neondeck 1.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (804) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/DEVELOPMENT.md +304 -0
  3. package/LICENSE +21 -0
  4. package/README.md +129 -0
  5. package/SOUL.md +8 -0
  6. package/bin/neondeck.mjs +27 -0
  7. package/config/dashboard.json +224 -0
  8. package/config/dashboard.schema.json +247 -0
  9. package/dist/SOUL.md +8 -0
  10. package/dist/assets/app-CnXGMuTl.js +3878 -0
  11. package/dist/assets/app-CnXGMuTl.js.map +1 -0
  12. package/dist/assets/autopilot-B8lfWyA1.js +68813 -0
  13. package/dist/assets/autopilot-B8lfWyA1.js.map +1 -0
  14. package/dist/assets/briefing-BT8h9XXT.js +52 -0
  15. package/dist/assets/briefing-BT8h9XXT.js.map +1 -0
  16. package/dist/assets/briefing-VMdQPEGc.js +2 -0
  17. package/dist/assets/briefings-DuApznpN.js +1596 -0
  18. package/dist/assets/briefings-DuApznpN.js.map +1 -0
  19. package/dist/assets/command-run-CnPOA8iY.js +20 -0
  20. package/dist/assets/command-run-CnPOA8iY.js.map +1 -0
  21. package/dist/assets/command-run-Smpq7waT.js +2 -0
  22. package/dist/assets/display-assistant-CKU4YJlc.js +392 -0
  23. package/dist/assets/display-assistant-CKU4YJlc.js.map +1 -0
  24. package/dist/assets/fix-pr-ci-Ce2SIcyf.js +46 -0
  25. package/dist/assets/fix-pr-ci-Ce2SIcyf.js.map +1 -0
  26. package/dist/assets/fix-pr-ci-P3dLxmbx.js +2 -0
  27. package/dist/assets/migrations/20260710061339_neondeck_pre_1_0_baseline/migration.sql +748 -0
  28. package/dist/assets/migrations/20260710061339_neondeck_pre_1_0_baseline/snapshot.json +7126 -0
  29. package/dist/assets/migrations/20260711171708_conversational_briefings/migration.sql +35 -0
  30. package/dist/assets/migrations/20260711171708_conversational_briefings/snapshot.json +7458 -0
  31. package/dist/assets/migrations/20260714191624_worktree_lock_revocation/migration.sql +1 -0
  32. package/dist/assets/migrations/20260714191624_worktree_lock_revocation/snapshot.json +7468 -0
  33. package/dist/assets/migrations/20260714213018_pr_reviews/migration.sql +34 -0
  34. package/dist/assets/migrations/20260714213018_pr_reviews/snapshot.json +7809 -0
  35. package/dist/assets/pr-reviews-BtJ5cm5P.js +521 -0
  36. package/dist/assets/pr-reviews-BtJ5cm5P.js.map +1 -0
  37. package/dist/assets/prepare-pr-worktree-B0qMZMRP.js +2 -0
  38. package/dist/assets/prepare-pr-worktree-C7SmiaTp.js +17 -0
  39. package/dist/assets/prepare-pr-worktree-C7SmiaTp.js.map +1 -0
  40. package/dist/assets/push-pr-autofix-CsMbrnXR.js +17 -0
  41. package/dist/assets/push-pr-autofix-CsMbrnXR.js.map +1 -0
  42. package/dist/assets/push-pr-autofix-njuM6ej2.js +2 -0
  43. package/dist/assets/review-pr-for-human-CEciM46A.js +2 -0
  44. package/dist/assets/review-pr-for-human-TPiQNRWV.js +790 -0
  45. package/dist/assets/review-pr-for-human-TPiQNRWV.js.map +1 -0
  46. package/dist/assets/safety-BQC7exnI.js +1931 -0
  47. package/dist/assets/safety-BQC7exnI.js.map +1 -0
  48. package/dist/assets/scheduled-agent-instruction-BbxwCKbU.js +2 -0
  49. package/dist/assets/scheduled-agent-instruction-C58itQyU.js +22 -0
  50. package/dist/assets/scheduled-agent-instruction-C58itQyU.js.map +1 -0
  51. package/dist/assets/scheduler-tick-B2S9jCYS.js +90 -0
  52. package/dist/assets/scheduler-tick-B2S9jCYS.js.map +1 -0
  53. package/dist/assets/scheduler-workflow-CnI0tWbg.js +21 -0
  54. package/dist/assets/scheduler-workflow-CnI0tWbg.js.map +1 -0
  55. package/dist/assets/skills/github-gh/SKILL.md +56 -0
  56. package/dist/assets/skills/neon-ci-fix/SKILL.md +15 -0
  57. package/dist/assets/skills/neon-docs-fix/SKILL.md +15 -0
  58. package/dist/assets/skills/neon-issue-triage/SKILL.md +13 -0
  59. package/dist/assets/skills/neon-pr-review/SKILL.md +19 -0
  60. package/dist/assets/skills/neondeck/SKILL.md +127 -0
  61. package/dist/assets/skills/neondeck-handoff/SKILL.md +31 -0
  62. package/dist/assets/triage-pr-event-CBje6df5.js +2 -0
  63. package/dist/assets/triage-pr-event-IgC-IrNs.js +17 -0
  64. package/dist/assets/triage-pr-event-IgC-IrNs.js.map +1 -0
  65. package/dist/assets/verify-then-push-pr-autofix-C5Dpomtd.js +75 -0
  66. package/dist/assets/verify-then-push-pr-autofix-C5Dpomtd.js.map +1 -0
  67. package/dist/assets/verify-then-push-pr-autofix-oZ0-wa7L.js +2 -0
  68. package/dist/config/dashboard.json +224 -0
  69. package/dist/config/dashboard.schema.json +247 -0
  70. package/dist/server.mjs +583 -0
  71. package/dist/server.mjs.map +1 -0
  72. package/dist/skills/github-gh/SKILL.md +56 -0
  73. package/dist/skills/neon-ci-fix/SKILL.md +15 -0
  74. package/dist/skills/neon-docs-fix/SKILL.md +15 -0
  75. package/dist/skills/neon-issue-triage/SKILL.md +13 -0
  76. package/dist/skills/neon-pr-review/SKILL.md +19 -0
  77. package/dist/skills/neondeck/SKILL.md +127 -0
  78. package/dist/skills/neondeck-handoff/SKILL.md +31 -0
  79. package/drizzle.config.ts +7 -0
  80. package/package.json +156 -0
  81. package/shared/patch-anchors.ts +78 -0
  82. package/shared/report-document.ts +91 -0
  83. package/src/agents/busywork-workflow.ts +24 -0
  84. package/src/agents/display-assistant.ts +137 -0
  85. package/src/agents/pr-review-assistant.ts +25 -0
  86. package/src/agents/scheduler-workflow.ts +20 -0
  87. package/src/agents/support/tools.ts +346 -0
  88. package/src/app.ts +1 -0
  89. package/src/cli/index.ts +560 -0
  90. package/src/cli/learning.ts +44 -0
  91. package/src/cli/mcp.ts +496 -0
  92. package/src/cli/modules.ts +107 -0
  93. package/src/cli/onboarding.ts +666 -0
  94. package/src/cli/options.ts +102 -0
  95. package/src/cli/output.ts +399 -0
  96. package/src/cli/preapprovals.ts +204 -0
  97. package/src/cli/prompts.ts +108 -0
  98. package/src/cli/types.ts +59 -0
  99. package/src/db.ts +41 -0
  100. package/src/desktop/open.ts +698 -0
  101. package/src/desktop/service.ts +863 -0
  102. package/src/domains/mcp/actions.ts +420 -0
  103. package/src/domains/mcp/config.ts +501 -0
  104. package/src/domains/mcp/format.ts +35 -0
  105. package/src/domains/mcp/gate.ts +188 -0
  106. package/src/domains/mcp/index.ts +9 -0
  107. package/src/domains/mcp/instructions.ts +18 -0
  108. package/src/domains/mcp/oauth.ts +1063 -0
  109. package/src/domains/mcp/policy.ts +15 -0
  110. package/src/domains/mcp/registry.ts +461 -0
  111. package/src/domains/mcp/schemas.ts +171 -0
  112. package/src/domains/mcp/stdio.ts +451 -0
  113. package/src/domains/mcp/store.ts +905 -0
  114. package/src/domains/mcp/tools.ts +119 -0
  115. package/src/lib/action-result.ts +51 -0
  116. package/src/lib/exec.ts +118 -0
  117. package/src/lib/git.ts +20 -0
  118. package/src/lib/report-html.ts +193 -0
  119. package/src/lib/sqlite.ts +51 -0
  120. package/src/lib/valibot.ts +33 -0
  121. package/src/modules/app-state/index.ts +4 -0
  122. package/src/modules/app-state/notification-events.ts +44 -0
  123. package/src/modules/app-state/notifications.ts +259 -0
  124. package/src/modules/app-state/types.ts +42 -0
  125. package/src/modules/app-state/workflow-summaries.ts +201 -0
  126. package/src/modules/autonomous-audit/index.ts +225 -0
  127. package/src/modules/autopilot/actions.ts +186 -0
  128. package/src/modules/autopilot/admissions.ts +865 -0
  129. package/src/modules/autopilot/approvals.ts +59 -0
  130. package/src/modules/autopilot/ci-fix-run.ts +1332 -0
  131. package/src/modules/autopilot/ci-fix.ts +718 -0
  132. package/src/modules/autopilot/comments.ts +426 -0
  133. package/src/modules/autopilot/fixtures.ts +344 -0
  134. package/src/modules/autopilot/github-facts.ts +306 -0
  135. package/src/modules/autopilot/index.ts +64 -0
  136. package/src/modules/autopilot/notifications.ts +271 -0
  137. package/src/modules/autopilot/push-support.ts +260 -0
  138. package/src/modules/autopilot/push.ts +670 -0
  139. package/src/modules/autopilot/recovery.ts +656 -0
  140. package/src/modules/autopilot/review-feedback.ts +649 -0
  141. package/src/modules/autopilot/review-support.ts +524 -0
  142. package/src/modules/autopilot/revision-run.ts +445 -0
  143. package/src/modules/autopilot/schemas.ts +485 -0
  144. package/src/modules/autopilot/state-mappers.ts +517 -0
  145. package/src/modules/autopilot/state-schemas.ts +450 -0
  146. package/src/modules/autopilot/state-store.ts +183 -0
  147. package/src/modules/autopilot/state.ts +255 -0
  148. package/src/modules/autopilot/triage-support.ts +234 -0
  149. package/src/modules/autopilot/triage.ts +156 -0
  150. package/src/modules/autopilot/utils.ts +145 -0
  151. package/src/modules/autopilot/worktree.ts +637 -0
  152. package/src/modules/autopilot-policy/config.ts +101 -0
  153. package/src/modules/autopilot-policy/index.ts +4 -0
  154. package/src/modules/autopilot-policy/risk.ts +359 -0
  155. package/src/modules/autopilot-policy/schemas.ts +229 -0
  156. package/src/modules/autopilot-policy/service.ts +272 -0
  157. package/src/modules/briefings/actions.ts +80 -0
  158. package/src/modules/briefings/index.ts +5 -0
  159. package/src/modules/briefings/schemas.ts +125 -0
  160. package/src/modules/briefings/service.ts +642 -0
  161. package/src/modules/briefings/snapshot.ts +291 -0
  162. package/src/modules/briefings/store.ts +644 -0
  163. package/src/modules/commands/actions.ts +112 -0
  164. package/src/modules/commands/handlers/index.ts +3 -0
  165. package/src/modules/commands/handlers/misc.ts +367 -0
  166. package/src/modules/commands/handlers/queue.ts +710 -0
  167. package/src/modules/commands/handlers/repo.ts +339 -0
  168. package/src/modules/commands/index.ts +5 -0
  169. package/src/modules/commands/registry.ts +157 -0
  170. package/src/modules/commands/runner.ts +152 -0
  171. package/src/modules/commands/schemas.ts +109 -0
  172. package/src/modules/commands/summaries.ts +108 -0
  173. package/src/modules/commands/utils.ts +113 -0
  174. package/src/modules/config/actions.ts +253 -0
  175. package/src/modules/config/events.ts +80 -0
  176. package/src/modules/config/files.ts +9 -0
  177. package/src/modules/config/history.ts +74 -0
  178. package/src/modules/config/index.ts +9 -0
  179. package/src/modules/config/mutations/dashboard.ts +333 -0
  180. package/src/modules/config/mutations/execution.ts +89 -0
  181. package/src/modules/config/mutations/models.ts +467 -0
  182. package/src/modules/config/mutations/providers.ts +163 -0
  183. package/src/modules/config/mutations/repos.ts +663 -0
  184. package/src/modules/config/read.ts +130 -0
  185. package/src/modules/config/result.ts +66 -0
  186. package/src/modules/config/schemas.ts +180 -0
  187. package/src/modules/docs-drift/index.ts +1 -0
  188. package/src/modules/docs-drift/service.ts +863 -0
  189. package/src/modules/execution/actions.ts +35 -0
  190. package/src/modules/execution/approvals.ts +322 -0
  191. package/src/modules/execution/exedev/checkouts.ts +356 -0
  192. package/src/modules/execution/exedev/context.ts +286 -0
  193. package/src/modules/execution/index.ts +7 -0
  194. package/src/modules/execution/policy.ts +102 -0
  195. package/src/modules/execution/run.ts +589 -0
  196. package/src/modules/execution/schemas.ts +116 -0
  197. package/src/modules/execution/scope.ts +137 -0
  198. package/src/modules/execution/store.ts +320 -0
  199. package/src/modules/execution/utils.ts +105 -0
  200. package/src/modules/execution-policy/index.ts +424 -0
  201. package/src/modules/flue/execution-context.ts +40 -0
  202. package/src/modules/flue/index.ts +2 -0
  203. package/src/modules/flue/origin.ts +7 -0
  204. package/src/modules/github/actions.ts +334 -0
  205. package/src/modules/github/checks.ts +484 -0
  206. package/src/modules/github/client.ts +110 -0
  207. package/src/modules/github/comments.ts +204 -0
  208. package/src/modules/github/errors.ts +50 -0
  209. package/src/modules/github/index.ts +93 -0
  210. package/src/modules/github/issues.ts +116 -0
  211. package/src/modules/github/pr-file-cache.ts +264 -0
  212. package/src/modules/github/pull-requests.ts +411 -0
  213. package/src/modules/github/queue.ts +350 -0
  214. package/src/modules/github/reviews.ts +1446 -0
  215. package/src/modules/github/schemas.ts +794 -0
  216. package/src/modules/github/state-truncation.ts +31 -0
  217. package/src/modules/handoff/index.ts +2 -0
  218. package/src/modules/handoff/schemas.ts +61 -0
  219. package/src/modules/handoff/service.ts +587 -0
  220. package/src/modules/hygiene/index.ts +1 -0
  221. package/src/modules/hygiene/service.ts +513 -0
  222. package/src/modules/kilo/actions.ts +229 -0
  223. package/src/modules/kilo/ci-fix-run-reconcile.ts +299 -0
  224. package/src/modules/kilo/docs-drift-boundary.ts +178 -0
  225. package/src/modules/kilo/index.ts +8 -0
  226. package/src/modules/kilo/notifications.ts +295 -0
  227. package/src/modules/kilo/process.ts +637 -0
  228. package/src/modules/kilo/results/actions.ts +66 -0
  229. package/src/modules/kilo/results/gates.ts +227 -0
  230. package/src/modules/kilo/results/index.ts +23 -0
  231. package/src/modules/kilo/results/schemas.ts +112 -0
  232. package/src/modules/kilo/results/service.ts +512 -0
  233. package/src/modules/kilo/results/state.ts +508 -0
  234. package/src/modules/kilo/results/verify.ts +328 -0
  235. package/src/modules/kilo/revision-reconcile.ts +187 -0
  236. package/src/modules/kilo/runtime-facts.ts +128 -0
  237. package/src/modules/kilo/schemas.ts +265 -0
  238. package/src/modules/kilo/service.ts +714 -0
  239. package/src/modules/kilo/sessions-adapters.ts +343 -0
  240. package/src/modules/kilo/sessions.ts +446 -0
  241. package/src/modules/kilo/store.ts +689 -0
  242. package/src/modules/kilo/utils.ts +166 -0
  243. package/src/modules/learning/automation-health.ts +441 -0
  244. package/src/modules/learning/automation-memory.ts +179 -0
  245. package/src/modules/learning/index.ts +6 -0
  246. package/src/modules/learning/observability.ts +616 -0
  247. package/src/modules/learning/operator.ts +404 -0
  248. package/src/modules/learning/reviews/agents.ts +33 -0
  249. package/src/modules/learning/reviews/complete.ts +321 -0
  250. package/src/modules/learning/reviews/context.ts +145 -0
  251. package/src/modules/learning/reviews/events.ts +306 -0
  252. package/src/modules/learning/reviews/index.ts +6 -0
  253. package/src/modules/learning/reviews/pr-cadence.ts +157 -0
  254. package/src/modules/learning/reviews/pr-context.ts +749 -0
  255. package/src/modules/learning/reviews/prepare.ts +387 -0
  256. package/src/modules/learning/reviews/schemas.ts +184 -0
  257. package/src/modules/learning/reviews/store.ts +405 -0
  258. package/src/modules/learning/skill-patches/actions.ts +86 -0
  259. package/src/modules/learning/skill-patches/index.ts +3 -0
  260. package/src/modules/learning/skill-patches/schemas.ts +60 -0
  261. package/src/modules/learning/skill-patches/service.ts +571 -0
  262. package/src/modules/learning/skill-patches/support.ts +417 -0
  263. package/src/modules/memory/actions.ts +183 -0
  264. package/src/modules/memory/candidates.ts +525 -0
  265. package/src/modules/memory/events.ts +2 -0
  266. package/src/modules/memory/index.ts +6 -0
  267. package/src/modules/memory/prompt.ts +214 -0
  268. package/src/modules/memory/schemas.ts +170 -0
  269. package/src/modules/memory/service.ts +578 -0
  270. package/src/modules/memory/store.ts +489 -0
  271. package/src/modules/pr-events/actions.ts +191 -0
  272. package/src/modules/pr-events/index.ts +46 -0
  273. package/src/modules/pr-events/schemas.ts +186 -0
  274. package/src/modules/pr-events/service.ts +1414 -0
  275. package/src/modules/pr-events/target.ts +222 -0
  276. package/src/modules/pr-events/utils.ts +85 -0
  277. package/src/modules/pr-events/watermarks.ts +308 -0
  278. package/src/modules/pr-local-diffs/index.ts +334 -0
  279. package/src/modules/pr-review-assist/actions.ts +239 -0
  280. package/src/modules/pr-review-assist/index.ts +3 -0
  281. package/src/modules/pr-review-assist/schemas.ts +86 -0
  282. package/src/modules/pr-review-assist/service.ts +706 -0
  283. package/src/modules/pr-reviews/events.ts +39 -0
  284. package/src/modules/pr-reviews/index.ts +4 -0
  285. package/src/modules/pr-reviews/service.ts +655 -0
  286. package/src/modules/pr-reviews/store.ts +186 -0
  287. package/src/modules/pr-reviews/types.ts +48 -0
  288. package/src/modules/prepared-diffs/actions.ts +132 -0
  289. package/src/modules/prepared-diffs/index.ts +53 -0
  290. package/src/modules/prepared-diffs/schemas.ts +255 -0
  291. package/src/modules/prepared-diffs/service.ts +791 -0
  292. package/src/modules/prepared-diffs/store.ts +678 -0
  293. package/src/modules/repo-guardrails/config.ts +61 -0
  294. package/src/modules/repo-guardrails/index.ts +162 -0
  295. package/src/modules/repo-guardrails/risk.ts +2 -0
  296. package/src/modules/reports/index.ts +1 -0
  297. package/src/modules/reports/service.ts +337 -0
  298. package/src/modules/repos/index.ts +3 -0
  299. package/src/modules/repos/model-discovery.ts +233 -0
  300. package/src/modules/repos/providers.ts +194 -0
  301. package/src/modules/repos/registry.ts +232 -0
  302. package/src/modules/runtime/agent-config.ts +167 -0
  303. package/src/modules/runtime/doctor.ts +528 -0
  304. package/src/modules/runtime/env.ts +123 -0
  305. package/src/modules/runtime/index.ts +12 -0
  306. package/src/modules/runtime/local-api-auth.ts +43 -0
  307. package/src/modules/runtime/metrics.ts +211 -0
  308. package/src/modules/runtime/skills-actions.ts +141 -0
  309. package/src/modules/runtime/skills.ts +689 -0
  310. package/src/modules/runtime/soul.ts +68 -0
  311. package/src/modules/runtime/status-database.ts +252 -0
  312. package/src/modules/runtime/status-schema.ts +149 -0
  313. package/src/modules/runtime/status.ts +481 -0
  314. package/src/modules/runtime/subagents.ts +37 -0
  315. package/src/modules/runtime/utility-model.ts +47 -0
  316. package/src/modules/safety/index.ts +3 -0
  317. package/src/modules/safety/policy-entries.ts +2528 -0
  318. package/src/modules/safety/schemas.ts +63 -0
  319. package/src/modules/safety/service.ts +58 -0
  320. package/src/modules/safety/tools.ts +15 -0
  321. package/src/modules/scheduled-tasks/actions.ts +113 -0
  322. package/src/modules/scheduled-tasks/dispatch.ts +107 -0
  323. package/src/modules/scheduled-tasks/index.ts +6 -0
  324. package/src/modules/scheduled-tasks/schemas.ts +91 -0
  325. package/src/modules/scheduled-tasks/service.ts +296 -0
  326. package/src/modules/scheduled-tasks/store.ts +814 -0
  327. package/src/modules/scheduled-tasks/triggers.ts +87 -0
  328. package/src/modules/scheduler/actions.ts +37 -0
  329. package/src/modules/scheduler/dispatch.ts +192 -0
  330. package/src/modules/scheduler/index.ts +4 -0
  331. package/src/modules/scheduler/lease.ts +247 -0
  332. package/src/modules/scheduler/pr-watch-event-deltas.ts +367 -0
  333. package/src/modules/scheduler/pr-watch-events.ts +834 -0
  334. package/src/modules/scheduler/schemas.ts +79 -0
  335. package/src/modules/scheduler/service.ts +228 -0
  336. package/src/modules/scheduler/utils.ts +106 -0
  337. package/src/modules/scheduler/workflow-invocation.ts +48 -0
  338. package/src/modules/sessions/actions.ts +213 -0
  339. package/src/modules/sessions/active-session.ts +46 -0
  340. package/src/modules/sessions/activity.ts +122 -0
  341. package/src/modules/sessions/agent-context.ts +152 -0
  342. package/src/modules/sessions/approval-nudges.ts +156 -0
  343. package/src/modules/sessions/events.ts +57 -0
  344. package/src/modules/sessions/index.ts +12 -0
  345. package/src/modules/sessions/queries.ts +252 -0
  346. package/src/modules/sessions/references.ts +113 -0
  347. package/src/modules/sessions/repo-context.ts +131 -0
  348. package/src/modules/sessions/schemas.ts +285 -0
  349. package/src/modules/sessions/service.ts +845 -0
  350. package/src/modules/sessions/store.ts +560 -0
  351. package/src/modules/sessions/summaries.ts +129 -0
  352. package/src/modules/sessions/utils.ts +18 -0
  353. package/src/modules/watches/actions.ts +115 -0
  354. package/src/modules/watches/index.ts +6 -0
  355. package/src/modules/watches/polling.ts +245 -0
  356. package/src/modules/watches/references.ts +293 -0
  357. package/src/modules/watches/schemas.ts +156 -0
  358. package/src/modules/watches/service.ts +557 -0
  359. package/src/modules/watches/store.ts +398 -0
  360. package/src/modules/watches/utils.ts +51 -0
  361. package/src/modules/worktree-verification/index.ts +256 -0
  362. package/src/modules/worktrees/access.ts +129 -0
  363. package/src/modules/worktrees/actions.ts +108 -0
  364. package/src/modules/worktrees/cleanup.ts +98 -0
  365. package/src/modules/worktrees/ensure-pr-worktree.ts +63 -0
  366. package/src/modules/worktrees/errors.ts +38 -0
  367. package/src/modules/worktrees/git.ts +48 -0
  368. package/src/modules/worktrees/index.ts +7 -0
  369. package/src/modules/worktrees/locks.ts +231 -0
  370. package/src/modules/worktrees/paths.ts +209 -0
  371. package/src/modules/worktrees/push-target.ts +39 -0
  372. package/src/modules/worktrees/queries.ts +31 -0
  373. package/src/modules/worktrees/schemas.ts +237 -0
  374. package/src/modules/worktrees/service.ts +680 -0
  375. package/src/modules/worktrees/store.ts +415 -0
  376. package/src/repo-edit/actions.ts +509 -0
  377. package/src/repo-edit/audit.ts +180 -0
  378. package/src/repo-edit/fuzzy-replace.ts +256 -0
  379. package/src/repo-edit/git.ts +830 -0
  380. package/src/repo-edit/index.ts +4 -0
  381. package/src/repo-edit/locks.ts +27 -0
  382. package/src/repo-edit/patch-parser.ts +212 -0
  383. package/src/repo-edit/patch-service.ts +572 -0
  384. package/src/repo-edit/path-safety.ts +299 -0
  385. package/src/repo-edit/schemas.ts +239 -0
  386. package/src/repo-edit/service.ts +488 -0
  387. package/src/repo-edit/support.ts +459 -0
  388. package/src/runtime-home/app-db/index.ts +74 -0
  389. package/src/runtime-home/app-db/migrate.ts +491 -0
  390. package/src/runtime-home/app-db/migrations/20260710061339_neondeck_pre_1_0_baseline/migration.sql +748 -0
  391. package/src/runtime-home/app-db/migrations/20260710061339_neondeck_pre_1_0_baseline/snapshot.json +7126 -0
  392. package/src/runtime-home/app-db/migrations/20260711171708_conversational_briefings/migration.sql +35 -0
  393. package/src/runtime-home/app-db/migrations/20260711171708_conversational_briefings/snapshot.json +7458 -0
  394. package/src/runtime-home/app-db/migrations/20260714191624_worktree_lock_revocation/migration.sql +1 -0
  395. package/src/runtime-home/app-db/migrations/20260714191624_worktree_lock_revocation/snapshot.json +7468 -0
  396. package/src/runtime-home/app-db/migrations/20260714213018_pr_reviews/migration.sql +34 -0
  397. package/src/runtime-home/app-db/migrations/20260714213018_pr_reviews/snapshot.json +7809 -0
  398. package/src/runtime-home/app-db/reconcile.ts +155 -0
  399. package/src/runtime-home/app-db/schema.ts +1209 -0
  400. package/src/runtime-home/bootstrap.ts +177 -0
  401. package/src/runtime-home/dashboard-migrations.ts +101 -0
  402. package/src/runtime-home/defaults.ts +54 -0
  403. package/src/runtime-home/files.ts +193 -0
  404. package/src/runtime-home/guardrails.ts +77 -0
  405. package/src/runtime-home/index.ts +71 -0
  406. package/src/runtime-home/paths.ts +75 -0
  407. package/src/runtime-home/schemas.ts +520 -0
  408. package/src/sandboxes/exedev.ts +676 -0
  409. package/src/server/app.ts +5 -0
  410. package/src/server/autopilot-push-dispatch.ts +326 -0
  411. package/src/server/create-app.ts +160 -0
  412. package/src/server/events/event-stream.ts +109 -0
  413. package/src/server/http.ts +56 -0
  414. package/src/server/learning-hooks.ts +489 -0
  415. package/src/server/middleware.ts +81 -0
  416. package/src/server/routes/autopilot.ts +318 -0
  417. package/src/server/routes/briefings.ts +34 -0
  418. package/src/server/routes/commands.ts +12 -0
  419. package/src/server/routes/config.ts +124 -0
  420. package/src/server/routes/execution.ts +71 -0
  421. package/src/server/routes/github.ts +559 -0
  422. package/src/server/routes/handoff.ts +69 -0
  423. package/src/server/routes/kilo.ts +179 -0
  424. package/src/server/routes/learning.ts +384 -0
  425. package/src/server/routes/mcp.ts +301 -0
  426. package/src/server/routes/memory.ts +99 -0
  427. package/src/server/routes/metrics.ts +12 -0
  428. package/src/server/routes/notifications.ts +48 -0
  429. package/src/server/routes/repo-edit.ts +115 -0
  430. package/src/server/routes/reports.ts +128 -0
  431. package/src/server/routes/repos.ts +50 -0
  432. package/src/server/routes/reviews.ts +257 -0
  433. package/src/server/routes/runtime.ts +48 -0
  434. package/src/server/routes/safety.ts +13 -0
  435. package/src/server/routes/scheduled-tasks.ts +60 -0
  436. package/src/server/routes/scheduler.ts +13 -0
  437. package/src/server/routes/sessions.ts +229 -0
  438. package/src/server/routes/skills.ts +103 -0
  439. package/src/server/routes/watches.ts +81 -0
  440. package/src/server/routes/workflows.ts +21 -0
  441. package/src/server/routes/worktrees.ts +64 -0
  442. package/src/server/scheduler-workflow.ts +541 -0
  443. package/src/server/serve.ts +100 -0
  444. package/src/setup.ts +162 -0
  445. package/src/skills/github-gh/SKILL.md +56 -0
  446. package/src/skills/neon-ci-fix/SKILL.md +15 -0
  447. package/src/skills/neon-docs-fix/SKILL.md +15 -0
  448. package/src/skills/neon-issue-triage/SKILL.md +13 -0
  449. package/src/skills/neon-pr-review/SKILL.md +19 -0
  450. package/src/skills/neondeck/SKILL.md +127 -0
  451. package/src/skills/neondeck-handoff/SKILL.md +31 -0
  452. package/src/workflows/briefing.ts +50 -0
  453. package/src/workflows/command-run.ts +15 -0
  454. package/src/workflows/comment-pr-autofix-result.ts +10 -0
  455. package/src/workflows/curate_learning_store.ts +37 -0
  456. package/src/workflows/dev-doctor.ts +10 -0
  457. package/src/workflows/fix-pr-ci-failure.ts +10 -0
  458. package/src/workflows/fix-pr-ci.ts +15 -0
  459. package/src/workflows/fix-pr-review-feedback.ts +10 -0
  460. package/src/workflows/handoff_to_kilo.ts +10 -0
  461. package/src/workflows/prepare-pr-worktree.ts +10 -0
  462. package/src/workflows/promote_kilo_result.ts +10 -0
  463. package/src/workflows/push-pr-autofix.ts +10 -0
  464. package/src/workflows/reconcile_kilo_task.ts +10 -0
  465. package/src/workflows/review-pr-for-human.ts +15 -0
  466. package/src/workflows/review_conversation_for_learning.ts +37 -0
  467. package/src/workflows/review_kilo_result.ts +10 -0
  468. package/src/workflows/review_pr_batch_for_learning.ts +37 -0
  469. package/src/workflows/scheduled-agent-instruction.ts +16 -0
  470. package/src/workflows/scheduler-tick.ts +10 -0
  471. package/src/workflows/summarize_kilo_session.ts +25 -0
  472. package/src/workflows/triage-pr-event.ts +10 -0
  473. package/src/workflows/verify-pr-worktree.ts +10 -0
  474. package/src/workflows/verify-then-push-pr-autofix.ts +82 -0
  475. package/src/workflows/verify_kilo_result.ts +10 -0
  476. package/src/workflows/watch-pr.ts +10 -0
  477. package/web/dist/assets/GitHubPrReview-Bf8PXCaq.js +3 -0
  478. package/web/dist/assets/MultiFileView-CFYStqTV.js +2970 -0
  479. package/web/dist/assets/PrReviewPopoutPage-CZN1CV82.js +1 -0
  480. package/web/dist/assets/abap-CLvhMVsD.js +1 -0
  481. package/web/dist/assets/actionscript-3--17pq3dv.js +1 -0
  482. package/web/dist/assets/ada-C5qYipkI.js +1 -0
  483. package/web/dist/assets/andromeeda-vGVdxbeo.js +1 -0
  484. package/web/dist/assets/angular-html-BVBpGdXr.js +1 -0
  485. package/web/dist/assets/angular-ts-BfdufMKP.js +1 -0
  486. package/web/dist/assets/apache-U0d_L8uA.js +1 -0
  487. package/web/dist/assets/apex-VAyPSnFM.js +1 -0
  488. package/web/dist/assets/apl-DWBSSoBH.js +1 -0
  489. package/web/dist/assets/applescript-CCn79oCD.js +1 -0
  490. package/web/dist/assets/ara-4CJ0cIlV.js +1 -0
  491. package/web/dist/assets/asciidoc-DE70LPWp.js +1 -0
  492. package/web/dist/assets/asm-Cmm7eHzH.js +1 -0
  493. package/web/dist/assets/astro-3LtMP0Sq.js +1 -0
  494. package/web/dist/assets/aurora-x-CDeNXAV0.js +1 -0
  495. package/web/dist/assets/awk-BWXHIvNe.js +1 -0
  496. package/web/dist/assets/ayu-dark-DluEY0Gj.js +1 -0
  497. package/web/dist/assets/ayu-light-C3h-C4tm.js +1 -0
  498. package/web/dist/assets/ayu-mirage-Bqwy1Gya.js +1 -0
  499. package/web/dist/assets/ballerina-B7ZEbQpA.js +1 -0
  500. package/web/dist/assets/bat-Bo4NYOV-.js +1 -0
  501. package/web/dist/assets/beancount-D-usSTwE.js +1 -0
  502. package/web/dist/assets/berry-DKpUyyne.js +1 -0
  503. package/web/dist/assets/bibtex-Ci_nEsc7.js +1 -0
  504. package/web/dist/assets/bicep-CUHmPFLl.js +1 -0
  505. package/web/dist/assets/bird2-C6vDhewU.js +1 -0
  506. package/web/dist/assets/blade-llJRbbtR.js +1 -0
  507. package/web/dist/assets/bsl-BkkzgIyY.js +1 -0
  508. package/web/dist/assets/c-Wt1voDr2.js +1 -0
  509. package/web/dist/assets/c3-BFHwR3_K.js +1 -0
  510. package/web/dist/assets/cadence-CQ2zXKGN.js +1 -0
  511. package/web/dist/assets/cairo-DLTphjLi.js +1 -0
  512. package/web/dist/assets/catppuccin-frappe-3VR1Za6u.js +1 -0
  513. package/web/dist/assets/catppuccin-latte-DwIHMF0Q.js +1 -0
  514. package/web/dist/assets/catppuccin-macchiato-DYnBP6_5.js +1 -0
  515. package/web/dist/assets/catppuccin-mocha-DYhrFGRu.js +1 -0
  516. package/web/dist/assets/ccount-CMHa3wy6.js +1 -0
  517. package/web/dist/assets/clarity-SemFz856.js +1 -0
  518. package/web/dist/assets/clojure-DqKBuwfJ.js +1 -0
  519. package/web/dist/assets/cmake-Bj61d0ZC.js +1 -0
  520. package/web/dist/assets/cobol-x_HIyl2P.js +1 -0
  521. package/web/dist/assets/codeowners-C8r90Shi.js +1 -0
  522. package/web/dist/assets/codeql-oeQT6MSM.js +1 -0
  523. package/web/dist/assets/coffee-CThvmt4R.js +1 -0
  524. package/web/dist/assets/common-lisp-Cv5bFMCO.js +1 -0
  525. package/web/dist/assets/coq-BrsZFFmf.js +1 -0
  526. package/web/dist/assets/cpp-NtAeskI3.js +1 -0
  527. package/web/dist/assets/crystal-DNu_sX0G.js +1 -0
  528. package/web/dist/assets/csharp-oqKa8noW.js +1 -0
  529. package/web/dist/assets/css-DJp_X0uY.js +1 -0
  530. package/web/dist/assets/csv-Dx-8-gkx.js +1 -0
  531. package/web/dist/assets/cue-CE9AQfxI.js +1 -0
  532. package/web/dist/assets/cypher-ClKdZ_lG.js +1 -0
  533. package/web/dist/assets/d-qD-0Kul2.js +1 -0
  534. package/web/dist/assets/dark-plus-Cs2F2srj.js +1 -0
  535. package/web/dist/assets/dart-CnvKMtbv.js +1 -0
  536. package/web/dist/assets/dax-BkyTk9wS.js +1 -0
  537. package/web/dist/assets/desktop-Dlh5hvp9.js +1 -0
  538. package/web/dist/assets/diff-woXpYk--.js +1 -0
  539. package/web/dist/assets/docker-IyjqRm3v.js +1 -0
  540. package/web/dist/assets/dotenv-_5a1GRtc.js +1 -0
  541. package/web/dist/assets/dracula-BHWKrbxM.js +1 -0
  542. package/web/dist/assets/dracula-soft-5eyTD99u.js +1 -0
  543. package/web/dist/assets/dream-maker-DW3nJb8Q.js +1 -0
  544. package/web/dist/assets/edge-ozw5tpLl.js +1 -0
  545. package/web/dist/assets/elixir-VhA6FeZt.js +1 -0
  546. package/web/dist/assets/elm-dREJmIFz.js +1 -0
  547. package/web/dist/assets/emacs-lisp-B4R74twV.js +1 -0
  548. package/web/dist/assets/erb-CIg6G69l.js +1 -0
  549. package/web/dist/assets/erlang-Cphh6RMH.js +1 -0
  550. package/web/dist/assets/everforest-dark-sB-x3p7T.js +1 -0
  551. package/web/dist/assets/everforest-light-Df2xbC6M.js +1 -0
  552. package/web/dist/assets/fennel-DQxkIbk2.js +1 -0
  553. package/web/dist/assets/fish-BJitypiv.js +1 -0
  554. package/web/dist/assets/fluent-C03EYrpw.js +1 -0
  555. package/web/dist/assets/fortran-fixed-form-DEKoE2YW.js +1 -0
  556. package/web/dist/assets/fortran-free-form-CYNrtFtB.js +1 -0
  557. package/web/dist/assets/fsharp-D13ZGOAj.js +1 -0
  558. package/web/dist/assets/gdresource-C0sCabJj.js +1 -0
  559. package/web/dist/assets/gdscript-Cp2uCuqX.js +1 -0
  560. package/web/dist/assets/gdshader-CBce3t8t.js +1 -0
  561. package/web/dist/assets/genie-CV2tkWYe.js +1 -0
  562. package/web/dist/assets/gherkin-DExj1W_8.js +1 -0
  563. package/web/dist/assets/git-commit-BSykSTBG.js +1 -0
  564. package/web/dist/assets/git-rebase-B44mJPta.js +1 -0
  565. package/web/dist/assets/github-dark-C-LZuMrd.js +1 -0
  566. package/web/dist/assets/github-dark-default-DXG-b-1a.js +1 -0
  567. package/web/dist/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
  568. package/web/dist/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
  569. package/web/dist/assets/github-light-EUqPIrTm.js +1 -0
  570. package/web/dist/assets/github-light-default-BXViO-2h.js +1 -0
  571. package/web/dist/assets/github-light-high-contrast-B68TUdTA.js +1 -0
  572. package/web/dist/assets/gleam-CSRkHgEL.js +1 -0
  573. package/web/dist/assets/glimmer-js-vH_gHG0-.js +1 -0
  574. package/web/dist/assets/glimmer-ts--abOzSAQ.js +1 -0
  575. package/web/dist/assets/glsl-Dv5r7kPw.js +1 -0
  576. package/web/dist/assets/gn-ilITqXS6.js +1 -0
  577. package/web/dist/assets/gnuplot-7GGW24-e.js +1 -0
  578. package/web/dist/assets/go-rLFTqkRN.js +1 -0
  579. package/web/dist/assets/graphql-CB4jsw2E.js +1 -0
  580. package/web/dist/assets/groovy-CacY0gHj.js +1 -0
  581. package/web/dist/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
  582. package/web/dist/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
  583. package/web/dist/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
  584. package/web/dist/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
  585. package/web/dist/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
  586. package/web/dist/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
  587. package/web/dist/assets/hack-DvEYX148.js +1 -0
  588. package/web/dist/assets/haml-zE6W3STP.js +1 -0
  589. package/web/dist/assets/handlebars-CzBR2SDs.js +1 -0
  590. package/web/dist/assets/haskell-D8IpX4py.js +1 -0
  591. package/web/dist/assets/haxe-OTjmBuCE.js +1 -0
  592. package/web/dist/assets/hcl-Dh228itO.js +1 -0
  593. package/web/dist/assets/hjson-CxZEssPk.js +1 -0
  594. package/web/dist/assets/hlsl-Cvrh5tZx.js +1 -0
  595. package/web/dist/assets/horizon-CE9ld1lL.js +1 -0
  596. package/web/dist/assets/horizon-bright-DSNQnXHK.js +1 -0
  597. package/web/dist/assets/houston-CsvMBhTu.js +1 -0
  598. package/web/dist/assets/html-C8UlPnhE.js +1 -0
  599. package/web/dist/assets/html-derivative-CY6NRz-J.js +1 -0
  600. package/web/dist/assets/http-Cyd7bS_S.js +1 -0
  601. package/web/dist/assets/hurl-CWPsiEpf.js +1 -0
  602. package/web/dist/assets/hxml-B0Qn7Nwc.js +1 -0
  603. package/web/dist/assets/hy-CZbG8q4J.js +1 -0
  604. package/web/dist/assets/imba-DsUTQ-LC.js +1 -0
  605. package/web/dist/assets/index-BTjK1c82.js +44 -0
  606. package/web/dist/assets/index-D0kg2-9O.css +2 -0
  607. package/web/dist/assets/ini-B5eOa1yu.js +1 -0
  608. package/web/dist/assets/java-CGc3VwQr.js +1 -0
  609. package/web/dist/assets/javascript-CUt1pgmJ.js +1 -0
  610. package/web/dist/assets/jinja-CD-Z-FLd.js +1 -0
  611. package/web/dist/assets/jison-imPNup1l.js +1 -0
  612. package/web/dist/assets/json-Bg9ijW3F.js +1 -0
  613. package/web/dist/assets/json5-BR5RXkoi.js +1 -0
  614. package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  615. package/web/dist/assets/jsonl-CmCQp5Yx.js +1 -0
  616. package/web/dist/assets/jsonnet-CJTPZ8u_.js +1 -0
  617. package/web/dist/assets/jssm-DXw9l8Rf.js +1 -0
  618. package/web/dist/assets/jsx-CY6oMTks.js +1 -0
  619. package/web/dist/assets/julia-Dc3O-irA.js +1 -0
  620. package/web/dist/assets/just-BhOq_Kbv.js +1 -0
  621. package/web/dist/assets/kanagawa-dragon-CXtmUGW6.js +1 -0
  622. package/web/dist/assets/kanagawa-lotus-BN08jTvb.js +1 -0
  623. package/web/dist/assets/kanagawa-wave-CTweb8Dz.js +1 -0
  624. package/web/dist/assets/kdl-CsD5j6eV.js +1 -0
  625. package/web/dist/assets/kilo-CvN-tXHs.js +1 -0
  626. package/web/dist/assets/kotlin-DhhofPvG.js +1 -0
  627. package/web/dist/assets/kusto-C7mF5XQf.js +1 -0
  628. package/web/dist/assets/laserwave-C_8bwKvT.js +1 -0
  629. package/web/dist/assets/latex-Cu4Y1d5w.js +1 -0
  630. package/web/dist/assets/lean-CewbzKMR.js +1 -0
  631. package/web/dist/assets/less-DVTAwKKz.js +1 -0
  632. package/web/dist/assets/light-plus-DVQuIRkW.js +1 -0
  633. package/web/dist/assets/liquid-CvXMrjlQ.js +1 -0
  634. package/web/dist/assets/llvm-Cm23YOpf.js +1 -0
  635. package/web/dist/assets/log-BNLmms1o.js +1 -0
  636. package/web/dist/assets/logo-Cluzi2Zq.js +1 -0
  637. package/web/dist/assets/lua-BjLEUjKY.js +1 -0
  638. package/web/dist/assets/luau-FMPmPwt6.js +1 -0
  639. package/web/dist/assets/make-Dixweg8N.js +1 -0
  640. package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  641. package/web/dist/assets/marko-DvhNOisQ.js +1 -0
  642. package/web/dist/assets/material-theme-Bm3Qr25_.js +1 -0
  643. package/web/dist/assets/material-theme-darker-2IIEA8gg.js +1 -0
  644. package/web/dist/assets/material-theme-lighter-uhdI0v04.js +1 -0
  645. package/web/dist/assets/material-theme-ocean-CHQ94UKr.js +1 -0
  646. package/web/dist/assets/material-theme-palenight-B5W6OYN7.js +1 -0
  647. package/web/dist/assets/matlab-D7qyCx1q.js +1 -0
  648. package/web/dist/assets/mdc-Bm9TpL1X.js +1 -0
  649. package/web/dist/assets/mdx-DQZ5AkYe.js +1 -0
  650. package/web/dist/assets/mermaid-Bk4SNUv9.js +1 -0
  651. package/web/dist/assets/min-dark-BSWPekZh.js +1 -0
  652. package/web/dist/assets/min-light-DDpmG2fV.js +1 -0
  653. package/web/dist/assets/mipsasm-BMqwQI7S.js +1 -0
  654. package/web/dist/assets/mojo-BgCJLMeH.js +1 -0
  655. package/web/dist/assets/monokai-CdkpiU2Y.js +1 -0
  656. package/web/dist/assets/moonbit-CaWjb8XO.js +1 -0
  657. package/web/dist/assets/move-B1IS1UjX.js +1 -0
  658. package/web/dist/assets/narrat-_X_XdTYD.js +1 -0
  659. package/web/dist/assets/nextflow-BJtWHP5T.js +1 -0
  660. package/web/dist/assets/nextflow-groovy-DJMQeKeT.js +1 -0
  661. package/web/dist/assets/nginx-Bhc82uuv.js +1 -0
  662. package/web/dist/assets/night-owl-DhmEMT88.js +1 -0
  663. package/web/dist/assets/night-owl-light-eJ-hLW7d.js +1 -0
  664. package/web/dist/assets/nim-DXTVBFnF.js +1 -0
  665. package/web/dist/assets/nix-IvuFDN5E.js +1 -0
  666. package/web/dist/assets/nord-Cb4Vim4T.js +1 -0
  667. package/web/dist/assets/nushell-DcLAeLz5.js +1 -0
  668. package/web/dist/assets/objective-c-D1A_Heim.js +1 -0
  669. package/web/dist/assets/objective-cpp-BsSzOQcm.js +1 -0
  670. package/web/dist/assets/ocaml-O90oeIOV.js +1 -0
  671. package/web/dist/assets/odin-B1RWQWA5.js +1 -0
  672. package/web/dist/assets/one-dark-pro-CLwyXe_n.js +1 -0
  673. package/web/dist/assets/one-light-D7Lr4KcI.js +1 -0
  674. package/web/dist/assets/openscad-BUDT5pXO.js +1 -0
  675. package/web/dist/assets/pascal-4ZHwLPI5.js +1 -0
  676. package/web/dist/assets/perl-C7veXV9z.js +1 -0
  677. package/web/dist/assets/php-BRiuMnnr.js +1 -0
  678. package/web/dist/assets/pierre-dark-CpLgRqie.js +1 -0
  679. package/web/dist/assets/pierre-dark-protanopia-deuteranopia-B35FxJx-.js +1 -0
  680. package/web/dist/assets/pierre-dark-soft-kZQmAZld.js +1 -0
  681. package/web/dist/assets/pierre-dark-tritanopia-CpjhbsIL.js +1 -0
  682. package/web/dist/assets/pierre-dark-vibrant-CpQYzh95.js +1 -0
  683. package/web/dist/assets/pierre-light-CoaEpmwp.js +1 -0
  684. package/web/dist/assets/pierre-light-protanopia-deuteranopia-0fSaH845.js +1 -0
  685. package/web/dist/assets/pierre-light-soft-lWLdNTOI.js +1 -0
  686. package/web/dist/assets/pierre-light-tritanopia-CEbqgOJL.js +1 -0
  687. package/web/dist/assets/pierre-light-vibrant-D80Fkn33.js +1 -0
  688. package/web/dist/assets/pkl-ot-7Btpt.js +1 -0
  689. package/web/dist/assets/plastic-DQwYfKfQ.js +1 -0
  690. package/web/dist/assets/plsql-DGHpHOYJ.js +1 -0
  691. package/web/dist/assets/po-BiJDBrnU.js +1 -0
  692. package/web/dist/assets/poimandres-DRFjx7u4.js +1 -0
  693. package/web/dist/assets/polar-C7UOKdEL.js +1 -0
  694. package/web/dist/assets/postcss-BXeXVLqQ.js +1 -0
  695. package/web/dist/assets/powerquery-DNMTfnFr.js +1 -0
  696. package/web/dist/assets/powershell-DshXNtvi.js +1 -0
  697. package/web/dist/assets/prisma-BsRQq5mF.js +1 -0
  698. package/web/dist/assets/prolog-iXnhIJG7.js +1 -0
  699. package/web/dist/assets/proto-DB4EqR-F.js +1 -0
  700. package/web/dist/assets/pug-C5hz5LQ7.js +1 -0
  701. package/web/dist/assets/puppet-CDv2pdJW.js +1 -0
  702. package/web/dist/assets/purescript-9MfHhQsQ.js +1 -0
  703. package/web/dist/assets/python-gzcpVVnB.js +1 -0
  704. package/web/dist/assets/qml-BdUV3aTS.js +1 -0
  705. package/web/dist/assets/qmldir-DCQb3MpD.js +1 -0
  706. package/web/dist/assets/qss-Fe1Jh2GI.js +1 -0
  707. package/web/dist/assets/r-8R7vtdQc.js +1 -0
  708. package/web/dist/assets/racket-DcIDlBhZ.js +1 -0
  709. package/web/dist/assets/raku-B3gFvitq.js +1 -0
  710. package/web/dist/assets/razor-DRL52XO2.js +1 -0
  711. package/web/dist/assets/red-CJ3rzSJv.js +1 -0
  712. package/web/dist/assets/reg-CRGYupPL.js +1 -0
  713. package/web/dist/assets/regexp-Omp9DhTb.js +1 -0
  714. package/web/dist/assets/rel-BtDbiS_P.js +1 -0
  715. package/web/dist/assets/reviews-CUXp47M8.js +1 -0
  716. package/web/dist/assets/riscv-Ckw8ddFX.js +1 -0
  717. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  718. package/web/dist/assets/ron-VUp2lXgN.js +1 -0
  719. package/web/dist/assets/rose-pine-BthvhNj6.js +1 -0
  720. package/web/dist/assets/rose-pine-dawn-Dg85fqjY.js +1 -0
  721. package/web/dist/assets/rose-pine-moon-hon4tzzS.js +1 -0
  722. package/web/dist/assets/rosmsg-CAekHB0j.js +1 -0
  723. package/web/dist/assets/rst-BHX71KW9.js +1 -0
  724. package/web/dist/assets/ruby-B--HzjGU.js +1 -0
  725. package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
  726. package/web/dist/assets/sas-DrLaYOK_.js +1 -0
  727. package/web/dist/assets/sass-DXrisJhu.js +1 -0
  728. package/web/dist/assets/scala-DKOlJaKm.js +1 -0
  729. package/web/dist/assets/scheme-DQCgrYNe.js +1 -0
  730. package/web/dist/assets/scss-DdSxiZKl.js +1 -0
  731. package/web/dist/assets/sdbl-bTVj8UrX.js +1 -0
  732. package/web/dist/assets/shaderlab-TOUzSsQk.js +1 -0
  733. package/web/dist/assets/shellscript-DwcUjJBL.js +1 -0
  734. package/web/dist/assets/shellsession-CPZkydE6.js +1 -0
  735. package/web/dist/assets/slack-dark-DnToyrRv.js +1 -0
  736. package/web/dist/assets/slack-ochin-B2OO5cIa.js +1 -0
  737. package/web/dist/assets/smalltalk-B16xEiuN.js +1 -0
  738. package/web/dist/assets/snazzy-light-4G7pJPwS.js +1 -0
  739. package/web/dist/assets/solarized-dark-DV17i1UV.js +1 -0
  740. package/web/dist/assets/solarized-light-DSh2HLQt.js +1 -0
  741. package/web/dist/assets/solidity-CKzVLygQ.js +1 -0
  742. package/web/dist/assets/soy-Br5FhD7c.js +1 -0
  743. package/web/dist/assets/sparql-D_iOobhT.js +1 -0
  744. package/web/dist/assets/splunk-BC2Px7Mm.js +1 -0
  745. package/web/dist/assets/sql-DNssxck8.js +1 -0
  746. package/web/dist/assets/ssh-config-BgfXC-Er.js +1 -0
  747. package/web/dist/assets/stata-DXn1tqOr.js +1 -0
  748. package/web/dist/assets/stylus-B6D30XZt.js +1 -0
  749. package/web/dist/assets/surfaces-Dlg1xLbg.js +1 -0
  750. package/web/dist/assets/surrealql-IeLNQw0f.js +1 -0
  751. package/web/dist/assets/svelte-DOdLCIlh.js +1 -0
  752. package/web/dist/assets/swift-DonLKvLd.js +1 -0
  753. package/web/dist/assets/synthwave-84-nFMaYfgc.js +1 -0
  754. package/web/dist/assets/system-verilog-DJ5XKQeo.js +1 -0
  755. package/web/dist/assets/systemd-BxMlprV5.js +1 -0
  756. package/web/dist/assets/talonscript-CohzipZa.js +1 -0
  757. package/web/dist/assets/tasl-DMoTqEGO.js +1 -0
  758. package/web/dist/assets/tcl-CZd0xW_V.js +1 -0
  759. package/web/dist/assets/templ-CIwIngms.js +1 -0
  760. package/web/dist/assets/terraform-DswuEJGm.js +1 -0
  761. package/web/dist/assets/tex-D8QMumu5.js +1 -0
  762. package/web/dist/assets/tokyo-night-oM2G3aXe.js +1 -0
  763. package/web/dist/assets/toml-CcmNWLt0.js +1 -0
  764. package/web/dist/assets/ts-tags-BMVY4q-l.js +1 -0
  765. package/web/dist/assets/tsv-sltzmVWM.js +1 -0
  766. package/web/dist/assets/tsx-5Eka4NBX.js +1 -0
  767. package/web/dist/assets/turtle-ByJddavk.js +1 -0
  768. package/web/dist/assets/twig-C8o_5mgw.js +1 -0
  769. package/web/dist/assets/typescript-DOu2WMV5.js +1 -0
  770. package/web/dist/assets/typespec-BRdr0IET.js +1 -0
  771. package/web/dist/assets/typst-DI99ib-x.js +1 -0
  772. package/web/dist/assets/v-DETTlOr0.js +1 -0
  773. package/web/dist/assets/vala-zf12oZj6.js +1 -0
  774. package/web/dist/assets/vb-Djn5o6TS.js +1 -0
  775. package/web/dist/assets/verilog-CiiDBU1e.js +1 -0
  776. package/web/dist/assets/vesper-DdrHHSXu.js +1 -0
  777. package/web/dist/assets/vhdl-BroJfC0k.js +1 -0
  778. package/web/dist/assets/viml-DvXPmvsu.js +1 -0
  779. package/web/dist/assets/vitesse-black-fwtXNY1n.js +1 -0
  780. package/web/dist/assets/vitesse-dark-BZCL-v6S.js +1 -0
  781. package/web/dist/assets/vitesse-light-VbXTXTou.js +1 -0
  782. package/web/dist/assets/vue-BU18DNDL.js +1 -0
  783. package/web/dist/assets/vue-html-BeluIYX0.js +1 -0
  784. package/web/dist/assets/vue-vine-DGUAbOCX.js +1 -0
  785. package/web/dist/assets/vyper-CgoNMtux.js +1 -0
  786. package/web/dist/assets/wasm-BnjxR4X6.js +1 -0
  787. package/web/dist/assets/wasm-ByWQv1Qj.js +1 -0
  788. package/web/dist/assets/wenyan-C8pVoKbM.js +1 -0
  789. package/web/dist/assets/wgsl-BsKzXJz4.js +1 -0
  790. package/web/dist/assets/wikitext-ClFFjSW2.js +1 -0
  791. package/web/dist/assets/wit-DdvCle-K.js +1 -0
  792. package/web/dist/assets/wolfram-DLL8P-h_.js +1 -0
  793. package/web/dist/assets/worker-05jVtNwz.js +160 -0
  794. package/web/dist/assets/xml-DIqSwXR3.js +1 -0
  795. package/web/dist/assets/xsl-Ct_-YIAy.js +1 -0
  796. package/web/dist/assets/yaml-DTtCYNlS.js +1 -0
  797. package/web/dist/assets/zenscript-BnlCZFoB.js +1 -0
  798. package/web/dist/assets/zig-CMLA9XwU.js +1 -0
  799. package/web/dist/icons/neondeck-icon-192.png +0 -0
  800. package/web/dist/icons/neondeck-icon-512.png +0 -0
  801. package/web/dist/icons/neondeck-icon.svg +41 -0
  802. package/web/dist/icons/neondeck-maskable-512.png +0 -0
  803. package/web/dist/index.html +27 -0
  804. package/web/dist/manifest.webmanifest +28 -0
@@ -0,0 +1,44 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/surfaces-Dlg1xLbg.js","assets/rolldown-runtime-QTnfLwEv.js","assets/ccount-CMHa3wy6.js","assets/kilo-CvN-tXHs.js","assets/MultiFileView-CFYStqTV.js","assets/GitHubPrReview-Bf8PXCaq.js","assets/reviews-CUXp47M8.js","assets/PrReviewPopoutPage-CZN1CV82.js"])))=>i.map(i=>d[i]);
2
+ import{n as e,r as t,t as n}from"./rolldown-runtime-QTnfLwEv.js";import{A as r,C as i,D as a,E as o,G as s,M as c,N as l,O as u,P as d,S as f,T as p,U as m,W as h,_ as g,a as _,b as v,c as y,d as b,f as x,g as S,h as C,i as w,l as T,m as E,n as ee,o as D,p as te,r as ne,s as re,t as ie,tt as O,u as k,v as A,w as j,x as ae,y as M}from"./ccount-CMHa3wy6.js";import{S as oe,a as se,i as N,m as ce,o as le,r as ue,t as de,x as P}from"./reviews-CUXp47M8.js";import{c as fe,d as pe,f as me,i as he,n as ge,r as _e,s as ve,u as ye}from"./kilo-CvN-tXHs.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var be=n(((e,t)=>{function n(e){var t=new e,n=t;function r(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r}function i(e){n.next=e,n=e}return{get:r,release:i}}t.exports=n})),xe=n(((e,t)=>{var n=be();function r(e,t,r){if(typeof e==`function`&&(r=t,t=e,e=null),!(r>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);var o=n(a),s=null,c=null,l=0,u=null,d={push:v,drain:i,saturated:i,pause:p,paused:!1,get concurrency(){return r},set concurrency(e){if(!(e>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);if(r=e,!d.paused)for(;s&&l<r;)l++,b()},running:f,resume:g,idle:_,length:m,getQueue:h,unshift:y,empty:i,kill:x,killAndDrain:S,error:w,abort:C};return d;function f(){return l}function p(){d.paused=!0}function m(){for(var e=s,t=0;e;)e=e.next,t++;return t}function h(){for(var e=s,t=[];e;)t.push(e.value),e=e.next;return t}function g(){if(d.paused){if(d.paused=!1,s===null){l++,b();return}for(;s&&l<r;)l++,b()}}function _(){return l===0&&d.length()===0}function v(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?c?(c.next=f,c=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function y(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?s?(f.next=s,s=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function b(n){n&&o.release(n);var i=s;i&&l<=r?d.paused?l--:(c===s&&(c=null),s=i.next,i.next=null,t.call(e,i.value,i.worked),c===null&&d.empty()):--l===0&&d.drain()}function x(){s=null,c=null,d.drain=i}function S(){s=null,c=null,d.drain(),d.drain=i}function C(){var e=s;for(s=null,c=null;e;){var t=e.next,n=e.callback,r=e.errorHandler,a=e.value,o=e.context;e.value=null,e.callback=i,e.errorHandler=null,r&&r(Error(`abort`),a),n.call(o,Error(`abort`)),e.release(e),e=t}d.drain=i}function w(e){u=e}}function i(){}function a(){this.value=null,this.callback=i,this.next=null,this.release=i,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var r=e.callback,a=e.errorHandler,o=e.value;e.value=null,e.callback=i,e.errorHandler&&a(t,o),r.call(e.context,t,n),e.release(e)}}function o(e,t,n){typeof e==`function`&&(n=t,t=e,e=null);function a(e,n){t.call(this,e).then(function(e){n(null,e)},n)}var o=r(e,a,n),s=o.push,c=o.unshift;return o.push=l,o.unshift=u,o.drained=d,o;function l(e){var t=new Promise(function(t,n){s(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function u(e){var t=new Promise(function(t,n){c(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function d(){return new Promise(function(e){process.nextTick(function(){if(o.idle())e();else{var t=o.drain;o.drain=function(){typeof t==`function`&&t(),e(),o.drain=t}}})})}}t.exports=r,t.exports.promise=o})),F=t(O(),1);xe();var Se=`Stream-Next-Offset`,Ce=`Stream-Cursor`,we=`Stream-Up-To-Date`,Te=`Stream-Closed`,Ee=`offset`,De=`live`,Oe=`stream-sse-data-encoding`,ke=class e extends Error{status;text;json;headers;constructor(e,t,n,r,i,a){super(a||`HTTP Error ${e} at ${i}: ${t??JSON.stringify(n)}`),this.url=i,this.name=`FetchError`,this.status=e,this.text=t,this.json=n,this.headers=r}static async fromResponse(t,n){let r=t.status,i=Object.fromEntries([...t.headers.entries()]),a,o,s=t.headers.get(`content-type`);if(!t.bodyUsed&&t.body!==null)if(s&&s.includes(`application/json`))try{o=await t.json()}catch{a=await t.text()}else a=await t.text();return new e(r,a,o,i,n)}},Ae=class extends Error{constructor(){super(`Fetch with backoff aborted`),this.name=`FetchBackoffAbortError`}},je=class e extends Error{status;code;details;constructor(e,t,n,r){super(e),this.name=`DurableStreamError`,this.code=t,this.status=n,this.details=r}static async fromResponse(t,n){let r=t.status,i,a=t.headers.get(`content-type`);if(!t.bodyUsed&&t.body!==null)if(a&&a.includes(`application/json`))try{i=await t.json()}catch{i=await t.text()}else i=await t.text();let o=Me(r),s=`Durable stream error at ${n}: ${t.statusText||r}`;return new e(s,o,r,i)}static fromFetchError(t){let n=Me(t.status);return new e(t.message,n,t.status,t.json??t.text)}};function Me(e){switch(e){case 400:return`BAD_REQUEST`;case 401:return`UNAUTHORIZED`;case 403:return`FORBIDDEN`;case 404:return`NOT_FOUND`;case 409:return`CONFLICT_SEQ`;case 429:return`RATE_LIMITED`;case 503:return`BUSY`;default:return`UNKNOWN`}}var Ne=class extends je{code=`STREAM_CLOSED`;status=409;streamClosed=!0;finalOffset;constructor(e,t){super(`Cannot append to closed stream`,`STREAM_CLOSED`,409,e),this.name=`StreamClosedError`,this.finalOffset=t}},Pe=[429,503],Fe={initialDelay:100,maxDelay:6e4,multiplier:1.3,maxRetries:1/0};function Ie(e){if(!e)return 0;let t=Number(e);if(Number.isFinite(t)&&t>0)return t*1e3;let n=Date.parse(e);if(!isNaN(n)){let e=n-Date.now();return Math.max(0,Math.min(e,36e5))}return 0}function Le(e,t=Fe){let{initialDelay:n,maxDelay:r,multiplier:i,debug:a=!1,onFailedAttempt:o,maxRetries:s=1/0}=t;return async(...t)=>{let c=t[0],l=t[1],u=n,d=0;for(;;)try{let n=await e(...t);if(n.ok)return n;throw await ke.fromResponse(n,c.toString())}catch(e){if(o?.(),l?.signal?.aborted)throw new Ae;if(e instanceof ke&&!Pe.includes(e.status)&&e.status>=400&&e.status<500)throw e;{if(d++,d>s)throw a&&console.log(`Max retries reached (${d}/${s}), giving up`),e;let t=e instanceof ke?Ie(e.headers[`retry-after`]):0,n=Math.random()*u,o=Math.min(n,r),c=Math.max(t,o);a&&console.log(`Retry attempt #${d} after ${c}ms (${t>0?`server+client`:`client`}, serverMin=${t}ms, clientBackoff=${o}ms)`),await new Promise(e=>setTimeout(e,c)),u=Math.min(u*i,r)}}}}function Re(e){return typeof Symbol<`u`&&typeof Symbol.asyncIterator==`symbol`&&typeof e[Symbol.asyncIterator]==`function`}function ze(e){if(typeof Symbol>`u`||typeof Symbol.asyncIterator!=`symbol`||typeof e[Symbol.asyncIterator]==`function`)return;let t=function(){let e=this.getReader(),t=!1,n=0;return{async next(){if(t)return{done:!0,value:void 0};n++;try{let{value:n,done:r}=await e.read();return r?(t=!0,e.releaseLock(),{done:!0,value:void 0}):{done:!1,value:n}}catch(n){t=!0;try{e.releaseLock()}catch{}throw n}finally{n--}},async return(r){if(n>0)throw TypeError(`Cannot close a readable stream reader when it has pending read requests`);t=!0;let i=e.cancel(r);return e.releaseLock(),await i,{done:!0,value:void 0}},async throw(r){if(n>0)throw TypeError(`Cannot close a readable stream reader when it has pending read requests`);t=!0;let i=e.cancel(r);throw e.releaseLock(),await i,r},[Symbol.asyncIterator](){return this}}};try{Object.defineProperty(e,Symbol.asyncIterator,{configurable:!0,writable:!0,value:t})}catch{return}try{Object.defineProperty(e,"values",{configurable:!0,writable:!0,value:t})}catch{}}function Be(e){return Re(e)||ze(e),e}async function*Ve(e,t){let n=e.getReader(),r=new TextDecoder,i=``,a={data:[]};try{for(;!t?.aborted;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,{stream:!0}),i=i.replace(/\r\n/g,`
3
+ `).replace(/\r/g,`
4
+ `);let o=i.split(`
5
+ `);i=o.pop()??``;for(let e of o)if(e===``){if(a.type&&a.data.length>0){let e=a.data.join(`
6
+ `);if(a.type===`data`)yield{type:`data`,data:e};else if(a.type===`control`)try{let t=JSON.parse(e);yield{type:`control`,streamNextOffset:t.streamNextOffset,streamCursor:t.streamCursor,upToDate:t.upToDate,streamClosed:t.streamClosed}}catch(t){let n=e.length>100?e.slice(0,100)+`...`:e;throw new je(`Failed to parse SSE control event: ${t instanceof Error?t.message:String(t)}. Data: ${n}`,`PARSE_ERROR`)}}a={data:[]}}else if(e.startsWith(`event:`)){let t=e.slice(6);a.type=t.startsWith(` `)?t.slice(1):t}else if(e.startsWith(`data:`)){let t=e.slice(5);a.data.push(t.startsWith(` `)?t.slice(1):t)}}let e=r.decode();if(e&&(i+=e),i&&a.type&&a.data.length>0){let e=a.data.join(`
7
+ `);if(a.type===`data`)yield{type:`data`,data:e};else if(a.type===`control`)try{let t=JSON.parse(e);yield{type:`control`,streamNextOffset:t.streamNextOffset,streamCursor:t.streamCursor,upToDate:t.upToDate,streamClosed:t.streamClosed}}catch(t){let n=e.length>100?e.slice(0,100)+`...`:e;throw new je(`Failed to parse SSE control event: ${t instanceof Error?t.message:String(t)}. Data: ${n}`,`PARSE_ERROR`)}}}finally{n.releaseLock()}}var He=class{shouldContinueLive(e,t){return!(e&&this.upToDate||t===!1||this.streamClosed)}},Ue=class e extends He{offset;cursor;upToDate;streamClosed;constructor(e){super(),this.offset=e.offset,this.cursor=e.cursor,this.upToDate=e.upToDate,this.streamClosed=e.streamClosed}shouldUseSse(){return!1}withResponseMetadata(t){return new e({offset:t.offset??this.offset,cursor:t.cursor??this.cursor,upToDate:t.upToDate,streamClosed:this.streamClosed||t.streamClosed})}withSSEControl(t){let n=this.streamClosed||(t.streamClosed??!1);return new e({offset:t.streamNextOffset,cursor:t.streamCursor||this.cursor,upToDate:t.streamClosed??!1?!0:t.upToDate??this.upToDate,streamClosed:n})}pause(){return new Ge(this)}},We=class e extends He{offset;cursor;upToDate;streamClosed;consecutiveShortConnections;connectionStartTime;constructor(e){super(),this.offset=e.offset,this.cursor=e.cursor,this.upToDate=e.upToDate,this.streamClosed=e.streamClosed,this.consecutiveShortConnections=e.consecutiveShortConnections??0,this.connectionStartTime=e.connectionStartTime}shouldUseSse(){return!0}withResponseMetadata(t){return new e({offset:t.offset??this.offset,cursor:t.cursor??this.cursor,upToDate:t.upToDate,streamClosed:this.streamClosed||t.streamClosed,consecutiveShortConnections:this.consecutiveShortConnections,connectionStartTime:this.connectionStartTime})}withSSEControl(t){let n=this.streamClosed||(t.streamClosed??!1);return new e({offset:t.streamNextOffset,cursor:t.streamCursor||this.cursor,upToDate:t.streamClosed??!1?!0:t.upToDate??this.upToDate,streamClosed:n,consecutiveShortConnections:this.consecutiveShortConnections,connectionStartTime:this.connectionStartTime})}startConnection(t){return new e({offset:this.offset,cursor:this.cursor,upToDate:this.upToDate,streamClosed:this.streamClosed,consecutiveShortConnections:this.consecutiveShortConnections,connectionStartTime:t})}handleConnectionEnd(t,n,r){if(this.connectionStartTime===void 0)return{action:`healthy`,state:this};let i=t-this.connectionStartTime;if(i<r.minConnectionDuration&&!n){let t=this.consecutiveShortConnections+1;return t>=r.maxShortConnections?{action:`fallback`,state:new Ue({offset:this.offset,cursor:this.cursor,upToDate:this.upToDate,streamClosed:this.streamClosed})}:{action:`reconnect`,state:new e({offset:this.offset,cursor:this.cursor,upToDate:this.upToDate,streamClosed:this.streamClosed,consecutiveShortConnections:t,connectionStartTime:this.connectionStartTime}),backoffAttempt:t}}return i>=r.minConnectionDuration?{action:`healthy`,state:new e({offset:this.offset,cursor:this.cursor,upToDate:this.upToDate,streamClosed:this.streamClosed,consecutiveShortConnections:0,connectionStartTime:this.connectionStartTime})}:{action:`healthy`,state:this}}pause(){return new Ge(this)}},Ge=class e extends He{#e;constructor(e){super(),this.#e=e}get offset(){return this.#e.offset}get cursor(){return this.#e.cursor}get upToDate(){return this.#e.upToDate}get streamClosed(){return this.#e.streamClosed}shouldUseSse(){return this.#e.shouldUseSse()}withResponseMetadata(t){let n=this.#e.withResponseMetadata(t);return new e(n)}withSSEControl(t){let n=this.#e.withSSEControl(t);return new e(n)}pause(){return this}resume(){return{state:this.#e,justResumed:!0}}},Ke=`PAUSE_STREAM`,qe=class{url;contentType;live;startOffset;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=!1;#m=null;#h=`active`;#g;#_;#v;#y;#b;#x;#S;constructor(e){this.url=e.url,this.contentType=e.contentType,this.live=e.live,this.startOffset=e.startOffset;let t={offset:e.initialOffset,cursor:e.initialCursor,upToDate:e.initialUpToDate,streamClosed:e.initialStreamClosed};this.#a=e.startSSE?new We(t):new Ue(t),this.#e=e.firstResponse.headers,this.#t=e.firstResponse.status,this.#n=e.firstResponse.statusText,this.#r=e.firstResponse.ok,this.#i=!1,this.#o=e.isJsonMode,this.#s=e.abortController,this.#c=e.fetchNext,this.#l=e.startSSE,this.#b={minConnectionDuration:e.sseResilience?.minConnectionDuration??1e3,maxShortConnections:e.sseResilience?.maxShortConnections??3,backoffBaseDelay:e.sseResilience?.backoffBaseDelay??100,backoffMaxDelay:e.sseResilience?.backoffMaxDelay??5e3,logWarnings:e.sseResilience?.logWarnings??!0},this.#x=e.encoding,this.#f=new Promise((e,t)=>{this.#u=e,this.#d=t}),this.#S=this.#R(e.firstResponse),this.#s.signal.addEventListener(`abort`,()=>{this.#g?.abort(this.#s.signal.reason),this.#y?.(),this.#v=void 0,this.#y=void 0},{once:!0}),this.#C()}#C(){if(typeof document==`object`&&typeof document.hidden==`boolean`&&typeof document.addEventListener==`function`){let e=()=>{document.hidden?this.#w():this.#T()};document.addEventListener(`visibilitychange`,e),this.#_=()=>{typeof document==`object`&&document.removeEventListener(`visibilitychange`,e)},document.hidden&&this.#w()}}#w(){this.#h===`active`&&(this.#h=`pause-requested`,this.#a=this.#a.pause(),this.#v=new Promise(e=>{this.#y=e}),this.#g?.abort(Ke))}#T(){if(this.#h===`paused`||this.#h===`pause-requested`){if(this.#s.signal.aborted)return;this.#a instanceof Ge&&(this.#a=this.#a.resume().state),this.#h=`active`,this.#y?.(),this.#v=void 0,this.#y=void 0}}get headers(){return this.#e}get status(){return this.#t}get statusText(){return this.#n}get ok(){return this.#r}get isLoading(){return this.#i}get offset(){return this.#a.offset}get cursor(){return this.#a.cursor}get upToDate(){return this.#a.upToDate}get streamClosed(){return this.#a.streamClosed}#E(){if(!this.#o)throw new je(`JSON methods are only valid for JSON-mode streams. Content-Type is "${this.contentType}" and json hint was not set.`,`BAD_REQUEST`)}#D(){this.#_?.(),this.#u()}#O(e){this.#_?.(),this.#d(e)}#k(e){if(this.#m!==null)throw new je(`Cannot call ${e}() - this StreamResponse is already being consumed via ${this.#m}()`,`ALREADY_CONSUMED`);this.#m=e}#A(){return this.#a.shouldContinueLive(this.#p,this.live)}#j(e){this.#a=this.#a.withResponseMetadata({offset:e.headers.get(Se)||void 0,cursor:e.headers.get(Ce)||void 0,upToDate:e.headers.has(we),streamClosed:e.headers.get(Te)?.toLowerCase()===`true`}),this.#e=e.headers,this.#t=e.status,this.#n=e.statusText,this.#r=e.ok}#M(e){this.#a=this.#a.withSSEControl(e)}#N(e){this.#x=e.headers.get(Oe)===`base64`?`base64`:void 0}#P(){this.#a instanceof We||(this.#a=new We({offset:this.#a.offset,cursor:this.#a.cursor,upToDate:this.#a.upToDate,streamClosed:this.#a.streamClosed})),this.#a=this.#a.startConnection(Date.now())}async#F(){if(!this.#a.shouldUseSse()||!this.#A()||!this.#l)return null;let e=this.#a.handleConnectionEnd(Date.now(),this.#s.signal.aborted,this.#b);if(this.#a=e.state,e.action===`fallback`)return this.#b.logWarnings&&console.warn(`[Durable Streams] SSE connections are closing immediately (possibly due to proxy buffering or misconfiguration). Falling back to long polling. Your proxy must support streaming SSE responses (not buffer the complete response). Configuration: Nginx add 'X-Accel-Buffering: no', Caddy add 'flush_interval -1' to reverse_proxy.`),null;if(e.action===`reconnect`){let t=Math.min(this.#b.backoffMaxDelay,this.#b.backoffBaseDelay*2**e.backoffAttempt),n=Math.floor(Math.random()*t);await new Promise(e=>setTimeout(e,n))}this.#P(),this.#g=new AbortController;let t=await this.#l(this.offset,this.cursor,this.#g.signal);return this.#N(t),t.body?Ve(t.body,this.#g.signal):null}async#I(e){let{done:t,value:n}=await e.next();if(t){try{let e=await this.#F();if(e)return{type:`continue`,newIterator:e}}catch(e){return{type:`error`,error:e instanceof Error?e:Error(`SSE reconnection failed`)}}return{type:`closed`}}return n.type===`data`?this.#L(n.data,e):(this.#M(n),n.upToDate?{type:`response`,response:Xe(``,n.streamNextOffset,n.streamCursor,!0,n.streamClosed??!1,this.contentType,this.#x)}:{type:`continue`})}async#L(e,t){let n=[e];for(;;){let{done:e,value:r}=await t.next();if(e){let e=Ze(n,this.offset,this.cursor,this.upToDate,this.streamClosed,this.contentType,this.#x,this.#o);try{return{type:`response`,response:e,newIterator:await this.#F()??void 0}}catch(e){return{type:`error`,error:e instanceof Error?e:Error(`SSE reconnection failed`)}}}if(r.type===`control`)return this.#M(r),{type:`response`,response:Ze(n,r.streamNextOffset,r.streamCursor,r.upToDate??!1,r.streamClosed??!1,this.contentType,this.#x,this.#o)};n.push(r.data)}}#R(e){let t=!1,n=null;return new ReadableStream({pull:async r=>{try{if(!t)if(t=!0,(e.headers.get(`content-type`)?.includes(`text/event-stream`)??!1)&&e.body)this.#P(),this.#N(e),this.#g=new AbortController,n=Ve(e.body,this.#g.signal);else{if(r.enqueue(e),this.upToDate&&!this.#A()){this.#D(),r.close();return}return}if(!n&&this.upToDate&&this.#l&&this.#A()){if((this.#h===`pause-requested`||this.#h===`paused`)&&(this.#h=`paused`,this.#v&&await this.#v,this.#s.signal.aborted)){this.#D(),r.close();return}this.#P(),this.#g=new AbortController;let e=await this.#l(this.offset,this.cursor,this.#g.signal);this.#N(e),e.body&&(n=Ve(e.body,this.#g.signal))}if(n){if(this.#h===`pause-requested`||this.#h===`paused`){if(this.#h=`paused`,this.#v&&await this.#v,this.#s.signal.aborted){this.#D(),r.close();return}let e=await this.#F();if(e)n=e;else{this.#D(),r.close();return}}for(;;){let e=await this.#I(n);switch(e.type){case`response`:e.newIterator&&(n=e.newIterator),r.enqueue(e.response);return;case`closed`:this.#D(),r.close();return;case`error`:this.#O(e.error),r.error(e.error);return;case`continue`:e.newIterator&&(n=e.newIterator);continue}}}if(this.#A()){let e=!1;if(this.#h===`pause-requested`||this.#h===`paused`){if(this.#h=`paused`,this.#v&&await this.#v,this.#s.signal.aborted){this.#D(),r.close();return}e=!0}if(this.#s.signal.aborted){this.#D(),r.close();return}this.#g=new AbortController;let t=await this.#c(this.offset,this.cursor,this.#g.signal,this.upToDate,e);this.#j(t),r.enqueue(t);return}this.#D(),r.close()}catch(e){if(this.#g?.signal.aborted&&this.#g.signal.reason===Ke){this.#h===`pause-requested`&&(this.#h=`paused`);return}this.#s.signal.aborted?(this.#D(),r.close()):(this.#O(e instanceof Error?e:Error(String(e))),r.error(e))}},cancel:()=>{this.#s.abort(),this.#_?.(),this.#D()}})}#z(){return this.#S.getReader()}async body(){this.#k(`body`),this.#p=!0;let e=this.#z(),t=[];try{let n=await e.read();for(;!n.done;){let r=this.upToDate,i=await n.value.blob();if(i.size>0&&t.push(i),r)break;n=await e.read()}}finally{e.releaseLock()}if(this.#D(),t.length===0)return new Uint8Array;if(t.length===1)return new Uint8Array(await t[0].arrayBuffer());let n=new Blob(t);return new Uint8Array(await n.arrayBuffer())}async json(){this.#k(`json`),this.#E(),this.#p=!0;let e=this.#z(),t=[];try{let n=await e.read();for(;!n.done;){let r=this.upToDate,i=(await n.value.text()).trim()||`[]`,a;try{a=JSON.parse(i)}catch(e){let t=i.length>100?i.slice(0,100)+`...`:i;throw new je(`Failed to parse JSON response: ${e instanceof Error?e.message:String(e)}. Data: ${t}`,`PARSE_ERROR`)}if(Array.isArray(a)?t.push(...a):t.push(a),r)break;n=await e.read()}}finally{e.releaseLock()}return this.#D(),t}async text(){this.#k(`text`),this.#p=!0;let e=this.#z(),t=[];try{let n=await e.read();for(;!n.done;){let r=this.upToDate,i=await n.value.text();if(i&&t.push(i),r)break;n=await e.read()}}finally{e.releaseLock()}return this.#D(),t.join(``)}#B(){let{readable:e,writable:t}=new TransformStream,n=this.#z();return(async()=>{try{let e=await n.read();for(;!e.done;){let r=this.upToDate,i=e.value.body;if(i&&await i.pipeTo(t,{preventClose:!0,preventAbort:!0,preventCancel:!0}),r&&!this.#A())break;e=await n.read()}await t.close(),this.#D()}catch(e){if(this.#s.signal.aborted){try{await t.close()}catch{}this.#D()}else{try{await t.abort(e)}catch{}this.#O(e instanceof Error?e:Error(String(e)))}}finally{n.releaseLock()}})(),e}bodyStream(){return this.#k(`bodyStream`),Be(this.#B())}jsonStream(){this.#k(`jsonStream`),this.#E();let e=this.#z(),t=[];return Be(new ReadableStream({pull:async n=>{if(t.length>0){n.enqueue(t.shift());return}let r=await e.read();for(;!r.done;){let i=(await r.value.text()).trim()||`[]`,a;try{a=JSON.parse(i)}catch(e){let t=i.length>100?i.slice(0,100)+`...`:i;throw new je(`Failed to parse JSON response: ${e instanceof Error?e.message:String(e)}. Data: ${t}`,`PARSE_ERROR`)}if(t=Array.isArray(a)?a:[a],t.length>0){n.enqueue(t.shift());return}r=await e.read()}this.#D(),n.close()},cancel:()=>{e.releaseLock(),this.cancel()}}))}textStream(){this.#k(`textStream`);let e=new TextDecoder;return Be(this.#B().pipeThrough(new TransformStream({transform(t,n){n.enqueue(e.decode(t,{stream:!0}))},flush(t){let n=e.decode();n&&t.enqueue(n)}})))}subscribeJson(e){this.#k(`subscribeJson`),this.#E();let t=new AbortController,n=this.#z();return(async()=>{try{let r=await n.read();for(;!r.done&&!t.signal.aborted;){let t=r.value,{offset:i,cursor:a,upToDate:o,streamClosed:s}=Je(t,this.offset,this.cursor,this.streamClosed),c=(await t.text()).trim()||`[]`,l;try{l=JSON.parse(c)}catch(e){let t=c.length>100?c.slice(0,100)+`...`:c;throw new je(`Failed to parse JSON response: ${e instanceof Error?e.message:String(e)}. Data: ${t}`,`PARSE_ERROR`)}await e({items:Array.isArray(l)?l:[l],offset:i,cursor:a,upToDate:o,streamClosed:s}),r=await n.read()}this.#D()}catch(e){let n=t.signal.aborted,r=e instanceof TypeError&&String(e).includes(`Body`);!n&&!r?this.#O(e instanceof Error?e:Error(String(e))):this.#D()}finally{n.releaseLock()}})(),()=>{t.abort(),this.cancel()}}subscribeBytes(e){this.#k(`subscribeBytes`);let t=new AbortController,n=this.#z();return(async()=>{try{let r=await n.read();for(;!r.done&&!t.signal.aborted;){let t=r.value,{offset:i,cursor:a,upToDate:o,streamClosed:s}=Je(t,this.offset,this.cursor,this.streamClosed),c=await t.arrayBuffer();await e({data:new Uint8Array(c),offset:i,cursor:a,upToDate:o,streamClosed:s}),r=await n.read()}this.#D()}catch(e){let n=t.signal.aborted,r=e instanceof TypeError&&String(e).includes(`Body`);!n&&!r?this.#O(e instanceof Error?e:Error(String(e))):this.#D()}finally{n.releaseLock()}})(),()=>{t.abort(),this.cancel()}}subscribeText(e){this.#k(`subscribeText`);let t=new AbortController,n=this.#z();return(async()=>{try{let r=await n.read();for(;!r.done&&!t.signal.aborted;){let t=r.value,{offset:i,cursor:a,upToDate:o,streamClosed:s}=Je(t,this.offset,this.cursor,this.streamClosed);await e({text:await t.text(),offset:i,cursor:a,upToDate:o,streamClosed:s}),r=await n.read()}this.#D()}catch(e){let n=t.signal.aborted,r=e instanceof TypeError&&String(e).includes(`Body`);!n&&!r?this.#O(e instanceof Error?e:Error(String(e))):this.#D()}finally{n.releaseLock()}})(),()=>{t.abort(),this.cancel()}}cancel(e){this.#s.abort(e),this.#_?.(),this.#D()}get closed(){return this.#f}};function Je(e,t,n,r){let i=e.headers.get(Se),a=e.headers.get(Ce),o=e.headers.has(we),s=e.headers.get(Te)?.toLowerCase()===`true`;return{offset:i??t,cursor:a??n,upToDate:o,streamClosed:s||r}}function Ye(e){let t=e.replace(/[\n\r]/g,``);if(t.length===0)return new Uint8Array;if(t.length%4!=0)throw new je(`Invalid base64 data: length ${t.length} is not a multiple of 4`,`PARSE_ERROR`);try{if(typeof Buffer<`u`)return new Uint8Array(Buffer.from(t,`base64`));{let e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}}catch(e){throw new je(`Failed to decode base64 data: ${e instanceof Error?e.message:String(e)}`,`PARSE_ERROR`)}}function Xe(e,t,n,r,i,a,o){return Ze([e],t,n,r,i,a,o)}function Ze(e,t,n,r,i,a,o,s){let c={"content-type":a??`application/json`,[Se]:String(t)};n&&(c[Ce]=n),r&&(c[we]=`true`),i&&(c[Te]=`true`);let l;if(o===`base64`){let t=e.filter(e=>e.length>0).map(e=>Ye(e));if(t.length===0)l=new ArrayBuffer(0);else if(t.length===1){let e=t[0];l=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}else{let e=t.reduce((e,t)=>e+t.length,0),n=new Uint8Array(e),r=0;for(let e of t)n.set(e,r),r+=e.length;l=n.buffer}}else if(s){let t=[];for(let n of e){let e=n.trim();if(e.length!==0)if(e.startsWith(`[`)&&e.endsWith(`]`)){let n=e.slice(1,-1).trim();n.length>0&&t.push(n)}else t.push(e)}l=`[${t.join(`,`)}]`}else l=e.join(``);return new Response(l,{status:200,headers:c})}async function Qe(e){let t={};if(!e)return t;for(let[n,r]of Object.entries(e))typeof r==`function`?t[n]=await r():t[n]=r;return t}async function $e(e,t,n){let r=e.status;throw r===404?new je(`Stream not found: ${t}`,`NOT_FOUND`,404):r===409?e.headers.get(Te)?.toLowerCase()===`true`?new Ne(t,e.headers.get(Se)??void 0):new je(n?.operation===`create`?`Stream already exists: ${t}`:`Sequence conflict: seq is lower than last appended`,n?.operation===`create`?`CONFLICT_EXISTS`:`CONFLICT_SEQ`,409):r===400?new je(`Bad request (possibly content-type mismatch)`,`BAD_REQUEST`,400):await je.fromResponse(e,t)}async function et(e){let t={};if(!e)return t;for(let[n,r]of Object.entries(e))r!==void 0&&(typeof r==`function`?t[n]=await r():t[n]=r);return t}var tt=new Set;function nt(){if(!(typeof process>`u`))return`production`}function rt(){return globalThis.window!==void 0}function it(){if(globalThis.window!==void 0&&globalThis.window.location!==void 0)return globalThis.window.location.href}function at(e){try{return new URL(e)}catch{let t=it();if(t)try{return new URL(e,t)}catch{return}return}}function ot(e,t){if(t===!1||nt()===`test`||!rt()||typeof console>`u`||typeof console.warn!=`function`)return;let n=at(e instanceof URL?e.toString():e);n&&n.protocol===`http:`&&(tt.has(n.origin)||(tt.add(n.origin),console.warn(`[DurableStream] Using HTTP (not HTTPS) typically limits browsers to ~6 concurrent connections per origin under HTTP/1.1. This can cause slow streams and app freezes with multiple active streams. Use HTTPS for HTTP/2 support. See https://electric-sql.com/r/electric-http2 for more information.`)))}async function st(e){if(!e.url)throw new je(`Invalid stream options: missing required url parameter`,`BAD_REQUEST`);let t=e.headers,n=e.params;for(;;)try{return await ct({...e,headers:t,params:n})}catch(r){if(e.onError){let i=await e.onError(r instanceof Error?r:Error(String(r)));if(i===void 0)throw r;i.params&&(n={...n,...i.params}),i.headers&&(t={...t,...i.headers});continue}throw r}}async function ct(e){let t=e.url instanceof URL?e.url.toString():e.url;ot(t,e.warnOnHttp);let n=new URL(t),r=e.offset??`-1`;n.searchParams.set(Ee,r);let i=e.live??!0,a=await et(e.params);for(let[e,t]of Object.entries(a))n.searchParams.set(e,t);let o=await Qe(e.headers),s=new AbortController;e.signal&&e.signal.addEventListener(`abort`,()=>s.abort(e.signal?.reason),{once:!0});let c=Le(e.fetch??((...e)=>fetch(...e)),e.backoffOptions??Fe),l;try{l=await c(n.toString(),{method:`GET`,headers:o,signal:s.signal})}catch(e){throw e instanceof Ae?new je(`Stream request was aborted`,`UNKNOWN`):e}let u=l.headers.get(`content-type`)??void 0,d=l.headers.get(Se)??r,f=l.headers.get(Ce)??void 0,p=l.headers.has(we),m=l.headers.get(Te)?.toLowerCase()===`true`,h=e.json===!0||(u?.includes(`application/json`)??!1),g=l.headers.get(Oe)===`base64`?`base64`:void 0;return new qe({url:t,contentType:u,live:i,startOffset:r,isJsonMode:h,initialOffset:d,initialCursor:f,initialUpToDate:p,initialStreamClosed:m,firstResponse:l,abortController:s,fetchNext:async(n,r,a,o,s)=>{let l=new URL(t);l.searchParams.set(Ee,n),o&&!s&&(i===!0||i===`long-poll`)&&l.searchParams.set(De,`long-poll`),r&&l.searchParams.set(`cursor`,r);let u=await et(e.params);for(let[e,t]of Object.entries(u))l.searchParams.set(e,t);let d=await Qe(e.headers),f=await c(l.toString(),{method:`GET`,headers:d,signal:a});return f.ok||await $e(f,t),f},startSSE:i===`sse`?async(n,r,i)=>{let a=new URL(t);a.searchParams.set(Ee,n),a.searchParams.set(De,`sse`),r&&a.searchParams.set(`cursor`,r);let o=await et(e.params);for(let[e,t]of Object.entries(o))a.searchParams.set(e,t);let s=await Qe(e.headers),l=await c(a.toString(),{method:`GET`,headers:s,signal:i});return l.ok||await $e(l,t),l}:void 0,sseResilience:e.sseResilience,encoding:g})}var lt=class extends Error{status;body;constructor(e,t){super(mt(e,t)),this.name=`FlueApiError`,this.status=e,this.body=t}},ut=class{baseUrl;fetchImpl;headers;token;constructor(e){this.baseUrl=dt(e.baseUrl).replace(/\/+$/,``),this.fetchImpl=e.fetch??fetch.bind(globalThis),this.headers=e.headers,this.token=e.token}async json(e){return ft(await this.fetchImpl(this.url(e.path,e.query),{method:e.method??`GET`,headers:await this.requestHeaders(e.headers,e.body!==void 0),body:e.body===void 0?void 0:JSON.stringify(e.body),signal:e.signal}))}url(e,t){let n=new URL(e.replace(/^\/+/,``),`${this.baseUrl}/`);for(let[e,r]of Object.entries(t??{}))r!==void 0&&n.searchParams.set(e,String(r));return n.toString()}async resolveHeaders(){let e=typeof this.headers==`function`?await this.headers():this.headers??{};return{...this.token?{authorization:`Bearer ${this.token}`}:{},...e}}async fetchWithHeaders(e,t){let n={...await this.resolveHeaders(),...t?.headers};return this.fetchImpl(e,{...t,headers:n})}async requestHeaders(e,t){let n=await this.resolveHeaders();return{...t?{"content-type":`application/json`}:{},...n,...e}}};function dt(e){try{return new URL(e).toString()}catch{let t=globalThis.location?.origin;if(!t)throw TypeError(`relative baseUrl requires a browser; pass an absolute URL`);return new URL(e,t).toString()}}async function ft(e){let t=await e.text(),n=t?pt(t):void 0;if(!e.ok)throw new lt(e.status,t&&n);return n}function pt(e){try{return JSON.parse(e)}catch{return e}}function mt(e,t){if(typeof t==`object`&&t&&`error`in t){let n=t.error;return`Flue API error ${e}${n?.type?` [${n.type}]`:``}: ${n?.message??`request failed`}`}return`Flue API error ${e}: request failed`}var ht=class extends Error{recover;constructor(e){super(e),this.name=`ConversationStreamError`,this.recover=`rehydrate`}},gt=new Set([`conversation-reset`,`message-appended`,`message-started`,`message-delta`,`tool-input`,`tool-output`,`tool-output-error`,`message-completed`,`submission-settled`]);function _t(e){if(!e||typeof e!=`object`||typeof e.type!=`string`||!gt.has(e.type)||typeof e.conversationId!=`string`)throw new ht(`Unsupported agent conversation chunk: ${JSON.stringify(e)}.`);let t=e.position;if(!t||!Number.isFinite(t.batch)||!Number.isFinite(t.index))throw new ht(`Agent conversation chunk is missing a valid position: ${JSON.stringify(e)}.`);return e}function vt(e){return{conversationId:e.conversationId,messages:e.messages,settlements:e.settlements}}function yt(e,t){switch(t.type){case`conversation-reset`:return vt(t.snapshot);case`message-appended`:return bt(e,e=>xt(e,t.message));case`message-started`:return bt(e,e=>e.some(e=>e.id===t.messageId)?e:[...e,{id:t.messageId,role:`assistant`,...t.submissionId?{submissionId:t.submissionId}:{},parts:[],...t.timestamp||t.model?{metadata:{...t.timestamp?{timestamp:t.timestamp}:{},...t.model?{model:t.model}:{}}}:{}}]);case`message-delta`:return St(e,t);case`tool-input`:return Ct(e,t);case`tool-output`:return wt(e,t.toolCallId,e=>({...e,state:`output-available`,output:t.output,errorText:void 0}));case`tool-output-error`:return wt(e,t.toolCallId,e=>({...e,state:`output-error`,output:void 0,errorText:t.errorText}));case`message-completed`:return Tt(e,t.messageId,t.usage);case`submission-settled`:return Et(e,t);default:throw new ht(`Unsupported conversation chunk type "${String(t.type)}".`)}}function bt(e,t){let n=t(e.messages);return n===e.messages?e:{...e,messages:n}}function xt(e,t){let n=e.findIndex(e=>e.id===t.id);if(n<0)return[...e,t];let r=[...e];return r[n]=t,r}function St(e,t){return bt(e,e=>{let n=e.findIndex(e=>e.id===t.messageId);if(n<0)return e;let r=e[n],i=r.parts[r.parts.length-1],a=[...r.parts];i&&i.type===t.kind&&i.state===`streaming`?a[a.length-1]={...i,text:i.text+t.delta}:(i&&(i.type===`text`||i.type===`reasoning`)&&i.state===`streaming`&&(a[a.length-1]={...i,state:`done`}),a.push({type:t.kind,text:t.delta,state:`streaming`}));let o=[...e];return o[n]={...r,parts:a},o})}function Ct(e,t){return bt(e,e=>{let n=e.findIndex(e=>e.id===t.messageId);if(n<0)return e;let r=e[n];if(r.parts.some(e=>e.type===`dynamic-tool`&&e.toolCallId===t.toolCallId))return e;let i=r.parts.map((e,t)=>t===r.parts.length-1&&(e.type===`text`||e.type===`reasoning`)&&e.state===`streaming`?{...e,state:`done`}:e),a=[...e];return a[n]={...r,parts:[...i,{type:`dynamic-tool`,toolName:t.toolName,toolCallId:t.toolCallId,state:`input-available`,input:t.input}]},a})}function wt(e,t,n){return bt(e,e=>{let r=e.findLastIndex(e=>e.parts.some(e=>e.type===`dynamic-tool`&&e.toolCallId===t));if(r<0)return e;let i=e[r],a=[...e];return a[r]={...i,parts:i.parts.map(e=>e.type===`dynamic-tool`&&e.toolCallId===t?n(e):e)},a})}function Tt(e,t,n){return bt(e,e=>{let r=e.findIndex(e=>e.id===t);if(r<0)return e;let i=e[r],a=[...e];return a[r]={...i,parts:i.parts.map(e=>e.type===`text`||e.type===`reasoning`?{...e,state:`done`}:e),...n?{metadata:{...i.metadata,usage:n}}:{}},a})}function Et(e,t){let n={submissionId:t.submissionId,outcome:t.outcome,...t.result===void 0?{}:{result:t.result},...t.error===void 0?{}:{error:t.error}},r=e.settlements,i=r.findIndex(e=>e.submissionId===n.submissionId),a=i<0?[...r,n]:r.map((e,t)=>t===i?n:e);return{...e,settlements:a}}function Dt(e,t={}){let n=new Set,r,i={conversation:void 0,offset:void 0,phase:`loading`,error:void 0},a=!1,o=!1,s=0,c,l,u,d,f=0,p,m=e=>{i=e;for(let e of n)e()},h=e=>!o&&e===s,g=()=>{l?.(),l=void 0,c?.abort(),c=void 0,u?.cancel(),u=void 0,d&&clearTimeout(d),d=void 0},_=(e,t)=>{if(!h(e))return;if(c?.signal.aborted){m({...i,phase:`closed`,error:void 0});return}if(At(t)){m({...i,phase:`error`,error:t});return}m({...i,phase:`connecting`,error:t});let n=Math.min(1e3*2**f++,3e4);d=setTimeout(()=>{d=void 0,h(e)&&y(e)},n)},v=async(n,a)=>{if(!h(n))return;m({...i,phase:`live`,error:void 0});let o;try{o=e.updates({offset:a,live:t.live,signal:c?.signal,backoffOptions:t.backoffOptions})}catch(e){_(n,jt(e));return}u=o;try{for await(let e of o){if(!h(n)||u!==o)return;if(!r)throw Error(`Agent conversation updates require materialized state.`);p!==void 0&&Mt(e.position,p)<=0||(r=yt(r,e),p=e.position,m({conversation:r,offset:o.offset,phase:`live`,error:void 0}),f=0)}if(!h(n)||u!==o)return;u=void 0,_(n,Error(`Agent conversation stream ended unexpectedly.`))}catch(e){if(!h(n)||u!==o)return;u=void 0,_(n,jt(e))}},y=async t=>{if(h(t)){m({...i,phase:r?`connecting`:`loading`,error:void 0});try{let n=await e.history({signal:c?.signal});if(!h(t))return;r=vt(n),p=void 0,f=0,m({conversation:r,offset:n.offset,phase:`connecting`,error:void 0}),await v(t,n.offset)}catch(e){if(!h(t))return;let n=jt(e);if(kt(e)===404){r=void 0,f=0,m({conversation:void 0,offset:void 0,phase:`absent`,error:void 0});return}_(t,n)}}},b=()=>{s++,c=new AbortController,l=Ot(t.signal,c,()=>{o||(o=!0,s++,g(),m({...i,phase:`closed`,error:void 0}))}),f=0;let e=s;queueMicrotask(()=>void y(e))};return{getSnapshot:()=>i,subscribe(e){return n.add(e),!a&&!o&&(a=!0,b()),()=>n.delete(e)},refresh(){o||(g(),a=!0,b())},close(e){o||(o=!0,s++,g(),m({...i,phase:`closed`,error:e===void 0?void 0:jt(e)}),n.clear())}}}function Ot(e,t,n){if(e)if(e.aborted)t.abort(e.reason),n();else{let r=()=>{t.abort(e.reason),n()};return e.addEventListener(`abort`,r,{once:!0}),()=>e.removeEventListener(`abort`,r)}}function kt(e){return e&&typeof e==`object`&&`status`in e&&typeof e.status==`number`?e.status:void 0}function At(e){let t=kt(e);return t===400||t===401||t===403}function jt(e){return e instanceof Error?e:Error(String(e))}function Mt(e,t){return e.batch===t.batch?e.index-t.index:e.batch-t.batch}async function Nt(e,t,n,r){let i=`/agents/${encodeURIComponent(t)}/${encodeURIComponent(n)}?wait=result`;return e.json({method:`POST`,path:i,body:{message:r.message,...r.images?{images:r.images}:{}},signal:r.signal})}async function Pt(e,t,n,r){return e.json({method:`POST`,path:`/agents/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,body:{message:r.message,...r.images?{images:r.images}:{}},signal:r.signal})}var Ft=class extends Error{received;supported=3;constructor(e){super(`Flue event version ${String(e)} is unsupported. Clear historical event data created by an earlier Flue beta.`),this.name=`UnsupportedFlueEventVersionError`,this.received=e}};function It(e,t,n=Lt){let r=new AbortController,i;if(e.signal){let t=e.signal;if(t.aborted)r.abort(t.reason);else{let e=()=>r.abort(t.reason);t.addEventListener(`abort`,e,{once:!0}),i=()=>t.removeEventListener(`abort`,e)}}let a=t.fetch??globalThis.fetch,o=new URL(t.url);e.tail!==void 0&&o.searchParams.set(`tail`,String(e.tail));let s=e.offset??`-1`,c,l=()=>c||(r.signal.aborted?Promise.reject(r.signal.reason??new DOMException(`Aborted`,`AbortError`)):(c=st({url:o.toString(),offset:s,live:e.live??!0,json:!0,signal:r.signal,fetch:a,backoffOptions:e.backoffOptions,warnOnHttp:!1}),c)),u=!1,d,f,p,m=!1,h=!1,g,_,v,y=e.offset??`-1`,b=()=>{let e=p;p=void 0,e?.()},x=()=>{let e=f;f=void 0,e?.()},S=e=>{r.abort(e),i?.(),x(),b()},C=t=>{t.subscribeJson(t=>{if(r.signal.aborted)return;let n=t.streamClosed||e.live===!1?{upToDate:t.upToDate}:void 0;if(t.items.length===0){y=t.offset,n&&(g={...n,offset:t.offset},m=!0),b();return}return new Promise(e=>{d={items:t.items,next:0,offset:t.offset,final:n},f=e,b()})}),t.closed.then(()=>{h=!0,b()},e=>{_={error:e},m=!0,b()})},w=async()=>{for(;;){if(v!==void 0)throw v;if(r.signal.aborted)return i?.(),{value:void 0,done:!0};if(!u){u=!0;try{C(await l())}catch(e){if(u=!1,i?.(),r.signal.aborted||Rt(e))return{value:void 0,done:!0};throw e}}if(d){let e;try{e=n(d.items[d.next])}catch(e){throw v=e,m=!0,d=void 0,x(),S(e),e}return d.next++,d.next>=d.items.length&&(y=d.offset,d.final&&(g={...d.final,offset:d.offset},m=!0),d=void 0,x()),{value:e,done:!1}}if(m){if(_){let{error:e}=_;if(_=void 0,i?.(),r.signal.aborted||Rt(e))return{value:void 0,done:!0};throw e}if(e.live===!1&&g&&!g.upToDate&&g.offset!==s){s=g.offset,c=void 0,u=!1,m=!1,h=!1,g=void 0;continue}return i?.(),{value:void 0,done:!0}}if(h&&e.live===`sse`){if(await new Promise(e=>setTimeout(e,0)),d||m||r.signal.aborted)continue;return i?.(),{value:void 0,done:!0}}await new Promise(e=>{p=e})}},T,E={next(){let e=T?T.then(w,w):w();return T=e.catch(()=>{}),e},async return(){return S(),{value:void 0,done:!0}}};return{cancel:S,get offset(){return y},[Symbol.asyncIterator](){return E}}}function Lt(e){let t=e&&typeof e==`object`?e.v:void 0;if(t!==3)throw new Ft(t);return e}function Rt(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`}var zt=class extends Error{target;targetId;failure;error;constructor(e){super(Ut(e)),this.name=`FlueExecutionError`,this.target=e.target,this.targetId=e.targetId,this.failure=e.failure,this.error=e.error}};async function Bt(e,t,n={}){let r=new URL(t.streamUrl);r.searchParams.set(`view`,`updates`);let i=It({offset:t.offset,signal:n.signal,backoffOptions:n.backoffOptions},{url:r.toString(),fetch:e.fetchWithHeaders.bind(e)},_t);for await(let e of i)if(await n.onEvent?.(e),Ht(n.signal),e.type===`submission-settled`&&e.submissionId===t.submissionId){if(e.outcome===`completed`)return e.result;throw new zt({target:`agent_submission`,targetId:t.submissionId,failure:`failed`,error:e.error})}throw Ht(n.signal),new zt({target:`agent_submission`,targetId:t.submissionId,failure:`terminal_event_missing`})}async function Vt(e,t,n={}){let r=await e.json({method:`POST`,path:`/workflows/${encodeURIComponent(t)}`,body:n.input,signal:n.signal}),i=It({signal:n.signal,backoffOptions:n.backoffOptions},{url:e.url(`/runs/${encodeURIComponent(r.runId)}`),fetch:e.fetchWithHeaders.bind(e)});for await(let e of i)if(await n.onEvent?.(e),Ht(n.signal),!(e.type!==`run_end`||e.runId!==r.runId)){if(!e.isError)return{runId:r.runId,result:e.result};throw new zt({target:`workflow_run`,targetId:r.runId,failure:`failed`,error:e.error})}Ht(n.signal);let a=await e.json({path:`/runs/${encodeURIComponent(r.runId)}?meta`,signal:n.signal});if(a.status===`completed`)return{runId:r.runId,result:a.result};throw a.status===`errored`?new zt({target:`workflow_run`,targetId:r.runId,failure:`failed`,error:a.error}):new zt({target:`workflow_run`,targetId:r.runId,failure:`terminal_event_missing`})}function Ht(e){if(e?.aborted)throw e.reason??new DOMException(`Aborted`,`AbortError`)}function Ut(e){let t=e.target===`agent_submission`?`Agent submission`:`Workflow run`;if(e.failure===`terminal_event_missing`)return`${t} ${e.targetId} ended without a terminal event`;let n=Wt(e.error);return`${t} ${e.targetId} failed${n?`: ${n}`:``}`}function Wt(e){if(typeof e==`string`)return e;if(!(typeof e!=`object`||!e||!(`message`in e)))return typeof e.message==`string`?e.message:void 0}function Gt(e,t,n,r){let i=!1,a=e.parts.map(e=>e.type===`file`&&e.id!==void 0&&e.url===void 0?(i=!0,{...e,url:t.url(`/agents/${encodeURIComponent(n)}/${encodeURIComponent(r)}/attachments/${encodeURIComponent(e.id)}`)}):e);return i?{...e,parts:a}:e}function Kt(e,t,n,r){return{...e,messages:e.messages.map(e=>Gt(e,t,n,r))}}function qt(e,t,n,r){return e.type===`conversation-reset`?{...e,snapshot:Kt(e.snapshot,t,n,r)}:e.type===`message-appended`?{...e,message:Gt(e.message,t,n,r)}:e}function Jt(e){let t=new ut(e);return{agents:{prompt:(e,n,r)=>Nt(t,e,n,r),send:(e,n,r)=>Pt(t,e,n,r),wait:(e,n)=>Bt(t,e,n),abort:(e,n,r={})=>t.json({method:`POST`,path:`/agents/${encodeURIComponent(e)}/${encodeURIComponent(n)}/abort`,signal:r.signal}),history:async(e,n,r={})=>Kt(await t.json({path:`/agents/${encodeURIComponent(e)}/${encodeURIComponent(n)}`,query:{view:`history`},signal:r.signal}),t,e,n),observe:(e,n,r={})=>Dt({history:async r=>Kt(await t.json({path:`/agents/${encodeURIComponent(e)}/${encodeURIComponent(n)}`,query:{view:`history`},signal:r.signal}),t,e,n),updates:r=>It(r,{url:t.url(`/agents/${encodeURIComponent(e)}/${encodeURIComponent(n)}`,{view:`updates`}),fetch:t.fetchWithHeaders.bind(t)},r=>qt(_t(r),t,e,n))},r),attachmentUrl:(e,n,r)=>t.url(`/agents/${encodeURIComponent(e)}/${encodeURIComponent(n)}/attachments/${encodeURIComponent(r)}`)},runs:{get:e=>t.json({path:`/runs/${encodeURIComponent(e)}?meta`}),stream:(e,n={})=>It(n,{url:t.url(`/runs/${encodeURIComponent(e)}`),fetch:t.fetchWithHeaders.bind(t)}),events:async(e,n)=>{let r=new URL(t.url(`/runs/${encodeURIComponent(e)}`));n?.tail!==void 0&&r.searchParams.set(`tail`,String(n.tail));let i=[],a=n?.offset??`-1`;for(;;){let e=await st({url:r.toString(),offset:a,live:!1,json:!0,signal:n?.signal,backoffOptions:n?.backoffOptions,fetch:t.fetchWithHeaders.bind(t),warnOnHttp:!1});if(i.push(...await Yt(e,n?.signal)),e.upToDate||e.offset===a)break;a=e.offset}return i}},workflows:{invoke:(e,n)=>t.json({method:`POST`,path:`/workflows/${encodeURIComponent(e)}`,query:n?.wait===`result`?{wait:`result`}:void 0,body:n?.input,signal:n?.signal}),run:(e,n)=>Vt(t,e,n)}}}async function Yt(e,t){let n=await e.json();if(t?.aborted)throw t.reason??new DOMException(`Aborted`,`AbortError`);return n}var Xt=(0,F.createContext)(void 0);function Zt({client:e,children:t}){return(0,F.createElement)(Xt.Provider,{value:e},t)}function Qt(){let e=(0,F.useContext)(Xt);if(!e)throw Error(`useFlueClient() requires a FlueProvider`);return e}function $t(e){let t=(0,F.useContext)(Xt),n=e??t;if(!n)throw Error(`Flue hooks require a client option or FlueProvider`);return n}var en={messages:[],status:`idle`,historyReady:!1,error:void 0,failedSends:[],conversation:void 0,pendingSends:[],failedOptimistic:[],localMessageIds:[],localSubmissionIds:[],activeSubmissionIds:[]};function tn(e,t){switch(t.type){case`local_send_submitted`:{let n=new Set(e.conversation?.settlements.map(e=>e.submissionId)??[]);return nn({...e,pendingSends:[...e.pendingSends,{localId:t.localId,optimistic:rn(t)}],localSubmissionIds:e.localSubmissionIds.filter(e=>!n.has(e)),failedSends:[],failedOptimistic:[],error:void 0})}case`local_send_admitted`:return nn({...e,pendingSends:e.pendingSends.map(e=>e.localId===t.localId?{...e,submissionId:t.submissionId}:e),localMessageIds:[...e.localMessageIds,{submissionId:t.submissionId,localId:t.localId}],localSubmissionIds:on(e.localSubmissionIds,t.submissionId),activeSubmissionIds:on(e.activeSubmissionIds,t.submissionId)});case`local_send_failed`:{let n=e.pendingSends.find(e=>e.localId===t.localId);return nn({...e,pendingSends:e.pendingSends.filter(e=>e.localId!==t.localId),...n?{failedOptimistic:[...e.failedOptimistic,n.optimistic],failedSends:[...e.failedSends,{id:n.localId,message:an(n.optimistic),error:t.error}]}:{}})}case`local_observation`:if(t.phase===`error`)return{...e,status:`error`,error:t.error};if(t.phase===`absent`)return nn({...e,conversation:void 0,historyReady:!0});if(t.conversation){let n=nn({...e,conversation:t.conversation,historyReady:!0});return t.phase===`loading`||t.phase===`connecting`?{...n,status:n.status===`idle`?`connecting`:n.status,error:t.error}:n}return{...e,status:t.phase===`loading`||t.phase===`connecting`?`connecting`:e.status,error:t.error}}}function nn(e){let t=e.conversation,n=new Set(t?.settlements.map(e=>e.submissionId)??[]),r=new Map(e.localMessageIds.map(e=>[e.submissionId,e.localId])),i=(t?.messages??[]).map(e=>{let t=e.role===`user`&&e.submissionId?r.get(e.submissionId):void 0;return t?{...e,id:t}:e}),a=new Set((t?.messages??[]).map(e=>e.submissionId).filter(e=>typeof e==`string`)),o=[],s=[];for(let t of e.pendingSends)t.submissionId&&(a.has(t.submissionId)||n.has(t.submissionId))||(o.push(t),s.push(t.optimistic));let c=[...i,...s,...e.failedOptimistic],l=(t?.messages??[]).some(e=>e.role===`assistant`&&e.parts.some(e=>(e.type===`text`||e.type===`reasoning`)&&e.state===`streaming`)),u=t?.settlements.find(t=>t.outcome===`failed`&&e.localSubmissionIds.includes(t.submissionId)),d=e.activeSubmissionIds.filter(e=>!n.has(e)),f=e.failedSends.length>0,p=u?`error`:l?`streaming`:o.length>0?`submitted`:d.length>0?`streaming`:f?`error`:`idle`;return{...e,messages:c,pendingSends:o,activeSubmissionIds:d,status:p,error:u?Error(sn(u.error)):p===`error`&&f?e.failedSends[e.failedSends.length-1]?.error:void 0}}function rn(e){return{id:e.localId,role:`user`,metadata:{timestamp:new Date().toISOString()},parts:[{type:`text`,text:e.message,state:`done`},...(e.images??[]).map(e=>({type:`file`,mediaType:e.mimeType,url:`data:${e.mimeType};base64,${e.data}`,...e.filename?{filename:e.filename}:{}}))]}}function an(e){let t=e.parts.find(e=>e.type===`text`);return t&&t.type===`text`?t.text:``}function on(e,t){return e.includes(t)?e:[...e,t]}function sn(e){return e&&typeof e==`object`&&`message`in e?String(e.message):`Agent submission failed`}var cn=class{client;name;id;live;state={...en};snapshot=ln(this.state);listeners=new Set;observation;unsubscribeObservation;active=!1;localId=0;constructor(e,t,n,r=`sse`){this.client=e,this.name=t,this.id=n,this.live=r}start(){this.active||(this.active=!0,this.observation=this.client.agents.observe(this.name,this.id,{live:this.live}),this.unsubscribeObservation=this.observation.subscribe(()=>this.applyObservation()),this.applyObservation())}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snapshot;async sendMessage(e,t={}){let n=`local:${this.name}:${this.id}:${++this.localId}`;this.dispatch({type:`local_send_submitted`,localId:n,message:e,images:t.images});try{let r=await this.client.agents.send(this.name,this.id,{message:e,images:t.images});this.dispatch({type:`local_send_admitted`,localId:n,submissionId:r.submissionId}),this.observation?.getSnapshot().phase===`absent`&&this.observation.refresh()}catch(e){let t=un(e);throw this.dispatch({type:`local_send_failed`,localId:n,error:t}),e}}dispose(){this.active&&(this.active=!1,this.unsubscribeObservation?.(),this.unsubscribeObservation=void 0,this.observation?.close(),this.observation=void 0)}applyObservation(){let e=this.observation?.getSnapshot();e&&this.dispatch({type:`local_observation`,conversation:e.conversation,phase:e.phase,error:e.error})}dispatch(e){let t=tn(this.state,e);t!==this.state&&(this.state=t,this.publish())}publish(){this.snapshot=ln(this.state);for(let e of this.listeners)e()}};function ln(e){return{messages:e.messages,status:e.status,historyReady:e.historyReady,error:e.error,failedSends:e.failedSends}}function un(e){return e instanceof Error?e:Error(String(e))}var dn={messages:en.messages,status:`idle`,historyReady:!1,error:void 0,failedSends:en.failedSends},fn=()=>()=>{};function pn(e){let t=$t(e.client),n=e.live??`sse`,r=(0,F.useMemo)(()=>e.id?new cn(t,e.name,e.id,n):void 0,[t,e.name,e.id,n]);return(0,F.useEffect)(()=>(r?.start(),()=>r?.dispose()),[r]),{...(0,F.useSyncExternalStore)(r?.subscribe??fn,r?.getSnapshot??(()=>dn),()=>dn),sendMessage:r?r.sendMessage.bind(r):async()=>{throw Error(`useFlueAgent() cannot send without an agent id`)}}}var mn=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=ee,D=function(){ne.postMessage(null)}}else D=function(){_(ee,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),hn=n(((e,t)=>{t.exports=mn()})),gn=n((e=>{var t=O();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),_n=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=gn()})),vn=n((e=>{var t=hn(),n=O(),r=_n();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),D=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=D&&e[D]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j={pending:!1,data:null,method:null,action:null},ae=[],M=-1;function oe(e){return{current:e}}function se(e){0>M||(e.current=ae[M],ae[M]=null,M--)}function N(e,t){M++,ae[M]=e.current,e.current=t}var ce=oe(null),le=oe(null),ue=oe(null),de=oe(null);function P(e,t){switch(N(ue,t),N(le,e),N(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}se(ce),N(ce,e)}function fe(){se(ce),se(le),se(ue)}function pe(e){e.memoizedState!==null&&N(de,e);var t=ce.current,n=Hd(t,e.type);t!==n&&(N(le,e),N(ce,n))}function me(e){le.current===e&&(se(ce),se(le)),de.current===e&&(se(de),Qf._currentValue=j)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
8
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
9
+ `+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
10
+ `),l=s.split(`
11
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
12
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
13
+ Error generating stack: `+e.message+`
14
+ `+e.stack}}var F=Object.prototype.hasOwnProperty,Se=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,we=t.unstable_shouldYield,Te=t.unstable_requestPaint,Ee=t.unstable_now,De=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,je=t.unstable_LowPriority,Me=t.unstable_IdlePriority,Ne=t.log,Pe=t.unstable_setDisableYieldValue,Fe=null,Ie=null;function Le(e){if(typeof Ne==`function`&&Pe(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Fe,e)}catch{}}var Re=Math.clz32?Math.clz32:Ve,ze=Math.log,Be=Math.LN2;function Ve(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var He=256,Ue=262144,We=4194304;function Ge(e){var t=e&42;if(t!==0)return t;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 Ke(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ge(n))):i=Ge(o):i=Ge(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ge(n))):i=Ge(o)):i=Ge(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Je(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Ye(){var e=We;return We<<=1,!(We&62914560)&&(We=4194304),e}function Xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Re(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&$e(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function $e(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(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 rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=A.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function at(e,t){var n=A.p;try{return A.p=e,t()}finally{A.p=n}}var ot=Math.random().toString(36).slice(2),st=`__reactFiber$`+ot,ct=`__reactProps$`+ot,lt=`__reactContainer$`+ot,ut=`__reactEvents$`+ot,dt=`__reactListeners$`+ot,ft=`__reactHandles$`+ot,pt=`__reactResources$`+ot,mt=`__reactMarker$`+ot;function ht(e){delete e[st],delete e[ct],delete e[ut],delete e[dt],delete e[ft]}function gt(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[st])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[st]||e[lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yt(e){var t=e[pt];return t||=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function bt(e){e[mt]=!0}var xt=new Set,St={};function Ct(e,t){wt(e,t),wt(e+`Capture`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)xt.add(t[e])}var Tt=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]*$`),Et={},Dt={};function Ot(e){return F.call(Dt,e)?!0:F.call(Et,e)?!1:Tt.test(e)?Dt[e]=!0:(Et[e]=!0,!1)}function kt(e,t,n){if(Ot(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function At(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function jt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Mt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Pt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ft(e){if(!e._valueTracker){var t=Nt(e)?`checked`:`value`;e._valueTracker=Pt(e,t,``+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Nt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\n"\\]/g;function zt(e){return e.replace(Rt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Bt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Mt(t)):e.value!==``+Mt(t)&&(e.value=``+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ht(e,o,Mt(n)):Ht(e,o,Mt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Mt(s):e.removeAttribute(`name`)}function Vt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ft(e);return}n=n==null?``:``+Mt(n),t=t==null?n:``+Mt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ft(e)}function Ht(e,t,n){t===`number`&&Lt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ut(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Mt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Wt(e,t,n){if(t!=null&&(t=``+Mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Mt(n)}function Gt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ft(e)}function Kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qt=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 Jt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Yt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Jt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Jt(e,o,t[o])}function Xt(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 Zt=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`]]),Qt=/^[\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 $t(e){return Qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function en(){}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function on(e){var t=_t(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Bt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ct]||null;if(!a)throw Error(i(90));Bt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&It(r)}break a;case`textarea`:Wt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var sn=!1;function cn(e,t,n){if(sn)return e(t,n);sn=!0;try{return e(t)}finally{if(sn=!1,(rn!==null||an!==null)&&(bu(),rn&&(t=rn,e=an,an=rn=null,on(t),e)))for(t=0;t<e.length;t++)on(e[t])}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ct]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var un=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,"passive",{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,gn=null;function vn(){if(gn)return gn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return gn=i.slice(e,1<r?1-r:void 0)}function yn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bn(){return!0}function xn(){return!1}function Sn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?bn:xn,this.isPropagationStopped=xn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=bn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=bn)},persist:function(){},isPersistent:bn}),t}var Cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wn=Sn(Cn),Tn=f({},Cn,{view:0,detail:0}),En=Sn(Tn),Dn,On,kn,An=f({},Tn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vn,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!==kn&&(kn&&e.type===`mousemove`?(Dn=e.screenX-kn.screenX,On=e.screenY-kn.screenY):On=Dn=0,kn=e),Dn)},movementY:function(e){return`movementY`in e?e.movementY:On}}),jn=Sn(An),Mn=Sn(f({},An,{dataTransfer:0})),Nn=Sn(f({},Tn,{relatedTarget:0})),Pn=Sn(f({},Cn,{animationName:0,elapsedTime:0,pseudoElement:0})),Fn=Sn(f({},Cn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),In=Sn(f({},Cn,{data:0})),Ln={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Rn={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`},zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Bn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zn[e])?!!t[e]:!1}function Vn(){return Bn}var Hn=Sn(f({},Tn,{key:function(e){if(e.key){var t=Ln[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=yn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Rn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vn,charCode:function(e){return e.type===`keypress`?yn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?yn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Un=Sn(f({},An,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Wn=Sn(f({},Tn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vn})),Gn=Sn(f({},Cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Kn=Sn(f({},An,{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})),qn=Sn(f({},Cn,{newState:0,oldState:0})),Jn=[9,13,27,32],Yn=un&&`CompositionEvent`in window,Xn=null;un&&`documentMode`in document&&(Xn=document.documentMode);var Zn=un&&`TextEvent`in window&&!Xn,Qn=un&&(!Yn||Xn&&8<Xn&&11>=Xn),$n=` `,er=!1;function tr(e,t){switch(e){case`keyup`:return Jn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function nr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var rr=!1;function ir(e,t){switch(e){case`compositionend`:return nr(t);case`keypress`:return t.which===32?(er=!0,$n):null;case`textInput`:return e=t.data,e===$n&&er?null:e;default:return null}}function ar(e,t){if(rr)return e===`compositionend`||!Yn&&tr(e,t)?(e=vn(),gn=mn=pn=null,rr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Qn&&t.locale!==`ko`?null:t.data;default:return null}}var or={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 sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!or[e.type]:t===`textarea`}function cr(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=Ed(t,`onChange`),0<t.length&&(n=new wn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var lr=null,I=null;function ur(e){yd(e,0)}function dr(e){if(It(vt(e)))return e}function fr(e,t){if(e===`change`)return t}var pr=!1;if(un){var mr;if(un){var hr=`oninput`in document;if(!hr){var gr=document.createElement(`div`);gr.setAttribute(`oninput`,`return;`),hr=typeof gr.oninput==`function`}mr=hr}else mr=!1;pr=mr&&(!document.documentMode||9<document.documentMode)}function _r(){lr&&(lr.detachEvent(`onpropertychange`,vr),I=lr=null)}function vr(e){if(e.propertyName===`value`&&dr(I)){var t=[];cr(t,I,e,nn(e)),cn(ur,t)}}function yr(e,t,n){e===`focusin`?(_r(),lr=t,I=n,lr.attachEvent(`onpropertychange`,vr)):e===`focusout`&&_r()}function br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return dr(I)}function xr(e,t){if(e===`click`)return dr(t)}function Sr(e,t){if(e===`input`||e===`change`)return dr(t)}function Cr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var wr=typeof Object.is==`function`?Object.is:Cr;function Tr(e,t){if(wr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!F.call(t,i)||!wr(e[i],t[i]))return!1}return!0}function Er(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dr(e,t){var n=Er(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Er(n)}}function Or(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Or(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lt(e.document)}return t}function Ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var L=un&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function Fr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==Lt(r)||(r=jr,`selectionStart`in r&&Ar(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nr&&Tr(Nr,r)||(Nr=r,r=Ed(Mr,`onSelect`),0<r.length&&(t=new wn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=jr)))}function Ir(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Lr={animationend:Ir(`Animation`,`AnimationEnd`),animationiteration:Ir(`Animation`,`AnimationIteration`),animationstart:Ir(`Animation`,`AnimationStart`),transitionrun:Ir(`Transition`,`TransitionRun`),transitionstart:Ir(`Transition`,`TransitionStart`),transitioncancel:Ir(`Transition`,`TransitionCancel`),transitionend:Ir(`Transition`,`TransitionEnd`)},Rr={},zr={};un&&(zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),`TransitionEvent`in window||delete Lr.transitionend.transition);function Br(e){if(Rr[e])return Rr[e];if(!Lr[e])return e;var t=Lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zr)return Rr[e]=t[n];return e}var Vr=Br(`animationend`),Hr=Br(`animationiteration`),Ur=Br(`animationstart`),Wr=Br(`transitionrun`),Gr=Br(`transitionstart`),Kr=Br(`transitioncancel`),qr=Br(`transitionend`),Jr=new Map,Yr=`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(` `);Yr.push(`scrollEnd`);function Xr(e,t){Jr.set(e,t),Ct(t,[e])}var Zr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Qr=[],$r=0,ei=0;function ti(){for(var e=$r,t=ei=$r=0;t<e;){var n=Qr[t];Qr[t++]=null;var r=Qr[t];Qr[t++]=null;var i=Qr[t];Qr[t++]=null;var a=Qr[t];if(Qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ai(n,i,a)}}function ni(e,t,n,r){Qr[$r++]=e,Qr[$r++]=t,Qr[$r++]=n,Qr[$r++]=r,ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ri(e,t,n,r){return ni(e,t,n,r),oi(e)}function ii(e,t){return ni(e,null,null,t),oi(e)}function ai(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function oi(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function ci(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function fi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=li(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return mi(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=li(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=li(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=li(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e){var t=li(18,null,null,0);return t.stateNode=e,t}function _i(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function yi(e,t){if(typeof e==`object`&&e){var n=vi.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},vi.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var bi=[],xi=0,Si=null,Ci=0,wi=[],Ti=0,Ei=null,Di=1,Oi=``;function ki(e,t){bi[xi++]=Ci,bi[xi++]=Si,Si=e,Ci=t}function Ai(e,t,n){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Ei=e;var r=Di;e=Oi;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Di=1<<32-Re(t)+i|n<<i|r,Oi=a+e}else Di=1<<a|n<<i|r,Oi=e}function ji(e){e.return!==null&&(ki(e,1),Ai(e,1,0))}function Mi(e){for(;e===Si;)Si=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null;for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,Oi=wi[--Ti],wi[Ti]=null,Di=wi[--Ti],wi[Ti]=null}function Ni(e,t){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Di=t.id,Oi=t.overflow,Ei=e}var Pi=null,Fi=null,R=!1,Ii=null,Li=!1,Ri=Error(i(519));function zi(e){throw Gi(yi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ri}function Bi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[st]=e,t[ct]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Gt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=en),t=!0):t=!1,t||zi(e,!0)}function Vi(e){for(Pi=e.return;Pi;)switch(Pi.tag){case 5:case 31:case 13:Li=!1;return;case 27:case 3:Li=!0;return;default:Pi=Pi.return}}function Hi(e){if(e!==Pi)return!1;if(!R)return Vi(e),R=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&Fi&&zi(e),Vi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=uf(e)}else t===27?(t=Fi,Zd(e.type)?(e=lf,lf=null,Fi=e):Fi=t):Fi=Pi?cf(e.stateNode.nextSibling):null;return!0}function Ui(){Fi=Pi=null,R=!1}function Wi(){var e=Ii;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),Ii=null),e}function Gi(e){Ii===null?Ii=[e]:Ii.push(e)}var Ki=oe(null),qi=null,Ji=null;function Yi(e,t,n){N(Ki,t._currentValue),t._currentValue=n}function Xi(e){e._currentValue=Ki.current,se(Ki)}function Zi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Zi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Zi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function $i(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===de.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Qi(t,e,n,r),t.flags|=262144}function ea(e){for(e=e.firstContext;e!==null;){if(!wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ta(e){qi=e,Ji=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function z(e){return ra(qi,e)}function na(e,t){return qi===null&&ta(e),ra(e,t)}function ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ji===null){if(e===null)throw Error(i(308));Ji=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ji=Ji.next=t;return n}var ia=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},aa=t.unstable_scheduleCallback,oa=t.unstable_NormalPriority,sa={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ca(){return{controller:new ia,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&aa(oa,function(){e.controller.abort()})}var ua=null,da=0,fa=0,pa=null;function ma(e,t){if(ua===null){var n=ua=[];da=0,fa=dd(),pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return da++,t.then(ha,ha),t}function ha(){if(--da===0&&ua!==null){pa!==null&&(pa.status=`fulfilled`);var e=ua;ua=null,fa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var _a=k.S;k.S=function(e,t){eu=Ee(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=oe(null);function ya(){var e=va.current;return e===null?q.pooledCache:e}function ba(e,t){t===null?N(va,va.current):N(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:sa._currentValue,pool:e}}var Sa=Error(i(460)),Ca=Error(i(474)),wa=Error(i(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(en,en),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e;default:if(typeof t.status==`string`)t.then(en,en);else{if(e=q,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function Aa(){if(ka===null)throw Error(i(459));var e=ka;return ka=null,e}function ja(e){if(e===Sa||e===wa)throw Error(i(483))}var Ma=null,Na=0;function Pa(e){var t=Na;return Na+=1,Ma===null&&(Ma=[]),Da(Ma,e,t)}function Fa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ia(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function La(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=di(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&Oa(i)===t.type)?(t=a(t,n.props),Fa(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),Fa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=_i(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=mi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=pi(t.type,t.key,t.props,null,e.mode,n),Fa(n,t),n.return=e,n;case h:return t=_i(t,e.mode,n),t.return=e,t;case T:return t=Oa(t),f(e,t,n)}if(ie(t)||te(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Pa(t),n);if(t.$$typeof===b)return f(e,na(e,t),n);Ia(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=Oa(n),p(e,t,n,r)}if(ie(n)||te(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Pa(n),r);if(n.$$typeof===b)return p(e,t,na(e,n),r);Ia(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Oa(r),_(e,t,n,r,i)}if(ie(r)||te(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Pa(r),i);if(r.$$typeof===b)return _(e,t,n,na(t,r),i);Ia(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),R&&ki(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return R&&ki(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),R&&ki(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),R&&ki(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return R&&ki(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),R&&ki(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),Fa(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Oa(o),x(e,r,o,c)}if(ie(o))return v(e,r,o,c);if(te(o)){if(l=te(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Pa(o),c);if(o.$$typeof===b)return x(e,r,na(e,o),c);Ia(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=x(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=oi(e),ai(e,null,n),t}return ni(e,r,t,n),oi(e)}function Ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qa=!1;function Ja(){if(qa){var e=pa;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Y&p)===p:(r&p)===p){p!==0&&p===fa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ba=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xa(n[e],t)}var Qa=oe(null),B=oe(0);function V(e,t){e=Ul,N(B,e),N(Qa,t),Ul=e|t.baseLanes}function H(){N(B,Ul),N(Qa,Qa.current)}function $a(){Ul=B.current,se(Qa),se(B)}var eo=oe(null),to=null;function no(e){var t=e.alternate;N(oo,oo.current&1),N(eo,e),to===null&&(t===null||Qa.current!==null||t.memoizedState!==null)&&(to=e)}function U(e){N(oo,oo.current),N(eo,e),to===null&&(to=e)}function ro(e){e.tag===22?(N(oo,oo.current),N(eo,e),to===null&&(to=e)):io(e)}function io(){N(oo,oo.current),N(eo,eo.current)}function ao(e){se(eo),to===e&&(to=null),se(oo)}var oo=oe(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var co=0,W=null,G=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return co=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Ls:Rs,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){k.H=Is;var t=G!==null&&G.next!==null;if(co=0,lo=G=W=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||tc||(e=e.dependencies,e!==null&&ea(e)&&(tc=!0))}function So(e,t,n,r){W=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=G=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}k.H=zs,o=t(n,r)}while(fo);return o}function Co(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(G===null?null:G.memoizedState)!==e&&(W.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}co=0,lo=G=W=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?W.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(G===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=G.next;var t=lo===null?W.memoizedState:lo.next;if(t!==null)lo=t,G=e;else{if(e===null)throw W.alternate===null?Error(i(467)):Error(i(310));G=e,e={memoizedState:G.memoizedState,baseState:G.baseState,baseQueue:G.baseQueue,queue:G.queue,next:null},lo===null?W.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Da(go,e,t),t=W,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Ls:Rs),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===b)return z(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ko(),W.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ee;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),G,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(co&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===fa&&(d=!0);else if((co&p)===p){u=u.next,p===fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,W.lanes|=p,Gl|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,W.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!wr(o,e.memoizedState)&&(tc=!0,d&&(n=pa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);wr(o,t.memoizedState)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=W,a=Oo(),o=R;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!wr((G||a).memoizedState,n);if(s&&(a.memoizedState=n,tc=!0),a=a.queue,cs(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),q===null)throw Error(i(349));o||co&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=ko(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wr(e,n)}catch{return!0}}function Ho(e){var t=ii(e,2);t!==null&&hu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){Le(!0);try{n()}finally{Le(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,G,typeof r==`function`?r:No)}function Go(e,t,n,r,a){if(Ns(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};k.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(R){var n=q.formState;if(n!==null){a:{var r=W;if(R){if(Fi){b:{for(var i=Fi,a=Li;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Fi=cf(i.nextSibling),r=i.data===`F!`;break a}}zi(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,W,r),r.dispatch=n,r=Uo(!1),a=Ms.bind(null,W,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),G,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===Sa?wa:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=G;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=ko(),W.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();W.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;G!==null&&r!==null&&yo(r,G.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(W.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=ko(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(K&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||co&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),W.lanes|=e,Gl|=e,n)}function ys(e,t,n,r){return wr(n,t)?n:Qa.current===null?!(co&42)||co&1073741824&&!(Y&261930)?(tc=!0,e.memoizedState=n):(e=mu(),W.lanes|=e,Gl|=e,t):(e=vs(e,n,r),wr(e,t)||(tc=!0),e)}function bs(e,t,n,r,i){var a=A.p;A.p=a!==0&&8>a?a:8;var o=k.T,s={};k.T=s,Ms(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,ga(c,r),pu(e)):js(e,t,r,pu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,j,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:j,baseState:j,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:j},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},pu())}function Ts(){return z(Qf)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ua(n);var r=Wa(t,e,n);r!==null&&(hu(r,t,n),Ga(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=ri(e,t,n,r),n!==null&&(hu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,pu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,wr(s,o))return ni(e,t,i,0),q===null&&ti(),!1}catch{}if(n=ri(e,t,i,r),n!==null)return hu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(i(479))}else t=ri(e,n,r,2),t!==null&&hu(t,e,2)}function Ns(e){var t=e.alternate;return e===W||t!==null&&t===W}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Is={readContext:z,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:z,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:z,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Le(!0);try{n(t)}finally{Le(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ks.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,W,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=Do();if(R){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),q===null)throw Error(i(349));Y&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=q.identifierPrefix;if(R){var n=Oi,r=Di;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,W)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:z,use:jo,useCallback:gs,useContext:z,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),G.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),G,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Rs.useEffectEvent=us;var zs={readContext:z,use:jo,useCallback:gs,useContext:z,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return G===null?vs(n,e,t):ys(n,G.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return G===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,G,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};zs.useEffectEvent=us;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ua(r);i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(hu(t,e,r),Ga(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ua(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(hu(t,e,r),Ga(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=Ua(n);r.tag=2,t!=null&&(r.callback=t),t=Wa(e,r,n),t!==null&&(hu(t,e,n),Ga(t,e,n))}};function Hs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Tr(n,r)||!Tr(i,a):!0}function Us(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){Zr(e)}function Ks(e){console.error(e)}function qs(e){Zr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){return n=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=Ua(e),e.tag=3,e}function Qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&$i(t,n,a,!0),n=eo.current,n!==null){switch(n.tag){case 31:case 13:return to===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Du(),!1}if(R)return t=eo.current,t===null?(r!==Ri&&(t=Error(i(423),{cause:r}),Gi(yi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=yi(r,n),a=Xs(e.stateNode,r,a),Ka(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ri&&(e=Error(i(422),{cause:r}),Gi(yi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=yi(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Xs(n.stateNode,r,e),Ka(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Zs(a),Qs(a,e,n,r),Ka(n,a),!1}n=n.return}while(n!==null);return!1}var ec=Error(i(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function rc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ta(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(R&&s&&ji(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Tr:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Tr(a,r)&&e.ref===t.ref)if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?H():V(t,a),ro(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),H(),io(t)):(ba(t,a.cachePool),V(t,a),io(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),H(),ro(t),e!==null&&$i(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Ra(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(R){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(U(t),(e=Fi)?(e=rf(e,Li),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw zi(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(U(t),a)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(tc||$i(e,t,n,!1),a=(n&e.childLanes)!==0,tc||a){if(r=q,r!==null&&(s=tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ii(e,s),hu(r,e,s),ec;Du(),t=uc(e,t,n)}else e=o.treeContext,Fi=cf(s.nextSibling),Pi=t,R=!0,Ii=null,Li=!1,e!==null&&Ni(t,e),t=lc(t,r),t.flags|=4096;return t}return e=di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pc(e,t,n,r,i){return ta(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(R&&r&&ji(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return ta(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!tc?(To(e,t,a),Dc(e,t,a)):(R&&r&&ji(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(ta(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=z(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Va(t),o=n.contextType,a.context=typeof o==`object`&&o?z(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Vs.enqueueReplaceState(a,a.state,null),Ya(t,r,a,i),Ja(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=z(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Us(t,a,r,o),Ba=!1;var f=t.memoizedState;a.state=f,Ya(t,r,a,i),Ja(),l=t.memoizedState,s||f!==l||Ba?(typeof d==`function`&&(Bs(t,n,d,r),l=t.memoizedState),(c=Ba||Hs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ha(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=z(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Us(t,a,r,c),Ba=!1,f=t.memoizedState,a.state=f,Ya(t,r,a,i),Ja();var p=t.memoizedState;o!==d||f!==p||Ba||e!==null&&e.dependencies!==null&&ea(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=Ba||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ea(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,fc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ra(t,e.child,null,i),t.child=Ra(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return Ui(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:xa()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function bc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(oo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(R){if(a?no(t):io(t),(e=Fi)?(e=rf(e,Li),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw zi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(io(t),a=t.mode,c=Sc({mode:`hidden`,children:c},a),r=mi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(no(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(no(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,a=t.mode,r=Sc({mode:`visible`,children:r.children},a),c=mi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ra(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(no(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Gi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||$i(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=q,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ii(e,r),hu(s,e,r),ec;af(c)||Du(),t=Cc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Fi=cf(c.nextSibling),Pi=t,R=!0,Ii=null,Li=!1,e!==null&&Ni(t,e),t=xc(t,r.children),t.flags|=4096);return t}return a?(io(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=mi(c,a,n,null),c.flags|=2):c=di(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(a=c.cachePool,a===null?a=xa():(l=sa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(no(t),n=e.child,e=n.sibling,n=di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=li(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Ra(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zi(e.return,t,n)}function Tc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=oo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,N(oo,o),nc(e,t,r,n),r=R?Ci:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&so(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&so(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if($i(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ea(e))):!0}function kc(e,t,n){switch(t.tag){case 3:P(t,t.stateNode.containerInfo),Yi(t,sa,e.memoizedState.cache),Ui();break;case 27:case 5:pe(t);break;case 4:P(t,t.stateNode.containerInfo);break;case 10:Yi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,U(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(no(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(no(t),t.flags|=128,null);no(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=($i(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),N(oo,oo.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Yi(t,sa,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}else tc=!1,R&&t.flags&1048576&&Ai(t,Ci,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)ui(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=rc(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=re(e)||e,Error(i(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ws(r,t.pendingProps),hc(e,t,r,a,n);case 3:a:{if(P(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ha(e,t),Ya(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Yi(t,sa,r),r!==o.cache&&Qi(t,[sa],n,!0),Ja(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=gc(e,t,r,n);break a}else if(r!==a){a=yi(Error(i(424)),t),Gi(a),t=gc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Fi=cf(e.firstChild),Pi=t,R=!0,Ii=null,Li=!0,n=za(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ui(),r===a){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:R||(n=t.type,e=t.pendingProps,r=Bd(ue.current).createElement(n),r[st]=t,r[ct]=e,Pd(r,n,e),bt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&R&&(r=t.stateNode=ff(t.type,t.pendingProps,ue.current),Pi=t,Li=!0,a=Fi,Zd(t.type)?(lf=a,Fi=cf(r.firstChild)):Fi=a),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&R&&((a=r=Fi)&&(r=tf(r,t.type,t.pendingProps,Li),r===null?a=!1:(t.stateNode=r,Pi=t,Fi=cf(r.firstChild),Li=!1,a=!0)),a||zi(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),Qf._currentValue=a),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&R&&((e=n=Fi)&&(n=nf(n,t.pendingProps,Li),n===null?e=!1:(t.stateNode=n,Pi=t,Fi=null,e=!0)),e||zi(t)),null;case 13:return bc(e,t,n);case 4:return P(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ra(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Yi(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ta(t),a=z(a),r=r(a),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return ta(t),r=z(sa),e===null?(a=ya(),a===null&&(a=q,o=ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Va(t),Yi(t,sa,a)):((e.lanes&n)!==0&&(Ha(e,t),Ya(t,null,null,n),Ja()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Yi(t,sa,r),r!==a.cache&&Qi(t,[sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Yi(t,sa,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw ka=Ta,Ca}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw ka=Ta,Ca}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ye(),e.lanes|=t,Yl|=t)}function Fc(e,t){if(!R)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ic(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Mi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Xi(sa),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Wi())),Ic(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,a,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,a,e,r,n)),null;case 27:if(me(t),n=ue.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}e=ce.current,Hi(t)?Bi(t,e):(e=ff(a,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}if(o=ce.current,Hi(t))Bi(t,o);else{var s=Bd(ue.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[st]=t,o[ct]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ue.current,Hi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Pi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||zi(t,!0)}else e=Bd(e).createTextNode(r),e[st]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[st]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[st]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return fe(),e===null&&Sd(t.stateNode.containerInfo),Ic(t),null;case 10:return Xi(t.type),Ic(t),null;case 19:if(se(oo),r=t.memoizedState,r===null)return Ic(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Fc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return N(oo,oo.current&1|2),R&&ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>tu&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}else{if(!a)if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!R)return Ic(t),null}else 2*Ee()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=oo.current,N(oo,a?n&1|2:n&1),R&&ki(t,r.treeForkCount),e);case 22:case 23:return ao(t),$a(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&se(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Xi(sa),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Mi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xi(sa),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return se(oo),null;case 4:return fe(),null;case 10:return Xi(t.type),null;case 22:case 23:return ao(t),$a(),e!==null&&se(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xi(sa),null;case 25:return null;default:return null}}function zc(e,t){switch(Mi(t),t.tag){case 3:Xi(sa),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:se(oo);break;case 10:Xi(t.type);break;case 22:case 23:ao(t),$a(),e!==null&&se(va);break;case 24:Xi(sa)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){Z(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ct]=t}catch(t){Z(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(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&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=en));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[st]=e,t[ct]=n}catch(t){Z(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Rd=sp,e=kr(e),Ar(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Bc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Za(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),$c=i,el=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ht(t)),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 sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(Ie&&typeof Ie.onCommitFiberUnmount==`function`)try{Ie.onCommitFiberUnmount(Fe,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;Zd(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),pf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[mt]||o[st]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[st]=e,bt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[st]=e,bt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{Kt(a,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,a=gl,gl=gf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=gf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=Ee()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Kt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:pf(t.stateNode);case 26:case 5:Gc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Xa(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Wc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&la(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Gf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=gf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:la(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Ll={getCacheForType:function(e){var t=z(sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return z(sa).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,K=0,q=null,J=null,Y=0,X=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return K&2&&Y!==0?Y&-Y:k.T===null?it():dd()}function mu(){if(Jl===0)if(!(Y&536870912)||R){var e=Ue;Ue<<=1,!(Ue&3932160)&&(Ue=262144),Jl=e}else Jl=536870912;return e=eo.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===q&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Y,Jl,!1)),Ze(e,n),(!(K&2)||e!==q)&&(e===q&&(!(K&2)&&(Kl|=n),Wl===4&&yu(e,Y,Jl,!1)),rd(e))}function gu(e,t,n){if(K&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||qe(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Vl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-Ee(),10<a)){if(yu(r,t,Jl,!Bl),Ke(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Kd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:en},jl(t,a,d);var m=(a&62914560)===a?$l-Ee():(a&4194048)===a?eu-Ee():0;if(m=qf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!wr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&$e(e,n,t)}function bu(){return K&6?!0:(id(0,!1),!1)}function xu(){if(J!==null){if(X===0)var e=J.return;else e=J,Ji=qi=null,Eo(e),Ma=null,Na=0,e=J;for(;e!==null;)zc(e.alternate,e),e=e.return;J=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),q=e,J=n=di(e.current,null),Y=t,X=0,zl=null,Bl=!1,Vl=qe(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,ti(),n}function Cu(e,t){W=null,k.H=Is,t===Sa||t===wa?(t=Aa(),X=3):t===Ca?(t=Aa(),X=4):X=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,J===null&&(Wl=1,Js(e,yi(t,e.current)))}function wu(){var e=eo.current;return e===null?!0:(Y&4194048)===Y?to===null:(Y&62914560)===Y||Y&536870912?e===to:!1}function Tu(){var e=k.H;return k.H=Is,e===null?Is:e}function Eu(){var e=k.A;return k.A=Ll,e}function Du(){Wl=4,Bl||(Y&4194048)!==Y&&eo.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||q===null||yu(q,Y,Jl,!1)}function Ou(e,t,n){var r=K;K|=2;var i=Tu(),a=Eu();(q!==e||Y!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(X!==0&&J!==null){var s=J,c=zl;switch(X){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:eo.current===null&&(t=!0);var l=X;if(X=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=X,X=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ji=qi=null,K=r,k.H=i,k.A=a,J===null&&(q=null,Y=0,ti()),o}function ku(){for(;J!==null;)Mu(J)}function Au(e,t){var n=K;K|=2;var r=Tu(),a=Eu();q!==e||Y!==t?(nu=null,tu=Ee()+500,Su(e,t)):Vl=qe(e,t);a:do try{if(X!==0&&J!==null){t=J;var o=zl;b:switch(X){case 1:X=0,zl=null,Pu(e,t,o,1);break;case 2:case 9:if(Ea(o)){X=0,zl=null,Nu(t);break}t=function(){X!==2&&X!==9||q!==e||(X=7),rd(e)},o.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:Ea(o)?(X=0,zl=null,Nu(t)):(X=0,zl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Wf(s):c.stateNode.complete){X=0,zl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Fu(u))}break b}}X=0,zl=null,Pu(e,t,o,5);break;case 6:X=0,zl=null,Pu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Ji=qi=null,k.H=r,k.A=a,K=n,J===null?(q=null,Y=0,ti(),Wl):0}function ju(){for(;J!==null&&!we();)Mu(J)}function Mu(e){var t=Ac(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:Eo(t);default:zc(n,t),t=J=fi(t,Ul),t=Ac(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Pu(e,t,n,r){Ji=qi=null,Eo(t),Ma=null,Na=0;var i=t.return;try{if($s(e,i,t,n,Y)){Wl=1,Js(e,yi(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Wl=1,Js(e,yi(n,e.current)),J=null;return}t.flags&32768?(R||r===1?e=!0:Vl||Y&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Lc(t.alternate,t,Ul);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);Wl=6,J=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(K&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ei,Qe(e,n,o,s,c,l),e===q&&(J=q=null,Y=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Ae,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=k.T,k.T=null,a=A.p,A.p=2,s=K,K|=4;try{il(e,t,n)}finally{K=s,A.p=a,k.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=K;K|=4;try{_l(t,e);var a=zd,o=kr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Or(s.ownerDocument.documentElement,s)){if(c!==null&&Ar(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Dr(s,h),v=Dr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{K=i,A.p=r,k.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=K;K|=4;try{al(e,t.alternate,t)}finally{K=i,A.p=r,k.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,Te();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),rt(n),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot==`function`)try{Ie.onCommitFiberRoot(Fe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=k.T,i=A.p,A.p=2,k.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{k.T=t,A.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=rt(su),r=k.T,a=A.p;try{A.p=32>n?32:n,k.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,K&6)throw Error(i(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,id(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Fe,o)}catch{}return!0}finally{A.p=a,k.T=r,Vu(e,t)}}function Wu(e,t,n){t=yi(n,t),t=Xs(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(Ze(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=yi(n,e),n=Zs(2),r=Wa(t,n,2),r!==null&&(Qs(n,r,t,e),Ze(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>Ee()-$l?!(K&2)&&Su(e,0):ql|=n,Yl===Y&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=Ye()),e=ii(e,t),e!==null&&(Ze(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Se(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=Ke(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||qe(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Ee(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Je(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=q,n=Y,n=Ke(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ce(r),rt(n)){case 2:case 8:n=ke;break;case 32:n=Ae;break;case 268435456:n=Me;break;default:n=Ae}return r=cd.bind(null,e),n=Se(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ce(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Y;return r=Ke(e,e===q?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,Ee()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){K&6?Se(Oe,ad):od()})}function dd(){if(nd===0){var e=fa;e===0&&(e=He,He<<=1,!(He&261888)&&(He=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:$t(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[ct]||null).action),o=r.submitter;o&&(t=(t=o[ct]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new wn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Yr.length;hd++){var gd=Yr[hd];Xr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Xr(Vr,`onAnimationEnd`),Xr(Hr,`onAnimationIteration`),Xr(Ur,`onAnimationStart`),Xr(`dblclick`,`onDoubleClick`),Xr(`focusin`,`onFocus`),Xr(`focusout`,`onBlur`),Xr(Wr,`onTransitionRun`),Xr(Gr,`onTransitionStart`),Xr(Kr,`onTransitionCancel`),Xr(qr,`onTransitionEnd`),wt(`onMouseEnter`,[`mouseout`,`mouseover`]),wt(`onMouseLeave`,[`mouseout`,`mouseover`]),wt(`onPointerEnter`,[`pointerout`,`pointerover`]),wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ct(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ct(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ct(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ct(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Zr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Zr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[ut];n===void 0&&(n=t[ut]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,xt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!dn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=gt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}cn(function(){var r=a,i=nn(n),s=[];a:{var c=Jr.get(e);if(c!==void 0){var l=wn,u=e;switch(e){case`keypress`:if(yn(n)===0)break a;case`keydown`:case`keyup`:l=Hn;break;case`focusin`:u=`focus`,l=Nn;break;case`focusout`:u=`blur`,l=Nn;break;case`beforeblur`:case`afterblur`:l=Nn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Mn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Wn;break;case Vr:case Hr:case Ur:l=Pn;break;case qr:l=Gn;break;case`scroll`:case`scrollend`:l=En;break;case`wheel`:l=Kn;break;case`copy`:case`cut`:case`paste`:l=Fn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Un;break;case`toggle`:case`beforetoggle`:l=qn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=ln(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==tn&&(u=n.relatedTarget||n.fromElement)&&(gt(u)||u[lt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?gt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=jn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Un,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:vt(l),h=u==null?c:vt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,gt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=fr;else if(sr(c))if(pr)v=Sr;else{v=br;var y=yr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Xt(r.elementType)&&(v=fr):v=xr;if(v&&=v(e,r)){cr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ht(c,`number`,c.value)}switch(y=r?vt(r):window,e){case`focusin`:(sr(y)||y.contentEditable===`true`)&&(jr=y,Mr=r,Nr=null);break;case`focusout`:Nr=Mr=jr=null;break;case`mousedown`:Pr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Pr=!1,Fr(s,n,i);break;case`selectionchange`:if(L)break;case`keydown`:case`keyup`:Fr(s,n,i)}var b;if(Yn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else rr?tr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Qn&&n.locale!==`ko`&&(rr||x!==`onCompositionStart`?x===`onCompositionEnd`&&rr&&(b=vn()):(pn=i,mn=`value`in pn?pn.value:pn.textContent,rr=!0)),y=Ed(r,x),0<y.length&&(x=new In(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=nr(n),b!==null&&(x.data=b)))),(b=Zn?ir(e,n):ar(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new In(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=ln(e,n),i!=null&&r.unshift(Td(e,i,a)),i=ln(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=ln(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=ln(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
15
+ `).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){At(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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 o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=$t(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Zt.get(n)||n,kt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Yt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ct]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):kt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}Gt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Bt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}Wt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[mt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=A.d;A.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=yt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);bt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=yt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),bt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=yt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),bt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=ue.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=yt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=yt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=yt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+zt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),bt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+zt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,bt(a),a):(r=n,(a=mf.get(o))&&(r=f({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),bt(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[mt]||a[st]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:b,Provider:null,Consumer:null,_currentValue:j,_currentValue2:j,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){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=Xe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xe(0),this.hiddenUpdates=Xe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=li(3,null,null,t),e.current=a,a.stateNode=e,t=ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function tp(e){return e?(e=si,e):si}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(hu(n,e,t),Ga(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ii(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=nt(t);var n=ii(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=2,up(e,t,n,r)}finally{A.p=a,k.T=i}}function lp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=8,up(e,t,n,r)}finally{A.p=a,k.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ge(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}rd(a),!(K&6)&&(tu=Ee()+500,id(0,!1))}}break;case 31:case 13:s=ii(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=nn(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=gt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(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(De()){case Oe:return 2;case ke:return 8;case Ae:case je:return 32;case Me:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=_t(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=gt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,at(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,at(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=_t(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ct]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ct]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[lt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.7`)throw Error(i(527,Lp,`19.2.7`));A.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Fe=zp.inject(Rp),Ie=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Gs,s=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[lt]=t.current,Sd(e),new Fp(t)}})),yn=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=vn()}));function bn(){return r(`/api/commands`)}async function xn(){return r(`/api/dashboard/config`)}async function Sn(e){return c(`/api/models`,e)}async function Cn(e,t){return c(`/api/providers/${e}`,t)}async function wn(){return r(`/api/runtime/status`)}async function Tn(){return r(`/api/skills`)}async function En(){return r(`/api/metrics/host`)}async function Dn(){return r(`/api/safety/policy`)}async function On(){return r(`/api/session`)}async function kn(e={}){return r(`/api/sessions${e.includeArchived?`?includeArchived=1`:``}`)}async function An(e={}){return c(`/api/sessions`,e)}async function jn(e,t={}){return c(`/api/sessions/${e}/summary/refresh`,t)}async function Mn(e,t={}){return c(`/api/sessions/${e}/reference`,t)}async function Nn(e){return c(`/api/sessions/${e}/switch`,{surface:`dashboard`,reason:`dashboard-session-switcher`})}async function Pn(e,t){return c(`/api/sessions/${e}/rename`,{title:t,reason:`dashboard-session-switcher`})}async function Fn(e,t){return c(`/api/sessions/${e}/pin`,{pinned:t,reason:`dashboard-session-switcher`})}async function In(e){return c(`/api/sessions/${e}/archive`,{surface:`dashboard`,reason:`dashboard-session-switcher`})}async function Ln(e){return c(`/api/sessions/${e}/restore`,{surface:`dashboard`,reason:`dashboard-session-switcher`})}async function Rn(e){return r(`/api/sessions/${e}/command-events`)}async function zn(e){return r(`/api/sessions/${e}/activity`)}async function Bn(e,t){return c(`/api/sessions/${e}/command-events`,t)}async function Vn(e,t,n){return c(`/api/sessions/${e}/command-events/${t}`,n)}async function Hn(){return r(`/api/workflows/observability`)}async function Un(e={}){return r(`/api/execution/approvals${e.includeResolved?`?includeResolved=1`:``}`)}async function Wn(e,t){return c(`/api/execution/approvals/${e}/resolve`,{decision:t,approverSurface:`dashboard`})}async function Gn(){return r(`/api/mcp/servers`)}async function Kn(e={}){return r(`/api/mcp/approvals${e.includeResolved?`?includeResolved=1`:``}`)}async function qn(e){return c(`/api/mcp/servers/${e}/login`,{})}async function Jn(e){return c(`/api/mcp/servers/${e}/logout`,{confirm:!0})}async function Yn(e,t){return c(`/api/mcp/approvals/${e}/resolve`,{decision:t,approverSurface:`dashboard`})}async function Xn(){return r(`/api/scheduled-tasks`)}async function Zn(e={}){let t=new URLSearchParams;e.scope&&t.set(`scope`,e.scope),e.status&&t.set(`status`,e.status),e.includeArchived&&t.set(`includeArchived`,`true`);let n=t.toString();return r(`/api/memories${n?`?${n}`:``}`)}async function Qn(e={}){return r($n(e))}function $n(e={}){let t=new URLSearchParams;e.candidateStatus&&t.set(`candidateStatus`,e.candidateStatus),e.candidateTarget&&t.set(`candidateTarget`,e.candidateTarget),e.limit&&t.set(`limit`,String(e.limit));let n=t.toString();return`/api/learning/state${n?`?${n}`:``}`}async function er(e,t,n){return c(`/api/learning/candidates/${e}/${t}`,{reason:n||void 0})}async function tr(e,t){return c(`/api/skills/patches/${e}/restore`,{confirm:!0,reason:t||`Dashboard skill patch restore.`})}async function nr(e){return c(e===`conversation`?`/api/learning/reviews/conversation`:`/api/learning/reviews/prs`,{reason:`Dashboard manual learning review.`})}async function rr(){return r(`/api/notifications`)}async function ir(e){return c(`/api/notifications/${e}/read`,{})}async function ar(e){return c(`/api/notifications/${e}/resolve`,{})}async function or(){return r(`/api/briefings`)}async function sr(e){return l(`/api/briefings/profile`,e)}async function cr(e={}){return c(`/api/briefings/run`,e)}async function lr(e=`morning`){return c(`/api/briefings/session/rotate`,{id:e})}var I=s(),ur=_n(),dr=yn();async function fr(e={}){let t=new URLSearchParams;e.kind&&t.set(`kind`,e.kind),e.excludeKind&&t.set(`excludeKind`,e.excludeKind),e.limit&&t.set(`limit`,String(e.limit));let n=t.toString(),i=await r(`/api/reports${n?`?${n}`:``}`);if(!i.ok)throw Error(i.message??`Reports unavailable.`);return i}async function pr(e,t={}){let n=await r(`/api/reports/${encodeURIComponent(e)}`,t);if(!n.ok)throw Error(n.message??`Report unavailable.`);return n}async function mr(e,t={}){let n=`/reports/${encodeURIComponent(e)}`,r=await fetch(n,{signal:t.signal});if(!r.ok)throw new u(`Report request failed with ${r.status}.`,r.status,n,null);return r.text()}async function hr(e){let t=await c(`/api/reports/${encodeURIComponent(e)}/stage-docs-fix`,{});if(!t.ok)throw Error(t.message??`Could not stage docs fix.`);return t}async function gr(){return r(`/api/worktrees`)}async function _r(){return r(`/api/watches`)}async function vr(e){return c(`/api/watches/${encodeURIComponent(e)}`,{confirm:!0})}async function yr(e,t){return c(`/api/watches/${encodeURIComponent(e)}/polling`,{enabled:t})}var br=`neondeck:config-change`;function xr(e){window.dispatchEvent(new CustomEvent(br,{detail:e}))}function Sr(e){let t=(0,F.useRef)(e);(0,F.useEffect)(()=>{t.current=e},[e]),(0,F.useEffect)(()=>{let e=e=>{t.current(e.detail)};return window.addEventListener(br,e),()=>window.removeEventListener(br,e)},[])}function Cr(e,t){return e.files.some(e=>e===t||e.endsWith(`/${t}`))}var wr=640,Tr=2.2,Er=1.1;function Dr(e){let{width:t,height:n,mode:r}=e;if(r===`xeneon`)return`ultrawide`;if(r===`stacked`)return`portrait`;if(!Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0)return`wide`;if(t<wr)return`compact`;let i=t/n;return i>=Tr?`ultrawide`:i>=Er?`wide`:`portrait`}function Or(e){return e===`portrait`||e===`compact`?`column`:`grid`}function kr(e){let t=(0,F.useRef)({width:typeof window>`u`?0:window.innerWidth,height:typeof window>`u`?0:window.innerHeight}),n=(0,F.useRef)(e),r=(0,F.useRef)(null),[i,a]=(0,F.useState)(()=>Dr({...t.current,mode:e})),o=(0,F.useCallback)(()=>{let e=Dr({...t.current,mode:n.current});a(t=>t===e?t:e)},[]),s=(0,F.useCallback)(e=>{if(r.current?.disconnect(),r.current=null,!e)return;let n=e.getBoundingClientRect();if(t.current={width:n.width,height:n.height},o(),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(e=>{let n=e[0];n&&(t.current={width:n.contentRect.width,height:n.contentRect.height},o())});i.observe(e),r.current=i},[o]);return(0,F.useEffect)(()=>{n.current=e,o()},[e,o]),(0,F.useEffect)(()=>()=>r.current?.disconnect(),[]),{ref:s,profile:i,arrangement:Or(i)}}function Ar({title:e,kind:t,linkedRepoId:n,linkedWatchId:r,linkedTaskId:i,summary:a,uiMetadata:o,label:s=`session`,className:c=`inline-flex min-h-[28px] shrink-0 items-center border border-line px-2 py-1 text-muted hover:border-primary hover:text-primary disabled:opacity-50`}){let l=h(),u=P({async mutationFn(){let s=await An({title:e,kind:t,activate:!0,surface:`dashboard`,linkedRepoId:n,linkedWatchId:r,linkedTaskId:i,summary:a,summarySource:a?`metadata`:void 0,uiMetadata:o,reason:`dashboard-reference-row`});if(!s.ok||!s.session)throw Error(s.message);return s},onSuccess(){l.invalidateQueries({queryKey:b.neonSession}),l.invalidateQueries({queryKey:b.chatSessions}),window.dispatchEvent(new CustomEvent(`neondeck:focus-chat`,{detail:{pluginId:`flue-chat`}}))}});return(0,I.jsx)(`button`,{className:c,disabled:u.isPending,onClick:()=>u.mutate(),title:`Open a linked chat session for this row`,type:`button`,children:u.isPending?`opening`:s})}function L(e,t={}){let n=Date.parse(e),r=Date.now()-n;if(!Number.isFinite(r))return`now`;let i=r<0,a=Math.floor(Math.abs(r)/6e4),o=a<1?i?`soon`:`now`:a<60?`${a}m`:a<2880?`${Math.floor(a/60)}h`:`${Math.floor(a/1440)}d`;return i?t.suffix?`in ${o}`:o:t.suffix&&o!==`now`?`${o} ago`:o}function jr(e){if(e.status!==`attention-needed`)return null;let t=e.lastSnapshot?.checks,n=t?.failed,r=t?.total,i=typeof n==`number`&&n>0?typeof r==`number`&&r>0?`${n} of ${r} ${r===1?`check`:`checks`} failed`:`${n} ${n===1?`check`:`checks`} failed`:`checks are failing`;return e.lastSnapshot?.merged?`Merged, but ${i}.`:e.prState===`closed`?`Closed, but ${i}.`:`${i[0]?.toUpperCase()}${i.slice(1)}.`}function Mr(e){if(e.source!==`watch-pr`||!e.message.startsWith(`Updated watch `))return e.message;let t=Nr(e.data);if(!t)return e.message;let n=jr(t);return n?`${t.id}: ${n}`:e.message}function Nr(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;return typeof t.id!=`string`||typeof t.status!=`string`?null:{id:t.id,status:t.status,prState:typeof t.prState==`string`?t.prState:null,lastSnapshot:t.lastSnapshot&&typeof t.lastSnapshot==`object`?t.lastSnapshot:null}}function Pr(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:e}function Fr(e,t){let n=Pr(t),r={...e},i=[];for(let t of Object.keys(e)){let e=n[String(t)];e!==void 0&&(typeof e==`number`&&Number.isInteger(e)&&e>=1?r[t]=e:i.push(`${String(t)} must be an integer >= 1.`))}return{config:r,issues:i}}function Ir(e,t,n,r){return e===void 0?t:typeof e==`string`&&e.trim().length>0?e:(r.push(`${n} must be a non-empty string.`),t)}var Lr={limit:8},Rr={id:`active-watches`,title:`Active watches`,kind:`data`,defaultConfig:Lr,parseConfig:e=>Fr(Lr,e),Component({config:e}){let t=h(),{data:n,error:r,isLoading:i}=d({queryKey:b.prWatches,queryFn:_r,refetchInterval:3e4});Sr(e=>{(e.action===`config_reload`||Cr(e,`repos.json`))&&t.invalidateQueries({queryKey:b.prWatches})});let a=n?.watches??[],o=a.slice(0,e.limit);return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`header`,{className:`panel-header flex h-8 items-center justify-between border-b border-line px-3 font-mono text-[10.5px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:`text-primary`,children:`WATCHES`}),(0,I.jsx)(x,{children:a.length})]}),(0,I.jsx)(v,{className:`flex-1`,children:(0,I.jsx)(`div`,{className:`space-y-2 p-3`,children:i?(0,I.jsx)(Br,{title:`Loading watches`,detail:`Reading runtime state.`}):r?(0,I.jsx)(Br,{title:`Watch API failed`,detail:k(r)}):o.length===0?(0,I.jsx)(Br,{title:`No active watches`,detail:`PR watches will appear here after they are created.`}):o.map(e=>(0,I.jsx)(zr,{watch:e},e.id))})})]})}};function zr({watch:e}){let[t,n]=(0,F.useState)(!1),r=h(),i=P({mutationFn:()=>vr(e.id),onSuccess(){n(!1),r.invalidateQueries({queryKey:b.prWatches}),r.invalidateQueries({queryKey:b.autopilotState})}}),a=e.pollingEnabled!==!1,o=P({mutationFn:()=>yr(e.id,!a),onSuccess(){r.invalidateQueries({queryKey:b.prWatches})}}),s=e.lastCheckedAt?`checked ${L(e.lastCheckedAt)}`:`not checked`,c=a?e.nextRunAt?`next ${L(e.nextRunAt)}`:`next poll pending`:`polling paused`,l=e.createdBy?` · ${e.createdBy}`:``,u=jr(e);return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`p`,{className:`truncate font-mono text-[11px] text-primary`,children:[e.repoFullName,`#`,e.prNumber]}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[12px] leading-4 text-ink`,children:e.title??`Untitled PR`}),u?(0,I.jsxs)(`p`,{className:`mt-1 font-mono text-[10px] leading-4 text-accent`,children:[`why · `,u]}):null]}),(0,I.jsx)(x,{className:Vr(e.status),children:e.status})]}),(0,I.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`until `,e.desiredTerminalState,` · `,s,` · `,c,l]}),(0,I.jsxs)(`span`,{className:`flex shrink-0 gap-1.5`,children:[(0,I.jsx)(Ar,{kind:`watch`,label:`session`,linkedRepoId:e.repoId,linkedWatchId:e.id,summary:`${e.repoFullName}#${e.prNumber} watch is ${e.status} until ${e.desiredTerminalState}. ${e.title??`Untitled PR`}.`,title:`Watch ${e.repoFullName}#${e.prNumber}`,uiMetadata:{source:`pr-watch`,repoFullName:e.repoFullName,prNumber:e.prNumber,status:e.status,desiredTerminalState:e.desiredTerminalState,url:e.url}}),e.url?(0,I.jsx)(E,{className:`min-h-[28px] border-line bg-transparent px-2 py-1 text-[10px] text-muted`,onClick:()=>window.open(e.url??void 0,`_blank`,`noopener,noreferrer`),type:`button`,children:`open`}):null,(0,I.jsx)(E,{className:`min-h-[28px] border-line bg-transparent px-2 py-1 text-[10px] text-muted`,disabled:o.isPending,onClick:()=>o.mutate(),title:o.error?k(o.error):void 0,type:`button`,children:o.isPending?a?`pausing`:`resuming`:a?`pause`:`resume`}),(0,I.jsx)(E,{className:`min-h-[28px] border-line bg-transparent px-2 py-1 text-[10px] text-muted hover:border-accent hover:text-accent`,disabled:i.isPending||o.isPending,onClick:()=>n(!0),type:`button`,children:`stop`})]})]}),t?(0,I.jsxs)(`div`,{className:`mt-2 border border-accent/50 bg-field px-2 py-1.5 font-mono text-[10px] text-muted`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`text-accent`,children:`Remove this watch?`}),(0,I.jsxs)(`span`,{className:`flex gap-1.5`,children:[(0,I.jsx)(E,{className:`min-h-[28px] border-accent bg-transparent px-2 py-1 text-[10px] text-accent`,disabled:i.isPending,onClick:()=>i.mutate(),type:`button`,children:`confirm`}),(0,I.jsx)(E,{className:`min-h-[28px] bg-transparent px-2 py-1 text-[10px] text-muted`,disabled:i.isPending,onClick:()=>n(!1),type:`button`,children:`cancel`})]})]}),i.error?(0,I.jsx)(`p`,{className:`mt-1 text-accent`,children:k(i.error)}):null]}):null]})}function Br({title:e,detail:t}){return(0,I.jsxs)(`div`,{className:`flex h-32 flex-col items-center justify-center text-center`,children:[(0,I.jsx)(`div`,{className:`miami-accent mb-2 h-1 w-10`}),(0,I.jsx)(`p`,{className:`text-[12px] font-semibold text-ink`,children:e}),(0,I.jsx)(`p`,{className:`mt-1 max-w-[24ch] text-[11px] leading-4 text-muted`,children:t})]})}function Vr(e){return e===`green`?`border-primary text-primary`:e===`attention-needed`?`border-accent text-accent`:e===`closed`||e===`merged`?`border-line text-muted`:``}var Hr=(0,F.lazy)(()=>y(()=>import(`./surfaces-Dlg1xLbg.js`).then(e=>({default:e.PreparedDiffReview})),__vite__mapDeps([0,1,2,3,4]))),Ur=(0,F.lazy)(()=>y(()=>import(`./surfaces-Dlg1xLbg.js`).then(e=>({default:e.KiloTaskDiffReview})),__vite__mapDeps([0,1,2,3,4]))),Wr={queueLimit:8,policyLimit:6,preparedLimit:4,approvalLimit:4,checkLimit:4,activityLimit:8},Gr={id:`autopilot`,title:`Autopilot`,kind:`data`,defaultConfig:Wr,parseConfig:e=>Fr(Wr,e),Component({config:e}){let{data:t,error:n,isLoading:r}=d({queryKey:b.autopilotState,queryFn:he,refetchInterval:2e4});return r?(0,I.jsx)(S,{title:`Autopilot loading`,detail:`Reading operator state.`}):n?(0,I.jsx)(S,{title:`Autopilot unavailable`,detail:k(n)}):t?(0,I.jsx)(Kr,{config:e,state:t}):(0,I.jsx)(S,{title:`Autopilot unavailable`,detail:`No data.`})}};function Kr({config:e,state:t}){let n=t.queue.slice(0,e.queueLimit),r=t.policies.repos.slice(0,e.policyLimit),i=t.policies.watches.slice(0,e.policyLimit),a=t.preparedDiffs.slice(0,e.preparedLimit),o=t.pendingApprovals.slice(0,e.approvalLimit),s=t.runningChecks.slice(0,e.checkLimit),c=t.recentActivity.slice(0,e.activityLimit);return(0,I.jsxs)(`div`,{className:`autopilot-panel flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`header`,{className:`panel-header flex h-8 items-center justify-between border-b border-line px-3 font-mono text-[10.5px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:`text-primary`,children:`AUTOPILOT`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(x,{children:t.modeLabels[t.policies.global.mode]}),(0,I.jsxs)(x,{children:[t.summary.queuedItems,` queue`]})]})]}),(0,I.jsx)(qr,{state:t}),(0,I.jsx)(v,{className:`flex-1`,children:(0,I.jsxs)(`div`,{className:`autopilot-grid grid gap-2 p-3`,children:[(0,I.jsxs)(`section`,{className:`min-w-0 space-y-2`,children:[(0,I.jsx)(Jr,{state:t}),(0,I.jsx)(Yr,{count:t.queue.length,empty:`No queued autopilot work.`,title:`Queue`,children:n.map(e=>(0,I.jsx)(Xr,{item:e},e.id))}),(0,I.jsx)(Yr,{count:t.preparedDiffs.length,empty:`No prepared diffs.`,title:`Prepared`,children:a.map(e=>(0,I.jsx)(Zr,{diff:e},e.id))}),(0,I.jsx)(Yr,{count:t.pendingApprovals.length,empty:`No pending push approvals.`,title:`Approvals`,children:o.map(e=>(0,I.jsx)(ti,{approval:e,preparedDiff:e.preparedDiffId?t.preparedDiffs.find(t=>t.id===e.preparedDiffId):void 0},e.id))})]}),(0,I.jsxs)(`section`,{className:`min-w-0 space-y-2`,children:[(0,I.jsx)(ii,{repoPolicies:r,state:t,watchPolicies:i}),(0,I.jsx)(Yr,{count:t.runningChecks.length,empty:`No autopilot checks running.`,title:`Checks`,children:s.map(e=>(0,I.jsx)(oi,{check:e},e.id))}),(0,I.jsx)(Yr,{count:t.recentActivity.length,empty:`No autonomous activity recorded.`,title:`Recent`,children:c.map(e=>(0,I.jsx)(si,{item:e},e.id))}),(0,I.jsx)(Yr,{count:t.summary.placeholderAdapters.length,empty:`No placeholder adapters.`,title:`Adapters`,children:t.summary.placeholderAdapters.map(e=>(0,I.jsx)(`p`,{className:`border border-line bg-soft px-2.5 py-2 text-[11px] leading-4 text-muted`,children:e},e))})]})]})})]})}function qr({state:e}){let t=[[`approvals`,e.summary.pendingApprovals],[`unread`,e.summary.unreadNotifications],[`failed checks`,e.summary.failedChecks]];return t.reduce((e,[,t])=>e+t,0)===0?null:(0,I.jsxs)(`div`,{className:`flex min-h-8 items-center justify-between gap-3 border-b border-accent/50 bg-soft px-3 font-mono text-[10px] leading-4 text-muted`,children:[(0,I.jsx)(`span`,{className:`text-accent`,children:`NEEDS ATTENTION`}),(0,I.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-x-2 gap-y-1`,children:t.filter(([,e])=>e>0).map(([e,t])=>(0,I.jsxs)(`span`,{className:`whitespace-nowrap`,children:[t,` `,e]},e))})]})}function Jr({state:e}){return(0,I.jsx)(`div`,{className:`autopilot-summary grid border border-line bg-soft font-mono`,children:[[`watches`,e.summary.activeWatches],[`prepared`,e.summary.preparedDiffs],[`approvals`,e.summary.pendingApprovals],[`checks`,e.summary.runningChecks]].map(([e,t])=>(0,I.jsxs)(`div`,{className:`border-r border-line px-2 py-2 last:border-r-0`,children:[(0,I.jsx)(`p`,{className:`text-[10px] uppercase text-muted`,children:e}),(0,I.jsx)(`p`,{className:`mt-1 text-[15px] text-primary`,children:t})]},e))})}function Yr({children:e,count:t,empty:n,title:r}){return(0,I.jsxs)(`section`,{children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between font-mono text-[10px] tracking-[0.12em] text-muted`,children:[(0,I.jsx)(`span`,{children:r.toUpperCase()}),(0,I.jsx)(`span`,{children:t})]}),(0,I.jsx)(`div`,{className:`space-y-1.5`,children:t===0?(0,I.jsx)(`p`,{className:`border border-line bg-soft px-2.5 py-2 text-[11px] text-muted`,children:n}):e})]})}function Xr({item:e}){return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-primary`,children:li(e.repoFullName,e.prNumber)}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-1 text-[12px] text-ink`,children:e.title})]}),(0,I.jsx)(x,{className:ci(e.priority),children:e.status})]}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-4 text-muted`,children:e.reason}),(0,I.jsxs)(`div`,{className:`mt-2 flex min-w-0 items-center justify-between gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:e.nextStep}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,I.jsx)(Ar,{kind:`task`,label:`session`,linkedRepoId:e.repoId,linkedTaskId:e.id,summary:`${e.title}: ${e.reason} Next step: ${e.nextStep}. Mode ${e.mode}; status ${e.status}.`,title:`Autopilot ${e.title}`,uiMetadata:{source:`autopilot-queue`,itemId:e.id,repoFullName:e.repoFullName,prNumber:e.prNumber,worktreeId:e.worktreeId,runId:e.runId,mode:e.mode,status:e.status}}),e.mode]})]})]})}function Zr({diff:e}){let[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(!1),a=ri(e);return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-primary`,children:li(e.repoFullName,e.prNumber)}),(0,I.jsx)(x,{className:`border-primary text-primary`,children:e.status})]}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-4 text-muted`,children:e.summary}),(0,I.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-muted`,children:e.localPath}),e.revisionRun?(0,I.jsxs)(`div`,{className:`mt-1.5 border border-line bg-field px-2 py-1.5 font-mono text-[10px] leading-4 text-muted`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`span`,{className:`truncate`,children:[`revision`,` `,e.revisionRun.status??e.revisionRun.outcome??`queued`]}),a?(0,I.jsx)(E,{className:`min-h-[22px] bg-transparent px-1.5 py-0 text-[10px]`,onClick:()=>i(e=>!e),type:`button`,children:r?`hide task diff`:`view task diff`}):null]}),e.revisionRun.reason?(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 whitespace-pre-wrap`,children:e.revisionRun.reason}):null]}):null,(0,I.jsxs)(`div`,{className:`mt-1.5 flex justify-end gap-1.5 font-mono text-[10px]`,children:[(0,I.jsx)(E,{className:`min-h-[24px] px-2 py-0 font-mono text-[10px]`,onClick:()=>n(e=>!e),type:`button`,children:t?`hide diff`:`inspect diff`}),(0,I.jsx)(Ar,{kind:`task`,label:`session`,linkedRepoId:e.repoId,linkedTaskId:e.id,summary:`${e.title}: ${e.summary}. Prepared diff ${e.status} in ${e.localPath}.`,title:`Prepared ${e.title}`,uiMetadata:{source:`autopilot-prepared-diff`,preparedDiffId:e.id,repoFullName:e.repoFullName,prNumber:e.prNumber,worktreeId:e.worktreeId,status:e.status}})]}),t?(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(M,{label:`Loading diff viewer.`}),children:(0,I.jsx)(Hr,{diff:e})})}):null,r&&a?(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(M,{label:`Loading Kilo diff viewer.`}),children:(0,I.jsx)(Ur,{task:a})})}):null,(0,I.jsx)(Qr,{diff:e})]})}function Qr({diff:e}){let t=e.id,[n,r]=(0,F.useState)(),[i,a]=(0,F.useState)(),o=h(),{data:s}=d({queryKey:[`autopilot-recovery-options`,t],queryFn:()=>_e(t),refetchInterval:3e4}),c=P({mutationFn:fe,onSuccess(){o.invalidateQueries({queryKey:b.autopilotState}),o.invalidateQueries({queryKey:[`autopilot-recovery-options`,t]})}}),l=(s?.options??[]).filter(e=>$r(e.id));return l.length===0?null:(0,I.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[l.map(e=>(0,I.jsx)(E,{className:`px-2 py-1 font-mono text-[10px]`,disabled:c.isPending,onClick:()=>{if(e.id===`cleanup-worktree`){r(e);return}if(e.id===`request-revision`||e.id===`run-revision`){a(e);return}c.mutate({preparedDiffId:t,recoveryAction:e.id})},title:e.description,type:`button`,children:ei(e.id)},e.id)),c.data?(0,I.jsx)(`p`,{className:`basis-full text-[10px] leading-4 text-muted`,children:c.data.message}):null,c.error?(0,I.jsx)(`p`,{className:`basis-full text-[10px] leading-4 text-accent`,children:k(c.error)}):null,n?(0,I.jsx)(`div`,{className:`basis-full border border-accent/50 bg-field px-2 py-1.5 font-mono text-[10px] text-muted`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`text-accent`,children:`Clean up this worktree?`}),(0,I.jsxs)(`span`,{className:`flex gap-1.5`,children:[(0,I.jsx)(E,{className:`min-h-[24px] border-accent bg-transparent px-1.5 py-0 text-[10px] text-accent`,disabled:c.isPending,onClick:()=>{c.mutate({preparedDiffId:t,recoveryAction:n.id,confirm:!0}),r(void 0)},type:`button`,children:`confirm`}),(0,I.jsx)(E,{className:`min-h-[24px] bg-transparent px-1.5 py-0 text-[10px]`,disabled:c.isPending,onClick:()=>r(void 0),type:`button`,children:`cancel`})]})]})}):null,i?(0,I.jsx)(ni,{actionLabel:ei(i.id),defaultReason:i.id===`run-revision`?e.revisionRun?.reason??``:``,isPending:c.isPending,onCancel:()=>a(void 0),onConfirm:e=>{c.mutate({preparedDiffId:t,recoveryAction:i.id,reason:e.reason||void 0,runRevisionNow:i.id===`request-revision`?e.runRevisionNow:void 0}),a(void 0)},requireReason:i.id===`request-revision`||!e.revisionRun?.reason,showRunNow:i.id===`request-revision`},`${i.id}:${e.revisionRun?.reason??``}`):null]})}function $r(e){return[`inspect-worktree`,`retry-after-new-commit`,`rebase-resync-worktree`,`retry-verify`,`retry-push`,`retry-comment`,`request-revision`,`run-revision`,`cleanup-worktree`].includes(e)}function ei(e){return e===`inspect-worktree`?`inspect`:e===`retry-after-new-commit`?`new commit`:e===`rebase-resync-worktree`?`resync`:e===`retry-verify`?`verify`:e===`retry-push`?`push`:e===`retry-comment`?`comment`:e===`request-revision`?`revise`:e===`run-revision`?`run revision`:e===`cleanup-worktree`?`cleanup`:e}function ti({approval:e,preparedDiff:t}){let n=h(),[r,i]=(0,F.useState)(!1),[a,o]=(0,F.useState)(e.source===`prepared-diff`&&!!t),s=P({mutationFn:t=>ve(e.id,t.decision,{reason:t.reason,runRevisionNow:t.runRevisionNow}),onSuccess(){n.invalidateQueries({queryKey:b.autopilotState}),n.invalidateQueries({queryKey:b.executionApprovals})}});return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-primary`,children:e.repoFullName?li(e.repoFullName,e.prNumber):`autopilot approval`}),(0,I.jsx)(x,{className:`border-accent text-accent`,children:e.risk})]}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-1 font-mono text-[10px] text-muted`,children:e.command}),(0,I.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{children:e.source}),(0,I.jsxs)(`span`,{className:`flex gap-1.5`,children:[t?(0,I.jsx)(E,{className:`min-h-[28px] bg-transparent px-2 py-1 text-[10px]`,onClick:()=>o(e=>!e),type:`button`,children:a?`hide diff`:`inspect diff`}):null,(0,I.jsx)(E,{className:`min-h-[28px] border-primary bg-transparent px-2 py-1 text-[10px] text-primary`,disabled:s.isPending,onClick:()=>s.mutate({decision:`approve`}),type:`button`,children:`approve`}),(0,I.jsx)(E,{className:`min-h-[28px] border-accent bg-transparent px-2 py-1 text-[10px] text-accent`,disabled:s.isPending,onClick:()=>{if(e.source===`prepared-diff`){i(!0);return}s.mutate({decision:`deny`})},type:`button`,children:e.source===`prepared-diff`?`revise`:`deny`})]})]}),s.error?(0,I.jsx)(`p`,{className:`mt-1 text-[10px] leading-4 text-accent`,children:k(s.error)}):null,s.data?(0,I.jsx)(`p`,{className:`mt-1 text-[10px] leading-4 text-muted`,children:s.data.message}):null,r?(0,I.jsx)(ni,{actionLabel:`revise`,isPending:s.isPending,onCancel:()=>i(!1),onConfirm:e=>{s.mutate({decision:`deny`,reason:e.reason||void 0,runRevisionNow:e.runRevisionNow}),i(!1)},requireReason:!0,showRunNow:!0}):null,t&&a?(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(M,{label:`Loading diff viewer.`}),children:(0,I.jsx)(Hr,{diff:t})})}):e.source===`prepared-diff`?(0,I.jsxs)(`p`,{className:`mt-2 border border-line bg-field px-2 py-1.5 text-[10px] leading-4 text-muted`,children:[`Prepared diff `,e.preparedDiffId??`unknown`,` is no longer in the retained diff list.`]}):null]})}function ni({actionLabel:e,defaultReason:t=``,isPending:n,onCancel:r,onConfirm:i,requireReason:a,showRunNow:o}){let[s,c]=(0,F.useState)(t),[l,u]=(0,F.useState)(!0),d=n||a&&(!o||l)&&!s.trim();return(0,I.jsxs)(`div`,{className:`mt-2 border border-accent/50 bg-field px-2 py-1.5 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`textarea`,{className:`min-h-[64px] w-full resize-y border border-line bg-panel px-2 py-1.5 text-[11px] leading-4 text-ink outline-none focus:border-accent`,onChange:e=>c(e.target.value),placeholder:`Revision note`,value:s}),o?(0,I.jsxs)(`label`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,I.jsx)(`input`,{checked:l,className:`accent-[var(--color-accent)]`,onChange:e=>u(e.target.checked),type:`checkbox`}),(0,I.jsx)(`span`,{children:`run revision now`})]}):null,(0,I.jsxs)(`div`,{className:`mt-1.5 flex justify-end gap-1.5`,children:[(0,I.jsx)(E,{className:`min-h-[24px] border-accent bg-transparent px-1.5 py-0 text-[10px] text-accent`,disabled:d,onClick:()=>i({reason:s.trim(),runRevisionNow:l}),type:`button`,children:e}),(0,I.jsx)(E,{className:`min-h-[24px] bg-transparent px-1.5 py-0 text-[10px]`,disabled:n,onClick:r,type:`button`,children:`cancel`})]})]})}function ri(e){let t=e.revisionRun;return t?.kiloTaskId?{id:t.kiloTaskId,title:t.title??`Revision ${e.title}`,prompt:``,repoId:e.repoId,repoFullName:e.repoFullName,worktreeId:e.worktreeId,lockId:null,cwd:t.cwd??e.localPath,mode:`draft-fix`,status:t.status??`running`,explicitUserRequest:!0,autoEnabled:!0,cliPath:`kilo`,args:[],pid:null,processStartedAt:null,rootSessionId:null,childSessionIds:[],rawLogPath:null,summary:t.reason,exitCode:null,error:null,createdAt:t.startedAt??e.updatedAt,updatedAt:e.updatedAt,completedAt:t.completedAt}:null}function ii({repoPolicies:e,state:t,watchPolicies:n}){return(0,I.jsxs)(`section`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`font-mono text-[10px] tracking-[0.12em] text-muted`,children:`POLICY`}),(0,I.jsx)(`p`,{className:`mt-1 text-[12px] text-ink`,children:t.modeLabels[t.policies.global.mode]})]}),(0,I.jsxs)(x,{children:[t.policies.global.limits.maxFilesChanged,` files`]})]}),(0,I.jsxs)(`div`,{className:`mt-2 grid grid-cols-2 gap-1.5 text-[11px]`,children:[e.map(e=>(0,I.jsx)(ai,{label:e.repoFullName,mode:e.mode},e.repoId)),n.map(e=>(0,I.jsx)(ai,{label:`${e.repoFullName}#${e.prNumber}`,mode:e.mode},e.watchId))]})]})}function ai({label:e,mode:t}){return(0,I.jsxs)(`div`,{className:`min-w-0 border border-line bg-panel px-2 py-1`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[10px] text-primary`,children:e}),(0,I.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted`,children:t})]})}function oi({check:e}){return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-primary`,children:e.workflow}),(0,I.jsx)(x,{className:`border-primary text-primary`,children:`running`})]}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-4 text-muted`,children:e.lastMessage})]})}function si({item:e}){return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-primary`,children:e.repoFullName?li(e.repoFullName,e.prNumber):e.title}),(0,I.jsx)(x,{className:e.level===`attention`?`border-accent text-accent`:``,children:e.type})]}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-4 text-muted`,children:e.message}),(0,I.jsx)(`div`,{className:`mt-1.5 flex justify-end font-mono text-[10px]`,children:(0,I.jsx)(Ar,{kind:`task`,label:`session`,linkedRepoId:e.repoId,linkedTaskId:e.id,summary:`${e.title}: ${e.message}`,title:`Activity ${e.title}`,uiMetadata:{source:`autopilot-activity`,activityId:e.id,type:e.type,repoFullName:e.repoFullName,prNumber:e.prNumber,level:e.level}})})]})}function ci(e){return e===`urgent`||e===`high`?`border-accent text-accent`:e===`normal`?`border-primary text-primary`:``}function li(e,t){return t?`${e}#${t}`:e}var ui={actionLimit:5},di={id:`briefing-panel`,title:`Briefing`,kind:`data`,defaultConfig:ui,parseConfig:e=>Fr(ui,e),Component(){let e=h(),[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(``),[a,o]=(0,F.useState)(``),[s,c]=(0,F.useState)(``),[l,u]=(0,F.useState)(!0),{data:p,error:m,isLoading:g}=d({queryKey:b.briefings,queryFn:or,refetchInterval:1e4});(0,F.useEffect)(()=>{!p?.profile||t||(i(p.profile.instructions),o(p.profile.schedule),c(p.profile.timezone),u(p.profile.enabled))},[p?.profile,t]);let _=P({mutationFn:()=>sr({instructions:r,schedule:a,timezone:s,enabled:l}),async onSuccess(t){if(!t.ok)throw Error(t.message);n(!1),await e.invalidateQueries({queryKey:b.briefings}),await e.invalidateQueries({queryKey:b.scheduledTasks})}}),y=P({mutationFn:()=>cr({profileId:`morning`,trigger:`dashboard`}),async onSuccess(t){if(!t.ok)throw Error(t.message);await e.invalidateQueries({queryKey:b.briefings}),await e.invalidateQueries({queryKey:b.chatSessions})}}),C=P({async mutationFn(){let e=p?.profile.sessionId??p?.latestRun?.sessionId;if(!e)throw Error(`Run the briefing once to create its conversation.`);return Nn(e)},onSuccess(t){if(!t.ok)throw Error(t.message);t.state&&e.setQueryData(b.neonSession,t.state),e.invalidateQueries({queryKey:b.chatSessions}),fi()}}),w=P({mutationFn:()=>lr(),async onSuccess(t){if(!t.ok)throw Error(t.message);await e.invalidateQueries({queryKey:b.briefings}),await e.invalidateQueries({queryKey:b.chatSessions})}});if(g)return(0,I.jsx)(S,{title:`Briefing loading`,detail:`Reading profile and run state.`});if(m||!p)return(0,I.jsx)(S,{title:`Briefing unavailable`,detail:k(m??`No briefing state returned.`)});let T=p.latestRun,ee=_.error??y.error??C.error??w.error,D=p.sessionStaleReasons.length>0;return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`header`,{className:`panel-header flex h-8 items-center justify-between border-b border-line px-3 font-mono text-[10.5px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:`text-primary`,children:`MORNING BRIEFING`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[p.unreadCount>0?(0,I.jsxs)(x,{className:`border-primary text-primary`,children:[p.unreadCount,` unread`]}):null,(0,I.jsx)(x,{children:T?.status??(p.profile.enabled?`scheduled`:`paused`)})]})]}),(0,I.jsx)(v,{className:`flex-1`,children:(0,I.jsxs)(`div`,{className:`space-y-3 p-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-line pb-2.5`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`font-mono text-[11px] text-ink`,children:p.profile.name}),(0,I.jsx)(`p`,{className:`mt-1 text-[10.5px] leading-4 text-muted`,children:p.profile.enabled?`${p.profile.schedule} · ${p.profile.timezone}`:`Automatic runs are paused.`}),(0,I.jsx)(`p`,{className:`mt-1 text-[10.5px] leading-4 text-muted`,children:T?`${T.status} · ${L(T.updatedAt)}`:`No conversational briefing has run yet.`})]}),T?(0,I.jsx)(x,{children:T.trigger}):null]}),t?(0,I.jsxs)(`form`,{className:`max-w-[75ch] space-y-2.5`,onSubmit:e=>{e.preventDefault(),_.mutate()},children:[(0,I.jsxs)(`label`,{className:`block font-mono text-[10px] text-muted`,htmlFor:`briefing-instructions`,children:[`Instructions`,(0,I.jsx)(f,{id:`briefing-instructions`,className:`mt-1 min-h-24 w-full border border-line bg-field px-2 py-1.5 font-sans text-[11px] leading-4 text-ink`,onChange:e=>i(e.target.value),value:r})]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,I.jsxs)(`label`,{className:`font-mono text-[10px] text-muted`,htmlFor:`briefing-schedule`,children:[`Cron schedule`,(0,I.jsx)(`input`,{id:`briefing-schedule`,className:`mt-1 h-7 w-full border border-line bg-field px-2 text-[11px] text-ink outline-none focus:border-primary`,onChange:e=>o(e.target.value),value:a})]}),(0,I.jsxs)(`label`,{className:`font-mono text-[10px] text-muted`,htmlFor:`briefing-timezone`,children:[`Timezone`,(0,I.jsx)(`input`,{id:`briefing-timezone`,className:`mt-1 h-7 w-full border border-line bg-field px-2 text-[11px] text-ink outline-none focus:border-primary`,onChange:e=>c(e.target.value),value:s})]})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`input`,{checked:l,onChange:e=>u(e.target.checked),type:`checkbox`}),`Run automatically`]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(E,{disabled:_.isPending,type:`submit`,children:_.isPending?`saving`:`save`}),(0,I.jsx)(E,{onClick:()=>n(!1),type:`button`,children:`cancel`})]})]}):(0,I.jsx)(`p`,{className:`max-w-[75ch] whitespace-normal break-words text-[11px] leading-[1.55] text-muted`,children:p.profile.instructions}),ee?(0,I.jsx)(`p`,{className:`border border-accent/60 px-2 py-1.5 text-[10.5px] leading-4 text-accent`,children:k(ee)}):null,D?(0,I.jsxs)(`div`,{className:`border border-accent/60 px-2 py-1.5 text-[10.5px] leading-4 text-accent`,children:[(0,I.jsx)(`p`,{children:p.sessionStaleReasons[0]?.message}),(0,I.jsx)(E,{className:`mt-2`,disabled:w.isPending,onClick:()=>w.mutate(),type:`button`,children:w.isPending?`starting fresh`:`start fresh conversation`})]}):null,t?null:(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2 border-t border-line pt-2.5`,children:[(0,I.jsx)(E,{disabled:C.isPending||!p.profile.sessionId&&!T,onClick:()=>C.mutate(),type:`button`,children:`open conversation`}),(0,I.jsx)(E,{disabled:y.isPending||D,onClick:()=>y.mutate(),type:`button`,children:y.isPending?`queueing`:`run now`}),(0,I.jsx)(E,{onClick:()=>n(!0),type:`button`,children:`edit instructions`})]})]})})]})}};function fi(){window.dispatchEvent(new CustomEvent(`neondeck:focus-chat`,{detail:{pluginId:`flue-chat`}}))}var pi={id:`clock-status`,title:`Clock and status`,kind:`status`,defaultConfig:{},Component(){let[e,t]=(0,F.useState)(()=>new Date);return(0,F.useEffect)(()=>{let e=window.setInterval(()=>t(new Date),1e3);return()=>window.clearInterval(e)},[]),(0,I.jsxs)(`div`,{className:`flex h-full items-center justify-between px-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`font-mono text-2xl font-semibold tabular-nums text-ink`,children:e.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}),(0,I.jsx)(`p`,{className:`text-xs text-muted`,children:e.toLocaleDateString([],{weekday:`short`,month:`short`,day:`numeric`})})]}),(0,I.jsxs)(`div`,{className:`text-right`,children:[(0,I.jsx)(`p`,{className:`text-sm font-semibold text-ink`,children:`neondeck`}),(0,I.jsx)(`p`,{className:`text-xs text-muted`,children:`neondeck.dev · Flue`})]})]})}};function mi({activeSessionId:e,disabled:t,onSelect:n,sessions:r}){let i=r.filter(e=>e.pinned&&!e.archivedAt),a=r.filter(e=>!e.pinned&&!e.archivedAt),o=r.filter(e=>e.archivedAt);return(0,I.jsxs)(`select`,{"aria-label":`Chat session`,className:`h-5 max-w-[22ch] border border-line bg-field px-1 font-mono text-[10.5px] tracking-normal text-ink outline-none hover:border-primary`,disabled:t||r.length===0,onChange:e=>n(e.target.value),value:e??``,children:[e?null:(0,I.jsx)(`option`,{value:``,children:`Loading`}),(0,I.jsx)(hi,{label:`Pinned`,sessions:i}),(0,I.jsx)(hi,{label:`Recent`,sessions:a}),(0,I.jsx)(hi,{label:`Archived`,sessions:o})]})}function hi({label:e,sessions:t}){return t.length===0?null:(0,I.jsx)(`optgroup`,{label:e,children:t.map(e=>(0,I.jsx)(`option`,{value:e.id,children:gi(e)},e.id))})}function gi(e){let t=[e.title];return e.kind!==`general`&&t.push(e.kind),e.staleReasons.length>0&&t.push(`stale`),e.archivedAt&&t.push(`archived`),t.join(` · `)}function _i(e){return vi(xi(e)?.document)}function vi(e){let t=xi(e);if(!t||!Si(t.eyebrow)||typeof t.title!=`string`||!Si(t.summary)||typeof t.generatedAt!=`string`||!Array.isArray(t.sections))return null;let n=t.sections.map(yi);return n.some(e=>e===null)?null:{eyebrow:t.eyebrow,title:t.title,summary:t.summary,generatedAt:t.generatedAt,sections:n}}function yi(e){let t=xi(e);if(!t||typeof t.title!=`string`||!Si(t.body)||!Array.isArray(t.items))return null;let n=t.items.map(bi);return n.some(e=>e===null)?null:{title:t.title,body:t.body,items:n}}function bi(e){let t=xi(e);return!t||!Si(t.label)||typeof t.value!=`string`?null:{label:t.label,value:t.value}}function xi(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:null}function Si(e){return e===null||typeof e==`string`}function Ci(e){let t=new DOMParser().parseFromString(e,`text/html`).querySelector(`main`),n=Ei(t,`HEADER`),r=Di(n?.querySelector(`h1`)),i=Di(n?.querySelector(`.meta`))?.replace(/^generated\s+/iu,``);return!t||!n||!r||!i?null:{eyebrow:Di(n.querySelector(`.eyebrow`)),title:r,summary:Di(n.querySelector(`.summary`)),generatedAt:i,sections:[...t.children].filter(e=>e.tagName===`SECTION`).map(wi).filter(e=>e!==null)}}function wi(e){let t=Di(Ei(e,`H2`));if(!t)return null;let n=Di(Ei(e,`P`)),r=Ei(e,`DL`);return{title:t,body:n,items:r?Ti(r):[]}}function Ti(e){let t=[],n=[...e.children];for(let e=0;e<n.length;e+=1){let r=n[e],i=n[e+1];if(r?.tagName!==`DT`||i?.tagName!==`DD`)continue;let a=Di(i);a&&(t.push({label:Di(r),value:a}),e+=1)}return t}function Ei(e,t){return e?[...e.children].find(e=>e.tagName===t)??null:null}function Di(e){return e?.textContent?.trim()||null}function Oi({initialReportIndex:e=0,onClose:t,reportIds:n,reviewLabel:r,reviewUrl:i}){let a=(0,F.useRef)(null),[o,s]=(0,F.useState)(e),[c,l]=(0,F.useState)(0),[u,d]=(0,F.useState)(null);(0,F.useEffect)(()=>{s(Math.min(e,n.length-1))},[e,n.length]),(0,F.useEffect)(()=>{let e=a.current,t=document.activeElement;if(e)return e.open||e.showModal(),()=>{e.open&&e.close(),t instanceof HTMLElement&&t.isConnected&&t.focus()}},[]);let f=n[Math.max(0,o)]??n[0]??null,p=f?`${f}:${c}`:null;if((0,F.useEffect)(()=>{if(!f||!p)return;let e=new AbortController;d({key:p,status:`loading`});let t=window.setTimeout(()=>{d(e=>e?.key===p&&e.status===`loading`?{key:p,status:`stalled`}:e)},6e3);return pr(f,{signal:e.signal}).then(async t=>{let n=_i(t.item?.summary);if(n||=Ci(await mr(f,{signal:e.signal})),!n)throw Error(`This report could not be converted for display.`);d({document:n,key:p,status:`loaded`})}).catch(t=>{e.signal.aborted||d({key:p,message:t instanceof Error?t.message:String(t),status:`error`})}),()=>{e.abort(),window.clearTimeout(t)}},[p,f]),!f||!p)return null;let m=`/reports/${encodeURIComponent(f)}`,h=u?.key===p?u:{key:p,status:`loading`},g=()=>window.open(m,`neondeck-pr-report-${f}`,`popup,width=1180,height=860`);return(0,ur.createPortal)((0,I.jsx)(`dialog`,{"aria-label":`Review artifacts for ${r}`,className:`fixed inset-0 z-[100] m-0 flex h-full max-h-none w-full max-w-none items-center justify-center border-0 bg-black/80 p-3 sm:p-6`,onCancel:e=>{e.preventDefault(),t()},ref:a,children:(0,I.jsxs)(`section`,{className:`flex h-[min(92vh,980px)] w-[min(96vw,1440px)] flex-col border border-line bg-panel`,children:[(0,I.jsxs)(`header`,{className:`flex min-h-11 flex-wrap items-center justify-between gap-2 border-b border-line px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`font-mono text-[10px] tracking-[0.12em] text-primary`,children:`PR REVIEW ARTIFACTS`}),(0,I.jsx)(`p`,{className:`truncate text-[11px] text-ink`,children:r})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 font-mono text-[10px]`,children:[n.map((e,t)=>(0,I.jsx)(`button`,{"aria-pressed":o===t,className:o===t?`border border-primary px-2 py-1 text-primary focus:outline-none focus:ring-1 focus:ring-primary`:`border border-line px-2 py-1 text-muted hover:border-primary hover:text-primary focus:outline-none focus:ring-1 focus:ring-primary`,onClick:()=>s(t),type:`button`,children:ji(t)},e)),(0,I.jsx)(`button`,{className:`border border-line px-2 py-1 text-muted hover:border-primary hover:text-primary focus:outline-none focus:ring-1 focus:ring-primary`,onClick:g,type:`button`,children:`pop out`}),(0,I.jsx)(`a`,{className:`border border-line px-2 py-1 text-muted hover:border-primary hover:text-primary focus:outline-none focus:ring-1 focus:ring-primary`,href:i,rel:`noreferrer`,target:`_blank`,children:`workbench`}),(0,I.jsx)(`button`,{autoFocus:!0,className:`border border-primary px-2 py-1 text-primary focus:outline-none focus:ring-1 focus:ring-primary`,onClick:t,type:`button`,children:`close`})]})]}),(0,I.jsx)(`div`,{className:`relative min-h-0 flex-1 bg-canvas`,children:h.status===`loaded`?(0,I.jsx)(ki,{document:h.document}):(0,I.jsx)(Ai,{label:ji(o),message:h.status===`error`?h.message:void 0,onPopOut:g,onRetry:()=>l(e=>e+1),status:h.status})})]})}),document.body)}function ki({document:e}){return(0,I.jsx)(`article`,{className:`h-full overflow-y-auto bg-bg px-4 py-5 text-ink sm:px-7 sm:py-7`,children:(0,I.jsxs)(`div`,{className:`mx-auto max-w-[980px]`,children:[(0,I.jsxs)(`header`,{className:`border border-line bg-panel px-5 py-4`,children:[e.eyebrow?(0,I.jsx)(`p`,{className:`font-mono text-[10px] tracking-[0.12em] text-primary`,children:e.eyebrow}):null,(0,I.jsx)(`h1`,{className:`mt-1 font-display text-xl font-semibold leading-tight`,children:e.title}),e.summary?(0,I.jsx)(`p`,{className:`mt-2 max-w-[74ch] text-[13px] leading-5 text-muted`,children:e.summary}):null,(0,I.jsxs)(`p`,{className:`mt-2 font-mono text-[10px] text-muted`,children:[`generated`,` `,(0,I.jsx)(`time`,{dateTime:e.generatedAt,children:e.generatedAt})]})]}),e.sections.map((e,t)=>(0,I.jsxs)(`section`,{className:`mt-3 border border-line bg-panel px-5 py-4`,children:[(0,I.jsx)(`h2`,{className:`font-mono text-xs tracking-[0.06em] text-primary`,children:e.title}),e.body?(0,I.jsx)(`p`,{className:`mt-2 max-w-[74ch] whitespace-pre-wrap text-[13px] leading-5`,children:e.body}):null,e.items.length>0?(0,I.jsx)(`dl`,{className:`mt-3 grid grid-cols-1 gap-x-4 gap-y-2 sm:grid-cols-[minmax(120px,0.34fr)_1fr]`,children:e.items.map((e,t)=>(0,I.jsxs)(`div`,{className:`contents`,children:[(0,I.jsx)(`dt`,{className:`min-w-0 font-mono text-[10px] text-muted [overflow-wrap:anywhere]`,children:e.label??`item`}),(0,I.jsx)(`dd`,{className:`min-w-0 whitespace-pre-wrap break-words text-[13px] leading-5`,children:e.value})]},`${e.label}:${t}`))}):null]},`${e.title}:${t}`))]})})}function Ai({label:e,message:t,onPopOut:n,onRetry:r,status:i}){let a=i!==`loading`;return(0,I.jsxs)(`output`,{"aria-live":`polite`,className:`absolute inset-0 flex flex-col items-center justify-center gap-2 bg-canvas px-4 text-center`,children:[(0,I.jsx)(`div`,{className:`miami-accent h-1 w-12`}),(0,I.jsx)(`p`,{className:`text-[13px] font-semibold text-ink`,children:i===`error`?`Could not load ${e}`:i===`stalled`?`${e} is taking longer than expected`:`Loading ${e}`}),(0,I.jsx)(`p`,{className:`max-w-[44ch] text-xs leading-5 text-muted`,children:i===`error`?t:i===`stalled`?`The local report has not finished loading. Retry it here or open it in a separate window.`:`Loading the structured local review report.`}),a?(0,I.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 font-mono text-[10px]`,children:[(0,I.jsx)(`button`,{className:`border border-primary px-2 py-1 text-primary focus:outline-none focus:ring-1 focus:ring-primary`,onClick:r,type:`button`,children:`retry`}),(0,I.jsx)(`button`,{className:`border border-line px-2 py-1 text-muted hover:border-primary hover:text-primary focus:outline-none focus:ring-1 focus:ring-primary`,onClick:n,type:`button`,children:`pop out`})]}):null]})}function ji(e){return e===0?`overview`:e===1?`issues`:`report ${e+1}`}function Mi({event:e,onAsk:t}){let n=Fi(e.result);return n?(0,I.jsx)(Ni,{fallbackStatus:e.status,reviewId:n}):(0,I.jsxs)(`section`,{className:`border border-line bg-soft px-3 py-2 font-mono text-[10.5px] leading-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,I.jsx)(`span`,{className:e.result?.ok===!1||e.status===`failed`?`min-w-0 truncate text-accent`:`min-w-0 truncate text-primary`,children:e.input}),(0,I.jsx)(x,{children:e.status})]}),e.result?(0,I.jsxs)(`div`,{className:`mt-1 flex items-start justify-between gap-3 text-muted`,children:[(0,I.jsx)(`p`,{className:`min-w-0`,children:e.result.message}),t?(0,I.jsx)(E,{className:`min-h-[24px] shrink-0 bg-transparent px-1.5 py-0 text-[10px]`,onClick:t,type:`button`,children:`ask Neon`}):null]}):(0,I.jsx)(`p`,{className:`mt-1 text-muted`,children:`Command workflow is running.`})]})}function Ni({fallbackStatus:e,reviewId:t}){let n=h(),{data:r,error:i}=d({queryKey:[`pr-review`,t],queryFn:async()=>(await de(t)).review});(0,F.useEffect)(()=>a(e=>{e.review.id===t&&n.setQueryData([`pr-review`,t],e.review)},void 0,()=>{n.invalidateQueries({queryKey:[`pr-review`,t]})}),[n,t]);let o=r,s=o?.status??e;return(0,I.jsxs)(`section`,{className:`border border-line bg-soft px-3 py-2 text-[10.5px] leading-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 font-mono`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate text-primary`,children:o?`${o.repoFullName}#${o.prNumber}`:`PR review`}),(0,I.jsx)(x,{children:s})]}),i?(0,I.jsx)(`p`,{className:`mt-1 font-mono text-accent`,children:k(i)}):o?(0,I.jsx)(Pi,{review:o}):(0,I.jsx)(`p`,{className:`mt-1 text-muted`,children:`Hydrating the durable review record.`})]})}function Pi({review:e}){let[t,n]=(0,F.useState)(null);return(0,I.jsxs)(`div`,{className:`mt-1.5`,children:[(0,I.jsx)(`p`,{className:`text-muted`,children:e.status===`reviewing`?`Neon is reviewing the pull request.`:e.status===`submitting`?`Submitting the review to GitHub…`:e.status===`ready`?`${e.findingCount} findings · ${e.seededCount} local drafts${e.reportOnlyCount?` · ${e.reportOnlyCount} report-only`:``}`:e.status===`submitted`?`Submitted as ${e.verdict??`review`}.`:e.failureMessage||`Review failed.`}),e.status===`ready`?(0,I.jsx)(`p`,{className:`mt-1 text-muted`,children:e.trustBoundary}):null,(0,I.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap justify-end gap-1.5 font-mono text-[10px]`,children:[e.reportIds.map((e,t)=>(0,I.jsx)(`button`,{className:`border border-line px-1.5 py-1 text-muted hover:border-primary hover:text-primary focus:outline-none focus:ring-1 focus:ring-primary`,onClick:()=>n(t),type:`button`,children:t===0?`overview`:t===1?`issues`:`report ${t+1}`},e)),(e.status===`ready`||e.status===`submitted`)&&(0,I.jsx)(`a`,{className:`border border-primary px-2 py-1 text-primary focus:outline-none focus:ring-1 focus:ring-primary`,href:e.reviewUrl,rel:`noreferrer`,target:`_blank`,children:`open review`})]}),t===null?null:(0,I.jsx)(Oi,{initialReportIndex:t,onClose:()=>n(null),reportIds:e.reportIds,reviewLabel:`${e.repoFullName}#${e.prNumber}`,reviewUrl:e.reviewUrl})]})}function Fi(e){if(!e||e.command!==`review-pr`||!e.data||typeof e.data!=`object`||Array.isArray(e.data))return null;let t=e.data.reviewId;return typeof t==`string`&&t.trim()?t:null}function R({activeCommand:e,activeCommandIndex:t,commands:n,onSelect:r,open:i}){return i?(0,I.jsx)(`div`,{"aria-label":`Slash commands`,className:`command-typeahead absolute right-0 bottom-full left-0 z-10 border-t border-line bg-canvas font-mono`,id:`flue-command-typeahead`,children:n.slice(0,6).map((n,i)=>(0,I.jsxs)(`button`,{"aria-current":e?.command===n.command,className:`command-typeahead-option flex w-full items-center gap-4 px-[18px] py-1.5 text-left`,"data-active":i===t,onMouseDown:e=>e.preventDefault(),onClick:()=>r(n),type:`button`,children:[(0,I.jsx)(`span`,{className:`w-[18ch] shrink-0 truncate text-[13px] font-semibold text-ink`,children:n.command}),(0,I.jsx)(`span`,{className:`min-w-0 truncate text-[12px] text-muted`,children:n.description??n.label})]},n.command))}):null}function Ii({activity:e}){let t=e.resolvedAt?`resolved`:e.readAt?`read`:`unread`;return(0,I.jsxs)(`section`,{"aria-label":`Watch activity: ${e.title}`,className:`border-y border-line bg-field px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 font-mono text-[9.5px] leading-4 text-muted`,children:[(0,I.jsx)(`span`,{className:Li(e.level),children:`WATCH ACTIVITY · SYSTEM RECORD`}),(0,I.jsx)(`span`,{className:`shrink-0`,children:L(e.updatedAt)})]}),(0,I.jsxs)(`div`,{className:`mt-1 flex items-start justify-between gap-3`,children:[(0,I.jsx)(`p`,{className:`text-[12px] font-medium leading-4 text-ink`,children:e.title}),(0,I.jsx)(x,{className:Ri(e.level),children:e.level})]}),(0,I.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-muted`,children:Mr(e)}),(0,I.jsxs)(`p`,{className:`mt-1 font-mono text-[9.5px] leading-4 text-muted`,children:[e.source??`local`,` · `,t,e.occurrenceCount>1?` · ×${e.occurrenceCount}`:``]})]})}function Li(e){return e===`attention`||e===`urgent`?`text-accent`:e===`ready`?`text-primary`:`text-violet`}function Ri(e){return e===`attention`||e===`urgent`?`border-accent text-accent`:e===`ready`?`border-primary text-primary`:`border-violet/60 text-violet`}var zi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Bi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vi={};function Hi(e,t){return((t||Vi).jsx?Bi:zi).test(e)}var Ui={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Wi=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
16
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(!(e.charAt(0)!=`/`||e.charAt(1)!=`*`)){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Gi=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(Wi());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Ki=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),qi=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Gi()),r=Ki();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Ji=Xi(`end`),Yi=Xi(`start`);function Xi(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Zi(e){let t=Yi(e),n=Ji(e);if(t&&n)return{start:t,end:n}}function Qi(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ea(e.position):`start`in e||`end`in e?ea(e):`line`in e||`column`in e?$i(e):``}function $i(e){return ta(e&&e.line)+`:`+ta(e&&e.column)}function ea(e){return $i(e&&e.start)+`-`+$i(e&&e.end)}function ta(e){return e&&typeof e==`number`?e:1}var z=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Qi(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};z.prototype.file=``,z.prototype.name=``,z.prototype.reason=``,z.prototype.message=``,z.prototype.stack=``,z.prototype.column=void 0,z.prototype.line=void 0,z.prototype.ancestors=void 0,z.prototype.cause=void 0,z.prototype.fatal=void 0,z.prototype.place=void 0,z.prototype.ruleId=void 0,z.prototype.source=void 0;var na=t(qi(),1),ra={}.hasOwnProperty,ia=new Map,aa=/[A-Z]/g,oa=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),sa=new Set([`td`,`th`]);function ca(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=ya(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=va(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?w:ne,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=la(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function la(e,t,n){if(t.type===`element`)return ua(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return da(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return pa(e,t,n);if(t.type===`mdxjsEsm`)return fa(e,t);if(t.type===`root`)return ma(e,t,n);if(t.type===`text`)return ha(e,t)}function ua(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=w,e.schema=i),e.ancestors.push(t);let a=Ta(e,t.tagName,!1),o=ba(e,t),s=Sa(e,t);return oa.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!D(e)})),ga(e,o,a,t),_a(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function da(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Ea(e,t.position)}function fa(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ea(e,t.position)}function pa(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=w,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Ta(e,t.name,!0),o=xa(e,t),s=Sa(e,t);return ga(e,o,a,t),_a(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ma(e,t,n){let r={};return _a(r,Sa(e,t)),e.create(t,e.Fragment,r,n)}function ha(e,t){return t.value}function ga(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function _a(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function va(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function ya(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Yi(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function ba(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&ra.call(t.properties,i)){let a=Ca(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&sa.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function xa(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Ea(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Ea(e,t.position);else a=r.value===null||r.value;n[i]=a}return n}function Sa(e,t){let n=[],r=-1,i=e.passKeys?new Map:ia;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=la(e,a,o);s!==void 0&&n.push(s)}return n}function Ca(e,t,n){let r=_(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?re(n):ee(n)),r.property===`style`){let t=typeof n==`object`?n:wa(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Da(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Ui[r.property]||r.property:r.attribute,n]}}function wa(e,t){try{return(0,na.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new z("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function Ta(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Hi(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Hi(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return ra.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ea(e)}function Ea(e,t){let n=new z("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function Da(e){let t={},n;for(n in e)ra.call(e,n)&&(t[Oa(n)]=e[n]);return t}function Oa(e){let t=e.replace(aa,ka);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function ka(e){return`-`+e.toLowerCase()}var Aa={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},ja={};function Ma(e,t){let n=t||ja;return Na(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Na(e,t,n){if(Fa(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Pa(e.children,t,n)}return Array.isArray(e)?Pa(e,t,n):``}function Pa(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Na(e[i],t,n);return r.join(``)}function Fa(e){return!!(e&&typeof e==`object`)}var Ia=document.createElement(`i`);function La(e){let t=`&`+e+`;`;Ia.innerHTML=t;let n=Ia.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Ra(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function za(e,t){return e.length>0?(Ra(e,e.length,0,t),e):t}var Ba={}.hasOwnProperty;function Va(e){let t={},n=-1;for(;++n<e.length;)Ha(t,e[n]);return t}function Ha(e,t){let n;for(n in t){let r=(Ba.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Ba.call(r,a)||(r[a]=[]);let e=i[a];Ua(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Ua(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Ra(e,0,0,r)}function Wa(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Ga(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Ka=to(/[A-Za-z]/),qa=to(/[\dA-Za-z]/),Ja=to(/[#-'*+\--9=?A-Z^-~]/);function Ya(e){return e!==null&&(e<32||e===127)}var Xa=to(/\d/),Za=to(/[\dA-Fa-f]/),Qa=to(/[!-/:-@[-`{-~]/);function B(e){return e!==null&&e<-2}function V(e){return e!==null&&(e<0||e===32)}function H(e){return e===-2||e===-1||e===32}var $a=to(/\p{P}|\p{S}/u),eo=to(/\s/);function to(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function no(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&qa(e.charCodeAt(n+1))&&qa(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function U(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return H(r)?(e.enter(n),s(r)):t(r)}function s(r){return H(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var ro={tokenize:io};function io(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),U(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return B(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var ao={tokenize:so},oo={tokenize:co};function so(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Ra(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(oo,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(oo,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return B(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Ra(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function co(e,t,n){return U(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function W(e){if(e===null||V(e)||eo(e))return 1;if($a(e))return 2}function G(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var lo={name:`attention`,resolveAll:uo,tokenize:fo};function uo(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};po(d,-c),po(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=za(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=za(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=za(l,G(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=za(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=za(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Ra(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function fo(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=W(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=W(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function po(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var mo={name:`autolink`,tokenize:ho};function ho(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Ka(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||qa(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||qa(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Ya(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Ja(t)?(e.consume(t),l):n(t)}function u(e){return qa(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||qa(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var go={partial:!0,tokenize:_o};function _o(e,t,n){return r;function r(t){return H(t)?U(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||B(e)?t(e):n(e)}}var vo={continuation:{tokenize:bo},exit:xo,name:`blockQuote`,tokenize:yo};function yo(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return H(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function bo(e,t,n){let r=this;return i;function i(t){return H(t)?U(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(vo,t,n)(r)}}function xo(e){e.exit(`blockQuote`)}var So={name:`characterEscape`,tokenize:Co};function Co(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Qa(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var wo={name:`characterReference`,tokenize:To};function To(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=qa,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Za,u):(e.enter(`characterReferenceValue`),a=7,o=Xa,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===qa&&!La(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Eo={partial:!0,tokenize:ko},Do={concrete:!0,name:`codeFenced`,tokenize:Oo};function Oo(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),H(t)?U(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||B(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Eo,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):H(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),U(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||B(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&H(t)?U(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||B(t)?e.check(Eo,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||B(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),H(t)?U(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),H(t)?U(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||B(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function ko(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Ao={name:`codeIndented`,tokenize:Mo},jo={partial:!0,tokenize:No};function Mo(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),U(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):B(t)?e.attempt(jo,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||B(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function No(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):U(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):B(e)?i(e):n(e)}}var Po={name:`codeText`,previous:Io,resolve:Fo,tokenize:Lo};function Fo(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Io(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Lo(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||B(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Ro=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&zo(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),zo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),zo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);zo(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);zo(this.left,t.reverse())}}};function zo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Bo(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Ro(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Vo(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Ra(e,0,1/0,u.slice(0)),!l}function Vo(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Ho={resolve:Wo,tokenize:Go},Uo={partial:!0,tokenize:Ko};function Wo(e){return Bo(e),e}function Go(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):B(t)?e.check(Uo,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Ko(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),U(e,a,`linePrefix`)}function a(i){if(i===null||B(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function qo(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Ya(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||B(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||V(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Ya(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Jo(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):B(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||B(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!H(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Yo(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),U(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||B(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Xo(e,t){let n;return r;function r(i){return B(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):H(i)?U(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Zo={name:`definition`,tokenize:$o},Qo={partial:!0,tokenize:es};function $o(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Jo.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Ga(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return V(t)?Xo(e,l)(t):l(t)}function l(t){return qo(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Qo,d,d)(t)}function d(t){return H(t)?U(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||B(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function es(e,t,n){return r;function r(t){return V(t)?Xo(e,i)(t):n(t)}function i(t){return Yo(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return H(t)?U(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||B(e)?t(e):n(e)}}var ts={name:`hardBreakEscape`,tokenize:ns};function ns(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return B(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var rs={name:`headingAtx`,resolve:is,tokenize:as};function is(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Ra(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function as(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||V(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||B(n)?(e.exit(`atxHeading`),t(n)):H(n)?U(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||V(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var os=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),ss=[`pre`,`script`,`style`,`textarea`],cs={concrete:!0,name:`htmlFlow`,resolveTo:ds,tokenize:fs},ls={partial:!0,tokenize:ms},us={partial:!0,tokenize:ps};function ds(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function fs(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:j):Ka(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Ka(a)?(e.consume(a),i=4,r.interrupt?t:j):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:j):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return Ka(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||V(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ss.includes(l)?(i=1,r.interrupt?t(s):D(s)):os.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||qa(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return H(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Ka(t)?(e.consume(t),b):H(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||qa(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):H(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):H(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||B(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||V(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||H(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||B(t)?D(t):H(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),ie):t===60&&i===1?(e.consume(t),O):t===62&&i===4?(e.consume(t),ae):t===63&&i===3?(e.consume(t),j):t===93&&i===5?(e.consume(t),A):B(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(ls,M,te)(t)):t===null||B(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(us,ne,M)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||B(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function ie(t){return t===45?(e.consume(t),j):D(t)}function O(t){return t===47?(e.consume(t),o=``,k):D(t)}function k(t){if(t===62){let n=o.toLowerCase();return ss.includes(n)?(e.consume(t),ae):D(t)}return Ka(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),k):D(t)}function A(t){return t===93?(e.consume(t),j):D(t)}function j(t){return t===62?(e.consume(t),ae):t===45&&i===2?(e.consume(t),j):D(t)}function ae(t){return t===null||B(t)?(e.exit(`htmlFlowData`),M(t)):(e.consume(t),ae)}function M(n){return e.exit(`htmlFlow`),t(n)}}function ps(e,t,n){let r=this;return i;function i(t){return B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function ms(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(go,t,n)}}var hs={name:`htmlText`,tokenize:gs};function gs(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Ka(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Ka(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):B(t)?(o=d,O(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ie(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):B(t)?(o=h,O(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ie(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ie(t):B(t)?(o=v,O(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):B(t)?(o=y,O(t)):(e.consume(t),y)}function b(e){return e===62?ie(e):y(e)}function x(t){return Ka(t)?(e.consume(t),S):n(t)}function S(t){return t===45||qa(t)?(e.consume(t),S):C(t)}function C(t){return B(t)?(o=C,O(t)):H(t)?(e.consume(t),C):ie(t)}function w(t){return t===45||qa(t)?(e.consume(t),w):t===47||t===62||V(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ie):t===58||t===95||Ka(t)?(e.consume(t),E):B(t)?(o=T,O(t)):H(t)?(e.consume(t),T):ie(t)}function E(t){return t===45||t===46||t===58||t===95||qa(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):B(t)?(o=ee,O(t)):H(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):B(t)?(o=D,O(t)):H(t)?(e.consume(t),D):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):B(t)?(o=te,O(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||V(t)?T(t):(e.consume(t),ne)}function re(e){return e===47||e===62||V(e)?T(e):n(e)}function ie(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function O(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),k}function k(t){return H(t)?U(e,A,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):A(t)}function A(t){return e.enter(`htmlTextData`),o(t)}}var _s={name:`labelEnd`,resolveAll:xs,resolveTo:Ss,tokenize:Cs},vs={tokenize:ws},ys={tokenize:Ts},bs={tokenize:Es};function xs(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Ra(e,0,e.length,n),e}function Ss(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=za(s,e.slice(a+1,a+r+3)),s=za(s,[[`enter`,u,t]]),s=za(s,G(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=za(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=za(s,e.slice(o+1)),s=za(s,[[`exit`,c,t]]),Ra(e,a,e.length,s),e}function Cs(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Ga(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(vs,u,o?u:d)(t):t===91?e.attempt(ys,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(bs,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function ws(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return V(t)?Xo(e,a)(t):a(t)}function a(t){return t===41?u(t):qo(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return V(t)?Xo(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Yo(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return V(t)?Xo(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Ts(e,t,n){let r=this;return i;function i(t){return Jo.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Ga(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Es(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Ds={name:`labelStartImage`,resolveAll:_s.resolveAll,tokenize:Os};function Os(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var ks={name:`labelStartLink`,resolveAll:_s.resolveAll,tokenize:As};function As(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var js={name:`lineEnding`,tokenize:Ms};function Ms(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),U(e,t,`linePrefix`)}}var Ns={name:`thematicBreak`,tokenize:Ps};function Ps(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||B(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),H(t)?U(e,s,`whitespace`)(t):s(t))}}var Fs={continuation:{tokenize:zs},exit:Vs,name:`list`,tokenize:Rs},Is={partial:!0,tokenize:Hs},Ls={partial:!0,tokenize:Bs};function Rs(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Xa(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Ns,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Xa(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(go,r.interrupt?n:u,e.attempt(Is,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return H(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function zs(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(go,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,U(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!H(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ls,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,U(e,e.attempt(Fs,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Bs(e,t,n){let r=this;return U(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Vs(e){e.exit(this.containerState.type)}function Hs(e,t,n){let r=this;return U(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!H(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Us={name:`setextUnderline`,resolveTo:Ws,tokenize:Gs};function Ws(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Gs(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),H(t)?U(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||B(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Ks={tokenize:qs};function qs(e){let t=this,n=e.attempt(go,r,e.attempt(this.parser.constructs.flowInitial,i,U(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ho,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Js={resolveAll:Qs()},Ys=Zs(`string`),Xs=Zs(`text`);function Zs(e){return{resolveAll:Qs(e===`text`?$s:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Qs(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function $s(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var ec=e({attentionMarkers:()=>cc,contentInitial:()=>nc,disable:()=>lc,document:()=>tc,flow:()=>ic,flowInitial:()=>rc,insideSpan:()=>sc,string:()=>ac,text:()=>oc}),tc={42:Fs,43:Fs,45:Fs,48:Fs,49:Fs,50:Fs,51:Fs,52:Fs,53:Fs,54:Fs,55:Fs,56:Fs,57:Fs,62:vo},nc={91:Zo},rc={[-2]:Ao,[-1]:Ao,32:Ao},ic={35:rs,42:Ns,45:[Us,Ns],60:cs,61:Us,95:Ns,96:Do,126:Do},ac={38:wo,92:So},oc={[-5]:js,[-4]:js,[-3]:js,33:Ds,38:wo,42:lo,60:[mo,hs],91:ks,92:[ts,So],93:_s,95:lo,96:Po},sc={null:[lo,Js]},cc={null:[42,95]},lc={null:[]};function uc(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=za(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=G(a,l.events,l),l.events):[]}function f(e,t){return fc(p(e),t)}function p(e){return dc(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){B(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Ra(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function dc(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function fc(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
17
+ `;break;case-3:o=`\r
18
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function pc(e){let t={constructs:Va([ec,...(e||{}).extensions||[]]),content:n(ro),defined:[],document:n(ao),flow:n(Ks),lazy:{},string:n(Ys),text:n(Xs)};return t;function n(e){return n;function n(n){return uc(t,e,n)}}}function mc(e){for(;!Bo(e););return e}var hc=/[\0\t\n\r]/g;function gc(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(hc.lastIndex=u,c=hc.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var _c=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function vc(e){return e.replace(_c,yc)}function yc(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Wa(n.slice(t?2:1),t?16:10)}return La(n)||e}var bc={}.hasOwnProperty;function xc(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Sc(n)(mc(pc(n).document().write(gc()(e,t,!0))))}function Sc(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(be),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ge),blockQuote:a(P),characterEscape:T,characterReference:T,codeFenced:a(fe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(fe,o),codeText:a(pe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(me),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(he),hardBreakEscape:a(_e),hardBreakTrailing:a(_e),htmlFlow:a(ve,o),htmlFlowData:T,htmlText:a(ve,o),htmlTextData:T,image:a(ye),label:o,link:a(be),listItem:a(F),listItemValue:f,listOrdered:a(xe,d),listUnordered:a(xe),paragraph:a(Se),reference:oe,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ge),strong:a(Ce),thematicBreak:a(Te)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:N,characterReferenceMarkerNumeric:N,characterReferenceValue:ce,characterReference:le,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(re),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(ne),htmlTextData:E,image:c(O),label:A,labelText:k,lineEnding:ee,link:c(ie),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:j,resourceTitleString:ae,resource:M,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};wc(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];bc.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Ec).call(a,void 0,e[0])}for(r.position={start:Cc(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Cc(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Cc(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Ec).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Qi({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Cc(e.end)}function u(){return Ma(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ga(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=we(),n.position={start:Cc(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Cc(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Cc(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function k(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=vc(t),n.identifier=Ga(t).toLowerCase()}function A(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function M(){this.data.inReference=void 0}function oe(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ga(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function N(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Wa(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=La(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=Cc(e.end)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function P(){return{type:`blockquote`,children:[]}}function fe(){return{type:`code`,lang:null,meta:null,value:``}}function pe(){return{type:`inlineCode`,value:``}}function me(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function he(){return{type:`emphasis`,children:[]}}function ge(){return{type:`heading`,depth:0,children:[]}}function _e(){return{type:`break`}}function ve(){return{type:`html`,value:``}}function ye(){return{type:`image`,title:null,url:``,alt:null}}function be(){return{type:`link`,title:null,url:``,children:[]}}function xe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function F(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Se(){return{type:`paragraph`,children:[]}}function Ce(){return{type:`strong`,children:[]}}function we(){return{type:`text`,value:``}}function Te(){return{type:`thematicBreak`}}}function Cc(e){return{line:e.line,column:e.column,offset:e.offset}}function wc(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?wc(e,r):Tc(e,r)}}function Tc(e,t){let n;for(n in t)if(bc.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Ec(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Qi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qi({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Qi({start:t.start,end:t.end})+`) is still open`)}function Dc(e){let t=this;t.parser=n;function n(n){return xc(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Oc(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function kc(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
19
+ `}]}function Ac(e,t){let n=t.value?t.value+`
20
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function jc(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mc(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nc(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=no(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Pc(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fc(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ic(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Lc(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ic(e,t);let i={src:no(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Rc(e,t){let n={src:no(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function zc(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Bc(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ic(e,t);let i={href:no(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Vc(e,t){let n={href:no(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Hc(e,t,n){let r=e.all(t),i=n?Uc(n):Wc(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
21
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
22
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Uc(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Wc(n[r])}return t}function Wc(e){return e.spread??e.children.length>1}function Gc(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Kc(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qc(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Jc(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yc(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Yi(t.children[1]),o=Ji(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Xc(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Zc(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Qc=9,$c=32;function el(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(tl(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(tl(t.slice(i),i>0,!1)),a.join(``)}function tl(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Qc||t===$c;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Qc||t===$c;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function nl(e,t){let n={type:`text`,value:el(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function rl(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var il={blockquote:Oc,break:kc,code:Ac,delete:jc,emphasis:Mc,footnoteReference:Nc,heading:Pc,html:Fc,imageReference:Lc,image:Rc,inlineCode:zc,linkReference:Bc,link:Vc,listItem:Hc,list:Gc,paragraph:Kc,root:qc,strong:Jc,table:Yc,tableCell:Zc,tableRow:Xc,text:nl,thematicBreak:rl,toml:al,yaml:al,definition:al,footnoteDefinition:al};function al(){}var ol=typeof self==`object`?self:globalThis,sl=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new ol[e](t)},cl=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(sl(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(sl(a,o),i)};return r},ll=e=>cl(new Map,e)(0),ul=``,{toString:dl}={},{keys:fl}=Object,pl=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=dl.call(e).slice(8,-1);switch(n){case`Array`:return[1,ul];case`Object`:return[2,ul];case`Date`:return[3,ul];case`RegExp`:return[4,ul];case`Map`:return[5,ul];case`Set`:return[6,ul];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},ml=([e,t])=>e===0&&(t===`function`||t===`symbol`),hl=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=pl(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of fl(r))(e||!ml(pl(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?ul:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(ml(pl(n))||ml(pl(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!ml(pl(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},gl=(e,{json:t,lossy:n}={})=>{let r=[];return hl(!(t||n),!!t,new Map,r)(e),r},_l=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?ll(gl(e,t)):structuredClone(e):(e,t)=>ll(gl(e,t));function vl(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function yl(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function bl(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||vl,r=e.options.footnoteBackLabel||yl,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=no(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{..._l(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
23
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
24
+ `}]}}var xl=(function(e){if(e==null)return El;if(typeof e==`function`)return Tl(e);if(typeof e==`object`)return Array.isArray(e)?Sl(e):Cl(e);if(typeof e==`string`)return wl(e);throw Error(`Expected function, string, or object as test`)});function Sl(e){let t=[],n=-1;for(;++n<e.length;)t[n]=xl(e[n]);return Tl(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Cl(e){let t=e;return Tl(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function wl(e){return Tl(t);function t(t){return t&&t.type===e}}function Tl(e){return t;function t(t,n,r){return!!(Dl(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function El(){return!0}function Dl(e){return typeof e==`object`&&!!e&&`type`in e}function Ol(e){return e}var kl=[];function Al(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=xl(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Ol(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=kl,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=jl(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function jl(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?kl:[e]}function Ml(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Al(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Nl={}.hasOwnProperty,Pl={};function Fl(e,t){let n=t||Pl,r=new Map,i=new Map,a={all:s,applyData:Ll,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...il,...n.handlers},one:o,options:n,patch:Il,wrap:K};return Ml(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Nl.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=_l(n);return r.children=a.all(e),r}return _l(e)}return(a.options.unknownHandler||Rl)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=q(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=q(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Il(e,t){e.position&&(t.position=Zi(e))}function Ll(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,_l(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Rl(e,t){let n=t.data||{},r=`value`in t&&!(Nl.call(n,`hProperties`)||Nl.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function K(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
25
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
26
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
27
+ `}),n}function q(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function J(e,t){let n=Fl(e,t),r=n.one(e,void 0),i=bl(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
28
+ `},i)),a}function Y(e,t){return e&&`run`in e?async function(n,r){let i=J(n,{file:r,...t});await e.run(i,r)}:function(n,r){return J(n,{file:r,...e||t})}}function X(e){if(e)throw e}var zl=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Bl(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Vl(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Hl(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Hl(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Ul={basename:Wl,dirname:Gl,extname:Kl,join:ql,sep:`/`};function Wl(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Xl(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Gl(e){if(Xl(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Kl(e){Xl(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function ql(...e){let t=-1,n;for(;++t<e.length;)Xl(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Jl(n)}function Jl(e){Xl(e);let t=e.codePointAt(0)===47,n=Yl(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Yl(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Xl(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Zl={cwd:Ql};function Ql(){return`/`}function $l(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function eu(e){if(typeof e==`string`)e=new URL(e);else if(!$l(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return tu(e)}function tu(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var nu=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],ru=class{constructor(e){let t;t=e?$l(e)?{path:e}:typeof e==`string`||su(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Zl.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<nu.length;){let e=nu[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)nu.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Ul.basename(this.path):void 0}set basename(e){au(e,`basename`),iu(e,`basename`),this.path=Ul.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Ul.dirname(this.path):void 0}set dirname(e){ou(this.basename,`dirname`),this.path=Ul.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Ul.extname(this.path):void 0}set extname(e){if(iu(e,`extname`),ou(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Ul.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){$l(e)&&(e=eu(e)),au(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Ul.basename(this.path,this.extname):void 0}set stem(e){au(e,`stem`),iu(e,`stem`),this.path=Ul.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new z(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function iu(e,t){if(e&&e.includes(Ul.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Ul.sep+"`")}function au(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function ou(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function su(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var cu=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),lu=t(zl(),1),uu={}.hasOwnProperty,du=new class e extends cu{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Vl()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,lu.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(mu(`data`,this.frozen),this.namespace[e]=t,this):uu.call(this.namespace,e)&&this.namespace[e]||void 0:e?(mu(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=_u(e),n=this.parser||this.Parser;return fu(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),fu(`process`,this.parser||this.Parser),pu(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=_u(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);yu(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),fu(`processSync`,this.parser||this.Parser),pu(`processSync`,this.compiler||this.Compiler),this.process(e,r),gu(`processSync`,`process`,t),n;function r(e,r){t=!0,X(e),n=r}}run(e,t,n){hu(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=_u(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),gu(`runSync`,`run`,n),r;function i(e,t){X(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=_u(t),r=this.compiler||this.Compiler;return pu(`stringify`,r),hu(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(mu(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,lu.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Bl(o)&&Bl(r)&&(r=(0,lu.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function fu(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function pu(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function mu(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function hu(e){if(!Bl(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function gu(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function _u(e){return vu(e)?e:new ru(e)}function vu(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function yu(e){return typeof e==`string`||bu(e)}function bu(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var xu=[],Su={allowDangerousHtml:!0},Cu=/^(https?|ircs?|mailto|xmpp)$/i,wu=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Tu(e){let t=Eu(e),n=Du(e);return Ou(t.runSync(t.parse(n),n),e)}function Eu(e){let t=e.rehypePlugins||xu,n=e.remarkPlugins||xu,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Su}:Su;return du().use(Dc).use(n).use(Y,r).use(t)}function Du(e){let t=e.children||``,n=new ru;return typeof t==`string`?n.value=t:``+t,n}function Ou(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||ku;for(let e of wu)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Ml(e,l),ca(e,{Fragment:I.Fragment,components:i,ignoreInvalidStyle:!0,jsx:I.jsx,jsxs:I.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Aa)if(Object.hasOwn(Aa,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Aa[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function ku(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Cu.test(e.slice(0,t))?e:``}function Au(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function ju(e,t,n){let r=xl((n||{}).ignore||[]),i=Mu(t),a=-1;for(;++a<i.length;)Al(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Mu(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Nu(e[0]),Pu(e[1])])}return t}function Nu(e){return typeof e==`string`?new RegExp(Au(e),`g`):e}function Pu(e){return typeof e==`function`?e:function(){return e}}var Fu=`phrasing`,Iu=[`autolink`,`link`,`image`,`label`];function Lu(){return{transforms:[Z],enter:{literalAutolink:zu,literalAutolinkEmail:Bu,literalAutolinkHttp:Bu,literalAutolinkWww:Bu},exit:{literalAutolink:Wu,literalAutolinkEmail:Uu,literalAutolinkHttp:Vu,literalAutolinkWww:Hu}}}function Ru(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Fu,notInConstruct:Iu},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Fu,notInConstruct:Iu},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Fu,notInConstruct:Iu}]}}function zu(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Bu(e){this.config.enter.autolinkProtocol.call(this,e)}function Vu(e){this.config.exit.autolinkProtocol.call(this,e)}function Hu(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Uu(e){this.config.exit.autolinkEmail.call(this,e)}function Wu(e){this.exit(e)}function Z(e){ju(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Gu],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Ku]],{ignore:[`link`,`linkReference`]})}function Gu(e,t,n,r,i){let a=``;if(!Yu(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!qu(n)))return!1;let o=Ju(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Ku(e,t,n,r){return!Yu(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function qu(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Ju(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=ie(e,`(`),a=ie(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Yu(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||eo(n)||$a(n))&&(!t||n!==47)}ad.peek=id;function Xu(){this.buffer()}function Zu(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Qu(){this.buffer()}function $u(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function ed(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ga(this.sliceSerialize(e)).toLowerCase(),n.label=t}function td(e){this.exit(e)}function nd(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ga(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rd(e){this.exit(e)}function id(){return`[`}function ad(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function od(){return{enter:{gfmFootnoteCallString:Xu,gfmFootnoteCall:Zu,gfmFootnoteDefinitionLabelString:Qu,gfmFootnoteDefinition:$u},exit:{gfmFootnoteCallString:ed,gfmFootnoteCall:td,gfmFootnoteDefinitionLabelString:nd,gfmFootnoteDefinition:rd}}}function sd(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ad},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
29
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?ld:cd))),s(),o}}function cd(e,t,n){return t===0?e:ld(e,t,n)}function ld(e,t,n){return(n?``:` `)+e}var ud=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];hd.peek=gd;function dd(){return{canContainEols:[`delete`],enter:{strikethrough:pd},exit:{strikethrough:md}}}function fd(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:ud}],handlers:{delete:hd}}}function pd(e){this.enter({type:`delete`,children:[]},e)}function md(e){this.exit(e)}function hd(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function gd(){return`~`}function _d(e){return e.length}function vd(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||_d,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=yd(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Q(r[d]);else{let e=Q(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
30
+ `)}function yd(e){return e==null?``:String(e)}function Q(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function bd(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),xd);return i(),o}function xd(e,t,n){return`>`+(n?``:` `)+e}function Sd(e,t){return Cd(e,t.inConstruct,!0)&&!Cd(e,t.notInConstruct,!1)}function Cd(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function wd(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
31
+ `&&Sd(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
32
+ `}function Td(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Ed(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Dd(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Od(e,t,n,r){let i=Dd(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Ed(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,kd);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Td(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
33
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
34
+ `),a&&(u+=s.move(a+`
35
+ `)),u+=s.move(c),l(),u}function kd(e,t,n){return(n?``:` `)+e}function Ad(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function jd(e,t,n,r){let i=Ad(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
36
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Md(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function $(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Nd(e,t,n){let r=W(e),i=W(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Pd.peek=Fd;function Pd(e,t,n,r){let i=Md(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Nd(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=$(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Nd(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+$(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Fd(e,t,n){return n.options.emphasis||`*`}function Id(e,t){let n=!1;return Ml(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Ma(e)&&(t.options.setext||n))}function Ld(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Id(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
37
+ `,after:`
38
+ `});return r(),t(),o+`
39
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
40
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
41
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=$(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Rd.peek=zd;function Rd(e){return e.value||``}function zd(){return`<`}Bd.peek=Vd;function Bd(e,t,n,r){let i=Ad(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Vd(){return`!`}Hd.peek=Ud;function Hd(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ud(){return`!`}Wd.peek=Gd;function Wd(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Gd(){return"`"}function Kd(e,t){let n=Ma(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}qd.peek=Jd;function qd(e,t,n,r){let i=Ad(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Kd(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Jd(e,t,n){return Kd(e,n)?`<`:`[`}Yd.peek=Xd;function Yd(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Xd(){return`[`}function Zd(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Qd(e){let t=Zd(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function $d(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ef(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function tf(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?$d(n):Zd(n),s=e.ordered?o===`.`?`)`:`.`:Qd(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),ef(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function nf(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function rf(e,t,n,r){let i=nf(n),a=n.bulletCurrent||Zd(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function af(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var of=xl([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function sf(e,t,n,r){return(e.children.some(function(e){return of(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function cf(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}lf.peek=uf;function lf(e,t,n,r){let i=cf(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Nd(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=$(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Nd(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+$(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function uf(e,t,n){return n.options.strong||`*`}function df(e,t,n,r){return n.safe(e.value,r)}function ff(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function pf(e,t,n){let r=(ef(n)+(n.options.ruleSpaces?` `:``)).repeat(ff(n));return n.options.ruleSpaces?r.slice(0,-1):r}var mf={blockquote:bd,break:wd,code:Od,definition:jd,emphasis:Pd,hardBreak:wd,heading:Ld,html:Rd,image:Bd,imageReference:Hd,inlineCode:Wd,link:qd,linkReference:Yd,list:tf,listItem:rf,paragraph:af,root:sf,strong:lf,text:df,thematicBreak:pf};function hf(){return{enter:{table:gf,tableData:bf,tableHeader:bf,tableRow:vf},exit:{codeText:xf,table:_f,tableData:yf,tableHeader:yf,tableRow:yf}}}function gf(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function _f(e){this.exit(e),this.data.inTable=void 0}function vf(e){this.enter({type:`tableRow`,children:[]},e)}function yf(e){this.exit(e)}function bf(e){this.enter({type:`tableCell`,children:[]},e)}function xf(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Sf));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Sf(e,t){return t===`|`?t:e}function Cf(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
42
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
43
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return vd(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=mf.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function wf(){return{exit:{taskListCheckValueChecked:Ef,taskListCheckValueUnchecked:Ef,paragraph:Df}}}function Tf(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Of}}}function Ef(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Df(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Of(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=mf.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function kf(){return[Lu(),od(),dd(),hf(),wf()]}function Af(e){return{extensions:[Ru(),sd(e),fd(),Cf(e),Tf()]}}var jf={tokenize:Gf,partial:!0},Mf={tokenize:Kf,partial:!0},Nf={tokenize:qf,partial:!0},Pf={tokenize:Jf,partial:!0},Ff={tokenize:Yf,partial:!0},If={name:`wwwAutolink`,tokenize:Uf,previous:Xf},Lf={name:`protocolAutolink`,tokenize:Wf,previous:Zf},Rf={name:`emailAutolink`,tokenize:Hf,previous:Qf},zf={};function Bf(){return{text:zf}}for(var Vf=48;Vf<123;)zf[Vf]=Rf,Vf++,Vf===58?Vf=65:Vf===91&&(Vf=97);zf[43]=Rf,zf[45]=Rf,zf[46]=Rf,zf[95]=Rf,zf[72]=[Rf,Lf],zf[104]=[Rf,Lf],zf[87]=[Rf,If],zf[119]=[Rf,If];function Hf(e,t,n){let r=this,i,a;return o;function o(t){return!$f(t)||!Qf.call(r,r.previous)||ep(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return $f(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Ff,u,l)(t):t===45||t===95||qa(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Ka(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Uf(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Xf.call(r,r.previous)||ep(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(jf,e.attempt(Mf,e.attempt(Nf,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Wf(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Zf.call(r,r.previous)&&!ep(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Ka(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Ya(t)||V(t)||eo(t)||$a(t)?n(t):e.attempt(Mf,e.attempt(Nf,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Gf(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Kf(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Pf,c,s)(t):t===null||V(t)||eo(t)||t!==45&&$a(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function qf(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Pf,t,a)(o):o===null||V(o)||eo(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Jf(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||V(o)||eo(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||V(e)||eo(e)?t(e):r(e)}function a(e){return Ka(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Ka(t)?(e.consume(t),o):n(t)}}function Yf(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return qa(e)?n(e):t(e)}}function Xf(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||V(e)}function Zf(e){return!Ka(e)}function Qf(e){return!(e===47||$f(e))}function $f(e){return e===43||e===45||e===46||e===95||qa(e)}function ep(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var tp={tokenize:lp,partial:!0};function np(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:op,continuation:{tokenize:sp},exit:cp}},text:{91:{name:`gfmFootnoteCall`,tokenize:ap},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:rp,resolveTo:ip}}}}function rp(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Ga(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function ip(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function ap(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||V(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Ga(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return V(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function op(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||V(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Ga(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return V(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),U(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function sp(e,t,n){return e.check(go,t,e.attempt(tp,t,n))}function cp(e){e.exit(`gfmFootnoteDefinition`)}function lp(e,t,n){let r=this;return U(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function up(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Ra(o,o.length,0,G(s,e.slice(r+1,n),t)),Ra(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Ra(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=W(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=W(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var dp=class{constructor(){this.map=[]}add(e,t,n){fp(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function fp(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function pp(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function mp(){return{flow:{null:{name:`table`,tokenize:hp,resolveAll:gp}}}}function hp(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):B(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):H(t)?U(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||V(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,H(t)?U(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return H(t)?U(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||B(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return H(t)?U(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||B(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||B(n)?(e.exit(`tableRow`),t(n)):H(n)?U(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||V(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function gp(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new dp;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(vp(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=_p(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=_p(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=_p(f,t,o,i,n,d)):(o[0]=o[1],d=_p(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&vp(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=pp(t.events,n))}return e}function _p(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},yp(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=yp(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=yp(t.events,n[2]),a=yp(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},yp(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function vp(e,t,n,r,i){let a=[],o=yp(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function yp(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var bp={name:`tasklistCheck`,tokenize:Sp};function xp(){return{text:{91:bp}}}function Sp(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return V(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return B(r)?t(r):H(r)?e.check({tokenize:Cp},t,n)(r):n(r)}}function Cp(e,t,n){return U(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function wp(e){return Va([Bf(),np(),up(e),mp(),xp()])}var Tp={};function Ep(e){let t=this,n=e||Tp,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(wp(n)),a.push(kf()),o.push(Af(n))}function Dp({children:e,className:t}){return(0,I.jsx)(`div`,{className:i(`chat-markdown`,t),children:(0,I.jsx)(Tu,{remarkPlugins:[Ep],components:{a({children:e,...t}){return(0,I.jsx)(`a`,{rel:`noreferrer`,target:`_blank`,...t,children:e})}},children:e})})}function Op(e){return e instanceof Error?e.message:String(e)}function kp(e,t){let n=jp(e),r=Mp(n?.type)??`part`;if(r===`text`){let e=Mp(n?.text);return e?(0,I.jsx)(Dp,{children:e},t):null}return(0,I.jsx)(Ap,{kind:Np(r),name:Pp(n)??zp(r),preview:Ip(n),status:Fp(n,r)},t)}function Ap({kind:e,name:t,preview:n,status:r}){return(0,I.jsxs)(`div`,{className:`chat-part-event`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`shrink-0 font-mono text-[9.5px] font-semibold uppercase text-primary`,children:e}),(0,I.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-ink`,children:t}),r?(0,I.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted`,children:r}):null]}),n?(0,I.jsx)(`code`,{className:`mt-1 block truncate font-mono text-[10.5px] leading-4 text-muted`,children:n}):null]})}function jp(e){if(!(!e||typeof e!=`object`||Array.isArray(e)))return e}function Mp(e){return typeof e==`string`&&e.trim()?e:void 0}function Np(e){let t=e.toLowerCase();return t.includes(`tool`)?`tool`:t.includes(`action`)?`action`:t.includes(`data`)?`data`:`event`}function Pp(e){if(e)return Mp(e.name)??Mp(e.toolName)??Mp(e.actionName)??Mp(e.tool)??Mp(e.action)??Mp(e.id)??Mp(e.toolCallId)??Mp(e.callId)}function Fp(e,t){return e?Mp(e.status)??Mp(e.state)??Mp(e.outcome)??zp(t):zp(t)}function Ip(e){if(e){for(let t of[`input`,`args`,`arguments`,`parameters`,`result`,`output`,`error`])if(t in e)return Lp(e[t])}}function Lp(e){if(e!=null){if(typeof e==`string`)return Rp(e);if(typeof e==`number`||typeof e==`boolean`)return String(e);try{return Rp(JSON.stringify(e))}catch{return}}}function Rp(e){let t=e.replace(/\s+/g,` `).trim();return t.length>180?`${t.slice(0,177)}...`:t}function zp(e){return e.replace(/[_-]+/g,` `)}var Bp=[{label:`Briefing`,command:`/briefing`,description:`summarize active runtime context`},{label:`Reasoning`,command:`/reasoning`,description:`show or change the session reasoning level`},{label:`Repo`,command:`/repo-status`,description:`inspect the current repo state`},{label:`Queue`,command:`/review-queue`,description:`list active GitHub PR work`},{label:`Review PR`,command:`/review-pr`,description:`prepare a review of a GitHub pull request`},{label:`Watch PR`,command:`/watch-pr`,description:`create or inspect a PR watch`},{label:`CI`,command:`/explain-ci`,description:`explain a failing check or PR ref`},{label:`Fix CI`,command:`/fix-ci`,description:`queue a bounded local fix for failing PR checks`},{label:`PR`,command:`/summarize-pr`,description:`summarize a pull request`},{label:`Draft`,command:`/draft-pr-description`,description:`draft a PR description from local state`},{label:`Prep`,command:`/prepare-pr`,description:`prepare local changes for review`},{label:`Review`,command:`/review-local`,description:`review local changes before pushing`},{label:`Memory`,command:`/memory`,description:`read or update durable memory`},{label:`Doctor`,command:`/dev-doctor`,description:`check local runtime readiness`}],Vp={agentName:`display-assistant`,sessions:[{id:`neondeck-main`,label:`Primary`,placeholder:`Ask the assistant...`}],quickCommands:Bp};function Hp(e,t=void 0){let n=t===void 0?Bp:t.map(Gp),r=t===void 0?void 0:new Set(n.map(e=>e.command)),i=new Map(Bp.map(e=>[e.command,e]));for(let e of n)i.set(e.command,{...i.get(e.command),...e});let a=new Map;for(let t of e)r&&!r.has(t.command)||a.set(t.command,{...i.get(t.command),...t});for(let e of n)a.has(e.command)||a.set(e.command,e);return[...a.values()]}function Up(e){let t=e.trimStart();if(!t.startsWith(`/`))return;let n=t.split(/\s+/,1)[0]??``;if(!(t.length>n.length))return n.slice(1).toLowerCase()}function Wp(e,t){return t===void 0?[]:t?e.filter(e=>{let n=e.command.slice(1).toLowerCase(),r=e.label.toLowerCase(),i=e.description?.toLowerCase()??``;return n.includes(t)||r.includes(t)||i.includes(t)}):e}function Gp(e){let t=`/${e.name}`;return{label:Bp.find(e=>e.command===t)?.label??Kp(e.name),command:t,description:e.description}}function Kp(e){return e.split(`-`).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(` `)}var qp=`[NEONDECK_INTERNAL_BRIEFING_INPUT v1 trigger=`;function Jp(e,t,n){let r=n===`idle`&&t&&t.length>=e.length?t:e;return r.some(Yp)?r.map(Xp):r}function Yp(e){return e.role===`user`&&e.parts.some(e=>e.type===`text`&&Zp(e.text).startsWith(qp))}function Xp(e){if(e.role!==`user`)return e;let t=e.parts.find(e=>e.type===`text`)?.text,n=t?Zp(t):void 0;if(!n?.startsWith(qp))return e;let r=n.startsWith(`${qp}scheduled`);return{...e,parts:[{type:`text`,text:r?`Scheduled morning briefing`:`/briefing`,state:`done`}]}}function Zp(e){if(!e.startsWith(`"`))return e;try{let t=JSON.parse(e);return typeof t==`string`?t:e}catch{return e}}function Qp(e,t){return e?t??[]:[]}function $p(e,t){return[...e.map((e,t)=>({kind:`message`,id:`message:${e.id}`,order:t,timestamp:e.metadata?.timestamp,message:e})),...t.map((t,n)=>({kind:`activity`,id:`activity:${t.id}`,order:e.length+n,timestamp:t.updatedAt,activity:t}))].sort(em)}function em(e,t){let n=tm(e.timestamp),r=tm(t.timestamp);return n!==null&&r!==null&&n!==r?n-r:n===null&&r!==null?1:n!==null&&r===null?-1:e.order-t.order}function tm(e){if(!e)return null;let t=Date.parse(e);return Number.isFinite(t)?t:null}function nm({activeRecord:e,agentName:t,onReferenceDraftConsumed:n,quickCommands:r,referenceDraft:i,session:a,sessionState:o}){let[s,c]=(0,F.useState)(``),[l,u]=(0,F.useState)([]),[p,m]=(0,F.useState)(),[_,y]=(0,F.useState)(!1),[S,C]=(0,F.useState)(0),[w,T]=(0,F.useState)(``),[ee,D]=(0,F.useState)(!1),[te,ne]=(0,F.useState)(),re=(0,F.useRef)(!1),ie=h(),O=Qt(),k=pn({name:t,id:a?.id}),[A,ae]=(0,F.useState)(),[M,oe]=(0,F.useState)(!1),[se,N]=(0,F.useState)(),ce=Jp(k.messages,A,k.status),le=d({queryKey:b.neonCommands,queryFn:bn,staleTime:1/0}),ue=(0,F.useMemo)(()=>Hp(r,le.data?.items),[le.data?.items,r]),de=Up(s),P=(0,F.useMemo)(()=>Wp(ue,de),[ue,de]).slice(0,6),fe=de!==void 0&&w!==s&&P.length>0,pe=P[Math.min(S,P.length-1)],me=M||!!se,he=_||!!p,ge=a?se?`Retry session history before sending...`:M?`Loading session history...`:a.placeholder:`Resolving active session...`,_e=e?.linkedWatchId,ve=d({queryKey:b.chatSessionCommandEvents(a?.id),queryFn:()=>Rn(a?.id??``),enabled:!!a?.id}),ye=d({queryKey:b.chatSessionActivity(a?.id,_e),queryFn:()=>zn(a?.id??``),enabled:!!(a?.id&&_e),refetchInterval:3e4}),be=Qp(_e,ye.data?.items),xe=$p(ce,be);(0,F.useEffect)(()=>{C(0)},[de]),(0,F.useEffect)(()=>{ae(void 0),oe(!!a?.id),N(void 0),u([])},[t,a?.id]),(0,F.useEffect)(()=>{u(ve.data?.events??[])},[ve.data?.events]),(0,F.useEffect)(()=>{if(a?.id)return j(e=>{e.session.id===a.id&&(ae(void 0),oe(!0),ie.invalidateQueries({queryKey:b.chatSessionCommandEvents(a.id)}),ie.invalidateQueries({queryKey:b.chatSessionActivity(a.id,_e)}))})},[_e,ie,a?.id]),(0,F.useEffect)(()=>{i&&(c(e=>e.trim()?`${e}\n\n${i}`:i),n?.())},[n,i]),(0,F.useEffect)(()=>{if(!M)return;if(k.status===`error`){oe(!1);return}if(!a?.id||k.status!==`idle`)return;let e=!1;return O.agents.history(t,a.id).then(t=>{e||(ae(t.messages),oe(!1),N(void 0))}).catch(t=>{if(!e){if(om(t)){ae([]),N(void 0),oe(!1);return}N(Op(t)),oe(!1)}}),()=>{e=!0}},[k.status,t,O,M,a?.id]);async function Se(e){e.preventDefault();let t=s.trim();if(!(!t||ee||he||re.current)){if(ne(void 0),!a){ne(`Active session is still resolving.`);return}if(t.startsWith(`/`)){let e;re.current=!0,y(!0);try{let n=await Bn(a.id,{input:t,reason:`dashboard-slash-command`});if(!n.event){ne(`Command transcript row was not created.`);return}if(e=n.event,Ce(e),am(t)===`briefing`){m(t);let n=await cr({profileId:`morning`,sessionId:a.id,commandEventId:e.id,trigger:`manual`});if(!n.ok)throw Error(n.message);n.workflowRunId&&(we(e.id,{flueRunId:n.workflowRunId}),await Vn(a.id,e.id,{status:`running`,flueRunId:n.workflowRunId,reason:`dashboard-briefing-workflow-admitted`})),c(``),ae(void 0);return}let r=await Ee(t),i=r.status===`running`?`running`:r.ok?`completed`:`failed`,o=i===`running`?null:new Date().toISOString();we(e.id,{status:i,result:r,flueRunId:r.flueRunId??null,workflowSummaryId:r.workflowSummary?.id??null,completedAt:o});try{let t=await Vn(a.id,e.id,{status:i,result:r,flueRunId:r.flueRunId??null,workflowSummaryId:r.workflowSummary?.id??null,...o?{completedAt:o}:{},reason:i===`running`?`dashboard-slash-command-admitted`:`dashboard-slash-command-complete`});t.event&&we(t.event.id,t.event),await ie.invalidateQueries({queryKey:b.chatSessionCommandEvents(a.id)})}catch(e){ne(`Command finished but transcript update failed: ${Op(e)}`)}r.ok&&r.command===`reasoning`&&await ie.invalidateQueries({queryKey:b.neonSession}),c(``)}catch(n){if(!e){ne(Op(n));return}let r=im(t,n),i=new Date().toISOString();we(e.id,{status:`failed`,result:r,completedAt:i}),await Vn(a.id,e.id,{status:`failed`,result:r,completedAt:i,reason:`dashboard-slash-command-failed`}).catch(e=>{ne(`Command failed and transcript update failed: ${Op(e)}`)}),await ie.invalidateQueries({queryKey:b.chatSessionCommandEvents(a.id)}),ne(Op(n))}finally{m(void 0),re.current=!1,y(!1)}return}if(me){ne(se?`Refresh session history before sending.`:`Session history is still loading.`);return}D(!0);try{ae(void 0),await k.sendMessage(t),oe(!0),c(``)}catch(e){oe(!1),ne(Op(e))}finally{D(!1)}}}function Ce(e){u(t=>[...t,e].slice(-30))}function we(e,t){u(n=>n.map(n=>n.id===e?{...n,...t}:n))}async function Te(e){if(!a||ee||he||me)return;let t=e.result?.workflowSummary?.id,n=e.result?.flueRunId??e.flueRunId,r=[`Explain the result of command ${e.input}.`,t?`Workflow summary id: ${t}.`:void 0,n?`Flue run id: ${n}.`:void 0,e.result?.message?`Command message: ${e.result.message}`:void 0].filter(Boolean).join(`
44
+ `);D(!0);try{ae(void 0),await k.sendMessage(r),oe(!0)}catch(e){oe(!1),ne(Op(e))}finally{D(!1)}}async function Ee(e){m(e);try{let t=await O.workflows.invoke(`command-run`,{input:{command:e,...a?.id?{sessionId:a.id}:{},surface:`dashboard`},wait:`result`});return{...t.result,flueRunId:t.runId}}finally{m(void 0)}}function De(e){if(fe&&pe){if(e.key===`ArrowDown`){e.preventDefault(),C(e=>(e+1)%P.length);return}if(e.key===`ArrowUp`){e.preventDefault(),C(e=>(e-1+P.length)%P.length);return}if(e.key===`Tab`){e.preventDefault(),Oe(pe);return}if(e.key===`Enter`&&!e.shiftKey&&s.trim()!==pe.command){e.preventDefault(),Oe(pe);return}if(e.key===`Escape`){e.preventDefault(),T(s);return}}e.key!==`Enter`||e.shiftKey||(e.preventDefault(),e.currentTarget.form?.requestSubmit())}function Oe(e){c(`${e.command} `),T(``)}return(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,I.jsx)(v,{className:`chat-log flex-1`,children:(0,I.jsxs)(`div`,{className:`flex min-h-full flex-col gap-3 px-[18px] py-3.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between font-mono text-[10.5px] text-muted`,children:[(0,I.jsx)(`span`,{className:`text-primary`,children:a?.id??`loading session`}),(0,I.jsx)(x,{children:k.status})]}),o?.stale?(0,I.jsxs)(`div`,{className:`border border-accent/60 bg-soft px-2.5 py-2 text-[10.5px] leading-4 text-muted`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 font-mono`,children:[(0,I.jsx)(`span`,{className:`text-accent`,children:`CONTEXT STALE`}),(0,I.jsx)(x,{className:`border-accent text-accent`,children:o.staleReasons.length})]}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-2`,children:o.staleReasons[0]?.message??`Start a new session to reload runtime context.`})]}):null,se?(0,I.jsxs)(`div`,{className:`border border-accent/60 bg-soft px-2.5 py-2 text-[10.5px] leading-4 text-muted`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 font-mono`,children:[(0,I.jsx)(`span`,{className:`text-accent`,children:`HISTORY REFRESH FAILED`}),(0,I.jsx)(E,{className:`min-h-[24px] border-accent bg-transparent px-1.5 py-0 text-[10px] text-accent`,onClick:()=>{N(void 0),oe(!!a?.id)},type:`button`,children:`retry`})]}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-2`,children:se})]}):null,ve.error?(0,I.jsxs)(`div`,{className:`border border-accent/60 bg-soft px-2.5 py-2 font-mono text-[10.5px] leading-4 text-accent`,children:[`COMMAND HISTORY UNAVAILABLE ·`,` `,Op(ve.error)]}):null,_e&&ye.error?(0,I.jsxs)(`div`,{className:`border border-accent/60 bg-soft px-2.5 py-2 font-mono text-[10.5px] leading-4 text-accent`,children:[`SESSION ACTIVITY UNAVAILABLE · `,Op(ye.error)]}):null,xe.length>0?(0,I.jsxs)(`div`,{className:`chat-workflow px-2.5 py-1 font-mono text-[10.5px]`,children:[(0,I.jsx)(`span`,{children:`workflow`}),(0,I.jsxs)(`span`,{className:`text-muted`,children:[`session · `,ce.length,` messages`,be.length>0?` · ${be.length} activity records`:``]})]}):null,l.filter(rm).map(e=>(0,I.jsx)(Mi,{event:e,onAsk:e.result?()=>void Te(e):void 0},e.id)),xe.length===0?(0,I.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-center text-[13px] text-muted`,children:(0,I.jsxs)(`div`,{className:`max-w-[42ch]`,children:[(0,I.jsx)(`div`,{className:`miami-accent mx-auto mb-2 h-1.5 w-12`}),(0,I.jsx)(`p`,{className:`font-medium text-ink`,children:a?`Session ready`:`Resolving session`}),(0,I.jsx)(`p`,{className:`mt-1 leading-5`,children:a?`Messages persist through the local Flue SQLite store.`:`Chat will attach when the active durable session is available.`})]})}):xe.map(e=>{if(e.kind===`activity`)return(0,I.jsx)(Ii,{activity:e.activity},e.id);let t=e.message;return(0,I.jsxs)(`article`,{className:`chat-message chat-message-${t.role} space-y-1.5`,children:[(0,I.jsx)(`p`,{className:`font-mono text-[10px] font-semibold text-muted`,children:t.role}),(0,I.jsx)(`div`,{className:`space-y-2 text-[13px] leading-[1.55] text-ink`,children:t.parts.length>0?t.parts.map((e,n)=>kp(e,`${t.id}-${n}`)):(0,I.jsx)(Ap,{kind:`event`,name:`assistant message`,preview:`No visible message parts were returned.`})})]},e.id)})]})}),(0,I.jsxs)(`div`,{className:`relative shrink-0 border-t border-line bg-field`,children:[(0,I.jsx)(R,{activeCommand:pe,activeCommandIndex:S,commands:P,open:fe,onSelect:Oe}),te?(0,I.jsx)(`div`,{className:`border-b border-accent/50 px-4 py-1 font-mono text-[10.5px] leading-4 text-accent`,children:te}):null,(0,I.jsxs)(`form`,{className:`flex h-11 items-center gap-2.5 px-4`,onSubmit:Se,children:[(0,I.jsx)(`span`,{className:`font-mono text-[13px] text-accent`,children:`›`}),(0,I.jsx)(f,{"aria-autocomplete":`list`,"aria-controls":`flue-command-typeahead`,"aria-expanded":fe,className:`dashboard-input h-7 flex-1 overflow-hidden px-0 py-1 font-mono text-[13px] leading-5 caret-primary`,onChange:e=>{c(e.target.value),T(``),te&&ne(void 0)},onKeyDown:De,placeholder:ge,rows:1,disabled:!a||me||ee||he,value:s}),(0,I.jsx)(g,{children:fe?`Tab complete`:me?`Loading history`:p?`Running`:_?`Starting`:ee?`Sending`:`/ commands | Enter send`}),(0,I.jsx)(E,{className:`sr-only`,disabled:!a||me||!s.trim()||ee||he,type:`submit`,children:`Send`})]})]})]})}function rm(e){return am(e.input)!==`briefing`}function im(e,t){return{ok:!1,command:am(e),input:e,status:`failed`,message:Op(t),errors:[Op(t)]}}function am(e){return e.replace(/^\//,``).split(/\s+/,1)[0]||`unknown`}function om(e){let t=Op(e).toLowerCase();return t.includes(`404`)&&t.includes(`stream_not_found`)}function sm(e){let t=Pr(e),n=[];return{config:{agentName:Ir(t.agentName,Vp.agentName,`agentName`,n),sessions:cm(t.sessions,n),quickCommands:lm(t.quickCommands,n)},issues:n}}function cm(e,t){if(e===void 0)return Vp.sessions;if(!Array.isArray(e))return t.push(`sessions must be an array.`),Vp.sessions;let n=e.flatMap((e,n)=>{if(!e||typeof e!=`object`||Array.isArray(e))return t.push(`sessions[${n}] must be an object.`),[];let r=e;return typeof r.id!=`string`||typeof r.label!=`string`||typeof r.placeholder!=`string`||r.id.trim().length===0||r.label.trim().length===0||r.placeholder.trim().length===0?(t.push(`sessions[${n}] must include non-empty id, label, and placeholder strings.`),[]):[{id:r.id,label:r.label,placeholder:r.placeholder}]});return n.length>0?n:(t.push(`sessions did not contain any usable entries.`),Vp.sessions)}function lm(e,t){if(e===void 0)return Vp.quickCommands;if(!Array.isArray(e))return t.push(`quickCommands must be an array.`),Vp.quickCommands;let n=e.flatMap((e,n)=>{if(!e||typeof e!=`object`||Array.isArray(e))return t.push(`quickCommands[${n}] must be an object.`),[];let r=e;return typeof r.label!=`string`||typeof r.command!=`string`||r.label.trim().length===0||r.command.trim().length===0?(t.push(`quickCommands[${n}] must include non-empty label and command strings.`),[]):[{label:r.label,command:r.command,...typeof r.description==`string`?{description:r.description}:{}}]});return n.length>0?n:(t.push(`quickCommands did not contain any usable entries.`),Vp.quickCommands)}var um={id:`flue-chat`,title:`Flue chat`,kind:`agent`,defaultConfig:Vp,parseConfig:sm,Component({config:e}){let t=(e.sessions.length>0?e.sessions:Vp.sessions)[0]??Vp.sessions[0],n=h(),[r,i]=(0,F.useState)(``),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(),{data:f,error:p,refetch:m}=d({queryKey:b.neonSession,queryFn:On,refetchInterval:3e4}),{data:g,error:_,refetch:v}=d({queryKey:b.chatSessions,queryFn:()=>kn({includeArchived:!0}),refetchInterval:3e4}),y=P({async mutationFn(){let e=await An({title:`Fresh`,surface:`dashboard`,activate:!0});if(!e.state)throw Error(e.message);return e.state},onSuccess(e){n.setQueryData(b.neonSession,e),n.invalidateQueries({queryKey:b.chatSessions})}}),x=P({async mutationFn(e){let t=e.archivedAt?await Ln(e.id):void 0;if(t&&!t.ok)throw Error(t.message);let n=await Nn(e.id);if(!n.state)throw Error(n.message);return n.state},onSuccess(e){n.setQueryData(b.neonSession,e),n.invalidateQueries({queryKey:b.chatSessions})}}),S=P({async mutationFn(e){let t;if(t=e.action===`rename`?await Pn(e.session.id,e.title):e.action===`pin`?await Fn(e.session.id,!e.session.pinned):e.action===`restore`?await Ln(e.session.id):await In(e.session.id),!t.ok)throw Error(t.message);return t},onSuccess(e){e.state&&n.setQueryData(b.neonSession,e.state),n.invalidateQueries({queryKey:b.chatSessions}),n.invalidateQueries({queryKey:b.neonSession})}}),C=P({async mutationFn(e){if(e.summaryStatus!==`fresh`){let t=await jn(e.id,{surface:`dashboard`,reason:`dashboard-reference-active-session`});if(!t.ok)throw Error(t.message)}let t=await Mn(e.id,{fromSessionId:f?.activeSessionId,surface:`dashboard`,reason:`dashboard-reference-active-session`});if(!t.ok)throw Error(t.message);return t},onSuccess(e){c(!1);let t=e.session?.summary??`Prepared cross-session reference.`;u(`Use this prepared session reference as context:\n\n${t}\n\nMy question: `),n.invalidateQueries({queryKey:b.chatSessions})}}),w=g?.sessions??f?.sessions??[],T=w.find(e=>e.id===f?.activeSessionId)??f?.activeChatSession,ee=T?.id,D=T?.title,te=f?{id:f.activeSessionId,label:T?.title??f.activeChatSession.title,placeholder:fm(T)??t.placeholder}:void 0;function ne(){y.mutate()}function re(e){let t=w.find(t=>t.id===e);!t||t.id===te?.id||x.mutate(t)}function ie(){if(!T)return;let e=r.trim();!e||e===T.title||(S.mutate({action:`rename`,session:T,title:e}),o(!1))}Sr(()=>{m(),v()}),(0,F.useEffect)(()=>{D&&(i(D),o(!1))},[ee,D]),(0,F.useEffect)(()=>{if(!C.data?.session||s)return;let e=window.setTimeout(()=>c(!0),8e3);return()=>window.clearTimeout(e)},[s,C.data?.session]);let O=!!(C.data?.session&&!s);return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`header`,{className:`panel-header flex h-8 items-center justify-between border-b border-line px-4 font-mono text-[11px] tracking-[0.14em]`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-primary`,children:[(0,I.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-primary shadow-[0_0_8px_var(--primary)]`}),`FLUE AGENT · `,e.agentName]}),(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(mi,{activeSessionId:te?.id,disabled:x.isPending,onSelect:re,sessions:w}),(0,I.jsx)(E,{className:`h-5 border-transparent bg-transparent px-1.5 py-0 font-mono text-[10.5px] text-muted hover:border-violet hover:text-primary`,disabled:!T||S.isPending,onClick:()=>o(e=>!e),type:`button`,children:a?`Cancel`:`Rename`}),(0,I.jsx)(E,{className:`h-5 border-transparent bg-transparent px-1.5 py-0 font-mono text-[10.5px] text-muted hover:border-violet hover:text-primary`,disabled:!T||S.isPending,onClick:()=>T&&S.mutate({action:`pin`,session:T}),type:`button`,children:T?.pinned?`Unpin`:`Pin`}),(0,I.jsx)(E,{className:`h-5 border-transparent bg-transparent px-1.5 py-0 font-mono text-[10.5px] text-muted hover:border-violet hover:text-primary`,disabled:!T||S.isPending,onClick:()=>T&&S.mutate({action:T.archivedAt?`restore`:`archive`,session:T}),type:`button`,children:T?.archivedAt?`Restore`:`Archive`}),(0,I.jsx)(E,{className:`h-5 border-transparent bg-transparent px-1.5 py-0 font-mono text-[10.5px] text-muted hover:border-violet hover:text-primary`,disabled:!T||C.isPending,onClick:()=>T&&C.mutate(T),type:`button`,children:C.isPending?`Ref...`:`Ref`}),(0,I.jsx)(E,{className:`h-5 border-transparent bg-transparent px-2 py-0 font-mono text-[10.5px] text-muted hover:border-violet hover:text-primary`,disabled:y.isPending,onClick:()=>void ne(),type:`button`,children:y.isPending?`Starting`:`New`}),(0,I.jsx)(`span`,{className:f?.stale?`text-accent`:`text-muted`,children:f?.stale?`stale ctx`:`durable ctx`})]})]}),p||_||y.error||x.error||S.error||C.error?(0,I.jsx)(`div`,{className:`border-b border-accent/60 bg-soft px-4 py-1.5 text-[11px] text-accent`,children:k(p??_??y.error??x.error??S.error??C.error)}):null,a&&T?(0,I.jsxs)(`form`,{className:`flex items-center gap-2 border-b border-line bg-field px-4 py-1.5 font-mono text-[10.5px]`,onSubmit:e=>{e.preventDefault(),ie()},children:[(0,I.jsx)(`span`,{className:`text-muted`,children:`title`}),(0,I.jsx)(`input`,{className:`min-w-0 flex-1 border border-line bg-panel px-2 py-1 text-ink outline-none focus:border-primary`,disabled:S.isPending,onChange:e=>i(e.target.value),value:r}),(0,I.jsx)(E,{className:`min-h-[28px] px-2 py-1 text-[10px]`,disabled:S.isPending,type:`submit`,children:`Save`})]}):null,T?(0,I.jsx)(dm,{session:T}):null,O&&C.data?.session?(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-line bg-soft px-4 py-1.5 text-[11px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Reference ready · `,C.data.session.id,` ·`,` `,C.data.session.summary??`summary metadata refreshed`]}),(0,I.jsx)(E,{className:`min-h-[24px] border-transparent bg-transparent px-1.5 py-0 font-mono text-[10px] text-muted`,onClick:()=>c(!0),type:`button`,children:`Dismiss`})]}):null,(0,I.jsx)(nm,{activeRecord:T,agentName:e.agentName,quickCommands:e.quickCommands,referenceDraft:l,onReferenceDraftConsumed:()=>u(void 0),session:te,sessionState:f})]})}};function dm({session:e}){let t=pm(e);if(!t)return null;let n=mm(e);return(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-line bg-soft px-4 py-1.5 font-mono text-[10.5px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`linked: `,(0,I.jsx)(`span`,{className:`text-primary`,children:t})]}),n?(0,I.jsx)(`a`,{className:`shrink-0 text-primary hover:text-primary-strong`,href:n,rel:`noreferrer`,target:`_blank`,children:`open`}):null]})}function fm(e){if(!e)return;let t=pm(e);if(t)return`Ask about ${t}...`}function pm(e){let t=hm(e.uiMetadata);if(t?.source===`github-pr`&&typeof t.repo==`string`)return`${t.repo}#${t.prNumber}`;if(t?.source===`pr-watch`&&typeof t.repoFullName==`string`)return`${t.repoFullName}#${t.prNumber} watch`;if(typeof t?.repoFullName==`string`&&typeof t.prNumber==`number`)return`${t.repoFullName}#${t.prNumber}`;if(e.linkedTaskId)return e.linkedTaskId;if(e.linkedWatchId)return e.linkedWatchId;if(e.linkedRepoId)return e.linkedRepoId}function mm(e){let t=hm(e.uiMetadata);return typeof t?.url==`string`?t.url:void 0}function hm(e){return e&&typeof e==`object`?e:void 0}var gm={limit:12},_m=(0,F.lazy)(()=>y(()=>import(`./GitHubPrReview-Bf8PXCaq.js`).then(e=>({default:e.GitHubPrReview})),__vite__mapDeps([5,1,2,6,4]))),vm={id:`github-pr-list`,title:`GitHub PR list`,kind:`data`,defaultConfig:gm,parseConfig:e=>Fr(gm,e),Component({config:e}){let t=h(),{data:n,error:r,isLoading:i}=d({queryKey:b.githubPrs,queryFn:ce,refetchInterval:5*6e4}),{data:a}=d({queryKey:b.repoRegistry,queryFn:me,refetchInterval:5*6e4});Sr(e=>{(e.action===`config_reload`||Cr(e,`repos.json`))&&(t.invalidateQueries({queryKey:b.githubPrs}),t.invalidateQueries({queryKey:b.repoRegistry}))});let o=n?.login?`@${n.login}`:`@you`,s=bm(),c=n?n.items.slice(0,e.limit):[],l=new Map((a?.repos??[]).map(e=>[`${e.github.owner}/${e.github.name}`,e.id])),u=n?`${c.length} PR${c.length===1?``:`s`} · ${n.repos?.length??0} REPOS`:`OPEN PRs`;return(0,I.jsxs)(`div`,{className:`terminal-list flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`header`,{className:`panel-header flex h-8 items-center justify-between border-b border-line px-3.5 font-mono text-[11px] tracking-[0.14em]`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-accent`,children:[(0,I.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-accent`}),`GITHUB · `,o]}),(0,I.jsx)(`span`,{className:`text-muted`,children:u})]}),i?(0,I.jsx)(jm,{}):null,r?(0,I.jsx)(S,{title:`GitHub unavailable`,detail:`${k(r)}. Set GITHUB_TOKEN in .env to show authored, assigned, and review-requested PRs.`}):null,n&&c.length===0?(0,I.jsx)(S,{title:`Inbox zero`,detail:`Authored, assigned, and review-requested PRs are clear.`}):null,n&&c.length>0?(0,I.jsx)(v,{className:`flex-1`,children:(0,I.jsx)(`ul`,{children:c.map(e=>(0,I.jsx)(ym,{initialShowReview:s?.repo===e.repo&&s.number===e.number,item:e,repoId:l.get(e.repo)},e.url))})}):null]})}};function ym({initialShowReview:e,item:t,repoId:n}){let[r,i]=(0,F.useState)(!!e),a=(0,F.useId)();return(0,I.jsx)(`li`,{className:`pr-row px-3.5 py-2 last:border-b-0`,children:(0,I.jsxs)(`div`,{className:`group`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-3 font-mono text-[10.5px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:t.repo}),(0,I.jsxs)(`span`,{className:`shrink-0`,children:[`#`,t.number,` · `,L(t.updatedAt)]})]}),(0,I.jsx)(`p`,{className:`line-clamp-2 text-[13px] font-medium leading-[1.35] text-ink group-hover:text-primary-strong`,children:t.title}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2.5 font-mono text-[10px] text-primary`,children:[(0,I.jsxs)(`span`,{className:Nm(t),children:[`● `,Mm(t)]}),(0,I.jsxs)(`span`,{className:`text-violet`,children:[`◆ `,Pm(t)]}),t.stale?(0,I.jsx)(`span`,{className:`text-accent`,children:`◇ stale`}):null,t.draft||t.labels.includes(`draft`)?(0,I.jsx)(`span`,{className:`text-muted`,children:`△ draft`}):null,n?null:(0,I.jsx)(`span`,{className:`text-muted`,children:`◇ repo unregistered`})]}),t.labels.length>0?(0,I.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:t.labels.slice(0,3).map(e=>(0,I.jsx)(x,{children:e},e))}):null,(0,I.jsxs)(`div`,{className:`mt-1.5 flex justify-end gap-1.5 font-mono text-[10px]`,children:[(0,I.jsx)(E,{className:`min-h-[28px] shrink-0 border-line bg-transparent px-2 py-1 text-[10px] text-muted`,"aria-controls":r?a:void 0,"aria-expanded":r,onClick:()=>i(e=>!e),type:`button`,children:r?`hide diff`:`review`}),(0,I.jsx)(Ar,{kind:`task`,label:`session`,linkedRepoId:n??null,linkedTaskId:`github-pr:${t.repo}#${t.number}`,summary:`${t.repo}#${t.number}: ${t.title}. ${Mm(t)}; relation ${Pm(t)}.`,title:`PR ${t.repo}#${t.number}`,uiMetadata:{source:`github-pr`,repo:t.repo,prNumber:t.number,url:t.url,state:t.state,checks:t.checks?.status??null,relations:t.relations}}),(0,I.jsx)(xm,{item:t}),Em(t)?(0,I.jsx)(Sm,{item:t}):null,(0,I.jsx)(km,{item:t}),(0,I.jsx)(`a`,{className:`inline-flex min-h-[28px] shrink-0 items-center border border-line px-2 py-1 text-muted hover:border-primary hover:text-primary focus:outline-none focus:ring-1 focus:ring-primary`,href:t.url,rel:`noreferrer`,target:`_blank`,children:`open`})]}),r?(0,I.jsx)(`div`,{className:`mt-2`,id:a,children:(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(M,{label:`Loading PR review.`}),children:(0,I.jsx)(_m,{pr:t})})}):null]})},t.url)}function bm(){if(typeof window>`u`)return null;let e=new URLSearchParams(window.location.search),t=e.get(`prReviewRepo`)?.trim(),n=Number(e.get(`prReviewNumber`));return!t||!Number.isInteger(n)||n<1?null:{repo:t,number:n}}function xm({item:e}){let t=h(),n=P({mutationFn:()=>le({ref:`${e.repo}#${e.number}`,origin:`panel`}),onSuccess(){t.invalidateQueries({queryKey:b.prReviews})}});return(0,I.jsx)(E,{className:`min-h-[28px] shrink-0 border-line bg-transparent px-2 py-1 text-[10px] text-muted`,disabled:n.isPending,onClick:()=>n.mutate(),title:n.error?k(n.error):n.data?`Review workflow ${n.data.runId} is running. Follow it in Reviews.`:`Prepare local reports and Neon-origin draft comments through the review workflow`,type:`button`,children:n.isPending?`queuing`:n.data?`queued`:`neon review`})}function Sm({item:e}){let t=Qt(),n=h(),r=P({mutationFn:async()=>await t.workflows.invoke(`fix-pr-ci`,{input:{ref:`${e.repo}#${e.number}`}}),onSuccess(e){n.invalidateQueries({queryKey:b.workflowObservability}),n.invalidateQueries({queryKey:b.workflowSummaries}),n.invalidateQueries({queryKey:b.reports}),Cm(n,e.runId)}});return(0,I.jsx)(E,{className:`min-h-[28px] shrink-0 border-line bg-transparent px-2 py-1 text-[10px] text-muted`,disabled:r.isPending,onClick:()=>r.mutate(),title:r.error?k(r.error):r.data?`Queued CI fix workflow run ${r.data.runId}. Reports and prepared-diff state will refresh when the run completes.`:`Create a CI dossier and start a bounded local fix workflow`,type:`button`,children:r.isPending?`queuing`:r.data?`queued`:`fix CI`})}function Cm(e,t){let n=!1,r=!1,i=()=>{e.invalidateQueries({queryKey:b.reports}),e.invalidateQueries({queryKey:b.notifications}),e.invalidateQueries({queryKey:b.kiloTasks}),e.invalidateQueries({queryKey:b.autopilotState}),e.invalidateQueries({queryKey:b.worktrees}),e.invalidateQueries({queryKey:b.workflowObservability}),e.invalidateQueries({queryKey:b.workflowSummaries})},a=()=>{window.setTimeout(()=>void o(!0),Tm)},o=async o=>{if(!r)try{let s=Om(await e.fetchQuery({queryKey:b.workflowObservability,queryFn:Hn,staleTime:0}),t,n,o);if(n=s.sawActiveRun,s.shouldRefresh&&i(),s.done){r=!0;return}o&&s.sawActiveRun&&a()}catch{if(o&&!n){i(),r=!0;return}o&&a()}};for(let e of wm)window.setTimeout(()=>void o(e===wm.at(-1)),e)}var wm=[15e3,45e3,9e4,15e4,21e4],Tm=6e4;function Em(e){return e.checks?.status===`failure`||e.checkError!==void 0}function Dm(e,t,n){let r=e.activeRuns.some(e=>e.runId===t),i=[...e.recentFailures,...e.recentData,...e.recentEvents].some(e=>e.runId===t&&e.eventType===`run_end`);return{terminal:i,sawActiveRun:n||r,shouldRefresh:i||n&&!r}}function Om(e,t,n,r){let i=Dm(e,t,n),a=r&&!i.sawActiveRun;return{...i,shouldRefresh:i.shouldRefresh||a,done:i.terminal||i.shouldRefresh||a}}function km({item:e}){let t=Qt(),n=h(),r=`${e.repo}#${e.number}`,{data:i}=d({queryKey:b.prWatches,queryFn:_r,refetchInterval:3e4}),a=i?.watches.find(t=>t.id.toLowerCase()===r.toLowerCase()||t.repoFullName.toLowerCase()===e.repo.toLowerCase()&&t.prNumber===e.number),o=a&&!Am(a.status)?a:void 0,s=P({mutationFn:async()=>{let e=await t.workflows.invoke(`command-run`,{input:{command:`/watch-pr ${r}`,surface:`dashboard`},wait:`result`}),n={...e.result,flueRunId:e.runId};if(!n.ok)throw Error(n.message);return n},onSuccess(){n.invalidateQueries({queryKey:b.prWatches}),n.invalidateQueries({queryKey:b.workflowObservability}),n.invalidateQueries({queryKey:b.autopilotState})}}),c=!!(o||s.data);return(0,I.jsx)(E,{className:`min-h-[28px] shrink-0 border-line bg-transparent px-2 py-1 text-[10px] text-muted`,disabled:s.isPending||!!o,onClick:()=>s.mutate(),title:s.error?k(s.error):o?`Watching ${o.id}`:a?`Re-watch ${a.id}`:s.data?`${s.data.message} · run ${s.data.flueRunId}`:`Watch this PR until checks are green`,type:`button`,children:s.isPending?`watching`:c?`watched`:`watch`})}function Am(e){return e===`closed`||e===`merged`||e===`green`}function jm(){return(0,I.jsx)(`div`,{className:`space-y-2 p-3`,children:Array.from({length:8}).map((e,t)=>(0,I.jsxs)(`div`,{className:`border border-line bg-soft p-2`,children:[(0,I.jsx)(`div`,{className:`h-3 w-4/5 bg-line`}),(0,I.jsx)(`div`,{className:`mt-2 h-2 w-3/5 bg-line`})]},t))})}function Mm(e){return e.checkError||!e.checks?`checks unknown`:e.checks.status===`success`?`checks pass`:e.checks.status===`failure`?`${e.checks.failed} failed`:e.checks.status===`pending`?`${e.checks.pending} pending`:`no checks`}function Nm(e){return e.checks?.status===`failure`?`text-accent`:e.checks?.status===`pending`?`text-violet`:e.checks?.status===`success`?`text-primary`:`text-muted`}function Pm(e){return e.relations.includes(`review-requested`)?`review requested`:e.relations.includes(`assigned`)?`assigned`:e.relations.includes(`authored`)?`authored`:`${e.comments||0} comments`}var Fm={id:`host-metrics`,title:`Host metrics`,kind:`status`,defaultConfig:{},Component(){let[e,t]=(0,F.useState)(()=>new Date),{data:n,error:r,isLoading:i}=d({queryKey:b.hostMetrics,queryFn:En,refetchInterval:1e3}),{data:a}=d({queryKey:b.runtimeStatus,queryFn:wn,refetchInterval:5e3});if((0,F.useEffect)(()=>{let e=window.setInterval(()=>t(new Date),1e3);return()=>window.clearInterval(e)},[]),i)return(0,I.jsx)(`div`,{className:`powerline h-full`,children:Array.from({length:6}).map((e,t)=>(0,I.jsx)(`div`,{className:`status-segment min-w-36`,children:(0,I.jsx)(`span`,{className:`h-3 w-20 rounded-sm bg-line`})},t))});if(r)return(0,I.jsx)(S,{title:`Metrics unavailable`,detail:k(r)});if(!n)return(0,I.jsx)(S,{title:`Metrics unavailable`,detail:`No data.`});let o=Math.round(n.memory.usedRatio*100),s=n.cpu.loadPercent??Math.min(100,Math.round(n.loadAverage[0]/Math.max(1,n.cpuCount)*100)),c=n.gpu.temperatureC??n.temperature.cpuC??n.temperature.maxC;return(0,I.jsxs)(`div`,{className:`powerline h-full`,children:[(0,I.jsxs)(`div`,{className:`brand-segment px-3.5`,children:[(0,I.jsx)(`span`,{className:`brand-mark`}),(0,I.jsx)(`span`,{children:`neondeck`}),(0,I.jsxs)(`span`,{className:`text-[11px] font-normal text-muted`,children:[`v`,`1.0.0-beta.10`]})]}),(0,I.jsx)(Im,{}),(0,I.jsx)(Lm,{label:`CPU`,tone:`cyan`,value:`${Math.round(s)}%`}),(0,I.jsx)(Im,{}),(0,I.jsx)(Lm,{label:`MEM`,tone:o>90?`pink`:`cyan`,value:`${Rm(n.memory.used)}/${Rm(n.memory.total)}`}),(0,I.jsx)(Im,{}),(0,I.jsx)(Lm,{label:`GPU`,tone:`teal`,value:zm(n.gpu.utilizationPercent)}),(0,I.jsx)(Im,{}),(0,I.jsx)(Lm,{label:``,tone:`teal`,value:Bm(c)}),(0,I.jsx)(Im,{}),(0,I.jsx)(Lm,{label:`NET`,tone:`violet`,value:`↓${Vm(n.network.downBytesPerSecond)} ↑${Vm(n.network.upBytesPerSecond)}`}),(0,I.jsx)(Im,{}),(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5 px-3 ${a?.ok?`text-primary`:`text-accent`}`,children:[(0,I.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${a?.ok?`bg-primary`:`bg-accent`} shadow-[0_0_8px_currentColor] [animation:nd-pulse_2.4s_ease-in-out_infinite]`}),a?.service??`runtime`,`:`,a?.status??`unknown`]}),(0,I.jsxs)(`p`,{className:`ml-auto px-3.5 text-ink tabular-nums`,children:[Hm(e).hourMinute,(0,I.jsx)(`span`,{className:`[animation:nd-blink_1.1s_step-end_infinite]`,children:`:`}),Hm(e).seconds]})]})}};function Im(){return(0,I.jsx)(`span`,{className:`status-separator`,children:`│`})}function Lm({label:e,tone:t,value:n}){return(0,I.jsxs)(`div`,{className:`status-segment`,children:[e?(0,I.jsx)(`span`,{className:`status-label status-${t}`,children:e}):null,(0,I.jsx)(`span`,{className:`status-value`,children:n})]})}function Rm(e){let t=e/1024/1024/1024;return`${t.toFixed(t>=10?0:1)}G`}function zm(e){return e==null?`n/a`:`${Math.round(e)}%`}function Bm(e){return e==null?`n/a °C`:`${Math.round(e)} °C`}function Vm(e){if(e==null)return`n/a`;let t=e*8/1e6;return t<.05?`0.0`:t<10?t.toFixed(1):Math.round(t).toString()}function Hm(e){let[t=``,n=``]=e.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}).split(/:(?=\d{2}$)/);return{hourMinute:t,seconds:n}}var Um=(0,F.lazy)(()=>y(()=>import(`./surfaces-Dlg1xLbg.js`).then(e=>({default:e.SkillPatchDiffReview})),__vite__mapDeps([0,1,2,3,4]))),Wm={limit:18,refreshSeconds:30},Gm={id:`learning-operator`,title:`Learning operator`,kind:`data`,defaultConfig:Wm,parseConfig:e=>Fr(Wm,e),Component({config:e}){let[t,n]=(0,F.useState)(`candidates`),[r,i]=(0,F.useState)(`all`),[a,o]=(0,F.useState)(`all`),s=r===`all`?void 0:r,c=a===`all`?void 0:a,{data:l,error:u,isLoading:f}=d({queryKey:[...b.learningState,{candidateStatus:s,candidateTarget:c,limit:e.limit}],queryFn:()=>Qn({candidateStatus:s,candidateTarget:c,limit:e.limit}),refetchInterval:Math.max(10,e.refreshSeconds)*1e3});return f?(0,I.jsx)(S,{title:`Learning loading`,detail:`Reading audit state.`}):u?(0,I.jsx)(S,{title:`Learning unavailable`,detail:k(u)}):l?(0,I.jsx)(Km,{candidateFilter:r,candidateTargetFilter:a,limit:e.limit,onCandidateFilterChange:i,onCandidateTargetFilterChange:o,onTabChange:n,state:l,tab:t}):(0,I.jsx)(S,{title:`Learning unavailable`,detail:`No data.`})}};function Km({candidateFilter:e,candidateTargetFilter:t,limit:n,onCandidateFilterChange:r,onCandidateTargetFilterChange:i,onTabChange:a,state:o,tab:s}){let c=(0,F.useMemo)(()=>(e===`all`?o.candidates:o.candidates.filter(t=>t.status===e)).slice(0,n),[e,n,o.candidates]),l=[...o.learningEvents,...o.memoryEvents].sort((e,t)=>Date.parse(t.createdAt)-Date.parse(e.createdAt)).slice(0,n);return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`header`,{className:`panel-header flex h-8 items-center justify-between border-b border-line px-3 font-mono text-[10.5px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:`text-violet`,children:`LEARNING`}),(0,I.jsxs)(x,{className:o.summary.pendingDecisions>0?`border-primary text-primary`:``,children:[o.summary.pendingDecisions,` pending`]})]}),(0,I.jsxs)(`div`,{className:`border-b border-line px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`grid grid-cols-4 gap-1.5 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(A,{label:`reviews`,value:ch(o.summary.reviews)}),(0,I.jsx)(A,{label:`failed`,value:o.summary.failedReviews}),(0,I.jsx)(A,{label:`memory`,value:o.summary.activeMemories}),(0,I.jsx)(A,{label:`PR events`,value:o.summary.handledPrEvents})]}),(0,I.jsx)(`div`,{className:`mt-2 grid grid-cols-3 gap-1`,children:[`reviews`,`candidates`,`audit`].map(e=>(0,I.jsx)(`button`,{className:nh(s===e),onClick:()=>a(e),type:`button`,children:e},e))})]}),s===`candidates`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(qm,{filter:e,onFilterChange:r}),(0,I.jsx)(Jm,{filter:t,onFilterChange:i})]}):null,(0,I.jsx)(v,{className:`flex-1`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5 p-3`,children:[s===`reviews`?(0,I.jsx)(Ym,{reviews:o.reviews.slice(0,n)}):null,s===`candidates`?(0,I.jsx)(Xm,{candidates:c}):null,s===`audit`?(0,I.jsx)(Zm,{events:l}):null]})}),(0,I.jsx)(th,{})]})}function qm({filter:e,onFilterChange:t}){return(0,I.jsx)(`div`,{className:`grid grid-cols-5 gap-1 border-b border-line px-3 py-2`,children:[`all`,`proposed`,`applied`,`rejected`,`archived`].map(n=>(0,I.jsx)(`button`,{className:nh(e===n),onClick:()=>t(n),type:`button`,children:n},n))})}function Jm({filter:e,onFilterChange:t}){return(0,I.jsx)(`div`,{className:`grid grid-cols-3 gap-1 border-b border-line px-3 py-2`,children:[`all`,`memory`,`skill`].map(n=>(0,I.jsx)(`button`,{className:nh(e===n),onClick:()=>t(n),type:`button`,children:n},n))})}function Ym({reviews:e}){return e.length===0?(0,I.jsx)(M,{label:`No learning reviews.`}):e.map(e=>(0,I.jsx)(Qm,{review:e},e.id))}function Xm({candidates:e}){return e.length===0?(0,I.jsx)(M,{label:`No learning candidates in this filter.`}):e.map(e=>(0,I.jsx)($m,{candidate:e},e.id))}function Zm({events:e}){return e.length===0?(0,I.jsx)(M,{label:`No learning audit events.`}):e.map(e=>(0,I.jsx)(eh,{event:e},e.id))}function Qm({review:e}){return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:[e.kind,`:`,e.id]}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:e.error??ah(e.result)})]}),(0,I.jsx)(x,{className:rh(e.status),children:e.status})]}),(0,I.jsxs)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-muted`,children:[e.model,` · `,e.thinkingLevel,` ·`,` `,L(e.startedAt)]})]})}function $m({candidate:e}){let[t,n]=(0,F.useState)(!1),r=h(),i=P({mutationFn:t=>er(e.id,t,`Dashboard decision.`),onSettled(){r.invalidateQueries({queryKey:b.learningState}),r.invalidateQueries({queryKey:b.memories}),r.invalidateQueries({queryKey:b.runtimeStatus})}}),a=P({mutationFn:()=>tr(e.id),onSettled(){r.invalidateQueries({queryKey:b.learningState}),r.invalidateQueries({queryKey:b.runtimeStatus})}}),o=ih(e.patch),s=i.isPending||a.isPending;return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:[e.target,`:`,e.skillId??e.key??e.id]}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:e.reason??o?.summary??sh(e.value)})]}),(0,I.jsx)(x,{className:rh(e.status),children:e.status})]}),o?.diff?(0,I.jsxs)(`div`,{className:`mt-1.5`,children:[(0,I.jsx)(E,{className:`h-6 px-2 py-0 font-mono text-[10px]`,onClick:()=>n(e=>!e),type:`button`,children:t?`hide diff`:`view diff`}),t?(0,I.jsx)(`div`,{className:`mt-1.5`,children:(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(M,{label:`Loading diff viewer.`}),children:(0,I.jsx)(Um,{patch:o.diff,title:e.skillId??e.key??e.id})})}):null]}):null,(0,I.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 font-mono text-[10px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.reviewId??e.id,` ·`,` `,L(e.createdAt)]}),e.status===`proposed`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(E,{className:`h-6 px-2 py-0 font-mono text-[10px]`,disabled:s,onClick:()=>i.mutate(`reject`),children:`reject`}),(0,I.jsx)(E,{className:`h-6 border-primary px-2 py-0 font-mono text-[10px] text-primary`,disabled:s,onClick:()=>i.mutate(`approve`),children:`apply`})]}):null,e.target===`skill`&&e.status===`applied`&&o?.restoreFromAudit?(0,I.jsx)(E,{className:`h-6 border-accent px-2 py-0 font-mono text-[10px] text-accent`,disabled:s,onClick:()=>a.mutate(),children:`restore`}):null]}),i.error||a.error?(0,I.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[10.5px] leading-4 text-accent`,children:k(i.error??a.error)}):null]})}function eh({event:e}){return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.type??e.action??`audit`}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:e.reason??oh(e.data??e.after)})]}),(0,I.jsx)(x,{children:e.source??e.actor??`audit`})]}),(0,I.jsxs)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-muted`,children:[e.prKey??e.sessionId??e.memoryId??e.id,` ·`,` `,L(e.createdAt)]})]})}function th(){let e=h(),t=P({mutationFn:nr,onSettled(){e.invalidateQueries({queryKey:b.learningState})}});return(0,I.jsxs)(`footer`,{className:`grid grid-cols-2 gap-1 border-t border-line p-2`,children:[(0,I.jsx)(E,{className:`h-7 px-2 py-0 font-mono text-[10px]`,disabled:t.isPending,onClick:()=>t.mutate(`conversation`),children:`review chat`}),(0,I.jsx)(E,{className:`h-7 px-2 py-0 font-mono text-[10px]`,disabled:t.isPending,onClick:()=>t.mutate(`pr-batch`),children:`review PRs`})]})}function nh(e){return e?`border border-primary bg-soft px-1.5 py-1 font-mono text-[10px] text-primary`:`border border-line bg-soft px-1.5 py-1 font-mono text-[10px] text-muted hover:border-primary hover:text-primary`}function rh(e){return e===`failed`||e===`rejected`?`border-accent text-accent`:e===`completed`||e===`applied`?`border-primary text-primary`:e===`proposed`||e===`running`?`border-violet text-violet`:``}function ih(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function ah(e){if(!e||typeof e!=`object`||Array.isArray(e))return sh(e);let t=e;return sh(t.summary??t.message??t)}function oh(e){return sh(e)||`No audit detail.`}function sh(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e==null?``:JSON.stringify(e)}function ch(e){return Object.values(e).reduce((e,t)=>e+t,0)}var lh={limit:8},uh={id:`memory-panel`,title:`Memory`,kind:`data`,defaultConfig:lh,parseConfig:e=>Fr(lh,e),Component({config:e}){let{data:t,error:n,isLoading:r}=d({queryKey:b.memories,queryFn:()=>Zn(),refetchInterval:3e4});return r?(0,I.jsx)(S,{title:`Memory loading`,detail:`Reading durable notes.`}):n?(0,I.jsx)(S,{title:`Memory unavailable`,detail:k(n)}):(0,I.jsx)(dh,{limit:e.limit,memories:t?.memories??[]})}};function dh({limit:e,memories:t}){return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`header`,{className:`panel-header flex h-8 items-center justify-between border-b border-line px-3 font-mono text-[10.5px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:`text-violet`,children:`MEMORY`}),(0,I.jsxs)(x,{children:[t.length,` entries`]})]}),(0,I.jsx)(v,{className:`flex-1`,children:(0,I.jsx)(`div`,{className:`space-y-2.5 p-3`,children:(0,I.jsxs)(`section`,{children:[(0,I.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between font-mono text-[10px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:`text-primary`,children:`DURABLE NOTES`}),(0,I.jsx)(`span`,{className:`text-muted`,children:t.length})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[t.slice(0,e).map(e=>(0,I.jsx)(fh,{memory:e},e.id)),t.length===0?(0,I.jsx)(M,{label:`No durable memory recorded.`}):null]})]})})})]})}function fh({memory:e}){return(0,I.jsx)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:[e.scope,`:`,e.key]}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:ph(e.value)})]}),(0,I.jsx)(x,{className:mh(e.scope),children:e.scope})]})})}function ph(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e==null?``:JSON.stringify(e)}function mh(e){return e===`local`?`border-accent text-accent`:e===`project`?`border-primary text-primary`:``}var hh={limit:12,refreshSeconds:60},gh={id:`reports-panel`,title:`Reports`,kind:`data`,defaultConfig:hh,parseConfig:e=>Fr(hh,e),Component({config:e}){let{data:t,error:n,isLoading:r}=d({queryKey:[...b.reports,e.limit],queryFn:()=>fr({excludeKind:`pr-review`,limit:e.limit}),refetchInterval:Math.max(10,e.refreshSeconds)*1e3});if(r)return(0,I.jsx)(S,{title:`Reports loading`,detail:`Reading local artifacts.`});if(n)return(0,I.jsx)(S,{title:`Reports unavailable`,detail:k(n)});let i=t?.items??[];return(0,I.jsxs)(`div`,{className:`terminal-list flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`header`,{className:`panel-header flex h-8 items-center justify-between border-b border-line px-3 font-mono text-[10.5px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:`text-primary`,children:`REPORTS`}),(0,I.jsxs)(x,{children:[i.length,` local`]})]}),i.length===0?(0,I.jsx)(S,{title:`No reports`,detail:`Unlinked CI, drift, triage, and hygiene reports will appear here. Review artifacts stay with their review.`}):(0,I.jsx)(v,{className:`flex-1`,children:(0,I.jsx)(`div`,{className:`space-y-1.5 p-3`,children:i.map(e=>(0,I.jsx)(_h,{report:e},e.id))})})]})}};function _h({report:e}){let t=vh(e.summary),n=h(),r=P({mutationFn:()=>hr(e.id),onSuccess:()=>{n.invalidateQueries({queryKey:b.reports})}});return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.title}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:t||e.sourceRef||e.repoId||e.createdBy})]}),(0,I.jsx)(x,{children:e.kind})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.sourceRef??e.repoId??e.createdBy,` ·`,` `,L(e.createdAt)]}),e.kind===`docs-drift`?(0,I.jsx)(`button`,{className:`shrink-0 border border-line px-1.5 py-0.5 text-muted hover:border-primary hover:text-primary focus:outline-none focus:ring-1 focus:ring-primary disabled:cursor-wait disabled:opacity-60`,disabled:r.isPending,onClick:()=>r.mutate(),title:r.error?k(r.error):`Stage a docs-only Kilo fix`,type:`button`,children:r.isPending?`staging`:`stage`}):null,(0,I.jsx)(`a`,{className:`shrink-0 border border-line px-1.5 py-0.5 text-muted hover:border-primary hover:text-primary focus:outline-none focus:ring-1 focus:ring-primary`,href:`/reports/${encodeURIComponent(e.id)}`,rel:`noreferrer`,target:`_blank`,children:`open`})]})]})}function vh(e){if(e==null)return null;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(Array.isArray(e))return e.map(e=>vh(e)).filter(Boolean).join(` · `);if(typeof e==`object`){let t=e,n=t.summary??t.message??t.title;return typeof n==`string`?n:Object.entries(t).slice(0,3).map(([e,t])=>`${e}: ${vh(t)??`n/a`}`).join(` · `)}return null}var yh={id:`reviews-panel`,title:`Reviews`,kind:`data`,defaultConfig:{},Component(){let e=h(),[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(``),{data:o,error:s,isLoading:c}=d({queryKey:b.prReviews,queryFn:()=>ue()}),l=P({mutationFn:e=>le({ref:e,origin:`panel`}),onSuccess(t){e.setQueryData(b.prReviews,e=>Th(e,t.review)),i(``),n(!1)}}),u=P({mutationFn:e=>se(e),onSuccess(t){e.setQueryData(b.prReviews,e=>Th(e,t.review))}}),f=P({mutationFn:e=>N(e),onSuccess(t){e.setQueryData(b.prReviews,e=>Th(e,t.review))}});return(0,F.useEffect)(()=>a(t=>{e.setQueryData(b.prReviews,e=>Th(e,t.review))},void 0,()=>{e.invalidateQueries({queryKey:b.prReviews})}),[e]),(0,I.jsxs)(`div`,{className:`terminal-list flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`header`,{className:`panel-header flex h-8 items-center justify-between border-b border-line px-3 font-mono text-[10.5px] tracking-[0.12em]`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-primary`,children:[(0,I.jsx)(`span`,{className:`h-1.5 w-1.5 bg-primary`}),`REVIEWS`]}),(0,I.jsx)(E,{"aria-expanded":t,className:`min-h-[24px] bg-transparent px-2 py-0 text-[10px]`,onClick:()=>n(e=>!e),type:`button`,children:t?`cancel`:`+ review a PR`})]}),t?(0,I.jsxs)(`form`,{className:`flex gap-2 border-b border-line bg-field p-2`,onSubmit:e=>{e.preventDefault();let t=r.trim();t&&l.mutate(t)},children:[(0,I.jsx)(`label`,{className:`sr-only`,htmlFor:`pr-review-ref`,children:`Pull request URL or reference`}),(0,I.jsx)(`input`,{className:`h-7 min-w-0 flex-1 border border-line bg-canvas px-2 font-mono text-[11px] text-ink outline-none placeholder:text-muted focus:border-primary`,id:`pr-review-ref`,onChange:e=>i(e.currentTarget.value),placeholder:`owner/repo#101 or GitHub URL`,value:r}),(0,I.jsx)(E,{disabled:!r.trim()||l.isPending,type:`submit`,children:l.isPending?`starting`:`start`})]}):null,l.error||u.error||f.error?(0,I.jsx)(`p`,{className:`border-b border-accent/60 px-3 py-1.5 font-mono text-[10px] text-accent`,children:k(l.error??u.error??f.error)}):null,c?(0,I.jsx)(S,{title:`Reviews loading`,detail:`Reading the local review inbox.`}):null,s?(0,I.jsx)(S,{title:`Reviews unavailable`,detail:k(s)}):null,o?(0,I.jsx)(v,{className:`flex-1`,children:(0,I.jsxs)(`div`,{className:`divide-y divide-line`,children:[(0,I.jsx)(bh,{empty:`No pull requests are requesting your review.`,title:`AWAITING YOUR REVIEW`,children:o.groups.awaiting.map(e=>(0,I.jsx)(xh,{item:e,onRestart:e=>u.mutate(e),onStart:e=>l.mutate(e),pending:l.isPending||u.isPending},`${e.pullRequest.repo}#${e.pullRequest.number}`))}),(0,I.jsx)(bh,{empty:`No reviews are running.`,title:`IN PROGRESS`,children:o.groups.inProgress.map(e=>(0,I.jsx)(Sh,{onReconcile:e=>f.mutate(e),pending:f.isPending,review:e},e.id))}),(0,I.jsx)(bh,{empty:`No prepared reviews need action.`,title:`NEEDS ACTION`,children:o.groups.needsAction.map(e=>(0,I.jsx)(Sh,{onRestart:e=>u.mutate(e),pending:u.isPending,review:e},e.id))}),(0,I.jsxs)(`details`,{className:`group`,children:[(0,I.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between px-3 py-2 font-mono text-[10px] tracking-[0.08em] text-muted focus:outline-none focus:ring-1 focus:ring-primary`,children:[(0,I.jsx)(`span`,{children:`SUBMITTED`}),(0,I.jsxs)(x,{children:[o.groups.submitted.length,` · 7D`]})]}),(0,I.jsx)(`div`,{className:`border-t border-line`,children:o.groups.submitted.length?o.groups.submitted.map(e=>(0,I.jsx)(Sh,{review:e},e.id)):(0,I.jsx)(`p`,{className:`px-3 py-2 text-[10.5px] text-muted`,children:`No reviews submitted in the last seven days.`})})]})]})}):null]})}};function bh({children:e,empty:t,title:n}){let r=Array.isArray(e)?e.length:+!!e;return(0,I.jsxs)(`section`,{children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between bg-field px-3 py-1.5 font-mono text-[10px] tracking-[0.08em] text-muted`,children:[(0,I.jsx)(`h3`,{children:n}),(0,I.jsx)(`span`,{className:`tabular-nums`,children:r})]}),(0,I.jsx)(`div`,{className:`divide-y divide-line`,children:r?e:(0,I.jsx)(`p`,{className:`px-3 py-2 text-[10.5px] text-muted`,children:t})})]})}function xh({item:e,onRestart:t,onStart:n,pending:r}){let{pullRequest:i,review:a}=e,o=!!(a?.headSha&&i.headSha&&a.headSha!==i.headSha);return(0,I.jsx)(`article`,{className:`px-3 py-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:[i.repo,`#`,i.number]}),(0,I.jsxs)(`p`,{className:`mt-0.5 truncate text-[10.5px] text-muted`,children:[`@`,i.author,` · `,i.title]}),(0,I.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-primary`,children:a?.status===`ready`?`Neon draft ready · ${a.seededCount}`:a?.status===`reviewing`?`Neon is reviewing…`:a?.status===`submitting`?`Submitting review to GitHub…`:o?`New commits since your review`:`No Neon draft yet`})]}),a?.status===`ready`&&!o?(0,I.jsx)(Ch,{review:a}):a&&a.status!==`reviewing`&&a.status!==`submitting`&&o?(0,I.jsx)(E,{disabled:r,onClick:()=>t(a.id),type:`button`,children:`re-review`}):a?.status===`reviewing`||a?.status===`submitting`?(0,I.jsx)(x,{children:a.status}):(0,I.jsx)(E,{disabled:r,onClick:()=>n(`${i.repo}#${i.number}`),type:`button`,children:`review`})]})})}function Sh({onReconcile:e,onRestart:t,pending:n=!1,review:r}){let[i,a]=(0,F.useState)(null);return(0,I.jsxs)(`article`,{className:`px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:[r.repoFullName,`#`,r.prNumber]}),(0,I.jsx)(`p`,{className:`mt-0.5 truncate text-[10.5px] text-muted`,children:r.title}),(0,I.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-primary`,children:wh(r)}),r.status===`ready`?(0,I.jsx)(`p`,{className:`mt-1 max-w-[65ch] text-[10px] leading-4 text-muted`,children:r.trustBoundary}):null]}),(0,I.jsx)(x,{children:r.status})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center justify-end gap-1.5 font-mono text-[10px]`,children:[r.reportIds.map((e,t)=>(0,I.jsx)(`button`,{className:`border border-line px-1.5 py-1 text-muted hover:border-primary hover:text-primary focus:outline-none focus:ring-1 focus:ring-primary`,onClick:()=>a(t),type:`button`,children:t===0?`overview`:t===1?`issues`:`report ${t+1}`},e)),r.status===`ready`||r.status===`submitted`?(0,I.jsx)(Ch,{review:r}):null,r.status===`failed`&&t?(0,I.jsx)(E,{disabled:n,onClick:()=>t(r.id),type:`button`,children:`retry`}):null,r.status===`submitting`&&e?(0,I.jsx)(E,{disabled:n,onClick:()=>e(r.id),type:`button`,children:n?`checking`:`recover submission`}):null]}),i===null?null:(0,I.jsx)(Oi,{initialReportIndex:i,onClose:()=>a(null),reportIds:r.reportIds,reviewLabel:`${r.repoFullName}#${r.prNumber}`,reviewUrl:r.reviewUrl})]})}function Ch({review:e}){return(0,I.jsx)(`a`,{className:`inline-flex min-h-[26px] items-center border border-primary px-2 py-1 font-mono text-[10px] text-primary focus:outline-none focus:ring-1 focus:ring-primary`,href:e.reviewUrl,rel:`noreferrer`,target:`_blank`,children:`open review`})}function wh(e){return e.status===`reviewing`?`reviewing…`:e.status===`submitting`?`submitting to GitHub…`:e.status===`failed`?e.failureMessage??`Review failed.`:e.status===`submitted`?`${e.verdict??`submitted`} · ${L(e.submittedAt??e.updatedAt)}`:`${e.findingCount} findings · ${e.seededCount} drafts${e.reportOnlyCount?` · ${e.reportOnlyCount} report-only`:``}`}function Th(e,t){let n=e?[t,...e.items.filter(e=>e.id!==t.id)].sort((e,t)=>Date.parse(t.updatedAt)-Date.parse(e.updatedAt)):[t];return{ok:!0,action:`pr_reviews_list`,changed:!1,items:n,groups:{awaiting:(e?.groups.awaiting??[]).map(e=>e.pullRequest.repo.toLowerCase()===t.repoFullName.toLowerCase()&&e.pullRequest.number===t.prNumber?{...e,review:t}:e),inProgress:n.filter(e=>e.status===`reviewing`||e.status===`submitting`),needsAction:n.filter(e=>e.status===`ready`||e.status===`failed`),submitted:n.filter(e=>e.status===`submitted`)},queueIssues:e?.queueIssues}}function Eh({onRefresh:e,status:t}){let[n,r]=(0,F.useState)(t.models.displayAssistant),[i,a]=(0,F.useState)(t.models.displayAssistantThinkingLevel),[o,s]=(0,F.useState)(t.models.utilityConfigured?t.models.utility:``),[c,l]=(0,F.useState)(t.models.utilityThinkingLevel),[u,d]=(0,F.useState)(t.models.subagents.repoResearcher??``),[f,p]=(0,F.useState)(t.models.subagentThinkingLevels.repoResearcher??`medium`),[m,h]=(0,F.useState)(t.models.subagents.ciInvestigator??``),[g,_]=(0,F.useState)(t.models.subagentThinkingLevels.ciInvestigator??`medium`),[v,y]=(0,F.useState)(t.models.subagents.releaseReviewer??``),[b,x]=(0,F.useState)(t.models.subagentThinkingLevels.releaseReviewer??`medium`),[S,C]=(0,F.useState)(jh(t.models.displayAssistantProvider)),w=(0,F.useRef)(jh(t.models.displayAssistantProvider)),T=Ph(t,S),[E,ee]=(0,F.useState)(T.enabled),[D,te]=(0,F.useState)(T.apiKeyEnv),[ne,re]=(0,F.useState)(T.organizationIdEnv??``),[ie,O]=(0,F.useState)(!1),[k,A]=(0,F.useState)(!1),j=(0,F.useRef)(null),ae=(0,F.useRef)(null),[M,oe]=(0,F.useState)(null),[se,N]=(0,F.useState)(null),[ce,le]=(0,F.useState)(!1),[ue,de]=(0,F.useState)(!1);(0,F.useEffect)(()=>{if(j.current===t.fetchedAt||(j.current=null,ie||ce))return;r(t.models.displayAssistant),a(t.models.displayAssistantThinkingLevel),s(t.models.utilityConfigured?t.models.utility:``),l(t.models.utilityThinkingLevel),d(t.models.subagents.repoResearcher??``),p(t.models.subagentThinkingLevels.repoResearcher??`medium`),h(t.models.subagents.ciInvestigator??``),_(t.models.subagentThinkingLevels.ciInvestigator??`medium`),y(t.models.subagents.releaseReviewer??``),x(t.models.subagentThinkingLevels.releaseReviewer??`medium`);let e=jh(t.models.displayAssistantProvider);w.current!==e&&(w.current=e,C(e))},[ie,ce,t]),(0,F.useEffect)(()=>{if(ae.current===t.fetchedAt||(ae.current=null,k||ue))return;let e=Ph(t,S);ee(e.enabled),te(e.apiKeyEnv),re(e.organizationIdEnv??``)},[k,S,ue,t]);async function P(r){r.preventDefault(),le(!0),oe(null);try{let r=Dh(t,{displayAssistant:n,displayThinking:i,utilityModel:o,utilityThinking:c,repoResearcher:u,repoThinking:f,ciInvestigator:m,ciThinking:g,releaseReviewer:v,releaseThinking:b});if(Object.keys(r).length===0){oe(`No model changes to save.`);return}let a=await Sn(r);oe(a.message),j.current=t.fetchedAt,O(!1),e()}catch(e){oe(e instanceof Error?e.message:String(e))}finally{le(!1)}}async function fe(n){n.preventDefault(),de(!0),N(null);try{let n=await Cn(S,{enabled:E,apiKeyEnv:D.trim()||null,...S===`kilocode`?{organizationIdEnv:ne.trim()||null}:{}});N(n.message),ae.current=t.fetchedAt,A(!1),e()}catch(e){N(e instanceof Error?e.message:String(e))}finally{de(!1)}}return(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`form`,{className:`space-y-2 border border-line bg-soft px-2.5 py-2`,onSubmit:P,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`p`,{className:`font-mono text-[10px] tracking-[0.12em] text-violet`,children:`MODELS`}),(0,I.jsx)(`button`,{className:`border border-violet px-2 py-1 font-mono text-[10px] text-violet disabled:opacity-50`,disabled:ce,type:`submit`,children:ce?`saving`:`save`})]}),(0,I.jsx)(Oh,{label:`display`,onChange:e=>{j.current=null,O(!0),r(e)},value:n}),(0,I.jsx)(kh,{label:`display think`,onChange:e=>{j.current=null,O(!0),a(e)},options:Ah,value:i}),(0,I.jsx)(Oh,{label:`utility`,onChange:e=>{j.current=null,O(!0),s(e)},placeholder:t.models.utility,value:o}),(0,I.jsx)(kh,{label:`utility think`,onChange:e=>{j.current=null,O(!0),l(e)},options:Ah,value:c}),(0,I.jsx)(Oh,{label:`repo`,onChange:e=>{j.current=null,O(!0),d(e)},value:u}),(0,I.jsx)(kh,{label:`repo think`,onChange:e=>{j.current=null,O(!0),p(e)},options:Ah,value:f}),(0,I.jsx)(Oh,{label:`ci`,onChange:e=>{j.current=null,O(!0),h(e)},value:m}),(0,I.jsx)(kh,{label:`ci think`,onChange:e=>{j.current=null,O(!0),_(e)},options:Ah,value:g}),(0,I.jsx)(Oh,{label:`release`,onChange:e=>{j.current=null,O(!0),y(e)},value:v}),(0,I.jsx)(kh,{label:`release think`,onChange:e=>{j.current=null,O(!0),x(e)},options:Ah,value:b}),M?(0,I.jsx)(Fh,{message:M}):null]}),(0,I.jsxs)(`form`,{className:`space-y-2 border border-line bg-soft px-2.5 py-2`,onSubmit:fe,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`label`,{className:`flex items-center gap-2 font-mono text-[10px] tracking-[0.12em] text-violet`,children:[(0,I.jsx)(`input`,{checked:E,className:`size-3 accent-current`,onChange:e=>{ae.current=null,A(!0),ee(e.target.checked)},type:`checkbox`}),`PROVIDER TARGET`]}),(0,I.jsxs)(`select`,{"aria-label":`Provider to configure`,className:`border border-line bg-field px-2 py-1 font-mono text-[10px] text-ink outline-none focus:border-violet`,onChange:e=>{ae.current=null,A(!1),C(jh(e.target.value))},value:S,children:[(0,I.jsx)(`option`,{value:`kilocode`,children:`KiloCode`}),(0,I.jsx)(`option`,{value:`openai`,children:`OpenAI`}),(0,I.jsx)(`option`,{value:`anthropic`,children:`Anthropic`})]}),(0,I.jsx)(`button`,{className:`border border-violet px-2 py-1 font-mono text-[10px] text-violet disabled:opacity-50`,disabled:ue,type:`submit`,children:ue?`saving`:`save`})]}),(0,I.jsx)(Oh,{label:`key env`,onChange:e=>{ae.current=null,A(!0),te(e)},value:D}),S===`kilocode`?(0,I.jsx)(Oh,{label:`org env`,onChange:e=>{ae.current=null,A(!0),re(e)},placeholder:`optional`,value:ne}):null,(0,I.jsx)(`p`,{className:`line-clamp-2 text-[10.5px] leading-4 text-muted`,children:`Environment variable references only. Provider registration changes apply after server restart.`}),se?(0,I.jsx)(Fh,{message:se}):null]})]})}function Dh(e,t){let n=t.displayAssistant.trim(),r=t.displayThinking.trim(),i=t.utilityModel.trim(),a=t.utilityThinking.trim(),o=t.repoResearcher.trim(),s=t.repoThinking.trim(),c=t.ciInvestigator.trim(),l=t.ciThinking.trim(),u=t.releaseReviewer.trim(),d=t.releaseThinking.trim(),f={},p={};return n!==e.models.displayAssistant&&(p.displayAssistant=n),r!==e.models.displayAssistantThinkingLevel&&(p.displayAssistantThinkingLevel=r),i?(!e.models.utilityConfigured||i!==e.models.utility)&&(p.utility=i):e.models.utilityConfigured&&(p.utility=null),a!==e.models.utilityThinkingLevel&&(p.utilityThinkingLevel=a),o!==e.models.subagents.repoResearcher&&(f.repoResearcher=o),s!==e.models.subagentThinkingLevels.repoResearcher&&(f.repoResearcherThinkingLevel=s),c!==e.models.subagents.ciInvestigator&&(f.ciInvestigator=c),l!==e.models.subagentThinkingLevels.ciInvestigator&&(f.ciInvestigatorThinkingLevel=l),u!==e.models.subagents.releaseReviewer&&(f.releaseReviewer=u),d!==e.models.subagentThinkingLevels.releaseReviewer&&(f.releaseReviewerThinkingLevel=d),Object.keys(f).length>0&&(p.subagents=f),p}function Oh({label:e,onChange:t,placeholder:n,value:r}){return(0,I.jsxs)(`label`,{className:`grid grid-cols-[4.5rem_minmax(0,1fr)] items-center gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:e}),(0,I.jsx)(`input`,{className:`min-w-0 border border-line bg-field px-2 py-1 text-[10.5px] text-ink outline-none focus:border-violet`,onChange:e=>t(e.target.value),placeholder:n,value:r})]})}function kh({label:e,onChange:t,options:n,value:r}){return(0,I.jsxs)(`label`,{className:`grid grid-cols-[4.5rem_minmax(0,1fr)] items-center gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:e}),(0,I.jsx)(`select`,{className:`min-w-0 border border-line bg-field px-2 py-1 text-[10.5px] text-ink outline-none focus:border-violet`,onChange:e=>t(e.target.value),value:r,children:n.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))})]})}var Ah=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function jh(e){return e===`openai`||e===`anthropic`?e:`kilocode`}function Mh(e){return Array.from(new Set([e.models.displayAssistant,e.models.utility,...Object.values(e.models.subagents)].map(e=>e.split(`/`)[0]??`kilocode`).map(jh)))}function Nh(e,t){return t===`kilocode`?e.providers.credentials.kilo:e.providers.credentials[t]}function Ph(e,t){let n=jh(t);return n===`openai`?{label:`OPENAI`,enabled:e.providers.configs.openai.enabled,apiKeyEnv:e.providers.configs.openai.apiKeyEnv,organizationIdEnv:null}:n===`anthropic`?{label:`ANTHROPIC`,enabled:e.providers.configs.anthropic.enabled,apiKeyEnv:e.providers.configs.anthropic.apiKeyEnv,organizationIdEnv:null}:{label:`KILOCODE`,enabled:e.providers.configs.kilocode.enabled,apiKeyEnv:e.providers.configs.kilocode.apiKeyEnv,organizationIdEnv:e.providers.configs.kilocode.organizationIdEnv}}function Fh({message:e}){return(0,I.jsx)(`p`,{className:`line-clamp-2 border border-line bg-field px-2 py-1 text-[10.5px] leading-4 text-muted`,children:e})}function Ih(e){return e?e.error?{label:`error`,className:`border-accent text-accent`}:e.dirty?{label:`${e.changeCount} dirty`,className:`border-accent text-accent`}:e.behind&&e.behind>0?{label:`${e.behind} behind`,className:`border-accent text-accent`}:e.ahead&&e.ahead>0?{label:`${e.ahead} ahead`,className:`border-violet text-violet`}:{label:`clean`,className:`border-primary text-primary`}:{label:`unknown`,className:``}}function Lh(e){return e.ok?`border-primary text-primary`:e.level===`attention`?`border-accent text-accent`:`border-violet text-violet`}function Rh(e){return e.level===`urgent`||e.level===`attention`?`border-accent text-accent`:e.level===`ready`?`border-primary text-primary`:``}function zh(e){return e.status===`pending`?`border-accent text-accent`:e.status===`executed`?`border-primary text-primary`:e.status===`failed`||e.status===`blocked`?`border-accent text-accent`:``}function Bh(e){return e.status===`applied`?`border-primary text-primary`:e.status===`failed`||e.status===`blocked`?`border-accent text-accent`:e.status===`preview`?`border-violet text-violet`:``}function Vh(e){return e===`succeeded`||e===`ready-to-verify`||e===`ready-to-push`?`border-primary text-primary`:e===`failed`||e===`unknown`?`border-accent text-accent`:e===`needs-reconcile`||e===`needs-review`||e===`discarded`?`border-violet text-violet`:e===`running`?`border-primary text-primary`:``}function Hh(e){return e.status===`connected`?`border-primary text-primary`:e.status===`needs-login`||e.status===`error`?`border-accent text-accent`:e.status===`connecting`?`border-violet text-violet`:``}function Uh(e){return e.status===`pending`?`border-accent text-accent`:e.status===`approved`||e.status===`used`?`border-primary text-primary`:e.status===`expired`?`border-violet text-violet`:``}function Wh(e){return e===`ready`||e===`succeeded`?`border-primary text-primary`:e===`failed`||e===`needs-sync`||e===`stale`||e===`cleanup-pending`?`border-accent text-accent`:e===`busy`||e===`prepared-diff`?`border-violet text-violet`:``}function Gh(e){let t=`https://neondeck.dev/docs/getting-started/`;return{config:{action:`neondeck_config_validate`,docsHref:`${t}#runtime-home`,docsLabel:`runtime`,surface:`action`,detail:`Validate config.json or rerun setup for the runtime home.`},"repos-config":{action:`neondeck_config_validate`,docsHref:`${t}#repositories`,docsLabel:`repos`,surface:`action`,detail:`Repair repos.json before repo status, queues, or watches run.`},skills:{action:`neondeck_skills_reload`,docsHref:`${t}#runtime-skills`,docsLabel:`skills`,surface:`action`,detail:`Fix ignored or invalid runtime skills, then reload skills.`},"session-context":{action:`neondeck_session_create`,docsHref:`${t}#agent-models`,docsLabel:`models`,surface:`action`,detail:`Start a new session so changed config, models, skills, or memory apply.`},"kilo-key":{action:`neondeck_config_update_provider`,docsHref:`${t}#secrets`,docsLabel:`secrets`,surface:`config`,detail:`Set the Kilo API key environment reference or disable Kilo.`},"openai-key":{action:`neondeck_config_update_provider`,docsHref:`${t}#secrets`,docsLabel:`secrets`,surface:`config`,detail:`Set the OpenAI API key environment reference or disable OpenAI.`},"anthropic-key":{action:`neondeck_config_update_provider`,docsHref:`${t}#secrets`,docsLabel:`secrets`,surface:`config`,detail:`Set the Anthropic API key environment reference or disable Anthropic.`},"github-token":{action:`GITHUB_TOKEN`,docsHref:`${t}#secrets`,docsLabel:`secrets`,surface:`env`,detail:`Set GitHub credentials before queues, checks, and watches run.`},"model-providers":{action:`neondeck_config_update_agent_models`,docsHref:`${t}#agent-models`,docsLabel:`models`,surface:`action`,detail:`Point model strings at registered, enabled providers.`},"execution-policy":{action:`neondeck_config_update_execution_policy`,docsHref:`${t}#execution-approvals`,docsLabel:`execution`,surface:`action`,detail:`Enable at least one execution backend and keep approval policy explicit.`},repos:{action:`neondeck_config_add_repo`,docsHref:`${t}#repositories`,docsLabel:`repos`,surface:`action`,detail:`Add a local checkout so queues, watches, and repo status have context.`},"flue-errors":{action:`neondeck_workflow_summaries_lookup`,docsHref:`${t}#commands`,docsLabel:`commands`,surface:`tool`,detail:`Inspect recent workflow failures before trusting automation output.`},"app-db":{action:`npm run setup`,docsHref:`${t}#runtime-home`,docsLabel:`runtime`,surface:`shell`,detail:`Initialize or repair the Neondeck app database.`},"flue-db":{action:`npm run setup`,docsHref:`${t}#runtime-home`,docsLabel:`runtime`,surface:`shell`,detail:`Initialize or repair the Flue runtime database.`}}[e.id]??{action:`neondeck_runtime_status_lookup`,docsHref:`${t}#runtime-home`,docsLabel:`docs`,surface:`tool`,detail:`Inspect the readiness message and update the related runtime config.`}}function Kh(e){return e.class===`host-execution`?0:e.requiresConfirmation?1:e.class===`safe-mutation`?2:3}function qh(e){let t=e.split(`/`).filter(Boolean);return t.length<=3?e:`.../${t.slice(-3).join(`/`)}`}function Jh(e){let t=Math.floor(e/60);if(t<60)return`${t}m`;let n=Math.floor(t/60);return n<48?`${n}h`:`${Math.floor(n/24)}d`}function Yh(e){return e<3600?`${Math.round(e/60)}m`:e<86400?`${Math.round(e/3600)}h`:`${Math.round(e/86400)}d`}function Xh(e){return{ok:!1,action:`safety_policy_read`,version:0,summary:{readOnly:0,safeMutation:0,destructiveMutation:0,hostExecution:0,requiresConfirmation:0,unattendedAllowed:0,audited:0},confirmationPolicy:`Safety policy could not be loaded.`,hostExecutionPolicy:`Host execution is unavailable.`,executionPolicy:{defaultBackend:`local`,enabledBackends:[],supportedBackends:[`local`,`exe.dev`],approvalMode:`manual`,unattended:`deny`,preapprovedCommandCount:0,defaultLocalAccess:!1,exeDevPlanned:!0},entries:[],fetchedAt:e}}function Zh(){return{ok:!0,action:`workflow_observability_read`,activeRuns:[],recentFailures:[],recentData:[],recentLogs:[],recentTools:[],recentOperations:[],recentEvents:[],fetchedAt:new Date().toISOString()}}function Qh({children:e,count:t,title:n,tone:r}){return(0,I.jsxs)(`section`,{children:[(0,I.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between font-mono text-[10px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:r===`primary`?`text-primary`:r===`accent`?`text-accent`:`text-violet`,children:n}),(0,I.jsx)(`span`,{className:`text-muted`,children:t})]}),e]})}function $h({checks:e}){return e.length===0?(0,I.jsx)(M,{label:`Setup checks are green.`}):(0,I.jsx)(`div`,{className:`space-y-1.5`,children:e.map(e=>(0,I.jsx)(eg,{check:e,step:Gh(e)},e.id))})}function eg({check:e,step:t}){return(0,I.jsxs)(`article`,{className:`border border-accent/60 bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.label}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:t.detail})]}),(0,I.jsx)(x,{className:Lh(e),children:e.level})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.action}),(0,I.jsx)(`span`,{className:`shrink-0 text-violet`,children:t.surface}),(0,I.jsx)(`a`,{className:`shrink-0 border border-line px-1.5 py-0.5 text-muted hover:border-primary hover:text-primary`,href:t.docsHref,rel:`noreferrer`,target:`_blank`,children:t.docsLabel})]}),(0,I.jsx)(`p`,{className:`mt-1.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:e.message})]})}function tg({check:e}){return(0,I.jsx)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.label}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:e.message})]}),(0,I.jsx)(x,{className:Lh(e),children:e.ok?`ok`:e.level})]})})}function ng({error:e}){return(0,I.jsx)(`article`,{className:`border border-accent/60 bg-soft px-2.5 py-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.title}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:e.message})]}),(0,I.jsx)(x,{className:`border-accent text-accent`,children:L(e.createdAt)})]})})}function rg({notification:e,onRefresh:t}){let n=h(),[r,i]=(0,F.useState)(!1),[a,o]=(0,F.useState)(null);async function s(n){i(!0),o(null);try{n===`read`?await ir(e.id):await ar(e.id),t()}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}async function c(){let r=ig(e.data);if(r){i(!0),o(null);try{let i=await Nn(r);if(!i.ok)throw Error(i.message);i.state&&n.setQueryData(b.neonSession,i.state),await ir(e.id),await Promise.all([n.invalidateQueries({queryKey:b.chatSessions}),n.invalidateQueries({queryKey:b.notifications})]),window.dispatchEvent(new CustomEvent(`neondeck:focus-chat`,{detail:{pluginId:`flue-chat`}})),t()}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}let l=ig(e.data);return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.title}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:Mr(e)})]}),(0,I.jsx)(x,{className:Rh(e),children:e.level})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.source??`local`,` ·`,` `,L(e.updatedAt),e.occurrenceCount>1?` · x${e.occurrenceCount}`:``]}),e.readAt?null:(0,I.jsx)(`button`,{className:`shrink-0 border border-line px-1.5 py-0.5 text-muted disabled:opacity-50`,disabled:r,onClick:()=>void s(`read`),type:`button`,children:`read`}),l?(0,I.jsx)(`button`,{className:`shrink-0 border border-primary/50 px-1.5 py-0.5 text-primary disabled:opacity-50`,disabled:r,onClick:()=>void c(),type:`button`,children:`open`}):null,(0,I.jsx)(`button`,{className:`shrink-0 border border-line px-1.5 py-0.5 text-muted disabled:opacity-50`,disabled:r,onClick:()=>void s(`resolve`),type:`button`,children:`resolve`})]}),a?(0,I.jsx)(`p`,{className:`mt-1.5 line-clamp-2 text-[10.5px] leading-4 text-accent`,children:a}):null]})}function ig(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.sessionId;return typeof t==`string`&&t?t:null}function ag({entry:e}){return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.title}),(0,I.jsxs)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:[e.primitive,` · `,e.notes]})]}),(0,I.jsx)(x,{className:e.class===`host-execution`||e.class===`destructive-mutation`?`border-accent text-accent`:``,children:e.requiresConfirmation?`confirm`:e.class})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex justify-between gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:e.id}),(0,I.jsx)(`span`,{className:`shrink-0`,children:e.auditTarget})]})]})}function og({approval:e,onRefresh:t}){let[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(null);async function o(n){r(n),a(null);try{let r=await Wn(e.id,n);r.requires?.includes(`approvalNudge`)&&a(`Approval resolved, but requester notification failed: ${r.errors?.join(`; `)??`unknown error`}`),t()}catch(e){a(e instanceof Error?e.message:String(e))}finally{r(null)}}return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.command}),(0,I.jsxs)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:[e.backend,` · `,e.risk,e.cwd?` · ${qh(e.cwd)}`:``,e.error?` · ${e.error}`:``]})]}),(0,I.jsx)(x,{className:zh(e),children:e.status})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 font-mono text-[10px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.status===`approved`&&!e.usedAt?`approved ${L(e.resolvedAt??e.updatedAt)} · not yet used`:L(e.updatedAt),e.exitCode===null?``:` · exit ${e.exitCode}`]}),e.status===`pending`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{className:`shrink-0 border border-line px-1.5 py-0.5 text-muted disabled:opacity-50`,disabled:!!n,onClick:()=>void o(`allow-once`),type:`button`,children:`once`}),(0,I.jsx)(`button`,{className:`shrink-0 border border-line px-1.5 py-0.5 text-muted disabled:opacity-50`,disabled:!!n,onClick:()=>void o(`allow-session`),type:`button`,children:`session`}),(0,I.jsx)(`button`,{className:`shrink-0 border border-line px-1.5 py-0.5 text-muted disabled:opacity-50`,disabled:!!n,onClick:()=>void o(`allow-always`),type:`button`,children:`preapprove`}),(0,I.jsx)(`button`,{className:`shrink-0 border border-accent px-1.5 py-0.5 text-accent disabled:opacity-50`,disabled:!!n,onClick:()=>void o(`deny`),type:`button`,children:`deny`})]}):null]}),i?(0,I.jsx)(`p`,{className:`mt-1.5 line-clamp-2 text-[10.5px] leading-4 text-accent`,children:i}):null]})}var sg=(0,F.lazy)(()=>y(()=>import(`./surfaces-Dlg1xLbg.js`).then(e=>({default:e.KiloTaskDiffReview})),__vite__mapDeps([0,1,2,3,4]))),cg=(0,F.lazy)(()=>y(()=>import(`./surfaces-Dlg1xLbg.js`).then(e=>({default:e.RepoEditEventDiffReview})),__vite__mapDeps([0,1,2,3,4])));function lg({onRefresh:e,server:t}){let[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(null);async function o(){r(`login`),a(null);try{let n=await qn(t.id);n.authorizationUrl&&window.open(n.authorizationUrl,`_blank`,`noopener,noreferrer`),e()}catch(e){a(e instanceof Error?e.message:String(e))}finally{r(null)}}async function s(){r(`logout`),a(null);try{await Jn(t.id),e()}catch(e){a(e instanceof Error?e.message:String(e))}finally{r(null)}}return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:t.id}),(0,I.jsxs)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:[t.transport,` · `,t.auth.kind,t.auth.kind===`oauth`?t.auth.authorized?` · authorized${t.auth.expiresAt?` until ${L(t.auth.expiresAt)}`:``}`:` · not authorized`:``,t.message?` · ${t.message}`:``]})]}),(0,I.jsx)(x,{className:Hh(t),children:t.status})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 font-mono text-[10px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[t.toolCount,` tools`,t.lastConnectedAt?` · connected ${L(t.lastConnectedAt)}`:``,t.lastErrorAt?` · error ${L(t.lastErrorAt)}`:``]}),t.auth.kind===`oauth`&&!t.auth.authorized?(0,I.jsx)(`button`,{className:`shrink-0 border border-line px-1.5 py-0.5 text-muted disabled:opacity-50`,disabled:n!==null,onClick:()=>void o(),type:`button`,children:n===`login`?`opening`:`login`}):null,t.auth.kind===`oauth`&&t.auth.authorized?(0,I.jsx)(`button`,{className:`shrink-0 border border-accent px-1.5 py-0.5 text-accent disabled:opacity-50`,disabled:n!==null,onClick:()=>void s(),type:`button`,children:n===`logout`?`logging out`:`logout`}):null]}),i?(0,I.jsx)(`p`,{className:`mt-1.5 line-clamp-2 text-[10.5px] leading-4 text-accent`,children:i}):null]})}function ug({approval:e,onRefresh:t}){let[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(null);async function o(n){r(n),a(null);try{let r=await Yn(e.id,n);r.requires?.includes(`approvalNudge`)&&a(`Approval resolved, but requester notification failed: ${r.errors?.join(`; `)??`unknown error`}`),t()}catch(e){a(e instanceof Error?e.message:String(e))}finally{r(null)}}return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.adaptedName}),(0,I.jsxs)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:[e.serverId,` · `,e.toolName,` ·`,` `,e.argumentsPreview]})]}),(0,I.jsx)(x,{className:Uh(e),children:e.status})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.status===`approved`&&!e.usedAt?`approved ${L(e.resolvedAt??e.updatedAt)} · not yet used`:`${L(e.updatedAt)} · expires ${L(e.expiresAt)}`}),e.status===`pending`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{className:`shrink-0 border border-line px-1.5 py-0.5 text-muted disabled:opacity-50`,disabled:n!==null,onClick:()=>void o(`approve`),type:`button`,children:`approve`}),(0,I.jsx)(`button`,{className:`shrink-0 border border-accent px-1.5 py-0.5 text-accent disabled:opacity-50`,disabled:n!==null,onClick:()=>void o(`deny`),type:`button`,children:`deny`})]}):null]}),i?(0,I.jsx)(`p`,{className:`mt-1.5 line-clamp-2 text-[10.5px] leading-4 text-accent`,children:i}):null]})}function dg({event:e}){let[t,n]=(0,F.useState)(!1),r=e.paths.length>0?e.paths.join(`, `):`no paths`,i=e.diffPatch||e.paths.length>0;return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:[e.repoId,` · `,e.action]}),(0,I.jsxs)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:[r,e.reason?` · ${e.reason}`:``]})]}),(0,I.jsx)(x,{className:Bh(e),children:e.status})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex justify-between gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:e.sessionId?`session ${e.sessionId}`:e.actorType}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[i?(0,I.jsx)(E,{className:`min-h-[24px] px-2 py-0 font-mono text-[10px]`,onClick:()=>n(e=>!e),type:`button`,children:t?`hide diff`:`view diff`}):null,L(e.updatedAt)]})]}),t?(0,I.jsx)(`div`,{className:`mt-1.5`,children:(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(M,{label:`Loading diff viewer.`}),children:(0,I.jsx)(cg,{event:e})})}):null]})}function fg({task:e}){let[t,n]=(0,F.useState)(!1),r=e.diff&&e.diff.ok?`${e.diff.fileCount} files +${e.diff.additions} -${e.diff.deletions}`:e.diff?.error?e.diff.error:`diff not read`,i=e.childSessionIds.length>0?`${e.childSessionIds.length} child session${e.childSessionIds.length===1?``:`s`}`:`no child sessions`,a=e.rootSessionId??`session pending`,o=(e.notificationFacts??[])[0],s=e.resultPlaceholders??[];return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:[e.repoId,` · `,e.title]}),(0,I.jsxs)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:[a,` · `,i,` · `,r]})]}),(0,I.jsx)(x,{className:Vh(e.status),children:e.status})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex justify-between gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:e.worktreeId?`worktree ${e.worktreeId}`:qh(e.cwd)}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,I.jsx)(Ar,{kind:`task`,label:`session`,linkedRepoId:e.repoId,linkedTaskId:e.id,summary:`${e.title}: Kilo task ${e.status}. ${e.summary??r}.`,title:`Kilo ${e.title}`,uiMetadata:{source:`kilo-task`,taskId:e.id,repoFullName:e.repoFullName,worktreeId:e.worktreeId,rootSessionId:e.rootSessionId,childSessionIds:e.childSessionIds,status:e.status}}),(0,I.jsx)(E,{className:`min-h-[24px] px-2 py-0 font-mono text-[10px]`,onClick:()=>n(e=>!e),type:`button`,children:t?`hide diff`:`view diff`}),L(e.updatedAt)]})]}),t?(0,I.jsx)(`div`,{className:`mt-1.5`,children:(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(M,{label:`Loading diff viewer.`}),children:(0,I.jsx)(sg,{task:e})})}):null,(0,I.jsxs)(`div`,{className:`mt-1.5 grid grid-cols-2 gap-1.5 font-mono text-[10px] text-muted`,children:[(0,I.jsxs)(`div`,{className:`border border-line bg-field px-2 py-1`,children:[`verify `,e.verificationState??`not-run`]}),(0,I.jsxs)(`div`,{className:`border border-line bg-field px-2 py-1`,children:[`approvals `,e.pendingApprovals?.length??0]})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 grid grid-cols-2 gap-1.5 font-mono text-[10px] text-muted`,children:[(0,I.jsxs)(`div`,{className:`border border-line bg-field px-2 py-1`,children:[`review `,e.reviewClassification??`pending`]}),(0,I.jsxs)(`div`,{className:`border border-line bg-field px-2 py-1`,children:[`promote `,e.promotionState??`not-requested`]})]}),o||s.length>0?(0,I.jsxs)(`div`,{className:`mt-1.5 space-y-1`,children:[o?(0,I.jsxs)(`p`,{className:`line-clamp-2 border border-line bg-field px-2 py-1 text-[10px] leading-4 text-muted`,children:[`notify `,o.state,`: `,o.message]}):null,s.slice(0,2).map(e=>(0,I.jsxs)(`p`,{className:`line-clamp-2 border border-line bg-field px-2 py-1 text-[10px] leading-4 text-muted`,children:[e.type,` `,e.status,`: `,e.reason]},`${e.type}:${e.workflow}`))]}):null,e.childSessionIds.length>0?(0,I.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:[e.childSessionIds.slice(0,3).map(e=>(0,I.jsxs)(x,{children:[`child `,e]},e)),e.childSessionIds.length>3?(0,I.jsxs)(x,{children:[`+`,e.childSessionIds.length-3]}):null]}):null,e.error?(0,I.jsx)(`p`,{className:`mt-1.5 line-clamp-2 text-[10.5px] leading-4 text-accent`,children:e.error}):null]})}function pg({worktree:e}){let t=e.prNumber?`PR #${e.prNumber}`:`repo work`;return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:[e.repoId,` · `,t]}),(0,I.jsxs)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:[e.headRef,e.headSha?` · ${e.headSha.slice(0,12)}`:``]})]}),(0,I.jsx)(x,{className:Wh(e.lifecycleStatus),children:e.lifecycleStatus})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex justify-between gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:qh(e.localPath)}),(0,I.jsx)(`span`,{className:`shrink-0`,children:e.adopted?`adopted`:e.storageKind})]})]})}function mg({lock:e}){return(0,I.jsxs)(`article`,{className:`border border-accent/70 bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:[`stale `,e.scope,` lock`]}),(0,I.jsxs)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:[e.owner,` · `,e.scopeKey]})]}),(0,I.jsx)(x,{className:`border-accent text-accent`,children:`stale`})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex justify-between gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:e.worktreeId??e.repoId}),(0,I.jsx)(`span`,{className:`shrink-0`,children:L(e.expiresAt)})]})]})}function hg({failure:e}){return(0,I.jsxs)(`article`,{className:`border border-accent/70 bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:`cleanup failed`}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:e.error??e.reason})]}),(0,I.jsx)(x,{className:`border-accent text-accent`,children:`failed`})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex justify-between gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:e.worktreeId}),(0,I.jsx)(`span`,{className:`shrink-0`,children:L(e.attemptedAt)})]})]})}function gg({run:e}){return(0,I.jsxs)(`article`,{className:`border border-primary/60 bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[e.runUrl?(0,I.jsx)(`a`,{className:`truncate font-mono text-[11px] text-ink hover:text-primary`,href:e.runUrl,rel:`noreferrer`,target:`_blank`,children:e.workflow}):(0,I.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-ink`,children:e.workflow}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:e.lastMessage})]}),(0,I.jsxs)(x,{className:`border-primary text-primary`,children:[e.eventCount,` events`]})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex justify-between gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:e.runId}),(0,I.jsx)(`span`,{className:`shrink-0`,children:L(e.lastEventAt)})]})]})}function _g({event:e,rawLabel:t=!1}){let n=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.name??e.workflow??e.eventType}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:e.message})]}),(0,I.jsx)(x,{className:e.isError?`border-accent text-accent`:``,children:e.level??e.eventType})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex justify-between gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:t&&e.runUrl?`raw run inspection`:e.runId??e.operationId??`local`}),(0,I.jsx)(`span`,{className:`shrink-0`,children:L(e.createdAt)})]})]});return e.runUrl?(0,I.jsx)(`a`,{className:`block border border-line bg-soft px-2.5 py-2 hover:border-primary/70`,href:e.runUrl,rel:`noreferrer`,target:`_blank`,children:n}):(0,I.jsx)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:n})}function vg({health:e,repo:t}){let n=Object.keys(t.packageScripts??{}).length,r=Ih(e);return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:t.id}),(0,I.jsxs)(`p`,{className:`mt-0.5 truncate font-mono text-[10px] text-muted`,children:[t.github.owner,`/`,t.github.name]})]}),(0,I.jsx)(x,{className:r.className,children:r.label})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 items-center gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`truncate`,children:[e?.branch??`branch:n/a`,`→`,t.defaultBranch]}),t.productionTarget?(0,I.jsxs)(`span`,{className:`truncate text-primary`,children:[`prod:`,t.productionTarget]}):null,(0,I.jsxs)(`span`,{className:`ml-auto shrink-0`,children:[e?.changeCount??0,` changes · `,n,` scripts`]})]}),(0,I.jsx)(`div`,{className:`mt-1.5 flex justify-end font-mono text-[10px]`,children:(0,I.jsx)(Ar,{kind:`repo`,label:`session`,linkedRepoId:t.id,summary:`${t.id}: ${t.github.owner}/${t.github.name} on ${e?.branch??`unknown branch`} with ${e?.changeCount??0} local changes and ${n} package scripts. Default branch ${t.defaultBranch}.`,title:`Repo ${t.id}`,uiMetadata:{source:`repo-row`,repoId:t.id,repoFullName:`${t.github.owner}/${t.github.name}`,path:t.path,branch:e?.branch??null,dirty:e?.dirty??null,productionTarget:t.productionTarget??null}})})]})}function yg({job:e}){return(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.id}),(0,I.jsxs)(`p`,{className:`mt-0.5 truncate font-mono text-[10px] text-muted`,children:[e.spec.kind,` · `,bg(e.trigger)]})]}),(0,I.jsx)(x,{className:e.enabled?`border-primary text-primary`:``,children:e.enabled?`enabled`:`paused`})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:e.claimId?`running`:`not-run`}),(0,I.jsx)(`span`,{className:`shrink-0`,children:e.lastRunAt?L(e.lastRunAt):`due`})]})]})}function bg(e){return e.kind===`interval`&&e.everySeconds?`every ${Yh(e.everySeconds)}`:e.kind}function xg({skill:e}){return(0,I.jsx)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.id}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:e.description})]}),(0,I.jsx)(x,{className:e.status===`active`?`border-violet text-violet`:`border-accent text-accent`,children:e.source})]})})}function Sg({memory:e}){return(0,I.jsx)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:[e.scope,`:`,e.key]}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:Cg(e.value)})]}),(0,I.jsx)(x,{children:L(e.updatedAt)})]})})}function Cg(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e==null?`empty`:JSON.stringify(e)}function wg({skills:e}){return e.duplicates.length+e.ignored.length===0?null:(0,I.jsxs)(`div`,{className:`border border-accent/50 bg-soft px-2.5 py-2 font-mono text-[10px] text-accent`,children:[e.duplicates.length,` duplicate · `,e.ignored.length,` ignored`]})}function Tg({config:e,onRefresh:t,snapshot:n}){let r=n.skills.skills.filter(e=>e.status===`active`),i=n.jobs.filter(e=>e.enabled),a=n.executionApprovals.approvals.filter(e=>e.status===`pending`),o=n.executionApprovals.approvals.slice(0,5),s=n.mcpApprovals.approvals.filter(e=>e.status===`pending`),c=n.mcpApprovals.approvals.slice(0,5),l=n.kiloTasks.tasks.filter(e=>[`running`,`needs-reconcile`,`needs-review`,`ready-to-verify`,`ready-to-push`,`unknown`].includes(e.status)),u=[...l,...n.kiloTasks.tasks.filter(e=>!l.some(t=>t.id===e.id))].slice(0,5),d=new Map(n.repoHealth.repos.map(e=>[e.id,e])),f=n.status.status,p=n.status.checks.filter(e=>!e.ok);return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`header`,{className:`panel-header flex h-8 items-center justify-between border-b border-line px-3 font-mono text-[10.5px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:`text-violet`,children:`RUNTIME`}),(0,I.jsxs)(x,{className:n.status.ok?`border-primary text-primary`:`border-accent text-accent`,children:[n.status.service,`:`,f]})]}),(0,I.jsx)(v,{className:`flex-1`,children:(0,I.jsxs)(`div`,{className:`space-y-3 p-3`,children:[(0,I.jsx)(Eg,{activeSkills:r.length,status:n.status,repoCount:n.repos.length}),(0,I.jsx)(Qh,{count:2,title:`CONFIG`,tone:`violet`,children:(0,I.jsx)(Eh,{onRefresh:t,status:n.status})}),(0,I.jsx)(Qh,{count:p.length,title:`FIRST RUN`,tone:p.length>0?`accent`:`primary`,children:(0,I.jsx)($h,{checks:p})}),n.secondaryErrors.length>0?(0,I.jsx)(Qh,{count:n.secondaryErrors.length,title:`PARTIAL DATA`,tone:`accent`,children:(0,I.jsx)(`div`,{className:`space-y-1.5`,children:n.secondaryErrors.map(e=>(0,I.jsx)(M,{label:e},e))})}):null,(0,I.jsx)(Qh,{count:n.status.checks.filter(e=>!e.ok).length,title:`READINESS`,tone:`accent`,children:(0,I.jsx)(`div`,{className:`space-y-1.5`,children:n.status.checks.map(e=>(0,I.jsx)(tg,{check:e},e.id))})}),(0,I.jsx)(Qh,{count:n.repos.length,title:`REPOS`,tone:`primary`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[n.repos.slice(0,e.repoLimit).map(e=>(0,I.jsx)(vg,{health:d.get(e.id),repo:e},e.id)),n.repos.length===0?(0,I.jsx)(M,{label:`No repositories configured.`}):null]})}),(0,I.jsx)(Qh,{count:n.status.lastFlueErrors.length,title:`FLUE ERRORS`,tone:`accent`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[n.status.lastFlueErrors.map(e=>(0,I.jsx)(ng,{error:e},`${e.source}:${e.id}`)),n.status.lastFlueErrors.length===0?(0,I.jsx)(M,{label:`No recent Flue failures.`}):null]})}),(0,I.jsx)(Qh,{count:n.notifications.items.length,title:`NOTIFICATIONS`,tone:`accent`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[n.notifications.items.slice(0,e.notificationLimit).map(e=>(0,I.jsx)(rg,{notification:e,onRefresh:t},e.id)),n.notifications.items.length===0?(0,I.jsx)(M,{label:`No active notifications.`}):null,(0,I.jsx)(M,{label:n.notifications.policy.reconcile})]})}),(0,I.jsx)(Qh,{count:n.safety.summary.requiresConfirmation,title:`SAFETY`,tone:`violet`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(M,{label:n.safety.confirmationPolicy}),(0,I.jsx)(M,{label:n.safety.hostExecutionPolicy}),(0,I.jsx)(M,{label:`Execution defaults to ${n.safety.executionPolicy.defaultBackend}; ${n.safety.executionPolicy.enabledBackends.join(`, `)} enabled; ${n.safety.executionPolicy.preapprovedCommandCount} preapproved commands.`}),[...n.safety.entries].sort((e,t)=>Kh(e)-Kh(t)).slice(0,8).map(e=>(0,I.jsx)(ag,{entry:e},e.id))]})}),(0,I.jsx)(Qh,{count:n.mcpServers.servers.length,title:`MCP SERVERS`,tone:n.mcpServers.servers.some(e=>[`needs-login`,`error`].includes(e.status))?`accent`:`primary`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[n.mcpServers.servers.slice(0,e.mcpLimit).map(e=>(0,I.jsx)(lg,{onRefresh:t,server:e},e.id)),n.mcpServers.servers.length===0?(0,I.jsx)(M,{label:`No MCP servers configured.`}):null]})}),(0,I.jsx)(Qh,{count:s.length,title:`MCP APPROVALS`,tone:s.length>0?`accent`:`violet`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[c.map(e=>(0,I.jsx)(ug,{approval:e,onRefresh:t},e.id)),c.length===0?(0,I.jsx)(M,{label:`No MCP approvals recorded.`}):null]})}),(0,I.jsx)(Qh,{count:a.length,title:`EXECUTION APPROVALS`,tone:`accent`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[o.map(e=>(0,I.jsx)(og,{approval:e,onRefresh:t},e.id)),o.length===0?(0,I.jsx)(M,{label:`No execution approvals recorded.`}):null]})}),(0,I.jsx)(Qh,{count:l.length,title:`KILO WORK`,tone:l.length>0?`accent`:`violet`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[u.map(e=>(0,I.jsx)(fg,{task:e},e.id)),u.length===0?(0,I.jsx)(M,{label:`No delegated Kilo work recorded.`}):null]})}),(0,I.jsx)(Qh,{count:n.repoEditEvents.events.length,title:`REPO EDITS`,tone:`violet`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[n.repoEditEvents.events.slice(0,e.repoEditLimit).map(e=>(0,I.jsx)(dg,{event:e},e.id)),n.repoEditEvents.events.length===0?(0,I.jsx)(M,{label:`No repo edits recorded.`}):null]})}),(0,I.jsx)(Qh,{count:n.worktrees.worktrees.length,title:`WORKTREES`,tone:n.worktrees.staleLocks.length>0||n.worktrees.cleanupFailures.length>0?`accent`:`primary`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[n.worktrees.worktrees.slice(0,6).map(e=>(0,I.jsx)(pg,{worktree:e},e.id)),n.worktrees.worktrees.length===0?(0,I.jsx)(M,{label:`No managed worktrees recorded.`}):null,n.worktrees.staleLocks.map(e=>(0,I.jsx)(mg,{lock:e},e.id)),n.worktrees.cleanupFailures.map(e=>(0,I.jsx)(hg,{failure:e},e.id))]})}),(0,I.jsx)(Qh,{count:n.workflows.activeRuns.length,title:`ACTIVE RUNS`,tone:`primary`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[n.workflows.activeRuns.map(e=>(0,I.jsx)(gg,{run:e},e.runId)),n.workflows.activeRuns.length===0?(0,I.jsx)(M,{label:`No active workflow runs observed.`}):null]})}),(0,I.jsx)(Qh,{count:n.workflows.recentFailures.length,title:`FAILED RUNS`,tone:`accent`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[n.workflows.recentFailures.slice(0,e.workflowEventLimit).map(e=>(0,I.jsx)(_g,{event:e,rawLabel:!0},`failure:${e.id}`)),n.workflows.recentFailures.length===0?(0,I.jsx)(M,{label:`No recent failed workflow runs.`}):null]})}),(0,I.jsx)(Qh,{count:n.workflows.recentData.length,title:`RUN RESULTS`,tone:`violet`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[n.workflows.recentData.slice(0,e.workflowEventLimit).map(e=>(0,I.jsx)(_g,{event:e},`data:${e.id}`)),n.workflows.recentData.length===0?(0,I.jsx)(M,{label:`No completed workflow results yet.`}):null]})}),(0,I.jsx)(Qh,{count:n.workflows.recentLogs.length+n.workflows.recentTools.length+n.workflows.recentOperations.length,title:`ACTION LOGS`,tone:`primary`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[[...n.workflows.recentLogs,...n.workflows.recentTools,...n.workflows.recentOperations].sort((e,t)=>Date.parse(t.createdAt)-Date.parse(e.createdAt)).slice(0,e.workflowEventLimit).map(e=>(0,I.jsx)(_g,{event:e},`activity:${e.id}`)),n.workflows.recentLogs.length+n.workflows.recentTools.length+n.workflows.recentOperations.length===0?(0,I.jsx)(M,{label:`No action, tool, or operation logs yet.`}):null]})}),(0,I.jsx)(Qh,{count:i.length,title:`TASKS`,tone:`accent`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[n.jobs.slice(0,e.jobLimit).map(e=>(0,I.jsx)(yg,{job:e},e.id)),n.jobs.length===0?(0,I.jsx)(M,{label:`No scheduled tasks recorded.`}):null]})}),(0,I.jsx)(Qh,{count:n.memories.length,title:`MEMORY`,tone:`primary`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[n.memories.slice(0,e.memoryLimit).map(e=>(0,I.jsx)(Sg,{memory:e},e.id)),n.memories.length===0?(0,I.jsx)(M,{label:`No durable memory recorded.`}):null]})}),(0,I.jsx)(Qh,{count:r.length,title:`SKILLS`,tone:`violet`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[n.skills.skills.slice(0,e.skillLimit).map(e=>(0,I.jsx)(xg,{skill:e},`${e.source}:${e.path}`)),n.skills.skills.length===0?(0,I.jsx)(M,{label:`No runtime skills loaded.`}):null,(0,I.jsx)(wg,{skills:n.skills})]})})]})})]})}function Eg({activeSkills:e,status:t,repoCount:n}){let r=t.models.displayAssistant,i=Ph(t,t.models.displayAssistantProvider),a=Mh(t),o=t.models.utilityConfigured?t.models.utility:`${t.models.utility} fallback`;return(0,I.jsxs)(`section`,{className:`border border-line bg-soft p-2.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`font-mono text-[10px] tracking-[0.12em] text-muted`,children:`NEONDECK_HOME`}),(0,I.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] text-ink`,children:qh(t.home)})]}),(0,I.jsx)(x,{children:Jh(t.uptimeSeconds)})]}),(0,I.jsxs)(`div`,{className:`mt-2 grid grid-cols-4 gap-1.5 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(A,{label:`repos`,value:n}),(0,I.jsx)(A,{label:`sched`,value:t.counts.activeSchedules}),(0,I.jsx)(A,{label:`watches`,value:t.counts.activeWatches}),(0,I.jsx)(A,{label:`skills`,value:e})]}),(0,I.jsxs)(`div`,{className:`mt-2 grid grid-cols-2 gap-1.5 font-mono text-[10px] text-muted`,children:[a.map(e=>(0,I.jsx)(ae,{ok:Nh(t,e),label:e,value:Nh(t,e)?`key`:`missing`},e)),(0,I.jsx)(ae,{ok:t.providers.credentials.github,label:`github`,value:t.providers.credentials.github?`token`:`missing`})]}),(0,I.jsxs)(`div`,{className:`mt-2 min-w-0 border border-line bg-field px-2 py-1.5`,children:[(0,I.jsxs)(`p`,{className:`font-mono text-[10px] tracking-[0.12em] text-muted`,children:[`MODEL · `,t.models.displayAssistantProvider]}),(0,I.jsxs)(`p`,{className:`mt-1 truncate font-mono text-[10.5px] text-ink`,children:[r,` · `,t.models.displayAssistantThinkingLevel]}),(0,I.jsxs)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-muted`,children:[`utility `,o,` · `,t.models.utilityThinkingLevel]}),t.models.utilityRecommendation?(0,I.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[10px] leading-4 text-muted`,children:t.models.utilityRecommendation}):null]}),(0,I.jsxs)(`div`,{className:`mt-2 min-w-0 border border-line bg-field px-2 py-1.5`,children:[(0,I.jsxs)(`p`,{className:`font-mono text-[10px] tracking-[0.12em] text-muted`,children:[`PROVIDER · `,i.label]}),(0,I.jsxs)(`p`,{className:`mt-1 truncate font-mono text-[10.5px] text-ink`,children:[i.enabled?`enabled`:`disabled`,` · `,i.apiKeyEnv]})]}),(0,I.jsxs)(`div`,{className:`mt-2 min-w-0 border border-line bg-field px-2 py-1.5`,children:[(0,I.jsxs)(`p`,{className:`font-mono text-[10px] tracking-[0.12em] text-muted`,children:[`SESSION · `,t.session.stale?`STALE`:`CURRENT`]}),(0,I.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10.5px] text-ink`,children:t.session.id})]}),(0,I.jsxs)(`div`,{className:`mt-2 min-w-0 border border-line bg-field px-2 py-1.5`,children:[(0,I.jsxs)(`p`,{className:`font-mono text-[10px] tracking-[0.12em] text-muted`,children:[`EXEC · `,t.execution.defaultBackend]}),(0,I.jsxs)(`p`,{className:`mt-1 truncate font-mono text-[10.5px] text-ink`,children:[t.execution.enabledBackends.join(`, `),` ·`,` `,t.execution.preapprovedCommandCount,` preapproved`]})]})]})}function Dg(e,t){let n=[Og(t.registry),Og(t.repoHealth),Og(t.jobs),Og(t.skills),Og(t.memories),Og(t.notifications),Og(t.executionApprovals),Og(t.mcpServers),Og(t.mcpApprovals),Og(t.safety),Og(t.workflows),Og(t.kiloTasks),Og(t.repoEditEvents),Og(t.worktrees)].filter(e=>!!e);return{status:e,repos:t.registry.data?.repos??[],repoHealth:t.repoHealth.data??{home:e.home,path:e.paths.repos,repos:[],attention:[],count:0,fetchedAt:e.fetchedAt},jobs:t.jobs.data?.tasks??[],skills:t.skills.data??{roots:[],skills:[],ignored:[],duplicates:[],loadedAt:e.fetchedAt},memories:t.memories.data?.memories??[],notifications:t.notifications.data??{items:[],policy:{info:`Passive updates.`,ready:`Completed work.`,attention:`Actionable failures.`,urgent:`Production-facing failures.`,reconcile:`Repeated source events are reconciled.`,autopilot:`Autopilot state changes create actionable notifications.`,kilo:`Kilo task state changes create delegated-work notifications.`},fetchedAt:e.fetchedAt},executionApprovals:t.executionApprovals.data??{ok:!1,action:`execution_approvals_list`,changed:!1,approvals:[],fetchedAt:e.fetchedAt},mcpServers:t.mcpServers.data??{ok:!1,action:`mcp_servers_list`,changed:!1,message:`MCP server status unavailable.`,servers:[]},mcpApprovals:t.mcpApprovals.data??{ok:!1,action:`mcp_approvals_list`,changed:!1,message:`MCP approvals unavailable.`,approvals:[]},safety:t.safety.data??Xh(e.fetchedAt),workflows:t.workflows.data??Zh(),kiloTasks:t.kiloTasks.data??{ok:!1,action:`kilo_tasks_list`,changed:!1,message:`Kilo tasks unavailable.`,tasks:[],fetchedAt:e.fetchedAt},repoEditEvents:t.repoEditEvents.data??{ok:!1,action:`repo_edit_events_list`,changed:!1,message:`Repo edit events unavailable.`,events:[],fetchedAt:e.fetchedAt},worktrees:t.worktrees.data??{ok:!1,action:`worktrees_list`,changed:!1,message:`Worktrees unavailable.`,worktrees:[],activeLocks:[],staleLocks:[],cleanupFailures:[],fetchedAt:e.fetchedAt},secondaryErrors:n,fetchedAt:new Date().toISOString()}}function Og(e){return e.error?k(e.error):void 0}async function kg(e){await Promise.all([e.invalidateQueries({queryKey:b.runtimeStatus}),e.invalidateQueries({queryKey:b.repoRegistry}),e.invalidateQueries({queryKey:b.repoHealth}),e.invalidateQueries({queryKey:b.scheduledTasks}),e.invalidateQueries({queryKey:b.runtimeSkills}),e.invalidateQueries({queryKey:b.workflowObservability}),e.invalidateQueries({queryKey:b.kiloTasks}),e.invalidateQueries({queryKey:b.memories}),e.invalidateQueries({queryKey:b.notifications}),e.invalidateQueries({queryKey:b.executionApprovals}),e.invalidateQueries({queryKey:b.mcpServers}),e.invalidateQueries({queryKey:b.mcpApprovals}),e.invalidateQueries({queryKey:b.safetyPolicy}),e.invalidateQueries({queryKey:b.repoEditEvents}),e.invalidateQueries({queryKey:b.worktrees})])}var Ag={repoLimit:5,jobLimit:5,skillLimit:5,memoryLimit:5,notificationLimit:5,workflowEventLimit:6,repoEditLimit:5,mcpLimit:5},jg={id:`runtime-overview`,title:`Runtime overview`,kind:`data`,defaultConfig:Ag,parseConfig:e=>Fr(Ag,e),Component({config:e}){let t=h(),[n,r,i,a,o,s,c,l,u,d,f,p,m,g,_]=oe({queries:[{queryKey:b.runtimeStatus,queryFn:wn,refetchInterval:3e4},{queryKey:b.repoRegistry,queryFn:me,refetchInterval:3e4},{queryKey:b.repoHealth,queryFn:pe,refetchInterval:3e4},{queryKey:b.scheduledTasks,queryFn:Xn,refetchInterval:3e4},{queryKey:b.runtimeSkills,queryFn:Tn,refetchInterval:3e4},{queryKey:b.memories,queryFn:()=>Zn(),refetchInterval:3e4},{queryKey:b.notifications,queryFn:rr,refetchInterval:3e4},{queryKey:b.executionApprovals,queryFn:()=>Un({includeResolved:!0}),refetchInterval:3e4},{queryKey:b.mcpServers,queryFn:Gn,refetchInterval:3e4},{queryKey:b.mcpApprovals,queryFn:()=>Kn({includeResolved:!0}),refetchInterval:3e4},{queryKey:b.safetyPolicy,queryFn:Dn,refetchInterval:3e4},{queryKey:b.workflowObservability,queryFn:Hn,refetchInterval:3e4},{queryKey:b.kiloTasks,queryFn:ge,refetchInterval:15e3},{queryKey:b.repoEditEvents,queryFn:ye,refetchInterval:3e4},{queryKey:b.worktrees,queryFn:gr,refetchInterval:3e4}]});if(Sr(()=>{kg(t)}),n.isLoading)return(0,I.jsx)(S,{title:`Runtime loading`,detail:`Reading backend state.`});if(n.error)return(0,I.jsx)(S,{title:`Runtime unavailable`,detail:k(n.error)});let v=n.data;if(!v)return(0,I.jsx)(S,{title:`Runtime unavailable`,detail:`No data.`});let y=Dg(v,{registry:r,repoHealth:i,jobs:a,skills:o,memories:s,notifications:c,executionApprovals:l,mcpServers:u,mcpApprovals:d,safety:f,workflows:p,kiloTasks:m,repoEditEvents:g,worktrees:_});return y?(0,I.jsx)(Tg,{config:e,onRefresh:()=>void kg(t),snapshot:y}):(0,I.jsx)(S,{title:`Runtime unavailable`,detail:`No data.`})}},Mg={eventLimit:5},Ng={repoResearcher:`repo_researcher`,ciInvestigator:`ci_investigator`,releaseReviewer:`release_reviewer`},Pg={id:`subagent-summary`,title:`Subagents`,kind:`data`,defaultConfig:Mg,parseConfig:e=>Fr(Mg,e),Component({config:e}){let t=h(),[n,r]=oe({queries:[{queryKey:b.runtimeStatus,queryFn:wn,refetchInterval:3e4},{queryKey:b.workflowObservability,queryFn:Hn,refetchInterval:3e4}]});return Sr(()=>{t.invalidateQueries({queryKey:b.runtimeStatus}),t.invalidateQueries({queryKey:b.workflowObservability})}),n.isLoading||r.isLoading?(0,I.jsx)(S,{title:`Subagents loading`,detail:`Reading role state.`}):n.error||r.error?(0,I.jsx)(S,{title:`Subagents unavailable`,detail:k(n.error??r.error)}):!n.data||!r.data?(0,I.jsx)(S,{title:`Subagents unavailable`,detail:`No data.`}):(0,I.jsx)(Fg,{eventLimit:e.eventLimit,runtime:n.data,workflows:r.data})}};function Fg({eventLimit:e,runtime:t,workflows:n}){let r=(0,F.useMemo)(()=>Lg(n.recentEvents),[n.recentEvents]),i=Object.entries(t.models.subagents);return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`header`,{className:`panel-header flex h-8 items-center justify-between border-b border-line px-3 font-mono text-[10.5px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:`text-accent`,children:`SUBAGENTS`}),(0,I.jsxs)(x,{children:[i.length,` roles`]})]}),(0,I.jsx)(v,{className:`flex-1`,children:(0,I.jsxs)(`div`,{className:`space-y-2.5 p-3`,children:[(0,I.jsxs)(`section`,{children:[(0,I.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between font-mono text-[10px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:`text-violet`,children:`MODELS`}),(0,I.jsx)(`span`,{className:`text-muted`,children:t.session.stale?`stale`:`current`})]}),(0,I.jsx)(`div`,{className:`space-y-1.5`,children:i.map(([e,t])=>(0,I.jsxs)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:Ng[e]??e}),(0,I.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-[10px] text-muted`,children:t})]},e))})]}),(0,I.jsxs)(`section`,{children:[(0,I.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between font-mono text-[10px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:`text-primary`,children:`RECENT DELEGATION`}),(0,I.jsx)(`span`,{className:`text-muted`,children:r.length})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[r.slice(0,e).map(e=>(0,I.jsx)(Ig,{event:e},e.id)),r.length===0?(0,I.jsx)(M,{label:`No delegated subagent activity observed yet.`}):null]})]})]})})]})}function Ig({event:e}){return(0,I.jsx)(`article`,{className:`border border-line bg-soft px-2.5 py-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.name??e.operationKind??e.eventType}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:e.message})]}),(0,I.jsx)(x,{className:e.isError?`border-accent text-accent`:``,children:L(e.createdAt)})]})})}function Lg(e){return e.filter(e=>{let t=[e.operationKind,e.name].filter(Boolean).join(` `).toLowerCase();if(t.includes(`subagent`)||t.includes(`repo_researcher`)||t.includes(`ci_investigator`)||t.includes(`release_reviewer`))return!0;let n=[e.message,e.operationId,JSON.stringify(e.summary??{})].filter(Boolean).join(` `).toLowerCase();return n.includes(`subagent`)||n.includes(`repo_researcher`)||n.includes(`ci_investigator`)||n.includes(`release_reviewer`)||n.includes(`delegat`)})}var Rg={eventLimit:18,refreshSeconds:20},zg=[{id:`all`,label:`all`},{id:`active`,label:`active`},{id:`failed`,label:`failed`},{id:`progress`,label:`progress`},{id:`activity`,label:`activity`}],Bg={id:`workflow-observability`,title:`Workflow observability`,kind:`data`,defaultConfig:Rg,parseConfig:e=>Fr(Rg,e),Component({config:e}){let[t,n]=(0,F.useState)(`all`),{data:r,error:i,isLoading:a}=d({queryKey:b.workflowObservability,queryFn:Hn,refetchInterval:Math.max(5,e.refreshSeconds)*1e3});return a?(0,I.jsx)(S,{title:`Workflows loading`,detail:`Reading recent Flue observations.`}):i?(0,I.jsx)(S,{title:`Workflows unavailable`,detail:k(i)}):r?(0,I.jsx)(Vg,{eventLimit:e.eventLimit,filter:t,onFilterChange:n,workflows:r}):(0,I.jsx)(S,{title:`Workflows unavailable`,detail:`No data.`})}};function Vg({eventLimit:e,filter:t,onFilterChange:n,workflows:r}){let i=(0,F.useMemo)(()=>Ug(r,t).slice(0,e),[e,t,r]),a=Kg(r);return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`header`,{className:`panel-header flex h-8 items-center justify-between border-b border-line px-3 font-mono text-[10.5px] tracking-[0.12em]`,children:[(0,I.jsx)(`span`,{className:`text-violet`,children:`WORKFLOWS`}),(0,I.jsxs)(x,{className:a.failed>0?`border-accent text-accent`:``,children:[a.active,` active · `,a.failed,` failed`]})]}),(0,I.jsxs)(`div`,{className:`border-b border-line px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`grid grid-cols-4 gap-1.5 font-mono text-[10px] text-muted`,children:[(0,I.jsx)(A,{label:`progress`,value:a.progress}),(0,I.jsx)(A,{label:`logs`,value:a.activity}),(0,I.jsx)(A,{label:`events`,value:a.events}),(0,I.jsx)(A,{label:`runs`,value:a.active})]}),(0,I.jsx)(`div`,{className:`mt-2 grid grid-cols-5 gap-1`,children:zg.map(e=>(0,I.jsx)(`button`,{className:e.id===t?`border border-primary bg-soft px-1.5 py-1 font-mono text-[10px] text-primary`:`border border-line bg-soft px-1.5 py-1 font-mono text-[10px] text-muted hover:border-primary hover:text-primary`,onClick:()=>n(e.id),type:`button`,children:e.label},e.id))})]}),(0,I.jsx)(v,{className:`flex-1`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5 p-3`,children:[i.map(e=>(0,I.jsx)(Hg,{item:e},e.id)),i.length===0?(0,I.jsx)(M,{label:`No workflow observations in this filter.`}):null]})})]})}function Hg({item:e}){return(0,I.jsxs)(`article`,{className:e.kind===`active`?`border border-primary/60 bg-soft px-2.5 py-2`:`border border-line bg-soft px-2.5 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`truncate font-mono text-[11px] text-ink`,children:e.title}),(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[10.5px] leading-4 text-muted`,children:e.message})]}),(0,I.jsx)(x,{className:e.isError?`border-accent text-accent`:e.kind===`active`?`border-primary text-primary`:``,children:e.badge})]}),(0,I.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2 font-mono text-[10px] text-muted`,children:[(0,I.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.metadata,` · `,L(e.createdAt)]}),e.runUrl?(0,I.jsx)(`a`,{className:`shrink-0 border border-line px-1.5 py-0.5 text-muted hover:border-primary hover:text-primary`,href:e.runUrl,rel:`noreferrer`,target:`_blank`,children:`inspect`}):null]})]})}function Ug(e,t){let n=[],r=new Set;if(t===`all`||t===`active`)for(let t of e.activeRuns)n.push({id:`active:${t.runId}`,kind:`active`,title:t.workflow,message:t.lastMessage,createdAt:t.lastEventAt,metadata:t.runId,runUrl:t.runUrl,badge:`${t.eventCount} events`,isError:!1});return(t===`all`||t===`failed`)&&Wg(n,r,e.recentFailures,`failed`),(t===`all`||t===`progress`)&&Wg(n,r,e.recentData,`progress`),(t===`all`||t===`activity`)&&(Wg(n,r,e.recentLogs,`activity`),Wg(n,r,e.recentTools,`activity`),Wg(n,r,e.recentOperations,`activity`)),t===`all`&&Wg(n,r,e.recentEvents,`event`),n.sort((e,t)=>Date.parse(t.createdAt)-Date.parse(e.createdAt))}function Wg(e,t,n,r){for(let i of n)t.has(i.id)||(t.add(i.id),e.push(Gg(i,r)))}function Gg(e,t){return{id:`${t}:${e.id}`,kind:t,title:e.name??e.workflow??e.eventType,message:e.message,createdAt:e.createdAt,metadata:e.runId??e.operationId??e.operationKind??`local`,runUrl:e.runUrl,badge:t===`failed`?`failed`:e.level??e.operationKind??e.eventType,isError:e.isError||t===`failed`}}function Kg(e){return{active:e.activeRuns.length,failed:e.recentFailures.length,progress:e.recentData.length,activity:e.recentLogs.length+e.recentTools.length+e.recentOperations.length,events:e.recentEvents.length}}var qg=Object.fromEntries([yh,vm,Rr,Gr,gh,jg,di,uh,Gm,Pg,Bg,um,Fm,pi].map(e=>[e.id,e]));function Jg(e,t){return e.parseConfig?e.parseConfig(t):!t||typeof t!=`object`||Array.isArray(t)?{config:e.defaultConfig,issues:[]}:{config:{...e.defaultConfig,...t},issues:[]}}var Yg={enabled:!0,soundEnabled:!0,minimumLevel:`ready`,readyDurationMs:36e5,maxVisible:3},Xg={info:0,ready:1,attention:2,urgent:3};function Zg(e){return{enabled:e?.enabled??Yg.enabled,soundEnabled:e?.soundEnabled??Yg.soundEnabled,minimumLevel:e?.minimumLevel??Yg.minimumLevel,readyDurationMs:e_(e?.readyDurationMs??Yg.readyDurationMs),maxVisible:Math.min(3,Math.max(1,Math.round(e?.maxVisible??Yg.maxVisible)))}}function Qg(e,t){return t.enabled&&!e.readAt&&!e.resolvedAt&&Xg[e.level]>=Xg[t.minimumLevel]}function $g(e,t,n){return e.level===`ready`&&t.readyDurationMs>0?n+t.readyDurationMs:null}function e_(e){let t=Math.round(e);return t===0?0:Math.min(864e5,Math.max(1e3,t))}var t_={items:[]};function n_(e,t){if(t.type===`clear`)return t_;if(t.type===`reconfigure`)return{items:t.config.enabled?e.items.filter(e=>Qg(e.notification,t.config)).map(e=>({...e,expiresAt:$g(e.notification,t.config,t.now)})):[]};if(t.type===`remove`)return{items:e.items.filter(e=>e.notification.id!==t.id)};let{event:n,config:r,now:i}=t;if(n.action===`read`||n.action===`resolved`)return{items:e.items.filter(e=>e.notification.id!==n.notification.id)};let a=e.items.findIndex(e=>e.notification.id===n.notification.id);if(a>=0&&!Qg(n.notification,r))return{items:e.items.filter(e=>e.notification.id!==n.notification.id)};if(a<0&&!Qg(n.notification,r))return e;let o={notification:n.notification,admittedAt:a>=0?e.items[a].admittedAt:i,expiresAt:$g(n.notification,r,i)};if(a>=0){let t=[...e.items];return t[a]=o,{items:t}}let s=[...e.items,o];for(;s.length>100;){let e=s.findIndex(e=>e.expiresAt!==null);if(e<0){s.pop();break}s.splice(e,1)}return{items:s}}function r_(){let e=null,t=!1,n=()=>{if(t)return null;if(e)return e;let n=window,r=n.AudioContext??n.webkitAudioContext;if(!r)return null;try{return e=new r,e}catch{return null}};return{unlock:()=>{let e=n();e?.state===`suspended`&&e.resume().catch(()=>void 0)},play:()=>{let e=n();if(!(!e||e.state===`closed`)){if(e.state===`suspended`){let n=Date.now();e.resume().then(()=>{!t&&Date.now()-n<250&&i_(e)}).catch(()=>void 0);return}i_(e)}},close:()=>{t=!0,e&&e.state!==`closed`&&e.close().catch(()=>void 0),e=null}}}function i_(e){try{a_(e)}catch{}}function a_(e){let t=e.currentTime;o_(e,659.25,t,.26,.045),o_(e,880,t+.09,.32,.035)}function o_(e,t,n,r,i){let a=e.createOscillator(),o=e.createGain();a.type=`sine`,a.frequency.setValueAtTime(t,n),o.gain.setValueAtTime(1e-4,n),o.gain.exponentialRampToValueAtTime(i,n+.018),o.gain.exponentialRampToValueAtTime(1e-4,n+r),a.connect(o),o.connect(e.destination),a.onended=()=>{a.disconnect(),o.disconnect()},a.start(n),a.stop(n+r)}function s_(e){let t=c_(e.data);if(l_(t.preparedDiffId))return{kind:`plugin`,pluginId:`autopilot`,label:`Open autopilot`};let n=u_(t.reviewUrl);if(n)return{kind:`url`,href:n,label:`Open review`};let r=u_(t.reportUrl);if(r)return{kind:`url`,href:r,label:`Open report`};let i=l_(t.sessionId);return i&&d_(e.source)?{kind:`session`,sessionId:i,label:`Open session`}:l_(t.taskId)||l_(t.kiloTaskId)||e.source===`kilo`?{kind:`plugin`,pluginId:`runtime-overview`,label:`Open tasks`}:l_(t.approvalId)||e.source?.includes(`approval`)||e.source===`execution`||e.source===`mcp`?{kind:`plugin`,pluginId:`runtime-overview`,label:`Open approvals`}:e.source===`flue`||l_(t.runId)||l_(t.workflow)?{kind:`plugin`,pluginId:`workflow-observability`,label:`Inspect run`}:e.source?.includes(`watch`)?{kind:`plugin`,pluginId:`active-watches`,label:`Open watches`}:e.source===`autopilot`?{kind:`plugin`,pluginId:`autopilot`,label:`Open autopilot`}:{kind:`plugin`,pluginId:`runtime-overview`,label:`Open notifications`}}function c_(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function l_(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function u_(e){let t=l_(e);return t?.startsWith(`/`)&&!t.startsWith(`//`)?t:void 0}function d_(e){return e===`briefing`||e===`execution`||e===`mcp`||e?.includes(`approval`)===!0}function f_({actionError:e,item:t,onAcknowledge:n,onDismiss:r,onOpen:i,pending:a,target:o}){let{notification:s}=t,[c,l]=(0,F.useState)(!1),[u,d]=(0,F.useState)(!1),f=(0,F.useRef)(t.expiresAt===null?null:Math.max(0,t.expiresAt-Date.now())),p=(0,F.useRef)(Date.now());(0,F.useEffect)(()=>{f.current=t.expiresAt===null?null:Math.max(0,t.expiresAt-Date.now()),p.current=Date.now()},[t.expiresAt,s.updatedAt]),(0,F.useEffect)(()=>{let e=f.current;if(e===null||c||u||a)return;p.current=Date.now();let t=window.setTimeout(r,e);return()=>{window.clearTimeout(t),f.current=Math.max(0,e-(Date.now()-p.current))}},[r,c,u,a,t.expiresAt,s.updatedAt]);let m=s.level===`attention`||s.level===`urgent`,h=Mr(s);return(0,I.jsxs)(`article`,{"aria-atomic":`true`,"aria-busy":a,"aria-labelledby":`toast-title-${s.id}`,className:`notification-toast notification-toast-${s.level}`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||d(!1)},onFocus:()=>d(!0),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),r())},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),role:m?`alert`:`status`,children:[(0,I.jsxs)(`div`,{className:`notification-toast-heading`,children:[(0,I.jsx)(`span`,{className:`notification-toast-level`,children:s.level}),(0,I.jsxs)(`span`,{className:`notification-toast-meta`,children:[L(s.updatedAt),s.occurrenceCount>1?` · ×${s.occurrenceCount}`:``]}),(0,I.jsx)(`button`,{"aria-label":`Dismiss ${s.title}`,className:`notification-toast-close`,onClick:r,type:`button`,children:`×`})]}),(0,I.jsx)(`h2`,{id:`toast-title-${s.id}`,children:s.title}),(0,I.jsx)(`p`,{children:h}),e?(0,I.jsx)(`p`,{className:`notification-toast-error`,children:e}):null,(0,I.jsxs)(`div`,{className:`notification-toast-actions`,children:[(0,I.jsx)(E,{disabled:a,onClick:i,type:`button`,children:o.label}),(0,I.jsx)(E,{disabled:a,onClick:n,type:`button`,children:`Acknowledge`})]})]})}function p_({actionErrors:e,density:t,items:n,onAcknowledge:r,onDismiss:i,onOpen:a,pendingIds:o,statuslinePosition:s}){return typeof document>`u`||n.length===0?null:(0,ur.createPortal)((0,I.jsx)(`aside`,{"aria-label":`Notifications`,className:`notification-toast-viewport toast-density-${t} ${s===`bottom`?`toast-above-statusline`:``}`,children:n.map(t=>(0,I.jsx)(f_,{actionError:e[t.notification.id],item:t,onAcknowledge:()=>r(t),onDismiss:()=>i(t),onOpen:()=>a(t),pending:o.has(t.notification.id),target:s_(t.notification)},t.notification.id))}),document.body)}function m_({children:e,config:t}){let n=h(),[r,i]=(0,F.useReducer)(n_,t_),[a,s]=(0,F.useState)({}),c=(0,F.useRef)(new Set),[l,u]=(0,F.useState)(()=>new Set),d=(0,F.useMemo)(()=>Zg(t.notifications?.toasts),[t.notifications?.toasts]),f=(0,F.useRef)(d),p=(0,F.useRef)(d),m=(0,F.useRef)(null);(0,F.useEffect)(()=>{f.current=d,g_(p.current,d)||(i({type:`reconfigure`,config:d,now:Date.now()}),p.current=d)},[d]),(0,F.useEffect)(()=>{if(!d.soundEnabled)return;let e=r_(),t=()=>e.unlock();return m.current=e,window.addEventListener(`pointerdown`,t,{passive:!0}),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,t),window.removeEventListener(`keydown`,t),m.current===e&&(m.current=null),e.close()}},[d.soundEnabled]),(0,F.useEffect)(()=>o(e=>{let t=f.current;Promise.all([n.invalidateQueries({queryKey:b.notifications}),n.invalidateQueries({queryKey:b.runtimeStatus}),n.invalidateQueries({queryKey:b.chatSessionActivityRoot})]),e.action===`created`&&t.soundEnabled&&Qg(e.notification,t)&&m.current?.play(),i({type:`notification-event`,event:e,config:t,now:Date.now()})}),[n]);let g=(0,F.useCallback)(e=>{i({type:`remove`,id:e.notification.id})},[]),_=(0,F.useCallback)(async(e,t)=>{let n=e.notification.id;if(!c.current.has(n)){c.current.add(n),u(new Set(c.current)),s(e=>({...e,[n]:void 0}));try{await t(),await ir(n),i({type:`remove`,id:n}),s(e=>{let t={...e};return delete t[n],t})}catch(e){s(t=>({...t,[n]:e instanceof Error?e.message:String(e)}))}finally{c.current.delete(n),u(new Set(c.current))}}},[]),v=(0,F.useCallback)(e=>{_(e,async()=>{})},[_]),y=(0,F.useCallback)(e=>{let t=s_(e.notification);_(e,async()=>{if(t.kind===`session`){if(!h_(`flue-chat`))throw Error(`Chat is not available in this dashboard layout.`);let e=await Nn(t.sessionId);if(!e.ok)throw Error(e.message);await Promise.all([n.invalidateQueries({queryKey:b.neonSession}),n.invalidateQueries({queryKey:b.chatSessions})]);return}if(t.kind===`plugin`){if(!h_(t.pluginId))throw Error(`${t.label.replace(/^Open /,``)} is not available in this dashboard layout.`);return}window.open(t.href,`_blank`,`noopener,noreferrer`)})},[n,_]),x=r.items.slice(-d.maxVisible);return(0,I.jsxs)(I.Fragment,{children:[e,(0,I.jsx)(p_,{actionErrors:a,density:t.appearance?.density??`comfortable`,items:x,onAcknowledge:v,onDismiss:g,onOpen:y,pendingIds:l,statuslinePosition:t.statusline?.position})]})}function h_(e){let t={pluginId:e,handled:!1};return window.dispatchEvent(new CustomEvent(`neondeck:navigate`,{detail:t})),t.handled}function g_(e,t){return e.enabled===t.enabled&&e.minimumLevel===t.minimumLevel&&e.readyDurationMs===t.readyDurationMs&&e.maxVisible===t.maxVisible}var __=()=>y(()=>import(`./PrReviewPopoutPage-CZN1CV82.js`),__vite__mapDeps([7,2,1,6,5,4])),v_=(0,F.lazy)(()=>__().then(e=>({default:e.PrReviewPopoutPage}))),y_=(0,F.lazy)(()=>__().then(e=>({default:e.PrReviewPopoutErrorPage}))),b_={density:`comfortable`,textScale:1.12};typeof window<`u`&&window.location.pathname===`/review`&&__();function x_(){let e=h(),t=(0,F.useMemo)(M_,[]),n=t.kind===`none`,{data:r,error:i,isLoading:a}=d({queryKey:b.dashboardConfig,queryFn:xn,enabled:n});(0,F.useEffect)(()=>{if(n)return p(t=>{xr(t),(t.action===`config_reload`||Cr(t,`dashboard.json`))&&e.invalidateQueries({queryKey:b.dashboardConfig})})},[n,e]),(0,F.useEffect)(()=>{if(n)return j(()=>{e.invalidateQueries({queryKey:b.neonSession}),e.invalidateQueries({queryKey:b.chatSessions})})},[n,e]),(0,F.useEffect)(()=>{if(!r)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{document.documentElement.dataset.theme=A_(r.theme)};if(t(),r.theme===`system`)return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[r]);let o=r?N_(r):b_;return t.kind===`target`?(0,I.jsx)(`main`,{className:`deck-page h-screen overflow-hidden bg-bg text-ink`,children:(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(j_,{appearance:o}),children:(0,I.jsx)(v_,{appearance:o,target:t.target})})}):t.kind===`invalid`?(0,I.jsx)(`main`,{className:`deck-page h-screen overflow-hidden bg-bg text-ink`,children:(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(j_,{appearance:o}),children:(0,I.jsx)(y_,{appearance:o,detail:t.message,title:`Invalid review route`})})}):i?(0,I.jsx)(te,{title:`Dashboard config failed`,detail:k(i)}):a||!r?(0,I.jsx)(te,{title:`Starting dashboard`,detail:`Loading local layout config.`}):(0,I.jsx)(`main`,{className:`deck-page h-screen overflow-hidden bg-bg text-ink`,children:(0,I.jsx)(m_,{config:r,children:(0,I.jsx)(S_,{config:r})})})}function S_({config:e}){let t=N_(e),{ref:n,profile:r,arrangement:i}=kr(e.layout.mode??`auto`),a=(0,F.useMemo)(()=>{let n={"--deck-text-scale":t.textScale.toString()};return i===`grid`&&(n.gridTemplateColumns=`repeat(${e.layout.columns}, minmax(0, 1fr))`,n.gridTemplateRows=e.statusline?F_(e):`repeat(${e.layout.rows}, minmax(0, 1fr))`),n},[t.textScale,e,i]),o=+(e.statusline?.position===`top`),s=P_(e);return(0,I.jsx)(`section`,{ref:n,className:`deck-shell h-screen w-screen overflow-hidden bg-bg p-0`,children:(0,I.jsxs)(`div`,{className:`dashboard-grid deck-density-${t.density} grid h-full w-full gap-0 border-0 bg-canvas p-0`,"data-display-preset":s,"data-deck-profile":r,"data-deck-arrangement":i,style:a,children:[e.statusline&&e.statusline.position!==`bottom`?(0,I.jsx)(T_,{arrangement:i,columns:e.layout.columns,rows:e.layout.rows,statusline:e.statusline}):null,e.layout.regions.map(e=>(0,I.jsx)(E_,{arrangement:i,region:e,rowOffset:o},e.id)),e.statusline&&e.statusline.position===`bottom`?(0,I.jsx)(T_,{arrangement:i,columns:e.layout.columns,rows:e.layout.rows,statusline:e.statusline}):null]})})}function C_(e){let t=e.defaultTab??e.tabs[0]?.id,n=e.tabs.find(e=>e.id===t)??e.tabs[0];return(n?qg[n.pluginId]:void 0)?.kind??`data`}function w_(e){return e===`data`?10:20}function T_({arrangement:e,columns:t,rows:n,statusline:r}){let i=qg[r.pluginId],a=e===`grid`?{gridColumn:`1 / span ${t}`,gridRow:r.position===`top`?`1 / span 1`:`${n+1}`}:{};if(!i)return(0,I.jsx)(k_,{regionRole:`status`,style:a,title:`Statusline`,variant:`statusline`,children:(0,I.jsx)(S,{title:`Plugin unavailable`,detail:`No plugin registered for ${r.pluginId}.`})});let o=Jg(i,r.config),s=i.Component;return(0,I.jsxs)(k_,{regionRole:`status`,style:a,title:`Statusline`,variant:`statusline`,children:[(0,I.jsx)(D_,{issues:o.issues}),(0,I.jsx)(s,{config:o.config,region:I_(r)})]})}function E_({arrangement:e,region:t,rowOffset:n}){let r=t.defaultTab??t.tabs[0]?.id??``,[i,a]=(0,F.useState)(r),[o,s]=(0,F.useState)(!1),c=(0,F.useRef)({regionId:t.id,tabId:r}),l=t.tabs.find(e=>e.id===i)??t.tabs[0],u=C_(t),d=e===`grid`?{gridColumn:`${t.column} / span ${t.columnSpan}`,gridRow:`${t.row+n} / span ${t.rowSpan}`}:{order:w_(u)};(0,F.useEffect)(()=>{let e=c.current.regionId!==t.id||c.current.tabId!==r;if(c.current={regionId:t.id,tabId:r},e){a(r);return}t.tabs.some(e=>e.id===i)||a(r)},[i,r,t.id,t.tabs]),(0,F.useEffect)(()=>{function e(e){let n=e.detail,r=n?.pluginId??`flue-chat`,i=t.tabs.find(e=>e.pluginId===r);i&&(n.handled=!0,a(i.id),s(!0),window.setTimeout(()=>s(!1),900))}return window.addEventListener(`neondeck:navigate`,e),window.addEventListener(`neondeck:focus-chat`,e),()=>{window.removeEventListener(`neondeck:navigate`,e),window.removeEventListener(`neondeck:focus-chat`,e)}},[t.tabs]);let f=`agent`,p=e===`grid`?d:{order:w_(f)};if(!l)return(0,I.jsx)(k_,{regionRole:f,style:p,title:t.title,variant:t.id,children:(0,I.jsx)(S,{title:`Region unavailable`,detail:`No tabs configured.`})});let m=qg[l.pluginId];if(!m)return(0,I.jsxs)(k_,{regionRole:f,style:p,title:t.title,variant:t.id,children:[(0,I.jsx)(O_,{activeTabId:l.id,onChange:a,tabs:t.tabs}),(0,I.jsx)(S,{title:`Plugin unavailable`,detail:`No plugin registered for ${l.pluginId}.`})]});let h=Jg(m,l.config),g=m.Component;return(0,I.jsx)(k_,{regionRole:u,highlight:o,style:d,title:t.title,variant:t.id,children:(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,I.jsx)(O_,{activeTabId:l.id,onChange:a,tabs:t.tabs}),(0,I.jsx)(D_,{issues:h.issues}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,I.jsx)(g,{config:h.config,region:L_(t,l)})})]})})}function D_({issues:e}){return e.length===0?null:(0,I.jsxs)(`div`,{className:`border-b border-accent bg-field px-2 py-1 font-mono text-[10px] leading-4 text-accent`,children:[`Invalid panel config ignored: `,e.join(` `)]})}function O_({activeTabId:e,onChange:t,tabs:n}){return n.length<=1?null:(0,I.jsx)(`div`,{className:`flex h-7 shrink-0 items-center gap-1 overflow-hidden border-b border-line bg-field px-2 font-mono text-[10px] tracking-[0.08em]`,children:n.map(n=>(0,I.jsx)(`button`,{className:n.id===e?`shrink-0 border border-primary px-2 py-0.5 text-primary`:`shrink-0 border border-transparent px-2 py-0.5 text-muted hover:border-line hover:text-ink`,onClick:()=>t(n.id),type:`button`,children:n.title},n.id))})}function k_({children:e,highlight:t=!1,regionRole:n,style:r,title:i,variant:a}){return a===`statusline`?(0,I.jsx)(C,{className:`panel panel-status min-h-0 overflow-hidden border-x-0 border-t-0 ${t?`ring-1 ring-primary`:``}`,"data-region-role":n,style:r,children:e}):(0,I.jsx)(C,{className:`panel panel-${a} min-h-0 overflow-hidden border-y-0 border-l-0 ${t?`ring-1 ring-primary`:``}`,"data-region-role":n,style:r,children:(0,I.jsx)(`div`,{"aria-label":i,className:`h-full min-h-0`,children:e})})}function A_(e){return e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e}function j_({appearance:e}){let t={"--deck-text-scale":e.textScale.toString()};return(0,I.jsx)(`section`,{className:`dashboard-grid deck-density-${e.density} pr-review-popout-page`,"data-deck-arrangement":`review-popout`,"data-deck-profile":`review-popout`,"data-display-preset":`review-popout`,style:t,children:(0,I.jsxs)(`output`,{"aria-label":`Loading PR review workbench`,"aria-live":`polite`,className:`pr-review-popout-skeleton`,children:[(0,I.jsxs)(`div`,{className:`pr-review-popout-skeleton-header`,children:[(0,I.jsx)(`span`,{className:`pr-review-popout-skeleton-line pr-review-popout-skeleton-title`}),(0,I.jsx)(`span`,{className:`pr-review-popout-skeleton-line pr-review-popout-skeleton-badges`})]}),(0,I.jsxs)(`div`,{className:`pr-review-popout-skeleton-workbench`,children:[(0,I.jsx)(`span`,{className:`pr-review-popout-skeleton-pane`}),(0,I.jsx)(`span`,{className:`pr-review-popout-skeleton-pane`}),(0,I.jsx)(`span`,{className:`pr-review-popout-skeleton-pane`})]}),(0,I.jsx)(`div`,{className:`pr-review-popout-skeleton-footer`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Loading the review workbench.`})]})})}function M_(){if(window.location.pathname!==`/review`)return{kind:`none`};let e=new URLSearchParams(window.location.search),t=e.get(`repo`)?.trim(),n=Number(e.get(`number`));if(!t)return{kind:`invalid`,message:`A repository query parameter is required, for example /review?repo=owner/repo&number=123.`};let r=t.split(`/`);return r.length!==2||!r[0]||!r[1]?{kind:`invalid`,message:`The repository query parameter must be in owner/repo form, for example /review?repo=owner/repo&number=123.`}:!Number.isInteger(n)||n<1?{kind:`invalid`,message:`A positive pull request number is required, for example /review?repo=owner/repo&number=123.`}:{kind:`target`,target:{repo:t,number:n,headSha:e.get(`head`)?.trim()||null,baseSha:e.get(`base`)?.trim()||null,baseRef:e.get(`baseRef`)?.trim()||null,title:e.get(`title`)?.trim()||null}}}function N_(e){let t=e.appearance?.density??`comfortable`;return{density:t,textScale:e.appearance?.textScale??{compact:1,comfortable:1.12,large:1.24}[t]}}function P_(e){return e.display.preset?e.display.preset:e.display.width===2560&&e.display.height===720?`xeneon-edge`:`custom`}function F_(e){let t=`repeat(${e.layout.rows}, minmax(0, 1fr))`,n=`var(--deck-statusline-height)`;return e.statusline?.position===`bottom`?`${t} ${n}`:`${n} ${t}`}function I_(e){return{id:`statusline`,title:`Statusline`,column:1,row:1,columnSpan:1,rowSpan:1,tabs:[{id:`statusline`,title:`Statusline`,pluginId:e.pluginId,config:e.config??{}}]}}function L_(e,t){return{...e,id:`${e.id}:${t.id}`,title:t.title,defaultTab:t.id,tabs:[t]}}var R_=fetch(`/api/local-api/session`).then(e=>e.ok?e.json():null).catch(()=>null),z_=Jt({baseUrl:`/api/flue`,fetch:async(e,t)=>{let n=await R_,r=new Headers(t?.headers);return n?.token&&r.set(n.header||`x-neondeck-api-token`,n.token),fetch(e,{...t,headers:r})}});(0,dr.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(F.StrictMode,{children:(0,I.jsx)(m,{client:T,children:(0,I.jsx)(Zt,{client:z_,children:(0,I.jsx)(x_,{})})})}));