limn-review 0.1.123

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 (474) hide show
  1. package/LICENSE +110 -0
  2. package/README.md +133 -0
  3. package/dist/ai/runtime.js +535 -0
  4. package/dist/api/plugins/auth.js +169 -0
  5. package/dist/api/plugins/error-handler.js +114 -0
  6. package/dist/api/plugins/rate-limit.js +855 -0
  7. package/dist/api/plugins/security.js +321 -0
  8. package/dist/api/routes/activity.js +103 -0
  9. package/dist/api/routes/ai-runtime.js +67 -0
  10. package/dist/api/routes/auth.js +194 -0
  11. package/dist/api/routes/billing.js +209 -0
  12. package/dist/api/routes/bot-triage.js +1289 -0
  13. package/dist/api/routes/conflicts.js +730 -0
  14. package/dist/api/routes/contact.js +318 -0
  15. package/dist/api/routes/daily-brief.js +58 -0
  16. package/dist/api/routes/flow.js +71 -0
  17. package/dist/api/routes/health.js +7 -0
  18. package/dist/api/routes/insights.js +200 -0
  19. package/dist/api/routes/me.js +458 -0
  20. package/dist/api/routes/mentions.js +22 -0
  21. package/dist/api/routes/mergers.js +8 -0
  22. package/dist/api/routes/ml-labels.js +109 -0
  23. package/dist/api/routes/open-prs.js +35 -0
  24. package/dist/api/routes/prs.js +1633 -0
  25. package/dist/api/routes/reactions.js +217 -0
  26. package/dist/api/routes/repos.js +563 -0
  27. package/dist/api/routes/search.js +41 -0
  28. package/dist/api/routes/threads.js +118 -0
  29. package/dist/api/routes/timeline.js +150 -0
  30. package/dist/api/routes/users.js +67 -0
  31. package/dist/api/routes/webhooks.js +181 -0
  32. package/dist/api/routes/workspaces.js +322 -0
  33. package/dist/app.js +274 -0
  34. package/dist/ascii.js +19 -0
  35. package/dist/auth/account.js +482 -0
  36. package/dist/auth/crypto.js +46 -0
  37. package/dist/bot-triage/resolve.js +59 -0
  38. package/dist/cli.js +388 -0
  39. package/dist/coding/activity.js +80 -0
  40. package/dist/coding/agent.js +288 -0
  41. package/dist/coding/ai-fix/auto-fix.js +212 -0
  42. package/dist/coding/ai-fix/manager.js +370 -0
  43. package/dist/coding/ai-fix/persist.js +213 -0
  44. package/dist/coding/ai-fix/pr-context.js +58 -0
  45. package/dist/coding/ai-fix/prompts.js +138 -0
  46. package/dist/coding/ai-fix/review-seed.js +357 -0
  47. package/dist/coding/ai-fix/routes.js +425 -0
  48. package/dist/coding/git-ops.js +321 -0
  49. package/dist/coding/git.js +184 -0
  50. package/dist/coding/merge.js +262 -0
  51. package/dist/coding/safe-path.js +75 -0
  52. package/dist/coding/schema.js +43 -0
  53. package/dist/config.js +648 -0
  54. package/dist/conflict/diff.js +304 -0
  55. package/dist/conflict/git.js +118 -0
  56. package/dist/conflict/hash.js +73 -0
  57. package/dist/conflict/janitor.js +218 -0
  58. package/dist/conflict/land.js +675 -0
  59. package/dist/conflict/model-types.js +2 -0
  60. package/dist/conflict/model.js +1081 -0
  61. package/dist/conflict/parse.js +142 -0
  62. package/dist/conflict/seam.js +136 -0
  63. package/dist/conflict/session.js +532 -0
  64. package/dist/conflict/suggestion.js +398 -0
  65. package/dist/conflict/tokens.js +72 -0
  66. package/dist/data-dir.js +112 -0
  67. package/dist/db/actor-lanes.js +213 -0
  68. package/dist/db/automation-ids.js +97 -0
  69. package/dist/db/automation-output.js +349 -0
  70. package/dist/db/blast-radius-query.js +36 -0
  71. package/dist/db/blast-radius.js +226 -0
  72. package/dist/db/bot-dormancy.js +115 -0
  73. package/dist/db/bot-overlap.js +579 -0
  74. package/dist/db/bot-volume.js +722 -0
  75. package/dist/db/bot-window.js +35 -0
  76. package/dist/db/branch-queries.js +310 -0
  77. package/dist/db/change-shape.js +243 -0
  78. package/dist/db/changepoint.js +75 -0
  79. package/dist/db/cleanup.js +36 -0
  80. package/dist/db/client.js +102 -0
  81. package/dist/db/code-loc.js +388 -0
  82. package/dist/db/credits.js +79 -0
  83. package/dist/db/daily-brief.js +406 -0
  84. package/dist/db/dependency-cards.js +145 -0
  85. package/dist/db/erase-account.js +255 -0
  86. package/dist/db/export-account.js +189 -0
  87. package/dist/db/failing-checks.js +124 -0
  88. package/dist/db/file-coupling.js +197 -0
  89. package/dist/db/flow-detail.js +661 -0
  90. package/dist/db/flow-pointers.js +197 -0
  91. package/dist/db/flow-settings.js +67 -0
  92. package/dist/db/forecast.js +114 -0
  93. package/dist/db/line-overlap.js +81 -0
  94. package/dist/db/merge-queue.js +189 -0
  95. package/dist/db/migrate.js +17 -0
  96. package/dist/db/migrations/0000_purple_ben_grimm.sql +155 -0
  97. package/dist/db/migrations/0001_colorful_ozymandias.sql +31 -0
  98. package/dist/db/migrations/0002_famous_sersi.sql +9 -0
  99. package/dist/db/migrations/0003_clever_shinobi_shaw.sql +3 -0
  100. package/dist/db/migrations/0004_pale_scalphunter.sql +1 -0
  101. package/dist/db/migrations/0005_daffy_guardian.sql +2 -0
  102. package/dist/db/migrations/0006_cute_violations.sql +45 -0
  103. package/dist/db/migrations/0007_dark_anthem.sql +2 -0
  104. package/dist/db/migrations/0008_multitenant_accounts.sql +44 -0
  105. package/dist/db/migrations/0009_lean_bodies.sql +13 -0
  106. package/dist/db/migrations/0010_lean_bodies_nullable.sql +56 -0
  107. package/dist/db/migrations/0011_pr_diff_size.sql +10 -0
  108. package/dist/db/migrations/0012_findings_included_default.sql +7 -0
  109. package/dist/db/migrations/0013_review_routing.sql +9 -0
  110. package/dist/db/migrations/0014_account_last_active.sql +6 -0
  111. package/dist/db/migrations/0015_repos_inbox_watch.sql +9 -0
  112. package/dist/db/migrations/0016_repo_viewer_permission.sql +7 -0
  113. package/dist/db/migrations/0017_account_display_name.sql +7 -0
  114. package/dist/db/migrations/0018_finding_comment_kind.sql +7 -0
  115. package/dist/db/migrations/0019_finding_file_in_diff.sql +7 -0
  116. package/dist/db/migrations/0020_claude_review_cost_telemetry.sql +11 -0
  117. package/dist/db/migrations/0021_account_feed_last_seen.sql +7 -0
  118. package/dist/db/migrations/0022_ci_status_events.sql +21 -0
  119. package/dist/db/migrations/0023_ai_usage.sql +21 -0
  120. package/dist/db/migrations/0024_pr_head_ref_name.sql +6 -0
  121. package/dist/db/migrations/0025_account_billing.sql +7 -0
  122. package/dist/db/migrations/0026_ai_credit_allowance.sql +5 -0
  123. package/dist/db/migrations/0027_user_github_type.sql +6 -0
  124. package/dist/db/migrations/0028_bot_review_classification.sql +21 -0
  125. package/dist/db/migrations/0029_bot_mute_rules.sql +19 -0
  126. package/dist/db/migrations/0030_teams.sql +32 -0
  127. package/dist/db/migrations/0031_events_pr_idx.sql +7 -0
  128. package/dist/db/migrations/0032_benchmark_contributions.sql +29 -0
  129. package/dist/db/migrations/0033_thread_addressed_confidence.sql +9 -0
  130. package/dist/db/migrations/0034_thread_resolved_at.sql +6 -0
  131. package/dist/db/migrations/0035_pr_first_review_requested_at.sql +5 -0
  132. package/dist/db/migrations/0036_search_index.sql +25 -0
  133. package/dist/db/migrations/0037_author_indexes.sql +15 -0
  134. package/dist/db/migrations/0038_auto_merge_requests.sql +37 -0
  135. package/dist/db/migrations/0039_branch_status.sql +44 -0
  136. package/dist/db/migrations/0040_pr_review_decision.sql +10 -0
  137. package/dist/db/migrations/0041_branch_commit_detail.sql +38 -0
  138. package/dist/db/migrations/0042_repo_reviewers.sql +176 -0
  139. package/dist/db/migrations/0043_account_reviewers.sql +131 -0
  140. package/dist/db/migrations/0044_workspaces.sql +138 -0
  141. package/dist/db/migrations/0045_workspace_reviewers.sql +180 -0
  142. package/dist/db/migrations/0046_drop_inbox_watch.sql +25 -0
  143. package/dist/db/migrations/0047_ml_comment_labels.sql +40 -0
  144. package/dist/db/migrations/0048_ml_vendor_severity.sql +31 -0
  145. package/dist/db/migrations/0049_seat_pricing_repo_description.sql +21 -0
  146. package/dist/db/migrations/0050_users_app_slug.sql +12 -0
  147. package/dist/db/migrations/0051_auto_merge_queue.sql +17 -0
  148. package/dist/db/migrations/0052_trunk_ci_status_events.sql +43 -0
  149. package/dist/db/migrations/0053_automation_roles.sql +79 -0
  150. package/dist/db/migrations/0054_automation_vendor_kinds.sql +514 -0
  151. package/dist/db/migrations/0055_auto_merge_phase.sql +12 -0
  152. package/dist/db/migrations/0056_pr_mentions.sql +22 -0
  153. package/dist/db/migrations/0057_large_pr_threshold.sql +14 -0
  154. package/dist/db/migrations/0058_pending_mute.sql +53 -0
  155. package/dist/db/migrations/0059_merge_queue_state.sql +33 -0
  156. package/dist/db/migrations/0060_drop_my_turn_dismissals.sql +33 -0
  157. package/dist/db/migrations/0061_auto_merge_durable_anchors.sql +27 -0
  158. package/dist/db/migrations/0062_blast_radius_config.sql +21 -0
  159. package/dist/db/migrations/0063_repo_file_coupling.sql +33 -0
  160. package/dist/db/migrations/0064_pr_content_kind.sql +21 -0
  161. package/dist/db/migrations/0065_workspace_flow_settings.sql +13 -0
  162. package/dist/db/migrations/0066_review_request_events.sql +31 -0
  163. package/dist/db/migrations/0067_pr_security_signals.sql +86 -0
  164. package/dist/db/migrations/0068_my_turn_settings.sql +18 -0
  165. package/dist/db/migrations/0069_my_turn_dismissals.sql +41 -0
  166. package/dist/db/migrations/0070_claude_review_follow_up_ticket.sql +22 -0
  167. package/dist/db/migrations/0071_claude_review_trigger.sql +11 -0
  168. package/dist/db/migrations/0072_commit_message_headline.sql +13 -0
  169. package/dist/db/migrations/0073_claude_review_chat.sql +31 -0
  170. package/dist/db/migrations/0074_adopt_agentic_tables.sql +98 -0
  171. package/dist/db/migrations/0075_review_lens_drop_learnings.sql +15 -0
  172. package/dist/db/migrations/0076_claude_review_threads.sql +17 -0
  173. package/dist/db/migrations/0077_claude_review_ci_failures.sql +10 -0
  174. package/dist/db/migrations/0078_ai_fix_change_report.sql +17 -0
  175. package/dist/db/migrations/0079_claude_finding_story.sql +16 -0
  176. package/dist/db/migrations/meta/0000_snapshot.json +1116 -0
  177. package/dist/db/migrations/meta/0001_snapshot.json +1321 -0
  178. package/dist/db/migrations/meta/0002_snapshot.json +1375 -0
  179. package/dist/db/migrations/meta/0003_snapshot.json +1396 -0
  180. package/dist/db/migrations/meta/0004_snapshot.json +1416 -0
  181. package/dist/db/migrations/meta/0005_snapshot.json +1430 -0
  182. package/dist/db/migrations/meta/0006_snapshot.json +1745 -0
  183. package/dist/db/migrations/meta/0007_snapshot.json +1759 -0
  184. package/dist/db/migrations/meta/_journal.json +566 -0
  185. package/dist/db/migrations-pg/0000_tired_alex_power.sql +268 -0
  186. package/dist/db/migrations-pg/0001_dizzy_mockingbird.sql +3 -0
  187. package/dist/db/migrations-pg/0002_glorious_ikaris.sql +4 -0
  188. package/dist/db/migrations-pg/0003_melted_secret_warriors.sql +2 -0
  189. package/dist/db/migrations-pg/0004_numerous_triton.sql +1 -0
  190. package/dist/db/migrations-pg/0005_thick_blockbuster.sql +2 -0
  191. package/dist/db/migrations-pg/0006_majestic_dracula.sql +1 -0
  192. package/dist/db/migrations-pg/0007_same_human_torch.sql +2 -0
  193. package/dist/db/migrations-pg/0008_slimy_toxin.sql +1 -0
  194. package/dist/db/migrations-pg/0009_fuzzy_jubilee.sql +4 -0
  195. package/dist/db/migrations-pg/0010_late_hammerhead.sql +1 -0
  196. package/dist/db/migrations-pg/0011_happy_leech.sql +16 -0
  197. package/dist/db/migrations-pg/0012_woozy_captain_midlands.sql +16 -0
  198. package/dist/db/migrations-pg/0013_yielding_nicolaos.sql +1 -0
  199. package/dist/db/migrations-pg/0014_wakeful_bill_hollister.sql +2 -0
  200. package/dist/db/migrations-pg/0015_aspiring_black_tom.sql +1 -0
  201. package/dist/db/migrations-pg/0016_cute_ghost_rider.sql +30 -0
  202. package/dist/db/migrations-pg/0017_far_changeling.sql +24 -0
  203. package/dist/db/migrations-pg/0018_fancy_miss_america.sql +1 -0
  204. package/dist/db/migrations-pg/0019_benchmark_contributions.sql +22 -0
  205. package/dist/db/migrations-pg/0020_majestic_edwin_jarvis.sql +3 -0
  206. package/dist/db/migrations-pg/0021_green_salo.sql +1 -0
  207. package/dist/db/migrations-pg/0022_wise_baron_strucker.sql +1 -0
  208. package/dist/db/migrations-pg/0023_search_index.sql +19 -0
  209. package/dist/db/migrations-pg/0024_author_indexes.sql +9 -0
  210. package/dist/db/migrations-pg/0025_auto_merge_requests.sql +26 -0
  211. package/dist/db/migrations-pg/0026_branch_status.sql +32 -0
  212. package/dist/db/migrations-pg/0027_pr_review_decision.sql +5 -0
  213. package/dist/db/migrations-pg/0028_branch_commit_detail.sql +9 -0
  214. package/dist/db/migrations-pg/0029_repo_reviewers.sql +127 -0
  215. package/dist/db/migrations-pg/0030_account_reviewers.sql +77 -0
  216. package/dist/db/migrations-pg/0031_workspaces.sql +131 -0
  217. package/dist/db/migrations-pg/0032_workspace_reviewers.sql +165 -0
  218. package/dist/db/migrations-pg/0033_drop_inbox_watch.sql +14 -0
  219. package/dist/db/migrations-pg/0034_ml_comment_labels.sql +33 -0
  220. package/dist/db/migrations-pg/0035_ml_vendor_severity.sql +16 -0
  221. package/dist/db/migrations-pg/0036_seat_pricing_repo_description.sql +12 -0
  222. package/dist/db/migrations-pg/0037_users_app_slug.sql +9 -0
  223. package/dist/db/migrations-pg/0038_auto_merge_queue.sql +10 -0
  224. package/dist/db/migrations-pg/0039_trunk_ci_status_events.sql +27 -0
  225. package/dist/db/migrations-pg/0040_automation_roles.sql +63 -0
  226. package/dist/db/migrations-pg/0041_automation_vendor_kinds.sql +488 -0
  227. package/dist/db/migrations-pg/0042_auto_merge_phase.sql +8 -0
  228. package/dist/db/migrations-pg/0043_pr_mentions.sql +19 -0
  229. package/dist/db/migrations-pg/0044_large_pr_threshold.sql +6 -0
  230. package/dist/db/migrations-pg/0045_pending_mute.sql +26 -0
  231. package/dist/db/migrations-pg/0046_merge_queue_state.sql +18 -0
  232. package/dist/db/migrations-pg/0047_drop_my_turn_dismissals.sql +21 -0
  233. package/dist/db/migrations-pg/0048_auto_merge_durable_anchors.sql +27 -0
  234. package/dist/db/migrations-pg/0049_blast_radius_config.sql +8 -0
  235. package/dist/db/migrations-pg/0050_repo_file_coupling.sql +13 -0
  236. package/dist/db/migrations-pg/0051_pr_content_kind.sql +6 -0
  237. package/dist/db/migrations-pg/0052_workspace_flow_settings.sql +4 -0
  238. package/dist/db/migrations-pg/0053_review_request_events.sql +18 -0
  239. package/dist/db/migrations-pg/0054_pr_security_signals.sql +59 -0
  240. package/dist/db/migrations-pg/0055_my_turn_settings.sql +6 -0
  241. package/dist/db/migrations-pg/0056_my_turn_dismissals.sql +21 -0
  242. package/dist/db/migrations-pg/0057_claude_review_follow_up_ticket.sql +8 -0
  243. package/dist/db/migrations-pg/0058_claude_review_trigger.sql +4 -0
  244. package/dist/db/migrations-pg/0059_commit_message_headline.sql +3 -0
  245. package/dist/db/migrations-pg/0060_claude_review_chat.sql +24 -0
  246. package/dist/db/migrations-pg/0061_adopt_agentic_tables.sql +79 -0
  247. package/dist/db/migrations-pg/0062_review_lens_drop_learnings.sql +5 -0
  248. package/dist/db/migrations-pg/0063_claude_review_threads.sql +7 -0
  249. package/dist/db/migrations-pg/0064_claude_review_ci_failures.sql +4 -0
  250. package/dist/db/migrations-pg/0065_ai_fix_change_report.sql +9 -0
  251. package/dist/db/migrations-pg/0066_claude_finding_story.sql +7 -0
  252. package/dist/db/migrations-pg/meta/0000_snapshot.json +2137 -0
  253. package/dist/db/migrations-pg/meta/0001_snapshot.json +2143 -0
  254. package/dist/db/migrations-pg/meta/0002_snapshot.json +2170 -0
  255. package/dist/db/migrations-pg/meta/0003_snapshot.json +2182 -0
  256. package/dist/db/migrations-pg/meta/0004_snapshot.json +2188 -0
  257. package/dist/db/migrations-pg/meta/0005_snapshot.json +2201 -0
  258. package/dist/db/migrations-pg/meta/0006_snapshot.json +2207 -0
  259. package/dist/db/migrations-pg/meta/0007_snapshot.json +2219 -0
  260. package/dist/db/migrations-pg/meta/0008_snapshot.json +2226 -0
  261. package/dist/db/migrations-pg/meta/0009_snapshot.json +2250 -0
  262. package/dist/db/migrations-pg/meta/0010_snapshot.json +2256 -0
  263. package/dist/db/migrations-pg/meta/0011_snapshot.json +2412 -0
  264. package/dist/db/migrations-pg/meta/0012_snapshot.json +2528 -0
  265. package/dist/db/migrations-pg/meta/0013_snapshot.json +2534 -0
  266. package/dist/db/migrations-pg/meta/0014_snapshot.json +2547 -0
  267. package/dist/db/migrations-pg/meta/0015_snapshot.json +2553 -0
  268. package/dist/db/migrations-pg/meta/0016_snapshot.json +2774 -0
  269. package/dist/db/migrations-pg/meta/0017_snapshot.json +2999 -0
  270. package/dist/db/migrations-pg/meta/0018_snapshot.json +3020 -0
  271. package/dist/db/migrations-pg/meta/0020_snapshot.json +3228 -0
  272. package/dist/db/migrations-pg/meta/0021_snapshot.json +3234 -0
  273. package/dist/db/migrations-pg/meta/0022_snapshot.json +3240 -0
  274. package/dist/db/migrations-pg/meta/_journal.json +475 -0
  275. package/dist/db/ml-labels.js +1666 -0
  276. package/dist/db/my-turn-dismissals.js +343 -0
  277. package/dist/db/my-turn-settings.js +34 -0
  278. package/dist/db/pending-classify.js +46 -0
  279. package/dist/db/pending-mute.js +171 -0
  280. package/dist/db/pending-tabs.js +238 -0
  281. package/dist/db/period-metrics.js +820 -0
  282. package/dist/db/person-period.js +763 -0
  283. package/dist/db/pr-intervals.js +930 -0
  284. package/dist/db/pr-liveness.js +240 -0
  285. package/dist/db/pr-mentions.js +279 -0
  286. package/dist/db/pr-merge-queue-stamp.js +91 -0
  287. package/dist/db/queries.js +14631 -0
  288. package/dist/db/reaction-targets.js +94 -0
  289. package/dist/db/repo-activity.js +171 -0
  290. package/dist/db/retention.js +138 -0
  291. package/dist/db/review-threads-for-review.js +240 -0
  292. package/dist/db/run-migrations.js +24 -0
  293. package/dist/db/schema.pg.js +1220 -0
  294. package/dist/db/schema.sqlite.js +1801 -0
  295. package/dist/db/search.js +317 -0
  296. package/dist/db/security-alerts.js +218 -0
  297. package/dist/db/synthesis-input.js +565 -0
  298. package/dist/db/triage.js +320 -0
  299. package/dist/db/usage.js +63 -0
  300. package/dist/db/work-plan.js +1086 -0
  301. package/dist/db/working-hours.js +161 -0
  302. package/dist/feed/my-turn.js +122 -0
  303. package/dist/github/actions-logs.js +397 -0
  304. package/dist/github/auth.js +86 -0
  305. package/dist/github/branch-queries.js +229 -0
  306. package/dist/github/client.js +454 -0
  307. package/dist/github/codeowners.js +221 -0
  308. package/dist/github/commit-checks.js +105 -0
  309. package/dist/github/compare.js +110 -0
  310. package/dist/github/diff-anchor.js +227 -0
  311. package/dist/github/mutations.js +706 -0
  312. package/dist/github/pr-file-content.js +254 -0
  313. package/dist/github/pr-liveness.js +161 -0
  314. package/dist/github/queries.js +875 -0
  315. package/dist/github/rate-budget.js +129 -0
  316. package/dist/github/reactions.js +161 -0
  317. package/dist/github/reviewer-suggest.js +104 -0
  318. package/dist/github/team-reviewers.js +96 -0
  319. package/dist/index.js +184 -0
  320. package/dist/merge/auto-merge-runner.js +960 -0
  321. package/dist/ml/severity-client.js +218 -0
  322. package/dist/pr/detail-enricher.js +26 -0
  323. package/dist/pro/bind.js +302 -0
  324. package/dist/pro/contract.js +37 -0
  325. package/dist/pro/migrate.js +64 -0
  326. package/dist/review/agent-context.js +127 -0
  327. package/dist/review/agent.js +385 -0
  328. package/dist/review/agentic.js +59 -0
  329. package/dist/review/auth.js +94 -0
  330. package/dist/review/chat-agent.js +179 -0
  331. package/dist/review/claude-review/ai-ready.js +16 -0
  332. package/dist/review/claude-review/auto-settings.js +139 -0
  333. package/dist/review/claude-review/auto.js +244 -0
  334. package/dist/review/claude-review/chat.js +489 -0
  335. package/dist/review/claude-review/ci-failures.js +350 -0
  336. package/dist/review/claude-review/follow-up.js +310 -0
  337. package/dist/review/claude-review/manager.js +686 -0
  338. package/dist/review/claude-review/persist.js +996 -0
  339. package/dist/review/claude-review/prompts.js +357 -0
  340. package/dist/review/claude-review/routes.js +518 -0
  341. package/dist/review/claude-review/routing.js +61 -0
  342. package/dist/review/claude-review/specialists.js +190 -0
  343. package/dist/review/claude-review/threads.js +265 -0
  344. package/dist/review/claude-review/ticket.js +282 -0
  345. package/dist/review/clone-hygiene.js +380 -0
  346. package/dist/review/clone-manager.js +367 -0
  347. package/dist/review/llm.js +113 -0
  348. package/dist/review/model-options.js +48 -0
  349. package/dist/review/plugin-providers.js +12 -0
  350. package/dist/review/post-review.js +216 -0
  351. package/dist/review/post-seam.js +161 -0
  352. package/dist/review/prepare.js +168 -0
  353. package/dist/review/pricing.js +17 -0
  354. package/dist/review/schema.js +156 -0
  355. package/dist/review/submit-map.js +41 -0
  356. package/dist/review/usage.js +90 -0
  357. package/dist/shared/claude-review.js +335 -0
  358. package/dist/shared/conflict-fold.js +151 -0
  359. package/dist/shared/conflicts.js +30 -0
  360. package/dist/shared/flow-settings.js +191 -0
  361. package/dist/shared/index.js +8 -0
  362. package/dist/shared/my-turn-settings.js +238 -0
  363. package/dist/shared/pending-rules.js +281 -0
  364. package/dist/shared/product.js +54 -0
  365. package/dist/shared/types.js +896 -0
  366. package/dist/status.js +386 -0
  367. package/dist/sync/adaptive.js +185 -0
  368. package/dist/sync/app-attribution.js +66 -0
  369. package/dist/sync/auth-notices.js +36 -0
  370. package/dist/sync/backfill-ci-history.js +315 -0
  371. package/dist/sync/backfill-commit-headlines.js +136 -0
  372. package/dist/sync/backfill-pr-security.js +175 -0
  373. package/dist/sync/backfill-review-requests.js +97 -0
  374. package/dist/sync/benchmark-rollup.js +50 -0
  375. package/dist/sync/bot-detection.js +309 -0
  376. package/dist/sync/bot-resolution-markers.js +30 -0
  377. package/dist/sync/branch-status.js +634 -0
  378. package/dist/sync/classify-change-shape.js +150 -0
  379. package/dist/sync/commit-files.js +74 -0
  380. package/dist/sync/derive-thread-state.js +99 -0
  381. package/dist/sync/drain-review-threads.js +212 -0
  382. package/dist/sync/hydrate-detail.js +482 -0
  383. package/dist/sync/mention-scan.js +89 -0
  384. package/dist/sync/ml-enrichment.js +478 -0
  385. package/dist/sync/pr-change-signal.js +96 -0
  386. package/dist/sync/pr-liveness-sweep.js +139 -0
  387. package/dist/sync/pr-settle.js +381 -0
  388. package/dist/sync/refresh-pr.js +163 -0
  389. package/dist/sync/reparse-vendor-badges.js +495 -0
  390. package/dist/sync/resync-after-write.js +280 -0
  391. package/dist/sync/review-fingerprint.js +117 -0
  392. package/dist/sync/reviewer-behavior.js +103 -0
  393. package/dist/sync/reviewer-classify.js +503 -0
  394. package/dist/sync/routing-files.js +97 -0
  395. package/dist/sync/scheduled-jobs.js +12 -0
  396. package/dist/sync/scheduler.js +159 -0
  397. package/dist/sync/security-detect.js +521 -0
  398. package/dist/sync/sync-manager.js +750 -0
  399. package/dist/sync/sync-one-pr.js +205 -0
  400. package/dist/sync/sync-repo.js +400 -0
  401. package/dist/sync/unsettled-prs.js +506 -0
  402. package/dist/sync/upsert.js +1190 -0
  403. package/package.json +56 -0
  404. package/public/apple-touch-icon.png +0 -0
  405. package/public/assets/AiFixTab-CQP6PT5u.js +2 -0
  406. package/public/assets/ClaudeReviewTab-DQJ-58ZA.js +8 -0
  407. package/public/assets/PrBotBehaviourTab-CCnFrWbC.js +1 -0
  408. package/public/assets/archivo-latin-600-BN-JkNrl.woff2 +0 -0
  409. package/public/assets/highlight-BEHUn5zE.css +10 -0
  410. package/public/assets/highlight-CIIZLa6Z.js +12 -0
  411. package/public/assets/index-BDnYs6zg.js +73 -0
  412. package/public/assets/index-mCuI--RC.css +1 -0
  413. package/public/assets/markdown-I_JLLVAZ.js +32 -0
  414. package/public/assets/perfProbe-Da13EhTE.js +1 -0
  415. package/public/assets/tanstack-5qsxxaLe.js +17 -0
  416. package/public/assets/vis-C3BCkP5U.js +1280 -0
  417. package/public/assets/vis-ziCVehMy.css +1 -0
  418. package/public/favicon-16.png +0 -0
  419. package/public/favicon-32.png +0 -0
  420. package/public/favicon-48.png +0 -0
  421. package/public/favicon.svg +5 -0
  422. package/public/index.html +41 -0
  423. package/public-landing/apple-touch-icon.png +0 -0
  424. package/public-landing/assets/archivo-latin-500-BWmvx2Mg.woff2 +0 -0
  425. package/public-landing/assets/archivo-latin-600-BN-JkNrl.woff2 +0 -0
  426. package/public-landing/assets/index-CA3eEGXO.js +40 -0
  427. package/public-landing/assets/index-naQrQ6Fe.css +1 -0
  428. package/public-landing/assets/jetbrains-mono-latin-400-RruCX7RW.woff2 +0 -0
  429. package/public-landing/assets/newsreader-latin-400-DExrRRrN.woff2 +0 -0
  430. package/public-landing/assets/newsreader-latin-400-italic-b0I-AwbV.woff2 +0 -0
  431. package/public-landing/bots/index.html +156 -0
  432. package/public-landing/contact/index.html +156 -0
  433. package/public-landing/cookies/index.html +156 -0
  434. package/public-landing/demo/limn-walkthrough-poster.jpg +0 -0
  435. package/public-landing/demo/limn-walkthrough.cues.json +44 -0
  436. package/public-landing/demo/limn-walkthrough.mp4 +0 -0
  437. package/public-landing/favicon-16.png +0 -0
  438. package/public-landing/favicon-32.png +0 -0
  439. package/public-landing/favicon-48.png +0 -0
  440. package/public-landing/favicon.svg +5 -0
  441. package/public-landing/features/index.html +156 -0
  442. package/public-landing/for-developers/index.html +156 -0
  443. package/public-landing/for-managers/index.html +156 -0
  444. package/public-landing/how-it-works/index.html +156 -0
  445. package/public-landing/how-we-measure/index.html +156 -0
  446. package/public-landing/icon-192.png +0 -0
  447. package/public-landing/icon-512.png +0 -0
  448. package/public-landing/index.html +156 -0
  449. package/public-landing/insights/index.html +156 -0
  450. package/public-landing/og-image.png +0 -0
  451. package/public-landing/pricing/index.html +156 -0
  452. package/public-landing/privacy/index.html +156 -0
  453. package/public-landing/pro/index.html +156 -0
  454. package/public-landing/reviews/index.html +156 -0
  455. package/public-landing/robots.txt +8 -0
  456. package/public-landing/shots/benchmark.png +0 -0
  457. package/public-landing/shots/bot-roi.png +0 -0
  458. package/public-landing/shots/bot-settings.png +0 -0
  459. package/public-landing/shots/chronology.png +0 -0
  460. package/public-landing/shots/feed.png +0 -0
  461. package/public-landing/shots/flow-metrics.png +0 -0
  462. package/public-landing/shots/free-reports.png +0 -0
  463. package/public-landing/shots/pending-board.png +0 -0
  464. package/public-landing/shots/pending-card.png +0 -0
  465. package/public-landing/shots/period-report.png +0 -0
  466. package/public-landing/shots/pr-detail.png +0 -0
  467. package/public-landing/shots/pr-threads.png +0 -0
  468. package/public-landing/shots/reach.png +0 -0
  469. package/public-landing/shots/repo-rows.png +0 -0
  470. package/public-landing/shots/severity-findings.png +0 -0
  471. package/public-landing/shots/severity-strip.png +0 -0
  472. package/public-landing/site.webmanifest +14 -0
  473. package/public-landing/sitemap.xml +51 -0
  474. package/public-landing/terms/index.html +156 -0
