@winspan/claude-forge 9.2.0 → 9.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (591) hide show
  1. package/DEVELOPMENT.md +80 -19
  2. package/README.md +13 -6
  3. package/dist/catalogs/agents.json +19 -24
  4. package/dist/catalogs/skills.json +139 -27
  5. package/dist/claudemd/templates/swarm-protocol.md +1 -1
  6. package/dist/cli/commands/agent.d.ts +169 -0
  7. package/dist/cli/commands/agent.d.ts.map +1 -0
  8. package/dist/cli/commands/agent.js +690 -0
  9. package/dist/cli/commands/agent.js.map +1 -0
  10. package/dist/cli/commands/codegraph.d.ts +17 -0
  11. package/dist/cli/commands/codegraph.d.ts.map +1 -0
  12. package/dist/cli/commands/codegraph.js +263 -0
  13. package/dist/cli/commands/codegraph.js.map +1 -0
  14. package/dist/cli/commands/decisions.d.ts.map +1 -1
  15. package/dist/cli/commands/decisions.js +46 -9
  16. package/dist/cli/commands/decisions.js.map +1 -1
  17. package/dist/cli/commands/executions.d.ts.map +1 -1
  18. package/dist/cli/commands/executions.js +2 -1
  19. package/dist/cli/commands/executions.js.map +1 -1
  20. package/dist/cli/commands/insights-goal-check.d.ts +5 -1
  21. package/dist/cli/commands/insights-goal-check.d.ts.map +1 -1
  22. package/dist/cli/commands/insights-goal-check.js +15 -15
  23. package/dist/cli/commands/insights-goal-check.js.map +1 -1
  24. package/dist/cli/commands/knowledge.d.ts +51 -0
  25. package/dist/cli/commands/knowledge.d.ts.map +1 -1
  26. package/dist/cli/commands/knowledge.js +202 -29
  27. package/dist/cli/commands/knowledge.js.map +1 -1
  28. package/dist/cli/commands/loop.d.ts +95 -0
  29. package/dist/cli/commands/loop.d.ts.map +1 -0
  30. package/dist/cli/commands/loop.js +408 -0
  31. package/dist/cli/commands/loop.js.map +1 -0
  32. package/dist/cli/commands/maintenance.d.ts +33 -0
  33. package/dist/cli/commands/maintenance.d.ts.map +1 -0
  34. package/dist/cli/commands/maintenance.js +75 -0
  35. package/dist/cli/commands/maintenance.js.map +1 -0
  36. package/dist/cli/commands/mcp.d.ts +23 -0
  37. package/dist/cli/commands/mcp.d.ts.map +1 -1
  38. package/dist/cli/commands/mcp.js +82 -0
  39. package/dist/cli/commands/mcp.js.map +1 -1
  40. package/dist/cli/commands/skills.d.ts +131 -0
  41. package/dist/cli/commands/skills.d.ts.map +1 -1
  42. package/dist/cli/commands/skills.js +409 -9
  43. package/dist/cli/commands/skills.js.map +1 -1
  44. package/dist/cli/commands/stats.d.ts.map +1 -1
  45. package/dist/cli/commands/stats.js +9 -2
  46. package/dist/cli/commands/stats.js.map +1 -1
  47. package/dist/cli/index.js +8 -0
  48. package/dist/cli/index.js.map +1 -1
  49. package/dist/core/constants.d.ts +37 -0
  50. package/dist/core/constants.d.ts.map +1 -1
  51. package/dist/core/constants.js +43 -0
  52. package/dist/core/constants.js.map +1 -1
  53. package/dist/core/diagnostics/checks.d.ts.map +1 -1
  54. package/dist/core/diagnostics/checks.js +2 -1
  55. package/dist/core/diagnostics/checks.js.map +1 -1
  56. package/dist/core/diagnostics/daemon-status.d.ts +1 -1
  57. package/dist/core/diagnostics/daemon-status.d.ts.map +1 -1
  58. package/dist/core/diagnostics/daemon-status.js +1 -1
  59. package/dist/core/diagnostics/daemon-status.js.map +1 -1
  60. package/dist/core/diagnostics/entropy-checks.d.ts +3 -2
  61. package/dist/core/diagnostics/entropy-checks.d.ts.map +1 -1
  62. package/dist/core/diagnostics/entropy-checks.js +10 -5
  63. package/dist/core/diagnostics/entropy-checks.js.map +1 -1
  64. package/dist/core/diagnostics/heartbeat-reader.d.ts +28 -0
  65. package/dist/core/diagnostics/heartbeat-reader.d.ts.map +1 -0
  66. package/dist/core/diagnostics/heartbeat-reader.js +50 -0
  67. package/dist/core/diagnostics/heartbeat-reader.js.map +1 -0
  68. package/dist/core/event-fields.d.ts +27 -0
  69. package/dist/core/event-fields.d.ts.map +1 -1
  70. package/dist/core/event-fields.js +43 -0
  71. package/dist/core/event-fields.js.map +1 -1
  72. package/dist/core/governance/global-inject.d.ts +34 -4
  73. package/dist/core/governance/global-inject.d.ts.map +1 -1
  74. package/dist/core/governance/global-inject.js +80 -25
  75. package/dist/core/governance/global-inject.js.map +1 -1
  76. package/dist/core/insights/agent-anchor-guard.d.ts +77 -0
  77. package/dist/core/insights/agent-anchor-guard.d.ts.map +1 -0
  78. package/dist/core/insights/agent-anchor-guard.js +119 -0
  79. package/dist/core/insights/agent-anchor-guard.js.map +1 -0
  80. package/dist/core/insights/agent-distill-context.d.ts +55 -0
  81. package/dist/core/insights/agent-distill-context.d.ts.map +1 -0
  82. package/dist/core/insights/agent-distill-context.js +146 -0
  83. package/dist/core/insights/agent-distill-context.js.map +1 -0
  84. package/dist/core/insights/agent-distill-spawn.d.ts +56 -0
  85. package/dist/core/insights/agent-distill-spawn.d.ts.map +1 -0
  86. package/dist/core/insights/agent-distill-spawn.js +179 -0
  87. package/dist/core/insights/agent-distill-spawn.js.map +1 -0
  88. package/dist/core/insights/agent-drift.d.ts +66 -0
  89. package/dist/core/insights/agent-drift.d.ts.map +1 -0
  90. package/dist/core/insights/agent-drift.js +109 -0
  91. package/dist/core/insights/agent-drift.js.map +1 -0
  92. package/dist/core/insights/agent-evolution-sources.d.ts +21 -0
  93. package/dist/core/insights/agent-evolution-sources.d.ts.map +1 -0
  94. package/dist/core/insights/agent-evolution-sources.js +36 -0
  95. package/dist/core/insights/agent-evolution-sources.js.map +1 -0
  96. package/dist/core/insights/agent-health.d.ts +142 -0
  97. package/dist/core/insights/agent-health.d.ts.map +1 -0
  98. package/dist/core/insights/agent-health.js +296 -0
  99. package/dist/core/insights/agent-health.js.map +1 -0
  100. package/dist/core/insights/agent-patch-apply.d.ts +45 -0
  101. package/dist/core/insights/agent-patch-apply.d.ts.map +1 -0
  102. package/dist/core/insights/agent-patch-apply.js +165 -0
  103. package/dist/core/insights/agent-patch-apply.js.map +1 -0
  104. package/dist/core/insights/agent-suggest.d.ts +128 -0
  105. package/dist/core/insights/agent-suggest.d.ts.map +1 -0
  106. package/dist/core/insights/agent-suggest.js +284 -0
  107. package/dist/core/insights/agent-suggest.js.map +1 -0
  108. package/dist/core/insights/coverage-tiers.d.ts +46 -0
  109. package/dist/core/insights/coverage-tiers.d.ts.map +1 -0
  110. package/dist/core/insights/coverage-tiers.js +95 -0
  111. package/dist/core/insights/coverage-tiers.js.map +1 -0
  112. package/dist/{daemon/services → core/insights}/experience-extractor.d.ts +0 -7
  113. package/dist/core/insights/experience-extractor.d.ts.map +1 -0
  114. package/dist/{daemon/services → core/insights}/experience-extractor.js +5 -9
  115. package/dist/core/insights/experience-extractor.js.map +1 -0
  116. package/dist/{daemon/services → core/insights}/violation-reporter.d.ts +20 -1
  117. package/dist/core/insights/violation-reporter.d.ts.map +1 -0
  118. package/dist/{daemon/services → core/insights}/violation-reporter.js +56 -4
  119. package/dist/core/insights/violation-reporter.js.map +1 -0
  120. package/dist/core/loop/loop-engine.d.ts +140 -0
  121. package/dist/core/loop/loop-engine.d.ts.map +1 -0
  122. package/dist/core/loop/loop-engine.js +266 -0
  123. package/dist/core/loop/loop-engine.js.map +1 -0
  124. package/dist/core/queue/index.d.ts.map +1 -1
  125. package/dist/core/queue/index.js +2 -1
  126. package/dist/core/queue/index.js.map +1 -1
  127. package/dist/core/storage/base.d.ts +159 -0
  128. package/dist/core/storage/base.d.ts.map +1 -1
  129. package/dist/core/storage/base.js +523 -0
  130. package/dist/core/storage/base.js.map +1 -1
  131. package/dist/core/storage/codegraph-types.d.ts +79 -0
  132. package/dist/core/storage/codegraph-types.d.ts.map +1 -0
  133. package/dist/core/storage/codegraph-types.js +14 -0
  134. package/dist/core/storage/codegraph-types.js.map +1 -0
  135. package/dist/core/storage/codegraph.d.ts +186 -0
  136. package/dist/core/storage/codegraph.d.ts.map +1 -0
  137. package/dist/core/storage/codegraph.js +452 -0
  138. package/dist/core/storage/codegraph.js.map +1 -0
  139. package/dist/core/storage/decisions.d.ts +30 -5
  140. package/dist/core/storage/decisions.d.ts.map +1 -1
  141. package/dist/core/storage/decisions.js +45 -13
  142. package/dist/core/storage/decisions.js.map +1 -1
  143. package/dist/core/storage/events.d.ts +127 -0
  144. package/dist/core/storage/events.d.ts.map +1 -1
  145. package/dist/core/storage/events.js +318 -3
  146. package/dist/core/storage/events.js.map +1 -1
  147. package/dist/core/storage/feedback.d.ts +3 -23
  148. package/dist/core/storage/feedback.d.ts.map +1 -1
  149. package/dist/core/storage/feedback.js +37 -38
  150. package/dist/core/storage/feedback.js.map +1 -1
  151. package/dist/core/storage/injections.d.ts +40 -0
  152. package/dist/core/storage/injections.d.ts.map +1 -1
  153. package/dist/core/storage/injections.js +69 -0
  154. package/dist/core/storage/injections.js.map +1 -1
  155. package/dist/core/storage/knowledge.d.ts +226 -0
  156. package/dist/core/storage/knowledge.d.ts.map +1 -1
  157. package/dist/core/storage/knowledge.js +391 -4
  158. package/dist/core/storage/knowledge.js.map +1 -1
  159. package/dist/core/storage/pipeline-rollup.d.ts +1 -7
  160. package/dist/core/storage/pipeline-rollup.d.ts.map +1 -1
  161. package/dist/core/storage/pipeline-rollup.js +18 -57
  162. package/dist/core/storage/pipeline-rollup.js.map +1 -1
  163. package/dist/core/storage/routing.d.ts +34 -0
  164. package/dist/core/storage/routing.d.ts.map +1 -1
  165. package/dist/core/storage/routing.js +92 -2
  166. package/dist/core/storage/routing.js.map +1 -1
  167. package/dist/core/storage/rows.d.ts +5 -25
  168. package/dist/core/storage/rows.d.ts.map +1 -1
  169. package/dist/core/storage/schema.sql +92 -27
  170. package/dist/core/storage/sessions.d.ts.map +1 -1
  171. package/dist/core/storage/sessions.js +2 -1
  172. package/dist/core/storage/sessions.js.map +1 -1
  173. package/dist/core/storage/skills.d.ts +159 -0
  174. package/dist/core/storage/skills.d.ts.map +1 -1
  175. package/dist/core/storage/skills.js +350 -4
  176. package/dist/core/storage/skills.js.map +1 -1
  177. package/dist/core/storage/sqlite.d.ts +81 -25
  178. package/dist/core/storage/sqlite.d.ts.map +1 -1
  179. package/dist/core/storage/sqlite.js +143 -45
  180. package/dist/core/storage/sqlite.js.map +1 -1
  181. package/dist/core/storage/tasks.d.ts +270 -0
  182. package/dist/core/storage/tasks.d.ts.map +1 -1
  183. package/dist/core/storage/tasks.js +495 -16
  184. package/dist/core/storage/tasks.js.map +1 -1
  185. package/dist/core/storage/tool-intercepts.d.ts +1 -1
  186. package/dist/core/storage/tool-intercepts.js +1 -1
  187. package/dist/core/types.d.ts +26 -3
  188. package/dist/core/types.d.ts.map +1 -1
  189. package/dist/core/types.js +1 -3
  190. package/dist/core/types.js.map +1 -1
  191. package/dist/core/utils/binary-paths.d.ts +32 -0
  192. package/dist/core/utils/binary-paths.d.ts.map +1 -1
  193. package/dist/core/utils/binary-paths.js +52 -0
  194. package/dist/core/utils/binary-paths.js.map +1 -1
  195. package/dist/core/utils/claude-cli-resolver.d.ts.map +1 -0
  196. package/dist/{skills/distill → core/utils}/claude-cli-resolver.js +1 -1
  197. package/dist/core/utils/claude-cli-resolver.js.map +1 -0
  198. package/dist/core/utils/claude-cli-spawn.d.ts +1 -1
  199. package/dist/core/utils/claude-cli-spawn.js +2 -2
  200. package/dist/core/utils/claude-cli-spawn.js.map +1 -1
  201. package/dist/core/utils/noise-prompt.d.ts +1 -1
  202. package/dist/core/utils/noise-prompt.js +1 -1
  203. package/dist/core/utils/time.d.ts +26 -0
  204. package/dist/core/utils/time.d.ts.map +1 -1
  205. package/dist/core/utils/time.js +33 -0
  206. package/dist/core/utils/time.js.map +1 -1
  207. package/dist/daemon/config-store.d.ts.map +1 -1
  208. package/dist/daemon/config-store.js +14 -5
  209. package/dist/daemon/config-store.js.map +1 -1
  210. package/dist/daemon/event-parser.d.ts.map +1 -1
  211. package/dist/daemon/event-parser.js +5 -0
  212. package/dist/daemon/event-parser.js.map +1 -1
  213. package/dist/daemon/handlers/post-tool-use.d.ts +24 -16
  214. package/dist/daemon/handlers/post-tool-use.d.ts.map +1 -1
  215. package/dist/daemon/handlers/post-tool-use.js +76 -116
  216. package/dist/daemon/handlers/post-tool-use.js.map +1 -1
  217. package/dist/daemon/handlers/pre-tool-use.d.ts +35 -10
  218. package/dist/daemon/handlers/pre-tool-use.d.ts.map +1 -1
  219. package/dist/daemon/handlers/pre-tool-use.js +71 -38
  220. package/dist/daemon/handlers/pre-tool-use.js.map +1 -1
  221. package/dist/daemon/handlers/stop.d.ts +20 -0
  222. package/dist/daemon/handlers/stop.d.ts.map +1 -1
  223. package/dist/daemon/handlers/stop.js +96 -8
  224. package/dist/daemon/handlers/stop.js.map +1 -1
  225. package/dist/daemon/handlers/user-prompt.d.ts +16 -1
  226. package/dist/daemon/handlers/user-prompt.d.ts.map +1 -1
  227. package/dist/daemon/handlers/user-prompt.js +97 -56
  228. package/dist/daemon/handlers/user-prompt.js.map +1 -1
  229. package/dist/daemon/handlers/violation-content-backfill.d.ts +76 -0
  230. package/dist/daemon/handlers/violation-content-backfill.d.ts.map +1 -0
  231. package/dist/daemon/handlers/violation-content-backfill.js +167 -0
  232. package/dist/daemon/handlers/violation-content-backfill.js.map +1 -0
  233. package/dist/daemon/index.d.ts +19 -0
  234. package/dist/daemon/index.d.ts.map +1 -1
  235. package/dist/daemon/index.js +125 -200
  236. package/dist/daemon/index.js.map +1 -1
  237. package/dist/daemon/rules/defaults.d.ts.map +1 -1
  238. package/dist/daemon/rules/defaults.js +151 -64
  239. package/dist/daemon/rules/defaults.js.map +1 -1
  240. package/dist/daemon/rules/types.d.ts +28 -22
  241. package/dist/daemon/rules/types.d.ts.map +1 -1
  242. package/dist/daemon/rules/workflow-defaults.js +9 -9
  243. package/dist/daemon/rules/workflow-defaults.js.map +1 -1
  244. package/dist/daemon/services/codegraph-sync.d.ts +94 -0
  245. package/dist/daemon/services/codegraph-sync.d.ts.map +1 -0
  246. package/dist/daemon/services/codegraph-sync.js +159 -0
  247. package/dist/daemon/services/codegraph-sync.js.map +1 -0
  248. package/dist/daemon/services/decision-hint.d.ts +47 -10
  249. package/dist/daemon/services/decision-hint.d.ts.map +1 -1
  250. package/dist/daemon/services/decision-hint.js +99 -24
  251. package/dist/daemon/services/decision-hint.js.map +1 -1
  252. package/dist/daemon/services/event-ttl-sweep.d.ts.map +1 -1
  253. package/dist/daemon/services/event-ttl-sweep.js +3 -2
  254. package/dist/daemon/services/event-ttl-sweep.js.map +1 -1
  255. package/dist/daemon/services/feedback-aggregator.d.ts +14 -26
  256. package/dist/daemon/services/feedback-aggregator.d.ts.map +1 -1
  257. package/dist/daemon/services/feedback-aggregator.js +23 -63
  258. package/dist/daemon/services/feedback-aggregator.js.map +1 -1
  259. package/dist/daemon/services/heartbeat-writer.d.ts +6 -15
  260. package/dist/daemon/services/heartbeat-writer.d.ts.map +1 -1
  261. package/dist/daemon/services/heartbeat-writer.js +7 -36
  262. package/dist/daemon/services/heartbeat-writer.js.map +1 -1
  263. package/dist/daemon/services/kb-injector.d.ts +1 -1
  264. package/dist/daemon/services/kb-injector.d.ts.map +1 -1
  265. package/dist/daemon/services/kb-injector.js +10 -2
  266. package/dist/daemon/services/kb-injector.js.map +1 -1
  267. package/dist/daemon/services/kb-rebuild-scheduler.d.ts +95 -0
  268. package/dist/daemon/services/kb-rebuild-scheduler.d.ts.map +1 -0
  269. package/dist/daemon/services/kb-rebuild-scheduler.js +149 -0
  270. package/dist/daemon/services/kb-rebuild-scheduler.js.map +1 -0
  271. package/dist/daemon/services/loop-hint.d.ts +139 -0
  272. package/dist/daemon/services/loop-hint.d.ts.map +1 -0
  273. package/dist/daemon/services/loop-hint.js +272 -0
  274. package/dist/daemon/services/loop-hint.js.map +1 -0
  275. package/dist/daemon/services/outcome-classification-service.js +1 -1
  276. package/dist/daemon/services/outcome-classification-service.js.map +1 -1
  277. package/dist/daemon/services/task-segmenter.d.ts +11 -0
  278. package/dist/daemon/services/task-segmenter.d.ts.map +1 -1
  279. package/dist/daemon/services/task-segmenter.js +48 -2
  280. package/dist/daemon/services/task-segmenter.js.map +1 -1
  281. package/dist/daemon/startup/maintenance-schedulers.d.ts +68 -0
  282. package/dist/daemon/startup/maintenance-schedulers.d.ts.map +1 -0
  283. package/dist/daemon/startup/maintenance-schedulers.js +294 -0
  284. package/dist/daemon/startup/maintenance-schedulers.js.map +1 -0
  285. package/dist/daemon/templates/agents/agent-retro-distiller.md +106 -0
  286. package/dist/daemon/templates/agents/claudemd-writer.md +1 -0
  287. package/dist/daemon/templates/agents/coder.md +165 -8
  288. package/dist/daemon/templates/agents/decision-maker.md +107 -21
  289. package/dist/daemon/templates/agents/doc-reviewer.md +4 -1
  290. package/dist/daemon/templates/agents/harness-debug-full.md +85 -3
  291. package/dist/daemon/templates/agents/knowledge-builder.md +1 -0
  292. package/dist/daemon/templates/agents/patch-applier.md +1 -0
  293. package/dist/daemon/templates/agents/planner.md +55 -3
  294. package/dist/daemon/templates/agents/safety-net-implementer.md +278 -0
  295. package/dist/daemon/templates/agents/skill-distiller.md +1 -0
  296. package/dist/daemon/templates/agents/task-boundary-classifier.md +1 -0
  297. package/dist/daemon/templates/agents/verify-agent.md +128 -5
  298. package/dist/hooks/stop.sh +7 -1
  299. package/dist/knowledge/builder.js +36 -7
  300. package/dist/knowledge/builder.js.map +1 -1
  301. package/dist/knowledge/constants.d.ts +10 -5
  302. package/dist/knowledge/constants.d.ts.map +1 -1
  303. package/dist/knowledge/constants.js +10 -5
  304. package/dist/knowledge/constants.js.map +1 -1
  305. package/dist/knowledge/graph/edge-extractor.d.ts +45 -0
  306. package/dist/knowledge/graph/edge-extractor.d.ts.map +1 -0
  307. package/dist/knowledge/graph/edge-extractor.js +242 -0
  308. package/dist/knowledge/graph/edge-extractor.js.map +1 -0
  309. package/dist/knowledge/graph/impact.d.ts +73 -0
  310. package/dist/knowledge/graph/impact.d.ts.map +1 -0
  311. package/dist/knowledge/graph/impact.js +94 -0
  312. package/dist/knowledge/graph/impact.js.map +1 -0
  313. package/dist/knowledge/graph/types.d.ts +22 -0
  314. package/dist/knowledge/graph/types.d.ts.map +1 -0
  315. package/dist/knowledge/graph/types.js +13 -0
  316. package/dist/knowledge/graph/types.js.map +1 -0
  317. package/dist/knowledge/prompt.d.ts +9 -0
  318. package/dist/knowledge/prompt.d.ts.map +1 -1
  319. package/dist/knowledge/prompt.js +17 -5
  320. package/dist/knowledge/prompt.js.map +1 -1
  321. package/dist/knowledge/query.d.ts +13 -0
  322. package/dist/knowledge/query.d.ts.map +1 -1
  323. package/dist/knowledge/query.js +107 -10
  324. package/dist/knowledge/query.js.map +1 -1
  325. package/dist/knowledge/repo-map.d.ts +11 -5
  326. package/dist/knowledge/repo-map.d.ts.map +1 -1
  327. package/dist/knowledge/repo-map.js +42 -3
  328. package/dist/knowledge/repo-map.js.map +1 -1
  329. package/dist/knowledge/validator.d.ts.map +1 -1
  330. package/dist/knowledge/validator.js +69 -2
  331. package/dist/knowledge/validator.js.map +1 -1
  332. package/dist/mcp/server.d.ts +64 -8
  333. package/dist/mcp/server.d.ts.map +1 -1
  334. package/dist/mcp/server.js +233 -18
  335. package/dist/mcp/server.js.map +1 -1
  336. package/dist/skills/distill/distiller.js +1 -1
  337. package/dist/skills/distill/distiller.js.map +1 -1
  338. package/dist/skills/distilled/distilled-api-design.md +4 -0
  339. package/dist/skills/distilled/distilled-brainstorming.md +79 -0
  340. package/dist/skills/distilled/distilled-brand-guidelines.md +86 -0
  341. package/dist/skills/distilled/distilled-canvas-design.md +128 -0
  342. package/dist/skills/distilled/distilled-claude-api.md +185 -0
  343. package/dist/skills/distilled/distilled-creator.md +5 -2
  344. package/dist/skills/distilled/distilled-dispatching-parallel-agents.md +136 -0
  345. package/dist/skills/distilled/distilled-doc-coauthoring.md +144 -0
  346. package/dist/skills/distilled/distilled-docx.md +231 -0
  347. package/dist/skills/distilled/distilled-executing-plans.md +85 -50
  348. package/dist/skills/distilled/distilled-finishing-a-development-branch.md +213 -0
  349. package/dist/skills/distilled/distilled-frontend-design.md +118 -0
  350. package/dist/skills/distilled/distilled-harness-engineering.md +1 -1
  351. package/dist/skills/distilled/distilled-receiving-code-review.md +185 -0
  352. package/dist/skills/distilled/distilled-subagent-driven-development.md +124 -0
  353. package/dist/skills/distilled/distilled-systematic-debugging.md +108 -260
  354. package/dist/skills/distilled/distilled-test-driven-development.md +432 -0
  355. package/dist/skills/distilled/distilled-using-superpowers.md +134 -0
  356. package/dist/skills/distilled/distilled-verification-before-completion.md +88 -78
  357. package/dist/skills/distilled/distilled-writing-skills.md +175 -0
  358. package/dist/skills/registry.d.ts +10 -50
  359. package/dist/skills/registry.d.ts.map +1 -1
  360. package/dist/skills/registry.js +7 -118
  361. package/dist/skills/registry.js.map +1 -1
  362. package/dist/skills/tools/pipeline-suggest.js +2 -2
  363. package/dist/skills/tools/pipeline-suggest.js.map +1 -1
  364. package/dist/skills/tools/skill-invoke.d.ts +2 -1
  365. package/dist/skills/tools/skill-invoke.d.ts.map +1 -1
  366. package/dist/skills/tools/skill-invoke.js +3 -1
  367. package/dist/skills/tools/skill-invoke.js.map +1 -1
  368. package/dist/web/analytics/anti-pattern-detector.d.ts.map +1 -1
  369. package/dist/web/analytics/anti-pattern-detector.js +6 -1
  370. package/dist/web/analytics/anti-pattern-detector.js.map +1 -1
  371. package/dist/web/analytics/drift-detector.d.ts +6 -0
  372. package/dist/web/analytics/drift-detector.d.ts.map +1 -1
  373. package/dist/web/analytics/drift-detector.js +15 -8
  374. package/dist/web/analytics/drift-detector.js.map +1 -1
  375. package/dist/web/analytics/weekly-report.d.ts +13 -0
  376. package/dist/web/analytics/weekly-report.d.ts.map +1 -1
  377. package/dist/web/analytics/weekly-report.js +17 -3
  378. package/dist/web/analytics/weekly-report.js.map +1 -1
  379. package/dist/web/routes/_helpers.d.ts +31 -0
  380. package/dist/web/routes/_helpers.d.ts.map +1 -1
  381. package/dist/web/routes/_helpers.js +33 -0
  382. package/dist/web/routes/_helpers.js.map +1 -1
  383. package/dist/web/routes/agent-distill.d.ts +49 -0
  384. package/dist/web/routes/agent-distill.d.ts.map +1 -0
  385. package/dist/web/routes/agent-distill.js +526 -0
  386. package/dist/web/routes/agent-distill.js.map +1 -0
  387. package/dist/web/routes/config.d.ts +56 -0
  388. package/dist/web/routes/config.d.ts.map +1 -0
  389. package/dist/web/routes/config.js +243 -0
  390. package/dist/web/routes/config.js.map +1 -0
  391. package/dist/web/routes/decisions.js +1 -1
  392. package/dist/web/routes/decisions.js.map +1 -1
  393. package/dist/web/routes/error-handler.d.ts +0 -4
  394. package/dist/web/routes/error-handler.d.ts.map +1 -1
  395. package/dist/web/routes/error-handler.js +0 -8
  396. package/dist/web/routes/error-handler.js.map +1 -1
  397. package/dist/web/routes/events.d.ts.map +1 -1
  398. package/dist/web/routes/events.js +2 -1
  399. package/dist/web/routes/events.js.map +1 -1
  400. package/dist/web/routes/insights.d.ts.map +1 -1
  401. package/dist/web/routes/insights.js +0 -0
  402. package/dist/web/routes/insights.js.map +1 -1
  403. package/dist/web/routes/knowledge.d.ts +43 -2
  404. package/dist/web/routes/knowledge.d.ts.map +1 -1
  405. package/dist/web/routes/knowledge.js +117 -6
  406. package/dist/web/routes/knowledge.js.map +1 -1
  407. package/dist/web/routes/pipeline.d.ts +0 -9
  408. package/dist/web/routes/pipeline.d.ts.map +1 -1
  409. package/dist/web/routes/pipeline.js +0 -4
  410. package/dist/web/routes/pipeline.js.map +1 -1
  411. package/dist/web/routes/rules.d.ts.map +1 -1
  412. package/dist/web/routes/rules.js +20 -6
  413. package/dist/web/routes/rules.js.map +1 -1
  414. package/dist/web/routes/sessions.d.ts.map +1 -1
  415. package/dist/web/routes/sessions.js +8 -7
  416. package/dist/web/routes/sessions.js.map +1 -1
  417. package/dist/web/routes/skill-stats.d.ts.map +1 -1
  418. package/dist/web/routes/skill-stats.js +153 -16
  419. package/dist/web/routes/skill-stats.js.map +1 -1
  420. package/dist/web/routes/skills-distill.js +1 -1
  421. package/dist/web/routes/skills-distill.js.map +1 -1
  422. package/dist/web/routes/stats.d.ts.map +1 -1
  423. package/dist/web/routes/stats.js +2 -1
  424. package/dist/web/routes/stats.js.map +1 -1
  425. package/dist/web/routes/task-timeline.d.ts +95 -19
  426. package/dist/web/routes/task-timeline.d.ts.map +1 -1
  427. package/dist/web/routes/task-timeline.js +344 -88
  428. package/dist/web/routes/task-timeline.js.map +1 -1
  429. package/dist/web/routes/tasks.d.ts.map +1 -1
  430. package/dist/web/routes/tasks.js +52 -30
  431. package/dist/web/routes/tasks.js.map +1 -1
  432. package/dist/web/routes/violations.d.ts +1 -1
  433. package/dist/web/routes/violations.d.ts.map +1 -1
  434. package/dist/web/routes/violations.js +3 -2
  435. package/dist/web/routes/violations.js.map +1 -1
  436. package/dist/web/server.d.ts.map +1 -1
  437. package/dist/web/server.js +20 -0
  438. package/dist/web/server.js.map +1 -1
  439. package/dist/web/services/agent-distill-manager.d.ts +122 -0
  440. package/dist/web/services/agent-distill-manager.d.ts.map +1 -0
  441. package/dist/web/services/agent-distill-manager.js +397 -0
  442. package/dist/web/services/agent-distill-manager.js.map +1 -0
  443. package/dist/web/services/distill-manager.d.ts +47 -0
  444. package/dist/web/services/distill-manager.d.ts.map +1 -1
  445. package/dist/web/services/distill-manager.js +103 -0
  446. package/dist/web/services/distill-manager.js.map +1 -1
  447. package/dist/web/static/assets/AgentDetailPage-DlUeA1sX.js +2 -0
  448. package/dist/web/static/assets/AgentDetailPage-DlUeA1sX.js.map +1 -0
  449. package/dist/web/static/assets/AgentDistillRunPage-Cybo4bii.js +3 -0
  450. package/dist/web/static/assets/AgentDistillRunPage-Cybo4bii.js.map +1 -0
  451. package/dist/web/static/assets/AgentsPage-Qd9FExLG.js +2 -0
  452. package/dist/web/static/assets/AgentsPage-Qd9FExLG.js.map +1 -0
  453. package/dist/web/static/assets/DaemonHealthPage-DTSVqtrI.js +2 -0
  454. package/dist/web/static/assets/DaemonHealthPage-DTSVqtrI.js.map +1 -0
  455. package/dist/web/static/assets/DecisionDetailPage-b4BA8dhc.js +2 -0
  456. package/dist/web/static/assets/DecisionDetailPage-b4BA8dhc.js.map +1 -0
  457. package/dist/web/static/assets/DecisionsPage-a3NRo_T7.js +2 -0
  458. package/dist/web/static/assets/DecisionsPage-a3NRo_T7.js.map +1 -0
  459. package/dist/web/static/assets/DiagnosticsPage-DIVdiIQG.js +2 -0
  460. package/dist/web/static/assets/DiagnosticsPage-DIVdiIQG.js.map +1 -0
  461. package/dist/web/static/assets/DistillDetailPage-U6a3l2iP.js +4 -0
  462. package/dist/web/static/assets/DistillDetailPage-U6a3l2iP.js.map +1 -0
  463. package/dist/web/static/assets/DistillPage-O7BHtRN8.js +2 -0
  464. package/dist/web/static/assets/DistillPage-O7BHtRN8.js.map +1 -0
  465. package/dist/web/static/assets/DistillRunPage-D1JuRWWr.js +2 -0
  466. package/dist/web/static/assets/DistillRunPage-D1JuRWWr.js.map +1 -0
  467. package/dist/web/static/assets/GlobalScopeHint-Q3wTJx3F.js +2 -0
  468. package/dist/web/static/assets/GlobalScopeHint-Q3wTJx3F.js.map +1 -0
  469. package/dist/web/static/assets/IssueDetailPage-BDfrtk2C.js +2 -0
  470. package/dist/web/static/assets/IssueDetailPage-BDfrtk2C.js.map +1 -0
  471. package/dist/web/static/assets/IssuesPage-SKmhlCrw.js +2 -0
  472. package/dist/web/static/assets/IssuesPage-SKmhlCrw.js.map +1 -0
  473. package/dist/web/static/assets/KbDetailPage-Yna86Na8.js +2 -0
  474. package/dist/web/static/assets/KbDetailPage-Yna86Na8.js.map +1 -0
  475. package/dist/web/static/assets/KbHitsPage-Cljl7H9p.js +2 -0
  476. package/dist/web/static/assets/KbHitsPage-Cljl7H9p.js.map +1 -0
  477. package/dist/web/static/assets/{MarkdownRenderer-DZmTl-8J.js → MarkdownRenderer-DlDQNihj.js} +2 -2
  478. package/dist/web/static/assets/{MarkdownRenderer-DZmTl-8J.js.map → MarkdownRenderer-DlDQNihj.js.map} +1 -1
  479. package/dist/web/static/assets/NotFound-LMzbP51V.js +2 -0
  480. package/dist/web/static/assets/{NotFound-BQPh0vaF.js.map → NotFound-LMzbP51V.js.map} +1 -1
  481. package/dist/web/static/assets/SettingsPage-DzoK4PKg.js +2 -0
  482. package/dist/web/static/assets/SettingsPage-DzoK4PKg.js.map +1 -0
  483. package/dist/web/static/assets/SkillDetailPage-BuBJJ_NX.js +2 -0
  484. package/dist/web/static/assets/SkillDetailPage-BuBJJ_NX.js.map +1 -0
  485. package/dist/web/static/assets/SkillsPage-aojkJpBc.js +2 -0
  486. package/dist/web/static/assets/SkillsPage-aojkJpBc.js.map +1 -0
  487. package/dist/web/static/assets/TaskDetailPage-1ckxnGhw.js +4 -0
  488. package/dist/web/static/assets/TaskDetailPage-1ckxnGhw.js.map +1 -0
  489. package/dist/web/static/assets/TasksHubPage-C2PLh3eg.js +6 -0
  490. package/dist/web/static/assets/TasksHubPage-C2PLh3eg.js.map +1 -0
  491. package/dist/web/static/assets/WorkplacePage-DHrp5VxS.js +2 -0
  492. package/dist/web/static/assets/WorkplacePage-DHrp5VxS.js.map +1 -0
  493. package/dist/web/static/assets/arco-DV6xCLhr.js +14 -0
  494. package/dist/web/static/assets/arco-DV6xCLhr.js.map +1 -0
  495. package/dist/web/static/assets/charts-BSV4cyC4.js +37 -0
  496. package/dist/web/static/assets/charts-BSV4cyC4.js.map +1 -0
  497. package/dist/web/static/assets/{index-7bl3kbcx.css → index-B_v_MKlb.css} +1 -1
  498. package/dist/web/static/assets/index-DileOOE4.js +4 -0
  499. package/dist/web/static/assets/index-DileOOE4.js.map +1 -0
  500. package/dist/web/static/assets/markdown-CA7ePUts.js +30 -0
  501. package/dist/web/static/assets/markdown-CA7ePUts.js.map +1 -0
  502. package/dist/web/static/assets/{outcome-DUn1NjlC.js → outcome-BKGy9azt.js} +2 -2
  503. package/dist/web/static/assets/{outcome-DUn1NjlC.js.map → outcome-BKGy9azt.js.map} +1 -1
  504. package/dist/web/static/assets/{query-S6X1S7K9.js → query-CgCOpYWf.js} +2 -2
  505. package/dist/web/static/assets/{query-S6X1S7K9.js.map → query-CgCOpYWf.js.map} +1 -1
  506. package/dist/web/static/assets/{react-router-JVUrkhdd.js → react-router-Cxmg8RuL.js} +3 -3
  507. package/dist/web/static/assets/{react-router-JVUrkhdd.js.map → react-router-Cxmg8RuL.js.map} +1 -1
  508. package/dist/web/static/assets/{syntax-highlighter-BkZfCDsz.js → syntax-highlighter-BDYycNja.js} +3 -3
  509. package/dist/web/static/assets/{syntax-highlighter-BkZfCDsz.js.map → syntax-highlighter-BDYycNja.js.map} +1 -1
  510. package/dist/web/static/assets/task-title-BhOcemuR.js +2 -0
  511. package/dist/web/static/assets/task-title-BhOcemuR.js.map +1 -0
  512. package/dist/web/static/assets/useAgentStats-B-uTgqBd.js +2 -0
  513. package/dist/web/static/assets/useAgentStats-B-uTgqBd.js.map +1 -0
  514. package/dist/web/static/assets/useDecisions-D-G2Ft5T.js +2 -0
  515. package/dist/web/static/assets/useDecisions-D-G2Ft5T.js.map +1 -0
  516. package/dist/web/static/assets/useDistill-21dZkXlT.js +3 -0
  517. package/dist/web/static/assets/useDistill-21dZkXlT.js.map +1 -0
  518. package/dist/web/static/assets/useEffectiveProject-DQiyX54y.js +2 -0
  519. package/dist/web/static/assets/useEffectiveProject-DQiyX54y.js.map +1 -0
  520. package/dist/web/static/assets/useIssuesFeed-CFiyQkAL.js +2 -0
  521. package/dist/web/static/assets/useIssuesFeed-CFiyQkAL.js.map +1 -0
  522. package/dist/web/static/assets/useKbHits-xKXWgqh9.js +2 -0
  523. package/dist/web/static/assets/useKbHits-xKXWgqh9.js.map +1 -0
  524. package/dist/web/static/assets/useSkillStats-B5hbIwdf.js +2 -0
  525. package/dist/web/static/assets/useSkillStats-B5hbIwdf.js.map +1 -0
  526. package/dist/web/static/assets/vendor-DS-q4Eyc.js +36 -0
  527. package/dist/web/static/assets/vendor-DS-q4Eyc.js.map +1 -0
  528. package/dist/web/static/index.html +6 -6
  529. package/package.json +5 -3
  530. package/dist/core/storage/workflow-recommendations.d.ts +0 -124
  531. package/dist/core/storage/workflow-recommendations.d.ts.map +0 -1
  532. package/dist/core/storage/workflow-recommendations.js +0 -274
  533. package/dist/core/storage/workflow-recommendations.js.map +0 -1
  534. package/dist/daemon/services/experience-extractor.d.ts.map +0 -1
  535. package/dist/daemon/services/experience-extractor.js.map +0 -1
  536. package/dist/daemon/services/violation-reporter.d.ts.map +0 -1
  537. package/dist/daemon/services/violation-reporter.js.map +0 -1
  538. package/dist/daemon/templates/agents/harness-hotfix.md +0 -99
  539. package/dist/daemon/templates/agents/hybrid-feature-with-safety.md +0 -104
  540. package/dist/daemon/templates/agents/refactor-specialist.md +0 -98
  541. package/dist/skills/distill/claude-cli-resolver.d.ts.map +0 -1
  542. package/dist/skills/distill/claude-cli-resolver.js.map +0 -1
  543. package/dist/skills/distilled/distilled-defi-amm-security.md +0 -293
  544. package/dist/skills/keyword-score.d.ts +0 -29
  545. package/dist/skills/keyword-score.d.ts.map +0 -1
  546. package/dist/skills/keyword-score.js +0 -54
  547. package/dist/skills/keyword-score.js.map +0 -1
  548. package/dist/web/static/assets/AgentContentPage-DkeRNxok.js +0 -2
  549. package/dist/web/static/assets/AgentContentPage-DkeRNxok.js.map +0 -1
  550. package/dist/web/static/assets/AgentDelegationTable-ByBa0x1l.js +0 -2
  551. package/dist/web/static/assets/AgentDelegationTable-ByBa0x1l.js.map +0 -1
  552. package/dist/web/static/assets/ContextInsightsPage-oUk7_I8u.js +0 -3
  553. package/dist/web/static/assets/ContextInsightsPage-oUk7_I8u.js.map +0 -1
  554. package/dist/web/static/assets/DaemonHealthPage-DG2fyOP7.js +0 -2
  555. package/dist/web/static/assets/DaemonHealthPage-DG2fyOP7.js.map +0 -1
  556. package/dist/web/static/assets/DecisionsPage-CMAPEnKb.js +0 -2
  557. package/dist/web/static/assets/DecisionsPage-CMAPEnKb.js.map +0 -1
  558. package/dist/web/static/assets/DiagnosticsPage-DQd-Zm4r.js +0 -2
  559. package/dist/web/static/assets/DiagnosticsPage-DQd-Zm4r.js.map +0 -1
  560. package/dist/web/static/assets/DriftTab-DqpepOhI.js +0 -2
  561. package/dist/web/static/assets/DriftTab-DqpepOhI.js.map +0 -1
  562. package/dist/web/static/assets/HealthHomePage-CN6zNIie.js +0 -3
  563. package/dist/web/static/assets/HealthHomePage-CN6zNIie.js.map +0 -1
  564. package/dist/web/static/assets/KbHitRateTable-ByEIWujF.js +0 -2
  565. package/dist/web/static/assets/KbHitRateTable-ByEIWujF.js.map +0 -1
  566. package/dist/web/static/assets/NotFound-BQPh0vaF.js +0 -2
  567. package/dist/web/static/assets/ProjectSwitcher-D3lZMFd3.js +0 -2
  568. package/dist/web/static/assets/ProjectSwitcher-D3lZMFd3.js.map +0 -1
  569. package/dist/web/static/assets/SettingsPage-oLJBNzQj.js +0 -2
  570. package/dist/web/static/assets/SettingsPage-oLJBNzQj.js.map +0 -1
  571. package/dist/web/static/assets/SkillContentPage-DK5rgfgw.js +0 -2
  572. package/dist/web/static/assets/SkillContentPage-DK5rgfgw.js.map +0 -1
  573. package/dist/web/static/assets/SkillStatsTable-DYMzjEUV.js +0 -2
  574. package/dist/web/static/assets/SkillStatsTable-DYMzjEUV.js.map +0 -1
  575. package/dist/web/static/assets/SkillsDistillTab-C7qaG8q3.js +0 -2
  576. package/dist/web/static/assets/SkillsDistillTab-C7qaG8q3.js.map +0 -1
  577. package/dist/web/static/assets/TasksHubPage-03wsRRsJ.js +0 -6
  578. package/dist/web/static/assets/TasksHubPage-03wsRRsJ.js.map +0 -1
  579. package/dist/web/static/assets/ViolationsPage-DSiLr-9O.js +0 -3
  580. package/dist/web/static/assets/ViolationsPage-DSiLr-9O.js.map +0 -1
  581. package/dist/web/static/assets/arco-Bhi3a6Qp.js +0 -14
  582. package/dist/web/static/assets/arco-Bhi3a6Qp.js.map +0 -1
  583. package/dist/web/static/assets/charts-BuHQWDbQ.js +0 -37
  584. package/dist/web/static/assets/charts-BuHQWDbQ.js.map +0 -1
  585. package/dist/web/static/assets/index-BIYnq1Dx.js +0 -4
  586. package/dist/web/static/assets/index-BIYnq1Dx.js.map +0 -1
  587. package/dist/web/static/assets/useTabsParam-k8qte_0C.js +0 -2
  588. package/dist/web/static/assets/useTabsParam-k8qte_0C.js.map +0 -1
  589. package/dist/web/static/assets/vendor-DWgdB1eY.js +0 -65
  590. package/dist/web/static/assets/vendor-DWgdB1eY.js.map +0 -1
  591. /package/dist/{skills/distill → core/utils}/claude-cli-resolver.d.ts +0 -0
