yepanywhere 0.1.0

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 (635) hide show
  1. package/bundled/@yep-anywhere/shared/dist/app-types.d.ts +229 -0
  2. package/bundled/@yep-anywhere/shared/dist/app-types.d.ts.map +1 -0
  3. package/bundled/@yep-anywhere/shared/dist/app-types.js +46 -0
  4. package/bundled/@yep-anywhere/shared/dist/app-types.js.map +1 -0
  5. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/DocumentContentSchema.d.ts +16 -0
  6. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/DocumentContentSchema.d.ts.map +1 -0
  7. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/DocumentContentSchema.js +17 -0
  8. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/DocumentContentSchema.js.map +1 -0
  9. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ImageContentSchema.d.ts +15 -0
  10. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ImageContentSchema.d.ts.map +1 -0
  11. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ImageContentSchema.js +10 -0
  12. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ImageContentSchema.js.map +1 -0
  13. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/TextContentSchema.d.ts +6 -0
  14. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/TextContentSchema.d.ts.map +1 -0
  15. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/TextContentSchema.js +6 -0
  16. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/TextContentSchema.js.map +1 -0
  17. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ThinkingContentSchema.d.ts +7 -0
  18. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ThinkingContentSchema.d.ts.map +1 -0
  19. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ThinkingContentSchema.js +7 -0
  20. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ThinkingContentSchema.js.map +1 -0
  21. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolResultContentSchema.d.ts +24 -0
  22. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolResultContentSchema.d.ts.map +1 -0
  23. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolResultContentSchema.js +13 -0
  24. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolResultContentSchema.js.map +1 -0
  25. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolUseContentSchema.d.ts +8 -0
  26. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolUseContentSchema.d.ts.map +1 -0
  27. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolUseContentSchema.js +8 -0
  28. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/content/ToolUseContentSchema.js.map +1 -0
  29. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.d.ts +78 -0
  30. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.d.ts.map +1 -0
  31. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.js +13 -0
  32. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.js.map +1 -0
  33. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.d.ts +18 -0
  34. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.d.ts.map +1 -0
  35. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.js +19 -0
  36. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.js.map +1 -0
  37. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/FileHistorySnapshotEntrySchema.d.ts +13 -0
  38. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/FileHistorySnapshotEntrySchema.d.ts.map +1 -0
  39. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/FileHistorySnapshotEntrySchema.js +14 -0
  40. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/FileHistorySnapshotEntrySchema.js.map +1 -0
  41. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.d.ts +68 -0
  42. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.d.ts.map +1 -0
  43. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.js +37 -0
  44. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.js.map +1 -0
  45. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SummaryEntrySchema.d.ts +8 -0
  46. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SummaryEntrySchema.d.ts.map +1 -0
  47. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SummaryEntrySchema.js +7 -0
  48. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SummaryEntrySchema.js.map +1 -0
  49. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.d.ts +52 -0
  50. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.d.ts.map +1 -0
  51. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.js +29 -0
  52. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.js.map +1 -0
  53. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.d.ts +72 -0
  54. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.d.ts.map +1 -0
  55. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.js +10 -0
  56. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.js.map +1 -0
  57. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/normalizeQueueOperationContent.d.ts +14 -0
  58. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/normalizeQueueOperationContent.d.ts.map +1 -0
  59. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/normalizeQueueOperationContent.js +39 -0
  60. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/normalizeQueueOperationContent.js.map +1 -0
  61. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.d.ts +15 -0
  62. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.d.ts.map +1 -0
  63. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.js +26 -0
  64. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.js.map +1 -0
  65. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.d.ts +566 -0
  66. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.d.ts.map +1 -0
  67. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.js +39 -0
  68. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.js.map +1 -0
  69. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.d.ts +93 -0
  70. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.d.ts.map +1 -0
  71. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.js +40 -0
  72. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.js.map +1 -0
  73. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/UserMessageSchema.d.ts +105 -0
  74. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/UserMessageSchema.d.ts.map +1 -0
  75. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/UserMessageSchema.js +20 -0
  76. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/UserMessageSchema.js.map +1 -0
  77. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/CommonToolSchema.d.ts +53 -0
  78. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/CommonToolSchema.d.ts.map +1 -0
  79. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/CommonToolSchema.js +54 -0
  80. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/CommonToolSchema.js.map +1 -0
  81. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/StructuredPatchSchema.d.ts +9 -0
  82. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/StructuredPatchSchema.d.ts.map +1 -0
  83. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/StructuredPatchSchema.js +9 -0
  84. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/StructuredPatchSchema.js.map +1 -0
  85. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/TodoSchema.d.ts +32 -0
  86. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/TodoSchema.d.ts.map +1 -0
  87. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/TodoSchema.js +12 -0
  88. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/TodoSchema.js.map +1 -0
  89. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.d.ts +288 -0
  90. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.d.ts.map +1 -0
  91. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.js +293 -0
  92. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.js.map +1 -0
  93. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/index.d.ts +83 -0
  94. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/index.d.ts.map +1 -0
  95. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/index.js +10 -0
  96. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/index.js.map +1 -0
  97. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/types.d.ts +42 -0
  98. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/types.d.ts.map +1 -0
  99. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/types.js +11 -0
  100. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/types.js.map +1 -0
  101. package/bundled/@yep-anywhere/shared/dist/codex-schema/content.d.ts +99 -0
  102. package/bundled/@yep-anywhere/shared/dist/codex-schema/content.d.ts.map +1 -0
  103. package/bundled/@yep-anywhere/shared/dist/codex-schema/content.js +64 -0
  104. package/bundled/@yep-anywhere/shared/dist/codex-schema/content.js.map +1 -0
  105. package/bundled/@yep-anywhere/shared/dist/codex-schema/index.d.ts +17 -0
  106. package/bundled/@yep-anywhere/shared/dist/codex-schema/index.d.ts.map +1 -0
  107. package/bundled/@yep-anywhere/shared/dist/codex-schema/index.js +17 -0
  108. package/bundled/@yep-anywhere/shared/dist/codex-schema/index.js.map +1 -0
  109. package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts +600 -0
  110. package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts.map +1 -0
  111. package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js +282 -0
  112. package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js.map +1 -0
  113. package/bundled/@yep-anywhere/shared/dist/codex-schema/types.d.ts +7 -0
  114. package/bundled/@yep-anywhere/shared/dist/codex-schema/types.d.ts.map +1 -0
  115. package/bundled/@yep-anywhere/shared/dist/codex-schema/types.js +6 -0
  116. package/bundled/@yep-anywhere/shared/dist/codex-schema/types.js.map +1 -0
  117. package/bundled/@yep-anywhere/shared/dist/dag.d.ts +35 -0
  118. package/bundled/@yep-anywhere/shared/dist/dag.d.ts.map +1 -0
  119. package/bundled/@yep-anywhere/shared/dist/dag.js +75 -0
  120. package/bundled/@yep-anywhere/shared/dist/dag.js.map +1 -0
  121. package/bundled/@yep-anywhere/shared/dist/filePathDetection.d.ts +72 -0
  122. package/bundled/@yep-anywhere/shared/dist/filePathDetection.d.ts.map +1 -0
  123. package/bundled/@yep-anywhere/shared/dist/filePathDetection.js +376 -0
  124. package/bundled/@yep-anywhere/shared/dist/filePathDetection.js.map +1 -0
  125. package/bundled/@yep-anywhere/shared/dist/gemini-schema/content.d.ts +95 -0
  126. package/bundled/@yep-anywhere/shared/dist/gemini-schema/content.d.ts.map +1 -0
  127. package/bundled/@yep-anywhere/shared/dist/gemini-schema/content.js +57 -0
  128. package/bundled/@yep-anywhere/shared/dist/gemini-schema/content.js.map +1 -0
  129. package/bundled/@yep-anywhere/shared/dist/gemini-schema/events.d.ts +174 -0
  130. package/bundled/@yep-anywhere/shared/dist/gemini-schema/events.d.ts.map +1 -0
  131. package/bundled/@yep-anywhere/shared/dist/gemini-schema/events.js +117 -0
  132. package/bundled/@yep-anywhere/shared/dist/gemini-schema/events.js.map +1 -0
  133. package/bundled/@yep-anywhere/shared/dist/gemini-schema/index.d.ts +18 -0
  134. package/bundled/@yep-anywhere/shared/dist/gemini-schema/index.d.ts.map +1 -0
  135. package/bundled/@yep-anywhere/shared/dist/gemini-schema/index.js +18 -0
  136. package/bundled/@yep-anywhere/shared/dist/gemini-schema/index.js.map +1 -0
  137. package/bundled/@yep-anywhere/shared/dist/gemini-schema/session.d.ts +267 -0
  138. package/bundled/@yep-anywhere/shared/dist/gemini-schema/session.d.ts.map +1 -0
  139. package/bundled/@yep-anywhere/shared/dist/gemini-schema/session.js +147 -0
  140. package/bundled/@yep-anywhere/shared/dist/gemini-schema/session.js.map +1 -0
  141. package/bundled/@yep-anywhere/shared/dist/gemini-schema/types.d.ts +7 -0
  142. package/bundled/@yep-anywhere/shared/dist/gemini-schema/types.d.ts.map +1 -0
  143. package/bundled/@yep-anywhere/shared/dist/gemini-schema/types.js +6 -0
  144. package/bundled/@yep-anywhere/shared/dist/gemini-schema/types.js.map +1 -0
  145. package/bundled/@yep-anywhere/shared/dist/ideMetadata.d.ts +30 -0
  146. package/bundled/@yep-anywhere/shared/dist/ideMetadata.d.ts.map +1 -0
  147. package/bundled/@yep-anywhere/shared/dist/ideMetadata.js +58 -0
  148. package/bundled/@yep-anywhere/shared/dist/ideMetadata.js.map +1 -0
  149. package/bundled/@yep-anywhere/shared/dist/index.d.ts +24 -0
  150. package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -0
  151. package/bundled/@yep-anywhere/shared/dist/index.js +17 -0
  152. package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -0
  153. package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.d.ts +457 -0
  154. package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.d.ts.map +1 -0
  155. package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.js +217 -0
  156. package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.js.map +1 -0
  157. package/bundled/@yep-anywhere/shared/dist/opencode-schema/index.d.ts +23 -0
  158. package/bundled/@yep-anywhere/shared/dist/opencode-schema/index.d.ts.map +1 -0
  159. package/bundled/@yep-anywhere/shared/dist/opencode-schema/index.js +23 -0
  160. package/bundled/@yep-anywhere/shared/dist/opencode-schema/index.js.map +1 -0
  161. package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.d.ts +149 -0
  162. package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.d.ts.map +1 -0
  163. package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.js +158 -0
  164. package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.js.map +1 -0
  165. package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.d.ts +7 -0
  166. package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.d.ts.map +1 -0
  167. package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.js +6 -0
  168. package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.js.map +1 -0
  169. package/bundled/@yep-anywhere/shared/dist/projectId.d.ts +48 -0
  170. package/bundled/@yep-anywhere/shared/dist/projectId.d.ts.map +1 -0
  171. package/bundled/@yep-anywhere/shared/dist/projectId.js +74 -0
  172. package/bundled/@yep-anywhere/shared/dist/projectId.js.map +1 -0
  173. package/bundled/@yep-anywhere/shared/dist/session/SessionView.d.ts +171 -0
  174. package/bundled/@yep-anywhere/shared/dist/session/SessionView.d.ts.map +1 -0
  175. package/bundled/@yep-anywhere/shared/dist/session/SessionView.js +189 -0
  176. package/bundled/@yep-anywhere/shared/dist/session/SessionView.js.map +1 -0
  177. package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.d.ts +31 -0
  178. package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.d.ts.map +1 -0
  179. package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.js +2 -0
  180. package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.js.map +1 -0
  181. package/bundled/@yep-anywhere/shared/dist/session/index.d.ts +3 -0
  182. package/bundled/@yep-anywhere/shared/dist/session/index.d.ts.map +1 -0
  183. package/bundled/@yep-anywhere/shared/dist/session/index.js +2 -0
  184. package/bundled/@yep-anywhere/shared/dist/session/index.js.map +1 -0
  185. package/bundled/@yep-anywhere/shared/dist/types.d.ts +172 -0
  186. package/bundled/@yep-anywhere/shared/dist/types.d.ts.map +1 -0
  187. package/bundled/@yep-anywhere/shared/dist/types.js +33 -0
  188. package/bundled/@yep-anywhere/shared/dist/types.js.map +1 -0
  189. package/bundled/@yep-anywhere/shared/dist/upload.d.ts +58 -0
  190. package/bundled/@yep-anywhere/shared/dist/upload.d.ts.map +1 -0
  191. package/bundled/@yep-anywhere/shared/dist/upload.js +6 -0
  192. package/bundled/@yep-anywhere/shared/dist/upload.js.map +1 -0
  193. package/bundled/@yep-anywhere/shared/package.json +7 -0
  194. package/client-dist/assets/index-C7DeAWG4.css +1 -0
  195. package/client-dist/assets/index-yX0HPwrz.js +147 -0
  196. package/client-dist/badge-96.png +0 -0
  197. package/client-dist/badge.svg +20 -0
  198. package/client-dist/debug-streaming.html +746 -0
  199. package/client-dist/favicon.ico +0 -0
  200. package/client-dist/icon-192.png +0 -0
  201. package/client-dist/icon-512.png +0 -0
  202. package/client-dist/icon.svg +27 -0
  203. package/client-dist/index.html +35 -0
  204. package/client-dist/manifest.json +23 -0
  205. package/client-dist/sw.js +482 -0
  206. package/dist/app.d.ts +67 -0
  207. package/dist/app.d.ts.map +1 -0
  208. package/dist/app.js +236 -0
  209. package/dist/app.js.map +1 -0
  210. package/dist/augments/augment-generator.d.ts +30 -0
  211. package/dist/augments/augment-generator.d.ts.map +1 -0
  212. package/dist/augments/augment-generator.js +171 -0
  213. package/dist/augments/augment-generator.js.map +1 -0
  214. package/dist/augments/block-detector.d.ts +81 -0
  215. package/dist/augments/block-detector.d.ts.map +1 -0
  216. package/dist/augments/block-detector.js +615 -0
  217. package/dist/augments/block-detector.js.map +1 -0
  218. package/dist/augments/edit-augments.d.ts +138 -0
  219. package/dist/augments/edit-augments.d.ts.map +1 -0
  220. package/dist/augments/edit-augments.js +665 -0
  221. package/dist/augments/edit-augments.js.map +1 -0
  222. package/dist/augments/index.d.ts +14 -0
  223. package/dist/augments/index.d.ts.map +1 -0
  224. package/dist/augments/index.js +20 -0
  225. package/dist/augments/index.js.map +1 -0
  226. package/dist/augments/markdown-augments.d.ts +33 -0
  227. package/dist/augments/markdown-augments.d.ts.map +1 -0
  228. package/dist/augments/markdown-augments.js +128 -0
  229. package/dist/augments/markdown-augments.js.map +1 -0
  230. package/dist/augments/read-augments.d.ts +40 -0
  231. package/dist/augments/read-augments.d.ts.map +1 -0
  232. package/dist/augments/read-augments.js +64 -0
  233. package/dist/augments/read-augments.js.map +1 -0
  234. package/dist/augments/stream-coordinator.d.ts +32 -0
  235. package/dist/augments/stream-coordinator.d.ts.map +1 -0
  236. package/dist/augments/stream-coordinator.js +115 -0
  237. package/dist/augments/stream-coordinator.js.map +1 -0
  238. package/dist/augments/write-augments.d.ts +32 -0
  239. package/dist/augments/write-augments.d.ts.map +1 -0
  240. package/dist/augments/write-augments.js +27 -0
  241. package/dist/augments/write-augments.js.map +1 -0
  242. package/dist/auth/AuthService.d.ts +98 -0
  243. package/dist/auth/AuthService.d.ts.map +1 -0
  244. package/dist/auth/AuthService.js +217 -0
  245. package/dist/auth/AuthService.js.map +1 -0
  246. package/dist/auth/index.d.ts +3 -0
  247. package/dist/auth/index.d.ts.map +1 -0
  248. package/dist/auth/index.js +3 -0
  249. package/dist/auth/index.js.map +1 -0
  250. package/dist/auth/routes.d.ts +13 -0
  251. package/dist/auth/routes.d.ts.map +1 -0
  252. package/dist/auth/routes.js +149 -0
  253. package/dist/auth/routes.js.map +1 -0
  254. package/dist/cli.d.ts +19 -0
  255. package/dist/cli.d.ts.map +1 -0
  256. package/dist/cli.js +152 -0
  257. package/dist/cli.js.map +1 -0
  258. package/dist/config.d.ts +76 -0
  259. package/dist/config.d.ts.map +1 -0
  260. package/dist/config.js +124 -0
  261. package/dist/config.js.map +1 -0
  262. package/dist/dev-mock.d.ts +18 -0
  263. package/dist/dev-mock.d.ts.map +1 -0
  264. package/dist/dev-mock.js +260 -0
  265. package/dist/dev-mock.js.map +1 -0
  266. package/dist/frontend/index.d.ts +10 -0
  267. package/dist/frontend/index.d.ts.map +1 -0
  268. package/dist/frontend/index.js +10 -0
  269. package/dist/frontend/index.js.map +1 -0
  270. package/dist/frontend/proxy.d.ts +70 -0
  271. package/dist/frontend/proxy.d.ts.map +1 -0
  272. package/dist/frontend/proxy.js +329 -0
  273. package/dist/frontend/proxy.js.map +1 -0
  274. package/dist/frontend/static.d.ts +16 -0
  275. package/dist/frontend/static.d.ts.map +1 -0
  276. package/dist/frontend/static.js +106 -0
  277. package/dist/frontend/static.js.map +1 -0
  278. package/dist/highlighting/index.d.ts +43 -0
  279. package/dist/highlighting/index.d.ts.map +1 -0
  280. package/dist/highlighting/index.js +224 -0
  281. package/dist/highlighting/index.js.map +1 -0
  282. package/dist/index.d.ts +2 -0
  283. package/dist/index.d.ts.map +1 -0
  284. package/dist/index.js +259 -0
  285. package/dist/index.js.map +1 -0
  286. package/dist/indexes/SessionIndexService.d.ts +106 -0
  287. package/dist/indexes/SessionIndexService.d.ts.map +1 -0
  288. package/dist/indexes/SessionIndexService.js +356 -0
  289. package/dist/indexes/SessionIndexService.js.map +1 -0
  290. package/dist/indexes/index.d.ts +3 -0
  291. package/dist/indexes/index.d.ts.map +1 -0
  292. package/dist/indexes/index.js +2 -0
  293. package/dist/indexes/index.js.map +1 -0
  294. package/dist/indexes/types.d.ts +55 -0
  295. package/dist/indexes/types.d.ts.map +1 -0
  296. package/dist/indexes/types.js +8 -0
  297. package/dist/indexes/types.js.map +1 -0
  298. package/dist/logging/index.d.ts +2 -0
  299. package/dist/logging/index.d.ts.map +1 -0
  300. package/dist/logging/index.js +2 -0
  301. package/dist/logging/index.js.map +1 -0
  302. package/dist/logging/logger.d.ts +81 -0
  303. package/dist/logging/logger.d.ts.map +1 -0
  304. package/dist/logging/logger.js +257 -0
  305. package/dist/logging/logger.js.map +1 -0
  306. package/dist/maintenance/debug-routes.d.ts +39 -0
  307. package/dist/maintenance/debug-routes.d.ts.map +1 -0
  308. package/dist/maintenance/debug-routes.js +561 -0
  309. package/dist/maintenance/debug-routes.js.map +1 -0
  310. package/dist/maintenance/index.d.ts +3 -0
  311. package/dist/maintenance/index.d.ts.map +1 -0
  312. package/dist/maintenance/index.js +3 -0
  313. package/dist/maintenance/index.js.map +1 -0
  314. package/dist/maintenance/server.d.ts +53 -0
  315. package/dist/maintenance/server.d.ts.map +1 -0
  316. package/dist/maintenance/server.js +419 -0
  317. package/dist/maintenance/server.js.map +1 -0
  318. package/dist/metadata/SessionMetadataService.d.ts +96 -0
  319. package/dist/metadata/SessionMetadataService.d.ts.map +1 -0
  320. package/dist/metadata/SessionMetadataService.js +209 -0
  321. package/dist/metadata/SessionMetadataService.js.map +1 -0
  322. package/dist/metadata/index.d.ts +2 -0
  323. package/dist/metadata/index.d.ts.map +1 -0
  324. package/dist/metadata/index.js +2 -0
  325. package/dist/metadata/index.js.map +1 -0
  326. package/dist/middleware/auth.d.ts +18 -0
  327. package/dist/middleware/auth.d.ts.map +1 -0
  328. package/dist/middleware/auth.js +53 -0
  329. package/dist/middleware/auth.js.map +1 -0
  330. package/dist/middleware/security.d.ts +4 -0
  331. package/dist/middleware/security.d.ts.map +1 -0
  332. package/dist/middleware/security.js +28 -0
  333. package/dist/middleware/security.js.map +1 -0
  334. package/dist/notifications/NotificationService.d.ts +76 -0
  335. package/dist/notifications/NotificationService.d.ts.map +1 -0
  336. package/dist/notifications/NotificationService.js +155 -0
  337. package/dist/notifications/NotificationService.js.map +1 -0
  338. package/dist/notifications/index.d.ts +2 -0
  339. package/dist/notifications/index.d.ts.map +1 -0
  340. package/dist/notifications/index.js +2 -0
  341. package/dist/notifications/index.js.map +1 -0
  342. package/dist/projects/codex-scanner.d.ts +52 -0
  343. package/dist/projects/codex-scanner.d.ts.map +1 -0
  344. package/dist/projects/codex-scanner.js +167 -0
  345. package/dist/projects/codex-scanner.js.map +1 -0
  346. package/dist/projects/gemini-project-map.d.ts +54 -0
  347. package/dist/projects/gemini-project-map.d.ts.map +1 -0
  348. package/dist/projects/gemini-project-map.js +116 -0
  349. package/dist/projects/gemini-project-map.js.map +1 -0
  350. package/dist/projects/gemini-scanner.d.ts +58 -0
  351. package/dist/projects/gemini-scanner.d.ts.map +1 -0
  352. package/dist/projects/gemini-scanner.js +210 -0
  353. package/dist/projects/gemini-scanner.js.map +1 -0
  354. package/dist/projects/index.d.ts +16 -0
  355. package/dist/projects/index.d.ts.map +1 -0
  356. package/dist/projects/index.js +17 -0
  357. package/dist/projects/index.js.map +1 -0
  358. package/dist/projects/paths.d.ts +127 -0
  359. package/dist/projects/paths.d.ts.map +1 -0
  360. package/dist/projects/paths.js +185 -0
  361. package/dist/projects/paths.js.map +1 -0
  362. package/dist/projects/scanner.d.ts +45 -0
  363. package/dist/projects/scanner.d.ts.map +1 -0
  364. package/dist/projects/scanner.js +287 -0
  365. package/dist/projects/scanner.js.map +1 -0
  366. package/dist/push/PushNotifier.d.ts +48 -0
  367. package/dist/push/PushNotifier.d.ts.map +1 -0
  368. package/dist/push/PushNotifier.js +145 -0
  369. package/dist/push/PushNotifier.js.map +1 -0
  370. package/dist/push/PushService.d.ts +95 -0
  371. package/dist/push/PushService.d.ts.map +1 -0
  372. package/dist/push/PushService.js +245 -0
  373. package/dist/push/PushService.js.map +1 -0
  374. package/dist/push/index.d.ts +9 -0
  375. package/dist/push/index.d.ts.map +1 -0
  376. package/dist/push/index.js +8 -0
  377. package/dist/push/index.js.map +1 -0
  378. package/dist/push/routes.d.ts +10 -0
  379. package/dist/push/routes.d.ts.map +1 -0
  380. package/dist/push/routes.js +111 -0
  381. package/dist/push/routes.js.map +1 -0
  382. package/dist/push/types.d.ts +80 -0
  383. package/dist/push/types.d.ts.map +1 -0
  384. package/dist/push/types.js +5 -0
  385. package/dist/push/types.js.map +1 -0
  386. package/dist/push/vapid.d.ts +42 -0
  387. package/dist/push/vapid.d.ts.map +1 -0
  388. package/dist/push/vapid.js +132 -0
  389. package/dist/push/vapid.js.map +1 -0
  390. package/dist/recents/RecentsService.d.ts +77 -0
  391. package/dist/recents/RecentsService.d.ts.map +1 -0
  392. package/dist/recents/RecentsService.js +155 -0
  393. package/dist/recents/RecentsService.js.map +1 -0
  394. package/dist/recents/index.d.ts +2 -0
  395. package/dist/recents/index.d.ts.map +1 -0
  396. package/dist/recents/index.js +2 -0
  397. package/dist/recents/index.js.map +1 -0
  398. package/dist/routes/activity.d.ts +7 -0
  399. package/dist/routes/activity.d.ts.map +1 -0
  400. package/dist/routes/activity.js +80 -0
  401. package/dist/routes/activity.js.map +1 -0
  402. package/dist/routes/beads.d.ts +42 -0
  403. package/dist/routes/beads.d.ts.map +1 -0
  404. package/dist/routes/beads.js +101 -0
  405. package/dist/routes/beads.js.map +1 -0
  406. package/dist/routes/debug-streaming.d.ts +7 -0
  407. package/dist/routes/debug-streaming.d.ts.map +1 -0
  408. package/dist/routes/debug-streaming.js +88 -0
  409. package/dist/routes/debug-streaming.js.map +1 -0
  410. package/dist/routes/dev.d.ts +11 -0
  411. package/dist/routes/dev.d.ts.map +1 -0
  412. package/dist/routes/dev.js +55 -0
  413. package/dist/routes/dev.js.map +1 -0
  414. package/dist/routes/files.d.ts +7 -0
  415. package/dist/routes/files.d.ts.map +1 -0
  416. package/dist/routes/files.js +429 -0
  417. package/dist/routes/files.js.map +1 -0
  418. package/dist/routes/global-sessions.d.ts +76 -0
  419. package/dist/routes/global-sessions.d.ts.map +1 -0
  420. package/dist/routes/global-sessions.js +207 -0
  421. package/dist/routes/global-sessions.js.map +1 -0
  422. package/dist/routes/health.d.ts +3 -0
  423. package/dist/routes/health.d.ts.map +1 -0
  424. package/dist/routes/health.js +6 -0
  425. package/dist/routes/health.js.map +1 -0
  426. package/dist/routes/inbox.d.ts +45 -0
  427. package/dist/routes/inbox.d.ts.map +1 -0
  428. package/dist/routes/inbox.js +174 -0
  429. package/dist/routes/inbox.js.map +1 -0
  430. package/dist/routes/processes.d.ts +16 -0
  431. package/dist/routes/processes.d.ts.map +1 -0
  432. package/dist/routes/processes.js +82 -0
  433. package/dist/routes/processes.js.map +1 -0
  434. package/dist/routes/projects.d.ts +30 -0
  435. package/dist/routes/projects.d.ts.map +1 -0
  436. package/dist/routes/projects.js +316 -0
  437. package/dist/routes/projects.js.map +1 -0
  438. package/dist/routes/providers.d.ts +9 -0
  439. package/dist/routes/providers.d.ts.map +1 -0
  440. package/dist/routes/providers.js +63 -0
  441. package/dist/routes/providers.js.map +1 -0
  442. package/dist/routes/recents.d.ts +14 -0
  443. package/dist/routes/recents.d.ts.map +1 -0
  444. package/dist/routes/recents.js +82 -0
  445. package/dist/routes/recents.js.map +1 -0
  446. package/dist/routes/sessions.d.ts +26 -0
  447. package/dist/routes/sessions.d.ts.map +1 -0
  448. package/dist/routes/sessions.js +962 -0
  449. package/dist/routes/sessions.js.map +1 -0
  450. package/dist/routes/stream.d.ts +7 -0
  451. package/dist/routes/stream.d.ts.map +1 -0
  452. package/dist/routes/stream.js +561 -0
  453. package/dist/routes/stream.js.map +1 -0
  454. package/dist/routes/upload.d.ts +14 -0
  455. package/dist/routes/upload.d.ts.map +1 -0
  456. package/dist/routes/upload.js +278 -0
  457. package/dist/routes/upload.js.map +1 -0
  458. package/dist/sdk/cli-detection.d.ts +47 -0
  459. package/dist/sdk/cli-detection.d.ts.map +1 -0
  460. package/dist/sdk/cli-detection.js +122 -0
  461. package/dist/sdk/cli-detection.js.map +1 -0
  462. package/dist/sdk/messageLogger.d.ts +15 -0
  463. package/dist/sdk/messageLogger.d.ts.map +1 -0
  464. package/dist/sdk/messageLogger.js +68 -0
  465. package/dist/sdk/messageLogger.js.map +1 -0
  466. package/dist/sdk/messageQueue.d.ts +49 -0
  467. package/dist/sdk/messageQueue.d.ts.map +1 -0
  468. package/dist/sdk/messageQueue.js +186 -0
  469. package/dist/sdk/messageQueue.js.map +1 -0
  470. package/dist/sdk/mock.d.ts +16 -0
  471. package/dist/sdk/mock.d.ts.map +1 -0
  472. package/dist/sdk/mock.js +81 -0
  473. package/dist/sdk/mock.js.map +1 -0
  474. package/dist/sdk/providers/__mocks__/base.d.ts +78 -0
  475. package/dist/sdk/providers/__mocks__/base.d.ts.map +1 -0
  476. package/dist/sdk/providers/__mocks__/base.js +185 -0
  477. package/dist/sdk/providers/__mocks__/base.js.map +1 -0
  478. package/dist/sdk/providers/__mocks__/claude.d.ts +33 -0
  479. package/dist/sdk/providers/__mocks__/claude.d.ts.map +1 -0
  480. package/dist/sdk/providers/__mocks__/claude.js +146 -0
  481. package/dist/sdk/providers/__mocks__/claude.js.map +1 -0
  482. package/dist/sdk/providers/__mocks__/codex.d.ts +45 -0
  483. package/dist/sdk/providers/__mocks__/codex.d.ts.map +1 -0
  484. package/dist/sdk/providers/__mocks__/codex.js +160 -0
  485. package/dist/sdk/providers/__mocks__/codex.js.map +1 -0
  486. package/dist/sdk/providers/__mocks__/factory.d.ts +40 -0
  487. package/dist/sdk/providers/__mocks__/factory.d.ts.map +1 -0
  488. package/dist/sdk/providers/__mocks__/factory.js +183 -0
  489. package/dist/sdk/providers/__mocks__/factory.js.map +1 -0
  490. package/dist/sdk/providers/__mocks__/gemini.d.ts +43 -0
  491. package/dist/sdk/providers/__mocks__/gemini.d.ts.map +1 -0
  492. package/dist/sdk/providers/__mocks__/gemini.js +198 -0
  493. package/dist/sdk/providers/__mocks__/gemini.js.map +1 -0
  494. package/dist/sdk/providers/__mocks__/index.d.ts +23 -0
  495. package/dist/sdk/providers/__mocks__/index.d.ts.map +1 -0
  496. package/dist/sdk/providers/__mocks__/index.js +25 -0
  497. package/dist/sdk/providers/__mocks__/index.js.map +1 -0
  498. package/dist/sdk/providers/__mocks__/opencode.d.ts +33 -0
  499. package/dist/sdk/providers/__mocks__/opencode.d.ts.map +1 -0
  500. package/dist/sdk/providers/__mocks__/opencode.js +136 -0
  501. package/dist/sdk/providers/__mocks__/opencode.js.map +1 -0
  502. package/dist/sdk/providers/__mocks__/types.d.ts +50 -0
  503. package/dist/sdk/providers/__mocks__/types.d.ts.map +1 -0
  504. package/dist/sdk/providers/__mocks__/types.js +8 -0
  505. package/dist/sdk/providers/__mocks__/types.js.map +1 -0
  506. package/dist/sdk/providers/claude.d.ts +63 -0
  507. package/dist/sdk/providers/claude.d.ts.map +1 -0
  508. package/dist/sdk/providers/claude.js +252 -0
  509. package/dist/sdk/providers/claude.js.map +1 -0
  510. package/dist/sdk/providers/codex-oss.d.ts +108 -0
  511. package/dist/sdk/providers/codex-oss.d.ts.map +1 -0
  512. package/dist/sdk/providers/codex-oss.js +744 -0
  513. package/dist/sdk/providers/codex-oss.js.map +1 -0
  514. package/dist/sdk/providers/codex.d.ts +82 -0
  515. package/dist/sdk/providers/codex.d.ts.map +1 -0
  516. package/dist/sdk/providers/codex.js +597 -0
  517. package/dist/sdk/providers/codex.js.map +1 -0
  518. package/dist/sdk/providers/gemini.d.ts +78 -0
  519. package/dist/sdk/providers/gemini.d.ts.map +1 -0
  520. package/dist/sdk/providers/gemini.js +536 -0
  521. package/dist/sdk/providers/gemini.js.map +1 -0
  522. package/dist/sdk/providers/index.d.ts +22 -0
  523. package/dist/sdk/providers/index.d.ts.map +1 -0
  524. package/dist/sdk/providers/index.js +53 -0
  525. package/dist/sdk/providers/index.js.map +1 -0
  526. package/dist/sdk/providers/opencode.d.ts +95 -0
  527. package/dist/sdk/providers/opencode.d.ts.map +1 -0
  528. package/dist/sdk/providers/opencode.js +586 -0
  529. package/dist/sdk/providers/opencode.js.map +1 -0
  530. package/dist/sdk/providers/types.d.ts +99 -0
  531. package/dist/sdk/providers/types.d.ts.map +1 -0
  532. package/dist/sdk/providers/types.js +2 -0
  533. package/dist/sdk/providers/types.js.map +1 -0
  534. package/dist/sdk/real.d.ts +20 -0
  535. package/dist/sdk/real.d.ts.map +1 -0
  536. package/dist/sdk/real.js +22 -0
  537. package/dist/sdk/real.js.map +1 -0
  538. package/dist/sdk/types.d.ts +113 -0
  539. package/dist/sdk/types.d.ts.map +1 -0
  540. package/dist/sdk/types.js +3 -0
  541. package/dist/sdk/types.js.map +1 -0
  542. package/dist/sessions/Session.d.ts +80 -0
  543. package/dist/sessions/Session.d.ts.map +1 -0
  544. package/dist/sessions/Session.js +119 -0
  545. package/dist/sessions/Session.js.map +1 -0
  546. package/dist/sessions/codex-reader.d.ts +166 -0
  547. package/dist/sessions/codex-reader.d.ts.map +1 -0
  548. package/dist/sessions/codex-reader.js +664 -0
  549. package/dist/sessions/codex-reader.js.map +1 -0
  550. package/dist/sessions/dag.d.ts +62 -0
  551. package/dist/sessions/dag.d.ts.map +1 -0
  552. package/dist/sessions/dag.js +175 -0
  553. package/dist/sessions/dag.js.map +1 -0
  554. package/dist/sessions/fork.d.ts +34 -0
  555. package/dist/sessions/fork.d.ts.map +1 -0
  556. package/dist/sessions/fork.js +58 -0
  557. package/dist/sessions/fork.js.map +1 -0
  558. package/dist/sessions/gemini-reader.d.ts +103 -0
  559. package/dist/sessions/gemini-reader.d.ts.map +1 -0
  560. package/dist/sessions/gemini-reader.js +332 -0
  561. package/dist/sessions/gemini-reader.js.map +1 -0
  562. package/dist/sessions/normalization.d.ts +7 -0
  563. package/dist/sessions/normalization.d.ts.map +1 -0
  564. package/dist/sessions/normalization.js +429 -0
  565. package/dist/sessions/normalization.js.map +1 -0
  566. package/dist/sessions/opencode-reader.d.ts +99 -0
  567. package/dist/sessions/opencode-reader.d.ts.map +1 -0
  568. package/dist/sessions/opencode-reader.js +370 -0
  569. package/dist/sessions/opencode-reader.js.map +1 -0
  570. package/dist/sessions/reader.d.ts +118 -0
  571. package/dist/sessions/reader.d.ts.map +1 -0
  572. package/dist/sessions/reader.js +444 -0
  573. package/dist/sessions/reader.js.map +1 -0
  574. package/dist/sessions/types.d.ts +77 -0
  575. package/dist/sessions/types.d.ts.map +1 -0
  576. package/dist/sessions/types.js +8 -0
  577. package/dist/sessions/types.js.map +1 -0
  578. package/dist/supervisor/ExternalSessionTracker.d.ts +94 -0
  579. package/dist/supervisor/ExternalSessionTracker.d.ts.map +1 -0
  580. package/dist/supervisor/ExternalSessionTracker.js +507 -0
  581. package/dist/supervisor/ExternalSessionTracker.js.map +1 -0
  582. package/dist/supervisor/Process.d.ts +230 -0
  583. package/dist/supervisor/Process.d.ts.map +1 -0
  584. package/dist/supervisor/Process.js +878 -0
  585. package/dist/supervisor/Process.js.map +1 -0
  586. package/dist/supervisor/Supervisor.d.ts +191 -0
  587. package/dist/supervisor/Supervisor.d.ts.map +1 -0
  588. package/dist/supervisor/Supervisor.js +933 -0
  589. package/dist/supervisor/Supervisor.js.map +1 -0
  590. package/dist/supervisor/WorkerQueue.d.ts +113 -0
  591. package/dist/supervisor/WorkerQueue.d.ts.map +1 -0
  592. package/dist/supervisor/WorkerQueue.js +148 -0
  593. package/dist/supervisor/WorkerQueue.js.map +1 -0
  594. package/dist/supervisor/types.d.ts +176 -0
  595. package/dist/supervisor/types.d.ts.map +1 -0
  596. package/dist/supervisor/types.js +7 -0
  597. package/dist/supervisor/types.js.map +1 -0
  598. package/dist/testing/mockProjectData.d.ts +5 -0
  599. package/dist/testing/mockProjectData.d.ts.map +1 -0
  600. package/dist/testing/mockProjectData.js +27 -0
  601. package/dist/testing/mockProjectData.js.map +1 -0
  602. package/dist/uploads/index.d.ts +3 -0
  603. package/dist/uploads/index.d.ts.map +1 -0
  604. package/dist/uploads/index.js +2 -0
  605. package/dist/uploads/index.js.map +1 -0
  606. package/dist/uploads/manager.d.ts +84 -0
  607. package/dist/uploads/manager.d.ts.map +1 -0
  608. package/dist/uploads/manager.js +215 -0
  609. package/dist/uploads/manager.js.map +1 -0
  610. package/dist/utils/fileLock.d.ts +57 -0
  611. package/dist/utils/fileLock.d.ts.map +1 -0
  612. package/dist/utils/fileLock.js +91 -0
  613. package/dist/utils/fileLock.js.map +1 -0
  614. package/dist/watcher/BatchProcessor.d.ts +58 -0
  615. package/dist/watcher/BatchProcessor.d.ts.map +1 -0
  616. package/dist/watcher/BatchProcessor.js +105 -0
  617. package/dist/watcher/BatchProcessor.js.map +1 -0
  618. package/dist/watcher/EventBus.d.ts +157 -0
  619. package/dist/watcher/EventBus.d.ts.map +1 -0
  620. package/dist/watcher/EventBus.js +36 -0
  621. package/dist/watcher/EventBus.js.map +1 -0
  622. package/dist/watcher/FileWatcher.d.ts +42 -0
  623. package/dist/watcher/FileWatcher.d.ts.map +1 -0
  624. package/dist/watcher/FileWatcher.js +165 -0
  625. package/dist/watcher/FileWatcher.js.map +1 -0
  626. package/dist/watcher/SourceWatcher.d.ts +36 -0
  627. package/dist/watcher/SourceWatcher.d.ts.map +1 -0
  628. package/dist/watcher/SourceWatcher.js +97 -0
  629. package/dist/watcher/SourceWatcher.js.map +1 -0
  630. package/dist/watcher/index.d.ts +9 -0
  631. package/dist/watcher/index.d.ts.map +1 -0
  632. package/dist/watcher/index.js +5 -0
  633. package/dist/watcher/index.js.map +1 -0
  634. package/package.json +54 -0
  635. package/scripts/postinstall.js +48 -0
@@ -0,0 +1,147 @@
1
+ var kS=Object.defineProperty;var TS=(t,s,i)=>s in t?kS(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i;var Ke=(t,s,i)=>TS(t,typeof s!="symbol"?s+"":s,i);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))r(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&r(f)}).observe(document,{childList:!0,subtree:!0});function i(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(c){if(c.ep)return;c.ep=!0;const u=i(c);fetch(c.href,u)}})();var Lu={exports:{}},Sl={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var $p;function CS(){if($p)return Sl;$p=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function i(r,c,u){var f=null;if(u!==void 0&&(f=""+u),c.key!==void 0&&(f=""+c.key),"key"in c){u={};for(var p in c)p!=="key"&&(u[p]=c[p])}else u=c;return c=u.ref,{$$typeof:t,type:r,key:f,ref:c!==void 0?c:null,props:u}}return Sl.Fragment=s,Sl.jsx=i,Sl.jsxs=i,Sl}var Bp;function RS(){return Bp||(Bp=1,Lu.exports=CS()),Lu.exports}var l=RS(),Uu={exports:{}},Me={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Ip;function AS(){if(Ip)return Me;Ip=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),S=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=S&&A[S]||A["@@iterator"],typeof A=="function"?A:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,j={};function R(A,Y,X){this.props=A,this.context=Y,this.refs=j,this.updater=X||_}R.prototype.isReactComponent={},R.prototype.setState=function(A,Y){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,Y,"setState")},R.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function C(){}C.prototype=R.prototype;function z(A,Y,X){this.props=A,this.context=Y,this.refs=j,this.updater=X||_}var H=z.prototype=new C;H.constructor=z,N(H,R.prototype),H.isPureReactComponent=!0;var T=Array.isArray;function O(){}var D={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function ne(A,Y,X){var ae=X.ref;return{$$typeof:t,type:A,key:Y,ref:ae!==void 0?ae:null,props:X}}function ce(A,Y){return ne(A.type,Y,A.props)}function de(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function q(A){var Y={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(X){return Y[X]})}var Q=/\/+/g;function le(A,Y){return typeof A=="object"&&A!==null&&A.key!=null?q(""+A.key):Y.toString(36)}function ue(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(O,O):(A.status="pending",A.then(function(Y){A.status==="pending"&&(A.status="fulfilled",A.value=Y)},function(Y){A.status==="pending"&&(A.status="rejected",A.reason=Y)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function k(A,Y,X,ae,fe){var ie=typeof A;(ie==="undefined"||ie==="boolean")&&(A=null);var ve=!1;if(A===null)ve=!0;else switch(ie){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(A.$$typeof){case t:case s:ve=!0;break;case y:return ve=A._init,k(ve(A._payload),Y,X,ae,fe)}}if(ve)return fe=fe(A),ve=ae===""?"."+le(A,0):ae,T(fe)?(X="",ve!=null&&(X=ve.replace(Q,"$&/")+"/"),k(fe,Y,X,"",function(xe){return xe})):fe!=null&&(de(fe)&&(fe=ce(fe,X+(fe.key==null||A&&A.key===fe.key?"":(""+fe.key).replace(Q,"$&/")+"/")+ve)),Y.push(fe)),1;ve=0;var Ae=ae===""?".":ae+":";if(T(A))for(var be=0;be<A.length;be++)ae=A[be],ie=Ae+le(ae,be),ve+=k(ae,Y,X,ie,fe);else if(be=w(A),typeof be=="function")for(A=be.call(A),be=0;!(ae=A.next()).done;)ae=ae.value,ie=Ae+le(ae,be++),ve+=k(ae,Y,X,ie,fe);else if(ie==="object"){if(typeof A.then=="function")return k(ue(A),Y,X,ae,fe);throw Y=String(A),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return ve}function U(A,Y,X){if(A==null)return A;var ae=[],fe=0;return k(A,ae,"","",function(ie){return Y.call(X,ie,fe++)}),ae}function I(A){if(A._status===-1){var Y=A._result;Y=Y(),Y.then(function(X){(A._status===0||A._status===-1)&&(A._status=1,A._result=X)},function(X){(A._status===0||A._status===-1)&&(A._status=2,A._result=X)}),A._status===-1&&(A._status=0,A._result=Y)}if(A._status===1)return A._result.default;throw A._result}var oe=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},he={map:U,forEach:function(A,Y,X){U(A,function(){Y.apply(this,arguments)},X)},count:function(A){var Y=0;return U(A,function(){Y++}),Y},toArray:function(A){return U(A,function(Y){return Y})||[]},only:function(A){if(!de(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Me.Activity=b,Me.Children=he,Me.Component=R,Me.Fragment=i,Me.Profiler=c,Me.PureComponent=z,Me.StrictMode=r,Me.Suspense=g,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Me.__COMPILER_RUNTIME={__proto__:null,c:function(A){return D.H.useMemoCache(A)}},Me.cache=function(A){return function(){return A.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(A,Y,X){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var ae=N({},A.props),fe=A.key;if(Y!=null)for(ie in Y.key!==void 0&&(fe=""+Y.key),Y)!F.call(Y,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&Y.ref===void 0||(ae[ie]=Y[ie]);var ie=arguments.length-2;if(ie===1)ae.children=X;else if(1<ie){for(var ve=Array(ie),Ae=0;Ae<ie;Ae++)ve[Ae]=arguments[Ae+2];ae.children=ve}return ne(A.type,fe,ae)},Me.createContext=function(A){return A={$$typeof:f,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:u,_context:A},A},Me.createElement=function(A,Y,X){var ae,fe={},ie=null;if(Y!=null)for(ae in Y.key!==void 0&&(ie=""+Y.key),Y)F.call(Y,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(fe[ae]=Y[ae]);var ve=arguments.length-2;if(ve===1)fe.children=X;else if(1<ve){for(var Ae=Array(ve),be=0;be<ve;be++)Ae[be]=arguments[be+2];fe.children=Ae}if(A&&A.defaultProps)for(ae in ve=A.defaultProps,ve)fe[ae]===void 0&&(fe[ae]=ve[ae]);return ne(A,ie,fe)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(A){return{$$typeof:p,render:A}},Me.isValidElement=de,Me.lazy=function(A){return{$$typeof:y,_payload:{_status:-1,_result:A},_init:I}},Me.memo=function(A,Y){return{$$typeof:v,type:A,compare:Y===void 0?null:Y}},Me.startTransition=function(A){var Y=D.T,X={};D.T=X;try{var ae=A(),fe=D.S;fe!==null&&fe(X,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(O,oe)}catch(ie){oe(ie)}finally{Y!==null&&X.types!==null&&(Y.types=X.types),D.T=Y}},Me.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Me.use=function(A){return D.H.use(A)},Me.useActionState=function(A,Y,X){return D.H.useActionState(A,Y,X)},Me.useCallback=function(A,Y){return D.H.useCallback(A,Y)},Me.useContext=function(A){return D.H.useContext(A)},Me.useDebugValue=function(){},Me.useDeferredValue=function(A,Y){return D.H.useDeferredValue(A,Y)},Me.useEffect=function(A,Y){return D.H.useEffect(A,Y)},Me.useEffectEvent=function(A){return D.H.useEffectEvent(A)},Me.useId=function(){return D.H.useId()},Me.useImperativeHandle=function(A,Y,X){return D.H.useImperativeHandle(A,Y,X)},Me.useInsertionEffect=function(A,Y){return D.H.useInsertionEffect(A,Y)},Me.useLayoutEffect=function(A,Y){return D.H.useLayoutEffect(A,Y)},Me.useMemo=function(A,Y){return D.H.useMemo(A,Y)},Me.useOptimistic=function(A,Y){return D.H.useOptimistic(A,Y)},Me.useReducer=function(A,Y,X){return D.H.useReducer(A,Y,X)},Me.useRef=function(A){return D.H.useRef(A)},Me.useState=function(A){return D.H.useState(A)},Me.useSyncExternalStore=function(A,Y,X){return D.H.useSyncExternalStore(A,Y,X)},Me.useTransition=function(){return D.H.useTransition()},Me.version="19.2.3",Me}var Hp;function wd(){return Hp||(Hp=1,Uu.exports=AS()),Uu.exports}var m=wd(),$u={exports:{}},jl={},Bu={exports:{}},Iu={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Zp;function MS(){return Zp||(Zp=1,(function(t){function s(k,U){var I=k.length;k.push(U);e:for(;0<I;){var oe=I-1>>>1,he=k[oe];if(0<c(he,U))k[oe]=U,k[I]=he,I=oe;else break e}}function i(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var U=k[0],I=k.pop();if(I!==U){k[0]=I;e:for(var oe=0,he=k.length,A=he>>>1;oe<A;){var Y=2*(oe+1)-1,X=k[Y],ae=Y+1,fe=k[ae];if(0>c(X,I))ae<he&&0>c(fe,X)?(k[oe]=fe,k[ae]=I,oe=ae):(k[oe]=X,k[Y]=I,oe=Y);else if(ae<he&&0>c(fe,I))k[oe]=fe,k[ae]=I,oe=ae;else break e}}return U}function c(k,U){var I=k.sortIndex-U.sortIndex;return I!==0?I:k.id-U.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();t.unstable_now=function(){return f.now()-p}}var g=[],v=[],y=1,b=null,S=3,w=!1,_=!1,N=!1,j=!1,R=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function H(k){for(var U=i(v);U!==null;){if(U.callback===null)r(v);else if(U.startTime<=k)r(v),U.sortIndex=U.expirationTime,s(g,U);else break;U=i(v)}}function T(k){if(N=!1,H(k),!_)if(i(g)!==null)_=!0,O||(O=!0,q());else{var U=i(v);U!==null&&ue(T,U.startTime-k)}}var O=!1,D=-1,F=5,ne=-1;function ce(){return j?!0:!(t.unstable_now()-ne<F)}function de(){if(j=!1,O){var k=t.unstable_now();ne=k;var U=!0;try{e:{_=!1,N&&(N=!1,C(D),D=-1),w=!0;var I=S;try{t:{for(H(k),b=i(g);b!==null&&!(b.expirationTime>k&&ce());){var oe=b.callback;if(typeof oe=="function"){b.callback=null,S=b.priorityLevel;var he=oe(b.expirationTime<=k);if(k=t.unstable_now(),typeof he=="function"){b.callback=he,H(k),U=!0;break t}b===i(g)&&r(g),H(k)}else r(g);b=i(g)}if(b!==null)U=!0;else{var A=i(v);A!==null&&ue(T,A.startTime-k),U=!1}}break e}finally{b=null,S=I,w=!1}U=void 0}}finally{U?q():O=!1}}}var q;if(typeof z=="function")q=function(){z(de)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,le=Q.port2;Q.port1.onmessage=de,q=function(){le.postMessage(null)}}else q=function(){R(de,0)};function ue(k,U){D=R(function(){k(t.unstable_now())},U)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(k){k.callback=null},t.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<k?Math.floor(1e3/k):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_next=function(k){switch(S){case 1:case 2:case 3:var U=3;break;default:U=S}var I=S;S=U;try{return k()}finally{S=I}},t.unstable_requestPaint=function(){j=!0},t.unstable_runWithPriority=function(k,U){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var I=S;S=k;try{return U()}finally{S=I}},t.unstable_scheduleCallback=function(k,U,I){var oe=t.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?oe+I:oe):I=oe,k){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=I+he,k={id:y++,callback:U,priorityLevel:k,startTime:I,expirationTime:he,sortIndex:-1},I>oe?(k.sortIndex=I,s(v,k),i(g)===null&&k===i(v)&&(N?(C(D),D=-1):N=!0,ue(T,I-oe))):(k.sortIndex=he,s(g,k),_||w||(_=!0,O||(O=!0,q()))),k},t.unstable_shouldYield=ce,t.unstable_wrapCallback=function(k){var U=S;return function(){var I=S;S=U;try{return k.apply(this,arguments)}finally{S=I}}}})(Iu)),Iu}var qp;function zS(){return qp||(qp=1,Bu.exports=MS()),Bu.exports}var Hu={exports:{}},tn={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Pp;function OS(){if(Pp)return tn;Pp=1;var t=wd();function s(g){var v="https://react.dev/errors/"+g;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)v+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var r={d:{f:i,r:function(){throw Error(s(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},c=Symbol.for("react.portal");function u(g,v,y){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:b==null?null:""+b,children:g,containerInfo:v,implementation:y}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,v){if(g==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,tn.createPortal=function(g,v){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(s(299));return u(g,v,null,y)},tn.flushSync=function(g){var v=f.T,y=r.p;try{if(f.T=null,r.p=2,g)return g()}finally{f.T=v,r.p=y,r.d.f()}},tn.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,r.d.C(g,v))},tn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},tn.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var y=v.as,b=p(y,v.crossOrigin),S=typeof v.integrity=="string"?v.integrity:void 0,w=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;y==="style"?r.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:b,integrity:S,fetchPriority:w}):y==="script"&&r.d.X(g,{crossOrigin:b,integrity:S,fetchPriority:w,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},tn.preinitModule=function(g,v){if(typeof g=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var y=p(v.as,v.crossOrigin);r.d.M(g,{crossOrigin:y,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&r.d.M(g)},tn.preload=function(g,v){if(typeof g=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var y=v.as,b=p(y,v.crossOrigin);r.d.L(g,y,{crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},tn.preloadModule=function(g,v){if(typeof g=="string")if(v){var y=p(v.as,v.crossOrigin);r.d.m(g,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:y,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else r.d.m(g)},tn.requestFormReset=function(g){r.d.r(g)},tn.unstable_batchedUpdates=function(g,v){return g(v)},tn.useFormState=function(g,v,y){return f.H.useFormState(g,v,y)},tn.useFormStatus=function(){return f.H.useHostTransitionStatus()},tn.version="19.2.3",tn}var Vp;function lv(){if(Vp)return Hu.exports;Vp=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(s){console.error(s)}}return t(),Hu.exports=OS(),Hu.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Gp;function DS(){if(Gp)return jl;Gp=1;var t=zS(),s=wd(),i=lv();function r(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,a=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(a=n.return),e=n.return;while(e)}return n.tag===3?a:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(r(188))}function v(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(r(188));return n!==e?null:e}for(var a=e,o=n;;){var d=a.return;if(d===null)break;var h=d.alternate;if(h===null){if(o=d.return,o!==null){a=o;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===a)return g(d),e;if(h===o)return g(d),n;h=h.sibling}throw Error(r(188))}if(a.return!==o.return)a=d,o=h;else{for(var x=!1,E=d.child;E;){if(E===a){x=!0,a=d,o=h;break}if(E===o){x=!0,o=d,a=h;break}E=E.sibling}if(!x){for(E=h.child;E;){if(E===a){x=!0,a=h,o=d;break}if(E===o){x=!0,o=h,a=d;break}E=E.sibling}if(!x)throw Error(r(189))}}if(a.alternate!==o)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?e:n}function y(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=y(e),n!==null)return n;e=e.sibling}return null}var b=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),z=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),ce=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Symbol.for("react.client.reference");function le(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case R:return"Profiler";case j:return"StrictMode";case T:return"Suspense";case O:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case _:return"Portal";case z:return e.displayName||"Context";case C:return(e._context.displayName||"Context")+".Consumer";case H:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return n=e.displayName||null,n!==null?n:le(e.type)||"Memo";case F:n=e._payload,e=e._init;try{return le(e(n))}catch{}}return null}var ue=Array.isArray,k=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},oe=[],he=-1;function A(e){return{current:e}}function Y(e){0>he||(e.current=oe[he],oe[he]=null,he--)}function X(e,n){he++,oe[he]=e.current,e.current=n}var ae=A(null),fe=A(null),ie=A(null),ve=A(null);function Ae(e,n){switch(X(ie,n),X(fe,e),X(ae,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?rp(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=rp(n),e=op(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(ae),X(ae,e)}function be(){Y(ae),Y(fe),Y(ie)}function xe(e){e.memoizedState!==null&&X(ve,e);var n=ae.current,a=op(n,e.type);n!==a&&(X(fe,e),X(ae,a))}function Ce(e){fe.current===e&&(Y(ae),Y(fe)),ve.current===e&&(Y(ve),vl._currentValue=I)}var zt,Nt;function se(e){if(zt===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);zt=n&&n[1]||"",Nt=-1<a.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+zt+e+Nt}var Se=!1;function Oe(e,n){if(!e||Se)return"";Se=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(K){var G=K}Reflect.construct(e,[],te)}else{try{te.call()}catch(K){G=K}e.call(te.prototype)}}else{try{throw Error()}catch(K){G=K}(te=e())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(K){if(K&&G&&typeof K.stack=="string")return[K.stack,G.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),x=h[0],E=h[1];if(x&&E){var M=x.split(`
44
+ `),V=E.split(`
45
+ `);for(d=o=0;o<M.length&&!M[o].includes("DetermineComponentFrameRoot");)o++;for(;d<V.length&&!V[d].includes("DetermineComponentFrameRoot");)d++;if(o===M.length||d===V.length)for(o=M.length-1,d=V.length-1;1<=o&&0<=d&&M[o]!==V[d];)d--;for(;1<=o&&0<=d;o--,d--)if(M[o]!==V[d]){if(o!==1||d!==1)do if(o--,d--,0>d||M[o]!==V[d]){var W=`
46
+ `+M[o].replace(" at new "," at ");return e.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",e.displayName)),W}while(1<=o&&0<=d);break}}}finally{Se=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?se(a):""}function Ie(e,n){switch(e.tag){case 26:case 27:case 5:return se(e.type);case 16:return se("Lazy");case 13:return e.child!==n&&n!==null?se("Suspense Fallback"):se("Suspense");case 19:return se("SuspenseList");case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return se("Activity");default:return""}}function ct(e){try{var n="",a=null;do n+=Ie(e,a),a=e,e=e.return;while(e);return n}catch(o){return`
47
+ Error generating stack: `+o.message+`
48
+ `+o.stack}}var $=Object.prototype.hasOwnProperty,me=t.unstable_scheduleCallback,$e=t.unstable_cancelCallback,Ot=t.unstable_shouldYield,Gt=t.unstable_requestPaint,We=t.unstable_now,ns=t.unstable_getCurrentPriorityLevel,ge=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,wt=t.unstable_NormalPriority,qn=t.unstable_LowPriority,ye=t.unstable_IdlePriority,xt=t.log,It=t.unstable_setDisableYieldValue,Ht=null,He=null;function rn(e){if(typeof xt=="function"&&It(e),He&&typeof He.setStrictMode=="function")try{He.setStrictMode(Ht,e)}catch{}}var pt=Math.clz32?Math.clz32:la,Pn=Math.log,ss=Math.LN2;function la(e){return e>>>=0,e===0?32:31-(Pn(e)/ss|0)|0}var on=256,Dt=262144,as=4194304;function Vn(e){var n=e&42;if(n!==0)return n;switch(e&-e){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ra(e,n,a){var o=e.pendingLanes;if(o===0)return 0;var d=0,h=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var E=o&134217727;return E!==0?(o=E&~h,o!==0?d=Vn(o):(x&=E,x!==0?d=Vn(x):a||(a=E&~e,a!==0&&(d=Vn(a))))):(E=o&~h,E!==0?d=Vn(E):x!==0?d=Vn(x):a||(a=o&~e,a!==0&&(d=Vn(a)))),d===0?0:n!==0&&n!==d&&(n&h)===0&&(h=d&-d,a=n&-n,h>=a||h===32&&(a&4194048)!==0)?n:d}function oa(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Eo(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32: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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ri(){var e=as;return as<<=1,(as&62914560)===0&&(as=4194304),e}function Ai(e){for(var n=[],a=0;31>a;a++)n.push(e);return n}function ca(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _o(e,n,a,o,d,h){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var E=e.entanglements,M=e.expirationTimes,V=e.hiddenUpdates;for(a=x&~a;0<a;){var W=31-pt(a),te=1<<W;E[W]=0,M[W]=-1;var G=V[W];if(G!==null)for(V[W]=null,W=0;W<G.length;W++){var K=G[W];K!==null&&(K.lane&=-536870913)}a&=~te}o!==0&&Ll(e,o,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(x&~n))}function Ll(e,n,a){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-pt(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|a&261930}function Aa(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var o=31-pt(a),d=1<<o;d&n|e[o]&n&&(e[o]|=n),a&=~d}}function Ul(e,n){var a=n&-n;return a=(a&42)!==0?1:Mi(a),(a&(e.suspendedLanes|n))!==0?0:a}function Mi(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ma(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ks(){var e=U.p;return e!==0?e:(e=window.event,e===void 0?32:Ap(e.type))}function za(e,n){var a=U.p;try{return U.p=e,n()}finally{U.p=a}}var Cn=Math.random().toString(36).slice(2),Lt="__reactFiber$"+Cn,Ft="__reactProps$"+Cn,Ts="__reactContainer$"+Cn,Oa="__reactEvents$"+Cn,ko="__reactListeners$"+Cn,To="__reactHandles$"+Cn,$l="__reactResources$"+Cn,Cs="__reactMarker$"+Cn;function zi(e){delete e[Lt],delete e[Ft],delete e[Oa],delete e[ko],delete e[To]}function Rs(e){var n=e[Lt];if(n)return n;for(var a=e.parentNode;a;){if(n=a[Ts]||a[Lt]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=pp(e);e!==null;){if(a=e[Lt])return a;e=pp(e)}return n}e=a,a=e.parentNode}return null}function _e(e){if(e=e[Lt]||e[Ts]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function De(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(r(33))}function et(e){var n=e[$l];return n||(n=e[$l]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ge(e){e[Cs]=!0}var cn=new Set,Yt={};function Zt(e,n){Qn(e,n),Qn(e+"Capture",n)}function Qn(e,n){for(Yt[e]=n,e=0;e<n.length;e++)cn.add(n[e])}var yb=RegExp("^[: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]*$"),Kd={},Qd={};function bb(e){return $.call(Qd,e)?!0:$.call(Kd,e)?!1:yb.test(e)?Qd[e]=!0:(Kd[e]=!0,!1)}function Bl(e,n,a){if(bb(n))if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+a)}}function Il(e,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+a)}}function is(e,n,a,o){if(o===null)e.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(n,a,""+o)}}function Rn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wd(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function xb(e,n,a){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var d=o.get,h=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(x){a=""+x,h.call(this,x)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Co(e){if(!e._valueTracker){var n=Wd(e)?"checked":"value";e._valueTracker=xb(e,n,""+e[n])}}function Jd(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),o="";return e&&(o=Wd(e)?e.checked?"true":"false":e.value),e=o,e!==a?(n.setValue(e),!0):!1}function Hl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Sb=/[\n"\\]/g;function An(e){return e.replace(Sb,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Ro(e,n,a,o,d,h,x,E){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),n!=null?x==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Rn(n)):e.value!==""+Rn(n)&&(e.value=""+Rn(n)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),n!=null?Ao(e,x,Rn(n)):a!=null?Ao(e,x,Rn(a)):o!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.name=""+Rn(E):e.removeAttribute("name")}function ef(e,n,a,o,d,h,x,E){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||a!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Co(e);return}a=a!=null?""+Rn(a):"",n=n!=null?""+Rn(n):a,E||n===e.value||(e.value=n),e.defaultValue=n}o=o??d,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=E?e.checked:!!o,e.defaultChecked=!!o,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Co(e)}function Ao(e,n,a){n==="number"&&Hl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Da(e,n,a,o){if(e=e.options,n){n={};for(var d=0;d<a.length;d++)n["$"+a[d]]=!0;for(a=0;a<e.length;a++)d=n.hasOwnProperty("$"+e[a].value),e[a].selected!==d&&(e[a].selected=d),d&&o&&(e[a].defaultSelected=!0)}else{for(a=""+Rn(a),n=null,d=0;d<e.length;d++){if(e[d].value===a){e[d].selected=!0,o&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function tf(e,n,a){if(n!=null&&(n=""+Rn(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+Rn(a):""}function nf(e,n,a,o){if(n==null){if(o!=null){if(a!=null)throw Error(r(92));if(ue(o)){if(1<o.length)throw Error(r(93));o=o[0]}a=o}a==null&&(a=""),n=a}a=Rn(n),e.defaultValue=a,o=e.textContent,o===a&&o!==""&&o!==null&&(e.value=o),Co(e)}function La(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var jb=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function sf(e,n,a){var o=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":o?e.setProperty(n,a):typeof a!="number"||a===0||jb.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function af(e,n,a){if(n!=null&&typeof n!="object")throw Error(r(62));if(e=e.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var d in n)o=n[d],n.hasOwnProperty(d)&&a[d]!==o&&sf(e,d,o)}else for(var h in n)n.hasOwnProperty(h)&&sf(e,h,n[h])}function Mo(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Nb=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),wb=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Zl(e){return wb.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ls(){}var zo=null;function Oo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ua=null,$a=null;function lf(e){var n=_e(e);if(n&&(e=n.stateNode)){var a=e[Ft]||null;e:switch(e=n.stateNode,n.type){case"input":if(Ro(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+An(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var o=a[n];if(o!==e&&o.form===e.form){var d=o[Ft]||null;if(!d)throw Error(r(90));Ro(o,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<a.length;n++)o=a[n],o.form===e.form&&Jd(o)}break e;case"textarea":tf(e,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&Da(e,!!a.multiple,n,!1)}}}var Do=!1;function rf(e,n,a){if(Do)return e(n,a);Do=!0;try{var o=e(n);return o}finally{if(Do=!1,(Ua!==null||$a!==null)&&(Cr(),Ua&&(n=Ua,e=$a,$a=Ua=null,lf(n),e)))for(n=0;n<e.length;n++)lf(e[n])}}function Oi(e,n){var a=e.stateNode;if(a===null)return null;var o=a[Ft]||null;if(o===null)return null;a=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(r(231,n,typeof a));return a}var rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lo=!1;if(rs)try{var Di={};Object.defineProperty(Di,"passive",{get:function(){Lo=!0}}),window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{Lo=!1}var As=null,Uo=null,ql=null;function of(){if(ql)return ql;var e,n=Uo,a=n.length,o,d="value"in As?As.value:As.textContent,h=d.length;for(e=0;e<a&&n[e]===d[e];e++);var x=a-e;for(o=1;o<=x&&n[a-o]===d[h-o];o++);return ql=d.slice(e,1<o?1-o:void 0)}function Pl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Vl(){return!0}function cf(){return!1}function un(e){function n(a,o,d,h,x){this._reactName=a,this._targetInst=d,this.type=o,this.nativeEvent=h,this.target=x,this.currentTarget=null;for(var E in e)e.hasOwnProperty(E)&&(a=e[E],this[E]=a?a(h):h[E]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Vl:cf,this.isPropagationStopped=cf,this}return b(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Vl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Vl)},persist:function(){},isPersistent:Vl}),n}var ua={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gl=un(ua),Li=b({},ua,{view:0,detail:0}),Eb=un(Li),$o,Bo,Ui,Fl=b({},Li,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ho,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ui&&(Ui&&e.type==="mousemove"?($o=e.screenX-Ui.screenX,Bo=e.screenY-Ui.screenY):Bo=$o=0,Ui=e),$o)},movementY:function(e){return"movementY"in e?e.movementY:Bo}}),uf=un(Fl),_b=b({},Fl,{dataTransfer:0}),kb=un(_b),Tb=b({},Li,{relatedTarget:0}),Io=un(Tb),Cb=b({},ua,{animationName:0,elapsedTime:0,pseudoElement:0}),Rb=un(Cb),Ab=b({},ua,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mb=un(Ab),zb=b({},ua,{data:0}),df=un(zb),Ob={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Db={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"},Lb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ub(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Lb[e])?!!n[e]:!1}function Ho(){return Ub}var $b=b({},Li,{key:function(e){if(e.key){var n=Ob[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Pl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Db[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ho,charCode:function(e){return e.type==="keypress"?Pl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Pl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Bb=un($b),Ib=b({},Fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ff=un(Ib),Hb=b({},Li,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ho}),Zb=un(Hb),qb=b({},ua,{propertyName:0,elapsedTime:0,pseudoElement:0}),Pb=un(qb),Vb=b({},Fl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Gb=un(Vb),Fb=b({},ua,{newState:0,oldState:0}),Yb=un(Fb),Xb=[9,13,27,32],Zo=rs&&"CompositionEvent"in window,$i=null;rs&&"documentMode"in document&&($i=document.documentMode);var Kb=rs&&"TextEvent"in window&&!$i,hf=rs&&(!Zo||$i&&8<$i&&11>=$i),mf=" ",pf=!1;function gf(e,n){switch(e){case"keyup":return Xb.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ba=!1;function Qb(e,n){switch(e){case"compositionend":return vf(n);case"keypress":return n.which!==32?null:(pf=!0,mf);case"textInput":return e=n.data,e===mf&&pf?null:e;default:return null}}function Wb(e,n){if(Ba)return e==="compositionend"||!Zo&&gf(e,n)?(e=of(),ql=Uo=As=null,Ba=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return hf&&n.locale!=="ko"?null:n.data;default:return null}}var Jb={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 yf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Jb[e.type]:n==="textarea"}function bf(e,n,a,o){Ua?$a?$a.push(o):$a=[o]:Ua=o,n=Lr(n,"onChange"),0<n.length&&(a=new Gl("onChange","change",null,a,o),e.push({event:a,listeners:n}))}var Bi=null,Ii=null;function ex(e){tp(e,0)}function Yl(e){var n=De(e);if(Jd(n))return e}function xf(e,n){if(e==="change")return n}var Sf=!1;if(rs){var qo;if(rs){var Po="oninput"in document;if(!Po){var jf=document.createElement("div");jf.setAttribute("oninput","return;"),Po=typeof jf.oninput=="function"}qo=Po}else qo=!1;Sf=qo&&(!document.documentMode||9<document.documentMode)}function Nf(){Bi&&(Bi.detachEvent("onpropertychange",wf),Ii=Bi=null)}function wf(e){if(e.propertyName==="value"&&Yl(Ii)){var n=[];bf(n,Ii,e,Oo(e)),rf(ex,n)}}function tx(e,n,a){e==="focusin"?(Nf(),Bi=n,Ii=a,Bi.attachEvent("onpropertychange",wf)):e==="focusout"&&Nf()}function nx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yl(Ii)}function sx(e,n){if(e==="click")return Yl(n)}function ax(e,n){if(e==="input"||e==="change")return Yl(n)}function ix(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var xn=typeof Object.is=="function"?Object.is:ix;function Hi(e,n){if(xn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var a=Object.keys(e),o=Object.keys(n);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var d=a[o];if(!$.call(n,d)||!xn(e[d],n[d]))return!1}return!0}function Ef(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _f(e,n){var a=Ef(e);e=0;for(var o;a;){if(a.nodeType===3){if(o=e+a.textContent.length,e<=n&&o>=n)return{node:a,offset:n-e};e=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Ef(a)}}function kf(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?kf(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Tf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Hl(e.document);n instanceof e.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)e=n.contentWindow;else break;n=Hl(e.document)}return n}function Vo(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var lx=rs&&"documentMode"in document&&11>=document.documentMode,Ia=null,Go=null,Zi=null,Fo=!1;function Cf(e,n,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Fo||Ia==null||Ia!==Hl(o)||(o=Ia,"selectionStart"in o&&Vo(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Zi&&Hi(Zi,o)||(Zi=o,o=Lr(Go,"onSelect"),0<o.length&&(n=new Gl("onSelect","select",null,n,a),e.push({event:n,listeners:o}),n.target=Ia)))}function da(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var Ha={animationend:da("Animation","AnimationEnd"),animationiteration:da("Animation","AnimationIteration"),animationstart:da("Animation","AnimationStart"),transitionrun:da("Transition","TransitionRun"),transitionstart:da("Transition","TransitionStart"),transitioncancel:da("Transition","TransitionCancel"),transitionend:da("Transition","TransitionEnd")},Yo={},Rf={};rs&&(Rf=document.createElement("div").style,"AnimationEvent"in window||(delete Ha.animationend.animation,delete Ha.animationiteration.animation,delete Ha.animationstart.animation),"TransitionEvent"in window||delete Ha.transitionend.transition);function fa(e){if(Yo[e])return Yo[e];if(!Ha[e])return e;var n=Ha[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in Rf)return Yo[e]=n[a];return e}var Af=fa("animationend"),Mf=fa("animationiteration"),zf=fa("animationstart"),rx=fa("transitionrun"),ox=fa("transitionstart"),cx=fa("transitioncancel"),Of=fa("transitionend"),Df=new Map,Xo="abort auxClick beforeToggle 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(" ");Xo.push("scrollEnd");function Gn(e,n){Df.set(e,n),Zt(n,[e])}var Xl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Mn=[],Za=0,Ko=0;function Kl(){for(var e=Za,n=Ko=Za=0;n<e;){var a=Mn[n];Mn[n++]=null;var o=Mn[n];Mn[n++]=null;var d=Mn[n];Mn[n++]=null;var h=Mn[n];if(Mn[n++]=null,o!==null&&d!==null){var x=o.pending;x===null?d.next=d:(d.next=x.next,x.next=d),o.pending=d}h!==0&&Lf(a,d,h)}}function Ql(e,n,a,o){Mn[Za++]=e,Mn[Za++]=n,Mn[Za++]=a,Mn[Za++]=o,Ko|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Qo(e,n,a,o){return Ql(e,n,a,o),Wl(e)}function ha(e,n){return Ql(e,null,null,n),Wl(e)}function Lf(e,n,a){e.lanes|=a;var o=e.alternate;o!==null&&(o.lanes|=a);for(var d=!1,h=e.return;h!==null;)h.childLanes|=a,o=h.alternate,o!==null&&(o.childLanes|=a),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&n!==null&&(d=31-pt(a),e=h.hiddenUpdates,o=e[d],o===null?e[d]=[n]:o.push(n),n.lane=a|536870912),h):null}function Wl(e){if(50<ul)throw ul=0,lu=null,Error(r(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var qa={};function ux(e,n,a,o){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sn(e,n,a,o){return new ux(e,n,a,o)}function Wo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function os(e,n){var a=e.alternate;return a===null?(a=Sn(e.tag,n,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=n,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,n=e.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Uf(e,n){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,n=a.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Jl(e,n,a,o,d,h){var x=0;if(o=e,typeof e=="function")Wo(e)&&(x=1);else if(typeof e=="string")x=pS(e,a,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=Sn(31,a,n,d),e.elementType=ne,e.lanes=h,e;case N:return ma(a.children,d,h,n);case j:x=8,d|=24;break;case R:return e=Sn(12,a,n,d|2),e.elementType=R,e.lanes=h,e;case T:return e=Sn(13,a,n,d),e.elementType=T,e.lanes=h,e;case O:return e=Sn(19,a,n,d),e.elementType=O,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case z:x=10;break e;case C:x=9;break e;case H:x=11;break e;case D:x=14;break e;case F:x=16,o=null;break e}x=29,a=Error(r(130,e===null?"null":typeof e,"")),o=null}return n=Sn(x,a,n,d),n.elementType=e,n.type=o,n.lanes=h,n}function ma(e,n,a,o){return e=Sn(7,e,o,n),e.lanes=a,e}function Jo(e,n,a){return e=Sn(6,e,null,n),e.lanes=a,e}function $f(e){var n=Sn(18,null,null,0);return n.stateNode=e,n}function ec(e,n,a){return n=Sn(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Bf=new WeakMap;function zn(e,n){if(typeof e=="object"&&e!==null){var a=Bf.get(e);return a!==void 0?a:(n={value:e,source:n,stack:ct(n)},Bf.set(e,n),n)}return{value:e,source:n,stack:ct(n)}}var Pa=[],Va=0,er=null,qi=0,On=[],Dn=0,Ms=null,Wn=1,Jn="";function cs(e,n){Pa[Va++]=qi,Pa[Va++]=er,er=e,qi=n}function If(e,n,a){On[Dn++]=Wn,On[Dn++]=Jn,On[Dn++]=Ms,Ms=e;var o=Wn;e=Jn;var d=32-pt(o)-1;o&=~(1<<d),a+=1;var h=32-pt(n)+d;if(30<h){var x=d-d%5;h=(o&(1<<x)-1).toString(32),o>>=x,d-=x,Wn=1<<32-pt(n)+d|a<<d|o,Jn=h+e}else Wn=1<<h|a<<d|o,Jn=e}function tc(e){e.return!==null&&(cs(e,1),If(e,1,0))}function nc(e){for(;e===er;)er=Pa[--Va],Pa[Va]=null,qi=Pa[--Va],Pa[Va]=null;for(;e===Ms;)Ms=On[--Dn],On[Dn]=null,Jn=On[--Dn],On[Dn]=null,Wn=On[--Dn],On[Dn]=null}function Hf(e,n){On[Dn++]=Wn,On[Dn++]=Jn,On[Dn++]=Ms,Wn=n.id,Jn=n.overflow,Ms=e}var Xt=null,ut=null,Fe=!1,zs=null,Ln=!1,sc=Error(r(519));function Os(e){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Pi(zn(n,e)),sc}function Zf(e){var n=e.stateNode,a=e.type,o=e.memoizedProps;switch(n[Lt]=e,n[Ft]=o,a){case"dialog":qe("cancel",n),qe("close",n);break;case"iframe":case"object":case"embed":qe("load",n);break;case"video":case"audio":for(a=0;a<fl.length;a++)qe(fl[a],n);break;case"source":qe("error",n);break;case"img":case"image":case"link":qe("error",n),qe("load",n);break;case"details":qe("toggle",n);break;case"input":qe("invalid",n),ef(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":qe("invalid",n);break;case"textarea":qe("invalid",n),nf(n,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||o.suppressHydrationWarning===!0||ip(n.textContent,a)?(o.popover!=null&&(qe("beforetoggle",n),qe("toggle",n)),o.onScroll!=null&&qe("scroll",n),o.onScrollEnd!=null&&qe("scrollend",n),o.onClick!=null&&(n.onclick=ls),n=!0):n=!1,n||Os(e,!0)}function qf(e){for(Xt=e.return;Xt;)switch(Xt.tag){case 5:case 31:case 13:Ln=!1;return;case 27:case 3:Ln=!0;return;default:Xt=Xt.return}}function Ga(e){if(e!==Xt)return!1;if(!Fe)return qf(e),Fe=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Su(e.type,e.memoizedProps)),a=!a),a&&ut&&Os(e),qf(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));ut=mp(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));ut=mp(e)}else n===27?(n=ut,Ys(e.type)?(e=_u,_u=null,ut=e):ut=n):ut=Xt?$n(e.stateNode.nextSibling):null;return!0}function pa(){ut=Xt=null,Fe=!1}function ac(){var e=zs;return e!==null&&(mn===null?mn=e:mn.push.apply(mn,e),zs=null),e}function Pi(e){zs===null?zs=[e]:zs.push(e)}var ic=A(null),ga=null,us=null;function Ds(e,n,a){X(ic,n._currentValue),n._currentValue=a}function ds(e){e._currentValue=ic.current,Y(ic)}function lc(e,n,a){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===a)break;e=e.return}}function rc(e,n,a,o){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var x=d.child;h=h.firstContext;e:for(;h!==null;){var E=h;h=d;for(var M=0;M<n.length;M++)if(E.context===n[M]){h.lanes|=a,E=h.alternate,E!==null&&(E.lanes|=a),lc(h.return,a,e),o||(x=null);break e}h=E.next}}else if(d.tag===18){if(x=d.return,x===null)throw Error(r(341));x.lanes|=a,h=x.alternate,h!==null&&(h.lanes|=a),lc(x,a,e),x=null}else x=d.child;if(x!==null)x.return=d;else for(x=d;x!==null;){if(x===e){x=null;break}if(d=x.sibling,d!==null){d.return=x.return,x=d;break}x=x.return}d=x}}function Fa(e,n,a,o){e=null;for(var d=n,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var x=d.alternate;if(x===null)throw Error(r(387));if(x=x.memoizedProps,x!==null){var E=d.type;xn(d.pendingProps.value,x.value)||(e!==null?e.push(E):e=[E])}}else if(d===ve.current){if(x=d.alternate,x===null)throw Error(r(387));x.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(vl):e=[vl])}d=d.return}e!==null&&rc(n,e,a,o),n.flags|=262144}function tr(e){for(e=e.firstContext;e!==null;){if(!xn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function va(e){ga=e,us=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Kt(e){return Pf(ga,e)}function nr(e,n){return ga===null&&va(e),Pf(e,n)}function Pf(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},us===null){if(e===null)throw Error(r(308));us=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else us=us.next=n;return a}var dx=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(a,o){e.push(o)}};this.abort=function(){n.aborted=!0,e.forEach(function(a){return a()})}},fx=t.unstable_scheduleCallback,hx=t.unstable_NormalPriority,kt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oc(){return{controller:new dx,data:new Map,refCount:0}}function Vi(e){e.refCount--,e.refCount===0&&fx(hx,function(){e.controller.abort()})}var Gi=null,cc=0,Ya=0,Xa=null;function mx(e,n){if(Gi===null){var a=Gi=[];cc=0,Ya=fu(),Xa={status:"pending",value:void 0,then:function(o){a.push(o)}}}return cc++,n.then(Vf,Vf),n}function Vf(){if(--cc===0&&Gi!==null){Xa!==null&&(Xa.status="fulfilled");var e=Gi;Gi=null,Ya=0,Xa=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function px(e,n){var a=[],o={status:"pending",value:null,reason:null,then:function(d){a.push(d)}};return e.then(function(){o.status="fulfilled",o.value=n;for(var d=0;d<a.length;d++)(0,a[d])(n)},function(d){for(o.status="rejected",o.reason=d,d=0;d<a.length;d++)(0,a[d])(void 0)}),o}var Gf=k.S;k.S=function(e,n){Cm=We(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&mx(e,n),Gf!==null&&Gf(e,n)};var ya=A(null);function uc(){var e=ya.current;return e!==null?e:ot.pooledCache}function sr(e,n){n===null?X(ya,ya.current):X(ya,n.pool)}function Ff(){var e=uc();return e===null?null:{parent:kt._currentValue,pool:e}}var Ka=Error(r(460)),dc=Error(r(474)),ar=Error(r(542)),ir={then:function(){}};function Yf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Xf(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(ls,ls),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Qf(e),e;default:if(typeof n.status=="string")n.then(ls,ls);else{if(e=ot,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=n,e.status="pending",e.then(function(o){if(n.status==="pending"){var d=n;d.status="fulfilled",d.value=o}},function(o){if(n.status==="pending"){var d=n;d.status="rejected",d.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Qf(e),e}throw xa=n,Ka}}function ba(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(xa=a,Ka):a}}var xa=null;function Kf(){if(xa===null)throw Error(r(459));var e=xa;return xa=null,e}function Qf(e){if(e===Ka||e===ar)throw Error(r(483))}var Qa=null,Fi=0;function lr(e){var n=Fi;return Fi+=1,Qa===null&&(Qa=[]),Xf(Qa,e,n)}function Yi(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function rr(e,n){throw n.$$typeof===S?Error(r(525)):(e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Wf(e){function n(B,L){if(e){var P=B.deletions;P===null?(B.deletions=[L],B.flags|=16):P.push(L)}}function a(B,L){if(!e)return null;for(;L!==null;)n(B,L),L=L.sibling;return null}function o(B){for(var L=new Map;B!==null;)B.key!==null?L.set(B.key,B):L.set(B.index,B),B=B.sibling;return L}function d(B,L){return B=os(B,L),B.index=0,B.sibling=null,B}function h(B,L,P){return B.index=P,e?(P=B.alternate,P!==null?(P=P.index,P<L?(B.flags|=67108866,L):P):(B.flags|=67108866,L)):(B.flags|=1048576,L)}function x(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function E(B,L,P,ee){return L===null||L.tag!==6?(L=Jo(P,B.mode,ee),L.return=B,L):(L=d(L,P),L.return=B,L)}function M(B,L,P,ee){var ke=P.type;return ke===N?W(B,L,P.props.children,ee,P.key):L!==null&&(L.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===F&&ba(ke)===L.type)?(L=d(L,P.props),Yi(L,P),L.return=B,L):(L=Jl(P.type,P.key,P.props,null,B.mode,ee),Yi(L,P),L.return=B,L)}function V(B,L,P,ee){return L===null||L.tag!==4||L.stateNode.containerInfo!==P.containerInfo||L.stateNode.implementation!==P.implementation?(L=ec(P,B.mode,ee),L.return=B,L):(L=d(L,P.children||[]),L.return=B,L)}function W(B,L,P,ee,ke){return L===null||L.tag!==7?(L=ma(P,B.mode,ee,ke),L.return=B,L):(L=d(L,P),L.return=B,L)}function te(B,L,P){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Jo(""+L,B.mode,P),L.return=B,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case w:return P=Jl(L.type,L.key,L.props,null,B.mode,P),Yi(P,L),P.return=B,P;case _:return L=ec(L,B.mode,P),L.return=B,L;case F:return L=ba(L),te(B,L,P)}if(ue(L)||q(L))return L=ma(L,B.mode,P,null),L.return=B,L;if(typeof L.then=="function")return te(B,lr(L),P);if(L.$$typeof===z)return te(B,nr(B,L),P);rr(B,L)}return null}function G(B,L,P,ee){var ke=L!==null?L.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return ke!==null?null:E(B,L,""+P,ee);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case w:return P.key===ke?M(B,L,P,ee):null;case _:return P.key===ke?V(B,L,P,ee):null;case F:return P=ba(P),G(B,L,P,ee)}if(ue(P)||q(P))return ke!==null?null:W(B,L,P,ee,null);if(typeof P.then=="function")return G(B,L,lr(P),ee);if(P.$$typeof===z)return G(B,L,nr(B,P),ee);rr(B,P)}return null}function K(B,L,P,ee,ke){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return B=B.get(P)||null,E(L,B,""+ee,ke);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case w:return B=B.get(ee.key===null?P:ee.key)||null,M(L,B,ee,ke);case _:return B=B.get(ee.key===null?P:ee.key)||null,V(L,B,ee,ke);case F:return ee=ba(ee),K(B,L,P,ee,ke)}if(ue(ee)||q(ee))return B=B.get(P)||null,W(L,B,ee,ke,null);if(typeof ee.then=="function")return K(B,L,P,lr(ee),ke);if(ee.$$typeof===z)return K(B,L,P,nr(L,ee),ke);rr(L,ee)}return null}function je(B,L,P,ee){for(var ke=null,Ye=null,we=L,Be=L=0,Ve=null;we!==null&&Be<P.length;Be++){we.index>Be?(Ve=we,we=null):Ve=we.sibling;var Xe=G(B,we,P[Be],ee);if(Xe===null){we===null&&(we=Ve);break}e&&we&&Xe.alternate===null&&n(B,we),L=h(Xe,L,Be),Ye===null?ke=Xe:Ye.sibling=Xe,Ye=Xe,we=Ve}if(Be===P.length)return a(B,we),Fe&&cs(B,Be),ke;if(we===null){for(;Be<P.length;Be++)we=te(B,P[Be],ee),we!==null&&(L=h(we,L,Be),Ye===null?ke=we:Ye.sibling=we,Ye=we);return Fe&&cs(B,Be),ke}for(we=o(we);Be<P.length;Be++)Ve=K(we,B,Be,P[Be],ee),Ve!==null&&(e&&Ve.alternate!==null&&we.delete(Ve.key===null?Be:Ve.key),L=h(Ve,L,Be),Ye===null?ke=Ve:Ye.sibling=Ve,Ye=Ve);return e&&we.forEach(function(Js){return n(B,Js)}),Fe&&cs(B,Be),ke}function Te(B,L,P,ee){if(P==null)throw Error(r(151));for(var ke=null,Ye=null,we=L,Be=L=0,Ve=null,Xe=P.next();we!==null&&!Xe.done;Be++,Xe=P.next()){we.index>Be?(Ve=we,we=null):Ve=we.sibling;var Js=G(B,we,Xe.value,ee);if(Js===null){we===null&&(we=Ve);break}e&&we&&Js.alternate===null&&n(B,we),L=h(Js,L,Be),Ye===null?ke=Js:Ye.sibling=Js,Ye=Js,we=Ve}if(Xe.done)return a(B,we),Fe&&cs(B,Be),ke;if(we===null){for(;!Xe.done;Be++,Xe=P.next())Xe=te(B,Xe.value,ee),Xe!==null&&(L=h(Xe,L,Be),Ye===null?ke=Xe:Ye.sibling=Xe,Ye=Xe);return Fe&&cs(B,Be),ke}for(we=o(we);!Xe.done;Be++,Xe=P.next())Xe=K(we,B,Be,Xe.value,ee),Xe!==null&&(e&&Xe.alternate!==null&&we.delete(Xe.key===null?Be:Xe.key),L=h(Xe,L,Be),Ye===null?ke=Xe:Ye.sibling=Xe,Ye=Xe);return e&&we.forEach(function(_S){return n(B,_S)}),Fe&&cs(B,Be),ke}function lt(B,L,P,ee){if(typeof P=="object"&&P!==null&&P.type===N&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case w:e:{for(var ke=P.key;L!==null;){if(L.key===ke){if(ke=P.type,ke===N){if(L.tag===7){a(B,L.sibling),ee=d(L,P.props.children),ee.return=B,B=ee;break e}}else if(L.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===F&&ba(ke)===L.type){a(B,L.sibling),ee=d(L,P.props),Yi(ee,P),ee.return=B,B=ee;break e}a(B,L);break}else n(B,L);L=L.sibling}P.type===N?(ee=ma(P.props.children,B.mode,ee,P.key),ee.return=B,B=ee):(ee=Jl(P.type,P.key,P.props,null,B.mode,ee),Yi(ee,P),ee.return=B,B=ee)}return x(B);case _:e:{for(ke=P.key;L!==null;){if(L.key===ke)if(L.tag===4&&L.stateNode.containerInfo===P.containerInfo&&L.stateNode.implementation===P.implementation){a(B,L.sibling),ee=d(L,P.children||[]),ee.return=B,B=ee;break e}else{a(B,L);break}else n(B,L);L=L.sibling}ee=ec(P,B.mode,ee),ee.return=B,B=ee}return x(B);case F:return P=ba(P),lt(B,L,P,ee)}if(ue(P))return je(B,L,P,ee);if(q(P)){if(ke=q(P),typeof ke!="function")throw Error(r(150));return P=ke.call(P),Te(B,L,P,ee)}if(typeof P.then=="function")return lt(B,L,lr(P),ee);if(P.$$typeof===z)return lt(B,L,nr(B,P),ee);rr(B,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,L!==null&&L.tag===6?(a(B,L.sibling),ee=d(L,P),ee.return=B,B=ee):(a(B,L),ee=Jo(P,B.mode,ee),ee.return=B,B=ee),x(B)):a(B,L)}return function(B,L,P,ee){try{Fi=0;var ke=lt(B,L,P,ee);return Qa=null,ke}catch(we){if(we===Ka||we===ar)throw we;var Ye=Sn(29,we,null,B.mode);return Ye.lanes=ee,Ye.return=B,Ye}finally{}}}var Sa=Wf(!0),Jf=Wf(!1),Ls=!1;function fc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hc(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Us(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function $s(e,n,a){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Je&2)!==0){var d=o.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),o.pending=n,n=Wl(e),Lf(e,null,a),n}return Ql(e,o,n,a),Wl(e)}function Xi(e,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var o=n.lanes;o&=e.pendingLanes,a|=o,n.lanes=a,Aa(e,a)}}function mc(e,n){var a=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var d=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?d=h=x:h=h.next=x,a=a.next}while(a!==null);h===null?d=h=n:h=h.next=n}else d=h=n;a={baseState:o.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=n:e.next=n,a.lastBaseUpdate=n}var pc=!1;function Ki(){if(pc){var e=Xa;if(e!==null)throw e}}function Qi(e,n,a,o){pc=!1;var d=e.updateQueue;Ls=!1;var h=d.firstBaseUpdate,x=d.lastBaseUpdate,E=d.shared.pending;if(E!==null){d.shared.pending=null;var M=E,V=M.next;M.next=null,x===null?h=V:x.next=V,x=M;var W=e.alternate;W!==null&&(W=W.updateQueue,E=W.lastBaseUpdate,E!==x&&(E===null?W.firstBaseUpdate=V:E.next=V,W.lastBaseUpdate=M))}if(h!==null){var te=d.baseState;x=0,W=V=M=null,E=h;do{var G=E.lane&-536870913,K=G!==E.lane;if(K?(Pe&G)===G:(o&G)===G){G!==0&&G===Ya&&(pc=!0),W!==null&&(W=W.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var je=e,Te=E;G=n;var lt=a;switch(Te.tag){case 1:if(je=Te.payload,typeof je=="function"){te=je.call(lt,te,G);break e}te=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Te.payload,G=typeof je=="function"?je.call(lt,te,G):je,G==null)break e;te=b({},te,G);break e;case 2:Ls=!0}}G=E.callback,G!==null&&(e.flags|=64,K&&(e.flags|=8192),K=d.callbacks,K===null?d.callbacks=[G]:K.push(G))}else K={lane:G,tag:E.tag,payload:E.payload,callback:E.callback,next:null},W===null?(V=W=K,M=te):W=W.next=K,x|=G;if(E=E.next,E===null){if(E=d.shared.pending,E===null)break;K=E,E=K.next,K.next=null,d.lastBaseUpdate=K,d.shared.pending=null}}while(!0);W===null&&(M=te),d.baseState=M,d.firstBaseUpdate=V,d.lastBaseUpdate=W,h===null&&(d.shared.lanes=0),qs|=x,e.lanes=x,e.memoizedState=te}}function eh(e,n){if(typeof e!="function")throw Error(r(191,e));e.call(n)}function th(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)eh(a[e],n)}var Wa=A(null),or=A(0);function nh(e,n){e=xs,X(or,e),X(Wa,n),xs=e|n.baseLanes}function gc(){X(or,xs),X(Wa,Wa.current)}function vc(){xs=or.current,Y(Wa),Y(or)}var jn=A(null),Un=null;function Bs(e){var n=e.alternate;X(Et,Et.current&1),X(jn,e),Un===null&&(n===null||Wa.current!==null||n.memoizedState!==null)&&(Un=e)}function yc(e){X(Et,Et.current),X(jn,e),Un===null&&(Un=e)}function sh(e){e.tag===22?(X(Et,Et.current),X(jn,e),Un===null&&(Un=e)):Is()}function Is(){X(Et,Et.current),X(jn,jn.current)}function Nn(e){Y(jn),Un===e&&(Un=null),Y(Et)}var Et=A(0);function cr(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||wu(a)||Eu(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var fs=0,Le=null,at=null,Tt=null,ur=!1,Ja=!1,ja=!1,dr=0,Wi=0,ei=null,gx=0;function St(){throw Error(r(321))}function bc(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!xn(e[a],n[a]))return!1;return!0}function xc(e,n,a,o,d,h){return fs=h,Le=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,k.H=e===null||e.memoizedState===null?Ih:Dc,ja=!1,h=a(o,d),ja=!1,Ja&&(h=ih(n,a,o,d)),ah(e),h}function ah(e){k.H=tl;var n=at!==null&&at.next!==null;if(fs=0,Tt=at=Le=null,ur=!1,Wi=0,ei=null,n)throw Error(r(300));e===null||Ct||(e=e.dependencies,e!==null&&tr(e)&&(Ct=!0))}function ih(e,n,a,o){Le=e;var d=0;do{if(Ja&&(ei=null),Wi=0,Ja=!1,25<=d)throw Error(r(301));if(d+=1,Tt=at=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}k.H=Hh,h=n(a,o)}while(Ja);return h}function vx(){var e=k.H,n=e.useState()[0];return n=typeof n.then=="function"?Ji(n):n,e=e.useState()[0],(at!==null?at.memoizedState:null)!==e&&(Le.flags|=1024),n}function Sc(){var e=dr!==0;return dr=0,e}function jc(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function Nc(e){if(ur){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}ur=!1}fs=0,Tt=at=Le=null,Ja=!1,Wi=dr=0,ei=null}function an(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Le.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function _t(){if(at===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var n=Tt===null?Le.memoizedState:Tt.next;if(n!==null)Tt=n,at=e;else{if(e===null)throw Le.alternate===null?Error(r(467)):Error(r(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},Tt===null?Le.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function fr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ji(e){var n=Wi;return Wi+=1,ei===null&&(ei=[]),e=Xf(ei,e,n),n=Le,(Tt===null?n.memoizedState:Tt.next)===null&&(n=n.alternate,k.H=n===null||n.memoizedState===null?Ih:Dc),e}function hr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ji(e);if(e.$$typeof===z)return Kt(e)}throw Error(r(438,String(e)))}function wc(e){var n=null,a=Le.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var o=Le.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=fr(),Le.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(e),o=0;o<e;o++)a[o]=ce;return n.index++,a}function hs(e,n){return typeof n=="function"?n(e):n}function mr(e){var n=_t();return Ec(n,at,e)}function Ec(e,n,a){var o=e.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=a;var d=e.baseQueue,h=o.pending;if(h!==null){if(d!==null){var x=d.next;d.next=h.next,h.next=x}n.baseQueue=d=h,o.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{n=d.next;var E=x=null,M=null,V=n,W=!1;do{var te=V.lane&-536870913;if(te!==V.lane?(Pe&te)===te:(fs&te)===te){var G=V.revertLane;if(G===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),te===Ya&&(W=!0);else if((fs&G)===G){V=V.next,G===Ya&&(W=!0);continue}else te={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},M===null?(E=M=te,x=h):M=M.next=te,Le.lanes|=G,qs|=G;te=V.action,ja&&a(h,te),h=V.hasEagerState?V.eagerState:a(h,te)}else G={lane:te,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},M===null?(E=M=G,x=h):M=M.next=G,Le.lanes|=te,qs|=te;V=V.next}while(V!==null&&V!==n);if(M===null?x=h:M.next=E,!xn(h,e.memoizedState)&&(Ct=!0,W&&(a=Xa,a!==null)))throw a;e.memoizedState=h,e.baseState=x,e.baseQueue=M,o.lastRenderedState=h}return d===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function _c(e){var n=_t(),a=n.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=e;var o=a.dispatch,d=a.pending,h=n.memoizedState;if(d!==null){a.pending=null;var x=d=d.next;do h=e(h,x.action),x=x.next;while(x!==d);xn(h,n.memoizedState)||(Ct=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),a.lastRenderedState=h}return[h,o]}function lh(e,n,a){var o=Le,d=_t(),h=Fe;if(h){if(a===void 0)throw Error(r(407));a=a()}else a=n();var x=!xn((at||d).memoizedState,a);if(x&&(d.memoizedState=a,Ct=!0),d=d.queue,Cc(ch.bind(null,o,d,e),[e]),d.getSnapshot!==n||x||Tt!==null&&Tt.memoizedState.tag&1){if(o.flags|=2048,ti(9,{destroy:void 0},oh.bind(null,o,d,a,n),null),ot===null)throw Error(r(349));h||(fs&127)!==0||rh(o,n,a)}return a}function rh(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=Le.updateQueue,n===null?(n=fr(),Le.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function oh(e,n,a,o){n.value=a,n.getSnapshot=o,uh(n)&&dh(e)}function ch(e,n,a){return a(function(){uh(n)&&dh(e)})}function uh(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!xn(e,a)}catch{return!0}}function dh(e){var n=ha(e,2);n!==null&&pn(n,e,2)}function kc(e){var n=an();if(typeof e=="function"){var a=e;if(e=a(),ja){rn(!0);try{a()}finally{rn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:e},n}function fh(e,n,a,o){return e.baseState=a,Ec(e,at,typeof o=="function"?o:hs)}function yx(e,n,a,o,d){if(vr(e))throw Error(r(485));if(e=n.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){h.listeners.push(x)}};k.T!==null?a(!0):h.isTransition=!1,o(h),a=n.pending,a===null?(h.next=n.pending=h,hh(n,h)):(h.next=a.next,n.pending=a.next=h)}}function hh(e,n){var a=n.action,o=n.payload,d=e.state;if(n.isTransition){var h=k.T,x={};k.T=x;try{var E=a(d,o),M=k.S;M!==null&&M(x,E),mh(e,n,E)}catch(V){Tc(e,n,V)}finally{h!==null&&x.types!==null&&(h.types=x.types),k.T=h}}else try{h=a(d,o),mh(e,n,h)}catch(V){Tc(e,n,V)}}function mh(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){ph(e,n,o)},function(o){return Tc(e,n,o)}):ph(e,n,a)}function ph(e,n,a){n.status="fulfilled",n.value=a,gh(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,hh(e,a)))}function Tc(e,n,a){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=a,gh(n),n=n.next;while(n!==o)}e.action=null}function gh(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function vh(e,n){return n}function yh(e,n){if(Fe){var a=ot.formState;if(a!==null){e:{var o=Le;if(Fe){if(ut){t:{for(var d=ut,h=Ln;d.nodeType!==8;){if(!h){d=null;break t}if(d=$n(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){ut=$n(d.nextSibling),o=d.data==="F!";break e}}Os(o)}o=!1}o&&(n=a[0])}}return a=an(),a.memoizedState=a.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vh,lastRenderedState:n},a.queue=o,a=Uh.bind(null,Le,o),o.dispatch=a,o=kc(!1),h=Oc.bind(null,Le,!1,o.queue),o=an(),d={state:n,dispatch:null,action:e,pending:null},o.queue=d,a=yx.bind(null,Le,d,h,a),d.dispatch=a,o.memoizedState=e,[n,a,!1]}function bh(e){var n=_t();return xh(n,at,e)}function xh(e,n,a){if(n=Ec(e,n,vh)[0],e=mr(hs)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Ji(n)}catch(x){throw x===Ka?ar:x}else o=n;n=_t();var d=n.queue,h=d.dispatch;return a!==n.memoizedState&&(Le.flags|=2048,ti(9,{destroy:void 0},bx.bind(null,d,a),null)),[o,h,e]}function bx(e,n){e.action=n}function Sh(e){var n=_t(),a=at;if(a!==null)return xh(n,a,e);_t(),n=n.memoizedState,a=_t();var o=a.queue.dispatch;return a.memoizedState=e,[n,o,!1]}function ti(e,n,a,o){return e={tag:e,create:a,deps:o,inst:n,next:null},n=Le.updateQueue,n===null&&(n=fr(),Le.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=e.next=e:(o=a.next,a.next=e,e.next=o,n.lastEffect=e),e}function jh(){return _t().memoizedState}function pr(e,n,a,o){var d=an();Le.flags|=e,d.memoizedState=ti(1|n,{destroy:void 0},a,o===void 0?null:o)}function gr(e,n,a,o){var d=_t();o=o===void 0?null:o;var h=d.memoizedState.inst;at!==null&&o!==null&&bc(o,at.memoizedState.deps)?d.memoizedState=ti(n,h,a,o):(Le.flags|=e,d.memoizedState=ti(1|n,h,a,o))}function Nh(e,n){pr(8390656,8,e,n)}function Cc(e,n){gr(2048,8,e,n)}function xx(e){Le.flags|=4;var n=Le.updateQueue;if(n===null)n=fr(),Le.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function wh(e){var n=_t().memoizedState;return xx({ref:n,nextImpl:e}),function(){if((Je&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function Eh(e,n){return gr(4,2,e,n)}function _h(e,n){return gr(4,4,e,n)}function kh(e,n){if(typeof n=="function"){e=e();var a=n(e);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Th(e,n,a){a=a!=null?a.concat([e]):null,gr(4,4,kh.bind(null,n,e),a)}function Rc(){}function Ch(e,n){var a=_t();n=n===void 0?null:n;var o=a.memoizedState;return n!==null&&bc(n,o[1])?o[0]:(a.memoizedState=[e,n],e)}function Rh(e,n){var a=_t();n=n===void 0?null:n;var o=a.memoizedState;if(n!==null&&bc(n,o[1]))return o[0];if(o=e(),ja){rn(!0);try{e()}finally{rn(!1)}}return a.memoizedState=[o,n],o}function Ac(e,n,a){return a===void 0||(fs&1073741824)!==0&&(Pe&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=Am(),Le.lanes|=e,qs|=e,a)}function Ah(e,n,a,o){return xn(a,n)?a:Wa.current!==null?(e=Ac(e,a,o),xn(e,n)||(Ct=!0),e):(fs&42)===0||(fs&1073741824)!==0&&(Pe&261930)===0?(Ct=!0,e.memoizedState=a):(e=Am(),Le.lanes|=e,qs|=e,n)}function Mh(e,n,a,o,d){var h=U.p;U.p=h!==0&&8>h?h:8;var x=k.T,E={};k.T=E,Oc(e,!1,n,a);try{var M=d(),V=k.S;if(V!==null&&V(E,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var W=px(M,o);el(e,n,W,_n(e))}else el(e,n,o,_n(e))}catch(te){el(e,n,{then:function(){},status:"rejected",reason:te},_n())}finally{U.p=h,x!==null&&E.types!==null&&(x.types=E.types),k.T=x}}function Sx(){}function Mc(e,n,a,o){if(e.tag!==5)throw Error(r(476));var d=zh(e).queue;Mh(e,d,n,I,a===null?Sx:function(){return Oh(e),a(o)})}function zh(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:I},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Oh(e){var n=zh(e);n.next===null&&(n=e.alternate.memoizedState),el(e,n.next.queue,{},_n())}function zc(){return Kt(vl)}function Dh(){return _t().memoizedState}function Lh(){return _t().memoizedState}function jx(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=_n();e=Us(a);var o=$s(n,e,a);o!==null&&(pn(o,n,a),Xi(o,n,a)),n={cache:oc()},e.payload=n;return}n=n.return}}function Nx(e,n,a){var o=_n();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},vr(e)?$h(n,a):(a=Qo(e,n,a,o),a!==null&&(pn(a,e,o),Bh(a,n,o)))}function Uh(e,n,a){var o=_n();el(e,n,a,o)}function el(e,n,a,o){var d={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(vr(e))$h(n,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var x=n.lastRenderedState,E=h(x,a);if(d.hasEagerState=!0,d.eagerState=E,xn(E,x))return Ql(e,n,d,0),ot===null&&Kl(),!1}catch{}finally{}if(a=Qo(e,n,d,o),a!==null)return pn(a,e,o),Bh(a,n,o),!0}return!1}function Oc(e,n,a,o){if(o={lane:2,revertLane:fu(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},vr(e)){if(n)throw Error(r(479))}else n=Qo(e,a,o,2),n!==null&&pn(n,e,2)}function vr(e){var n=e.alternate;return e===Le||n!==null&&n===Le}function $h(e,n){Ja=ur=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function Bh(e,n,a){if((a&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,a|=o,n.lanes=a,Aa(e,a)}}var tl={readContext:Kt,use:hr,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St};tl.useEffectEvent=St;var Ih={readContext:Kt,use:hr,useCallback:function(e,n){return an().memoizedState=[e,n===void 0?null:n],e},useContext:Kt,useEffect:Nh,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,pr(4194308,4,kh.bind(null,n,e),a)},useLayoutEffect:function(e,n){return pr(4194308,4,e,n)},useInsertionEffect:function(e,n){pr(4,2,e,n)},useMemo:function(e,n){var a=an();n=n===void 0?null:n;var o=e();if(ja){rn(!0);try{e()}finally{rn(!1)}}return a.memoizedState=[o,n],o},useReducer:function(e,n,a){var o=an();if(a!==void 0){var d=a(n);if(ja){rn(!0);try{a(n)}finally{rn(!1)}}}else d=n;return o.memoizedState=o.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},o.queue=e,e=e.dispatch=Nx.bind(null,Le,e),[o.memoizedState,e]},useRef:function(e){var n=an();return e={current:e},n.memoizedState=e},useState:function(e){e=kc(e);var n=e.queue,a=Uh.bind(null,Le,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:Rc,useDeferredValue:function(e,n){var a=an();return Ac(a,e,n)},useTransition:function(){var e=kc(!1);return e=Mh.bind(null,Le,e.queue,!0,!1),an().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var o=Le,d=an();if(Fe){if(a===void 0)throw Error(r(407));a=a()}else{if(a=n(),ot===null)throw Error(r(349));(Pe&127)!==0||rh(o,n,a)}d.memoizedState=a;var h={value:a,getSnapshot:n};return d.queue=h,Nh(ch.bind(null,o,h,e),[e]),o.flags|=2048,ti(9,{destroy:void 0},oh.bind(null,o,h,a,n),null),a},useId:function(){var e=an(),n=ot.identifierPrefix;if(Fe){var a=Jn,o=Wn;a=(o&~(1<<32-pt(o)-1)).toString(32)+a,n="_"+n+"R_"+a,a=dr++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=gx++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:zc,useFormState:yh,useActionState:yh,useOptimistic:function(e){var n=an();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Oc.bind(null,Le,!0,a),a.dispatch=n,[e,n]},useMemoCache:wc,useCacheRefresh:function(){return an().memoizedState=jx.bind(null,Le)},useEffectEvent:function(e){var n=an(),a={impl:e};return n.memoizedState=a,function(){if((Je&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Dc={readContext:Kt,use:hr,useCallback:Ch,useContext:Kt,useEffect:Cc,useImperativeHandle:Th,useInsertionEffect:Eh,useLayoutEffect:_h,useMemo:Rh,useReducer:mr,useRef:jh,useState:function(){return mr(hs)},useDebugValue:Rc,useDeferredValue:function(e,n){var a=_t();return Ah(a,at.memoizedState,e,n)},useTransition:function(){var e=mr(hs)[0],n=_t().memoizedState;return[typeof e=="boolean"?e:Ji(e),n]},useSyncExternalStore:lh,useId:Dh,useHostTransitionStatus:zc,useFormState:bh,useActionState:bh,useOptimistic:function(e,n){var a=_t();return fh(a,at,e,n)},useMemoCache:wc,useCacheRefresh:Lh};Dc.useEffectEvent=wh;var Hh={readContext:Kt,use:hr,useCallback:Ch,useContext:Kt,useEffect:Cc,useImperativeHandle:Th,useInsertionEffect:Eh,useLayoutEffect:_h,useMemo:Rh,useReducer:_c,useRef:jh,useState:function(){return _c(hs)},useDebugValue:Rc,useDeferredValue:function(e,n){var a=_t();return at===null?Ac(a,e,n):Ah(a,at.memoizedState,e,n)},useTransition:function(){var e=_c(hs)[0],n=_t().memoizedState;return[typeof e=="boolean"?e:Ji(e),n]},useSyncExternalStore:lh,useId:Dh,useHostTransitionStatus:zc,useFormState:Sh,useActionState:Sh,useOptimistic:function(e,n){var a=_t();return at!==null?fh(a,at,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:wc,useCacheRefresh:Lh};Hh.useEffectEvent=wh;function Lc(e,n,a,o){n=e.memoizedState,a=a(o,n),a=a==null?n:b({},n,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Uc={enqueueSetState:function(e,n,a){e=e._reactInternals;var o=_n(),d=Us(o);d.payload=n,a!=null&&(d.callback=a),n=$s(e,d,o),n!==null&&(pn(n,e,o),Xi(n,e,o))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var o=_n(),d=Us(o);d.tag=1,d.payload=n,a!=null&&(d.callback=a),n=$s(e,d,o),n!==null&&(pn(n,e,o),Xi(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=_n(),o=Us(a);o.tag=2,n!=null&&(o.callback=n),n=$s(e,o,a),n!==null&&(pn(n,e,a),Xi(n,e,a))}};function Zh(e,n,a,o,d,h,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,x):n.prototype&&n.prototype.isPureReactComponent?!Hi(a,o)||!Hi(d,h):!0}function qh(e,n,a,o){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,o),n.state!==e&&Uc.enqueueReplaceState(n,n.state,null)}function Na(e,n){var a=n;if("ref"in n){a={};for(var o in n)o!=="ref"&&(a[o]=n[o])}if(e=e.defaultProps){a===n&&(a=b({},a));for(var d in e)a[d]===void 0&&(a[d]=e[d])}return a}function Ph(e){Xl(e)}function Vh(e){console.error(e)}function Gh(e){Xl(e)}function yr(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Fh(e,n,a){try{var o=e.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function $c(e,n,a){return a=Us(a),a.tag=3,a.payload={element:null},a.callback=function(){yr(e,n)},a}function Yh(e){return e=Us(e),e.tag=3,e}function Xh(e,n,a,o){var d=a.type.getDerivedStateFromError;if(typeof d=="function"){var h=o.value;e.payload=function(){return d(h)},e.callback=function(){Fh(n,a,o)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Fh(n,a,o),typeof d!="function"&&(Ps===null?Ps=new Set([this]):Ps.add(this));var E=o.stack;this.componentDidCatch(o.value,{componentStack:E!==null?E:""})})}function wx(e,n,a,o,d){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=a.alternate,n!==null&&Fa(n,a,d,!0),a=jn.current,a!==null){switch(a.tag){case 31:case 13:return Un===null?Rr():a.alternate===null&&jt===0&&(jt=3),a.flags&=-257,a.flags|=65536,a.lanes=d,o===ir?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([o]):n.add(o),cu(e,o,d)),!1;case 22:return a.flags|=65536,o===ir?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([o]):a.add(o)),cu(e,o,d)),!1}throw Error(r(435,a.tag))}return cu(e,o,d),Rr(),!1}if(Fe)return n=jn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,o!==sc&&(e=Error(r(422),{cause:o}),Pi(zn(e,a)))):(o!==sc&&(n=Error(r(423),{cause:o}),Pi(zn(n,a))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,o=zn(o,a),d=$c(e.stateNode,o,d),mc(e,d),jt!==4&&(jt=2)),!1;var h=Error(r(520),{cause:o});if(h=zn(h,a),cl===null?cl=[h]:cl.push(h),jt!==4&&(jt=2),n===null)return!0;o=zn(o,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=d&-d,a.lanes|=e,e=$c(a.stateNode,o,e),mc(a,e),!1;case 1:if(n=a.type,h=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Ps===null||!Ps.has(h))))return a.flags|=65536,d&=-d,a.lanes|=d,d=Yh(d),Xh(d,e,a,o),mc(a,d),!1}a=a.return}while(a!==null);return!1}var Bc=Error(r(461)),Ct=!1;function Qt(e,n,a,o){n.child=e===null?Jf(n,null,a,o):Sa(n,e.child,a,o)}function Kh(e,n,a,o,d){a=a.render;var h=n.ref;if("ref"in o){var x={};for(var E in o)E!=="ref"&&(x[E]=o[E])}else x=o;return va(n),o=xc(e,n,a,x,h,d),E=Sc(),e!==null&&!Ct?(jc(e,n,d),ms(e,n,d)):(Fe&&E&&tc(n),n.flags|=1,Qt(e,n,o,d),n.child)}function Qh(e,n,a,o,d){if(e===null){var h=a.type;return typeof h=="function"&&!Wo(h)&&h.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=h,Wh(e,n,h,o,d)):(e=Jl(a.type,null,o,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!Fc(e,d)){var x=h.memoizedProps;if(a=a.compare,a=a!==null?a:Hi,a(x,o)&&e.ref===n.ref)return ms(e,n,d)}return n.flags|=1,e=os(h,o),e.ref=n.ref,e.return=n,n.child=e}function Wh(e,n,a,o,d){if(e!==null){var h=e.memoizedProps;if(Hi(h,o)&&e.ref===n.ref)if(Ct=!1,n.pendingProps=o=h,Fc(e,d))(e.flags&131072)!==0&&(Ct=!0);else return n.lanes=e.lanes,ms(e,n,d)}return Ic(e,n,a,o,d)}function Jh(e,n,a,o){var d=o.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|a:a,e!==null){for(o=n.child=e.child,d=0;o!==null;)d=d|o.lanes|o.childLanes,o=o.sibling;o=d&~h}else o=0,n.child=null;return em(e,n,h,a,o)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&sr(n,h!==null?h.cachePool:null),h!==null?nh(n,h):gc(),sh(n);else return o=n.lanes=536870912,em(e,n,h!==null?h.baseLanes|a:a,a,o)}else h!==null?(sr(n,h.cachePool),nh(n,h),Is(),n.memoizedState=null):(e!==null&&sr(n,null),gc(),Is());return Qt(e,n,d,a),n.child}function nl(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function em(e,n,a,o,d){var h=uc();return h=h===null?null:{parent:kt._currentValue,pool:h},n.memoizedState={baseLanes:a,cachePool:h},e!==null&&sr(n,null),gc(),sh(n),e!==null&&Fa(e,n,o,!0),n.childLanes=d,null}function br(e,n){return n=Sr({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function tm(e,n,a){return Sa(n,e.child,null,a),e=br(n,n.pendingProps),e.flags|=2,Nn(n),n.memoizedState=null,e}function Ex(e,n,a){var o=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Fe){if(o.mode==="hidden")return e=br(n,o),n.lanes=536870912,nl(null,e);if(yc(n),(e=ut)?(e=hp(e,Ln),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ms!==null?{id:Wn,overflow:Jn}:null,retryLane:536870912,hydrationErrors:null},a=$f(e),a.return=n,n.child=a,Xt=n,ut=null)):e=null,e===null)throw Os(n);return n.lanes=536870912,null}return br(n,o)}var h=e.memoizedState;if(h!==null){var x=h.dehydrated;if(yc(n),d)if(n.flags&256)n.flags&=-257,n=tm(e,n,a);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(r(558));else if(Ct||Fa(e,n,a,!1),d=(a&e.childLanes)!==0,Ct||d){if(o=ot,o!==null&&(x=Ul(o,a),x!==0&&x!==h.retryLane))throw h.retryLane=x,ha(e,x),pn(o,e,x),Bc;Rr(),n=tm(e,n,a)}else e=h.treeContext,ut=$n(x.nextSibling),Xt=n,Fe=!0,zs=null,Ln=!1,e!==null&&Hf(n,e),n=br(n,o),n.flags|=4096;return n}return e=os(e.child,{mode:o.mode,children:o.children}),e.ref=n.ref,n.child=e,e.return=n,e}function xr(e,n){var a=n.ref;if(a===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(e===null||e.ref!==a)&&(n.flags|=4194816)}}function Ic(e,n,a,o,d){return va(n),a=xc(e,n,a,o,void 0,d),o=Sc(),e!==null&&!Ct?(jc(e,n,d),ms(e,n,d)):(Fe&&o&&tc(n),n.flags|=1,Qt(e,n,a,d),n.child)}function nm(e,n,a,o,d,h){return va(n),n.updateQueue=null,a=ih(n,o,a,d),ah(e),o=Sc(),e!==null&&!Ct?(jc(e,n,h),ms(e,n,h)):(Fe&&o&&tc(n),n.flags|=1,Qt(e,n,a,h),n.child)}function sm(e,n,a,o,d){if(va(n),n.stateNode===null){var h=qa,x=a.contextType;typeof x=="object"&&x!==null&&(h=Kt(x)),h=new a(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Uc,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},fc(n),x=a.contextType,h.context=typeof x=="object"&&x!==null?Kt(x):qa,h.state=n.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Lc(n,a,x,o),h.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(x=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),x!==h.state&&Uc.enqueueReplaceState(h,h.state,null),Qi(n,o,h,d),Ki(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){h=n.stateNode;var E=n.memoizedProps,M=Na(a,E);h.props=M;var V=h.context,W=a.contextType;x=qa,typeof W=="object"&&W!==null&&(x=Kt(W));var te=a.getDerivedStateFromProps;W=typeof te=="function"||typeof h.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,W||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(E||V!==x)&&qh(n,h,o,x),Ls=!1;var G=n.memoizedState;h.state=G,Qi(n,o,h,d),Ki(),V=n.memoizedState,E||G!==V||Ls?(typeof te=="function"&&(Lc(n,a,te,o),V=n.memoizedState),(M=Ls||Zh(n,a,M,o,G,V,x))?(W||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=V),h.props=o,h.state=V,h.context=x,o=M):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,hc(e,n),x=n.memoizedProps,W=Na(a,x),h.props=W,te=n.pendingProps,G=h.context,V=a.contextType,M=qa,typeof V=="object"&&V!==null&&(M=Kt(V)),E=a.getDerivedStateFromProps,(V=typeof E=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==te||G!==M)&&qh(n,h,o,M),Ls=!1,G=n.memoizedState,h.state=G,Qi(n,o,h,d),Ki();var K=n.memoizedState;x!==te||G!==K||Ls||e!==null&&e.dependencies!==null&&tr(e.dependencies)?(typeof E=="function"&&(Lc(n,a,E,o),K=n.memoizedState),(W=Ls||Zh(n,a,W,o,G,K,M)||e!==null&&e.dependencies!==null&&tr(e.dependencies))?(V||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,K,M),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,K,M)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=K),h.props=o,h.state=K,h.context=M,o=W):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),o=!1)}return h=o,xr(e,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&o?(n.child=Sa(n,e.child,null,d),n.child=Sa(n,null,a,d)):Qt(e,n,a,d),n.memoizedState=h.state,e=n.child):e=ms(e,n,d),e}function am(e,n,a,o){return pa(),n.flags|=256,Qt(e,n,a,o),n.child}var Hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:Ff()}}function qc(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=En),e}function im(e,n,a){var o=n.pendingProps,d=!1,h=(n.flags&128)!==0,x;if((x=h)||(x=e!==null&&e.memoizedState===null?!1:(Et.current&2)!==0),x&&(d=!0,n.flags&=-129),x=(n.flags&32)!==0,n.flags&=-33,e===null){if(Fe){if(d?Bs(n):Is(),(e=ut)?(e=hp(e,Ln),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ms!==null?{id:Wn,overflow:Jn}:null,retryLane:536870912,hydrationErrors:null},a=$f(e),a.return=n,n.child=a,Xt=n,ut=null)):e=null,e===null)throw Os(n);return Eu(e)?n.lanes=32:n.lanes=536870912,null}var E=o.children;return o=o.fallback,d?(Is(),d=n.mode,E=Sr({mode:"hidden",children:E},d),o=ma(o,d,a,null),E.return=n,o.return=n,E.sibling=o,n.child=E,o=n.child,o.memoizedState=Zc(a),o.childLanes=qc(e,x,a),n.memoizedState=Hc,nl(null,o)):(Bs(n),Pc(n,E))}var M=e.memoizedState;if(M!==null&&(E=M.dehydrated,E!==null)){if(h)n.flags&256?(Bs(n),n.flags&=-257,n=Vc(e,n,a)):n.memoizedState!==null?(Is(),n.child=e.child,n.flags|=128,n=null):(Is(),E=o.fallback,d=n.mode,o=Sr({mode:"visible",children:o.children},d),E=ma(E,d,a,null),E.flags|=2,o.return=n,E.return=n,o.sibling=E,n.child=o,Sa(n,e.child,null,a),o=n.child,o.memoizedState=Zc(a),o.childLanes=qc(e,x,a),n.memoizedState=Hc,n=nl(null,o));else if(Bs(n),Eu(E)){if(x=E.nextSibling&&E.nextSibling.dataset,x)var V=x.dgst;x=V,o=Error(r(419)),o.stack="",o.digest=x,Pi({value:o,source:null,stack:null}),n=Vc(e,n,a)}else if(Ct||Fa(e,n,a,!1),x=(a&e.childLanes)!==0,Ct||x){if(x=ot,x!==null&&(o=Ul(x,a),o!==0&&o!==M.retryLane))throw M.retryLane=o,ha(e,o),pn(x,e,o),Bc;wu(E)||Rr(),n=Vc(e,n,a)}else wu(E)?(n.flags|=192,n.child=e.child,n=null):(e=M.treeContext,ut=$n(E.nextSibling),Xt=n,Fe=!0,zs=null,Ln=!1,e!==null&&Hf(n,e),n=Pc(n,o.children),n.flags|=4096);return n}return d?(Is(),E=o.fallback,d=n.mode,M=e.child,V=M.sibling,o=os(M,{mode:"hidden",children:o.children}),o.subtreeFlags=M.subtreeFlags&65011712,V!==null?E=os(V,E):(E=ma(E,d,a,null),E.flags|=2),E.return=n,o.return=n,o.sibling=E,n.child=o,nl(null,o),o=n.child,E=e.child.memoizedState,E===null?E=Zc(a):(d=E.cachePool,d!==null?(M=kt._currentValue,d=d.parent!==M?{parent:M,pool:M}:d):d=Ff(),E={baseLanes:E.baseLanes|a,cachePool:d}),o.memoizedState=E,o.childLanes=qc(e,x,a),n.memoizedState=Hc,nl(e.child,o)):(Bs(n),a=e.child,e=a.sibling,a=os(a,{mode:"visible",children:o.children}),a.return=n,a.sibling=null,e!==null&&(x=n.deletions,x===null?(n.deletions=[e],n.flags|=16):x.push(e)),n.child=a,n.memoizedState=null,a)}function Pc(e,n){return n=Sr({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Sr(e,n){return e=Sn(22,e,null,n),e.lanes=0,e}function Vc(e,n,a){return Sa(n,e.child,null,a),e=Pc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function lm(e,n,a){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),lc(e.return,n,a)}function Gc(e,n,a,o,d,h){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:d,treeForkCount:h}:(x.isBackwards=n,x.rendering=null,x.renderingStartTime=0,x.last=o,x.tail=a,x.tailMode=d,x.treeForkCount=h)}function rm(e,n,a){var o=n.pendingProps,d=o.revealOrder,h=o.tail;o=o.children;var x=Et.current,E=(x&2)!==0;if(E?(x=x&1|2,n.flags|=128):x&=1,X(Et,x),Qt(e,n,o,a),o=Fe?qi:0,!E&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lm(e,a,n);else if(e.tag===19)lm(e,a,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(a=n.child,d=null;a!==null;)e=a.alternate,e!==null&&cr(e)===null&&(d=a),a=a.sibling;a=d,a===null?(d=n.child,n.child=null):(d=a.sibling,a.sibling=null),Gc(n,!1,d,a,h,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&cr(e)===null){n.child=d;break}e=d.sibling,d.sibling=a,a=d,d=e}Gc(n,!0,a,null,h,o);break;case"together":Gc(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function ms(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),qs|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(Fa(e,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(r(153));if(n.child!==null){for(e=n.child,a=os(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=os(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function Fc(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&tr(e)))}function _x(e,n,a){switch(n.tag){case 3:Ae(n,n.stateNode.containerInfo),Ds(n,kt,e.memoizedState.cache),pa();break;case 27:case 5:xe(n);break;case 4:Ae(n,n.stateNode.containerInfo);break;case 10:Ds(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,yc(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Bs(n),n.flags|=128,null):(a&n.child.childLanes)!==0?im(e,n,a):(Bs(n),e=ms(e,n,a),e!==null?e.sibling:null);Bs(n);break;case 19:var d=(e.flags&128)!==0;if(o=(a&n.childLanes)!==0,o||(Fa(e,n,a,!1),o=(a&n.childLanes)!==0),d){if(o)return rm(e,n,a);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),X(Et,Et.current),o)break;return null;case 22:return n.lanes=0,Jh(e,n,a,n.pendingProps);case 24:Ds(n,kt,e.memoizedState.cache)}return ms(e,n,a)}function om(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)Ct=!0;else{if(!Fc(e,a)&&(n.flags&128)===0)return Ct=!1,_x(e,n,a);Ct=(e.flags&131072)!==0}else Ct=!1,Fe&&(n.flags&1048576)!==0&&If(n,qi,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(e=ba(n.elementType),n.type=e,typeof e=="function")Wo(e)?(o=Na(e,o),n.tag=1,n=sm(null,n,e,o,a)):(n.tag=0,n=Ic(null,n,e,o,a));else{if(e!=null){var d=e.$$typeof;if(d===H){n.tag=11,n=Kh(null,n,e,o,a);break e}else if(d===D){n.tag=14,n=Qh(null,n,e,o,a);break e}}throw n=le(e)||e,Error(r(306,n,""))}}return n;case 0:return Ic(e,n,n.type,n.pendingProps,a);case 1:return o=n.type,d=Na(o,n.pendingProps),sm(e,n,o,d,a);case 3:e:{if(Ae(n,n.stateNode.containerInfo),e===null)throw Error(r(387));o=n.pendingProps;var h=n.memoizedState;d=h.element,hc(e,n),Qi(n,o,null,a);var x=n.memoizedState;if(o=x.cache,Ds(n,kt,o),o!==h.cache&&rc(n,[kt],a,!0),Ki(),o=x.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:x.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=am(e,n,o,a);break e}else if(o!==d){d=zn(Error(r(424)),n),Pi(d),n=am(e,n,o,a);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ut=$n(e.firstChild),Xt=n,Fe=!0,zs=null,Ln=!0,a=Jf(n,null,o,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(pa(),o===d){n=ms(e,n,a);break e}Qt(e,n,o,a)}n=n.child}return n;case 26:return xr(e,n),e===null?(a=bp(n.type,null,n.pendingProps,null))?n.memoizedState=a:Fe||(a=n.type,e=n.pendingProps,o=Ur(ie.current).createElement(a),o[Lt]=n,o[Ft]=e,Wt(o,a,e),Ge(o),n.stateNode=o):n.memoizedState=bp(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return xe(n),e===null&&Fe&&(o=n.stateNode=gp(n.type,n.pendingProps,ie.current),Xt=n,Ln=!0,d=ut,Ys(n.type)?(_u=d,ut=$n(o.firstChild)):ut=d),Qt(e,n,n.pendingProps.children,a),xr(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Fe&&((d=o=ut)&&(o=nS(o,n.type,n.pendingProps,Ln),o!==null?(n.stateNode=o,Xt=n,ut=$n(o.firstChild),Ln=!1,d=!0):d=!1),d||Os(n)),xe(n),d=n.type,h=n.pendingProps,x=e!==null?e.memoizedProps:null,o=h.children,Su(d,h)?o=null:x!==null&&Su(d,x)&&(n.flags|=32),n.memoizedState!==null&&(d=xc(e,n,vx,null,null,a),vl._currentValue=d),xr(e,n),Qt(e,n,o,a),n.child;case 6:return e===null&&Fe&&((e=a=ut)&&(a=sS(a,n.pendingProps,Ln),a!==null?(n.stateNode=a,Xt=n,ut=null,e=!0):e=!1),e||Os(n)),null;case 13:return im(e,n,a);case 4:return Ae(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=Sa(n,null,o,a):Qt(e,n,o,a),n.child;case 11:return Kh(e,n,n.type,n.pendingProps,a);case 7:return Qt(e,n,n.pendingProps,a),n.child;case 8:return Qt(e,n,n.pendingProps.children,a),n.child;case 12:return Qt(e,n,n.pendingProps.children,a),n.child;case 10:return o=n.pendingProps,Ds(n,n.type,o.value),Qt(e,n,o.children,a),n.child;case 9:return d=n.type._context,o=n.pendingProps.children,va(n),d=Kt(d),o=o(d),n.flags|=1,Qt(e,n,o,a),n.child;case 14:return Qh(e,n,n.type,n.pendingProps,a);case 15:return Wh(e,n,n.type,n.pendingProps,a);case 19:return rm(e,n,a);case 31:return Ex(e,n,a);case 22:return Jh(e,n,a,n.pendingProps);case 24:return va(n),o=Kt(kt),e===null?(d=uc(),d===null&&(d=ot,h=oc(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=a),d=h),n.memoizedState={parent:o,cache:d},fc(n),Ds(n,kt,d)):((e.lanes&a)!==0&&(hc(e,n),Qi(n,null,null,a),Ki()),d=e.memoizedState,h=n.memoizedState,d.parent!==o?(d={parent:o,cache:o},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),Ds(n,kt,o)):(o=h.cache,Ds(n,kt,o),o!==d.cache&&rc(n,[kt],a,!0))),Qt(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function ps(e){e.flags|=4}function Yc(e,n,a,o,d){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Dm())e.flags|=8192;else throw xa=ir,dc}else e.flags&=-16777217}function cm(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!wp(n))if(Dm())e.flags|=8192;else throw xa=ir,dc}function jr(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Ri():536870912,e.lanes|=n,ii|=n)}function sl(e,n){if(!Fe)switch(e.tailMode){case"hidden":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function dt(e){var n=e.alternate!==null&&e.alternate.child===e.child,a=0,o=0;if(n)for(var d=e.child;d!==null;)a|=d.lanes|d.childLanes,o|=d.subtreeFlags&65011712,o|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)a|=d.lanes|d.childLanes,o|=d.subtreeFlags,o|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=o,e.childLanes=a,n}function kx(e,n,a){var o=n.pendingProps;switch(nc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(n),null;case 1:return dt(n),null;case 3:return a=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),ds(kt),be(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ga(n)?ps(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ac())),dt(n),null;case 26:var d=n.type,h=n.memoizedState;return e===null?(ps(n),h!==null?(dt(n),cm(n,h)):(dt(n),Yc(n,d,null,o,a))):h?h!==e.memoizedState?(ps(n),dt(n),cm(n,h)):(dt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&ps(n),dt(n),Yc(n,d,e,o,a)),null;case 27:if(Ce(n),a=ie.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&ps(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return dt(n),null}e=ae.current,Ga(n)?Zf(n):(e=gp(d,o,a),n.stateNode=e,ps(n))}return dt(n),null;case 5:if(Ce(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&ps(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return dt(n),null}if(h=ae.current,Ga(n))Zf(n);else{var x=Ur(ie.current);switch(h){case 1:h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=x.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?x.createElement("select",{is:o.is}):x.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?x.createElement(d,{is:o.is}):x.createElement(d)}}h[Lt]=n,h[Ft]=o;e:for(x=n.child;x!==null;){if(x.tag===5||x.tag===6)h.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===n)break e;for(;x.sibling===null;){if(x.return===null||x.return===n)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}n.stateNode=h;e:switch(Wt(h,d,o),d){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ps(n)}}return dt(n),Yc(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&ps(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(e=ie.current,Ga(n)){if(e=n.stateNode,a=n.memoizedProps,o=null,d=Xt,d!==null)switch(d.tag){case 27:case 5:o=d.memoizedProps}e[Lt]=n,e=!!(e.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||ip(e.nodeValue,a)),e||Os(n,!0)}else e=Ur(e).createTextNode(o),e[Lt]=n,n.stateNode=e}return dt(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(o=Ga(n),a!==null){if(e===null){if(!o)throw Error(r(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Lt]=n}else pa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;dt(n),e=!1}else a=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(Nn(n),n):(Nn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return dt(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Ga(n),o!==null&&o.dehydrated!==null){if(e===null){if(!d)throw Error(r(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));d[Lt]=n}else pa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;dt(n),d=!1}else d=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(Nn(n),n):(Nn(n),null)}return Nn(n),(n.flags&128)!==0?(n.lanes=a,n):(a=o!==null,e=e!==null&&e.memoizedState!==null,a&&(o=n.child,d=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(d=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==d&&(o.flags|=2048)),a!==e&&a&&(n.child.flags|=8192),jr(n,n.updateQueue),dt(n),null);case 4:return be(),e===null&&gu(n.stateNode.containerInfo),dt(n),null;case 10:return ds(n.type),dt(n),null;case 19:if(Y(Et),o=n.memoizedState,o===null)return dt(n),null;if(d=(n.flags&128)!==0,h=o.rendering,h===null)if(d)sl(o,!1);else{if(jt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=cr(e),h!==null){for(n.flags|=128,sl(o,!1),e=h.updateQueue,n.updateQueue=e,jr(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)Uf(a,e),a=a.sibling;return X(Et,Et.current&1|2),Fe&&cs(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&We()>kr&&(n.flags|=128,d=!0,sl(o,!1),n.lanes=4194304)}else{if(!d)if(e=cr(h),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,jr(n,e),sl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Fe)return dt(n),null}else 2*We()-o.renderingStartTime>kr&&a!==536870912&&(n.flags|=128,d=!0,sl(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(e=o.last,e!==null?e.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=We(),e.sibling=null,a=Et.current,X(Et,d?a&1|2:a&1),Fe&&cs(n,o.treeForkCount),e):(dt(n),null);case 22:case 23:return Nn(n),vc(),o=n.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(a&536870912)!==0&&(n.flags&128)===0&&(dt(n),n.subtreeFlags&6&&(n.flags|=8192)):dt(n),a=n.updateQueue,a!==null&&jr(n,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==a&&(n.flags|=2048),e!==null&&Y(ya),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),ds(kt),dt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function Tx(e,n){switch(nc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ds(kt),be(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Ce(n),null;case 31:if(n.memoizedState!==null){if(Nn(n),n.alternate===null)throw Error(r(340));pa()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Nn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));pa()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Y(Et),null;case 4:return be(),null;case 10:return ds(n.type),null;case 22:case 23:return Nn(n),vc(),e!==null&&Y(ya),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return ds(kt),null;case 25:return null;default:return null}}function um(e,n){switch(nc(n),n.tag){case 3:ds(kt),be();break;case 26:case 27:case 5:Ce(n);break;case 4:be();break;case 31:n.memoizedState!==null&&Nn(n);break;case 13:Nn(n);break;case 19:Y(Et);break;case 10:ds(n.type);break;case 22:case 23:Nn(n),vc(),e!==null&&Y(ya);break;case 24:ds(kt)}}function al(e,n){try{var a=n.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var d=o.next;a=d;do{if((a.tag&e)===e){o=void 0;var h=a.create,x=a.inst;o=h(),x.destroy=o}a=a.next}while(a!==d)}}catch(E){st(n,n.return,E)}}function Hs(e,n,a){try{var o=n.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var h=d.next;o=h;do{if((o.tag&e)===e){var x=o.inst,E=x.destroy;if(E!==void 0){x.destroy=void 0,d=n;var M=a,V=E;try{V()}catch(W){st(d,M,W)}}}o=o.next}while(o!==h)}}catch(W){st(n,n.return,W)}}function dm(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{th(n,a)}catch(o){st(e,e.return,o)}}}function fm(e,n,a){a.props=Na(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(o){st(e,n,o)}}function il(e,n){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof a=="function"?e.refCleanup=a(o):a.current=o}}catch(d){st(e,n,d)}}function es(e,n){var a=e.ref,o=e.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(d){st(e,n,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(d){st(e,n,d)}else a.current=null}function hm(e){var n=e.type,a=e.memoizedProps,o=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(d){st(e,e.return,d)}}function Xc(e,n,a){try{var o=e.stateNode;Kx(o,e.type,a,n),o[Ft]=n}catch(d){st(e,e.return,d)}}function mm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ys(e.type)||e.tag===4}function Kc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ys(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qc(e,n,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(e),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=ls));else if(o!==4&&(o===27&&Ys(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(Qc(e,n,a),e=e.sibling;e!==null;)Qc(e,n,a),e=e.sibling}function Nr(e,n,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?a.insertBefore(e,n):a.appendChild(e);else if(o!==4&&(o===27&&Ys(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Nr(e,n,a),e=e.sibling;e!==null;)Nr(e,n,a),e=e.sibling}function pm(e){var n=e.stateNode,a=e.memoizedProps;try{for(var o=e.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);Wt(n,o,a),n[Lt]=e,n[Ft]=a}catch(h){st(e,e.return,h)}}var gs=!1,Rt=!1,Wc=!1,gm=typeof WeakSet=="function"?WeakSet:Set,qt=null;function Cx(e,n){if(e=e.containerInfo,bu=Pr,e=Tf(e),Vo(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var d=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var x=0,E=-1,M=-1,V=0,W=0,te=e,G=null;t:for(;;){for(var K;te!==a||d!==0&&te.nodeType!==3||(E=x+d),te!==h||o!==0&&te.nodeType!==3||(M=x+o),te.nodeType===3&&(x+=te.nodeValue.length),(K=te.firstChild)!==null;)G=te,te=K;for(;;){if(te===e)break t;if(G===a&&++V===d&&(E=x),G===h&&++W===o&&(M=x),(K=te.nextSibling)!==null)break;te=G,G=te.parentNode}te=K}a=E===-1||M===-1?null:{start:E,end:M}}else a=null}a=a||{start:0,end:0}}else a=null;for(xu={focusedElem:e,selectionRange:a},Pr=!1,qt=n;qt!==null;)if(n=qt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,qt=e;else for(;qt!==null;){switch(n=qt,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)d=e[a],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,a=n,d=h.memoizedProps,h=h.memoizedState,o=a.stateNode;try{var je=Na(a.type,d);e=o.getSnapshotBeforeUpdate(je,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(Te){st(a,a.return,Te)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)Nu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=n.sibling,e!==null){e.return=n.return,qt=e;break}qt=n.return}}function vm(e,n,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:ys(e,a),o&4&&al(5,a);break;case 1:if(ys(e,a),o&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(x){st(a,a.return,x)}else{var d=Na(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(x){st(a,a.return,x)}}o&64&&dm(a),o&512&&il(a,a.return);break;case 3:if(ys(e,a),o&64&&(e=a.updateQueue,e!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{th(e,n)}catch(x){st(a,a.return,x)}}break;case 27:n===null&&o&4&&pm(a);case 26:case 5:ys(e,a),n===null&&o&4&&hm(a),o&512&&il(a,a.return);break;case 12:ys(e,a);break;case 31:ys(e,a),o&4&&xm(e,a);break;case 13:ys(e,a),o&4&&Sm(e,a),o&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=$x.bind(null,a),aS(e,a))));break;case 22:if(o=a.memoizedState!==null||gs,!o){n=n!==null&&n.memoizedState!==null||Rt,d=gs;var h=Rt;gs=o,(Rt=n)&&!h?bs(e,a,(a.subtreeFlags&8772)!==0):ys(e,a),gs=d,Rt=h}break;case 30:break;default:ys(e,a)}}function ym(e){var n=e.alternate;n!==null&&(e.alternate=null,ym(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&zi(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ft=null,dn=!1;function vs(e,n,a){for(a=a.child;a!==null;)bm(e,n,a),a=a.sibling}function bm(e,n,a){if(He&&typeof He.onCommitFiberUnmount=="function")try{He.onCommitFiberUnmount(Ht,a)}catch{}switch(a.tag){case 26:Rt||es(a,n),vs(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Rt||es(a,n);var o=ft,d=dn;Ys(a.type)&&(ft=a.stateNode,dn=!1),vs(e,n,a),ml(a.stateNode),ft=o,dn=d;break;case 5:Rt||es(a,n);case 6:if(o=ft,d=dn,ft=null,vs(e,n,a),ft=o,dn=d,ft!==null)if(dn)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(a.stateNode)}catch(h){st(a,n,h)}else try{ft.removeChild(a.stateNode)}catch(h){st(a,n,h)}break;case 18:ft!==null&&(dn?(e=ft,dp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),hi(e)):dp(ft,a.stateNode));break;case 4:o=ft,d=dn,ft=a.stateNode.containerInfo,dn=!0,vs(e,n,a),ft=o,dn=d;break;case 0:case 11:case 14:case 15:Hs(2,a,n),Rt||Hs(4,a,n),vs(e,n,a);break;case 1:Rt||(es(a,n),o=a.stateNode,typeof o.componentWillUnmount=="function"&&fm(a,n,o)),vs(e,n,a);break;case 21:vs(e,n,a);break;case 22:Rt=(o=Rt)||a.memoizedState!==null,vs(e,n,a),Rt=o;break;default:vs(e,n,a)}}function xm(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{hi(e)}catch(a){st(n,n.return,a)}}}function Sm(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{hi(e)}catch(a){st(n,n.return,a)}}function Rx(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new gm),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new gm),n;default:throw Error(r(435,e.tag))}}function wr(e,n){var a=Rx(e);n.forEach(function(o){if(!a.has(o)){a.add(o);var d=Bx.bind(null,e,o);o.then(d,d)}})}function fn(e,n){var a=n.deletions;if(a!==null)for(var o=0;o<a.length;o++){var d=a[o],h=e,x=n,E=x;e:for(;E!==null;){switch(E.tag){case 27:if(Ys(E.type)){ft=E.stateNode,dn=!1;break e}break;case 5:ft=E.stateNode,dn=!1;break e;case 3:case 4:ft=E.stateNode.containerInfo,dn=!0;break e}E=E.return}if(ft===null)throw Error(r(160));bm(h,x,d),ft=null,dn=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)jm(n,e),n=n.sibling}var Fn=null;function jm(e,n){var a=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:fn(n,e),hn(e),o&4&&(Hs(3,e,e.return),al(3,e),Hs(5,e,e.return));break;case 1:fn(n,e),hn(e),o&512&&(Rt||a===null||es(a,a.return)),o&64&&gs&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var d=Fn;if(fn(n,e),hn(e),o&512&&(Rt||a===null||es(a,a.return)),o&4){var h=a!==null?a.memoizedState:null;if(o=e.memoizedState,a===null)if(o===null)if(e.stateNode===null){e:{o=e.type,a=e.memoizedProps,d=d.ownerDocument||d;t:switch(o){case"title":h=d.getElementsByTagName("title")[0],(!h||h[Cs]||h[Lt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(o),d.head.insertBefore(h,d.querySelector("head > title"))),Wt(h,o,a),h[Lt]=e,Ge(h),o=h;break e;case"link":var x=jp("link","href",d).get(o+(a.href||""));if(x){for(var E=0;E<x.length;E++)if(h=x[E],h.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&h.getAttribute("rel")===(a.rel==null?null:a.rel)&&h.getAttribute("title")===(a.title==null?null:a.title)&&h.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(E,1);break t}}h=d.createElement(o),Wt(h,o,a),d.head.appendChild(h);break;case"meta":if(x=jp("meta","content",d).get(o+(a.content||""))){for(E=0;E<x.length;E++)if(h=x[E],h.getAttribute("content")===(a.content==null?null:""+a.content)&&h.getAttribute("name")===(a.name==null?null:a.name)&&h.getAttribute("property")===(a.property==null?null:a.property)&&h.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&h.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(E,1);break t}}h=d.createElement(o),Wt(h,o,a),d.head.appendChild(h);break;default:throw Error(r(468,o))}h[Lt]=e,Ge(h),o=h}e.stateNode=o}else Np(d,e.type,e.stateNode);else e.stateNode=Sp(d,o,e.memoizedProps);else h!==o?(h===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):h.count--,o===null?Np(d,e.type,e.stateNode):Sp(d,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Xc(e,e.memoizedProps,a.memoizedProps)}break;case 27:fn(n,e),hn(e),o&512&&(Rt||a===null||es(a,a.return)),a!==null&&o&4&&Xc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(fn(n,e),hn(e),o&512&&(Rt||a===null||es(a,a.return)),e.flags&32){d=e.stateNode;try{La(d,"")}catch(je){st(e,e.return,je)}}o&4&&e.stateNode!=null&&(d=e.memoizedProps,Xc(e,d,a!==null?a.memoizedProps:d)),o&1024&&(Wc=!0);break;case 6:if(fn(n,e),hn(e),o&4){if(e.stateNode===null)throw Error(r(162));o=e.memoizedProps,a=e.stateNode;try{a.nodeValue=o}catch(je){st(e,e.return,je)}}break;case 3:if(Ir=null,d=Fn,Fn=$r(n.containerInfo),fn(n,e),Fn=d,hn(e),o&4&&a!==null&&a.memoizedState.isDehydrated)try{hi(n.containerInfo)}catch(je){st(e,e.return,je)}Wc&&(Wc=!1,Nm(e));break;case 4:o=Fn,Fn=$r(e.stateNode.containerInfo),fn(n,e),hn(e),Fn=o;break;case 12:fn(n,e),hn(e);break;case 31:fn(n,e),hn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,wr(e,o)));break;case 13:fn(n,e),hn(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(_r=We()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,wr(e,o)));break;case 22:d=e.memoizedState!==null;var M=a!==null&&a.memoizedState!==null,V=gs,W=Rt;if(gs=V||d,Rt=W||M,fn(n,e),Rt=W,gs=V,hn(e),o&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(a===null||M||gs||Rt||wa(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){M=a=n;try{if(h=M.stateNode,d)x=h.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{E=M.stateNode;var te=M.memoizedProps.style,G=te!=null&&te.hasOwnProperty("display")?te.display:null;E.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(je){st(M,M.return,je)}}}else if(n.tag===6){if(a===null){M=n;try{M.stateNode.nodeValue=d?"":M.memoizedProps}catch(je){st(M,M.return,je)}}}else if(n.tag===18){if(a===null){M=n;try{var K=M.stateNode;d?fp(K,!0):fp(M.stateNode,!1)}catch(je){st(M,M.return,je)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=e.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,wr(e,a))));break;case 19:fn(n,e),hn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,wr(e,o)));break;case 30:break;case 21:break;default:fn(n,e),hn(e)}}function hn(e){var n=e.flags;if(n&2){try{for(var a,o=e.return;o!==null;){if(mm(o)){a=o;break}o=o.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var d=a.stateNode,h=Kc(e);Nr(e,h,d);break;case 5:var x=a.stateNode;a.flags&32&&(La(x,""),a.flags&=-33);var E=Kc(e);Nr(e,E,x);break;case 3:case 4:var M=a.stateNode.containerInfo,V=Kc(e);Qc(e,V,M);break;default:throw Error(r(161))}}catch(W){st(e,e.return,W)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Nm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Nm(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function ys(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)vm(e,n.alternate,n),n=n.sibling}function wa(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Hs(4,n,n.return),wa(n);break;case 1:es(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&fm(n,n.return,a),wa(n);break;case 27:ml(n.stateNode);case 26:case 5:es(n,n.return),wa(n);break;case 22:n.memoizedState===null&&wa(n);break;case 30:wa(n);break;default:wa(n)}e=e.sibling}}function bs(e,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,d=e,h=n,x=h.flags;switch(h.tag){case 0:case 11:case 15:bs(d,h,a),al(4,h);break;case 1:if(bs(d,h,a),o=h,d=o.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(V){st(o,o.return,V)}if(o=h,d=o.updateQueue,d!==null){var E=o.stateNode;try{var M=d.shared.hiddenCallbacks;if(M!==null)for(d.shared.hiddenCallbacks=null,d=0;d<M.length;d++)eh(M[d],E)}catch(V){st(o,o.return,V)}}a&&x&64&&dm(h),il(h,h.return);break;case 27:pm(h);case 26:case 5:bs(d,h,a),a&&o===null&&x&4&&hm(h),il(h,h.return);break;case 12:bs(d,h,a);break;case 31:bs(d,h,a),a&&x&4&&xm(d,h);break;case 13:bs(d,h,a),a&&x&4&&Sm(d,h);break;case 22:h.memoizedState===null&&bs(d,h,a),il(h,h.return);break;case 30:break;default:bs(d,h,a)}n=n.sibling}}function Jc(e,n){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Vi(a))}function eu(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Vi(e))}function Yn(e,n,a,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)wm(e,n,a,o),n=n.sibling}function wm(e,n,a,o){var d=n.flags;switch(n.tag){case 0:case 11:case 15:Yn(e,n,a,o),d&2048&&al(9,n);break;case 1:Yn(e,n,a,o);break;case 3:Yn(e,n,a,o),d&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Vi(e)));break;case 12:if(d&2048){Yn(e,n,a,o),e=n.stateNode;try{var h=n.memoizedProps,x=h.id,E=h.onPostCommit;typeof E=="function"&&E(x,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){st(n,n.return,M)}}else Yn(e,n,a,o);break;case 31:Yn(e,n,a,o);break;case 13:Yn(e,n,a,o);break;case 23:break;case 22:h=n.stateNode,x=n.alternate,n.memoizedState!==null?h._visibility&2?Yn(e,n,a,o):ll(e,n):h._visibility&2?Yn(e,n,a,o):(h._visibility|=2,ni(e,n,a,o,(n.subtreeFlags&10256)!==0||!1)),d&2048&&Jc(x,n);break;case 24:Yn(e,n,a,o),d&2048&&eu(n.alternate,n);break;default:Yn(e,n,a,o)}}function ni(e,n,a,o,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,x=n,E=a,M=o,V=x.flags;switch(x.tag){case 0:case 11:case 15:ni(h,x,E,M,d),al(8,x);break;case 23:break;case 22:var W=x.stateNode;x.memoizedState!==null?W._visibility&2?ni(h,x,E,M,d):ll(h,x):(W._visibility|=2,ni(h,x,E,M,d)),d&&V&2048&&Jc(x.alternate,x);break;case 24:ni(h,x,E,M,d),d&&V&2048&&eu(x.alternate,x);break;default:ni(h,x,E,M,d)}n=n.sibling}}function ll(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=e,o=n,d=o.flags;switch(o.tag){case 22:ll(a,o),d&2048&&Jc(o.alternate,o);break;case 24:ll(a,o),d&2048&&eu(o.alternate,o);break;default:ll(a,o)}n=n.sibling}}var rl=8192;function si(e,n,a){if(e.subtreeFlags&rl)for(e=e.child;e!==null;)Em(e,n,a),e=e.sibling}function Em(e,n,a){switch(e.tag){case 26:si(e,n,a),e.flags&rl&&e.memoizedState!==null&&gS(a,Fn,e.memoizedState,e.memoizedProps);break;case 5:si(e,n,a);break;case 3:case 4:var o=Fn;Fn=$r(e.stateNode.containerInfo),si(e,n,a),Fn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=rl,rl=16777216,si(e,n,a),rl=o):si(e,n,a));break;default:si(e,n,a)}}function _m(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function ol(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];qt=o,Tm(o,e)}_m(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)km(e),e=e.sibling}function km(e){switch(e.tag){case 0:case 11:case 15:ol(e),e.flags&2048&&Hs(9,e,e.return);break;case 3:ol(e);break;case 12:ol(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Er(e)):ol(e);break;default:ol(e)}}function Er(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];qt=o,Tm(o,e)}_m(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Hs(8,n,n.return),Er(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,Er(n));break;default:Er(n)}e=e.sibling}}function Tm(e,n){for(;qt!==null;){var a=qt;switch(a.tag){case 0:case 11:case 15:Hs(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Vi(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,qt=o;else e:for(a=e;qt!==null;){o=qt;var d=o.sibling,h=o.return;if(ym(o),o===a){qt=null;break e}if(d!==null){d.return=h,qt=d;break e}qt=h}}}var Ax={getCacheForType:function(e){var n=Kt(kt),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return Kt(kt).controller.signal}},Mx=typeof WeakMap=="function"?WeakMap:Map,Je=0,ot=null,Ze=null,Pe=0,nt=0,wn=null,Zs=!1,ai=!1,tu=!1,xs=0,jt=0,qs=0,Ea=0,nu=0,En=0,ii=0,cl=null,mn=null,su=!1,_r=0,Cm=0,kr=1/0,Tr=null,Ps=null,Ut=0,Vs=null,li=null,Ss=0,au=0,iu=null,Rm=null,ul=0,lu=null;function _n(){return(Je&2)!==0&&Pe!==0?Pe&-Pe:k.T!==null?fu():ks()}function Am(){if(En===0)if((Pe&536870912)===0||Fe){var e=Dt;Dt<<=1,(Dt&3932160)===0&&(Dt=262144),En=e}else En=536870912;return e=jn.current,e!==null&&(e.flags|=32),En}function pn(e,n,a){(e===ot&&(nt===2||nt===9)||e.cancelPendingCommit!==null)&&(ri(e,0),Gs(e,Pe,En,!1)),ca(e,a),((Je&2)===0||e!==ot)&&(e===ot&&((Je&2)===0&&(Ea|=a),jt===4&&Gs(e,Pe,En,!1)),ts(e))}function Mm(e,n,a){if((Je&6)!==0)throw Error(r(327));var o=!a&&(n&127)===0&&(n&e.expiredLanes)===0||oa(e,n),d=o?Dx(e,n):ou(e,n,!0),h=o;do{if(d===0){ai&&!o&&Gs(e,n,0,!1);break}else{if(a=e.current.alternate,h&&!zx(a)){d=ou(e,n,!1),h=!1;continue}if(d===2){if(h=n,e.errorRecoveryDisabledLanes&h)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){n=x;e:{var E=e;d=cl;var M=E.current.memoizedState.isDehydrated;if(M&&(ri(E,x).flags|=256),x=ou(E,x,!1),x!==2){if(tu&&!M){E.errorRecoveryDisabledLanes|=h,Ea|=h,d=4;break e}h=mn,mn=d,h!==null&&(mn===null?mn=h:mn.push.apply(mn,h))}d=x}if(h=!1,d!==2)continue}}if(d===1){ri(e,0),Gs(e,n,0,!0);break}e:{switch(o=e,h=d,h){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:Gs(o,n,En,!Zs);break e;case 2:mn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(d=_r+300-We(),10<d)){if(Gs(o,n,En,!Zs),ra(o,0,!0)!==0)break e;Ss=n,o.timeoutHandle=cp(zm.bind(null,o,a,mn,Tr,su,n,En,Ea,ii,Zs,h,"Throttled",-0,0),d);break e}zm(o,a,mn,Tr,su,n,En,Ea,ii,Zs,h,null,-0,0)}}break}while(!0);ts(e)}function zm(e,n,a,o,d,h,x,E,M,V,W,te,G,K){if(e.timeoutHandle=-1,te=n.subtreeFlags,te&8192||(te&16785408)===16785408){te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ls},Em(n,h,te);var je=(h&62914560)===h?_r-We():(h&4194048)===h?Cm-We():0;if(je=vS(te,je),je!==null){Ss=h,e.cancelPendingCommit=je(Hm.bind(null,e,n,h,a,o,d,x,E,M,W,te,null,G,K)),Gs(e,h,x,!V);return}}Hm(e,n,h,a,o,d,x,E,M)}function zx(e){for(var n=e;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var d=a[o],h=d.getSnapshot;d=d.value;try{if(!xn(h(),d))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Gs(e,n,a,o){n&=~nu,n&=~Ea,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var d=n;0<d;){var h=31-pt(d),x=1<<h;o[h]=-1,d&=~x}a!==0&&Ll(e,a,n)}function Cr(){return(Je&6)===0?(dl(0),!1):!0}function ru(){if(Ze!==null){if(nt===0)var e=Ze.return;else e=Ze,us=ga=null,Nc(e),Qa=null,Fi=0,e=Ze;for(;e!==null;)um(e.alternate,e),e=e.return;Ze=null}}function ri(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Jx(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Ss=0,ru(),ot=e,Ze=a=os(e.current,null),Pe=n,nt=0,wn=null,Zs=!1,ai=oa(e,n),tu=!1,ii=En=nu=Ea=qs=jt=0,mn=cl=null,su=!1,(n&8)!==0&&(n|=n&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=n;0<o;){var d=31-pt(o),h=1<<d;n|=e[d],o&=~h}return xs=n,Kl(),a}function Om(e,n){Le=null,k.H=tl,n===Ka||n===ar?(n=Kf(),nt=3):n===dc?(n=Kf(),nt=4):nt=n===Bc?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,wn=n,Ze===null&&(jt=1,yr(e,zn(n,e.current)))}function Dm(){var e=jn.current;return e===null?!0:(Pe&4194048)===Pe?Un===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?e===Un:!1}function Lm(){var e=k.H;return k.H=tl,e===null?tl:e}function Um(){var e=k.A;return k.A=Ax,e}function Rr(){jt=4,Zs||(Pe&4194048)!==Pe&&jn.current!==null||(ai=!0),(qs&134217727)===0&&(Ea&134217727)===0||ot===null||Gs(ot,Pe,En,!1)}function ou(e,n,a){var o=Je;Je|=2;var d=Lm(),h=Um();(ot!==e||Pe!==n)&&(Tr=null,ri(e,n)),n=!1;var x=jt;e:do try{if(nt!==0&&Ze!==null){var E=Ze,M=wn;switch(nt){case 8:ru(),x=6;break e;case 3:case 2:case 9:case 6:jn.current===null&&(n=!0);var V=nt;if(nt=0,wn=null,oi(e,E,M,V),a&&ai){x=0;break e}break;default:V=nt,nt=0,wn=null,oi(e,E,M,V)}}Ox(),x=jt;break}catch(W){Om(e,W)}while(!0);return n&&e.shellSuspendCounter++,us=ga=null,Je=o,k.H=d,k.A=h,Ze===null&&(ot=null,Pe=0,Kl()),x}function Ox(){for(;Ze!==null;)$m(Ze)}function Dx(e,n){var a=Je;Je|=2;var o=Lm(),d=Um();ot!==e||Pe!==n?(Tr=null,kr=We()+500,ri(e,n)):ai=oa(e,n);e:do try{if(nt!==0&&Ze!==null){n=Ze;var h=wn;t:switch(nt){case 1:nt=0,wn=null,oi(e,n,h,1);break;case 2:case 9:if(Yf(h)){nt=0,wn=null,Bm(n);break}n=function(){nt!==2&&nt!==9||ot!==e||(nt=7),ts(e)},h.then(n,n);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:Yf(h)?(nt=0,wn=null,Bm(n)):(nt=0,wn=null,oi(e,n,h,7));break;case 5:var x=null;switch(Ze.tag){case 26:x=Ze.memoizedState;case 5:case 27:var E=Ze;if(x?wp(x):E.stateNode.complete){nt=0,wn=null;var M=E.sibling;if(M!==null)Ze=M;else{var V=E.return;V!==null?(Ze=V,Ar(V)):Ze=null}break t}}nt=0,wn=null,oi(e,n,h,5);break;case 6:nt=0,wn=null,oi(e,n,h,6);break;case 8:ru(),jt=6;break e;default:throw Error(r(462))}}Lx();break}catch(W){Om(e,W)}while(!0);return us=ga=null,k.H=o,k.A=d,Je=a,Ze!==null?0:(ot=null,Pe=0,Kl(),jt)}function Lx(){for(;Ze!==null&&!Ot();)$m(Ze)}function $m(e){var n=om(e.alternate,e,xs);e.memoizedProps=e.pendingProps,n===null?Ar(e):Ze=n}function Bm(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=nm(a,n,n.pendingProps,n.type,void 0,Pe);break;case 11:n=nm(a,n,n.pendingProps,n.type.render,n.ref,Pe);break;case 5:Nc(n);default:um(a,n),n=Ze=Uf(n,xs),n=om(a,n,xs)}e.memoizedProps=e.pendingProps,n===null?Ar(e):Ze=n}function oi(e,n,a,o){us=ga=null,Nc(n),Qa=null,Fi=0;var d=n.return;try{if(wx(e,d,n,a,Pe)){jt=1,yr(e,zn(a,e.current)),Ze=null;return}}catch(h){if(d!==null)throw Ze=d,h;jt=1,yr(e,zn(a,e.current)),Ze=null;return}n.flags&32768?(Fe||o===1?e=!0:ai||(Pe&536870912)!==0?e=!1:(Zs=e=!0,(o===2||o===9||o===3||o===6)&&(o=jn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Im(n,e)):Ar(n)}function Ar(e){var n=e;do{if((n.flags&32768)!==0){Im(n,Zs);return}e=n.return;var a=kx(n.alternate,n,xs);if(a!==null){Ze=a;return}if(n=n.sibling,n!==null){Ze=n;return}Ze=n=e}while(n!==null);jt===0&&(jt=5)}function Im(e,n){do{var a=Tx(e.alternate,e);if(a!==null){a.flags&=32767,Ze=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){Ze=e;return}Ze=e=a}while(e!==null);jt=6,Ze=null}function Hm(e,n,a,o,d,h,x,E,M){e.cancelPendingCommit=null;do Mr();while(Ut!==0);if((Je&6)!==0)throw Error(r(327));if(n!==null){if(n===e.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=Ko,_o(e,a,h,x,E,M),e===ot&&(Ze=ot=null,Pe=0),li=n,Vs=e,Ss=a,au=h,iu=d,Rm=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ix(wt,function(){return Gm(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=k.T,k.T=null,d=U.p,U.p=2,x=Je,Je|=4;try{Cx(e,n,a)}finally{Je=x,U.p=d,k.T=o}}Ut=1,Zm(),qm(),Pm()}}function Zm(){if(Ut===1){Ut=0;var e=Vs,n=li,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var o=U.p;U.p=2;var d=Je;Je|=4;try{jm(n,e);var h=xu,x=Tf(e.containerInfo),E=h.focusedElem,M=h.selectionRange;if(x!==E&&E&&E.ownerDocument&&kf(E.ownerDocument.documentElement,E)){if(M!==null&&Vo(E)){var V=M.start,W=M.end;if(W===void 0&&(W=V),"selectionStart"in E)E.selectionStart=V,E.selectionEnd=Math.min(W,E.value.length);else{var te=E.ownerDocument||document,G=te&&te.defaultView||window;if(G.getSelection){var K=G.getSelection(),je=E.textContent.length,Te=Math.min(M.start,je),lt=M.end===void 0?Te:Math.min(M.end,je);!K.extend&&Te>lt&&(x=lt,lt=Te,Te=x);var B=_f(E,Te),L=_f(E,lt);if(B&&L&&(K.rangeCount!==1||K.anchorNode!==B.node||K.anchorOffset!==B.offset||K.focusNode!==L.node||K.focusOffset!==L.offset)){var P=te.createRange();P.setStart(B.node,B.offset),K.removeAllRanges(),Te>lt?(K.addRange(P),K.extend(L.node,L.offset)):(P.setEnd(L.node,L.offset),K.addRange(P))}}}}for(te=[],K=E;K=K.parentNode;)K.nodeType===1&&te.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<te.length;E++){var ee=te[E];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}Pr=!!bu,xu=bu=null}finally{Je=d,U.p=o,k.T=a}}e.current=n,Ut=2}}function qm(){if(Ut===2){Ut=0;var e=Vs,n=li,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var o=U.p;U.p=2;var d=Je;Je|=4;try{vm(e,n.alternate,n)}finally{Je=d,U.p=o,k.T=a}}Ut=3}}function Pm(){if(Ut===4||Ut===3){Ut=0,Gt();var e=Vs,n=li,a=Ss,o=Rm;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ut=5:(Ut=0,li=Vs=null,Vm(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Ps=null),Ma(a),n=n.stateNode,He&&typeof He.onCommitFiberRoot=="function")try{He.onCommitFiberRoot(Ht,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=k.T,d=U.p,U.p=2,k.T=null;try{for(var h=e.onRecoverableError,x=0;x<o.length;x++){var E=o[x];h(E.value,{componentStack:E.stack})}}finally{k.T=n,U.p=d}}(Ss&3)!==0&&Mr(),ts(e),d=e.pendingLanes,(a&261930)!==0&&(d&42)!==0?e===lu?ul++:(ul=0,lu=e):ul=0,dl(0)}}function Vm(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Vi(n)))}function Mr(){return Zm(),qm(),Pm(),Gm()}function Gm(){if(Ut!==5)return!1;var e=Vs,n=au;au=0;var a=Ma(Ss),o=k.T,d=U.p;try{U.p=32>a?32:a,k.T=null,a=iu,iu=null;var h=Vs,x=Ss;if(Ut=0,li=Vs=null,Ss=0,(Je&6)!==0)throw Error(r(331));var E=Je;if(Je|=4,km(h.current),wm(h,h.current,x,a),Je=E,dl(0,!1),He&&typeof He.onPostCommitFiberRoot=="function")try{He.onPostCommitFiberRoot(Ht,h)}catch{}return!0}finally{U.p=d,k.T=o,Vm(e,n)}}function Fm(e,n,a){n=zn(a,n),n=$c(e.stateNode,n,2),e=$s(e,n,2),e!==null&&(ca(e,2),ts(e))}function st(e,n,a){if(e.tag===3)Fm(e,e,a);else for(;n!==null;){if(n.tag===3){Fm(n,e,a);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ps===null||!Ps.has(o))){e=zn(a,e),a=Yh(2),o=$s(n,a,2),o!==null&&(Xh(a,o,n,e),ca(o,2),ts(o));break}}n=n.return}}function cu(e,n,a){var o=e.pingCache;if(o===null){o=e.pingCache=new Mx;var d=new Set;o.set(n,d)}else d=o.get(n),d===void 0&&(d=new Set,o.set(n,d));d.has(a)||(tu=!0,d.add(a),e=Ux.bind(null,e,n,a),n.then(e,e))}function Ux(e,n,a){var o=e.pingCache;o!==null&&o.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ot===e&&(Pe&a)===a&&(jt===4||jt===3&&(Pe&62914560)===Pe&&300>We()-_r?(Je&2)===0&&ri(e,0):nu|=a,ii===Pe&&(ii=0)),ts(e)}function Ym(e,n){n===0&&(n=Ri()),e=ha(e,n),e!==null&&(ca(e,n),ts(e))}function $x(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),Ym(e,a)}function Bx(e,n){var a=0;switch(e.tag){case 31:case 13:var o=e.stateNode,d=e.memoizedState;d!==null&&(a=d.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(n),Ym(e,a)}function Ix(e,n){return me(e,n)}var zr=null,ci=null,uu=!1,Or=!1,du=!1,Fs=0;function ts(e){e!==ci&&e.next===null&&(ci===null?zr=ci=e:ci=ci.next=e),Or=!0,uu||(uu=!0,Zx())}function dl(e,n){if(!du&&Or){du=!0;do for(var a=!1,o=zr;o!==null;){if(e!==0){var d=o.pendingLanes;if(d===0)var h=0;else{var x=o.suspendedLanes,E=o.pingedLanes;h=(1<<31-pt(42|e)+1)-1,h&=d&~(x&~E),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(a=!0,Wm(o,h))}else h=Pe,h=ra(o,o===ot?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||oa(o,h)||(a=!0,Wm(o,h));o=o.next}while(a);du=!1}}function Hx(){Xm()}function Xm(){Or=uu=!1;var e=0;Fs!==0&&Wx()&&(e=Fs);for(var n=We(),a=null,o=zr;o!==null;){var d=o.next,h=Km(o,n);h===0?(o.next=null,a===null?zr=d:a.next=d,d===null&&(ci=a)):(a=o,(e!==0||(h&3)!==0)&&(Or=!0)),o=d}Ut!==0&&Ut!==5||dl(e),Fs!==0&&(Fs=0)}function Km(e,n){for(var a=e.suspendedLanes,o=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var x=31-pt(h),E=1<<x,M=d[x];M===-1?((E&a)===0||(E&o)!==0)&&(d[x]=Eo(E,n)):M<=n&&(e.expiredLanes|=E),h&=~E}if(n=ot,a=Pe,a=ra(e,e===n?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,a===0||e===n&&(nt===2||nt===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&$e(o),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||oa(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(o!==null&&$e(o),Ma(a)){case 2:case 8:a=ze;break;case 32:a=wt;break;case 268435456:a=ye;break;default:a=wt}return o=Qm.bind(null,e),a=me(a,o),e.callbackPriority=n,e.callbackNode=a,n}return o!==null&&o!==null&&$e(o),e.callbackPriority=2,e.callbackNode=null,2}function Qm(e,n){if(Ut!==0&&Ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Mr()&&e.callbackNode!==a)return null;var o=Pe;return o=ra(e,e===ot?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Mm(e,o,n),Km(e,We()),e.callbackNode!=null&&e.callbackNode===a?Qm.bind(null,e):null)}function Wm(e,n){if(Mr())return null;Mm(e,n,!0)}function Zx(){eS(function(){(Je&6)!==0?me(ge,Hx):Xm()})}function fu(){if(Fs===0){var e=Ya;e===0&&(e=on,on<<=1,(on&261888)===0&&(on=256)),Fs=e}return Fs}function Jm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Zl(""+e)}function ep(e,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,e.id&&a.setAttribute("form",e.id),n.parentNode.insertBefore(a,n),e=new FormData(e),a.parentNode.removeChild(a),e}function qx(e,n,a,o,d){if(n==="submit"&&a&&a.stateNode===d){var h=Jm((d[Ft]||null).action),x=o.submitter;x&&(n=(n=x[Ft]||null)?Jm(n.formAction):x.getAttribute("formAction"),n!==null&&(h=n,x=null));var E=new Gl("action","action",null,o,d);e.push({event:E,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Fs!==0){var M=x?ep(d,x):new FormData(d);Mc(a,{pending:!0,data:M,method:d.method,action:h},null,M)}}else typeof h=="function"&&(E.preventDefault(),M=x?ep(d,x):new FormData(d),Mc(a,{pending:!0,data:M,method:d.method,action:h},h,M))},currentTarget:d}]})}}for(var hu=0;hu<Xo.length;hu++){var mu=Xo[hu],Px=mu.toLowerCase(),Vx=mu[0].toUpperCase()+mu.slice(1);Gn(Px,"on"+Vx)}Gn(Af,"onAnimationEnd"),Gn(Mf,"onAnimationIteration"),Gn(zf,"onAnimationStart"),Gn("dblclick","onDoubleClick"),Gn("focusin","onFocus"),Gn("focusout","onBlur"),Gn(rx,"onTransitionRun"),Gn(ox,"onTransitionStart"),Gn(cx,"onTransitionCancel"),Gn(Of,"onTransitionEnd"),Qn("onMouseEnter",["mouseout","mouseover"]),Qn("onMouseLeave",["mouseout","mouseover"]),Qn("onPointerEnter",["pointerout","pointerover"]),Qn("onPointerLeave",["pointerout","pointerover"]),Zt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fl="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(" "),Gx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fl));function tp(e,n){n=(n&4)!==0;for(var a=0;a<e.length;a++){var o=e[a],d=o.event;o=o.listeners;e:{var h=void 0;if(n)for(var x=o.length-1;0<=x;x--){var E=o[x],M=E.instance,V=E.currentTarget;if(E=E.listener,M!==h&&d.isPropagationStopped())break e;h=E,d.currentTarget=V;try{h(d)}catch(W){Xl(W)}d.currentTarget=null,h=M}else for(x=0;x<o.length;x++){if(E=o[x],M=E.instance,V=E.currentTarget,E=E.listener,M!==h&&d.isPropagationStopped())break e;h=E,d.currentTarget=V;try{h(d)}catch(W){Xl(W)}d.currentTarget=null,h=M}}}}function qe(e,n){var a=n[Oa];a===void 0&&(a=n[Oa]=new Set);var o=e+"__bubble";a.has(o)||(np(n,e,2,!1),a.add(o))}function pu(e,n,a){var o=0;n&&(o|=4),np(a,e,o,n)}var Dr="_reactListening"+Math.random().toString(36).slice(2);function gu(e){if(!e[Dr]){e[Dr]=!0,cn.forEach(function(a){a!=="selectionchange"&&(Gx.has(a)||pu(a,!1,e),pu(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Dr]||(n[Dr]=!0,pu("selectionchange",!1,n))}}function np(e,n,a,o){switch(Ap(n)){case 2:var d=xS;break;case 8:d=SS;break;default:d=Au}a=d.bind(null,n,a,e),d=void 0,!Lo||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),o?d!==void 0?e.addEventListener(n,a,{capture:!0,passive:d}):e.addEventListener(n,a,!0):d!==void 0?e.addEventListener(n,a,{passive:d}):e.addEventListener(n,a,!1)}function vu(e,n,a,o,d){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var x=o.tag;if(x===3||x===4){var E=o.stateNode.containerInfo;if(E===d)break;if(x===4)for(x=o.return;x!==null;){var M=x.tag;if((M===3||M===4)&&x.stateNode.containerInfo===d)return;x=x.return}for(;E!==null;){if(x=Rs(E),x===null)return;if(M=x.tag,M===5||M===6||M===26||M===27){o=h=x;continue e}E=E.parentNode}}o=o.return}rf(function(){var V=h,W=Oo(a),te=[];e:{var G=Df.get(e);if(G!==void 0){var K=Gl,je=e;switch(e){case"keypress":if(Pl(a)===0)break e;case"keydown":case"keyup":K=Bb;break;case"focusin":je="focus",K=Io;break;case"focusout":je="blur",K=Io;break;case"beforeblur":case"afterblur":K=Io;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=uf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=kb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=Zb;break;case Af:case Mf:case zf:K=Rb;break;case Of:K=Pb;break;case"scroll":case"scrollend":K=Eb;break;case"wheel":K=Gb;break;case"copy":case"cut":case"paste":K=Mb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=ff;break;case"toggle":case"beforetoggle":K=Yb}var Te=(n&4)!==0,lt=!Te&&(e==="scroll"||e==="scrollend"),B=Te?G!==null?G+"Capture":null:G;Te=[];for(var L=V,P;L!==null;){var ee=L;if(P=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||P===null||B===null||(ee=Oi(L,B),ee!=null&&Te.push(hl(L,ee,P))),lt)break;L=L.return}0<Te.length&&(G=new K(G,je,null,a,W),te.push({event:G,listeners:Te}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",G&&a!==zo&&(je=a.relatedTarget||a.fromElement)&&(Rs(je)||je[Ts]))break e;if((K||G)&&(G=W.window===W?W:(G=W.ownerDocument)?G.defaultView||G.parentWindow:window,K?(je=a.relatedTarget||a.toElement,K=V,je=je?Rs(je):null,je!==null&&(lt=u(je),Te=je.tag,je!==lt||Te!==5&&Te!==27&&Te!==6)&&(je=null)):(K=null,je=V),K!==je)){if(Te=uf,ee="onMouseLeave",B="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Te=ff,ee="onPointerLeave",B="onPointerEnter",L="pointer"),lt=K==null?G:De(K),P=je==null?G:De(je),G=new Te(ee,L+"leave",K,a,W),G.target=lt,G.relatedTarget=P,ee=null,Rs(W)===V&&(Te=new Te(B,L+"enter",je,a,W),Te.target=P,Te.relatedTarget=lt,ee=Te),lt=ee,K&&je)t:{for(Te=Fx,B=K,L=je,P=0,ee=B;ee;ee=Te(ee))P++;ee=0;for(var ke=L;ke;ke=Te(ke))ee++;for(;0<P-ee;)B=Te(B),P--;for(;0<ee-P;)L=Te(L),ee--;for(;P--;){if(B===L||L!==null&&B===L.alternate){Te=B;break t}B=Te(B),L=Te(L)}Te=null}else Te=null;K!==null&&sp(te,G,K,Te,!1),je!==null&&lt!==null&&sp(te,lt,je,Te,!0)}}e:{if(G=V?De(V):window,K=G.nodeName&&G.nodeName.toLowerCase(),K==="select"||K==="input"&&G.type==="file")var Ye=xf;else if(yf(G))if(Sf)Ye=ax;else{Ye=nx;var we=tx}else K=G.nodeName,!K||K.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?V&&Mo(V.elementType)&&(Ye=xf):Ye=sx;if(Ye&&(Ye=Ye(e,V))){bf(te,Ye,a,W);break e}we&&we(e,G,V),e==="focusout"&&V&&G.type==="number"&&V.memoizedProps.value!=null&&Ao(G,"number",G.value)}switch(we=V?De(V):window,e){case"focusin":(yf(we)||we.contentEditable==="true")&&(Ia=we,Go=V,Zi=null);break;case"focusout":Zi=Go=Ia=null;break;case"mousedown":Fo=!0;break;case"contextmenu":case"mouseup":case"dragend":Fo=!1,Cf(te,a,W);break;case"selectionchange":if(lx)break;case"keydown":case"keyup":Cf(te,a,W)}var Be;if(Zo)e:{switch(e){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Ba?gf(e,a)&&(Ve="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ve="onCompositionStart");Ve&&(hf&&a.locale!=="ko"&&(Ba||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Ba&&(Be=of()):(As=W,Uo="value"in As?As.value:As.textContent,Ba=!0)),we=Lr(V,Ve),0<we.length&&(Ve=new df(Ve,e,null,a,W),te.push({event:Ve,listeners:we}),Be?Ve.data=Be:(Be=vf(a),Be!==null&&(Ve.data=Be)))),(Be=Kb?Qb(e,a):Wb(e,a))&&(Ve=Lr(V,"onBeforeInput"),0<Ve.length&&(we=new df("onBeforeInput","beforeinput",null,a,W),te.push({event:we,listeners:Ve}),we.data=Be)),qx(te,e,V,a,W)}tp(te,n)})}function hl(e,n,a){return{instance:e,listener:n,currentTarget:a}}function Lr(e,n){for(var a=n+"Capture",o=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=Oi(e,a),d!=null&&o.unshift(hl(e,d,h)),d=Oi(e,n),d!=null&&o.push(hl(e,d,h))),e.tag===3)return o;e=e.return}return[]}function Fx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sp(e,n,a,o,d){for(var h=n._reactName,x=[];a!==null&&a!==o;){var E=a,M=E.alternate,V=E.stateNode;if(E=E.tag,M!==null&&M===o)break;E!==5&&E!==26&&E!==27||V===null||(M=V,d?(V=Oi(a,h),V!=null&&x.unshift(hl(a,V,M))):d||(V=Oi(a,h),V!=null&&x.push(hl(a,V,M)))),a=a.return}x.length!==0&&e.push({event:n,listeners:x})}var Yx=/\r\n?/g,Xx=/\u0000|\uFFFD/g;function ap(e){return(typeof e=="string"?e:""+e).replace(Yx,`
49
+ `).replace(Xx,"")}function ip(e,n){return n=ap(n),ap(e)===n}function it(e,n,a,o,d,h){switch(a){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||La(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&La(e,""+o);break;case"className":Il(e,"class",o);break;case"tabIndex":Il(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Il(e,a,o);break;case"style":af(e,o,h);break;case"data":if(n!=="object"){Il(e,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||a!=="href")){e.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=Zl(""+o),e.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(a==="formAction"?(n!=="input"&&it(e,n,"name",d.name,d,null),it(e,n,"formEncType",d.formEncType,d,null),it(e,n,"formMethod",d.formMethod,d,null),it(e,n,"formTarget",d.formTarget,d,null)):(it(e,n,"encType",d.encType,d,null),it(e,n,"method",d.method,d,null),it(e,n,"target",d.target,d,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=Zl(""+o),e.setAttribute(a,o);break;case"onClick":o!=null&&(e.onclick=ls);break;case"onScroll":o!=null&&qe("scroll",e);break;case"onScrollEnd":o!=null&&qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(a=o.__html,a!=null){if(d.children!=null)throw Error(r(60));e.innerHTML=a}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}a=Zl(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""+o):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":o===!0?e.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,o):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(a,o):e.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(a):e.setAttribute(a,o);break;case"popover":qe("beforetoggle",e),qe("toggle",e),Bl(e,"popover",o);break;case"xlinkActuate":is(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":is(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":is(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":is(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":is(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":is(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":is(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":is(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":is(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Bl(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Nb.get(a)||a,Bl(e,a,o))}}function yu(e,n,a,o,d,h){switch(a){case"style":af(e,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(a=o.__html,a!=null){if(d.children!=null)throw Error(r(60));e.innerHTML=a}}break;case"children":typeof o=="string"?La(e,o):(typeof o=="number"||typeof o=="bigint")&&La(e,""+o);break;case"onScroll":o!=null&&qe("scroll",e);break;case"onScrollEnd":o!=null&&qe("scrollend",e);break;case"onClick":o!=null&&(e.onclick=ls);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Yt.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(d=a.endsWith("Capture"),n=a.slice(2,d?a.length-7:void 0),h=e[Ft]||null,h=h!=null?h[a]:null,typeof h=="function"&&e.removeEventListener(n,h,d),typeof o=="function")){typeof h!="function"&&h!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(n,o,d);break e}a in e?e[a]=o:o===!0?e.setAttribute(a,""):Bl(e,a,o)}}}function Wt(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",e),qe("load",e);var o=!1,d=!1,h;for(h in a)if(a.hasOwnProperty(h)){var x=a[h];if(x!=null)switch(h){case"src":o=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:it(e,n,h,x,a,null)}}d&&it(e,n,"srcSet",a.srcSet,a,null),o&&it(e,n,"src",a.src,a,null);return;case"input":qe("invalid",e);var E=h=x=d=null,M=null,V=null;for(o in a)if(a.hasOwnProperty(o)){var W=a[o];if(W!=null)switch(o){case"name":d=W;break;case"type":x=W;break;case"checked":M=W;break;case"defaultChecked":V=W;break;case"value":h=W;break;case"defaultValue":E=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,n));break;default:it(e,n,o,W,a,null)}}ef(e,h,E,M,V,x,d,!1);return;case"select":qe("invalid",e),o=x=h=null;for(d in a)if(a.hasOwnProperty(d)&&(E=a[d],E!=null))switch(d){case"value":h=E;break;case"defaultValue":x=E;break;case"multiple":o=E;default:it(e,n,d,E,a,null)}n=h,a=x,e.multiple=!!o,n!=null?Da(e,!!o,n,!1):a!=null&&Da(e,!!o,a,!0);return;case"textarea":qe("invalid",e),h=d=o=null;for(x in a)if(a.hasOwnProperty(x)&&(E=a[x],E!=null))switch(x){case"value":o=E;break;case"defaultValue":d=E;break;case"children":h=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:it(e,n,x,E,a,null)}nf(e,o,d,h);return;case"option":for(M in a)if(a.hasOwnProperty(M)&&(o=a[M],o!=null))switch(M){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:it(e,n,M,o,a,null)}return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(o=0;o<fl.length;o++)qe(fl[o],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in a)if(a.hasOwnProperty(V)&&(o=a[V],o!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:it(e,n,V,o,a,null)}return;default:if(Mo(n)){for(W in a)a.hasOwnProperty(W)&&(o=a[W],o!==void 0&&yu(e,n,W,o,a,void 0));return}}for(E in a)a.hasOwnProperty(E)&&(o=a[E],o!=null&&it(e,n,E,o,a,null))}function Kx(e,n,a,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,x=null,E=null,M=null,V=null,W=null;for(K in a){var te=a[K];if(a.hasOwnProperty(K)&&te!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":M=te;default:o.hasOwnProperty(K)||it(e,n,K,null,o,te)}}for(var G in o){var K=o[G];if(te=a[G],o.hasOwnProperty(G)&&(K!=null||te!=null))switch(G){case"type":h=K;break;case"name":d=K;break;case"checked":V=K;break;case"defaultChecked":W=K;break;case"value":x=K;break;case"defaultValue":E=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,n));break;default:K!==te&&it(e,n,G,K,o,te)}}Ro(e,x,E,M,V,W,h,d);return;case"select":K=x=E=G=null;for(h in a)if(M=a[h],a.hasOwnProperty(h)&&M!=null)switch(h){case"value":break;case"multiple":K=M;default:o.hasOwnProperty(h)||it(e,n,h,null,o,M)}for(d in o)if(h=o[d],M=a[d],o.hasOwnProperty(d)&&(h!=null||M!=null))switch(d){case"value":G=h;break;case"defaultValue":E=h;break;case"multiple":x=h;default:h!==M&&it(e,n,d,h,o,M)}n=E,a=x,o=K,G!=null?Da(e,!!a,G,!1):!!o!=!!a&&(n!=null?Da(e,!!a,n,!0):Da(e,!!a,a?[]:"",!1));return;case"textarea":K=G=null;for(E in a)if(d=a[E],a.hasOwnProperty(E)&&d!=null&&!o.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:it(e,n,E,null,o,d)}for(x in o)if(d=o[x],h=a[x],o.hasOwnProperty(x)&&(d!=null||h!=null))switch(x){case"value":G=d;break;case"defaultValue":K=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(r(91));break;default:d!==h&&it(e,n,x,d,o,h)}tf(e,G,K);return;case"option":for(var je in a)if(G=a[je],a.hasOwnProperty(je)&&G!=null&&!o.hasOwnProperty(je))switch(je){case"selected":e.selected=!1;break;default:it(e,n,je,null,o,G)}for(M in o)if(G=o[M],K=a[M],o.hasOwnProperty(M)&&G!==K&&(G!=null||K!=null))switch(M){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:it(e,n,M,G,o,K)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Te in a)G=a[Te],a.hasOwnProperty(Te)&&G!=null&&!o.hasOwnProperty(Te)&&it(e,n,Te,null,o,G);for(V in o)if(G=o[V],K=a[V],o.hasOwnProperty(V)&&G!==K&&(G!=null||K!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(r(137,n));break;default:it(e,n,V,G,o,K)}return;default:if(Mo(n)){for(var lt in a)G=a[lt],a.hasOwnProperty(lt)&&G!==void 0&&!o.hasOwnProperty(lt)&&yu(e,n,lt,void 0,o,G);for(W in o)G=o[W],K=a[W],!o.hasOwnProperty(W)||G===K||G===void 0&&K===void 0||yu(e,n,W,G,o,K);return}}for(var B in a)G=a[B],a.hasOwnProperty(B)&&G!=null&&!o.hasOwnProperty(B)&&it(e,n,B,null,o,G);for(te in o)G=o[te],K=a[te],!o.hasOwnProperty(te)||G===K||G==null&&K==null||it(e,n,te,G,o,K)}function lp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Qx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var d=a[o],h=d.transferSize,x=d.initiatorType,E=d.duration;if(h&&E&&lp(x)){for(x=0,E=d.responseEnd,o+=1;o<a.length;o++){var M=a[o],V=M.startTime;if(V>E)break;var W=M.transferSize,te=M.initiatorType;W&&lp(te)&&(M=M.responseEnd,x+=W*(M<E?1:(E-V)/(M-V)))}if(--o,n+=8*(h+x)/(d.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var bu=null,xu=null;function Ur(e){return e.nodeType===9?e:e.ownerDocument}function rp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function op(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Su(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var ju=null;function Wx(){var e=window.event;return e&&e.type==="popstate"?e===ju?!1:(ju=e,!0):(ju=null,!1)}var cp=typeof setTimeout=="function"?setTimeout:void 0,Jx=typeof clearTimeout=="function"?clearTimeout:void 0,up=typeof Promise=="function"?Promise:void 0,eS=typeof queueMicrotask=="function"?queueMicrotask:typeof up<"u"?function(e){return up.resolve(null).then(e).catch(tS)}:cp;function tS(e){setTimeout(function(){throw e})}function Ys(e){return e==="head"}function dp(e,n){var a=n,o=0;do{var d=a.nextSibling;if(e.removeChild(a),d&&d.nodeType===8)if(a=d.data,a==="/$"||a==="/&"){if(o===0){e.removeChild(d),hi(n);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")ml(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ml(a);for(var h=a.firstChild;h;){var x=h.nextSibling,E=h.nodeName;h[Cs]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&h.rel.toLowerCase()==="stylesheet"||a.removeChild(h),h=x}}else a==="body"&&ml(e.ownerDocument.body);a=d}while(a);hi(n)}function fp(e,n){var a=e;e=0;do{var o=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=o}while(a)}function Nu(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Nu(a),zi(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function nS(e,n,a,o){for(;e.nodeType===1;){var d=a;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Cs])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=$n(e.nextSibling),e===null)break}return null}function sS(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=$n(e.nextSibling),e===null))return null;return e}function hp(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=$n(e.nextSibling),e===null))return null;return e}function wu(e){return e.data==="$?"||e.data==="$~"}function Eu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function aS(e,n){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||a.readyState!=="loading")n();else{var o=function(){n(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function $n(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var _u=null;function mp(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return $n(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function pp(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return e;n--}else a!=="/$"&&a!=="/&"||n++}e=e.previousSibling}return null}function gp(e,n,a){switch(n=Ur(a),e){case"html":if(e=n.documentElement,!e)throw Error(r(452));return e;case"head":if(e=n.head,!e)throw Error(r(453));return e;case"body":if(e=n.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function ml(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);zi(e)}var Bn=new Map,vp=new Set;function $r(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var js=U.d;U.d={f:iS,r:lS,D:rS,C:oS,L:cS,m:uS,X:fS,S:dS,M:hS};function iS(){var e=js.f(),n=Cr();return e||n}function lS(e){var n=_e(e);n!==null&&n.tag===5&&n.type==="form"?Oh(n):js.r(e)}var ui=typeof document>"u"?null:document;function yp(e,n,a){var o=ui;if(o&&typeof n=="string"&&n){var d=An(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof a=="string"&&(d+='[crossorigin="'+a+'"]'),vp.has(d)||(vp.add(d),e={rel:e,crossOrigin:a,href:n},o.querySelector(d)===null&&(n=o.createElement("link"),Wt(n,"link",e),Ge(n),o.head.appendChild(n)))}}function rS(e){js.D(e),yp("dns-prefetch",e,null)}function oS(e,n){js.C(e,n),yp("preconnect",e,n)}function cS(e,n,a){js.L(e,n,a);var o=ui;if(o&&e&&n){var d='link[rel="preload"][as="'+An(n)+'"]';n==="image"&&a&&a.imageSrcSet?(d+='[imagesrcset="'+An(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(d+='[imagesizes="'+An(a.imageSizes)+'"]')):d+='[href="'+An(e)+'"]';var h=d;switch(n){case"style":h=di(e);break;case"script":h=fi(e)}Bn.has(h)||(e=b({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),Bn.set(h,e),o.querySelector(d)!==null||n==="style"&&o.querySelector(pl(h))||n==="script"&&o.querySelector(gl(h))||(n=o.createElement("link"),Wt(n,"link",e),Ge(n),o.head.appendChild(n)))}}function uS(e,n){js.m(e,n);var a=ui;if(a&&e){var o=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+An(o)+'"][href="'+An(e)+'"]',h=d;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=fi(e)}if(!Bn.has(h)&&(e=b({rel:"modulepreload",href:e},n),Bn.set(h,e),a.querySelector(d)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(gl(h)))return}o=a.createElement("link"),Wt(o,"link",e),Ge(o),a.head.appendChild(o)}}}function dS(e,n,a){js.S(e,n,a);var o=ui;if(o&&e){var d=et(o).hoistableStyles,h=di(e);n=n||"default";var x=d.get(h);if(!x){var E={loading:0,preload:null};if(x=o.querySelector(pl(h)))E.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":n},a),(a=Bn.get(h))&&ku(e,a);var M=x=o.createElement("link");Ge(M),Wt(M,"link",e),M._p=new Promise(function(V,W){M.onload=V,M.onerror=W}),M.addEventListener("load",function(){E.loading|=1}),M.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Br(x,n,o)}x={type:"stylesheet",instance:x,count:1,state:E},d.set(h,x)}}}function fS(e,n){js.X(e,n);var a=ui;if(a&&e){var o=et(a).hoistableScripts,d=fi(e),h=o.get(d);h||(h=a.querySelector(gl(d)),h||(e=b({src:e,async:!0},n),(n=Bn.get(d))&&Tu(e,n),h=a.createElement("script"),Ge(h),Wt(h,"link",e),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(d,h))}}function hS(e,n){js.M(e,n);var a=ui;if(a&&e){var o=et(a).hoistableScripts,d=fi(e),h=o.get(d);h||(h=a.querySelector(gl(d)),h||(e=b({src:e,async:!0,type:"module"},n),(n=Bn.get(d))&&Tu(e,n),h=a.createElement("script"),Ge(h),Wt(h,"link",e),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(d,h))}}function bp(e,n,a,o){var d=(d=ie.current)?$r(d):null;if(!d)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=di(a.href),a=et(d).hoistableStyles,o=a.get(n),o||(o={type:"style",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=di(a.href);var h=et(d).hoistableStyles,x=h.get(e);if(x||(d=d.ownerDocument||d,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,x),(h=d.querySelector(pl(e)))&&!h._p&&(x.instance=h,x.state.loading=5),Bn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Bn.set(e,a),h||mS(d,e,a,x.state))),n&&o===null)throw Error(r(528,""));return x}if(n&&o!==null)throw Error(r(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=fi(a),a=et(d).hoistableScripts,o=a.get(n),o||(o={type:"script",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function di(e){return'href="'+An(e)+'"'}function pl(e){return'link[rel="stylesheet"]['+e+"]"}function xp(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function mS(e,n,a,o){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=e.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Wt(n,"link",a),Ge(n),e.head.appendChild(n))}function fi(e){return'[src="'+An(e)+'"]'}function gl(e){return"script[async]"+e}function Sp(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var o=e.querySelector('style[data-href~="'+An(a.href)+'"]');if(o)return n.instance=o,Ge(o),o;var d=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),Ge(o),Wt(o,"style",d),Br(o,a.precedence,e),n.instance=o;case"stylesheet":d=di(a.href);var h=e.querySelector(pl(d));if(h)return n.state.loading|=4,n.instance=h,Ge(h),h;o=xp(a),(d=Bn.get(d))&&ku(o,d),h=(e.ownerDocument||e).createElement("link"),Ge(h);var x=h;return x._p=new Promise(function(E,M){x.onload=E,x.onerror=M}),Wt(h,"link",o),n.state.loading|=4,Br(h,a.precedence,e),n.instance=h;case"script":return h=fi(a.src),(d=e.querySelector(gl(h)))?(n.instance=d,Ge(d),d):(o=a,(d=Bn.get(h))&&(o=b({},a),Tu(o,d)),e=e.ownerDocument||e,d=e.createElement("script"),Ge(d),Wt(d,"link",o),e.head.appendChild(d),n.instance=d);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Br(o,a.precedence,e));return n.instance}function Br(e,n,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=o.length?o[o.length-1]:null,h=d,x=0;x<o.length;x++){var E=o[x];if(E.dataset.precedence===n)h=E;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(e,n.firstChild))}function ku(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Tu(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Ir=null;function jp(e,n,a){if(Ir===null){var o=new Map,d=Ir=new Map;d.set(a,o)}else d=Ir,o=d.get(a),o||(o=new Map,d.set(a,o));if(o.has(e))return o;for(o.set(e,null),a=a.getElementsByTagName(e),d=0;d<a.length;d++){var h=a[d];if(!(h[Cs]||h[Lt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var x=h.getAttribute(n)||"";x=e+x;var E=o.get(x);E?E.push(h):o.set(x,[h])}}return o}function Np(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function pS(e,n,a){if(a===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function wp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function gS(e,n,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var d=di(o.href),h=n.querySelector(pl(d));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Hr.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=h,Ge(h);return}h=n.ownerDocument||n,o=xp(o),(d=Bn.get(d))&&ku(o,d),h=h.createElement("link"),Ge(h);var x=h;x._p=new Promise(function(E,M){x.onload=E,x.onerror=M}),Wt(h,"link",o),a.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Hr.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var Cu=0;function vS(e,n){return e.stylesheets&&e.count===0&&qr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var o=setTimeout(function(){if(e.stylesheets&&qr(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Cu===0&&(Cu=62500*Qx());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&qr(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Cu?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(d)}}:null}function Hr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zr=null;function qr(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zr=new Map,n.forEach(yS,e),Zr=null,Hr.call(e))}function yS(e,n){if(!(n.state.loading&4)){var a=Zr.get(e);if(a)var o=a.get(null);else{a=new Map,Zr.set(e,a);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var x=d[h];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),o=x)}o&&a.set(null,o)}d=n.instance,x=d.getAttribute("data-precedence"),h=a.get(x)||o,h===o&&a.set(null,d),a.set(x,d),this.count++,o=Hr.bind(this),d.addEventListener("load",o),d.addEventListener("error",o),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),n.state.loading|=4}}var vl={$$typeof:z,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function bS(e,n,a,o,d,h,x,E,M){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ai(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ai(0),this.hiddenUpdates=Ai(null),this.identifierPrefix=o,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Ep(e,n,a,o,d,h,x,E,M,V,W,te){return e=new bS(e,n,a,x,M,V,W,te,E),n=1,h===!0&&(n|=24),h=Sn(3,null,null,n),e.current=h,h.stateNode=e,n=oc(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:a,cache:n},fc(h),e}function _p(e){return e?(e=qa,e):qa}function kp(e,n,a,o,d,h){d=_p(d),o.context===null?o.context=d:o.pendingContext=d,o=Us(n),o.payload={element:a},h=h===void 0?null:h,h!==null&&(o.callback=h),a=$s(e,o,n),a!==null&&(pn(a,e,n),Xi(a,e,n))}function Tp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function Ru(e,n){Tp(e,n),(e=e.alternate)&&Tp(e,n)}function Cp(e){if(e.tag===13||e.tag===31){var n=ha(e,67108864);n!==null&&pn(n,e,67108864),Ru(e,67108864)}}function Rp(e){if(e.tag===13||e.tag===31){var n=_n();n=Mi(n);var a=ha(e,n);a!==null&&pn(a,e,n),Ru(e,n)}}var Pr=!0;function xS(e,n,a,o){var d=k.T;k.T=null;var h=U.p;try{U.p=2,Au(e,n,a,o)}finally{U.p=h,k.T=d}}function SS(e,n,a,o){var d=k.T;k.T=null;var h=U.p;try{U.p=8,Au(e,n,a,o)}finally{U.p=h,k.T=d}}function Au(e,n,a,o){if(Pr){var d=Mu(o);if(d===null)vu(e,n,o,Vr,a),Mp(e,o);else if(NS(d,e,n,a,o))o.stopPropagation();else if(Mp(e,o),n&4&&-1<jS.indexOf(e)){for(;d!==null;){var h=_e(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var x=Vn(h.pendingLanes);if(x!==0){var E=h;for(E.pendingLanes|=2,E.entangledLanes|=2;x;){var M=1<<31-pt(x);E.entanglements[1]|=M,x&=~M}ts(h),(Je&6)===0&&(kr=We()+500,dl(0))}}break;case 31:case 13:E=ha(h,2),E!==null&&pn(E,h,2),Cr(),Ru(h,2)}if(h=Mu(o),h===null&&vu(e,n,o,Vr,a),h===d)break;d=h}d!==null&&o.stopPropagation()}else vu(e,n,o,null,a)}}function Mu(e){return e=Oo(e),zu(e)}var Vr=null;function zu(e){if(Vr=null,e=Rs(e),e!==null){var n=u(e);if(n===null)e=null;else{var a=n.tag;if(a===13){if(e=f(n),e!==null)return e;e=null}else if(a===31){if(e=p(n),e!==null)return e;e=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Vr=e,null}function Ap(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ns()){case ge:return 2;case ze:return 8;case wt:case qn:return 32;case ye:return 268435456;default:return 32}default:return 32}}var Ou=!1,Xs=null,Ks=null,Qs=null,yl=new Map,bl=new Map,Ws=[],jS="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".split(" ");function Mp(e,n){switch(e){case"focusin":case"focusout":Xs=null;break;case"dragenter":case"dragleave":Ks=null;break;case"mouseover":case"mouseout":Qs=null;break;case"pointerover":case"pointerout":yl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":bl.delete(n.pointerId)}}function xl(e,n,a,o,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:a,eventSystemFlags:o,nativeEvent:h,targetContainers:[d]},n!==null&&(n=_e(n),n!==null&&Cp(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function NS(e,n,a,o,d){switch(n){case"focusin":return Xs=xl(Xs,e,n,a,o,d),!0;case"dragenter":return Ks=xl(Ks,e,n,a,o,d),!0;case"mouseover":return Qs=xl(Qs,e,n,a,o,d),!0;case"pointerover":var h=d.pointerId;return yl.set(h,xl(yl.get(h)||null,e,n,a,o,d)),!0;case"gotpointercapture":return h=d.pointerId,bl.set(h,xl(bl.get(h)||null,e,n,a,o,d)),!0}return!1}function zp(e){var n=Rs(e.target);if(n!==null){var a=u(n);if(a!==null){if(n=a.tag,n===13){if(n=f(a),n!==null){e.blockedOn=n,za(e.priority,function(){Rp(a)});return}}else if(n===31){if(n=p(a),n!==null){e.blockedOn=n,za(e.priority,function(){Rp(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gr(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=Mu(e.nativeEvent);if(a===null){a=e.nativeEvent;var o=new a.constructor(a.type,a);zo=o,a.target.dispatchEvent(o),zo=null}else return n=_e(a),n!==null&&Cp(n),e.blockedOn=a,!1;n.shift()}return!0}function Op(e,n,a){Gr(e)&&a.delete(n)}function wS(){Ou=!1,Xs!==null&&Gr(Xs)&&(Xs=null),Ks!==null&&Gr(Ks)&&(Ks=null),Qs!==null&&Gr(Qs)&&(Qs=null),yl.forEach(Op),bl.forEach(Op)}function Fr(e,n){e.blockedOn===n&&(e.blockedOn=null,Ou||(Ou=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,wS)))}var Yr=null;function Dp(e){Yr!==e&&(Yr=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Yr===e&&(Yr=null);for(var n=0;n<e.length;n+=3){var a=e[n],o=e[n+1],d=e[n+2];if(typeof o!="function"){if(zu(o||a)===null)continue;break}var h=_e(a);h!==null&&(e.splice(n,3),n-=3,Mc(h,{pending:!0,data:d,method:a.method,action:o},o,d))}}))}function hi(e){function n(M){return Fr(M,e)}Xs!==null&&Fr(Xs,e),Ks!==null&&Fr(Ks,e),Qs!==null&&Fr(Qs,e),yl.forEach(n),bl.forEach(n);for(var a=0;a<Ws.length;a++){var o=Ws[a];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Ws.length&&(a=Ws[0],a.blockedOn===null);)zp(a),a.blockedOn===null&&Ws.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var d=a[o],h=a[o+1],x=d[Ft]||null;if(typeof h=="function")x||Dp(a);else if(x){var E=null;if(h&&h.hasAttribute("formAction")){if(d=h,x=h[Ft]||null)E=x.formAction;else if(zu(d)!==null)continue}else E=x.action;typeof E=="function"?a[o+1]=E:(a.splice(o,3),o-=3),Dp(a)}}}function Lp(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(x){return d=x})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),d!==null&&(d(),d=null)}}}function Du(e){this._internalRoot=e}Xr.prototype.render=Du.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));var a=n.current,o=_n();kp(a,o,e,n,null,null)},Xr.prototype.unmount=Du.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;kp(e.current,2,null,e,null,null),Cr(),n[Ts]=null}};function Xr(e){this._internalRoot=e}Xr.prototype.unstable_scheduleHydration=function(e){if(e){var n=ks();e={blockedOn:null,target:e,priority:n};for(var a=0;a<Ws.length&&n!==0&&n<Ws[a].priority;a++);Ws.splice(a,0,e),a===0&&zp(e)}};var Up=s.version;if(Up!=="19.2.3")throw Error(r(527,Up,"19.2.3"));U.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=v(n),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var ES={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kr.isDisabled&&Kr.supportsFiber)try{Ht=Kr.inject(ES),He=Kr}catch{}}return jl.createRoot=function(e,n){if(!c(e))throw Error(r(299));var a=!1,o="",d=Ph,h=Vh,x=Gh;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError)),n=Ep(e,1,!1,null,null,a,o,null,d,h,x,Lp),e[Ts]=n.current,gu(e),new Du(n)},jl.hydrateRoot=function(e,n,a){if(!c(e))throw Error(r(299));var o=!1,d="",h=Ph,x=Vh,E=Gh,M=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(d=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError),a.formState!==void 0&&(M=a.formState)),n=Ep(e,1,!0,n,a??null,o,d,M,h,x,E,Lp),n.context=_p(null),a=n.current,o=_n(),o=Mi(o),d=Us(o),d.callback=null,$s(a,d,o),a=o,n.current.lanes=a,ca(n,a),ts(n),e[Ts]=n.current,gu(e),new Xr(n)},jl.version="19.2.3",jl}var Fp;function LS(){if(Fp)return $u.exports;Fp=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(s){console.error(s)}}return t(),$u.exports=DS(),$u.exports}var US=LS();/**
50
+ * react-router v7.12.0
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var Yp="popstate";function $S(t={}){function s(r,c){let{pathname:u,search:f,hash:p}=r.location;return cd("",{pathname:u,search:f,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function i(r,c){return typeof c=="string"?c:Tl(c)}return IS(s,i,null,t)}function ht(t,s){if(t===!1||t===null||typeof t>"u")throw new Error(s)}function kn(t,s){if(!t){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function BS(){return Math.random().toString(36).substring(2,10)}function Xp(t,s){return{usr:t.state,key:t.key,idx:s}}function cd(t,s,i=null,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof s=="string"?ji(s):s,state:i,key:s&&s.key||r||BS()}}function Tl({pathname:t="/",search:s="",hash:i=""}){return s&&s!=="?"&&(t+=s.charAt(0)==="?"?s:"?"+s),i&&i!=="#"&&(t+=i.charAt(0)==="#"?i:"#"+i),t}function ji(t){let s={};if(t){let i=t.indexOf("#");i>=0&&(s.hash=t.substring(i),t=t.substring(0,i));let r=t.indexOf("?");r>=0&&(s.search=t.substring(r),t=t.substring(0,r)),t&&(s.pathname=t)}return s}function IS(t,s,i,r={}){let{window:c=document.defaultView,v5Compat:u=!1}=r,f=c.history,p="POP",g=null,v=y();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function y(){return(f.state||{idx:null}).idx}function b(){p="POP";let j=y(),R=j==null?null:j-v;v=j,g&&g({action:p,location:N.location,delta:R})}function S(j,R){p="PUSH";let C=cd(N.location,j,R);v=y()+1;let z=Xp(C,v),H=N.createHref(C);try{f.pushState(z,"",H)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;c.location.assign(H)}u&&g&&g({action:p,location:N.location,delta:1})}function w(j,R){p="REPLACE";let C=cd(N.location,j,R);v=y();let z=Xp(C,v),H=N.createHref(C);f.replaceState(z,"",H),u&&g&&g({action:p,location:N.location,delta:0})}function _(j){return HS(j)}let N={get action(){return p},get location(){return t(c,f)},listen(j){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(Yp,b),g=j,()=>{c.removeEventListener(Yp,b),g=null}},createHref(j){return s(c,j)},createURL:_,encodeLocation(j){let R=_(j);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:S,replace:w,go(j){return f.go(j)}};return N}function HS(t,s=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),ht(i,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:Tl(t);return r=r.replace(/ $/,"%20"),!s&&r.startsWith("//")&&(r=i+r),new URL(r,i)}function rv(t,s,i="/"){return ZS(t,s,i,!1)}function ZS(t,s,i,r){let c=typeof s=="string"?ji(s):s,u=ws(c.pathname||"/",i);if(u==null)return null;let f=ov(t);qS(f);let p=null;for(let g=0;p==null&&g<f.length;++g){let v=e0(u);p=WS(f[g],v,r)}return p}function ov(t,s=[],i=[],r="",c=!1){let u=(f,p,g=c,v)=>{let y={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(r)&&g)return;ht(y.relativePath.startsWith(r),`Absolute route path "${y.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(r.length)}let b=Ns([r,y.relativePath]),S=i.concat(y);f.children&&f.children.length>0&&(ht(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),ov(f.children,s,S,b,g)),!(f.path==null&&!f.index)&&s.push({path:b,score:KS(b,f.index),routesMeta:S})};return t.forEach((f,p)=>{var g;if(f.path===""||!((g=f.path)!=null&&g.includes("?")))u(f,p);else for(let v of cv(f.path))u(f,p,!0,v)}),s}function cv(t){let s=t.split("/");if(s.length===0)return[];let[i,...r]=s,c=i.endsWith("?"),u=i.replace(/\?$/,"");if(r.length===0)return c?[u,""]:[u];let f=cv(r.join("/")),p=[];return p.push(...f.map(g=>g===""?u:[u,g].join("/"))),c&&p.push(...f),p.map(g=>t.startsWith("/")&&g===""?"/":g)}function qS(t){t.sort((s,i)=>s.score!==i.score?i.score-s.score:QS(s.routesMeta.map(r=>r.childrenIndex),i.routesMeta.map(r=>r.childrenIndex)))}var PS=/^:[\w-]+$/,VS=3,GS=2,FS=1,YS=10,XS=-2,Kp=t=>t==="*";function KS(t,s){let i=t.split("/"),r=i.length;return i.some(Kp)&&(r+=XS),s&&(r+=GS),i.filter(c=>!Kp(c)).reduce((c,u)=>c+(PS.test(u)?VS:u===""?FS:YS),r)}function QS(t,s){return t.length===s.length&&t.slice(0,-1).every((r,c)=>r===s[c])?t[t.length-1]-s[s.length-1]:0}function WS(t,s,i=!1){let{routesMeta:r}=t,c={},u="/",f=[];for(let p=0;p<r.length;++p){let g=r[p],v=p===r.length-1,y=u==="/"?s:s.slice(u.length)||"/",b=uo({path:g.relativePath,caseSensitive:g.caseSensitive,end:v},y),S=g.route;if(!b&&v&&i&&!r[r.length-1].route.index&&(b=uo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:Ns([u,b.pathname]),pathnameBase:a0(Ns([u,b.pathnameBase])),route:S}),b.pathnameBase!=="/"&&(u=Ns([u,b.pathnameBase]))}return f}function uo(t,s){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[i,r]=JS(t.path,t.caseSensitive,t.end),c=s.match(i);if(!c)return null;let u=c[0],f=u.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:r.reduce((v,{paramName:y,isOptional:b},S)=>{if(y==="*"){let _=p[S]||"";f=u.slice(0,u.length-_.length).replace(/(.)\/+$/,"$1")}const w=p[S];return b&&!w?v[y]=void 0:v[y]=(w||"").replace(/%2F/g,"/"),v},{}),pathname:u,pathnameBase:f,pattern:t}}function JS(t,s=!1,i=!0){kn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],c="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,g)=>(r.push({paramName:p,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),c+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?c+="\\/*$":t!==""&&t!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,s?void 0:"i"),r]}function e0(t){try{return t.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return kn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${s}).`),t}}function ws(t,s){if(s==="/")return t;if(!t.toLowerCase().startsWith(s.toLowerCase()))return null;let i=s.endsWith("/")?s.length-1:s.length,r=t.charAt(i);return r&&r!=="/"?null:t.slice(i)||"/"}var uv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,t0=t=>uv.test(t);function n0(t,s="/"){let{pathname:i,search:r="",hash:c=""}=typeof t=="string"?ji(t):t,u;if(i)if(t0(i))u=i;else{if(i.includes("//")){let f=i;i=i.replace(/\/\/+/g,"/"),kn(!1,`Pathnames cannot have embedded double slashes - normalizing ${f} -> ${i}`)}i.startsWith("/")?u=Qp(i.substring(1),"/"):u=Qp(i,s)}else u=s;return{pathname:u,search:i0(r),hash:l0(c)}}function Qp(t,s){let i=s.replace(/\/+$/,"").split("/");return t.split("/").forEach(c=>{c===".."?i.length>1&&i.pop():c!=="."&&i.push(c)}),i.length>1?i.join("/"):"/"}function Zu(t,s,i,r){return`Cannot include a '${t}' character in a manually specified \`to.${s}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function s0(t){return t.filter((s,i)=>i===0||s.route.path&&s.route.path.length>0)}function Ed(t){let s=s0(t);return s.map((i,r)=>r===s.length-1?i.pathname:i.pathnameBase)}function _d(t,s,i,r=!1){let c;typeof t=="string"?c=ji(t):(c={...t},ht(!c.pathname||!c.pathname.includes("?"),Zu("?","pathname","search",c)),ht(!c.pathname||!c.pathname.includes("#"),Zu("#","pathname","hash",c)),ht(!c.search||!c.search.includes("#"),Zu("#","search","hash",c)));let u=t===""||c.pathname==="",f=u?"/":c.pathname,p;if(f==null)p=i;else{let b=s.length-1;if(!r&&f.startsWith("..")){let S=f.split("/");for(;S[0]==="..";)S.shift(),b-=1;c.pathname=S.join("/")}p=b>=0?s[b]:"/"}let g=n0(c,p),v=f&&f!=="/"&&f.endsWith("/"),y=(u||f===".")&&i.endsWith("/");return!g.pathname.endsWith("/")&&(v||y)&&(g.pathname+="/"),g}var Ns=t=>t.join("/").replace(/\/\/+/g,"/"),a0=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),i0=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,l0=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,r0=class{constructor(t,s,i,r=!1){this.status=t,this.statusText=s||"",this.internal=r,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function o0(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function c0(t){return t.map(s=>s.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var dv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function fv(t,s){let i=t;if(typeof i!="string"||!uv.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let r=i,c=!1;if(dv)try{let u=new URL(window.location.href),f=i.startsWith("//")?new URL(u.protocol+i):new URL(i),p=ws(f.pathname,s);f.origin===u.origin&&p!=null?i=p+f.search+f.hash:c=!0}catch{kn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:c,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var hv=["POST","PUT","PATCH","DELETE"];new Set(hv);var u0=["GET",...hv];new Set(u0);var Ni=m.createContext(null);Ni.displayName="DataRouter";var go=m.createContext(null);go.displayName="DataRouterState";var d0=m.createContext(!1),mv=m.createContext({isTransitioning:!1});mv.displayName="ViewTransition";var f0=m.createContext(new Map);f0.displayName="Fetchers";var h0=m.createContext(null);h0.displayName="Await";var Tn=m.createContext(null);Tn.displayName="Navigation";var Ml=m.createContext(null);Ml.displayName="Location";var Hn=m.createContext({outlet:null,matches:[],isDataRoute:!1});Hn.displayName="Route";var kd=m.createContext(null);kd.displayName="RouteError";var pv="REACT_ROUTER_ERROR",m0="REDIRECT",p0="ROUTE_ERROR_RESPONSE";function g0(t){if(t.startsWith(`${pv}:${m0}:{`))try{let s=JSON.parse(t.slice(28));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.location=="string"&&typeof s.reloadDocument=="boolean"&&typeof s.replace=="boolean")return s}catch{}}function v0(t){if(t.startsWith(`${pv}:${p0}:{`))try{let s=JSON.parse(t.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new r0(s.status,s.statusText,s.data)}catch{}}function y0(t,{relative:s}={}){ht(wi(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:r}=m.useContext(Tn),{hash:c,pathname:u,search:f}=zl(t,{relative:s}),p=u;return i!=="/"&&(p=u==="/"?i:Ns([i,u])),r.createHref({pathname:p,search:f,hash:c})}function wi(){return m.useContext(Ml)!=null}function yn(){return ht(wi(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(Ml).location}var gv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function vv(t){m.useContext(Tn).static||m.useLayoutEffect(t)}function Kn(){let{isDataRoute:t}=m.useContext(Hn);return t?z0():b0()}function b0(){ht(wi(),"useNavigate() may be used only in the context of a <Router> component.");let t=m.useContext(Ni),{basename:s,navigator:i}=m.useContext(Tn),{matches:r}=m.useContext(Hn),{pathname:c}=yn(),u=JSON.stringify(Ed(r)),f=m.useRef(!1);return vv(()=>{f.current=!0}),m.useCallback((g,v={})=>{if(kn(f.current,gv),!f.current)return;if(typeof g=="number"){i.go(g);return}let y=_d(g,JSON.parse(u),c,v.relative==="path");t==null&&s!=="/"&&(y.pathname=y.pathname==="/"?s:Ns([s,y.pathname])),(v.replace?i.replace:i.push)(y,v.state,v)},[s,i,u,c,t])}var yv=m.createContext(null);function x0(){return m.useContext(yv)}function S0(t){let s=m.useContext(Hn).outlet;return m.useMemo(()=>s&&m.createElement(yv.Provider,{value:t},s),[s,t])}function Td(){let{matches:t}=m.useContext(Hn),s=t[t.length-1];return s?s.params:{}}function zl(t,{relative:s}={}){let{matches:i}=m.useContext(Hn),{pathname:r}=yn(),c=JSON.stringify(Ed(i));return m.useMemo(()=>_d(t,JSON.parse(c),r,s==="path"),[t,c,r,s])}function j0(t,s){return bv(t,s)}function bv(t,s,i,r,c){var C;ht(wi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=m.useContext(Tn),{matches:f}=m.useContext(Hn),p=f[f.length-1],g=p?p.params:{},v=p?p.pathname:"/",y=p?p.pathnameBase:"/",b=p&&p.route;{let z=b&&b.path||"";Sv(v,!b||z.endsWith("*")||z.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${v}" (under <Route path="${z}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${z}"> to <Route path="${z==="/"?"*":`${z}/*`}">.`)}let S=yn(),w;if(s){let z=typeof s=="string"?ji(s):s;ht(y==="/"||((C=z.pathname)==null?void 0:C.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${z.pathname}" was given in the \`location\` prop.`),w=z}else w=S;let _=w.pathname||"/",N=_;if(y!=="/"){let z=y.replace(/^\//,"").split("/");N="/"+_.replace(/^\//,"").split("/").slice(z.length).join("/")}let j=rv(t,{pathname:N});kn(b||j!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),kn(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let R=k0(j&&j.map(z=>Object.assign({},z,{params:Object.assign({},g,z.params),pathname:Ns([y,u.encodeLocation?u.encodeLocation(z.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:z.pathname]),pathnameBase:z.pathnameBase==="/"?y:Ns([y,u.encodeLocation?u.encodeLocation(z.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:z.pathnameBase])})),f,i,r,c);return s&&R?m.createElement(Ml.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...w},navigationType:"POP"}},R):R}function N0(){let t=M0(),s=o0(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),i=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:r},u={padding:"2px 4px",backgroundColor:r},f=null;return console.error("Error handled by React Router default ErrorBoundary:",t),f=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:u},"ErrorBoundary")," or"," ",m.createElement("code",{style:u},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},s),i?m.createElement("pre",{style:c},i):null,f)}var w0=m.createElement(N0,null),xv=class extends m.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,s){return s.location!==t.location||s.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:s.error,location:s.location,revalidation:t.revalidation||s.revalidation}}componentDidCatch(t,s){this.props.onError?this.props.onError(t,s):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const i=v0(t.digest);i&&(t=i)}let s=t!==void 0?m.createElement(Hn.Provider,{value:this.props.routeContext},m.createElement(kd.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?m.createElement(E0,{error:t},s):s}};xv.contextType=d0;var qu=new WeakMap;function E0({children:t,error:s}){let{basename:i}=m.useContext(Tn);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let r=g0(s.digest);if(r){let c=qu.get(s);if(c)throw c;let u=fv(r.location,i);if(dv&&!qu.get(s))if(u.isExternal||r.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:r.replace}));throw qu.set(s,f),f}return m.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return t}function _0({routeContext:t,match:s,children:i}){let r=m.useContext(Ni);return r&&r.static&&r.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=s.route.id),m.createElement(Hn.Provider,{value:t},i)}function k0(t,s=[],i=null,r=null,c=null){if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(s.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let u=t,f=i==null?void 0:i.errors;if(f!=null){let y=u.findIndex(b=>b.route.id&&(f==null?void 0:f[b.route.id])!==void 0);ht(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),u=u.slice(0,Math.min(u.length,y+1))}let p=!1,g=-1;if(i)for(let y=0;y<u.length;y++){let b=u[y];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(g=y),b.route.id){let{loaderData:S,errors:w}=i,_=b.route.loader&&!S.hasOwnProperty(b.route.id)&&(!w||w[b.route.id]===void 0);if(b.route.lazy||_){p=!0,g>=0?u=u.slice(0,g+1):u=[u[0]];break}}}let v=i&&r?(y,b)=>{var S,w;r(y,{location:i.location,params:((w=(S=i.matches)==null?void 0:S[0])==null?void 0:w.params)??{},unstable_pattern:c0(i.matches),errorInfo:b})}:void 0;return u.reduceRight((y,b,S)=>{let w,_=!1,N=null,j=null;i&&(w=f&&b.route.id?f[b.route.id]:void 0,N=b.route.errorElement||w0,p&&(g<0&&S===0?(Sv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,j=null):g===S&&(_=!0,j=b.route.hydrateFallbackElement||null)));let R=s.concat(u.slice(0,S+1)),C=()=>{let z;return w?z=N:_?z=j:b.route.Component?z=m.createElement(b.route.Component,null):b.route.element?z=b.route.element:z=y,m.createElement(_0,{match:b,routeContext:{outlet:y,matches:R,isDataRoute:i!=null},children:z})};return i&&(b.route.ErrorBoundary||b.route.errorElement||S===0)?m.createElement(xv,{location:i.location,revalidation:i.revalidation,component:N,error:w,children:C(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:v}):C()},null)}function Cd(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function T0(t){let s=m.useContext(Ni);return ht(s,Cd(t)),s}function C0(t){let s=m.useContext(go);return ht(s,Cd(t)),s}function R0(t){let s=m.useContext(Hn);return ht(s,Cd(t)),s}function Rd(t){let s=R0(t),i=s.matches[s.matches.length-1];return ht(i.route.id,`${t} can only be used on routes that contain a unique "id"`),i.route.id}function A0(){return Rd("useRouteId")}function M0(){var r;let t=m.useContext(kd),s=C0("useRouteError"),i=Rd("useRouteError");return t!==void 0?t:(r=s.errors)==null?void 0:r[i]}function z0(){let{router:t}=T0("useNavigate"),s=Rd("useNavigate"),i=m.useRef(!1);return vv(()=>{i.current=!0}),m.useCallback(async(c,u={})=>{kn(i.current,gv),i.current&&(typeof c=="number"?await t.navigate(c):await t.navigate(c,{fromRouteId:s,...u}))},[t,s])}var Wp={};function Sv(t,s,i){!s&&!Wp[t]&&(Wp[t]=!0,kn(!1,i))}m.memo(O0);function O0({routes:t,future:s,state:i,onError:r}){return bv(t,void 0,i,r,s)}function Jp({to:t,replace:s,state:i,relative:r}){ht(wi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=m.useContext(Tn);kn(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=m.useContext(Hn),{pathname:f}=yn(),p=Kn(),g=_d(t,Ed(u),f,r==="path"),v=JSON.stringify(g);return m.useEffect(()=>{p(JSON.parse(v),{replace:s,state:i,relative:r})},[p,v,r,s,i]),null}function D0(t){return S0(t.context)}function nn(t){ht(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function L0({basename:t="/",children:s=null,location:i,navigationType:r="POP",navigator:c,static:u=!1,unstable_useTransitions:f}){ht(!wi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=t.replace(/^\/*/,"/"),g=m.useMemo(()=>({basename:p,navigator:c,static:u,unstable_useTransitions:f,future:{}}),[p,c,u,f]);typeof i=="string"&&(i=ji(i));let{pathname:v="/",search:y="",hash:b="",state:S=null,key:w="default"}=i,_=m.useMemo(()=>{let N=ws(v,p);return N==null?null:{location:{pathname:N,search:y,hash:b,state:S,key:w},navigationType:r}},[p,v,y,b,S,w,r]);return kn(_!=null,`<Router basename="${p}"> is not able to match the URL "${v}${y}${b}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:m.createElement(Tn.Provider,{value:g},m.createElement(Ml.Provider,{children:s,value:_}))}function U0({children:t,location:s}){return j0(ud(t),s)}function ud(t,s=[]){let i=[];return m.Children.forEach(t,(r,c)=>{if(!m.isValidElement(r))return;let u=[...s,c];if(r.type===m.Fragment){i.push.apply(i,ud(r.props.children,u));return}ht(r.type===nn,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ht(!r.props.index||!r.props.children,"An index route cannot have child routes.");let f={id:r.props.id||u.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(f.children=ud(r.props.children,u)),i.push(f)}),i}var lo="get",ro="application/x-www-form-urlencoded";function vo(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function $0(t){return vo(t)&&t.tagName.toLowerCase()==="button"}function B0(t){return vo(t)&&t.tagName.toLowerCase()==="form"}function I0(t){return vo(t)&&t.tagName.toLowerCase()==="input"}function H0(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Z0(t,s){return t.button===0&&(!s||s==="_self")&&!H0(t)}function dd(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((s,i)=>{let r=t[i];return s.concat(Array.isArray(r)?r.map(c=>[i,c]):[[i,r]])},[]))}function q0(t,s){let i=dd(t);return s&&s.forEach((r,c)=>{i.has(c)||s.getAll(c).forEach(u=>{i.append(c,u)})}),i}var Qr=null;function P0(){if(Qr===null)try{new FormData(document.createElement("form"),0),Qr=!1}catch{Qr=!0}return Qr}var V0=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pu(t){return t!=null&&!V0.has(t)?(kn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ro}"`),null):t}function G0(t,s){let i,r,c,u,f;if(B0(t)){let p=t.getAttribute("action");r=p?ws(p,s):null,i=t.getAttribute("method")||lo,c=Pu(t.getAttribute("enctype"))||ro,u=new FormData(t)}else if($0(t)||I0(t)&&(t.type==="submit"||t.type==="image")){let p=t.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=t.getAttribute("formaction")||p.getAttribute("action");if(r=g?ws(g,s):null,i=t.getAttribute("formmethod")||p.getAttribute("method")||lo,c=Pu(t.getAttribute("formenctype"))||Pu(p.getAttribute("enctype"))||ro,u=new FormData(p,t),!P0()){let{name:v,type:y,value:b}=t;if(y==="image"){let S=v?`${v}.`:"";u.append(`${S}x`,"0"),u.append(`${S}y`,"0")}else v&&u.append(v,b)}}else{if(vo(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=lo,r=null,c=ro,f=t}return u&&c==="text/plain"&&(f=u,u=void 0),{action:r,method:i.toLowerCase(),encType:c,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ad(t,s){if(t===!1||t===null||typeof t>"u")throw new Error(s)}function F0(t,s,i,r){let c=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return i?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${r}`:c.pathname=`${c.pathname}.${r}`:c.pathname==="/"?c.pathname=`_root.${r}`:s&&ws(c.pathname,s)==="/"?c.pathname=`${s.replace(/\/$/,"")}/_root.${r}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${r}`,c}async function Y0(t,s){if(t.id in s)return s[t.id];try{let i=await import(t.module);return s[t.id]=i,i}catch(i){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function X0(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function K0(t,s,i){let r=await Promise.all(t.map(async c=>{let u=s.routes[c.route.id];if(u){let f=await Y0(u,i);return f.links?f.links():[]}return[]}));return ej(r.flat(1).filter(X0).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function eg(t,s,i,r,c,u){let f=(g,v)=>i[v]?g.route.id!==i[v].route.id:!0,p=(g,v)=>{var y;return i[v].pathname!==g.pathname||((y=i[v].route.path)==null?void 0:y.endsWith("*"))&&i[v].params["*"]!==g.params["*"]};return u==="assets"?s.filter((g,v)=>f(g,v)||p(g,v)):u==="data"?s.filter((g,v)=>{var b;let y=r.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(f(g,v)||p(g,v))return!0;if(g.route.shouldRevalidate){let S=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((b=i[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof S=="boolean")return S}return!0}):[]}function Q0(t,s,{includeHydrateFallback:i}={}){return W0(t.map(r=>{let c=s.routes[r.route.id];if(!c)return[];let u=[c.module];return c.clientActionModule&&(u=u.concat(c.clientActionModule)),c.clientLoaderModule&&(u=u.concat(c.clientLoaderModule)),i&&c.hydrateFallbackModule&&(u=u.concat(c.hydrateFallbackModule)),c.imports&&(u=u.concat(c.imports)),u}).flat(1))}function W0(t){return[...new Set(t)]}function J0(t){let s={},i=Object.keys(t).sort();for(let r of i)s[r]=t[r];return s}function ej(t,s){let i=new Set;return new Set(s),t.reduce((r,c)=>{let u=JSON.stringify(J0(c));return i.has(u)||(i.add(u),r.push({key:u,link:c})),r},[])}function jv(){let t=m.useContext(Ni);return Ad(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function tj(){let t=m.useContext(go);return Ad(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Md=m.createContext(void 0);Md.displayName="FrameworkContext";function Nv(){let t=m.useContext(Md);return Ad(t,"You must render this element inside a <HydratedRouter> element"),t}function nj(t,s){let i=m.useContext(Md),[r,c]=m.useState(!1),[u,f]=m.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:v,onMouseLeave:y,onTouchStart:b}=s,S=m.useRef(null);m.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let N=R=>{R.forEach(C=>{f(C.isIntersecting)})},j=new IntersectionObserver(N,{threshold:.5});return S.current&&j.observe(S.current),()=>{j.disconnect()}}},[t]),m.useEffect(()=>{if(r){let N=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(N)}}},[r]);let w=()=>{c(!0)},_=()=>{c(!1),f(!1)};return i?t!=="intent"?[u,S,{}]:[u,S,{onFocus:Nl(p,w),onBlur:Nl(g,_),onMouseEnter:Nl(v,w),onMouseLeave:Nl(y,_),onTouchStart:Nl(b,w)}]:[!1,S,{}]}function Nl(t,s){return i=>{t&&t(i),i.defaultPrevented||s(i)}}function sj({page:t,...s}){let{router:i}=jv(),r=m.useMemo(()=>rv(i.routes,t,i.basename),[i.routes,t,i.basename]);return r?m.createElement(ij,{page:t,matches:r,...s}):null}function aj(t){let{manifest:s,routeModules:i}=Nv(),[r,c]=m.useState([]);return m.useEffect(()=>{let u=!1;return K0(t,s,i).then(f=>{u||c(f)}),()=>{u=!0}},[t,s,i]),r}function ij({page:t,matches:s,...i}){let r=yn(),{future:c,manifest:u,routeModules:f}=Nv(),{basename:p}=jv(),{loaderData:g,matches:v}=tj(),y=m.useMemo(()=>eg(t,s,v,u,r,"data"),[t,s,v,u,r]),b=m.useMemo(()=>eg(t,s,v,u,r,"assets"),[t,s,v,u,r]),S=m.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let N=new Set,j=!1;if(s.forEach(C=>{var H;let z=u.routes[C.route.id];!z||!z.hasLoader||(!y.some(T=>T.route.id===C.route.id)&&C.route.id in g&&((H=f[C.route.id])!=null&&H.shouldRevalidate)||z.hasClientLoader?j=!0:N.add(C.route.id))}),N.size===0)return[];let R=F0(t,p,c.unstable_trailingSlashAwareDataRequests,"data");return j&&N.size>0&&R.searchParams.set("_routes",s.filter(C=>N.has(C.route.id)).map(C=>C.route.id).join(",")),[R.pathname+R.search]},[p,c.unstable_trailingSlashAwareDataRequests,g,r,u,y,s,t,f]),w=m.useMemo(()=>Q0(b,u),[b,u]),_=aj(b);return m.createElement(m.Fragment,null,S.map(N=>m.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...i})),w.map(N=>m.createElement("link",{key:N,rel:"modulepreload",href:N,...i})),_.map(({key:N,link:j})=>m.createElement("link",{key:N,nonce:i.nonce,...j})))}function lj(...t){return s=>{t.forEach(i=>{typeof i=="function"?i(s):i!=null&&(i.current=s)})}}var rj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{rj&&(window.__reactRouterVersion="7.12.0")}catch{}function oj({basename:t,children:s,unstable_useTransitions:i,window:r}){let c=m.useRef();c.current==null&&(c.current=$S({window:r,v5Compat:!0}));let u=c.current,[f,p]=m.useState({action:u.action,location:u.location}),g=m.useCallback(v=>{i===!1?p(v):m.startTransition(()=>p(v))},[i]);return m.useLayoutEffect(()=>u.listen(g),[u,g]),m.createElement(L0,{basename:t,children:s,location:f.location,navigationType:f.action,navigator:u,unstable_useTransitions:i})}var wv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gn=m.forwardRef(function({onClick:s,discover:i="render",prefetch:r="none",relative:c,reloadDocument:u,replace:f,state:p,target:g,to:v,preventScrollReset:y,viewTransition:b,unstable_defaultShouldRevalidate:S,...w},_){let{basename:N,unstable_useTransitions:j}=m.useContext(Tn),R=typeof v=="string"&&wv.test(v),C=fv(v,N);v=C.to;let z=y0(v,{relative:c}),[H,T,O]=nj(r,w),D=fj(v,{replace:f,state:p,target:g,preventScrollReset:y,relative:c,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:j});function F(ce){s&&s(ce),ce.defaultPrevented||D(ce)}let ne=m.createElement("a",{...w,...O,href:C.absoluteURL||z,onClick:C.isExternal||u?s:F,ref:lj(_,T),target:g,"data-discover":!R&&i==="render"?"true":void 0});return H&&!R?m.createElement(m.Fragment,null,ne,m.createElement(sj,{page:z})):ne});gn.displayName="Link";var cj=m.forwardRef(function({"aria-current":s="page",caseSensitive:i=!1,className:r="",end:c=!1,style:u,to:f,viewTransition:p,children:g,...v},y){let b=zl(f,{relative:v.relative}),S=yn(),w=m.useContext(go),{navigator:_,basename:N}=m.useContext(Tn),j=w!=null&&vj(b)&&p===!0,R=_.encodeLocation?_.encodeLocation(b).pathname:b.pathname,C=S.pathname,z=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;i||(C=C.toLowerCase(),z=z?z.toLowerCase():null,R=R.toLowerCase()),z&&N&&(z=ws(z,N)||z);const H=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let T=C===R||!c&&C.startsWith(R)&&C.charAt(H)==="/",O=z!=null&&(z===R||!c&&z.startsWith(R)&&z.charAt(R.length)==="/"),D={isActive:T,isPending:O,isTransitioning:j},F=T?s:void 0,ne;typeof r=="function"?ne=r(D):ne=[r,T?"active":null,O?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let ce=typeof u=="function"?u(D):u;return m.createElement(gn,{...v,"aria-current":F,className:ne,ref:y,style:ce,to:f,viewTransition:p},typeof g=="function"?g(D):g)});cj.displayName="NavLink";var uj=m.forwardRef(({discover:t="render",fetcherKey:s,navigate:i,reloadDocument:r,replace:c,state:u,method:f=lo,action:p,onSubmit:g,relative:v,preventScrollReset:y,viewTransition:b,unstable_defaultShouldRevalidate:S,...w},_)=>{let{unstable_useTransitions:N}=m.useContext(Tn),j=pj(),R=gj(p,{relative:v}),C=f.toLowerCase()==="get"?"get":"post",z=typeof p=="string"&&wv.test(p),H=T=>{if(g&&g(T),T.defaultPrevented)return;T.preventDefault();let O=T.nativeEvent.submitter,D=(O==null?void 0:O.getAttribute("formmethod"))||f,F=()=>j(O||T.currentTarget,{fetcherKey:s,method:D,navigate:i,replace:c,state:u,relative:v,preventScrollReset:y,viewTransition:b,unstable_defaultShouldRevalidate:S});N&&i!==!1?m.startTransition(()=>F()):F()};return m.createElement("form",{ref:_,method:C,action:R,onSubmit:r?g:H,...w,"data-discover":!z&&t==="render"?"true":void 0})});uj.displayName="Form";function dj(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ev(t){let s=m.useContext(Ni);return ht(s,dj(t)),s}function fj(t,{target:s,replace:i,state:r,preventScrollReset:c,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:g}={}){let v=Kn(),y=yn(),b=zl(t,{relative:u});return m.useCallback(S=>{if(Z0(S,s)){S.preventDefault();let w=i!==void 0?i:Tl(y)===Tl(b),_=()=>v(t,{replace:w,state:r,preventScrollReset:c,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:p});g?m.startTransition(()=>_()):_()}},[y,v,b,i,r,s,t,c,u,f,p,g])}function yo(t){kn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let s=m.useRef(dd(t)),i=m.useRef(!1),r=yn(),c=m.useMemo(()=>q0(r.search,i.current?null:s.current),[r.search]),u=Kn(),f=m.useCallback((p,g)=>{const v=dd(typeof p=="function"?p(new URLSearchParams(c)):p);i.current=!0,u("?"+v,g)},[u,c]);return[c,f]}var hj=0,mj=()=>`__${String(++hj)}__`;function pj(){let{router:t}=Ev("useSubmit"),{basename:s}=m.useContext(Tn),i=A0(),r=t.fetch,c=t.navigate;return m.useCallback(async(u,f={})=>{let{action:p,method:g,encType:v,formData:y,body:b}=G0(u,s);if(f.navigate===!1){let S=f.fetcherKey||mj();await r(S,i,f.action||p,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:y,body:b,formMethod:f.method||g,formEncType:f.encType||v,flushSync:f.flushSync})}else await c(f.action||p,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:y,body:b,formMethod:f.method||g,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:i,flushSync:f.flushSync,viewTransition:f.viewTransition})},[r,c,s,i])}function gj(t,{relative:s}={}){let{basename:i}=m.useContext(Tn),r=m.useContext(Hn);ht(r,"useFormAction must be used inside a RouteContext");let[c]=r.matches.slice(-1),u={...zl(t||".",{relative:s})},f=yn();if(t==null){u.search=f.search;let p=new URLSearchParams(u.search),g=p.getAll("index");if(g.some(y=>y==="")){p.delete("index"),g.filter(b=>b).forEach(b=>p.append("index",b));let y=p.toString();u.search=y?`?${y}`:""}}return(!t||t===".")&&c.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:Ns([i,u.pathname])),Tl(u)}function vj(t,{relative:s}={}){let i=m.useContext(mv);ht(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ev("useViewTransitionState"),c=zl(t,{relative:s});if(!i.isTransitioning)return!1;let u=ws(i.currentLocation.pathname,r)||i.currentLocation.pathname,f=ws(i.nextLocation.pathname,r)||i.nextLocation.pathname;return uo(c.pathname,f)!=null||uo(c.pathname,u)!=null}var Ei=lv();const yj=500;function Vu(t,s){try{s?localStorage.setItem(t,s):localStorage.removeItem(t)}catch{}}function zd(t){const[s,i]=m.useState(()=>{try{return localStorage.getItem(t)??""}catch{return""}}),r=m.useRef(null),c=m.useRef(t),u=m.useRef(null);m.useEffect(()=>{c.current=t},[t]),m.useEffect(()=>{try{const S=localStorage.getItem(t);i(S??"")}catch{i("")}},[t]);const f=m.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),u.current!==null&&(Vu(c.current,u.current),u.current=null)},[]);m.useEffect(()=>{const S=()=>{f()};return window.addEventListener("beforeunload",S),()=>{window.removeEventListener("beforeunload",S)}},[f]);const p=m.useCallback(S=>{i(S),u.current=S,r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{Vu(c.current,S),u.current=null},yj)},[]),g=m.useCallback(()=>{i(""),u.current=null,r.current&&(clearTimeout(r.current),r.current=null)},[]),v=m.useCallback(()=>{i(""),u.current=null,r.current&&(clearTimeout(r.current),r.current=null);try{localStorage.removeItem(c.current)}catch{}},[]),y=m.useCallback(()=>{try{const S=localStorage.getItem(c.current);S&&i(S)}catch{}},[]);m.useEffect(()=>()=>{u.current!==null&&Vu(c.current,u.current),r.current&&clearTimeout(r.current)},[]);const b=m.useMemo(()=>({clearInput:g,clearDraft:v,restoreFromStorage:y}),[g,v,y]);return[s,p,b]}const _v="yep-anywhere-sidebar-width",El=280,kv=560,bj=56,xj=600,Tv=1100;function Cv(t,s,i){return Math.min(Math.max(t,s),i)}function Rv(){if(typeof window>"u")return El;const t=localStorage.getItem(_v);if(t===null)return El;const s=Number.parseInt(t,10);return Number.isNaN(s)?El:Cv(s,El,kv)}function Sj(t){localStorage.setItem(_v,String(t))}function jj(){const[t,s]=m.useState(Rv),[i,r]=m.useState(!1),c=m.useCallback(p=>{const g=Cv(p,El,kv);s(g),Sj(g)},[]),u=m.useCallback(p=>p>=Tv,[]),f=m.useCallback(p=>p>=t+xj,[t]);return{width:t,setWidth:c,isResizing:i,setIsResizing:r,canShowDesktop:u,canShowExpanded:f}}function Nj(){return Rv()}function Av(){const[t,s]=m.useState(()=>typeof window>"u"?1200:window.innerWidth);return m.useEffect(()=>{const i=()=>{s(window.innerWidth)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),t}const wj=830,Ej=100,Gu=24,_j=80;function kj(t,s){const i=t-s,r=Math.min(i,wj);return(i-r)/2}function Tj(){const t=Av();return m.useMemo(()=>{if(t<Tv)return null;const s=Nj(),r=t<s+600?bj:s,c=kj(t,r),u=Ej+Gu*2;if(c<u)return null;const f=Gu,p=Math.min(c-Gu*2,300);return{visible:!0,right:f,bottom:_j,maxWidth:p}},[t])}const Mv="yep-anywhere-recent-project";function tg(){return typeof window>"u"?null:sessionStorage.getItem(Mv)}function Cj(t){typeof window>"u"||sessionStorage.setItem(Mv,t)}const zv="yep-anywhere-model",Ov="yep-anywhere-thinking-level",Dv="yep-anywhere-thinking-enabled",Lv="yep-anywhere-voice-input-enabled",fd=[{value:"default",label:"Default"},{value:"sonnet",label:"Sonnet"},{value:"opus",label:"Opus"},{value:"haiku",label:"Haiku"}],Rj=[{value:"light",label:"Light",tokens:4096,description:"4K tokens"},{value:"medium",label:"Medium",tokens:16e3,description:"16K tokens"},{value:"thorough",label:"Thorough",tokens:32e3,description:"32K tokens"}];function Uv(){const t=localStorage.getItem(zv);return t&&["default","sonnet","opus","haiku"].includes(t)?t:"default"}function Aj(t){localStorage.setItem(zv,t)}function $v(){const t=localStorage.getItem(Ov);return t&&["light","medium","thorough"].includes(t)?t:"medium"}function Mj(t){localStorage.setItem(Ov,t)}function Bv(){return localStorage.getItem(Dv)==="true"}function ng(t){localStorage.setItem(Dv,t?"true":"false")}function zj(){return localStorage.getItem(Lv)!=="false"}function sg(t){localStorage.setItem(Lv,t?"true":"false")}function bo(){const[t,s]=m.useState(Uv),[i,r]=m.useState($v),[c,u]=m.useState(Bv),[f,p]=m.useState(zj),g=m.useCallback(_=>{s(_),Aj(_)},[]),v=m.useCallback(_=>{r(_),Mj(_)},[]),y=m.useCallback(_=>{u(_),ng(_)},[]),b=m.useCallback(()=>{const _=!c;u(_),ng(_)},[c]),S=m.useCallback(_=>{p(_),sg(_)},[]),w=m.useCallback(()=>{const _=!f;p(_),sg(_)},[f]);return{model:t,setModel:g,thinkingLevel:i,setThinkingLevel:v,thinkingEnabled:c,setThinkingEnabled:y,toggleThinking:b,voiceInputEnabled:f,setVoiceInputEnabled:S,toggleVoiceInput:w}}function hd(){return Uv()}function md(){return Bv()?$v():"off"}function Oj(t,s){return!t||t===s?"":t.startsWith(s)?t.slice(s.length):t}function ag(){return typeof window>"u"?null:window.SpeechRecognition??window.webkitSpeechRecognition??null}function Dj(t={}){const{lang:s,onResult:i,onInterimResult:r,onEnd:c,onError:u}=t,[f]=m.useState(()=>!!ag()),[p,g]=m.useState(!1),[v,y]=m.useState(""),[b,S]=m.useState(null),w=m.useRef(null),_=m.useRef(!1),N=m.useRef(""),j=m.useRef(i),R=m.useRef(r),C=m.useRef(c),z=m.useRef(u);m.useEffect(()=>{j.current=i,R.current=r,C.current=c,z.current=u},[i,r,c,u]),m.useEffect(()=>()=>{w.current&&(w.current.abort(),w.current=null)},[]);const H=m.useCallback(()=>{var ne;const D=ag();if(!D){S("Speech recognition not supported");return}w.current&&w.current.abort(),S(null),y(""),_.current=!1,N.current="";const F=new D;w.current=F,F.continuous=!0,F.interimResults=!0,s&&(F.lang=s),F.onstart=()=>{g(!0)},F.onresult=ce=>{var k,U,I;let de="",q="";for(let oe=0;oe<ce.results.length;oe++){const he=ce.results[oe];if(he){const A=((k=he[0])==null?void 0:k.transcript)??"";he.isFinal?q=A:de+=A}}const Q=Oj(q,N.current);Q&&(N.current=q);const le=de.trim();le?(y(le),(U=R.current)==null||U.call(R,le)):de&&!le&&y("");const ue=Q.trim();ue&&(y(""),(I=j.current)==null||I.call(j,ue))},F.onerror=ce=>{var q;if(ce.error==="aborted")return;let de="Speech recognition error";switch(ce.error){case"no-speech":de="No speech detected";break;case"audio-capture":de="No microphone found";break;case"not-allowed":de="Microphone permission denied";break;case"network":de="Network error during recognition";break;default:de=`Error: ${ce.error}`}S(de),(q=z.current)==null||q.call(z,de),g(!1)},F.onend=()=>{var ce,de;if(g(!1),y(""),!_.current&&w.current===F)try{F.start()}catch{(ce=C.current)==null||ce.call(C)}else(de=C.current)==null||de.call(C)};try{F.start()}catch{S("Failed to start speech recognition"),(ne=z.current)==null||ne.call(z,"Failed to start speech recognition")}},[s]),T=m.useCallback(()=>{_.current=!0,w.current&&(w.current.stop(),w.current=null),g(!1),y("")},[]),O=m.useCallback(()=>{p?T():H()},[p,H,T]);return{isSupported:f,isListening:p,interimTranscript:v,startListening:H,stopListening:T,toggleListening:O,error:b}}const Od=m.forwardRef(function({onTranscript:s,onInterimTranscript:i,onListeningStart:r,disabled:c,className:u=""},f){const{voiceInputEnabled:p}=bo(),g=m.useCallback(C=>{s(C)},[s]),v=m.useCallback(C=>{i==null||i(C)},[i]),{isSupported:y,isListening:b,toggleListening:S,stopListening:w,error:_,interimTranscript:N}=Dj({onResult:g,onInterimResult:v}),j=y&&p;m.useImperativeHandle(f,()=>({stopAndFinalize:()=>{const C=N;return b&&w(),C},toggle:S,isListening:b,isAvailable:j}),[N,b,w,S,j]),m.useEffect(()=>{!b&&N&&(i==null||i(""))},[b,N,i]);const R=m.useCallback(()=>{const C=b;S(),C||r==null||r()},[b,S,r]);return j?l.jsx("button",{type:"button",className:`voice-input-button ${b?"listening":""} ${u}`,onClick:R,disabled:c,title:_||(b?"Stop voice input (Ctrl+Space)":"Start voice input (Ctrl+Space)"),"aria-label":b?"Stop voice input":"Start voice input","aria-pressed":b,children:b?l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:"voice-input-recording",children:[l.jsx("rect",{x:"4",y:"8",width:"3",height:"8",rx:"1",className:"bar bar-1"}),l.jsx("rect",{x:"10.5",y:"5",width:"3",height:"14",rx:"1",className:"bar bar-2"}),l.jsx("rect",{x:"17",y:"8",width:"3",height:"8",rx:"1",className:"bar bar-3"})]}):l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("path",{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),l.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),l.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),l.jsx("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]})}):null}),Lj="fab-draft",Dd="fab-prefill";function Uj(){return typeof window>"u"?null:sessionStorage.getItem(Dd)}function $j(){typeof window>"u"||sessionStorage.removeItem(Dd)}function Bj(t){typeof window>"u"||sessionStorage.setItem(Dd,t)}function Ij(){const t=Kn(),s=yn(),i=Tj(),[r,c]=m.useState(!1),[u,f,p]=zd(Lj),[g,v]=m.useState(""),y=m.useRef(null),b=m.useRef(null),S=Hj(s.pathname);m.useEffect(()=>{S&&Cj(S)},[S]),m.useEffect(()=>{var D;r&&((D=y.current)==null||D.focus())},[r]),m.useEffect(()=>{if(!r)return;const D=F=>{b.current&&!b.current.contains(F.target)&&c(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[r]);const w=m.useCallback(()=>{const D=u.trim();if(!D)return;const F=S??tg();F&&(Bj(D),p.clearDraft(),c(!1),t(`/new-session?projectId=${encodeURIComponent(F)}`))},[u,S,t,p]),_=m.useCallback(D=>{D.key==="Enter"&&!D.shiftKey?(D.preventDefault(),w()):D.key==="Escape"&&c(!1)},[w]),N=m.useCallback(()=>{if(!(S??tg())){t("/projects");return}c(!0)},[S,t]),j=m.useCallback(D=>{const F=u.trimEnd();f(F?`${F} ${D}`:D),v("")},[u,f]),R=m.useCallback(D=>{v(D)},[]),C=g?u+(u.trimEnd()?" ":"")+g:u,z=!i||s.pathname==="/new-session",{right:H,bottom:T,maxWidth:O}=i??{right:24,bottom:80,maxWidth:200};return l.jsxs("div",{ref:b,className:`fab-container ${r?"fab-expanded":"fab-collapsed"}`,style:{right:`${H}px`,bottom:`${T}px`,width:`${O}px`,display:z?"none":void 0},children:[r&&l.jsxs("div",{className:"fab-input-panel",children:[l.jsx("textarea",{ref:y,value:C,onChange:D=>{v(""),f(D.target.value)},onKeyDown:_,placeholder:"Start a new session...",className:"fab-textarea",rows:3}),l.jsxs("div",{className:"fab-input-toolbar",children:[l.jsx(Od,{onTranscript:j,onInterimTranscript:R,className:"toolbar-button"}),l.jsx("button",{type:"button",className:"fab-submit",onClick:w,disabled:!u.trim(),"aria-label":"Go to new session",children:"↵"})]})]}),l.jsx("button",{type:"button",className:`fab-button ${r?"fab-button-active":""}`,onClick:r?()=>c(!1):N,"aria-label":r?"Close":"New session",children:l.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:r?"fab-icon-rotated":"",children:[l.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),l.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function Hj(t){const s=t.match(/^\/projects\/([^/]+)/);return s!=null&&s[1]?decodeURIComponent(s[1]):null}function ig({target:t,onReload:s,onDismiss:i,unsafeToRestart:r,activeWorkers:c}){const u=t==="backend"?"Server":"Frontend",f=r&&t==="backend";return l.jsxs("div",{className:`reload-banner ${f?"reload-banner-warning":""}`,children:[l.jsxs("span",{className:"reload-banner-message",children:[u," code changed - reload to see changes"]}),f&&l.jsxs("span",{className:"reload-banner-warning-text",children:[c," active session",c!==1?"s":""," will be interrupted"]}),l.jsx("button",{type:"button",className:`reload-banner-button reload-banner-button-primary ${f?"reload-banner-button-danger":""}`,onClick:s,children:f?"Reload Anyway":`Reload ${u}`}),l.jsx("button",{type:"button",className:"reload-banner-button",onClick:i,children:"Dismiss"}),l.jsx("span",{className:"reload-banner-shortcut",children:"Ctrl+Shift+R"})]})}const Iv=64*1024;class _a extends Error{constructor(s,i){super(s),this.code=i,this.name="UploadError"}}async function Zj(t,s,i,r={},c=u=>new WebSocket(u)){const{onProgress:u,signal:f}=r;return console.log("[Upload] Starting upload to:",t),new Promise((p,g)=>{if(f!=null&&f.aborted){g(new _a("Upload aborted","ABORTED"));return}console.log("[Upload] Creating WebSocket connection...");const v=c(t);let y=!1,b=!1;const S=()=>{if(b)return;y=!0;const C={type:"cancel"};try{v.send(JSON.stringify(C))}catch{}v.close(1e3,"Aborted by user"),g(new _a("Upload aborted","ABORTED"))};f==null||f.addEventListener("abort",S);const w=()=>{f==null||f.removeEventListener("abort",S)},_=C=>{try{const z=JSON.parse(C.data);switch(z.type){case"progress":{u==null||u(z.bytesReceived);break}case"complete":{b=!0,w(),v.close(1e3,"Upload complete"),p(z.file);break}case"error":{b=!0,w(),v.close(1e3,"Error received"),g(new _a(z.message,z.code));break}}}catch{}},N=C=>{console.error("[Upload] WebSocket error:",C),!b&&(b=!0,w(),g(new _a("WebSocket error","WS_ERROR")))},j=C=>{console.log("[Upload] WebSocket closed:",C.code,C.reason),!b&&(w(),y||(b=!0,g(new _a(C.reason||"Connection closed unexpectedly","WS_CLOSED"))))},R=async()=>{console.log("[Upload] WebSocket connection opened");try{const C={type:"start",name:s.name,size:s.size,mimeType:s.mimeType};v.send(JSON.stringify(C));for await(const z of i){if(y)break;v.send(z)}if(!y){const z={type:"end"};v.send(JSON.stringify(z))}}catch(C){if(b)return;b=!0,w(),v.close(1e3,"Error during upload"),g(C instanceof _a?C:new _a(C instanceof Error?C.message:"Upload failed","UPLOAD_ERROR"))}};v.addEventListener("open",R),v.addEventListener("message",_),v.addEventListener("error",N),v.addEventListener("close",j)})}async function*qj(t,s=Iv){let i=0;for(;i<t.size;){const c=await t.slice(i,i+s).arrayBuffer();yield new Uint8Array(c),i+=s}}function Pj(t,s,i){const r=window.location.protocol==="https:"?"wss:":"ws:",c=window.location.host;return`${r}//${c}/api/projects/${t}/sessions/${s}/upload/ws`}async function Hv(t,s,i,r={}){const{chunkSize:c=Iv,...u}=r,f=Pj(t,s),p={name:i.name,size:i.size,mimeType:i.type||"application/octet-stream"},g=qj(i,c);return Zj(f,p,g,u)}const Vj="/api";async function Ue(t,s){const i=await fetch(`${Vj}${t}`,{...s,credentials:"include",headers:{"Content-Type":"application/json","X-Yep-Anywhere":"true",...s==null?void 0:s.headers}});if(!i.ok){const r=i.headers.get("X-Setup-Required")==="true",c=new Error(`API error: ${i.status} ${i.statusText}`);throw c.status=i.status,r&&(c.setupRequired=!0),c}return i.json()}const Ne={getProviders:()=>Ue("/providers"),getProjects:()=>Ue("/projects"),addProject:t=>Ue("/projects",{method:"POST",body:JSON.stringify({path:t})}),getProject:t=>Ue(`/projects/${t}`),getSession:(t,s,i)=>{const r=i?`?afterMessageId=${i}`:"";return Ue(`/projects/${t}/sessions/${s}${r}`)},getSessionMetadata:(t,s)=>Ue(`/projects/${t}/sessions/${s}/metadata`),getAgentSession:(t,s,i)=>Ue(`/projects/${t}/sessions/${s}/agents/${i}`),getAgentMappings:(t,s)=>Ue(`/projects/${t}/sessions/${s}/agents`),startSession:(t,s,i,r)=>Ue(`/projects/${t}/sessions`,{method:"POST",body:JSON.stringify({message:s,mode:i==null?void 0:i.mode,model:i==null?void 0:i.model,thinking:i==null?void 0:i.thinking,provider:i==null?void 0:i.provider,attachments:r})}),createSession:(t,s)=>Ue(`/projects/${t}/sessions/create`,{method:"POST",body:JSON.stringify({mode:s==null?void 0:s.mode,model:s==null?void 0:s.model,thinking:s==null?void 0:s.thinking,provider:s==null?void 0:s.provider})}),resumeSession:(t,s,i,r,c,u)=>Ue(`/projects/${t}/sessions/${s}/resume`,{method:"POST",body:JSON.stringify({message:i,mode:r==null?void 0:r.mode,model:r==null?void 0:r.model,thinking:r==null?void 0:r.thinking,provider:r==null?void 0:r.provider,attachments:c,tempId:u})}),queueMessage:(t,s,i,r,c,u)=>Ue(`/sessions/${t}/messages`,{method:"POST",body:JSON.stringify({message:s,mode:i,attachments:r,tempId:c,thinking:u})}),abortProcess:t=>Ue(`/processes/${t}/abort`,{method:"POST"}),respondToInput:(t,s,i,r,c)=>Ue(`/sessions/${t}/input`,{method:"POST",body:JSON.stringify({requestId:s,response:i,answers:r,feedback:c})}),setPermissionMode:(t,s)=>Ue(`/sessions/${t}/mode`,{method:"PUT",body:JSON.stringify({mode:s})}),setHold:(t,s)=>Ue(`/sessions/${t}/hold`,{method:"PUT",body:JSON.stringify({hold:s})}),getProcessInfo:t=>Ue(`/sessions/${t}/process`),markSessionSeen:(t,s,i)=>Ue(`/sessions/${t}/mark-seen`,{method:"POST",body:JSON.stringify({timestamp:s,messageId:i})}),markSessionUnread:t=>Ue(`/sessions/${t}/mark-seen`,{method:"DELETE"}),getLastSeen:()=>Ue("/notifications/last-seen"),updateSessionMetadata:(t,s)=>Ue(`/sessions/${t}/metadata`,{method:"PUT",body:JSON.stringify(s)}),cloneSession:(t,s,i)=>Ue(`/projects/${t}/sessions/${s}/clone`,{method:"POST",body:JSON.stringify({title:i})}),getPushPublicKey:()=>Ue("/push/vapid-public-key"),subscribePush:(t,s,i)=>Ue("/push/subscribe",{method:"POST",body:JSON.stringify({deviceId:t,subscription:s,deviceName:i})}),unsubscribePush:t=>Ue("/push/unsubscribe",{method:"POST",body:JSON.stringify({deviceId:t})}),getPushSubscriptions:()=>Ue("/push/subscriptions"),testPush:(t,s)=>Ue("/push/test",{method:"POST",body:JSON.stringify({deviceId:t,message:s})}),getFile:(t,s,i=!1)=>{const r=new URLSearchParams({path:s});return i&&r.set("highlight","true"),Ue(`/projects/${t}/files?${r.toString()}`)},getFileRawUrl:(t,s,i=!1)=>{const r=new URLSearchParams({path:s});return i&&r.set("download","true"),`/api/projects/${t}/files/raw?${r.toString()}`},getInbox:t=>Ue(t?`/inbox?projectId=${encodeURIComponent(t)}`:"/inbox"),getGlobalSessions:t=>{const s=new URLSearchParams;t!=null&&t.project&&s.set("project",t.project),t!=null&&t.q&&s.set("q",t.q),t!=null&&t.after&&s.set("after",t.after),t!=null&&t.limit&&s.set("limit",String(t.limit)),t!=null&&t.includeArchived&&s.set("includeArchived","true"),t!=null&&t.starred&&s.set("starred","true");const i=s.toString();return Ue(i?`/sessions?${i}`:"/sessions")},getAuthStatus:()=>Ue("/auth/status"),setupAccount:t=>Ue("/auth/setup",{method:"POST",body:JSON.stringify({password:t})}),login:t=>Ue("/auth/login",{method:"POST",body:JSON.stringify({password:t})}),logout:()=>Ue("/auth/logout",{method:"POST"}),changePassword:(t,s)=>Ue("/auth/change-password",{method:"POST",body:JSON.stringify({currentPassword:t,newPassword:s})}),getRecents:t=>Ue(t?`/recents?limit=${t}`:"/recents"),recordVisit:(t,s)=>Ue("/recents/visit",{method:"POST",body:JSON.stringify({sessionId:t,projectId:s})}),clearRecents:()=>Ue("/recents",{method:"DELETE"}),getBeadsStatus:t=>Ue(`/projects/${t}/beads/status`),getBeadsList:t=>Ue(`/projects/${t}/beads/list`),getBeadsReady:t=>Ue(`/projects/${t}/beads/ready`)},Zv=m.createContext(null);function Gj({children:t}){const[s,i]=m.useState(!1),[r,c]=m.useState(!1),[u,f]=m.useState(!0),[p,g]=m.useState(!1),v=Kn(),y=yn(),b=m.useCallback(async()=>{try{const j=await Ne.getAuthStatus();j.enabled===!1?(i(!0),c(!1),g(!0)):(i(j.authenticated),c(j.setupRequired),g(!1))}catch(j){console.warn("[Auth] Auth check failed, assuming auth disabled:",j),i(!0),c(!1),g(!0)}finally{f(!1)}},[]);m.useEffect(()=>{b()},[b]),m.useEffect(()=>{!u&&!s&&!p&&y.pathname!=="/login"&&v("/login",{state:{from:y.pathname}})},[u,s,p,y.pathname,v]);const S=m.useCallback(async j=>{await Ne.login(j),i(!0),c(!1)},[]),w=m.useCallback(async()=>{await Ne.logout(),i(!1),v("/login")},[v]),_=m.useCallback(async j=>{await Ne.setupAccount(j),i(!0),c(!1)},[]),N=m.useCallback(async(j,R)=>{await Ne.changePassword(j,R)},[]);return l.jsx(Zv.Provider,{value:{isAuthenticated:s,isSetupMode:r,isLoading:u,authDisabled:p,login:S,logout:w,setupAccount:_,changePassword:N,checkAuth:b},children:t})}function qv(){const t=m.useContext(Zv);if(!t)throw new Error("useAuth must be used within an AuthProvider");return t}const Fj="/api",Yj=2e3;class Xj{constructor(){Ke(this,"eventSource",null);Ke(this,"listeners",new Map);Ke(this,"reconnectTimeout",null);Ke(this,"hasConnected",!1);Ke(this,"_connected",!1)}get connected(){return this._connected}connect(){if(this.eventSource)return;const s=new EventSource(`${Fj}/activity/events`);s.onopen=()=>{const i=this.hasConnected;this.hasConnected=!0,this._connected=!0,i&&this.emit("reconnect",void 0)},s.addEventListener("file-change",i=>this.handleEvent("file-change",i)),s.addEventListener("session-status-changed",i=>this.handleEvent("session-status-changed",i)),s.addEventListener("session-created",i=>this.handleEvent("session-created",i)),s.addEventListener("session-updated",i=>this.handleEvent("session-updated",i)),s.addEventListener("session-seen",i=>this.handleEvent("session-seen",i)),s.addEventListener("process-state-changed",i=>this.handleEvent("process-state-changed",i)),s.addEventListener("session-metadata-changed",i=>this.handleEvent("session-metadata-changed",i)),s.addEventListener("source-change",i=>this.handleEvent("source-change",i)),s.addEventListener("backend-reloaded",()=>this.emit("backend-reloaded",void 0)),s.addEventListener("worker-activity-changed",i=>this.handleEvent("worker-activity-changed",i)),s.addEventListener("connected",()=>{}),s.addEventListener("heartbeat",()=>{}),s.onerror=()=>{this._connected=!1,s.close(),this.eventSource=null,this.reconnectTimeout=setTimeout(()=>this.connect(),Yj)},this.eventSource=s}disconnect(){this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this._connected=!1}on(s,i){let r=this.listeners.get(s);return r||(r=new Set,this.listeners.set(s,r)),r.add(i),()=>{r.delete(i)}}handleEvent(s,i){if(!(i.data===void 0||i.data===null))try{const r=JSON.parse(i.data);this.emit(s,r)}catch{}}emit(s,i){const r=this.listeners.get(s);if(r)for(const c of r)c(i)}}const Jt=new Xj,Kj=500;function _i(t={}){const{maxEvents:s=Kj,onFileChange:i,onSessionStatusChange:r,onSessionCreated:c,onSessionSeen:u,onProcessStateChange:f,onSessionMetadataChange:p,onSessionUpdated:g,onReconnect:v}=t,[y,b]=m.useState([]),[S,w]=m.useState(Jt.connected),[_,N]=m.useState(!1),j=m.useRef(i);j.current=i;const R=m.useRef(r);R.current=r;const C=m.useRef(c);C.current=c;const z=m.useRef(u);z.current=u;const H=m.useRef(f);H.current=f;const T=m.useRef(p);T.current=p;const O=m.useRef(g);O.current=g;const D=m.useRef(v);D.current=v;const F=m.useRef(s);F.current=s;const ne=m.useRef(_);ne.current=_,m.useEffect(()=>{const k=[];return k.push(Jt.on("file-change",U=>{var I;(I=j.current)==null||I.call(j,U),ne.current||b(oe=>[U,...oe].slice(0,F.current))})),k.push(Jt.on("session-status-changed",U=>{var I;(I=R.current)==null||I.call(R,U)})),k.push(Jt.on("session-created",U=>{var I;(I=C.current)==null||I.call(C,U)})),k.push(Jt.on("session-seen",U=>{var I;(I=z.current)==null||I.call(z,U)})),k.push(Jt.on("process-state-changed",U=>{var I;(I=H.current)==null||I.call(H,U)})),k.push(Jt.on("session-metadata-changed",U=>{var I;(I=T.current)==null||I.call(T,U)})),k.push(Jt.on("session-updated",U=>{var I;(I=O.current)==null||I.call(O,U)})),k.push(Jt.on("reconnect",()=>{var U;w(!0),(U=D.current)==null||U.call(D)})),()=>{for(const U of k)U()}},[]),m.useEffect(()=>{const U=setInterval(()=>{w(Jt.connected)},1e3);return()=>clearInterval(U)},[]);const ce=m.useCallback(()=>{b([])},[]),de=m.useCallback(()=>{N(k=>!k)},[]),q=m.useCallback(k=>{const U=new RegExp(k,"i");return y.filter(I=>U.test(I.relativePath))},[y]),Q=m.useCallback(k=>y.filter(U=>U.fileType===k),[y]),le=m.useCallback(()=>{},[]),ue=m.useCallback(()=>{},[]);return{events:y,connected:S,paused:_,connect:le,disconnect:ue,clearEvents:ce,togglePause:de,filterByPath:q,filterByType:Q}}const Qj=500,Wj=["needsAttention","active","recentActivity","unread8h","unread24h"];function Jj(t,s){const i={needsAttention:[],active:[],recentActivity:[],unread8h:[],unread24h:[]};for(const r of Wj){const c=t[r],u=s[r],f=new Map(c.map(v=>[v.sessionId,v])),p=[];for(const v of u){const y=f.get(v);y&&p.push(y)}const g=new Set(u);for(const v of c)g.has(v.sessionId)||p.push(v);i[r]=p}return i}function lg(t){return{needsAttention:t.needsAttention.map(s=>s.sessionId),active:t.active.map(s=>s.sessionId),recentActivity:t.recentActivity.map(s=>s.sessionId),unread8h:t.unread8h.map(s=>s.sessionId),unread24h:t.unread24h.map(s=>s.sessionId)}}function e1(){return{needsAttention:[],active:[],recentActivity:[],unread8h:[],unread24h:[]}}const t1={needsAttention:[],active:[],recentActivity:[],unread8h:[],unread24h:[]},Pv=m.createContext(null);function n1({children:t,initialEnabled:s=!0}){const[i,r]=m.useState(t1),[c,u]=m.useState(!0),[f,p]=m.useState(null),[g,v]=m.useState(s),y=m.useRef(e1()),b=m.useRef(!1),S=m.useRef(null),w=m.useRef(g);w.current=g;const _=m.useCallback(async(H=!1)=>{if(w.current)try{const T=await Ne.getInbox();if(!b.current||H)r(T),y.current=lg(T),b.current=!0;else{const O=Jj(T,y.current);r(O),y.current=lg(O)}p(null)}catch(T){p(T instanceof Error?T:new Error(String(T)))}finally{u(!1)}},[]),N=m.useCallback(()=>_(!0),[_]),j=m.useCallback(()=>{w.current&&(S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{_()},Qj))},[_]);_i({onProcessStateChange:j,onSessionStatusChange:j,onSessionSeen:j,onSessionCreated:j}),m.useEffect(()=>{g&&_()},[g,_]),m.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const R=i.needsAttention.length,C=i.active.length,z=i.needsAttention.length+i.active.length+i.recentActivity.length+i.unread8h.length+i.unread24h.length;return l.jsx(Pv.Provider,{value:{needsAttention:i.needsAttention,active:i.active,recentActivity:i.recentActivity,unread8h:i.unread8h,unread24h:i.unread24h,inbox:i,loading:c,error:f,refresh:N,refetch:_,totalNeedsAttention:R,totalActive:C,totalItems:z,enabled:g,setEnabled:v},children:t})}function Vv(){const t=m.useContext(Pv);if(!t)throw new Error("useInboxContext must be used within an InboxProvider");return t}const Gv="yep-anywhere-schema-validation",Fu={enabled:!1,ignoredTools:[]};function s1(){const t=localStorage.getItem(Gv);if(!t)return Fu;try{return{...Fu,...JSON.parse(t)}}catch{return Fu}}function rg(t){localStorage.setItem(Gv,JSON.stringify(t))}function Fv(){const[t,s]=m.useState(s1),i=m.useCallback(c=>{s(u=>{const f={...u,enabled:c};return rg(f),f})},[]),r=m.useCallback(c=>{s(u=>{const f={...u,ignoredTools:c};return rg(f),f})},[]);return{settings:t,setEnabled:i,setIgnoredTools:r}}function a1({toasts:t,onDismiss:s}){return t.length===0?null:l.jsx("div",{className:"toast-container",children:t.map(i=>l.jsxs("div",{className:`toast toast-${i.type}`,onClick:()=>s(i.id),onKeyDown:r=>r.key==="Enter"&&s(i.id),role:"alert",children:[l.jsx("span",{className:"toast-message",children:i.message}),i.action&&l.jsx("button",{type:"button",className:"toast-action",onClick:r=>{var c;r.stopPropagation(),(c=i.action)==null||c.onClick(),s(i.id)},children:i.action.label})]},i.id))})}const Yv=m.createContext(null);function i1({children:t}){const[s,i]=m.useState([]),r=m.useCallback((u,f="info",p)=>{const g=crypto.randomUUID();i(y=>[...y,{id:g,message:u,type:f,action:p}]),setTimeout(()=>{i(y=>y.filter(b=>b.id!==g))},p?7e3:5e3)},[]),c=m.useCallback(u=>{i(f=>f.filter(p=>p.id!==u))},[]);return l.jsxs(Yv.Provider,{value:{showToast:r,dismissToast:c},children:[t,l.jsx(a1,{toasts:s,onDismiss:c})]})}function Xv(){const t=m.useContext(Yv);if(!t)throw new Error("useToastContext must be used within a ToastProvider");return t}const Kv=m.createContext(null);function l1({children:t}){const{settings:s,setIgnoredTools:i}=Fv(),{showToast:r}=Xv(),c=m.useRef(new Set),u=m.useCallback(y=>s.ignoredTools.includes(y),[s.ignoredTools]),f=m.useCallback(y=>{s.ignoredTools.includes(y)||i([...s.ignoredTools,y])},[s.ignoredTools,i]),p=m.useCallback(()=>{i([])},[i]),v={reportValidationError:m.useCallback((y,b)=>{console.error(`Schema validation failed for ${y}:`,b),s.enabled&&(s.ignoredTools.includes(y)||c.current.has(y)||(c.current.add(y),r(`Schema validation failed for ${y}`,"error",{label:"Ignore",onClick:()=>f(y)})))},[s.enabled,s.ignoredTools,r,f]),isToolIgnored:u,ignoreToolErrors:f,clearIgnoredTools:p,ignoredTools:s.ignoredTools,enabled:s.enabled};return l.jsx(Kv.Provider,{value:v,children:t})}function Mt(){const t=m.useContext(Kv);if(!t)throw new Error("useSchemaValidationContext must be used within a SchemaValidationProvider");return t}const Yu=/^\(\d+\)\s*/;function Qv(){const{totalNeedsAttention:t}=Vv();return m.useEffect(()=>{let s=!1;const i=()=>{s=!0;const u=document.title.replace(Yu,"");t>0?document.title=`(${t}) ${u}`:document.title=u,setTimeout(()=>{s=!1},0)};i();const r=new MutationObserver(()=>{if(s)return;const u=document.title;(t>0?u.startsWith(`(${t}) `):!Yu.test(u))||i()}),c=document.querySelector("title");return c&&r.observe(c,{childList:!0,characterData:!0,subtree:!0}),()=>{r.disconnect(),document.title=document.title.replace(Yu,"")}},[t]),t}const Wv="yep-anywhere-notify-in-app";function pd(){return localStorage.getItem(Wv)==="true"}function gd(t){"serviceWorker"in navigator&&(navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"setting-update",key:"notifyInApp",value:t}),navigator.serviceWorker.ready.then(s=>{var i;(i=s.active)==null||i.postMessage({type:"setting-update",key:"notifyInApp",value:t})}))}function r1(){m.useEffect(()=>{const t=pd();if(gd(t),"serviceWorker"in navigator){const s=()=>{gd(pd())};return navigator.serviceWorker.addEventListener("controllerchange",s),()=>{navigator.serviceWorker.removeEventListener("controllerchange",s)}}},[])}function o1(){const[t,s]=m.useState(pd);m.useEffect(()=>{gd(t)},[t]);const i=m.useCallback(r=>{localStorage.setItem(Wv,String(r)),s(r)},[]);return{notifyInApp:t,setNotifyInApp:i}}const Wr="/api";function Jv(){const[t,s]=m.useState({backend:!1,frontend:!1}),[i,r]=m.useState(null),[c,u]=m.useState(Jt.connected),[f,p]=m.useState({type:"worker-activity-changed",activeWorkers:0,queueLength:0,hasActiveWork:!1,timestamp:""}),g=m.useCallback(()=>{fetch(`${Wr}/dev/status`).then(N=>N.ok?N.json():null).then(N=>{N&&!N.backendDirty&&s(j=>({...j,backend:!1}))}).catch(()=>{}),fetch(`${Wr}/status/workers`).then(N=>N.ok?N.json():null).then(N=>{N&&p(N)}).catch(()=>{})},[]);m.useEffect(()=>{fetch(`${Wr}/dev/status`).then(N=>{if(N.ok)return N.json();throw new Error("Dev routes not available")}).then(N=>{r(N),N.backendDirty&&s(j=>({...j,backend:!0}))}).catch(()=>{r(null)})},[]),m.useEffect(()=>{const N=[];return N.push(Jt.on("source-change",j=>{s(R=>({...R,[j.target]:!0}))})),N.push(Jt.on("backend-reloaded",()=>{s(j=>({...j,backend:!1}))})),N.push(Jt.on("worker-activity-changed",j=>{p(j)})),N.push(Jt.on("reconnect",()=>{u(!0),g()})),()=>{for(const j of N)j()}},[g]),m.useEffect(()=>{const j=setInterval(()=>{u(Jt.connected)},1e3);return()=>clearInterval(j)},[]),m.useEffect(()=>{(i!=null&&i.noBackendReload||i!=null&&i.noFrontendReload)&&g()},[i,g]);const v=m.useCallback(async()=>{console.log("[ReloadNotifications] Requesting backend reload...");try{const N=await fetch(`${Wr}/dev/reload`,{method:"POST",headers:{"X-Yep-Anywhere":"true"}});console.log("[ReloadNotifications] Reload response:",N.status),s(j=>({...j,backend:!1}))}catch(N){console.log("[ReloadNotifications] Reload error (may be expected):",N)}},[]),y=m.useCallback(()=>{window.location.reload()},[]),b=m.useCallback(()=>{t.backend?v():t.frontend&&y()},[t,v,y]),S=m.useCallback(N=>{s(j=>({...j,[N]:!1}))},[]),w=m.useCallback(()=>{s({backend:!1,frontend:!1})},[]);return m.useEffect(()=>{const N=j=>{j.ctrlKey&&j.shiftKey&&j.key==="R"&&(j.preventDefault(),b())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[b]),{isManualReloadMode:(i==null?void 0:i.noBackendReload)||(i==null?void 0:i.noFrontendReload),pendingReloads:t,connected:c,reloadBackend:v,reloadFrontend:y,reload:b,dismiss:S,dismissAll:w,workerActivity:f,unsafeToRestart:f.hasActiveWork}}function c1({children:t}){r1(),Qv();const{isManualReloadMode:s,pendingReloads:i,reloadBackend:r,reloadFrontend:c,dismiss:u,unsafeToRestart:f,workerActivity:p}=Jv();return l.jsxs(l.Fragment,{children:[s&&i.backend&&l.jsx(ig,{target:"backend",onReload:r,onDismiss:()=>u("backend"),unsafeToRestart:f,activeWorkers:p.activeWorkers}),s&&i.frontend&&l.jsx(ig,{target:"frontend",onReload:c,onDismiss:()=>u("frontend")}),t,l.jsx(Ij,{})]})}function u1({children:t}){return l.jsx(i1,{children:l.jsx(Gj,{children:l.jsx(n1,{children:l.jsx(l1,{children:l.jsx(c1,{children:t})})})})})}const ey="yep-anywhere-font-size",d1={small:.85,default:1,large:1.15,larger:1.3},f1={small:"Small",default:"Default",large:"Large",larger:"Larger"},ty=["small","default","large","larger"];function h1(t){return f1[t]}function ny(t){const s=d1[t],i=document.documentElement;i.style.fontSize=`${100*s}%`,i.style.setProperty("--font-size-xs",`${10*s}px`),i.style.setProperty("--font-size-sm",`${12*s}px`),i.style.setProperty("--font-size-base",`${13*s}px`),i.style.setProperty("--font-size-lg",`${14*s}px`)}function sy(){const t=localStorage.getItem(ey);return t&&ty.includes(t)?t:"large"}function m1(t){localStorage.setItem(ey,t)}function p1(){const[t,s]=m.useState(sy);m.useEffect(()=>{ny(t)},[t]);const i=m.useCallback(r=>{s(r),m1(r)},[]);return{fontSize:t,setFontSize:i}}function g1(){const t=sy();ny(t)}const ay="yep-anywhere-theme",v1={auto:"Auto",light:"Light",dark:"Dark",verydark:"Very Dark"},iy=["auto","light","dark","verydark"];function y1(t){return v1[t]}function ly(t){document.documentElement.setAttribute("data-theme",t)}function ry(){const t=localStorage.getItem(ay);return t&&iy.includes(t)?t:"auto"}function b1(t){localStorage.setItem(ay,t)}function x1(){const[t,s]=m.useState(ry);m.useEffect(()=>{ly(t)},[t]);const i=m.useCallback(r=>{s(r),b1(r)},[]);return{theme:t,setTheme:i}}function S1(){const t=ry();ly(t)}const j1=500,N1={totalCount:0,unreadCount:0,starredCount:0,archivedCount:0,providerCounts:{}};function fo(t={}){const{projectId:s,searchQuery:i,limit:r,includeArchived:c,starred:u}=t,[f,p]=m.useState([]),[g,v]=m.useState(N1),[y,b]=m.useState([]),[S,w]=m.useState(!0),[_,N]=m.useState(null),[j,R]=m.useState(!1),C=m.useRef(null),z=m.useRef(!1),H=m.useRef([]);H.current=f;const T=m.useRef([]);T.current=y;const O=m.useRef({}),D=m.useCallback(async()=>{const k=O.current.projectId!==s||O.current.searchQuery!==i||O.current.includeArchived!==c||O.current.starred!==u;k&&(z.current=!1),O.current={projectId:s,searchQuery:i,limit:r,includeArchived:c,starred:u},(H.current.length===0||k)&&w(!0),N(null);try{const U=await Ne.getGlobalSessions({project:s??void 0,q:i||void 0,limit:r,includeArchived:c,starred:u});!z.current||k?(p(U.sessions),z.current=!0):p(I=>{const oe=new Map(U.sessions.map(ae=>[ae.id,ae])),A=I.map(ae=>oe.get(ae.id)??ae).filter(ae=>oe.has(ae.id)),Y=new Set(I.map(ae=>ae.id));return[...U.sessions.filter(ae=>!Y.has(ae.id)),...A]}),R(U.hasMore),v(U.stats),b(U.projects)}catch(U){N(U instanceof Error?U:new Error(String(U)))}finally{w(!1)}},[s,i,r,c,u]),F=m.useCallback(async()=>{if(!j||f.length===0)return;const k=f[f.length-1];if(k)try{const U=await Ne.getGlobalSessions({project:s??void 0,q:i||void 0,limit:r,after:k.updatedAt,includeArchived:c,starred:u});p(I=>{const oe=new Set(I.map(A=>A.id)),he=U.sessions.filter(A=>!oe.has(A.id));return[...I,...he]}),R(U.hasMore)}catch(U){N(U instanceof Error?U:new Error(String(U)))}},[j,f,s,i,r,c,u]),ne=m.useCallback(()=>{C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{D()},j1)},[D]),ce=m.useCallback(k=>{p(U=>U.map(I=>I.id===k.sessionId?{...I,status:k.status}:I)),k.status.state==="idle"&&p(U=>U.map(I=>I.id===k.sessionId?{...I,pendingInputType:void 0,processState:void 0}:I))},[]),de=m.useCallback(k=>{p(U=>U.map(I=>I.id===k.sessionId?{...I,processState:k.processState}:I)),k.processState==="running"&&p(U=>U.map(I=>I.id===k.sessionId?{...I,pendingInputType:void 0}:I))},[]),q=m.useCallback(k=>{if(!(s&&k.session.projectId!==s)&&!(u&&!k.session.isStarred)){if(i){ne();return}p(U=>{if(U.some(A=>A.id===k.session.id))return U;const I=T.current.find(A=>A.id===k.session.projectId),oe=(I==null?void 0:I.name)??k.session.projectId;return[{id:k.session.id,title:k.session.title,createdAt:k.session.createdAt,updatedAt:k.session.updatedAt,messageCount:k.session.messageCount,provider:k.session.provider,projectId:k.session.projectId,projectName:oe,status:k.session.status,pendingInputType:k.session.pendingInputType,processState:k.session.processState,hasUnread:k.session.hasUnread,customTitle:k.session.customTitle,isArchived:k.session.isArchived,isStarred:k.session.isStarred},...U]})}},[s,i,u,ne]),Q=m.useCallback(k=>{p(U=>{const I=U.map(oe=>oe.id!==k.sessionId?oe:{...oe,...k.title!==void 0&&{customTitle:k.title},...k.archived!==void 0&&{isArchived:k.archived},...k.starred!==void 0&&{isStarred:k.starred}});return u&&k.starred===!1?I.filter(oe=>oe.id!==k.sessionId):I})},[u]),le=m.useCallback(k=>{p(U=>U.map(I=>I.id!==k.sessionId?I:{...I,hasUnread:!1}))},[]),ue=m.useCallback(k=>{p(U=>U.map(I=>I.id!==k.sessionId?I:{...I,...k.title!==void 0&&{title:k.title},...k.messageCount!==void 0&&{messageCount:k.messageCount},...k.updatedAt!==void 0&&{updatedAt:k.updatedAt}}))},[]);return _i({onSessionStatusChange:ce,onSessionCreated:q,onProcessStateChange:de,onSessionMetadataChange:Q,onSessionSeen:le,onSessionUpdated:ue,onReconnect:D}),m.useEffect(()=>{D()},[D]),m.useEffect(()=>()=>{C.current&&clearTimeout(C.current)},[]),{sessions:f,stats:g,projects:y,loading:S,error:_,hasMore:j,loadMore:F,refetch:D}}function oy(t){const[s,i]=m.useState(null),[r,c]=m.useState(!0),[u,f]=m.useState(null),p=m.useRef(void 0);return m.useEffect(()=>{if(!t){i(null),c(!1);return}p.current!==t&&(c(!0),f(null),p.current=t);let g=!1;return Ne.getProject(t).then(v=>{g||(i(v.project),c(!1))}).catch(v=>{g||(f(v instanceof Error?v:new Error(String(v))),c(!1))}),()=>{g=!0}},[t]),m.useMemo(()=>({project:s,loading:r,error:u}),[s,r,u])}const w1=500;function ki(){const[t,s]=m.useState([]),[i,r]=m.useState(!0),[c,u]=m.useState(null),f=m.useRef(null),p=m.useRef(!1),g=m.useCallback(async()=>{r(!0),u(null);try{const b=await Ne.getProjects();s(b.projects)}catch(b){u(b instanceof Error?b:new Error(String(b)))}finally{r(!1)}},[]);m.useEffect(()=>{p.current||(p.current=!0,g())},[g]);const v=m.useCallback(()=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{g()},w1)},[g]),y=m.useCallback(b=>{v()},[v]);return _i({onSessionStatusChange:y}),m.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]),{projects:t,loading:i,error:c,refetch:g}}const E1=12;function _1(){const{projects:t,loading:s}=ki();return{recentProjects:m.useMemo(()=>[...t].filter(r=>r.lastActivity!==null).sort((r,c)=>{const u=r.lastActivity?new Date(r.lastActivity).getTime():0;return(c.lastActivity?new Date(c.lastActivity).getTime():0)-u}).slice(0,E1),[t]),loading:s}}const k1=/<ide_(opened_file|selection)>[\s\S]*?<\/ide_\1>/g,T1=/<ide_opened_file>([\s\S]*?)<\/ide_opened_file>/g;function C1(t){return t.replace(k1,"").trim()}function R1(t){const s=t.match(/(?:user opened the file|opened the file)\s+(.+?)\s+in the IDE/i);return(s==null?void 0:s[1])??null}function A1(t){const s=[];for(const i of t.matchAll(T1)){const r=i[1];if(r){const c=R1(r);c&&s.push(c)}}return s}function M1(t){const s=t.split("/");return s[s.length-1]||t}const z1="claude",O1="opus";function og(t){return t==="default"||!t?O1:t}function vd(t){return t.uuid??t.id??""}function D1(t){const s=new Set;for(const i of t){if(i.parentUuid&&!s.has(i.parentUuid))return!0;s.add(vd(i))}return!1}function L1(t){if(t.length<=1||!D1(t))return t;const s=new Map;for(const u of t){const f=u.parentUuid??null,p=s.get(f)??[];p.push(u),s.set(f,p)}const i=[],r=new Set;function c(u){for(const f of s.get(u)??[]){const p=vd(f);r.has(p)||(r.add(p),i.push(f),c(p))}}c(null);for(const u of t)r.has(vd(u))||i.push(u);return i}function cy(t){const s=new TextEncoder().encode(t);return btoa(String.fromCharCode(...s)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function uy(t){return t?t.customTitle??t.title??"Untitled":"Untitled"}function J(t,s,i){function r(p,g){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:g,constr:f,traits:new Set},enumerable:!1}),p._zod.traits.has(t))return;p._zod.traits.add(t),s(p,g);const v=f.prototype,y=Object.keys(v);for(let b=0;b<y.length;b++){const S=y[b];S in p||(p[S]=v[S].bind(p))}}const c=(i==null?void 0:i.Parent)??Object;class u extends c{}Object.defineProperty(u,"name",{value:t});function f(p){var g;const v=i!=null&&i.Parent?new u:this;r(v,p),(g=v._zod).deferred??(g.deferred=[]);for(const y of v._zod.deferred)y();return v}return Object.defineProperty(f,"init",{value:r}),Object.defineProperty(f,Symbol.hasInstance,{value:p=>{var g,v;return i!=null&&i.Parent&&p instanceof i.Parent?!0:(v=(g=p==null?void 0:p._zod)==null?void 0:g.traits)==null?void 0:v.has(t)}}),Object.defineProperty(f,"name",{value:t}),f}class vi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class dy extends Error{constructor(s){super(`Encountered unidirectional transform during encode: ${s}`),this.name="ZodEncodeError"}}const fy={};function na(t){return fy}function hy(t){const s=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,c])=>s.indexOf(+r)===-1).map(([r,c])=>c)}function yd(t,s){return typeof s=="bigint"?s.toString():s}function xo(t){return{get value(){{const s=t();return Object.defineProperty(this,"value",{value:s}),s}}}}function Ld(t){return t==null}function Ud(t){const s=t.startsWith("^")?1:0,i=t.endsWith("$")?t.length-1:t.length;return t.slice(s,i)}function U1(t,s){const i=(t.toString().split(".")[1]||"").length,r=s.toString();let c=(r.split(".")[1]||"").length;if(c===0&&/\d?e-\d?/.test(r)){const g=r.match(/\d?e-(\d?)/);g!=null&&g[1]&&(c=Number.parseInt(g[1]))}const u=i>c?i:c,f=Number.parseInt(t.toFixed(u).replace(".","")),p=Number.parseInt(s.toFixed(u).replace(".",""));return f%p/10**u}const cg=Symbol("evaluating");function tt(t,s,i){let r;Object.defineProperty(t,s,{get(){if(r!==cg)return r===void 0&&(r=cg,r=i()),r},set(c){Object.defineProperty(t,s,{value:c})},configurable:!0})}function Ca(t,s,i){Object.defineProperty(t,s,{value:i,writable:!0,enumerable:!0,configurable:!0})}function aa(...t){const s={};for(const i of t){const r=Object.getOwnPropertyDescriptors(i);Object.assign(s,r)}return Object.defineProperties({},s)}function ug(t){return JSON.stringify(t)}function $1(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const my="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Cl(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const B1=xo(()=>{var t;if(typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const s=Function;return new s(""),!0}catch{return!1}});function bi(t){if(Cl(t)===!1)return!1;const s=t.constructor;if(s===void 0||typeof s!="function")return!0;const i=s.prototype;return!(Cl(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function py(t){return bi(t)?{...t}:Array.isArray(t)?[...t]:t}const I1=new Set(["string","number","symbol"]);function xi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ia(t,s,i){const r=new t._zod.constr(s??t._zod.def);return(!s||i!=null&&i.parent)&&(r._zod.parent=t),r}function Ee(t){const s=t;if(!s)return{};if(typeof s=="string")return{error:()=>s};if((s==null?void 0:s.message)!==void 0){if((s==null?void 0:s.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");s.error=s.message}return delete s.message,typeof s.error=="string"?{...s,error:()=>s.error}:s}function H1(t){return Object.keys(t).filter(s=>t[s]._zod.optin==="optional"&&t[s]._zod.optout==="optional")}const Z1={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function q1(t,s){const i=t._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=aa(t._zod.def,{get shape(){const f={};for(const p in s){if(!(p in i.shape))throw new Error(`Unrecognized key: "${p}"`);s[p]&&(f[p]=i.shape[p])}return Ca(this,"shape",f),f},checks:[]});return ia(t,u)}function P1(t,s){const i=t._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=aa(t._zod.def,{get shape(){const f={...t._zod.def.shape};for(const p in s){if(!(p in i.shape))throw new Error(`Unrecognized key: "${p}"`);s[p]&&delete f[p]}return Ca(this,"shape",f),f},checks:[]});return ia(t,u)}function V1(t,s){if(!bi(s))throw new Error("Invalid input to extend: expected a plain object");const i=t._zod.def.checks;if(i&&i.length>0){const u=t._zod.def.shape;for(const f in s)if(Object.getOwnPropertyDescriptor(u,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const c=aa(t._zod.def,{get shape(){const u={...t._zod.def.shape,...s};return Ca(this,"shape",u),u}});return ia(t,c)}function G1(t,s){if(!bi(s))throw new Error("Invalid input to safeExtend: expected a plain object");const i=aa(t._zod.def,{get shape(){const r={...t._zod.def.shape,...s};return Ca(this,"shape",r),r}});return ia(t,i)}function F1(t,s){const i=aa(t._zod.def,{get shape(){const r={...t._zod.def.shape,...s._zod.def.shape};return Ca(this,"shape",r),r},get catchall(){return s._zod.def.catchall},checks:[]});return ia(t,i)}function Y1(t,s,i){const c=s._zod.def.checks;if(c&&c.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const f=aa(s._zod.def,{get shape(){const p=s._zod.def.shape,g={...p};if(i)for(const v in i){if(!(v in p))throw new Error(`Unrecognized key: "${v}"`);i[v]&&(g[v]=t?new t({type:"optional",innerType:p[v]}):p[v])}else for(const v in p)g[v]=t?new t({type:"optional",innerType:p[v]}):p[v];return Ca(this,"shape",g),g},checks:[]});return ia(s,f)}function X1(t,s,i){const r=aa(s._zod.def,{get shape(){const c=s._zod.def.shape,u={...c};if(i)for(const f in i){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);i[f]&&(u[f]=new t({type:"nonoptional",innerType:c[f]}))}else for(const f in c)u[f]=new t({type:"nonoptional",innerType:c[f]});return Ca(this,"shape",u),u}});return ia(s,r)}function pi(t,s=0){var i;if(t.aborted===!0)return!0;for(let r=s;r<t.issues.length;r++)if(((i=t.issues[r])==null?void 0:i.continue)!==!0)return!0;return!1}function gi(t,s){return s.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(t),i})}function Jr(t){return typeof t=="string"?t:t==null?void 0:t.message}function sa(t,s,i){var c,u,f,p,g,v;const r={...t,path:t.path??[]};if(!t.message){const y=Jr((f=(u=(c=t.inst)==null?void 0:c._zod.def)==null?void 0:u.error)==null?void 0:f.call(u,t))??Jr((p=s==null?void 0:s.error)==null?void 0:p.call(s,t))??Jr((g=i.customError)==null?void 0:g.call(i,t))??Jr((v=i.localeError)==null?void 0:v.call(i,t))??"Invalid input";r.message=y}return delete r.inst,delete r.continue,s!=null&&s.reportInput||delete r.input,r}function $d(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Rl(...t){const[s,i,r]=t;return typeof s=="string"?{message:s,code:"custom",input:i,inst:r}:{...s}}const gy=(t,s)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:s,enumerable:!1}),t.message=JSON.stringify(s,yd,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},vy=J("$ZodError",gy),yy=J("$ZodError",gy,{Parent:Error});function K1(t,s=i=>i.message){const i={},r=[];for(const c of t.issues)c.path.length>0?(i[c.path[0]]=i[c.path[0]]||[],i[c.path[0]].push(s(c))):r.push(s(c));return{formErrors:r,fieldErrors:i}}function Q1(t,s=i=>i.message){const i={_errors:[]},r=c=>{for(const u of c.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(f=>r({issues:f}));else if(u.code==="invalid_key")r({issues:u.issues});else if(u.code==="invalid_element")r({issues:u.issues});else if(u.path.length===0)i._errors.push(s(u));else{let f=i,p=0;for(;p<u.path.length;){const g=u.path[p];p===u.path.length-1?(f[g]=f[g]||{_errors:[]},f[g]._errors.push(s(u))):f[g]=f[g]||{_errors:[]},f=f[g],p++}}};return r(t),i}const Bd=t=>(s,i,r,c)=>{const u=r?Object.assign(r,{async:!1}):{async:!1},f=s._zod.run({value:i,issues:[]},u);if(f instanceof Promise)throw new vi;if(f.issues.length){const p=new((c==null?void 0:c.Err)??t)(f.issues.map(g=>sa(g,u,na())));throw my(p,c==null?void 0:c.callee),p}return f.value},Id=t=>async(s,i,r,c)=>{const u=r?Object.assign(r,{async:!0}):{async:!0};let f=s._zod.run({value:i,issues:[]},u);if(f instanceof Promise&&(f=await f),f.issues.length){const p=new((c==null?void 0:c.Err)??t)(f.issues.map(g=>sa(g,u,na())));throw my(p,c==null?void 0:c.callee),p}return f.value},So=t=>(s,i,r)=>{const c=r?{...r,async:!1}:{async:!1},u=s._zod.run({value:i,issues:[]},c);if(u instanceof Promise)throw new vi;return u.issues.length?{success:!1,error:new(t??vy)(u.issues.map(f=>sa(f,c,na())))}:{success:!0,data:u.value}},W1=So(yy),jo=t=>async(s,i,r)=>{const c=r?Object.assign(r,{async:!0}):{async:!0};let u=s._zod.run({value:i,issues:[]},c);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new t(u.issues.map(f=>sa(f,c,na())))}:{success:!0,data:u.value}},J1=jo(yy),eN=t=>(s,i,r)=>{const c=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Bd(t)(s,i,c)},tN=t=>(s,i,r)=>Bd(t)(s,i,r),nN=t=>async(s,i,r)=>{const c=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Id(t)(s,i,c)},sN=t=>async(s,i,r)=>Id(t)(s,i,r),aN=t=>(s,i,r)=>{const c=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return So(t)(s,i,c)},iN=t=>(s,i,r)=>So(t)(s,i,r),lN=t=>async(s,i,r)=>{const c=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return jo(t)(s,i,c)},rN=t=>async(s,i,r)=>jo(t)(s,i,r),oN=/^[cC][^\s-]{8,}$/,cN=/^[0-9a-z]+$/,uN=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,dN=/^[0-9a-vA-V]{20}$/,fN=/^[A-Za-z0-9]{27}$/,hN=/^[a-zA-Z0-9_-]{21}$/,mN=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,pN=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,dg=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,gN=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,vN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function yN(){return new RegExp(vN,"u")}const bN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,SN=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,jN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,NN=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,by=/^[A-Za-z0-9_-]*$/,wN=/^\+[1-9]\d{6,14}$/,xy="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",EN=new RegExp(`^${xy}$`);function Sy(t){const s="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${s}`:t.precision===0?`${s}:[0-5]\\d`:`${s}:[0-5]\\d\\.\\d{${t.precision}}`:`${s}(?::[0-5]\\d(?:\\.\\d+)?)?`}function _N(t){return new RegExp(`^${Sy(t)}$`)}function kN(t){const s=Sy({precision:t.precision}),i=["Z"];t.local&&i.push(""),t.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${s}(?:${i.join("|")})`;return new RegExp(`^${xy}T(?:${r})$`)}const TN=t=>{const s=t?`[\\s\\S]{${(t==null?void 0:t.minimum)??0},${(t==null?void 0:t.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${s}$`)},CN=/^-?\d+$/,jy=/^-?\d+(?:\.\d+)?$/,RN=/^(?:true|false)$/i,AN=/^[^A-Z]*$/,MN=/^[^a-z]*$/,bn=J("$ZodCheck",(t,s)=>{var i;t._zod??(t._zod={}),t._zod.def=s,(i=t._zod).onattach??(i.onattach=[])}),Ny={number:"number",bigint:"bigint",object:"date"},wy=J("$ZodCheckLessThan",(t,s)=>{bn.init(t,s);const i=Ny[typeof s.value];t._zod.onattach.push(r=>{const c=r._zod.bag,u=(s.inclusive?c.maximum:c.exclusiveMaximum)??Number.POSITIVE_INFINITY;s.value<u&&(s.inclusive?c.maximum=s.value:c.exclusiveMaximum=s.value)}),t._zod.check=r=>{(s.inclusive?r.value<=s.value:r.value<s.value)||r.issues.push({origin:i,code:"too_big",maximum:typeof s.value=="object"?s.value.getTime():s.value,input:r.value,inclusive:s.inclusive,inst:t,continue:!s.abort})}}),Ey=J("$ZodCheckGreaterThan",(t,s)=>{bn.init(t,s);const i=Ny[typeof s.value];t._zod.onattach.push(r=>{const c=r._zod.bag,u=(s.inclusive?c.minimum:c.exclusiveMinimum)??Number.NEGATIVE_INFINITY;s.value>u&&(s.inclusive?c.minimum=s.value:c.exclusiveMinimum=s.value)}),t._zod.check=r=>{(s.inclusive?r.value>=s.value:r.value>s.value)||r.issues.push({origin:i,code:"too_small",minimum:typeof s.value=="object"?s.value.getTime():s.value,input:r.value,inclusive:s.inclusive,inst:t,continue:!s.abort})}}),zN=J("$ZodCheckMultipleOf",(t,s)=>{bn.init(t,s),t._zod.onattach.push(i=>{var r;(r=i._zod.bag).multipleOf??(r.multipleOf=s.value)}),t._zod.check=i=>{if(typeof i.value!=typeof s.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%s.value===BigInt(0):U1(i.value,s.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:s.value,input:i.value,inst:t,continue:!s.abort})}}),ON=J("$ZodCheckNumberFormat",(t,s)=>{var f;bn.init(t,s),s.format=s.format||"float64";const i=(f=s.format)==null?void 0:f.includes("int"),r=i?"int":"number",[c,u]=Z1[s.format];t._zod.onattach.push(p=>{const g=p._zod.bag;g.format=s.format,g.minimum=c,g.maximum=u,i&&(g.pattern=CN)}),t._zod.check=p=>{const g=p.value;if(i){if(!Number.isInteger(g)){p.issues.push({expected:r,format:s.format,code:"invalid_type",continue:!1,input:g,inst:t});return}if(!Number.isSafeInteger(g)){g>0?p.issues.push({input:g,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!s.abort}):p.issues.push({input:g,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!s.abort});return}}g<c&&p.issues.push({origin:"number",input:g,code:"too_small",minimum:c,inclusive:!0,inst:t,continue:!s.abort}),g>u&&p.issues.push({origin:"number",input:g,code:"too_big",maximum:u,inclusive:!0,inst:t,continue:!s.abort})}}),DN=J("$ZodCheckMaxLength",(t,s)=>{var i;bn.init(t,s),(i=t._zod.def).when??(i.when=r=>{const c=r.value;return!Ld(c)&&c.length!==void 0}),t._zod.onattach.push(r=>{const c=r._zod.bag.maximum??Number.POSITIVE_INFINITY;s.maximum<c&&(r._zod.bag.maximum=s.maximum)}),t._zod.check=r=>{const c=r.value;if(c.length<=s.maximum)return;const f=$d(c);r.issues.push({origin:f,code:"too_big",maximum:s.maximum,inclusive:!0,input:c,inst:t,continue:!s.abort})}}),LN=J("$ZodCheckMinLength",(t,s)=>{var i;bn.init(t,s),(i=t._zod.def).when??(i.when=r=>{const c=r.value;return!Ld(c)&&c.length!==void 0}),t._zod.onattach.push(r=>{const c=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;s.minimum>c&&(r._zod.bag.minimum=s.minimum)}),t._zod.check=r=>{const c=r.value;if(c.length>=s.minimum)return;const f=$d(c);r.issues.push({origin:f,code:"too_small",minimum:s.minimum,inclusive:!0,input:c,inst:t,continue:!s.abort})}}),UN=J("$ZodCheckLengthEquals",(t,s)=>{var i;bn.init(t,s),(i=t._zod.def).when??(i.when=r=>{const c=r.value;return!Ld(c)&&c.length!==void 0}),t._zod.onattach.push(r=>{const c=r._zod.bag;c.minimum=s.length,c.maximum=s.length,c.length=s.length}),t._zod.check=r=>{const c=r.value,u=c.length;if(u===s.length)return;const f=$d(c),p=u>s.length;r.issues.push({origin:f,...p?{code:"too_big",maximum:s.length}:{code:"too_small",minimum:s.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!s.abort})}}),No=J("$ZodCheckStringFormat",(t,s)=>{var i,r;bn.init(t,s),t._zod.onattach.push(c=>{const u=c._zod.bag;u.format=s.format,s.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(s.pattern))}),s.pattern?(i=t._zod).check??(i.check=c=>{s.pattern.lastIndex=0,!s.pattern.test(c.value)&&c.issues.push({origin:"string",code:"invalid_format",format:s.format,input:c.value,...s.pattern?{pattern:s.pattern.toString()}:{},inst:t,continue:!s.abort})}):(r=t._zod).check??(r.check=()=>{})}),$N=J("$ZodCheckRegex",(t,s)=>{No.init(t,s),t._zod.check=i=>{s.pattern.lastIndex=0,!s.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:s.pattern.toString(),inst:t,continue:!s.abort})}}),BN=J("$ZodCheckLowerCase",(t,s)=>{s.pattern??(s.pattern=AN),No.init(t,s)}),IN=J("$ZodCheckUpperCase",(t,s)=>{s.pattern??(s.pattern=MN),No.init(t,s)}),HN=J("$ZodCheckIncludes",(t,s)=>{bn.init(t,s);const i=xi(s.includes),r=new RegExp(typeof s.position=="number"?`^.{${s.position}}${i}`:i);s.pattern=r,t._zod.onattach.push(c=>{const u=c._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(r)}),t._zod.check=c=>{c.value.includes(s.includes,s.position)||c.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:s.includes,input:c.value,inst:t,continue:!s.abort})}}),ZN=J("$ZodCheckStartsWith",(t,s)=>{bn.init(t,s);const i=new RegExp(`^${xi(s.prefix)}.*`);s.pattern??(s.pattern=i),t._zod.onattach.push(r=>{const c=r._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(i)}),t._zod.check=r=>{r.value.startsWith(s.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:s.prefix,input:r.value,inst:t,continue:!s.abort})}}),qN=J("$ZodCheckEndsWith",(t,s)=>{bn.init(t,s);const i=new RegExp(`.*${xi(s.suffix)}$`);s.pattern??(s.pattern=i),t._zod.onattach.push(r=>{const c=r._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(i)}),t._zod.check=r=>{r.value.endsWith(s.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:s.suffix,input:r.value,inst:t,continue:!s.abort})}}),PN=J("$ZodCheckOverwrite",(t,s)=>{bn.init(t,s),t._zod.check=i=>{i.value=s.tx(i.value)}});class VN{constructor(s=[]){this.content=[],this.indent=0,this&&(this.args=s)}indented(s){this.indent+=1,s(this),this.indent-=1}write(s){if(typeof s=="function"){s(this,{execution:"sync"}),s(this,{execution:"async"});return}const r=s.split(`
61
+ `).filter(f=>f),c=Math.min(...r.map(f=>f.length-f.trimStart().length)),u=r.map(f=>f.slice(c)).map(f=>" ".repeat(this.indent*2)+f);for(const f of u)this.content.push(f)}compile(){const s=Function,i=this==null?void 0:this.args,c=[...((this==null?void 0:this.content)??[""]).map(u=>` ${u}`)];return new s(...i,c.join(`
62
+ `))}}const GN={major:4,minor:3,patch:5},vt=J("$ZodType",(t,s)=>{var c;var i;t??(t={}),t._zod.def=s,t._zod.bag=t._zod.bag||{},t._zod.version=GN;const r=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&r.unshift(t);for(const u of r)for(const f of u._zod.onattach)f(t);if(r.length===0)(i=t._zod).deferred??(i.deferred=[]),(c=t._zod.deferred)==null||c.push(()=>{t._zod.run=t._zod.parse});else{const u=(p,g,v)=>{let y=pi(p),b;for(const S of g){if(S._zod.def.when){if(!S._zod.def.when(p))continue}else if(y)continue;const w=p.issues.length,_=S._zod.check(p);if(_ instanceof Promise&&(v==null?void 0:v.async)===!1)throw new vi;if(b||_ instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await _,p.issues.length!==w&&(y||(y=pi(p,w)))});else{if(p.issues.length===w)continue;y||(y=pi(p,w))}}return b?b.then(()=>p):p},f=(p,g,v)=>{if(pi(p))return p.aborted=!0,p;const y=u(g,r,v);if(y instanceof Promise){if(v.async===!1)throw new vi;return y.then(b=>t._zod.parse(b,v))}return t._zod.parse(y,v)};t._zod.run=(p,g)=>{if(g.skipChecks)return t._zod.parse(p,g);if(g.direction==="backward"){const y=t._zod.parse({value:p.value,issues:[]},{...g,skipChecks:!0});return y instanceof Promise?y.then(b=>f(b,p,g)):f(y,p,g)}const v=t._zod.parse(p,g);if(v instanceof Promise){if(g.async===!1)throw new vi;return v.then(y=>u(y,r,g))}return u(v,r,g)}}tt(t,"~standard",()=>({validate:u=>{var f;try{const p=W1(t,u);return p.success?{value:p.data}:{issues:(f=p.error)==null?void 0:f.issues}}catch{return J1(t,u).then(g=>{var v;return g.success?{value:g.data}:{issues:(v=g.error)==null?void 0:v.issues}})}},vendor:"zod",version:1}))}),Hd=J("$ZodString",(t,s)=>{var i;vt.init(t,s),t._zod.pattern=[...((i=t==null?void 0:t._zod.bag)==null?void 0:i.patterns)??[]].pop()??TN(t._zod.bag),t._zod.parse=(r,c)=>{if(s.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),mt=J("$ZodStringFormat",(t,s)=>{No.init(t,s),Hd.init(t,s)}),FN=J("$ZodGUID",(t,s)=>{s.pattern??(s.pattern=pN),mt.init(t,s)}),YN=J("$ZodUUID",(t,s)=>{if(s.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[s.version];if(r===void 0)throw new Error(`Invalid UUID version: "${s.version}"`);s.pattern??(s.pattern=dg(r))}else s.pattern??(s.pattern=dg());mt.init(t,s)}),XN=J("$ZodEmail",(t,s)=>{s.pattern??(s.pattern=gN),mt.init(t,s)}),KN=J("$ZodURL",(t,s)=>{mt.init(t,s),t._zod.check=i=>{try{const r=i.value.trim(),c=new URL(r);s.hostname&&(s.hostname.lastIndex=0,s.hostname.test(c.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:s.hostname.source,input:i.value,inst:t,continue:!s.abort})),s.protocol&&(s.protocol.lastIndex=0,s.protocol.test(c.protocol.endsWith(":")?c.protocol.slice(0,-1):c.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:s.protocol.source,input:i.value,inst:t,continue:!s.abort})),s.normalize?i.value=c.href:i.value=r;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:t,continue:!s.abort})}}}),QN=J("$ZodEmoji",(t,s)=>{s.pattern??(s.pattern=yN()),mt.init(t,s)}),WN=J("$ZodNanoID",(t,s)=>{s.pattern??(s.pattern=hN),mt.init(t,s)}),JN=J("$ZodCUID",(t,s)=>{s.pattern??(s.pattern=oN),mt.init(t,s)}),ew=J("$ZodCUID2",(t,s)=>{s.pattern??(s.pattern=cN),mt.init(t,s)}),tw=J("$ZodULID",(t,s)=>{s.pattern??(s.pattern=uN),mt.init(t,s)}),nw=J("$ZodXID",(t,s)=>{s.pattern??(s.pattern=dN),mt.init(t,s)}),sw=J("$ZodKSUID",(t,s)=>{s.pattern??(s.pattern=fN),mt.init(t,s)}),aw=J("$ZodISODateTime",(t,s)=>{s.pattern??(s.pattern=kN(s)),mt.init(t,s)}),iw=J("$ZodISODate",(t,s)=>{s.pattern??(s.pattern=EN),mt.init(t,s)}),lw=J("$ZodISOTime",(t,s)=>{s.pattern??(s.pattern=_N(s)),mt.init(t,s)}),rw=J("$ZodISODuration",(t,s)=>{s.pattern??(s.pattern=mN),mt.init(t,s)}),ow=J("$ZodIPv4",(t,s)=>{s.pattern??(s.pattern=bN),mt.init(t,s),t._zod.bag.format="ipv4"}),cw=J("$ZodIPv6",(t,s)=>{s.pattern??(s.pattern=xN),mt.init(t,s),t._zod.bag.format="ipv6",t._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:t,continue:!s.abort})}}}),uw=J("$ZodCIDRv4",(t,s)=>{s.pattern??(s.pattern=SN),mt.init(t,s)}),dw=J("$ZodCIDRv6",(t,s)=>{s.pattern??(s.pattern=jN),mt.init(t,s),t._zod.check=i=>{const r=i.value.split("/");try{if(r.length!==2)throw new Error;const[c,u]=r;if(!u)throw new Error;const f=Number(u);if(`${f}`!==u)throw new Error;if(f<0||f>128)throw new Error;new URL(`http://[${c}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:t,continue:!s.abort})}}});function _y(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const fw=J("$ZodBase64",(t,s)=>{s.pattern??(s.pattern=NN),mt.init(t,s),t._zod.bag.contentEncoding="base64",t._zod.check=i=>{_y(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:t,continue:!s.abort})}});function hw(t){if(!by.test(t))return!1;const s=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=s.padEnd(Math.ceil(s.length/4)*4,"=");return _y(i)}const mw=J("$ZodBase64URL",(t,s)=>{s.pattern??(s.pattern=by),mt.init(t,s),t._zod.bag.contentEncoding="base64url",t._zod.check=i=>{hw(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:t,continue:!s.abort})}}),pw=J("$ZodE164",(t,s)=>{s.pattern??(s.pattern=wN),mt.init(t,s)});function gw(t,s=null){try{const i=t.split(".");if(i.length!==3)return!1;const[r]=i;if(!r)return!1;const c=JSON.parse(atob(r));return!("typ"in c&&(c==null?void 0:c.typ)!=="JWT"||!c.alg||s&&(!("alg"in c)||c.alg!==s))}catch{return!1}}const vw=J("$ZodJWT",(t,s)=>{mt.init(t,s),t._zod.check=i=>{gw(i.value,s.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:t,continue:!s.abort})}}),ky=J("$ZodNumber",(t,s)=>{vt.init(t,s),t._zod.pattern=t._zod.bag.pattern??jy,t._zod.parse=(i,r)=>{if(s.coerce)try{i.value=Number(i.value)}catch{}const c=i.value;if(typeof c=="number"&&!Number.isNaN(c)&&Number.isFinite(c))return i;const u=typeof c=="number"?Number.isNaN(c)?"NaN":Number.isFinite(c)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:c,inst:t,...u?{received:u}:{}}),i}}),yw=J("$ZodNumberFormat",(t,s)=>{ON.init(t,s),ky.init(t,s)}),bw=J("$ZodBoolean",(t,s)=>{vt.init(t,s),t._zod.pattern=RN,t._zod.parse=(i,r)=>{if(s.coerce)try{i.value=!!i.value}catch{}const c=i.value;return typeof c=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:c,inst:t}),i}}),xw=J("$ZodUnknown",(t,s)=>{vt.init(t,s),t._zod.parse=i=>i}),Sw=J("$ZodNever",(t,s)=>{vt.init(t,s),t._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:t}),i)});function fg(t,s,i){t.issues.length&&s.issues.push(...gi(i,t.issues)),s.value[i]=t.value}const jw=J("$ZodArray",(t,s)=>{vt.init(t,s),t._zod.parse=(i,r)=>{const c=i.value;if(!Array.isArray(c))return i.issues.push({expected:"array",code:"invalid_type",input:c,inst:t}),i;i.value=Array(c.length);const u=[];for(let f=0;f<c.length;f++){const p=c[f],g=s.element._zod.run({value:p,issues:[]},r);g instanceof Promise?u.push(g.then(v=>fg(v,i,f))):fg(g,i,f)}return u.length?Promise.all(u).then(()=>i):i}});function ho(t,s,i,r,c){if(t.issues.length){if(c&&!(i in r))return;s.issues.push(...gi(i,t.issues))}t.value===void 0?i in r&&(s.value[i]=void 0):s.value[i]=t.value}function Ty(t){var r,c,u,f;const s=Object.keys(t.shape);for(const p of s)if(!((f=(u=(c=(r=t.shape)==null?void 0:r[p])==null?void 0:c._zod)==null?void 0:u.traits)!=null&&f.has("$ZodType")))throw new Error(`Invalid element at key "${p}": expected a Zod schema`);const i=H1(t.shape);return{...t,keys:s,keySet:new Set(s),numKeys:s.length,optionalKeys:new Set(i)}}function Cy(t,s,i,r,c,u){const f=[],p=c.keySet,g=c.catchall._zod,v=g.def.type,y=g.optout==="optional";for(const b in s){if(p.has(b))continue;if(v==="never"){f.push(b);continue}const S=g.run({value:s[b],issues:[]},r);S instanceof Promise?t.push(S.then(w=>ho(w,i,b,s,y))):ho(S,i,b,s,y)}return f.length&&i.issues.push({code:"unrecognized_keys",keys:f,input:s,inst:u}),t.length?Promise.all(t).then(()=>i):i}const Nw=J("$ZodObject",(t,s)=>{vt.init(t,s);const i=Object.getOwnPropertyDescriptor(s,"shape");if(!(i!=null&&i.get)){const p=s.shape;Object.defineProperty(s,"shape",{get:()=>{const g={...p};return Object.defineProperty(s,"shape",{value:g}),g}})}const r=xo(()=>Ty(s));tt(t._zod,"propValues",()=>{const p=s.shape,g={};for(const v in p){const y=p[v]._zod;if(y.values){g[v]??(g[v]=new Set);for(const b of y.values)g[v].add(b)}}return g});const c=Cl,u=s.catchall;let f;t._zod.parse=(p,g)=>{f??(f=r.value);const v=p.value;if(!c(v))return p.issues.push({expected:"object",code:"invalid_type",input:v,inst:t}),p;p.value={};const y=[],b=f.shape;for(const S of f.keys){const w=b[S],_=w._zod.optout==="optional",N=w._zod.run({value:v[S],issues:[]},g);N instanceof Promise?y.push(N.then(j=>ho(j,p,S,v,_))):ho(N,p,S,v,_)}return u?Cy(y,v,p,g,r.value,t):y.length?Promise.all(y).then(()=>p):p}}),ww=J("$ZodObjectJIT",(t,s)=>{Nw.init(t,s);const i=t._zod.parse,r=xo(()=>Ty(s)),c=S=>{var z;const w=new VN(["shape","payload","ctx"]),_=r.value,N=H=>{const T=ug(H);return`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`};w.write("const input = payload.value;");const j=Object.create(null);let R=0;for(const H of _.keys)j[H]=`key_${R++}`;w.write("const newResult = {};");for(const H of _.keys){const T=j[H],O=ug(H),D=S[H],F=((z=D==null?void 0:D._zod)==null?void 0:z.optout)==="optional";w.write(`const ${T} = ${N(H)};`),F?w.write(`
63
+ if (${T}.issues.length) {
64
+ if (${O} in input) {
65
+ payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
66
+ ...iss,
67
+ path: iss.path ? [${O}, ...iss.path] : [${O}]
68
+ })));
69
+ }
70
+ }
71
+
72
+ if (${T}.value === undefined) {
73
+ if (${O} in input) {
74
+ newResult[${O}] = undefined;
75
+ }
76
+ } else {
77
+ newResult[${O}] = ${T}.value;
78
+ }
79
+
80
+ `):w.write(`
81
+ if (${T}.issues.length) {
82
+ payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
83
+ ...iss,
84
+ path: iss.path ? [${O}, ...iss.path] : [${O}]
85
+ })));
86
+ }
87
+
88
+ if (${T}.value === undefined) {
89
+ if (${O} in input) {
90
+ newResult[${O}] = undefined;
91
+ }
92
+ } else {
93
+ newResult[${O}] = ${T}.value;
94
+ }
95
+
96
+ `)}w.write("payload.value = newResult;"),w.write("return payload;");const C=w.compile();return(H,T)=>C(S,H,T)};let u;const f=Cl,p=!fy.jitless,v=p&&B1.value,y=s.catchall;let b;t._zod.parse=(S,w)=>{b??(b=r.value);const _=S.value;return f(_)?p&&v&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(u||(u=c(s.shape)),S=u(S,w),y?Cy([],_,S,w,b,t):S):i(S,w):(S.issues.push({expected:"object",code:"invalid_type",input:_,inst:t}),S)}});function hg(t,s,i,r){for(const u of t)if(u.issues.length===0)return s.value=u.value,s;const c=t.filter(u=>!pi(u));return c.length===1?(s.value=c[0].value,c[0]):(s.issues.push({code:"invalid_union",input:s.value,inst:i,errors:t.map(u=>u.issues.map(f=>sa(f,r,na())))}),s)}const Ry=J("$ZodUnion",(t,s)=>{vt.init(t,s),tt(t._zod,"optin",()=>s.options.some(c=>c._zod.optin==="optional")?"optional":void 0),tt(t._zod,"optout",()=>s.options.some(c=>c._zod.optout==="optional")?"optional":void 0),tt(t._zod,"values",()=>{if(s.options.every(c=>c._zod.values))return new Set(s.options.flatMap(c=>Array.from(c._zod.values)))}),tt(t._zod,"pattern",()=>{if(s.options.every(c=>c._zod.pattern)){const c=s.options.map(u=>u._zod.pattern);return new RegExp(`^(${c.map(u=>Ud(u.source)).join("|")})$`)}});const i=s.options.length===1,r=s.options[0]._zod.run;t._zod.parse=(c,u)=>{if(i)return r(c,u);let f=!1;const p=[];for(const g of s.options){const v=g._zod.run({value:c.value,issues:[]},u);if(v instanceof Promise)p.push(v),f=!0;else{if(v.issues.length===0)return v;p.push(v)}}return f?Promise.all(p).then(g=>hg(g,c,t,u)):hg(p,c,t,u)}}),Ew=J("$ZodDiscriminatedUnion",(t,s)=>{s.inclusive=!1,Ry.init(t,s);const i=t._zod.parse;tt(t._zod,"propValues",()=>{const c={};for(const u of s.options){const f=u._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${s.options.indexOf(u)}"`);for(const[p,g]of Object.entries(f)){c[p]||(c[p]=new Set);for(const v of g)c[p].add(v)}}return c});const r=xo(()=>{var f;const c=s.options,u=new Map;for(const p of c){const g=(f=p._zod.propValues)==null?void 0:f[s.discriminator];if(!g||g.size===0)throw new Error(`Invalid discriminated union option at index "${s.options.indexOf(p)}"`);for(const v of g){if(u.has(v))throw new Error(`Duplicate discriminator value "${String(v)}"`);u.set(v,p)}}return u});t._zod.parse=(c,u)=>{const f=c.value;if(!Cl(f))return c.issues.push({code:"invalid_type",expected:"object",input:f,inst:t}),c;const p=r.value.get(f==null?void 0:f[s.discriminator]);return p?p._zod.run(c,u):s.unionFallback?i(c,u):(c.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:s.discriminator,input:f,path:[s.discriminator],inst:t}),c)}}),_w=J("$ZodIntersection",(t,s)=>{vt.init(t,s),t._zod.parse=(i,r)=>{const c=i.value,u=s.left._zod.run({value:c,issues:[]},r),f=s.right._zod.run({value:c,issues:[]},r);return u instanceof Promise||f instanceof Promise?Promise.all([u,f]).then(([g,v])=>mg(i,g,v)):mg(i,u,f)}});function bd(t,s){if(t===s)return{valid:!0,data:t};if(t instanceof Date&&s instanceof Date&&+t==+s)return{valid:!0,data:t};if(bi(t)&&bi(s)){const i=Object.keys(s),r=Object.keys(t).filter(u=>i.indexOf(u)!==-1),c={...t,...s};for(const u of r){const f=bd(t[u],s[u]);if(!f.valid)return{valid:!1,mergeErrorPath:[u,...f.mergeErrorPath]};c[u]=f.data}return{valid:!0,data:c}}if(Array.isArray(t)&&Array.isArray(s)){if(t.length!==s.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let r=0;r<t.length;r++){const c=t[r],u=s[r],f=bd(c,u);if(!f.valid)return{valid:!1,mergeErrorPath:[r,...f.mergeErrorPath]};i.push(f.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function mg(t,s,i){const r=new Map;let c;for(const p of s.issues)if(p.code==="unrecognized_keys"){c??(c=p);for(const g of p.keys)r.has(g)||r.set(g,{}),r.get(g).l=!0}else t.issues.push(p);for(const p of i.issues)if(p.code==="unrecognized_keys")for(const g of p.keys)r.has(g)||r.set(g,{}),r.get(g).r=!0;else t.issues.push(p);const u=[...r].filter(([,p])=>p.l&&p.r).map(([p])=>p);if(u.length&&c&&t.issues.push({...c,keys:u}),pi(t))return t;const f=bd(s.value,i.value);if(!f.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(f.mergeErrorPath)}`);return t.value=f.data,t}const kw=J("$ZodRecord",(t,s)=>{vt.init(t,s),t._zod.parse=(i,r)=>{const c=i.value;if(!bi(c))return i.issues.push({expected:"record",code:"invalid_type",input:c,inst:t}),i;const u=[],f=s.keyType._zod.values;if(f){i.value={};const p=new Set;for(const v of f)if(typeof v=="string"||typeof v=="number"||typeof v=="symbol"){p.add(typeof v=="number"?v.toString():v);const y=s.valueType._zod.run({value:c[v],issues:[]},r);y instanceof Promise?u.push(y.then(b=>{b.issues.length&&i.issues.push(...gi(v,b.issues)),i.value[v]=b.value})):(y.issues.length&&i.issues.push(...gi(v,y.issues)),i.value[v]=y.value)}let g;for(const v in c)p.has(v)||(g=g??[],g.push(v));g&&g.length>0&&i.issues.push({code:"unrecognized_keys",input:c,inst:t,keys:g})}else{i.value={};for(const p of Reflect.ownKeys(c)){if(p==="__proto__")continue;let g=s.keyType._zod.run({value:p,issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&jy.test(p)&&g.issues.length&&g.issues.some(b=>b.code==="invalid_type"&&b.expected==="number")){const b=s.keyType._zod.run({value:Number(p),issues:[]},r);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(g=b)}if(g.issues.length){s.mode==="loose"?i.value[p]=c[p]:i.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(b=>sa(b,r,na())),input:p,path:[p],inst:t});continue}const y=s.valueType._zod.run({value:c[p],issues:[]},r);y instanceof Promise?u.push(y.then(b=>{b.issues.length&&i.issues.push(...gi(p,b.issues)),i.value[g.value]=b.value})):(y.issues.length&&i.issues.push(...gi(p,y.issues)),i.value[g.value]=y.value)}}return u.length?Promise.all(u).then(()=>i):i}}),Tw=J("$ZodEnum",(t,s)=>{vt.init(t,s);const i=hy(s.entries),r=new Set(i);t._zod.values=r,t._zod.pattern=new RegExp(`^(${i.filter(c=>I1.has(typeof c)).map(c=>typeof c=="string"?xi(c):c.toString()).join("|")})$`),t._zod.parse=(c,u)=>{const f=c.value;return r.has(f)||c.issues.push({code:"invalid_value",values:i,input:f,inst:t}),c}}),Cw=J("$ZodLiteral",(t,s)=>{if(vt.init(t,s),s.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(s.values);t._zod.values=i,t._zod.pattern=new RegExp(`^(${s.values.map(r=>typeof r=="string"?xi(r):r?xi(r.toString()):String(r)).join("|")})$`),t._zod.parse=(r,c)=>{const u=r.value;return i.has(u)||r.issues.push({code:"invalid_value",values:s.values,input:u,inst:t}),r}}),Rw=J("$ZodTransform",(t,s)=>{vt.init(t,s),t._zod.parse=(i,r)=>{if(r.direction==="backward")throw new dy(t.constructor.name);const c=s.transform(i.value,i);if(r.async)return(c instanceof Promise?c:Promise.resolve(c)).then(f=>(i.value=f,i));if(c instanceof Promise)throw new vi;return i.value=c,i}});function pg(t,s){return t.issues.length&&s===void 0?{issues:[],value:void 0}:t}const Ay=J("$ZodOptional",(t,s)=>{vt.init(t,s),t._zod.optin="optional",t._zod.optout="optional",tt(t._zod,"values",()=>s.innerType._zod.values?new Set([...s.innerType._zod.values,void 0]):void 0),tt(t._zod,"pattern",()=>{const i=s.innerType._zod.pattern;return i?new RegExp(`^(${Ud(i.source)})?$`):void 0}),t._zod.parse=(i,r)=>{if(s.innerType._zod.optin==="optional"){const c=s.innerType._zod.run(i,r);return c instanceof Promise?c.then(u=>pg(u,i.value)):pg(c,i.value)}return i.value===void 0?i:s.innerType._zod.run(i,r)}}),Aw=J("$ZodExactOptional",(t,s)=>{Ay.init(t,s),tt(t._zod,"values",()=>s.innerType._zod.values),tt(t._zod,"pattern",()=>s.innerType._zod.pattern),t._zod.parse=(i,r)=>s.innerType._zod.run(i,r)}),Mw=J("$ZodNullable",(t,s)=>{vt.init(t,s),tt(t._zod,"optin",()=>s.innerType._zod.optin),tt(t._zod,"optout",()=>s.innerType._zod.optout),tt(t._zod,"pattern",()=>{const i=s.innerType._zod.pattern;return i?new RegExp(`^(${Ud(i.source)}|null)$`):void 0}),tt(t._zod,"values",()=>s.innerType._zod.values?new Set([...s.innerType._zod.values,null]):void 0),t._zod.parse=(i,r)=>i.value===null?i:s.innerType._zod.run(i,r)}),zw=J("$ZodDefault",(t,s)=>{vt.init(t,s),t._zod.optin="optional",tt(t._zod,"values",()=>s.innerType._zod.values),t._zod.parse=(i,r)=>{if(r.direction==="backward")return s.innerType._zod.run(i,r);if(i.value===void 0)return i.value=s.defaultValue,i;const c=s.innerType._zod.run(i,r);return c instanceof Promise?c.then(u=>gg(u,s)):gg(c,s)}});function gg(t,s){return t.value===void 0&&(t.value=s.defaultValue),t}const Ow=J("$ZodPrefault",(t,s)=>{vt.init(t,s),t._zod.optin="optional",tt(t._zod,"values",()=>s.innerType._zod.values),t._zod.parse=(i,r)=>(r.direction==="backward"||i.value===void 0&&(i.value=s.defaultValue),s.innerType._zod.run(i,r))}),Dw=J("$ZodNonOptional",(t,s)=>{vt.init(t,s),tt(t._zod,"values",()=>{const i=s.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),t._zod.parse=(i,r)=>{const c=s.innerType._zod.run(i,r);return c instanceof Promise?c.then(u=>vg(u,t)):vg(c,t)}});function vg(t,s){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:s}),t}const Lw=J("$ZodCatch",(t,s)=>{vt.init(t,s),tt(t._zod,"optin",()=>s.innerType._zod.optin),tt(t._zod,"optout",()=>s.innerType._zod.optout),tt(t._zod,"values",()=>s.innerType._zod.values),t._zod.parse=(i,r)=>{if(r.direction==="backward")return s.innerType._zod.run(i,r);const c=s.innerType._zod.run(i,r);return c instanceof Promise?c.then(u=>(i.value=u.value,u.issues.length&&(i.value=s.catchValue({...i,error:{issues:u.issues.map(f=>sa(f,r,na()))},input:i.value}),i.issues=[]),i)):(i.value=c.value,c.issues.length&&(i.value=s.catchValue({...i,error:{issues:c.issues.map(u=>sa(u,r,na()))},input:i.value}),i.issues=[]),i)}}),Uw=J("$ZodPipe",(t,s)=>{vt.init(t,s),tt(t._zod,"values",()=>s.in._zod.values),tt(t._zod,"optin",()=>s.in._zod.optin),tt(t._zod,"optout",()=>s.out._zod.optout),tt(t._zod,"propValues",()=>s.in._zod.propValues),t._zod.parse=(i,r)=>{if(r.direction==="backward"){const u=s.out._zod.run(i,r);return u instanceof Promise?u.then(f=>eo(f,s.in,r)):eo(u,s.in,r)}const c=s.in._zod.run(i,r);return c instanceof Promise?c.then(u=>eo(u,s.out,r)):eo(c,s.out,r)}});function eo(t,s,i){return t.issues.length?(t.aborted=!0,t):s._zod.run({value:t.value,issues:t.issues},i)}const $w=J("$ZodReadonly",(t,s)=>{vt.init(t,s),tt(t._zod,"propValues",()=>s.innerType._zod.propValues),tt(t._zod,"values",()=>s.innerType._zod.values),tt(t._zod,"optin",()=>{var i,r;return(r=(i=s.innerType)==null?void 0:i._zod)==null?void 0:r.optin}),tt(t._zod,"optout",()=>{var i,r;return(r=(i=s.innerType)==null?void 0:i._zod)==null?void 0:r.optout}),t._zod.parse=(i,r)=>{if(r.direction==="backward")return s.innerType._zod.run(i,r);const c=s.innerType._zod.run(i,r);return c instanceof Promise?c.then(yg):yg(c)}});function yg(t){return t.value=Object.freeze(t.value),t}const Bw=J("$ZodCustom",(t,s)=>{bn.init(t,s),vt.init(t,s),t._zod.parse=(i,r)=>i,t._zod.check=i=>{const r=i.value,c=s.fn(r);if(c instanceof Promise)return c.then(u=>bg(u,i,r,t));bg(c,i,r,t)}});function bg(t,s,i,r){if(!t){const c={code:"custom",input:i,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(c.params=r._zod.def.params),s.issues.push(Rl(c))}}var xg;class Iw{constructor(){this._map=new WeakMap,this._idmap=new Map}add(s,...i){const r=i[0];return this._map.set(s,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,s),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(s){const i=this._map.get(s);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(s),this}get(s){const i=s._zod.parent;if(i){const r={...this.get(i)??{}};delete r.id;const c={...r,...this._map.get(s)};return Object.keys(c).length?c:void 0}return this._map.get(s)}has(s){return this._map.has(s)}}function Hw(){return new Iw}(xg=globalThis).__zod_globalRegistry??(xg.__zod_globalRegistry=Hw());const _l=globalThis.__zod_globalRegistry;function Zw(t,s){return new t({type:"string",...Ee(s)})}function qw(t,s){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Ee(s)})}function Sg(t,s){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(s)})}function Pw(t,s){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(s)})}function Vw(t,s){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(s)})}function Gw(t,s){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(s)})}function Fw(t,s){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(s)})}function Yw(t,s){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Ee(s)})}function Xw(t,s){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(s)})}function Kw(t,s){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(s)})}function Qw(t,s){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(s)})}function Ww(t,s){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(s)})}function Jw(t,s){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(s)})}function eE(t,s){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(s)})}function tE(t,s){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(s)})}function nE(t,s){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(s)})}function sE(t,s){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(s)})}function aE(t,s){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(s)})}function iE(t,s){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(s)})}function lE(t,s){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(s)})}function rE(t,s){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(s)})}function oE(t,s){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(s)})}function cE(t,s){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(s)})}function uE(t,s){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ee(s)})}function dE(t,s){return new t({type:"string",format:"date",check:"string_format",...Ee(s)})}function fE(t,s){return new t({type:"string",format:"time",check:"string_format",precision:null,...Ee(s)})}function hE(t,s){return new t({type:"string",format:"duration",check:"string_format",...Ee(s)})}function mE(t,s){return new t({type:"number",checks:[],...Ee(s)})}function pE(t,s){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(s)})}function gE(t,s){return new t({type:"boolean",...Ee(s)})}function vE(t){return new t({type:"unknown"})}function yE(t,s){return new t({type:"never",...Ee(s)})}function jg(t,s){return new wy({check:"less_than",...Ee(s),value:t,inclusive:!1})}function Xu(t,s){return new wy({check:"less_than",...Ee(s),value:t,inclusive:!0})}function Ng(t,s){return new Ey({check:"greater_than",...Ee(s),value:t,inclusive:!1})}function Ku(t,s){return new Ey({check:"greater_than",...Ee(s),value:t,inclusive:!0})}function wg(t,s){return new zN({check:"multiple_of",...Ee(s),value:t})}function My(t,s){return new DN({check:"max_length",...Ee(s),maximum:t})}function mo(t,s){return new LN({check:"min_length",...Ee(s),minimum:t})}function zy(t,s){return new UN({check:"length_equals",...Ee(s),length:t})}function bE(t,s){return new $N({check:"string_format",format:"regex",...Ee(s),pattern:t})}function xE(t){return new BN({check:"string_format",format:"lowercase",...Ee(t)})}function SE(t){return new IN({check:"string_format",format:"uppercase",...Ee(t)})}function jE(t,s){return new HN({check:"string_format",format:"includes",...Ee(s),includes:t})}function NE(t,s){return new ZN({check:"string_format",format:"starts_with",...Ee(s),prefix:t})}function wE(t,s){return new qN({check:"string_format",format:"ends_with",...Ee(s),suffix:t})}function Ti(t){return new PN({check:"overwrite",tx:t})}function EE(t){return Ti(s=>s.normalize(t))}function _E(){return Ti(t=>t.trim())}function kE(){return Ti(t=>t.toLowerCase())}function TE(){return Ti(t=>t.toUpperCase())}function CE(){return Ti(t=>$1(t))}function RE(t,s,i){return new t({type:"array",element:s,...Ee(i)})}function AE(t,s,i){return new t({type:"custom",check:"custom",fn:s,...Ee(i)})}function ME(t){const s=zE(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Rl(r,i.value,s._zod.def));else{const c=r;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=i.value),c.inst??(c.inst=s),c.continue??(c.continue=!s._zod.def.abort),i.issues.push(Rl(c))}},t(i.value,i)));return s}function zE(t,s){const i=new bn({check:"custom",...Ee(s)});return i._zod.check=t,i}function Oy(t){let s=(t==null?void 0:t.target)??"draft-2020-12";return s==="draft-4"&&(s="draft-04"),s==="draft-7"&&(s="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??_l,target:s,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",external:(t==null?void 0:t.external)??void 0}}function At(t,s,i={path:[],schemaPath:[]}){var y,b;var r;const c=t._zod.def,u=s.seen.get(t);if(u)return u.count++,i.schemaPath.includes(t)&&(u.cycle=i.path),u.schema;const f={schema:{},count:1,cycle:void 0,path:i.path};s.seen.set(t,f);const p=(b=(y=t._zod).toJSONSchema)==null?void 0:b.call(y);if(p)f.schema=p;else{const S={...i,schemaPath:[...i.schemaPath,t],path:i.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(s,f.schema,S);else{const _=f.schema,N=s.processors[c.type];if(!N)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${c.type}`);N(t,s,_,S)}const w=t._zod.parent;w&&(f.ref||(f.ref=w),At(w,s,S),s.seen.get(w).isParent=!0)}const g=s.metadataRegistry.get(t);return g&&Object.assign(f.schema,g),s.io==="input"&&ln(t)&&(delete f.schema.examples,delete f.schema.default),s.io==="input"&&f.schema._prefault&&((r=f.schema).default??(r.default=f.schema._prefault)),delete f.schema._prefault,s.seen.get(t).schema}function Dy(t,s){var f,p,g,v;const i=t.seen.get(s);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const y of t.seen.entries()){const b=(f=t.metadataRegistry.get(y[0]))==null?void 0:f.id;if(b){const S=r.get(b);if(S&&S!==y[0])throw new Error(`Duplicate schema id "${b}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(b,y[0])}}const c=y=>{var N;const b=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const j=(N=t.external.registry.get(y[0]))==null?void 0:N.id,R=t.external.uri??(z=>z);if(j)return{ref:R(j)};const C=y[1].defId??y[1].schema.id??`schema${t.counter++}`;return y[1].defId=C,{defId:C,ref:`${R("__shared")}#/${b}/${C}`}}if(y[1]===i)return{ref:"#"};const w=`#/${b}/`,_=y[1].schema.id??`__schema${t.counter++}`;return{defId:_,ref:w+_}},u=y=>{if(y[1].schema.$ref)return;const b=y[1],{ref:S,defId:w}=c(y);b.def={...b.schema},w&&(b.defId=w);const _=b.schema;for(const N in _)delete _[N];_.$ref=S};if(t.cycles==="throw")for(const y of t.seen.entries()){const b=y[1];if(b.cycle)throw new Error(`Cycle detected: #/${(p=b.cycle)==null?void 0:p.join("/")}/<root>
97
+
98
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of t.seen.entries()){const b=y[1];if(s===y[0]){u(y);continue}if(t.external){const w=(g=t.external.registry.get(y[0]))==null?void 0:g.id;if(s!==y[0]&&w){u(y);continue}}if((v=t.metadataRegistry.get(y[0]))==null?void 0:v.id){u(y);continue}if(b.cycle){u(y);continue}if(b.count>1&&t.reused==="ref"){u(y);continue}}}function Ly(t,s){var f,p,g;const i=t.seen.get(s);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=v=>{const y=t.seen.get(v);if(y.ref===null)return;const b=y.def??y.schema,S={...b},w=y.ref;if(y.ref=null,w){r(w);const N=t.seen.get(w),j=N.schema;if(j.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(b.allOf=b.allOf??[],b.allOf.push(j)):Object.assign(b,j),Object.assign(b,S),v._zod.parent===w)for(const C in b)C==="$ref"||C==="allOf"||C in S||delete b[C];if(j.$ref)for(const C in b)C==="$ref"||C==="allOf"||C in N.def&&JSON.stringify(b[C])===JSON.stringify(N.def[C])&&delete b[C]}const _=v._zod.parent;if(_&&_!==w){r(_);const N=t.seen.get(_);if(N!=null&&N.schema.$ref&&(b.$ref=N.schema.$ref,N.def))for(const j in b)j==="$ref"||j==="allOf"||j in N.def&&JSON.stringify(b[j])===JSON.stringify(N.def[j])&&delete b[j]}t.override({zodSchema:v,jsonSchema:b,path:y.path??[]})};for(const v of[...t.seen.entries()].reverse())r(v[0]);const c={};if(t.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?c.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?c.$schema="http://json-schema.org/draft-04/schema#":t.target,(f=t.external)!=null&&f.uri){const v=(p=t.external.registry.get(s))==null?void 0:p.id;if(!v)throw new Error("Schema is missing an `id` property");c.$id=t.external.uri(v)}Object.assign(c,i.def??i.schema);const u=((g=t.external)==null?void 0:g.defs)??{};for(const v of t.seen.entries()){const y=v[1];y.def&&y.defId&&(u[y.defId]=y.def)}t.external||Object.keys(u).length>0&&(t.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{const v=JSON.parse(JSON.stringify(c));return Object.defineProperty(v,"~standard",{value:{...s["~standard"],jsonSchema:{input:po(s,"input",t.processors),output:po(s,"output",t.processors)}},enumerable:!1,writable:!1}),v}catch{throw new Error("Error converting schema to JSON.")}}function ln(t,s){const i=s??{seen:new Set};if(i.seen.has(t))return!1;i.seen.add(t);const r=t._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ln(r.element,i);if(r.type==="set")return ln(r.valueType,i);if(r.type==="lazy")return ln(r.getter(),i);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return ln(r.innerType,i);if(r.type==="intersection")return ln(r.left,i)||ln(r.right,i);if(r.type==="record"||r.type==="map")return ln(r.keyType,i)||ln(r.valueType,i);if(r.type==="pipe")return ln(r.in,i)||ln(r.out,i);if(r.type==="object"){for(const c in r.shape)if(ln(r.shape[c],i))return!0;return!1}if(r.type==="union"){for(const c of r.options)if(ln(c,i))return!0;return!1}if(r.type==="tuple"){for(const c of r.items)if(ln(c,i))return!0;return!!(r.rest&&ln(r.rest,i))}return!1}const OE=(t,s={})=>i=>{const r=Oy({...i,processors:s});return At(t,r),Dy(r,t),Ly(r,t)},po=(t,s,i={})=>r=>{const{libraryOptions:c,target:u}=r??{},f=Oy({...c??{},target:u,io:s,processors:i});return At(t,f),Dy(f,t),Ly(f,t)},DE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},LE=(t,s,i,r)=>{const c=i;c.type="string";const{minimum:u,maximum:f,format:p,patterns:g,contentEncoding:v}=t._zod.bag;if(typeof u=="number"&&(c.minLength=u),typeof f=="number"&&(c.maxLength=f),p&&(c.format=DE[p]??p,c.format===""&&delete c.format,p==="time"&&delete c.format),v&&(c.contentEncoding=v),g&&g.size>0){const y=[...g];y.length===1?c.pattern=y[0].source:y.length>1&&(c.allOf=[...y.map(b=>({...s.target==="draft-07"||s.target==="draft-04"||s.target==="openapi-3.0"?{type:"string"}:{},pattern:b.source}))])}},UE=(t,s,i,r)=>{const c=i,{minimum:u,maximum:f,format:p,multipleOf:g,exclusiveMaximum:v,exclusiveMinimum:y}=t._zod.bag;typeof p=="string"&&p.includes("int")?c.type="integer":c.type="number",typeof y=="number"&&(s.target==="draft-04"||s.target==="openapi-3.0"?(c.minimum=y,c.exclusiveMinimum=!0):c.exclusiveMinimum=y),typeof u=="number"&&(c.minimum=u,typeof y=="number"&&s.target!=="draft-04"&&(y>=u?delete c.minimum:delete c.exclusiveMinimum)),typeof v=="number"&&(s.target==="draft-04"||s.target==="openapi-3.0"?(c.maximum=v,c.exclusiveMaximum=!0):c.exclusiveMaximum=v),typeof f=="number"&&(c.maximum=f,typeof v=="number"&&s.target!=="draft-04"&&(v<=f?delete c.maximum:delete c.exclusiveMaximum)),typeof g=="number"&&(c.multipleOf=g)},$E=(t,s,i,r)=>{i.type="boolean"},BE=(t,s,i,r)=>{i.not={}},IE=(t,s,i,r)=>{},HE=(t,s,i,r)=>{const c=t._zod.def,u=hy(c.entries);u.every(f=>typeof f=="number")&&(i.type="number"),u.every(f=>typeof f=="string")&&(i.type="string"),i.enum=u},ZE=(t,s,i,r)=>{const c=t._zod.def,u=[];for(const f of c.values)if(f===void 0){if(s.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof f=="bigint"){if(s.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(f))}else u.push(f);if(u.length!==0)if(u.length===1){const f=u[0];i.type=f===null?"null":typeof f,s.target==="draft-04"||s.target==="openapi-3.0"?i.enum=[f]:i.const=f}else u.every(f=>typeof f=="number")&&(i.type="number"),u.every(f=>typeof f=="string")&&(i.type="string"),u.every(f=>typeof f=="boolean")&&(i.type="boolean"),u.every(f=>f===null)&&(i.type="null"),i.enum=u},qE=(t,s,i,r)=>{if(s.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},PE=(t,s,i,r)=>{if(s.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},VE=(t,s,i,r)=>{const c=i,u=t._zod.def,{minimum:f,maximum:p}=t._zod.bag;typeof f=="number"&&(c.minItems=f),typeof p=="number"&&(c.maxItems=p),c.type="array",c.items=At(u.element,s,{...r,path:[...r.path,"items"]})},GE=(t,s,i,r)=>{var v;const c=i,u=t._zod.def;c.type="object",c.properties={};const f=u.shape;for(const y in f)c.properties[y]=At(f[y],s,{...r,path:[...r.path,"properties",y]});const p=new Set(Object.keys(f)),g=new Set([...p].filter(y=>{const b=u.shape[y]._zod;return s.io==="input"?b.optin===void 0:b.optout===void 0}));g.size>0&&(c.required=Array.from(g)),((v=u.catchall)==null?void 0:v._zod.def.type)==="never"?c.additionalProperties=!1:u.catchall?u.catchall&&(c.additionalProperties=At(u.catchall,s,{...r,path:[...r.path,"additionalProperties"]})):s.io==="output"&&(c.additionalProperties=!1)},FE=(t,s,i,r)=>{const c=t._zod.def,u=c.inclusive===!1,f=c.options.map((p,g)=>At(p,s,{...r,path:[...r.path,u?"oneOf":"anyOf",g]}));u?i.oneOf=f:i.anyOf=f},YE=(t,s,i,r)=>{const c=t._zod.def,u=At(c.left,s,{...r,path:[...r.path,"allOf",0]}),f=At(c.right,s,{...r,path:[...r.path,"allOf",1]}),p=v=>"allOf"in v&&Object.keys(v).length===1,g=[...p(u)?u.allOf:[u],...p(f)?f.allOf:[f]];i.allOf=g},XE=(t,s,i,r)=>{const c=i,u=t._zod.def;c.type="object";const f=u.keyType,p=f._zod.bag,g=p==null?void 0:p.patterns;if(u.mode==="loose"&&g&&g.size>0){const y=At(u.valueType,s,{...r,path:[...r.path,"patternProperties","*"]});c.patternProperties={};for(const b of g)c.patternProperties[b.source]=y}else(s.target==="draft-07"||s.target==="draft-2020-12")&&(c.propertyNames=At(u.keyType,s,{...r,path:[...r.path,"propertyNames"]})),c.additionalProperties=At(u.valueType,s,{...r,path:[...r.path,"additionalProperties"]});const v=f._zod.values;if(v){const y=[...v].filter(b=>typeof b=="string"||typeof b=="number");y.length>0&&(c.required=y)}},KE=(t,s,i,r)=>{const c=t._zod.def,u=At(c.innerType,s,r),f=s.seen.get(t);s.target==="openapi-3.0"?(f.ref=c.innerType,i.nullable=!0):i.anyOf=[u,{type:"null"}]},QE=(t,s,i,r)=>{const c=t._zod.def;At(c.innerType,s,r);const u=s.seen.get(t);u.ref=c.innerType},WE=(t,s,i,r)=>{const c=t._zod.def;At(c.innerType,s,r);const u=s.seen.get(t);u.ref=c.innerType,i.default=JSON.parse(JSON.stringify(c.defaultValue))},JE=(t,s,i,r)=>{const c=t._zod.def;At(c.innerType,s,r);const u=s.seen.get(t);u.ref=c.innerType,s.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(c.defaultValue)))},e_=(t,s,i,r)=>{const c=t._zod.def;At(c.innerType,s,r);const u=s.seen.get(t);u.ref=c.innerType;let f;try{f=c.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=f},t_=(t,s,i,r)=>{const c=t._zod.def,u=s.io==="input"?c.in._zod.def.type==="transform"?c.out:c.in:c.out;At(u,s,r);const f=s.seen.get(t);f.ref=u},n_=(t,s,i,r)=>{const c=t._zod.def;At(c.innerType,s,r);const u=s.seen.get(t);u.ref=c.innerType,i.readOnly=!0},Uy=(t,s,i,r)=>{const c=t._zod.def;At(c.innerType,s,r);const u=s.seen.get(t);u.ref=c.innerType},s_=J("ZodISODateTime",(t,s)=>{aw.init(t,s),bt.init(t,s)});function a_(t){return uE(s_,t)}const i_=J("ZodISODate",(t,s)=>{iw.init(t,s),bt.init(t,s)});function l_(t){return dE(i_,t)}const r_=J("ZodISOTime",(t,s)=>{lw.init(t,s),bt.init(t,s)});function o_(t){return fE(r_,t)}const c_=J("ZodISODuration",(t,s)=>{rw.init(t,s),bt.init(t,s)});function u_(t){return hE(c_,t)}const d_=(t,s)=>{vy.init(t,s),t.name="ZodError",Object.defineProperties(t,{format:{value:i=>Q1(t,i)},flatten:{value:i=>K1(t,i)},addIssue:{value:i=>{t.issues.push(i),t.message=JSON.stringify(t.issues,yd,2)}},addIssues:{value:i=>{t.issues.push(...i),t.message=JSON.stringify(t.issues,yd,2)}},isEmpty:{get(){return t.issues.length===0}}})},Zn=J("ZodError",d_,{Parent:Error}),f_=Bd(Zn),h_=Id(Zn),m_=So(Zn),p_=jo(Zn),g_=eN(Zn),v_=tN(Zn),y_=nN(Zn),b_=sN(Zn),x_=aN(Zn),S_=iN(Zn),j_=lN(Zn),N_=rN(Zn),yt=J("ZodType",(t,s)=>(vt.init(t,s),Object.assign(t["~standard"],{jsonSchema:{input:po(t,"input"),output:po(t,"output")}}),t.toJSONSchema=OE(t,{}),t.def=s,t.type=s.type,Object.defineProperty(t,"_def",{value:s}),t.check=(...i)=>t.clone(aa(s,{checks:[...s.checks??[],...i.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),t.with=t.check,t.clone=(i,r)=>ia(t,i,r),t.brand=()=>t,t.register=((i,r)=>(i.add(t,r),t)),t.parse=(i,r)=>f_(t,i,r,{callee:t.parse}),t.safeParse=(i,r)=>m_(t,i,r),t.parseAsync=async(i,r)=>h_(t,i,r,{callee:t.parseAsync}),t.safeParseAsync=async(i,r)=>p_(t,i,r),t.spa=t.safeParseAsync,t.encode=(i,r)=>g_(t,i,r),t.decode=(i,r)=>v_(t,i,r),t.encodeAsync=async(i,r)=>y_(t,i,r),t.decodeAsync=async(i,r)=>b_(t,i,r),t.safeEncode=(i,r)=>x_(t,i,r),t.safeDecode=(i,r)=>S_(t,i,r),t.safeEncodeAsync=async(i,r)=>j_(t,i,r),t.safeDecodeAsync=async(i,r)=>N_(t,i,r),t.refine=(i,r)=>t.check(g2(i,r)),t.superRefine=i=>t.check(v2(i)),t.overwrite=i=>t.check(Ti(i)),t.optional=()=>kg(t),t.exactOptional=()=>s2(t),t.nullable=()=>Tg(t),t.nullish=()=>kg(Tg(t)),t.nonoptional=i=>c2(t,i),t.array=()=>gt(t),t.or=i=>Ol([t,i]),t.and=i=>Q_(t,i),t.transform=i=>Cg(t,t2(i)),t.default=i=>l2(t,i),t.prefault=i=>o2(t,i),t.catch=i=>d2(t,i),t.pipe=i=>Cg(t,i),t.readonly=()=>m2(t),t.describe=i=>{const r=t.clone();return _l.add(r,{description:i}),r},Object.defineProperty(t,"description",{get(){var i;return(i=_l.get(t))==null?void 0:i.description},configurable:!0}),t.meta=(...i)=>{if(i.length===0)return _l.get(t);const r=t.clone();return _l.add(r,i[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=i=>i(t),t)),$y=J("_ZodString",(t,s)=>{Hd.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(r,c,u)=>LE(t,r,c);const i=t._zod.bag;t.format=i.format??null,t.minLength=i.minimum??null,t.maxLength=i.maximum??null,t.regex=(...r)=>t.check(bE(...r)),t.includes=(...r)=>t.check(jE(...r)),t.startsWith=(...r)=>t.check(NE(...r)),t.endsWith=(...r)=>t.check(wE(...r)),t.min=(...r)=>t.check(mo(...r)),t.max=(...r)=>t.check(My(...r)),t.length=(...r)=>t.check(zy(...r)),t.nonempty=(...r)=>t.check(mo(1,...r)),t.lowercase=r=>t.check(xE(r)),t.uppercase=r=>t.check(SE(r)),t.trim=()=>t.check(_E()),t.normalize=(...r)=>t.check(EE(...r)),t.toLowerCase=()=>t.check(kE()),t.toUpperCase=()=>t.check(TE()),t.slugify=()=>t.check(CE())}),w_=J("ZodString",(t,s)=>{Hd.init(t,s),$y.init(t,s),t.email=i=>t.check(qw(E_,i)),t.url=i=>t.check(Yw(__,i)),t.jwt=i=>t.check(cE(H_,i)),t.emoji=i=>t.check(Xw(k_,i)),t.guid=i=>t.check(Sg(Eg,i)),t.uuid=i=>t.check(Pw(to,i)),t.uuidv4=i=>t.check(Vw(to,i)),t.uuidv6=i=>t.check(Gw(to,i)),t.uuidv7=i=>t.check(Fw(to,i)),t.nanoid=i=>t.check(Kw(T_,i)),t.guid=i=>t.check(Sg(Eg,i)),t.cuid=i=>t.check(Qw(C_,i)),t.cuid2=i=>t.check(Ww(R_,i)),t.ulid=i=>t.check(Jw(A_,i)),t.base64=i=>t.check(lE($_,i)),t.base64url=i=>t.check(rE(B_,i)),t.xid=i=>t.check(eE(M_,i)),t.ksuid=i=>t.check(tE(z_,i)),t.ipv4=i=>t.check(nE(O_,i)),t.ipv6=i=>t.check(sE(D_,i)),t.cidrv4=i=>t.check(aE(L_,i)),t.cidrv6=i=>t.check(iE(U_,i)),t.e164=i=>t.check(oE(I_,i)),t.datetime=i=>t.check(a_(i)),t.date=i=>t.check(l_(i)),t.time=i=>t.check(o_(i)),t.duration=i=>t.check(u_(i))});function Z(t){return Zw(w_,t)}const bt=J("ZodStringFormat",(t,s)=>{mt.init(t,s),$y.init(t,s)}),E_=J("ZodEmail",(t,s)=>{XN.init(t,s),bt.init(t,s)}),Eg=J("ZodGUID",(t,s)=>{FN.init(t,s),bt.init(t,s)}),to=J("ZodUUID",(t,s)=>{YN.init(t,s),bt.init(t,s)}),__=J("ZodURL",(t,s)=>{KN.init(t,s),bt.init(t,s)}),k_=J("ZodEmoji",(t,s)=>{QN.init(t,s),bt.init(t,s)}),T_=J("ZodNanoID",(t,s)=>{WN.init(t,s),bt.init(t,s)}),C_=J("ZodCUID",(t,s)=>{JN.init(t,s),bt.init(t,s)}),R_=J("ZodCUID2",(t,s)=>{ew.init(t,s),bt.init(t,s)}),A_=J("ZodULID",(t,s)=>{tw.init(t,s),bt.init(t,s)}),M_=J("ZodXID",(t,s)=>{nw.init(t,s),bt.init(t,s)}),z_=J("ZodKSUID",(t,s)=>{sw.init(t,s),bt.init(t,s)}),O_=J("ZodIPv4",(t,s)=>{ow.init(t,s),bt.init(t,s)}),D_=J("ZodIPv6",(t,s)=>{cw.init(t,s),bt.init(t,s)}),L_=J("ZodCIDRv4",(t,s)=>{uw.init(t,s),bt.init(t,s)}),U_=J("ZodCIDRv6",(t,s)=>{dw.init(t,s),bt.init(t,s)}),$_=J("ZodBase64",(t,s)=>{fw.init(t,s),bt.init(t,s)}),B_=J("ZodBase64URL",(t,s)=>{mw.init(t,s),bt.init(t,s)}),I_=J("ZodE164",(t,s)=>{pw.init(t,s),bt.init(t,s)}),H_=J("ZodJWT",(t,s)=>{vw.init(t,s),bt.init(t,s)}),By=J("ZodNumber",(t,s)=>{ky.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(r,c,u)=>UE(t,r,c),t.gt=(r,c)=>t.check(Ng(r,c)),t.gte=(r,c)=>t.check(Ku(r,c)),t.min=(r,c)=>t.check(Ku(r,c)),t.lt=(r,c)=>t.check(jg(r,c)),t.lte=(r,c)=>t.check(Xu(r,c)),t.max=(r,c)=>t.check(Xu(r,c)),t.int=r=>t.check(_g(r)),t.safe=r=>t.check(_g(r)),t.positive=r=>t.check(Ng(0,r)),t.nonnegative=r=>t.check(Ku(0,r)),t.negative=r=>t.check(jg(0,r)),t.nonpositive=r=>t.check(Xu(0,r)),t.multipleOf=(r,c)=>t.check(wg(r,c)),t.step=(r,c)=>t.check(wg(r,c)),t.finite=()=>t;const i=t._zod.bag;t.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),t.isFinite=!0,t.format=i.format??null});function pe(t){return mE(By,t)}const Z_=J("ZodNumberFormat",(t,s)=>{yw.init(t,s),By.init(t,s)});function _g(t){return pE(Z_,t)}const q_=J("ZodBoolean",(t,s)=>{bw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>$E(t,i,r)});function vn(t){return gE(q_,t)}const P_=J("ZodUnknown",(t,s)=>{xw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>IE()});function In(){return vE(P_)}const V_=J("ZodNever",(t,s)=>{Sw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>BE(t,i,r)});function G_(t){return yE(V_,t)}const F_=J("ZodArray",(t,s)=>{jw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>VE(t,i,r,c),t.element=s.element,t.min=(i,r)=>t.check(mo(i,r)),t.nonempty=i=>t.check(mo(1,i)),t.max=(i,r)=>t.check(My(i,r)),t.length=(i,r)=>t.check(zy(i,r)),t.unwrap=()=>t.element});function gt(t,s){return RE(F_,t,s)}const Y_=J("ZodObject",(t,s)=>{ww.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>GE(t,i,r,c),tt(t,"shape",()=>s.shape),t.keyof=()=>Vt(Object.keys(t._zod.def.shape)),t.catchall=i=>t.clone({...t._zod.def,catchall:i}),t.passthrough=()=>t.clone({...t._zod.def,catchall:In()}),t.loose=()=>t.clone({...t._zod.def,catchall:In()}),t.strict=()=>t.clone({...t._zod.def,catchall:G_()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=i=>V1(t,i),t.safeExtend=i=>G1(t,i),t.merge=i=>F1(t,i),t.pick=i=>q1(t,i),t.omit=i=>P1(t,i),t.partial=(...i)=>Y1(Hy,t,i[0]),t.required=(...i)=>X1(Zy,t,i[0])});function re(t,s){const i={type:"object",shape:t??{},...Ee(s)};return new Y_(i)}const Iy=J("ZodUnion",(t,s)=>{Ry.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>FE(t,i,r,c),t.options=s.options});function Ol(t,s){return new Iy({type:"union",options:t,...Ee(s)})}const X_=J("ZodDiscriminatedUnion",(t,s)=>{Iy.init(t,s),Ew.init(t,s)});function Ci(t,s,i){return new X_({type:"union",options:s,discriminator:t,...Ee(i)})}const K_=J("ZodIntersection",(t,s)=>{_w.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>YE(t,i,r,c)});function Q_(t,s){return new K_({type:"intersection",left:t,right:s})}const W_=J("ZodRecord",(t,s)=>{kw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>XE(t,i,r,c),t.keyType=s.keyType,t.valueType=s.valueType});function Zd(t,s,i){return new W_({type:"record",keyType:t,valueType:s,...Ee(i)})}const xd=J("ZodEnum",(t,s)=>{Tw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(r,c,u)=>HE(t,r,c),t.enum=s.entries,t.options=Object.values(s.entries);const i=new Set(Object.keys(s.entries));t.extract=(r,c)=>{const u={};for(const f of r)if(i.has(f))u[f]=s.entries[f];else throw new Error(`Key ${f} not found in enum`);return new xd({...s,checks:[],...Ee(c),entries:u})},t.exclude=(r,c)=>{const u={...s.entries};for(const f of r)if(i.has(f))delete u[f];else throw new Error(`Key ${f} not found in enum`);return new xd({...s,checks:[],...Ee(c),entries:u})}});function Vt(t,s){const i=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new xd({type:"enum",entries:i,...Ee(s)})}const J_=J("ZodLiteral",(t,s)=>{Cw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>ZE(t,i,r),t.values=new Set(s.values),Object.defineProperty(t,"value",{get(){if(s.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return s.values[0]}})});function Qe(t,s){return new J_({type:"literal",values:Array.isArray(t)?t:[t],...Ee(s)})}const e2=J("ZodTransform",(t,s)=>{Rw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>PE(t,i),t._zod.parse=(i,r)=>{if(r.direction==="backward")throw new dy(t.constructor.name);i.addIssue=u=>{if(typeof u=="string")i.issues.push(Rl(u,i.value,s));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=i.value),f.inst??(f.inst=t),i.issues.push(Rl(f))}};const c=s.transform(i.value,i);return c instanceof Promise?c.then(u=>(i.value=u,i)):(i.value=c,i)}});function t2(t){return new e2({type:"transform",transform:t})}const Hy=J("ZodOptional",(t,s)=>{Ay.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>Uy(t,i,r,c),t.unwrap=()=>t._zod.def.innerType});function kg(t){return new Hy({type:"optional",innerType:t})}const n2=J("ZodExactOptional",(t,s)=>{Aw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>Uy(t,i,r,c),t.unwrap=()=>t._zod.def.innerType});function s2(t){return new n2({type:"optional",innerType:t})}const a2=J("ZodNullable",(t,s)=>{Mw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>KE(t,i,r,c),t.unwrap=()=>t._zod.def.innerType});function Tg(t){return new a2({type:"nullable",innerType:t})}const i2=J("ZodDefault",(t,s)=>{zw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>WE(t,i,r,c),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function l2(t,s){return new i2({type:"default",innerType:t,get defaultValue(){return typeof s=="function"?s():py(s)}})}const r2=J("ZodPrefault",(t,s)=>{Ow.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>JE(t,i,r,c),t.unwrap=()=>t._zod.def.innerType});function o2(t,s){return new r2({type:"prefault",innerType:t,get defaultValue(){return typeof s=="function"?s():py(s)}})}const Zy=J("ZodNonOptional",(t,s)=>{Dw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>QE(t,i,r,c),t.unwrap=()=>t._zod.def.innerType});function c2(t,s){return new Zy({type:"nonoptional",innerType:t,...Ee(s)})}const u2=J("ZodCatch",(t,s)=>{Lw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>e_(t,i,r,c),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function d2(t,s){return new u2({type:"catch",innerType:t,catchValue:typeof s=="function"?s:()=>s})}const f2=J("ZodPipe",(t,s)=>{Uw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>t_(t,i,r,c),t.in=s.in,t.out=s.out});function Cg(t,s){return new f2({type:"pipe",in:t,out:s})}const h2=J("ZodReadonly",(t,s)=>{$w.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>n_(t,i,r,c),t.unwrap=()=>t._zod.def.innerType});function m2(t){return new h2({type:"readonly",innerType:t})}const p2=J("ZodCustom",(t,s)=>{Bw.init(t,s),yt.init(t,s),t._zod.processJSONSchema=(i,r,c)=>qE(t,i)});function g2(t,s={}){return AE(p2,t,s)}function v2(t){return ME(t)}function sn(t){return Ol([t,Z()])}const y2=re({type:Vt(["text","thinking","tool_use","tool_result"]),text:Z().optional(),thinking:Z().optional(),signature:Z().optional(),id:Z().optional(),name:Z().optional(),input:In().optional(),tool_use_id:Z().optional(),content:Z().optional(),is_error:vn().optional()}),b2=re({status:Vt(["completed","failed","timeout"]).optional(),prompt:Z().optional(),agentId:Z().optional(),content:gt(y2).optional(),totalDurationMs:pe().optional(),totalTokens:pe().optional(),totalToolUseCount:pe().optional()}),x2=sn(b2),S2=re({stdout:Z().optional(),stderr:Z().optional(),interrupted:vn().optional(),isImage:vn().optional(),backgroundTaskId:Z().optional()}),j2=sn(S2),N2=re({filePath:Z().optional(),content:Z().optional(),numLines:pe().optional(),startLine:pe().optional(),totalLines:pe().optional()}),w2=re({originalWidth:pe().optional(),originalHeight:pe().optional(),displayWidth:pe().optional(),displayHeight:pe().optional()}),E2=re({base64:Z().optional(),type:Z().optional(),originalSize:pe().optional(),dimensions:w2.optional()}),_2=re({type:Vt(["text","image"]).optional(),file:Ol([N2,E2]).optional()}),k2=sn(_2),T2=re({oldStart:pe().optional(),oldLines:pe().optional(),newStart:pe().optional(),newLines:pe().optional(),lines:gt(Z()).optional()}),C2=re({type:Vt(["create","edit","update"]).optional(),filePath:Z().optional(),oldString:Z().optional(),newString:Z().optional(),originalFile:Z().nullable().optional(),replaceAll:vn().optional(),userModified:vn().optional(),structuredPatch:gt(T2).optional()}),R2=sn(C2),A2=re({type:Qe("text").optional(),file:re({filePath:Z().optional(),content:Z().optional(),numLines:pe().optional(),startLine:pe().optional(),totalLines:pe().optional()}).optional()}),M2=sn(A2),z2=re({filenames:gt(Z()).optional(),durationMs:pe().optional(),numFiles:pe().optional(),truncated:vn().optional()}),O2=sn(z2),D2=re({mode:Vt(["files_with_matches","content","count"]).optional(),filenames:gt(Z()).optional(),numFiles:pe().optional(),content:Z().optional(),numLines:pe().optional(),appliedLimit:pe().optional()}),L2=sn(D2),Rg=re({content:Z().optional(),status:Vt(["pending","in_progress","completed"]).optional(),activeForm:Z().optional()}),U2=re({oldTodos:gt(Rg).optional(),newTodos:gt(Rg).optional()}),$2=sn(U2),B2=re({tool_use_id:Z().optional(),content:gt(re({title:Z().optional(),url:Z().optional()})).optional()}),I2=re({query:Z().optional(),results:gt(Ol([B2,Z()])).optional(),durationSeconds:pe().optional()}),H2=sn(I2),Z2=re({bytes:pe().optional(),code:pe().optional(),codeText:Z().optional(),result:Z().optional(),durationMs:pe().optional(),url:Z().optional()}),q2=sn(Z2),P2=re({label:Z().optional(),description:Z().optional()}),V2=re({question:Z().optional(),header:Z().optional(),options:gt(P2).optional(),multiSelect:vn().optional()}),G2=re({questions:gt(V2).optional(),answers:Zd(Z(),Z()).optional()}),F2=sn(G2),Y2=re({shellId:Z().optional(),command:Z().optional(),status:Vt(["running","completed","failed"]).optional(),exitCode:pe().nullable().optional(),stdout:Z().optional(),stderr:Z().optional(),stdoutLines:pe().optional(),stderrLines:pe().optional(),timestamp:Z().optional()}),X2=sn(Y2),K2=re({retrieval_status:Vt(["completed","timeout","running"]).optional(),task:re({task_id:Z().optional(),task_type:Vt(["local_bash","agent"]).optional(),status:Vt(["running","completed","failed"]).optional(),description:Z().optional(),output:Z().optional(),exitCode:pe().nullable().optional()}).optional()}),Q2=sn(K2),W2=re({message:Z().optional(),shell_id:Z().optional()}),J2=sn(W2),ek=re({message:Z().optional()});sn(ek);const tk=re({message:Z().optional(),plan:Z().optional()});sn(tk);const nk=re({id:Z(),timestamp:Z(),cwd:Z(),originator:Z().optional(),cli_version:Z().optional(),instructions:Z().optional(),source:Z().optional(),model_provider:Z().optional()}),sk=re({timestamp:Z(),type:Qe("session_meta"),payload:nk}),ak=re({type:Qe("input_text"),text:Z()}),ik=re({type:Qe("output_text"),text:Z()}),lk=re({type:Qe("message"),role:Vt(["user","assistant"]),content:gt(Ol([ak,ik]))}),rk=re({type:Qe("summary_text"),text:Z()}),ok=re({type:Qe("reasoning"),summary:gt(rk).optional(),content:In().nullable().optional(),encrypted_content:Z().optional()}),ck=re({type:Qe("function_call"),name:Z(),arguments:Z(),call_id:Z()}),uk=re({type:Qe("function_call_output"),call_id:Z(),output:Z()}),dk=re({type:Qe("ghost_snapshot"),ghost_commit:re({id:Z(),parent:Z(),preexisting_untracked_files:gt(Z()).optional(),preexisting_untracked_dirs:gt(Z()).optional()})}),fk=Ci("type",[lk,ok,ck,uk,dk]),hk=re({timestamp:Z(),type:Qe("response_item"),payload:fk}),mk=re({primary:re({used_percent:pe(),window_minutes:pe(),resets_at:pe()}).optional(),secondary:re({used_percent:pe(),window_minutes:pe(),resets_at:pe()}).optional(),credits:re({has_credits:vn(),unlimited:vn(),balance:In().nullable()}).optional(),plan_type:Z().nullable().optional()}),pk=re({total_token_usage:re({input_tokens:pe(),cached_input_tokens:pe().optional(),output_tokens:pe(),reasoning_output_tokens:pe().optional(),total_tokens:pe()}).optional(),last_token_usage:re({input_tokens:pe(),cached_input_tokens:pe().optional(),output_tokens:pe(),reasoning_output_tokens:pe().optional(),total_tokens:pe()}).optional(),model_context_window:pe().optional()}),gk=re({type:Qe("user_message"),message:Z(),images:gt(In()).optional()}),vk=re({type:Qe("agent_message"),message:Z()}),yk=re({type:Qe("agent_reasoning"),text:Z()}),bk=re({type:Qe("token_count"),info:pk.nullable(),rate_limits:mk.optional()}),xk=Ci("type",[gk,vk,yk,bk]),Sk=re({timestamp:Z(),type:Qe("event_msg"),payload:xk}),jk=re({type:Z(),network_access:vn().optional(),exclude_tmpdir_env_var:vn().optional(),exclude_slash_tmp:vn().optional()}),Nk=re({cwd:Z(),approval_policy:Z(),sandbox_policy:jk.optional(),model:Z().optional(),summary:Z().optional()}),wk=re({timestamp:Z(),type:Qe("turn_context"),payload:Nk});Ci("type",[sk,hk,Sk,wk]);const Ek=re({total_tokens:pe().optional(),input_tokens:pe().optional(),output_tokens:pe().optional(),cached:pe().optional(),input:pe().optional(),duration_ms:pe().optional(),tool_calls:pe().optional()}),_k=re({type:Qe("init"),timestamp:Z().optional(),session_id:Z(),model:Z().optional()}),kk=re({type:Qe("message"),timestamp:Z().optional(),role:Vt(["user","assistant"]),content:Z(),delta:vn().optional()}),Tk=re({type:Qe("tool_use"),timestamp:Z().optional(),tool_name:Z(),tool_id:Z(),parameters:Zd(Z(),In()).optional()}),Ck=re({type:Qe("tool_result"),timestamp:Z().optional(),tool_id:Z(),status:Vt(["success","error"]),output:Z().optional(),error:Z().optional()}),Rk=re({type:Qe("result"),timestamp:Z().optional(),status:Vt(["success","error","cancelled"]),stats:Ek.optional(),error:Z().optional()}),Ak=re({type:Qe("error"),timestamp:Z().optional(),error:Z().optional(),message:Z().optional(),code:Z().optional()});Ci("type",[_k,kk,Tk,Ck,Rk,Ak]);const Mk=re({id:Z(),name:Z(),response:re({output:Z()})}),zk=re({functionResponse:Mk}),Ok=re({id:Z(),name:Z(),args:Zd(Z(),In()),result:gt(zk).optional(),status:Vt(["success","error","pending"]).optional(),timestamp:Z().optional(),resultDisplay:Z().optional(),displayName:Z().optional(),description:Z().optional(),renderOutputAsMarkdown:vn().optional()}),Dk=re({subject:Z(),description:Z(),timestamp:Z().optional()}),Lk=re({input:pe().optional(),output:pe().optional(),cached:pe().optional(),thoughts:pe().optional(),tool:pe().optional(),total:pe().optional()}),Uk=re({id:Z(),timestamp:Z(),type:Qe("user"),content:Z()}),$k=re({id:Z(),timestamp:Z(),type:Qe("gemini"),content:Z(),thoughts:gt(Dk).optional(),toolCalls:gt(Ok).optional(),tokens:Lk.optional(),model:Z().optional()}),Bk=Ci("type",[Uk,$k]);re({sessionId:Z(),projectHash:Z(),startTime:Z(),lastUpdated:Z(),messages:gt(Bk)});const Ik=re({type:Vt(["busy","idle"])}),qy=re({input:pe().optional(),output:pe().optional(),reasoning:pe().optional(),cache:re({read:pe().optional(),write:pe().optional()}).optional()}),qd=re({start:pe().optional(),end:pe().optional(),created:pe().optional(),updated:pe().optional(),completed:pe().optional()}),Hk=re({id:Z(),sessionID:Z(),messageID:Z(),type:Z(),text:Z().optional(),time:qd.optional(),reason:Z().optional(),snapshot:Z().optional(),cost:pe().optional(),tokens:qy.optional(),tool:Z().optional(),input:In().optional(),output:In().optional(),error:Z().optional()}),Zk=re({id:Z(),sessionID:Z(),role:Vt(["user","assistant"]),time:qd.optional(),parentID:Z().optional(),modelID:Z().optional(),providerID:Z().optional(),mode:Z().optional(),agent:Z().optional(),path:re({cwd:Z().optional(),root:Z().optional()}).optional(),cost:pe().optional(),tokens:qy.optional(),finish:Z().optional(),summary:re({title:Z().optional(),diffs:gt(In()).optional()}).optional(),model:re({providerID:Z().optional(),modelID:Z().optional()}).optional()}),qk=re({id:Z(),version:Z().optional(),projectID:Z().optional(),directory:Z().optional(),title:Z().optional(),time:qd.optional(),summary:re({additions:pe().optional(),deletions:pe().optional(),files:pe().optional()}).optional()}),Pk=re({type:Qe("server.connected"),properties:re({}).optional()}),Vk=re({type:Qe("session.status"),properties:re({sessionID:Z(),status:Ik})}),Gk=re({type:Qe("session.updated"),properties:re({info:qk})}),Fk=re({type:Qe("session.idle"),properties:re({sessionID:Z()})}),Yk=re({type:Qe("session.diff"),properties:re({sessionID:Z(),diff:gt(In())})}),Xk=re({type:Qe("message.updated"),properties:re({info:Zk})}),Kk=re({type:Qe("message.part.updated"),properties:re({part:Hk,delta:Z().optional()})});Ci("type",[Pk,Vk,Gk,Fk,Yk,Xk,Kk]);function en(t){return t.uuid??t.id??""}function Py(t,s,i){if(!t)return{...s,_source:i};const r=t._source??"sdk";return i==="jsonl"?{...t,...s,_source:"jsonl"}:r==="jsonl"?t:{...s,_source:"sdk"}}function Qk(t,s,i){const r=new Map(t.map(f=>[en(f),f]));for(const f of s){const p=en(f),g=r.get(p);r.set(p,Py(g,f,"jsonl"))}const c=[],u=new Set;for(const f of t){const p=en(f);u.has(p)||(c.push(r.get(p)??f),u.add(p))}for(const f of s){const p=en(f);u.has(p)||(c.push(r.get(p)??f),u.add(p))}return i!=null&&i.skipDagOrdering?{messages:c}:{messages:L1(c)}}function Wk(t,s){const i=en(s),r=t.findIndex(c=>en(c)===i);if(r>=0){const c=t[r],u=Py(c,s,"sdk");if(c===u)return{messages:t,index:r};const f=[...t];return f[r]=u,{messages:f,index:r}}return{messages:[...t,{...s,_source:"sdk"}],index:t.length}}const Jk=500;function eT(){const[t,s]=m.useState(0),i=m.useRef(null),r=m.useCallback(async()=>{try{const u=await Ne.getInbox();s(u.active.length)}catch{}},[]),c=m.useCallback(()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(r,Jk)},[r]);return _i({onProcessStateChange:c,onReconnect:r}),m.useEffect(()=>{r()},[r]),m.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]),t}function Ra({variant:t="dot",label:s="Thinking",className:i}){const r=l.jsx("span",{className:"thinking-indicator-dot"});return t==="pill"?l.jsxs("span",{className:`thinking-indicator-pill ${i??""}`,children:[r,l.jsx("span",{className:"thinking-indicator-label",children:s})]}):l.jsx("span",{className:`thinking-indicator ${i??""}`,children:r})}const ea={inbox:l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),l.jsx("path",{d:"M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"})]}),projects:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:l.jsx("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"})}),agents:l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),l.jsx("circle",{cx:"12",cy:"5",r:"3"}),l.jsx("path",{d:"M12 8v3"}),l.jsx("circle",{cx:"8",cy:"16",r:"1"}),l.jsx("circle",{cx:"16",cy:"16",r:"1"})]}),settings:l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("circle",{cx:"12",cy:"12",r:"3"}),l.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-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.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 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.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.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.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-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),allSessions:l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[l.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),l.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),l.jsx("line",{x1:"9",y1:"21",x2:"9",y2:"9"})]}),newSession:l.jsxs("svg",{className:"sidebar-new-session-icon",width:"20",height:"20",viewBox:"0 0 24 24","aria-hidden":"true",children:[l.jsx("circle",{cx:"12",cy:"12",r:"12",fill:"var(--app-yep-green)"}),l.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"17",stroke:"white",strokeWidth:"2",strokeLinecap:"round"}),l.jsx("line",{x1:"7",y1:"12",x2:"17",y2:"12",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),recents:l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("polyline",{points:"12 6 12 12 16 14"})]}),tasks:l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("path",{d:"M9 11l3 3L22 4"}),l.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})};function ta({to:t,icon:s,label:i,badge:r,onClick:c,title:u,hasDraft:f,hasActivityIndicator:p}){const v=yn().pathname===t;return l.jsxs(gn,{to:t,className:`sidebar-nav-item ${v?"active":""}`,onClick:c,title:u??i,children:[s,l.jsx("span",{className:"sidebar-nav-text",children:i}),f&&l.jsx("span",{className:"session-draft-badge",children:"(draft)"}),p&&l.jsx(Ra,{}),r!==void 0&&r>0&&l.jsx("span",{className:"sidebar-nav-badge",children:r})]})}function tT({children:t}){return l.jsx("nav",{className:"sidebar-nav-section",children:t})}function nT({onClick:t}){const s=eT();return l.jsx(ta,{to:"/agents",icon:ea.agents,label:"Agents",onClick:t,hasActivityIndicator:s>0})}function Vy({usage:t,size:s=16,showLabel:i=!0}){if(!t)return null;const{percentage:r}=t,c=Math.min(100,Math.max(0,r)),u=s/2-1,f=2*Math.PI*u,p=c/100*f,g=()=>c>=90?"var(--color-error, #dc3545)":c>=75?"var(--color-warning, #ffc107)":"var(--text-muted, #9d9d9d)";return l.jsxs("span",{className:"context-usage-indicator",title:`Context: ${r}% (${sT(t.inputTokens)} tokens)`,children:[l.jsxs("svg",{width:s,height:s,viewBox:`0 0 ${s} ${s}`,className:"context-usage-pie","aria-hidden":"true",children:[l.jsx("circle",{cx:s/2,cy:s/2,r:u,fill:"none",stroke:"var(--border-color, #3c3c3c)",strokeWidth:"2"}),l.jsx("circle",{cx:s/2,cy:s/2,r:u,fill:"none",stroke:g(),strokeWidth:"2",strokeDasharray:`${p} ${f}`,strokeLinecap:"round",transform:`rotate(-90 ${s/2} ${s/2})`})]}),i&&l.jsxs("span",{className:"context-usage-label",children:[c,"%"]})]})}function sT(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}class aT{constructor(){Ke(this,"id","claude");Ke(this,"displayName","Claude");Ke(this,"capabilities",{supportsDag:!0,supportsCloning:!0});Ke(this,"metadata",{description:"Anthropic's Claude Code SDK. Full tool transparency, real-time streaming, and permission modes.",limitations:[],website:"https://claude.ai/download",cliName:"claude"})}}class iT{constructor(){Ke(this,"id","codex");Ke(this,"displayName","Codex");Ke(this,"capabilities",{supportsDag:!1,supportsCloning:!1});Ke(this,"metadata",{description:"OpenAI's Codex CLI. Full editing capabilities with cloud-based reasoning.",limitations:["Edit details not visible (black box)","No out-of-band tool approval","Best for fire-and-forget tasks"],website:"https://openai.com/index/introducing-codex/",cliName:"codex"})}}class lT{constructor(){Ke(this,"id","codex-oss");Ke(this,"displayName","Codex OSS");Ke(this,"capabilities",{supportsDag:!1,supportsCloning:!1});Ke(this,"metadata",{description:"Codex with local models via Ollama. All operations visible through shell commands.",limitations:["Requires Ollama running locally","Model quality varies","More verbose output"],website:"https://github.com/openai/codex",cliName:"codex"})}}class rT{constructor(){Ke(this,"id","gemini");Ke(this,"displayName","Gemini");Ke(this,"capabilities",{supportsDag:!1,supportsCloning:!1});Ke(this,"metadata",{description:"Google's Gemini CLI. Read-only tools for code exploration and analysis.",limitations:["Read-only (no file edits or bash commands)","Best for research and planning tasks"],website:"https://github.com/google-gemini/gemini-cli",cliName:"gemini"})}}class oT{constructor(){Ke(this,"id","opencode");Ke(this,"displayName","OpenCode");Ke(this,"capabilities",{supportsDag:!1,supportsCloning:!1});Ke(this,"metadata",{description:"Multi-provider agent with tool streaming via SSE. Supports various LLM backends.",limitations:["Tool approval flow still under investigation","Experimental integration"],website:"https://opencode.ai",cliName:"opencode"})}}const Gy={claude:new aT,gemini:new rT,codex:new iT,"codex-oss":new lT,opencode:new oT};function cT(){return Object.values(Gy)}class Ag{constructor(s){Ke(this,"capabilities",{supportsDag:!1,supportsCloning:!1});Ke(this,"metadata");this.id=s,this.metadata={description:"Unknown provider",limitations:[],website:"",cliName:s}}get displayName(){return this.id}}function Fy(t){return t?Gy[t]??new Ag(t):new Ag("unknown")}function Yy({sessionId:t,projectId:s,isStarred:i,isArchived:r,hasUnread:c,provider:u,onToggleStar:f,onToggleArchive:p,onToggleRead:g,onRename:v,onClone:y,useEllipsisIcon:b=!1,className:S="",useFixedPositioning:w=!1}){const[_,N]=m.useState(!1),[j,R]=m.useState(!1),[C,z]=m.useState(null),H=m.useRef(null),T=m.useRef(null),O=m.useRef(null);m.useEffect(()=>{if(!_)return;const le=k=>{var he,A,Y;const U=k.target,I=(he=H.current)==null?void 0:he.contains(U),oe=(A=O.current)==null?void 0:A.contains(U);!I&&!oe&&(N(!1),(Y=T.current)==null||Y.blur())},ue=()=>{var k;N(!1),z(null),(k=T.current)==null||k.blur()};return document.addEventListener("mousedown",le),document.addEventListener("scroll",ue,!0),()=>{document.removeEventListener("mousedown",le),document.removeEventListener("scroll",ue,!0)}},[_]);const D=()=>{var le;if(_)N(!1),z(null),(le=T.current)==null||le.blur();else{if(w&&T.current){const ue=T.current.getBoundingClientRect(),k=140,U=180,I=window.innerWidth-ue.right,oe=8,A=ue.bottom+oe+U>window.innerHeight?ue.top-U-oe:ue.bottom+oe;ue.right-k<oe?z({top:A,left:ue.left}):z({top:A,right:I})}N(!0)}},F=le=>{var ue;N(!1),z(null),(ue=T.current)==null||ue.blur(),le()},ne=async()=>{var le;if(!j){R(!0),N(!1),z(null),(le=T.current)==null||le.blur();try{const ue=await Ne.cloneSession(s,t);y==null||y(ue.sessionId)}catch(ue){console.error("Failed to clone session:",ue)}finally{R(!1)}}},ce=["session-menu-wrapper",S,_&&"is-open"].filter(Boolean).join(" "),de=w?{position:"fixed",top:(C==null?void 0:C.top)??100,...(C==null?void 0:C.left)!==void 0?{left:C.left}:{right:(C==null?void 0:C.right)??20}}:void 0,q=l.jsxs("div",{ref:O,className:"session-menu-dropdown",style:de,children:[l.jsxs("button",{type:"button",onClick:()=>F(f),children:[l.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:i?"currentColor":"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:l.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})}),i?"Unstar":"Star"]}),l.jsxs("button",{type:"button",onClick:()=>F(v),children:[l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[l.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),l.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Rename"]}),y&&Fy(u).capabilities.supportsCloning&&l.jsxs("button",{type:"button",onClick:ne,disabled:j,children:[l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),j?"Cloning...":"Clone"]}),l.jsxs("button",{type:"button",onClick:()=>F(p),children:[l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[l.jsx("polyline",{points:"21 8 21 21 3 21 3 8"}),l.jsx("rect",{x:"1",y:"3",width:"22",height:"5"}),l.jsx("line",{x1:"10",y1:"12",x2:"14",y2:"12"})]}),r?"Unarchive":"Archive"]}),g&&l.jsxs("button",{type:"button",onClick:()=>F(g),children:[l.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:c?l.jsx("polyline",{points:"20 6 9 17 4 12"}):l.jsx("circle",{cx:"12",cy:"12",r:"10"})}),c?"Mark as read":"Mark as unread"]})]}),Q=()=>w?Ei.createPortal(q,document.body):q;return l.jsxs("div",{className:ce,ref:H,children:[l.jsx("button",{ref:T,type:"button",className:"session-menu-trigger",onClick:le=>{le.preventDefault(),le.stopPropagation(),D()},title:"Session options","aria-label":"Session options","aria-expanded":_,children:b?l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none","aria-hidden":"true",children:[l.jsx("circle",{cx:"5",cy:"12",r:"2"}),l.jsx("circle",{cx:"12",cy:"12",r:"2"}),l.jsx("circle",{cx:"19",cy:"12",r:"2"})]}):l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})}),_&&Q()]})}function uT({variant:t,label:s}){const i=t==="needs-input"?"Input Needed":"New";return l.jsx("span",{className:`status-badge notification-${t}`,children:s??i})}function dT({status:t,pendingInputType:s,hasUnread:i,processState:r}){if(t.state==="external")return l.jsx("span",{className:"status-badge status-external",children:"External"});if(s){const c=s==="tool-approval"?"Approval Needed":"Question";return l.jsx(uT,{variant:"needs-input",label:c})}return r==="running"?l.jsx(Ra,{variant:"pill"}):null}function Mg({variant:t,count:s}){if(s===0)return null;const i=t==="owned"?`${s} Active`:t==="external"?`${s} External`:null;return i?l.jsx("span",{className:`status-badge status-${t}`,children:i}):null}function oo({session:t,projectId:s,mode:i,isCurrent:r=!1,isSelected:c=!1,processState:u,hasDraft:f=!1,showProjectName:p=!1,projectName:g,onNavigate:v,onSelect:y,isSelectionMode:b=!1}){const S=Kn(),[w,_]=m.useState(void 0),[N,j]=m.useState(void 0),[R,C]=m.useState(!1),[z,H]=m.useState(""),[T,O]=m.useState(!1),[D,F]=m.useState(void 0),ne=m.useRef(null),ce=m.useRef(!1),de=w??t.isStarred,q=N??t.isArchived,Q=D??uy(t);m.useEffect(()=>{R&&setTimeout(()=>{var xe,Ce;(xe=ne.current)==null||xe.focus(),(Ce=ne.current)==null||Ce.select()},0)},[R]);const le=async()=>{const xe=!de;_(xe);try{await Ne.updateSessionMetadata(t.id,{starred:xe})}catch(Ce){console.error("Failed to update star status:",Ce),_(void 0)}},ue=async()=>{const xe=!q;j(xe);try{await Ne.updateSessionMetadata(t.id,{archived:xe})}catch(Ce){console.error("Failed to update archive status:",Ce),j(void 0)}},[k,U]=m.useState(void 0),I=k??t.hasUnread,oe=async()=>{const xe=!I;U(xe);try{xe?await Ne.markSessionUnread(t.id):await Ne.markSessionSeen(t.id)}catch(Ce){console.error("Failed to update read status:",Ce),U(void 0)}},he=()=>{H(Q),C(!0)},A=()=>{ce.current||(C(!1),H(""))},Y=async()=>{if(!(!z.trim()||T)){if(z.trim()===Q){A();return}ce.current=!0,O(!0);try{await Ne.updateSessionMetadata(t.id,{title:z.trim()}),F(z.trim()),C(!1)}catch(xe){console.error("Failed to rename session:",xe)}finally{O(!1),ce.current=!1}}},X=()=>{if(!ce.current){if(!z.trim()||z.trim()===Q){A();return}Y()}},ae=xe=>{xe.key==="Enter"?(xe.preventDefault(),Y()):xe.key==="Escape"&&(xe.preventDefault(),A())},fe=xe=>{xe.stopPropagation(),y==null||y(t.id,xe.target.checked)},ie=()=>{if(t.status.state==="external")return l.jsx("span",{className:"session-badge session-badge-external",children:"Ext"});if(t.pendingInputType){const Ce=t.pendingInputType==="tool-approval"?"Appr":"Q";return l.jsx("span",{className:"session-badge session-badge-needs-input",children:Ce})}return(u??t.processState)==="running"?l.jsx(Ra,{}):null},ve=xe=>{const Ce=Date.now(),zt=new Date(xe).getTime(),Nt=Ce-zt,se=Math.floor(Nt/6e4),Se=Math.floor(Nt/36e5),Oe=Math.floor(Nt/864e5);return se<1?"just now":se<60?`${se}m ago`:Se<24?`${Se}h ago`:Oe<7?`${Oe}d ago`:new Date(xe).toLocaleDateString()},Ae=["session-list-item",i==="card"?"session-list-item--card":"session-list-item--compact",r&&"current",I&&"unread",c&&"selected",q&&"archived"].filter(Boolean).join(" "),be=({filled:xe,size:Ce=10})=>l.jsx("svg",{className:"session-star-icon",width:Ce,height:Ce,viewBox:"0 0 24 24",fill:xe?"currentColor":"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:l.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})});return l.jsxs("li",{className:Ae,children:[y&&l.jsx("input",{type:"checkbox",className:"session-list-item__checkbox",checked:c,onChange:fe,onClick:xe=>xe.stopPropagation(),"aria-label":`Select ${Q}`}),R?l.jsx("input",{ref:ne,type:"text",className:"session-rename-input",value:z,onChange:xe=>H(xe.target.value),onBlur:X,onKeyDown:ae,disabled:T}):l.jsx(gn,{to:`/projects/${s}/sessions/${t.id}`,onClick:xe=>{b&&xe.preventDefault(),v()},title:t.fullTitle||Q,className:"session-list-item__link",children:i==="card"?l.jsxs(l.Fragment,{children:[l.jsxs("strong",{className:"session-list-item__title",children:[de&&l.jsx(be,{filled:!0,size:12}),Q,q&&l.jsx("span",{className:"session-archived-badge",children:"Archived"})]}),l.jsxs("span",{className:"session-list-item__meta",children:[p&&g&&l.jsx("span",{className:"session-list-item__project",children:g}),ve(t.updatedAt),l.jsx(Vy,{usage:t.contextUsage,size:14}),l.jsx(dT,{status:t.status,pendingInputType:t.pendingInputType,hasUnread:t.hasUnread,processState:u??t.processState})]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"session-list-item__title-row",children:[de&&l.jsx(be,{filled:!0}),l.jsx("span",{className:"session-list-item__title-text",children:Q}),f&&l.jsx("span",{className:"session-draft-badge",children:"(draft)"})]}),p&&g&&l.jsx("span",{className:"session-list-item__project-compact",children:g}),ie()]})}),l.jsx(Yy,{sessionId:t.id,projectId:s,isStarred:de??!1,isArchived:q??!1,hasUnread:I??!1,provider:t.provider,onToggleStar:le,onToggleArchive:ue,onToggleRead:oe,onRename:he,onClone:xe=>{S(`/projects/${s}/sessions/${xe}`)},useEllipsisIcon:!0,useFixedPositioning:!0,className:"session-list-item__menu"})]})}function Sd({showIcon:t=!0,className:s=""}){return l.jsxs("span",{className:`yep-anywhere-logo ${s}`,children:[t&&l.jsxs("svg",{viewBox:"0 0 120 120",className:"yep-anywhere-logo-icon","aria-hidden":"true",children:[l.jsx("defs",{children:l.jsxs("linearGradient",{id:"yepIconGrad",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[l.jsx("stop",{offset:"0%",stopColor:"var(--app-yep-green)"}),l.jsx("stop",{offset:"100%",stopColor:"var(--app-yep-green-dark)"})]})}),l.jsx("rect",{x:"0",y:"0",width:"120",height:"120",rx:"26",fill:"url(#yepIconGrad)"}),l.jsx("path",{d:"M 28 35 L 50 62 L 92 20",fill:"none",stroke:"#ffffff",strokeWidth:"10",strokeLinecap:"round",strokeLinejoin:"round"}),l.jsx("path",{d:"M 50 62 L 50 95",fill:"none",stroke:"#ffffff",strokeWidth:"10",strokeLinecap:"round"})]}),l.jsxs("span",{className:"yep-anywhere-logo-text",children:[l.jsx("span",{className:"yep-anywhere-logo-yep",children:"yep"}),l.jsx("span",{className:"yep-anywhere-logo-anywhere",children:"anywhere"})]})]})}const fT=15,Qu=12,mi=10;function Wu(t){return{id:t.id,projectId:cy(t.projectId),title:t.title,fullTitle:t.customTitle||t.title,customTitle:t.customTitle,createdAt:t.createdAt,updatedAt:t.updatedAt,messageCount:t.messageCount,provider:t.provider,status:t.status,pendingInputType:t.pendingInputType,processState:t.processState,hasUnread:t.hasUnread,isArchived:t.isArchived,isStarred:t.isStarred}}function zg({isOpen:t,onClose:s,onNavigate:i,currentSessionId:r,isDesktop:c=!1,isCollapsed:u=!1,onToggleExpanded:f,sidebarWidth:p,onResizeStart:g,onResize:v,onResizeEnd:y}){const{sessions:b}=fo({limit:50}),{sessions:S}=fo({starred:!0,limit:100}),w=Qv(),{recentProjects:_}=_1(),N=m.useRef(null),j=m.useRef(null),R=m.useRef(null),C=m.useRef(!1),[z,H]=m.useState(0),[T,O]=m.useState(!1),D=m.useRef(null),F=m.useRef(null),[ne,ce]=m.useState(Qu),[de,q]=m.useState(Qu),[Q,le]=m.useState(Qu),ue=X=>{var ae,fe;j.current=((ae=X.touches[0])==null?void 0:ae.clientX)??null,R.current=((fe=X.touches[0])==null?void 0:fe.clientY)??null,C.current=!1,H(0)},k=X=>{var Ae,be;if(j.current===null||R.current===null)return;const ae=(Ae=X.touches[0])==null?void 0:Ae.clientX,fe=(be=X.touches[0])==null?void 0:be.clientY;if(ae===void 0||fe===void 0)return;const ie=ae-j.current,ve=fe-R.current;if(!C.current){const xe=Math.abs(ie),Ce=Math.abs(ve);if(xe>fT&&xe>Ce&&ie<0)C.current=!0;else return}ie<0&&H(ie)},U=()=>{C.current&&z<-50&&s(),j.current=null,R.current=null,C.current=!1,H(0)},I=X=>{!c||u||!p||(X.preventDefault(),D.current=X.clientX,F.current=p,O(!0),g==null||g())};m.useEffect(()=>{if(!T)return;const X=fe=>{if(D.current===null||F.current===null)return;const ie=fe.clientX-D.current,ve=F.current+ie;v==null||v(ve)},ae=()=>{D.current=null,F.current=null,O(!1),y==null||y()};return document.addEventListener("mousemove",X),document.addEventListener("mouseup",ae),()=>{document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",ae)}},[T,v,y]);const oe=m.useMemo(()=>S.filter(X=>!X.isArchived),[S]),he=m.useMemo(()=>{const X=Date.now()-864e5,ae=fe=>fe.getTime()>=X;return b.filter(fe=>!fe.isStarred&&!fe.isArchived&&ae(new Date(fe.updatedAt)))},[b]),A=m.useMemo(()=>{const X=Date.now()-864e5,ae=fe=>fe.getTime()<X;return b.filter(fe=>!fe.isStarred&&!fe.isArchived&&ae(new Date(fe.updatedAt)))},[b]);if(!c&&!t)return null;const Y=()=>l.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),l.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]});return l.jsxs(l.Fragment,{children:[!c&&l.jsx("div",{className:"sidebar-overlay",onClick:s,onKeyDown:X=>X.key==="Escape"&&s(),role:"button",tabIndex:0,"aria-label":"Close sidebar"}),l.jsxs("aside",{ref:N,className:"sidebar",onTouchStart:c?void 0:ue,onTouchMove:c?void 0:k,onTouchEnd:c?void 0:U,style:!c&&z<0?{transform:`translateX(${z}px)`,transition:"none"}:void 0,children:[l.jsx("div",{className:"sidebar-header",children:c&&u?l.jsx("button",{type:"button",className:"sidebar-toggle",onClick:f,title:"Expand sidebar","aria-label":"Expand sidebar",children:l.jsx(Y,{})}):c?l.jsx("span",{className:"sidebar-brand",children:l.jsx(Sd,{})}):l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"sidebar-brand",children:l.jsx(Sd,{})}),l.jsx("button",{type:"button",className:"sidebar-close",onClick:s,"aria-label":"Close sidebar",children:l.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),l.jsx("div",{className:"sidebar-actions",children:_[0]&&l.jsx(ta,{to:`/new-session?projectId=${encodeURIComponent(_[0].id)}`,icon:ea.newSession,label:"New Session",onClick:i})}),l.jsxs("div",{className:"sidebar-sessions",children:[l.jsxs(tT,{children:[l.jsx(ta,{to:"/inbox",icon:ea.inbox,label:"Inbox",badge:w,onClick:i}),l.jsx(ta,{to:"/sessions",icon:ea.allSessions,label:"All Sessions",onClick:i}),l.jsx(ta,{to:"/recents",icon:ea.recents,label:"Recents",onClick:i}),l.jsx(ta,{to:"/projects",icon:ea.projects,label:"Projects",onClick:i}),l.jsx(nT,{onClick:i}),l.jsx(ta,{to:"/tasks",icon:ea.tasks,label:"Tasks",onClick:i}),l.jsx(ta,{to:"/settings",icon:ea.settings,label:"Settings",onClick:i})]}),oe.length>0&&l.jsxs("div",{className:"sidebar-section",children:[l.jsx("h3",{className:"sidebar-section-title",children:"Starred"}),l.jsx("ul",{className:"sidebar-session-list",children:oe.slice(0,Q).map(X=>l.jsx(oo,{session:Wu(X),projectId:X.projectId,mode:"compact",isCurrent:X.id===r,processState:X.processState,onNavigate:i,showProjectName:!0,projectName:X.projectName},X.id))}),oe.length>Q&&l.jsxs("button",{type:"button",className:"sidebar-show-more",onClick:()=>le(X=>X+mi),children:["Show"," ",Math.min(mi,oe.length-Q)," ","more"]})]}),he.length>0&&l.jsxs("div",{className:"sidebar-section",children:[l.jsx("h3",{className:"sidebar-section-title",children:"Last 24 Hours"}),l.jsx("ul",{className:"sidebar-session-list",children:he.slice(0,ne).map(X=>l.jsx(oo,{session:Wu(X),projectId:X.projectId,mode:"compact",isCurrent:X.id===r,processState:X.processState,onNavigate:i,showProjectName:!0,projectName:X.projectName},X.id))}),he.length>ne&&l.jsxs("button",{type:"button",className:"sidebar-show-more",onClick:()=>ce(X=>X+mi),children:["Show"," ",Math.min(mi,he.length-ne)," ","more"]})]}),A.length>0&&l.jsxs("div",{className:"sidebar-section",children:[l.jsx("h3",{className:"sidebar-section-title",children:"Older"}),l.jsx("ul",{className:"sidebar-session-list",children:A.slice(0,de).map(X=>l.jsx(oo,{session:Wu(X),projectId:X.projectId,mode:"compact",isCurrent:X.id===r,processState:X.processState,onNavigate:i,showProjectName:!0,projectName:X.projectName},X.id))}),A.length>de&&l.jsxs("button",{type:"button",className:"sidebar-show-more",onClick:()=>q(X=>X+mi),children:["Show"," ",Math.min(mi,A.length-de)," ","more"]})]}),oe.length===0&&he.length===0&&A.length===0&&l.jsx("p",{className:"sidebar-empty",children:"No sessions yet"})]}),c&&!u&&l.jsx("div",{className:`sidebar-resize-handle ${T?"active":""}`,onMouseDown:I,role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",tabIndex:0})]})]})}const Og="sidebar-expanded";function hT(){const[t,s]=m.useState(()=>{if(typeof window<"u"){const c=localStorage.getItem(Og);return c===null?!0:c==="true"}return!0}),i=m.useCallback(c=>{s(c),localStorage.setItem(Og,String(c))},[]),r=m.useCallback(()=>{i(!t)},[t,i]);return{isExpanded:t,setIsExpanded:i,toggleExpanded:r}}function mT(){const{sessionId:t}=Td(),[s,i]=m.useState(!1),{isExpanded:r,toggleExpanded:c}=hT(),{width:u,setWidth:f,isResizing:p,setIsResizing:g,canShowDesktop:v,canShowExpanded:y}=jj(),b=Av(),S=v(b),w=!r||!y(b),_={openSidebar:()=>i(!0),isWideScreen:S,isSidebarCollapsed:w,toggleSidebar:c},N=S?{"--sidebar-width":`${u}px`}:void 0;return l.jsxs("div",{className:`session-page ${S?"desktop-layout":""} ${p?"resizing":""}`,style:N,children:[S&&l.jsx("aside",{className:`sidebar-desktop ${w?"sidebar-collapsed":""} ${p?"resizing":""}`,style:{width:w?void 0:u},children:l.jsx(zg,{isOpen:!0,onClose:()=>{},onNavigate:()=>{},currentSessionId:t,isDesktop:!0,isCollapsed:w,onToggleExpanded:c,sidebarWidth:u,onResizeStart:()=>g(!0),onResize:f,onResizeEnd:()=>g(!1)})}),!S&&l.jsx(zg,{isOpen:s,onClose:()=>i(!1),onNavigate:()=>i(!1),currentSessionId:t}),l.jsx(D0,{context:_})]})}function _s(){return x0()}function pT(t){return new Date(t).toLocaleTimeString()}function gT(t){return new Date(t).toLocaleDateString()}function vT(t){switch(t){case"create":return"+";case"modify":return"~";case"delete":return"-"}}function yT(t){switch(t){case"create":return"#4f4";case"modify":return"#ff4";case"delete":return"#f44"}}function bT(t){switch(t){case"create":return"created";case"modify":return"modified";case"delete":return"deleted"}}function Dg(t){switch(t){case"session":return"Session";case"agent-session":return"Agent Session";case"settings":return"Settings";case"credentials":return"Credentials";case"telemetry":return"Telemetry";case"other":return"Other"}}const xT=["session","agent-session","settings","credentials","telemetry","other"];function ST(){const[t,s]=m.useState(""),[i,r]=m.useState(new Set),{events:c,connected:u,paused:f,clearEvents:p,togglePause:g}=_i(),v=m.useRef(null),y=m.useRef(!0);let b=c;if(t){const j=new RegExp(t,"i");b=b.filter(R=>j.test(R.relativePath))}i.size>0&&(b=b.filter(j=>i.has(j.fileType)));const S=[...b].reverse(),w=j=>{r(R=>{const C=new Set(R);return C.has(j)?C.delete(j):C.add(j),C})},_=()=>{const j=v.current;if(!j)return;const R=20;y.current=j.scrollHeight-j.scrollTop-j.clientHeight<R};m.useLayoutEffect(()=>{const j=v.current;j&&y.current&&(j.scrollTop=j.scrollHeight)},[S.length]);const N=S.reduce((j,R)=>{const C=gT(R.timestamp);return j[C]||(j[C]=[]),j[C].push(R),j},{});return l.jsxs("div",{className:"page",style:{maxWidth:"1000px",height:"100vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[l.jsxs("nav",{className:"breadcrumb",children:[l.jsx(gn,{to:"/projects",children:"Projects"})," / Activity"]}),l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("h1",{children:"File Activity"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[l.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:u?"#4f4":"#f44"}}),l.jsx("span",{style:{fontSize:"0.875rem",color:"#888"},children:u?"Connected":"Disconnected"})]})]}),l.jsxs("div",{style:{display:"flex",gap:"1rem",marginBottom:"1rem",flexWrap:"wrap"},children:[l.jsx("input",{type:"text",value:t,onChange:j=>s(j.target.value),placeholder:"Filter by path (regex)...",style:{flex:1,minWidth:"200px",padding:"0.75rem",background:"#2a2a2a",border:"1px solid #444",borderRadius:"8px",color:"inherit",fontSize:"1rem"}}),l.jsx("button",{type:"button",onClick:g,style:{background:f?"#a44":"#444"},children:f?"Resume":"Pause"}),l.jsx("button",{type:"button",onClick:p,style:{background:"#444"},children:"Clear"})]}),l.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginBottom:"1rem",flexWrap:"wrap"},children:[xT.map(j=>l.jsx("button",{type:"button",onClick:()=>w(j),style:{padding:"0.5rem 0.75rem",fontSize:"0.875rem",background:i.has(j)?"#4a4aff":"#333",border:i.has(j)?"1px solid #5a5aff":"1px solid #444"},children:Dg(j)},j)),i.size>0&&l.jsx("button",{type:"button",onClick:()=>r(new Set),style:{padding:"0.5rem 0.75rem",fontSize:"0.875rem",background:"#444"},children:"Clear filters"})]}),l.jsxs("div",{style:{display:"flex",gap:"2rem",marginBottom:"1rem",fontSize:"0.875rem",color:"#888"},children:[l.jsxs("span",{children:["Total: ",c.length," events"]}),l.jsxs("span",{children:["Showing: ",S.length]})]}),l.jsx("div",{ref:v,onScroll:_,style:{flex:1,overflow:"auto",minHeight:0,background:"#1a1a1a",borderRadius:"8px",padding:"1rem"},children:Object.entries(N).length===0?l.jsx("div",{style:{textAlign:"center",padding:"3rem",color:"#888"},children:c.length===0?"Waiting for file changes...":"No events match current filters"}):Object.entries(N).map(([j,R])=>l.jsxs("div",{style:{marginBottom:"1.5rem"},children:[l.jsx("h3",{style:{color:"#888",fontSize:"0.875rem",marginBottom:"0.5rem"},children:j}),l.jsx("div",{style:{background:"#2a2a2a",borderRadius:"8px",overflow:"hidden"},children:R.map((C,z)=>l.jsxs("div",{style:{padding:"0.75rem 1rem",borderBottom:z<R.length-1?"1px solid #333":"none",display:"grid",gridTemplateColumns:"80px 24px 100px 1fr",gap:"0.75rem",alignItems:"center",fontFamily:"monospace",fontSize:"0.875rem"},children:[l.jsx("span",{style:{color:"#666"},children:pT(C.timestamp)}),l.jsx("span",{style:{color:yT(C.changeType),fontWeight:"bold",textAlign:"center"},title:bT(C.changeType),children:vT(C.changeType)}),l.jsx("span",{style:{color:"#888",fontSize:"0.75rem",background:"#333",padding:"0.25rem 0.5rem",borderRadius:"4px",textAlign:"center"},children:Dg(C.fileType)}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:C.path,children:C.relativePath})]},`${C.timestamp}-${C.path}-${z}`))})]},j))})]})}function jT(t,s=60){return t.length>s?`${t.slice(0,s)}…`:t}const NT=()=>l.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),l.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]});function Es({title:t,titleElement:s,onOpenSidebar:i,onToggleSidebar:r,isWideScreen:c=!1,isSidebarCollapsed:u=!1}){const f=c?u?void 0:r:i,p=c?"Toggle sidebar":"Open sidebar";return l.jsx("header",{className:"session-header",children:l.jsx("div",{className:"session-header-inner",children:l.jsxs("div",{className:"session-header-left",children:[f&&l.jsx("button",{type:"button",className:"sidebar-toggle",onClick:f,title:p,"aria-label":p,children:l.jsx(NT,{})}),s??l.jsx("span",{className:"session-title",title:t.length>60?t:void 0,children:jT(t)})]})})})}const wT=3e4;function ET(){const[t,s]=m.useState([]),[i,r]=m.useState([]),[c,u]=m.useState(!0),[f,p]=m.useState(null),g=m.useRef(null),v=m.useCallback(async()=>{try{const b=await Ue("/processes?includeTerminated=true");s(b.processes),r(b.terminatedProcesses??[]),p(null)}catch(b){p(b instanceof Error?b:new Error(String(b)))}finally{u(!1)}},[]);m.useEffect(()=>{v()},[v]),m.useEffect(()=>(g.current=setInterval(v,wT),()=>{g.current&&clearInterval(g.current)}),[v]);const y=t.filter(b=>b.state==="running"||b.state==="waiting-input").length;return{processes:t,terminatedProcesses:i,loading:c,error:f,activeCount:y,refetch:v}}function _T(t){const s=new Date(t).getTime(),r=Date.now()-s,c=Math.floor(r/1e3),u=Math.floor(c/60),f=Math.floor(u/60),p=Math.floor(f/24);return p>0?`${p}d ${f%24}h`:f>0?`${f}h ${u%60}m`:u>0?`${u}m ${c%60}s`:`${c}s`}function kT(t){switch(t){case"running":return"Running";case"waiting-input":return"Needs Input";case"idle":return"Idle";case"terminated":return"Stopped";default:return t}}function TT(t){switch(t){case"running":return"agent-state-running";case"waiting-input":return"agent-state-input";case"idle":return"agent-state-idle";case"terminated":return"agent-state-terminated";default:return""}}function CT(t){switch(t){case"claude":return"Claude";case"codex":return"Codex";case"gemini":return"Gemini";case"local":return"Local";default:return t??"Claude"}}function RT(t){switch(t){case"codex":return"agent-provider-codex";case"gemini":return"agent-provider-gemini";case"local":return"agent-provider-local";default:return"agent-provider-claude"}}function Ju({process:t,isTerminated:s=!1}){const i=t.projectPath.split("/").pop()??t.projectPath;return l.jsxs("div",{className:`agent-card ${s?"agent-card-terminated":""}`,children:[l.jsxs("div",{className:"agent-card-header",children:[l.jsxs("div",{className:"agent-card-title",children:[l.jsx("span",{className:"agent-card-session-title",children:t.sessionTitle||"Untitled Session"}),l.jsx("span",{className:`agent-provider-badge ${RT(t.provider)}`,children:CT(t.provider)}),t.state==="running"?l.jsx(Ra,{variant:"pill",label:"Running"}):l.jsx("span",{className:`agent-state-badge ${TT(t.state)}`,children:kT(t.state)})]}),l.jsxs("div",{className:"agent-card-meta",children:[l.jsx("span",{className:"agent-card-project",children:i}),!s&&l.jsx("span",{className:"agent-card-uptime",children:_T(t.startedAt)})]})]}),l.jsxs("div",{className:"agent-card-details",children:[l.jsxs("div",{className:"agent-detail-row",children:[l.jsx("span",{className:"agent-detail-label",children:"Session ID"}),l.jsx("span",{className:"agent-detail-value agent-detail-mono",children:t.sessionId})]}),l.jsxs("div",{className:"agent-detail-row",children:[l.jsx("span",{className:"agent-detail-label",children:"Project Path"}),l.jsx("span",{className:"agent-detail-value agent-detail-mono",children:t.projectPath})]}),t.permissionMode&&l.jsxs("div",{className:"agent-detail-row",children:[l.jsx("span",{className:"agent-detail-label",children:"Permission Mode"}),l.jsx("span",{className:"agent-detail-value",children:t.permissionMode})]}),t.queueDepth>0&&l.jsxs("div",{className:"agent-detail-row",children:[l.jsx("span",{className:"agent-detail-label",children:"Messages Queued"}),l.jsx("span",{className:"agent-detail-value",children:t.queueDepth})]}),t.terminationReason&&l.jsxs("div",{className:"agent-detail-row",children:[l.jsx("span",{className:"agent-detail-label",children:"Stop Reason"}),l.jsx("span",{className:"agent-detail-value",children:t.terminationReason})]}),l.jsx("div",{className:"agent-card-actions",children:l.jsxs(gn,{to:`/projects/${t.projectId}/sessions/${t.sessionId}`,className:"agent-view-session-link",children:[t.sessionTitle||"View Session"," →"]})})]})]})}function AT(){const{processes:t,terminatedProcesses:s,loading:i,error:r}=ET(),{openSidebar:c,isWideScreen:u}=_s(),f=t.filter(g=>g.state==="running"||g.state==="waiting-input"),p=t.filter(g=>g.state==="idle");return l.jsx("div",{className:u?"main-content-wrapper":"main-content-mobile",children:l.jsxs("div",{className:u?"main-content-constrained":"main-content-mobile-inner",children:[l.jsx(Es,{title:"Agents",onOpenSidebar:c}),l.jsx("main",{className:"page-scroll-container",children:l.jsxs("div",{className:"page-content-inner",children:[i&&l.jsx("p",{className:"loading",children:"Loading agents..."}),r&&l.jsxs("p",{className:"error",children:["Error loading agents: ",r.message]}),!i&&!r&&l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"agents-section",children:[l.jsx("h2",{children:"Active"}),f.length===0?l.jsx("p",{className:"agents-empty",children:"No active agents"}):l.jsx("div",{className:"agents-list",children:f.map(g=>l.jsx(Ju,{process:g},g.id))})]}),l.jsxs("section",{className:"agents-section",children:[l.jsx("h2",{children:"Idle"}),p.length===0?l.jsx("p",{className:"agents-empty",children:"No idle agents"}):l.jsx("div",{className:"agents-list",children:p.map(g=>l.jsx(Ju,{process:g},g.id))})]}),l.jsxs("section",{className:"agents-section",children:[l.jsx("h2",{children:"Stopped"}),s.length===0?l.jsx("p",{className:"agents-empty",children:"No stopped agents"}):l.jsx("div",{className:"agents-list",children:s.map(g=>l.jsx(Ju,{process:g,isTerminated:!0},g.id))})]})]})]})})]})})}function MT(t){const[s,i]=m.useState([]),[r,c]=m.useState(null),[u,f]=m.useState(!1),[p,g]=m.useState(null),v=m.useRef(null),y=m.useCallback(async()=>{if(!t){i([]),c(null),f(!1);return}f(!0),g(null);try{const b=await Ne.getBeadsList(t);i(b.issues),c({installed:b.status.installed,initialized:b.status.initialized})}catch(b){g(b instanceof Error?b:new Error(String(b)))}finally{f(!1)}},[t]);return m.useEffect(()=>{t!==v.current&&(v.current=t??null,y())},[t,y]),{issues:s,status:r,loading:u,error:p,refetch:y}}const ed="beads-selected-project";function zT(t){return`P${t}`}function OT(t){switch(t){case 1:return"beads-priority-1";case 2:return"beads-priority-2";case 3:return"beads-priority-3";default:return"beads-priority-4"}}function DT(t){switch(t){case"open":return"beads-status-open";case"in_progress":return"beads-status-progress";case"closed":return"beads-status-closed";default:return""}}function LT(t){const s=new Date(t),r=Date.now()-s.getTime(),c=Math.floor(r/6e4),u=Math.floor(c/60),f=Math.floor(u/24);return f>0?`${f}d ago`:u>0?`${u}h ago`:c>0?`${c}m ago`:"just now"}function td({issue:t}){return l.jsxs("div",{className:"beads-card",children:[l.jsxs("div",{className:"beads-card-header",children:[l.jsx("span",{className:"beads-card-id",children:t.id}),l.jsx("span",{className:`beads-priority-badge ${OT(t.priority)}`,children:zT(t.priority)}),l.jsx("span",{className:`beads-status-badge ${DT(t.status)}`,children:t.status}),l.jsx("span",{className:"beads-type-badge",children:t.issue_type})]}),l.jsx("h3",{className:"beads-card-title",children:t.title}),l.jsxs("div",{className:"beads-card-meta",children:[l.jsxs("span",{children:["Updated ",LT(t.updated_at)]}),t.dependency_count!==void 0&&t.dependency_count>0&&l.jsxs("span",{className:"beads-deps",children:[t.dependency_count," dep",t.dependency_count!==1?"s":""]})]}),t.description&&l.jsx("div",{className:"beads-card-description",children:l.jsx("pre",{children:t.description})})]})}function UT({projects:t,selectedId:s,onSelect:i}){return l.jsxs("select",{className:"beads-project-selector",value:s??"",onChange:r=>i(r.target.value),children:[l.jsx("option",{value:"",disabled:!0,children:"Select a project..."}),t.map(r=>l.jsx("option",{value:r.id,children:r.name},r.id))]})}function $T(){const{openSidebar:t,isWideScreen:s}=_s(),{projects:i,loading:r}=ki(),[c,u]=m.useState(()=>{try{return localStorage.getItem(ed)}catch{return null}});m.useEffect(()=>{if(!c&&i.length>0&&i[0]){u(i[0].id);try{localStorage.setItem(ed,i[0].id)}catch{}}},[i,c]);const f=w=>{u(w);try{localStorage.setItem(ed,w)}catch{}},{issues:p,status:g,loading:v,error:y,refetch:b}=MT(c),S=i.find(w=>w.id===c);return l.jsx("div",{className:s?"main-content-wrapper":"main-content-mobile",children:l.jsxs("div",{className:s?"main-content-constrained":"main-content-mobile-inner",children:[l.jsx(Es,{title:"Tasks",onOpenSidebar:t}),l.jsx("main",{className:"page-scroll-container",children:l.jsxs("div",{className:"page-content-inner",children:[l.jsxs("div",{className:"beads-toolbar",children:[l.jsx(UT,{projects:i,selectedId:c,onSelect:f}),l.jsxs("button",{type:"button",className:"beads-refresh-btn",onClick:b,title:"Refresh tasks",disabled:!c,children:[l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("polyline",{points:"23 4 23 10 17 10"}),l.jsx("polyline",{points:"1 20 1 14 7 14"}),l.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]}),"Refresh"]})]}),r&&l.jsx("p",{className:"loading",children:"Loading projects..."}),!r&&i.length===0&&l.jsxs("div",{className:"beads-empty-state",children:[l.jsx("p",{children:"No projects found."}),l.jsx("p",{children:"Add a project first to view its tasks."})]}),!r&&!c&&i.length>0&&l.jsx("div",{className:"beads-empty-state",children:l.jsx("p",{children:"Select a project to view its tasks."})}),c&&v&&l.jsx("p",{className:"loading",children:"Loading tasks..."}),c&&y&&l.jsxs("p",{className:"error",children:["Error loading tasks: ",y.message]}),c&&!v&&!y&&g&&(g.initialized?l.jsx(BT,{issues:p}):l.jsxs("div",{className:"beads-not-initialized",children:[l.jsx("h2",{children:"Beads not initialized"}),g.installed?l.jsxs("p",{children:["Beads is installed but not initialized for"," ",l.jsx("strong",{children:S==null?void 0:S.name}),".",l.jsx("br",{}),"Run ",l.jsx("code",{children:"bd init"})," in the project directory to get started."]}):l.jsxs("p",{children:["Beads is not installed.",l.jsx("br",{}),"Visit"," ",l.jsx("a",{href:"https://github.com/steveyegge/beads",target:"_blank",rel:"noopener noreferrer",children:"github.com/steveyegge/beads"})," ","to install it."]})]}))]})})]})})}function BT({issues:t}){const s=t.filter(c=>c.status==="open"),i=t.filter(c=>c.status==="in_progress"),r=t.filter(c=>c.status==="closed");return l.jsxs(l.Fragment,{children:[i.length>0&&l.jsxs("section",{className:"beads-section",children:[l.jsxs("h2",{children:["In Progress (",i.length,")"]}),l.jsx("div",{className:"beads-list",children:i.map(c=>l.jsx(td,{issue:c},c.id))})]}),l.jsxs("section",{className:"beads-section",children:[l.jsxs("h2",{children:["Open (",s.length,")"]}),s.length===0?l.jsx("p",{className:"beads-empty",children:"No open tasks"}):l.jsx("div",{className:"beads-list",children:s.map(c=>l.jsx(td,{issue:c},c.id))})]}),r.length>0&&l.jsxs("section",{className:"beads-section",children:[l.jsxs("h2",{children:["Closed (",r.length,")"]}),l.jsx("div",{className:"beads-list",children:r.map(c=>l.jsx(td,{issue:c},c.id))})]}),t.length===0&&l.jsxs("div",{className:"beads-empty-state",children:[l.jsx("p",{children:"No tasks yet."}),l.jsxs("p",{children:["Create one with ",l.jsx("code",{children:'bd create "Task title"'})]})]})]})}function Lg(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function IT(t){var r;const s=((r=t.split(".").pop())==null?void 0:r.toLowerCase())||"";return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",swift:"swift",php:"php",sql:"sql",sh:"bash",bash:"bash",zsh:"bash",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",html:"html",css:"css",scss:"scss",md:"markdown",markdown:"markdown"}[s]||"plaintext"}function HT(t){var i;const s=((i=t.split(".").pop())==null?void 0:i.toLowerCase())||"";return s==="md"||s==="markdown"}function ZT(t){return t.startsWith("image/")}function qT(t){return t.split("/").pop()||t}const PT=m.memo(function({projectId:s,filePath:i,onClose:r,standalone:c=!1,lineNumber:u,lineEnd:f}){const[p,g]=m.useState(null),[v,y]=m.useState(!0),[b,S]=m.useState(null),[w,_]=m.useState(!1),[N,j]=m.useState(!0),[R,C]=m.useState(!1),[z,H]=m.useState(null);m.useEffect(()=>{let I=!1;return y(!0),S(null),Ne.getFile(s,i,!0).then(oe=>{I||(g(oe),y(!1))}).catch(oe=>{I||(S(oe.message||"Failed to load file"),y(!1))}),()=>{I=!0}},[s,i]),m.useEffect(()=>{if(!R)return;const I=oe=>{oe.key==="Escape"&&C(!1)};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[R]),m.useEffect(()=>{z&&requestAnimationFrame(()=>{z.scrollIntoView({behavior:"smooth",block:"center"})})},[z]);const T=m.useCallback(async()=>{if(p!=null&&p.content)try{await navigator.clipboard.writeText(p.content),_(!0),setTimeout(()=>_(!1),2e3)}catch(I){console.error("Failed to copy:",I)}},[p==null?void 0:p.content]),O=m.useCallback(()=>{const I=Ne.getFileRawUrl(s,i,!0);window.open(I,"_blank")},[s,i]),D=m.useCallback(()=>{const I=`/projects/${s}/file?path=${encodeURIComponent(i)}`;window.open(I,"_blank")},[s,i]),F=qT(i),ne=IT(i),ce=HT(i);if(v)return l.jsx("div",{className:"file-viewer",children:l.jsxs("div",{className:"file-viewer-loading",children:["Loading ",F,"..."]})});if(b||!p)return l.jsx("div",{className:"file-viewer",children:l.jsx("div",{className:"file-viewer-error",children:b||"File not found"})});const{metadata:de,content:q,rawUrl:Q}=p,le=ZT(de.mimeType),ue=()=>{if(le)return l.jsx("div",{className:"file-viewer-image",children:l.jsx("img",{src:Q,alt:F})});if(q!==void 0){if(p.highlightedHtml)return l.jsxs("div",{className:"file-viewer-code file-viewer-code-highlighted","data-language":p.highlightedLanguage??ne,children:[l.jsx("div",{className:"shiki-container",dangerouslySetInnerHTML:{__html:p.highlightedHtml}}),p.highlightedTruncated&&l.jsx("div",{className:"file-viewer-truncated",children:"File truncated for highlighting (showing first 2000 lines)"})]});const I=q.split(`
99
+ `),oe=u??0,he=f??oe;return l.jsx("div",{className:"file-viewer-code","data-language":ne,children:l.jsxs("div",{className:"code-highlighter-plain",children:[l.jsx("div",{className:"code-line-numbers",children:I.map((A,Y)=>l.jsx("div",{children:Y+1},`ln-${Y+1}`))}),l.jsx("pre",{className:"code-content",children:l.jsx("code",{children:I.map((A,Y)=>{const X=Y+1,ae=u&&X>=oe&&X<=he;return l.jsx("div",{ref:u&&X===oe?fe=>H(fe):void 0,className:ae?"highlighted-line":void 0,style:ae?{backgroundColor:"rgba(255, 255, 0, 0.15)",marginLeft:"-0.75rem",marginRight:"-0.75rem",paddingLeft:"0.75rem",paddingRight:"0.75rem"}:void 0,children:A||" "},`line-${Y+1}`)})})})]})})}return l.jsxs("div",{className:"file-viewer-binary",children:[l.jsx("p",{children:"This file cannot be displayed inline."}),l.jsxs("p",{children:[l.jsx("strong",{children:"Type:"})," ",de.mimeType]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Size:"})," ",Lg(de.size)]}),l.jsx("button",{type:"button",className:"file-viewer-download-btn",onClick:O,children:"Download File"})]})},k=l.jsxs("div",{className:"file-viewer-header",children:[l.jsxs("div",{className:"file-viewer-info",children:[l.jsx("span",{className:"file-viewer-path",title:i,children:i}),l.jsxs("span",{className:"file-viewer-meta",children:[Lg(de.size),de.isText&&q&&` • ${q.split(`
100
+ `).length} lines`]})]}),l.jsxs("div",{className:"file-viewer-actions",children:[ce&&q&&l.jsx("button",{type:"button",className:"file-viewer-action",onClick:()=>j(!N),title:N?"View raw":"Render markdown",children:N?l.jsx(KT,{}):l.jsx(QT,{})}),q&&l.jsx("button",{type:"button",className:`file-viewer-action ${w?"copied":""}`,onClick:T,title:w?"Copied!":"Copy content",children:w?l.jsx(GT,{}):l.jsx(VT,{})}),!c&&l.jsx("button",{type:"button",className:"file-viewer-action",onClick:D,title:"Open in new tab",children:l.jsx(YT,{})}),l.jsx("button",{type:"button",className:"file-viewer-action",onClick:O,title:"Download",children:l.jsx(FT,{})}),l.jsx("button",{type:"button",className:"file-viewer-action",onClick:()=>C(!R),title:R?"Exit fullscreen":"Fullscreen",children:R?l.jsx(JT,{}):l.jsx(WT,{})}),r&&l.jsx("button",{type:"button",className:"file-viewer-action file-viewer-close",onClick:r,title:"Close",children:l.jsx(XT,{})})]})]}),U=["file-viewer",c&&"file-viewer-standalone",R&&"file-viewer-fullscreen"].filter(Boolean).join(" ");return l.jsxs("div",{className:U,children:[k,l.jsx("div",{className:"file-viewer-body",children:ue()})]})});function VT(){return l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),l.jsx("path",{d:"M11 5V3.5A1.5 1.5 0 0 0 9.5 2H3.5A1.5 1.5 0 0 0 2 3.5v6A1.5 1.5 0 0 0 3.5 11H5"})]})}function GT(){return l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"M3 8.5L6.5 12L13 4"})})}function FT(){return l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"M8 2v9M4 8l4 4 4-4M2 14h12"})})}function YT(){return l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"M12 9v4a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h4M9 2h5v5M6 10l8-8"})})}function XT(){return l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function KT(){return l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"M5 4L1 8l4 4M11 4l4 4-4 4"})})}function QT(){return l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("rect",{x:"1",y:"3",width:"14",height:"10",rx:"1"}),l.jsx("path",{d:"M4 6v4l2-2 2 2V6M10 10V6l2 3 2-3v4"})]})}function WT(){return l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"M2 5V2h3M11 2h3v3M14 11v3h-3M5 14H2v-3"})})}function JT(){return l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"M5 2v3H2M14 5h-3V2M11 14v-3h3M2 11h3v3"})})}function eC(){const{projectId:t}=Td(),[s]=yo(),i=s.get("path");return t?i?l.jsxs("div",{className:"file-page",children:[l.jsx("div",{className:"file-page-nav",children:l.jsxs(gn,{to:`/projects/${t}`,className:"file-page-back-link",title:"Back to project",children:[l.jsx(tC,{}),l.jsx("span",{children:"Back to project"})]})}),l.jsx("div",{className:"file-page-content",children:l.jsx(PT,{projectId:t,filePath:i,standalone:!0})})]}):l.jsx("div",{className:"file-page file-page-error",children:l.jsxs("div",{className:"file-page-error-content",children:[l.jsx("h1",{children:"Invalid URL"}),l.jsx("p",{children:"File path is missing from the URL."}),l.jsx(gn,{to:`/projects/${t}`,className:"file-page-back-link",children:"Go to Project"})]})}):l.jsx("div",{className:"file-page file-page-error",children:l.jsxs("div",{className:"file-page-error-content",children:[l.jsx("h1",{children:"Invalid URL"}),l.jsx("p",{children:"Project ID is missing from the URL."}),l.jsx(gn,{to:"/projects",className:"file-page-back-link",children:"Go to Projects"})]})})}function tC(){return l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"M10 12L6 8l4-4"})})}function nC({selectedCount:t,onArchive:s,onUnarchive:i,onStar:r,onUnstar:c,onMarkRead:u,onMarkUnread:f,onClearSelection:p,isPending:g=!1,canArchive:v=!0,canUnarchive:y=!0,canStar:b=!0,canUnstar:S=!0,canMarkRead:w=!0,canMarkUnread:_=!0}){return t===0?null:l.jsxs("div",{className:"bulk-action-bar",children:[l.jsxs("div",{className:"bulk-action-bar__info",children:[l.jsxs("span",{className:"bulk-action-bar__count",children:[t," selected"]}),l.jsx("button",{type:"button",className:"bulk-action-bar__clear",onClick:p,disabled:g,"aria-label":"Clear selection",children:l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),l.jsxs("div",{className:"bulk-action-bar__actions",children:[v&&l.jsxs("button",{type:"button",className:"bulk-action-button",onClick:s,disabled:g,title:"Archive selected",children:[l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("polyline",{points:"21 8 21 21 3 21 3 8"}),l.jsx("rect",{x:"1",y:"3",width:"22",height:"5"}),l.jsx("line",{x1:"10",y1:"12",x2:"14",y2:"12"})]}),l.jsx("span",{children:"Archive"})]}),y&&l.jsxs("button",{type:"button",className:"bulk-action-button",onClick:i,disabled:g,title:"Unarchive selected",children:[l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("polyline",{points:"21 8 21 21 3 21 3 8"}),l.jsx("rect",{x:"1",y:"3",width:"22",height:"5"}),l.jsx("polyline",{points:"12 11 12 17"}),l.jsx("polyline",{points:"9 14 12 11 15 14"})]}),l.jsx("span",{children:"Unarchive"})]}),b&&l.jsxs("button",{type:"button",className:"bulk-action-button",onClick:r,disabled:g,title:"Star selected",children:[l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})}),l.jsx("span",{children:"Star"})]}),S&&l.jsxs("button",{type:"button",className:"bulk-action-button",onClick:c,disabled:g,title:"Unstar selected",children:[l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"}),l.jsx("line",{x1:"4",y1:"4",x2:"20",y2:"20"})]}),l.jsx("span",{children:"Unstar"})]}),w&&l.jsxs("button",{type:"button",className:"bulk-action-button",onClick:u,disabled:g,title:"Mark as read",children:[l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),l.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),l.jsx("span",{children:"Mark read"})]}),_&&l.jsxs("button",{type:"button",className:"bulk-action-button",onClick:f,disabled:g,title:"Mark as unread",children:[l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("circle",{cx:"12",cy:"12",r:"4",fill:"currentColor"})]}),l.jsx("span",{children:"Mark unread"})]})]})]})}const Ug=769;function kl({label:t,options:s,selected:i,onChange:r,multiSelect:c=!0,placeholder:u}){const[f,p]=m.useState(!1),[g,v]=m.useState(()=>window.innerWidth>=Ug),y=m.useRef(null),b=m.useRef(null),S=()=>{var T;(T=y.current)==null||T.blur(),p(!0)},w=T=>{c?i.includes(T)?r(i.filter(O=>O!==T)):r([...i,T]):(r([T]),p(!1))},_=()=>{r([])},N=m.useCallback(()=>{p(!1)},[]);m.useEffect(()=>{const T=()=>{v(window.innerWidth>=Ug)};return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]),m.useEffect(()=>{if(!f)return;const T=O=>{O.key==="Escape"&&(O.preventDefault(),O.stopPropagation(),N())};return document.addEventListener("keydown",T,!0),()=>document.removeEventListener("keydown",T,!0)},[f,N]),m.useEffect(()=>{if(!f||!g)return;const T=O=>{b.current&&!b.current.contains(O.target)&&y.current&&!y.current.contains(O.target)&&N()};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[f,g,N]),m.useEffect(()=>{if(f&&!g)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[f,g]),m.useEffect(()=>{var T;f&&((T=b.current)==null||T.focus())},[f]);const j=T=>{T.target===T.currentTarget&&(T.preventDefault(),T.stopPropagation(),N())},R=(()=>{if(i.length===0)return u||t;if(!c&&i.length===1){const T=s.find(O=>O.value===i[0]);return(T==null?void 0:T.label)||t}return`${t} (${i.length})`})(),C=l.jsxs(l.Fragment,{children:[c&&i.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"filter-dropdown-option filter-dropdown-clear",onClick:_,children:l.jsx("span",{className:"filter-dropdown-label",children:"Clear all"})}),l.jsx("div",{className:"filter-dropdown-divider"})]}),s.map(T=>{const O=i.includes(T.value);return l.jsxs("button",{type:"button",className:`filter-dropdown-option ${O?"selected":""} ${c?"":"single-select"}`,onClick:()=>w(T.value),"aria-pressed":O,children:[c&&l.jsx("span",{className:`filter-dropdown-checkbox ${O?"checked":""}`,"aria-hidden":"true",children:O&&l.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})})}),T.color&&l.jsx("span",{className:"filter-dropdown-color-dot",style:{backgroundColor:T.color},"aria-hidden":"true"}),l.jsx("span",{className:"filter-dropdown-label",children:T.label}),T.count!==void 0&&l.jsx("span",{className:"filter-dropdown-count",children:T.count})]},T.value)})]}),z=f&&!g?Ei.createPortal(l.jsx("div",{className:"filter-dropdown-overlay",onClick:j,onMouseDown:T=>T.stopPropagation(),children:l.jsxs("div",{ref:b,className:"filter-dropdown-sheet",tabIndex:-1,"aria-label":`Filter by ${t}`,children:[l.jsx("div",{className:"filter-dropdown-header",children:l.jsx("span",{className:"filter-dropdown-title",children:t})}),l.jsx("div",{className:"filter-dropdown-options",children:C})]})}),document.body):null,H=f&&g?l.jsx("div",{ref:b,className:"filter-dropdown-dropdown",tabIndex:-1,"aria-label":`Filter by ${t}`,children:l.jsx("div",{className:"filter-dropdown-options",children:C})}):null;return l.jsxs("div",{className:"filter-dropdown-container",children:[l.jsxs("button",{ref:y,type:"button",className:`filter-dropdown-button ${i.length>0?"has-selection":""}`,onClick:S,title:`Filter by ${t}`,"aria-haspopup":"listbox","aria-expanded":f,children:[R,l.jsx("svg",{className:"filter-dropdown-chevron",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),H,z]})}const sC=500,$g={claude:"var(--app-yep-green)",codex:"#10a37f","codex-oss":"#f97316",gemini:"#4285f4",opencode:"#9333ea"};function aC(){const{openSidebar:t,isWideScreen:s,toggleSidebar:i,isSidebarCollapsed:r}=_s(),[c,u]=yo(),f=c.get("q")||"",p=c.get("project")||void 0,[g,v]=m.useState(f),y=m.useMemo(()=>{const $=c.get("status");return $?$.split(",").filter(me=>["all","unread","starred","archived"].includes(me)):[]},[c]),b=m.useMemo(()=>{const $=c.get("provider");if(!$)return[];const me=Object.keys($g);return $.split(",").filter($e=>me.includes($e))},[c]),S=m.useCallback($=>{u(me=>{const $e=new URLSearchParams(me);return $.length>0?$e.set("status",$.join(",")):$e.delete("status"),$e})},[u]),w=m.useCallback($=>{u(me=>{const $e=new URLSearchParams(me);return $.length>0?$e.set("provider",$.join(",")):$e.delete("provider"),$e})},[u]),_=y.includes("archived"),{sessions:N,stats:j,projects:R,loading:C,error:z,hasMore:H,loadMore:T}=fo({projectId:p,searchQuery:f,includeArchived:_}),O=m.useMemo(()=>N.filter($=>{if(y.length===0){if($.isArchived)return!1}else{let me=!1;for(const $e of y)switch($e){case"all":$.isArchived||(me=!0);break;case"unread":$.hasUnread&&!$.isArchived&&(me=!0);break;case"starred":$.isStarred&&(me=!0);break;case"archived":$.isArchived&&(me=!0);break}if(!me)return!1}return!(b.length>0&&(!$.provider||!b.includes($.provider)))}),[N,y,b]),D=m.useMemo(()=>{const $=!p;return[{value:"all",label:"All",count:$?j.totalCount:void 0},{value:"unread",label:"Unread",count:$?j.unreadCount:void 0},{value:"starred",label:"Starred",count:$?j.starredCount:void 0},{value:"archived",label:"Archived",count:$?j.archivedCount:void 0}]},[j,p]),F=m.useMemo(()=>{const $=!p,me=j.providerCounts,$e=[],Ot=["claude","codex","codex-oss","gemini"];for(const Gt of Ot){const We=me[Gt];We&&We>0&&$e.push({value:Gt,label:Gt.charAt(0).toUpperCase()+Gt.slice(1),count:$?We:void 0,color:$g[Gt]})}return $e},[j.providerCounts,p]),[ne,ce]=m.useState(new Set),[de,q]=m.useState(!1),[Q,le]=m.useState(!1),ue=m.useRef(null),k=m.useRef(null),U=m.useRef(null),I=m.useCallback(($,me)=>{ce($e=>{const Ot=new Set($e);return me?Ot.add($):Ot.delete($),Ot.size===0&&q(!1),Ot})},[]),oe=m.useCallback(()=>{ce(new Set(O.map($=>$.id))),q(!0)},[O]),he=m.useCallback(()=>{ce(new Set),q(!1)},[]),A=m.useCallback(($,me)=>{if(!(de||s)){if("touches"in me){const $e=me.touches[0];$e&&(U.current={x:$e.clientX,y:$e.clientY})}else"clientX"in me&&(U.current={x:me.clientX,y:me.clientY});k.current=$,ue.current=setTimeout(()=>{q(!0),ce(new Set([$])),k.current=null,U.current=null},sC)}},[de,s]),Y=m.useCallback(()=>{ue.current&&(clearTimeout(ue.current),ue.current=null),k.current=null,U.current=null},[]),X=m.useCallback($=>{if(!U.current||!ue.current)return;const me=$.touches[0];if(!me)return;const $e=me.clientX-U.current.x,Ot=me.clientY-U.current.y;Math.sqrt($e*$e+Ot*Ot)>10&&(clearTimeout(ue.current),ue.current=null,k.current=null,U.current=null)},[]),ae=m.useCallback($=>{(ue.current||de)&&$.preventDefault()},[de]),fe=m.useCallback(async()=>{if(!Q){le(!0);try{await Promise.all(Array.from(ne).map($=>Ne.updateSessionMetadata($,{archived:!0}))),he()}finally{le(!1)}}},[ne,Q,he]),ie=m.useCallback(async()=>{if(!Q){le(!0);try{await Promise.all(Array.from(ne).map($=>Ne.updateSessionMetadata($,{archived:!1}))),he()}finally{le(!1)}}},[ne,Q,he]),ve=m.useCallback(async()=>{if(!Q){le(!0);try{await Promise.all(Array.from(ne).map($=>Ne.updateSessionMetadata($,{starred:!0}))),he()}finally{le(!1)}}},[ne,Q,he]),Ae=m.useCallback(async()=>{if(!Q){le(!0);try{await Promise.all(Array.from(ne).map($=>Ne.updateSessionMetadata($,{starred:!1}))),he()}finally{le(!1)}}},[ne,Q,he]),be=m.useCallback(async()=>{if(!Q){le(!0);try{await Promise.all(Array.from(ne).map($=>Ne.markSessionSeen($))),he()}finally{le(!1)}}},[ne,Q,he]),xe=m.useCallback(async()=>{if(!Q){le(!0);try{await Promise.all(Array.from(ne).map($=>Ne.markSessionUnread($))),he()}finally{le(!1)}}},[ne,Q,he]),Ce=m.useMemo(()=>{const $=N.filter(me=>ne.has(me.id));return{canArchive:$.some(me=>!me.isArchived),canUnarchive:$.some(me=>me.isArchived),canStar:$.some(me=>!me.isStarred),canUnstar:$.some(me=>me.isStarred),canMarkRead:$.some(me=>me.hasUnread),canMarkUnread:$.some(me=>!me.hasUnread)}},[N,ne]),zt=$=>{$.preventDefault();const me=new URLSearchParams(c);g.trim()?me.set("q",g.trim()):me.delete("q"),u(me)},Nt=m.useCallback($=>{const me=new URLSearchParams(c);$.length>0&&$[0]?me.set("project",$[0]):me.delete("project"),u(me)},[c,u]),se=m.useMemo(()=>R.map($=>({value:$.id,label:$.name})),[R]),Se=()=>{v(""),u(new URLSearchParams)},Oe=$=>({id:$.id,projectId:cy($.projectId),title:$.title,fullTitle:$.customTitle||$.title,customTitle:$.customTitle,createdAt:$.createdAt,updatedAt:$.updatedAt,messageCount:$.messageCount,provider:$.provider,status:$.status,pendingInputType:$.pendingInputType,processState:$.processState,hasUnread:$.hasUnread,isArchived:$.isArchived,isStarred:$.isStarred}),Ie=O.length===0,ct=f||p||y.length>0||b.length>0;return l.jsx("div",{className:s?"main-content-wrapper":"main-content-mobile",children:l.jsxs("div",{className:s?"main-content-constrained":"main-content-mobile-inner",children:[l.jsx(Es,{title:"All Sessions",onOpenSidebar:t,onToggleSidebar:i,isWideScreen:s,isSidebarCollapsed:r}),l.jsx("main",{className:"page-scroll-container",children:l.jsxs("div",{className:"page-content-inner",children:[l.jsxs("div",{className:"filter-bar",children:[l.jsxs("form",{onSubmit:zt,className:"filter-search-form",children:[l.jsx("input",{type:"text",className:"filter-search",placeholder:"Search sessions...",value:g,onChange:$=>v($.target.value)}),l.jsx("button",{type:"submit",className:"filter-search-button",children:l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("circle",{cx:"11",cy:"11",r:"8"}),l.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})})]}),l.jsxs("div",{className:"filter-dropdowns",children:[se.length>0&&l.jsx(kl,{label:"Project",options:se,selected:p?[p]:[],onChange:Nt,multiSelect:!1,placeholder:"All projects"}),l.jsx(kl,{label:"Status",options:D,selected:y,onChange:S,placeholder:"All statuses"}),F.length>1&&l.jsx(kl,{label:"Provider",options:F,selected:b,onChange:w,placeholder:"All providers"})]}),ct&&l.jsx("button",{type:"button",onClick:Se,className:"filter-clear-button",children:"Clear filters"})]}),C&&N.length===0&&l.jsx("p",{className:"loading",children:"Loading sessions..."}),z&&l.jsxs("p",{className:"error",children:["Error loading sessions: ",z.message]}),!C&&!z&&Ie&&l.jsxs("div",{className:"inbox-empty",children:[l.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),l.jsx("h3",{children:"No sessions found"}),l.jsx("p",{children:ct?"Try adjusting your search or filters.":"Start a new session to get started."})]}),!z&&!Ie&&l.jsxs(l.Fragment,{children:[(s||de)&&O.length>0&&l.jsx("div",{className:"session-list-header",children:l.jsxs("label",{className:"session-list-header__select-all",children:[l.jsx("input",{type:"checkbox",checked:ne.size===O.length&&O.length>0,onChange:$=>$.target.checked?oe():he()}),l.jsx("span",{children:ne.size>0?`${ne.size} selected`:"Select all"})]})}),l.jsx("ul",{className:`sessions-list ${de?"session-list--selection-mode":""}`,children:O.map($=>l.jsx("div",{onTouchStart:me=>A($.id,me),onTouchMove:X,onTouchEnd:Y,onTouchCancel:Y,onMouseDown:me=>!s&&A($.id,me),onMouseUp:Y,onMouseLeave:Y,onContextMenu:ae,children:l.jsx(oo,{session:Oe($),projectId:$.projectId,mode:"card",processState:$.processState,isSelected:ne.has($.id),isSelectionMode:de&&!s,onNavigate:()=>{de&&!s&&I($.id,!ne.has($.id))},onSelect:s||de?I:void 0,showProjectName:!p,projectName:$.projectName})},$.id))}),H&&l.jsx("div",{className:"global-sessions-load-more",children:l.jsx("button",{type:"button",onClick:T,className:"global-sessions-load-more-button",disabled:C,children:C?"Loading...":"Load more"})})]}),l.jsx(nC,{selectedCount:ne.size,onArchive:fe,onUnarchive:ie,onStar:ve,onUnstar:Ae,onMarkRead:be,onMarkUnread:xe,onClearSelection:he,isPending:Q,canArchive:Ce.canArchive,canUnarchive:Ce.canUnarchive,canStar:Ce.canStar,canUnstar:Ce.canUnstar,canMarkRead:Ce.canMarkRead,canMarkUnread:Ce.canMarkUnread})]})})]})})}function iC(t){const s=Date.now(),i=new Date(t).getTime(),r=s-i,c=Math.floor(r/6e4),u=Math.floor(r/36e5),f=Math.floor(r/864e5);return c<1?"just now":c<60?`${c}m ago`:u<24?`${u}h ago`:f<7?`${f}d ago`:new Date(t).toLocaleDateString()}const lC=[{key:"needsAttention",title:"Needs Attention",colorClass:"inbox-tier-attention",getBadge:t=>t.pendingInputType==="tool-approval"?{label:"Approval",className:"inbox-badge-approval"}:t.pendingInputType==="user-question"?{label:"Question",className:"inbox-badge-question"}:null},{key:"active",title:"Active",colorClass:"inbox-tier-active"},{key:"recentActivity",title:"Recent Activity",colorClass:"inbox-tier-recent"},{key:"unread8h",title:"Unread (8h)",colorClass:"inbox-tier-unread8h"},{key:"unread24h",title:"Unread (24h)",colorClass:"inbox-tier-unread24h"}];function rC({config:t,items:s,hideProjectName:i}){const r=s.length===0;return l.jsxs("section",{className:`inbox-section ${t.colorClass} ${r?"inbox-section-empty":""}`,children:[l.jsxs("h2",{className:"inbox-section-header",children:[t.title,l.jsx("span",{className:"inbox-section-count",children:s.length})]}),r?l.jsx("p",{className:"inbox-section-empty-message",children:"No sessions"}):l.jsx("ul",{className:"inbox-list",children:s.map(c=>{var p;const u=(p=t.getBadge)==null?void 0:p.call(t,c),f=c.hasUnread?"unread":void 0;return l.jsx("li",{className:f,children:l.jsxs(gn,{to:`/projects/${c.projectId}/sessions/${c.sessionId}`,children:[l.jsxs("div",{className:"inbox-item-main",children:[l.jsx("span",{className:"inbox-item-title",children:c.sessionTitle??"Untitled"}),u&&l.jsx("span",{className:`inbox-item-badge ${u.className}`,children:u.label}),t.key==="active"&&l.jsx(Ra,{})]}),l.jsxs("div",{className:"inbox-item-meta",children:[!i&&l.jsx("span",{className:"inbox-item-project",children:c.projectName}),l.jsx("span",{className:"inbox-item-time",children:iC(c.updatedAt)})]})]})},c.sessionId)})})]})}function wl(t,s){return s?t.filter(i=>i.projectId===s):t}function oC({projectId:t,projects:s,onProjectChange:i}){const{needsAttention:r,active:c,recentActivity:u,unread8h:f,unread24h:p,loading:g,error:v,refresh:y}=Vv(),b=wl(r,t),S=wl(c,t),w=wl(u,t),_=wl(f,t),N=wl(p,t),j=b.length+S.length+w.length+_.length+N.length,[R,C]=m.useState(!1),z=async()=>{C(!0),await y(),C(!1)},H={needsAttention:b,active:S,recentActivity:w,unread8h:_,unread24h:N},T=j===0&&!g,O=s?[{value:"",label:"All Projects"},...s.map(F=>({value:F.id,label:F.name}))]:[],D=F=>{const ne=F[0]??"";i==null||i(ne===""?void 0:ne)};return l.jsx("main",{className:"page-scroll-container",children:l.jsxs("div",{className:"page-content-inner inbox-content",children:[l.jsxs("div",{className:"inbox-toolbar",children:[s&&s.length>0&&l.jsx(kl,{label:"Project",options:O,selected:[t??""],onChange:D,multiSelect:!1,placeholder:"All Projects"}),l.jsxs("button",{type:"button",className:"inbox-refresh-button",onClick:z,disabled:R||g,title:"Refresh inbox",children:[l.jsxs("svg",{className:R?"spinning":"",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("polyline",{points:"23 4 23 10 17 10"}),l.jsx("polyline",{points:"1 20 1 14 7 14"}),l.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]}),R?"Refreshing...":"Refresh"]})]}),g&&l.jsx("p",{className:"loading",children:"Loading inbox..."}),v&&l.jsxs("p",{className:"error",children:["Error loading inbox: ",v.message]}),!g&&!v&&T&&l.jsxs("div",{className:"inbox-empty",children:[l.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),l.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),l.jsx("h3",{children:"All caught up!"}),l.jsx("p",{children:t?"No sessions need attention in this project.":"No sessions need attention."})]}),!g&&!v&&!T&&l.jsx("div",{className:"inbox-tiers",children:lC.map(F=>l.jsx(rC,{config:F,items:H[F.key]??[],hideProjectName:!!t},F.key))})]})})}function cC(){const{openSidebar:t,isWideScreen:s}=_s(),{projects:i}=ki(),[r,c]=yo(),u=r.get("project")??void 0,f=m.useCallback(g=>{c(g?{project:g}:{})},[c]),p=m.useMemo(()=>{var g;if(u)return(g=i.find(v=>v.id===u))==null?void 0:g.name},[u,i]);return l.jsx("div",{className:s?"main-content-wrapper":"main-content-mobile",children:l.jsxs("div",{className:s?"main-content-constrained":"main-content-mobile-inner",children:[l.jsx(Es,{title:p?`${p} Inbox`:"Inbox",onOpenSidebar:t}),l.jsx(oC,{projectId:u,projects:i,onProjectChange:f})]})})}function uC(){var R;const{isSetupMode:t,login:s,setupAccount:i,isLoading:r,authDisabled:c}=qv(),[u,f]=m.useState(""),[p,g]=m.useState(""),[v,y]=m.useState(null),[b,S]=m.useState(!1),w=Kn(),N=((R=yn().state)==null?void 0:R.from)??"/projects";m.useEffect(()=>{!r&&c&&w("/projects",{replace:!0})},[r,c,w]);const j=async C=>{if(C.preventDefault(),y(null),!u){y("Password is required");return}if(t){if(u.length<8){y("Password must be at least 8 characters");return}if(u!==p){y("Passwords do not match");return}}S(!0);try{t?await i(u):await s(u),w(N,{replace:!0})}catch(z){const H=z instanceof Error?z.message:"Authentication failed";y(H.includes("401")?"Invalid password":H)}finally{S(!1)}};return r?l.jsx("div",{className:"login-page",children:l.jsx("div",{className:"login-container",children:l.jsx("div",{className:"login-loading",children:"Loading..."})})}):l.jsx("div",{className:"login-page",children:l.jsxs("div",{className:"login-container",children:[l.jsx("div",{className:"login-logo",children:l.jsx(Sd,{})}),l.jsx("p",{className:"login-subtitle",children:t?"Create your account to get started":"Enter your password to continue"}),l.jsxs("form",{onSubmit:j,className:"login-form",children:[l.jsxs("div",{className:"login-field",children:[l.jsx("label",{htmlFor:"password",children:"Password"}),l.jsx("input",{id:"password",type:"password",value:u,onChange:C=>f(C.target.value),placeholder:t?"Create a password":"Enter password",disabled:b})]}),t&&l.jsxs("div",{className:"login-field",children:[l.jsx("label",{htmlFor:"confirmPassword",children:"Confirm Password"}),l.jsx("input",{id:"confirmPassword",type:"password",value:p,onChange:C=>g(C.target.value),placeholder:"Confirm password",disabled:b})]}),v&&l.jsx("div",{className:"login-error",children:v}),l.jsx("button",{type:"submit",className:"login-button",disabled:b,children:b?"Please wait...":t?"Create Account":"Login"})]}),t&&l.jsx("p",{className:"login-hint",children:"This password will be used to access Yep Anywhere from any device."})]})})}function Pd(){const[t,s]=m.useState([]),[i,r]=m.useState(!0),[c,u]=m.useState(null),f=m.useRef(!1),p=m.useCallback(async()=>{r(!0),u(null);try{const g=await Ne.getProviders();s(g.providers)}catch(g){u(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}},[]);return m.useEffect(()=>{f.current||(f.current=!0,p())},[p]),{providers:t,loading:i,error:c,refetch:p}}function Xy(t){return t.filter(s=>s.installed&&(s.authenticated||s.enabled))}function dC(t){const s=Xy(t);if(s.length===0)return null;const i=s.find(r=>r.name===z1);return i||(s[0]??null)}const fC=["default","acceptEdits","plan","bypassPermissions"],hC={default:"Ask before edits",acceptEdits:"Edit automatically",plan:"Plan mode",bypassPermissions:"Bypass permissions"},mC={default:"Claude will ask for approval before making changes",acceptEdits:"Claude can edit files without asking",plan:"Claude will create a plan before implementing",bypassPermissions:"Skip all permission checks (use with caution)"};function pC(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(1)} GB`}function gC({projectId:t,autoFocus:s=!0,rows:i=6,placeholder:r="Describe what you'd like help with...",compact:c=!1}){const u=Kn(),[f,p,g]=zd(`draft-new-session-${t}`),[v,y]=m.useState("default"),[b,S]=m.useState(null),[w,_]=m.useState(null),[N,j]=m.useState([]),[R,C]=m.useState(!1),[z,H]=m.useState({}),[T,O]=m.useState(""),D=m.useRef(null),F=m.useRef(null),ne=m.useRef(null),{thinkingEnabled:ce,toggleThinking:de,thinkingLevel:q}=bo(),{providers:Q,loading:le}=Pd(),ue=Xy(Q),k=Q.find(se=>se.name===b),U=(k==null?void 0:k.models)??[],I=(k==null?void 0:k.supportsPermissionMode)??!0,oe=(k==null?void 0:k.supportsThinkingToggle)??!0;m.useEffect(()=>{var se;if(!b&&Q.length>0){const Se=dC(Q);if(Se&&(S(Se.name),Se.models&&Se.models.length>0)){const Oe=og(hd()),Ie=Se.models.find(ct=>ct.id===Oe);_((Ie==null?void 0:Ie.id)??((se=Se.models[0])==null?void 0:se.id)??null)}}},[Q,b]);const he=se=>{var Oe;S(se);const Se=Q.find(Ie=>Ie.name===se);if(Se!=null&&Se.models&&Se.models.length>0){const Ie=og(hd()),ct=Se.models.find($=>$.id===Ie);_((ct==null?void 0:ct.id)??((Oe=Se.models[0])==null?void 0:Oe.id)??null)}else _(null)},A=m.useMemo(()=>U.map(se=>({value:se.id,label:se.size?`${se.name} (${(se.size/(1024*1024*1024)).toFixed(1)} GB)`:se.name})),[U]),Y=m.useCallback(se=>{_(se[0]??null)},[]),X=T?f+(f.trimEnd()?" ":"")+T:f;m.useEffect(()=>{var se;s&&((se=F.current)==null||se.focus())},[s]),m.useEffect(()=>{const se=Uj();se&&(p(se),$j(),F.current&&(F.current.focus(),F.current.setSelectionRange(se.length,se.length)))},[p]);const ae=se=>{const Se=se.target.files;if(!(Se!=null&&Se.length))return;const Oe=Array.from(Se).map(Ie=>({id:`pending-${Date.now()}-${Math.random().toString(36).slice(2)}`,file:Ie,previewUrl:Ie.type.startsWith("image/")?URL.createObjectURL(Ie):void 0}));j(Ie=>[...Ie,...Oe]),se.target.value=""},fe=se=>{j(Se=>{const Oe=Se.find(Ie=>Ie.id===se);return Oe!=null&&Oe.previewUrl&&URL.revokeObjectURL(Oe.previewUrl),Se.filter(Ie=>Ie.id!==se)})},ie=se=>{y(se)},ve=async()=>{var ct;const se=((ct=ne.current)==null?void 0:ct.stopAndFinalize())??"";let Se=f.trimEnd();se&&(Se=Se?`${Se} ${se}`:se);const Oe=Se.trim()||N.length>0;if(!t||!Oe||R)return;const Ie=Se.trim();O(""),C(!0);try{let $,me;const $e=[],Ot=md(),Gt={mode:v,model:w??void 0,thinking:Ot,provider:b??void 0};if(N.length>0){const We=await Ne.createSession(t,Gt);$=We.sessionId,me=We.processId;for(const ns of N)try{const ge=await Hv(t,$,ns.file,{onProgress:ze=>{H(wt=>({...wt,[ns.id]:{uploaded:ze,total:ns.file.size}}))}});$e.push(ge)}catch(ge){console.error("Failed to upload file:",ge)}await Ne.queueMessage($,Ie,v,$e.length>0?$e:void 0)}else{const We=await Ne.startSession(t,Ie,Gt);$=We.sessionId,me=We.processId}for(const We of N)We.previewUrl&&URL.revokeObjectURL(We.previewUrl);g.clearDraft(),u(`/projects/${t}/sessions/${$}`,{state:{initialStatus:{state:"owned",processId:me},initialTitle:Ie,initialModel:w,initialProvider:b}})}catch($){console.error("Failed to start session:",$),g.restoreFromStorage(),C(!1)}},Ae=se=>{var Se;if(se.key==="Enter"){const Oe=window.matchMedia("(pointer: coarse)").matches;if((Se=ne.current)!=null&&Se.isListening){se.preventDefault(),ve();return}if(Oe)return;{if(se.ctrlKey||se.shiftKey)return;se.preventDefault(),ve()}}},be=se=>{var Ie;const Se=(Ie=se.clipboardData)==null?void 0:Ie.items;if(!Se)return;const Oe=[];for(const ct of Se)if(ct.kind==="file"){const $=ct.getAsFile();$&&Oe.push($)}if(Oe.length>0){se.preventDefault();const ct=Oe.map($=>({id:`pending-${Date.now()}-${Math.random().toString(36).slice(2)}`,file:$,previewUrl:$.type.startsWith("image/")?URL.createObjectURL($):void 0}));j($=>[...$,...ct])}},xe=m.useCallback(se=>{const Se=f.trimEnd();p(Se?`${Se} ${se}`:se),O("")},[f,p]),Ce=m.useCallback(se=>{O(se)},[]),zt=f.trim()||N.length>0,Nt=l.jsxs(l.Fragment,{children:[l.jsx("textarea",{ref:F,value:X,onChange:se=>{O(""),p(se.target.value)},onKeyDown:Ae,onPaste:be,placeholder:r,disabled:R,rows:i,className:"new-session-form-textarea"}),l.jsxs("div",{className:"new-session-form-toolbar",children:[l.jsxs("div",{className:"new-session-form-toolbar-left",children:[l.jsx("input",{ref:D,type:"file",multiple:!0,style:{display:"none"},onChange:ae}),l.jsx("button",{type:"button",className:"toolbar-button",onClick:()=>{var se;return(se=D.current)==null?void 0:se.click()},disabled:R,"aria-label":"Attach files",children:l.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:l.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),l.jsx(Od,{ref:ne,onTranscript:xe,onInterimTranscript:Ce,onListeningStart:()=>{var se;return(se=F.current)==null?void 0:se.focus()},disabled:R,className:"toolbar-button"}),oe&&l.jsx("button",{type:"button",className:`toolbar-button ${ce?"active":""}`,onClick:de,disabled:R,title:ce?`Extended thinking: ${q}`:"Enable extended thinking","aria-pressed":ce,"aria-label":"Toggle extended thinking",children:l.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("polyline",{points:"12 6 12 12 16 14"})]})})]}),l.jsx("button",{type:"button",onClick:ve,disabled:R||!zt,className:"send-button","aria-label":"Start session",children:l.jsx("span",{className:"send-icon",children:R?"...":"↑"})})]}),N.length>0&&l.jsx("div",{className:"pending-files-list",children:N.map(se=>{const Se=z[se.id];return l.jsxs("div",{className:"pending-file-chip",children:[se.previewUrl&&l.jsx("img",{src:se.previewUrl,alt:"",className:"pending-file-preview"}),l.jsxs("div",{className:"pending-file-info",children:[l.jsx("span",{className:"pending-file-name",children:se.file.name}),l.jsx("span",{className:"pending-file-size",children:Se?`${Math.round(Se.uploaded/Se.total*100)}%`:pC(se.file.size)})]}),!R&&l.jsx("button",{type:"button",className:"pending-file-remove",onClick:()=>fe(se.id),"aria-label":`Remove ${se.file.name}`,children:l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[l.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},se.id)})})]});return c?l.jsx("div",{className:`new-session-form new-session-form-compact ${T?"voice-recording":""}`,children:Nt}):l.jsxs("div",{className:`new-session-form new-session-container ${T?"voice-recording":""}`,children:[l.jsxs("div",{className:"new-session-header",children:[l.jsx("h1",{children:"Start a New Session"}),l.jsx("p",{className:"new-session-subtitle",children:"What would you like to work on?"})]}),l.jsx("div",{className:"new-session-input-area",children:Nt}),!le&&ue.length>1&&l.jsxs("div",{className:"new-session-provider-section",children:[l.jsx("h3",{children:"AI Provider"}),l.jsx("div",{className:"provider-options",children:Q.map(se=>{const Se=se.installed&&(se.authenticated||se.enabled),Oe=b===se.name;return l.jsxs("button",{type:"button",className:`provider-option ${Oe?"selected":""} ${Se?"":"disabled"}`,onClick:()=>Se&&he(se.name),disabled:R||!Se,title:Se?se.displayName:`${se.displayName} is not available (${se.installed?"not authenticated":"not installed"})`,children:[l.jsx("span",{className:`provider-option-dot provider-${se.name}`}),l.jsxs("div",{className:"provider-option-content",children:[l.jsx("span",{className:"provider-option-label",children:se.displayName}),!Se&&l.jsx("span",{className:"provider-option-status",children:se.installed?"Not authenticated":"Not installed"})]})]},se.name)})})]}),b&&A.length>0&&l.jsxs("div",{className:"new-session-model-section",children:[l.jsx("h3",{children:"Model"}),l.jsx(kl,{label:"Model",options:A,selected:w?[w]:[],onChange:Y,multiSelect:!1,placeholder:"Select model"})]}),I&&l.jsxs("div",{className:"new-session-mode-section",children:[l.jsx("h3",{children:"Permission Mode"}),l.jsx("div",{className:"mode-options",children:fC.map(se=>l.jsxs("button",{type:"button",className:`mode-option ${v===se?"selected":""}`,onClick:()=>ie(se),disabled:R,children:[l.jsx("span",{className:`mode-option-dot mode-${se}`}),l.jsxs("div",{className:"mode-option-content",children:[l.jsx("span",{className:"mode-option-label",children:hC[se]}),l.jsx("span",{className:"mode-option-desc",children:mC[se]})]})]},se))})]})]})}const Bg=769;function vC({currentProjectId:t,currentProjectName:s,onProjectChange:i}){const[r,c]=m.useState(!1),[u,f]=m.useState(()=>window.innerWidth>=Bg),p=m.useRef(null),g=m.useRef(null),v=Kn(),{projects:y,loading:b}=ki(),S=y.find(T=>T.id===t),w=(S==null?void 0:S.name)??s??"Project",_=()=>{var T;(T=p.current)==null||T.blur(),c(!0)},N=T=>{T.id!==t&&(i?i(T):v(`/new-session?projectId=${encodeURIComponent(T.id)}`)),c(!1)},j=m.useCallback(()=>{c(!1)},[]);m.useEffect(()=>{const T=()=>{f(window.innerWidth>=Bg)};return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]),m.useEffect(()=>{if(!r)return;const T=O=>{O.key==="Escape"&&(O.preventDefault(),O.stopPropagation(),j())};return document.addEventListener("keydown",T,!0),()=>document.removeEventListener("keydown",T,!0)},[r,j]),m.useEffect(()=>{if(!r||!u)return;const T=O=>{g.current&&!g.current.contains(O.target)&&p.current&&!p.current.contains(O.target)&&j()};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[r,u,j]),m.useEffect(()=>{if(r&&!u)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[r,u]),m.useEffect(()=>{var T;r&&((T=g.current)==null||T.focus())},[r]);const R=T=>{T.target===T.currentTarget&&(T.preventDefault(),T.stopPropagation(),j())};if(!b&&y.length<=1)return l.jsx("span",{className:"session-title",children:w});const C=l.jsx("div",{className:"project-selector-options",children:y.map(T=>{const O=T.id===t;return l.jsxs("button",{type:"button",className:`project-selector-option ${O?"selected":""}`,onClick:()=>N(T),children:[l.jsx("span",{className:"project-selector-name",children:T.name}),l.jsxs("span",{className:"project-selector-meta",children:[T.sessionCount," sessions"]})]},T.id)})}),z=r&&!u?Ei.createPortal(l.jsx("div",{className:"project-selector-overlay",onClick:R,onMouseDown:T=>T.stopPropagation(),children:l.jsxs("div",{ref:g,className:"project-selector-sheet",tabIndex:-1,"aria-label":"Select project",children:[l.jsx("div",{className:"project-selector-header",children:l.jsx("span",{className:"project-selector-title",children:"Select Project"})}),C]})}),document.body):null,H=r&&u?l.jsx("div",{ref:g,className:"project-selector-dropdown",tabIndex:-1,"aria-label":"Select project",children:C}):null;return l.jsxs("div",{className:"project-selector-container",children:[l.jsxs("button",{ref:p,type:"button",className:"project-selector-button",onClick:_,title:"Change project","aria-haspopup":"listbox","aria-expanded":r,children:[l.jsx("span",{className:"project-selector-text",children:w}),l.jsx("svg",{className:"project-selector-chevron",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),H,z]})}const Ig="Yep Anywhere";function Hg(t,s){return t.length<=s?t:`${t.slice(0,s-1)}…`}function Ky(t,s){m.useEffect(()=>{let i=Ig;if(t)if(s){const r=Hg(t,10),c=Hg(s,20);i=`${r} - ${c}`}else i=t;return document.title=i,()=>{document.title=Ig}},[t,s])}function yC(){var w;const[t,s]=yo(),i=t.get("projectId"),{openSidebar:r,isWideScreen:c,toggleSidebar:u,isSidebarCollapsed:f}=_s(),{projects:p}=ki(),g=i||((w=p[0])==null?void 0:w.id),{project:v,loading:y,error:b}=oy(g),S=_=>{s({projectId:_},{replace:!0})};return!g&&!y&&p.length===0?l.jsx("div",{className:"error",children:"No projects available"}):(Ky(v==null?void 0:v.name,"New Session"),y||b?l.jsx("div",{className:c?"main-content-wrapper":"main-content-mobile",children:l.jsxs("div",{className:c?"main-content-constrained":"main-content-mobile-inner",children:[l.jsx(Es,{title:"New Session",onOpenSidebar:r,onToggleSidebar:u,isWideScreen:c,isSidebarCollapsed:f}),l.jsx("main",{className:"page-scroll-container",children:l.jsx("div",{className:"page-content-inner",children:y?l.jsx("div",{className:"loading",children:"Loading..."}):l.jsxs("div",{className:"error",children:["Error: ",b==null?void 0:b.message]})})})]})}):l.jsx("div",{className:c?"main-content-wrapper":"main-content-mobile",children:l.jsxs("div",{className:c?"main-content-constrained":"main-content-mobile-inner",children:[l.jsx(Es,{title:(v==null?void 0:v.name)??"New Session",titleElement:g?l.jsx(vC,{currentProjectId:g,currentProjectName:v==null?void 0:v.name,onProjectChange:_=>S(_.id)}):void 0,onOpenSidebar:r,onToggleSidebar:u,isWideScreen:c,isSidebarCollapsed:f}),l.jsx("main",{className:"page-scroll-container",children:l.jsx("div",{className:"page-content-inner",children:g&&l.jsx(gC,{projectId:g})})})]})}))}function bC(){const{projects:t,loading:s,error:i,refetch:r}=ki(),[c,u]=m.useState(!1),[f,p]=m.useState(""),[g,v]=m.useState(null),[y,b]=m.useState(!1),S=Kn(),{openSidebar:w,isWideScreen:_,toggleSidebar:N,isSidebarCollapsed:j}=_s(),R=async C=>{if(C.preventDefault(),!!f.trim()){b(!0),v(null);try{const{project:z}=await Ne.addProject(f.trim());await r(),p(""),u(!1),S(`/sessions?project=${z.id}`)}catch(z){v(z instanceof Error?z.message:"Failed to add project")}finally{b(!1)}}};return s?l.jsx("div",{className:"loading",children:"Loading projects..."}):i?l.jsxs("div",{className:"error",children:["Error: ",i.message]}):l.jsx("div",{className:_?"main-content-wrapper":"main-content-mobile",children:l.jsxs("div",{className:_?"main-content-constrained":"main-content-mobile-inner",children:[l.jsx(Es,{title:"Projects",onOpenSidebar:w,onToggleSidebar:N,isWideScreen:_,isSidebarCollapsed:j}),l.jsx("main",{className:"page-scroll-container",children:l.jsxs("div",{className:"page-content-inner",children:[l.jsx("div",{className:"add-project-section",children:c?l.jsxs("form",{onSubmit:R,className:"add-project-form",children:[l.jsx("input",{type:"text",value:f,onChange:C=>p(C.target.value),placeholder:"Enter project path (e.g., ~/code/my-project)",disabled:y}),l.jsxs("div",{className:"add-project-actions",children:[l.jsx("button",{type:"submit",disabled:y||!f.trim(),children:y?"Adding...":"Add"}),l.jsx("button",{type:"button",onClick:()=>{u(!1),p(""),v(null)},disabled:y,children:"Cancel"})]}),g&&l.jsx("div",{className:"add-project-error",children:g})]}):l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"add-project-button",onClick:()=>u(!0),children:"+ Add Project"}),l.jsx("p",{className:"add-project-hint",children:"or just launch Claude in a folder and it will automatically appear here"})]})}),t.length===0?l.jsx("p",{children:"No projects found. Add a project above to get started."}):l.jsx("ul",{className:"project-list",children:t.map(C=>l.jsx("li",{children:l.jsxs(gn,{to:`/sessions?project=${C.id}`,children:[l.jsx("strong",{children:C.name}),l.jsxs("span",{className:"meta",children:[C.sessionCount," sessions",l.jsx(Mg,{variant:"owned",count:C.activeOwnedCount}),l.jsx(Mg,{variant:"external",count:C.activeExternalCount})]})]})},C.id))})]})})]})})}const xC={claude:"var(--provider-claude)",codex:"var(--provider-codex)","codex-oss":"var(--provider-codex)",gemini:"var(--provider-gemini)",opencode:"var(--provider-opencode)"},SC={claude:"Claude",codex:"Codex","codex-oss":"CodexOSS",gemini:"Gemini",opencode:"OpenCode"};function Qy({provider:t,compact:s=!1,model:i,isThinking:r=!1,className:c=""}){const u=xC[t],f=SC[t],g=(b=>{if(!b||b==="default")return null;const S=fd.find(_=>_.value===b);if(S&&S.value!=="default")return S.label;const w=b.match(/claude-(\w+)-/);if(w!=null&&w[1]){const _=w[1],N=fd.find(j=>j.value===_);return N?N.label:_.charAt(0).toUpperCase()+_.slice(1)}return b.charAt(0).toUpperCase()+b.slice(1)})(i);if(s)return l.jsx("span",{className:`provider-badge-stripe ${c}`,style:{backgroundColor:u},title:g?`${f} (${g})`:f,"aria-label":`Provider: ${f}${g?` (${g})`:""}`});const v=r?"provider-badge-dot-inline thinking":"provider-badge-dot-inline",y=r?{backgroundColor:"var(--thinking-color)"}:{backgroundColor:u};return l.jsxs("span",{className:`provider-badge ${c}`,style:{borderColor:u,color:u},children:[l.jsx("span",{className:v,style:y}),l.jsx("span",{className:"provider-badge-label",children:f}),g&&l.jsx("span",{className:"provider-badge-model",children:g})]})}function jC(t,s){Ne.recordVisit(t,s).catch(i=>{console.error("Failed to record session visit:",i)})}function NC(){const[t,s]=m.useState([]),[i,r]=m.useState(!0),[c,u]=m.useState(null),f=m.useCallback(async()=>{try{const v=await Ne.getRecents();s(v.recents),u(null)}catch(v){u(v instanceof Error?v:new Error("Failed to fetch"))}finally{r(!1)}},[]);m.useEffect(()=>{f()},[f]);const p=m.useCallback((v,y)=>{s(b=>{const S=b.find(_=>_.sessionId===v),w=b.filter(_=>_.sessionId!==v);return S?[{...S,visitedAt:new Date().toISOString()},...w]:b}),Ne.recordVisit(v,y).catch(b=>{console.error("Failed to record session visit:",b),f()})},[f]),g=m.useCallback(()=>{s([]),Ne.clearRecents().catch(v=>{console.error("Failed to clear recents:",v),f()})},[f]);return{recentSessions:t,isLoading:i,error:c,recordVisit:p,clearRecents:g,refetch:f}}function wC(){const{openSidebar:t,isWideScreen:s,toggleSidebar:i,isSidebarCollapsed:r}=_s(),{recentSessions:c,isLoading:u,error:f,clearRecents:p}=NC(),g=c.length===0;return l.jsx("div",{className:s?"main-content-wrapper":"main-content-mobile",children:l.jsxs("div",{className:s?"main-content-constrained":"main-content-mobile-inner",children:[l.jsx(Es,{title:"Recent Sessions",onOpenSidebar:t,onToggleSidebar:i,isWideScreen:s,isSidebarCollapsed:r}),l.jsx("main",{className:"page-scroll-container",children:l.jsxs("div",{className:"page-content-inner",children:[!g&&l.jsx("div",{className:"inbox-toolbar",children:l.jsxs("button",{type:"button",className:"inbox-refresh-button",onClick:p,title:"Clear recent sessions",children:[l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("path",{d:"M3 6h18"}),l.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),l.jsx("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]}),"Clear History"]})}),u&&l.jsx("p",{className:"loading",children:"Loading recent sessions..."}),f&&l.jsxs("p",{className:"error",children:["Error loading sessions: ",f.message]}),!u&&!f&&g&&l.jsxs("div",{className:"inbox-empty",children:[l.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("polyline",{points:"12 6 12 12 16 14"})]}),l.jsx("h3",{children:"No recent sessions"}),l.jsx("p",{children:"Sessions you visit will appear here."})]}),!u&&!f&&!g&&l.jsx("ul",{className:"sessions-list recents-list",children:c.map(v=>l.jsx("li",{className:"session-list-item session-list-item--card",children:l.jsxs(gn,{to:`/projects/${v.projectId}/sessions/${v.sessionId}`,className:"session-list-item__link",children:[l.jsxs("div",{className:"session-list-item__content",children:[l.jsx("span",{className:"session-list-item__title",children:v.title??"Untitled session"}),l.jsx("span",{className:"session-list-item__project",children:v.projectName})]}),l.jsx(Qy,{provider:v.provider,compact:!0})]})},v.sessionId))})]})})]})})}const EC=["default","acceptEdits","plan","bypassPermissions"],Zg={default:"Ask before edits",acceptEdits:"Edit automatically",plan:"Plan mode",bypassPermissions:"Bypass permissions"},qg=769;function _C({mode:t,onModeChange:s,disabled:i,isModePending:r,isHeld:c=!1,onHoldChange:u}){const[f,p]=m.useState(!1),[g,v]=m.useState(()=>window.innerWidth>=qg),y=m.useRef(null),b=m.useRef(null),S=()=>{var O;i||((O=y.current)==null||O.blur(),p(!0))},w=O=>{c&&u&&u(!1),s(O),p(!1)},_=()=>{u&&u(!c),p(!1)},N=m.useCallback(()=>{p(!1)},[]);m.useEffect(()=>{const O=()=>{v(window.innerWidth>=qg)};return window.addEventListener("resize",O),()=>window.removeEventListener("resize",O)},[]),m.useEffect(()=>{if(!f)return;const O=D=>{D.key==="Escape"&&(D.preventDefault(),D.stopPropagation(),N())};return document.addEventListener("keydown",O,!0),()=>document.removeEventListener("keydown",O,!0)},[f,N]),m.useEffect(()=>{if(!f||!g)return;const O=D=>{b.current&&!b.current.contains(D.target)&&y.current&&!y.current.contains(D.target)&&N()};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[f,g,N]),m.useEffect(()=>{if(f&&!g)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[f,g]),m.useEffect(()=>{var O;f&&((O=b.current)==null||O.focus())},[f]);const j=O=>{O.target===O.currentTarget&&(O.preventDefault(),O.stopPropagation(),N())},R=c?"Hold":Zg[t],C=c?"mode-hold":`mode-${t}`,z=l.jsxs(l.Fragment,{children:[u&&l.jsxs("button",{type:"button",className:`mode-selector-option ${c?"selected":""}`,onClick:_,"aria-pressed":c,children:[l.jsx("span",{className:"mode-dot mode-hold"}),l.jsx("span",{className:"mode-selector-label",children:c?"Resume":"Hold"}),l.jsx("span",{className:"mode-selector-description",children:c?"Continue execution":"Pause execution"}),c&&l.jsx("span",{className:"mode-selector-check","aria-hidden":"true",children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})})})]}),u&&l.jsx("div",{className:"mode-selector-divider"}),EC.map(O=>l.jsxs("button",{type:"button",className:`mode-selector-option ${!c&&t===O?"selected":""}`,onClick:()=>w(O),"aria-pressed":!c&&t===O,children:[l.jsx("span",{className:`mode-dot mode-${O}`}),l.jsx("span",{className:"mode-selector-label",children:Zg[O]}),!c&&t===O&&l.jsx("span",{className:"mode-selector-check","aria-hidden":"true",children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})})})]},O))]}),H=f&&!g?Ei.createPortal(l.jsx("div",{className:"mode-selector-overlay",onClick:j,onMouseDown:O=>O.stopPropagation(),children:l.jsxs("div",{ref:b,className:"mode-selector-sheet",tabIndex:-1,"aria-label":"Select mode",children:[l.jsx("div",{className:"mode-selector-header",children:l.jsx("span",{className:"mode-selector-title",children:"Session Mode"})}),l.jsx("div",{className:"mode-selector-options",children:z})]})}),document.body):null,T=f&&g?l.jsx("div",{ref:b,className:"mode-selector-dropdown",tabIndex:-1,"aria-label":"Select mode",children:l.jsx("div",{className:"mode-selector-options",children:z})}):null;return l.jsxs("div",{className:"mode-selector-container",children:[l.jsxs("button",{ref:y,type:"button",className:`mode-button ${c?"mode-button-held":""}`,onClick:S,disabled:i,title:"Click to select mode","aria-haspopup":"listbox","aria-expanded":f,children:[l.jsx("span",{className:`mode-dot ${C}`}),R,r&&!c&&l.jsx("span",{className:"mode-pending-hint",children:"(set on next message)"})]}),T,H]})}function Wy({mode:t="default",onModeChange:s,isModePending:i,isHeld:r,onHoldChange:c,supportsPermissionMode:u=!0,supportsThinkingToggle:f=!0,canAttach:p,attachmentCount:g=0,onAttachClick:v,voiceButtonRef:y,onVoiceTranscript:b,onInterimTranscript:S,onListeningStart:w,voiceDisabled:_,contextUsage:N,isRunning:j,isThinking:R,onStop:C,onSend:z,canSend:H,disabled:T,pendingApproval:O}){const{thinkingEnabled:D,toggleThinking:F,thinkingLevel:ne}=bo();return l.jsxs("div",{className:"message-input-toolbar",children:[l.jsxs("div",{className:"message-input-left",children:[s&&u&&l.jsx(_C,{mode:t,onModeChange:s,isModePending:i,isHeld:r,onHoldChange:c}),l.jsxs("button",{type:"button",className:"attach-button",onClick:v,disabled:!p,title:p?"Attach files":"Send a message first to enable attachments",children:[l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:l.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})}),g>0&&l.jsx("span",{className:"attach-count",children:g})]}),f&&l.jsx("button",{type:"button",className:`thinking-toggle-button ${D?"active":""}`,onClick:F,title:D?`Extended thinking: ${ne}`:"Enable extended thinking","aria-pressed":D,children:l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("polyline",{points:"12 6 12 12 16 14"})]})}),y&&b&&S&&l.jsx(Od,{ref:y,onTranscript:b,onInterimTranscript:S,onListeningStart:w,disabled:_})]}),l.jsxs("div",{className:"message-input-actions",children:[O&&l.jsxs("button",{type:"button",className:`pending-approval-indicator ${O.type}`,onClick:O.onExpand,title:O.type==="tool-approval"?"Expand tool approval":"Expand question",children:[l.jsx("span",{className:"pending-approval-dot"}),l.jsx("span",{className:"pending-approval-text",children:O.type==="tool-approval"?"Approval":"Question"})]}),l.jsx(Vy,{usage:N,size:16}),j&&C&&R&&!H?l.jsx("button",{type:"button",onClick:C,className:"stop-button","aria-label":"Stop",children:l.jsx("span",{className:"stop-icon"})}):z?l.jsx("button",{type:"button",onClick:z,disabled:T||!H,className:"send-button","aria-label":"Send",children:l.jsx("span",{className:"send-icon",children:"↑"})}):null]})]})}function kC(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(1)} GB`}function TC({onSend:t,disabled:s,placeholder:i,mode:r="default",onModeChange:c,isModePending:u,isHeld:f,onHoldChange:p,isRunning:g,isThinking:v,onStop:y,draftKey:b,collapsed:S,onDraftControlsReady:w,contextUsage:_,projectId:N,sessionId:j,attachments:R=[],onAttach:C,onRemoveAttachment:z,uploadProgress:H=[],supportsPermissionMode:T=!0,supportsThinkingToggle:O=!0}){const[D,F,ne]=zd(b),ce=m.useRef(null),de=m.useRef(null),q=m.useRef(null),[Q,le]=m.useState(!1),[ue,k]=m.useState(""),U=ue?D+(D.trimEnd()?" ":"")+ue:D,I=Q||S,oe=!!(N&&j&&C),he=ie=>{const ve=ie.target.files;ve!=null&&ve.length&&C&&(C(Array.from(ve)),ie.target.value="")};m.useEffect(()=>{w==null||w(ne)},[ne,w]);const A=m.useCallback(()=>{var be,xe;const ie=((be=q.current)==null?void 0:be.stopAndFinalize())??"";let ve=D.trimEnd();if(ie&&(ve=ve?`${ve} ${ie}`:ie),(ve.trim()||R.length>0)&&!s){const Ce=ve.trim();ne.clearInput(),k(""),t(Ce),(xe=ce.current)==null||xe.focus()}},[D,s,ne,t,R.length]),Y=ie=>{var ve,Ae;if(ie.key===" "&&ie.ctrlKey&&!ie.shiftKey&&!ie.altKey){ie.preventDefault(),(ve=q.current)!=null&&ve.isAvailable&&q.current.toggle();return}if(ie.key==="Enter"){const be=window.matchMedia("(pointer: coarse)").matches;if((Ae=q.current)!=null&&Ae.isListening){ie.preventDefault(),A();return}if(be)return;{if(ie.ctrlKey||ie.shiftKey)return;ie.preventDefault(),A()}}},X=ie=>{var be;if(!oe||!C)return;const ve=(be=ie.clipboardData)==null?void 0:be.items;if(!ve)return;const Ae=[];for(const xe of ve)if(xe.kind==="file"){const Ce=xe.getAsFile();Ce&&Ae.push(Ce)}Ae.length>0&&(ie.preventDefault(),C(Ae))},ae=m.useCallback(ie=>{const ve=ie.trim();if(!ve)return;const Ae=D.trimEnd();F(Ae?`${Ae} ${ve}`:ve),k("")},[D,F]),fe=m.useCallback(ie=>{k(ie)},[]);return l.jsxs("div",{className:"message-input-wrapper",children:[!S&&l.jsx("button",{type:"button",className:"message-input-toggle",onClick:()=>le(!Q),"aria-label":Q?"Expand message input":"Collapse message input","aria-expanded":!Q,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:Q?"chevron-up":"chevron-down","aria-hidden":"true",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})}),l.jsxs("div",{className:`message-input ${I?"message-input-collapsed":""} ${ue?"voice-recording":""}`,children:[l.jsx("textarea",{ref:ce,value:U,onChange:ie=>{k(""),F(ie.target.value)},onKeyDown:Y,onPaste:X,placeholder:S?"Continue typing while responding above...":i,disabled:s,rows:I?1:3}),!I&&(R.length>0||H.length>0)&&l.jsxs("div",{className:"attachment-list",children:[R.map(ie=>l.jsxs("div",{className:"attachment-chip",children:[l.jsx("span",{className:"attachment-name",title:ie.path,children:ie.originalName}),l.jsx("span",{className:"attachment-size",children:kC(ie.size)}),l.jsx("button",{type:"button",className:"attachment-remove",onClick:()=>z==null?void 0:z(ie.id),"aria-label":`Remove ${ie.originalName}`,children:"x"})]},ie.id)),H.map(ie=>l.jsxs("div",{className:"attachment-chip uploading",children:[l.jsx("span",{className:"attachment-name",children:ie.fileName}),l.jsxs("span",{className:"attachment-progress",children:[ie.percent,"%"]})]},ie.fileId))]}),l.jsx("input",{ref:de,type:"file",multiple:!0,style:{display:"none"},onChange:he}),!I&&l.jsx(Wy,{mode:r,onModeChange:c,isModePending:u,isHeld:f,onHoldChange:p,supportsPermissionMode:T,supportsThinkingToggle:O,canAttach:oe,attachmentCount:R.length,onAttachClick:()=>{var ie;return(ie=de.current)==null?void 0:ie.click()},voiceButtonRef:q,onVoiceTranscript:ae,onInterimTranscript:fe,onListeningStart:()=>{var ie;return(ie=ce.current)==null?void 0:ie.focus()},voiceDisabled:s,contextUsage:_,isRunning:g,isThinking:v,onStop:y,onSend:A,canSend:!!(D.trim()||R.length>0),disabled:s})]})]})}function Vd(t,s){const i=[],r=new Map,c=new Set;if(!(s!=null&&s.activeToolApproval)){for(const u of t)if(u.orphanedToolUseIds)for(const f of u.orphanedToolUseIds)c.add(f)}for(const u of t)CC(u,i,r,c,s);return i}function CC(t,s,i,r,c){var b,S,w,_,N,j,R,C,z;const u=en(t);if(t.type==="system"){const H=t.subtype??"unknown";if(H==="compact_boundary"){const T={type:"system",id:u,subtype:H,content:typeof t.content=="string"?t.content:"Context compacted",sourceMessages:[t]};s.push(T)}return}typeof window<"u"&&window.__STREAMING_DEBUG__&&t.type==="assistant"&&console.log("[preprocessMessages] Processing assistant message:",{msgId:u,uuid:t.uuid,id:t.id,_isStreaming:t._isStreaming});const f=((b=t.message)==null?void 0:b.content)??t.content,p=((S=t.message)==null?void 0:S.role)??t.role,g=t.type==="user"||p==="user";if(typeof f=="string"){if(g){s.push({type:"user_prompt",id:u,content:f,sourceMessages:[t],isSubagent:t.isSubagent});return}if(f.trim()){const H=t._html;s.push({type:"text",id:u,text:f,sourceMessages:[t],isSubagent:t.isSubagent,augmentHtml:H??((_=(w=c==null?void 0:c.markdown)==null?void 0:w[u])==null?void 0:_.html)})}return}if(!Array.isArray(f))return;if(g&&f.every(H=>H.type==="tool_result")){for(const H of f)H.type==="tool_result"&&H.tool_use_id&&RC(H,t,s,i);return}if(g){s.push({type:"user_prompt",id:u,content:f,sourceMessages:[t],isSubagent:t.isSubagent});return}let y=-1;if(t._isStreaming)for(let H=f.length-1;H>=0;H--){const T=f[H];if((T==null?void 0:T.type)==="text"&&((N=T.text)!=null&&N.trim())){y=H;break}}for(let H=0;H<f.length;H++){const T=f[H];if(!T)continue;const O=`${u}-${H}`;if(T.type==="text"){if((j=T.text)!=null&&j.trim()){const D=T._html;s.push({type:"text",id:O,text:T.text,sourceMessages:[t],isSubagent:t.isSubagent,isStreaming:t._isStreaming&&H===y,augmentHtml:D??((C=(R=c==null?void 0:c.markdown)==null?void 0:R[u])==null?void 0:C.html)})}}else if(T.type==="thinking")(z=T.thinking)!=null&&z.trim()&&s.push({type:"thinking",id:O,thinking:T.thinking,signature:void 0,status:"complete",sourceMessages:[t],isSubagent:t.isSubagent});else if(T.type==="tool_use"&&T.id&&T.name){const D=r.has(T.id),F={type:"tool_call",id:T.id,toolName:T.name,toolInput:T.input,toolResult:void 0,status:D?"aborted":"pending",sourceMessages:[t],isSubagent:t.isSubagent};i.set(T.id,s.length),s.push(F)}}}function RC(t,s,i,r){const c=t.tool_use_id;if(!c)return;const u=r.get(c);if(u===void 0){console.warn(`Tool result for unknown tool_use: ${c}`);return}const f=i[u];if(!f||f.type!=="tool_call")return;const p=s.toolUseResult??s.tool_use_result,g={content:t.content||"",isError:t.is_error||!1,structured:p},v={type:"tool_call",id:f.id,toolName:f.toolName,toolInput:f.toolInput,toolResult:g,status:t.is_error?"error":"complete",sourceMessages:[...f.sourceMessages,s],isSubagent:f.isSubagent};i[u]=v,r.delete(c)}const Jy="yep-anywhere-fun-phrases-enabled";function eb(){const t=localStorage.getItem(Jy);return t===null?!0:t==="true"}function AC(t){localStorage.setItem(Jy,String(t))}function MC(){const[t,s]=m.useState(eb),i=m.useCallback(r=>{s(r),AC(r)},[]);return{funPhrasesEnabled:t,setFunPhrasesEnabled:i}}function zC(){return eb()}const OC=["Thinking...","Processing...","Cooking...","Analyzing...","Working on it...","Pondering...","Computing...","Crafting...","Mulling it over...","On it...","Crunching...","Brewing...","Conjuring...","Synthesizing...","Deliberating...","Ruminating...","Contemplating...","Percolating...","Cogitating...","Noodling..."],DC=2e3,LC=25;function UC(t){const s=[...t];for(let i=s.length-1;i>0;i--){const r=Math.floor(Math.random()*(i+1)),c=s[i];s[i]=s[r],s[r]=c}return s}const $C=m.memo(function({isProcessing:s}){const[i,r]=m.useState(0),[c,u]=m.useState(""),[f,p]=m.useState(!0),g=m.useMemo(()=>s?zC()?UC(OC):["Thinking..."]:["Thinking..."],[s]);return m.useEffect(()=>{if(!s){r(0),u(""),p(!0);return}const v=setInterval(()=>{r(y=>(y+1)%g.length),p(!0),u("")},DC);return()=>clearInterval(v)},[s,g.length]),m.useEffect(()=>{if(!s||!f)return;const v=g[i]??"";if(c.length>=v.length){p(!1);return}const y=setTimeout(()=>{u(v.slice(0,c.length+1))},LC);return()=>clearTimeout(y)},[s,f,i,c,g]),s?l.jsxs("div",{className:"processing-indicator",children:[l.jsx("div",{className:"processing-dot-container",children:l.jsx(Ra,{})}),l.jsxs("span",{className:"processing-text",children:[c,l.jsx("span",{className:"processing-cursor",children:"|"})]})]}):null}),tb=m.createContext(null);function BC({children:t}){const s=m.useRef(null),i=m.useRef(null),r=m.useCallback(y=>(typeof window<"u"&&window.__STREAMING_DEBUG__&&console.log("%c[CONTEXT] Handler registered","color: #2196F3",{hadPreviousHandler:!!s.current}),s.current=y,()=>{s.current===y&&(typeof window<"u"&&window.__STREAMING_DEBUG__&&console.log("%c[CONTEXT] Handler unregistered","color: #FF5722"),s.current=null)}),[]),c=m.useCallback(y=>{i.current=y},[]),u=m.useCallback(y=>{var b;typeof window<"u"&&window.__STREAMING_DEBUG__&&console.log("%c[CONTEXT] dispatchAugment called","color: #4CAF50",{hasHandler:!!s.current,augment:{blockIndex:y.blockIndex,type:y.type}}),(b=s.current)==null||b.onAugment(y)},[]),f=m.useCallback(y=>{var b;typeof window<"u"&&window.__STREAMING_DEBUG__&&console.log("%c[CONTEXT] dispatchPending called","color: #FF9800",{hasHandler:!!s.current,htmlLength:y.html.length}),(b=s.current)==null||b.onPending(y)},[]),p=m.useCallback(()=>{var y;(y=s.current)==null||y.onStreamEnd(),i.current=null},[]),g=m.useCallback(()=>{var y,b;return((b=(y=s.current)==null?void 0:y.captureHtml)==null?void 0:b.call(y))??null},[]),v={registerStreamingHandler:r,setCurrentMessageId:c,dispatchAugment:u,dispatchPending:f,dispatchStreamEnd:p,captureStreamingHtml:g};return l.jsx(tb.Provider,{value:v,children:t})}function nb(){return m.useContext(tb)}function $t(t,s,i){if(typeof window<"u"&&window.__STREAMING_DEBUG__){const r={augment:"[AUGMENT]",pending:"[PENDING]",event:"[EVENT]",dom:"[DOM]"}[t],c=i?` ${JSON.stringify(i)}`:"";console.log(`%c${r} ${s}${c}`,IC(t))}}function IC(t){return{augment:"color: #4caf50; font-weight: bold",pending:"color: #ff9800; font-weight: bold",event:"color: #2196f3; font-weight: bold",dom:"color: #9c27b0; font-weight: bold"}[t]||""}function HC(){const t=m.useRef(null),s=m.useRef(null),[i,r]=m.useState(!1),c=m.useRef(new Map),u=m.useRef(-1),f=m.useCallback(b=>{const S=t.current;if($t("augment","Received augment",{blockIndex:b.blockIndex,type:b.type,htmlLength:b.html.length,htmlPreview:b.html.substring(0,100)}),!S){$t("augment","ERROR: containerRef.current is null - refs not attached!");return}r(!0);const{blockIndex:w,html:_}=b;if(c.current.has(w)){const j=c.current.get(w);j&&($t("dom","Updating existing block",{blockIndex:w}),j.innerHTML=_);return}const N=document.createElement("div");if(N.className="streaming-block",N.dataset.blockIndex=String(w),N.innerHTML=_,$t("dom","Created new block element",{blockIndex:w,className:N.className}),w>u.current)S.appendChild(N),u.current=w,$t("dom","Appended block to end",{blockIndex:w,maxBlockIndex:u.current});else{let j=!1;const R=S.children;for(let C=0;C<R.length;C++){const z=R[C],H=Number.parseInt(z.dataset.blockIndex??"-1",10);if(H>w){S.insertBefore(N,z),j=!0,$t("dom","Inserted block before",{blockIndex:w,beforeIndex:H});break}}j||(S.appendChild(N),$t("dom","Appended out-of-order block to end",{blockIndex:w}))}c.current.set(w,N),$t("dom","Block tracking updated",{totalBlocks:c.current.size})},[]),p=m.useCallback(b=>{const S=s.current;if($t("pending","Received pending update",{htmlLength:b.html.length,htmlPreview:b.html.substring(0,80)}),!S){$t("pending","ERROR: pendingRef.current is null - refs not attached!");return}r(!0),S.innerHTML=b.html,$t("pending","Updated pending element innerHTML")},[]),g=m.useCallback(()=>{$t("event","Stream ended");const b=s.current;b&&(b.innerHTML="",$t("event","Cleared pending element")),r(!1),$t("event","Set isStreaming to false")},[]),v=m.useCallback(()=>{$t("event","Reset called");const b=t.current,S=s.current;b&&(b.innerHTML="",$t("event","Cleared container")),S&&(S.innerHTML="",$t("event","Cleared pending element"));const w=c.current.size;c.current.clear(),u.current=-1,r(!1),$t("event","Reset complete",{previousBlockCount:w,maxBlockIndexReset:!0})},[]),y=m.useCallback(()=>{const b=t.current;if(!b)return null;const S=b.innerHTML;return $t("event","Captured HTML",{length:S.length}),S||null},[]);return{containerRef:t,pendingRef:s,isStreaming:i,onAugment:f,onPending:p,onStreamEnd:g,reset:v,captureHtml:y}}const ZC=m.memo(function({text:s,isStreaming:i=!1,augmentHtml:r}){const[c,u]=m.useState(!1),f=HC(),p=nb(),[g,v]=m.useState(!1);m.useEffect(()=>{if(!i||!p){i||(v(!1),f.reset());return}return p.registerStreamingHandler({onAugment:_=>{v(!0),f.onAugment(_)},onPending:f.onPending,onStreamEnd:f.onStreamEnd,captureHtml:f.captureHtml})},[i,p,f]);const y=m.useCallback(async()=>{try{await navigator.clipboard.writeText(s),u(!0),setTimeout(()=>u(!1),2e3)}catch(w){console.error("Failed to copy text:",w)}},[s]),b=i&&g,S=i;return l.jsxs("div",{className:`text-block timeline-item${i?" streaming":""}`,children:[l.jsx("button",{type:"button",className:`text-block-copy ${c?"copied":""}`,onClick:y,title:c?"Copied!":"Copy markdown","aria-label":c?"Copied!":"Copy markdown",children:c?l.jsx(PC,{}):l.jsx(qC,{})}),S&&l.jsxs("div",{style:b?void 0:{display:"none"},children:[l.jsx("div",{ref:f.containerRef,className:"streaming-blocks"}),l.jsx("span",{ref:f.pendingRef,className:"streaming-pending"})]}),!b&&(r?l.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):l.jsx("p",{children:s}))]})});function qC(){return l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),l.jsx("path",{d:"M11 5V3.5A1.5 1.5 0 0 0 9.5 2H3.5A1.5 1.5 0 0 0 2 3.5v6A1.5 1.5 0 0 0 3.5 11H5"})]})}function PC(){return l.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"M3 8.5L6.5 12L13 4"})})}const VC=m.memo(function({thinking:s,status:i,isExpanded:r,onToggle:c}){const u=i==="streaming",f=["thinking-block","collapsible","timeline-item",u&&!r?"thinking-streaming-collapsed":""].filter(Boolean).join(" ");return l.jsxs("details",{className:f,open:r,onToggle:p=>{p.currentTarget.open!==r&&c()},children:[l.jsxs("summary",{className:"collapsible__summary",children:[l.jsx("span",{children:u?"Thinking...":"Thinking"}),l.jsx("span",{className:"collapsible__icon",children:"▸"})]}),l.jsx("div",{className:"collapsible__content",children:l.jsx("span",{className:"text-content",children:s})})]})}),GC={Task:x2,Bash:j2,Read:k2,Edit:R2,Write:M2,Glob:O2,Grep:L2,TodoWrite:$2,WebSearch:H2,WebFetch:q2,AskUserQuestion:F2,BashOutput:X2,TaskOutput:Q2,KillShell:J2};function Bt(t,s){const i=GC[t];if(!i)return{valid:!0,toolName:t};const r=i.safeParse(s);return r.success?{valid:!0,toolName:t}:{valid:!1,errors:r.error,toolName:t}}function Xn({title:t,children:s,onClose:i}){const r=m.useRef(null);m.useEffect(()=>{const p=g=>{g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),i())};return document.addEventListener("keydown",p,!0),()=>document.removeEventListener("keydown",p,!0)},[i]),m.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]),m.useEffect(()=>{var p;(p=r.current)==null||p.focus()},[]);const c=p=>{p.target===p.currentTarget&&(p.preventDefault(),p.stopPropagation(),i())},u=p=>{p.stopPropagation()},f=l.jsx("div",{className:"modal-overlay",onClick:c,onMouseDown:p=>p.stopPropagation(),children:l.jsxs("dialog",{className:"modal",open:!0,onClick:u,children:[l.jsxs("div",{className:"modal-header",children:[l.jsx("span",{className:"modal-title",children:t}),l.jsx("button",{ref:r,type:"button",className:"modal-close",onClick:p=>{p.preventDefault(),p.stopPropagation(),i()},"aria-label":"Close",children:"×"})]}),l.jsx("div",{className:"modal-content",children:s})]})});return Ei.createPortal(f,document.body)}function FC(t){const s=t.issues,i=[],r=[];for(const c of s){const u=c.path.join(".")||"(root)";c.code==="invalid_type"&&c.message.toLowerCase().includes("required")?i.push(u):r.push({path:u,message:c.message})}return{missing:i,invalid:r}}const YC="https://github.com/kzahel/yepanywhere/issues/new";function XC(t,s,i){const r=`Schema validation error: ${t}`,c=[`## Tool
101
+
102
+ \`${t}\``];s.length>0&&c.push(`## Missing fields
103
+
104
+ ${s.map(p=>`- \`${p}\``).join(`
105
+ `)}`),i.length>0&&c.push(`## Invalid fields
106
+
107
+ ${i.map(({path:p,message:g})=>`- \`${p}\`: ${g}`).join(`
108
+ `)}`),c.push(`## Context
109
+
110
+ <!-- Please add any additional context here, such as what you were doing when this occurred -->`);const u=c.join(`
111
+
112
+ `),f=new URLSearchParams({title:r,body:u,labels:"bug,schema"});return`${YC}?${f.toString()}`}function Re({toolName:t,errors:s}){const[i,r]=m.useState(!1),{missing:c,invalid:u}=FC(s),f=XC(t,c,u),p=m.useCallback(y=>{y.stopPropagation(),r(!0)},[]),g=m.useCallback(y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),y.stopPropagation(),r(!0))},[]),v=m.useCallback(()=>{r(!1)},[]);return l.jsxs(l.Fragment,{children:[l.jsx("span",{role:"button",tabIndex:0,className:"schema-warning",onClick:p,onKeyDown:g,title:`Schema warning for ${t} - click for details`,children:l.jsx("span",{className:"schema-warning-icon","aria-hidden":"true",children:"!"})}),i&&l.jsx(Xn,{title:l.jsxs("span",{className:"schema-warning-modal-title",children:["Schema validation failed: ",t]}),onClose:v,children:l.jsxs("div",{className:"schema-warning-modal-content",children:[c.length>0&&l.jsxs("div",{className:"schema-warning-section",children:[l.jsx("div",{className:"schema-warning-section-title",children:"Missing fields"}),l.jsx("ul",{className:"schema-warning-list",children:c.map(y=>l.jsx("li",{className:"schema-warning-item",children:l.jsx("code",{children:y})},y))})]}),u.length>0&&l.jsxs("div",{className:"schema-warning-section",children:[l.jsx("div",{className:"schema-warning-section-title",children:"Invalid fields"}),l.jsx("ul",{className:"schema-warning-list",children:u.map(({path:y,message:b})=>l.jsxs("li",{className:"schema-warning-item",children:[l.jsx("code",{children:y}),l.jsx("span",{className:"schema-warning-message",children:b})]},y))})]}),l.jsx("div",{className:"schema-warning-footer",children:l.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"schema-warning-report-link",onClick:y=>y.stopPropagation(),children:"Report issue on GitHub"})})]})})]})}function sb({question:t,selectedAnswer:s}){return l.jsxs("div",{className:"question-item",children:[l.jsxs("div",{className:"question-header",children:[l.jsx("span",{className:"badge",children:t.header}),l.jsx("span",{className:"question-text",children:t.question})]}),l.jsx("ul",{className:"question-options",children:t.options.map(i=>{const r=s===i.label;return l.jsxs("li",{className:`question-option ${r?"question-option-selected":""}`,children:[l.jsx("span",{className:"question-option-indicator",children:t.multiSelect?r?"☑":"☐":r?"●":"○"}),l.jsxs("div",{className:"question-option-content",children:[l.jsx("span",{className:"question-option-label",children:i.label}),i.description&&l.jsx("span",{className:"question-option-desc",children:i.description})]})]},i.label)})})]})}function KC({input:t}){return l.jsx("div",{className:"question-tool-use",children:t.questions.map((s,i)=>l.jsx(sb,{question:s},`${s.header}-${i}`))})}function QC({result:t,isError:s}){const{enabled:i,reportValidationError:r,isToolIgnored:c}=Mt(),[u,f]=m.useState(null);m.useEffect(()=>{if(i&&t){const g=Bt("AskUserQuestion",t);!g.valid&&g.errors?(f(g.errors),r("AskUserQuestion",g.errors)):f(null)}},[i,t,r]);const p=i&&u&&!c("AskUserQuestion");if(s){const g=t;return l.jsxs("div",{className:"question-error",children:[p&&u&&l.jsx(Re,{toolName:"AskUserQuestion",errors:u}),typeof t=="object"&&(g!=null&&g.content)?String(g.content):"Question failed"]})}return!t||!t.questions?l.jsxs("div",{className:"question-empty",children:[p&&u&&l.jsx(Re,{toolName:"AskUserQuestion",errors:u}),"No questions"]}):l.jsxs("div",{className:"question-result",children:[p&&u&&l.jsx(Re,{toolName:"AskUserQuestion",errors:u}),t.questions.map((g,v)=>{var b;const y=(b=t.answers)==null?void 0:b[g.question];return l.jsx(sb,{question:g,selectedAnswer:y},`${g.header}-${v}`)})]})}const WC={tool:"AskUserQuestion",renderToolUse(t,s){return l.jsx(KC,{input:t})},renderToolResult(t,s,i){return l.jsx(QC,{result:t,isError:s})},getUseSummary(t){const s=t.questions;return`${(s==null?void 0:s.length)||0} question${(s==null?void 0:s.length)===1?"":"s"}`},getResultSummary(t,s){var c;if(s)return"Error";const i=Object.keys((t==null?void 0:t.answers)||{}).length,r=((c=t==null?void 0:t.questions)==null?void 0:c.length)||0;return i===0&&r>0?`${r} question${r===1?"":"s"}`:`${i} answered`}},Pg=20;function JC(t){try{const s=new Date(t),r=new Date().getTime()-s.getTime(),c=Math.floor(r/1e3);return c<60?`${c}s ago`:c<3600?`${Math.floor(c/60)}m ago`:s.toLocaleTimeString()}catch{return t}}function eR({status:t}){const i={running:{icon:"⟳",className:"status-running"},completed:{icon:"✓",className:"status-completed"},failed:{icon:"✗",className:"status-failed"}}[t]||{icon:"?",className:""};return l.jsxs("span",{className:`bashoutput-status ${i.className}`,children:[i.icon," ",t]})}function tR({input:t}){return l.jsxs("div",{className:"bashoutput-tool-use",children:[l.jsx("span",{className:"bashoutput-label",children:"Polling background shell"}),l.jsx("code",{className:"bashoutput-id",children:t.bash_id}),t.block!==void 0&&l.jsx("span",{className:"badge",children:t.block?"blocking":"non-blocking"})]})}function nR({result:t,isError:s}){var N,j;const[i,r]=m.useState(!1),{enabled:c,reportValidationError:u,isToolIgnored:f}=Mt(),[p,g]=m.useState(null);m.useEffect(()=>{if(c&&t){const R=Bt("BashOutput",t);!R.valid&&R.errors?(g(R.errors),u("BashOutput",R.errors)):g(null)}},[c,t,u]);const v=c&&p&&!f("BashOutput");if(s){const R=t;return l.jsxs("div",{className:"bashoutput-error",children:[v&&p&&l.jsx(Re,{toolName:"BashOutput",errors:p}),typeof t=="object"&&(R!=null&&R.content)?String(R.content):"Failed to get bash output"]})}if(!t)return l.jsx("div",{className:"bashoutput-empty",children:"No output"});const y=((N=t.stdout)==null?void 0:N.split(`
113
+ `))||[],b=((j=t.stderr)==null?void 0:j.split(`
114
+ `))||[],S=y.length+b.length,w=S>Pg,_=w&&!i?y.slice(0,Pg):y;return l.jsxs("div",{className:"bashoutput-result",children:[l.jsxs("div",{className:"bashoutput-header",children:[l.jsx(eR,{status:t.status}),t.command&&l.jsx("code",{className:"bashoutput-command",children:t.command}),t.exitCode!==null&&l.jsxs("span",{className:`badge ${t.exitCode===0?"badge-success":"badge-error"}`,children:["exit ",t.exitCode]}),t.timestamp&&l.jsx("span",{className:"bashoutput-timestamp",children:JC(t.timestamp)}),v&&p&&l.jsx(Re,{toolName:"BashOutput",errors:p})]}),(t.stdout||t.stderr)&&l.jsxs(l.Fragment,{children:[t.stdout&&l.jsx("pre",{className:"bash-stdout code-block",children:l.jsx("code",{children:_.join(`
115
+ `)})}),t.stderr&&l.jsx("pre",{className:"bash-stderr code-block",children:l.jsx("code",{children:t.stderr})}),w&&l.jsx("button",{type:"button",className:"expand-button",onClick:()=>r(!i),children:i?"Show less":`Show all ${S} lines`})]})]})}const sR={tool:"BashOutput",renderToolUse(t,s){return l.jsx(tR,{input:t})},renderToolResult(t,s,i){return l.jsx(nR,{result:t,isError:s})},getUseSummary(t){return t.bash_id},getResultSummary(t,s){if(s)return"Error";const i=t;return i?i.status==="running"?"Running...":i.exitCode!==null?`exit ${i.exitCode}`:i.status:"Pending"}},Vg=20,aR=4,Gg=400;function Gd(t,s){return t?typeof t=="string"?{stdout:s?"":t,stderr:s?t:"",interrupted:!1,isImage:!1}:t:{stdout:"",stderr:"",interrupted:!1,isImage:!1}}function iR({input:t,result:s,isError:i}){const r=s?Gd(s,i):void 0,c=(r==null?void 0:r.stdout)||"",u=(r==null?void 0:r.stderr)||"";return l.jsxs("div",{className:"bash-modal-sections",children:[l.jsxs("div",{className:"bash-modal-section",children:[l.jsx("div",{className:"bash-modal-label",children:"Command"}),l.jsx("div",{className:"bash-modal-code",children:l.jsx("pre",{className:"code-block",children:l.jsx("code",{children:t.command})})})]}),c&&l.jsxs("div",{className:"bash-modal-section",children:[l.jsx("div",{className:"bash-modal-label",children:"Output"}),l.jsx("div",{className:"bash-modal-code",children:l.jsx("pre",{className:"code-block",children:l.jsx("code",{children:c})})})]}),u&&l.jsxs("div",{className:"bash-modal-section",children:[l.jsx("div",{className:"bash-modal-label bash-modal-label-error",children:i?"Error":"Stderr"}),l.jsx("div",{className:"bash-modal-code bash-modal-code-error",children:l.jsx("pre",{className:"code-block code-block-error",children:l.jsx("code",{children:u})})})]}),!c&&!u&&r&&!r.interrupted&&l.jsxs("div",{className:"bash-modal-section",children:[l.jsx("div",{className:"bash-modal-label",children:"Output"}),l.jsx("div",{className:"bash-modal-empty",children:"No output"})]}),(r==null?void 0:r.interrupted)&&l.jsx("div",{className:"bash-modal-section",children:l.jsx("span",{className:"badge badge-warning",children:"Interrupted"})}),(r==null?void 0:r.backgroundTaskId)&&l.jsx("div",{className:"bash-modal-section",children:l.jsxs("span",{className:"badge badge-info",children:["Background: ",r.backgroundTaskId]})})]})}function lR({input:t}){return l.jsx("div",{className:"bash-tool-use",children:l.jsx("pre",{className:"code-block",children:l.jsx("code",{children:t.command})})})}function rR({result:t,isError:s}){const[i,r]=m.useState(!1),{enabled:c,reportValidationError:u,isToolIgnored:f}=Mt(),[p,g]=m.useState(null),v=Gd(t,s);m.useEffect(()=>{if(c&&t&&typeof t=="object"){const j=Bt("Bash",t);!j.valid&&j.errors?(g(j.errors),u("Bash",j.errors)):g(null)}},[c,t,u]);const y=c&&p&&!f("Bash"),b=v.stdout||"",S=v.stderr||"",w=b.split(`
116
+ `),_=w.length>Vg,N=_&&!i?`${w.slice(0,Vg).join(`
117
+ `)}
118
+ ...`:b;return l.jsxs("div",{className:`bash-result ${s?"bash-result-error":""}`,children:[y&&p&&l.jsx(Re,{toolName:"Bash",errors:p}),(v==null?void 0:v.interrupted)&&l.jsx("span",{className:"badge badge-warning",children:"Interrupted"}),(v==null?void 0:v.backgroundTaskId)&&l.jsxs("span",{className:"badge badge-info",children:["Background: ",v.backgroundTaskId]}),b&&l.jsxs("div",{className:"bash-stdout",children:[l.jsx("pre",{className:"code-block",children:l.jsx("code",{children:N})}),_&&l.jsx("button",{type:"button",className:"expand-button",onClick:()=>r(!i),children:i?"Show less":`Show all ${w.length} lines`})]}),S&&l.jsx("div",{className:"bash-stderr",children:l.jsx("pre",{className:"code-block code-block-error",children:l.jsx("code",{children:S})})}),!b&&!S&&!(v!=null&&v.interrupted)&&l.jsx("div",{className:"bash-empty",children:"No output"})]})}function oR(t){const s=t.split(`
119
+ `);let i="",r=0,c=0;for(const u of s){if(c>=aR||r>=Gg)return{text:i.trimEnd(),truncated:!0};const f=Gg-r;if(u.length>f)return i+=`${u.slice(0,f)}...`,{text:i.trimEnd(),truncated:!0};i+=`${u}
120
+ `,r+=u.length+1,c++}return{text:i.trimEnd(),truncated:!1}}function cR({input:t,result:s,isError:i}){const[r,c]=m.useState(!1),{enabled:u,reportValidationError:f,isToolIgnored:p}=Mt(),[g,v]=m.useState(null),y=s?Gd(s,i):void 0;m.useEffect(()=>{if(u&&s&&typeof s=="object"){const C=Bt("Bash",s);!C.valid&&C.errors?(v(C.errors),f("Bash",C.errors)):v(null)}},[u,s,f]);const b=u&&g&&!p("Bash"),S=(y==null?void 0:y.stdout)||(y==null?void 0:y.stderr)||"",{text:w,truncated:_}=oR(S),N=w.length>0,j=m.useCallback(()=>{c(!0)},[]),R=m.useCallback(()=>{c(!1)},[]);return l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:"bash-collapsed-preview",onClick:j,children:[l.jsxs("div",{className:"bash-preview-row",children:[l.jsx("span",{className:"bash-preview-label",children:"IN"}),l.jsx("code",{className:"bash-preview-command",children:t.command}),b&&g&&l.jsx(Re,{toolName:"Bash",errors:g})]}),N&&l.jsxs("div",{className:"bash-preview-row bash-preview-output-row",children:[l.jsx("span",{className:"bash-preview-label",children:"OUT"}),l.jsxs("div",{className:`bash-preview-output ${_?"bash-preview-truncated":""} ${i||y!=null&&y.stderr?"bash-preview-error":""}`,children:[l.jsx("pre",{children:l.jsx("code",{children:w})}),_&&l.jsx("div",{className:"bash-preview-fade"})]})]}),!N&&y&&!y.interrupted&&l.jsxs("div",{className:"bash-preview-row",children:[l.jsx("span",{className:"bash-preview-label",children:"OUT"}),l.jsx("span",{className:"bash-preview-empty",children:"No output"})]}),(y==null?void 0:y.interrupted)&&l.jsxs("div",{className:"bash-preview-row",children:[l.jsx("span",{className:"bash-preview-label",children:"OUT"}),l.jsx("span",{className:"bash-preview-interrupted",children:"Interrupted"})]})]}),r&&l.jsx(Xn,{title:t.description||"Bash Command",onClose:R,children:l.jsx(iR,{input:t,result:y,isError:i})})]})}const uR={tool:"Bash",renderToolUse(t,s){return l.jsx(lR,{input:t})},renderToolResult(t,s,i){return l.jsx(rR,{result:t,isError:s})},getUseSummary(t){const s=t;return s.description?s.description:s.command.length>60?`${s.command.slice(0,57)}...`:s.command},getResultSummary(t,s){const i=t;return i!=null&&i.interrupted?"Interrupted":s||i!=null&&i.stderr?"Error":""},renderCollapsedPreview(t,s,i,r){return l.jsx(cR,{input:t,result:s,isError:i})}},dR=[{pattern:/^User denied permission\.?$/i,classification:"user_rejection",label:"Declined"},{pattern:/^User did not (approve|allow|permit)/i,classification:"user_rejection",label:"Declined"},{pattern:/^Permission denied by user/i,classification:"user_rejection",label:"Declined"},{pattern:/^Rejected by user/i,classification:"user_rejection",label:"Declined"},{pattern:/^The user doesn't want to proceed/i,classification:"user_rejection",label:"Declined"},{pattern:/^The user doesn't want to take this action/i,classification:"user_rejection",label:"Declined"},{pattern:/^\[Request interrupted by user/i,classification:"user_rejection",label:"Interrupted"},{pattern:/^User cancelled/i,classification:"user_rejection",label:"Cancelled"},{pattern:/^Plan mode - tools not executed/i,classification:"user_rejection",label:"Plan mode"},{pattern:/^Exit code [1-9]\d*/,classification:"command_failure",label:"Exit code"},{pattern:/ELIFECYCLE.*Command failed/,classification:"command_failure",label:"Command failed"},{pattern:/command not found/i,classification:"command_failure",label:"Not found"},{pattern:/Shell \d+ is not running/i,classification:"command_failure",label:"Shell stopped"},{pattern:/<tool_use_error>.*No shell found/i,classification:"command_failure",label:"Shell not found"},{pattern:/<tool_use_error>.*No task found/i,classification:"command_failure",label:"Task not found"},{pattern:/<tool_use_error>.*File has been modified since read/i,classification:"file_error",label:"File changed"},{pattern:/^File has been unexpectedly modified/i,classification:"file_error",label:"File changed"},{pattern:/<tool_use_error>.*File has not been read yet/i,classification:"file_error",label:"Not read yet"},{pattern:/<tool_use_error>.*File does not exist/i,classification:"file_error",label:"Not found"},{pattern:/<tool_use_error>.*No such file or directory/i,classification:"file_error",label:"Not found"},{pattern:/<tool_use_error>.*Permission denied/i,classification:"file_error",label:"Permission denied"},{pattern:/ENOENT/,classification:"file_error",label:"Not found"},{pattern:/EACCES/,classification:"file_error",label:"Permission denied"},{pattern:/No plan file found/i,classification:"file_error",label:"Plan not found"},{pattern:/<tool_use_error>.*Path does not exist/i,classification:"file_error",label:"Path not found"},{pattern:/<tool_use_error>.*old_string.*not found/i,classification:"validation_error",label:"Not found"},{pattern:/<tool_use_error>.*not unique/i,classification:"validation_error",label:"Not unique"},{pattern:/<tool_use_error>.*Found \d+ matches.*replace_all is false/i,classification:"validation_error",label:"Multiple matches"},{pattern:/<tool_use_error>.*InputValidationError/i,classification:"validation_error",label:"Invalid input"},{pattern:/Invalid (input|parameter|argument)/i,classification:"validation_error",label:"Invalid input"},{pattern:/<tool_use_error>.*No changes to make.*old_string and new_string are exactly the same/i,classification:"validation_error",label:"No changes"},{pattern:/<tool_use_error>.*String to replace not found/i,classification:"validation_error",label:"Not found"},{pattern:/File content.*exceeds maximum/i,classification:"validation_error",label:"Too large"},{pattern:/<tool_use_error>.*exceeds maximum allowed/i,classification:"validation_error",label:"Too large"},{pattern:/Agent type .* not found/i,classification:"validation_error",label:"Unknown agent"},{pattern:/^Request failed with status code/i,classification:"network_error",label:"Request failed"},{pattern:/ECONNREFUSED/,classification:"network_error",label:"Connection refused"},{pattern:/ENOTFOUND/,classification:"network_error",label:"Not found"},{pattern:/fetch failed/i,classification:"network_error",label:"Fetch failed"},{pattern:/Tool permission request failed/i,classification:"network_error",label:"Connection lost"},{pattern:/timed? ?out/i,classification:"timeout",label:"Timeout"},{pattern:/ETIMEDOUT/,classification:"timeout",label:"Timeout"}];function co(t){let s=t;return s=s.replace(/^Error:\s*/i,""),s=s.replace(/<\/?tool_use_error>/gi,""),s=s.trim(),s}function fR(t){const s=t.match(/provided the following reason[^:]*:\s*(.+)/is);if(s!=null&&s[1])return s[1].trim()}function hR(t){const s=co(t);return s.length>200||/exit code|ENOENT|EACCES|<tool_use_error>|command failed|permission denied|not found|does not exist/i.test(s)?!1:/^[a-zA-Z]/.test(s)&&s.includes(" ")&&!/^[A-Z_]+:/.test(s)&&!/\n.*\n/.test(s)}function wo(t){for(const{pattern:s,classification:i,label:r}of dR)if(s.test(t)){const c=co(t);if(i==="user_rejection"){const u=fR(t);if(u)return{classification:"user_rejection_with_reason",cleanedMessage:c,userReason:u,label:r}}return{classification:i,cleanedMessage:c,label:r}}if(hR(t)){const s=co(t);return{classification:"user_rejection_with_reason",cleanedMessage:s,userReason:s,label:"Declined"}}return{classification:"unknown",cleanedMessage:co(t),label:"Error"}}function ab(t){switch(t){case"user_rejection":case"user_rejection_with_reason":return"muted";default:return"warning"}}function ib(t){return t==="user_rejection"||t==="user_rejection_with_reason"}const Al=12;function Si(t){return t.split("/").pop()||t}function mR(t){return t.includes(".claude/plans/")}function lb(t){if(!t||t.length===0)return null;const s=t.flatMap(r=>r.lines).filter(r=>r.startsWith("+")).length,i=t.flatMap(r=>r.lines).filter(r=>r.startsWith("-")).length;return s>0&&i>0?`Modified ${s+i} lines`:s>0?`Added ${s} line${s!==1?"s":""}`:i>0?`Removed ${i} line${i!==1?"s":""}`:null}const Fd=m.memo(function({lines:s}){return l.jsx("div",{className:"diff-hunk",children:l.jsx("pre",{className:"diff-content",children:s.map((i,r)=>{const c=i[0],u=c==="-"?"diff-removed":c==="+"?"diff-added":"diff-context",f=`${r}-${i.slice(0,50)}`;return l.jsx("div",{className:u,children:i},f)})})})}),Yd=m.memo(function({diffHtml:s,truncateLines:i}){const r=m.useMemo(()=>{if(!i)return s;const c=/<span class="line[^"]*">/g,u=[...s.matchAll(c)];if(u.length<=i)return s;const f=u[i-1];if(!f)return s;const p=(f.index??0)+f[0].length,g=s.indexOf("</span>",p);return g===-1?s:`${s.slice(0,g+7)}</code></pre>`},[s,i]);return l.jsx("div",{className:"highlighted-diff",dangerouslySetInnerHTML:{__html:r}})}),pR=m.memo(function({hunk:s}){return l.jsx("div",{className:"diff-hunk",children:l.jsx("pre",{className:"diff-content",children:s.lines.map((i,r)=>{const c=i[0],u=c==="-"?"diff-removed":c==="+"?"diff-added":"diff-context";return l.jsx("div",{className:u,children:i},`${s.oldStart}-${r}`)})})})});function gR({input:t}){if(!t._structuredPatch||t._structuredPatch.length===0)return l.jsx("div",{className:"edit-result",children:l.jsx("div",{className:"edit-loading",children:"Computing diff..."})});const s=t._structuredPatch.flatMap(c=>c.lines),i=lb(t._structuredPatch),r=s.length>Al;return l.jsxs("div",{className:"edit-result",children:[i&&l.jsx("div",{className:"edit-change-summary",children:i}),l.jsxs("div",{className:`diff-view-container ${r?"truncated":""}`,children:[l.jsx("div",{className:"diff-view",children:t._diffHtml?l.jsx(Yd,{diffHtml:t._diffHtml,truncateLines:r?Al:void 0}):l.jsx(Fd,{lines:s})}),r&&l.jsx("div",{className:"diff-fade-overlay"})]})]})}function Xd({diffHtml:t,structuredPatch:s}){if(t)return l.jsx("div",{className:"diff-modal-content",children:l.jsx(Yd,{diffHtml:t})});const i=s.map(r=>r.lines.join(`
121
+ `)).join(`
122
+ `);return l.jsx("div",{className:"diff-modal-content",children:l.jsx(Fd,{lines:i.split(`
123
+ `)})})}function vR({input:t,result:s,isError:i}){const[r,c]=m.useState(!1),{enabled:u,reportValidationError:f,isToolIgnored:p}=Mt(),[g,v]=m.useState(null);m.useEffect(()=>{if(u&&s){const z=Bt("Edit",s);!z.valid&&z.errors?(v(z.errors),f("Edit",z.errors)):v(null)}},[u,s,f]);const y=u&&g&&!p("Edit"),b=m.useCallback(z=>{z.stopPropagation(),i||c(!0)},[i]),S=m.useCallback(()=>{c(!1)},[]),w=(s==null?void 0:s.filePath)??t.file_path,_=Si(w),N=(s==null?void 0:s.structuredPatch)??t._structuredPatch??[],j=t._diffHtml;if(i){let z=null;if(typeof s=="string")z=s;else if(typeof s=="object"&&s!==null){const D=s;D.content&&(z=String(D.content))}const H=z?wo(z):{classification:"unknown",label:"Error",cleanedMessage:""},T=ab(H.classification),O=ib(H.classification);return l.jsxs("div",{className:`edit-collapsed-preview edit-collapsed-${T}`,children:[y&&g&&l.jsx(Re,{toolName:"Edit",errors:g}),l.jsx("span",{className:`badge badge-${T}`,children:O?H.label:`Edit ${H.label.toLowerCase()}`}),H.userReason?l.jsx("span",{className:"edit-error-message",children:H.userReason}):H.cleanedMessage&&!O?l.jsx("span",{className:"edit-error-message",children:H.cleanedMessage}):null]})}if(N.length===0)return l.jsx("div",{className:"edit-collapsed-preview",children:l.jsx("div",{className:"edit-loading",children:"Computing diff..."})});const R=N.flatMap(z=>z.lines),C=R.length>Al;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"edit-collapsed-preview",children:[(s==null?void 0:s.userModified)&&l.jsx("span",{className:"badge badge-info",children:"User modified"}),y&&g&&l.jsx(Re,{toolName:"Edit",errors:g}),l.jsxs("div",{className:`diff-view-container ${C?"truncated":""}`,children:[l.jsx("div",{className:"diff-view",children:j?l.jsx(Yd,{diffHtml:j,truncateLines:C?Al:void 0}):l.jsx(Fd,{lines:R})}),C&&l.jsx("div",{className:"diff-fade-overlay"})]}),C&&l.jsx("button",{type:"button",className:"diff-expand-button",onClick:b,children:"Show full diff"})]}),r&&l.jsx(Xn,{title:l.jsx("span",{className:"file-path",children:_}),onClose:S,children:l.jsx(Xd,{diffHtml:j,structuredPatch:N})})]})}function yR({input:t,result:s,isError:i}){const[r,c]=m.useState(!1),{enabled:u,reportValidationError:f,isToolIgnored:p}=Mt(),[g,v]=m.useState(null);m.useEffect(()=>{if(u&&s){const j=Bt("Edit",s);!j.valid&&j.errors?(v(j.errors),f("Edit",j.errors)):v(null)}},[u,s,f]);const y=u&&g&&!p("Edit"),b=(s==null?void 0:s.filePath)??t.file_path,S=Si(b),w=(s==null?void 0:s.structuredPatch)??t._structuredPatch??[],_=t._diffHtml,N=lb(w);return i?l.jsxs("span",{children:[S,y&&g&&l.jsx(Re,{toolName:"Edit",errors:g})]}):w.length===0?l.jsx("span",{children:S}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:"file-link-inline",onClick:j=>{j.stopPropagation(),c(!0)},children:[S,N&&l.jsx("span",{className:"file-line-count-inline",children:N}),y&&g&&l.jsx(Re,{toolName:"Edit",errors:g})]}),r&&l.jsx(Xn,{title:l.jsx("span",{className:"file-path",children:S}),onClose:()=>c(!1),children:l.jsx(Xd,{diffHtml:_,structuredPatch:w})})]})}function bR({result:t,input:s,isError:i}){const[r,c]=m.useState(!1),{enabled:u,reportValidationError:f,isToolIgnored:p}=Mt(),[g,v]=m.useState(null);m.useEffect(()=>{if(u&&t){const _=Bt("Edit",t);!_.valid&&_.errors?(v(_.errors),f("Edit",_.errors)):v(null)}},[u,t,f]);const y=u&&g&&!p("Edit"),S=m.useMemo(()=>t!=null&&t.structuredPatch?t.structuredPatch.reduce((_,N)=>_+N.lines.length+1,0):0,[t==null?void 0:t.structuredPatch])>Al,w=m.useMemo(()=>{if(!(t!=null&&t.structuredPatch))return null;const _=t.structuredPatch.flatMap(j=>j.lines).filter(j=>j.startsWith("+")).length,N=t.structuredPatch.flatMap(j=>j.lines).filter(j=>j.startsWith("-")).length;return _>0&&N>0?`Modified ${_+N} lines`:_>0?`Added ${_} line${_!==1?"s":""}`:N>0?`Removed ${N} line${N!==1?"s":""}`:null},[t==null?void 0:t.structuredPatch]);if(i){let _=null;if(typeof t=="string")_=t;else if(typeof t=="object"&&t!==null){const C=t;C.content&&(_=String(C.content))}const N=_?wo(_):{classification:"unknown",label:"Error",cleanedMessage:""},j=ab(N.classification),R=ib(N.classification);return l.jsxs("div",{className:`edit-result edit-result-${j}`,children:[y&&g&&l.jsx(Re,{toolName:"Edit",errors:g}),l.jsx("span",{className:`badge badge-${j}`,children:R?N.label:`Edit ${N.label.toLowerCase()}`}),N.userReason?l.jsx("div",{className:"edit-error-message",children:N.userReason}):N.cleanedMessage&&!R?l.jsx("div",{className:"edit-error-message",children:N.cleanedMessage}):null]})}if(!(t!=null&&t.structuredPatch)||t.structuredPatch.length===0){const _=(t==null?void 0:t.filePath)||(s==null?void 0:s.file_path),N=(t==null?void 0:t.oldString)||(s==null?void 0:s.old_string)||"",j=(t==null?void 0:t.newString)||(s==null?void 0:s.new_string)||"",R=_?mR(_):!1;return l.jsxs("div",{className:"edit-result",children:[l.jsxs("div",{className:"edit-header",children:[l.jsx("span",{className:"file-path",children:_?Si(_):"File"}),R&&l.jsx("span",{className:"badge badge-muted",children:"Plan"}),(t==null?void 0:t.userModified)&&l.jsx("span",{className:"badge badge-info",children:"User modified"}),y&&g&&l.jsx(Re,{toolName:"Edit",errors:g})]}),l.jsxs("div",{className:"edit-simple",children:[l.jsxs("div",{className:"edit-old",children:[l.jsx("div",{className:"edit-label",children:"Removed:"}),l.jsx("pre",{className:"code-block",children:l.jsx("code",{children:N||"(empty)"})})]}),l.jsxs("div",{className:"edit-new",children:[l.jsx("div",{className:"edit-label",children:"Added:"}),l.jsx("pre",{className:"code-block",children:l.jsx("code",{children:j||"(empty)"})})]})]})]})}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"edit-result",children:[y&&g&&l.jsx(Re,{toolName:"Edit",errors:g}),w&&l.jsx("div",{className:"edit-change-summary",children:w}),t.userModified&&l.jsx("span",{className:"badge badge-info",children:"User modified"}),l.jsxs("div",{className:`diff-view-container ${S?"truncated":""}`,children:[l.jsx("div",{className:"diff-view",children:t.structuredPatch.map((_,N)=>l.jsx(pR,{hunk:_},`hunk-${_.oldStart}-${N}`))}),S&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"diff-fade-overlay"}),l.jsx("button",{type:"button",className:"diff-expand-button",onClick:_=>{_.stopPropagation(),c(!0)},children:"Click to expand"})]})]})]}),r&&l.jsx(Xn,{title:l.jsx("span",{className:"file-path",children:Si(t.filePath)}),onClose:()=>c(!1),children:l.jsx(Xd,{structuredPatch:t.structuredPatch})})]})}const xR={tool:"Edit",renderToolUse(t){return l.jsx(gR,{input:t})},renderToolResult(t,s,i,r){return l.jsx(bR,{result:t,input:r,isError:s})},getUseSummary(t){return Si(t.file_path)},getResultSummary(t,s){if(s){let r=null;if(typeof t=="string")r=t;else if(typeof t=="object"&&t!==null){const c=t;c.content&&(r=String(c.content))}return r?wo(r).label:"Error"}const i=t;return i!=null&&i.filePath?Si(i.filePath):"file"},renderCollapsedPreview(t,s,i){return l.jsx(vR,{input:t,result:s,isError:i})},renderInteractiveSummary(t,s,i,r){return l.jsx(yR,{input:t,result:s,isError:i})}};function SR({plan:t,renderedHtml:s}){return s?l.jsx("div",{dangerouslySetInnerHTML:{__html:s}}):l.jsx("pre",{style:{whiteSpace:"pre-wrap",fontFamily:"inherit"},children:t})}const jR={tool:"ExitPlanMode",renderToolUse(){return null},renderToolResult(){return null},renderInline(t,s,i,r){const c=t,u=s,f=(c==null?void 0:c.plan)||(u==null?void 0:u.plan),p=(c==null?void 0:c._renderedHtml)||(u==null?void 0:u._renderedHtml);if(i){const g=s;return l.jsx("div",{className:"exitplan-error",children:typeof s=="object"&&(g!=null&&g.content)?String(g.content):"Exit plan mode failed"})}return!f&&!p?r==="pending"?l.jsx("div",{className:"exitplan-pending",children:"Planning..."}):null:l.jsxs("details",{className:"exitplan-collapsible collapsible",open:!0,children:[l.jsxs("summary",{className:"collapsible__summary",children:[l.jsx("span",{children:r==="pending"?"Planning...":"Plan"}),l.jsx("span",{className:"collapsible__icon",children:"▸"})]}),l.jsx("div",{className:"collapsible__content",children:l.jsx("div",{className:`exitplan-inline ${r==="pending"?"pending":""}`,children:l.jsx(SR,{plan:f,renderedHtml:p})})})]})},getUseSummary(t){return"Exit plan mode"},getResultSummary(t,s){return s?"Error":"Plan"}},nd=20;function NR(t){return t.split("/").pop()||t}function wR({input:t}){return l.jsxs("div",{className:"glob-tool-use",children:[l.jsx("span",{className:"glob-pattern",children:t.pattern}),t.path&&l.jsxs("span",{className:"glob-path",children:["in ",t.path]})]})}function ER({result:t,isError:s}){const[i,r]=m.useState(!1),{enabled:c,reportValidationError:u,isToolIgnored:f}=Mt(),[p,g]=m.useState(null);m.useEffect(()=>{if(c&&t){const N=Bt("Glob",t);!N.valid&&N.errors?(g(N.errors),u("Glob",N.errors)):g(null)}},[c,t,u]);const v=c&&p&&!f("Glob");if(s){const N=t;return l.jsxs("div",{className:"glob-error",children:[v&&p&&l.jsx(Re,{toolName:"Glob",errors:p}),typeof t=="object"&&(N!=null&&N.content)?String(N.content):"Glob search failed"]})}if(!(t!=null&&t.filenames)||t.filenames.length===0)return l.jsxs("div",{className:"glob-empty",children:[v&&p&&l.jsx(Re,{toolName:"Glob",errors:p}),"No files found"]});const{filenames:y,numFiles:b,truncated:S}=t,w=y.length>nd,_=w&&!i?y.slice(0,nd):y;return l.jsxs("div",{className:"glob-result",children:[l.jsxs("div",{className:"glob-header",children:[l.jsxs("span",{className:"glob-count",children:[b," files"]}),S&&l.jsx("span",{className:"badge badge-warning",children:"truncated"}),v&&p&&l.jsx(Re,{toolName:"Glob",errors:p})]}),l.jsxs("div",{className:"file-list",children:[_.map(N=>l.jsxs("div",{className:"file-list-item",children:[l.jsx("span",{className:"file-path",children:NR(N)}),l.jsx("span",{className:"file-dir",children:N})]},N)),w&&!i&&l.jsxs("div",{className:"file-list-more",children:["... and ",y.length-nd," more"]})]}),w&&l.jsx("button",{type:"button",className:"expand-button",onClick:()=>r(!i),children:i?"Show less":`Show all ${y.length} files`})]})}const _R={tool:"Glob",renderToolUse(t,s){return l.jsx(wR,{input:t})},renderToolResult(t,s,i){return l.jsx(ER,{result:t,isError:s})},getUseSummary(t){return`pattern: "${t.pattern}"`},getResultSummary(t,s){if(s)return"Error";const i=t;return(i==null?void 0:i.numFiles)===void 0?"Searching...":i.numFiles===0?"No files found":`Found ${i.numFiles} files`}},sd=20,Fg=30;function kR(t){return t.split("/").pop()||t}function TR({input:t}){return l.jsxs("div",{className:"grep-tool-use",children:[l.jsx("span",{className:"grep-pattern",children:t.pattern}),t.glob&&l.jsxs("span",{className:"grep-glob",children:["(",t.glob,")"]}),t.path&&l.jsxs("span",{className:"grep-path",children:["in ",t.path]})]})}function CR({filenames:t,isExpanded:s,setIsExpanded:i}){const r=t.length>sd,c=r&&!s?t.slice(0,sd):t;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"file-list",children:[c.map(u=>l.jsxs("div",{className:"file-list-item",children:[l.jsx("span",{className:"file-path",children:kR(u)}),l.jsx("span",{className:"file-dir",children:u})]},u)),r&&!s&&l.jsxs("div",{className:"file-list-more",children:["... and ",t.length-sd," more"]})]}),r&&l.jsx("button",{type:"button",className:"expand-button",onClick:()=>i(!s),children:s?"Show less":`Show all ${t.length} files`})]})}function RR({content:t,isExpanded:s,setIsExpanded:i}){const r=t.split(`
124
+ `),c=r.length>Fg,u=c&&!s?r.slice(0,Fg):r;return l.jsxs(l.Fragment,{children:[l.jsx("pre",{className:"grep-content code-block",children:l.jsx("code",{children:u.join(`
125
+ `)})}),c&&l.jsx("button",{type:"button",className:"expand-button",onClick:()=>i(!s),children:s?"Show less":`Show all ${r.length} lines`})]})}function AR({result:t,isError:s}){const[i,r]=m.useState(!1),{enabled:c,reportValidationError:u,isToolIgnored:f}=Mt(),[p,g]=m.useState(null);m.useEffect(()=>{if(c&&t){const N=Bt("Grep",t);!N.valid&&N.errors?(g(N.errors),u("Grep",N.errors)):g(null)}},[c,t,u]);const v=c&&p&&!f("Grep");if(s){const N=t;return l.jsxs("div",{className:"grep-error",children:[v&&p&&l.jsx(Re,{toolName:"Grep",errors:p}),typeof t=="object"&&(N!=null&&N.content)?String(N.content):"Search failed"]})}if(!t)return l.jsx("div",{className:"grep-empty",children:"No results"});const{mode:y,filenames:b,numFiles:S,content:w,appliedLimit:_}=t;if(y==="count")return l.jsxs("div",{className:"grep-result",children:[v&&p&&l.jsx(Re,{toolName:"Grep",errors:p}),l.jsxs("div",{className:"grep-count-summary",children:[S," ",S===1?"file":"files"," matched"]})]});if(y==="content"&&w){const j=w.split(`
126
+ `).filter(R=>/(^|:)\d+:/.test(R)).length;return l.jsxs("div",{className:"grep-result",children:[l.jsxs("div",{className:"grep-header",children:[l.jsxs("span",{className:"grep-count",children:[j," ",j===1?"match":"matches"]}),_&&l.jsxs("span",{className:"badge badge-info",children:["limit: ",_]}),v&&p&&l.jsx(Re,{toolName:"Grep",errors:p})]}),l.jsx(RR,{content:w,isExpanded:i,setIsExpanded:r})]})}return!b||b.length===0?l.jsxs("div",{className:"grep-empty",children:[v&&p&&l.jsx(Re,{toolName:"Grep",errors:p}),"No matches found"]}):l.jsxs("div",{className:"grep-result",children:[l.jsxs("div",{className:"grep-header",children:[l.jsxs("span",{className:"grep-count",children:[S," files"]}),v&&p&&l.jsx(Re,{toolName:"Grep",errors:p})]}),l.jsx(CR,{filenames:b,isExpanded:i,setIsExpanded:r})]})}const MR={tool:"Grep",renderToolUse(t,s){return l.jsx(TR,{input:t})},renderToolResult(t,s,i){return l.jsx(AR,{result:t,isError:s})},getUseSummary(t){return t.pattern},getResultSummary(t,s){if(s)return"Error";const i=t;if(!i)return"Results";if(i.mode==="content"&&i.content){const r=i.content.split(`
127
+ `).filter(c=>/(^|:)\d+:/.test(c)).length;return`${r} ${r===1?"match":"matches"}`}return i.numFiles!==void 0?`${i.numFiles} files`:"Results"}};function zR({input:t}){return l.jsxs("div",{className:"killshell-tool-use",children:[l.jsx("span",{className:"killshell-label",children:"Killing shell"}),l.jsx("code",{className:"killshell-id",children:t.shell_id})]})}function OR({result:t,isError:s}){const{enabled:i,reportValidationError:r,isToolIgnored:c}=Mt(),[u,f]=m.useState(null);m.useEffect(()=>{if(i&&t){const g=Bt("KillShell",t);!g.valid&&g.errors?(f(g.errors),r("KillShell",g.errors)):f(null)}},[i,t,r]);const p=i&&u&&!c("KillShell");if(s){const g=t;return l.jsxs("div",{className:"killshell-error",children:[p&&u&&l.jsx(Re,{toolName:"KillShell",errors:u}),typeof t=="object"&&(g!=null&&g.content)?String(g.content):"Failed to kill shell"]})}return t?l.jsxs("div",{className:"killshell-result",children:[p&&u&&l.jsx(Re,{toolName:"KillShell",errors:u}),l.jsx("span",{className:"killshell-message",children:t.message}),t.shell_id&&l.jsx("code",{className:"killshell-id",children:t.shell_id})]}):l.jsx("div",{className:"killshell-empty",children:"No result"})}const DR={tool:"KillShell",renderToolUse(t,s){return l.jsx(zR,{input:t})},renderToolResult(t,s,i){return l.jsx(OR,{result:t,isError:s})},getUseSummary(t){return t.shell_id},getResultSummary(t,s){if(s)return"Error";const i=t;return(i==null?void 0:i.message)||"Killed"}};function Ta(t){return t.split("/").pop()||t}function LR({input:t}){const s=Ta(t.file_path);return l.jsxs("div",{className:"read-tool-use",children:[l.jsx("span",{className:"file-path",children:s}),(t.offset!==void 0||t.limit!==void 0)&&l.jsxs("span",{className:"read-range",children:[t.offset!==void 0&&` from line ${t.offset}`,t.limit!==void 0&&` (${t.limit} lines)`]})]})}function rb({file:t,highlightedHtml:s,highlightedTruncated:i,renderedMarkdownHtml:r}){const[c,u]=m.useState(!1),f=t.content.split(`
128
+ `),g=!!r&&l.jsxs("div",{className:"markdown-view-toggle",children:[l.jsx("button",{type:"button",className:`toggle-btn ${c?"":"active"}`,onClick:()=>u(!1),children:"Source"}),l.jsx("button",{type:"button",className:`toggle-btn ${c?"active":""}`,onClick:()=>u(!0),children:"Preview"})]});return c&&r?l.jsxs("div",{className:"file-content-modal",children:[g,l.jsx("div",{className:"markdown-preview",children:l.jsx("div",{className:"markdown-rendered",dangerouslySetInnerHTML:{__html:r}})})]}):s?l.jsxs("div",{className:"file-content-modal",children:[g,l.jsxs("div",{className:"file-viewer-code file-viewer-code-highlighted",children:[l.jsx("div",{className:"shiki-container",dangerouslySetInnerHTML:{__html:s}}),i&&l.jsx("div",{className:"file-viewer-truncated",children:"Content truncated for highlighting (showing first 2000 lines)"})]})]}):l.jsxs("div",{className:"file-content-modal",children:[g,l.jsxs("div",{className:"file-content-with-lines",children:[l.jsx("div",{className:"line-numbers",children:f.map((v,y)=>l.jsx("div",{children:t.startLine+y},`ln-${y+1}`))}),l.jsx("pre",{className:"line-content",children:l.jsx("code",{children:t.content})})]})]})}function ob({file:t}){const s=Ta(t.filePath),i=t.startLine>1||t.numLines<t.totalLines;return l.jsxs("span",{className:"file-path",children:[s,i&&l.jsxs("span",{className:"file-range",children:[" ","(lines ",t.startLine,"-",t.startLine+t.numLines-1," of"," ",t.totalLines,")"]})]})}function UR({file:t,highlightedHtml:s,highlightedTruncated:i,renderedMarkdownHtml:r}){const[c,u]=m.useState(!1),f=Ta(t.filePath),p=t.startLine>1||t.numLines<t.totalLines;return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"read-text-result",children:l.jsxs("button",{type:"button",className:"file-link-button",onClick:()=>u(!0),children:[f,p&&l.jsxs("span",{className:"file-range",children:[" ","(lines ",t.startLine,"-",t.startLine+t.numLines-1,")"]}),l.jsxs("span",{className:"file-line-count",children:[t.numLines," lines"]})]})}),c&&l.jsx(Xn,{title:l.jsx(ob,{file:t}),onClose:()=>u(!1),children:l.jsx(rb,{file:t,highlightedHtml:s,highlightedTruncated:i,renderedMarkdownHtml:r})})]})}function cb({file:t}){const s=t.originalSize?Math.round(t.originalSize/1024):0,{dimensions:i}=t,r=(i==null?void 0:i.originalWidth)!=null&&(i==null?void 0:i.originalHeight)!=null;return l.jsxs("div",{className:"read-image-result",children:[(r||s>0)&&l.jsxs("div",{className:"image-info",children:[r&&l.jsxs(l.Fragment,{children:[i.originalWidth,"x",i.originalHeight]}),r&&s>0&&" ",s>0&&l.jsxs(l.Fragment,{children:["(",s,"KB)"]})]}),l.jsx("img",{className:"read-image",src:`data:${t.type};base64,${t.base64}`,alt:"File content",width:i==null?void 0:i.displayWidth,height:i==null?void 0:i.displayHeight})]})}function $R({result:t,isError:s}){const{enabled:i,reportValidationError:r,isToolIgnored:c}=Mt(),[u,f]=m.useState(null);m.useEffect(()=>{if(i&&t){const g=Bt("Read",t);!g.valid&&g.errors?(f(g.errors),r("Read",g.errors)):f(null)}},[i,t,r]);const p=i&&u&&!c("Read");if(s||!(t!=null&&t.file)){const g=t;return l.jsxs("div",{className:"read-error",children:[p&&u&&l.jsx(Re,{toolName:"Read",errors:u}),typeof t=="object"&&(g!=null&&g.content)?String(g.content):"Failed to read file"]})}return t.type==="image"?l.jsxs(l.Fragment,{children:[p&&u&&l.jsx(Re,{toolName:"Read",errors:u}),l.jsx(cb,{file:t.file})]}):l.jsxs(l.Fragment,{children:[p&&u&&l.jsx(Re,{toolName:"Read",errors:u}),l.jsx(UR,{file:t.file,highlightedHtml:t._highlightedContentHtml,highlightedTruncated:t._highlightedTruncated,renderedMarkdownHtml:t._renderedMarkdownHtml})]})}function BR({input:t,result:s,isError:i}){const[r,c]=m.useState(!1),{enabled:u,reportValidationError:f,isToolIgnored:p}=Mt(),[g,v]=m.useState(null);m.useEffect(()=>{if(u&&s){const w=Bt("Read",s);!w.valid&&w.errors?(v(w.errors),f("Read",w.errors)):v(null)}},[u,s,f]);const y=u&&g&&!p("Read"),b=Ta(t.file_path);if(i)return l.jsxs("span",{children:[b,y&&g&&l.jsx(Re,{toolName:"Read",errors:g})]});if(!(s!=null&&s.file))return l.jsx("span",{children:b});if(s.type==="image"){const w=s.file;return l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:"file-link-inline",onClick:_=>{_.stopPropagation(),c(!0)},children:[b,l.jsx("span",{className:"file-line-count-inline",children:"(image)"}),y&&g&&l.jsx(Re,{toolName:"Read",errors:g})]}),r&&l.jsx(Xn,{title:b,onClose:()=>c(!1),children:l.jsx(cb,{file:w})})]})}const S=s.file;return l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:"file-link-inline",onClick:w=>{w.stopPropagation(),c(!0)},children:[b,l.jsxs("span",{className:"file-line-count-inline",children:[S.numLines," lines"]}),y&&g&&l.jsx(Re,{toolName:"Read",errors:g})]}),r&&l.jsx(Xn,{title:l.jsx(ob,{file:S}),onClose:()=>c(!1),children:l.jsx(rb,{file:S,highlightedHtml:s._highlightedContentHtml,highlightedTruncated:s._highlightedTruncated,renderedMarkdownHtml:s._renderedMarkdownHtml})})]})}const IR={tool:"Read",renderToolUse(t,s){return l.jsx(LR,{input:t})},renderToolResult(t,s,i){return l.jsx($R,{result:t,isError:s})},getUseSummary(t){return Ta(t.file_path)},getResultSummary(t,s,i){if(s&&i)return Ta(i.file_path);if(s)return"Error";const r=t;if(!(r!=null&&r.file))return"Reading...";const c=Ta(r.type==="image"?"image":r.file.filePath);return r.type==="image"?"Image":c},renderInteractiveSummary(t,s,i,r){return l.jsx(BR,{input:t,result:s,isError:i})}},Yg=20;function Xg({status:t}){const i={running:{icon:"⟳",className:"status-running"},completed:{icon:"✓",className:"status-completed"},failed:{icon:"✗",className:"status-failed"},timeout:{icon:"⏱",className:"status-timeout"}}[t]||{icon:"?",className:""};return l.jsxs("span",{className:`taskoutput-status ${i.className}`,children:[i.icon," ",t]})}function HR({input:t}){return l.jsxs("div",{className:"taskoutput-tool-use",children:[l.jsx("span",{className:"taskoutput-label",children:"Polling task"}),l.jsx("code",{className:"taskoutput-id",children:t.task_id}),t.block!==void 0&&l.jsx("span",{className:"badge",children:t.block?"blocking":"non-blocking"}),t.timeout!==void 0&&l.jsxs("span",{className:"badge",children:["timeout: ",t.timeout,"ms"]})]})}function ZR({result:t,isError:s}){var _;const[i,r]=m.useState(!1),{enabled:c,reportValidationError:u,isToolIgnored:f}=Mt(),[p,g]=m.useState(null);m.useEffect(()=>{if(c&&t){const N=Bt("TaskOutput",t);!N.valid&&N.errors?(g(N.errors),u("TaskOutput",N.errors)):g(null)}},[c,t,u]);const v=c&&p&&!f("TaskOutput");if(s){const N=t;return l.jsxs("div",{className:"taskoutput-error",children:[v&&p&&l.jsx(Re,{toolName:"TaskOutput",errors:p}),typeof t=="object"&&(N!=null&&N.content)?String(N.content):"Failed to get task output"]})}if(!t)return l.jsx("div",{className:"taskoutput-empty",children:"No output"});const y=t.task,b=((_=y==null?void 0:y.output)==null?void 0:_.split(`
129
+ `))||[],S=b.length>Yg,w=S&&!i?b.slice(0,Yg):b;return l.jsxs("div",{className:"taskoutput-result",children:[l.jsxs("div",{className:"taskoutput-header",children:[l.jsx(Xg,{status:t.retrieval_status}),(y==null?void 0:y.task_type)&&l.jsx("span",{className:"badge badge-info",children:y.task_type}),(y==null?void 0:y.description)&&l.jsx("span",{className:"taskoutput-desc",children:y.description}),v&&p&&l.jsx(Re,{toolName:"TaskOutput",errors:p})]}),y&&l.jsxs("div",{className:"taskoutput-task",children:[l.jsxs("div",{className:"taskoutput-task-status",children:[l.jsx(Xg,{status:y.status}),y.exitCode!==null&&l.jsxs("span",{className:`badge ${y.exitCode===0?"badge-success":"badge-error"}`,children:["exit ",y.exitCode]})]}),y.output&&l.jsxs(l.Fragment,{children:[l.jsx("pre",{className:"taskoutput-content code-block",children:l.jsx("code",{children:w.join(`
130
+ `)})}),S&&l.jsx("button",{type:"button",className:"expand-button",onClick:()=>r(!i),children:i?"Show less":`Show all ${b.length} lines`})]})]})]})}const qR={tool:"TaskOutput",renderToolUse(t,s){return l.jsx(HR,{input:t})},renderToolResult(t,s,i){return l.jsx(ZR,{result:t,isError:s})},getUseSummary(t){return t.task_id},getResultSummary(t,s){if(s)return"Error";const i=t;return i?i.retrieval_status:"Pending"}},ub=m.createContext(null);function PR({children:t,agentContent:s,setAgentContent:i,toolUseToAgent:r,projectId:c,sessionId:u}){const[f,p]=m.useState(new Set),g=m.useRef(new Set),v=m.useCallback(async(S,w,_)=>{if(g.current.has(_))return s[_]??{messages:[],status:"pending"};if(f.has(_))return new Promise(N=>{const j=setInterval(()=>{g.current.has(_)&&(clearInterval(j),N(s[_]??{messages:[],status:"pending"}))},100);setTimeout(()=>{clearInterval(j),N({messages:[],status:"pending"})},3e4)});p(N=>new Set(N).add(_));try{const N=await Ne.getAgentSession(S,w,_);return g.current.add(_),i(j=>{const R=j[_],C=(R==null?void 0:R.messages)??[],z=N.messages,H=new Map;for(const O of z)H.set(en(O),O);for(const O of C){const D=en(O);H.has(D)||H.set(D,O)}const T=(R==null?void 0:R.status)==="running"?"running":N.status;return{...j,[_]:{messages:Array.from(H.values()),status:T}}}),{messages:N.messages,status:N.status}}catch(N){return console.error(`Failed to load agent content for ${_}:`,N),{messages:[],status:"failed"}}finally{p(N=>{const j=new Set(N);return j.delete(_),j})}},[s,f,i]),y=m.useCallback(S=>f.has(S),[f]),b={agentContent:s,toolUseToAgent:r,loadAgentContent:v,isLoading:y,projectId:c};return l.jsx(ub.Provider,{value:b,children:t})}function VR({block:t}){return l.jsxs("div",{className:"fallback-block",children:[l.jsx("div",{className:"fallback-type",children:t.type}),l.jsx("pre",{className:"fallback-content",children:l.jsx("code",{children:JSON.stringify(t,null,2)})})]})}const GR={type:[],render(t,s){return l.jsx(VR,{block:t,context:s})}};function FR({block:t}){return t._renderedHtml?l.jsx("div",{className:"text-block",dangerouslySetInnerHTML:{__html:t._renderedHtml}}):l.jsx("div",{className:"text-block",children:l.jsx("pre",{style:{whiteSpace:"pre-wrap",fontFamily:"inherit"},children:t.text})})}const YR={type:"text",render(t,s){return l.jsx(FR,{block:t})},getSummary(t){const s=t.text;return s.length>100?`${s.slice(0,97)}...`:s}};function XR({block:t,context:s}){const i=t.thinking||"";if(s.thinkingExpanded??!1)return l.jsxs("button",{type:"button",className:"thinking-block thinking-block-expanded",onClick:s.toggleThinkingExpanded,"aria-expanded":!0,children:[l.jsxs("div",{className:"thinking-toggle-expanded",children:[l.jsx("span",{className:"thinking-label",children:"Thinking"}),l.jsx("span",{className:"thinking-icon",children:"▲"})]}),l.jsx("div",{className:"thinking-content",children:i})]});const c=s.isStreaming?"thinking-block thinking-streaming-collapsed":"thinking-block";return l.jsx("div",{className:c,children:l.jsxs("button",{type:"button",className:"thinking-toggle-collapsed",onClick:s.toggleThinkingExpanded,"aria-expanded":!1,children:[l.jsx("span",{className:"thinking-label",children:s.isStreaming?"Thinking...":"Thinking"}),l.jsx("span",{className:"thinking-icon",children:"▼"})]})})}const KR={type:"thinking",render(t,s){return l.jsx(XR,{block:t,context:s})},getSummary(t){const i=(t.thinking||"").split(`
131
+ `)[0]||"";return i.length>80?`${i.slice(0,77)}...`:i}};function QR({block:t,context:s}){var f;const i=(f=s.getToolUse)==null?void 0:f.call(s,t.tool_use_id),r=(i==null?void 0:i.name)||"Unknown",c=t.is_error===!0;let u=s.toolUseResult;if(!u&&t.content)try{u=JSON.parse(t.content)}catch{u={content:t.content}}return l.jsxs("div",{className:`tool-block tool-result ${c?"tool-error":""}`,children:[l.jsxs("div",{className:"tool-header",children:[l.jsx("span",{className:"tool-icon",children:"<"}),l.jsx("span",{className:"tool-name",children:r}),c&&l.jsx("span",{className:"badge badge-error",children:"Error"})]}),l.jsx("div",{className:"tool-content",children:rt.renderToolResult(r,u,c,s)})]})}const WR={type:"tool_result",render(t,s){return l.jsx(QR,{block:t,context:s})},getSummary(t){return t.is_error?"Error":"Result"}};function JR({block:t,context:s}){return l.jsxs("div",{className:"tool-block tool-use",children:[l.jsxs("div",{className:"tool-header",children:[l.jsx("span",{className:"tool-icon",children:">"}),l.jsx("span",{className:"tool-name",children:t.name})]}),l.jsx("div",{className:"tool-content",children:rt.renderToolUse(t.name,t.input,s)})]})}const eA={type:"tool_use",render(t,s){return l.jsx(JR,{block:t,context:s})},getSummary(t){var r;const s=t,i=rt.get(s.name);return((r=i.getUseSummary)==null?void 0:r.call(i,s.input))||s.name}};class tA{constructor(s){Ke(this,"renderers",new Map);Ke(this,"fallback");this.fallback=s}register(s){const i=Array.isArray(s.type)?s.type:[s.type];for(const r of i)this.renderers.set(r,s)}getRenderer(s){return this.renderers.get(s.type)||this.fallback}render(s,i){return this.getRenderer(s).render(s,i)}}const Dl=new tA(GR);Dl.register(YR);Dl.register(KR);Dl.register(eA);Dl.register(WR);const db=m.memo(function({block:s,context:i}){return l.jsx(l.Fragment,{children:Dl.render(s,i)})}),Kg=200,Qg=80;function nA(t){if(!t)return null;let s="";if(typeof t=="string")s=t;else if(typeof t=="object"&&t!==null&&"content"in t){const c=t.content;if(typeof c=="string")s=c;else if(Array.isArray(c)){for(const u of c)if(typeof u=="object"&&u!==null&&"type"in u&&u.type==="text"&&"text"in u){s=String(u.text);break}}}if(!s)return null;const i=wo(s),r=i.cleanedMessage.length>Qg?`${i.cleanedMessage.slice(0,Qg)}...`:i.cleanedMessage;return{raw:s,summary:r,label:i.label}}function fb(t){return t<1e3?`${t}ms`:t<6e4?`${(t/1e3).toFixed(1)}s`:`${(t/6e4).toFixed(1)}m`}function sA({input:t}){const[s,i]=m.useState(!1),r=t.prompt.length>Kg?`${t.prompt.slice(0,Kg)}...`:t.prompt;return l.jsxs("div",{className:"task-tool-use",children:[l.jsxs("div",{className:"task-header",children:[l.jsx("span",{className:"task-description",children:t.description}),l.jsx("span",{className:"badge badge-info",children:t.subagent_type}),t.model&&l.jsx("span",{className:"badge",children:t.model})]}),t.prompt&&l.jsxs("div",{className:"task-prompt",children:[l.jsx("button",{type:"button",className:"task-prompt-toggle",onClick:()=>i(!s),children:s?"Hide prompt":"Show prompt"}),s&&l.jsx("pre",{className:"task-prompt-content",children:l.jsx("code",{children:s?t.prompt:r})})]})]})}function aA({messages:t,isStreaming:s}){const[i,r]=m.useState(!1),c=m.useCallback(()=>{r(f=>!f)},[]),u=m.useMemo(()=>Vd(t),[t]);return l.jsx("div",{className:"task-nested-content",children:u.map(f=>l.jsx(Nd,{item:f,isStreaming:s,thinkingExpanded:i,toggleThinkingExpanded:c},f.id))})}function iA({input:t,result:s,isError:i,status:r,toolUseId:c}){var ue;const u=m.useContext(ub),{reportValidationError:f,enabled:p,isToolIgnored:g}=Mt(),v=(s==null?void 0:s.agentId)??(c?u==null?void 0:u.toolUseToAgent.get(c):void 0),y=v?u==null?void 0:u.agentContent[v]:void 0,S=!((s==null?void 0:s.status)==="completed"||(s==null?void 0:s.status)==="failed")&&(r==="pending"||(y==null?void 0:y.status)==="running"),[w,_]=m.useState(!1),[N,j]=m.useState(!1),R=m.useRef(null),C=m.useRef(!0),z=m.useRef(!1),H=m.useRef(0),T=m.useCallback(k=>{z.current=!0,k.scrollTop=k.scrollHeight-k.clientHeight,H.current=k.scrollHeight,requestAnimationFrame(()=>{z.current=!1})},[]),O=m.useCallback(()=>{if(z.current)return;const k=R.current;if(!k)return;const U=100,I=k.scrollHeight-k.scrollTop-k.clientHeight;C.current=I<U},[]);m.useEffect(()=>{const k=R.current;if(!(!k||!w))return k.addEventListener("scroll",O),()=>{k.removeEventListener("scroll",O)}},[O,w]),m.useEffect(()=>{const k=R.current;if(!k||!w||!S)return;H.current=k.scrollHeight;const U=new ResizeObserver(()=>{const I=k.scrollHeight;I>H.current&&C.current?T(k):H.current=I});for(const I of k.children)U.observe(I);return U.observe(k),()=>{U.disconnect()}},[w,S,T]),m.useEffect(()=>{if(w&&S){C.current=!0;const k=R.current;k&&requestAnimationFrame(()=>{T(k)})}},[w,S,T]);const D=m.useRef(!1);m.useEffect(()=>{if(!w||!v||!u||D.current)return;D.current=!0,(async()=>{j(!0);try{const U=document.querySelector("[data-session-id]"),I=document.querySelector("[data-project-id]"),oe=(I==null?void 0:I.getAttribute("data-project-id"))||"",he=(U==null?void 0:U.getAttribute("data-session-id"))||"";await u.loadAgentContent(oe,he,v)}finally{j(!1)}})()},[w,v,u]);const[F,ne]=m.useState(null);m.useEffect(()=>{if(!s||!p){ne(null);return}const k=Bt("Task",s);!k.valid&&k.errors?(ne(k.errors),f("Task",k.errors)):ne(null)},[s,p,f]);const ce=p&&F!==null&&!g("Task"),de=async()=>{const k=(y==null?void 0:y.messages)&&y.messages.length>0;if(!w&&v&&u&&!k){_(!0),j(!0);try{const U=document.querySelector("[data-session-id]"),I=document.querySelector("[data-project-id]"),oe=(I==null?void 0:I.getAttribute("data-project-id"))||"",he=(U==null?void 0:U.getAttribute("data-session-id"))||"";await u.loadAgentContent(oe,he,v)}finally{j(!1)}}else _(!w)},q=i?nA(s):null,le=i?{class:"badge-error",text:(q==null?void 0:q.label)??"failed"}:r==="aborted"?{class:"badge-warning",text:"interrupted"}:S?{class:"badge-running",text:"running"}:(s==null?void 0:s.status)==="completed"?{class:"badge-success",text:"completed"}:(s==null?void 0:s.status)==="failed"?{class:"badge-error",text:"failed"}:{class:"badge-pending",text:"pending"};return l.jsxs("div",{className:`task-inline ${w?"expanded":"collapsed"} status-${le.text}`,children:[l.jsxs("button",{type:"button",className:"task-inline-header",onClick:de,children:[l.jsx("span",{className:"task-expand-icon",children:w?"▼":"▶"}),l.jsx("span",{className:"badge badge-info task-agent-type",children:t.subagent_type}),l.jsx("span",{className:"task-inline-title",children:t.description}),t.model&&l.jsx("span",{className:"badge task-model",children:t.model}),S&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"task-spinner","aria-label":"Running",children:l.jsx(Wg,{})}),(y==null?void 0:y.contextUsage)&&l.jsxs("span",{className:"task-context-usage",children:[y.contextUsage.percentage.toFixed(0),"% context"]})]}),!S&&l.jsx("span",{className:`badge ${le.class}`,children:le.text}),!w&&q&&l.jsx("span",{className:"task-error-summary",title:q.raw,children:q.summary}),s&&!i&&l.jsxs("span",{className:"task-stats",children:[fb(s.totalDurationMs??0)," ·"," ",(s.totalTokens??0).toLocaleString()," tokens"]}),ce&&F&&l.jsx(Re,{toolName:"Task",errors:F})]}),N&&l.jsxs("div",{className:"task-loading",children:[l.jsx(Wg,{})," Loading agent content..."]}),w&&l.jsxs("div",{className:"task-inline-content",ref:R,children:[q&&l.jsx("div",{className:"task-error-details",children:l.jsx("pre",{className:"task-error-message",children:q.raw})}),!q&&(y!=null&&y.messages.length)?l.jsx(aA,{messages:y.messages,isStreaming:S}):!q&&((ue=s==null?void 0:s.content)!=null&&ue.length)?l.jsx("div",{className:"task-content",children:s.content.map(k=>{var U;return l.jsx(db,{block:k,context:{isStreaming:!1,theme:"dark"}},k.id??`${v}-${k.type}-${((U=k.text)==null?void 0:U.slice(0,20))??""}`)})}):q?null:l.jsx("div",{className:"task-empty",children:S?"Waiting for agent activity...":"No content"})]})]})}function Wg(){return l.jsx("svg",{className:"spinner",viewBox:"0 0 16 16",width:"12",height:"12","aria-hidden":"true",children:l.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"24",strokeDashoffset:"8"})})}function lA({result:t,isError:s}){const[i,r]=m.useState(!0);if(s)return l.jsx("div",{className:"task-error",children:typeof t=="object"&&"content"in t?String(t.content):"Task failed"});if(!t)return l.jsx("div",{className:"task-empty",children:"No result"});const c=t.status==="completed"?"badge-success":t.status==="failed"?"badge-error":"badge-warning";return l.jsxs("div",{className:"task-result",children:[l.jsxs("div",{className:"task-result-header",children:[l.jsx("span",{className:`badge ${c}`,children:t.status}),l.jsxs("span",{className:"task-stats",children:[fb(t.totalDurationMs??0)," ·"," ",(t.totalTokens??0).toLocaleString()," tokens ·"," ",t.totalToolUseCount??0," tools"]}),l.jsx("button",{type:"button",className:"expand-button",onClick:()=>r(!i),children:i?"Collapse":"Expand"})]}),i&&t.content&&t.content.length>0&&l.jsx("div",{className:"task-content",children:t.content.map((u,f)=>l.jsx(db,{block:u,context:{isStreaming:!1,theme:"dark"}},`${t.agentId}-${f}`))})]})}const rA={tool:"Task",renderToolUse(t,s){return l.jsx(sA,{input:t})},renderToolResult(t,s,i){return l.jsx(lA,{result:t,isError:s})},getUseSummary(t){return t.description},getResultSummary(t,s){if(s)return"Error";const i=t;return i!=null&&i.status?`${i.status} (${i.totalToolUseCount} tools)`:"Complete"},renderInline(t,s,i,r,c){return l.jsx(iA,{input:t,result:s,isError:i,status:r,toolUseId:c.toolUseId})}};function oA(t){switch(t){case"pending":return"□";case"in_progress":return"❋";case"completed":return"✓";default:return"□"}}function cA({todo:t}){const s=`todo-status-${t.status}`,i=t.status==="completed";return l.jsxs("div",{className:`todo-item ${s}`,children:[l.jsx("span",{className:"todo-checkbox",children:oA(t.status)}),l.jsx("span",{className:`todo-content ${i?"todo-completed":""}`,children:t.content})]})}function uA({input:t}){if(!(t!=null&&t.todos)||t.todos.length===0)return l.jsx("div",{className:"todo-empty",children:"No todos specified"});const s=t.todos.filter(c=>c.status==="in_progress"),i=t.todos.filter(c=>c.status==="pending"),r=t.todos.filter(c=>c.status==="completed");return l.jsx("div",{className:"todo-tool-use",children:l.jsxs("span",{className:"todo-summary",children:[s.length>0&&`${s.length} in progress`,s.length>0&&(i.length>0||r.length>0)&&", ",i.length>0&&`${i.length} pending`,i.length>0&&r.length>0&&", ",r.length>0&&`${r.length} completed`]})})}function dA({result:t,isError:s}){const{enabled:i,reportValidationError:r,isToolIgnored:c}=Mt(),[u,f]=m.useState(null);m.useEffect(()=>{if(i&&t){const g=Bt("TodoWrite",t);!g.valid&&g.errors?(f(g.errors),r("TodoWrite",g.errors)):f(null)}},[i,t,r]);const p=i&&u&&!c("TodoWrite");if(s){const g=t;return l.jsxs("div",{className:"todo-error",children:[p&&u&&l.jsx(Re,{toolName:"TodoWrite",errors:u}),typeof t=="object"&&(g!=null&&g.content)?String(g.content):"Failed to update todos"]})}return!(t!=null&&t.newTodos)||t.newTodos.length===0?l.jsxs("div",{className:"todo-empty",children:[p&&u&&l.jsx(Re,{toolName:"TodoWrite",errors:u}),"No todos"]}):l.jsxs("div",{className:"todo-result",children:[p&&u&&l.jsx(Re,{toolName:"TodoWrite",errors:u}),l.jsx("div",{className:"todo-list",children:t.newTodos.map((g,v)=>l.jsx(cA,{todo:g},`${g.content}-${v}`))})]})}const fA={tool:"TodoWrite",displayName:"Update Todos",renderToolUse(t,s){return l.jsx(uA,{input:t})},renderToolResult(t,s,i){return l.jsx(dA,{result:t,isError:s})},getUseSummary(t){const s=t.todos;return s?`${s.length} items`:"Todos"},getResultSummary(t,s){if(s)return"Error";const i=t;return i!=null&&i.newTodos?`${i.newTodos.length} items`:"Todos"}},Jg=30;function hA(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function mA({input:t}){return l.jsxs("div",{className:"webfetch-tool-use",children:[l.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"webfetch-url",children:t.url}),t.prompt&&l.jsx("div",{className:"webfetch-prompt",children:t.prompt})]})}function pA({result:t,isError:s}){var _;const[i,r]=m.useState(!1),{enabled:c,reportValidationError:u,isToolIgnored:f}=Mt(),[p,g]=m.useState(null);m.useEffect(()=>{if(c&&t){const N=Bt("WebFetch",t);!N.valid&&N.errors?(g(N.errors),u("WebFetch",N.errors)):g(null)}},[c,t,u]);const v=c&&p&&!f("WebFetch");if(s){const N=t;return l.jsxs("div",{className:"webfetch-error",children:[v&&p&&l.jsx(Re,{toolName:"WebFetch",errors:p}),typeof t=="object"&&(N!=null&&N.content)?String(N.content):"Fetch failed"]})}if(!t)return l.jsx("div",{className:"webfetch-empty",children:"No content"});const y=((_=t.result)==null?void 0:_.split(`
132
+ `))||[],b=y.length>Jg,S=b&&!i?y.slice(0,Jg):y,w=t.code>=200&&t.code<300?"badge-success":t.code>=400?"badge-error":"badge-warning";return l.jsxs("div",{className:"webfetch-result",children:[l.jsxs("div",{className:"webfetch-header",children:[l.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"webfetch-url",children:t.url}),l.jsxs("span",{className:`badge ${w}`,children:[t.code," ",t.codeText]}),l.jsxs("span",{className:"webfetch-meta",children:[hA(t.bytes)," · ",t.durationMs,"ms"]}),v&&p&&l.jsx(Re,{toolName:"WebFetch",errors:p})]}),t.result&&l.jsxs(l.Fragment,{children:[l.jsx("pre",{className:"webfetch-content code-block",children:l.jsx("code",{children:S.join(`
133
+ `)})}),b&&l.jsx("button",{type:"button",className:"expand-button",onClick:()=>r(!i),children:i?"Show less":`Show all ${y.length} lines`})]})]})}const gA={tool:"WebFetch",renderToolUse(t,s){return l.jsx(mA,{input:t})},renderToolResult(t,s,i){return l.jsx(pA,{result:t,isError:s})},getUseSummary(t){const s=t.url;try{return new URL(s).hostname}catch{return s}},getResultSummary(t,s){if(s)return"Error";const i=t;return i!=null&&i.code?`${i.code} ${i.codeText}`:"Fetched"}};function vA({input:t}){return l.jsx("div",{className:"websearch-tool-use",children:l.jsx("span",{className:"websearch-query",children:t.query})})}function yA({result:t,isError:s}){var v;const{enabled:i,reportValidationError:r,isToolIgnored:c}=Mt(),[u,f]=m.useState(null);m.useEffect(()=>{if(i&&t){const y=Bt("WebSearch",t);!y.valid&&y.errors?(f(y.errors),r("WebSearch",y.errors)):f(null)}},[i,t,r]);const p=i&&u&&!c("WebSearch");if(s){const y=t;return l.jsxs("div",{className:"websearch-error",children:[p&&u&&l.jsx(Re,{toolName:"WebSearch",errors:u}),typeof t=="object"&&(y!=null&&y.content)?String(y.content):"Search failed"]})}if(!t)return l.jsx("div",{className:"websearch-empty",children:"No results"});const g=((v=t.results)==null?void 0:v.flatMap(y=>y.content||[]).filter(Boolean))||[];return l.jsxs("div",{className:"websearch-result",children:[l.jsxs("div",{className:"websearch-header",children:[l.jsxs("span",{className:"websearch-query-display",children:['"',t.query,'"']}),t.durationSeconds!==void 0&&l.jsxs("span",{className:"badge",children:[t.durationSeconds.toFixed(2),"s"]}),p&&u&&l.jsx(Re,{toolName:"WebSearch",errors:u})]}),g.length>0?l.jsx("ul",{className:"websearch-links",children:g.map((y,b)=>l.jsxs("li",{className:"websearch-link-item",children:[l.jsx("a",{href:y.url,target:"_blank",rel:"noopener noreferrer",className:"websearch-link",children:y.title}),l.jsx("span",{className:"websearch-url",children:y.url})]},`${y.url}-${b}`))}):l.jsx("div",{className:"websearch-empty",children:"No results found"})]})}const bA={tool:"WebSearch",renderToolUse(t,s){return l.jsx(vA,{input:t})},renderToolResult(t,s,i){return l.jsx(yA,{result:t,isError:s})},getUseSummary(t){return t.query},getResultSummary(t,s){var c;if(s)return"Error";const i=t;return`${((c=i==null?void 0:i.results)==null?void 0:c.flatMap(u=>u.content||[]).length)||0} results`}},ev=30,ad=3;function yi(t){return t.split("/").pop()||t}function xA(t,s){const i=t.split('<span class="line">');return i.length<=s+1?t:`${i.slice(0,s+1).join('<span class="line">')}</code></pre>`}function SA({input:t}){const s=yi(t.file_path),i=t.content.split(`
134
+ `).length;return l.jsxs("div",{className:"write-tool-use",children:[l.jsx("span",{className:"file-path",children:s}),l.jsxs("span",{className:"write-info",children:[i," lines"]})]})}function jA({file:t,input:s}){const i=t.content.split(`
135
+ `);return s!=null&&s._highlightedContentHtml?l.jsx("div",{className:"file-content-modal",children:l.jsxs("div",{className:"file-viewer-code file-viewer-code-highlighted",children:[l.jsx("div",{className:"shiki-container",dangerouslySetInnerHTML:{__html:s._highlightedContentHtml}}),s._highlightedTruncated&&l.jsx("div",{className:"file-viewer-truncated",children:"Content truncated for highlighting (showing first 2000 lines)"})]})}):l.jsx("div",{className:"file-content-modal",children:l.jsxs("div",{className:"file-content-with-lines",children:[l.jsx("div",{className:"line-numbers",children:i.map((r,c)=>l.jsx("div",{children:t.startLine+c},`ln-${c+1}`))}),l.jsx("pre",{className:"line-content",children:l.jsx("code",{children:t.content})})]})})}function NA({result:t,isError:s,input:i}){const[r,c]=m.useState(!1),{enabled:u,reportValidationError:f,isToolIgnored:p}=Mt(),[g,v]=m.useState(null);m.useEffect(()=>{if(u&&t){const j=Bt("Write",t);!j.valid&&j.errors?(v(j.errors),f("Write",j.errors)):v(null)}},[u,t,f]);const y=u&&g&&!p("Write");if(s||!(t!=null&&t.file)){let j="Failed to write file";if(typeof t=="string")j=t;else if(typeof t=="object"&&t!==null){const R=t;R.content&&(j=String(R.content))}return l.jsxs("div",{className:"write-error",children:[y&&g&&l.jsx(Re,{toolName:"Write",errors:g}),j]})}const{file:b}=t,S=b.content.split(`
136
+ `),w=S.length>ev,_=yi(b.filePath);if(i!=null&&i._highlightedContentHtml)return l.jsxs("div",{className:"write-result",children:[l.jsxs("div",{className:"file-header",children:[l.jsx("span",{className:"file-path",children:_}),l.jsxs("span",{className:"file-range",children:[b.numLines," lines written"]}),y&&g&&l.jsx(Re,{toolName:"Write",errors:g})]}),l.jsxs("div",{className:"file-viewer-code file-viewer-code-highlighted",children:[l.jsx("div",{className:"shiki-container",dangerouslySetInnerHTML:{__html:i._highlightedContentHtml}}),i._highlightedTruncated&&l.jsx("div",{className:"file-viewer-truncated",children:"Content truncated for highlighting (showing first 2000 lines)"})]})]});const N=w&&!r?S.slice(0,ev):S;return l.jsxs("div",{className:"write-result",children:[l.jsxs("div",{className:"file-header",children:[l.jsx("span",{className:"file-path",children:_}),l.jsxs("span",{className:"file-range",children:[b.numLines," lines written"]}),y&&g&&l.jsx(Re,{toolName:"Write",errors:g})]}),l.jsxs("div",{className:"file-content-with-lines",children:[l.jsxs("div",{className:"line-numbers",children:[N.map((j,R)=>{const C=b.startLine+R;return l.jsx("div",{children:C},`line-${C}`)}),w&&!r&&l.jsx("div",{children:"..."})]}),l.jsx("pre",{className:"line-content",children:l.jsx("code",{children:N.join(`
137
+ `)})})]}),w&&l.jsx("button",{type:"button",className:"expand-button",onClick:()=>c(!r),children:r?"Show less":`Show all ${S.length} lines`})]})}function wA({input:t,result:s,isError:i}){var H,T,O;const[r,c]=m.useState(!1),{enabled:u,reportValidationError:f,isToolIgnored:p}=Mt(),[g,v]=m.useState(null);m.useEffect(()=>{if(u&&s){const D=Bt("Write",s);!D.valid&&D.errors?(v(D.errors),f("Write",D.errors)):v(null)}},[u,s,f]);const y=u&&g&&!p("Write"),b=m.useCallback(D=>{D.stopPropagation(),i||c(!0)},[i]),S=m.useCallback(()=>{c(!1)},[]),w=((H=s==null?void 0:s.file)==null?void 0:H.content)??t.content,_=((T=s==null?void 0:s.file)==null?void 0:T.filePath)??t.file_path,N=yi(_),j=w.split(`
138
+ `),R=((O=s==null?void 0:s.file)==null?void 0:O.numLines)??j.length,C=j.length>ad,z=m.useMemo(()=>t._highlightedContentHtml?xA(t._highlightedContentHtml,ad):null,[t._highlightedContentHtml]);if(i){let D="Failed to write file";if(typeof s=="string")D=s;else if(typeof s=="object"&&s!==null){const F=s;F.content&&(D=String(F.content))}return l.jsxs("div",{className:"write-collapsed-preview write-collapsed-error",children:[y&&g&&l.jsx(Re,{toolName:"Write",errors:g}),l.jsx("span",{className:"write-preview-error",children:D})]})}return l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:"write-collapsed-preview",onClick:b,children:[l.jsxs("div",{className:"write-preview-lines",children:[R," lines",y&&g&&l.jsx(Re,{toolName:"Write",errors:g})]}),l.jsxs("div",{className:`write-preview-content ${C?"write-preview-truncated":""}`,children:[z?l.jsx("div",{className:"shiki-container",dangerouslySetInnerHTML:{__html:z}}):l.jsx("pre",{children:l.jsx("code",{children:j.slice(0,ad).join(`
139
+ `)})}),C&&l.jsx("div",{className:"write-preview-fade"})]})]}),r&&l.jsx(Xn,{title:l.jsx("span",{className:"file-path",children:N}),onClose:S,children:l.jsx(jA,{file:(s==null?void 0:s.file)??{filePath:_,content:w,numLines:R,startLine:1,totalLines:R},input:t})})]})}const EA={tool:"Write",renderToolUse(t,s){return l.jsx(SA,{input:t})},renderToolResult(t,s,i,r){return l.jsx(NA,{result:t,isError:s,input:r})},getUseSummary(t){return yi(t.file_path)},getResultSummary(t,s,i){if(s)return"Error";const r=t;return r!=null&&r.file?yi(r.file.filePath):i?yi(i.file_path):"Writing..."},renderCollapsedPreview(t,s,i,r){return l.jsx(wA,{input:t,result:s,isError:i})}};class _A{constructor(s){Ke(this,"tools",new Map);Ke(this,"fallback");this.fallback=s}register(s){this.tools.set(s.tool,s)}get(s){return this.tools.get(s)||this.fallback}renderToolUse(s,i,r){return this.get(s).renderToolUse(i,r)}renderToolResult(s,i,r,c,u){return this.get(s).renderToolResult(i,r,c,u)}hasInteractiveSummary(s){return typeof this.get(s).renderInteractiveSummary=="function"}hasCollapsedPreview(s){return typeof this.get(s).renderCollapsedPreview=="function"}renderCollapsedPreview(s,i,r,c,u){const f=this.get(s);return f.renderCollapsedPreview?f.renderCollapsedPreview(i,r,c,u):null}renderInteractiveSummary(s,i,r,c,u){const f=this.get(s);return f.renderInteractiveSummary?f.renderInteractiveSummary(i,r,c,u):null}hasInlineRenderer(s){return typeof this.get(s).renderInline=="function"}renderInline(s,i,r,c,u,f){const p=this.get(s);return p.renderInline?p.renderInline(i,r,c,u,f):null}getDisplayName(s){return this.get(s).displayName||s}}const kA={tool:"__fallback__",renderToolUse(t,s){return l.jsx("pre",{className:"tool-fallback",children:l.jsx("code",{children:JSON.stringify(t,null,2)})})},renderToolResult(t,s,i){return l.jsx("pre",{className:`tool-fallback ${s?"tool-fallback-error":""}`,children:l.jsx("code",{children:JSON.stringify(t,null,2)})})}},rt=new _A(kA);rt.register(uR);rt.register(IR);rt.register(xR);rt.register(EA);rt.register(_R);rt.register(MR);rt.register(fA);rt.register(rA);rt.register(bA);rt.register(gA);rt.register(WC);rt.register(jR);rt.register(sR);rt.register(qR);rt.register(DR);function hb(t,s,i,r){const c=rt.get(t);if(r==="pending"||r==="aborted")return c.getUseSummary?c.getUseSummary(s):tv(t,s);const u=c.getUseSummary?c.getUseSummary(s):tv(t,s),f=c.getResultSummary?c.getResultSummary(i==null?void 0:i.structured,(i==null?void 0:i.isError)??!1,s):TA(t,i,r);return t==="Glob"||t==="Grep"?`${u} → ${f}`:t==="Bash"?u:f}function tv(t,s){const i=s;switch(t){case"Read":return id(String(i.file_path||""));case"Write":return id(String(i.file_path||""));case"Edit":return id(String(i.file_path||""));case"Bash":return no(String(i.command||""),40);case"Glob":return String(i.pattern||"*");case"Grep":return`"${i.pattern||""}"`;case"Task":return no(String(i.description||""),30);case"WebSearch":return no(String(i.query||""),30);case"WebFetch":return no(String(i.url||""),40);default:return"..."}}function TA(t,s,i){if(i==="error")return"failed";if(!s)return"done";const c=(s.content||"").split(`
140
+ `).filter(Boolean).length;switch(t){case"Read":return`${c} lines`;case"Bash":return`${c} lines`;case"Glob":return`${c} files`;case"Grep":return`${c} matches`;default:return"done"}}function no(t,s){return t.length<=s?t:`${t.slice(0,s-3)}...`}function id(t){return t.split("/").pop()||t}const CA=m.memo(function({id:s,toolName:i,toolInput:r,toolResult:c,status:u}){const f=rt.hasInlineRenderer(i),p=rt.hasInteractiveSummary(i),g=rt.hasCollapsedPreview(i),v=p||g,[y,b]=m.useState(!v&&(i==="Edit"||i==="TodoWrite")),S=m.useMemo(()=>hb(i,r,c,u),[i,r,c,u]),w=()=>{v||b(!y)},_=m.useMemo(()=>({isStreaming:u==="pending",theme:"dark",toolUseId:s}),[u,s]),N=(c==null?void 0:c.structured)??(c==null?void 0:c.content);return f?l.jsx("div",{className:"tool-inline timeline-item",children:rt.renderInline(i,r,N,(c==null?void 0:c.isError)??!1,u,_)}):l.jsxs("div",{className:`tool-row timeline-item ${y?"expanded":"collapsed"} status-${u} ${v?"interactive":""}`,children:[l.jsxs("div",{className:`tool-row-header ${v?"non-expandable":""}`,onClick:v?void 0:w,onKeyDown:v?void 0:j=>j.key==="Enter"&&w(),role:v?"presentation":"button",tabIndex:v?void 0:0,children:[u==="pending"&&l.jsx("span",{className:"tool-spinner","aria-label":"Running",children:l.jsx(MA,{})}),u==="aborted"&&l.jsx("span",{className:"tool-aborted-icon","aria-label":"Interrupted",children:"⨯"}),l.jsx("span",{className:"tool-name",children:rt.getDisplayName(i)}),p&&u==="complete"?l.jsx("span",{className:"tool-summary interactive-summary",children:rt.renderInteractiveSummary(i,r,N,(c==null?void 0:c.isError)??!1,_)}):l.jsxs("span",{className:"tool-summary",children:[S,u==="aborted"&&l.jsx("span",{className:"tool-aborted-label",children:" (interrupted)"})]}),!v&&l.jsx("span",{className:"expand-chevron","aria-hidden":"true",children:y?"▾":"▸"})]}),g&&l.jsx("div",{className:"tool-row-collapsed-preview",children:rt.renderCollapsedPreview(i,r,N,(c==null?void 0:c.isError)??!1,_)}),y&&!v&&l.jsx("div",{className:"tool-row-content",children:u==="pending"||u==="aborted"?l.jsx(RA,{toolName:i,toolInput:r,context:_}):l.jsx(AA,{toolName:i,toolInput:r,toolResult:c,context:_})})]})});function RA({toolName:t,toolInput:s,context:i}){return l.jsx("div",{className:"tool-use-expanded",children:rt.renderToolUse(t,s,i)})}function AA({toolName:t,toolInput:s,toolResult:i,context:r}){if(!i)return l.jsx("div",{className:"tool-no-result",children:"No result data"});const c=i.structured??i.content;return l.jsx("div",{className:"tool-result-expanded",children:rt.renderToolResult(t,c,i.isError,r,s)})}function MA(){return l.jsx("svg",{className:"spinner",viewBox:"0 0 16 16",width:"12",height:"12","aria-hidden":"true",children:l.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"24",strokeDashoffset:"8"})})}const zA=M1;function OA(t){const s=[],i=`
141
+
142
+ User uploaded files:
143
+ `,r=t.indexOf(i);if(r===-1)return{textWithoutUploads:t,uploadedFiles:[]};const c=t.slice(0,r),u=t.slice(r+i.length),f=/^- (.+?) \(([^,]+), ([^)]+)\): (.+)$/;for(const p of u.split(`
144
+ `)){const g=p.match(f);g&&s.push({originalName:g[1]??"",size:g[2]??"",mimeType:g[3]??"",path:g[4]??""})}return{textWithoutUploads:c,uploadedFiles:s}}function nv(t){const{textWithoutUploads:s,uploadedFiles:i}=OA(t);return{text:C1(s),openedFiles:A1(s),uploadedFiles:i}}const jd=12,ld=jd*100;function so({files:t}){return t.length===0?null:l.jsx("div",{className:"user-prompt-metadata",children:t.map(s=>l.jsx("span",{className:"opened-file",title:`file was opened in editor: ${s}`,children:zA(s)},s))})}function DA(t){return t.startsWith("image/")}function LA(t){const s=t.split("/");if(s.length<3)return null;const i=s[s.length-1],r=s[s.length-2],c=s[s.length-3];return!i||!r||!c||!/^[0-9a-f-]{36}_/.test(i)?null:`/api/projects/${c}/sessions/${r}/upload/${encodeURIComponent(i)}`}function UA({file:t}){const[s,i]=m.useState(!1),r=DA(t.mimeType),c=r?LA(t.path):null;return r&&c?l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:"uploaded-file uploaded-file-clickable",title:`${t.mimeType}, ${t.size}`,onClick:()=>i(!0),children:["📎 ",t.originalName]}),s&&l.jsx(Xn,{title:t.originalName,onClose:()=>i(!1),children:l.jsx("div",{className:"uploaded-image-modal",children:l.jsx("img",{src:c,alt:t.originalName})})})]}):l.jsxs("span",{className:"uploaded-file",title:`${t.mimeType}, ${t.size}`,children:["📎 ",t.originalName]})}function ao({files:t}){return t.length===0?null:l.jsx("div",{className:"user-prompt-metadata",children:t.map(s=>l.jsx(UA,{file:s},s.path))})}function sv({text:t}){const[s,i]=m.useState(!1),r=t.split(`
145
+ `),c=r.length>jd,u=t.length>ld,f=c||u;if(!f||s)return l.jsxs("div",{className:"text-block",children:[t,s&&f&&l.jsx("button",{type:"button",className:"show-more-btn",onClick:()=>i(!1),children:"Show less"})]});let p=c?r.slice(0,jd).join(`
146
+ `):t;return p.length>ld&&(p=p.slice(0,ld)),l.jsxs("div",{className:"text-block collapsible-text",children:[l.jsxs("div",{className:"truncated-content",children:[p,l.jsx("div",{className:"fade-overlay"})]}),l.jsx("button",{type:"button",className:"show-more-btn",onClick:()=>i(!0),children:"Show more"})]})}const $A=m.memo(function({content:s}){if(typeof s=="string"){const{text:f,openedFiles:p,uploadedFiles:g}=nv(s);return f?l.jsxs("div",{className:"user-prompt-container",children:[l.jsx("div",{className:"message message-user-prompt",children:l.jsxs("div",{className:"message-content",children:[l.jsx(sv,{text:f}),l.jsx(ao,{files:g})]})}),l.jsx(so,{files:p})]}):p.length>0||g.length>0?l.jsxs(l.Fragment,{children:[l.jsx(ao,{files:g}),l.jsx(so,{files:p})]}):null}const i=s.filter(f=>f.type==="text"&&f.text).map(f=>f.text).join(`
147
+ `),{text:r,openedFiles:c,uploadedFiles:u}=nv(i);return r?l.jsxs("div",{className:"user-prompt-container",children:[l.jsx("div",{className:"message message-user-prompt",children:l.jsxs("div",{className:"message-content",children:[l.jsx(sv,{text:r}),l.jsx(ao,{files:u})]})}),l.jsx(so,{files:c})]}):c.length>0||u.length>0?l.jsxs(l.Fragment,{children:[l.jsx(ao,{files:u}),l.jsx(so,{files:c})]}):l.jsx("div",{className:"message message-user-prompt",children:l.jsx("div",{className:"message-content",children:l.jsx("div",{className:"text-block",children:"[Complex content]"})})})}),Nd=m.memo(function({item:s,isStreaming:i,thinkingExpanded:r,toggleThinkingExpanded:c}){const u=m.useCallback(p=>{const g=window.getSelection();g&&g.toString().length>0||(p.ctrlKey||p.metaKey)&&(p.preventDefault(),p.stopPropagation(),console.log("[DEBUG] RenderItem:",s),console.log("[DEBUG] Source JSONL entries:",s.sourceMessages))},[s]),f=()=>{switch(s.type){case"text":return l.jsx(ZC,{text:s.text,isStreaming:s.isStreaming,augmentHtml:s.augmentHtml});case"thinking":return l.jsx(VC,{thinking:s.thinking,status:s.status,isExpanded:r,onToggle:c});case"tool_call":return l.jsx(CA,{id:s.id,toolName:s.toolName,toolInput:s.toolInput,toolResult:s.toolResult,status:s.status});case"user_prompt":return l.jsx($A,{content:s.content});case"system":return l.jsxs("div",{className:"system-message",children:[l.jsx("span",{className:"system-message-icon",children:"⟳"}),l.jsx("span",{className:"system-message-text",children:s.content})]});default:return null}};return l.jsx("div",{className:s.isSubagent?"subagent-item":void 0,"data-render-type":s.type,"data-render-id":s.id,onClick:u,children:f()})});function BA(t){const s=[];let i=[];for(const r of t)r.type==="user_prompt"?(i.length>0&&(s.push({isUserPrompt:!1,items:i}),i=[]),s.push({isUserPrompt:!0,items:[r]})):i.push(r);return i.length>0&&s.push({isUserPrompt:!1,items:i}),s}const IA=m.memo(function({messages:s,isStreaming:i=!1,isProcessing:r=!1,scrollTrigger:c=0,pendingMessages:u=[],markdownAugments:f,activeToolApproval:p}){const g=m.useRef(null),v=m.useRef(!0),y=m.useRef(!0),b=m.useRef(!1),S=m.useRef(0),w=m.useRef(null),[_,N]=m.useState(!1),j=m.useCallback(T=>{b.current=!0,T.scrollTop=T.scrollHeight-T.clientHeight,S.current=T.scrollHeight,requestAnimationFrame(()=>{b.current=!1}),w.current!==null&&clearTimeout(w.current),w.current=setTimeout(()=>{w.current=null,v.current&&(b.current=!0,T.scrollTop=T.scrollHeight-T.clientHeight,S.current=T.scrollHeight,requestAnimationFrame(()=>{b.current=!1}))},50)},[]),R=m.useMemo(()=>Vd(s,{markdown:f,activeToolApproval:p}),[s,f,p]),C=m.useMemo(()=>BA(R),[R]),z=m.useCallback(()=>{N(T=>!T)},[]),H=m.useCallback(()=>{var F;if(b.current)return;const T=(F=g.current)==null?void 0:F.parentElement;if(!T)return;const O=100,D=T.scrollHeight-T.scrollTop-T.clientHeight;v.current=D<O},[]);return m.useEffect(()=>{var O;const T=(O=g.current)==null?void 0:O.parentElement;if(T)return T.addEventListener("scroll",H),()=>{T.removeEventListener("scroll",H)}},[H]),m.useEffect(()=>{var F;const T=(F=g.current)==null?void 0:F.parentElement;if(!T)return;const O=T;S.current=O.scrollHeight;const D=new ResizeObserver(()=>{const ne=O.scrollHeight;ne>S.current&&v.current?j(O):S.current=ne});return g.current&&D.observe(g.current),()=>{D.disconnect(),w.current!==null&&clearTimeout(w.current)}},[j]),m.useEffect(()=>{var T;if(c>0){v.current=!0;const O=(T=g.current)==null?void 0:T.parentElement;O&&j(O)}},[c,j]),m.useEffect(()=>{var T;if(y.current&&R.length>0){const O=(T=g.current)==null?void 0:T.parentElement;O&&j(O),y.current=!1}},[R.length,j]),l.jsxs("div",{className:"message-list",ref:g,children:[C.map(T=>{if(T.isUserPrompt){const D=T.items[0];return D?l.jsx(Nd,{item:D,isStreaming:i,thinkingExpanded:_,toggleThinkingExpanded:z},D.id):null}const O=T.items[0];return O?l.jsx("div",{className:"assistant-turn",children:T.items.map(D=>l.jsx(Nd,{item:D,isStreaming:i,thinkingExpanded:_,toggleThinkingExpanded:z},D.id))},`turn-${O.id}`):null}),u.map(T=>l.jsxs("div",{className:"pending-message",children:[l.jsx("div",{className:"message-user-prompt pending-message-bubble",children:T.content}),l.jsx("div",{className:"pending-message-status",children:"Sending..."})]},T.tempId)),l.jsx($C,{isProcessing:r})]})});function HA(t){return t?t>=1e3?`${Math.round(t/1e3)}K tokens`:`${t} tokens`:"Disabled"}function ZA(t){const s=new Date(t),r=new Date().getTime()-s.getTime(),c=Math.floor(r/1e3),u=Math.floor(c/60),f=Math.floor(u/60),p=Math.floor(f/24);return p>0?`${p}d ${f%24}h`:f>0?`${f}h ${u%60}m`:u>0?`${u}m ${c%60}s`:`${c}s`}function rd(t){return new Date(t).toLocaleString()}function Pt({label:t,value:s,mono:i=!1}){return s==null?null:l.jsxs("div",{className:"process-info-row",children:[l.jsx("span",{className:"process-info-label",children:t}),l.jsx("span",{className:`process-info-value ${i?"mono":""}`,children:s})]})}function io({title:t,children:s}){return l.jsxs("div",{className:"process-info-section",children:[l.jsx("h3",{className:"process-info-section-title",children:t}),s]})}function qA({sessionId:t,provider:s,model:i,status:r,processState:c,contextUsage:u,onClose:f}){const[p,g]=m.useState(null),[v,y]=m.useState(!1),[b,S]=m.useState(null);m.useEffect(()=>{r.state==="owned"&&(y(!0),S(null),Ne.getProcessInfo(t).then(N=>{g(N.process)}).catch(N=>{S(N.message||"Failed to fetch process info")}).finally(()=>{y(!1)}))},[t,r.state]);const w=()=>{if(r.state==="owned")switch(c){case"running":return"Running";case"idle":return"Idle";case"waiting-input":return"Waiting for input";case"hold":return"On hold";default:return c}return r.state==="external"?"External (other process)":"Idle (no process)"},_=N=>{switch(N){case"claude":return"Claude (Anthropic)";case"codex":return"Codex (OpenAI)";case"codex-oss":return"Codex OSS (Local)";case"gemini":return"Gemini (Google)";case"opencode":return"OpenCode";default:return N}};return l.jsx(Xn,{title:"Session Info",onClose:f,children:l.jsxs("div",{className:"process-info-content",children:[l.jsxs(io,{title:"Session",children:[l.jsx(Pt,{label:"Session ID",value:t,mono:!0}),l.jsx(Pt,{label:"Provider",value:_(s)}),l.jsx(Pt,{label:"Model",value:i||"Default",mono:!0}),l.jsx(Pt,{label:"Status",value:w()})]}),u&&l.jsxs(io,{title:"Token Usage",children:[l.jsx(Pt,{label:"Input tokens",value:u.inputTokens.toLocaleString()}),u.outputTokens!==void 0&&l.jsx(Pt,{label:"Output tokens",value:u.outputTokens.toLocaleString()}),l.jsx(Pt,{label:"Context used",value:`${u.percentage.toFixed(1)}%`}),u.cacheReadTokens!==void 0&&l.jsx(Pt,{label:"Cache read",value:u.cacheReadTokens.toLocaleString()}),u.cacheCreationTokens!==void 0&&l.jsx(Pt,{label:"Cache created",value:u.cacheCreationTokens.toLocaleString()})]}),l.jsx(io,{title:"Process",children:r.state==="owned"?l.jsxs(l.Fragment,{children:[v&&l.jsx("div",{className:"process-info-loading",children:"Loading..."}),b&&l.jsx("div",{className:"process-info-error",children:b}),p&&l.jsxs(l.Fragment,{children:[l.jsx(Pt,{label:"Process ID",value:p.id,mono:!0}),l.jsx(Pt,{label:"Started",value:rd(p.startedAt)}),l.jsx(Pt,{label:"Uptime",value:ZA(p.startedAt)}),l.jsx(Pt,{label:"Queue depth",value:p.queueDepth}),l.jsx(Pt,{label:"Extended thinking",value:HA(p.maxThinkingTokens)}),p.idleSince&&l.jsx(Pt,{label:"Idle since",value:rd(p.idleSince)}),p.holdSince&&l.jsx(Pt,{label:"Hold since",value:rd(p.holdSince)})]}),!v&&!p&&!b&&l.jsx("div",{className:"process-info-loading",children:"No process data"})]}):r.state==="external"?l.jsx("div",{className:"process-info-muted",children:"Session controlled by external process (VS Code, CLI)"}):l.jsx("div",{className:"process-info-muted",children:"No active process"})}),p&&l.jsxs(io,{title:"Project",children:[l.jsx(Pt,{label:"Name",value:p.projectName}),l.jsx(Pt,{label:"Path",value:p.projectPath,mono:!0})]})]})})}const mb="draft-tool-prompt-";function PA(t){const s=`${mb}${t}-toolApprovalFeedback`,[i,r]=m.useState(()=>{try{return localStorage.getItem(s)??""}catch{return""}}),c=m.useCallback(f=>{r(f);try{f?localStorage.setItem(s,f):localStorage.removeItem(s)}catch{}},[s]),u=m.useCallback(()=>{r("");try{localStorage.removeItem(s)}catch{}},[s]);return[i,c,u]}function VA(t){const s=`${mb}${t}-questionOther`,[i,r]=m.useState(()=>{try{const f=localStorage.getItem(s);return f?JSON.parse(f):{}}catch{return{}}}),c=m.useCallback((f,p)=>{r(g=>{const v={...g};p?v[f]=p:delete v[f];try{Object.keys(v).length>0?localStorage.setItem(s,JSON.stringify(v)):localStorage.removeItem(s)}catch{}return v})},[s]),u=m.useCallback(()=>{r({});try{localStorage.removeItem(s)}catch{}},[s]);return[i,c,u]}function GA({request:t,sessionId:s,onSubmit:i,onDeny:r}){const c=t.toolInput,u=(c==null?void 0:c.questions)||[],[f,p]=m.useState(0),[g,v]=m.useState({}),[y,b,S]=VA(s),[w,_]=m.useState(!1),[N,j]=m.useState(!1),R=m.useRef(null),C=u[f],z=f===u.length-1,H=C?g[C.question]:void 0,T=H==="__other__",O=u.every(q=>{const Q=g[q.question];return Q?Q==="__other__"?(y[q.question]||"").trim().length>0:!0:!1});m.useEffect(()=>{T&&R.current&&(R.current.focus(),setTimeout(()=>{var q;(q=R.current)==null||q.scrollIntoView({behavior:"smooth",block:"center"})},100))},[T]);const D=m.useCallback(q=>{C&&v(Q=>({...Q,[C.question]:q}))},[C]),F=m.useCallback(q=>{C&&b(C.question,q)},[C,b]),ne=m.useCallback(()=>{z||p(q=>q+1)},[z]),ce=m.useCallback(async()=>{if(!O||w)return;const q={};for(const Q of u){const le=g[Q.question];le==="__other__"?q[Q.question]=y[Q.question]||"":le&&(q[Q.question]=le)}_(!0);try{await i(q),S()}finally{_(!1)}},[O,w,u,g,y,i,S]),de=m.useCallback(async()=>{_(!0);try{await r()}finally{_(!1)}},[r]);return m.useEffect(()=>{const q=Q=>{if(!w){if(Q.key==="Escape"){Q.preventDefault(),de();return}if(Q.key==="Enter"&&!Q.shiftKey){const le=H&&H!=="__other__",ue=H==="__other__"&&(y[(C==null?void 0:C.question)||""]||"").trim().length>0;(le||ue)&&(Q.preventDefault(),z&&O?ce():ne())}Q.key==="Tab"&&!T&&(Q.preventDefault(),Q.shiftKey?p(le=>Math.max(0,le-1)):p(le=>Math.min(u.length-1,le+1)))}};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[w,H,C,y,z,O,T,u.length,de,ce,ne]),u.length?l.jsxs("div",{className:"question-panel-wrapper",children:[l.jsx("button",{type:"button",className:"question-panel-toggle",onClick:()=>j(!N),"aria-label":N?"Expand question panel":"Collapse question panel","aria-expanded":!N,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:N?"chevron-up":"chevron-down","aria-hidden":"true",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})}),!N&&l.jsxs("div",{className:"question-panel",children:[l.jsx("div",{className:"question-tabs",children:u.map((q,Q)=>{const le=Q===f,ue=!!g[q.question];return l.jsxs("button",{type:"button",className:`question-tab ${le?"active":""} ${ue?"answered":""}`,onClick:()=>p(Q),children:[ue&&l.jsx("span",{className:"question-tab-check",children:"✓"}),q.header]},q.question)})}),C&&l.jsxs("div",{className:"question-content",children:[l.jsx("div",{className:"question-text",children:C.question}),l.jsxs("div",{className:"question-options-list",children:[C.options.map(q=>{const Q=H===q.label;return l.jsxs("button",{type:"button",className:`question-option-btn ${Q?"selected":""}`,onClick:()=>D(q.label),children:[l.jsx("span",{className:"question-option-radio",children:C.multiSelect?Q?"☑":"☐":Q?"●":"○"}),l.jsxs("div",{className:"question-option-text",children:[l.jsx("span",{className:"question-option-label",children:q.label}),q.description&&l.jsx("span",{className:"question-option-desc",children:q.description})]})]},q.label)}),l.jsxs("button",{type:"button",className:`question-option-btn other ${T?"selected":""}`,onClick:()=>D("__other__"),children:[l.jsx("span",{className:"question-option-radio",children:T?"●":"○"}),l.jsx("div",{className:"question-option-text",children:l.jsx("span",{className:"question-option-label",children:"Other"})})]}),T&&l.jsx("div",{className:"question-other-input",children:l.jsx("input",{ref:R,type:"text",placeholder:"Type your answer...",value:y[C.question]||"",onChange:q=>F(q.target.value)})})]})]}),l.jsxs("div",{className:"question-actions",children:[l.jsxs("button",{type:"button",className:"question-btn deny",onClick:de,disabled:w,children:["Cancel",l.jsx("kbd",{children:"esc"})]}),z?l.jsxs("button",{type:"button",className:"question-btn submit",onClick:ce,disabled:!O||w,children:["Submit",l.jsx("kbd",{children:"↵"})]}):l.jsxs("button",{type:"button",className:"question-btn next",onClick:ne,disabled:!H||w,children:["Next",l.jsx("kbd",{children:"↵"})]})]})]})]}):l.jsx("div",{className:"question-panel-wrapper",children:l.jsx("div",{className:"question-panel",children:l.jsx("div",{className:"question-panel-empty",children:"No questions to answer"})})})}const av=10;function FA(t){const s=Date.now(),i=new Date(t).getTime(),r=s-i,c=Math.floor(r/6e4),u=Math.floor(r/36e5),f=Math.floor(r/864e5);return c<1?"now":c<60?`${c}m`:u<24?`${u}h`:f<7?`${f}d`:new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function YA(t){const s=t.customTitle||t.title||"Untitled";return s.length>30?`${s.slice(0,30)}...`:s}function XA({session:t}){if(t.processState==="running")return l.jsx(Ra,{});if(t.pendingInputType){const i=t.pendingInputType==="tool-approval"?"Appr":"Q";return l.jsx("span",{className:"recent-sessions-badge needs-input",children:i})}return t.status.state==="external"?l.jsx("span",{className:"recent-sessions-badge external",children:"Ext"}):null}function KA({currentSessionId:t,isOpen:s,onClose:i,onNavigate:r,triggerRef:c}){var b;const u=m.useRef(null),{sessions:f}=fo({limit:av+5}),p=f.filter(S=>S.id!==t&&!S.isArchived).slice(0,av);if(m.useEffect(()=>{if(!s)return;const S=_=>{const N=_.target;u.current&&!u.current.contains(N)&&c.current&&!c.current.contains(N)&&i()},w=_=>{_.key==="Escape"&&i()};return document.addEventListener("mousedown",S),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",S),document.removeEventListener("keydown",w)}},[s,i,c]),m.useEffect(()=>{if(!s)return;const S=()=>i();return window.addEventListener("scroll",S,{passive:!0}),()=>window.removeEventListener("scroll",S)},[s,i]),!s)return null;const g=(b=c.current)==null?void 0:b.getBoundingClientRect(),v=g?{position:"fixed",top:g.bottom+4,left:Math.max(8,g.left-100),maxWidth:"calc(100vw - 16px)"}:{},y=l.jsxs("div",{ref:u,className:"recent-sessions-dropdown",style:v,children:[l.jsx("div",{className:"recent-sessions-header",children:"Recent Sessions"}),p.length===0?l.jsx("div",{className:"recent-sessions-empty",children:"No other sessions"}):l.jsx("div",{className:"recent-sessions-list",children:p.map(S=>l.jsxs(gn,{to:`/projects/${S.projectId}/sessions/${S.id}`,className:"recent-session-item",onClick:()=>{r(S.id,S.projectId),i()},children:[l.jsxs("div",{className:"recent-session-content",children:[l.jsxs("span",{className:"recent-session-title",children:[S.isStarred&&l.jsx("svg",{className:"recent-session-star",width:"10",height:"10",viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:l.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})}),YA(S)]}),l.jsx("span",{className:"recent-session-project",children:S.projectName})]}),l.jsxs("div",{className:"recent-session-meta",children:[l.jsx(XA,{session:S}),l.jsx("span",{className:"recent-session-time",children:FA(S.updatedAt)})]})]},S.id))})]});return Ei.createPortal(y,document.body)}const QA=["Edit","Write","NotebookEdit"],od=t=>t==="ExitPlanMode";function WA({request:t,sessionId:s,onApprove:i,onDeny:r,onApproveAcceptEdits:c,onDenyWithFeedback:u,collapsed:f=!1,onCollapsedChange:p}){const[g,v]=m.useState(!1),[y,b,S]=PA(s),[w,_]=m.useState(()=>y.length>0),N=m.useRef(null),j=t.toolName&&QA.includes(t.toolName),R=m.useCallback(async()=>{v(!0);try{await i()}finally{v(!1)}},[i]),C=m.useCallback(async()=>{if(c){v(!0);try{await c()}finally{v(!1)}}},[c]),z=m.useCallback(async()=>{v(!0);try{await r()}finally{v(!1)}},[r]),H=m.useCallback(async()=>{if(!(!u||!y.trim())){v(!0);try{await u(y.trim()),S(),_(!1)}finally{v(!1)}}},[u,y,S]);m.useEffect(()=>{w&&N.current&&N.current.focus()},[w]),m.useEffect(()=>{const O=D=>{if(g)return;if(w){D.key==="Escape"?(D.preventDefault(),_(!1),S()):D.key==="Enter"&&y.trim()&&(D.preventDefault(),H());return}od(t.toolName)?D.key==="1"&&c?(D.preventDefault(),C()):D.key==="2"?(D.preventDefault(),R()):D.key==="3"?(D.preventDefault(),z()):D.key==="Enter"&&!D.shiftKey&&c?(D.preventDefault(),C()):D.key==="Escape"&&(D.preventDefault(),z()):D.key==="1"?(D.preventDefault(),R()):D.key==="2"&&j&&c?(D.preventDefault(),C()):D.key==="3"||D.key==="2"&&(!j||!c)?(D.preventDefault(),z()):D.key==="Enter"&&!D.shiftKey?(D.preventDefault(),R()):D.key==="Escape"&&(D.preventDefault(),z())};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[R,C,z,H,g,w,y,S,j,c,t.toolName]);const T=t.toolName?hb(t.toolName,t.toolInput,void 0,"pending"):t.prompt;return l.jsxs("div",{className:"tool-approval-wrapper",children:[l.jsx("button",{type:"button",className:`tool-approval-toggle ${f?"has-pending":""}`,onClick:()=>p==null?void 0:p(!f),"aria-label":f?"Expand approval panel":"Collapse approval panel","aria-expanded":!f,children:l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:f?"chevron-up":"chevron-down","aria-hidden":"true",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})}),!f&&l.jsxs("div",{className:"tool-approval-panel",children:[l.jsx("div",{className:"tool-approval-header",children:od(t.toolName)?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"tool-approval-title",children:"Accept this plan?"}),l.jsx("span",{className:"tool-approval-subtitle",children:"Review the plan above and decide whether to proceed"})]}):l.jsxs("span",{className:"tool-approval-question",children:["Allow"," ",l.jsx("span",{className:"tool-approval-name",children:t.toolName})," ",T,"?"]})}),l.jsxs("div",{className:"tool-approval-options",children:[od(t.toolName)?l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:"tool-approval-option primary",onClick:C,disabled:g||!c,children:[l.jsx("kbd",{children:"1"}),l.jsx("span",{children:"Yes, and auto-accept"})]}),l.jsxs("button",{type:"button",className:"tool-approval-option",onClick:R,disabled:g,children:[l.jsx("kbd",{children:"2"}),l.jsx("span",{children:"Yes, and manually approve edits"})]}),l.jsxs("button",{type:"button",className:"tool-approval-option",onClick:z,disabled:g,children:[l.jsx("kbd",{children:"3"}),l.jsx("span",{children:"No, keep planning"})]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:"tool-approval-option primary",onClick:R,disabled:g,children:[l.jsx("kbd",{children:"1"}),l.jsx("span",{children:"Yes"})]}),j&&c&&l.jsxs("button",{type:"button",className:"tool-approval-option",onClick:C,disabled:g,children:[l.jsx("kbd",{children:"2"}),l.jsx("span",{children:"Yes, and don't ask again"})]}),l.jsxs("button",{type:"button",className:"tool-approval-option",onClick:z,disabled:g,children:[l.jsx("kbd",{children:j&&c?"3":"2"}),l.jsx("span",{children:"No"})]})]}),u&&!w&&l.jsx("button",{type:"button",className:"tool-approval-option feedback-toggle",onClick:()=>_(!0),disabled:g,children:l.jsx("span",{children:"Tell Claude what to do instead"})}),u&&w&&l.jsxs("div",{className:"tool-approval-feedback",children:[l.jsx("input",{ref:N,type:"text",placeholder:"Tell Claude what to do instead...",value:y,onChange:O=>b(O.target.value),disabled:g,className:"tool-approval-feedback-input"}),l.jsx("button",{type:"button",className:"tool-approval-feedback-submit",onClick:H,disabled:g||!y.trim(),children:"Send"})]})]})]})]})}const JA=3e4,eM=2e3;function tM(t){const{sessionId:s,activityAt:i,updatedAt:r,lastSeenAt:c,hasUnread:u=!1,enabled:f=!0}=t,p=m.useRef(Date.now()),g=m.useRef(null),v=m.useRef(null),y=m.useRef(!0),b=m.useCallback(()=>i?c?i>c||u:!0:!1,[i,c,u]),S=m.useCallback(()=>{const N=document.hasFocus(),j=Date.now()-p.current<JA;return N&&j},[]),w=m.useCallback(()=>{!f||!y.current||!i||!r||g.current!==i&&(v.current&&clearTimeout(v.current),v.current=setTimeout(async()=>{if(y.current&&S()&&b())try{await Ne.markSessionSeen(s,r),g.current=i}catch(N){console.warn("[useEngagementTracking] Failed to mark session as seen:",N)}},eM))},[f,s,i,r,S,b]);return m.useEffect(()=>{if(!f)return;const N=()=>{p.current=Date.now(),b()&&S()&&w()},j=["mousemove","keydown","scroll","click","touchstart"];for(const R of j)window.addEventListener(R,N,{passive:!0});return()=>{for(const R of j)window.removeEventListener(R,N)}},[f,b,S,w]),m.useEffect(()=>{if(!f)return;const N=()=>{document.visibilityState==="visible"&&b()&&S()&&w()},j=()=>{p.current=Date.now(),b()&&S()&&w()};return document.addEventListener("visibilitychange",N),window.addEventListener("focus",j),()=>{document.removeEventListener("visibilitychange",N),window.removeEventListener("focus",j)}},[f,b,S,w]),m.useEffect(()=>{f&&i&&b()&&S()&&w()},[f,i,b,S,w]),m.useEffect(()=>(y.current=!0,()=>{y.current=!1,v.current&&clearTimeout(v.current)}),[]),{forceMarkSeen:m.useCallback(async()=>{if(!(!f||!r))try{await Ne.markSessionSeen(s,r),g.current=i}catch(N){console.warn("[useEngagementTracking] Failed to force mark session as seen:",N)}},[f,s,i,r]),isEngaged:S}}function nM(t){var r;const s=new Map,i=new Set;for(const c of t){const u=((r=c.message)==null?void 0:r.content)??c.content;if(Array.isArray(u))for(const f of u){if(f.type==="tool_use"&&f.name==="Task"&&typeof f.id=="string"){const p=f.input;s.set(f.id,{description:(p==null?void 0:p.description)??"Unknown task",subagentType:(p==null?void 0:p.subagent_type)??"unknown"})}f.type==="tool_result"&&typeof f.tool_use_id=="string"&&i.add(f.tool_use_id)}}return[...s.entries()].filter(([c])=>!i.has(c)).map(([c,{description:u,subagentType:f}])=>({toolUseId:c,description:u,subagentType:f}))}function sM(t){const s=t.relativePath.split(/[\\/]/).pop();if(!s)return null;let i=s;if(i.endsWith(".jsonl")?i=i.slice(0,-6):i.endsWith(".json")&&(i=i.slice(0,-5)),t.provider==="codex"){const r=i.match(/([0-9a-fA-F-]{36})$/);if(r)return r[1]??null}return i}function aM(t,s){const[i,r]=m.useState(!1),c=m.useRef(null),u=m.useRef(null),f=m.useRef(null),p=m.useRef(s);p.current=s;const g=m.useRef(null),v=m.useCallback(()=>{if(!t){g.current=null;return}if(c.current||g.current===t)return;g.current=t;const y=u.current?`${t}?lastEventId=${u.current}`:t,b=new EventSource(y);b.onopen=()=>{var w,_;r(!0),(_=(w=p.current).onOpen)==null||_.call(w)};const S=w=>_=>{if(_.lastEventId&&(u.current=_.lastEventId),!(_.data===void 0||_.data===null))try{const N=JSON.parse(_.data);p.current.onMessage({...N,eventType:w})}catch{}};b.addEventListener("connected",S("connected")),b.addEventListener("message",S("message")),b.addEventListener("status",S("status")),b.addEventListener("mode-change",S("mode-change")),b.addEventListener("error",S("error")),b.addEventListener("complete",S("complete")),b.addEventListener("heartbeat",S("heartbeat")),b.addEventListener("markdown-augment",S("markdown-augment")),b.addEventListener("pending",S("pending")),b.addEventListener("edit-augment",S("edit-augment")),b.onerror=w=>{var _,N;r(!1),(N=(_=p.current).onError)==null||N.call(_,w),b.close(),c.current=null,g.current=null,f.current=setTimeout(v,2e3)},c.current=b},[t]);return m.useEffect(()=>(v(),()=>{var y;f.current&&(clearTimeout(f.current),f.current=null),(y=c.current)==null||y.close(),c.current=null,g.current=null}),[v]),{connected:i}}function iM(t){const{projectId:s,sessionId:i,onLoadComplete:r,onLoadError:c}=t,[u,f]=m.useState([]),[p,g]=m.useState({}),[v,y]=m.useState(()=>new Map),[b,S]=m.useState(!0),[w,_]=m.useState(null),N=m.useRef([]),j=m.useRef(!1),R=m.useRef(void 0),C=m.useRef(void 0);m.useEffect(()=>{const q=u[u.length-1];q&&(C.current=en(q))},[u]);const z=m.useCallback(q=>{f(Q=>Wk(Q,q).messages)},[]),H=m.useCallback((q,Q)=>{g(le=>{const ue=le[Q]??{messages:[],status:"running"},k=en(q);return ue.messages.some(U=>en(U)===k)?le:{...le,[Q]:{...ue,messages:[...ue.messages,q],status:"running"}}})},[]),T=m.useCallback(()=>{const q=N.current;N.current=[];for(const Q of q)Q.type==="message"?z(Q.msg):H(Q.msg,Q.agentId)},[z,H]);m.useEffect(()=>{j.current=!1,N.current=[],S(!0),g({}),Ne.getSession(s,i).then(q=>{_(q.session),R.current=q.session.provider;const Q=q.messages.map(le=>({...le,_source:"jsonl"}));f(Q),j.current=!0,T(),S(!1),r==null||r({session:q.session,status:q.status,pendingInputRequest:q.pendingInputRequest})}).catch(q=>{S(!1),c==null||c(q)})},[s,i,r,c,T]);const O=m.useCallback((q,Q)=>{const le=en(q);if(le){if(Q){g(ue=>{const k=ue[Q]??{messages:[],status:"running"},U=k.messages.findIndex(I=>en(I)===le);if(U>=0){const I=[...k.messages];return I[U]=q,{...ue,[Q]:{...k,messages:I}}}return{...ue,[Q]:{...k,messages:[...k.messages,q]}}});return}f(ue=>{const k=ue.findIndex(U=>en(U)===le);if(k>=0){const U=[...ue];return U[k]=q,U}return[...ue,q]})}},[]),D=m.useCallback(q=>{if(!j.current){N.current.push({type:"message",msg:q});return}z(q)},[z]),F=m.useCallback((q,Q)=>{if(!j.current){N.current.push({type:"subagent",msg:q,agentId:Q});return}H(q,Q)},[H]),ne=m.useCallback((q,Q)=>{y(le=>{if(le.has(q))return le;const ue=new Map(le);return ue.set(q,Q),ue})},[]),ce=m.useCallback(async()=>{try{const q=await Ne.getSession(s,i,C.current);q.messages.length>0&&f(Q=>Qk(Q,q.messages,{skipDagOrdering:!Fy(q.session.provider).capabilities.supportsDag}).messages),_(Q=>Q?{...Q,...q.session,messages:Q.messages}:q.session)}catch{}},[s,i]),de=m.useCallback(async()=>{try{const q=await Ne.getSessionMetadata(s,i);_(Q=>Q?{...Q,...q.session,messages:Q.messages}:{...q.session,messages:[]})}catch{}},[s,i]);return{messages:u,agentContent:p,toolUseToAgent:v,loading:b,session:w,setSession:_,handleStreamingUpdate:O,handleSSEMessageEvent:D,handleSSESubagentMessage:F,registerToolUseAgent:ne,setAgentContent:g,setToolUseToAgent:y,setMessages:f,fetchNewMessages:ce,fetchSessionMetadata:de}}const pb="yep-anywhere-streaming-enabled";function gb(){const t=localStorage.getItem(pb);return t===null?!0:t==="true"}function lM(t){localStorage.setItem(pb,String(t))}function rM(){const[t,s]=m.useState(gb),i=m.useCallback(r=>{s(r),lM(r)},[]);return{streamingEnabled:t,setStreamingEnabled:i}}function oM(){return gb()}const cM=50;function uM(t){const{onUpdateMessage:s,streamingMarkdownCallbacks:i,onToolUseMapping:r,onAgentContextUsage:c}=t,u=m.useRef(new Map),f=m.useRef(null),p=m.useRef(null),g=m.useRef({timer:null,pendingIds:new Set}),v=m.useCallback(N=>{const j=u.current.get(N);if(!j)return;const R={id:N,type:"assistant",role:"assistant",message:{role:"assistant",content:j.blocks},_isStreaming:!0,_source:"sdk"};s(R,j.agentId)},[s]),y=m.useCallback(N=>{const j=g.current;j.pendingIds.add(N),j.timer||(j.timer=setTimeout(()=>{for(const R of j.pendingIds)v(R);j.pendingIds.clear(),j.timer=null},cM))},[v]),b=m.useCallback(N=>{var D,F;if(N.type!=="stream_event"||!oM())return!1;const R=N.event;if(!R)return!0;const C=R.type,H=N.isSubagent&&typeof N.parentToolUseId=="string"?N.parentToolUseId:void 0;if(H&&r&&r(H,H),C==="message_start"){const ne=R.message;if(ne!=null&&ne.id&&(f.current=ne.id,p.current=H??null,(D=i==null?void 0:i.setCurrentMessageId)==null||D.call(i,ne.id),H&&c)){const ce=ne.usage;if(ce!=null&&ce.input_tokens){const de=ce.input_tokens,q=de/2e5*100;c(H,{inputTokens:de,percentage:q})}}return!0}const T=f.current??`stream-${Date.now()}`,O=p.current??H;if(C==="content_block_start"){const ne=R.index,ce=R.content_block;if(ce){const de=u.current.get(T)??{blocks:[],isStreaming:!0,agentId:O};for(;de.blocks.length<=ne;)de.blocks.push({type:"text",text:""});de.blocks[ne]={type:ce.type??"text",text:ce.text??"",thinking:ce.thinking??void 0},u.current.set(T,de),v(T)}}else if(C==="content_block_delta"){const ne=R.index,ce=R.delta;if(ce){const de=u.current.get(T);if(de!=null&&de.blocks[ne]){const q=de.blocks[ne],Q=ce.type;Q==="text_delta"&&ce.text?q.text=(q.text??"")+ce.text:Q==="thinking_delta"&&ce.thinking&&(q.thinking=(q.thinking??"")+ce.thinking),y(T)}}}else C==="content_block_stop"||C==="message_stop"&&(u.current.delete(T),(F=i==null?void 0:i.onStreamEnd)==null||F.call(i));return!0},[v,y,i,r,c]),S=m.useCallback(()=>{u.current.clear(),f.current=null,p.current=null},[]),w=m.useCallback(()=>p.current,[]),_=m.useCallback(()=>{g.current.timer&&(clearTimeout(g.current.timer),g.current.timer=null)},[]);return{handleStreamEvent:b,clearStreaming:S,cleanup:_,getCurrentAgentId:w}}const dM=500;function fM(t,s,i,r){const[c,u]=m.useState(i??{state:"idle"}),[f,p]=m.useState(i?"running":"idle"),[g,v]=m.useState(null),[y,b]=m.useState(null),[S,w]=m.useState(s),[_,N]=m.useState(null),[j,R]=m.useState([]),[C,z]=m.useState({}),[H,T]=m.useState("default"),[O,D]=m.useState("default"),[F,ne]=m.useState(0),ce=m.useRef(0),de=H!==O,q=m.useCallback((ge,ze)=>{ze>=ce.current&&(ce.current=ze,D(ge),T(ge),ne(ze))},[]),Q=m.useCallback(ge=>{u(ze=>ze.state==="owned"&&ge.status.state!=="owned"?ze:ge.status),ge.status.state==="owned"&&ge.status.permissionMode&&ge.status.modeVersion!==void 0&&q(ge.status.permissionMode,ge.status.modeVersion),ge.pendingInputRequest&&v(ge.pendingInputRequest)},[q]),le=m.useCallback(ge=>{b(ge)},[]),{messages:ue,agentContent:k,toolUseToAgent:U,loading:I,session:oe,setSession:he,handleStreamingUpdate:A,handleSSEMessageEvent:Y,handleSSESubagentMessage:X,registerToolUseAgent:ae,setAgentContent:fe,setToolUseToAgent:ie,setMessages:ve,fetchNewMessages:Ae}=iM({projectId:t,sessionId:s,onLoadComplete:Q,onLoadError:le}),be=m.useCallback(async ge=>{if(T(ge),c.state==="owned"||c.state==="external")try{const ze=await Ne.setPermissionMode(s,ge);ze.modeVersion>=ce.current&&(ce.current=ze.modeVersion,D(ze.permissionMode),ne(ze.modeVersion))}catch(ze){console.warn("Failed to sync permission mode:",ze)}},[s,c.state]),xe=m.useCallback(async ge=>{if(c.state!=="owned"&&c.state!=="external"){console.warn("Cannot set hold: no active process");return}try{const ze=await Ne.setHold(s,ge);ze.state==="hold"?p("hold"):ze.state==="running"&&p("running")}catch(ze){console.warn("Failed to set hold:",ze)}},[s,c.state]),Ce=m.useRef({timer:null,pending:!1}),zt=m.useCallback(ge=>{const ze=`temp-${Date.now()}`;return R(wt=>[...wt,{tempId:ze,content:ge,timestamp:new Date().toISOString()}]),ze},[]),Nt=m.useCallback(ge=>{R(ze=>ze.filter(wt=>wt.tempId!==ge))},[]),se=m.useRef(null);m.useEffect(()=>{if(I||se.current===s||ue.length===0)return;(async()=>{se.current=s;const ze=nM(ue);if(ze.length!==0)try{const{mappings:wt}=await Ne.getAgentMappings(t,s),qn=new Map(wt.map(ye=>[ye.toolUseId,ye.agentId]));ie(ye=>{const xt=new Map(ye);for(const[It,Ht]of qn)xt.has(It)||xt.set(It,Ht);return xt});for(const ye of ze){const xt=qn.get(ye.toolUseId);if(xt)try{const It=await Ne.getAgentSession(t,s,xt);fe(Ht=>{const He=Ht[xt];if(He&&He.messages.length>0){const rn=new Set(He.messages.map(Pn=>en(Pn))),pt=It.messages.filter(Pn=>!rn.has(en(Pn)));return{...Ht,[xt]:{messages:[...He.messages,...pt],status:It.status}}}return{...Ht,[xt]:It}})}catch{}}}catch{}})()},[I,ue,t,s,fe,ie]);const Se=m.useCallback(()=>{const ge=Ce.current;ge.timer?ge.pending=!0:(Ae(),ge.timer=setTimeout(()=>{ge.timer=null,ge.pending&&(ge.pending=!1,Se())},dM))},[Ae]),Oe=m.useCallback(ge=>{ge.fileType!=="session"&&ge.fileType!=="agent-session"||sM(ge)!==s||c.state!=="owned"&&Se()},[s,c.state,Se]),Ie=m.useCallback(ge=>{ge.sessionId===s&&he(ze=>ze&&{...ze,...ge.title!==void 0&&{title:ge.title},...ge.messageCount!==void 0&&{messageCount:ge.messageCount},...ge.updatedAt!==void 0&&{updatedAt:ge.updatedAt}})},[s,he]),ct=m.useCallback(ge=>{ge.sessionId===s&&u(ge.status)},[s]);_i({onSessionStatusChange:ct,onFileChange:Oe,onSessionUpdated:Ie}),m.useEffect(()=>()=>{Ce.current.timer&&clearTimeout(Ce.current.timer)},[]);const $=m.useCallback((ge,ze)=>{fe(wt=>{const qn=wt[ge]??{messages:[],status:"running"};return{...wt,[ge]:{...qn,contextUsage:ze}}})},[fe]),{handleStreamEvent:me,clearStreaming:$e,cleanup:Ot}=uM({onUpdateMessage:A,onToolUseMapping:ae,onAgentContextUsage:$,streamingMarkdownCallbacks:r});m.useEffect(()=>()=>{Ot()},[Ot]);const Gt=m.useCallback(ge=>{var ze,wt,qn;if(ge.eventType==="message"){N(new Date().toISOString());const ye=ge,xt=ye.uuid,It=ye.id,Ht=(typeof xt=="string"?xt:null)??(typeof It=="string"?It:null)??`msg-${Date.now()}`,He=typeof ye.type=="string"?ye.type:void 0,rn=ye.role;if(He==="stream_event"&&me(ye))return;if(He==="assistant"){const la=ye.isSubagent&&typeof ye.parentToolUseId=="string"?ye.parentToolUseId:void 0;$e(),la?fe(on=>{const Dt=on[la];if(!Dt)return on;const as=Dt.messages.filter(Vn=>!Vn._isStreaming);return as.length===Dt.messages.length?on:{...on,[la]:{...Dt,messages:as}}}):ve(on=>on.filter(Dt=>!Dt._isStreaming))}const pt={...ye,id:Ht,type:He,role:rn??(He==="user"||He==="assistant"?He:void 0)};pt.eventType=void 0;const Pn=ye.tempId;if(He==="user"&&Pn&&Nt(Pn),ye.isSubagent&&typeof ye.parentToolUseId=="string"){const ss=ye.parentToolUseId;ae(ss,ss),X(pt,ss);return}Y(pt)}else if(ge.eventType==="status"){const ye=ge;(ye.state==="idle"||ye.state==="running"||ye.state==="waiting-input")&&p(ye.state),ye.state==="waiting-input"&&ye.request?(v(ye.request),ye.request.sessionId&&ye.request.sessionId!==s&&w(ye.request.sessionId)):v(null)}else if(ge.eventType==="complete")p("idle"),u({state:"idle"}),v(null);else if(ge.eventType==="connected"){const ye=ge,xt=ye.sessionId??((ze=ye.request)==null?void 0:ze.sessionId);xt&&xt!==s&&w(xt),(ye.state==="idle"||ye.state==="running"||ye.state==="waiting-input")&&p(ye.state),ye.state==="waiting-input"&&ye.request?v(ye.request):v(null),ye.permissionMode&&ye.modeVersion!==void 0&&q(ye.permissionMode,ye.modeVersion);const It=ye.provider,Ht=ye.model;It&&he(He=>!He||He.provider?He:{...He,provider:It,model:Ht})}else if(ge.eventType==="mode-change"){const ye=ge;ye.permissionMode&&ye.modeVersion!==void 0&&q(ye.permissionMode,ye.modeVersion)}else if(ge.eventType==="markdown-augment"){const ye=ge;ye.messageId&&ye.blockIndex===void 0&&ye.html?z(xt=>({...xt,[ye.messageId]:{html:ye.html}})):ye.blockIndex!==void 0&&((wt=r==null?void 0:r.onAugment)==null||wt.call(r,{blockIndex:ye.blockIndex,html:ye.html,type:ye.type??"text",messageId:ye.messageId}))}else if(ge.eventType==="pending"){const ye=ge;(qn=r==null?void 0:r.onPending)==null||qn.call(r,{html:ye.html})}},[q,s,me,$e,Nt,r,Y,X,ae,fe,ve,he]),We=m.useCallback(async()=>{try{(await Ne.getSessionMetadata(t,s)).status.state!=="owned"&&(u({state:"idle"}),p("idle"))}catch{u({state:"idle"}),p("idle")}},[t,s]),{connected:ns}=aM(c.state==="owned"?`/api/sessions/${s}/stream`:null,{onMessage:Gt,onError:We});return{session:oe,messages:ue,agentContent:k,setAgentContent:fe,toolUseToAgent:U,markdownAugments:C,status:c,processState:f,isHeld:f==="hold",pendingInputRequest:g,actualSessionId:S,permissionMode:H,isModePending:de,modeVersion:F,loading:I,error:y,connected:ns,lastSSEActivityAt:_,setStatus:u,setProcessState:p,setPermissionMode:be,setHold:xe,pendingMessages:j,addPendingMessage:zt,removePendingMessage:Nt}}function hM(){const{projectId:t,sessionId:s}=Td();return!t||!s?l.jsx("div",{className:"error",children:"Invalid session URL"}):l.jsx(BC,{children:l.jsx(mM,{projectId:t,sessionId:s},s)})}function mM({projectId:t,sessionId:s}){const{openSidebar:i,isWideScreen:r,toggleSidebar:c,isSidebarCollapsed:u}=_s(),{project:f}=oy(t),p=Kn(),v=yn().state,y=v==null?void 0:v.initialStatus,b=v==null?void 0:v.initialTitle,S=v==null?void 0:v.initialModel,w=v==null?void 0:v.initialProvider,_=nb(),N=m.useMemo(()=>{if(_)return{onAugment:_.dispatchAugment,onPending:_.dispatchPending,onStreamEnd:_.dispatchStreamEnd,setCurrentMessageId:_.setCurrentMessageId,captureHtml:_.captureStreamingHtml}},[_]),{session:j,messages:R,agentContent:C,setAgentContent:z,toolUseToAgent:H,markdownAugments:T,status:O,processState:D,pendingInputRequest:F,actualSessionId:ne,permissionMode:ce,isModePending:de,loading:q,error:Q,lastSSEActivityAt:le,setStatus:ue,setProcessState:k,setPermissionMode:U,setHold:I,isHeld:oe,pendingMessages:he,addPendingMessage:A,removePendingMessage:Y}=fM(t,s,y,N),X=(j==null?void 0:j.provider)??w,ae=(j==null?void 0:j.model)??S,[fe,ie]=m.useState(0),ve=m.useRef(null),Ae=m.useCallback(_e=>{ve.current=_e},[]),{showToast:be}=Xv(),{providers:xe}=Pd(),Ce=m.useMemo(()=>j!=null&&j.provider?xe.find(_e=>_e.name===j.provider)??null:null,[xe,j==null?void 0:j.provider]),zt=(Ce==null?void 0:Ce.supportsPermissionMode)??!0,Nt=(Ce==null?void 0:Ce.supportsThinkingToggle)??!0,[se,Se]=m.useState(!1),[Oe,Ie]=m.useState(""),[ct,$]=m.useState(!1),me=m.useRef(null),$e=m.useRef(!1),[Ot,Gt]=m.useState(!1),We=m.useRef(null),[ns,ge]=m.useState(void 0),[ze,wt]=m.useState(void 0),[qn,ye]=m.useState(void 0),[xt,It]=m.useState(void 0);m.useEffect(()=>{ge(void 0),wt(void 0),ye(void 0),It(void 0)},[s]),m.useEffect(()=>{jC(s,t)},[s,t]);const[Ht,He]=m.useState([]),[rn,pt]=m.useState([]),[Pn,ss]=m.useState(!1),[la,on]=m.useState(!1),Dt=(j==null?void 0:j.updatedAt)??null,as=m.useMemo(()=>!Dt&&!le?null:Dt?le?Dt>le?Dt:le:Dt:le,[Dt,le]);tM({sessionId:s,activityAt:as,updatedAt:Dt,lastSeenAt:j==null?void 0:j.lastSeenAt,hasUnread:j==null?void 0:j.hasUnread,enabled:O.state!=="external"});const Vn=async _e=>{var Ge,cn;const De=A(_e);k("running"),ie(Yt=>Yt+1);const et=[...Ht];He([]);try{if(O.state==="idle"){const Yt=(j==null?void 0:j.model)??hd(),Zt=md(),Qn=await Ne.resumeSession(t,s,_e,{mode:ce,model:Yt,thinking:Zt,provider:j==null?void 0:j.provider},et.length>0?et:void 0,De);ue({state:"owned",processId:Qn.processId})}else{const Yt=md(),Zt=await Ne.queueMessage(s,_e,ce,et.length>0?et:void 0,De,Yt);Zt.restarted&&Zt.processId&&ue({state:"owned",processId:Zt.processId})}(Ge=ve.current)==null||Ge.clearDraft()}catch(Yt){if(console.error("Failed to send:",Yt),Y(De),(cn=ve.current)==null||cn.restoreFromStorage(),He(et),k("idle"),Yt instanceof Error&&(Yt.message.includes("404")||Yt.message.includes("No active process")))ue({state:"idle"}),be("Session process ended. Your message has been restored.","error");else{const Qn=Yt instanceof Error?Yt.message:"Unknown error";be(`Failed to send message: ${Qn}`,"error")}}},ra=async()=>{O.state==="owned"&&O.processId&&await Ne.abortProcess(O.processId)},oa=m.useCallback(async()=>{if(F)try{await Ne.respondToInput(s,F.id,"approve")}catch(_e){const De=_e.status,et=De?`Error ${De}`:"Failed to approve";be(et,"error")}},[s,F,be]),Eo=m.useCallback(async()=>{if(F)try{await Ne.respondToInput(s,F.id,"approve_accept_edits"),U("acceptEdits")}catch(_e){const De=_e.status,et=De?`Error ${De}`:"Failed to approve";be(et,"error")}},[s,F,U,be]),Ri=m.useCallback(async()=>{if(F)try{await Ne.respondToInput(s,F.id,"deny")}catch(_e){const De=_e.status,et=De?`Error ${De}`:"Failed to deny";be(et,"error")}},[s,F,be]),Ai=m.useCallback(async _e=>{if(F)try{await Ne.respondToInput(s,F.id,"deny",void 0,_e)}catch(De){const et=De.status,Ge=et?`Error ${et}`:"Failed to send feedback";be(Ge,"error")}},[s,F,be]),ca=m.useCallback(async _e=>{if(F)try{await Ne.respondToInput(s,F.id,"approve",_e)}catch(De){const et=De.status,Ge=et?`Error ${et}`:"Failed to submit answer";be(Ge,"error")}},[s,F,be]),_o=m.useCallback(async _e=>{for(const De of _e){const et=crypto.randomUUID();pt(Ge=>[...Ge,{fileId:et,fileName:De.name,bytesUploaded:0,totalBytes:De.size,percent:0}]);try{const Ge=await Hv(t,s,De,{onProgress:cn=>{pt(Yt=>Yt.map(Zt=>Zt.fileId===et?{...Zt,bytesUploaded:cn,percent:Math.round(cn/De.size*100)}:Zt))}});He(cn=>[...cn,Ge])}catch(Ge){console.error("Upload failed:",Ge);const cn=Ge instanceof Error?Ge.message:"Upload failed";be(`Failed to upload ${De.name}: ${cn}`,"error")}finally{pt(Ge=>Ge.filter(cn=>cn.fileId!==et))}}},[t,s,be]),Ll=m.useCallback(_e=>{He(De=>De.filter(et=>et.id!==_e))},[]),Aa=(F==null?void 0:F.toolName)==="AskUserQuestion",Ul=D==="running"||D==="waiting-input",Mi=m.useMemo(()=>O.state!=="idle"?!1:Vd(R).some(De=>De.type==="tool_call"&&De.status==="pending"),[R,O.state]),Ma=uy(j),ks=ns??(Ma!=="Untitled"?Ma:null)??b??"Untitled",za=ze??(j==null?void 0:j.isArchived)??!1,Cn=qn??(j==null?void 0:j.isStarred)??!1;Ky(f==null?void 0:f.name,ks);const Lt=()=>{Ie(ks),Se(!0),setTimeout(()=>{var _e,De;(_e=me.current)==null||_e.focus(),(De=me.current)==null||De.select()},0)},Ft=()=>{$e.current||(Se(!1),Ie(""))},Ts=()=>{if(!$e.current){if(!Oe.trim()||Oe.trim()===ks){Ft();return}Oa()}},Oa=async()=>{if(!(!Oe.trim()||ct)){$e.current=!0,$(!0);try{await Ne.updateSessionMetadata(s,{title:Oe.trim()}),ge(Oe.trim()),Se(!1),be("Session renamed","success")}catch(_e){console.error("Failed to rename session:",_e),be("Failed to rename session","error")}finally{$(!1),$e.current=!1}}},ko=_e=>{_e.key==="Enter"?(_e.preventDefault(),Oa()):_e.key==="Escape"&&(_e.preventDefault(),Ft())},To=async()=>{const _e=!za;try{await Ne.updateSessionMetadata(s,{archived:_e}),wt(_e),be(_e?"Session archived":"Session unarchived","success")}catch(De){console.error("Failed to update archive status:",De),be("Failed to update archive status","error")}},$l=async()=>{const _e=!Cn;try{await Ne.updateSessionMetadata(s,{starred:_e}),ye(_e),be(_e?"Session starred":"Session unstarred","success")}catch(De){console.error("Failed to update star status:",De),be("Failed to update star status","error")}},Cs=xt??(j==null?void 0:j.hasUnread)??!1,zi=async()=>{const _e=!Cs;It(_e);try{_e?await Ne.markSessionUnread(s):await Ne.markSessionSeen(s),be(_e?"Marked as unread":"Marked as read","success")}catch(De){console.error("Failed to update read status:",De),It(void 0),be("Failed to update read status","error")}};if(Q)return l.jsxs("div",{className:"error",children:["Error: ",Q.message]});const Rs=()=>l.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),l.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]});return l.jsx("div",{className:r?"main-content-wrapper":"main-content-mobile",children:l.jsxs("div",{className:r?"main-content-constrained":"main-content-mobile-inner",children:[l.jsx("header",{className:"session-header",children:l.jsxs("div",{className:"session-header-inner",children:[l.jsxs("div",{className:"session-header-left",children:[!(r&&u)&&l.jsx("button",{type:"button",className:"sidebar-toggle",onClick:r?c:i,title:r?"Toggle sidebar":"Open sidebar","aria-label":r?"Toggle sidebar":"Open sidebar",children:l.jsx(Rs,{})}),(f==null?void 0:f.name)&&l.jsx(gn,{to:`/sessions?project=${t}`,className:"project-breadcrumb",title:f.name,children:f.name.length>12?`${f.name.slice(0,12)}...`:f.name}),l.jsxs("div",{className:"session-title-row",children:[Cn&&l.jsxs("svg",{className:"star-indicator-inline",width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"2",role:"img","aria-label":"Starred",children:[l.jsx("title",{children:"Starred"}),l.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})]}),q?l.jsx("span",{className:"session-title-skeleton"}):se?l.jsx("input",{ref:me,type:"text",className:"session-title-input",value:Oe,onChange:_e=>Ie(_e.target.value),onKeyDown:ko,onBlur:Ts,disabled:ct}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{ref:We,type:"button",className:"session-title session-title-dropdown-trigger",onClick:()=>Gt(!Ot),title:(j==null?void 0:j.fullTitle)??ks,children:[l.jsx("span",{className:"session-title-text",children:ks}),l.jsx("svg",{className:"session-title-chevron",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),l.jsx(KA,{currentSessionId:s,isOpen:Ot,onClose:()=>Gt(!1),onNavigate:()=>Gt(!1),triggerRef:We})]}),!q&&za&&l.jsx("span",{className:"archived-badge",children:"Archived"}),!q&&l.jsx(Yy,{sessionId:s,projectId:t,isStarred:Cn,isArchived:za,hasUnread:Cs,provider:j==null?void 0:j.provider,onToggleStar:$l,onToggleArchive:To,onToggleRead:zi,onRename:Lt,onClone:_e=>{p(`/projects/${t}/sessions/${_e}`)},useFixedPositioning:!0,useEllipsisIcon:!0})]})]}),l.jsx("div",{className:"session-header-right",children:!q&&X&&l.jsx("button",{type:"button",className:"provider-badge-button",onClick:()=>on(!0),title:"View session info",children:l.jsx(Qy,{provider:X,model:ae,isThinking:D==="running"})})})]})}),la&&j&&l.jsx(qA,{sessionId:ne,provider:j.provider,model:j.model,status:O,processState:D,contextUsage:j.contextUsage,onClose:()=>on(!1)}),O.state==="external"&&l.jsx("div",{className:"external-session-warning",children:"External session active - enter messages at your own risk!"}),Mi&&l.jsx("div",{className:"external-session-warning pending-tool-warning",children:"This session may be waiting for input in another process (VS Code, CLI). Check there before sending a message."}),l.jsx("main",{className:"session-messages","data-project-id":t,"data-session-id":s,children:q?l.jsx("div",{className:"loading",children:"Loading session..."}):l.jsx(PR,{agentContent:C,setAgentContent:z,toolUseToAgent:H,projectId:t,sessionId:s,children:l.jsx(IA,{messages:R,isProcessing:O.state==="owned"&&D==="running",scrollTrigger:fe,pendingMessages:he,markdownAugments:T,activeToolApproval:Ul})})}),l.jsx("footer",{className:"session-input",children:l.jsxs("div",{className:"session-input-inner",children:[F&&F.sessionId===ne&&Aa&&l.jsx(GA,{request:F,sessionId:ne,onSubmit:ca,onDeny:Ri}),F&&F.sessionId===ne&&!Aa&&l.jsxs(l.Fragment,{children:[l.jsx(WA,{request:F,sessionId:ne,onApprove:oa,onDeny:Ri,onApproveAcceptEdits:Eo,onDenyWithFeedback:Ai,collapsed:Pn,onCollapsedChange:ss}),l.jsx(Wy,{mode:ce,onModeChange:U,isModePending:de,isHeld:oe,onHoldChange:I,supportsPermissionMode:zt,supportsThinkingToggle:Nt,contextUsage:j==null?void 0:j.contextUsage,isRunning:O.state==="owned",isThinking:D==="running",onStop:ra,pendingApproval:Pn?{type:"tool-approval",onExpand:()=>ss(!1)}:void 0})]}),!(F&&F.sessionId===ne&&!Aa)&&l.jsx(TC,{onSend:Vn,placeholder:O.state==="external"?"External session - send at your own risk...":D==="idle"?"Send a message to resume...":"Queue a message...",mode:ce,onModeChange:U,isModePending:de,isHeld:oe,onHoldChange:I,supportsPermissionMode:zt,supportsThinkingToggle:Nt,isRunning:O.state==="owned",isThinking:D==="running",onStop:ra,draftKey:`draft-message-${s}`,onDraftControlsReady:Ae,collapsed:!!(F&&F.sessionId===ne),contextUsage:j==null?void 0:j.contextUsage,projectId:t,sessionId:s,attachments:Ht,onAttach:_o,onRemoveAttachment:Ll,uploadProgress:rn})]})})]})})}const iv="yep-anywhere-device-id",pM="/sw.js";function gM(){const[t,s]=m.useState({isSupported:!1,isSubscribed:!1,isLoading:!0,error:null,permission:"default",deviceId:null}),[i,r]=m.useState(null),c=typeof window<"u"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,u=m.useCallback(()=>{let b=localStorage.getItem(iv);return b||(b=crypto.randomUUID(),localStorage.setItem(iv,b)),b},[]);m.useEffect(()=>{if(!c){const S="Push notifications not supported in this browser";s(w=>({...w,isSupported:!1,isLoading:!1,error:S}));return}(async()=>{try{const S=await navigator.serviceWorker.register(pM);r(S),await navigator.serviceWorker.ready;const w=await S.pushManager.getSubscription(),_=u();s({isSupported:!0,isSubscribed:!!w,isLoading:!1,error:null,permission:Notification.permission,deviceId:_})}catch(S){console.error("[usePushNotifications] Init error:",S),s(w=>({...w,isSupported:!0,isLoading:!1,error:S instanceof Error?S.message:"Failed to initialize"}))}})()},[c,u]);const f=m.useCallback(async()=>{if(!i){s(b=>({...b,error:"Service worker not ready"}));return}s(b=>({...b,isLoading:!0,error:null}));try{const b=await Notification.requestPermission();if(s(R=>({...R,permission:b})),b!=="granted"){s(R=>({...R,isLoading:!1,error:"Notification permission denied"}));return}const{publicKey:S}=await Ne.getPushPublicKey(),w=vM(S),_=await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:w.buffer}),N=u(),j=_.toJSON();await Ne.subscribePush(N,j,yM()),s(R=>({...R,isSubscribed:!0,isLoading:!1,error:null,deviceId:N}))}catch(b){console.error("[usePushNotifications] Subscribe error:",b),s(S=>({...S,isLoading:!1,error:b instanceof Error?b.message:"Failed to subscribe"}))}},[i,u]),p=m.useCallback(async()=>{if(!i){s(b=>({...b,error:"Service worker not ready"}));return}s(b=>({...b,isLoading:!0,error:null}));try{const b=await i.pushManager.getSubscription();b&&await b.unsubscribe();const S=u();await Ne.unsubscribePush(S),s(w=>({...w,isSubscribed:!1,isLoading:!1,error:null}))}catch(b){console.error("[usePushNotifications] Unsubscribe error:",b),s(S=>({...S,isLoading:!1,error:b instanceof Error?b.message:"Failed to unsubscribe"}))}},[i,u]),g=m.useCallback(async()=>{const b=u();s(S=>({...S,isLoading:!0,error:null}));try{await Ne.testPush(b),s(S=>({...S,isLoading:!1}))}catch(S){console.error("[usePushNotifications] Test push error:",S),s(w=>({...w,isLoading:!1,error:S instanceof Error?S.message:"Failed to send test"}))}},[u]),v=m.useCallback(async()=>{var S;const b=(S=navigator.serviceWorker)==null?void 0:S.controller;return b?new Promise(w=>{const _=new MessageChannel;_.port1.onmessage=N=>{var j;w(((j=N.data)==null?void 0:j.logs)||[])},b.postMessage({type:"get-sw-logs"},[_.port2]),setTimeout(()=>w([]),2e3)}):(console.warn("[usePushNotifications] No active service worker"),[])},[]),y=m.useCallback(async()=>{var S;const b=(S=navigator.serviceWorker)==null?void 0:S.controller;if(b)return new Promise(w=>{const _=new MessageChannel;_.port1.onmessage=()=>w(),b.postMessage({type:"clear-sw-logs"},[_.port2]),setTimeout(w,1e3)})},[]);return{...t,subscribe:f,unsubscribe:p,sendTest:g,getSwLogs:v,clearSwLogs:y}}function vM(t){const s="=".repeat((4-t.length%4)%4),i=(t+s).replace(/-/g,"+").replace(/_/g,"/"),r=window.atob(i),c=new Uint8Array(r.length);for(let u=0;u<r.length;++u)c[u]=r.charCodeAt(u);return c}function yM(){const t=navigator.userAgent;return/iPhone/.test(t)?"iPhone":/iPad/.test(t)?"iPad":/Android/.test(t)?"Android":/Mac/.test(t)?"Mac":/Windows/.test(t)?"Windows":/Linux/.test(t)?"Linux":"Browser"}function bM(){const{isSupported:t,isSubscribed:s,isLoading:i,error:r,permission:c,subscribe:u,unsubscribe:f,sendTest:p}=gM(),{notifyInApp:g,setNotifyInApp:v}=o1(),y=async()=>{s?await f():await u()};return t?c==="denied"?l.jsx("div",{className:"settings-item",children:l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Push Notifications"}),l.jsx("p",{className:"settings-warning",children:"Notifications are blocked. Enable them in your browser settings to receive push notifications."})]})}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Push Notifications"}),l.jsx("p",{children:"Receive notifications when a session needs your attention, even when the app is in the background."}),r&&l.jsx("p",{className:"settings-error",children:r})]}),l.jsxs("label",{className:"toggle-switch",children:[l.jsx("input",{type:"checkbox",checked:s,onChange:y,disabled:i}),l.jsx("span",{className:"toggle-slider"})]})]}),s&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Notify When In App"}),l.jsx("p",{children:"Show notifications even when the app is open, as long as you're not viewing that session."})]}),l.jsxs("label",{className:"toggle-switch",children:[l.jsx("input",{type:"checkbox",checked:g,onChange:b=>v(b.target.checked)}),l.jsx("span",{className:"toggle-slider"})]})]}),l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Test Notification"}),l.jsx("p",{children:"Send a test notification to verify push is working."})]}),l.jsx("button",{type:"button",className:"settings-button",onClick:p,disabled:i,children:i?"Sending...":"Send Test"})]})]})]}):l.jsx("div",{className:"settings-item",children:l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Push Notifications"}),l.jsx("p",{className:"settings-muted",children:"Push notifications are not supported in this browser."})]})})}let ka=null;function xM(){const[t,s]=m.useState(!1),[i,r]=m.useState(!1);m.useEffect(()=>{if(window.matchMedia("(display-mode: standalone)").matches||"standalone"in navigator&&navigator.standalone===!0){r(!0);return}ka&&s(!0);const f=g=>{g.preventDefault(),ka=g,s(!0)},p=()=>{r(!0),s(!1),ka=null};return window.addEventListener("beforeinstallprompt",f),window.addEventListener("appinstalled",p),()=>{window.removeEventListener("beforeinstallprompt",f),window.removeEventListener("appinstalled",p)}},[]);const c=m.useCallback(async()=>{if(!ka)return!1;await ka.prompt();const{outcome:u}=await ka.userChoice;return u==="accepted"?(s(!1),ka=null,!0):!1},[]);return{canInstall:t,isInstalled:i,install:c}}function SM(){const{isManualReloadMode:t,pendingReloads:s,connected:i,reloadBackend:r,reloadFrontend:c,unsafeToRestart:u,workerActivity:f}=Jv(),{fontSize:p,setFontSize:g}=p1(),{theme:v,setTheme:y}=x1(),{streamingEnabled:b,setStreamingEnabled:S}=rM(),{funPhrasesEnabled:w,setFunPhrasesEnabled:_}=MC(),{model:N,setModel:j,thinkingLevel:R,setThinkingLevel:C,thinkingEnabled:z,setThinkingEnabled:H}=bo(),{canInstall:T,isInstalled:O,install:D}=xM(),{settings:F,setEnabled:ne}=Fv(),{ignoredTools:ce,clearIgnoredTools:de}=Mt(),{isAuthenticated:q,authDisabled:Q,logout:le,changePassword:ue}=qv(),{providers:k}=Pd(),I=cT().map($=>{const me=k.find($e=>$e.name===$.id);return{...$,installed:(me==null?void 0:me.installed)??!1,authenticated:(me==null?void 0:me.authenticated)??!1}}),[oe,he]=m.useState(!1),[A,Y]=m.useState(!1),[X,ae]=m.useState(""),[fe,ie]=m.useState(""),[ve,Ae]=m.useState(""),[be,xe]=m.useState(null),[Ce,zt]=m.useState(!1),[Nt,se]=m.useState(!1),{openSidebar:Se,isWideScreen:Oe}=_s();m.useEffect(()=>{oe&&i&&he(!1)},[oe,i]);const Ie=async()=>{he(!0),await r()},ct=()=>{c()};return l.jsx("div",{className:Oe?"main-content-wrapper":"main-content-mobile",children:l.jsxs("div",{className:Oe?"main-content-constrained":"main-content-mobile-inner",children:[l.jsx(Es,{title:"Settings",onOpenSidebar:Se}),l.jsx("main",{className:"page-scroll-container",children:l.jsxs("div",{className:"page-content-inner",children:[(T||O)&&l.jsxs("section",{className:"settings-section",children:[l.jsx("h2",{children:"App"}),l.jsx("div",{className:"settings-group",children:l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Install App"}),l.jsx("p",{children:O?"Yep Anywhere is installed on your device.":"Add Yep Anywhere to your home screen for quick access."})]}),O?l.jsx("span",{className:"settings-status-badge",children:"Installed"}):l.jsx("button",{type:"button",className:"settings-button",onClick:D,children:"Install"})]})})]}),l.jsxs("section",{className:"settings-section",children:[l.jsx("h2",{children:"Appearance"}),l.jsxs("div",{className:"settings-group",children:[l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Theme"}),l.jsx("p",{children:"Choose your preferred color scheme."})]}),l.jsx("div",{className:"font-size-selector",children:iy.map($=>l.jsx("button",{type:"button",className:`font-size-option ${v===$?"active":""}`,onClick:()=>y($),children:y1($)},$))})]}),l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Font Size"}),l.jsx("p",{children:"Adjust the text size throughout the application."})]}),l.jsx("div",{className:"font-size-selector",children:ty.map($=>l.jsx("button",{type:"button",className:`font-size-option ${p===$?"active":""}`,onClick:()=>g($),children:h1($)},$))})]}),l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Response Streaming"}),l.jsx("p",{children:"Show responses as they are generated, token by token. Disable for better performance on slower devices."})]}),l.jsxs("label",{className:"toggle-switch",children:[l.jsx("input",{type:"checkbox",checked:b,onChange:$=>S($.target.checked)}),l.jsx("span",{className:"toggle-slider"})]})]}),l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Fun Phrases"}),l.jsx("p",{children:'Show playful status messages while waiting for responses. Disable to show only "Thinking..."'})]}),l.jsxs("label",{className:"toggle-switch",children:[l.jsx("input",{type:"checkbox",checked:w,onChange:$=>_($.target.checked)}),l.jsx("span",{className:"toggle-slider"})]})]})]})]}),l.jsxs("section",{className:"settings-section",children:[l.jsx("h2",{children:"Model"}),l.jsxs("div",{className:"settings-group",children:[l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Model"}),l.jsx("p",{children:"Select which Claude model to use for new sessions."})]}),l.jsx("div",{className:"font-size-selector",children:fd.map($=>l.jsx("button",{type:"button",className:`font-size-option ${N===$.value?"active":""}`,onClick:()=>j($.value),children:$.label},$.value))})]}),l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Extended Thinking"}),l.jsx("p",{children:'Allow the model to "think" before responding. Toggle on to enable deeper reasoning.'})]}),l.jsxs("label",{className:"toggle-switch",children:[l.jsx("input",{type:"checkbox",checked:z,onChange:$=>H($.target.checked)}),l.jsx("span",{className:"toggle-slider"})]})]}),l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Thinking Level"}),l.jsx("p",{children:"Token budget for thinking. Higher levels enable deeper reasoning but use more tokens."})]}),l.jsx("div",{className:"font-size-selector",children:Rj.map($=>l.jsxs("button",{type:"button",className:`font-size-option ${R===$.value?"active":""}`,onClick:()=>C($.value),title:$.description,children:[$.label," (",$.description,")"]},$.value))})]})]})]}),l.jsxs("section",{className:"settings-section",children:[l.jsx("h2",{children:"Providers"}),l.jsx("p",{className:"settings-section-description",children:"AI providers are auto-detected when their CLI is installed."}),l.jsx("div",{className:"settings-group",children:I.map($=>l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsxs("div",{className:"settings-item-header",children:[l.jsx("strong",{children:$.displayName}),$.installed?l.jsx("span",{className:"settings-status-badge settings-status-detected",children:"Detected"}):l.jsx("span",{className:"settings-status-badge settings-status-not-detected",children:"Not Detected"})]}),l.jsx("p",{children:$.metadata.description}),$.metadata.limitations.length>0&&l.jsx("ul",{className:"settings-limitations",children:$.metadata.limitations.map(me=>l.jsx("li",{children:me},me))})]}),$.metadata.website&&l.jsx("a",{href:$.metadata.website,target:"_blank",rel:"noopener noreferrer",className:"settings-link",children:"Website"})]},$.id))})]}),l.jsxs("section",{className:"settings-section",children:[l.jsx("h2",{children:"Notifications"}),l.jsx("div",{className:"settings-group",children:l.jsx(bM,{})})]}),!Q&&q&&l.jsxs("section",{className:"settings-section",children:[l.jsx("h2",{children:"Security"}),l.jsxs("div",{className:"settings-group",children:[l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Change Password"}),l.jsx("p",{children:"Update your account password."})]}),A?l.jsx("button",{type:"button",className:"settings-button settings-button-secondary",onClick:()=>{Y(!1),ae(""),ie(""),Ae(""),xe(null),zt(!1)},children:"Cancel"}):l.jsx("button",{type:"button",className:"settings-button",onClick:()=>Y(!0),children:"Change Password"})]}),A&&l.jsx("div",{className:"settings-item settings-item-form",children:l.jsxs("form",{onSubmit:async $=>{if($.preventDefault(),xe(null),zt(!1),fe!==ve){xe("Passwords do not match");return}if(fe.length<8){xe("Password must be at least 8 characters");return}se(!0);try{await ue(X,fe),zt(!0),ae(""),ie(""),Ae(""),setTimeout(()=>{Y(!1),zt(!1)},2e3)}catch(me){xe(me instanceof Error?me.message:"Failed to change password")}finally{se(!1)}},children:[l.jsxs("div",{className:"form-field",children:[l.jsx("label",{htmlFor:"current-password",children:"Current Password"}),l.jsx("input",{id:"current-password",type:"password",value:X,onChange:$=>ae($.target.value),autoComplete:"current-password",required:!0})]}),l.jsxs("div",{className:"form-field",children:[l.jsx("label",{htmlFor:"new-password",children:"New Password"}),l.jsx("input",{id:"new-password",type:"password",value:fe,onChange:$=>ie($.target.value),autoComplete:"new-password",minLength:8,required:!0})]}),l.jsxs("div",{className:"form-field",children:[l.jsx("label",{htmlFor:"confirm-password",children:"Confirm New Password"}),l.jsx("input",{id:"confirm-password",type:"password",value:ve,onChange:$=>Ae($.target.value),autoComplete:"new-password",minLength:8,required:!0})]}),be&&l.jsx("p",{className:"form-error",children:be}),Ce&&l.jsx("p",{className:"form-success",children:"Password changed!"}),l.jsx("button",{type:"submit",className:"settings-button",disabled:Nt,children:Nt?"Changing...":"Update Password"})]})}),l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Logout"}),l.jsx("p",{children:"Sign out of your account on this device."})]}),l.jsx("button",{type:"button",className:"settings-button settings-button-danger",onClick:le,children:"Logout"})]})]})]}),l.jsxs("section",{className:"settings-section",children:[l.jsx("h2",{children:"Development"}),l.jsxs("div",{className:"settings-group",children:[l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Schema Validation"}),l.jsx("p",{children:"Validate tool results against expected schemas. Shows toast notifications and logs errors to console."})]}),l.jsxs("label",{className:"toggle-switch",children:[l.jsx("input",{type:"checkbox",checked:F.enabled,onChange:$=>ne($.target.checked)}),l.jsx("span",{className:"toggle-slider"})]})]}),ce.length>0&&l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Ignored Tools"}),l.jsx("p",{children:"Tools with validation errors you chose to ignore. They will not show toast notifications."}),l.jsx("div",{className:"ignored-tools-list",children:ce.map($=>l.jsx("span",{className:"ignored-tool-badge",children:$},$))})]}),l.jsx("button",{type:"button",className:"settings-button settings-button-secondary",onClick:de,children:"Clear Ignored"})]})]}),t?l.jsxs("div",{className:"settings-group",children:[l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Restart Server"}),l.jsxs("p",{children:["Restart the backend server to pick up code changes.",s.backend&&l.jsxs("span",{className:"settings-pending",children:[" ","(changes pending)"]})]}),u&&l.jsxs("p",{className:"settings-warning",children:[f.activeWorkers," active session",f.activeWorkers!==1?"s":""," will be interrupted"]})]}),l.jsx("button",{type:"button",className:`settings-button ${u?"settings-button-danger":""}`,onClick:Ie,disabled:oe,children:oe?"Restarting...":u?"Restart Anyway":"Restart Server"})]}),l.jsxs("div",{className:"settings-item",children:[l.jsxs("div",{className:"settings-item-info",children:[l.jsx("strong",{children:"Reload Frontend"}),l.jsxs("p",{children:["Refresh the browser to pick up frontend changes.",s.frontend&&l.jsxs("span",{className:"settings-pending",children:[" ","(changes pending)"]})]})]}),l.jsx("button",{type:"button",className:"settings-button",onClick:ct,children:"Reload Frontend"})]})]}):l.jsx("p",{className:"settings-info",children:"Manual reload mode is not enabled. The server automatically restarts when code changes."})]})]})})]})})}const jM=m.Fragment;S1();g1();Jt.connect();const NM="/".replace(/\/$/,"")||void 0,vb=document.getElementById("root");if(!vb)throw new Error("Root element not found");US.createRoot(vb).render(l.jsx(jM,{children:l.jsx(oj,{basename:NM,children:l.jsx(u1,{children:l.jsxs(U0,{children:[l.jsx(nn,{path:"/",element:l.jsx(Jp,{to:"/projects",replace:!0})}),l.jsx(nn,{path:"/login",element:l.jsx(uC,{})}),l.jsxs(nn,{element:l.jsx(mT,{}),children:[l.jsx(nn,{path:"/projects",element:l.jsx(bC,{})}),l.jsx(nn,{path:"/sessions",element:l.jsx(aC,{})}),l.jsx(nn,{path:"/agents",element:l.jsx(AT,{})}),l.jsx(nn,{path:"/tasks",element:l.jsx($T,{})}),l.jsx(nn,{path:"/inbox",element:l.jsx(cC,{})}),l.jsx(nn,{path:"/recents",element:l.jsx(wC,{})}),l.jsx(nn,{path:"/settings",element:l.jsx(SM,{})}),l.jsx(nn,{path:"/projects/:projectId",element:l.jsx(Jp,{to:"/sessions",replace:!0})}),l.jsx(nn,{path:"/new-session",element:l.jsx(yC,{})}),l.jsx(nn,{path:"/projects/:projectId/sessions/:sessionId",element:l.jsx(hM,{})})]}),l.jsx(nn,{path:"/projects/:projectId/file",element:l.jsx(eC,{})}),l.jsx(nn,{path:"/activity",element:l.jsx(ST,{})})]})})})}));