@@ -0,0 +1 @@
1
+ let p=!1;function g(){if(p)return;p=!0;const o=(...e)=>console.log("%c[perf]","color:#38bdf8;font-weight:700",...e);o("probe enabled — watch fps, longtasks, and the .pr-myturn census below");let r=0,a=performance.now(),u=a,n=0;const m=e=>{r+=1;const t=e-a;t>n&&(n=t),a=e;const s=e-u;if(s>=1e3){const f=Math.round(r*1e3/s),d=f<30?" ⚠ SLOW (sub-30fps)":"";o(`fps ${f} worst-frame ${Math.round(n)}ms${d}`),r=0,n=0,u=e}requestAnimationFrame(m)};requestAnimationFrame(m);let l=0,c=0;try{new PerformanceObserver(e=>{for(const t of e.getEntries())l+=1,c+=t.duration}).observe({entryTypes:["longtask"]})}catch{o("longtask observer unsupported in this browser")}let i=0;try{new PerformanceObserver(e=>{for(const t of e.getEntries()){const s=t.value;typeof s=="number"&&(i+=s)}}).observe({entryTypes:["layout-shift"]})}catch{}window.setInterval(()=>{const e=document.querySelectorAll(".vis-item").length,t=document.querySelectorAll(".vis-item.pr-myturn").length,s=document.getElementsByTagName("*").length;o(`census: nodes ${s} .vis-item ${e} .pr-myturn ${t} | last 5s: longtasks ${l} (${Math.round(c)}ms) cls ${i.toFixed(3)}`),t>=12&&o(` ⚠ ${t} "my turn" bars on screen — each used to animate box-shadow (continuous repaint); now opacity-pulsed on a composited layer`),l=0,c=0,i=0},5e3)}export{g as startPerfProbe};
@@ -0,0 +1,17 @@
1
+ var cs=e=>{throw TypeError(e)};var Qe=(e,t,s)=>t.has(e)||cs("Cannot "+s);var i=(e,t,s)=>(Qe(e,t,"read from private field"),s?s.call(e):t.get(e)),y=(e,t,s)=>t.has(e)?cs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),f=(e,t,s,r)=>(Qe(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),w=(e,t,s)=>(Qe(e,t,"access private method"),s);var Ce=(e,t,s,r)=>({set _(n){f(e,t,n,s)},get _(){return i(e,t,r)}});function or(e,t){for(var s=0;s<t.length;s++){const r=t[s];if(typeof r!="string"&&!Array.isArray(r)){for(const n in r)if(n!=="default"&&!(n in e)){const a=Object.getOwnPropertyDescriptor(r,n);a&&Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:()=>r[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function cr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fe={exports:{}},ue={},xe={exports:{}},O={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var hs;function hr(){if(hs)return O;hs=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),S=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.iterator;function b(u){return u===null||typeof u!="object"?null:(u=h&&u[h]||u["@@iterator"],typeof u=="function"?u:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},P=Object.assign,g={};function R(u,d,x){this.props=u,this.context=d,this.refs=g,this.updater=x||m}R.prototype.isReactComponent={},R.prototype.setState=function(u,d){if(typeof u!="object"&&typeof u!="function"&&u!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,u,d,"setState")},R.prototype.forceUpdate=function(u){this.updater.enqueueForceUpdate(this,u,"forceUpdate")};function C(){}C.prototype=R.prototype;function F(u,d,x){this.props=u,this.context=d,this.refs=g,this.updater=x||m}var _=F.prototype=new C;_.constructor=F,P(_,R.prototype),_.isPureReactComponent=!0;var v=Array.isArray,j=Object.prototype.hasOwnProperty,q={current:null},Y={key:!0,ref:!0,__self:!0,__source:!0};function Q(u,d,x){var T,I={},K=null,z=null;if(d!=null)for(T in d.ref!==void 0&&(z=d.ref),d.key!==void 0&&(K=""+d.key),d)j.call(d,T)&&!Y.hasOwnProperty(T)&&(I[T]=d[T]);var H=arguments.length-2;if(H===1)I.children=x;else if(1<H){for(var L=Array(H),at=0;at<H;at++)L[at]=arguments[at+2];I.children=L}if(u&&u.defaultProps)for(T in H=u.defaultProps,H)I[T]===void 0&&(I[T]=H[T]);return{$$typeof:e,type:u,key:K,ref:z,props:I,_owner:q.current}}function k(u,d){return{$$typeof:e,type:u.type,key:d,ref:u.ref,props:u.props,_owner:u._owner}}function N(u){return typeof u=="object"&&u!==null&&u.$$typeof===e}function it(u){var d={"=":"=0",":":"=2"};return"$"+u.replace(/[=:]/g,function(x){return d[x]})}var Dt=/\/+/g;function zt(u,d){return typeof u=="object"&&u!==null&&u.key!=null?it(""+u.key):d.toString(36)}function lt(u,d,x,T,I){var K=typeof u;(K==="undefined"||K==="boolean")&&(u=null);var z=!1;if(u===null)z=!0;else switch(K){case"string":case"number":z=!0;break;case"object":switch(u.$$typeof){case e:case t:z=!0}}if(z)return z=u,I=I(z),u=T===""?"."+zt(z,0):T,v(I)?(x="",u!=null&&(x=u.replace(Dt,"$&/")+"/"),lt(I,d,x,"",function(at){return at})):I!=null&&(N(I)&&(I=k(I,x+(!I.key||z&&z.key===I.key?"":(""+I.key).replace(Dt,"$&/")+"/")+u)),d.push(I)),1;if(z=0,T=T===""?".":T+":",v(u))for(var H=0;H<u.length;H++){K=u[H];var L=T+zt(K,H);z+=lt(K,d,x,L,I)}else if(L=b(u),typeof L=="function")for(u=L.call(u),H=0;!(K=u.next()).done;)K=K.value,L=T+zt(K,H++),z+=lt(K,d,x,L,I);else if(K==="object")throw d=String(u),Error("Objects are not valid as a React child (found: "+(d==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":d)+"). If you meant to render a collection of children, use an array instead.");return z}function ft(u,d,x){if(u==null)return u;var T=[],I=0;return lt(u,T,"","",function(K){return d.call(x,K,I++)}),T}function ar(u){if(u._status===-1){var d=u._result;d=d(),d.then(function(x){(u._status===0||u._status===-1)&&(u._status=1,u._result=x)},function(x){(u._status===0||u._status===-1)&&(u._status=2,u._result=x)}),u._status===-1&&(u._status=0,u._result=d)}if(u._status===1)return u._result.default;throw u._result}var J={current:null},Re={transition:null},ur={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:Re,ReactCurrentOwner:q};function os(){throw Error("act(...) is not supported in production builds of React.")}return O.Children={map:ft,forEach:function(u,d,x){ft(u,function(){d.apply(this,arguments)},x)},count:function(u){var d=0;return ft(u,function(){d++}),d},toArray:function(u){return ft(u,function(d){return d})||[]},only:function(u){if(!N(u))throw Error("React.Children.only expected to receive a single React element child.");return u}},O.Component=R,O.Fragment=s,O.Profiler=n,O.PureComponent=F,O.StrictMode=r,O.Suspense=l,O.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ur,O.act=os,O.cloneElement=function(u,d,x){if(u==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+u+".");var T=P({},u.props),I=u.key,K=u.ref,z=u._owner;if(d!=null){if(d.ref!==void 0&&(K=d.ref,z=q.current),d.key!==void 0&&(I=""+d.key),u.type&&u.type.defaultProps)var H=u.type.defaultProps;for(L in d)j.call(d,L)&&!Y.hasOwnProperty(L)&&(T[L]=d[L]===void 0&&H!==void 0?H[L]:d[L])}var L=arguments.length-2;if(L===1)T.children=x;else if(1<L){H=Array(L);for(var at=0;at<L;at++)H[at]=arguments[at+2];T.children=H}return{$$typeof:e,type:u.type,key:I,ref:K,props:T,_owner:z}},O.createContext=function(u){return u={$$typeof:o,_currentValue:u,_currentValue2:u,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},u.Provider={$$typeof:a,_context:u},u.Consumer=u},O.createElement=Q,O.createFactory=function(u){var d=Q.bind(null,u);return d.type=u,d},O.createRef=function(){return{current:null}},O.forwardRef=function(u){return{$$typeof:c,render:u}},O.isValidElement=N,O.lazy=function(u){return{$$typeof:p,_payload:{_status:-1,_result:u},_init:ar}},O.memo=function(u,d){return{$$typeof:S,type:u,compare:d===void 0?null:d}},O.startTransition=function(u){var d=Re.transition;Re.transition={};try{u()}finally{Re.transition=d}},O.unstable_act=os,O.useCallback=function(u,d){return J.current.useCallback(u,d)},O.useContext=function(u){return J.current.useContext(u)},O.useDebugValue=function(){},O.useDeferredValue=function(u){return J.current.useDeferredValue(u)},O.useEffect=function(u,d){return J.current.useEffect(u,d)},O.useId=function(){return J.current.useId()},O.useImperativeHandle=function(u,d,x){return J.current.useImperativeHandle(u,d,x)},O.useInsertionEffect=function(u,d){return J.current.useInsertionEffect(u,d)},O.useLayoutEffect=function(u,d){return J.current.useLayoutEffect(u,d)},O.useMemo=function(u,d){return J.current.useMemo(u,d)},O.useReducer=function(u,d,x){return J.current.useReducer(u,d,x)},O.useRef=function(u){return J.current.useRef(u)},O.useState=function(u){return J.current.useState(u)},O.useSyncExternalStore=function(u,d,x){return J.current.useSyncExternalStore(u,d,x)},O.useTransition=function(){return J.current.useTransition()},O.version="18.3.1",O}var ls;function Us(){return ls||(ls=1,xe.exports=hr()),xe.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var fs;function lr(){if(fs)return ue;fs=1;var e=Us(),t=Symbol.for("react.element"),s=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(c,l,S){var p,h={},b=null,m=null;S!==void 0&&(b=""+S),l.key!==void 0&&(b=""+l.key),l.ref!==void 0&&(m=l.ref);for(p in l)r.call(l,p)&&!a.hasOwnProperty(p)&&(h[p]=l[p]);if(c&&c.defaultProps)for(p in l=c.defaultProps,l)h[p]===void 0&&(h[p]=l[p]);return{$$typeof:t,type:c,key:b,ref:m,props:h,_owner:n.current}}return ue.Fragment=s,ue.jsx=o,ue.jsxs=o,ue}var ds;function fr(){return ds||(ds=1,Fe.exports=lr()),Fe.exports}var De=fr(),M=Us();const dr=cr(M),ui=or({__proto__:null,default:dr},[M]);var $t=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(){}},It,wt,Bt,Es,pr=(Es=class extends $t{constructor(){super();y(this,It);y(this,wt);y(this,Bt);f(this,Bt,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){i(this,wt)||this.setEventListener(i(this,Bt))}onUnsubscribe(){var t;this.hasListeners()||((t=i(this,wt))==null||t.call(this),f(this,wt,void 0))}setEventListener(t){var s;f(this,Bt,t),(s=i(this,wt))==null||s.call(this),f(this,wt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){i(this,It)!==t&&(f(this,It,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof i(this,It)=="boolean"?i(this,It):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},It=new WeakMap,wt=new WeakMap,Bt=new WeakMap,Es),rs=new pr,yr={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Rt,ss,_s,vr=(_s=class{constructor(){y(this,Rt,yr);y(this,ss,!1)}setTimeoutProvider(e){f(this,Rt,e)}setTimeout(e,t){return i(this,Rt).setTimeout(e,t)}clearTimeout(e){i(this,Rt).clearTimeout(e)}setInterval(e,t){return i(this,Rt).setInterval(e,t)}clearInterval(e){i(this,Rt).clearInterval(e)}},Rt=new WeakMap,ss=new WeakMap,_s),gt=new vr;function mr(e){setTimeout(e,0)}var gr=typeof window>"u"||"Deno"in globalThis;function $(){}function br(e,t){return typeof e=="function"?e(t):e}function Ie(e){return typeof e=="number"&&e>=0&&e!==1/0}function qs(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xt(e,t){return typeof e=="function"?e(t):e}function rt(e,t){return typeof e=="function"?e(t):e}function ps(e,t){const{type:s="all",exact:r,fetchStatus:n,predicate:a,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==is(o,t.options))return!1}else if(!ce(t.queryKey,o))return!1}if(s!=="all"){const l=t.isActive();if(s==="active"&&!l||s==="inactive"&&l)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||n&&n!==t.state.fetchStatus||a&&!a(t))}function ys(e,t){const{exact:s,status:r,predicate:n,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(s){if(Ht(t.options.mutationKey)!==Ht(a))return!1}else if(!ce(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||n&&!n(t))}function is(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ht)(e)}function Ht(e){return JSON.stringify(e,(t,s)=>Te(s)?Object.keys(s).sort().reduce((r,n)=>(r[n]=s[n],r),{}):s)}function ce(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>ce(e[s],t[s])):!1}var Sr=Object.prototype.hasOwnProperty;function _e(e,t,s=0){if(e===t)return e;if(s>500)return t;const r=vs(e)&&vs(t);if(!r&&!(Te(e)&&Te(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),c=o.length,l=r?new Array(c):{};let S=0;for(let p=0;p<c;p++){const h=r?p:o[p],b=e[h],m=t[h];if(b===m){l[h]=b,(r?p<a:Sr.call(e,h))&&S++;continue}if(b===null||m===null||typeof b!="object"||typeof m!="object"){l[h]=m;continue}const P=_e(b,m,s+1);l[h]=P,P===b&&S++}return a===c&&S===a?e:l}function he(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 vs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Te(e){if(!ms(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!ms(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ms(e){return Object.prototype.toString.call(e)==="[object Object]"}function wr(e){return new Promise(t=>{gt.setTimeout(t,e)})}function je(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?_e(e,t):t}function oi(e){return e}function Rr(e,t,s=0){const r=[...e,t];return s&&r.length>s?r.slice(1):r}function Cr(e,t,s=0){const r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var ns=Symbol();function Ls(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ns?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function as(e,t){return typeof e=="function"?e(...t):!!e}function Or(e,t,s){let r=!1,n;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??(n=t()),r||(r=!0,n.aborted?s():n.addEventListener("abort",s,{once:!0})),n)}),e}var le=(()=>{let e=()=>gr;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ae(){let e,t;const s=new Promise((n,a)=>{e=n,t=a});s.status="pending",s.catch(()=>{});function r(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{r({status:"fulfilled",value:n}),e(n)},s.reject=n=>{r({status:"rejected",reason:n}),t(n)},s}function Pr(e){var s;let t;if((s=e.then(r=>(t=r,r),$))==null||s.catch($),t!==void 0)return{data:t}}function Ns(e){return e}function Er(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function _r(e,t,s){const r=()=>{var a;const n=(a=e.promise)==null?void 0:a.then(t).catch(o=>s(o)?Promise.reject(new Error("redacted")):Promise.reject(o));return n==null||n.catch($),n};return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t(e.state.data)}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status==="pending"&&{promise:r()},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}}function Mr(e){return e.state.isPaused}function Qr(e){return e.state.status==="success"}function Fr(e){return!0}function xr(e,t={}){var l,S,p,h;const s=t.shouldDehydrateMutation??((l=e.getDefaultOptions().dehydrate)==null?void 0:l.shouldDehydrateMutation)??Mr,r=e.getMutationCache().getAll().flatMap(b=>s(b)?[Er(b)]:[]),n=t.shouldDehydrateQuery??((S=e.getDefaultOptions().dehydrate)==null?void 0:S.shouldDehydrateQuery)??Qr,a=t.shouldRedactErrors??((p=e.getDefaultOptions().dehydrate)==null?void 0:p.shouldRedactErrors)??Fr,o=t.serializeData??((h=e.getDefaultOptions().dehydrate)==null?void 0:h.serializeData)??Ns,c=e.getQueryCache().getAll().flatMap(b=>n(b)?[_r(b,o,a)]:[]);return{mutations:r,queries:c}}function Dr(e,t,s){var l,S;if(typeof t!="object"||t===null)return;const r=e.getMutationCache(),n=e.getQueryCache(),a=((l=s==null?void 0:s.defaultOptions)==null?void 0:l.deserializeData)??((S=e.getDefaultOptions().hydrate)==null?void 0:S.deserializeData)??Ns,o=t.mutations||[],c=t.queries||[];o.forEach(({state:p,...h})=>{var b,m;r.build(e,{...(b=e.getDefaultOptions().hydrate)==null?void 0:b.mutations,...(m=s==null?void 0:s.defaultOptions)==null?void 0:m.mutations,...h},p)}),c.forEach(({queryKey:p,state:h,queryHash:b,meta:m,promise:P,dehydratedAt:g,queryType:R})=>{var Y,Q;const C=P?Pr(P):void 0,F=h.data===void 0?C==null?void 0:C.data:h.data,_=F===void 0?F:a(F);let v=n.get(b);const j=(v==null?void 0:v.state.status)==="pending",q=(v==null?void 0:v.state.fetchStatus)==="fetching";if(v){const k=C&&g!==void 0&&g>v.state.dataUpdatedAt;if(h.dataUpdatedAt>v.state.dataUpdatedAt||k){const{fetchStatus:N,...it}=h;v.setState({...it,data:_,...h.status==="pending"&&_!==void 0&&{status:"success",...!q&&{fetchStatus:"idle"}}})}}else v=n.build(e,{...(Y=e.getDefaultOptions().hydrate)==null?void 0:Y.queries,...(Q=s==null?void 0:s.defaultOptions)==null?void 0:Q.queries,queryKey:p,queryHash:b,meta:m,_type:R},{...h,data:_,fetchStatus:"idle",status:h.status==="pending"&&_!==void 0?"success":h.status});P&&!C&&!j&&!q&&(g===void 0||g>v.state.dataUpdatedAt)&&v.fetch(void 0,{initialPromise:Promise.resolve(P).then(a)}).catch($)})}var Ir=mr;function Tr(){let e=[],t=0,s=c=>{c()},r=c=>{c()},n=Ir;const a=c=>{t?e.push(c):n(()=>{s(c)})},o=()=>{const c=e;e=[],c.length&&n(()=>{r(()=>{c.forEach(l=>{s(l)})})})};return{batch:c=>{let l;t++;try{l=c()}finally{t--,t||o()}return l},batchCalls:c=>(...l)=>{a(()=>{c(...l)})},schedule:a,setNotifyFunction:c=>{s=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{n=c}}}var A=Tr(),Gt,Ct,Vt,Ms,jr=(Ms=class extends $t{constructor(){super();y(this,Gt,!0);y(this,Ct);y(this,Vt);f(this,Vt,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",r)}}})}onSubscribe(){i(this,Ct)||this.setEventListener(i(this,Vt))}onUnsubscribe(){var t;this.hasListeners()||((t=i(this,Ct))==null||t.call(this),f(this,Ct,void 0))}setEventListener(t){var s;f(this,Vt,t),(s=i(this,Ct))==null||s.call(this),f(this,Ct,t(this.setOnline.bind(this)))}setOnline(t){i(this,Gt)!==t&&(f(this,Gt,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return i(this,Gt)}},Gt=new WeakMap,Ct=new WeakMap,Vt=new WeakMap,Ms),Ee=new jr;function Ar(e){return Math.min(1e3*2**e,3e4)}function Ks(e){return(e??"online")==="online"?Ee.isOnline():!0}var ke=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Hs(e){let t=!1,s=0,r;const n=Ae(),a=()=>n.status!=="pending",o=g=>{var R;if(!a()){const C=new ke(g);b(C),(R=e.onCancel)==null||R.call(e,C)}},c=()=>{t=!0},l=()=>{t=!1},S=()=>rs.isFocused()&&(e.networkMode==="always"||Ee.isOnline())&&e.canRun(),p=()=>Ks(e.networkMode)&&e.canRun(),h=g=>{a()||(r==null||r(),n.resolve(g))},b=g=>{a()||(r==null||r(),n.reject(g))},m=()=>new Promise(g=>{var R;r=C=>{(a()||S())&&g(C)},(R=e.onPause)==null||R.call(e)}).then(()=>{var g;r=void 0,a()||(g=e.onContinue)==null||g.call(e)}),P=()=>{if(a())return;let g;const R=s===0?e.initialPromise:void 0;try{g=R??e.fn()}catch(C){g=Promise.reject(C)}Promise.resolve(g).then(h).catch(C=>{var q;if(a())return;const F=e.retry??(le.isServer()?0:3),_=e.retryDelay??Ar,v=typeof _=="function"?_(s,C):_,j=F===!0||typeof F=="number"&&s<F||typeof F=="function"&&F(s,C);if(t||!j){b(C);return}s++,(q=e.onFail)==null||q.call(e,s,C),wr(v).then(()=>S()?void 0:m()).then(()=>{t?b(C):P()})})};return{promise:n,status:()=>n.status,cancel:o,continue:()=>(r==null||r(),n),cancelRetry:c,continueRetry:l,canStart:p,start:()=>(p()?P():m().then(P),n)}}var Tt,Qs,$s=(Qs=class{constructor(){y(this,Tt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ie(this.gcTime)&&f(this,Tt,gt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(le.isServer()?1/0:300*1e3))}clearGcTimeout(){i(this,Tt)!==void 0&&(gt.clearTimeout(i(this,Tt)),f(this,Tt,void 0))}},Tt=new WeakMap,Qs);function kr(e){return{onFetch:(t,s)=>{var p,h,b,m,P;const r=t.options,n=(b=(h=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:h.fetchMore)==null?void 0:b.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((P=t.state.data)==null?void 0:P.pageParams)||[];let c={pages:[],pageParams:[]},l=0;const S=async()=>{let g=!1;const R=_=>{Or(_,()=>t.signal,()=>g=!0)},C=Ls(t.options,t.fetchOptions),F=async(_,v,j)=>{if(g)return Promise.reject(t.signal.reason);if(v==null&&_.pages.length)return Promise.resolve(_);const Y=(()=>{const it={client:t.client,queryKey:t.queryKey,pageParam:v,direction:j?"backward":"forward",meta:t.options.meta};return R(it),it})(),Q=await C(Y),{maxPages:k}=t.options,N=j?Cr:Rr;return{pages:N(_.pages,Q,k),pageParams:N(_.pageParams,v,k)}};if(n&&a.length){const _=n==="backward",v=_?zs:Ue,j={pages:a,pageParams:o},q=v(r,j);c=await F(j,q,_)}else{const _=e??a.length;do{const v=l===0?o[0]??r.initialPageParam:Ue(r,c);if(l>0&&v==null)break;c=await F(c,v),l++}while(l<_)}return c};t.options.persister?t.fetchFn=()=>{var g,R;return(R=(g=t.options).persister)==null?void 0:R.call(g,S,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=S}}}function Ue(e,{pages:t,pageParams:s}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function zs(e,{pages:t,pageParams:s}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,s[0],s):void 0}function Ur(e,t){return t?Ue(e,t)!=null:!1}function qr(e,t){return!t||!e.getPreviousPageParam?!1:zs(e,t)!=null}var Jt,jt,Wt,nt,At,G,fe,kt,st,Bs,dt,Fs,Lr=(Fs=class extends $s{constructor(t){super();y(this,st);y(this,Jt);y(this,jt);y(this,Wt);y(this,nt);y(this,At);y(this,G);y(this,fe);y(this,kt);f(this,kt,!1),f(this,fe,t.defaultOptions),this.setOptions(t.options),this.observers=[],f(this,At,t.client),f(this,nt,i(this,At).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,f(this,jt,bs(this.options)),this.state=t.state??i(this,jt),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return i(this,Jt)}get promise(){var t;return(t=i(this,G))==null?void 0:t.promise}setOptions(t){if(this.options={...i(this,fe),...t},t!=null&&t._type&&f(this,Jt,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=bs(this.options);s.data!==void 0&&(this.setState(gs(s.data,s.dataUpdatedAt)),f(this,jt,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&i(this,nt).remove(this)}setData(t,s){const r=je(this.state.data,t,this.options);return w(this,st,dt).call(this,{data:r,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),r}setState(t){w(this,st,dt).call(this,{type:"setState",state:t})}cancel(t){var r,n;const s=(r=i(this,G))==null?void 0:r.promise;return(n=i(this,G))==null||n.cancel(t),s?s.then($).catch($):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return i(this,jt)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>rt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ns||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>xt(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:!qs(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=i(this,G))==null||s.continue()}onOnline(){var s;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=i(this,G))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),i(this,nt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(i(this,G)&&(i(this,kt)||w(this,st,Bs).call(this)?i(this,G).cancel({revert:!0}):i(this,G).cancelRetry()),this.scheduleGc()),i(this,nt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||w(this,st,dt).call(this,{type:"invalidate"})}async fetch(t,s){var S,p,h,b,m,P,g,R,C,F,_;if(this.state.fetchStatus!=="idle"&&((S=i(this,G))==null?void 0:S.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(i(this,G))return i(this,G).continueRetry(),i(this,G).promise}if(t&&this.setOptions(t),!this.options.queryFn){const v=this.observers.find(j=>j.options.queryFn);v&&this.setOptions(v.options)}const r=new AbortController,n=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(f(this,kt,!0),r.signal)})},a=()=>{const v=Ls(this.options,s),q=(()=>{const Y={client:i(this,At),queryKey:this.queryKey,meta:this.meta};return n(Y),Y})();return f(this,kt,!1),this.options.persister?this.options.persister(v,q,this):v(q)},c=(()=>{const v={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:i(this,At),state:this.state,fetchFn:a};return n(v),v})(),l=i(this,Jt)==="infinite"?kr(this.options.pages):this.options.behavior;l==null||l.onFetch(c,this),f(this,Wt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=c.fetchOptions)==null?void 0:p.meta))&&w(this,st,dt).call(this,{type:"fetch",meta:(h=c.fetchOptions)==null?void 0:h.meta}),f(this,G,Hs({initialPromise:s==null?void 0:s.initialPromise,fn:c.fetchFn,onCancel:v=>{v instanceof ke&&v.revert&&this.setState({...i(this,Wt),fetchStatus:"idle"}),r.abort()},onFail:(v,j)=>{w(this,st,dt).call(this,{type:"failed",failureCount:v,error:j})},onPause:()=>{w(this,st,dt).call(this,{type:"pause"})},onContinue:()=>{w(this,st,dt).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const v=await i(this,G).start();if(v===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(v),(m=(b=i(this,nt).config).onSuccess)==null||m.call(b,v,this),(g=(P=i(this,nt).config).onSettled)==null||g.call(P,v,this.state.error,this),v}catch(v){if(v instanceof ke){if(v.silent)return i(this,G).promise;if(v.revert){if(this.state.data===void 0)throw v;return this.state.data}}throw w(this,st,dt).call(this,{type:"error",error:v}),(C=(R=i(this,nt).config).onError)==null||C.call(R,v,this),(_=(F=i(this,nt).config).onSettled)==null||_.call(F,this.state.data,v,this),v}finally{this.scheduleGc()}}},Jt=new WeakMap,jt=new WeakMap,Wt=new WeakMap,nt=new WeakMap,At=new WeakMap,G=new WeakMap,fe=new WeakMap,kt=new WeakMap,st=new WeakSet,Bs=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},dt=function(t){const s=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Gs(r.data,this.options),fetchMeta:t.meta??null};case"success":const n={...r,...gs(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return f(this,Wt,t.manual?n:void 0),n;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=s(this.state),A.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),i(this,nt).notify({query:this,type:"updated",action:t})})},Fs);function Gs(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ks(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function gs(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function bs(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var X,E,de,W,Ut,Yt,pt,Ot,pe,Xt,Zt,qt,Lt,Pt,te,D,oe,qe,Le,Ne,Ke,He,$e,ze,Vs,xs,Me=(xs=class extends $t{constructor(t,s){super();y(this,D);y(this,X);y(this,E);y(this,de);y(this,W);y(this,Ut);y(this,Yt);y(this,pt);y(this,Ot);y(this,pe);y(this,Xt);y(this,Zt);y(this,qt);y(this,Lt);y(this,Pt);y(this,te,new Set);this.options=s,f(this,X,t),f(this,Ot,null),f(this,pt,Ae()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,E).addObserver(this),Ss(i(this,E),this.options)?w(this,D,oe).call(this):this.updateResult(),w(this,D,Ke).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Be(i(this,E),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Be(i(this,E),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,w(this,D,He).call(this),w(this,D,$e).call(this),i(this,E).removeObserver(this)}setOptions(t){const s=this.options,r=i(this,E);if(this.options=i(this,X).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof rt(this.options.enabled,i(this,E))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");w(this,D,ze).call(this),i(this,E).setOptions(this.options),s._defaulted&&!he(this.options,s)&&i(this,X).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,E),observer:this});const n=this.hasListeners();n&&ws(i(this,E),r,this.options,s)&&w(this,D,oe).call(this),this.updateResult(),n&&(i(this,E)!==r||rt(this.options.enabled,i(this,E))!==rt(s.enabled,i(this,E))||xt(this.options.staleTime,i(this,E))!==xt(s.staleTime,i(this,E)))&&w(this,D,qe).call(this);const a=w(this,D,Le).call(this);n&&(i(this,E)!==r||rt(this.options.enabled,i(this,E))!==rt(s.enabled,i(this,E))||a!==i(this,Pt))&&w(this,D,Ne).call(this,a)}getOptimisticResult(t){const s=i(this,X).getQueryCache().build(i(this,X),t),r=this.createResult(s,t);return Kr(this,r)&&(f(this,W,r),f(this,Yt,this.options),f(this,Ut,i(this,E).state)),r}getCurrentResult(){return i(this,W)}trackResult(t,s){return new Proxy(t,{get:(r,n)=>(this.trackProp(n),s==null||s(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,pt).status==="pending"&&i(this,pt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(t){i(this,te).add(t)}getCurrentQuery(){return i(this,E)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=i(this,X).defaultQueryOptions(t),r=i(this,X).getQueryCache().build(i(this,X),s);return r.fetch().then(()=>this.createResult(r,s))}fetch(t){return w(this,D,oe).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,W)))}createResult(t,s){var k;const r=i(this,E),n=this.options,a=i(this,W),o=i(this,Ut),c=i(this,Yt),S=t!==r?t.state:i(this,de),{state:p}=t;let h={...p},b=!1,m;if(s._optimisticResults){const N=this.hasListeners(),it=!N&&Ss(t,s),Dt=N&&ws(t,r,s,n);(it||Dt)&&(h={...h,...Gs(p.data,t.options)}),s._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:P,errorUpdatedAt:g,status:R}=h;m=h.data;let C=!1;if(s.placeholderData!==void 0&&m===void 0&&R==="pending"){let N;a!=null&&a.isPlaceholderData&&s.placeholderData===(c==null?void 0:c.placeholderData)?(N=a.data,C=!0):N=typeof s.placeholderData=="function"?s.placeholderData((k=i(this,Zt))==null?void 0:k.state.data,i(this,Zt)):s.placeholderData,N!==void 0&&(R="success",m=je(a==null?void 0:a.data,N,s),b=!0)}if(s.select&&m!==void 0&&!C)if(a&&m===(o==null?void 0:o.data)&&s.select===i(this,pe))m=i(this,Xt);else try{f(this,pe,s.select),m=s.select(m),m=je(a==null?void 0:a.data,m,s),f(this,Xt,m),f(this,Ot,null)}catch(N){f(this,Ot,N)}i(this,Ot)&&(P=i(this,Ot),m=i(this,Xt),g=Date.now(),R="error");const F=h.fetchStatus==="fetching",_=R==="pending",v=R==="error",j=_&&F,q=m!==void 0,Q={status:R,fetchStatus:h.fetchStatus,isPending:_,isSuccess:R==="success",isError:v,isInitialLoading:j,isLoading:j,data:m,dataUpdatedAt:h.dataUpdatedAt,error:P,errorUpdatedAt:g,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:h.dataUpdateCount>S.dataUpdateCount||h.errorUpdateCount>S.errorUpdateCount,isFetching:F,isRefetching:F&&!_,isLoadingError:v&&!q,isPaused:h.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:v&&q,isStale:us(t,s),refetch:this.refetch,promise:i(this,pt),isEnabled:rt(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const N=Q.data!==void 0,it=Q.status==="error"&&!N,Dt=ft=>{it?ft.reject(Q.error):N&&ft.resolve(Q.data)},zt=()=>{const ft=f(this,pt,Q.promise=Ae());Dt(ft)},lt=i(this,pt);switch(lt.status){case"pending":t.queryHash===r.queryHash&&Dt(lt);break;case"fulfilled":(it||Q.data!==lt.value)&&zt();break;case"rejected":(!it||Q.error!==lt.reason)&&zt();break}}return Q}updateResult(){const t=i(this,W),s=this.createResult(i(this,E),this.options);if(f(this,Ut,i(this,E).state),f(this,Yt,this.options),i(this,Ut).data!==void 0&&f(this,Zt,i(this,E)),he(s,t))return;f(this,W,s);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,a=typeof n=="function"?n():n;if(a==="all"||!a&&!i(this,te).size)return!0;const o=new Set(a??i(this,te));return this.options.throwOnError&&o.add("error"),Object.keys(i(this,W)).some(c=>{const l=c;return i(this,W)[l]!==t[l]&&o.has(l)})};w(this,D,Vs).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&w(this,D,Ke).call(this)}},X=new WeakMap,E=new WeakMap,de=new WeakMap,W=new WeakMap,Ut=new WeakMap,Yt=new WeakMap,pt=new WeakMap,Ot=new WeakMap,pe=new WeakMap,Xt=new WeakMap,Zt=new WeakMap,qt=new WeakMap,Lt=new WeakMap,Pt=new WeakMap,te=new WeakMap,D=new WeakSet,oe=function(t){w(this,D,ze).call(this);let s=i(this,E).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch($)),s},qe=function(){w(this,D,He).call(this);const t=xt(this.options.staleTime,i(this,E));if(le.isServer()||i(this,W).isStale||!Ie(t))return;const r=qs(i(this,W).dataUpdatedAt,t)+1;f(this,qt,gt.setTimeout(()=>{i(this,W).isStale||this.updateResult()},r))},Le=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,E)):this.options.refetchInterval)??!1},Ne=function(t){w(this,D,$e).call(this),f(this,Pt,t),!(le.isServer()||rt(this.options.enabled,i(this,E))===!1||!Ie(i(this,Pt))||i(this,Pt)===0)&&f(this,Lt,gt.setInterval(()=>{(this.options.refetchIntervalInBackground||rs.isFocused())&&w(this,D,oe).call(this)},i(this,Pt)))},Ke=function(){w(this,D,qe).call(this),w(this,D,Ne).call(this,w(this,D,Le).call(this))},He=function(){i(this,qt)!==void 0&&(gt.clearTimeout(i(this,qt)),f(this,qt,void 0))},$e=function(){i(this,Lt)!==void 0&&(gt.clearInterval(i(this,Lt)),f(this,Lt,void 0))},ze=function(){const t=i(this,X).getQueryCache().build(i(this,X),this.options);if(t===i(this,E))return;const s=i(this,E);f(this,E,t),f(this,de,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},Vs=function(t){A.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(i(this,W))}),i(this,X).getQueryCache().notify({query:i(this,E),type:"observerResultsUpdated"})})},xs);function Nr(e,t){return rt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&rt(t.retryOnMount,e)===!1)}function Ss(e,t){return Nr(e,t)||e.state.data!==void 0&&Be(e,t,t.refetchOnMount)}function Be(e,t,s){if(rt(t.enabled,e)!==!1&&xt(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&us(e,t)}return!1}function ws(e,t,s,r){return(e!==t||rt(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&us(e,s)}function us(e,t){return rt(t.enabled,e)!==!1&&e.isStaleByTime(xt(t.staleTime,e))}function Kr(e,t){return!he(e.getCurrentResult(),t)}var Hr=class extends Me{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var P,g;const{state:s}=e,r=super.createResult(e,t),{isFetching:n,isRefetching:a,isError:o,isRefetchError:c}=r,l=(g=(P=s.fetchMeta)==null?void 0:P.fetchMore)==null?void 0:g.direction,S=o&&l==="forward",p=n&&l==="forward",h=o&&l==="backward",b=n&&l==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Ur(t,s.data),hasPreviousPage:qr(t,s.data),isFetchNextPageError:S,isFetchingNextPage:p,isFetchPreviousPageError:h,isFetchingPreviousPage:b,isRefetchError:c&&!S&&!h,isRefetching:a&&!p&&!b}}},ye,ot,V,Nt,ct,St,Ds,$r=(Ds=class extends $s{constructor(t){super();y(this,ct);y(this,ye);y(this,ot);y(this,V);y(this,Nt);f(this,ye,t.client),this.mutationId=t.mutationId,f(this,V,t.mutationCache),f(this,ot,[]),this.state=t.state||Js(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){i(this,ot).includes(t)||(i(this,ot).push(t),this.clearGcTimeout(),i(this,V).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){f(this,ot,i(this,ot).filter(s=>s!==t)),this.scheduleGc(),i(this,V).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){i(this,ot).length||(this.state.status==="pending"?this.scheduleGc():i(this,V).remove(this))}continue(){var t;return((t=i(this,Nt))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,c,l,S,p,h,b,m,P,g,R,C,F,_,v,j,q,Y;const s=()=>{w(this,ct,St).call(this,{type:"continue"})},r={client:i(this,ye),meta:this.options.meta,mutationKey:this.options.mutationKey};f(this,Nt,Hs({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(Q,k)=>{w(this,ct,St).call(this,{type:"failed",failureCount:Q,error:k})},onPause:()=>{w(this,ct,St).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>i(this,V).canRun(this)}));const n=this.state.status==="pending",a=!i(this,Nt).canStart();try{if(n)s();else{w(this,ct,St).call(this,{type:"pending",variables:t,isPaused:a}),i(this,V).config.onMutate&&await i(this,V).config.onMutate(t,this,r);const k=await((c=(o=this.options).onMutate)==null?void 0:c.call(o,t,r));k!==this.state.context&&w(this,ct,St).call(this,{type:"pending",context:k,variables:t,isPaused:a})}const Q=await i(this,Nt).start();return await((S=(l=i(this,V).config).onSuccess)==null?void 0:S.call(l,Q,t,this.state.context,this,r)),await((h=(p=this.options).onSuccess)==null?void 0:h.call(p,Q,t,this.state.context,r)),await((m=(b=i(this,V).config).onSettled)==null?void 0:m.call(b,Q,null,this.state.variables,this.state.context,this,r)),await((g=(P=this.options).onSettled)==null?void 0:g.call(P,Q,null,t,this.state.context,r)),w(this,ct,St).call(this,{type:"success",data:Q}),Q}catch(Q){try{await((C=(R=i(this,V).config).onError)==null?void 0:C.call(R,Q,t,this.state.context,this,r))}catch(k){Promise.reject(k)}try{await((_=(F=this.options).onError)==null?void 0:_.call(F,Q,t,this.state.context,r))}catch(k){Promise.reject(k)}try{await((j=(v=i(this,V).config).onSettled)==null?void 0:j.call(v,void 0,Q,this.state.variables,this.state.context,this,r))}catch(k){Promise.reject(k)}try{await((Y=(q=this.options).onSettled)==null?void 0:Y.call(q,void 0,Q,t,this.state.context,r))}catch(k){Promise.reject(k)}throw w(this,ct,St).call(this,{type:"error",error:Q}),Q}finally{i(this,V).runNext(this)}}},ye=new WeakMap,ot=new WeakMap,V=new WeakMap,Nt=new WeakMap,ct=new WeakSet,St=function(t){const s=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),A.batch(()=>{i(this,ot).forEach(r=>{r.onMutationUpdate(t)}),i(this,V).notify({mutation:this,type:"updated",action:t})})},Ds);function Js(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yt,ut,ve,Is,zr=(Is=class extends $t{constructor(t={}){super();y(this,yt);y(this,ut);y(this,ve);this.config=t,f(this,yt,new Set),f(this,ut,new Map),f(this,ve,0)}build(t,s,r){const n=new $r({client:t,mutationCache:this,mutationId:++Ce(this,ve)._,options:t.defaultMutationOptions(s),state:r});return this.add(n),n}add(t){i(this,yt).add(t);const s=Oe(t);if(typeof s=="string"){const r=i(this,ut).get(s);r?r.push(t):i(this,ut).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(i(this,yt).delete(t)){const s=Oe(t);if(typeof s=="string"){const r=i(this,ut).get(s);if(r)if(r.length>1){const n=r.indexOf(t);n!==-1&&r.splice(n,1)}else r[0]===t&&i(this,ut).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=Oe(t);if(typeof s=="string"){const r=i(this,ut).get(s),n=r==null?void 0:r.find(a=>a.state.status==="pending");return!n||n===t}else return!0}runNext(t){var r;const s=Oe(t);if(typeof s=="string"){const n=(r=i(this,ut).get(s))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){A.batch(()=>{i(this,yt).forEach(t=>{this.notify({type:"removed",mutation:t})}),i(this,yt).clear(),i(this,ut).clear()})}getAll(){return Array.from(i(this,yt))}find(t){const s={exact:!0,...t};return this.getAll().find(r=>ys(s,r))}findAll(t={}){return this.getAll().filter(s=>ys(t,s))}notify(t){A.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return A.batch(()=>Promise.all(t.map(s=>s.continue().catch($))))}},yt=new WeakMap,ut=new WeakMap,ve=new WeakMap,Is);function Oe(e){var t;return(t=e.options.scope)==null?void 0:t.id}var vt,Et,Z,mt,bt,Pe,Ge,Ts,Br=(Ts=class extends $t{constructor(t,s){super();y(this,bt);y(this,vt);y(this,Et);y(this,Z);y(this,mt);f(this,vt,t),this.setOptions(s),this.bindMethods(),w(this,bt,Pe).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=i(this,vt).defaultMutationOptions(t),he(this.options,s)||i(this,vt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:i(this,Z),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Ht(s.mutationKey)!==Ht(this.options.mutationKey)?this.reset():((r=i(this,Z))==null?void 0:r.state.status)==="pending"&&i(this,Z).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=i(this,Z))==null||t.removeObserver(this)}onMutationUpdate(t){w(this,bt,Pe).call(this),w(this,bt,Ge).call(this,t)}getCurrentResult(){return i(this,Et)}reset(){var t;(t=i(this,Z))==null||t.removeObserver(this),f(this,Z,void 0),w(this,bt,Pe).call(this),w(this,bt,Ge).call(this)}mutate(t,s){var r;return f(this,mt,s),(r=i(this,Z))==null||r.removeObserver(this),f(this,Z,i(this,vt).getMutationCache().build(i(this,vt),this.options)),i(this,Z).addObserver(this),i(this,Z).execute(t)}},vt=new WeakMap,Et=new WeakMap,Z=new WeakMap,mt=new WeakMap,bt=new WeakSet,Pe=function(){var s;const t=((s=i(this,Z))==null?void 0:s.state)??Js();f(this,Et,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Ge=function(t){A.batch(()=>{var s,r,n,a,o,c,l,S;if(i(this,mt)&&this.hasListeners()){const p=i(this,Et).variables,h=i(this,Et).context,b={client:i(this,vt),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=i(this,mt)).onSuccess)==null||r.call(s,t.data,p,h,b)}catch(m){Promise.reject(m)}try{(a=(n=i(this,mt)).onSettled)==null||a.call(n,t.data,null,p,h,b)}catch(m){Promise.reject(m)}}else if((t==null?void 0:t.type)==="error"){try{(c=(o=i(this,mt)).onError)==null||c.call(o,t.error,p,h,b)}catch(m){Promise.reject(m)}try{(S=(l=i(this,mt)).onSettled)==null||S.call(l,void 0,t.error,p,h,b)}catch(m){Promise.reject(m)}}}this.listeners.forEach(p=>{p(i(this,Et))})})},Ts);function Rs(e,t){const s=new Set(t);return e.filter(r=>!s.has(r))}function Gr(e,t,s){const r=e.slice(0);return r[t]=s,r}var ee,tt,se,Kt,et,_t,me,ge,be,Se,B,Ve,Je,Ws,We,Ye,Xe,js,Vr=(js=class extends $t{constructor(t,s,r){super();y(this,B);y(this,ee);y(this,tt);y(this,se);y(this,Kt);y(this,et);y(this,_t);y(this,me);y(this,ge);y(this,be);y(this,Se,[]);f(this,ee,t),f(this,Kt,r),f(this,se,[]),f(this,et,[]),f(this,tt,[]),this.setQueries(s)}onSubscribe(){this.listeners.size===1&&i(this,et).forEach(t=>{t.subscribe(s=>{w(this,B,Ye).call(this,t,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,i(this,et).forEach(t=>{t.destroy()})}setQueries(t,s){f(this,se,t),f(this,Kt,s),A.batch(()=>{const r=i(this,et),n=w(this,B,We).call(this,i(this,se));n.forEach(h=>h.observer.setOptions(h.defaultedQueryOptions));const a=n.map(h=>h.observer),o=a.map(h=>h.getCurrentResult()),c=r.length!==a.length,l=a.some((h,b)=>h!==r[b]),S=c||l,p=S?!0:o.some((h,b)=>{const m=i(this,tt)[b];return!m||!he(h,m)});!S&&!p||(S&&(f(this,Se,n),f(this,et,a)),f(this,tt,o),this.hasListeners()&&(S&&(Rs(r,a).forEach(h=>{h.destroy()}),Rs(a,r).forEach(h=>{h.subscribe(b=>{w(this,B,Ye).call(this,h,b)})})),w(this,B,Xe).call(this)))})}getCurrentResult(){return i(this,tt)}getQueries(){return i(this,et).map(t=>t.getCurrentQuery())}getObservers(){return i(this,et)}getOptimisticResult(t,s){const r=w(this,B,We).call(this,t),n=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),a=r.map(o=>o.defaultedQueryOptions.queryHash);return[n,o=>w(this,B,Je).call(this,o??n,s,a),()=>w(this,B,Ve).call(this,n,r)]}},ee=new WeakMap,tt=new WeakMap,se=new WeakMap,Kt=new WeakMap,et=new WeakMap,_t=new WeakMap,me=new WeakMap,ge=new WeakMap,be=new WeakMap,Se=new WeakMap,B=new WeakSet,Ve=function(t,s){return s.map((r,n)=>{const a=t[n];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,o=>{s.forEach(c=>{c.observer.trackProp(o)})})})},Je=function(t,s,r){if(s){const n=i(this,be),a=r!==void 0&&n!==void 0&&(n.length!==r.length||r.some((o,c)=>o!==n[c]));return(!i(this,_t)||i(this,tt)!==i(this,ge)||a||s!==i(this,me))&&(f(this,me,s),f(this,ge,i(this,tt)),r!==void 0&&f(this,be,r),f(this,_t,_e(i(this,_t),s(t)))),i(this,_t)}return t},Ws=function(){var t;return((t=i(this,Kt))==null?void 0:t.combine)!==void 0&&i(this,et).some((s,r)=>{var n;return s.options.suspense&&((n=i(this,tt)[r])==null?void 0:n.data)===void 0})},We=function(t){const s=new Map;i(this,et).forEach(n=>{const a=n.options.queryHash;if(!a)return;const o=s.get(a);o?o.push(n):s.set(a,[n])});const r=[];return t.forEach(n=>{var l;const a=i(this,ee).defaultQueryOptions(n),c=((l=s.get(a.queryHash))==null?void 0:l.shift())??new Me(i(this,ee),a);r.push({defaultedQueryOptions:a,observer:c})}),r},Ye=function(t,s){const r=i(this,et).indexOf(t);r!==-1&&(f(this,tt,Gr(i(this,tt),r,s)),w(this,B,Xe).call(this))},Xe=function(){var t;if(this.hasListeners()){const s=w(this,B,Ve).call(this,i(this,tt),i(this,Se)),r=w(this,B,Ws).call(this),n=i(this,_t),a=r?n:w(this,B,Je).call(this,s,(t=i(this,Kt))==null?void 0:t.combine);(r||n!==a)&&A.batch(()=>{this.listeners.forEach(o=>{o(i(this,tt))})})}},js),ht,As,Jr=(As=class extends $t{constructor(t={}){super();y(this,ht);this.config=t,f(this,ht,new Map)}build(t,s,r){const n=s.queryKey,a=s.queryHash??is(n,s);let o=this.get(a);return o||(o=new Lr({client:t,queryKey:n,queryHash:a,options:t.defaultQueryOptions(s),state:r,defaultOptions:t.getQueryDefaults(n)}),this.add(o)),o}add(t){i(this,ht).has(t.queryHash)||(i(this,ht).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=i(this,ht).get(t.queryHash);s&&(t.destroy(),s===t&&i(this,ht).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){A.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return i(this,ht).get(t)}getAll(){return[...i(this,ht).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(r=>ps(s,r))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(r=>ps(t,r)):s}notify(t){A.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){A.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){A.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ht=new WeakMap,As),U,Mt,Qt,re,ie,Ft,ne,ae,ks,ci=(ks=class{constructor(e={}){y(this,U);y(this,Mt);y(this,Qt);y(this,re);y(this,ie);y(this,Ft);y(this,ne);y(this,ae);f(this,U,e.queryCache||new Jr),f(this,Mt,e.mutationCache||new zr),f(this,Qt,e.defaultOptions||{}),f(this,re,new Map),f(this,ie,new Map),f(this,Ft,0)}mount(){Ce(this,Ft)._++,i(this,Ft)===1&&(f(this,ne,rs.subscribe(async e=>{e&&(await this.resumePausedMutations(),i(this,U).onFocus())})),f(this,ae,Ee.subscribe(async e=>{e&&(await this.resumePausedMutations(),i(this,U).onOnline())})))}unmount(){var e,t;Ce(this,Ft)._--,i(this,Ft)===0&&((e=i(this,ne))==null||e.call(this),f(this,ne,void 0),(t=i(this,ae))==null||t.call(this),f(this,ae,void 0))}isFetching(e){return i(this,U).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return i(this,Mt).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=i(this,U).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=i(this,U).build(this,t),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(xt(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return i(this,U).findAll(e).map(({queryKey:t,state:s})=>{const r=s.data;return[t,r]})}setQueryData(e,t,s){const r=this.defaultQueryOptions({queryKey:e}),n=i(this,U).get(r.queryHash),a=n==null?void 0:n.state.data,o=br(t,a);if(o!==void 0)return i(this,U).build(this,r).setData(o,{...s,manual:!0})}setQueriesData(e,t,s){return A.batch(()=>i(this,U).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=i(this,U).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=i(this,U);A.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=i(this,U);return A.batch(()=>(s.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},r=A.batch(()=>i(this,U).findAll(e).map(n=>n.cancel(s)));return Promise.all(r).then($).catch($)}invalidateQueries(e,t={}){return A.batch(()=>(i(this,U).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},r=A.batch(()=>i(this,U).findAll(e).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,s);return s.throwOnError||(a=a.catch($)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then($)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=i(this,U).build(this,t);return s.isStaleByTime(xt(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($).catch($)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($).catch($)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ee.isOnline()?i(this,Mt).resumePausedMutations():Promise.resolve()}getQueryCache(){return i(this,U)}getMutationCache(){return i(this,Mt)}getDefaultOptions(){return i(this,Qt)}setDefaultOptions(e){f(this,Qt,e)}setQueryDefaults(e,t){i(this,re).set(Ht(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...i(this,re).values()],s={};return t.forEach(r=>{ce(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,t){i(this,ie).set(Ht(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...i(this,ie).values()],s={};return t.forEach(r=>{ce(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...i(this,Qt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=is(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===ns&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...i(this,Qt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){i(this,U).clear(),i(this,Mt).clear()}},U=new WeakMap,Mt=new WeakMap,Qt=new WeakMap,re=new WeakMap,ie=new WeakMap,Ft=new WeakMap,ne=new WeakMap,ae=new WeakMap,ks),Ys=M.createContext(void 0),we=e=>{const t=M.useContext(Ys);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Wr=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),De.jsx(Ys.Provider,{value:e,children:t})),Xs=M.createContext(!1),Zs=()=>M.useContext(Xs),Yr=Xs.Provider;function Xr(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Zr=M.createContext(Xr()),tr=()=>M.useContext(Zr),er=(e,t,s)=>{const r=s!=null&&s.state.error&&typeof e.throwOnError=="function"?as(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},sr=e=>{M.useEffect(()=>{e.clearReset()},[e])},rr=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(n&&e.data===void 0||as(s,[e.error,r])),ir=e=>{if(e.suspense){const s=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>s(r(...n)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ti=(e,t)=>e.isLoading&&e.isFetching&&!t,Ze=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ts=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function hi({queries:e,...t},s){const r=we(s),n=Zs(),a=tr(),o=M.useMemo(()=>e.map(g=>{const R=r.defaultQueryOptions(g);return R._optimisticResults=n?"isRestoring":"optimistic",R}),[e,r,n]);o.forEach(g=>{ir(g);const R=r.getQueryCache().get(g.queryHash);er(g,a,R)}),sr(a);const[c]=M.useState(()=>new Vr(r,o,t)),[l,S,p]=c.getOptimisticResult(o,t.combine),h=!n&&t.subscribed!==!1;M.useSyncExternalStore(M.useCallback(g=>h?c.subscribe(A.batchCalls(g)):$,[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),M.useEffect(()=>{c.setQueries(o,t)},[o,t,c]);const m=l.some((g,R)=>Ze(o[R],g))?l.flatMap((g,R)=>{const C=o[R];if(C&&Ze(C,g)){const F=new Me(r,C);return ts(C,F,a)}return[]}):[];if(m.length>0)throw Promise.all(m);const P=l.find((g,R)=>{const C=o[R];return C&&rr({result:g,errorResetBoundary:a,throwOnError:C.throwOnError,query:r.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(P!=null&&P.error)throw P.error;return S(p())}function nr(e,t,s){var m,P,g,R;const r=Zs(),n=tr(),a=we(s),o=a.defaultQueryOptions(e);(P=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||P.call(m,o);const c=a.getQueryCache().get(o.queryHash),l=e.subscribed!==!1;o._optimisticResults=r?"isRestoring":l?"optimistic":void 0,ir(o),er(o,n,c),sr(n);const S=!a.getQueryCache().get(o.queryHash),[p]=M.useState(()=>new t(a,o)),h=p.getOptimisticResult(o),b=!r&&l;if(M.useSyncExternalStore(M.useCallback(C=>{const F=b?p.subscribe(A.batchCalls(C)):$;return p.updateResult(),F},[p,b]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),M.useEffect(()=>{p.setOptions(o)},[o,p]),Ze(o,h))throw ts(o,p,n);if(rr({result:h,errorResetBoundary:n,throwOnError:o.throwOnError,query:c,suspense:o.suspense}))throw h.error;if((R=(g=a.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||R.call(g,o,h),o.experimental_prefetchInRender&&!le.isServer()&&ti(h,r)){const C=S?ts(o,p,n):c==null?void 0:c.promise;C==null||C.catch($).finally(()=>{p.updateResult()})}return o.notifyOnChangeProps?h:p.trackResult(h)}function li(e,t){return nr(e,Me,t)}function fi(e,t){const s=we(t);return ei({filters:{...e,status:"pending"}},s).length}function Cs(e,t){return e.findAll(t.filters).map(s=>t.select?t.select(s):s.state)}function ei(e={},t){const s=we(t).getMutationCache(),r=M.useRef(e),n=M.useRef(null);return n.current===null&&(n.current=Cs(s,e)),M.useEffect(()=>{r.current=e}),M.useSyncExternalStore(M.useCallback(a=>s.subscribe(()=>{const o=_e(n.current,Cs(s,r.current));n.current!==o&&(n.current=o,A.schedule(a))}),[s]),()=>n.current,()=>n.current)}function di(e,t){const s=we(t),[r]=M.useState(()=>new Br(s,e));M.useEffect(()=>{r.setOptions(e)},[r,e]);const n=M.useSyncExternalStore(M.useCallback(o=>r.subscribe(A.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=M.useCallback((o,c)=>{r.mutate(o,c).catch($)},[r]);if(n.error&&as(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:a,mutateAsync:n.mutate}}function pi(e,t){return nr(e,Hr,t)}var si=["added","removed","updated"];function Os(e){return si.includes(e)}async function ri({queryClient:e,persister:t,maxAge:s=1e3*60*60*24,buster:r="",hydrateOptions:n}){try{const a=await t.restoreClient();if(a)if(a.timestamp){const o=Date.now()-a.timestamp>s,c=a.buster!==r;if(o||c)return t.removeClient();Dr(e,a.clientState,n)}else return t.removeClient()}catch(a){throw await t.removeClient(),a}}async function Ps({queryClient:e,persister:t,buster:s="",dehydrateOptions:r}){const n={buster:s,timestamp:Date.now(),clientState:xr(e,r)};await t.persistClient(n)}function ii(e){const t=e.queryClient.getQueryCache().subscribe(r=>{Os(r.type)&&Ps(e)}),s=e.queryClient.getMutationCache().subscribe(r=>{Os(r.type)&&Ps(e)});return()=>{t(),s()}}var yi=({children:e,persistOptions:t,onSuccess:s,onError:r,...n})=>{const[a,o]=M.useState(!0),c=M.useRef({persistOptions:t,onSuccess:s,onError:r}),l=M.useRef(!1);return M.useEffect(()=>{c.current={persistOptions:t,onSuccess:s,onError:r}}),M.useEffect(()=>{const S={...c.current.persistOptions,queryClient:n.client};return l.current||(l.current=!0,ri(S).then(()=>{var p,h;return(h=(p=c.current).onSuccess)==null?void 0:h.call(p)}).catch(()=>{var p,h;return(h=(p=c.current).onError)==null?void 0:h.call(p)}).finally(()=>{o(!1)})),a?void 0:ii(S)},[n.client,a]),De.jsx(Wr,{...n,children:De.jsx(Yr,{value:a,children:e})})};function es(){}function ni(e,{interval:t=1e3,onError:s=es}={}){if(typeof e!="function")throw new Error("argument is not function.");let r=0,n=null,a=!1,o=!1;return async(...c)=>{if(n=c,!o){for(o=!0;a;)await new Promise(l=>gt.setTimeout(l,t));for(;Date.now()<r;)await new Promise(l=>gt.setTimeout(l,r-Date.now()));o=!1,a=!0;try{await e(...n)}catch(l){try{s(l)}catch{}}r=Date.now()+t,a=!1}}}var vi=({storage:e,key:t="REACT_QUERY_OFFLINE_CACHE",throttleTime:s=1e3,serialize:r=JSON.stringify,deserialize:n=JSON.parse,retry:a})=>{if(e){const o=async c=>{try{const l=await r(c);await e.setItem(t,l);return}catch(l){return l}};return{persistClient:ni(async c=>{let l=c,S=await o(l),p=0;for(;S&&l;)p++,l=await(a==null?void 0:a({persistedClient:l,error:S,errorCount:p})),l&&(S=await o(l))},{interval:s}),restoreClient:async()=>{const c=await e.getItem(t);if(c)return await n(c)},removeClient:()=>e.removeItem(t)}}return{persistClient:es,restoreClient:()=>Promise.resolve(void 0),removeClient:es}};export{yi as P,ci as Q,dr as R,ui as a,Us as b,vi as c,fi as d,di as e,ei as f,cr as g,hi as h,li as i,De as j,oi as k,we as l,A as n,M as r,ns as s,pi as u};