@@ -1,2 +1,2 @@
1
- import{j as o}from"./react-vendor-tkvCrao7.js";import{b as s}from"./arco-Bhi3a6Qp.js";const r={success:"#52c41a",partial:"#faad14",failed:"#f5222d",abandoned:"#86909c"},e={success:"green",partial:"orange",failed:"red",abandoned:"gray"},i={success:"成功",partial:"部分",failed:"失败",abandoned:"放弃"},n={success:"✅ 成功",partial:"⚠️ 部分",failed:"❌ 失败",abandoned:"🛑 放弃"};function d(a){return a&&a in r?r[a]:"var(--color-border-2)"}function O({value:a}){return!a||!(a in n)?null:o.jsx(s,{color:e[a],size:"small",children:n[a]})}export{i as O,r as a,O as b,d as o};
2
- //# sourceMappingURL=outcome-DUn1NjlC.js.map
1
+ import{j as o}from"./react-vendor-tkvCrao7.js";import{b as s}from"./arco-DV6xCLhr.js";const r={success:"#52c41a",partial:"#faad14",failed:"#f5222d",abandoned:"#86909c"},e={success:"green",partial:"orange",failed:"red",abandoned:"gray"},i={success:"成功",partial:"部分",failed:"失败",abandoned:"放弃"},n={success:"✅ 成功",partial:"⚠️ 部分",failed:"❌ 失败",abandoned:"🛑 放弃"};function d(a){return a&&a in r?r[a]:"var(--color-border-2)"}function O({value:a}){return!a||!(a in n)?null:o.jsx(s,{color:e[a],size:"small",children:n[a]})}export{i as O,r as a,O as b,d as o};
2
+ //# sourceMappingURL=outcome-BKGy9azt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"outcome-DUn1NjlC.js","sources":["../../src/utils/outcome.tsx"],"sourcesContent":["/**\n * Outcome palette + label + tag — single source of truth.\n *\n * Canonical pick (2026-05-26): Arco Design semantic palette\n * success: #52c41a (green)\n * partial: #faad14 (orange)\n * failed: #f5222d (red)\n * abandoned: #86909c (gray)\n *\n * Drift history:\n * - HealthHomePage and OutcomeDonutChart already use the Arco palette.\n * - TasksHubPage was the outlier (Material Design palette: #ff9800 / #f44336 /\n * #9e9e9e). After this consolidation, all 3 sites use the Arco palette and\n * share this file.\n *\n * Why Arco palette wins:\n * 1. 2-of-3 prior usages already used it.\n * 2. HealthHomePage (most recently updated, 2026-05-26) used it.\n * 3. Arco is the project's UI lib — semantic colors map cleanly to <Tag color=\"green\"> etc.\n *\n * The Arco <Tag> `color` prop takes a semantic name string (\"green\", \"orange\",\n * \"red\", \"gray\"), NOT a hex string. So OUTCOME_TAG_COLOR holds the semantic\n * names for <Tag>; OUTCOME_COLOR holds hex for recharts / border styling.\n */\n\nimport type { ReactElement } from 'react'\nimport Tag from '@arco-design/web-react/es/Tag'\n\nexport type OutcomeKey = 'success' | 'partial' | 'failed' | 'abandoned'\n\n/** Hex colors — for recharts, border styling, inline `style`. */\nexport const OUTCOME_COLOR: Record<OutcomeKey, string> = {\n success: '#52c41a',\n partial: '#faad14',\n failed: '#f5222d',\n abandoned: '#86909c',\n}\n\n/** Arco <Tag color=\"...\"> semantic names. */\nexport const OUTCOME_TAG_COLOR: Record<OutcomeKey, string> = {\n success: 'green',\n partial: 'orange',\n failed: 'red',\n abandoned: 'gray',\n}\n\n/** Chinese display labels. */\nexport const OUTCOME_LABEL: Record<OutcomeKey, string> = {\n success: '成功',\n partial: '部分',\n failed: '失败',\n abandoned: '放弃',\n}\n\n/** Emoji-prefixed labels (used by TasksHub's inline tag). */\nexport const OUTCOME_LABEL_EMOJI: Record<OutcomeKey, string> = {\n success: '✅ 成功',\n partial: '⚠️ 部分',\n failed: '❌ 失败',\n abandoned: '🛑 放弃',\n}\n\n/**\n * Hex border color for outcome — returns CSS var fallback for unknown/null.\n * Used by TasksHubPage's task-card left border.\n */\nexport function outcomeBorderColor(outcome: OutcomeKey | null | undefined): string {\n if (outcome && outcome in OUTCOME_COLOR) return OUTCOME_COLOR[outcome]\n return 'var(--color-border-2)'\n}\n\n/**\n * Small Arco-tag wrapper for outcome display.\n *\n * Returns `null` when value is null/undefined/unknown so call sites can\n * short-circuit fallback rendering (`<OutcomeTag value={x} /> || <fallback>`).\n */\nexport function OutcomeTag({ value }: { value: OutcomeKey | null | undefined }): ReactElement | null {\n if (!value || !(value in OUTCOME_LABEL_EMOJI)) return null\n return (\n <Tag color={OUTCOME_TAG_COLOR[value]} size=\"small\">\n {OUTCOME_LABEL_EMOJI[value]}\n </Tag>\n )\n}\n"],"names":["OUTCOME_COLOR","OUTCOME_TAG_COLOR","OUTCOME_LABEL","OUTCOME_LABEL_EMOJI","outcomeBorderColor","outcome","OutcomeTag","value","jsx","Tag"],"mappings":"sFA+BO,MAAMA,EAA4C,CACvD,QAAS,UACT,QAAS,UACT,OAAQ,UACR,UAAW,SACb,EAGaC,EAAgD,CAC3D,QAAS,QACT,QAAS,SACT,OAAQ,MACR,UAAW,MACb,EAGaC,EAA4C,CACvD,QAAS,KACT,QAAS,KACT,OAAQ,KACR,UAAW,IACb,EAGaC,EAAkD,CAC7D,QAAS,OACT,QAAS,QACT,OAAQ,OACR,UAAW,OACb,EAMO,SAASC,EAAmBC,EAAgD,CACjF,OAAIA,GAAWA,KAAWL,EAAsBA,EAAcK,CAAO,EAC9D,uBACT,CAQO,SAASC,EAAW,CAAE,MAAAC,GAAwE,CACnG,MAAI,CAACA,GAAS,EAAEA,KAASJ,GAA6B,KAEpDK,EAAAA,IAACC,EAAA,CAAI,MAAOR,EAAkBM,CAAK,EAAG,KAAK,QACxC,SAAAJ,EAAoBI,CAAK,CAAA,CAC5B,CAEJ"}
1
+ {"version":3,"file":"outcome-BKGy9azt.js","sources":["../../src/utils/outcome.tsx"],"sourcesContent":["/**\n * Outcome palette + label + tag — single source of truth.\n *\n * Canonical pick (2026-05-26): Arco Design semantic palette\n * success: #52c41a (green)\n * partial: #faad14 (orange)\n * failed: #f5222d (red)\n * abandoned: #86909c (gray)\n *\n * Drift history:\n * - HealthHomePage and OutcomeDonutChart already use the Arco palette.\n * - TasksHubPage was the outlier (Material Design palette: #ff9800 / #f44336 /\n * #9e9e9e). After this consolidation, all 3 sites use the Arco palette and\n * share this file.\n *\n * Why Arco palette wins:\n * 1. 2-of-3 prior usages already used it.\n * 2. HealthHomePage (most recently updated, 2026-05-26) used it.\n * 3. Arco is the project's UI lib — semantic colors map cleanly to <Tag color=\"green\"> etc.\n *\n * The Arco <Tag> `color` prop takes a semantic name string (\"green\", \"orange\",\n * \"red\", \"gray\"), NOT a hex string. So OUTCOME_TAG_COLOR holds the semantic\n * names for <Tag>; OUTCOME_COLOR holds hex for recharts / border styling.\n */\n\nimport type { ReactElement } from 'react'\nimport Tag from '@arco-design/web-react/es/Tag'\n\nexport type OutcomeKey = 'success' | 'partial' | 'failed' | 'abandoned'\n\n/** Hex colors — for recharts, border styling, inline `style`. */\nexport const OUTCOME_COLOR: Record<OutcomeKey, string> = {\n success: '#52c41a',\n partial: '#faad14',\n failed: '#f5222d',\n abandoned: '#86909c',\n}\n\n/** Arco <Tag color=\"...\"> semantic names. */\nexport const OUTCOME_TAG_COLOR: Record<OutcomeKey, string> = {\n success: 'green',\n partial: 'orange',\n failed: 'red',\n abandoned: 'gray',\n}\n\n/** Chinese display labels. */\nexport const OUTCOME_LABEL: Record<OutcomeKey, string> = {\n success: '成功',\n partial: '部分',\n failed: '失败',\n abandoned: '放弃',\n}\n\n/** Emoji-prefixed labels (used by TasksHub's inline tag). */\nexport const OUTCOME_LABEL_EMOJI: Record<OutcomeKey, string> = {\n success: '✅ 成功',\n partial: '⚠️ 部分',\n failed: '❌ 失败',\n abandoned: '🛑 放弃',\n}\n\n/**\n * Hex border color for outcome — returns CSS var fallback for unknown/null.\n * Used by TasksHubPage's task-card left border.\n */\nexport function outcomeBorderColor(outcome: OutcomeKey | null | undefined): string {\n if (outcome && outcome in OUTCOME_COLOR) return OUTCOME_COLOR[outcome]\n return 'var(--color-border-2)'\n}\n\n/**\n * Small Arco-tag wrapper for outcome display.\n *\n * Returns `null` when value is null/undefined/unknown so call sites can\n * short-circuit fallback rendering (`<OutcomeTag value={x} /> || <fallback>`).\n */\nexport function OutcomeTag({ value }: { value: OutcomeKey | null | undefined }): ReactElement | null {\n if (!value || !(value in OUTCOME_LABEL_EMOJI)) return null\n return (\n <Tag color={OUTCOME_TAG_COLOR[value]} size=\"small\">\n {OUTCOME_LABEL_EMOJI[value]}\n </Tag>\n )\n}\n"],"names":["OUTCOME_COLOR","OUTCOME_TAG_COLOR","OUTCOME_LABEL","OUTCOME_LABEL_EMOJI","outcomeBorderColor","outcome","OutcomeTag","value","jsx","Tag"],"mappings":"sFA+BO,MAAMA,EAA4C,CACvD,QAAS,UACT,QAAS,UACT,OAAQ,UACR,UAAW,SACb,EAGaC,EAAgD,CAC3D,QAAS,QACT,QAAS,SACT,OAAQ,MACR,UAAW,MACb,EAGaC,EAA4C,CACvD,QAAS,KACT,QAAS,KACT,OAAQ,KACR,UAAW,IACb,EAGaC,EAAkD,CAC7D,QAAS,OACT,QAAS,QACT,OAAQ,OACR,UAAW,OACb,EAMO,SAASC,EAAmBC,EAAgD,CACjF,OAAIA,GAAWA,KAAWL,EAAsBA,EAAcK,CAAO,EAC9D,uBACT,CAQO,SAASC,EAAW,CAAE,MAAAC,GAAwE,CACnG,MAAI,CAACA,GAAS,EAAEA,KAASJ,GAA6B,KAEpDK,EAAAA,IAACC,EAAA,CAAI,MAAOR,EAAkBM,CAAK,EAAG,KAAK,QACxC,SAAAJ,EAAoBI,CAAK,CAAA,CAC5B,CAEJ"}
@@ -1,2 +1,2 @@
1
- var Ce=e=>{throw TypeError(e)};var te=(e,t,s)=>t.has(e)||Ce("Cannot "+s);var r=(e,t,s)=>(te(e,t,"read from private field"),s?s.call(e):t.get(e)),c=(e,t,s)=>t.has(e)?Ce("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),o=(e,t,s,i)=>(te(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),f=(e,t,s)=>(te(e,t,"access private method"),s);var $t=(e,t,s,i)=>({set _(n){o(e,t,n,s)},get _(){return r(e,t,i)}});import{r as x,j as is}from"./react-vendor-tkvCrao7.js";var qt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yt,it,Pt,xe,rs=(xe=class extends qt{constructor(){super();c(this,yt);c(this,it);c(this,Pt);o(this,Pt,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){r(this,it)||this.setEventListener(r(this,Pt))}onUnsubscribe(){var t;this.hasListeners()||((t=r(this,it))==null||t.call(this),o(this,it,void 0))}setEventListener(t){var s;o(this,Pt,t),(s=r(this,it))==null||s.call(this),o(this,it,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){r(this,yt)!==t&&(o(this,yt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof r(this,yt)=="boolean"?r(this,yt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},yt=new WeakMap,it=new WeakMap,Pt=new WeakMap,xe),me=new rs,ns={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},rt,pe,Ae,as=(Ae=class{constructor(){c(this,rt,ns);c(this,pe,!1)}setTimeoutProvider(e){o(this,rt,e)}setTimeout(e,t){return r(this,rt).setTimeout(e,t)}clearTimeout(e){r(this,rt).clearTimeout(e)}setInterval(e,t){return r(this,rt).setInterval(e,t)}clearInterval(e){r(this,rt).clearInterval(e)}},rt=new WeakMap,pe=new WeakMap,Ae),ft=new as;function os(e){setTimeout(e,0)}var us=typeof window>"u"||"Deno"in globalThis;function q(){}function hs(e,t){return typeof e=="function"?e(t):e}function ee(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ge(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dt(e,t){return typeof e=="function"?e(t):e}function H(e,t){return typeof e=="function"?e(t):e}function Oe(e,t){const{type:s="all",exact:i,fetchStatus:n,predicate:a,queryKey:h,stale:u}=e;if(h){if(i){if(t.queryHash!==ve(h,t.options))return!1}else if(!_t(t.queryKey,h))return!1}if(s!=="all"){const p=t.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||n&&n!==t.state.fetchStatus||a&&!a(t))}function Pe(e,t){const{exact:s,status:i,predicate:n,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(s){if(Ot(t.options.mutationKey)!==Ot(a))return!1}else if(!_t(t.options.mutationKey,a))return!1}return!(i&&t.state.status!==i||n&&!n(t))}function ve(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ot)(e)}function Ot(e){return JSON.stringify(e,(t,s)=>se(s)?Object.keys(s).sort().reduce((i,n)=>(i[n]=s[n],i),{}):s)}function _t(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>_t(e[s],t[s])):!1}var cs=Object.prototype.hasOwnProperty;function Be(e,t,s=0){if(e===t)return e;if(s>500)return t;const i=Re(e)&&Re(t);if(!i&&!(se(e)&&se(t)))return t;const a=(i?e:Object.keys(e)).length,h=i?t:Object.keys(t),u=h.length,p=i?new Array(u):{};let m=0;for(let v=0;v<u;v++){const y=i?v:h[v],g=e[y],d=t[y];if(g===d){p[y]=g,(i?v<a:cs.call(e,y))&&m++;continue}if(g===null||d===null||typeof g!="object"||typeof d!="object"){p[y]=d;continue}const F=Be(g,d,s+1);p[y]=F,F===g&&m++}return a===u&&m===a?e:p}function Xt(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Re(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function se(e){if(!Fe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Fe(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Fe(e){return Object.prototype.toString.call(e)==="[object Object]"}function ls(e){return new Promise(t=>{ft.setTimeout(t,e)})}function ie(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Be(e,t):t}function Hs(e){return e}function ds(e,t,s=0){const i=[...e,t];return s&&i.length>s?i.slice(1):i}function fs(e,t,s=0){const i=[t,...e];return s&&i.length>s?i.slice(0,-1):i}var be=Symbol();function ze(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===be?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ge(e,t){return typeof e=="function"?e(...t):!!e}function ys(e,t,s){let i=!1,n;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??(n=t()),i||(i=!0,n.aborted?s():n.addEventListener("abort",s,{once:!0})),n)}),e}var kt=(()=>{let e=()=>us;return{isServer(){return e()},setIsServer(t){e=t}}})();function re(){let e,t;const s=new Promise((n,a)=>{e=n,t=a});s.status="pending",s.catch(()=>{});function i(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{i({status:"fulfilled",value:n}),e(n)},s.reject=n=>{i({status:"rejected",reason:n}),t(n)},s}var ps=os;function ms(){let e=[],t=0,s=u=>{u()},i=u=>{u()},n=ps;const a=u=>{t?e.push(u):n(()=>{s(u)})},h=()=>{const u=e;e=[],u.length&&n(()=>{i(()=>{u.forEach(p=>{s(p)})})})};return{batch:u=>{let p;t++;try{p=u()}finally{t--,t||h()}return p},batchCalls:u=>(...p)=>{a(()=>{u(...p)})},schedule:a,setNotifyFunction:u=>{s=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{n=u}}}var M=ms(),Rt,nt,Ft,je,vs=(je=class extends qt{constructor(){super();c(this,Rt,!0);c(this,nt);c(this,Ft);o(this,Ft,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",i)}}})}onSubscribe(){r(this,nt)||this.setEventListener(r(this,Ft))}onUnsubscribe(){var t;this.hasListeners()||((t=r(this,nt))==null||t.call(this),o(this,nt,void 0))}setEventListener(t){var s;o(this,Ft,t),(s=r(this,nt))==null||s.call(this),o(this,nt,t(this.setOnline.bind(this)))}setOnline(t){r(this,Rt)!==t&&(o(this,Rt,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return r(this,Rt)}},Rt=new WeakMap,nt=new WeakMap,Ft=new WeakMap,je),Yt=new vs;function bs(e){return Math.min(1e3*2**e,3e4)}function Ve(e){return(e??"online")==="online"?Yt.isOnline():!0}var ne=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function We(e){let t=!1,s=0,i;const n=re(),a=()=>n.status!=="pending",h=S=>{var w;if(!a()){const P=new ne(S);g(P),(w=e.onCancel)==null||w.call(e,P)}},u=()=>{t=!0},p=()=>{t=!1},m=()=>me.isFocused()&&(e.networkMode==="always"||Yt.isOnline())&&e.canRun(),v=()=>Ve(e.networkMode)&&e.canRun(),y=S=>{a()||(i==null||i(),n.resolve(S))},g=S=>{a()||(i==null||i(),n.reject(S))},d=()=>new Promise(S=>{var w;i=P=>{(a()||m())&&S(P)},(w=e.onPause)==null||w.call(e)}).then(()=>{var S;i=void 0,a()||(S=e.onContinue)==null||S.call(e)}),F=()=>{if(a())return;let S;const w=s===0?e.initialPromise:void 0;try{S=w??e.fn()}catch(P){S=Promise.reject(P)}Promise.resolve(S).then(y).catch(P=>{var K;if(a())return;const Q=e.retry??(kt.isServer()?0:3),R=e.retryDelay??bs,l=typeof R=="function"?R(s,P):R,I=Q===!0||typeof Q=="number"&&s<Q||typeof Q=="function"&&Q(s,P);if(t||!I){g(P);return}s++,(K=e.onFail)==null||K.call(e,s,P),ls(l).then(()=>m()?void 0:d()).then(()=>{t?g(P):F()})})};return{promise:n,status:()=>n.status,cancel:h,continue:()=>(i==null||i(),n),cancelRetry:u,continueRetry:p,canStart:v,start:()=>(v()?F():d().then(F),n)}}var pt,Ue,$e=(Ue=class{constructor(){c(this,pt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ee(this.gcTime)&&o(this,pt,ft.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(kt.isServer()?1/0:5*60*1e3))}clearGcTimeout(){r(this,pt)!==void 0&&(ft.clearTimeout(r(this,pt)),o(this,pt,void 0))}},pt=new WeakMap,Ue);function gs(e){return{onFetch:(t,s)=>{var v,y,g,d,F;const i=t.options,n=(g=(y=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:y.fetchMore)==null?void 0:g.direction,a=((d=t.state.data)==null?void 0:d.pages)||[],h=((F=t.state.data)==null?void 0:F.pageParams)||[];let u={pages:[],pageParams:[]},p=0;const m=async()=>{let S=!1;const w=R=>{ys(R,()=>t.signal,()=>S=!0)},P=ze(t.options,t.fetchOptions),Q=async(R,l,I)=>{if(S)return Promise.reject(t.signal.reason);if(l==null&&R.pages.length)return Promise.resolve(R);const tt=(()=>{const et={client:t.client,queryKey:t.queryKey,pageParam:l,direction:I?"backward":"forward",meta:t.options.meta};return w(et),et})(),O=await P(tt),{maxPages:T}=t.options,j=I?fs:ds;return{pages:j(R.pages,O,T),pageParams:j(R.pageParams,l,T)}};if(n&&a.length){const R=n==="backward",l=R?Ss:Ee,I={pages:a,pageParams:h},K=l(i,I);u=await Q(I,K,R)}else{const R=e??a.length;do{const l=p===0?h[0]??i.initialPageParam:Ee(i,u);if(p>0&&l==null)break;u=await Q(u,l),p++}while(p<R)}return u};t.options.persister?t.fetchFn=()=>{var S,w;return(w=(S=t.options).persister)==null?void 0:w.call(S,m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=m}}}function Ee(e,{pages:t,pageParams:s}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,s[i],s):void 0}function Ss(e,{pages:t,pageParams:s}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,s[0],s):void 0}var Et,mt,Mt,N,vt,D,Lt,bt,L,Je,W,qe,ws=(qe=class extends $e{constructor(t){super();c(this,L);c(this,Et);c(this,mt);c(this,Mt);c(this,N);c(this,vt);c(this,D);c(this,Lt);c(this,bt);o(this,bt,!1),o(this,Lt,t.defaultOptions),this.setOptions(t.options),this.observers=[],o(this,vt,t.client),o(this,N,r(this,vt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,o(this,mt,Qe(this.options)),this.state=t.state??r(this,mt),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return r(this,Et)}get promise(){var t;return(t=r(this,D))==null?void 0:t.promise}setOptions(t){if(this.options={...r(this,Lt),...t},t!=null&&t._type&&o(this,Et,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Qe(this.options);s.data!==void 0&&(this.setState(Me(s.data,s.dataUpdatedAt)),o(this,mt,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&r(this,N).remove(this)}setData(t,s){const i=ie(this.state.data,t,this.options);return f(this,L,W).call(this,{data:i,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),i}setState(t){f(this,L,W).call(this,{type:"setState",state:t})}cancel(t){var i,n;const s=(i=r(this,D))==null?void 0:i.promise;return(n=r(this,D))==null||n.cancel(t),s?s.then(q).catch(q):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return r(this,mt)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>H(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===be||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>dt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ge(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=r(this,D))==null||s.continue()}onOnline(){var s;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=r(this,D))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),r(this,N).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(r(this,D)&&(r(this,bt)||f(this,L,Je).call(this)?r(this,D).cancel({revert:!0}):r(this,D).cancelRetry()),this.scheduleGc()),r(this,N).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||f(this,L,W).call(this,{type:"invalidate"})}async fetch(t,s){var m,v,y,g,d,F,S,w,P,Q,R;if(this.state.fetchStatus!=="idle"&&((m=r(this,D))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(r(this,D))return r(this,D).continueRetry(),r(this,D).promise}if(t&&this.setOptions(t),!this.options.queryFn){const l=this.observers.find(I=>I.options.queryFn);l&&this.setOptions(l.options)}const i=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(o(this,bt,!0),i.signal)})},a=()=>{const l=ze(this.options,s),K=(()=>{const tt={client:r(this,vt),queryKey:this.queryKey,meta:this.meta};return n(tt),tt})();return o(this,bt,!1),this.options.persister?this.options.persister(l,K,this):l(K)},u=(()=>{const l={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:r(this,vt),state:this.state,fetchFn:a};return n(l),l})(),p=r(this,Et)==="infinite"?gs(this.options.pages):this.options.behavior;p==null||p.onFetch(u,this),o(this,Mt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=u.fetchOptions)==null?void 0:v.meta))&&f(this,L,W).call(this,{type:"fetch",meta:(y=u.fetchOptions)==null?void 0:y.meta}),o(this,D,We({initialPromise:s==null?void 0:s.initialPromise,fn:u.fetchFn,onCancel:l=>{l instanceof ne&&l.revert&&this.setState({...r(this,Mt),fetchStatus:"idle"}),i.abort()},onFail:(l,I)=>{f(this,L,W).call(this,{type:"failed",failureCount:l,error:I})},onPause:()=>{f(this,L,W).call(this,{type:"pause"})},onContinue:()=>{f(this,L,W).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const l=await r(this,D).start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),(d=(g=r(this,N).config).onSuccess)==null||d.call(g,l,this),(S=(F=r(this,N).config).onSettled)==null||S.call(F,l,this.state.error,this),l}catch(l){if(l instanceof ne){if(l.silent)return r(this,D).promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw f(this,L,W).call(this,{type:"error",error:l}),(P=(w=r(this,N).config).onError)==null||P.call(w,l,this),(R=(Q=r(this,N).config).onSettled)==null||R.call(Q,this.state.data,l,this),l}finally{this.scheduleGc()}}},Et=new WeakMap,mt=new WeakMap,Mt=new WeakMap,N=new WeakMap,vt=new WeakMap,D=new WeakMap,Lt=new WeakMap,bt=new WeakMap,L=new WeakSet,Je=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},W=function(t){const s=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Ze(i.data,this.options),fetchMeta:t.meta??null};case"success":const n={...i,...Me(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return o(this,Mt,t.manual?n:void 0),n;case"error":const a=t.error;return{...i,error:a,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=s(this.state),M.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),r(this,N).notify({query:this,type:"updated",action:t})})},qe);function Ze(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ve(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Me(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Qe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,i=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var _,b,Ht,U,gt,Qt,$,at,Nt,It,Tt,St,wt,ot,Dt,C,Kt,ae,oe,ue,he,ce,le,de,Xe,Ke,Cs=(Ke=class extends qt{constructor(t,s){super();c(this,C);c(this,_);c(this,b);c(this,Ht);c(this,U);c(this,gt);c(this,Qt);c(this,$);c(this,at);c(this,Nt);c(this,It);c(this,Tt);c(this,St);c(this,wt);c(this,ot);c(this,Dt,new Set);this.options=s,o(this,_,t),o(this,at,null),o(this,$,re()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(r(this,b).addObserver(this),Ie(r(this,b),this.options)?f(this,C,Kt).call(this):this.updateResult(),f(this,C,he).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fe(r(this,b),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fe(r(this,b),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,f(this,C,ce).call(this),f(this,C,le).call(this),r(this,b).removeObserver(this)}setOptions(t){const s=this.options,i=r(this,b);if(this.options=r(this,_).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof H(this.options.enabled,r(this,b))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");f(this,C,de).call(this),r(this,b).setOptions(this.options),s._defaulted&&!Xt(this.options,s)&&r(this,_).getQueryCache().notify({type:"observerOptionsUpdated",query:r(this,b),observer:this});const n=this.hasListeners();n&&Te(r(this,b),i,this.options,s)&&f(this,C,Kt).call(this),this.updateResult(),n&&(r(this,b)!==i||H(this.options.enabled,r(this,b))!==H(s.enabled,r(this,b))||dt(this.options.staleTime,r(this,b))!==dt(s.staleTime,r(this,b)))&&f(this,C,ae).call(this);const a=f(this,C,oe).call(this);n&&(r(this,b)!==i||H(this.options.enabled,r(this,b))!==H(s.enabled,r(this,b))||a!==r(this,ot))&&f(this,C,ue).call(this,a)}getOptimisticResult(t){const s=r(this,_).getQueryCache().build(r(this,_),t),i=this.createResult(s,t);return Ps(this,i)&&(o(this,U,i),o(this,Qt,this.options),o(this,gt,r(this,b).state)),i}getCurrentResult(){return r(this,U)}trackResult(t,s){return new Proxy(t,{get:(i,n)=>(this.trackProp(n),s==null||s(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&r(this,$).status==="pending"&&r(this,$).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,n))})}trackProp(t){r(this,Dt).add(t)}getCurrentQuery(){return r(this,b)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=r(this,_).defaultQueryOptions(t),i=r(this,_).getQueryCache().build(r(this,_),s);return i.fetch().then(()=>this.createResult(i,s))}fetch(t){return f(this,C,Kt).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),r(this,U)))}createResult(t,s){var T;const i=r(this,b),n=this.options,a=r(this,U),h=r(this,gt),u=r(this,Qt),m=t!==i?t.state:r(this,Ht),{state:v}=t;let y={...v},g=!1,d;if(s._optimisticResults){const j=this.hasListeners(),et=!j&&Ie(t,s),zt=j&&Te(t,i,s,n);(et||zt)&&(y={...y,...Ze(v.data,t.options)}),s._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:F,errorUpdatedAt:S,status:w}=y;d=y.data;let P=!1;if(s.placeholderData!==void 0&&d===void 0&&w==="pending"){let j;a!=null&&a.isPlaceholderData&&s.placeholderData===(u==null?void 0:u.placeholderData)?(j=a.data,P=!0):j=typeof s.placeholderData=="function"?s.placeholderData((T=r(this,Tt))==null?void 0:T.state.data,r(this,Tt)):s.placeholderData,j!==void 0&&(w="success",d=ie(a==null?void 0:a.data,j,s),g=!0)}if(s.select&&d!==void 0&&!P)if(a&&d===(h==null?void 0:h.data)&&s.select===r(this,Nt))d=r(this,It);else try{o(this,Nt,s.select),d=s.select(d),d=ie(a==null?void 0:a.data,d,s),o(this,It,d),o(this,at,null)}catch(j){o(this,at,j)}r(this,at)&&(F=r(this,at),d=r(this,It),S=Date.now(),w="error");const Q=y.fetchStatus==="fetching",R=w==="pending",l=w==="error",I=R&&Q,K=d!==void 0,O={status:w,fetchStatus:y.fetchStatus,isPending:R,isSuccess:w==="success",isError:l,isInitialLoading:I,isLoading:I,data:d,dataUpdatedAt:y.dataUpdatedAt,error:F,errorUpdatedAt:S,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:y.dataUpdateCount>m.dataUpdateCount||y.errorUpdateCount>m.errorUpdateCount,isFetching:Q,isRefetching:Q&&!R,isLoadingError:l&&!K,isPaused:y.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:l&&K,isStale:Se(t,s),refetch:this.refetch,promise:r(this,$),isEnabled:H(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const j=O.data!==void 0,et=O.status==="error"&&!j,zt=Wt=>{et?Wt.reject(O.error):j&&Wt.resolve(O.data)},we=()=>{const Wt=o(this,$,O.promise=re());zt(Wt)},Vt=r(this,$);switch(Vt.status){case"pending":t.queryHash===i.queryHash&&zt(Vt);break;case"fulfilled":(et||O.data!==Vt.value)&&we();break;case"rejected":(!et||O.error!==Vt.reason)&&we();break}}return O}updateResult(){const t=r(this,U),s=this.createResult(r(this,b),this.options);if(o(this,gt,r(this,b).state),o(this,Qt,this.options),r(this,gt).data!==void 0&&o(this,Tt,r(this,b)),Xt(s,t))return;o(this,U,s);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,a=typeof n=="function"?n():n;if(a==="all"||!a&&!r(this,Dt).size)return!0;const h=new Set(a??r(this,Dt));return this.options.throwOnError&&h.add("error"),Object.keys(r(this,U)).some(u=>{const p=u;return r(this,U)[p]!==t[p]&&h.has(p)})};f(this,C,Xe).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&f(this,C,he).call(this)}},_=new WeakMap,b=new WeakMap,Ht=new WeakMap,U=new WeakMap,gt=new WeakMap,Qt=new WeakMap,$=new WeakMap,at=new WeakMap,Nt=new WeakMap,It=new WeakMap,Tt=new WeakMap,St=new WeakMap,wt=new WeakMap,ot=new WeakMap,Dt=new WeakMap,C=new WeakSet,Kt=function(t){f(this,C,de).call(this);let s=r(this,b).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(q)),s},ae=function(){f(this,C,ce).call(this);const t=dt(this.options.staleTime,r(this,b));if(kt.isServer()||r(this,U).isStale||!ee(t))return;const i=Ge(r(this,U).dataUpdatedAt,t)+1;o(this,St,ft.setTimeout(()=>{r(this,U).isStale||this.updateResult()},i))},oe=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(r(this,b)):this.options.refetchInterval)??!1},ue=function(t){f(this,C,le).call(this),o(this,ot,t),!(kt.isServer()||H(this.options.enabled,r(this,b))===!1||!ee(r(this,ot))||r(this,ot)===0)&&o(this,wt,ft.setInterval(()=>{(this.options.refetchIntervalInBackground||me.isFocused())&&f(this,C,Kt).call(this)},r(this,ot)))},he=function(){f(this,C,ae).call(this),f(this,C,ue).call(this,f(this,C,oe).call(this))},ce=function(){r(this,St)!==void 0&&(ft.clearTimeout(r(this,St)),o(this,St,void 0))},le=function(){r(this,wt)!==void 0&&(ft.clearInterval(r(this,wt)),o(this,wt,void 0))},de=function(){const t=r(this,_).getQueryCache().build(r(this,_),this.options);if(t===r(this,b))return;const s=r(this,b);o(this,b,t),o(this,Ht,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},Xe=function(t){M.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(r(this,U))}),r(this,_).getQueryCache().notify({query:r(this,b),type:"observerResultsUpdated"})})},Ke);function Os(e,t){return H(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&H(t.retryOnMount,e)===!1)}function Ie(e,t){return Os(e,t)||e.state.data!==void 0&&fe(e,t,t.refetchOnMount)}function fe(e,t,s){if(H(t.enabled,e)!==!1&&dt(t.staleTime,e)!=="static"){const i=typeof s=="function"?s(e):s;return i==="always"||i!==!1&&Se(e,t)}return!1}function Te(e,t,s,i){return(e!==t||H(i.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Se(e,s)}function Se(e,t){return H(t.enabled,e)!==!1&&e.isStaleByTime(dt(t.staleTime,e))}function Ps(e,t){return!Xt(e.getCurrentResult(),t)}var Gt,B,A,Ct,z,st,_e,Rs=(_e=class extends $e{constructor(t){super();c(this,z);c(this,Gt);c(this,B);c(this,A);c(this,Ct);o(this,Gt,t.client),this.mutationId=t.mutationId,o(this,A,t.mutationCache),o(this,B,[]),this.state=t.state||Ye(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){r(this,B).includes(t)||(r(this,B).push(t),this.clearGcTimeout(),r(this,A).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){o(this,B,r(this,B).filter(s=>s!==t)),this.scheduleGc(),r(this,A).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){r(this,B).length||(this.state.status==="pending"?this.scheduleGc():r(this,A).remove(this))}continue(){var t;return((t=r(this,Ct))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var h,u,p,m,v,y,g,d,F,S,w,P,Q,R,l,I,K,tt;const s=()=>{f(this,z,st).call(this,{type:"continue"})},i={client:r(this,Gt),meta:this.options.meta,mutationKey:this.options.mutationKey};o(this,Ct,We({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(O,T)=>{f(this,z,st).call(this,{type:"failed",failureCount:O,error:T})},onPause:()=>{f(this,z,st).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>r(this,A).canRun(this)}));const n=this.state.status==="pending",a=!r(this,Ct).canStart();try{if(n)s();else{f(this,z,st).call(this,{type:"pending",variables:t,isPaused:a}),r(this,A).config.onMutate&&await r(this,A).config.onMutate(t,this,i);const T=await((u=(h=this.options).onMutate)==null?void 0:u.call(h,t,i));T!==this.state.context&&f(this,z,st).call(this,{type:"pending",context:T,variables:t,isPaused:a})}const O=await r(this,Ct).start();return await((m=(p=r(this,A).config).onSuccess)==null?void 0:m.call(p,O,t,this.state.context,this,i)),await((y=(v=this.options).onSuccess)==null?void 0:y.call(v,O,t,this.state.context,i)),await((d=(g=r(this,A).config).onSettled)==null?void 0:d.call(g,O,null,this.state.variables,this.state.context,this,i)),await((S=(F=this.options).onSettled)==null?void 0:S.call(F,O,null,t,this.state.context,i)),f(this,z,st).call(this,{type:"success",data:O}),O}catch(O){try{await((P=(w=r(this,A).config).onError)==null?void 0:P.call(w,O,t,this.state.context,this,i))}catch(T){Promise.reject(T)}try{await((R=(Q=this.options).onError)==null?void 0:R.call(Q,O,t,this.state.context,i))}catch(T){Promise.reject(T)}try{await((I=(l=r(this,A).config).onSettled)==null?void 0:I.call(l,void 0,O,this.state.variables,this.state.context,this,i))}catch(T){Promise.reject(T)}try{await((tt=(K=this.options).onSettled)==null?void 0:tt.call(K,void 0,O,t,this.state.context,i))}catch(T){Promise.reject(T)}throw f(this,z,st).call(this,{type:"error",error:O}),O}finally{r(this,A).runNext(this)}}},Gt=new WeakMap,B=new WeakMap,A=new WeakMap,Ct=new WeakMap,z=new WeakSet,st=function(t){const s=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),M.batch(()=>{r(this,B).forEach(i=>{i.onMutationUpdate(t)}),r(this,A).notify({mutation:this,type:"updated",action:t})})},_e);function Ye(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var J,G,Bt,ke,Fs=(ke=class extends qt{constructor(t={}){super();c(this,J);c(this,G);c(this,Bt);this.config=t,o(this,J,new Set),o(this,G,new Map),o(this,Bt,0)}build(t,s,i){const n=new Rs({client:t,mutationCache:this,mutationId:++$t(this,Bt)._,options:t.defaultMutationOptions(s),state:i});return this.add(n),n}add(t){r(this,J).add(t);const s=Jt(t);if(typeof s=="string"){const i=r(this,G).get(s);i?i.push(t):r(this,G).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(r(this,J).delete(t)){const s=Jt(t);if(typeof s=="string"){const i=r(this,G).get(s);if(i)if(i.length>1){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}else i[0]===t&&r(this,G).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=Jt(t);if(typeof s=="string"){const i=r(this,G).get(s),n=i==null?void 0:i.find(a=>a.state.status==="pending");return!n||n===t}else return!0}runNext(t){var i;const s=Jt(t);if(typeof s=="string"){const n=(i=r(this,G).get(s))==null?void 0:i.find(a=>a!==t&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){M.batch(()=>{r(this,J).forEach(t=>{this.notify({type:"removed",mutation:t})}),r(this,J).clear(),r(this,G).clear()})}getAll(){return Array.from(r(this,J))}find(t){const s={exact:!0,...t};return this.getAll().find(i=>Pe(s,i))}findAll(t={}){return this.getAll().filter(s=>Pe(t,s))}notify(t){M.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return M.batch(()=>Promise.all(t.map(s=>s.continue().catch(q))))}},J=new WeakMap,G=new WeakMap,Bt=new WeakMap,ke);function Jt(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Z,ut,k,X,Y,Zt,ye,Le,Es=(Le=class extends qt{constructor(t,s){super();c(this,Y);c(this,Z);c(this,ut);c(this,k);c(this,X);o(this,Z,t),this.setOptions(s),this.bindMethods(),f(this,Y,Zt).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var i;const s=this.options;this.options=r(this,Z).defaultMutationOptions(t),Xt(this.options,s)||r(this,Z).getMutationCache().notify({type:"observerOptionsUpdated",mutation:r(this,k),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Ot(s.mutationKey)!==Ot(this.options.mutationKey)?this.reset():((i=r(this,k))==null?void 0:i.state.status)==="pending"&&r(this,k).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=r(this,k))==null||t.removeObserver(this)}onMutationUpdate(t){f(this,Y,Zt).call(this),f(this,Y,ye).call(this,t)}getCurrentResult(){return r(this,ut)}reset(){var t;(t=r(this,k))==null||t.removeObserver(this),o(this,k,void 0),f(this,Y,Zt).call(this),f(this,Y,ye).call(this)}mutate(t,s){var i;return o(this,X,s),(i=r(this,k))==null||i.removeObserver(this),o(this,k,r(this,Z).getMutationCache().build(r(this,Z),this.options)),r(this,k).addObserver(this),r(this,k).execute(t)}},Z=new WeakMap,ut=new WeakMap,k=new WeakMap,X=new WeakMap,Y=new WeakSet,Zt=function(){var s;const t=((s=r(this,k))==null?void 0:s.state)??Ye();o(this,ut,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},ye=function(t){M.batch(()=>{var s,i,n,a,h,u,p,m;if(r(this,X)&&this.hasListeners()){const v=r(this,ut).variables,y=r(this,ut).context,g={client:r(this,Z),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(i=(s=r(this,X)).onSuccess)==null||i.call(s,t.data,v,y,g)}catch(d){Promise.reject(d)}try{(a=(n=r(this,X)).onSettled)==null||a.call(n,t.data,null,v,y,g)}catch(d){Promise.reject(d)}}else if((t==null?void 0:t.type)==="error"){try{(u=(h=r(this,X)).onError)==null||u.call(h,t.error,v,y,g)}catch(d){Promise.reject(d)}try{(m=(p=r(this,X)).onSettled)==null||m.call(p,void 0,t.error,v,y,g)}catch(d){Promise.reject(d)}}}this.listeners.forEach(v=>{v(r(this,ut))})})},Le),V,He,Ms=(He=class extends qt{constructor(t={}){super();c(this,V);this.config=t,o(this,V,new Map)}build(t,s,i){const n=s.queryKey,a=s.queryHash??ve(n,s);let h=this.get(a);return h||(h=new ws({client:t,queryKey:n,queryHash:a,options:t.defaultQueryOptions(s),state:i,defaultOptions:t.getQueryDefaults(n)}),this.add(h)),h}add(t){r(this,V).has(t.queryHash)||(r(this,V).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=r(this,V).get(t.queryHash);s&&(t.destroy(),s===t&&r(this,V).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){M.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return r(this,V).get(t)}getAll(){return[...r(this,V).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(i=>Oe(s,i))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(i=>Oe(t,i)):s}notify(t){M.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){M.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){M.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},V=new WeakMap,He),E,ht,ct,xt,At,lt,jt,Ut,Ne,Ns=(Ne=class{constructor(e={}){c(this,E);c(this,ht);c(this,ct);c(this,xt);c(this,At);c(this,lt);c(this,jt);c(this,Ut);o(this,E,e.queryCache||new Ms),o(this,ht,e.mutationCache||new Fs),o(this,ct,e.defaultOptions||{}),o(this,xt,new Map),o(this,At,new Map),o(this,lt,0)}mount(){$t(this,lt)._++,r(this,lt)===1&&(o(this,jt,me.subscribe(async e=>{e&&(await this.resumePausedMutations(),r(this,E).onFocus())})),o(this,Ut,Yt.subscribe(async e=>{e&&(await this.resumePausedMutations(),r(this,E).onOnline())})))}unmount(){var e,t;$t(this,lt)._--,r(this,lt)===0&&((e=r(this,jt))==null||e.call(this),o(this,jt,void 0),(t=r(this,Ut))==null||t.call(this),o(this,Ut,void 0))}isFetching(e){return r(this,E).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return r(this,ht).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=r(this,E).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=r(this,E).build(this,t),i=s.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(dt(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return r(this,E).findAll(e).map(({queryKey:t,state:s})=>{const i=s.data;return[t,i]})}setQueryData(e,t,s){const i=this.defaultQueryOptions({queryKey:e}),n=r(this,E).get(i.queryHash),a=n==null?void 0:n.state.data,h=hs(t,a);if(h!==void 0)return r(this,E).build(this,i).setData(h,{...s,manual:!0})}setQueriesData(e,t,s){return M.batch(()=>r(this,E).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=r(this,E).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=r(this,E);M.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=r(this,E);return M.batch(()=>(s.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},i=M.batch(()=>r(this,E).findAll(e).map(n=>n.cancel(s)));return Promise.all(i).then(q).catch(q)}invalidateQueries(e,t={}){return M.batch(()=>(r(this,E).findAll(e).forEach(s=>{s.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},i=M.batch(()=>r(this,E).findAll(e).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,s);return s.throwOnError||(a=a.catch(q)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(q)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=r(this,E).build(this,t);return s.isStaleByTime(dt(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(q).catch(q)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(q).catch(q)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Yt.isOnline()?r(this,ht).resumePausedMutations():Promise.resolve()}getQueryCache(){return r(this,E)}getMutationCache(){return r(this,ht)}getDefaultOptions(){return r(this,ct)}setDefaultOptions(e){o(this,ct,e)}setQueryDefaults(e,t){r(this,xt).set(Ot(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...r(this,xt).values()],s={};return t.forEach(i=>{_t(e,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(e,t){r(this,At).set(Ot(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...r(this,At).values()],s={};return t.forEach(i=>{_t(e,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...r(this,ct).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ve(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===be&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...r(this,ct).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){r(this,E).clear(),r(this,ht).clear()}},E=new WeakMap,ht=new WeakMap,ct=new WeakMap,xt=new WeakMap,At=new WeakMap,lt=new WeakMap,jt=new WeakMap,Ut=new WeakMap,Ne),ts=x.createContext(void 0),es=e=>{const t=x.useContext(ts);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Gs=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),is.jsx(ts.Provider,{value:e,children:t})),ss=x.createContext(!1),Qs=()=>x.useContext(ss);ss.Provider;function Is(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ts=x.createContext(Is()),Ds=()=>x.useContext(Ts),xs=(e,t,s)=>{const i=s!=null&&s.state.error&&typeof e.throwOnError=="function"?ge(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},As=e=>{x.useEffect(()=>{e.clearReset()},[e])},js=({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(n&&e.data===void 0||ge(s,[e.error,i])),Us=e=>{if(e.suspense){const s=n=>n==="static"?n:Math.max(n??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...n)=>s(i(...n)):s(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},qs=(e,t)=>e.isLoading&&e.isFetching&&!t,Ks=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,De=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function _s(e,t,s){var g,d,F,S;const i=Qs(),n=Ds(),a=es(),h=a.defaultQueryOptions(e);(d=(g=a.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||d.call(g,h);const u=a.getQueryCache().get(h.queryHash);h._optimisticResults=i?"isRestoring":"optimistic",Us(h),xs(h,n,u),As(n);const p=!a.getQueryCache().get(h.queryHash),[m]=x.useState(()=>new t(a,h)),v=m.getOptimisticResult(h),y=!i&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(w=>{const P=y?m.subscribe(M.batchCalls(w)):q;return m.updateResult(),P},[m,y]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),x.useEffect(()=>{m.setOptions(h)},[h,m]),Ks(h,v))throw De(h,m,n);if(js({result:v,errorResetBoundary:n,throwOnError:h.throwOnError,query:u,suspense:h.suspense}))throw v.error;if((S=(F=a.getDefaultOptions().queries)==null?void 0:F._experimental_afterQuery)==null||S.call(F,h,v),h.experimental_prefetchInRender&&!kt.isServer()&&qs(v,i)){const w=p?De(h,m,n):u==null?void 0:u.promise;w==null||w.catch(q).finally(()=>{m.updateResult()})}return h.notifyOnChangeProps?v:m.trackResult(v)}function Bs(e,t){return _s(e,Cs)}function zs(e,t){const s=es(),[i]=x.useState(()=>new Es(s,e));x.useEffect(()=>{i.setOptions(e)},[i,e]);const n=x.useSyncExternalStore(x.useCallback(h=>i.subscribe(M.batchCalls(h)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),a=x.useCallback((h,u)=>{i.mutate(h,u).catch(q)},[i]);if(n.error&&ge(i.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:a,mutateAsync:n.mutate}}export{Ns as Q,Gs as a,es as b,zs as c,Hs as k,Bs as u};
2
- //# sourceMappingURL=query-S6X1S7K9.js.map
1
+ var Ce=e=>{throw TypeError(e)};var te=(e,t,s)=>t.has(e)||Ce("Cannot "+s);var r=(e,t,s)=>(te(e,t,"read from private field"),s?s.call(e):t.get(e)),c=(e,t,s)=>t.has(e)?Ce("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),o=(e,t,s,i)=>(te(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),f=(e,t,s)=>(te(e,t,"access private method"),s);var $t=(e,t,s,i)=>({set _(n){o(e,t,n,s)},get _(){return r(e,t,i)}});import{r as x,j as is}from"./react-vendor-tkvCrao7.js";var qt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yt,it,Pt,xe,rs=(xe=class extends qt{constructor(){super();c(this,yt);c(this,it);c(this,Pt);o(this,Pt,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){r(this,it)||this.setEventListener(r(this,Pt))}onUnsubscribe(){var t;this.hasListeners()||((t=r(this,it))==null||t.call(this),o(this,it,void 0))}setEventListener(t){var s;o(this,Pt,t),(s=r(this,it))==null||s.call(this),o(this,it,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){r(this,yt)!==t&&(o(this,yt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof r(this,yt)=="boolean"?r(this,yt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},yt=new WeakMap,it=new WeakMap,Pt=new WeakMap,xe),me=new rs,ns={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},rt,pe,Ae,as=(Ae=class{constructor(){c(this,rt,ns);c(this,pe,!1)}setTimeoutProvider(e){o(this,rt,e)}setTimeout(e,t){return r(this,rt).setTimeout(e,t)}clearTimeout(e){r(this,rt).clearTimeout(e)}setInterval(e,t){return r(this,rt).setInterval(e,t)}clearInterval(e){r(this,rt).clearInterval(e)}},rt=new WeakMap,pe=new WeakMap,Ae),ft=new as;function os(e){setTimeout(e,0)}var us=typeof window>"u"||"Deno"in globalThis;function q(){}function hs(e,t){return typeof e=="function"?e(t):e}function ee(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ge(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dt(e,t){return typeof e=="function"?e(t):e}function H(e,t){return typeof e=="function"?e(t):e}function Oe(e,t){const{type:s="all",exact:i,fetchStatus:n,predicate:a,queryKey:h,stale:u}=e;if(h){if(i){if(t.queryHash!==ve(h,t.options))return!1}else if(!_t(t.queryKey,h))return!1}if(s!=="all"){const p=t.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||n&&n!==t.state.fetchStatus||a&&!a(t))}function Pe(e,t){const{exact:s,status:i,predicate:n,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(s){if(Ot(t.options.mutationKey)!==Ot(a))return!1}else if(!_t(t.options.mutationKey,a))return!1}return!(i&&t.state.status!==i||n&&!n(t))}function ve(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ot)(e)}function Ot(e){return JSON.stringify(e,(t,s)=>se(s)?Object.keys(s).sort().reduce((i,n)=>(i[n]=s[n],i),{}):s)}function _t(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>_t(e[s],t[s])):!1}var cs=Object.prototype.hasOwnProperty;function Be(e,t,s=0){if(e===t)return e;if(s>500)return t;const i=Re(e)&&Re(t);if(!i&&!(se(e)&&se(t)))return t;const a=(i?e:Object.keys(e)).length,h=i?t:Object.keys(t),u=h.length,p=i?new Array(u):{};let m=0;for(let v=0;v<u;v++){const y=i?v:h[v],g=e[y],d=t[y];if(g===d){p[y]=g,(i?v<a:cs.call(e,y))&&m++;continue}if(g===null||d===null||typeof g!="object"||typeof d!="object"){p[y]=d;continue}const F=Be(g,d,s+1);p[y]=F,F===g&&m++}return a===u&&m===a?e:p}function Xt(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Re(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function se(e){if(!Fe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Fe(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Fe(e){return Object.prototype.toString.call(e)==="[object Object]"}function ls(e){return new Promise(t=>{ft.setTimeout(t,e)})}function ie(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Be(e,t):t}function Hs(e){return e}function ds(e,t,s=0){const i=[...e,t];return s&&i.length>s?i.slice(1):i}function fs(e,t,s=0){const i=[t,...e];return s&&i.length>s?i.slice(0,-1):i}var be=Symbol();function ze(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===be?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ge(e,t){return typeof e=="function"?e(...t):!!e}function ys(e,t,s){let i=!1,n;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??(n=t()),i||(i=!0,n.aborted?s():n.addEventListener("abort",s,{once:!0})),n)}),e}var kt=(()=>{let e=()=>us;return{isServer(){return e()},setIsServer(t){e=t}}})();function re(){let e,t;const s=new Promise((n,a)=>{e=n,t=a});s.status="pending",s.catch(()=>{});function i(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{i({status:"fulfilled",value:n}),e(n)},s.reject=n=>{i({status:"rejected",reason:n}),t(n)},s}var ps=os;function ms(){let e=[],t=0,s=u=>{u()},i=u=>{u()},n=ps;const a=u=>{t?e.push(u):n(()=>{s(u)})},h=()=>{const u=e;e=[],u.length&&n(()=>{i(()=>{u.forEach(p=>{s(p)})})})};return{batch:u=>{let p;t++;try{p=u()}finally{t--,t||h()}return p},batchCalls:u=>(...p)=>{a(()=>{u(...p)})},schedule:a,setNotifyFunction:u=>{s=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{n=u}}}var M=ms(),Rt,nt,Ft,je,vs=(je=class extends qt{constructor(){super();c(this,Rt,!0);c(this,nt);c(this,Ft);o(this,Ft,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",i)}}})}onSubscribe(){r(this,nt)||this.setEventListener(r(this,Ft))}onUnsubscribe(){var t;this.hasListeners()||((t=r(this,nt))==null||t.call(this),o(this,nt,void 0))}setEventListener(t){var s;o(this,Ft,t),(s=r(this,nt))==null||s.call(this),o(this,nt,t(this.setOnline.bind(this)))}setOnline(t){r(this,Rt)!==t&&(o(this,Rt,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return r(this,Rt)}},Rt=new WeakMap,nt=new WeakMap,Ft=new WeakMap,je),Yt=new vs;function bs(e){return Math.min(1e3*2**e,3e4)}function Ve(e){return(e??"online")==="online"?Yt.isOnline():!0}var ne=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function We(e){let t=!1,s=0,i;const n=re(),a=()=>n.status!=="pending",h=S=>{var w;if(!a()){const P=new ne(S);g(P),(w=e.onCancel)==null||w.call(e,P)}},u=()=>{t=!0},p=()=>{t=!1},m=()=>me.isFocused()&&(e.networkMode==="always"||Yt.isOnline())&&e.canRun(),v=()=>Ve(e.networkMode)&&e.canRun(),y=S=>{a()||(i==null||i(),n.resolve(S))},g=S=>{a()||(i==null||i(),n.reject(S))},d=()=>new Promise(S=>{var w;i=P=>{(a()||m())&&S(P)},(w=e.onPause)==null||w.call(e)}).then(()=>{var S;i=void 0,a()||(S=e.onContinue)==null||S.call(e)}),F=()=>{if(a())return;let S;const w=s===0?e.initialPromise:void 0;try{S=w??e.fn()}catch(P){S=Promise.reject(P)}Promise.resolve(S).then(y).catch(P=>{var K;if(a())return;const Q=e.retry??(kt.isServer()?0:3),R=e.retryDelay??bs,l=typeof R=="function"?R(s,P):R,I=Q===!0||typeof Q=="number"&&s<Q||typeof Q=="function"&&Q(s,P);if(t||!I){g(P);return}s++,(K=e.onFail)==null||K.call(e,s,P),ls(l).then(()=>m()?void 0:d()).then(()=>{t?g(P):F()})})};return{promise:n,status:()=>n.status,cancel:h,continue:()=>(i==null||i(),n),cancelRetry:u,continueRetry:p,canStart:v,start:()=>(v()?F():d().then(F),n)}}var pt,Ue,$e=(Ue=class{constructor(){c(this,pt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ee(this.gcTime)&&o(this,pt,ft.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(kt.isServer()?1/0:5*60*1e3))}clearGcTimeout(){r(this,pt)!==void 0&&(ft.clearTimeout(r(this,pt)),o(this,pt,void 0))}},pt=new WeakMap,Ue);function gs(e){return{onFetch:(t,s)=>{var v,y,g,d,F;const i=t.options,n=(g=(y=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:y.fetchMore)==null?void 0:g.direction,a=((d=t.state.data)==null?void 0:d.pages)||[],h=((F=t.state.data)==null?void 0:F.pageParams)||[];let u={pages:[],pageParams:[]},p=0;const m=async()=>{let S=!1;const w=R=>{ys(R,()=>t.signal,()=>S=!0)},P=ze(t.options,t.fetchOptions),Q=async(R,l,I)=>{if(S)return Promise.reject(t.signal.reason);if(l==null&&R.pages.length)return Promise.resolve(R);const tt=(()=>{const et={client:t.client,queryKey:t.queryKey,pageParam:l,direction:I?"backward":"forward",meta:t.options.meta};return w(et),et})(),O=await P(tt),{maxPages:T}=t.options,j=I?fs:ds;return{pages:j(R.pages,O,T),pageParams:j(R.pageParams,l,T)}};if(n&&a.length){const R=n==="backward",l=R?Ss:Ee,I={pages:a,pageParams:h},K=l(i,I);u=await Q(I,K,R)}else{const R=e??a.length;do{const l=p===0?h[0]??i.initialPageParam:Ee(i,u);if(p>0&&l==null)break;u=await Q(u,l),p++}while(p<R)}return u};t.options.persister?t.fetchFn=()=>{var S,w;return(w=(S=t.options).persister)==null?void 0:w.call(S,m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=m}}}function Ee(e,{pages:t,pageParams:s}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,s[i],s):void 0}function Ss(e,{pages:t,pageParams:s}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,s[0],s):void 0}var Et,mt,Mt,N,vt,D,Lt,bt,L,Je,W,qe,ws=(qe=class extends $e{constructor(t){super();c(this,L);c(this,Et);c(this,mt);c(this,Mt);c(this,N);c(this,vt);c(this,D);c(this,Lt);c(this,bt);o(this,bt,!1),o(this,Lt,t.defaultOptions),this.setOptions(t.options),this.observers=[],o(this,vt,t.client),o(this,N,r(this,vt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,o(this,mt,Qe(this.options)),this.state=t.state??r(this,mt),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return r(this,Et)}get promise(){var t;return(t=r(this,D))==null?void 0:t.promise}setOptions(t){if(this.options={...r(this,Lt),...t},t!=null&&t._type&&o(this,Et,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Qe(this.options);s.data!==void 0&&(this.setState(Me(s.data,s.dataUpdatedAt)),o(this,mt,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&r(this,N).remove(this)}setData(t,s){const i=ie(this.state.data,t,this.options);return f(this,L,W).call(this,{data:i,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),i}setState(t){f(this,L,W).call(this,{type:"setState",state:t})}cancel(t){var i,n;const s=(i=r(this,D))==null?void 0:i.promise;return(n=r(this,D))==null||n.cancel(t),s?s.then(q).catch(q):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return r(this,mt)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>H(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===be||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>dt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ge(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=r(this,D))==null||s.continue()}onOnline(){var s;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=r(this,D))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),r(this,N).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(r(this,D)&&(r(this,bt)||f(this,L,Je).call(this)?r(this,D).cancel({revert:!0}):r(this,D).cancelRetry()),this.scheduleGc()),r(this,N).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||f(this,L,W).call(this,{type:"invalidate"})}async fetch(t,s){var m,v,y,g,d,F,S,w,P,Q,R;if(this.state.fetchStatus!=="idle"&&((m=r(this,D))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(r(this,D))return r(this,D).continueRetry(),r(this,D).promise}if(t&&this.setOptions(t),!this.options.queryFn){const l=this.observers.find(I=>I.options.queryFn);l&&this.setOptions(l.options)}const i=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(o(this,bt,!0),i.signal)})},a=()=>{const l=ze(this.options,s),K=(()=>{const tt={client:r(this,vt),queryKey:this.queryKey,meta:this.meta};return n(tt),tt})();return o(this,bt,!1),this.options.persister?this.options.persister(l,K,this):l(K)},u=(()=>{const l={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:r(this,vt),state:this.state,fetchFn:a};return n(l),l})(),p=r(this,Et)==="infinite"?gs(this.options.pages):this.options.behavior;p==null||p.onFetch(u,this),o(this,Mt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=u.fetchOptions)==null?void 0:v.meta))&&f(this,L,W).call(this,{type:"fetch",meta:(y=u.fetchOptions)==null?void 0:y.meta}),o(this,D,We({initialPromise:s==null?void 0:s.initialPromise,fn:u.fetchFn,onCancel:l=>{l instanceof ne&&l.revert&&this.setState({...r(this,Mt),fetchStatus:"idle"}),i.abort()},onFail:(l,I)=>{f(this,L,W).call(this,{type:"failed",failureCount:l,error:I})},onPause:()=>{f(this,L,W).call(this,{type:"pause"})},onContinue:()=>{f(this,L,W).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const l=await r(this,D).start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),(d=(g=r(this,N).config).onSuccess)==null||d.call(g,l,this),(S=(F=r(this,N).config).onSettled)==null||S.call(F,l,this.state.error,this),l}catch(l){if(l instanceof ne){if(l.silent)return r(this,D).promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw f(this,L,W).call(this,{type:"error",error:l}),(P=(w=r(this,N).config).onError)==null||P.call(w,l,this),(R=(Q=r(this,N).config).onSettled)==null||R.call(Q,this.state.data,l,this),l}finally{this.scheduleGc()}}},Et=new WeakMap,mt=new WeakMap,Mt=new WeakMap,N=new WeakMap,vt=new WeakMap,D=new WeakMap,Lt=new WeakMap,bt=new WeakMap,L=new WeakSet,Je=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},W=function(t){const s=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Ze(i.data,this.options),fetchMeta:t.meta??null};case"success":const n={...i,...Me(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return o(this,Mt,t.manual?n:void 0),n;case"error":const a=t.error;return{...i,error:a,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=s(this.state),M.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),r(this,N).notify({query:this,type:"updated",action:t})})},qe);function Ze(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ve(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Me(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Qe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,i=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var _,b,Ht,U,gt,Qt,$,at,Nt,It,Tt,St,wt,ot,Dt,C,Kt,ae,oe,ue,he,ce,le,de,Xe,Ke,Cs=(Ke=class extends qt{constructor(t,s){super();c(this,C);c(this,_);c(this,b);c(this,Ht);c(this,U);c(this,gt);c(this,Qt);c(this,$);c(this,at);c(this,Nt);c(this,It);c(this,Tt);c(this,St);c(this,wt);c(this,ot);c(this,Dt,new Set);this.options=s,o(this,_,t),o(this,at,null),o(this,$,re()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(r(this,b).addObserver(this),Ie(r(this,b),this.options)?f(this,C,Kt).call(this):this.updateResult(),f(this,C,he).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fe(r(this,b),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fe(r(this,b),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,f(this,C,ce).call(this),f(this,C,le).call(this),r(this,b).removeObserver(this)}setOptions(t){const s=this.options,i=r(this,b);if(this.options=r(this,_).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof H(this.options.enabled,r(this,b))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");f(this,C,de).call(this),r(this,b).setOptions(this.options),s._defaulted&&!Xt(this.options,s)&&r(this,_).getQueryCache().notify({type:"observerOptionsUpdated",query:r(this,b),observer:this});const n=this.hasListeners();n&&Te(r(this,b),i,this.options,s)&&f(this,C,Kt).call(this),this.updateResult(),n&&(r(this,b)!==i||H(this.options.enabled,r(this,b))!==H(s.enabled,r(this,b))||dt(this.options.staleTime,r(this,b))!==dt(s.staleTime,r(this,b)))&&f(this,C,ae).call(this);const a=f(this,C,oe).call(this);n&&(r(this,b)!==i||H(this.options.enabled,r(this,b))!==H(s.enabled,r(this,b))||a!==r(this,ot))&&f(this,C,ue).call(this,a)}getOptimisticResult(t){const s=r(this,_).getQueryCache().build(r(this,_),t),i=this.createResult(s,t);return Ps(this,i)&&(o(this,U,i),o(this,Qt,this.options),o(this,gt,r(this,b).state)),i}getCurrentResult(){return r(this,U)}trackResult(t,s){return new Proxy(t,{get:(i,n)=>(this.trackProp(n),s==null||s(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&r(this,$).status==="pending"&&r(this,$).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,n))})}trackProp(t){r(this,Dt).add(t)}getCurrentQuery(){return r(this,b)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=r(this,_).defaultQueryOptions(t),i=r(this,_).getQueryCache().build(r(this,_),s);return i.fetch().then(()=>this.createResult(i,s))}fetch(t){return f(this,C,Kt).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),r(this,U)))}createResult(t,s){var T;const i=r(this,b),n=this.options,a=r(this,U),h=r(this,gt),u=r(this,Qt),m=t!==i?t.state:r(this,Ht),{state:v}=t;let y={...v},g=!1,d;if(s._optimisticResults){const j=this.hasListeners(),et=!j&&Ie(t,s),zt=j&&Te(t,i,s,n);(et||zt)&&(y={...y,...Ze(v.data,t.options)}),s._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:F,errorUpdatedAt:S,status:w}=y;d=y.data;let P=!1;if(s.placeholderData!==void 0&&d===void 0&&w==="pending"){let j;a!=null&&a.isPlaceholderData&&s.placeholderData===(u==null?void 0:u.placeholderData)?(j=a.data,P=!0):j=typeof s.placeholderData=="function"?s.placeholderData((T=r(this,Tt))==null?void 0:T.state.data,r(this,Tt)):s.placeholderData,j!==void 0&&(w="success",d=ie(a==null?void 0:a.data,j,s),g=!0)}if(s.select&&d!==void 0&&!P)if(a&&d===(h==null?void 0:h.data)&&s.select===r(this,Nt))d=r(this,It);else try{o(this,Nt,s.select),d=s.select(d),d=ie(a==null?void 0:a.data,d,s),o(this,It,d),o(this,at,null)}catch(j){o(this,at,j)}r(this,at)&&(F=r(this,at),d=r(this,It),S=Date.now(),w="error");const Q=y.fetchStatus==="fetching",R=w==="pending",l=w==="error",I=R&&Q,K=d!==void 0,O={status:w,fetchStatus:y.fetchStatus,isPending:R,isSuccess:w==="success",isError:l,isInitialLoading:I,isLoading:I,data:d,dataUpdatedAt:y.dataUpdatedAt,error:F,errorUpdatedAt:S,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:y.dataUpdateCount>m.dataUpdateCount||y.errorUpdateCount>m.errorUpdateCount,isFetching:Q,isRefetching:Q&&!R,isLoadingError:l&&!K,isPaused:y.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:l&&K,isStale:Se(t,s),refetch:this.refetch,promise:r(this,$),isEnabled:H(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const j=O.data!==void 0,et=O.status==="error"&&!j,zt=Wt=>{et?Wt.reject(O.error):j&&Wt.resolve(O.data)},we=()=>{const Wt=o(this,$,O.promise=re());zt(Wt)},Vt=r(this,$);switch(Vt.status){case"pending":t.queryHash===i.queryHash&&zt(Vt);break;case"fulfilled":(et||O.data!==Vt.value)&&we();break;case"rejected":(!et||O.error!==Vt.reason)&&we();break}}return O}updateResult(){const t=r(this,U),s=this.createResult(r(this,b),this.options);if(o(this,gt,r(this,b).state),o(this,Qt,this.options),r(this,gt).data!==void 0&&o(this,Tt,r(this,b)),Xt(s,t))return;o(this,U,s);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,a=typeof n=="function"?n():n;if(a==="all"||!a&&!r(this,Dt).size)return!0;const h=new Set(a??r(this,Dt));return this.options.throwOnError&&h.add("error"),Object.keys(r(this,U)).some(u=>{const p=u;return r(this,U)[p]!==t[p]&&h.has(p)})};f(this,C,Xe).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&f(this,C,he).call(this)}},_=new WeakMap,b=new WeakMap,Ht=new WeakMap,U=new WeakMap,gt=new WeakMap,Qt=new WeakMap,$=new WeakMap,at=new WeakMap,Nt=new WeakMap,It=new WeakMap,Tt=new WeakMap,St=new WeakMap,wt=new WeakMap,ot=new WeakMap,Dt=new WeakMap,C=new WeakSet,Kt=function(t){f(this,C,de).call(this);let s=r(this,b).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(q)),s},ae=function(){f(this,C,ce).call(this);const t=dt(this.options.staleTime,r(this,b));if(kt.isServer()||r(this,U).isStale||!ee(t))return;const i=Ge(r(this,U).dataUpdatedAt,t)+1;o(this,St,ft.setTimeout(()=>{r(this,U).isStale||this.updateResult()},i))},oe=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(r(this,b)):this.options.refetchInterval)??!1},ue=function(t){f(this,C,le).call(this),o(this,ot,t),!(kt.isServer()||H(this.options.enabled,r(this,b))===!1||!ee(r(this,ot))||r(this,ot)===0)&&o(this,wt,ft.setInterval(()=>{(this.options.refetchIntervalInBackground||me.isFocused())&&f(this,C,Kt).call(this)},r(this,ot)))},he=function(){f(this,C,ae).call(this),f(this,C,ue).call(this,f(this,C,oe).call(this))},ce=function(){r(this,St)!==void 0&&(ft.clearTimeout(r(this,St)),o(this,St,void 0))},le=function(){r(this,wt)!==void 0&&(ft.clearInterval(r(this,wt)),o(this,wt,void 0))},de=function(){const t=r(this,_).getQueryCache().build(r(this,_),this.options);if(t===r(this,b))return;const s=r(this,b);o(this,b,t),o(this,Ht,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},Xe=function(t){M.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(r(this,U))}),r(this,_).getQueryCache().notify({query:r(this,b),type:"observerResultsUpdated"})})},Ke);function Os(e,t){return H(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&H(t.retryOnMount,e)===!1)}function Ie(e,t){return Os(e,t)||e.state.data!==void 0&&fe(e,t,t.refetchOnMount)}function fe(e,t,s){if(H(t.enabled,e)!==!1&&dt(t.staleTime,e)!=="static"){const i=typeof s=="function"?s(e):s;return i==="always"||i!==!1&&Se(e,t)}return!1}function Te(e,t,s,i){return(e!==t||H(i.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Se(e,s)}function Se(e,t){return H(t.enabled,e)!==!1&&e.isStaleByTime(dt(t.staleTime,e))}function Ps(e,t){return!Xt(e.getCurrentResult(),t)}var Gt,B,A,Ct,z,st,_e,Rs=(_e=class extends $e{constructor(t){super();c(this,z);c(this,Gt);c(this,B);c(this,A);c(this,Ct);o(this,Gt,t.client),this.mutationId=t.mutationId,o(this,A,t.mutationCache),o(this,B,[]),this.state=t.state||Ye(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){r(this,B).includes(t)||(r(this,B).push(t),this.clearGcTimeout(),r(this,A).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){o(this,B,r(this,B).filter(s=>s!==t)),this.scheduleGc(),r(this,A).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){r(this,B).length||(this.state.status==="pending"?this.scheduleGc():r(this,A).remove(this))}continue(){var t;return((t=r(this,Ct))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var h,u,p,m,v,y,g,d,F,S,w,P,Q,R,l,I,K,tt;const s=()=>{f(this,z,st).call(this,{type:"continue"})},i={client:r(this,Gt),meta:this.options.meta,mutationKey:this.options.mutationKey};o(this,Ct,We({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(O,T)=>{f(this,z,st).call(this,{type:"failed",failureCount:O,error:T})},onPause:()=>{f(this,z,st).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>r(this,A).canRun(this)}));const n=this.state.status==="pending",a=!r(this,Ct).canStart();try{if(n)s();else{f(this,z,st).call(this,{type:"pending",variables:t,isPaused:a}),r(this,A).config.onMutate&&await r(this,A).config.onMutate(t,this,i);const T=await((u=(h=this.options).onMutate)==null?void 0:u.call(h,t,i));T!==this.state.context&&f(this,z,st).call(this,{type:"pending",context:T,variables:t,isPaused:a})}const O=await r(this,Ct).start();return await((m=(p=r(this,A).config).onSuccess)==null?void 0:m.call(p,O,t,this.state.context,this,i)),await((y=(v=this.options).onSuccess)==null?void 0:y.call(v,O,t,this.state.context,i)),await((d=(g=r(this,A).config).onSettled)==null?void 0:d.call(g,O,null,this.state.variables,this.state.context,this,i)),await((S=(F=this.options).onSettled)==null?void 0:S.call(F,O,null,t,this.state.context,i)),f(this,z,st).call(this,{type:"success",data:O}),O}catch(O){try{await((P=(w=r(this,A).config).onError)==null?void 0:P.call(w,O,t,this.state.context,this,i))}catch(T){Promise.reject(T)}try{await((R=(Q=this.options).onError)==null?void 0:R.call(Q,O,t,this.state.context,i))}catch(T){Promise.reject(T)}try{await((I=(l=r(this,A).config).onSettled)==null?void 0:I.call(l,void 0,O,this.state.variables,this.state.context,this,i))}catch(T){Promise.reject(T)}try{await((tt=(K=this.options).onSettled)==null?void 0:tt.call(K,void 0,O,t,this.state.context,i))}catch(T){Promise.reject(T)}throw f(this,z,st).call(this,{type:"error",error:O}),O}finally{r(this,A).runNext(this)}}},Gt=new WeakMap,B=new WeakMap,A=new WeakMap,Ct=new WeakMap,z=new WeakSet,st=function(t){const s=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),M.batch(()=>{r(this,B).forEach(i=>{i.onMutationUpdate(t)}),r(this,A).notify({mutation:this,type:"updated",action:t})})},_e);function Ye(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var J,G,Bt,ke,Fs=(ke=class extends qt{constructor(t={}){super();c(this,J);c(this,G);c(this,Bt);this.config=t,o(this,J,new Set),o(this,G,new Map),o(this,Bt,0)}build(t,s,i){const n=new Rs({client:t,mutationCache:this,mutationId:++$t(this,Bt)._,options:t.defaultMutationOptions(s),state:i});return this.add(n),n}add(t){r(this,J).add(t);const s=Jt(t);if(typeof s=="string"){const i=r(this,G).get(s);i?i.push(t):r(this,G).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(r(this,J).delete(t)){const s=Jt(t);if(typeof s=="string"){const i=r(this,G).get(s);if(i)if(i.length>1){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}else i[0]===t&&r(this,G).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=Jt(t);if(typeof s=="string"){const i=r(this,G).get(s),n=i==null?void 0:i.find(a=>a.state.status==="pending");return!n||n===t}else return!0}runNext(t){var i;const s=Jt(t);if(typeof s=="string"){const n=(i=r(this,G).get(s))==null?void 0:i.find(a=>a!==t&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){M.batch(()=>{r(this,J).forEach(t=>{this.notify({type:"removed",mutation:t})}),r(this,J).clear(),r(this,G).clear()})}getAll(){return Array.from(r(this,J))}find(t){const s={exact:!0,...t};return this.getAll().find(i=>Pe(s,i))}findAll(t={}){return this.getAll().filter(s=>Pe(t,s))}notify(t){M.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return M.batch(()=>Promise.all(t.map(s=>s.continue().catch(q))))}},J=new WeakMap,G=new WeakMap,Bt=new WeakMap,ke);function Jt(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Z,ut,k,X,Y,Zt,ye,Le,Es=(Le=class extends qt{constructor(t,s){super();c(this,Y);c(this,Z);c(this,ut);c(this,k);c(this,X);o(this,Z,t),this.setOptions(s),this.bindMethods(),f(this,Y,Zt).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var i;const s=this.options;this.options=r(this,Z).defaultMutationOptions(t),Xt(this.options,s)||r(this,Z).getMutationCache().notify({type:"observerOptionsUpdated",mutation:r(this,k),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Ot(s.mutationKey)!==Ot(this.options.mutationKey)?this.reset():((i=r(this,k))==null?void 0:i.state.status)==="pending"&&r(this,k).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=r(this,k))==null||t.removeObserver(this)}onMutationUpdate(t){f(this,Y,Zt).call(this),f(this,Y,ye).call(this,t)}getCurrentResult(){return r(this,ut)}reset(){var t;(t=r(this,k))==null||t.removeObserver(this),o(this,k,void 0),f(this,Y,Zt).call(this),f(this,Y,ye).call(this)}mutate(t,s){var i;return o(this,X,s),(i=r(this,k))==null||i.removeObserver(this),o(this,k,r(this,Z).getMutationCache().build(r(this,Z),this.options)),r(this,k).addObserver(this),r(this,k).execute(t)}},Z=new WeakMap,ut=new WeakMap,k=new WeakMap,X=new WeakMap,Y=new WeakSet,Zt=function(){var s;const t=((s=r(this,k))==null?void 0:s.state)??Ye();o(this,ut,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},ye=function(t){M.batch(()=>{var s,i,n,a,h,u,p,m;if(r(this,X)&&this.hasListeners()){const v=r(this,ut).variables,y=r(this,ut).context,g={client:r(this,Z),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(i=(s=r(this,X)).onSuccess)==null||i.call(s,t.data,v,y,g)}catch(d){Promise.reject(d)}try{(a=(n=r(this,X)).onSettled)==null||a.call(n,t.data,null,v,y,g)}catch(d){Promise.reject(d)}}else if((t==null?void 0:t.type)==="error"){try{(u=(h=r(this,X)).onError)==null||u.call(h,t.error,v,y,g)}catch(d){Promise.reject(d)}try{(m=(p=r(this,X)).onSettled)==null||m.call(p,void 0,t.error,v,y,g)}catch(d){Promise.reject(d)}}}this.listeners.forEach(v=>{v(r(this,ut))})})},Le),V,He,Ms=(He=class extends qt{constructor(t={}){super();c(this,V);this.config=t,o(this,V,new Map)}build(t,s,i){const n=s.queryKey,a=s.queryHash??ve(n,s);let h=this.get(a);return h||(h=new ws({client:t,queryKey:n,queryHash:a,options:t.defaultQueryOptions(s),state:i,defaultOptions:t.getQueryDefaults(n)}),this.add(h)),h}add(t){r(this,V).has(t.queryHash)||(r(this,V).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=r(this,V).get(t.queryHash);s&&(t.destroy(),s===t&&r(this,V).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){M.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return r(this,V).get(t)}getAll(){return[...r(this,V).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(i=>Oe(s,i))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(i=>Oe(t,i)):s}notify(t){M.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){M.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){M.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},V=new WeakMap,He),E,ht,ct,xt,At,lt,jt,Ut,Ne,Ns=(Ne=class{constructor(e={}){c(this,E);c(this,ht);c(this,ct);c(this,xt);c(this,At);c(this,lt);c(this,jt);c(this,Ut);o(this,E,e.queryCache||new Ms),o(this,ht,e.mutationCache||new Fs),o(this,ct,e.defaultOptions||{}),o(this,xt,new Map),o(this,At,new Map),o(this,lt,0)}mount(){$t(this,lt)._++,r(this,lt)===1&&(o(this,jt,me.subscribe(async e=>{e&&(await this.resumePausedMutations(),r(this,E).onFocus())})),o(this,Ut,Yt.subscribe(async e=>{e&&(await this.resumePausedMutations(),r(this,E).onOnline())})))}unmount(){var e,t;$t(this,lt)._--,r(this,lt)===0&&((e=r(this,jt))==null||e.call(this),o(this,jt,void 0),(t=r(this,Ut))==null||t.call(this),o(this,Ut,void 0))}isFetching(e){return r(this,E).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return r(this,ht).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=r(this,E).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=r(this,E).build(this,t),i=s.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(dt(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return r(this,E).findAll(e).map(({queryKey:t,state:s})=>{const i=s.data;return[t,i]})}setQueryData(e,t,s){const i=this.defaultQueryOptions({queryKey:e}),n=r(this,E).get(i.queryHash),a=n==null?void 0:n.state.data,h=hs(t,a);if(h!==void 0)return r(this,E).build(this,i).setData(h,{...s,manual:!0})}setQueriesData(e,t,s){return M.batch(()=>r(this,E).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=r(this,E).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=r(this,E);M.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=r(this,E);return M.batch(()=>(s.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},i=M.batch(()=>r(this,E).findAll(e).map(n=>n.cancel(s)));return Promise.all(i).then(q).catch(q)}invalidateQueries(e,t={}){return M.batch(()=>(r(this,E).findAll(e).forEach(s=>{s.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},i=M.batch(()=>r(this,E).findAll(e).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,s);return s.throwOnError||(a=a.catch(q)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(q)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=r(this,E).build(this,t);return s.isStaleByTime(dt(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(q).catch(q)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(q).catch(q)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Yt.isOnline()?r(this,ht).resumePausedMutations():Promise.resolve()}getQueryCache(){return r(this,E)}getMutationCache(){return r(this,ht)}getDefaultOptions(){return r(this,ct)}setDefaultOptions(e){o(this,ct,e)}setQueryDefaults(e,t){r(this,xt).set(Ot(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...r(this,xt).values()],s={};return t.forEach(i=>{_t(e,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(e,t){r(this,At).set(Ot(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...r(this,At).values()],s={};return t.forEach(i=>{_t(e,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...r(this,ct).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ve(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===be&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...r(this,ct).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){r(this,E).clear(),r(this,ht).clear()}},E=new WeakMap,ht=new WeakMap,ct=new WeakMap,xt=new WeakMap,At=new WeakMap,lt=new WeakMap,jt=new WeakMap,Ut=new WeakMap,Ne),ts=x.createContext(void 0),es=e=>{const t=x.useContext(ts);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Gs=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),is.jsx(ts.Provider,{value:e,children:t})),ss=x.createContext(!1),Qs=()=>x.useContext(ss);ss.Provider;function Is(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ts=x.createContext(Is()),Ds=()=>x.useContext(Ts),xs=(e,t,s)=>{const i=s!=null&&s.state.error&&typeof e.throwOnError=="function"?ge(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},As=e=>{x.useEffect(()=>{e.clearReset()},[e])},js=({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(n&&e.data===void 0||ge(s,[e.error,i])),Us=e=>{if(e.suspense){const s=n=>n==="static"?n:Math.max(n??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...n)=>s(i(...n)):s(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},qs=(e,t)=>e.isLoading&&e.isFetching&&!t,Ks=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,De=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function _s(e,t,s){var g,d,F,S;const i=Qs(),n=Ds(),a=es(),h=a.defaultQueryOptions(e);(d=(g=a.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||d.call(g,h);const u=a.getQueryCache().get(h.queryHash);h._optimisticResults=i?"isRestoring":"optimistic",Us(h),xs(h,n,u),As(n);const p=!a.getQueryCache().get(h.queryHash),[m]=x.useState(()=>new t(a,h)),v=m.getOptimisticResult(h),y=!i&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(w=>{const P=y?m.subscribe(M.batchCalls(w)):q;return m.updateResult(),P},[m,y]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),x.useEffect(()=>{m.setOptions(h)},[h,m]),Ks(h,v))throw De(h,m,n);if(js({result:v,errorResetBoundary:n,throwOnError:h.throwOnError,query:u,suspense:h.suspense}))throw v.error;if((S=(F=a.getDefaultOptions().queries)==null?void 0:F._experimental_afterQuery)==null||S.call(F,h,v),h.experimental_prefetchInRender&&!kt.isServer()&&qs(v,i)){const w=p?De(h,m,n):u==null?void 0:u.promise;w==null||w.catch(q).finally(()=>{m.updateResult()})}return h.notifyOnChangeProps?v:m.trackResult(v)}function Bs(e,t){return _s(e,Cs)}function zs(e,t){const s=es(),[i]=x.useState(()=>new Es(s,e));x.useEffect(()=>{i.setOptions(e)},[i,e]);const n=x.useSyncExternalStore(x.useCallback(h=>i.subscribe(M.batchCalls(h)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),a=x.useCallback((h,u)=>{i.mutate(h,u).catch(q)},[i]);if(n.error&&ge(i.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:a,mutateAsync:n.mutate}}export{Ns as Q,es as a,Gs as b,zs as c,Hs as k,Bs as u};
2
+ //# sourceMappingURL=query-CgCOpYWf.js.map