draft-board 0.1.0-beta.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 (250) hide show
  1. package/app/backend/.env.example +9 -0
  2. package/app/backend/.smartkanban/evidence/8b383839-cbec-45af-86ee-c7708d075cbe/bddf2ed5-2e21-4d46-a62b-10b87f1642a6_patch.txt +195 -0
  3. package/app/backend/.smartkanban/evidence/8b383839-cbec-45af-86ee-c7708d075cbe/bddf2ed5-2e21-4d46-a62b-10b87f1642a6_stat.txt +6 -0
  4. package/app/backend/CURL_EXAMPLES.md +335 -0
  5. package/app/backend/ENV_SETUP.md +65 -0
  6. package/app/backend/alembic/env.py +71 -0
  7. package/app/backend/alembic/script.py.mako +28 -0
  8. package/app/backend/alembic/versions/001_initial_schema.py +104 -0
  9. package/app/backend/alembic/versions/002_add_jobs_table.py +52 -0
  10. package/app/backend/alembic/versions/003_add_workspace_table.py +48 -0
  11. package/app/backend/alembic/versions/004_add_evidence_table.py +56 -0
  12. package/app/backend/alembic/versions/005_add_verification_commands.py +32 -0
  13. package/app/backend/alembic/versions/006_add_planner_lock_table.py +39 -0
  14. package/app/backend/alembic/versions/007_add_revision_review_tables.py +126 -0
  15. package/app/backend/alembic/versions/008_add_revision_idempotency_and_traceability.py +52 -0
  16. package/app/backend/alembic/versions/009_add_job_health_fields.py +46 -0
  17. package/app/backend/alembic/versions/010_add_review_comment_line_content.py +36 -0
  18. package/app/backend/alembic/versions/011_add_analysis_cache.py +47 -0
  19. package/app/backend/alembic/versions/012_add_boards_table.py +102 -0
  20. package/app/backend/alembic/versions/013_add_ticket_blocking.py +45 -0
  21. package/app/backend/alembic/versions/014_add_agent_sessions.py +220 -0
  22. package/app/backend/alembic/versions/015_add_ticket_sort_order.py +33 -0
  23. package/app/backend/alembic/versions/03220f0b93ae_add_pr_fields_to_ticket.py +49 -0
  24. package/app/backend/alembic/versions/0c2d89fff3b1_seed_board_configs_from_yaml.py +206 -0
  25. package/app/backend/alembic/versions/3348e5cf54c1_add_merge_checklist_table.py +67 -0
  26. package/app/backend/alembic/versions/357c780ee445_add_goal_status.py +34 -0
  27. package/app/backend/alembic/versions/553340b7e26c_add_autonomy_fields_to_goal.py +65 -0
  28. package/app/backend/alembic/versions/774dc335c679_merge_migration_heads.py +23 -0
  29. package/app/backend/alembic/versions/7b307e847cbd_merge_heads.py +23 -0
  30. package/app/backend/alembic/versions/82ecd978cc70_add_missing_indexes.py +48 -0
  31. package/app/backend/alembic/versions/8ef5054dc280_add_normalized_log_entries.py +173 -0
  32. package/app/backend/alembic/versions/8f3e2bd8ea3b_merge_migration_heads.py +23 -0
  33. package/app/backend/alembic/versions/9d17f0698d3b_add_config_column_to_boards_table.py +30 -0
  34. package/app/backend/alembic/versions/add_agent_conversation_history.py +72 -0
  35. package/app/backend/alembic/versions/add_job_variant.py +34 -0
  36. package/app/backend/alembic/versions/add_performance_indexes.py +95 -0
  37. package/app/backend/alembic/versions/add_repos_and_board_repos.py +174 -0
  38. package/app/backend/alembic/versions/add_session_id_to_jobs.py +27 -0
  39. package/app/backend/alembic/versions/add_sqlite_backend_tables.py +104 -0
  40. package/app/backend/alembic/versions/b10fb0b62240_add_diff_content_to_revisions.py +34 -0
  41. package/app/backend/alembic.ini +89 -0
  42. package/app/backend/app/__init__.py +3 -0
  43. package/app/backend/app/data_dir.py +85 -0
  44. package/app/backend/app/database.py +70 -0
  45. package/app/backend/app/database_sync.py +64 -0
  46. package/app/backend/app/dependencies/__init__.py +5 -0
  47. package/app/backend/app/dependencies/auth.py +80 -0
  48. package/app/backend/app/dependencies.py +43 -0
  49. package/app/backend/app/exceptions.py +178 -0
  50. package/app/backend/app/executors/__init__.py +1 -0
  51. package/app/backend/app/executors/adapters/__init__.py +1 -0
  52. package/app/backend/app/executors/adapters/aider.py +152 -0
  53. package/app/backend/app/executors/adapters/amazon_q.py +103 -0
  54. package/app/backend/app/executors/adapters/amp.py +123 -0
  55. package/app/backend/app/executors/adapters/claude.py +177 -0
  56. package/app/backend/app/executors/adapters/cline.py +127 -0
  57. package/app/backend/app/executors/adapters/codex.py +167 -0
  58. package/app/backend/app/executors/adapters/copilot.py +202 -0
  59. package/app/backend/app/executors/adapters/cursor.py +87 -0
  60. package/app/backend/app/executors/adapters/droid.py +123 -0
  61. package/app/backend/app/executors/adapters/gemini.py +132 -0
  62. package/app/backend/app/executors/adapters/goose.py +131 -0
  63. package/app/backend/app/executors/adapters/opencode.py +123 -0
  64. package/app/backend/app/executors/adapters/qwen.py +123 -0
  65. package/app/backend/app/executors/plugins/__init__.py +1 -0
  66. package/app/backend/app/executors/registry.py +202 -0
  67. package/app/backend/app/executors/spec.py +226 -0
  68. package/app/backend/app/main.py +486 -0
  69. package/app/backend/app/middleware/__init__.py +13 -0
  70. package/app/backend/app/middleware/idempotency.py +426 -0
  71. package/app/backend/app/middleware/rate_limit.py +312 -0
  72. package/app/backend/app/middleware/security_headers.py +43 -0
  73. package/app/backend/app/middleware/timeout.py +37 -0
  74. package/app/backend/app/models/__init__.py +56 -0
  75. package/app/backend/app/models/agent_conversation_history.py +56 -0
  76. package/app/backend/app/models/agent_session.py +127 -0
  77. package/app/backend/app/models/analysis_cache.py +49 -0
  78. package/app/backend/app/models/base.py +9 -0
  79. package/app/backend/app/models/board.py +79 -0
  80. package/app/backend/app/models/board_repo.py +68 -0
  81. package/app/backend/app/models/cost_budget.py +42 -0
  82. package/app/backend/app/models/enums.py +40 -0
  83. package/app/backend/app/models/evidence.py +132 -0
  84. package/app/backend/app/models/goal.py +102 -0
  85. package/app/backend/app/models/idempotency_entry.py +30 -0
  86. package/app/backend/app/models/job.py +163 -0
  87. package/app/backend/app/models/job_queue.py +39 -0
  88. package/app/backend/app/models/kv_store.py +28 -0
  89. package/app/backend/app/models/merge_checklist.py +87 -0
  90. package/app/backend/app/models/normalized_log.py +100 -0
  91. package/app/backend/app/models/planner_lock.py +43 -0
  92. package/app/backend/app/models/rate_limit_entry.py +25 -0
  93. package/app/backend/app/models/repo.py +66 -0
  94. package/app/backend/app/models/review_comment.py +91 -0
  95. package/app/backend/app/models/review_summary.py +69 -0
  96. package/app/backend/app/models/revision.py +130 -0
  97. package/app/backend/app/models/ticket.py +223 -0
  98. package/app/backend/app/models/ticket_event.py +83 -0
  99. package/app/backend/app/models/user.py +47 -0
  100. package/app/backend/app/models/workspace.py +71 -0
  101. package/app/backend/app/redis_client.py +119 -0
  102. package/app/backend/app/routers/__init__.py +29 -0
  103. package/app/backend/app/routers/agents.py +296 -0
  104. package/app/backend/app/routers/auth.py +94 -0
  105. package/app/backend/app/routers/board.py +885 -0
  106. package/app/backend/app/routers/dashboard.py +351 -0
  107. package/app/backend/app/routers/debug.py +528 -0
  108. package/app/backend/app/routers/evidence.py +96 -0
  109. package/app/backend/app/routers/executors.py +324 -0
  110. package/app/backend/app/routers/goals.py +574 -0
  111. package/app/backend/app/routers/jobs.py +448 -0
  112. package/app/backend/app/routers/maintenance.py +172 -0
  113. package/app/backend/app/routers/merge.py +360 -0
  114. package/app/backend/app/routers/planner.py +537 -0
  115. package/app/backend/app/routers/pull_requests.py +382 -0
  116. package/app/backend/app/routers/repos.py +263 -0
  117. package/app/backend/app/routers/revisions.py +939 -0
  118. package/app/backend/app/routers/settings.py +267 -0
  119. package/app/backend/app/routers/tickets.py +2003 -0
  120. package/app/backend/app/routers/webhooks.py +143 -0
  121. package/app/backend/app/routers/websocket.py +249 -0
  122. package/app/backend/app/schemas/__init__.py +109 -0
  123. package/app/backend/app/schemas/board.py +87 -0
  124. package/app/backend/app/schemas/common.py +33 -0
  125. package/app/backend/app/schemas/evidence.py +87 -0
  126. package/app/backend/app/schemas/goal.py +90 -0
  127. package/app/backend/app/schemas/job.py +97 -0
  128. package/app/backend/app/schemas/merge.py +139 -0
  129. package/app/backend/app/schemas/planner.py +500 -0
  130. package/app/backend/app/schemas/repo.py +187 -0
  131. package/app/backend/app/schemas/review.py +137 -0
  132. package/app/backend/app/schemas/revision.py +114 -0
  133. package/app/backend/app/schemas/ticket.py +238 -0
  134. package/app/backend/app/schemas/ticket_event.py +72 -0
  135. package/app/backend/app/schemas/workspace.py +19 -0
  136. package/app/backend/app/services/__init__.py +31 -0
  137. package/app/backend/app/services/agent_memory_service.py +223 -0
  138. package/app/backend/app/services/agent_registry.py +346 -0
  139. package/app/backend/app/services/agent_session_manager.py +318 -0
  140. package/app/backend/app/services/agent_session_service.py +219 -0
  141. package/app/backend/app/services/agent_tools.py +379 -0
  142. package/app/backend/app/services/auth_service.py +98 -0
  143. package/app/backend/app/services/autonomy_service.py +380 -0
  144. package/app/backend/app/services/board_repo_service.py +201 -0
  145. package/app/backend/app/services/board_service.py +326 -0
  146. package/app/backend/app/services/cleanup_service.py +1085 -0
  147. package/app/backend/app/services/config_service.py +908 -0
  148. package/app/backend/app/services/context_gatherer.py +557 -0
  149. package/app/backend/app/services/cost_tracking_service.py +293 -0
  150. package/app/backend/app/services/cursor_log_normalizer.py +536 -0
  151. package/app/backend/app/services/delivery_pipeline.py +440 -0
  152. package/app/backend/app/services/executor_service.py +634 -0
  153. package/app/backend/app/services/git_host/__init__.py +11 -0
  154. package/app/backend/app/services/git_host/factory.py +87 -0
  155. package/app/backend/app/services/git_host/github.py +270 -0
  156. package/app/backend/app/services/git_host/gitlab.py +194 -0
  157. package/app/backend/app/services/git_host/protocol.py +75 -0
  158. package/app/backend/app/services/git_merge_simple.py +346 -0
  159. package/app/backend/app/services/git_ops.py +384 -0
  160. package/app/backend/app/services/github_service.py +233 -0
  161. package/app/backend/app/services/goal_service.py +113 -0
  162. package/app/backend/app/services/job_service.py +423 -0
  163. package/app/backend/app/services/job_watchdog_service.py +424 -0
  164. package/app/backend/app/services/langchain_adapter.py +122 -0
  165. package/app/backend/app/services/llm_provider_clients.py +351 -0
  166. package/app/backend/app/services/llm_service.py +285 -0
  167. package/app/backend/app/services/log_normalizer.py +342 -0
  168. package/app/backend/app/services/log_stream_service.py +276 -0
  169. package/app/backend/app/services/merge_checklist_service.py +264 -0
  170. package/app/backend/app/services/merge_service.py +784 -0
  171. package/app/backend/app/services/orchestrator_log.py +84 -0
  172. package/app/backend/app/services/planner_service.py +1662 -0
  173. package/app/backend/app/services/planner_tick_sync.py +1040 -0
  174. package/app/backend/app/services/queued_message_service.py +156 -0
  175. package/app/backend/app/services/reliability_wrapper.py +389 -0
  176. package/app/backend/app/services/repo_discovery_service.py +318 -0
  177. package/app/backend/app/services/review_service.py +334 -0
  178. package/app/backend/app/services/revision_service.py +389 -0
  179. package/app/backend/app/services/safe_autopilot.py +510 -0
  180. package/app/backend/app/services/sqlite_worker.py +372 -0
  181. package/app/backend/app/services/task_dispatch.py +135 -0
  182. package/app/backend/app/services/ticket_generation_service.py +1781 -0
  183. package/app/backend/app/services/ticket_service.py +486 -0
  184. package/app/backend/app/services/udar_planner_service.py +1007 -0
  185. package/app/backend/app/services/webhook_service.py +126 -0
  186. package/app/backend/app/services/workspace_service.py +465 -0
  187. package/app/backend/app/services/worktree_file_service.py +92 -0
  188. package/app/backend/app/services/worktree_validator.py +213 -0
  189. package/app/backend/app/sqlite_kv.py +278 -0
  190. package/app/backend/app/state_machine.py +128 -0
  191. package/app/backend/app/templates/__init__.py +5 -0
  192. package/app/backend/app/templates/registry.py +243 -0
  193. package/app/backend/app/utils/__init__.py +5 -0
  194. package/app/backend/app/utils/artifact_reader.py +87 -0
  195. package/app/backend/app/utils/circuit_breaker.py +229 -0
  196. package/app/backend/app/utils/db_retry.py +136 -0
  197. package/app/backend/app/utils/ignored_fields.py +123 -0
  198. package/app/backend/app/utils/validators.py +54 -0
  199. package/app/backend/app/websocket/__init__.py +5 -0
  200. package/app/backend/app/websocket/manager.py +179 -0
  201. package/app/backend/app/websocket/state_tracker.py +113 -0
  202. package/app/backend/app/worker.py +3190 -0
  203. package/app/backend/calculator_tickets.json +40 -0
  204. package/app/backend/canary_tests.sh +591 -0
  205. package/app/backend/celerybeat-schedule +0 -0
  206. package/app/backend/celerybeat-schedule-shm +0 -0
  207. package/app/backend/celerybeat-schedule-wal +0 -0
  208. package/app/backend/logs/.gitkeep +3 -0
  209. package/app/backend/multiplication_division_implementation_tickets.json +55 -0
  210. package/app/backend/multiplication_division_tickets.json +42 -0
  211. package/app/backend/pyproject.toml +45 -0
  212. package/app/backend/requirements-dev.txt +8 -0
  213. package/app/backend/requirements.txt +20 -0
  214. package/app/backend/run.sh +30 -0
  215. package/app/backend/run_with_logs.sh +10 -0
  216. package/app/backend/scientific_calculator_tickets.json +40 -0
  217. package/app/backend/scripts/extract_openapi.py +21 -0
  218. package/app/backend/scripts/seed_demo.py +187 -0
  219. package/app/backend/setup_demo_review.py +302 -0
  220. package/app/backend/test_actual_parse.py +41 -0
  221. package/app/backend/test_agent_streaming.py +61 -0
  222. package/app/backend/test_parse.py +51 -0
  223. package/app/backend/test_streaming.py +51 -0
  224. package/app/backend/test_subprocess_streaming.py +50 -0
  225. package/app/backend/tests/__init__.py +1 -0
  226. package/app/backend/tests/conftest.py +46 -0
  227. package/app/backend/tests/test_auth.py +341 -0
  228. package/app/backend/tests/test_autonomy_service.py +391 -0
  229. package/app/backend/tests/test_cleanup_service_safety.py +417 -0
  230. package/app/backend/tests/test_middleware.py +279 -0
  231. package/app/backend/tests/test_planner_providers.py +290 -0
  232. package/app/backend/tests/test_planner_unblock.py +183 -0
  233. package/app/backend/tests/test_revision_invariants.py +618 -0
  234. package/app/backend/tests/test_sqlite_kv.py +290 -0
  235. package/app/backend/tests/test_sqlite_worker.py +353 -0
  236. package/app/backend/tests/test_task_dispatch.py +100 -0
  237. package/app/backend/tests/test_ticket_validation.py +304 -0
  238. package/app/backend/tests/test_udar_agent.py +693 -0
  239. package/app/backend/tests/test_webhook_service.py +184 -0
  240. package/app/backend/tickets_output.json +59 -0
  241. package/app/backend/user_management_tickets.json +50 -0
  242. package/app/backend/uvicorn.log +0 -0
  243. package/app/draft.yaml +313 -0
  244. package/app/frontend/dist/assets/index-LcjCczu5.js +155 -0
  245. package/app/frontend/dist/assets/index-_FP_279e.css +1 -0
  246. package/app/frontend/dist/index.html +14 -0
  247. package/app/frontend/dist/vite.svg +1 -0
  248. package/app/frontend/package.json +101 -0
  249. package/bin/cli.js +527 -0
  250. package/package.json +37 -0
@@ -0,0 +1,155 @@
1
+ function sI(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function ab(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bR(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var a=!1;try{a=this instanceof r}catch{}return a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var iy={exports:{}},_u={};var mC;function aI(){if(mC)return _u;mC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var c=null;if(o!==void 0&&(c=""+o),a.key!==void 0&&(c=""+a.key),"key"in a){o={};for(var d in a)d!=="key"&&(o[d]=a[d])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:c,ref:a!==void 0?a:null,props:o}}return _u.Fragment=t,_u.jsx=n,_u.jsxs=n,_u}var pC;function wR(){return pC||(pC=1,iy.exports=aI()),iy.exports}var l=wR(),oy={exports:{}},Xe={};var gC;function iI(){if(gC)return Xe;gC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),y=Symbol.iterator;function v(L){return L===null||typeof L!="object"?null:(L=y&&L[y]||L["@@iterator"],typeof L=="function"?L:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,C={};function j(L,$,X){this.props=L,this.context=$,this.refs=C,this.updater=X||S}j.prototype.isReactComponent={},j.prototype.setState=function(L,$){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,$,"setState")},j.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function E(){}E.prototype=j.prototype;function R(L,$,X){this.props=L,this.context=$,this.refs=C,this.updater=X||S}var A=R.prototype=new E;A.constructor=R,N(A,j.prototype),A.isPureReactComponent=!0;var _=Array.isArray;function O(){}var T={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function B(L,$,X){var Q=X.ref;return{$$typeof:e,type:L,key:$,ref:Q!==void 0?Q:null,props:X}}function W(L,$){return B(L.type,$,L.props)}function M(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function V(L){var $={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(X){return $[X]})}var G=/\/+/g;function F(L,$){return typeof L=="object"&&L!==null&&L.key!=null?V(""+L.key):$.toString(36)}function H(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(O,O):(L.status="pending",L.then(function($){L.status==="pending"&&(L.status="fulfilled",L.value=$)},function($){L.status==="pending"&&(L.status="rejected",L.reason=$)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function P(L,$,X,Q,q){var ce=typeof L;(ce==="undefined"||ce==="boolean")&&(L=null);var ne=!1;if(L===null)ne=!0;else switch(ce){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(L.$$typeof){case e:case t:ne=!0;break;case m:return ne=L._init,P(ne(L._payload),$,X,Q,q)}}if(ne)return q=q(L),ne=Q===""?"."+F(L,0):Q,_(q)?(X="",ne!=null&&(X=ne.replace(G,"$&/")+"/"),P(q,$,X,"",function(De){return De})):q!=null&&(M(q)&&(q=W(q,X+(q.key==null||L&&L.key===q.key?"":(""+q.key).replace(G,"$&/")+"/")+ne)),$.push(q)),1;ne=0;var xe=Q===""?".":Q+":";if(_(L))for(var be=0;be<L.length;be++)Q=L[be],ce=xe+F(Q,be),ne+=P(Q,$,X,ce,q);else if(be=v(L),typeof be=="function")for(L=be.call(L),be=0;!(Q=L.next()).done;)Q=Q.value,ce=xe+F(Q,be++),ne+=P(Q,$,X,ce,q);else if(ce==="object"){if(typeof L.then=="function")return P(H(L),$,X,Q,q);throw $=String(L),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ne}function U(L,$,X){if(L==null)return L;var Q=[],q=0;return P(L,Q,"","",function(ce){return $.call(X,ce,q++)}),Q}function z(L){if(L._status===-1){var $=L._result;$=$(),$.then(function(X){(L._status===0||L._status===-1)&&(L._status=1,L._result=X)},function(X){(L._status===0||L._status===-1)&&(L._status=2,L._result=X)}),L._status===-1&&(L._status=0,L._result=$)}if(L._status===1)return L._result.default;throw L._result}var te=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},oe={map:U,forEach:function(L,$,X){U(L,function(){$.apply(this,arguments)},X)},count:function(L){var $=0;return U(L,function(){$++}),$},toArray:function(L){return U(L,function($){return $})||[]},only:function(L){if(!M(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Xe.Activity=p,Xe.Children=oe,Xe.Component=j,Xe.Fragment=n,Xe.Profiler=a,Xe.PureComponent=R,Xe.StrictMode=r,Xe.Suspense=h,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(L){return T.H.useMemoCache(L)}},Xe.cache=function(L){return function(){return L.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(L,$,X){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var Q=N({},L.props),q=L.key;if($!=null)for(ce in $.key!==void 0&&(q=""+$.key),$)!D.call($,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&$.ref===void 0||(Q[ce]=$[ce]);var ce=arguments.length-2;if(ce===1)Q.children=X;else if(1<ce){for(var ne=Array(ce),xe=0;xe<ce;xe++)ne[xe]=arguments[xe+2];Q.children=ne}return B(L.type,q,Q)},Xe.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:o,_context:L},L},Xe.createElement=function(L,$,X){var Q,q={},ce=null;if($!=null)for(Q in $.key!==void 0&&(ce=""+$.key),$)D.call($,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(q[Q]=$[Q]);var ne=arguments.length-2;if(ne===1)q.children=X;else if(1<ne){for(var xe=Array(ne),be=0;be<ne;be++)xe[be]=arguments[be+2];q.children=xe}if(L&&L.defaultProps)for(Q in ne=L.defaultProps,ne)q[Q]===void 0&&(q[Q]=ne[Q]);return B(L,ce,q)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(L){return{$$typeof:d,render:L}},Xe.isValidElement=M,Xe.lazy=function(L){return{$$typeof:m,_payload:{_status:-1,_result:L},_init:z}},Xe.memo=function(L,$){return{$$typeof:f,type:L,compare:$===void 0?null:$}},Xe.startTransition=function(L){var $=T.T,X={};T.T=X;try{var Q=L(),q=T.S;q!==null&&q(X,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(O,te)}catch(ce){te(ce)}finally{$!==null&&X.types!==null&&($.types=X.types),T.T=$}},Xe.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Xe.use=function(L){return T.H.use(L)},Xe.useActionState=function(L,$,X){return T.H.useActionState(L,$,X)},Xe.useCallback=function(L,$){return T.H.useCallback(L,$)},Xe.useContext=function(L){return T.H.useContext(L)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(L,$){return T.H.useDeferredValue(L,$)},Xe.useEffect=function(L,$){return T.H.useEffect(L,$)},Xe.useEffectEvent=function(L){return T.H.useEffectEvent(L)},Xe.useId=function(){return T.H.useId()},Xe.useImperativeHandle=function(L,$,X){return T.H.useImperativeHandle(L,$,X)},Xe.useInsertionEffect=function(L,$){return T.H.useInsertionEffect(L,$)},Xe.useLayoutEffect=function(L,$){return T.H.useLayoutEffect(L,$)},Xe.useMemo=function(L,$){return T.H.useMemo(L,$)},Xe.useOptimistic=function(L,$){return T.H.useOptimistic(L,$)},Xe.useReducer=function(L,$,X){return T.H.useReducer(L,$,X)},Xe.useRef=function(L){return T.H.useRef(L)},Xe.useState=function(L){return T.H.useState(L)},Xe.useSyncExternalStore=function(L,$,X){return T.H.useSyncExternalStore(L,$,X)},Xe.useTransition=function(){return T.H.useTransition()},Xe.version="19.2.3",Xe}var xC;function Vd(){return xC||(xC=1,oy.exports=iI()),oy.exports}var x=Vd();const ge=ab(x),tp=sI({__proto__:null,default:ge},[x]);var ly={exports:{}},Ru={},cy={exports:{}},uy={};var yC;function oI(){return yC||(yC=1,(function(e){function t(P,U){var z=P.length;P.push(U);e:for(;0<z;){var te=z-1>>>1,oe=P[te];if(0<a(oe,U))P[te]=U,P[z]=oe,z=te;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var U=P[0],z=P.pop();if(z!==U){P[0]=z;e:for(var te=0,oe=P.length,L=oe>>>1;te<L;){var $=2*(te+1)-1,X=P[$],Q=$+1,q=P[Q];if(0>a(X,z))Q<oe&&0>a(q,X)?(P[te]=q,P[Q]=z,te=Q):(P[te]=X,P[$]=z,te=$);else if(Q<oe&&0>a(q,z))P[te]=q,P[Q]=z,te=Q;else break e}}return U}function a(P,U){var z=P.sortIndex-U.sortIndex;return z!==0?z:P.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],f=[],m=1,p=null,y=3,v=!1,S=!1,N=!1,C=!1,j=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function A(P){for(var U=n(f);U!==null;){if(U.callback===null)r(f);else if(U.startTime<=P)r(f),U.sortIndex=U.expirationTime,t(h,U);else break;U=n(f)}}function _(P){if(N=!1,A(P),!S)if(n(h)!==null)S=!0,O||(O=!0,V());else{var U=n(f);U!==null&&H(_,U.startTime-P)}}var O=!1,T=-1,D=5,B=-1;function W(){return C?!0:!(e.unstable_now()-B<D)}function M(){if(C=!1,O){var P=e.unstable_now();B=P;var U=!0;try{e:{S=!1,N&&(N=!1,E(T),T=-1),v=!0;var z=y;try{t:{for(A(P),p=n(h);p!==null&&!(p.expirationTime>P&&W());){var te=p.callback;if(typeof te=="function"){p.callback=null,y=p.priorityLevel;var oe=te(p.expirationTime<=P);if(P=e.unstable_now(),typeof oe=="function"){p.callback=oe,A(P),U=!0;break t}p===n(h)&&r(h),A(P)}else r(h);p=n(h)}if(p!==null)U=!0;else{var L=n(f);L!==null&&H(_,L.startTime-P),U=!1}}break e}finally{p=null,y=z,v=!1}U=void 0}}finally{U?V():O=!1}}}var V;if(typeof R=="function")V=function(){R(M)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,F=G.port2;G.port1.onmessage=M,V=function(){F.postMessage(null)}}else V=function(){j(M,0)};function H(P,U){T=j(function(){P(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(P){switch(y){case 1:case 2:case 3:var U=3;break;default:U=y}var z=y;y=U;try{return P()}finally{y=z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(P,U){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var z=y;y=P;try{return U()}finally{y=z}},e.unstable_scheduleCallback=function(P,U,z){var te=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?te+z:te):z=te,P){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=z+oe,P={id:m++,callback:U,priorityLevel:P,startTime:z,expirationTime:oe,sortIndex:-1},z>te?(P.sortIndex=z,t(f,P),n(h)===null&&P===n(f)&&(N?(E(T),T=-1):N=!0,H(_,z-te))):(P.sortIndex=oe,t(h,P),S||v||(S=!0,O||(O=!0,V()))),P},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(P){var U=y;return function(){var z=y;y=U;try{return P.apply(this,arguments)}finally{y=z}}}})(uy)),uy}var vC;function lI(){return vC||(vC=1,cy.exports=oI()),cy.exports}var dy={exports:{}},zn={};var bC;function cI(){if(bC)return zn;bC=1;var e=Vd();function t(h){var f="https://react.dev/errors/"+h;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+h+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(h,f,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:p==null?null:""+p,children:h,containerInfo:f,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,f){if(h==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return zn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,zn.createPortal=function(h,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return o(h,f,null,m)},zn.flushSync=function(h){var f=c.T,m=r.p;try{if(c.T=null,r.p=2,h)return h()}finally{c.T=f,r.p=m,r.d.f()}},zn.preconnect=function(h,f){typeof h=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(h,f))},zn.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},zn.preinit=function(h,f){if(typeof h=="string"&&f&&typeof f.as=="string"){var m=f.as,p=d(m,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(h,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:y,fetchPriority:v}):m==="script"&&r.d.X(h,{crossOrigin:p,integrity:y,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},zn.preinitModule=function(h,f){if(typeof h=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=d(f.as,f.crossOrigin);r.d.M(h,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(h)},zn.preload=function(h,f){if(typeof h=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,p=d(m,f.crossOrigin);r.d.L(h,m,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},zn.preloadModule=function(h,f){if(typeof h=="string")if(f){var m=d(f.as,f.crossOrigin);r.d.m(h,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(h)},zn.requestFormReset=function(h){r.d.r(h)},zn.unstable_batchedUpdates=function(h,f){return h(f)},zn.useFormState=function(h,f,m){return c.H.useFormState(h,f,m)},zn.useFormStatus=function(){return c.H.useHostTransitionStatus()},zn.version="19.2.3",zn}var wC;function SR(){if(wC)return dy.exports;wC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),dy.exports=cI(),dy.exports}var SC;function uI(){if(SC)return Ru;SC=1;var e=lI(),t=Vd(),n=SR();function r(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var i=s,u=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(u=i.return),s=i.return;while(s)}return i.tag===3?u:null}function c(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function d(s){if(s.tag===31){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function h(s){if(o(s)!==s)throw Error(r(188))}function f(s){var i=s.alternate;if(!i){if(i=o(s),i===null)throw Error(r(188));return i!==s?null:s}for(var u=s,g=i;;){var b=u.return;if(b===null)break;var w=b.alternate;if(w===null){if(g=b.return,g!==null){u=g;continue}break}if(b.child===w.child){for(w=b.child;w;){if(w===u)return h(b),s;if(w===g)return h(b),i;w=w.sibling}throw Error(r(188))}if(u.return!==g.return)u=b,g=w;else{for(var k=!1,I=b.child;I;){if(I===u){k=!0,u=b,g=w;break}if(I===g){k=!0,g=b,u=w;break}I=I.sibling}if(!k){for(I=w.child;I;){if(I===u){k=!0,u=w,g=b;break}if(I===g){k=!0,g=w,u=b;break}I=I.sibling}if(!k)throw Error(r(189))}}if(u.alternate!==g)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?s:i}function m(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(i=m(s),i!==null)return i;s=s.sibling}return null}var p=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),M=Symbol.iterator;function V(s){return s===null||typeof s!="object"?null:(s=M&&s[M]||s["@@iterator"],typeof s=="function"?s:null)}var G=Symbol.for("react.client.reference");function F(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===G?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case N:return"Fragment";case j:return"Profiler";case C:return"StrictMode";case _:return"Suspense";case O:return"SuspenseList";case B:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case S:return"Portal";case R:return s.displayName||"Context";case E:return(s._context.displayName||"Context")+".Consumer";case A:var i=s.render;return s=s.displayName,s||(s=i.displayName||i.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case T:return i=s.displayName||null,i!==null?i:F(s.type)||"Memo";case D:i=s._payload,s=s._init;try{return F(s(i))}catch{}}return null}var H=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},te=[],oe=-1;function L(s){return{current:s}}function $(s){0>oe||(s.current=te[oe],te[oe]=null,oe--)}function X(s,i){oe++,te[oe]=s.current,s.current=i}var Q=L(null),q=L(null),ce=L(null),ne=L(null);function xe(s,i){switch(X(ce,i),X(q,s),X(Q,null),i.nodeType){case 9:case 11:s=(s=i.documentElement)&&(s=s.namespaceURI)?Ij(s):0;break;default:if(s=i.tagName,i=i.namespaceURI)i=Ij(i),s=Bj(i,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}$(Q),X(Q,s)}function be(){$(Q),$(q),$(ce)}function De(s){s.memoizedState!==null&&X(ne,s);var i=Q.current,u=Bj(i,s.type);i!==u&&(X(q,s),X(Q,u))}function Ke(s){q.current===s&&($(Q),$(q)),ne.current===s&&($(ne),ju._currentValue=z)}var we,_e;function vt(s){if(we===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);we=i&&i[1]||"",_e=-1<u.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+we+s+_e}var en=!1;function Pt(s,i){if(!s||en)return"";en=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(i){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(le){var ie=le}Reflect.construct(s,[],pe)}else{try{pe.call()}catch(le){ie=le}s.call(pe.prototype)}}else{try{throw Error()}catch(le){ie=le}(pe=s())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(le){if(le&&ie&&typeof le.stack=="string")return[le.stack,ie.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=g.DetermineComponentFrameRoot(),k=w[0],I=w[1];if(k&&I){var Y=k.split(`
4
+ `),se=I.split(`
5
+ `);for(b=g=0;g<Y.length&&!Y[g].includes("DetermineComponentFrameRoot");)g++;for(;b<se.length&&!se[b].includes("DetermineComponentFrameRoot");)b++;if(g===Y.length||b===se.length)for(g=Y.length-1,b=se.length-1;1<=g&&0<=b&&Y[g]!==se[b];)b--;for(;1<=g&&0<=b;g--,b--)if(Y[g]!==se[b]){if(g!==1||b!==1)do if(g--,b--,0>b||Y[g]!==se[b]){var de=`
6
+ `+Y[g].replace(" at new "," at ");return s.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",s.displayName)),de}while(1<=g&&0<=b);break}}}finally{en=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?vt(u):""}function vn(s,i){switch(s.tag){case 26:case 27:case 5:return vt(s.type);case 16:return vt("Lazy");case 13:return s.child!==i&&i!==null?vt("Suspense Fallback"):vt("Suspense");case 19:return vt("SuspenseList");case 0:case 15:return Pt(s.type,!1);case 11:return Pt(s.type.render,!1);case 1:return Pt(s.type,!0);case 31:return vt("Activity");default:return""}}function Hs(s){try{var i="",u=null;do i+=vn(s,u),u=s,s=s.return;while(s);return i}catch(g){return`
7
+ Error generating stack: `+g.message+`
8
+ `+g.stack}}var Qe=Object.prototype.hasOwnProperty,qn=e.unstable_scheduleCallback,va=e.unstable_cancelCallback,Bt=e.unstable_shouldYield,Wn=e.unstable_requestPaint,Nt=e.unstable_now,yr=e.unstable_getCurrentPriorityLevel,qr=e.unstable_ImmediatePriority,vr=e.unstable_UserBlockingPriority,mn=e.unstable_NormalPriority,jn=e.unstable_LowPriority,rr=e.unstable_IdlePriority,ba=e.log,sr=e.unstable_setDisableYieldValue,bs=null,At=null;function Cn(s){if(typeof ba=="function"&&sr(s),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(bs,s)}catch{}}var tn=Math.clz32?Math.clz32:Bn,Ka=Math.log,Wr=Math.LN2;function Bn(s){return s>>>=0,s===0?32:31-(Ka(s)/Wr|0)|0}var ar=256,ir=262144,or=4194304;function lr(s){var i=s&42;if(i!==0)return i;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ge(s,i,u){var g=s.pendingLanes;if(g===0)return 0;var b=0,w=s.suspendedLanes,k=s.pingedLanes;s=s.warmLanes;var I=g&134217727;return I!==0?(g=I&~w,g!==0?b=lr(g):(k&=I,k!==0?b=lr(k):u||(u=I&~s,u!==0&&(b=lr(u))))):(I=g&~w,I!==0?b=lr(I):k!==0?b=lr(k):u||(u=g&~s,u!==0&&(b=lr(u)))),b===0?0:i!==0&&i!==b&&(i&w)===0&&(w=b&-b,u=i&-i,w>=u||w===32&&(u&4194048)!==0)?i:b}function Tt(s,i){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&i)===0}function zt(s,i){switch(s){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ut(){var s=or;return or<<=1,(or&62914560)===0&&(or=4194304),s}function fe(s){for(var i=[],u=0;31>u;u++)i.push(s);return i}function Ee(s,i){s.pendingLanes|=i,i!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function et(s,i,u,g,b,w){var k=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var I=s.entanglements,Y=s.expirationTimes,se=s.hiddenUpdates;for(u=k&~u;0<u;){var de=31-tn(u),pe=1<<de;I[de]=0,Y[de]=-1;var ie=se[de];if(ie!==null)for(se[de]=null,de=0;de<ie.length;de++){var le=ie[de];le!==null&&(le.lane&=-536870913)}u&=~pe}g!==0&&En(s,g,0),w!==0&&b===0&&s.tag!==0&&(s.suspendedLanes|=w&~(k&~i))}function En(s,i,u){s.pendingLanes|=i,s.suspendedLanes&=~i;var g=31-tn(i);s.entangledLanes|=i,s.entanglements[g]=s.entanglements[g]|1073741824|u&261930}function K(s,i){var u=s.entangledLanes|=i;for(s=s.entanglements;u;){var g=31-tn(u),b=1<<g;b&i|s[g]&i&&(s[g]|=i),u&=~b}}function Z(s,i){var u=i&-i;return u=(u&42)!==0?1:ae(u),(u&(s.suspendedLanes|i))!==0?0:u}function ae(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function ve(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Se(){var s=U.p;return s!==0?s:(s=window.event,s===void 0?32:oC(s.type))}function ze(s,i){var u=U.p;try{return U.p=s,i()}finally{U.p=u}}var Te=Math.random().toString(36).slice(2),Ce="__reactFiber$"+Te,Re="__reactProps$"+Te,Be="__reactContainer$"+Te,qe="__reactEvents$"+Te,Fe="__reactListeners$"+Te,pt="__reactHandles$"+Te,ut="__reactResources$"+Te,Ht="__reactMarker$"+Te;function Wt(s){delete s[Ce],delete s[Re],delete s[qe],delete s[Fe],delete s[pt]}function Kt(s){var i=s[Ce];if(i)return i;for(var u=s.parentNode;u;){if(i=u[Be]||u[Ce]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(s=Gj(s);s!==null;){if(u=s[Ce])return u;s=Gj(s)}return i}s=u,u=s.parentNode}return null}function dt(s){if(s=s[Ce]||s[Be]){var i=s.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return s}return null}function bn(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s.stateNode;throw Error(r(33))}function cr(s){var i=s[ut];return i||(i=s[ut]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Ft(s){s[Ht]=!0}var ws=new Set,br={};function Ss(s,i){Kr(s,i),Kr(s+"Capture",i)}function Kr(s,i){for(br[s]=i,s=0;s<i.length;s++)ws.add(i[s])}var wa=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ro={},so={};function ft(s){return Qe.call(so,s)?!0:Qe.call(ro,s)?!1:wa.test(s)?so[s]=!0:(ro[s]=!0,!1)}function nn(s,i,u){if(ft(i))if(u===null)s.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(i);return;case"boolean":var g=i.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(i);return}}s.setAttribute(i,""+u)}}function Ns(s,i,u){if(u===null)s.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(i);return}s.setAttribute(i,""+u)}}function Tn(s,i,u,g){if(g===null)s.removeAttribute(u);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(i,u,""+g)}}function ht(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function ao(s){var i=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function hf(s,i,u){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,i);if(!s.hasOwnProperty(i)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var b=g.get,w=g.set;return Object.defineProperty(s,i,{configurable:!0,get:function(){return b.call(this)},set:function(k){u=""+k,w.call(this,k)}}),Object.defineProperty(s,i,{enumerable:g.enumerable}),{getValue:function(){return u},setValue:function(k){u=""+k},stopTracking:function(){s._valueTracker=null,delete s[i]}}}}function Fc(s){if(!s._valueTracker){var i=ao(s)?"checked":"value";s._valueTracker=hf(s,i,""+s[i])}}function D1(s){if(!s)return!1;var i=s._valueTracker;if(!i)return!0;var u=i.getValue(),g="";return s&&(g=ao(s)?s.checked?"true":"false":s.value),s=g,s!==u?(i.setValue(s),!0):!1}function mf(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var J3=/[\n"\\]/g;function Yr(s){return s.replace(J3,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function eg(s,i,u,g,b,w,k,I){s.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?s.type=k:s.removeAttribute("type"),i!=null?k==="number"?(i===0&&s.value===""||s.value!=i)&&(s.value=""+ht(i)):s.value!==""+ht(i)&&(s.value=""+ht(i)):k!=="submit"&&k!=="reset"||s.removeAttribute("value"),i!=null?tg(s,k,ht(i)):u!=null?tg(s,k,ht(u)):g!=null&&s.removeAttribute("value"),b==null&&w!=null&&(s.defaultChecked=!!w),b!=null&&(s.checked=b&&typeof b!="function"&&typeof b!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?s.name=""+ht(I):s.removeAttribute("name")}function k1(s,i,u,g,b,w,k,I){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(s.type=w),i!=null||u!=null){if(!(w!=="submit"&&w!=="reset"||i!=null)){Fc(s);return}u=u!=null?""+ht(u):"",i=i!=null?""+ht(i):u,I||i===s.value||(s.value=i),s.defaultValue=i}g=g??b,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=I?s.checked:!!g,s.defaultChecked=!!g,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.name=k),Fc(s)}function tg(s,i,u){i==="number"&&mf(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function tl(s,i,u,g){if(s=s.options,i){i={};for(var b=0;b<u.length;b++)i["$"+u[b]]=!0;for(u=0;u<s.length;u++)b=i.hasOwnProperty("$"+s[u].value),s[u].selected!==b&&(s[u].selected=b),b&&g&&(s[u].defaultSelected=!0)}else{for(u=""+ht(u),i=null,b=0;b<s.length;b++){if(s[b].value===u){s[b].selected=!0,g&&(s[b].defaultSelected=!0);return}i!==null||s[b].disabled||(i=s[b])}i!==null&&(i.selected=!0)}}function A1(s,i,u){if(i!=null&&(i=""+ht(i),i!==s.value&&(s.value=i),u==null)){s.defaultValue!==i&&(s.defaultValue=i);return}s.defaultValue=u!=null?""+ht(u):""}function O1(s,i,u,g){if(i==null){if(g!=null){if(u!=null)throw Error(r(92));if(H(g)){if(1<g.length)throw Error(r(93));g=g[0]}u=g}u==null&&(u=""),i=u}u=ht(i),s.defaultValue=u,g=s.textContent,g===u&&g!==""&&g!==null&&(s.value=g),Fc(s)}function nl(s,i){if(i){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=i;return}}s.textContent=i}var Z3=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function M1(s,i,u){var g=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?g?s.setProperty(i,""):i==="float"?s.cssFloat="":s[i]="":g?s.setProperty(i,u):typeof u!="number"||u===0||Z3.has(i)?i==="float"?s.cssFloat=u:s[i]=(""+u).trim():s[i]=u+"px"}function P1(s,i,u){if(i!=null&&typeof i!="object")throw Error(r(62));if(s=s.style,u!=null){for(var g in u)!u.hasOwnProperty(g)||i!=null&&i.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var b in i)g=i[b],i.hasOwnProperty(b)&&u[b]!==g&&M1(s,b,g)}else for(var w in i)i.hasOwnProperty(w)&&M1(s,w,i[w])}function ng(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var eL=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),tL=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function pf(s){return tL.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Sa(){}var rg=null;function sg(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var rl=null,sl=null;function L1(s){var i=dt(s);if(i&&(s=i.stateNode)){var u=s[Re]||null;e:switch(s=i.stateNode,i.type){case"input":if(eg(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Yr(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var g=u[i];if(g!==s&&g.form===s.form){var b=g[Re]||null;if(!b)throw Error(r(90));eg(g,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(i=0;i<u.length;i++)g=u[i],g.form===s.form&&D1(g)}break e;case"textarea":A1(s,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&tl(s,!!u.multiple,i,!1)}}}var ag=!1;function I1(s,i,u){if(ag)return s(i,u);ag=!0;try{var g=s(i);return g}finally{if(ag=!1,(rl!==null||sl!==null)&&(nh(),rl&&(i=rl,s=sl,sl=rl=null,L1(i),s)))for(i=0;i<s.length;i++)L1(s[i])}}function $c(s,i){var u=s.stateNode;if(u===null)return null;var g=u[Re]||null;if(g===null)return null;u=g[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(r(231,i,typeof u));return u}var Na=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ig=!1;if(Na)try{var Vc={};Object.defineProperty(Vc,"passive",{get:function(){ig=!0}}),window.addEventListener("test",Vc,Vc),window.removeEventListener("test",Vc,Vc)}catch{ig=!1}var Ya=null,og=null,gf=null;function B1(){if(gf)return gf;var s,i=og,u=i.length,g,b="value"in Ya?Ya.value:Ya.textContent,w=b.length;for(s=0;s<u&&i[s]===b[s];s++);var k=u-s;for(g=1;g<=k&&i[u-g]===b[w-g];g++);return gf=b.slice(s,1<g?1-g:void 0)}function xf(s){var i=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&i===13&&(s=13)):s=i,s===10&&(s=13),32<=s||s===13?s:0}function yf(){return!0}function z1(){return!1}function ur(s){function i(u,g,b,w,k){this._reactName=u,this._targetInst=b,this.type=g,this.nativeEvent=w,this.target=k,this.currentTarget=null;for(var I in s)s.hasOwnProperty(I)&&(u=s[I],this[I]=u?u(w):w[I]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?yf:z1,this.isPropagationStopped=z1,this}return p(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=yf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=yf)},persist:function(){},isPersistent:yf}),i}var io={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vf=ur(io),Uc=p({},io,{view:0,detail:0}),nL=ur(Uc),lg,cg,Hc,bf=p({},Uc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dg,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Hc&&(Hc&&s.type==="mousemove"?(lg=s.screenX-Hc.screenX,cg=s.screenY-Hc.screenY):cg=lg=0,Hc=s),lg)},movementY:function(s){return"movementY"in s?s.movementY:cg}}),F1=ur(bf),rL=p({},bf,{dataTransfer:0}),sL=ur(rL),aL=p({},Uc,{relatedTarget:0}),ug=ur(aL),iL=p({},io,{animationName:0,elapsedTime:0,pseudoElement:0}),oL=ur(iL),lL=p({},io,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),cL=ur(lL),uL=p({},io,{data:0}),$1=ur(uL),dL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fL={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},hL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mL(s){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(s):(s=hL[s])?!!i[s]:!1}function dg(){return mL}var pL=p({},Uc,{key:function(s){if(s.key){var i=dL[s.key]||s.key;if(i!=="Unidentified")return i}return s.type==="keypress"?(s=xf(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?fL[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dg,charCode:function(s){return s.type==="keypress"?xf(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?xf(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),gL=ur(pL),xL=p({},bf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),V1=ur(xL),yL=p({},Uc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dg}),vL=ur(yL),bL=p({},io,{propertyName:0,elapsedTime:0,pseudoElement:0}),wL=ur(bL),SL=p({},bf,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),NL=ur(SL),jL=p({},io,{newState:0,oldState:0}),CL=ur(jL),EL=[9,13,27,32],fg=Na&&"CompositionEvent"in window,Gc=null;Na&&"documentMode"in document&&(Gc=document.documentMode);var TL=Na&&"TextEvent"in window&&!Gc,U1=Na&&(!fg||Gc&&8<Gc&&11>=Gc),H1=" ",G1=!1;function q1(s,i){switch(s){case"keyup":return EL.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function W1(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var al=!1;function _L(s,i){switch(s){case"compositionend":return W1(i);case"keypress":return i.which!==32?null:(G1=!0,H1);case"textInput":return s=i.data,s===H1&&G1?null:s;default:return null}}function RL(s,i){if(al)return s==="compositionend"||!fg&&q1(s,i)?(s=B1(),gf=og=Ya=null,al=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return U1&&i.locale!=="ko"?null:i.data;default:return null}}var DL={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function K1(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i==="input"?!!DL[s.type]:i==="textarea"}function Y1(s,i,u,g){rl?sl?sl.push(g):sl=[g]:rl=g,i=ch(i,"onChange"),0<i.length&&(u=new vf("onChange","change",null,u,g),s.push({event:u,listeners:i}))}var qc=null,Wc=null;function kL(s){kj(s,0)}function wf(s){var i=bn(s);if(D1(i))return s}function X1(s,i){if(s==="change")return i}var Q1=!1;if(Na){var hg;if(Na){var mg="oninput"in document;if(!mg){var J1=document.createElement("div");J1.setAttribute("oninput","return;"),mg=typeof J1.oninput=="function"}hg=mg}else hg=!1;Q1=hg&&(!document.documentMode||9<document.documentMode)}function Z1(){qc&&(qc.detachEvent("onpropertychange",eS),Wc=qc=null)}function eS(s){if(s.propertyName==="value"&&wf(Wc)){var i=[];Y1(i,Wc,s,sg(s)),I1(kL,i)}}function AL(s,i,u){s==="focusin"?(Z1(),qc=i,Wc=u,qc.attachEvent("onpropertychange",eS)):s==="focusout"&&Z1()}function OL(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return wf(Wc)}function ML(s,i){if(s==="click")return wf(i)}function PL(s,i){if(s==="input"||s==="change")return wf(i)}function LL(s,i){return s===i&&(s!==0||1/s===1/i)||s!==s&&i!==i}var wr=typeof Object.is=="function"?Object.is:LL;function Kc(s,i){if(wr(s,i))return!0;if(typeof s!="object"||s===null||typeof i!="object"||i===null)return!1;var u=Object.keys(s),g=Object.keys(i);if(u.length!==g.length)return!1;for(g=0;g<u.length;g++){var b=u[g];if(!Qe.call(i,b)||!wr(s[b],i[b]))return!1}return!0}function tS(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function nS(s,i){var u=tS(s);s=0;for(var g;u;){if(u.nodeType===3){if(g=s+u.textContent.length,s<=i&&g>=i)return{node:u,offset:i-s};s=g}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=tS(u)}}function rS(s,i){return s&&i?s===i?!0:s&&s.nodeType===3?!1:i&&i.nodeType===3?rS(s,i.parentNode):"contains"in s?s.contains(i):s.compareDocumentPosition?!!(s.compareDocumentPosition(i)&16):!1:!1}function sS(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var i=mf(s.document);i instanceof s.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)s=i.contentWindow;else break;i=mf(s.document)}return i}function pg(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i&&(i==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||i==="textarea"||s.contentEditable==="true")}var IL=Na&&"documentMode"in document&&11>=document.documentMode,il=null,gg=null,Yc=null,xg=!1;function aS(s,i,u){var g=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;xg||il==null||il!==mf(g)||(g=il,"selectionStart"in g&&pg(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Yc&&Kc(Yc,g)||(Yc=g,g=ch(gg,"onSelect"),0<g.length&&(i=new vf("onSelect","select",null,i,u),s.push({event:i,listeners:g}),i.target=il)))}function oo(s,i){var u={};return u[s.toLowerCase()]=i.toLowerCase(),u["Webkit"+s]="webkit"+i,u["Moz"+s]="moz"+i,u}var ol={animationend:oo("Animation","AnimationEnd"),animationiteration:oo("Animation","AnimationIteration"),animationstart:oo("Animation","AnimationStart"),transitionrun:oo("Transition","TransitionRun"),transitionstart:oo("Transition","TransitionStart"),transitioncancel:oo("Transition","TransitionCancel"),transitionend:oo("Transition","TransitionEnd")},yg={},iS={};Na&&(iS=document.createElement("div").style,"AnimationEvent"in window||(delete ol.animationend.animation,delete ol.animationiteration.animation,delete ol.animationstart.animation),"TransitionEvent"in window||delete ol.transitionend.transition);function lo(s){if(yg[s])return yg[s];if(!ol[s])return s;var i=ol[s],u;for(u in i)if(i.hasOwnProperty(u)&&u in iS)return yg[s]=i[u];return s}var oS=lo("animationend"),lS=lo("animationiteration"),cS=lo("animationstart"),BL=lo("transitionrun"),zL=lo("transitionstart"),FL=lo("transitioncancel"),uS=lo("transitionend"),dS=new Map,vg="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");vg.push("scrollEnd");function js(s,i){dS.set(s,i),Ss(i,[s])}var Sf=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Xr=[],ll=0,bg=0;function Nf(){for(var s=ll,i=bg=ll=0;i<s;){var u=Xr[i];Xr[i++]=null;var g=Xr[i];Xr[i++]=null;var b=Xr[i];Xr[i++]=null;var w=Xr[i];if(Xr[i++]=null,g!==null&&b!==null){var k=g.pending;k===null?b.next=b:(b.next=k.next,k.next=b),g.pending=b}w!==0&&fS(u,b,w)}}function jf(s,i,u,g){Xr[ll++]=s,Xr[ll++]=i,Xr[ll++]=u,Xr[ll++]=g,bg|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function wg(s,i,u,g){return jf(s,i,u,g),Cf(s)}function co(s,i){return jf(s,null,null,i),Cf(s)}function fS(s,i,u){s.lanes|=u;var g=s.alternate;g!==null&&(g.lanes|=u);for(var b=!1,w=s.return;w!==null;)w.childLanes|=u,g=w.alternate,g!==null&&(g.childLanes|=u),w.tag===22&&(s=w.stateNode,s===null||s._visibility&1||(b=!0)),s=w,w=w.return;return s.tag===3?(w=s.stateNode,b&&i!==null&&(b=31-tn(u),s=w.hiddenUpdates,g=s[b],g===null?s[b]=[i]:g.push(i),i.lane=u|536870912),w):null}function Cf(s){if(50<xu)throw xu=0,Dx=null,Error(r(185));for(var i=s.return;i!==null;)s=i,i=s.return;return s.tag===3?s.stateNode:null}var cl={};function $L(s,i,u,g){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sr(s,i,u,g){return new $L(s,i,u,g)}function Sg(s){return s=s.prototype,!(!s||!s.isReactComponent)}function ja(s,i){var u=s.alternate;return u===null?(u=Sr(s.tag,i,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=i,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,i=s.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function hS(s,i){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=i,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,i=u.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),s}function Ef(s,i,u,g,b,w){var k=0;if(g=s,typeof s=="function")Sg(s)&&(k=1);else if(typeof s=="string")k=q4(s,u,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case B:return s=Sr(31,u,i,b),s.elementType=B,s.lanes=w,s;case N:return uo(u.children,b,w,i);case C:k=8,b|=24;break;case j:return s=Sr(12,u,i,b|2),s.elementType=j,s.lanes=w,s;case _:return s=Sr(13,u,i,b),s.elementType=_,s.lanes=w,s;case O:return s=Sr(19,u,i,b),s.elementType=O,s.lanes=w,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case R:k=10;break e;case E:k=9;break e;case A:k=11;break e;case T:k=14;break e;case D:k=16,g=null;break e}k=29,u=Error(r(130,s===null?"null":typeof s,"")),g=null}return i=Sr(k,u,i,b),i.elementType=s,i.type=g,i.lanes=w,i}function uo(s,i,u,g){return s=Sr(7,s,g,i),s.lanes=u,s}function Ng(s,i,u){return s=Sr(6,s,null,i),s.lanes=u,s}function mS(s){var i=Sr(18,null,null,0);return i.stateNode=s,i}function jg(s,i,u){return i=Sr(4,s.children!==null?s.children:[],s.key,i),i.lanes=u,i.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},i}var pS=new WeakMap;function Qr(s,i){if(typeof s=="object"&&s!==null){var u=pS.get(s);return u!==void 0?u:(i={value:s,source:i,stack:Hs(i)},pS.set(s,i),i)}return{value:s,source:i,stack:Hs(i)}}var ul=[],dl=0,Tf=null,Xc=0,Jr=[],Zr=0,Xa=null,Gs=1,qs="";function Ca(s,i){ul[dl++]=Xc,ul[dl++]=Tf,Tf=s,Xc=i}function gS(s,i,u){Jr[Zr++]=Gs,Jr[Zr++]=qs,Jr[Zr++]=Xa,Xa=s;var g=Gs;s=qs;var b=32-tn(g)-1;g&=~(1<<b),u+=1;var w=32-tn(i)+b;if(30<w){var k=b-b%5;w=(g&(1<<k)-1).toString(32),g>>=k,b-=k,Gs=1<<32-tn(i)+b|u<<b|g,qs=w+s}else Gs=1<<w|u<<b|g,qs=s}function Cg(s){s.return!==null&&(Ca(s,1),gS(s,1,0))}function Eg(s){for(;s===Tf;)Tf=ul[--dl],ul[dl]=null,Xc=ul[--dl],ul[dl]=null;for(;s===Xa;)Xa=Jr[--Zr],Jr[Zr]=null,qs=Jr[--Zr],Jr[Zr]=null,Gs=Jr[--Zr],Jr[Zr]=null}function xS(s,i){Jr[Zr++]=Gs,Jr[Zr++]=qs,Jr[Zr++]=Xa,Gs=i.id,qs=i.overflow,Xa=s}var _n=null,Lt=null,mt=!1,Qa=null,es=!1,Tg=Error(r(519));function Ja(s){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qc(Qr(i,s)),Tg}function yS(s){var i=s.stateNode,u=s.type,g=s.memoizedProps;switch(i[Ce]=s,i[Re]=g,u){case"dialog":at("cancel",i),at("close",i);break;case"iframe":case"object":case"embed":at("load",i);break;case"video":case"audio":for(u=0;u<vu.length;u++)at(vu[u],i);break;case"source":at("error",i);break;case"img":case"image":case"link":at("error",i),at("load",i);break;case"details":at("toggle",i);break;case"input":at("invalid",i),k1(i,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":at("invalid",i);break;case"textarea":at("invalid",i),O1(i,g.value,g.defaultValue,g.children)}u=g.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||g.suppressHydrationWarning===!0||Pj(i.textContent,u)?(g.popover!=null&&(at("beforetoggle",i),at("toggle",i)),g.onScroll!=null&&at("scroll",i),g.onScrollEnd!=null&&at("scrollend",i),g.onClick!=null&&(i.onclick=Sa),i=!0):i=!1,i||Ja(s,!0)}function vS(s){for(_n=s.return;_n;)switch(_n.tag){case 5:case 31:case 13:es=!1;return;case 27:case 3:es=!0;return;default:_n=_n.return}}function fl(s){if(s!==_n)return!1;if(!mt)return vS(s),mt=!0,!1;var i=s.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||Gx(s.type,s.memoizedProps)),u=!u),u&&Lt&&Ja(s),vS(s),i===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Lt=Hj(s)}else if(i===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Lt=Hj(s)}else i===27?(i=Lt,fi(s.type)?(s=Xx,Xx=null,Lt=s):Lt=i):Lt=_n?ns(s.stateNode.nextSibling):null;return!0}function fo(){Lt=_n=null,mt=!1}function _g(){var s=Qa;return s!==null&&(mr===null?mr=s:mr.push.apply(mr,s),Qa=null),s}function Qc(s){Qa===null?Qa=[s]:Qa.push(s)}var Rg=L(null),ho=null,Ea=null;function Za(s,i,u){X(Rg,i._currentValue),i._currentValue=u}function Ta(s){s._currentValue=Rg.current,$(Rg)}function Dg(s,i,u){for(;s!==null;){var g=s.alternate;if((s.childLanes&i)!==i?(s.childLanes|=i,g!==null&&(g.childLanes|=i)):g!==null&&(g.childLanes&i)!==i&&(g.childLanes|=i),s===u)break;s=s.return}}function kg(s,i,u,g){var b=s.child;for(b!==null&&(b.return=s);b!==null;){var w=b.dependencies;if(w!==null){var k=b.child;w=w.firstContext;e:for(;w!==null;){var I=w;w=b;for(var Y=0;Y<i.length;Y++)if(I.context===i[Y]){w.lanes|=u,I=w.alternate,I!==null&&(I.lanes|=u),Dg(w.return,u,s),g||(k=null);break e}w=I.next}}else if(b.tag===18){if(k=b.return,k===null)throw Error(r(341));k.lanes|=u,w=k.alternate,w!==null&&(w.lanes|=u),Dg(k,u,s),k=null}else k=b.child;if(k!==null)k.return=b;else for(k=b;k!==null;){if(k===s){k=null;break}if(b=k.sibling,b!==null){b.return=k.return,k=b;break}k=k.return}b=k}}function hl(s,i,u,g){s=null;for(var b=i,w=!1;b!==null;){if(!w){if((b.flags&524288)!==0)w=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var k=b.alternate;if(k===null)throw Error(r(387));if(k=k.memoizedProps,k!==null){var I=b.type;wr(b.pendingProps.value,k.value)||(s!==null?s.push(I):s=[I])}}else if(b===ne.current){if(k=b.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(s!==null?s.push(ju):s=[ju])}b=b.return}s!==null&&kg(i,s,u,g),i.flags|=262144}function _f(s){for(s=s.firstContext;s!==null;){if(!wr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function mo(s){ho=s,Ea=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Rn(s){return bS(ho,s)}function Rf(s,i){return ho===null&&mo(s),bS(s,i)}function bS(s,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},Ea===null){if(s===null)throw Error(r(308));Ea=i,s.dependencies={lanes:0,firstContext:i},s.flags|=524288}else Ea=Ea.next=i;return u}var VL=typeof AbortController<"u"?AbortController:function(){var s=[],i=this.signal={aborted:!1,addEventListener:function(u,g){s.push(g)}};this.abort=function(){i.aborted=!0,s.forEach(function(u){return u()})}},UL=e.unstable_scheduleCallback,HL=e.unstable_NormalPriority,an={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ag(){return{controller:new VL,data:new Map,refCount:0}}function Jc(s){s.refCount--,s.refCount===0&&UL(HL,function(){s.controller.abort()})}var Zc=null,Og=0,ml=0,pl=null;function GL(s,i){if(Zc===null){var u=Zc=[];Og=0,ml=Lx(),pl={status:"pending",value:void 0,then:function(g){u.push(g)}}}return Og++,i.then(wS,wS),i}function wS(){if(--Og===0&&Zc!==null){pl!==null&&(pl.status="fulfilled");var s=Zc;Zc=null,ml=0,pl=null;for(var i=0;i<s.length;i++)(0,s[i])()}}function qL(s,i){var u=[],g={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return s.then(function(){g.status="fulfilled",g.value=i;for(var b=0;b<u.length;b++)(0,u[b])(i)},function(b){for(g.status="rejected",g.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),g}var SS=P.S;P.S=function(s,i){aj=Nt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&GL(s,i),SS!==null&&SS(s,i)};var po=L(null);function Mg(){var s=po.current;return s!==null?s:Ot.pooledCache}function Df(s,i){i===null?X(po,po.current):X(po,i.pool)}function NS(){var s=Mg();return s===null?null:{parent:an._currentValue,pool:s}}var gl=Error(r(460)),Pg=Error(r(474)),kf=Error(r(542)),Af={then:function(){}};function jS(s){return s=s.status,s==="fulfilled"||s==="rejected"}function CS(s,i,u){switch(u=s[u],u===void 0?s.push(i):u!==i&&(i.then(Sa,Sa),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,TS(s),s;default:if(typeof i.status=="string")i.then(Sa,Sa);else{if(s=Ot,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=i,s.status="pending",s.then(function(g){if(i.status==="pending"){var b=i;b.status="fulfilled",b.value=g}},function(g){if(i.status==="pending"){var b=i;b.status="rejected",b.reason=g}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,TS(s),s}throw xo=i,gl}}function go(s){try{var i=s._init;return i(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(xo=u,gl):u}}var xo=null;function ES(){if(xo===null)throw Error(r(459));var s=xo;return xo=null,s}function TS(s){if(s===gl||s===kf)throw Error(r(483))}var xl=null,eu=0;function Of(s){var i=eu;return eu+=1,xl===null&&(xl=[]),CS(xl,s,i)}function tu(s,i){i=i.props.ref,s.ref=i!==void 0?i:null}function Mf(s,i){throw i.$$typeof===y?Error(r(525)):(s=Object.prototype.toString.call(i),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":s)))}function _S(s){function i(ee,J){if(s){var re=ee.deletions;re===null?(ee.deletions=[J],ee.flags|=16):re.push(J)}}function u(ee,J){if(!s)return null;for(;J!==null;)i(ee,J),J=J.sibling;return null}function g(ee){for(var J=new Map;ee!==null;)ee.key!==null?J.set(ee.key,ee):J.set(ee.index,ee),ee=ee.sibling;return J}function b(ee,J){return ee=ja(ee,J),ee.index=0,ee.sibling=null,ee}function w(ee,J,re){return ee.index=re,s?(re=ee.alternate,re!==null?(re=re.index,re<J?(ee.flags|=67108866,J):re):(ee.flags|=67108866,J)):(ee.flags|=1048576,J)}function k(ee){return s&&ee.alternate===null&&(ee.flags|=67108866),ee}function I(ee,J,re,he){return J===null||J.tag!==6?(J=Ng(re,ee.mode,he),J.return=ee,J):(J=b(J,re),J.return=ee,J)}function Y(ee,J,re,he){var Ve=re.type;return Ve===N?de(ee,J,re.props.children,he,re.key):J!==null&&(J.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===D&&go(Ve)===J.type)?(J=b(J,re.props),tu(J,re),J.return=ee,J):(J=Ef(re.type,re.key,re.props,null,ee.mode,he),tu(J,re),J.return=ee,J)}function se(ee,J,re,he){return J===null||J.tag!==4||J.stateNode.containerInfo!==re.containerInfo||J.stateNode.implementation!==re.implementation?(J=jg(re,ee.mode,he),J.return=ee,J):(J=b(J,re.children||[]),J.return=ee,J)}function de(ee,J,re,he,Ve){return J===null||J.tag!==7?(J=uo(re,ee.mode,he,Ve),J.return=ee,J):(J=b(J,re),J.return=ee,J)}function pe(ee,J,re){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=Ng(""+J,ee.mode,re),J.return=ee,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case v:return re=Ef(J.type,J.key,J.props,null,ee.mode,re),tu(re,J),re.return=ee,re;case S:return J=jg(J,ee.mode,re),J.return=ee,J;case D:return J=go(J),pe(ee,J,re)}if(H(J)||V(J))return J=uo(J,ee.mode,re,null),J.return=ee,J;if(typeof J.then=="function")return pe(ee,Of(J),re);if(J.$$typeof===R)return pe(ee,Rf(ee,J),re);Mf(ee,J)}return null}function ie(ee,J,re,he){var Ve=J!==null?J.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Ve!==null?null:I(ee,J,""+re,he);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return re.key===Ve?Y(ee,J,re,he):null;case S:return re.key===Ve?se(ee,J,re,he):null;case D:return re=go(re),ie(ee,J,re,he)}if(H(re)||V(re))return Ve!==null?null:de(ee,J,re,he,null);if(typeof re.then=="function")return ie(ee,J,Of(re),he);if(re.$$typeof===R)return ie(ee,J,Rf(ee,re),he);Mf(ee,re)}return null}function le(ee,J,re,he,Ve){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return ee=ee.get(re)||null,I(J,ee,""+he,Ve);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case v:return ee=ee.get(he.key===null?re:he.key)||null,Y(J,ee,he,Ve);case S:return ee=ee.get(he.key===null?re:he.key)||null,se(J,ee,he,Ve);case D:return he=go(he),le(ee,J,re,he,Ve)}if(H(he)||V(he))return ee=ee.get(re)||null,de(J,ee,he,Ve,null);if(typeof he.then=="function")return le(ee,J,re,Of(he),Ve);if(he.$$typeof===R)return le(ee,J,re,Rf(J,he),Ve);Mf(J,he)}return null}function Oe(ee,J,re,he){for(var Ve=null,xt=null,Ie=J,Ze=J=0,lt=null;Ie!==null&&Ze<re.length;Ze++){Ie.index>Ze?(lt=Ie,Ie=null):lt=Ie.sibling;var yt=ie(ee,Ie,re[Ze],he);if(yt===null){Ie===null&&(Ie=lt);break}s&&Ie&&yt.alternate===null&&i(ee,Ie),J=w(yt,J,Ze),xt===null?Ve=yt:xt.sibling=yt,xt=yt,Ie=lt}if(Ze===re.length)return u(ee,Ie),mt&&Ca(ee,Ze),Ve;if(Ie===null){for(;Ze<re.length;Ze++)Ie=pe(ee,re[Ze],he),Ie!==null&&(J=w(Ie,J,Ze),xt===null?Ve=Ie:xt.sibling=Ie,xt=Ie);return mt&&Ca(ee,Ze),Ve}for(Ie=g(Ie);Ze<re.length;Ze++)lt=le(Ie,ee,Ze,re[Ze],he),lt!==null&&(s&&lt.alternate!==null&&Ie.delete(lt.key===null?Ze:lt.key),J=w(lt,J,Ze),xt===null?Ve=lt:xt.sibling=lt,xt=lt);return s&&Ie.forEach(function(xi){return i(ee,xi)}),mt&&Ca(ee,Ze),Ve}function We(ee,J,re,he){if(re==null)throw Error(r(151));for(var Ve=null,xt=null,Ie=J,Ze=J=0,lt=null,yt=re.next();Ie!==null&&!yt.done;Ze++,yt=re.next()){Ie.index>Ze?(lt=Ie,Ie=null):lt=Ie.sibling;var xi=ie(ee,Ie,yt.value,he);if(xi===null){Ie===null&&(Ie=lt);break}s&&Ie&&xi.alternate===null&&i(ee,Ie),J=w(xi,J,Ze),xt===null?Ve=xi:xt.sibling=xi,xt=xi,Ie=lt}if(yt.done)return u(ee,Ie),mt&&Ca(ee,Ze),Ve;if(Ie===null){for(;!yt.done;Ze++,yt=re.next())yt=pe(ee,yt.value,he),yt!==null&&(J=w(yt,J,Ze),xt===null?Ve=yt:xt.sibling=yt,xt=yt);return mt&&Ca(ee,Ze),Ve}for(Ie=g(Ie);!yt.done;Ze++,yt=re.next())yt=le(Ie,ee,Ze,yt.value,he),yt!==null&&(s&&yt.alternate!==null&&Ie.delete(yt.key===null?Ze:yt.key),J=w(yt,J,Ze),xt===null?Ve=yt:xt.sibling=yt,xt=yt);return s&&Ie.forEach(function(rI){return i(ee,rI)}),mt&&Ca(ee,Ze),Ve}function Dt(ee,J,re,he){if(typeof re=="object"&&re!==null&&re.type===N&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case v:e:{for(var Ve=re.key;J!==null;){if(J.key===Ve){if(Ve=re.type,Ve===N){if(J.tag===7){u(ee,J.sibling),he=b(J,re.props.children),he.return=ee,ee=he;break e}}else if(J.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===D&&go(Ve)===J.type){u(ee,J.sibling),he=b(J,re.props),tu(he,re),he.return=ee,ee=he;break e}u(ee,J);break}else i(ee,J);J=J.sibling}re.type===N?(he=uo(re.props.children,ee.mode,he,re.key),he.return=ee,ee=he):(he=Ef(re.type,re.key,re.props,null,ee.mode,he),tu(he,re),he.return=ee,ee=he)}return k(ee);case S:e:{for(Ve=re.key;J!==null;){if(J.key===Ve)if(J.tag===4&&J.stateNode.containerInfo===re.containerInfo&&J.stateNode.implementation===re.implementation){u(ee,J.sibling),he=b(J,re.children||[]),he.return=ee,ee=he;break e}else{u(ee,J);break}else i(ee,J);J=J.sibling}he=jg(re,ee.mode,he),he.return=ee,ee=he}return k(ee);case D:return re=go(re),Dt(ee,J,re,he)}if(H(re))return Oe(ee,J,re,he);if(V(re)){if(Ve=V(re),typeof Ve!="function")throw Error(r(150));return re=Ve.call(re),We(ee,J,re,he)}if(typeof re.then=="function")return Dt(ee,J,Of(re),he);if(re.$$typeof===R)return Dt(ee,J,Rf(ee,re),he);Mf(ee,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,J!==null&&J.tag===6?(u(ee,J.sibling),he=b(J,re),he.return=ee,ee=he):(u(ee,J),he=Ng(re,ee.mode,he),he.return=ee,ee=he),k(ee)):u(ee,J)}return function(ee,J,re,he){try{eu=0;var Ve=Dt(ee,J,re,he);return xl=null,Ve}catch(Ie){if(Ie===gl||Ie===kf)throw Ie;var xt=Sr(29,Ie,null,ee.mode);return xt.lanes=he,xt.return=ee,xt}}}var yo=_S(!0),RS=_S(!1),ei=!1;function Lg(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ig(s,i){s=s.updateQueue,i.updateQueue===s&&(i.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function ti(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ni(s,i,u){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(bt&2)!==0){var b=g.pending;return b===null?i.next=i:(i.next=b.next,b.next=i),g.pending=i,i=Cf(s),fS(s,null,u),i}return jf(s,g,i,u),Cf(s)}function nu(s,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var g=i.lanes;g&=s.pendingLanes,u|=g,i.lanes=u,K(s,u)}}function Bg(s,i){var u=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,u===g)){var b=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var k={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};w===null?b=w=k:w=w.next=k,u=u.next}while(u!==null);w===null?b=w=i:w=w.next=i}else b=w=i;u={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:w,shared:g.shared,callbacks:g.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=i:s.next=i,u.lastBaseUpdate=i}var zg=!1;function ru(){if(zg){var s=pl;if(s!==null)throw s}}function su(s,i,u,g){zg=!1;var b=s.updateQueue;ei=!1;var w=b.firstBaseUpdate,k=b.lastBaseUpdate,I=b.shared.pending;if(I!==null){b.shared.pending=null;var Y=I,se=Y.next;Y.next=null,k===null?w=se:k.next=se,k=Y;var de=s.alternate;de!==null&&(de=de.updateQueue,I=de.lastBaseUpdate,I!==k&&(I===null?de.firstBaseUpdate=se:I.next=se,de.lastBaseUpdate=Y))}if(w!==null){var pe=b.baseState;k=0,de=se=Y=null,I=w;do{var ie=I.lane&-536870913,le=ie!==I.lane;if(le?(ot&ie)===ie:(g&ie)===ie){ie!==0&&ie===ml&&(zg=!0),de!==null&&(de=de.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Oe=s,We=I;ie=i;var Dt=u;switch(We.tag){case 1:if(Oe=We.payload,typeof Oe=="function"){pe=Oe.call(Dt,pe,ie);break e}pe=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=We.payload,ie=typeof Oe=="function"?Oe.call(Dt,pe,ie):Oe,ie==null)break e;pe=p({},pe,ie);break e;case 2:ei=!0}}ie=I.callback,ie!==null&&(s.flags|=64,le&&(s.flags|=8192),le=b.callbacks,le===null?b.callbacks=[ie]:le.push(ie))}else le={lane:ie,tag:I.tag,payload:I.payload,callback:I.callback,next:null},de===null?(se=de=le,Y=pe):de=de.next=le,k|=ie;if(I=I.next,I===null){if(I=b.shared.pending,I===null)break;le=I,I=le.next,le.next=null,b.lastBaseUpdate=le,b.shared.pending=null}}while(!0);de===null&&(Y=pe),b.baseState=Y,b.firstBaseUpdate=se,b.lastBaseUpdate=de,w===null&&(b.shared.lanes=0),oi|=k,s.lanes=k,s.memoizedState=pe}}function DS(s,i){if(typeof s!="function")throw Error(r(191,s));s.call(i)}function kS(s,i){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)DS(u[s],i)}var yl=L(null),Pf=L(0);function AS(s,i){s=La,X(Pf,s),X(yl,i),La=s|i.baseLanes}function Fg(){X(Pf,La),X(yl,yl.current)}function $g(){La=Pf.current,$(yl),$(Pf)}var Nr=L(null),ts=null;function ri(s){var i=s.alternate;X(rn,rn.current&1),X(Nr,s),ts===null&&(i===null||yl.current!==null||i.memoizedState!==null)&&(ts=s)}function Vg(s){X(rn,rn.current),X(Nr,s),ts===null&&(ts=s)}function OS(s){s.tag===22?(X(rn,rn.current),X(Nr,s),ts===null&&(ts=s)):si()}function si(){X(rn,rn.current),X(Nr,Nr.current)}function jr(s){$(Nr),ts===s&&(ts=null),$(rn)}var rn=L(0);function Lf(s){for(var i=s;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Kx(u)||Yx(u)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var _a=0,Je=null,_t=null,on=null,If=!1,vl=!1,vo=!1,Bf=0,au=0,bl=null,WL=0;function Yt(){throw Error(r(321))}function Ug(s,i){if(i===null)return!1;for(var u=0;u<i.length&&u<s.length;u++)if(!wr(s[u],i[u]))return!1;return!0}function Hg(s,i,u,g,b,w){return _a=w,Je=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,P.H=s===null||s.memoizedState===null?gN:ax,vo=!1,w=u(g,b),vo=!1,vl&&(w=PS(i,u,g,b)),MS(s),w}function MS(s){P.H=lu;var i=_t!==null&&_t.next!==null;if(_a=0,on=_t=Je=null,If=!1,au=0,bl=null,i)throw Error(r(300));s===null||ln||(s=s.dependencies,s!==null&&_f(s)&&(ln=!0))}function PS(s,i,u,g){Je=s;var b=0;do{if(vl&&(bl=null),au=0,vl=!1,25<=b)throw Error(r(301));if(b+=1,on=_t=null,s.updateQueue!=null){var w=s.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}P.H=xN,w=i(u,g)}while(vl);return w}function KL(){var s=P.H,i=s.useState()[0];return i=typeof i.then=="function"?iu(i):i,s=s.useState()[0],(_t!==null?_t.memoizedState:null)!==s&&(Je.flags|=1024),i}function Gg(){var s=Bf!==0;return Bf=0,s}function qg(s,i,u){i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~u}function Wg(s){if(If){for(s=s.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}If=!1}_a=0,on=_t=Je=null,vl=!1,au=Bf=0,bl=null}function Kn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Je.memoizedState=on=s:on=on.next=s,on}function sn(){if(_t===null){var s=Je.alternate;s=s!==null?s.memoizedState:null}else s=_t.next;var i=on===null?Je.memoizedState:on.next;if(i!==null)on=i,_t=s;else{if(s===null)throw Je.alternate===null?Error(r(467)):Error(r(310));_t=s,s={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},on===null?Je.memoizedState=on=s:on=on.next=s}return on}function zf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function iu(s){var i=au;return au+=1,bl===null&&(bl=[]),s=CS(bl,s,i),i=Je,(on===null?i.memoizedState:on.next)===null&&(i=i.alternate,P.H=i===null||i.memoizedState===null?gN:ax),s}function Ff(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return iu(s);if(s.$$typeof===R)return Rn(s)}throw Error(r(438,String(s)))}function Kg(s){var i=null,u=Je.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var g=Je.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(i={data:g.data.map(function(b){return b.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=zf(),Je.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(s),g=0;g<s;g++)u[g]=W;return i.index++,u}function Ra(s,i){return typeof i=="function"?i(s):i}function $f(s){var i=sn();return Yg(i,_t,s)}function Yg(s,i,u){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=u;var b=s.baseQueue,w=g.pending;if(w!==null){if(b!==null){var k=b.next;b.next=w.next,w.next=k}i.baseQueue=b=w,g.pending=null}if(w=s.baseState,b===null)s.memoizedState=w;else{i=b.next;var I=k=null,Y=null,se=i,de=!1;do{var pe=se.lane&-536870913;if(pe!==se.lane?(ot&pe)===pe:(_a&pe)===pe){var ie=se.revertLane;if(ie===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),pe===ml&&(de=!0);else if((_a&ie)===ie){se=se.next,ie===ml&&(de=!0);continue}else pe={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Y===null?(I=Y=pe,k=w):Y=Y.next=pe,Je.lanes|=ie,oi|=ie;pe=se.action,vo&&u(w,pe),w=se.hasEagerState?se.eagerState:u(w,pe)}else ie={lane:pe,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Y===null?(I=Y=ie,k=w):Y=Y.next=ie,Je.lanes|=pe,oi|=pe;se=se.next}while(se!==null&&se!==i);if(Y===null?k=w:Y.next=I,!wr(w,s.memoizedState)&&(ln=!0,de&&(u=pl,u!==null)))throw u;s.memoizedState=w,s.baseState=k,s.baseQueue=Y,g.lastRenderedState=w}return b===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function Xg(s){var i=sn(),u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=s;var g=u.dispatch,b=u.pending,w=i.memoizedState;if(b!==null){u.pending=null;var k=b=b.next;do w=s(w,k.action),k=k.next;while(k!==b);wr(w,i.memoizedState)||(ln=!0),i.memoizedState=w,i.baseQueue===null&&(i.baseState=w),u.lastRenderedState=w}return[w,g]}function LS(s,i,u){var g=Je,b=sn(),w=mt;if(w){if(u===void 0)throw Error(r(407));u=u()}else u=i();var k=!wr((_t||b).memoizedState,u);if(k&&(b.memoizedState=u,ln=!0),b=b.queue,Zg(zS.bind(null,g,b,s),[s]),b.getSnapshot!==i||k||on!==null&&on.memoizedState.tag&1){if(g.flags|=2048,wl(9,{destroy:void 0},BS.bind(null,g,b,u,i),null),Ot===null)throw Error(r(349));w||(_a&127)!==0||IS(g,i,u)}return u}function IS(s,i,u){s.flags|=16384,s={getSnapshot:i,value:u},i=Je.updateQueue,i===null?(i=zf(),Je.updateQueue=i,i.stores=[s]):(u=i.stores,u===null?i.stores=[s]:u.push(s))}function BS(s,i,u,g){i.value=u,i.getSnapshot=g,FS(i)&&$S(s)}function zS(s,i,u){return u(function(){FS(i)&&$S(s)})}function FS(s){var i=s.getSnapshot;s=s.value;try{var u=i();return!wr(s,u)}catch{return!0}}function $S(s){var i=co(s,2);i!==null&&pr(i,s,2)}function Qg(s){var i=Kn();if(typeof s=="function"){var u=s;if(s=u(),vo){Cn(!0);try{u()}finally{Cn(!1)}}}return i.memoizedState=i.baseState=s,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:s},i}function VS(s,i,u,g){return s.baseState=u,Yg(s,_t,typeof g=="function"?g:Ra)}function YL(s,i,u,g,b){if(Hf(s))throw Error(r(485));if(s=i.action,s!==null){var w={payload:b,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){w.listeners.push(k)}};P.T!==null?u(!0):w.isTransition=!1,g(w),u=i.pending,u===null?(w.next=i.pending=w,US(i,w)):(w.next=u.next,i.pending=u.next=w)}}function US(s,i){var u=i.action,g=i.payload,b=s.state;if(i.isTransition){var w=P.T,k={};P.T=k;try{var I=u(b,g),Y=P.S;Y!==null&&Y(k,I),HS(s,i,I)}catch(se){Jg(s,i,se)}finally{w!==null&&k.types!==null&&(w.types=k.types),P.T=w}}else try{w=u(b,g),HS(s,i,w)}catch(se){Jg(s,i,se)}}function HS(s,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(g){GS(s,i,g)},function(g){return Jg(s,i,g)}):GS(s,i,u)}function GS(s,i,u){i.status="fulfilled",i.value=u,qS(i),s.state=u,i=s.pending,i!==null&&(u=i.next,u===i?s.pending=null:(u=u.next,i.next=u,US(s,u)))}function Jg(s,i,u){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do i.status="rejected",i.reason=u,qS(i),i=i.next;while(i!==g)}s.action=null}function qS(s){s=s.listeners;for(var i=0;i<s.length;i++)(0,s[i])()}function WS(s,i){return i}function KS(s,i){if(mt){var u=Ot.formState;if(u!==null){e:{var g=Je;if(mt){if(Lt){t:{for(var b=Lt,w=es;b.nodeType!==8;){if(!w){b=null;break t}if(b=ns(b.nextSibling),b===null){b=null;break t}}w=b.data,b=w==="F!"||w==="F"?b:null}if(b){Lt=ns(b.nextSibling),g=b.data==="F!";break e}}Ja(g)}g=!1}g&&(i=u[0])}}return u=Kn(),u.memoizedState=u.baseState=i,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:WS,lastRenderedState:i},u.queue=g,u=hN.bind(null,Je,g),g.dispatch=u,g=Qg(!1),w=sx.bind(null,Je,!1,g.queue),g=Kn(),b={state:i,dispatch:null,action:s,pending:null},g.queue=b,u=YL.bind(null,Je,b,w,u),b.dispatch=u,g.memoizedState=s,[i,u,!1]}function YS(s){var i=sn();return XS(i,_t,s)}function XS(s,i,u){if(i=Yg(s,i,WS)[0],s=$f(Ra)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var g=iu(i)}catch(k){throw k===gl?kf:k}else g=i;i=sn();var b=i.queue,w=b.dispatch;return u!==i.memoizedState&&(Je.flags|=2048,wl(9,{destroy:void 0},XL.bind(null,b,u),null)),[g,w,s]}function XL(s,i){s.action=i}function QS(s){var i=sn(),u=_t;if(u!==null)return XS(i,u,s);sn(),i=i.memoizedState,u=sn();var g=u.queue.dispatch;return u.memoizedState=s,[i,g,!1]}function wl(s,i,u,g){return s={tag:s,create:u,deps:g,inst:i,next:null},i=Je.updateQueue,i===null&&(i=zf(),Je.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=s.next=s:(g=u.next,u.next=s,s.next=g,i.lastEffect=s),s}function JS(){return sn().memoizedState}function Vf(s,i,u,g){var b=Kn();Je.flags|=s,b.memoizedState=wl(1|i,{destroy:void 0},u,g===void 0?null:g)}function Uf(s,i,u,g){var b=sn();g=g===void 0?null:g;var w=b.memoizedState.inst;_t!==null&&g!==null&&Ug(g,_t.memoizedState.deps)?b.memoizedState=wl(i,w,u,g):(Je.flags|=s,b.memoizedState=wl(1|i,w,u,g))}function ZS(s,i){Vf(8390656,8,s,i)}function Zg(s,i){Uf(2048,8,s,i)}function QL(s){Je.flags|=4;var i=Je.updateQueue;if(i===null)i=zf(),Je.updateQueue=i,i.events=[s];else{var u=i.events;u===null?i.events=[s]:u.push(s)}}function eN(s){var i=sn().memoizedState;return QL({ref:i,nextImpl:s}),function(){if((bt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function tN(s,i){return Uf(4,2,s,i)}function nN(s,i){return Uf(4,4,s,i)}function rN(s,i){if(typeof i=="function"){s=s();var u=i(s);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return s=s(),i.current=s,function(){i.current=null}}function sN(s,i,u){u=u!=null?u.concat([s]):null,Uf(4,4,rN.bind(null,i,s),u)}function ex(){}function aN(s,i){var u=sn();i=i===void 0?null:i;var g=u.memoizedState;return i!==null&&Ug(i,g[1])?g[0]:(u.memoizedState=[s,i],s)}function iN(s,i){var u=sn();i=i===void 0?null:i;var g=u.memoizedState;if(i!==null&&Ug(i,g[1]))return g[0];if(g=s(),vo){Cn(!0);try{s()}finally{Cn(!1)}}return u.memoizedState=[g,i],g}function tx(s,i,u){return u===void 0||(_a&1073741824)!==0&&(ot&261930)===0?s.memoizedState=i:(s.memoizedState=u,s=oj(),Je.lanes|=s,oi|=s,u)}function oN(s,i,u,g){return wr(u,i)?u:yl.current!==null?(s=tx(s,u,g),wr(s,i)||(ln=!0),s):(_a&42)===0||(_a&1073741824)!==0&&(ot&261930)===0?(ln=!0,s.memoizedState=u):(s=oj(),Je.lanes|=s,oi|=s,i)}function lN(s,i,u,g,b){var w=U.p;U.p=w!==0&&8>w?w:8;var k=P.T,I={};P.T=I,sx(s,!1,i,u);try{var Y=b(),se=P.S;if(se!==null&&se(I,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var de=qL(Y,g);ou(s,i,de,Tr(s))}else ou(s,i,g,Tr(s))}catch(pe){ou(s,i,{then:function(){},status:"rejected",reason:pe},Tr())}finally{U.p=w,k!==null&&I.types!==null&&(k.types=I.types),P.T=k}}function JL(){}function nx(s,i,u,g){if(s.tag!==5)throw Error(r(476));var b=cN(s).queue;lN(s,b,i,z,u===null?JL:function(){return uN(s),u(g)})}function cN(s){var i=s.memoizedState;if(i!==null)return i;i={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:z},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:u},next:null},s.memoizedState=i,s=s.alternate,s!==null&&(s.memoizedState=i),i}function uN(s){var i=cN(s);i.next===null&&(i=s.alternate.memoizedState),ou(s,i.next.queue,{},Tr())}function rx(){return Rn(ju)}function dN(){return sn().memoizedState}function fN(){return sn().memoizedState}function ZL(s){for(var i=s.return;i!==null;){switch(i.tag){case 24:case 3:var u=Tr();s=ti(u);var g=ni(i,s,u);g!==null&&(pr(g,i,u),nu(g,i,u)),i={cache:Ag()},s.payload=i;return}i=i.return}}function e4(s,i,u){var g=Tr();u={lane:g,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Hf(s)?mN(i,u):(u=wg(s,i,u,g),u!==null&&(pr(u,s,g),pN(u,i,g)))}function hN(s,i,u){var g=Tr();ou(s,i,u,g)}function ou(s,i,u,g){var b={lane:g,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Hf(s))mN(i,b);else{var w=s.alternate;if(s.lanes===0&&(w===null||w.lanes===0)&&(w=i.lastRenderedReducer,w!==null))try{var k=i.lastRenderedState,I=w(k,u);if(b.hasEagerState=!0,b.eagerState=I,wr(I,k))return jf(s,i,b,0),Ot===null&&Nf(),!1}catch{}if(u=wg(s,i,b,g),u!==null)return pr(u,s,g),pN(u,i,g),!0}return!1}function sx(s,i,u,g){if(g={lane:2,revertLane:Lx(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Hf(s)){if(i)throw Error(r(479))}else i=wg(s,u,g,2),i!==null&&pr(i,s,2)}function Hf(s){var i=s.alternate;return s===Je||i!==null&&i===Je}function mN(s,i){vl=If=!0;var u=s.pending;u===null?i.next=i:(i.next=u.next,u.next=i),s.pending=i}function pN(s,i,u){if((u&4194048)!==0){var g=i.lanes;g&=s.pendingLanes,u|=g,i.lanes=u,K(s,u)}}var lu={readContext:Rn,use:Ff,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useLayoutEffect:Yt,useInsertionEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useSyncExternalStore:Yt,useId:Yt,useHostTransitionStatus:Yt,useFormState:Yt,useActionState:Yt,useOptimistic:Yt,useMemoCache:Yt,useCacheRefresh:Yt};lu.useEffectEvent=Yt;var gN={readContext:Rn,use:Ff,useCallback:function(s,i){return Kn().memoizedState=[s,i===void 0?null:i],s},useContext:Rn,useEffect:ZS,useImperativeHandle:function(s,i,u){u=u!=null?u.concat([s]):null,Vf(4194308,4,rN.bind(null,i,s),u)},useLayoutEffect:function(s,i){return Vf(4194308,4,s,i)},useInsertionEffect:function(s,i){Vf(4,2,s,i)},useMemo:function(s,i){var u=Kn();i=i===void 0?null:i;var g=s();if(vo){Cn(!0);try{s()}finally{Cn(!1)}}return u.memoizedState=[g,i],g},useReducer:function(s,i,u){var g=Kn();if(u!==void 0){var b=u(i);if(vo){Cn(!0);try{u(i)}finally{Cn(!1)}}}else b=i;return g.memoizedState=g.baseState=b,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:b},g.queue=s,s=s.dispatch=e4.bind(null,Je,s),[g.memoizedState,s]},useRef:function(s){var i=Kn();return s={current:s},i.memoizedState=s},useState:function(s){s=Qg(s);var i=s.queue,u=hN.bind(null,Je,i);return i.dispatch=u,[s.memoizedState,u]},useDebugValue:ex,useDeferredValue:function(s,i){var u=Kn();return tx(u,s,i)},useTransition:function(){var s=Qg(!1);return s=lN.bind(null,Je,s.queue,!0,!1),Kn().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,i,u){var g=Je,b=Kn();if(mt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=i(),Ot===null)throw Error(r(349));(ot&127)!==0||IS(g,i,u)}b.memoizedState=u;var w={value:u,getSnapshot:i};return b.queue=w,ZS(zS.bind(null,g,w,s),[s]),g.flags|=2048,wl(9,{destroy:void 0},BS.bind(null,g,w,u,i),null),u},useId:function(){var s=Kn(),i=Ot.identifierPrefix;if(mt){var u=qs,g=Gs;u=(g&~(1<<32-tn(g)-1)).toString(32)+u,i="_"+i+"R_"+u,u=Bf++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=WL++,i="_"+i+"r_"+u.toString(32)+"_";return s.memoizedState=i},useHostTransitionStatus:rx,useFormState:KS,useActionState:KS,useOptimistic:function(s){var i=Kn();i.memoizedState=i.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=sx.bind(null,Je,!0,u),u.dispatch=i,[s,i]},useMemoCache:Kg,useCacheRefresh:function(){return Kn().memoizedState=ZL.bind(null,Je)},useEffectEvent:function(s){var i=Kn(),u={impl:s};return i.memoizedState=u,function(){if((bt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},ax={readContext:Rn,use:Ff,useCallback:aN,useContext:Rn,useEffect:Zg,useImperativeHandle:sN,useInsertionEffect:tN,useLayoutEffect:nN,useMemo:iN,useReducer:$f,useRef:JS,useState:function(){return $f(Ra)},useDebugValue:ex,useDeferredValue:function(s,i){var u=sn();return oN(u,_t.memoizedState,s,i)},useTransition:function(){var s=$f(Ra)[0],i=sn().memoizedState;return[typeof s=="boolean"?s:iu(s),i]},useSyncExternalStore:LS,useId:dN,useHostTransitionStatus:rx,useFormState:YS,useActionState:YS,useOptimistic:function(s,i){var u=sn();return VS(u,_t,s,i)},useMemoCache:Kg,useCacheRefresh:fN};ax.useEffectEvent=eN;var xN={readContext:Rn,use:Ff,useCallback:aN,useContext:Rn,useEffect:Zg,useImperativeHandle:sN,useInsertionEffect:tN,useLayoutEffect:nN,useMemo:iN,useReducer:Xg,useRef:JS,useState:function(){return Xg(Ra)},useDebugValue:ex,useDeferredValue:function(s,i){var u=sn();return _t===null?tx(u,s,i):oN(u,_t.memoizedState,s,i)},useTransition:function(){var s=Xg(Ra)[0],i=sn().memoizedState;return[typeof s=="boolean"?s:iu(s),i]},useSyncExternalStore:LS,useId:dN,useHostTransitionStatus:rx,useFormState:QS,useActionState:QS,useOptimistic:function(s,i){var u=sn();return _t!==null?VS(u,_t,s,i):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:Kg,useCacheRefresh:fN};xN.useEffectEvent=eN;function ix(s,i,u,g){i=s.memoizedState,u=u(g,i),u=u==null?i:p({},i,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var ox={enqueueSetState:function(s,i,u){s=s._reactInternals;var g=Tr(),b=ti(g);b.payload=i,u!=null&&(b.callback=u),i=ni(s,b,g),i!==null&&(pr(i,s,g),nu(i,s,g))},enqueueReplaceState:function(s,i,u){s=s._reactInternals;var g=Tr(),b=ti(g);b.tag=1,b.payload=i,u!=null&&(b.callback=u),i=ni(s,b,g),i!==null&&(pr(i,s,g),nu(i,s,g))},enqueueForceUpdate:function(s,i){s=s._reactInternals;var u=Tr(),g=ti(u);g.tag=2,i!=null&&(g.callback=i),i=ni(s,g,u),i!==null&&(pr(i,s,u),nu(i,s,u))}};function yN(s,i,u,g,b,w,k){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,w,k):i.prototype&&i.prototype.isPureReactComponent?!Kc(u,g)||!Kc(b,w):!0}function vN(s,i,u,g){s=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,g),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,g),i.state!==s&&ox.enqueueReplaceState(i,i.state,null)}function bo(s,i){var u=i;if("ref"in i){u={};for(var g in i)g!=="ref"&&(u[g]=i[g])}if(s=s.defaultProps){u===i&&(u=p({},u));for(var b in s)u[b]===void 0&&(u[b]=s[b])}return u}function bN(s){Sf(s)}function wN(s){console.error(s)}function SN(s){Sf(s)}function Gf(s,i){try{var u=s.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(g){setTimeout(function(){throw g})}}function NN(s,i,u){try{var g=s.onCaughtError;g(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function lx(s,i,u){return u=ti(u),u.tag=3,u.payload={element:null},u.callback=function(){Gf(s,i)},u}function jN(s){return s=ti(s),s.tag=3,s}function CN(s,i,u,g){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var w=g.value;s.payload=function(){return b(w)},s.callback=function(){NN(i,u,g)}}var k=u.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(s.callback=function(){NN(i,u,g),typeof b!="function"&&(li===null?li=new Set([this]):li.add(this));var I=g.stack;this.componentDidCatch(g.value,{componentStack:I!==null?I:""})})}function t4(s,i,u,g,b){if(u.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(i=u.alternate,i!==null&&hl(i,u,b,!0),u=Nr.current,u!==null){switch(u.tag){case 31:case 13:return ts===null?rh():u.alternate===null&&Xt===0&&(Xt=3),u.flags&=-257,u.flags|=65536,u.lanes=b,g===Af?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([g]):i.add(g),Ox(s,g,b)),!1;case 22:return u.flags|=65536,g===Af?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([g])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([g]):u.add(g)),Ox(s,g,b)),!1}throw Error(r(435,u.tag))}return Ox(s,g,b),rh(),!1}if(mt)return i=Nr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=b,g!==Tg&&(s=Error(r(422),{cause:g}),Qc(Qr(s,u)))):(g!==Tg&&(i=Error(r(423),{cause:g}),Qc(Qr(i,u))),s=s.current.alternate,s.flags|=65536,b&=-b,s.lanes|=b,g=Qr(g,u),b=lx(s.stateNode,g,b),Bg(s,b),Xt!==4&&(Xt=2)),!1;var w=Error(r(520),{cause:g});if(w=Qr(w,u),gu===null?gu=[w]:gu.push(w),Xt!==4&&(Xt=2),i===null)return!0;g=Qr(g,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,s=b&-b,u.lanes|=s,s=lx(u.stateNode,g,s),Bg(u,s),!1;case 1:if(i=u.type,w=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(li===null||!li.has(w))))return u.flags|=65536,b&=-b,u.lanes|=b,b=jN(b),CN(b,s,u,g),Bg(u,b),!1}u=u.return}while(u!==null);return!1}var cx=Error(r(461)),ln=!1;function Dn(s,i,u,g){i.child=s===null?RS(i,null,u,g):yo(i,s.child,u,g)}function EN(s,i,u,g,b){u=u.render;var w=i.ref;if("ref"in g){var k={};for(var I in g)I!=="ref"&&(k[I]=g[I])}else k=g;return mo(i),g=Hg(s,i,u,k,w,b),I=Gg(),s!==null&&!ln?(qg(s,i,b),Da(s,i,b)):(mt&&I&&Cg(i),i.flags|=1,Dn(s,i,g,b),i.child)}function TN(s,i,u,g,b){if(s===null){var w=u.type;return typeof w=="function"&&!Sg(w)&&w.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=w,_N(s,i,w,g,b)):(s=Ef(u.type,null,g,i,i.mode,b),s.ref=i.ref,s.return=i,i.child=s)}if(w=s.child,!xx(s,b)){var k=w.memoizedProps;if(u=u.compare,u=u!==null?u:Kc,u(k,g)&&s.ref===i.ref)return Da(s,i,b)}return i.flags|=1,s=ja(w,g),s.ref=i.ref,s.return=i,i.child=s}function _N(s,i,u,g,b){if(s!==null){var w=s.memoizedProps;if(Kc(w,g)&&s.ref===i.ref)if(ln=!1,i.pendingProps=g=w,xx(s,b))(s.flags&131072)!==0&&(ln=!0);else return i.lanes=s.lanes,Da(s,i,b)}return ux(s,i,u,g,b)}function RN(s,i,u,g){var b=g.children,w=s!==null?s.memoizedState:null;if(s===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((i.flags&128)!==0){if(w=w!==null?w.baseLanes|u:u,s!==null){for(g=i.child=s.child,b=0;g!==null;)b=b|g.lanes|g.childLanes,g=g.sibling;g=b&~w}else g=0,i.child=null;return DN(s,i,w,u,g)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},s!==null&&Df(i,w!==null?w.cachePool:null),w!==null?AS(i,w):Fg(),OS(i);else return g=i.lanes=536870912,DN(s,i,w!==null?w.baseLanes|u:u,u,g)}else w!==null?(Df(i,w.cachePool),AS(i,w),si(),i.memoizedState=null):(s!==null&&Df(i,null),Fg(),si());return Dn(s,i,b,u),i.child}function cu(s,i){return s!==null&&s.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function DN(s,i,u,g,b){var w=Mg();return w=w===null?null:{parent:an._currentValue,pool:w},i.memoizedState={baseLanes:u,cachePool:w},s!==null&&Df(i,null),Fg(),OS(i),s!==null&&hl(s,i,g,!0),i.childLanes=b,null}function qf(s,i){return i=Kf({mode:i.mode,children:i.children},s.mode),i.ref=s.ref,s.child=i,i.return=s,i}function kN(s,i,u){return yo(i,s.child,null,u),s=qf(i,i.pendingProps),s.flags|=2,jr(i),i.memoizedState=null,s}function n4(s,i,u){var g=i.pendingProps,b=(i.flags&128)!==0;if(i.flags&=-129,s===null){if(mt){if(g.mode==="hidden")return s=qf(i,g),i.lanes=536870912,cu(null,s);if(Vg(i),(s=Lt)?(s=Uj(s,es),s=s!==null&&s.data==="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:Xa!==null?{id:Gs,overflow:qs}:null,retryLane:536870912,hydrationErrors:null},u=mS(s),u.return=i,i.child=u,_n=i,Lt=null)):s=null,s===null)throw Ja(i);return i.lanes=536870912,null}return qf(i,g)}var w=s.memoizedState;if(w!==null){var k=w.dehydrated;if(Vg(i),b)if(i.flags&256)i.flags&=-257,i=kN(s,i,u);else if(i.memoizedState!==null)i.child=s.child,i.flags|=128,i=null;else throw Error(r(558));else if(ln||hl(s,i,u,!1),b=(u&s.childLanes)!==0,ln||b){if(g=Ot,g!==null&&(k=Z(g,u),k!==0&&k!==w.retryLane))throw w.retryLane=k,co(s,k),pr(g,s,k),cx;rh(),i=kN(s,i,u)}else s=w.treeContext,Lt=ns(k.nextSibling),_n=i,mt=!0,Qa=null,es=!1,s!==null&&xS(i,s),i=qf(i,g),i.flags|=4096;return i}return s=ja(s.child,{mode:g.mode,children:g.children}),s.ref=i.ref,i.child=s,s.return=i,s}function Wf(s,i){var u=i.ref;if(u===null)s!==null&&s.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(s===null||s.ref!==u)&&(i.flags|=4194816)}}function ux(s,i,u,g,b){return mo(i),u=Hg(s,i,u,g,void 0,b),g=Gg(),s!==null&&!ln?(qg(s,i,b),Da(s,i,b)):(mt&&g&&Cg(i),i.flags|=1,Dn(s,i,u,b),i.child)}function AN(s,i,u,g,b,w){return mo(i),i.updateQueue=null,u=PS(i,g,u,b),MS(s),g=Gg(),s!==null&&!ln?(qg(s,i,w),Da(s,i,w)):(mt&&g&&Cg(i),i.flags|=1,Dn(s,i,u,w),i.child)}function ON(s,i,u,g,b){if(mo(i),i.stateNode===null){var w=cl,k=u.contextType;typeof k=="object"&&k!==null&&(w=Rn(k)),w=new u(g,w),i.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=ox,i.stateNode=w,w._reactInternals=i,w=i.stateNode,w.props=g,w.state=i.memoizedState,w.refs={},Lg(i),k=u.contextType,w.context=typeof k=="object"&&k!==null?Rn(k):cl,w.state=i.memoizedState,k=u.getDerivedStateFromProps,typeof k=="function"&&(ix(i,u,k,g),w.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(k=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),k!==w.state&&ox.enqueueReplaceState(w,w.state,null),su(i,g,w,b),ru(),w.state=i.memoizedState),typeof w.componentDidMount=="function"&&(i.flags|=4194308),g=!0}else if(s===null){w=i.stateNode;var I=i.memoizedProps,Y=bo(u,I);w.props=Y;var se=w.context,de=u.contextType;k=cl,typeof de=="object"&&de!==null&&(k=Rn(de));var pe=u.getDerivedStateFromProps;de=typeof pe=="function"||typeof w.getSnapshotBeforeUpdate=="function",I=i.pendingProps!==I,de||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(I||se!==k)&&vN(i,w,g,k),ei=!1;var ie=i.memoizedState;w.state=ie,su(i,g,w,b),ru(),se=i.memoizedState,I||ie!==se||ei?(typeof pe=="function"&&(ix(i,u,pe,g),se=i.memoizedState),(Y=ei||yN(i,u,Y,g,ie,se,k))?(de||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(i.flags|=4194308)):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=g,i.memoizedState=se),w.props=g,w.state=se,w.context=k,g=Y):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),g=!1)}else{w=i.stateNode,Ig(s,i),k=i.memoizedProps,de=bo(u,k),w.props=de,pe=i.pendingProps,ie=w.context,se=u.contextType,Y=cl,typeof se=="object"&&se!==null&&(Y=Rn(se)),I=u.getDerivedStateFromProps,(se=typeof I=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(k!==pe||ie!==Y)&&vN(i,w,g,Y),ei=!1,ie=i.memoizedState,w.state=ie,su(i,g,w,b),ru();var le=i.memoizedState;k!==pe||ie!==le||ei||s!==null&&s.dependencies!==null&&_f(s.dependencies)?(typeof I=="function"&&(ix(i,u,I,g),le=i.memoizedState),(de=ei||yN(i,u,de,g,ie,le,Y)||s!==null&&s.dependencies!==null&&_f(s.dependencies))?(se||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(g,le,Y),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(g,le,Y)),typeof w.componentDidUpdate=="function"&&(i.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof w.componentDidUpdate!="function"||k===s.memoizedProps&&ie===s.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||k===s.memoizedProps&&ie===s.memoizedState||(i.flags|=1024),i.memoizedProps=g,i.memoizedState=le),w.props=g,w.state=le,w.context=Y,g=de):(typeof w.componentDidUpdate!="function"||k===s.memoizedProps&&ie===s.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||k===s.memoizedProps&&ie===s.memoizedState||(i.flags|=1024),g=!1)}return w=g,Wf(s,i),g=(i.flags&128)!==0,w||g?(w=i.stateNode,u=g&&typeof u.getDerivedStateFromError!="function"?null:w.render(),i.flags|=1,s!==null&&g?(i.child=yo(i,s.child,null,b),i.child=yo(i,null,u,b)):Dn(s,i,u,b),i.memoizedState=w.state,s=i.child):s=Da(s,i,b),s}function MN(s,i,u,g){return fo(),i.flags|=256,Dn(s,i,u,g),i.child}var dx={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fx(s){return{baseLanes:s,cachePool:NS()}}function hx(s,i,u){return s=s!==null?s.childLanes&~u:0,i&&(s|=Er),s}function PN(s,i,u){var g=i.pendingProps,b=!1,w=(i.flags&128)!==0,k;if((k=w)||(k=s!==null&&s.memoizedState===null?!1:(rn.current&2)!==0),k&&(b=!0,i.flags&=-129),k=(i.flags&32)!==0,i.flags&=-33,s===null){if(mt){if(b?ri(i):si(),(s=Lt)?(s=Uj(s,es),s=s!==null&&s.data!=="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:Xa!==null?{id:Gs,overflow:qs}:null,retryLane:536870912,hydrationErrors:null},u=mS(s),u.return=i,i.child=u,_n=i,Lt=null)):s=null,s===null)throw Ja(i);return Yx(s)?i.lanes=32:i.lanes=536870912,null}var I=g.children;return g=g.fallback,b?(si(),b=i.mode,I=Kf({mode:"hidden",children:I},b),g=uo(g,b,u,null),I.return=i,g.return=i,I.sibling=g,i.child=I,g=i.child,g.memoizedState=fx(u),g.childLanes=hx(s,k,u),i.memoizedState=dx,cu(null,g)):(ri(i),mx(i,I))}var Y=s.memoizedState;if(Y!==null&&(I=Y.dehydrated,I!==null)){if(w)i.flags&256?(ri(i),i.flags&=-257,i=px(s,i,u)):i.memoizedState!==null?(si(),i.child=s.child,i.flags|=128,i=null):(si(),I=g.fallback,b=i.mode,g=Kf({mode:"visible",children:g.children},b),I=uo(I,b,u,null),I.flags|=2,g.return=i,I.return=i,g.sibling=I,i.child=g,yo(i,s.child,null,u),g=i.child,g.memoizedState=fx(u),g.childLanes=hx(s,k,u),i.memoizedState=dx,i=cu(null,g));else if(ri(i),Yx(I)){if(k=I.nextSibling&&I.nextSibling.dataset,k)var se=k.dgst;k=se,g=Error(r(419)),g.stack="",g.digest=k,Qc({value:g,source:null,stack:null}),i=px(s,i,u)}else if(ln||hl(s,i,u,!1),k=(u&s.childLanes)!==0,ln||k){if(k=Ot,k!==null&&(g=Z(k,u),g!==0&&g!==Y.retryLane))throw Y.retryLane=g,co(s,g),pr(k,s,g),cx;Kx(I)||rh(),i=px(s,i,u)}else Kx(I)?(i.flags|=192,i.child=s.child,i=null):(s=Y.treeContext,Lt=ns(I.nextSibling),_n=i,mt=!0,Qa=null,es=!1,s!==null&&xS(i,s),i=mx(i,g.children),i.flags|=4096);return i}return b?(si(),I=g.fallback,b=i.mode,Y=s.child,se=Y.sibling,g=ja(Y,{mode:"hidden",children:g.children}),g.subtreeFlags=Y.subtreeFlags&65011712,se!==null?I=ja(se,I):(I=uo(I,b,u,null),I.flags|=2),I.return=i,g.return=i,g.sibling=I,i.child=g,cu(null,g),g=i.child,I=s.child.memoizedState,I===null?I=fx(u):(b=I.cachePool,b!==null?(Y=an._currentValue,b=b.parent!==Y?{parent:Y,pool:Y}:b):b=NS(),I={baseLanes:I.baseLanes|u,cachePool:b}),g.memoizedState=I,g.childLanes=hx(s,k,u),i.memoizedState=dx,cu(s.child,g)):(ri(i),u=s.child,s=u.sibling,u=ja(u,{mode:"visible",children:g.children}),u.return=i,u.sibling=null,s!==null&&(k=i.deletions,k===null?(i.deletions=[s],i.flags|=16):k.push(s)),i.child=u,i.memoizedState=null,u)}function mx(s,i){return i=Kf({mode:"visible",children:i},s.mode),i.return=s,s.child=i}function Kf(s,i){return s=Sr(22,s,null,i),s.lanes=0,s}function px(s,i,u){return yo(i,s.child,null,u),s=mx(i,i.pendingProps.children),s.flags|=2,i.memoizedState=null,s}function LN(s,i,u){s.lanes|=i;var g=s.alternate;g!==null&&(g.lanes|=i),Dg(s.return,i,u)}function gx(s,i,u,g,b,w){var k=s.memoizedState;k===null?s.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:g,tail:u,tailMode:b,treeForkCount:w}:(k.isBackwards=i,k.rendering=null,k.renderingStartTime=0,k.last=g,k.tail=u,k.tailMode=b,k.treeForkCount=w)}function IN(s,i,u){var g=i.pendingProps,b=g.revealOrder,w=g.tail;g=g.children;var k=rn.current,I=(k&2)!==0;if(I?(k=k&1|2,i.flags|=128):k&=1,X(rn,k),Dn(s,i,g,u),g=mt?Xc:0,!I&&s!==null&&(s.flags&128)!==0)e:for(s=i.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&LN(s,u,i);else if(s.tag===19)LN(s,u,i);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(b){case"forwards":for(u=i.child,b=null;u!==null;)s=u.alternate,s!==null&&Lf(s)===null&&(b=u),u=u.sibling;u=b,u===null?(b=i.child,i.child=null):(b=u.sibling,u.sibling=null),gx(i,!1,b,u,w,g);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=i.child,i.child=null;b!==null;){if(s=b.alternate,s!==null&&Lf(s)===null){i.child=b;break}s=b.sibling,b.sibling=u,u=b,b=s}gx(i,!0,u,null,w,g);break;case"together":gx(i,!1,null,null,void 0,g);break;default:i.memoizedState=null}return i.child}function Da(s,i,u){if(s!==null&&(i.dependencies=s.dependencies),oi|=i.lanes,(u&i.childLanes)===0)if(s!==null){if(hl(s,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(s!==null&&i.child!==s.child)throw Error(r(153));if(i.child!==null){for(s=i.child,u=ja(s,s.pendingProps),i.child=u,u.return=i;s.sibling!==null;)s=s.sibling,u=u.sibling=ja(s,s.pendingProps),u.return=i;u.sibling=null}return i.child}function xx(s,i){return(s.lanes&i)!==0?!0:(s=s.dependencies,!!(s!==null&&_f(s)))}function r4(s,i,u){switch(i.tag){case 3:xe(i,i.stateNode.containerInfo),Za(i,an,s.memoizedState.cache),fo();break;case 27:case 5:De(i);break;case 4:xe(i,i.stateNode.containerInfo);break;case 10:Za(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Vg(i),null;break;case 13:var g=i.memoizedState;if(g!==null)return g.dehydrated!==null?(ri(i),i.flags|=128,null):(u&i.child.childLanes)!==0?PN(s,i,u):(ri(i),s=Da(s,i,u),s!==null?s.sibling:null);ri(i);break;case 19:var b=(s.flags&128)!==0;if(g=(u&i.childLanes)!==0,g||(hl(s,i,u,!1),g=(u&i.childLanes)!==0),b){if(g)return IN(s,i,u);i.flags|=128}if(b=i.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),X(rn,rn.current),g)break;return null;case 22:return i.lanes=0,RN(s,i,u,i.pendingProps);case 24:Za(i,an,s.memoizedState.cache)}return Da(s,i,u)}function BN(s,i,u){if(s!==null)if(s.memoizedProps!==i.pendingProps)ln=!0;else{if(!xx(s,u)&&(i.flags&128)===0)return ln=!1,r4(s,i,u);ln=(s.flags&131072)!==0}else ln=!1,mt&&(i.flags&1048576)!==0&&gS(i,Xc,i.index);switch(i.lanes=0,i.tag){case 16:e:{var g=i.pendingProps;if(s=go(i.elementType),i.type=s,typeof s=="function")Sg(s)?(g=bo(s,g),i.tag=1,i=ON(null,i,s,g,u)):(i.tag=0,i=ux(null,i,s,g,u));else{if(s!=null){var b=s.$$typeof;if(b===A){i.tag=11,i=EN(null,i,s,g,u);break e}else if(b===T){i.tag=14,i=TN(null,i,s,g,u);break e}}throw i=F(s)||s,Error(r(306,i,""))}}return i;case 0:return ux(s,i,i.type,i.pendingProps,u);case 1:return g=i.type,b=bo(g,i.pendingProps),ON(s,i,g,b,u);case 3:e:{if(xe(i,i.stateNode.containerInfo),s===null)throw Error(r(387));g=i.pendingProps;var w=i.memoizedState;b=w.element,Ig(s,i),su(i,g,null,u);var k=i.memoizedState;if(g=k.cache,Za(i,an,g),g!==w.cache&&kg(i,[an],u,!0),ru(),g=k.element,w.isDehydrated)if(w={element:g,isDehydrated:!1,cache:k.cache},i.updateQueue.baseState=w,i.memoizedState=w,i.flags&256){i=MN(s,i,g,u);break e}else if(g!==b){b=Qr(Error(r(424)),i),Qc(b),i=MN(s,i,g,u);break e}else for(s=i.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,Lt=ns(s.firstChild),_n=i,mt=!0,Qa=null,es=!0,u=RS(i,null,g,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(fo(),g===b){i=Da(s,i,u);break e}Dn(s,i,g,u)}i=i.child}return i;case 26:return Wf(s,i),s===null?(u=Yj(i.type,null,i.pendingProps,null))?i.memoizedState=u:mt||(u=i.type,s=i.pendingProps,g=uh(ce.current).createElement(u),g[Ce]=i,g[Re]=s,kn(g,u,s),Ft(g),i.stateNode=g):i.memoizedState=Yj(i.type,s.memoizedProps,i.pendingProps,s.memoizedState),null;case 27:return De(i),s===null&&mt&&(g=i.stateNode=qj(i.type,i.pendingProps,ce.current),_n=i,es=!0,b=Lt,fi(i.type)?(Xx=b,Lt=ns(g.firstChild)):Lt=b),Dn(s,i,i.pendingProps.children,u),Wf(s,i),s===null&&(i.flags|=4194304),i.child;case 5:return s===null&&mt&&((b=g=Lt)&&(g=O4(g,i.type,i.pendingProps,es),g!==null?(i.stateNode=g,_n=i,Lt=ns(g.firstChild),es=!1,b=!0):b=!1),b||Ja(i)),De(i),b=i.type,w=i.pendingProps,k=s!==null?s.memoizedProps:null,g=w.children,Gx(b,w)?g=null:k!==null&&Gx(b,k)&&(i.flags|=32),i.memoizedState!==null&&(b=Hg(s,i,KL,null,null,u),ju._currentValue=b),Wf(s,i),Dn(s,i,g,u),i.child;case 6:return s===null&&mt&&((s=u=Lt)&&(u=M4(u,i.pendingProps,es),u!==null?(i.stateNode=u,_n=i,Lt=null,s=!0):s=!1),s||Ja(i)),null;case 13:return PN(s,i,u);case 4:return xe(i,i.stateNode.containerInfo),g=i.pendingProps,s===null?i.child=yo(i,null,g,u):Dn(s,i,g,u),i.child;case 11:return EN(s,i,i.type,i.pendingProps,u);case 7:return Dn(s,i,i.pendingProps,u),i.child;case 8:return Dn(s,i,i.pendingProps.children,u),i.child;case 12:return Dn(s,i,i.pendingProps.children,u),i.child;case 10:return g=i.pendingProps,Za(i,i.type,g.value),Dn(s,i,g.children,u),i.child;case 9:return b=i.type._context,g=i.pendingProps.children,mo(i),b=Rn(b),g=g(b),i.flags|=1,Dn(s,i,g,u),i.child;case 14:return TN(s,i,i.type,i.pendingProps,u);case 15:return _N(s,i,i.type,i.pendingProps,u);case 19:return IN(s,i,u);case 31:return n4(s,i,u);case 22:return RN(s,i,u,i.pendingProps);case 24:return mo(i),g=Rn(an),s===null?(b=Mg(),b===null&&(b=Ot,w=Ag(),b.pooledCache=w,w.refCount++,w!==null&&(b.pooledCacheLanes|=u),b=w),i.memoizedState={parent:g,cache:b},Lg(i),Za(i,an,b)):((s.lanes&u)!==0&&(Ig(s,i),su(i,null,null,u),ru()),b=s.memoizedState,w=i.memoizedState,b.parent!==g?(b={parent:g,cache:g},i.memoizedState=b,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=b),Za(i,an,g)):(g=w.cache,Za(i,an,g),g!==b.cache&&kg(i,[an],u,!0))),Dn(s,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function ka(s){s.flags|=4}function yx(s,i,u,g,b){if((i=(s.mode&32)!==0)&&(i=!1),i){if(s.flags|=16777216,(b&335544128)===b)if(s.stateNode.complete)s.flags|=8192;else if(dj())s.flags|=8192;else throw xo=Af,Pg}else s.flags&=-16777217}function zN(s,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!eC(i))if(dj())s.flags|=8192;else throw xo=Af,Pg}function Yf(s,i){i!==null&&(s.flags|=4),s.flags&16384&&(i=s.tag!==22?Ut():536870912,s.lanes|=i,Cl|=i)}function uu(s,i){if(!mt)switch(s.tailMode){case"hidden":i=s.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?i||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function It(s){var i=s.alternate!==null&&s.alternate.child===s.child,u=0,g=0;if(i)for(var b=s.child;b!==null;)u|=b.lanes|b.childLanes,g|=b.subtreeFlags&65011712,g|=b.flags&65011712,b.return=s,b=b.sibling;else for(b=s.child;b!==null;)u|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=s,b=b.sibling;return s.subtreeFlags|=g,s.childLanes=u,i}function s4(s,i,u){var g=i.pendingProps;switch(Eg(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(i),null;case 1:return It(i),null;case 3:return u=i.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),i.memoizedState.cache!==g&&(i.flags|=2048),Ta(an),be(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(fl(i)?ka(i):s===null||s.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,_g())),It(i),null;case 26:var b=i.type,w=i.memoizedState;return s===null?(ka(i),w!==null?(It(i),zN(i,w)):(It(i),yx(i,b,null,g,u))):w?w!==s.memoizedState?(ka(i),It(i),zN(i,w)):(It(i),i.flags&=-16777217):(s=s.memoizedProps,s!==g&&ka(i),It(i),yx(i,b,s,g,u)),null;case 27:if(Ke(i),u=ce.current,b=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==g&&ka(i);else{if(!g){if(i.stateNode===null)throw Error(r(166));return It(i),null}s=Q.current,fl(i)?yS(i):(s=qj(b,g,u),i.stateNode=s,ka(i))}return It(i),null;case 5:if(Ke(i),b=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==g&&ka(i);else{if(!g){if(i.stateNode===null)throw Error(r(166));return It(i),null}if(w=Q.current,fl(i))yS(i);else{var k=uh(ce.current);switch(w){case 1:w=k.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:w=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":w=k.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":w=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":w=k.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof g.is=="string"?k.createElement("select",{is:g.is}):k.createElement("select"),g.multiple?w.multiple=!0:g.size&&(w.size=g.size);break;default:w=typeof g.is=="string"?k.createElement(b,{is:g.is}):k.createElement(b)}}w[Ce]=i,w[Re]=g;e:for(k=i.child;k!==null;){if(k.tag===5||k.tag===6)w.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===i)break e;for(;k.sibling===null;){if(k.return===null||k.return===i)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}i.stateNode=w;e:switch(kn(w,b,g),b){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&ka(i)}}return It(i),yx(i,i.type,s===null?null:s.memoizedProps,i.pendingProps,u),null;case 6:if(s&&i.stateNode!=null)s.memoizedProps!==g&&ka(i);else{if(typeof g!="string"&&i.stateNode===null)throw Error(r(166));if(s=ce.current,fl(i)){if(s=i.stateNode,u=i.memoizedProps,g=null,b=_n,b!==null)switch(b.tag){case 27:case 5:g=b.memoizedProps}s[Ce]=i,s=!!(s.nodeValue===u||g!==null&&g.suppressHydrationWarning===!0||Pj(s.nodeValue,u)),s||Ja(i,!0)}else s=uh(s).createTextNode(g),s[Ce]=i,i.stateNode=s}return It(i),null;case 31:if(u=i.memoizedState,s===null||s.memoizedState!==null){if(g=fl(i),u!==null){if(s===null){if(!g)throw Error(r(318));if(s=i.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Ce]=i}else fo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;It(i),s=!1}else u=_g(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return i.flags&256?(jr(i),i):(jr(i),null);if((i.flags&128)!==0)throw Error(r(558))}return It(i),null;case 13:if(g=i.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(b=fl(i),g!==null&&g.dehydrated!==null){if(s===null){if(!b)throw Error(r(318));if(b=i.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Ce]=i}else fo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;It(i),b=!1}else b=_g(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=b),b=!0;if(!b)return i.flags&256?(jr(i),i):(jr(i),null)}return jr(i),(i.flags&128)!==0?(i.lanes=u,i):(u=g!==null,s=s!==null&&s.memoizedState!==null,u&&(g=i.child,b=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(b=g.alternate.memoizedState.cachePool.pool),w=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(w=g.memoizedState.cachePool.pool),w!==b&&(g.flags|=2048)),u!==s&&u&&(i.child.flags|=8192),Yf(i,i.updateQueue),It(i),null);case 4:return be(),s===null&&Fx(i.stateNode.containerInfo),It(i),null;case 10:return Ta(i.type),It(i),null;case 19:if($(rn),g=i.memoizedState,g===null)return It(i),null;if(b=(i.flags&128)!==0,w=g.rendering,w===null)if(b)uu(g,!1);else{if(Xt!==0||s!==null&&(s.flags&128)!==0)for(s=i.child;s!==null;){if(w=Lf(s),w!==null){for(i.flags|=128,uu(g,!1),s=w.updateQueue,i.updateQueue=s,Yf(i,s),i.subtreeFlags=0,s=u,u=i.child;u!==null;)hS(u,s),u=u.sibling;return X(rn,rn.current&1|2),mt&&Ca(i,g.treeForkCount),i.child}s=s.sibling}g.tail!==null&&Nt()>eh&&(i.flags|=128,b=!0,uu(g,!1),i.lanes=4194304)}else{if(!b)if(s=Lf(w),s!==null){if(i.flags|=128,b=!0,s=s.updateQueue,i.updateQueue=s,Yf(i,s),uu(g,!0),g.tail===null&&g.tailMode==="hidden"&&!w.alternate&&!mt)return It(i),null}else 2*Nt()-g.renderingStartTime>eh&&u!==536870912&&(i.flags|=128,b=!0,uu(g,!1),i.lanes=4194304);g.isBackwards?(w.sibling=i.child,i.child=w):(s=g.last,s!==null?s.sibling=w:i.child=w,g.last=w)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=Nt(),s.sibling=null,u=rn.current,X(rn,b?u&1|2:u&1),mt&&Ca(i,g.treeForkCount),s):(It(i),null);case 22:case 23:return jr(i),$g(),g=i.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(i.flags|=8192):g&&(i.flags|=8192),g?(u&536870912)!==0&&(i.flags&128)===0&&(It(i),i.subtreeFlags&6&&(i.flags|=8192)):It(i),u=i.updateQueue,u!==null&&Yf(i,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),g=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(g=i.memoizedState.cachePool.pool),g!==u&&(i.flags|=2048),s!==null&&$(po),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Ta(an),It(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function a4(s,i){switch(Eg(i),i.tag){case 1:return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 3:return Ta(an),be(),s=i.flags,(s&65536)!==0&&(s&128)===0?(i.flags=s&-65537|128,i):null;case 26:case 27:case 5:return Ke(i),null;case 31:if(i.memoizedState!==null){if(jr(i),i.alternate===null)throw Error(r(340));fo()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 13:if(jr(i),s=i.memoizedState,s!==null&&s.dehydrated!==null){if(i.alternate===null)throw Error(r(340));fo()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 19:return $(rn),null;case 4:return be(),null;case 10:return Ta(i.type),null;case 22:case 23:return jr(i),$g(),s!==null&&$(po),s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 24:return Ta(an),null;case 25:return null;default:return null}}function FN(s,i){switch(Eg(i),i.tag){case 3:Ta(an),be();break;case 26:case 27:case 5:Ke(i);break;case 4:be();break;case 31:i.memoizedState!==null&&jr(i);break;case 13:jr(i);break;case 19:$(rn);break;case 10:Ta(i.type);break;case 22:case 23:jr(i),$g(),s!==null&&$(po);break;case 24:Ta(an)}}function du(s,i){try{var u=i.updateQueue,g=u!==null?u.lastEffect:null;if(g!==null){var b=g.next;u=b;do{if((u.tag&s)===s){g=void 0;var w=u.create,k=u.inst;g=w(),k.destroy=g}u=u.next}while(u!==b)}}catch(I){Et(i,i.return,I)}}function ai(s,i,u){try{var g=i.updateQueue,b=g!==null?g.lastEffect:null;if(b!==null){var w=b.next;g=w;do{if((g.tag&s)===s){var k=g.inst,I=k.destroy;if(I!==void 0){k.destroy=void 0,b=i;var Y=u,se=I;try{se()}catch(de){Et(b,Y,de)}}}g=g.next}while(g!==w)}}catch(de){Et(i,i.return,de)}}function $N(s){var i=s.updateQueue;if(i!==null){var u=s.stateNode;try{kS(i,u)}catch(g){Et(s,s.return,g)}}}function VN(s,i,u){u.props=bo(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(g){Et(s,i,g)}}function fu(s,i){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof u=="function"?s.refCleanup=u(g):u.current=g}}catch(b){Et(s,i,b)}}function Ws(s,i){var u=s.ref,g=s.refCleanup;if(u!==null)if(typeof g=="function")try{g()}catch(b){Et(s,i,b)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){Et(s,i,b)}else u.current=null}function UN(s){var i=s.type,u=s.memoizedProps,g=s.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&g.focus();break e;case"img":u.src?g.src=u.src:u.srcSet&&(g.srcset=u.srcSet)}}catch(b){Et(s,s.return,b)}}function vx(s,i,u){try{var g=s.stateNode;T4(g,s.type,u,i),g[Re]=i}catch(b){Et(s,s.return,b)}}function HN(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&fi(s.type)||s.tag===4}function bx(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||HN(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&fi(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function wx(s,i,u){var g=s.tag;if(g===5||g===6)s=s.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(s),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Sa));else if(g!==4&&(g===27&&fi(s.type)&&(u=s.stateNode,i=null),s=s.child,s!==null))for(wx(s,i,u),s=s.sibling;s!==null;)wx(s,i,u),s=s.sibling}function Xf(s,i,u){var g=s.tag;if(g===5||g===6)s=s.stateNode,i?u.insertBefore(s,i):u.appendChild(s);else if(g!==4&&(g===27&&fi(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(Xf(s,i,u),s=s.sibling;s!==null;)Xf(s,i,u),s=s.sibling}function GN(s){var i=s.stateNode,u=s.memoizedProps;try{for(var g=s.type,b=i.attributes;b.length;)i.removeAttributeNode(b[0]);kn(i,g,u),i[Ce]=s,i[Re]=u}catch(w){Et(s,s.return,w)}}var Aa=!1,cn=!1,Sx=!1,qN=typeof WeakSet=="function"?WeakSet:Set,wn=null;function i4(s,i){if(s=s.containerInfo,Ux=xh,s=sS(s),pg(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var g=u.getSelection&&u.getSelection();if(g&&g.rangeCount!==0){u=g.anchorNode;var b=g.anchorOffset,w=g.focusNode;g=g.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var k=0,I=-1,Y=-1,se=0,de=0,pe=s,ie=null;t:for(;;){for(var le;pe!==u||b!==0&&pe.nodeType!==3||(I=k+b),pe!==w||g!==0&&pe.nodeType!==3||(Y=k+g),pe.nodeType===3&&(k+=pe.nodeValue.length),(le=pe.firstChild)!==null;)ie=pe,pe=le;for(;;){if(pe===s)break t;if(ie===u&&++se===b&&(I=k),ie===w&&++de===g&&(Y=k),(le=pe.nextSibling)!==null)break;pe=ie,ie=pe.parentNode}pe=le}u=I===-1||Y===-1?null:{start:I,end:Y}}else u=null}u=u||{start:0,end:0}}else u=null;for(Hx={focusedElem:s,selectionRange:u},xh=!1,wn=i;wn!==null;)if(i=wn,s=i.child,(i.subtreeFlags&1028)!==0&&s!==null)s.return=i,wn=s;else for(;wn!==null;){switch(i=wn,w=i.alternate,s=i.flags,i.tag){case 0:if((s&4)!==0&&(s=i.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)b=s[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&w!==null){s=void 0,u=i,b=w.memoizedProps,w=w.memoizedState,g=u.stateNode;try{var Oe=bo(u.type,b);s=g.getSnapshotBeforeUpdate(Oe,w),g.__reactInternalSnapshotBeforeUpdate=s}catch(We){Et(u,u.return,We)}}break;case 3:if((s&1024)!==0){if(s=i.stateNode.containerInfo,u=s.nodeType,u===9)Wx(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Wx(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=i.sibling,s!==null){s.return=i.return,wn=s;break}wn=i.return}}function WN(s,i,u){var g=u.flags;switch(u.tag){case 0:case 11:case 15:Ma(s,u),g&4&&du(5,u);break;case 1:if(Ma(s,u),g&4)if(s=u.stateNode,i===null)try{s.componentDidMount()}catch(k){Et(u,u.return,k)}else{var b=bo(u.type,i.memoizedProps);i=i.memoizedState;try{s.componentDidUpdate(b,i,s.__reactInternalSnapshotBeforeUpdate)}catch(k){Et(u,u.return,k)}}g&64&&$N(u),g&512&&fu(u,u.return);break;case 3:if(Ma(s,u),g&64&&(s=u.updateQueue,s!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{kS(s,i)}catch(k){Et(u,u.return,k)}}break;case 27:i===null&&g&4&&GN(u);case 26:case 5:Ma(s,u),i===null&&g&4&&UN(u),g&512&&fu(u,u.return);break;case 12:Ma(s,u);break;case 31:Ma(s,u),g&4&&XN(s,u);break;case 13:Ma(s,u),g&4&&QN(s,u),g&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=p4.bind(null,u),P4(s,u))));break;case 22:if(g=u.memoizedState!==null||Aa,!g){i=i!==null&&i.memoizedState!==null||cn,b=Aa;var w=cn;Aa=g,(cn=i)&&!w?Pa(s,u,(u.subtreeFlags&8772)!==0):Ma(s,u),Aa=b,cn=w}break;case 30:break;default:Ma(s,u)}}function KN(s){var i=s.alternate;i!==null&&(s.alternate=null,KN(i)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(i=s.stateNode,i!==null&&Wt(i)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var $t=null,dr=!1;function Oa(s,i,u){for(u=u.child;u!==null;)YN(s,i,u),u=u.sibling}function YN(s,i,u){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(bs,u)}catch{}switch(u.tag){case 26:cn||Ws(u,i),Oa(s,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:cn||Ws(u,i);var g=$t,b=dr;fi(u.type)&&($t=u.stateNode,dr=!1),Oa(s,i,u),wu(u.stateNode),$t=g,dr=b;break;case 5:cn||Ws(u,i);case 6:if(g=$t,b=dr,$t=null,Oa(s,i,u),$t=g,dr=b,$t!==null)if(dr)try{($t.nodeType===9?$t.body:$t.nodeName==="HTML"?$t.ownerDocument.body:$t).removeChild(u.stateNode)}catch(w){Et(u,i,w)}else try{$t.removeChild(u.stateNode)}catch(w){Et(u,i,w)}break;case 18:$t!==null&&(dr?(s=$t,$j(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),Ol(s)):$j($t,u.stateNode));break;case 4:g=$t,b=dr,$t=u.stateNode.containerInfo,dr=!0,Oa(s,i,u),$t=g,dr=b;break;case 0:case 11:case 14:case 15:ai(2,u,i),cn||ai(4,u,i),Oa(s,i,u);break;case 1:cn||(Ws(u,i),g=u.stateNode,typeof g.componentWillUnmount=="function"&&VN(u,i,g)),Oa(s,i,u);break;case 21:Oa(s,i,u);break;case 22:cn=(g=cn)||u.memoizedState!==null,Oa(s,i,u),cn=g;break;default:Oa(s,i,u)}}function XN(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Ol(s)}catch(u){Et(i,i.return,u)}}}function QN(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Ol(s)}catch(u){Et(i,i.return,u)}}function o4(s){switch(s.tag){case 31:case 13:case 19:var i=s.stateNode;return i===null&&(i=s.stateNode=new qN),i;case 22:return s=s.stateNode,i=s._retryCache,i===null&&(i=s._retryCache=new qN),i;default:throw Error(r(435,s.tag))}}function Qf(s,i){var u=o4(s);i.forEach(function(g){if(!u.has(g)){u.add(g);var b=g4.bind(null,s,g);g.then(b,b)}})}function fr(s,i){var u=i.deletions;if(u!==null)for(var g=0;g<u.length;g++){var b=u[g],w=s,k=i,I=k;e:for(;I!==null;){switch(I.tag){case 27:if(fi(I.type)){$t=I.stateNode,dr=!1;break e}break;case 5:$t=I.stateNode,dr=!1;break e;case 3:case 4:$t=I.stateNode.containerInfo,dr=!0;break e}I=I.return}if($t===null)throw Error(r(160));YN(w,k,b),$t=null,dr=!1,w=b.alternate,w!==null&&(w.return=null),b.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)JN(i,s),i=i.sibling}var Cs=null;function JN(s,i){var u=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:fr(i,s),hr(s),g&4&&(ai(3,s,s.return),du(3,s),ai(5,s,s.return));break;case 1:fr(i,s),hr(s),g&512&&(cn||u===null||Ws(u,u.return)),g&64&&Aa&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?g:u.concat(g))));break;case 26:var b=Cs;if(fr(i,s),hr(s),g&512&&(cn||u===null||Ws(u,u.return)),g&4){var w=u!==null?u.memoizedState:null;if(g=s.memoizedState,u===null)if(g===null)if(s.stateNode===null){e:{g=s.type,u=s.memoizedProps,b=b.ownerDocument||b;t:switch(g){case"title":w=b.getElementsByTagName("title")[0],(!w||w[Ht]||w[Ce]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=b.createElement(g),b.head.insertBefore(w,b.querySelector("head > title"))),kn(w,g,u),w[Ce]=s,Ft(w),g=w;break e;case"link":var k=Jj("link","href",b).get(g+(u.href||""));if(k){for(var I=0;I<k.length;I++)if(w=k[I],w.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&w.getAttribute("rel")===(u.rel==null?null:u.rel)&&w.getAttribute("title")===(u.title==null?null:u.title)&&w.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){k.splice(I,1);break t}}w=b.createElement(g),kn(w,g,u),b.head.appendChild(w);break;case"meta":if(k=Jj("meta","content",b).get(g+(u.content||""))){for(I=0;I<k.length;I++)if(w=k[I],w.getAttribute("content")===(u.content==null?null:""+u.content)&&w.getAttribute("name")===(u.name==null?null:u.name)&&w.getAttribute("property")===(u.property==null?null:u.property)&&w.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&w.getAttribute("charset")===(u.charSet==null?null:u.charSet)){k.splice(I,1);break t}}w=b.createElement(g),kn(w,g,u),b.head.appendChild(w);break;default:throw Error(r(468,g))}w[Ce]=s,Ft(w),g=w}s.stateNode=g}else Zj(b,s.type,s.stateNode);else s.stateNode=Qj(b,g,s.memoizedProps);else w!==g?(w===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):w.count--,g===null?Zj(b,s.type,s.stateNode):Qj(b,g,s.memoizedProps)):g===null&&s.stateNode!==null&&vx(s,s.memoizedProps,u.memoizedProps)}break;case 27:fr(i,s),hr(s),g&512&&(cn||u===null||Ws(u,u.return)),u!==null&&g&4&&vx(s,s.memoizedProps,u.memoizedProps);break;case 5:if(fr(i,s),hr(s),g&512&&(cn||u===null||Ws(u,u.return)),s.flags&32){b=s.stateNode;try{nl(b,"")}catch(Oe){Et(s,s.return,Oe)}}g&4&&s.stateNode!=null&&(b=s.memoizedProps,vx(s,b,u!==null?u.memoizedProps:b)),g&1024&&(Sx=!0);break;case 6:if(fr(i,s),hr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,u=s.stateNode;try{u.nodeValue=g}catch(Oe){Et(s,s.return,Oe)}}break;case 3:if(hh=null,b=Cs,Cs=dh(i.containerInfo),fr(i,s),Cs=b,hr(s),g&4&&u!==null&&u.memoizedState.isDehydrated)try{Ol(i.containerInfo)}catch(Oe){Et(s,s.return,Oe)}Sx&&(Sx=!1,ZN(s));break;case 4:g=Cs,Cs=dh(s.stateNode.containerInfo),fr(i,s),hr(s),Cs=g;break;case 12:fr(i,s),hr(s);break;case 31:fr(i,s),hr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Qf(s,g)));break;case 13:fr(i,s),hr(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Zf=Nt()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Qf(s,g)));break;case 22:b=s.memoizedState!==null;var Y=u!==null&&u.memoizedState!==null,se=Aa,de=cn;if(Aa=se||b,cn=de||Y,fr(i,s),cn=de,Aa=se,hr(s),g&8192)e:for(i=s.stateNode,i._visibility=b?i._visibility&-2:i._visibility|1,b&&(u===null||Y||Aa||cn||wo(s)),u=null,i=s;;){if(i.tag===5||i.tag===26){if(u===null){Y=u=i;try{if(w=Y.stateNode,b)k=w.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{I=Y.stateNode;var pe=Y.memoizedProps.style,ie=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;I.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(Oe){Et(Y,Y.return,Oe)}}}else if(i.tag===6){if(u===null){Y=i;try{Y.stateNode.nodeValue=b?"":Y.memoizedProps}catch(Oe){Et(Y,Y.return,Oe)}}}else if(i.tag===18){if(u===null){Y=i;try{var le=Y.stateNode;b?Vj(le,!0):Vj(Y.stateNode,!1)}catch(Oe){Et(Y,Y.return,Oe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===s)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}g&4&&(g=s.updateQueue,g!==null&&(u=g.retryQueue,u!==null&&(g.retryQueue=null,Qf(s,u))));break;case 19:fr(i,s),hr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Qf(s,g)));break;case 30:break;case 21:break;default:fr(i,s),hr(s)}}function hr(s){var i=s.flags;if(i&2){try{for(var u,g=s.return;g!==null;){if(HN(g)){u=g;break}g=g.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,w=bx(s);Xf(s,w,b);break;case 5:var k=u.stateNode;u.flags&32&&(nl(k,""),u.flags&=-33);var I=bx(s);Xf(s,I,k);break;case 3:case 4:var Y=u.stateNode.containerInfo,se=bx(s);wx(s,se,Y);break;default:throw Error(r(161))}}catch(de){Et(s,s.return,de)}s.flags&=-3}i&4096&&(s.flags&=-4097)}function ZN(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var i=s;ZN(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),s=s.sibling}}function Ma(s,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)WN(s,i.alternate,i),i=i.sibling}function wo(s){for(s=s.child;s!==null;){var i=s;switch(i.tag){case 0:case 11:case 14:case 15:ai(4,i,i.return),wo(i);break;case 1:Ws(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&VN(i,i.return,u),wo(i);break;case 27:wu(i.stateNode);case 26:case 5:Ws(i,i.return),wo(i);break;case 22:i.memoizedState===null&&wo(i);break;case 30:wo(i);break;default:wo(i)}s=s.sibling}}function Pa(s,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var g=i.alternate,b=s,w=i,k=w.flags;switch(w.tag){case 0:case 11:case 15:Pa(b,w,u),du(4,w);break;case 1:if(Pa(b,w,u),g=w,b=g.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(se){Et(g,g.return,se)}if(g=w,b=g.updateQueue,b!==null){var I=g.stateNode;try{var Y=b.shared.hiddenCallbacks;if(Y!==null)for(b.shared.hiddenCallbacks=null,b=0;b<Y.length;b++)DS(Y[b],I)}catch(se){Et(g,g.return,se)}}u&&k&64&&$N(w),fu(w,w.return);break;case 27:GN(w);case 26:case 5:Pa(b,w,u),u&&g===null&&k&4&&UN(w),fu(w,w.return);break;case 12:Pa(b,w,u);break;case 31:Pa(b,w,u),u&&k&4&&XN(b,w);break;case 13:Pa(b,w,u),u&&k&4&&QN(b,w);break;case 22:w.memoizedState===null&&Pa(b,w,u),fu(w,w.return);break;case 30:break;default:Pa(b,w,u)}i=i.sibling}}function Nx(s,i){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&Jc(u))}function jx(s,i){s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&Jc(s))}function Es(s,i,u,g){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ej(s,i,u,g),i=i.sibling}function ej(s,i,u,g){var b=i.flags;switch(i.tag){case 0:case 11:case 15:Es(s,i,u,g),b&2048&&du(9,i);break;case 1:Es(s,i,u,g);break;case 3:Es(s,i,u,g),b&2048&&(s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&Jc(s)));break;case 12:if(b&2048){Es(s,i,u,g),s=i.stateNode;try{var w=i.memoizedProps,k=w.id,I=w.onPostCommit;typeof I=="function"&&I(k,i.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(Y){Et(i,i.return,Y)}}else Es(s,i,u,g);break;case 31:Es(s,i,u,g);break;case 13:Es(s,i,u,g);break;case 23:break;case 22:w=i.stateNode,k=i.alternate,i.memoizedState!==null?w._visibility&2?Es(s,i,u,g):hu(s,i):w._visibility&2?Es(s,i,u,g):(w._visibility|=2,Sl(s,i,u,g,(i.subtreeFlags&10256)!==0||!1)),b&2048&&Nx(k,i);break;case 24:Es(s,i,u,g),b&2048&&jx(i.alternate,i);break;default:Es(s,i,u,g)}}function Sl(s,i,u,g,b){for(b=b&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var w=s,k=i,I=u,Y=g,se=k.flags;switch(k.tag){case 0:case 11:case 15:Sl(w,k,I,Y,b),du(8,k);break;case 23:break;case 22:var de=k.stateNode;k.memoizedState!==null?de._visibility&2?Sl(w,k,I,Y,b):hu(w,k):(de._visibility|=2,Sl(w,k,I,Y,b)),b&&se&2048&&Nx(k.alternate,k);break;case 24:Sl(w,k,I,Y,b),b&&se&2048&&jx(k.alternate,k);break;default:Sl(w,k,I,Y,b)}i=i.sibling}}function hu(s,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=s,g=i,b=g.flags;switch(g.tag){case 22:hu(u,g),b&2048&&Nx(g.alternate,g);break;case 24:hu(u,g),b&2048&&jx(g.alternate,g);break;default:hu(u,g)}i=i.sibling}}var mu=8192;function Nl(s,i,u){if(s.subtreeFlags&mu)for(s=s.child;s!==null;)tj(s,i,u),s=s.sibling}function tj(s,i,u){switch(s.tag){case 26:Nl(s,i,u),s.flags&mu&&s.memoizedState!==null&&W4(u,Cs,s.memoizedState,s.memoizedProps);break;case 5:Nl(s,i,u);break;case 3:case 4:var g=Cs;Cs=dh(s.stateNode.containerInfo),Nl(s,i,u),Cs=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=mu,mu=16777216,Nl(s,i,u),mu=g):Nl(s,i,u));break;default:Nl(s,i,u)}}function nj(s){var i=s.alternate;if(i!==null&&(s=i.child,s!==null)){i.child=null;do i=s.sibling,s.sibling=null,s=i;while(s!==null)}}function pu(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var g=i[u];wn=g,sj(g,s)}nj(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)rj(s),s=s.sibling}function rj(s){switch(s.tag){case 0:case 11:case 15:pu(s),s.flags&2048&&ai(9,s,s.return);break;case 3:pu(s);break;case 12:pu(s);break;case 22:var i=s.stateNode;s.memoizedState!==null&&i._visibility&2&&(s.return===null||s.return.tag!==13)?(i._visibility&=-3,Jf(s)):pu(s);break;default:pu(s)}}function Jf(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var g=i[u];wn=g,sj(g,s)}nj(s)}for(s=s.child;s!==null;){switch(i=s,i.tag){case 0:case 11:case 15:ai(8,i,i.return),Jf(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,Jf(i));break;default:Jf(i)}s=s.sibling}}function sj(s,i){for(;wn!==null;){var u=wn;switch(u.tag){case 0:case 11:case 15:ai(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var g=u.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Jc(u.memoizedState.cache)}if(g=u.child,g!==null)g.return=u,wn=g;else e:for(u=s;wn!==null;){g=wn;var b=g.sibling,w=g.return;if(KN(g),g===u){wn=null;break e}if(b!==null){b.return=w,wn=b;break e}wn=w}}}var l4={getCacheForType:function(s){var i=Rn(an),u=i.data.get(s);return u===void 0&&(u=s(),i.data.set(s,u)),u},cacheSignal:function(){return Rn(an).controller.signal}},c4=typeof WeakMap=="function"?WeakMap:Map,bt=0,Ot=null,st=null,ot=0,Ct=0,Cr=null,ii=!1,jl=!1,Cx=!1,La=0,Xt=0,oi=0,So=0,Ex=0,Er=0,Cl=0,gu=null,mr=null,Tx=!1,Zf=0,aj=0,eh=1/0,th=null,li=null,pn=0,ci=null,El=null,Ia=0,_x=0,Rx=null,ij=null,xu=0,Dx=null;function Tr(){return(bt&2)!==0&&ot!==0?ot&-ot:P.T!==null?Lx():Se()}function oj(){if(Er===0)if((ot&536870912)===0||mt){var s=ir;ir<<=1,(ir&3932160)===0&&(ir=262144),Er=s}else Er=536870912;return s=Nr.current,s!==null&&(s.flags|=32),Er}function pr(s,i,u){(s===Ot&&(Ct===2||Ct===9)||s.cancelPendingCommit!==null)&&(Tl(s,0),ui(s,ot,Er,!1)),Ee(s,u),((bt&2)===0||s!==Ot)&&(s===Ot&&((bt&2)===0&&(So|=u),Xt===4&&ui(s,ot,Er,!1)),Ks(s))}function lj(s,i,u){if((bt&6)!==0)throw Error(r(327));var g=!u&&(i&127)===0&&(i&s.expiredLanes)===0||Tt(s,i),b=g?f4(s,i):Ax(s,i,!0),w=g;do{if(b===0){jl&&!g&&ui(s,i,0,!1);break}else{if(u=s.current.alternate,w&&!u4(u)){b=Ax(s,i,!1),w=!1;continue}if(b===2){if(w=i,s.errorRecoveryDisabledLanes&w)var k=0;else k=s.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){i=k;e:{var I=s;b=gu;var Y=I.current.memoizedState.isDehydrated;if(Y&&(Tl(I,k).flags|=256),k=Ax(I,k,!1),k!==2){if(Cx&&!Y){I.errorRecoveryDisabledLanes|=w,So|=w,b=4;break e}w=mr,mr=b,w!==null&&(mr===null?mr=w:mr.push.apply(mr,w))}b=k}if(w=!1,b!==2)continue}}if(b===1){Tl(s,0),ui(s,i,0,!0);break}e:{switch(g=s,w=b,w){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:ui(g,i,Er,!ii);break e;case 2:mr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(b=Zf+300-Nt(),10<b)){if(ui(g,i,Er,!ii),Ge(g,0,!0)!==0)break e;Ia=i,g.timeoutHandle=zj(cj.bind(null,g,u,mr,th,Tx,i,Er,So,Cl,ii,w,"Throttled",-0,0),b);break e}cj(g,u,mr,th,Tx,i,Er,So,Cl,ii,w,null,-0,0)}}break}while(!0);Ks(s)}function cj(s,i,u,g,b,w,k,I,Y,se,de,pe,ie,le){if(s.timeoutHandle=-1,pe=i.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Sa},tj(i,w,pe);var Oe=(w&62914560)===w?Zf-Nt():(w&4194048)===w?aj-Nt():0;if(Oe=K4(pe,Oe),Oe!==null){Ia=w,s.cancelPendingCommit=Oe(xj.bind(null,s,i,w,u,g,b,k,I,Y,de,pe,null,ie,le)),ui(s,w,k,!se);return}}xj(s,i,w,u,g,b,k,I,Y)}function u4(s){for(var i=s;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var g=0;g<u.length;g++){var b=u[g],w=b.getSnapshot;b=b.value;try{if(!wr(w(),b))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ui(s,i,u,g){i&=~Ex,i&=~So,s.suspendedLanes|=i,s.pingedLanes&=~i,g&&(s.warmLanes|=i),g=s.expirationTimes;for(var b=i;0<b;){var w=31-tn(b),k=1<<w;g[w]=-1,b&=~k}u!==0&&En(s,u,i)}function nh(){return(bt&6)===0?(yu(0),!1):!0}function kx(){if(st!==null){if(Ct===0)var s=st.return;else s=st,Ea=ho=null,Wg(s),xl=null,eu=0,s=st;for(;s!==null;)FN(s.alternate,s),s=s.return;st=null}}function Tl(s,i){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,D4(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),Ia=0,kx(),Ot=s,st=u=ja(s.current,null),ot=i,Ct=0,Cr=null,ii=!1,jl=Tt(s,i),Cx=!1,Cl=Er=Ex=So=oi=Xt=0,mr=gu=null,Tx=!1,(i&8)!==0&&(i|=i&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=i;0<g;){var b=31-tn(g),w=1<<b;i|=s[b],g&=~w}return La=i,Nf(),u}function uj(s,i){Je=null,P.H=lu,i===gl||i===kf?(i=ES(),Ct=3):i===Pg?(i=ES(),Ct=4):Ct=i===cx?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Cr=i,st===null&&(Xt=1,Gf(s,Qr(i,s.current)))}function dj(){var s=Nr.current;return s===null?!0:(ot&4194048)===ot?ts===null:(ot&62914560)===ot||(ot&536870912)!==0?s===ts:!1}function fj(){var s=P.H;return P.H=lu,s===null?lu:s}function hj(){var s=P.A;return P.A=l4,s}function rh(){Xt=4,ii||(ot&4194048)!==ot&&Nr.current!==null||(jl=!0),(oi&134217727)===0&&(So&134217727)===0||Ot===null||ui(Ot,ot,Er,!1)}function Ax(s,i,u){var g=bt;bt|=2;var b=fj(),w=hj();(Ot!==s||ot!==i)&&(th=null,Tl(s,i)),i=!1;var k=Xt;e:do try{if(Ct!==0&&st!==null){var I=st,Y=Cr;switch(Ct){case 8:kx(),k=6;break e;case 3:case 2:case 9:case 6:Nr.current===null&&(i=!0);var se=Ct;if(Ct=0,Cr=null,_l(s,I,Y,se),u&&jl){k=0;break e}break;default:se=Ct,Ct=0,Cr=null,_l(s,I,Y,se)}}d4(),k=Xt;break}catch(de){uj(s,de)}while(!0);return i&&s.shellSuspendCounter++,Ea=ho=null,bt=g,P.H=b,P.A=w,st===null&&(Ot=null,ot=0,Nf()),k}function d4(){for(;st!==null;)mj(st)}function f4(s,i){var u=bt;bt|=2;var g=fj(),b=hj();Ot!==s||ot!==i?(th=null,eh=Nt()+500,Tl(s,i)):jl=Tt(s,i);e:do try{if(Ct!==0&&st!==null){i=st;var w=Cr;t:switch(Ct){case 1:Ct=0,Cr=null,_l(s,i,w,1);break;case 2:case 9:if(jS(w)){Ct=0,Cr=null,pj(i);break}i=function(){Ct!==2&&Ct!==9||Ot!==s||(Ct=7),Ks(s)},w.then(i,i);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:jS(w)?(Ct=0,Cr=null,pj(i)):(Ct=0,Cr=null,_l(s,i,w,7));break;case 5:var k=null;switch(st.tag){case 26:k=st.memoizedState;case 5:case 27:var I=st;if(k?eC(k):I.stateNode.complete){Ct=0,Cr=null;var Y=I.sibling;if(Y!==null)st=Y;else{var se=I.return;se!==null?(st=se,sh(se)):st=null}break t}}Ct=0,Cr=null,_l(s,i,w,5);break;case 6:Ct=0,Cr=null,_l(s,i,w,6);break;case 8:kx(),Xt=6;break e;default:throw Error(r(462))}}h4();break}catch(de){uj(s,de)}while(!0);return Ea=ho=null,P.H=g,P.A=b,bt=u,st!==null?0:(Ot=null,ot=0,Nf(),Xt)}function h4(){for(;st!==null&&!Bt();)mj(st)}function mj(s){var i=BN(s.alternate,s,La);s.memoizedProps=s.pendingProps,i===null?sh(s):st=i}function pj(s){var i=s,u=i.alternate;switch(i.tag){case 15:case 0:i=AN(u,i,i.pendingProps,i.type,void 0,ot);break;case 11:i=AN(u,i,i.pendingProps,i.type.render,i.ref,ot);break;case 5:Wg(i);default:FN(u,i),i=st=hS(i,La),i=BN(u,i,La)}s.memoizedProps=s.pendingProps,i===null?sh(s):st=i}function _l(s,i,u,g){Ea=ho=null,Wg(i),xl=null,eu=0;var b=i.return;try{if(t4(s,b,i,u,ot)){Xt=1,Gf(s,Qr(u,s.current)),st=null;return}}catch(w){if(b!==null)throw st=b,w;Xt=1,Gf(s,Qr(u,s.current)),st=null;return}i.flags&32768?(mt||g===1?s=!0:jl||(ot&536870912)!==0?s=!1:(ii=s=!0,(g===2||g===9||g===3||g===6)&&(g=Nr.current,g!==null&&g.tag===13&&(g.flags|=16384))),gj(i,s)):sh(i)}function sh(s){var i=s;do{if((i.flags&32768)!==0){gj(i,ii);return}s=i.return;var u=s4(i.alternate,i,La);if(u!==null){st=u;return}if(i=i.sibling,i!==null){st=i;return}st=i=s}while(i!==null);Xt===0&&(Xt=5)}function gj(s,i){do{var u=a4(s.alternate,s);if(u!==null){u.flags&=32767,st=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(s=s.sibling,s!==null)){st=s;return}st=s=u}while(s!==null);Xt=6,st=null}function xj(s,i,u,g,b,w,k,I,Y){s.cancelPendingCommit=null;do ah();while(pn!==0);if((bt&6)!==0)throw Error(r(327));if(i!==null){if(i===s.current)throw Error(r(177));if(w=i.lanes|i.childLanes,w|=bg,et(s,u,w,k,I,Y),s===Ot&&(st=Ot=null,ot=0),El=i,ci=s,Ia=u,_x=w,Rx=b,ij=g,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,x4(mn,function(){return Sj(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||g){g=P.T,P.T=null,b=U.p,U.p=2,k=bt,bt|=4;try{i4(s,i,u)}finally{bt=k,U.p=b,P.T=g}}pn=1,yj(),vj(),bj()}}function yj(){if(pn===1){pn=0;var s=ci,i=El,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=P.T,P.T=null;var g=U.p;U.p=2;var b=bt;bt|=4;try{JN(i,s);var w=Hx,k=sS(s.containerInfo),I=w.focusedElem,Y=w.selectionRange;if(k!==I&&I&&I.ownerDocument&&rS(I.ownerDocument.documentElement,I)){if(Y!==null&&pg(I)){var se=Y.start,de=Y.end;if(de===void 0&&(de=se),"selectionStart"in I)I.selectionStart=se,I.selectionEnd=Math.min(de,I.value.length);else{var pe=I.ownerDocument||document,ie=pe&&pe.defaultView||window;if(ie.getSelection){var le=ie.getSelection(),Oe=I.textContent.length,We=Math.min(Y.start,Oe),Dt=Y.end===void 0?We:Math.min(Y.end,Oe);!le.extend&&We>Dt&&(k=Dt,Dt=We,We=k);var ee=nS(I,We),J=nS(I,Dt);if(ee&&J&&(le.rangeCount!==1||le.anchorNode!==ee.node||le.anchorOffset!==ee.offset||le.focusNode!==J.node||le.focusOffset!==J.offset)){var re=pe.createRange();re.setStart(ee.node,ee.offset),le.removeAllRanges(),We>Dt?(le.addRange(re),le.extend(J.node,J.offset)):(re.setEnd(J.node,J.offset),le.addRange(re))}}}}for(pe=[],le=I;le=le.parentNode;)le.nodeType===1&&pe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<pe.length;I++){var he=pe[I];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}xh=!!Ux,Hx=Ux=null}finally{bt=b,U.p=g,P.T=u}}s.current=i,pn=2}}function vj(){if(pn===2){pn=0;var s=ci,i=El,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=P.T,P.T=null;var g=U.p;U.p=2;var b=bt;bt|=4;try{WN(s,i.alternate,i)}finally{bt=b,U.p=g,P.T=u}}pn=3}}function bj(){if(pn===4||pn===3){pn=0,Wn();var s=ci,i=El,u=Ia,g=ij;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?pn=5:(pn=0,El=ci=null,wj(s,s.pendingLanes));var b=s.pendingLanes;if(b===0&&(li=null),ve(u),i=i.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(bs,i,void 0,(i.current.flags&128)===128)}catch{}if(g!==null){i=P.T,b=U.p,U.p=2,P.T=null;try{for(var w=s.onRecoverableError,k=0;k<g.length;k++){var I=g[k];w(I.value,{componentStack:I.stack})}}finally{P.T=i,U.p=b}}(Ia&3)!==0&&ah(),Ks(s),b=s.pendingLanes,(u&261930)!==0&&(b&42)!==0?s===Dx?xu++:(xu=0,Dx=s):xu=0,yu(0)}}function wj(s,i){(s.pooledCacheLanes&=i)===0&&(i=s.pooledCache,i!=null&&(s.pooledCache=null,Jc(i)))}function ah(){return yj(),vj(),bj(),Sj()}function Sj(){if(pn!==5)return!1;var s=ci,i=_x;_x=0;var u=ve(Ia),g=P.T,b=U.p;try{U.p=32>u?32:u,P.T=null,u=Rx,Rx=null;var w=ci,k=Ia;if(pn=0,El=ci=null,Ia=0,(bt&6)!==0)throw Error(r(331));var I=bt;if(bt|=4,rj(w.current),ej(w,w.current,k,u),bt=I,yu(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(bs,w)}catch{}return!0}finally{U.p=b,P.T=g,wj(s,i)}}function Nj(s,i,u){i=Qr(u,i),i=lx(s.stateNode,i,2),s=ni(s,i,2),s!==null&&(Ee(s,2),Ks(s))}function Et(s,i,u){if(s.tag===3)Nj(s,s,u);else for(;i!==null;){if(i.tag===3){Nj(i,s,u);break}else if(i.tag===1){var g=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(li===null||!li.has(g))){s=Qr(u,s),u=jN(2),g=ni(i,u,2),g!==null&&(CN(u,g,i,s),Ee(g,2),Ks(g));break}}i=i.return}}function Ox(s,i,u){var g=s.pingCache;if(g===null){g=s.pingCache=new c4;var b=new Set;g.set(i,b)}else b=g.get(i),b===void 0&&(b=new Set,g.set(i,b));b.has(u)||(Cx=!0,b.add(u),s=m4.bind(null,s,i,u),i.then(s,s))}function m4(s,i,u){var g=s.pingCache;g!==null&&g.delete(i),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,Ot===s&&(ot&u)===u&&(Xt===4||Xt===3&&(ot&62914560)===ot&&300>Nt()-Zf?(bt&2)===0&&Tl(s,0):Ex|=u,Cl===ot&&(Cl=0)),Ks(s)}function jj(s,i){i===0&&(i=Ut()),s=co(s,i),s!==null&&(Ee(s,i),Ks(s))}function p4(s){var i=s.memoizedState,u=0;i!==null&&(u=i.retryLane),jj(s,u)}function g4(s,i){var u=0;switch(s.tag){case 31:case 13:var g=s.stateNode,b=s.memoizedState;b!==null&&(u=b.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(i),jj(s,u)}function x4(s,i){return qn(s,i)}var ih=null,Rl=null,Mx=!1,oh=!1,Px=!1,di=0;function Ks(s){s!==Rl&&s.next===null&&(Rl===null?ih=Rl=s:Rl=Rl.next=s),oh=!0,Mx||(Mx=!0,v4())}function yu(s,i){if(!Px&&oh){Px=!0;do for(var u=!1,g=ih;g!==null;){if(s!==0){var b=g.pendingLanes;if(b===0)var w=0;else{var k=g.suspendedLanes,I=g.pingedLanes;w=(1<<31-tn(42|s)+1)-1,w&=b&~(k&~I),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(u=!0,_j(g,w))}else w=ot,w=Ge(g,g===Ot?w:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(w&3)===0||Tt(g,w)||(u=!0,_j(g,w));g=g.next}while(u);Px=!1}}function y4(){Cj()}function Cj(){oh=Mx=!1;var s=0;di!==0&&R4()&&(s=di);for(var i=Nt(),u=null,g=ih;g!==null;){var b=g.next,w=Ej(g,i);w===0?(g.next=null,u===null?ih=b:u.next=b,b===null&&(Rl=u)):(u=g,(s!==0||(w&3)!==0)&&(oh=!0)),g=b}pn!==0&&pn!==5||yu(s),di!==0&&(di=0)}function Ej(s,i){for(var u=s.suspendedLanes,g=s.pingedLanes,b=s.expirationTimes,w=s.pendingLanes&-62914561;0<w;){var k=31-tn(w),I=1<<k,Y=b[k];Y===-1?((I&u)===0||(I&g)!==0)&&(b[k]=zt(I,i)):Y<=i&&(s.expiredLanes|=I),w&=~I}if(i=Ot,u=ot,u=Ge(s,s===i?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,u===0||s===i&&(Ct===2||Ct===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&va(g),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||Tt(s,u)){if(i=u&-u,i===s.callbackPriority)return i;switch(g!==null&&va(g),ve(u)){case 2:case 8:u=vr;break;case 32:u=mn;break;case 268435456:u=rr;break;default:u=mn}return g=Tj.bind(null,s),u=qn(u,g),s.callbackPriority=i,s.callbackNode=u,i}return g!==null&&g!==null&&va(g),s.callbackPriority=2,s.callbackNode=null,2}function Tj(s,i){if(pn!==0&&pn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(ah()&&s.callbackNode!==u)return null;var g=ot;return g=Ge(s,s===Ot?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(lj(s,g,i),Ej(s,Nt()),s.callbackNode!=null&&s.callbackNode===u?Tj.bind(null,s):null)}function _j(s,i){if(ah())return null;lj(s,i,!0)}function v4(){k4(function(){(bt&6)!==0?qn(qr,y4):Cj()})}function Lx(){if(di===0){var s=ml;s===0&&(s=ar,ar<<=1,(ar&261888)===0&&(ar=256)),di=s}return di}function Rj(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:pf(""+s)}function Dj(s,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,s.id&&u.setAttribute("form",s.id),i.parentNode.insertBefore(u,i),s=new FormData(s),u.parentNode.removeChild(u),s}function b4(s,i,u,g,b){if(i==="submit"&&u&&u.stateNode===b){var w=Rj((b[Re]||null).action),k=g.submitter;k&&(i=(i=k[Re]||null)?Rj(i.formAction):k.getAttribute("formAction"),i!==null&&(w=i,k=null));var I=new vf("action","action",null,g,b);s.push({event:I,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(di!==0){var Y=k?Dj(b,k):new FormData(b);nx(u,{pending:!0,data:Y,method:b.method,action:w},null,Y)}}else typeof w=="function"&&(I.preventDefault(),Y=k?Dj(b,k):new FormData(b),nx(u,{pending:!0,data:Y,method:b.method,action:w},w,Y))},currentTarget:b}]})}}for(var Ix=0;Ix<vg.length;Ix++){var Bx=vg[Ix],w4=Bx.toLowerCase(),S4=Bx[0].toUpperCase()+Bx.slice(1);js(w4,"on"+S4)}js(oS,"onAnimationEnd"),js(lS,"onAnimationIteration"),js(cS,"onAnimationStart"),js("dblclick","onDoubleClick"),js("focusin","onFocus"),js("focusout","onBlur"),js(BL,"onTransitionRun"),js(zL,"onTransitionStart"),js(FL,"onTransitionCancel"),js(uS,"onTransitionEnd"),Kr("onMouseEnter",["mouseout","mouseover"]),Kr("onMouseLeave",["mouseout","mouseover"]),Kr("onPointerEnter",["pointerout","pointerover"]),Kr("onPointerLeave",["pointerout","pointerover"]),Ss("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ss("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ss("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ss("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ss("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ss("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),N4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vu));function kj(s,i){i=(i&4)!==0;for(var u=0;u<s.length;u++){var g=s[u],b=g.event;g=g.listeners;e:{var w=void 0;if(i)for(var k=g.length-1;0<=k;k--){var I=g[k],Y=I.instance,se=I.currentTarget;if(I=I.listener,Y!==w&&b.isPropagationStopped())break e;w=I,b.currentTarget=se;try{w(b)}catch(de){Sf(de)}b.currentTarget=null,w=Y}else for(k=0;k<g.length;k++){if(I=g[k],Y=I.instance,se=I.currentTarget,I=I.listener,Y!==w&&b.isPropagationStopped())break e;w=I,b.currentTarget=se;try{w(b)}catch(de){Sf(de)}b.currentTarget=null,w=Y}}}}function at(s,i){var u=i[qe];u===void 0&&(u=i[qe]=new Set);var g=s+"__bubble";u.has(g)||(Aj(i,s,2,!1),u.add(g))}function zx(s,i,u){var g=0;i&&(g|=4),Aj(u,s,g,i)}var lh="_reactListening"+Math.random().toString(36).slice(2);function Fx(s){if(!s[lh]){s[lh]=!0,ws.forEach(function(u){u!=="selectionchange"&&(N4.has(u)||zx(u,!1,s),zx(u,!0,s))});var i=s.nodeType===9?s:s.ownerDocument;i===null||i[lh]||(i[lh]=!0,zx("selectionchange",!1,i))}}function Aj(s,i,u,g){switch(oC(i)){case 2:var b=Q4;break;case 8:b=J4;break;default:b=ty}u=b.bind(null,i,u,s),b=void 0,!ig||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(b=!0),g?b!==void 0?s.addEventListener(i,u,{capture:!0,passive:b}):s.addEventListener(i,u,!0):b!==void 0?s.addEventListener(i,u,{passive:b}):s.addEventListener(i,u,!1)}function $x(s,i,u,g,b){var w=g;if((i&1)===0&&(i&2)===0&&g!==null)e:for(;;){if(g===null)return;var k=g.tag;if(k===3||k===4){var I=g.stateNode.containerInfo;if(I===b)break;if(k===4)for(k=g.return;k!==null;){var Y=k.tag;if((Y===3||Y===4)&&k.stateNode.containerInfo===b)return;k=k.return}for(;I!==null;){if(k=Kt(I),k===null)return;if(Y=k.tag,Y===5||Y===6||Y===26||Y===27){g=w=k;continue e}I=I.parentNode}}g=g.return}I1(function(){var se=w,de=sg(u),pe=[];e:{var ie=dS.get(s);if(ie!==void 0){var le=vf,Oe=s;switch(s){case"keypress":if(xf(u)===0)break e;case"keydown":case"keyup":le=gL;break;case"focusin":Oe="focus",le=ug;break;case"focusout":Oe="blur",le=ug;break;case"beforeblur":case"afterblur":le=ug;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=F1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=sL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=vL;break;case oS:case lS:case cS:le=oL;break;case uS:le=wL;break;case"scroll":case"scrollend":le=nL;break;case"wheel":le=NL;break;case"copy":case"cut":case"paste":le=cL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=V1;break;case"toggle":case"beforetoggle":le=CL}var We=(i&4)!==0,Dt=!We&&(s==="scroll"||s==="scrollend"),ee=We?ie!==null?ie+"Capture":null:ie;We=[];for(var J=se,re;J!==null;){var he=J;if(re=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||re===null||ee===null||(he=$c(J,ee),he!=null&&We.push(bu(J,he,re))),Dt)break;J=J.return}0<We.length&&(ie=new le(ie,Oe,null,u,de),pe.push({event:ie,listeners:We}))}}if((i&7)===0){e:{if(ie=s==="mouseover"||s==="pointerover",le=s==="mouseout"||s==="pointerout",ie&&u!==rg&&(Oe=u.relatedTarget||u.fromElement)&&(Kt(Oe)||Oe[Be]))break e;if((le||ie)&&(ie=de.window===de?de:(ie=de.ownerDocument)?ie.defaultView||ie.parentWindow:window,le?(Oe=u.relatedTarget||u.toElement,le=se,Oe=Oe?Kt(Oe):null,Oe!==null&&(Dt=o(Oe),We=Oe.tag,Oe!==Dt||We!==5&&We!==27&&We!==6)&&(Oe=null)):(le=null,Oe=se),le!==Oe)){if(We=F1,he="onMouseLeave",ee="onMouseEnter",J="mouse",(s==="pointerout"||s==="pointerover")&&(We=V1,he="onPointerLeave",ee="onPointerEnter",J="pointer"),Dt=le==null?ie:bn(le),re=Oe==null?ie:bn(Oe),ie=new We(he,J+"leave",le,u,de),ie.target=Dt,ie.relatedTarget=re,he=null,Kt(de)===se&&(We=new We(ee,J+"enter",Oe,u,de),We.target=re,We.relatedTarget=Dt,he=We),Dt=he,le&&Oe)t:{for(We=j4,ee=le,J=Oe,re=0,he=ee;he;he=We(he))re++;he=0;for(var Ve=J;Ve;Ve=We(Ve))he++;for(;0<re-he;)ee=We(ee),re--;for(;0<he-re;)J=We(J),he--;for(;re--;){if(ee===J||J!==null&&ee===J.alternate){We=ee;break t}ee=We(ee),J=We(J)}We=null}else We=null;le!==null&&Oj(pe,ie,le,We,!1),Oe!==null&&Dt!==null&&Oj(pe,Dt,Oe,We,!0)}}e:{if(ie=se?bn(se):window,le=ie.nodeName&&ie.nodeName.toLowerCase(),le==="select"||le==="input"&&ie.type==="file")var xt=X1;else if(K1(ie))if(Q1)xt=PL;else{xt=OL;var Ie=AL}else le=ie.nodeName,!le||le.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?se&&ng(se.elementType)&&(xt=X1):xt=ML;if(xt&&(xt=xt(s,se))){Y1(pe,xt,u,de);break e}Ie&&Ie(s,ie,se),s==="focusout"&&se&&ie.type==="number"&&se.memoizedProps.value!=null&&tg(ie,"number",ie.value)}switch(Ie=se?bn(se):window,s){case"focusin":(K1(Ie)||Ie.contentEditable==="true")&&(il=Ie,gg=se,Yc=null);break;case"focusout":Yc=gg=il=null;break;case"mousedown":xg=!0;break;case"contextmenu":case"mouseup":case"dragend":xg=!1,aS(pe,u,de);break;case"selectionchange":if(IL)break;case"keydown":case"keyup":aS(pe,u,de)}var Ze;if(fg)e:{switch(s){case"compositionstart":var lt="onCompositionStart";break e;case"compositionend":lt="onCompositionEnd";break e;case"compositionupdate":lt="onCompositionUpdate";break e}lt=void 0}else al?q1(s,u)&&(lt="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(lt="onCompositionStart");lt&&(U1&&u.locale!=="ko"&&(al||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&al&&(Ze=B1()):(Ya=de,og="value"in Ya?Ya.value:Ya.textContent,al=!0)),Ie=ch(se,lt),0<Ie.length&&(lt=new $1(lt,s,null,u,de),pe.push({event:lt,listeners:Ie}),Ze?lt.data=Ze:(Ze=W1(u),Ze!==null&&(lt.data=Ze)))),(Ze=TL?_L(s,u):RL(s,u))&&(lt=ch(se,"onBeforeInput"),0<lt.length&&(Ie=new $1("onBeforeInput","beforeinput",null,u,de),pe.push({event:Ie,listeners:lt}),Ie.data=Ze)),b4(pe,s,se,u,de)}kj(pe,i)})}function bu(s,i,u){return{instance:s,listener:i,currentTarget:u}}function ch(s,i){for(var u=i+"Capture",g=[];s!==null;){var b=s,w=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||w===null||(b=$c(s,u),b!=null&&g.unshift(bu(s,b,w)),b=$c(s,i),b!=null&&g.push(bu(s,b,w))),s.tag===3)return g;s=s.return}return[]}function j4(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function Oj(s,i,u,g,b){for(var w=i._reactName,k=[];u!==null&&u!==g;){var I=u,Y=I.alternate,se=I.stateNode;if(I=I.tag,Y!==null&&Y===g)break;I!==5&&I!==26&&I!==27||se===null||(Y=se,b?(se=$c(u,w),se!=null&&k.unshift(bu(u,se,Y))):b||(se=$c(u,w),se!=null&&k.push(bu(u,se,Y)))),u=u.return}k.length!==0&&s.push({event:i,listeners:k})}var C4=/\r\n?/g,E4=/\u0000|\uFFFD/g;function Mj(s){return(typeof s=="string"?s:""+s).replace(C4,`
9
+ `).replace(E4,"")}function Pj(s,i){return i=Mj(i),Mj(s)===i}function Rt(s,i,u,g,b,w){switch(u){case"children":typeof g=="string"?i==="body"||i==="textarea"&&g===""||nl(s,g):(typeof g=="number"||typeof g=="bigint")&&i!=="body"&&nl(s,""+g);break;case"className":Ns(s,"class",g);break;case"tabIndex":Ns(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Ns(s,u,g);break;case"style":P1(s,g,w);break;case"data":if(i!=="object"){Ns(s,"data",g);break}case"src":case"href":if(g===""&&(i!=="a"||u!=="href")){s.removeAttribute(u);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(u);break}g=pf(""+g),s.setAttribute(u,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(u==="formAction"?(i!=="input"&&Rt(s,i,"name",b.name,b,null),Rt(s,i,"formEncType",b.formEncType,b,null),Rt(s,i,"formMethod",b.formMethod,b,null),Rt(s,i,"formTarget",b.formTarget,b,null)):(Rt(s,i,"encType",b.encType,b,null),Rt(s,i,"method",b.method,b,null),Rt(s,i,"target",b.target,b,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(u);break}g=pf(""+g),s.setAttribute(u,g);break;case"onClick":g!=null&&(s.onclick=Sa);break;case"onScroll":g!=null&&at("scroll",s);break;case"onScrollEnd":g!=null&&at("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(u=g.__html,u!=null){if(b.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}u=pf(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(u,""+g):s.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":g===!0?s.setAttribute(u,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(u,g):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(u,g):s.removeAttribute(u);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(u):s.setAttribute(u,g);break;case"popover":at("beforetoggle",s),at("toggle",s),nn(s,"popover",g);break;case"xlinkActuate":Tn(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Tn(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Tn(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Tn(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Tn(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Tn(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Tn(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Tn(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Tn(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":nn(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=eL.get(u)||u,nn(s,u,g))}}function Vx(s,i,u,g,b,w){switch(u){case"style":P1(s,g,w);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(u=g.__html,u!=null){if(b.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"children":typeof g=="string"?nl(s,g):(typeof g=="number"||typeof g=="bigint")&&nl(s,""+g);break;case"onScroll":g!=null&&at("scroll",s);break;case"onScrollEnd":g!=null&&at("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Sa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!br.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),i=u.slice(2,b?u.length-7:void 0),w=s[Re]||null,w=w!=null?w[u]:null,typeof w=="function"&&s.removeEventListener(i,w,b),typeof g=="function")){typeof w!="function"&&w!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(i,g,b);break e}u in s?s[u]=g:g===!0?s.setAttribute(u,""):nn(s,u,g)}}}function kn(s,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":at("error",s),at("load",s);var g=!1,b=!1,w;for(w in u)if(u.hasOwnProperty(w)){var k=u[w];if(k!=null)switch(w){case"src":g=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Rt(s,i,w,k,u,null)}}b&&Rt(s,i,"srcSet",u.srcSet,u,null),g&&Rt(s,i,"src",u.src,u,null);return;case"input":at("invalid",s);var I=w=k=b=null,Y=null,se=null;for(g in u)if(u.hasOwnProperty(g)){var de=u[g];if(de!=null)switch(g){case"name":b=de;break;case"type":k=de;break;case"checked":Y=de;break;case"defaultChecked":se=de;break;case"value":w=de;break;case"defaultValue":I=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,i));break;default:Rt(s,i,g,de,u,null)}}k1(s,w,I,Y,se,k,b,!1);return;case"select":at("invalid",s),g=k=w=null;for(b in u)if(u.hasOwnProperty(b)&&(I=u[b],I!=null))switch(b){case"value":w=I;break;case"defaultValue":k=I;break;case"multiple":g=I;default:Rt(s,i,b,I,u,null)}i=w,u=k,s.multiple=!!g,i!=null?tl(s,!!g,i,!1):u!=null&&tl(s,!!g,u,!0);return;case"textarea":at("invalid",s),w=b=g=null;for(k in u)if(u.hasOwnProperty(k)&&(I=u[k],I!=null))switch(k){case"value":g=I;break;case"defaultValue":b=I;break;case"children":w=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(91));break;default:Rt(s,i,k,I,u,null)}O1(s,g,b,w);return;case"option":for(Y in u)u.hasOwnProperty(Y)&&(g=u[Y],g!=null)&&(Y==="selected"?s.selected=g&&typeof g!="function"&&typeof g!="symbol":Rt(s,i,Y,g,u,null));return;case"dialog":at("beforetoggle",s),at("toggle",s),at("cancel",s),at("close",s);break;case"iframe":case"object":at("load",s);break;case"video":case"audio":for(g=0;g<vu.length;g++)at(vu[g],s);break;case"image":at("error",s),at("load",s);break;case"details":at("toggle",s);break;case"embed":case"source":case"link":at("error",s),at("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in u)if(u.hasOwnProperty(se)&&(g=u[se],g!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Rt(s,i,se,g,u,null)}return;default:if(ng(i)){for(de in u)u.hasOwnProperty(de)&&(g=u[de],g!==void 0&&Vx(s,i,de,g,u,void 0));return}}for(I in u)u.hasOwnProperty(I)&&(g=u[I],g!=null&&Rt(s,i,I,g,u,null))}function T4(s,i,u,g){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,w=null,k=null,I=null,Y=null,se=null,de=null;for(le in u){var pe=u[le];if(u.hasOwnProperty(le)&&pe!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":Y=pe;default:g.hasOwnProperty(le)||Rt(s,i,le,null,g,pe)}}for(var ie in g){var le=g[ie];if(pe=u[ie],g.hasOwnProperty(ie)&&(le!=null||pe!=null))switch(ie){case"type":w=le;break;case"name":b=le;break;case"checked":se=le;break;case"defaultChecked":de=le;break;case"value":k=le;break;case"defaultValue":I=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,i));break;default:le!==pe&&Rt(s,i,ie,le,g,pe)}}eg(s,k,I,Y,se,de,w,b);return;case"select":le=k=I=ie=null;for(w in u)if(Y=u[w],u.hasOwnProperty(w)&&Y!=null)switch(w){case"value":break;case"multiple":le=Y;default:g.hasOwnProperty(w)||Rt(s,i,w,null,g,Y)}for(b in g)if(w=g[b],Y=u[b],g.hasOwnProperty(b)&&(w!=null||Y!=null))switch(b){case"value":ie=w;break;case"defaultValue":I=w;break;case"multiple":k=w;default:w!==Y&&Rt(s,i,b,w,g,Y)}i=I,u=k,g=le,ie!=null?tl(s,!!u,ie,!1):!!g!=!!u&&(i!=null?tl(s,!!u,i,!0):tl(s,!!u,u?[]:"",!1));return;case"textarea":le=ie=null;for(I in u)if(b=u[I],u.hasOwnProperty(I)&&b!=null&&!g.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:Rt(s,i,I,null,g,b)}for(k in g)if(b=g[k],w=u[k],g.hasOwnProperty(k)&&(b!=null||w!=null))switch(k){case"value":ie=b;break;case"defaultValue":le=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==w&&Rt(s,i,k,b,g,w)}A1(s,ie,le);return;case"option":for(var Oe in u)ie=u[Oe],u.hasOwnProperty(Oe)&&ie!=null&&!g.hasOwnProperty(Oe)&&(Oe==="selected"?s.selected=!1:Rt(s,i,Oe,null,g,ie));for(Y in g)ie=g[Y],le=u[Y],g.hasOwnProperty(Y)&&ie!==le&&(ie!=null||le!=null)&&(Y==="selected"?s.selected=ie&&typeof ie!="function"&&typeof ie!="symbol":Rt(s,i,Y,ie,g,le));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var We in u)ie=u[We],u.hasOwnProperty(We)&&ie!=null&&!g.hasOwnProperty(We)&&Rt(s,i,We,null,g,ie);for(se in g)if(ie=g[se],le=u[se],g.hasOwnProperty(se)&&ie!==le&&(ie!=null||le!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,i));break;default:Rt(s,i,se,ie,g,le)}return;default:if(ng(i)){for(var Dt in u)ie=u[Dt],u.hasOwnProperty(Dt)&&ie!==void 0&&!g.hasOwnProperty(Dt)&&Vx(s,i,Dt,void 0,g,ie);for(de in g)ie=g[de],le=u[de],!g.hasOwnProperty(de)||ie===le||ie===void 0&&le===void 0||Vx(s,i,de,ie,g,le);return}}for(var ee in u)ie=u[ee],u.hasOwnProperty(ee)&&ie!=null&&!g.hasOwnProperty(ee)&&Rt(s,i,ee,null,g,ie);for(pe in g)ie=g[pe],le=u[pe],!g.hasOwnProperty(pe)||ie===le||ie==null&&le==null||Rt(s,i,pe,ie,g,le)}function Lj(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _4(){if(typeof performance.getEntriesByType=="function"){for(var s=0,i=0,u=performance.getEntriesByType("resource"),g=0;g<u.length;g++){var b=u[g],w=b.transferSize,k=b.initiatorType,I=b.duration;if(w&&I&&Lj(k)){for(k=0,I=b.responseEnd,g+=1;g<u.length;g++){var Y=u[g],se=Y.startTime;if(se>I)break;var de=Y.transferSize,pe=Y.initiatorType;de&&Lj(pe)&&(Y=Y.responseEnd,k+=de*(Y<I?1:(I-se)/(Y-se)))}if(--g,i+=8*(w+k)/(b.duration/1e3),s++,10<s)break}}if(0<s)return i/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Ux=null,Hx=null;function uh(s){return s.nodeType===9?s:s.ownerDocument}function Ij(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Bj(s,i){if(s===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&i==="foreignObject"?0:s}function Gx(s,i){return s==="textarea"||s==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var qx=null;function R4(){var s=window.event;return s&&s.type==="popstate"?s===qx?!1:(qx=s,!0):(qx=null,!1)}var zj=typeof setTimeout=="function"?setTimeout:void 0,D4=typeof clearTimeout=="function"?clearTimeout:void 0,Fj=typeof Promise=="function"?Promise:void 0,k4=typeof queueMicrotask=="function"?queueMicrotask:typeof Fj<"u"?function(s){return Fj.resolve(null).then(s).catch(A4)}:zj;function A4(s){setTimeout(function(){throw s})}function fi(s){return s==="head"}function $j(s,i){var u=i,g=0;do{var b=u.nextSibling;if(s.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(g===0){s.removeChild(b),Ol(i);return}g--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")g++;else if(u==="html")wu(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,wu(u);for(var w=u.firstChild;w;){var k=w.nextSibling,I=w.nodeName;w[Ht]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&w.rel.toLowerCase()==="stylesheet"||u.removeChild(w),w=k}}else u==="body"&&wu(s.ownerDocument.body);u=b}while(u);Ol(i)}function Vj(s,i){var u=s;s=0;do{var g=u.nextSibling;if(u.nodeType===1?i?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(i?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=g}while(u)}function Wx(s){var i=s.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Wx(u),Wt(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function O4(s,i,u,g){for(;s.nodeType===1;){var b=u;if(s.nodeName.toLowerCase()!==i.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Ht])switch(i){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(w=s.getAttribute("rel"),w==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(w!==b.rel||s.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||s.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||s.getAttribute("title")!==(b.title==null?null:b.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(w=s.getAttribute("src"),(w!==(b.src==null?null:b.src)||s.getAttribute("type")!==(b.type==null?null:b.type)||s.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&w&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(i==="input"&&s.type==="hidden"){var w=b.name==null?null:""+b.name;if(b.type==="hidden"&&s.getAttribute("name")===w)return s}else return s;if(s=ns(s.nextSibling),s===null)break}return null}function M4(s,i,u){if(i==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=ns(s.nextSibling),s===null))return null;return s}function Uj(s,i){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!i||(s=ns(s.nextSibling),s===null))return null;return s}function Kx(s){return s.data==="$?"||s.data==="$~"}function Yx(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function P4(s,i){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=i;else if(s.data!=="$?"||u.readyState!=="loading")i();else{var g=function(){i(),u.removeEventListener("DOMContentLoaded",g)};u.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function ns(s){for(;s!=null;s=s.nextSibling){var i=s.nodeType;if(i===1||i===3)break;if(i===8){if(i=s.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return s}var Xx=null;function Hj(s){s=s.nextSibling;for(var i=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(i===0)return ns(s.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}s=s.nextSibling}return null}function Gj(s){s=s.previousSibling;for(var i=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return s;i--}else u!=="/$"&&u!=="/&"||i++}s=s.previousSibling}return null}function qj(s,i,u){switch(i=uh(u),s){case"html":if(s=i.documentElement,!s)throw Error(r(452));return s;case"head":if(s=i.head,!s)throw Error(r(453));return s;case"body":if(s=i.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function wu(s){for(var i=s.attributes;i.length;)s.removeAttributeNode(i[0]);Wt(s)}var rs=new Map,Wj=new Set;function dh(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ba=U.d;U.d={f:L4,r:I4,D:B4,C:z4,L:F4,m:$4,X:U4,S:V4,M:H4};function L4(){var s=Ba.f(),i=nh();return s||i}function I4(s){var i=dt(s);i!==null&&i.tag===5&&i.type==="form"?uN(i):Ba.r(s)}var Dl=typeof document>"u"?null:document;function Kj(s,i,u){var g=Dl;if(g&&typeof i=="string"&&i){var b=Yr(i);b='link[rel="'+s+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),Wj.has(b)||(Wj.add(b),s={rel:s,crossOrigin:u,href:i},g.querySelector(b)===null&&(i=g.createElement("link"),kn(i,"link",s),Ft(i),g.head.appendChild(i)))}}function B4(s){Ba.D(s),Kj("dns-prefetch",s,null)}function z4(s,i){Ba.C(s,i),Kj("preconnect",s,i)}function F4(s,i,u){Ba.L(s,i,u);var g=Dl;if(g&&s&&i){var b='link[rel="preload"][as="'+Yr(i)+'"]';i==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+Yr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+Yr(u.imageSizes)+'"]')):b+='[href="'+Yr(s)+'"]';var w=b;switch(i){case"style":w=kl(s);break;case"script":w=Al(s)}rs.has(w)||(s=p({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:s,as:i},u),rs.set(w,s),g.querySelector(b)!==null||i==="style"&&g.querySelector(Su(w))||i==="script"&&g.querySelector(Nu(w))||(i=g.createElement("link"),kn(i,"link",s),Ft(i),g.head.appendChild(i)))}}function $4(s,i){Ba.m(s,i);var u=Dl;if(u&&s){var g=i&&typeof i.as=="string"?i.as:"script",b='link[rel="modulepreload"][as="'+Yr(g)+'"][href="'+Yr(s)+'"]',w=b;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Al(s)}if(!rs.has(w)&&(s=p({rel:"modulepreload",href:s},i),rs.set(w,s),u.querySelector(b)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Nu(w)))return}g=u.createElement("link"),kn(g,"link",s),Ft(g),u.head.appendChild(g)}}}function V4(s,i,u){Ba.S(s,i,u);var g=Dl;if(g&&s){var b=cr(g).hoistableStyles,w=kl(s);i=i||"default";var k=b.get(w);if(!k){var I={loading:0,preload:null};if(k=g.querySelector(Su(w)))I.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":i},u),(u=rs.get(w))&&Qx(s,u);var Y=k=g.createElement("link");Ft(Y),kn(Y,"link",s),Y._p=new Promise(function(se,de){Y.onload=se,Y.onerror=de}),Y.addEventListener("load",function(){I.loading|=1}),Y.addEventListener("error",function(){I.loading|=2}),I.loading|=4,fh(k,i,g)}k={type:"stylesheet",instance:k,count:1,state:I},b.set(w,k)}}}function U4(s,i){Ba.X(s,i);var u=Dl;if(u&&s){var g=cr(u).hoistableScripts,b=Al(s),w=g.get(b);w||(w=u.querySelector(Nu(b)),w||(s=p({src:s,async:!0},i),(i=rs.get(b))&&Jx(s,i),w=u.createElement("script"),Ft(w),kn(w,"link",s),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},g.set(b,w))}}function H4(s,i){Ba.M(s,i);var u=Dl;if(u&&s){var g=cr(u).hoistableScripts,b=Al(s),w=g.get(b);w||(w=u.querySelector(Nu(b)),w||(s=p({src:s,async:!0,type:"module"},i),(i=rs.get(b))&&Jx(s,i),w=u.createElement("script"),Ft(w),kn(w,"link",s),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},g.set(b,w))}}function Yj(s,i,u,g){var b=(b=ce.current)?dh(b):null;if(!b)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=kl(u.href),u=cr(b).hoistableStyles,g=u.get(i),g||(g={type:"style",instance:null,count:0,state:null},u.set(i,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=kl(u.href);var w=cr(b).hoistableStyles,k=w.get(s);if(k||(b=b.ownerDocument||b,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(s,k),(w=b.querySelector(Su(s)))&&!w._p&&(k.instance=w,k.state.loading=5),rs.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},rs.set(s,u),w||G4(b,s,u,k.state))),i&&g===null)throw Error(r(528,""));return k}if(i&&g!==null)throw Error(r(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Al(u),u=cr(b).hoistableScripts,g=u.get(i),g||(g={type:"script",instance:null,count:0,state:null},u.set(i,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function kl(s){return'href="'+Yr(s)+'"'}function Su(s){return'link[rel="stylesheet"]['+s+"]"}function Xj(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function G4(s,i,u,g){s.querySelector('link[rel="preload"][as="style"]['+i+"]")?g.loading=1:(i=s.createElement("link"),g.preload=i,i.addEventListener("load",function(){return g.loading|=1}),i.addEventListener("error",function(){return g.loading|=2}),kn(i,"link",u),Ft(i),s.head.appendChild(i))}function Al(s){return'[src="'+Yr(s)+'"]'}function Nu(s){return"script[async]"+s}function Qj(s,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var g=s.querySelector('style[data-href~="'+Yr(u.href)+'"]');if(g)return i.instance=g,Ft(g),g;var b=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),Ft(g),kn(g,"style",b),fh(g,u.precedence,s),i.instance=g;case"stylesheet":b=kl(u.href);var w=s.querySelector(Su(b));if(w)return i.state.loading|=4,i.instance=w,Ft(w),w;g=Xj(u),(b=rs.get(b))&&Qx(g,b),w=(s.ownerDocument||s).createElement("link"),Ft(w);var k=w;return k._p=new Promise(function(I,Y){k.onload=I,k.onerror=Y}),kn(w,"link",g),i.state.loading|=4,fh(w,u.precedence,s),i.instance=w;case"script":return w=Al(u.src),(b=s.querySelector(Nu(w)))?(i.instance=b,Ft(b),b):(g=u,(b=rs.get(w))&&(g=p({},u),Jx(g,b)),s=s.ownerDocument||s,b=s.createElement("script"),Ft(b),kn(b,"link",g),s.head.appendChild(b),i.instance=b);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(g=i.instance,i.state.loading|=4,fh(g,u.precedence,s));return i.instance}function fh(s,i,u){for(var g=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=g.length?g[g.length-1]:null,w=b,k=0;k<g.length;k++){var I=g[k];if(I.dataset.precedence===i)w=I;else if(w!==b)break}w?w.parentNode.insertBefore(s,w.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(s,i.firstChild))}function Qx(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.title==null&&(s.title=i.title)}function Jx(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.integrity==null&&(s.integrity=i.integrity)}var hh=null;function Jj(s,i,u){if(hh===null){var g=new Map,b=hh=new Map;b.set(u,g)}else b=hh,g=b.get(u),g||(g=new Map,b.set(u,g));if(g.has(s))return g;for(g.set(s,null),u=u.getElementsByTagName(s),b=0;b<u.length;b++){var w=u[b];if(!(w[Ht]||w[Ce]||s==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var k=w.getAttribute(i)||"";k=s+k;var I=g.get(k);I?I.push(w):g.set(k,[w])}}return g}function Zj(s,i,u){s=s.ownerDocument||s,s.head.insertBefore(u,i==="title"?s.querySelector("head > title"):null)}function q4(s,i,u){if(u===1||i.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(s=i.disabled,typeof i.precedence=="string"&&s==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function eC(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function W4(s,i,u,g){if(u.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=kl(g.href),w=i.querySelector(Su(b));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(s.count++,s=mh.bind(s),i.then(s,s)),u.state.loading|=4,u.instance=w,Ft(w);return}w=i.ownerDocument||i,g=Xj(g),(b=rs.get(b))&&Qx(g,b),w=w.createElement("link"),Ft(w);var k=w;k._p=new Promise(function(I,Y){k.onload=I,k.onerror=Y}),kn(w,"link",g),u.instance=w}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=mh.bind(s),i.addEventListener("load",u),i.addEventListener("error",u))}}var Zx=0;function K4(s,i){return s.stylesheets&&s.count===0&&gh(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var g=setTimeout(function(){if(s.stylesheets&&gh(s,s.stylesheets),s.unsuspend){var w=s.unsuspend;s.unsuspend=null,w()}},6e4+i);0<s.imgBytes&&Zx===0&&(Zx=62500*_4());var b=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&gh(s,s.stylesheets),s.unsuspend)){var w=s.unsuspend;s.unsuspend=null,w()}},(s.imgBytes>Zx?50:800)+i);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(b)}}:null}function mh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gh(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var ph=null;function gh(s,i){s.stylesheets=null,s.unsuspend!==null&&(s.count++,ph=new Map,i.forEach(Y4,s),ph=null,mh.call(s))}function Y4(s,i){if(!(i.state.loading&4)){var u=ph.get(s);if(u)var g=u.get(null);else{u=new Map,ph.set(s,u);for(var b=s.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<b.length;w++){var k=b[w];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(u.set(k.dataset.precedence,k),g=k)}g&&u.set(null,g)}b=i.instance,k=b.getAttribute("data-precedence"),w=u.get(k)||g,w===g&&u.set(null,b),u.set(k,b),this.count++,g=mh.bind(this),b.addEventListener("load",g),b.addEventListener("error",g),w?w.parentNode.insertBefore(b,w.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(b,s.firstChild)),i.state.loading|=4}}var ju={$$typeof:R,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function X4(s,i,u,g,b,w,k,I,Y){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=fe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fe(0),this.hiddenUpdates=fe(null),this.identifierPrefix=g,this.onUncaughtError=b,this.onCaughtError=w,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function tC(s,i,u,g,b,w,k,I,Y,se,de,pe){return s=new X4(s,i,u,k,Y,se,de,pe,I),i=1,w===!0&&(i|=24),w=Sr(3,null,null,i),s.current=w,w.stateNode=s,i=Ag(),i.refCount++,s.pooledCache=i,i.refCount++,w.memoizedState={element:g,isDehydrated:u,cache:i},Lg(w),s}function nC(s){return s?(s=cl,s):cl}function rC(s,i,u,g,b,w){b=nC(b),g.context===null?g.context=b:g.pendingContext=b,g=ti(i),g.payload={element:u},w=w===void 0?null:w,w!==null&&(g.callback=w),u=ni(s,g,i),u!==null&&(pr(u,s,i),nu(u,s,i))}function sC(s,i){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<i?u:i}}function ey(s,i){sC(s,i),(s=s.alternate)&&sC(s,i)}function aC(s){if(s.tag===13||s.tag===31){var i=co(s,67108864);i!==null&&pr(i,s,67108864),ey(s,67108864)}}function iC(s){if(s.tag===13||s.tag===31){var i=Tr();i=ae(i);var u=co(s,i);u!==null&&pr(u,s,i),ey(s,i)}}var xh=!0;function Q4(s,i,u,g){var b=P.T;P.T=null;var w=U.p;try{U.p=2,ty(s,i,u,g)}finally{U.p=w,P.T=b}}function J4(s,i,u,g){var b=P.T;P.T=null;var w=U.p;try{U.p=8,ty(s,i,u,g)}finally{U.p=w,P.T=b}}function ty(s,i,u,g){if(xh){var b=ny(g);if(b===null)$x(s,i,g,yh,u),lC(s,g);else if(eI(b,s,i,u,g))g.stopPropagation();else if(lC(s,g),i&4&&-1<Z4.indexOf(s)){for(;b!==null;){var w=dt(b);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var k=lr(w.pendingLanes);if(k!==0){var I=w;for(I.pendingLanes|=2,I.entangledLanes|=2;k;){var Y=1<<31-tn(k);I.entanglements[1]|=Y,k&=~Y}Ks(w),(bt&6)===0&&(eh=Nt()+500,yu(0))}}break;case 31:case 13:I=co(w,2),I!==null&&pr(I,w,2),nh(),ey(w,2)}if(w=ny(g),w===null&&$x(s,i,g,yh,u),w===b)break;b=w}b!==null&&g.stopPropagation()}else $x(s,i,g,null,u)}}function ny(s){return s=sg(s),ry(s)}var yh=null;function ry(s){if(yh=null,s=Kt(s),s!==null){var i=o(s);if(i===null)s=null;else{var u=i.tag;if(u===13){if(s=c(i),s!==null)return s;s=null}else if(u===31){if(s=d(i),s!==null)return s;s=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;s=null}else i!==s&&(s=null)}}return yh=s,null}function oC(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(yr()){case qr:return 2;case vr:return 8;case mn:case jn:return 32;case rr:return 268435456;default:return 32}default:return 32}}var sy=!1,hi=null,mi=null,pi=null,Cu=new Map,Eu=new Map,gi=[],Z4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function lC(s,i){switch(s){case"focusin":case"focusout":hi=null;break;case"dragenter":case"dragleave":mi=null;break;case"mouseover":case"mouseout":pi=null;break;case"pointerover":case"pointerout":Cu.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Eu.delete(i.pointerId)}}function Tu(s,i,u,g,b,w){return s===null||s.nativeEvent!==w?(s={blockedOn:i,domEventName:u,eventSystemFlags:g,nativeEvent:w,targetContainers:[b]},i!==null&&(i=dt(i),i!==null&&aC(i)),s):(s.eventSystemFlags|=g,i=s.targetContainers,b!==null&&i.indexOf(b)===-1&&i.push(b),s)}function eI(s,i,u,g,b){switch(i){case"focusin":return hi=Tu(hi,s,i,u,g,b),!0;case"dragenter":return mi=Tu(mi,s,i,u,g,b),!0;case"mouseover":return pi=Tu(pi,s,i,u,g,b),!0;case"pointerover":var w=b.pointerId;return Cu.set(w,Tu(Cu.get(w)||null,s,i,u,g,b)),!0;case"gotpointercapture":return w=b.pointerId,Eu.set(w,Tu(Eu.get(w)||null,s,i,u,g,b)),!0}return!1}function cC(s){var i=Kt(s.target);if(i!==null){var u=o(i);if(u!==null){if(i=u.tag,i===13){if(i=c(u),i!==null){s.blockedOn=i,ze(s.priority,function(){iC(u)});return}}else if(i===31){if(i=d(u),i!==null){s.blockedOn=i,ze(s.priority,function(){iC(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function vh(s){if(s.blockedOn!==null)return!1;for(var i=s.targetContainers;0<i.length;){var u=ny(s.nativeEvent);if(u===null){u=s.nativeEvent;var g=new u.constructor(u.type,u);rg=g,u.target.dispatchEvent(g),rg=null}else return i=dt(u),i!==null&&aC(i),s.blockedOn=u,!1;i.shift()}return!0}function uC(s,i,u){vh(s)&&u.delete(i)}function tI(){sy=!1,hi!==null&&vh(hi)&&(hi=null),mi!==null&&vh(mi)&&(mi=null),pi!==null&&vh(pi)&&(pi=null),Cu.forEach(uC),Eu.forEach(uC)}function bh(s,i){s.blockedOn===i&&(s.blockedOn=null,sy||(sy=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,tI)))}var wh=null;function dC(s){wh!==s&&(wh=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){wh===s&&(wh=null);for(var i=0;i<s.length;i+=3){var u=s[i],g=s[i+1],b=s[i+2];if(typeof g!="function"){if(ry(g||u)===null)continue;break}var w=dt(u);w!==null&&(s.splice(i,3),i-=3,nx(w,{pending:!0,data:b,method:u.method,action:g},g,b))}}))}function Ol(s){function i(Y){return bh(Y,s)}hi!==null&&bh(hi,s),mi!==null&&bh(mi,s),pi!==null&&bh(pi,s),Cu.forEach(i),Eu.forEach(i);for(var u=0;u<gi.length;u++){var g=gi[u];g.blockedOn===s&&(g.blockedOn=null)}for(;0<gi.length&&(u=gi[0],u.blockedOn===null);)cC(u),u.blockedOn===null&&gi.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(g=0;g<u.length;g+=3){var b=u[g],w=u[g+1],k=b[Re]||null;if(typeof w=="function")k||dC(u);else if(k){var I=null;if(w&&w.hasAttribute("formAction")){if(b=w,k=w[Re]||null)I=k.formAction;else if(ry(b)!==null)continue}else I=k.action;typeof I=="function"?u[g+1]=I:(u.splice(g,3),g-=3),dC(u)}}}function fC(){function s(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(k){return b=k})},focusReset:"manual",scroll:"manual"})}function i(){b!==null&&(b(),b=null),g||setTimeout(u,20)}function u(){if(!g&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,b=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),b!==null&&(b(),b=null)}}}function ay(s){this._internalRoot=s}Sh.prototype.render=ay.prototype.render=function(s){var i=this._internalRoot;if(i===null)throw Error(r(409));var u=i.current,g=Tr();rC(u,g,s,i,null,null)},Sh.prototype.unmount=ay.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var i=s.containerInfo;rC(s.current,2,null,s,null,null),nh(),i[Be]=null}};function Sh(s){this._internalRoot=s}Sh.prototype.unstable_scheduleHydration=function(s){if(s){var i=Se();s={blockedOn:null,target:s,priority:i};for(var u=0;u<gi.length&&i!==0&&i<gi[u].priority;u++);gi.splice(u,0,s),u===0&&cC(s)}};var hC=t.version;if(hC!=="19.2.3")throw Error(r(527,hC,"19.2.3"));U.findDOMNode=function(s){var i=s._reactInternals;if(i===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(i),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var nI={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nh.isDisabled&&Nh.supportsFiber)try{bs=Nh.inject(nI),At=Nh}catch{}}return Ru.createRoot=function(s,i){if(!a(s))throw Error(r(299));var u=!1,g="",b=bN,w=wN,k=SN;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(g=i.identifierPrefix),i.onUncaughtError!==void 0&&(b=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(k=i.onRecoverableError)),i=tC(s,1,!1,null,null,u,g,null,b,w,k,fC),s[Be]=i.current,Fx(s),new ay(i)},Ru.hydrateRoot=function(s,i,u){if(!a(s))throw Error(r(299));var g=!1,b="",w=bN,k=wN,I=SN,Y=null;return u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(w=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(I=u.onRecoverableError),u.formState!==void 0&&(Y=u.formState)),i=tC(s,1,!0,i,u??null,g,b,Y,w,k,I,fC),i.context=nC(null),u=i.current,g=Tr(),g=ae(g),b=ti(g),b.callback=null,ni(u,b,g),u=g,i.current.lanes=u,Ee(i,u),Ks(i),s[Be]=i.current,Fx(s),new Sh(i)},Ru.version="19.2.3",Ru}var NC;function dI(){if(NC)return ly.exports;NC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ly.exports=uI(),ly.exports}var fI=dI();var NR=e=>{throw TypeError(e)},hI=(e,t,n)=>t.has(e)||NR("Cannot "+n),fy=(e,t,n)=>(hI(e,t,"read from private field"),n?n.call(e):t.get(e)),mI=(e,t,n)=>t.has(e)?NR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),jC="popstate";function pI(e={}){function t(r,a){let{pathname:o,search:c,hash:d}=r.location;return pd("",{pathname:o,search:c,hash:d},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:ua(a)}return xI(t,n,null,e)}function nt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Zt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function gI(){return Math.random().toString(36).substring(2,10)}function CC(e,t){return{usr:e.state,key:e.key,idx:t}}function pd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Yi(t):t,state:n,key:t&&t.key||r||gI()}}function ua({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Yi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function xI(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,c=a.history,d="POP",h=null,f=m();f==null&&(f=0,c.replaceState({...c.state,idx:f},""));function m(){return(c.state||{idx:null}).idx}function p(){d="POP";let C=m(),j=C==null?null:C-f;f=C,h&&h({action:d,location:N.location,delta:j})}function y(C,j){d="PUSH";let E=pd(N.location,C,j);f=m()+1;let R=CC(E,f),A=N.createHref(E);try{c.pushState(R,"",A)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;a.location.assign(A)}o&&h&&h({action:d,location:N.location,delta:1})}function v(C,j){d="REPLACE";let E=pd(N.location,C,j);f=m();let R=CC(E,f),A=N.createHref(E);c.replaceState(R,"",A),o&&h&&h({action:d,location:N.location,delta:0})}function S(C){return jR(C)}let N={get action(){return d},get location(){return e(a,c)},listen(C){if(h)throw new Error("A history only accepts one active listener");return a.addEventListener(jC,p),h=C,()=>{a.removeEventListener(jC,p),h=null}},createHref(C){return t(a,C)},createURL:S,encodeLocation(C){let j=S(C);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:y,replace:v,go(C){return c.go(C)}};return N}function jR(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),nt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ua(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Wu,EC=class{constructor(e){if(mI(this,Wu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(fy(this,Wu).has(e))return fy(this,Wu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){fy(this,Wu).set(e,t)}};Wu=new WeakMap;var yI=new Set(["lazy","caseSensitive","path","id","index","children"]);function vI(e){return yI.has(e)}var bI=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function wI(e){return bI.has(e)}function SI(e){return e.index===!0}function gd(e,t,n=[],r={},a=!1){return e.map((o,c)=>{let d=[...n,String(c)],h=typeof o.id=="string"?o.id:d.join("-");if(nt(o.index!==!0||!o.children,"Cannot specify children on an index route"),nt(a||!r[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),SI(o)){let f={...o,id:h};return r[h]=TC(f,t(f)),f}else{let f={...o,id:h,children:void 0};return r[h]=TC(f,t(f)),o.children&&(f.children=gd(o.children,t,d,r,a)),f}})}function TC(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ni(e,t,n="/"){return Ku(e,t,n,!1)}function Ku(e,t,n,r){let a=typeof t=="string"?Yi(t):t,o=ds(a.pathname||"/",n);if(o==null)return null;let c=CR(e);jI(c);let d=null;for(let h=0;d==null&&h<c.length;++h){let f=PI(o);d=OI(c[h],f,r)}return d}function NI(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function CR(e,t=[],n=[],r="",a=!1){let o=(c,d,h=a,f)=>{let m={relativePath:f===void 0?c.path||"":f,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&h)return;nt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let p=na([r,m.relativePath]),y=n.concat(m);c.children&&c.children.length>0&&(nt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),CR(c.children,t,y,p,h)),!(c.path==null&&!c.index)&&t.push({path:p,score:kI(p,c.index),routesMeta:y})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))o(c,d);else for(let h of ER(c.path))o(c,d,!0,h)}),t}function ER(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let c=ER(r.join("/")),d=[];return d.push(...c.map(h=>h===""?o:[o,h].join("/"))),a&&d.push(...c),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function jI(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:AI(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var CI=/^:[\w-]+$/,EI=3,TI=2,_I=1,RI=10,DI=-2,_C=e=>e==="*";function kI(e,t){let n=e.split("/"),r=n.length;return n.some(_C)&&(r+=DI),t&&(r+=TI),n.filter(a=>!_C(a)).reduce((a,o)=>a+(CI.test(o)?EI:o===""?_I:RI),r)}function AI(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function OI(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",c=[];for(let d=0;d<r.length;++d){let h=r[d],f=d===r.length-1,m=o==="/"?t:t.slice(o.length)||"/",p=ym({path:h.relativePath,caseSensitive:h.caseSensitive,end:f},m),y=h.route;if(!p&&f&&n&&!r[r.length-1].route.index&&(p=ym({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!p)return null;Object.assign(a,p.params),c.push({params:a,pathname:na([o,p.pathname]),pathnameBase:BI(na([o,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(o=na([o,p.pathnameBase]))}return c}function ym(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=MI(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],c=o.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:r.reduce((f,{paramName:m,isOptional:p},y)=>{if(m==="*"){let S=d[y]||"";c=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const v=d[y];return p&&!v?f[m]=void 0:f[m]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:c,pattern:e}}function MI(e,t=!1,n=!0){Zt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,h)=>(r.push({paramName:d,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function PI(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Zt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ds(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function LI({basename:e,pathname:t}){return t==="/"?e:na([e,t])}var TR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ib=e=>TR.test(e);function II(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Yi(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=RC(n.substring(1),"/"):o=RC(n,t)):o=t,{pathname:o,search:zI(r),hash:FI(a)}}function RC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function hy(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _R(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function np(e){let t=_R(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function rp(e,t,n,r=!1){let a;typeof e=="string"?a=Yi(e):(a={...e},nt(!a.pathname||!a.pathname.includes("?"),hy("?","pathname","search",a)),nt(!a.pathname||!a.pathname.includes("#"),hy("#","pathname","hash",a)),nt(!a.search||!a.search.includes("#"),hy("#","search","hash",a)));let o=e===""||a.pathname==="",c=o?"/":a.pathname,d;if(c==null)d=n;else{let p=t.length-1;if(!r&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),p-=1;a.pathname=y.join("/")}d=p>=0?t[p]:"/"}let h=II(a,d),f=c&&c!=="/"&&c.endsWith("/"),m=(o||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(f||m)&&(h.pathname+="/"),h}var na=e=>e.join("/").replace(/\/\/+/g,"/"),BI=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),zI=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,FI=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ud=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function xd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Hd(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var RR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function DR(e,t){let n=e;if(typeof n!="string"||!TR.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(RR)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),d=ds(c.pathname,t);c.origin===o.origin&&d!=null?n=d+c.search+c.hash:a=!0}catch{Zt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}var Ci=Symbol("Uninstrumented");function $I(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(o){let c=Object.keys(n);for(let d of c)o[d]&&n[d].push(o[d])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let a=Xl(n.lazy,t.lazy,()=>{});a&&(r.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(o=>{let c=a[o],d=n[`lazy.${o}`];if(typeof c=="function"&&d.length>0){let h=Xl(d,c,()=>{});h&&(r.lazy=Object.assign(r.lazy||{},{[o]:h}))}})}return["loader","action"].forEach(a=>{let o=t[a];if(typeof o=="function"&&n[a].length>0){let c=o[Ci]??o,d=Xl(n[a],c,(...h)=>DC(h[0]));d&&(a==="loader"&&c.hydrate===!0&&(d.hydrate=!0),d[Ci]=c,r[a]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(a=>{let o=a[Ci]??a,c=Xl(n.middleware,o,(...d)=>DC(d[0]));return c?(c[Ci]=o,c):a})),r}function VI(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(a){let o=Object.keys(a);for(let c of o)a[c]&&n[c].push(a[c])}})),n.navigate.length>0){let r=e.navigate[Ci]??e.navigate,a=Xl(n.navigate,r,(...o)=>{let[c,d]=o;return{to:typeof c=="number"||typeof c=="string"?c:c?ua(c):".",...kC(e,d??{})}});a&&(a[Ci]=r,e.navigate=a)}if(n.fetch.length>0){let r=e.fetch[Ci]??e.fetch,a=Xl(n.fetch,r,(...o)=>{let[c,,d,h]=o;return{href:d??".",fetcherKey:c,...kC(e,h??{})}});a&&(a[Ci]=r,e.fetch=a)}return e}function Xl(e,t,n){return e.length===0?null:async(...r)=>{let a=await kR(e,n(...r),()=>t(...r),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function kR(e,t,n,r){let a=e[r],o;if(a){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=kR(e,t,n,r-1),o=await c,nt(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(d,t)}catch(h){console.error("An instrumentation function threw an error:",h)}c||await d(),await c}else try{o={type:"success",value:await n()}}catch(c){o={type:"error",value:c}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function DC(e){let{request:t,context:n,params:r,unstable_pattern:a}=e;return{request:UI(t),params:{...r},unstable_pattern:a,context:HI(n)}}function kC(e,t){return{currentUrl:ua(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function UI(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function HI(e){if(qI(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var GI=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function qI(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===GI}var AR=["POST","PUT","PATCH","DELETE"],WI=new Set(AR),KI=["GET",...AR],YI=new Set(KI),OR=new Set([301,302,303,307,308]),XI=new Set([307,308]),my={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},QI={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Du={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},JI=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),MR="remix-router-transitions",PR=Symbol("ResetLoaderData");function ZI(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";nt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||JI,o=a;if(e.unstable_instrumentations){let K=e.unstable_instrumentations;o=Z=>({...a(Z),...$I(K.map(ae=>ae.route).filter(Boolean),Z)})}let c={},d=gd(e.routes,o,void 0,c),h,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let m=e.dataStrategy||sB,p={...e.future},y=null,v=new Set,S=null,N=null,C=null,j=e.hydrationData!=null,E=Ni(d,e.history.location,f),R=!1,A=null,_;if(E==null&&!e.patchRoutesOnNavigation){let K=as(404,{pathname:e.history.location.pathname}),{matches:Z,route:ae}=jh(d);_=!0,E=Z,A={[ae.id]:K}}else if(E&&!e.hydrationData&&Ut(E,d,e.history.location.pathname).active&&(E=null),E)if(E.some(K=>K.route.lazy))_=!1;else if(!E.some(K=>ob(K.route)))_=!0;else{let K=e.hydrationData?e.hydrationData.loaderData:null,Z=e.hydrationData?e.hydrationData.errors:null;if(Z){let ae=E.findIndex(ve=>Z[ve.route.id]!==void 0);_=E.slice(0,ae+1).every(ve=>!Av(ve.route,K,Z))}else _=E.every(ae=>!Av(ae.route,K,Z))}else{_=!1,E=[];let K=Ut(null,d,e.history.location.pathname);K.active&&K.matches&&(R=!0,E=K.matches)}let O,T={historyAction:e.history.action,location:e.history.location,matches:E,initialized:_,navigation:my,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||A,fetchers:new Map,blockers:new Map},D="POP",B=null,W=!1,M,V=!1,G=new Map,F=null,H=!1,P=!1,U=new Set,z=new Map,te=0,oe=-1,L=new Map,$=new Set,X=new Map,Q=new Map,q=new Set,ce=new Map,ne,xe=null;function be(){if(y=e.history.listen(({action:K,location:Z,delta:ae})=>{if(ne){ne(),ne=void 0;return}Zt(ce.size===0||ae!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ve=ir({currentLocation:T.location,nextLocation:Z,historyAction:K});if(ve&&ae!=null){let Se=new Promise(ze=>{ne=ze});e.history.go(ae*-1),ar(ve,{state:"blocked",location:Z,proceed(){ar(ve,{state:"proceeding",proceed:void 0,reset:void 0,location:Z}),Se.then(()=>e.history.go(ae))},reset(){let ze=new Map(T.blockers);ze.set(ve,Du),we({blockers:ze})}}),B?.resolve(),B=null;return}return Pt(K,Z)}),n){SB(t,G);let K=()=>NB(t,G);t.addEventListener("pagehide",K),F=()=>t.removeEventListener("pagehide",K)}return T.initialized||Pt("POP",T.location,{initialHydration:!0}),O}function De(){y&&y(),F&&F(),v.clear(),M&&M.abort(),T.fetchers.forEach((K,Z)=>sr(Z)),T.blockers.forEach((K,Z)=>Bn(Z))}function Ke(K){return v.add(K),()=>v.delete(K)}function we(K,Z={}){K.matches&&(K.matches=K.matches.map(Se=>{let ze=c[Se.route.id],Te=Se.route;return Te.element!==ze.element||Te.errorElement!==ze.errorElement||Te.hydrateFallbackElement!==ze.hydrateFallbackElement?{...Se,route:ze}:Se})),T={...T,...K};let ae=[],ve=[];T.fetchers.forEach((Se,ze)=>{Se.state==="idle"&&(q.has(ze)?ae.push(ze):ve.push(ze))}),q.forEach(Se=>{!T.fetchers.has(Se)&&!z.has(Se)&&ae.push(Se)}),[...v].forEach(Se=>Se(T,{deletedFetchers:ae,newErrors:K.errors??null,viewTransitionOpts:Z.viewTransitionOpts,flushSync:Z.flushSync===!0})),ae.forEach(Se=>sr(Se)),ve.forEach(Se=>T.fetchers.delete(Se))}function _e(K,Z,{flushSync:ae}={}){let ve=T.actionData!=null&&T.navigation.formMethod!=null&&$n(T.navigation.formMethod)&&T.navigation.state==="loading"&&K.state?._isRedirect!==!0,Se;Z.actionData?Object.keys(Z.actionData).length>0?Se=Z.actionData:Se=null:ve?Se=T.actionData:Se=null;let ze=Z.loaderData?$C(T.loaderData,Z.loaderData,Z.matches||[],Z.errors):T.loaderData,Te=T.blockers;Te.size>0&&(Te=new Map(Te),Te.forEach((qe,Fe)=>Te.set(Fe,Du)));let Ce=H?!1:zt(K,Z.matches||T.matches),Re=W===!0||T.navigation.formMethod!=null&&$n(T.navigation.formMethod)&&K.state?._isRedirect!==!0;h&&(d=h,h=void 0),H||D==="POP"||(D==="PUSH"?e.history.push(K,K.state):D==="REPLACE"&&e.history.replace(K,K.state));let Be;if(D==="POP"){let qe=G.get(T.location.pathname);qe&&qe.has(K.pathname)?Be={currentLocation:T.location,nextLocation:K}:G.has(K.pathname)&&(Be={currentLocation:K,nextLocation:T.location})}else if(V){let qe=G.get(T.location.pathname);qe?qe.add(K.pathname):(qe=new Set([K.pathname]),G.set(T.location.pathname,qe)),Be={currentLocation:T.location,nextLocation:K}}we({...Z,actionData:Se,loaderData:ze,historyAction:D,location:K,initialized:!0,navigation:my,revalidation:"idle",restoreScrollPosition:Ce,preventScrollReset:Re,blockers:Te},{viewTransitionOpts:Be,flushSync:ae===!0}),D="POP",W=!1,V=!1,H=!1,P=!1,B?.resolve(),B=null,xe?.resolve(),xe=null}async function vt(K,Z){if(B?.resolve(),B=null,typeof K=="number"){B||(B=GC());let ut=B.promise;return e.history.go(K),ut}let ae=kv(T.location,T.matches,f,K,Z?.fromRouteId,Z?.relative),{path:ve,submission:Se,error:ze}=AC(!1,ae,Z),Te=T.location,Ce=pd(T.location,ve,Z&&Z.state);Ce={...Ce,...e.history.encodeLocation(Ce)};let Re=Z&&Z.replace!=null?Z.replace:void 0,Be="PUSH";Re===!0?Be="REPLACE":Re===!1||Se!=null&&$n(Se.formMethod)&&Se.formAction===T.location.pathname+T.location.search&&(Be="REPLACE");let qe=Z&&"preventScrollReset"in Z?Z.preventScrollReset===!0:void 0,Fe=(Z&&Z.flushSync)===!0,pt=ir({currentLocation:Te,nextLocation:Ce,historyAction:Be});if(pt){ar(pt,{state:"blocked",location:Ce,proceed(){ar(pt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ce}),vt(K,Z)},reset(){let ut=new Map(T.blockers);ut.set(pt,Du),we({blockers:ut})}});return}await Pt(Be,Ce,{submission:Se,pendingError:ze,preventScrollReset:qe,replace:Z&&Z.replace,enableViewTransition:Z&&Z.viewTransition,flushSync:Fe,callSiteDefaultShouldRevalidate:Z&&Z.unstable_defaultShouldRevalidate})}function en(){xe||(xe=GC()),vr(),we({revalidation:"loading"});let K=xe.promise;return T.navigation.state==="submitting"?K:T.navigation.state==="idle"?(Pt(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),K):(Pt(D||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:V===!0}),K)}async function Pt(K,Z,ae){M&&M.abort(),M=null,D=K,H=(ae&&ae.startUninterruptedRevalidation)===!0,Tt(T.location,T.matches),W=(ae&&ae.preventScrollReset)===!0,V=(ae&&ae.enableViewTransition)===!0;let ve=h||d,Se=ae&&ae.overrideNavigation,ze=ae?.initialHydration&&T.matches&&T.matches.length>0&&!R?T.matches:Ni(ve,Z,f),Te=(ae&&ae.flushSync)===!0;if(ze&&T.initialized&&!P&&fB(T.location,Z)&&!(ae&&ae.submission&&$n(ae.submission.formMethod))){_e(Z,{matches:ze},{flushSync:Te});return}let Ce=Ut(ze,ve,Z.pathname);if(Ce.active&&Ce.matches&&(ze=Ce.matches),!ze){let{error:Wt,notFoundMatches:Kt,route:dt}=or(Z.pathname);_e(Z,{matches:Kt,loaderData:{},errors:{[dt.id]:Wt}},{flushSync:Te});return}M=new AbortController;let Re=Gl(e.history,Z,M.signal,ae&&ae.submission),Be=e.getContext?await e.getContext():new EC,qe;if(ae&&ae.pendingError)qe=[ji(ze).route.id,{type:"error",error:ae.pendingError}];else if(ae&&ae.submission&&$n(ae.submission.formMethod)){let Wt=await vn(Re,Z,ae.submission,ze,Be,Ce.active,ae&&ae.initialHydration===!0,{replace:ae.replace,flushSync:Te});if(Wt.shortCircuited)return;if(Wt.pendingActionResult){let[Kt,dt]=Wt.pendingActionResult;if(_r(dt)&&xd(dt.error)&&dt.error.status===404){M=null,_e(Z,{matches:Wt.matches,loaderData:{},errors:{[Kt]:dt.error}});return}}ze=Wt.matches||ze,qe=Wt.pendingActionResult,Se=py(Z,ae.submission),Te=!1,Ce.active=!1,Re=Gl(e.history,Re.url,Re.signal)}let{shortCircuited:Fe,matches:pt,loaderData:ut,errors:Ht}=await Hs(Re,Z,ze,Be,Ce.active,Se,ae&&ae.submission,ae&&ae.fetcherSubmission,ae&&ae.replace,ae&&ae.initialHydration===!0,Te,qe,ae&&ae.callSiteDefaultShouldRevalidate);Fe||(M=null,_e(Z,{matches:pt||ze,...VC(qe),loaderData:ut,errors:Ht}))}async function vn(K,Z,ae,ve,Se,ze,Te,Ce={}){vr();let Re=bB(Z,ae);if(we({navigation:Re},{flushSync:Ce.flushSync===!0}),ze){let Fe=await fe(ve,Z.pathname,K.signal);if(Fe.type==="aborted")return{shortCircuited:!0};if(Fe.type==="error"){if(Fe.partialMatches.length===0){let{matches:ut,route:Ht}=jh(d);return{matches:ut,pendingActionResult:[Ht.id,{type:"error",error:Fe.error}]}}let pt=ji(Fe.partialMatches).route.id;return{matches:Fe.partialMatches,pendingActionResult:[pt,{type:"error",error:Fe.error}]}}else if(Fe.matches)ve=Fe.matches;else{let{notFoundMatches:pt,error:ut,route:Ht}=or(Z.pathname);return{matches:pt,pendingActionResult:[Ht.id,{type:"error",error:ut}]}}}let Be,qe=Zh(ve,Z);if(!qe.route.action&&!qe.route.lazy)Be={type:"error",error:as(405,{method:K.method,pathname:Z.pathname,routeId:qe.route.id})};else{let Fe=rc(o,c,K,ve,qe,Te?[]:r,Se),pt=await yr(K,Fe,Se,null);if(Be=pt[qe.route.id],!Be){for(let ut of ve)if(pt[ut.route.id]){Be=pt[ut.route.id];break}}if(K.signal.aborted)return{shortCircuited:!0}}if(Mo(Be)){let Fe;return Ce&&Ce.replace!=null?Fe=Ce.replace:Fe=BC(Be.response.headers.get("Location"),new URL(K.url),f,e.history)===T.location.pathname+T.location.search,await Nt(K,Be,!0,{submission:ae,replace:Fe}),{shortCircuited:!0}}if(_r(Be)){let Fe=ji(ve,qe.route.id);return(Ce&&Ce.replace)!==!0&&(D="PUSH"),{matches:ve,pendingActionResult:[Fe.route.id,Be,qe.route.id]}}return{matches:ve,pendingActionResult:[qe.route.id,Be]}}async function Hs(K,Z,ae,ve,Se,ze,Te,Ce,Re,Be,qe,Fe,pt){let ut=ze||py(Z,Te),Ht=Te||Ce||HC(ut),Wt=!H&&!Be;if(Se){if(Wt){let nn=Qe(Fe);we({navigation:ut,...nn!==void 0?{actionData:nn}:{}},{flushSync:qe})}let ft=await fe(ae,Z.pathname,K.signal);if(ft.type==="aborted")return{shortCircuited:!0};if(ft.type==="error"){if(ft.partialMatches.length===0){let{matches:Ns,route:Tn}=jh(d);return{matches:Ns,loaderData:{},errors:{[Tn.id]:ft.error}}}let nn=ji(ft.partialMatches).route.id;return{matches:ft.partialMatches,loaderData:{},errors:{[nn]:ft.error}}}else if(ft.matches)ae=ft.matches;else{let{error:nn,notFoundMatches:Ns,route:Tn}=or(Z.pathname);return{matches:Ns,loaderData:{},errors:{[Tn.id]:nn}}}}let Kt=h||d,{dsMatches:dt,revalidatingFetchers:bn}=OC(K,ve,o,c,e.history,T,ae,Ht,Z,Be?[]:r,Be===!0,P,U,q,X,$,Kt,f,e.patchRoutesOnNavigation!=null,Fe,pt);if(oe=++te,!e.dataStrategy&&!dt.some(ft=>ft.shouldLoad)&&!dt.some(ft=>ft.route.middleware&&ft.route.middleware.length>0)&&bn.length===0){let ft=tn();return _e(Z,{matches:ae,loaderData:{},errors:Fe&&_r(Fe[1])?{[Fe[0]]:Fe[1].error}:null,...VC(Fe),...ft?{fetchers:new Map(T.fetchers)}:{}},{flushSync:qe}),{shortCircuited:!0}}if(Wt){let ft={};if(!Se){ft.navigation=ut;let nn=Qe(Fe);nn!==void 0&&(ft.actionData=nn)}bn.length>0&&(ft.fetchers=qn(bn)),we(ft,{flushSync:qe})}bn.forEach(ft=>{At(ft.key),ft.controller&&z.set(ft.key,ft.controller)});let cr=()=>bn.forEach(ft=>At(ft.key));M&&M.signal.addEventListener("abort",cr);let{loaderResults:Ft,fetcherResults:ws}=await qr(dt,bn,K,ve);if(K.signal.aborted)return{shortCircuited:!0};M&&M.signal.removeEventListener("abort",cr),bn.forEach(ft=>z.delete(ft.key));let br=Ch(Ft);if(br)return await Nt(K,br.result,!0,{replace:Re}),{shortCircuited:!0};if(br=Ch(ws),br)return $.add(br.key),await Nt(K,br.result,!0,{replace:Re}),{shortCircuited:!0};let{loaderData:Ss,errors:Kr}=FC(T,ae,Ft,Fe,bn,ws);Be&&T.errors&&(Kr={...T.errors,...Kr});let wa=tn(),ro=Ka(oe),so=wa||ro||bn.length>0;return{matches:ae,loaderData:Ss,errors:Kr,...so?{fetchers:new Map(T.fetchers)}:{}}}function Qe(K){if(K&&!_r(K[1]))return{[K[0]]:K[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function qn(K){return K.forEach(Z=>{let ae=T.fetchers.get(Z.key),ve=ku(void 0,ae?ae.data:void 0);T.fetchers.set(Z.key,ve)}),new Map(T.fetchers)}async function va(K,Z,ae,ve){At(K);let Se=(ve&&ve.flushSync)===!0,ze=h||d,Te=kv(T.location,T.matches,f,ae,Z,ve?.relative),Ce=Ni(ze,Te,f),Re=Ut(Ce,ze,Te);if(Re.active&&Re.matches&&(Ce=Re.matches),!Ce){jn(K,Z,as(404,{pathname:Te}),{flushSync:Se});return}let{path:Be,submission:qe,error:Fe}=AC(!0,Te,ve);if(Fe){jn(K,Z,Fe,{flushSync:Se});return}let pt=e.getContext?await e.getContext():new EC,ut=(ve&&ve.preventScrollReset)===!0;if(qe&&$n(qe.formMethod)){await Bt(K,Z,Be,Ce,pt,Re.active,Se,ut,qe,ve&&ve.unstable_defaultShouldRevalidate);return}X.set(K,{routeId:Z,path:Be}),await Wn(K,Z,Be,Ce,pt,Re.active,Se,ut,qe)}async function Bt(K,Z,ae,ve,Se,ze,Te,Ce,Re,Be){vr(),X.delete(K);let qe=T.fetchers.get(K);mn(K,wB(Re,qe),{flushSync:Te});let Fe=new AbortController,pt=Gl(e.history,ae,Fe.signal,Re);if(ze){let ht=await fe(ve,new URL(pt.url).pathname,pt.signal,K);if(ht.type==="aborted")return;if(ht.type==="error"){jn(K,Z,ht.error,{flushSync:Te});return}else if(ht.matches)ve=ht.matches;else{jn(K,Z,as(404,{pathname:ae}),{flushSync:Te});return}}let ut=Zh(ve,ae);if(!ut.route.action&&!ut.route.lazy){let ht=as(405,{method:Re.formMethod,pathname:ae,routeId:Z});jn(K,Z,ht,{flushSync:Te});return}z.set(K,Fe);let Ht=te,Wt=rc(o,c,pt,ve,ut,r,Se),Kt=await yr(pt,Wt,Se,K),dt=Kt[ut.route.id];if(!dt){for(let ht of Wt)if(Kt[ht.route.id]){dt=Kt[ht.route.id];break}}if(pt.signal.aborted){z.get(K)===Fe&&z.delete(K);return}if(q.has(K)){if(Mo(dt)||_r(dt)){mn(K,$a(void 0));return}}else{if(Mo(dt))if(z.delete(K),oe>Ht){mn(K,$a(void 0));return}else return $.add(K),mn(K,ku(Re)),Nt(pt,dt,!1,{fetcherSubmission:Re,preventScrollReset:Ce});if(_r(dt)){jn(K,Z,dt.error);return}}let bn=T.navigation.location||T.location,cr=Gl(e.history,bn,Fe.signal),Ft=h||d,ws=T.navigation.state!=="idle"?Ni(Ft,T.navigation.location,f):T.matches;nt(ws,"Didn't find any matches after fetcher action");let br=++te;L.set(K,br);let Ss=ku(Re,dt.data);T.fetchers.set(K,Ss);let{dsMatches:Kr,revalidatingFetchers:wa}=OC(cr,Se,o,c,e.history,T,ws,Re,bn,r,!1,P,U,q,X,$,Ft,f,e.patchRoutesOnNavigation!=null,[ut.route.id,dt],Be);wa.filter(ht=>ht.key!==K).forEach(ht=>{let ao=ht.key,hf=T.fetchers.get(ao),Fc=ku(void 0,hf?hf.data:void 0);T.fetchers.set(ao,Fc),At(ao),ht.controller&&z.set(ao,ht.controller)}),we({fetchers:new Map(T.fetchers)});let ro=()=>wa.forEach(ht=>At(ht.key));Fe.signal.addEventListener("abort",ro);let{loaderResults:so,fetcherResults:ft}=await qr(Kr,wa,cr,Se);if(Fe.signal.aborted)return;if(Fe.signal.removeEventListener("abort",ro),L.delete(K),z.delete(K),wa.forEach(ht=>z.delete(ht.key)),T.fetchers.has(K)){let ht=$a(dt.data);T.fetchers.set(K,ht)}let nn=Ch(so);if(nn)return Nt(cr,nn.result,!1,{preventScrollReset:Ce});if(nn=Ch(ft),nn)return $.add(nn.key),Nt(cr,nn.result,!1,{preventScrollReset:Ce});let{loaderData:Ns,errors:Tn}=FC(T,ws,so,void 0,wa,ft);Ka(br),T.navigation.state==="loading"&&br>oe?(nt(D,"Expected pending action"),M&&M.abort(),_e(T.navigation.location,{matches:ws,loaderData:Ns,errors:Tn,fetchers:new Map(T.fetchers)})):(we({errors:Tn,loaderData:$C(T.loaderData,Ns,ws,Tn),fetchers:new Map(T.fetchers)}),P=!1)}async function Wn(K,Z,ae,ve,Se,ze,Te,Ce,Re){let Be=T.fetchers.get(K);mn(K,ku(Re,Be?Be.data:void 0),{flushSync:Te});let qe=new AbortController,Fe=Gl(e.history,ae,qe.signal);if(ze){let dt=await fe(ve,new URL(Fe.url).pathname,Fe.signal,K);if(dt.type==="aborted")return;if(dt.type==="error"){jn(K,Z,dt.error,{flushSync:Te});return}else if(dt.matches)ve=dt.matches;else{jn(K,Z,as(404,{pathname:ae}),{flushSync:Te});return}}let pt=Zh(ve,ae);z.set(K,qe);let ut=te,Ht=rc(o,c,Fe,ve,pt,r,Se),Kt=(await yr(Fe,Ht,Se,K))[pt.route.id];if(z.get(K)===qe&&z.delete(K),!Fe.signal.aborted){if(q.has(K)){mn(K,$a(void 0));return}if(Mo(Kt))if(oe>ut){mn(K,$a(void 0));return}else{$.add(K),await Nt(Fe,Kt,!1,{preventScrollReset:Ce});return}if(_r(Kt)){jn(K,Z,Kt.error);return}mn(K,$a(Kt.data))}}async function Nt(K,Z,ae,{submission:ve,fetcherSubmission:Se,preventScrollReset:ze,replace:Te}={}){ae||(B?.resolve(),B=null),Z.response.headers.has("X-Remix-Revalidate")&&(P=!0);let Ce=Z.response.headers.get("Location");nt(Ce,"Expected a Location header on the redirect Response"),Ce=BC(Ce,new URL(K.url),f,e.history);let Re=pd(T.location,Ce,{_isRedirect:!0});if(n){let Ht=!1;if(Z.response.headers.has("X-Remix-Reload-Document"))Ht=!0;else if(ib(Ce)){const Wt=jR(Ce,!0);Ht=Wt.origin!==t.location.origin||ds(Wt.pathname,f)==null}if(Ht){Te?t.location.replace(Ce):t.location.assign(Ce);return}}M=null;let Be=Te===!0||Z.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:qe,formAction:Fe,formEncType:pt}=T.navigation;!ve&&!Se&&qe&&Fe&&pt&&(ve=HC(T.navigation));let ut=ve||Se;if(XI.has(Z.response.status)&&ut&&$n(ut.formMethod))await Pt(Be,Re,{submission:{...ut,formAction:Ce},preventScrollReset:ze||W,enableViewTransition:ae?V:void 0});else{let Ht=py(Re,ve);await Pt(Be,Re,{overrideNavigation:Ht,fetcherSubmission:Se,preventScrollReset:ze||W,enableViewTransition:ae?V:void 0})}}async function yr(K,Z,ae,ve){let Se,ze={};try{Se=await iB(m,K,Z,ve,ae,!1)}catch(Te){return Z.filter(Ce=>Ce.shouldLoad).forEach(Ce=>{ze[Ce.route.id]={type:"error",error:Te}}),ze}if(K.signal.aborted)return ze;if(!$n(K.method))for(let Te of Z){if(Se[Te.route.id]?.type==="error")break;!Se.hasOwnProperty(Te.route.id)&&!T.loaderData.hasOwnProperty(Te.route.id)&&(!T.errors||!T.errors.hasOwnProperty(Te.route.id))&&Te.shouldCallHandler()&&(Se[Te.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Te.route.id}`)})}for(let[Te,Ce]of Object.entries(Se))if(gB(Ce)){let Re=Ce.result;ze[Te]={type:"redirect",response:uB(Re,K,Te,Z,f)}}else ze[Te]=await cB(Ce);return ze}async function qr(K,Z,ae,ve){let Se=yr(ae,K,ve,null),ze=Promise.all(Z.map(async Re=>{if(Re.matches&&Re.match&&Re.request&&Re.controller){let qe=(await yr(Re.request,Re.matches,ve,Re.key))[Re.match.route.id];return{[Re.key]:qe}}else return Promise.resolve({[Re.key]:{type:"error",error:as(404,{pathname:Re.path})}})})),Te=await Se,Ce=(await ze).reduce((Re,Be)=>Object.assign(Re,Be),{});return{loaderResults:Te,fetcherResults:Ce}}function vr(){P=!0,X.forEach((K,Z)=>{z.has(Z)&&U.add(Z),At(Z)})}function mn(K,Z,ae={}){T.fetchers.set(K,Z),we({fetchers:new Map(T.fetchers)},{flushSync:(ae&&ae.flushSync)===!0})}function jn(K,Z,ae,ve={}){let Se=ji(T.matches,Z);sr(K),we({errors:{[Se.route.id]:ae},fetchers:new Map(T.fetchers)},{flushSync:(ve&&ve.flushSync)===!0})}function rr(K){return Q.set(K,(Q.get(K)||0)+1),q.has(K)&&q.delete(K),T.fetchers.get(K)||QI}function ba(K,Z){At(K,Z?.reason),mn(K,$a(null))}function sr(K){let Z=T.fetchers.get(K);z.has(K)&&!(Z&&Z.state==="loading"&&L.has(K))&&At(K),X.delete(K),L.delete(K),$.delete(K),q.delete(K),U.delete(K),T.fetchers.delete(K)}function bs(K){let Z=(Q.get(K)||0)-1;Z<=0?(Q.delete(K),q.add(K)):Q.set(K,Z),we({fetchers:new Map(T.fetchers)})}function At(K,Z){let ae=z.get(K);ae&&(ae.abort(Z),z.delete(K))}function Cn(K){for(let Z of K){let ae=rr(Z),ve=$a(ae.data);T.fetchers.set(Z,ve)}}function tn(){let K=[],Z=!1;for(let ae of $){let ve=T.fetchers.get(ae);nt(ve,`Expected fetcher: ${ae}`),ve.state==="loading"&&($.delete(ae),K.push(ae),Z=!0)}return Cn(K),Z}function Ka(K){let Z=[];for(let[ae,ve]of L)if(ve<K){let Se=T.fetchers.get(ae);nt(Se,`Expected fetcher: ${ae}`),Se.state==="loading"&&(At(ae),L.delete(ae),Z.push(ae))}return Cn(Z),Z.length>0}function Wr(K,Z){let ae=T.blockers.get(K)||Du;return ce.get(K)!==Z&&ce.set(K,Z),ae}function Bn(K){T.blockers.delete(K),ce.delete(K)}function ar(K,Z){let ae=T.blockers.get(K)||Du;nt(ae.state==="unblocked"&&Z.state==="blocked"||ae.state==="blocked"&&Z.state==="blocked"||ae.state==="blocked"&&Z.state==="proceeding"||ae.state==="blocked"&&Z.state==="unblocked"||ae.state==="proceeding"&&Z.state==="unblocked",`Invalid blocker state transition: ${ae.state} -> ${Z.state}`);let ve=new Map(T.blockers);ve.set(K,Z),we({blockers:ve})}function ir({currentLocation:K,nextLocation:Z,historyAction:ae}){if(ce.size===0)return;ce.size>1&&Zt(!1,"A router only supports one blocker at a time");let ve=Array.from(ce.entries()),[Se,ze]=ve[ve.length-1],Te=T.blockers.get(Se);if(!(Te&&Te.state==="proceeding")&&ze({currentLocation:K,nextLocation:Z,historyAction:ae}))return Se}function or(K){let Z=as(404,{pathname:K}),ae=h||d,{matches:ve,route:Se}=jh(ae);return{notFoundMatches:ve,route:Se,error:Z}}function lr(K,Z,ae){if(S=K,C=Z,N=ae||null,!j&&T.navigation===my){j=!0;let ve=zt(T.location,T.matches);ve!=null&&we({restoreScrollPosition:ve})}return()=>{S=null,C=null,N=null}}function Ge(K,Z){return N&&N(K,Z.map(ve=>NI(ve,T.loaderData)))||K.key}function Tt(K,Z){if(S&&C){let ae=Ge(K,Z);S[ae]=C()}}function zt(K,Z){if(S){let ae=Ge(K,Z),ve=S[ae];if(typeof ve=="number")return ve}return null}function Ut(K,Z,ae){if(e.patchRoutesOnNavigation)if(K){if(Object.keys(K[0].params).length>0)return{active:!0,matches:Ku(Z,ae,f,!0)}}else return{active:!0,matches:Ku(Z,ae,f,!0)||[]};return{active:!1,matches:null}}async function fe(K,Z,ae,ve){if(!e.patchRoutesOnNavigation)return{type:"success",matches:K};let Se=K;for(;;){let ze=h==null,Te=h||d,Ce=c;try{await e.patchRoutesOnNavigation({signal:ae,path:Z,matches:Se,fetcherKey:ve,patch:(qe,Fe)=>{ae.aborted||MC(qe,Fe,Te,Ce,o,!1)}})}catch(qe){return{type:"error",error:qe,partialMatches:Se}}finally{ze&&!ae.aborted&&(d=[...d])}if(ae.aborted)return{type:"aborted"};let Re=Ni(Te,Z,f),Be=null;if(Re){if(Object.keys(Re[0].params).length===0)return{type:"success",matches:Re};if(Be=Ku(Te,Z,f,!0),!(Be&&Se.length<Be.length&&Ee(Se,Be.slice(0,Se.length))))return{type:"success",matches:Re}}if(Be||(Be=Ku(Te,Z,f,!0)),!Be||Ee(Se,Be))return{type:"success",matches:null};Se=Be}}function Ee(K,Z){return K.length===Z.length&&K.every((ae,ve)=>ae.route.id===Z[ve].route.id)}function et(K){c={},h=gd(K,o,void 0,c)}function En(K,Z,ae=!1){let ve=h==null;MC(K,Z,h||d,c,o,ae),ve&&(d=[...d],we({}))}return O={get basename(){return f},get future(){return p},get state(){return T},get routes(){return d},get window(){return t},initialize:be,subscribe:Ke,enableScrollRestoration:lr,navigate:vt,fetch:va,revalidate:en,createHref:K=>e.history.createHref(K),encodeLocation:K=>e.history.encodeLocation(K),getFetcher:rr,resetFetcher:ba,deleteFetcher:bs,dispose:De,getBlocker:Wr,deleteBlocker:Bn,patchRoutes:En,_internalFetchControllers:z,_internalSetRoutes:et,_internalSetStateDoNotUseOrYouWillBreakYourApp(K){we(K)}},e.unstable_instrumentations&&(O=VI(O,e.unstable_instrumentations.map(K=>K.router).filter(Boolean))),O}function eB(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function kv(e,t,n,r,a,o){let c,d;if(a){c=[];for(let f of t)if(c.push(f),f.route.id===a){d=f;break}}else c=t,d=t[t.length-1];let h=rp(r||".",np(c),ds(e.pathname,n)||e.pathname,o==="path");if(r==null&&(h.search=e.search,h.hash=e.hash),(r==null||r===""||r===".")&&d){let f=cb(h.search);if(d.route.index&&!f)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&f){let m=new URLSearchParams(h.search),p=m.getAll("index");m.delete("index"),p.filter(v=>v).forEach(v=>m.append("index",v));let y=m.toString();h.search=y?`?${y}`:""}}return n!=="/"&&(h.pathname=LI({basename:n,pathname:h.pathname})),ua(h)}function AC(e,t,n){if(!n||!eB(n))return{path:t};if(n.formMethod&&!vB(n.formMethod))return{path:t,error:as(405,{method:n.formMethod})};let r=()=>({path:t,error:as(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),c=$R(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!$n(o))return r();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[v,S])=>`${y}${v}=${S}
10
+ `,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!$n(o))return r();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return r()}}}nt(typeof FormData=="function","FormData is not available in this environment");let d,h;if(n.formData)d=Mv(n.formData),h=n.formData;else if(n.body instanceof FormData)d=Mv(n.body),h=n.body;else if(n.body instanceof URLSearchParams)d=n.body,h=zC(d);else if(n.body==null)d=new URLSearchParams,h=new FormData;else try{d=new URLSearchParams(n.body),h=zC(d)}catch{return r()}let f={formMethod:o,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if($n(f.formMethod))return{path:t,submission:f};let m=Yi(t);return e&&m.search&&cb(m.search)&&d.append("index",""),m.search=`?${d}`,{path:ua(m),submission:f}}function OC(e,t,n,r,a,o,c,d,h,f,m,p,y,v,S,N,C,j,E,R,A){let _=R?_r(R[1])?R[1].error:R[1].data:void 0,O=a.createURL(o.location),T=a.createURL(h),D;if(m&&o.errors){let H=Object.keys(o.errors)[0];D=c.findIndex(P=>P.route.id===H)}else if(R&&_r(R[1])){let H=R[0];D=c.findIndex(P=>P.route.id===H)-1}let B=R?R[1].statusCode:void 0,W=B&&B>=400,M={currentUrl:O,currentParams:o.matches[0]?.params||{},nextUrl:T,nextParams:c[0].params,...d,actionResult:_,actionStatus:B},V=Hd(c),G=c.map((H,P)=>{let{route:U}=H,z=null;if(D!=null&&P>D?z=!1:U.lazy?z=!0:ob(U)?m?z=Av(U,o.loaderData,o.errors):tB(o.loaderData,o.matches[P],H)&&(z=!0):z=!1,z!==null)return Ov(n,r,e,V,H,f,t,z);let te=!1;typeof A=="boolean"?te=A:W?te=!1:(p||O.pathname+O.search===T.pathname+T.search||O.search!==T.search||nB(o.matches[P],H))&&(te=!0);let oe={...M,defaultShouldRevalidate:te},L=Zu(H,oe);return Ov(n,r,e,V,H,f,t,L,oe,A)}),F=[];return S.forEach((H,P)=>{if(m||!c.some(Q=>Q.route.id===H.routeId)||v.has(P))return;let U=o.fetchers.get(P),z=U&&U.state!=="idle"&&U.data===void 0,te=Ni(C,H.path,j);if(!te){if(E&&z)return;F.push({key:P,routeId:H.routeId,path:H.path,matches:null,match:null,request:null,controller:null});return}if(N.has(P))return;let oe=Zh(te,H.path),L=new AbortController,$=Gl(a,H.path,L.signal),X=null;if(y.has(P))y.delete(P),X=rc(n,r,$,te,oe,f,t);else if(z)p&&(X=rc(n,r,$,te,oe,f,t));else{let Q;typeof A=="boolean"?Q=A:W?Q=!1:Q=p;let q={...M,defaultShouldRevalidate:Q};Zu(oe,q)&&(X=rc(n,r,$,te,oe,f,t,q))}X&&F.push({key:P,routeId:H.routeId,path:H.path,matches:X,match:oe,request:$,controller:L})}),{dsMatches:G,revalidatingFetchers:F}}function ob(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Av(e,t,n){if(e.lazy)return!0;if(!ob(e))return!1;let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;return!r&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!a}function tB(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function nB(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Zu(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function MC(e,t,n,r,a,o){let c;if(e){let f=r[e];nt(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),c=f.children}else c=n;let d=[],h=[];if(t.forEach(f=>{let m=c.find(p=>LR(f,p));m?h.push({existingRoute:m,newRoute:f}):d.push(f)}),d.length>0){let f=gd(d,a,[e||"_","patch",String(c?.length||"0")],r);c.push(...f)}if(o&&h.length>0)for(let f=0;f<h.length;f++){let{existingRoute:m,newRoute:p}=h[f],y=m,[v]=gd([p],a,[],{},!0);Object.assign(y,{element:v.element?v.element:y.element,errorElement:v.errorElement?v.errorElement:y.errorElement,hydrateFallbackElement:v.hydrateFallbackElement?v.hydrateFallbackElement:y.hydrateFallbackElement})}}function LR(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>t.children?.some(a=>LR(n,a))):!1}var PC=new WeakMap,IR=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(nt(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let c=PC.get(a);c||(c={},PC.set(a,c));let d=c[e];if(d)return d;let h=(async()=>{let f=vI(e),p=a[e]!==void 0&&e!=="hasErrorBoundary";if(f)Zt(!f,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(p)Zt(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await o();y!=null&&(Object.assign(a,{[e]:y}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(y=>y===void 0)&&(a.lazy=void 0))})();return c[e]=h,h},LC=new WeakMap;function rB(e,t,n,r,a){let o=n[e.id];if(nt(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=LC.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let p=(async()=>{nt(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),v={};for(let S in y){let N=y[S];if(N===void 0)continue;let C=wI(S),E=o[S]!==void 0&&S!=="hasErrorBoundary";C?Zt(!C,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):E?Zt(!E,`Route "${o.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):v[S]=N}Object.assign(o,v),Object.assign(o,{...r(o),lazy:void 0})})();return LC.set(o,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let c=Object.keys(e.lazy),d=[],h;for(let m of c){if(a&&a.includes(m))continue;let p=IR({key:m,route:e,manifest:n,mapRouteProperties:r});p&&(d.push(p),m===t&&(h=p))}let f=d.length>0?Promise.all(d).then(()=>{}):void 0;return f?.catch(()=>{}),h?.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:h}}async function IC(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{n[t[o].route.id]=a}),n}async function sB(e){return e.matches.some(t=>t.route.middleware)?BR(e,()=>IC(e)):IC(e)}function BR(e,t){return aB(e,t,r=>{if(yB(r))throw r;return r},mB,n);function n(r,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(f=>f.route.id===a),0),Math.max(c.findIndex(f=>f.shouldCallHandler()),0)),h=ji(c,c[d].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:r}})}}}async function aB(e,t,n,r,a){let{matches:o,request:c,params:d,context:h,unstable_pattern:f}=e,m=o.flatMap(y=>y.route.middleware?y.route.middleware.map(v=>[y.route.id,v]):[]);return await zR({request:c,params:d,context:h,unstable_pattern:f},m,t,n,r,a)}async function zR(e,t,n,r,a,o,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let h=t[c];if(!h)return await n();let[f,m]=h,p,y=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await zR(e,t,n,r,a,o,c+1)},p.value}catch(v){return p={value:await o(v,f,p)},p.value}};try{let v=await m(e,y),S=v!=null?r(v):void 0;return a(S)?S:p?S??p.value:(p={value:await y()},p.value)}catch(v){return await o(v,f,p)}}function FR(e,t,n,r,a){let o=IR({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=rB(r.route,$n(n.method)?"action":"loader",t,e,a);return{middleware:o,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Ov(e,t,n,r,a,o,c,d,h=null,f){let m=!1,p=FR(e,t,n,a,o);return{...a,_lazyPromises:p,shouldLoad:d,shouldRevalidateArgs:h,shouldCallHandler(y){return m=!0,h?typeof f=="boolean"?Zu(a,{...h,defaultShouldRevalidate:f}):typeof y=="boolean"?Zu(a,{...h,defaultShouldRevalidate:y}):Zu(a,h):d},resolve(y){let{lazy:v,loader:S,middleware:N}=a.route,C=m||d||y&&!$n(n.method)&&(v||S),j=N&&N.length>0&&!S&&!v;return C&&($n(n.method)||!j)?oB({request:n,unstable_pattern:r,match:a,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:y,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function rc(e,t,n,r,a,o,c,d=null){return r.map(h=>h.route.id!==a.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:d,shouldCallHandler:()=>!1,_lazyPromises:FR(e,t,n,h,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Ov(e,t,n,Hd(r),h,o,c,!0,d))}async function iB(e,t,n,r,a,o){n.some(f=>f._lazyPromises?.middleware)&&await Promise.all(n.map(f=>f._lazyPromises?.middleware));let c={request:t,unstable_pattern:Hd(n),params:n[0].params,context:a,matches:n},h=await e({...c,fetcherKey:r,runClientMiddleware:f=>{let m=c;return BR(m,()=>f({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(f=>[f._lazyPromises?.handler,f._lazyPromises?.route]))}catch{}return h}async function oB({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:a,handlerOverride:o,scopedContext:c}){let d,h,f=$n(e.method),m=f?"action":"loader",p=y=>{let v,S=new Promise((j,E)=>v=E);h=()=>v(),e.signal.addEventListener("abort",h);let N=j=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:c},...j!==void 0?[j]:[]),C=(async()=>{try{return{type:"data",result:await(o?o(E=>N(E)):N())}}catch(j){return{type:"error",result:j}}})();return Promise.race([C,S])};try{let y=f?n.route.action:n.route.loader;if(r||a)if(y){let v,[S]=await Promise.all([p(y).catch(N=>{v=N}),r,a]);if(v!==void 0)throw v;d=S}else{await r;let v=f?n.route.action:n.route.loader;if(v)[d]=await Promise.all([p(v),a]);else if(m==="action"){let S=new URL(e.url),N=S.pathname+S.search;throw as(405,{method:e.method,pathname:N,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)d=await p(y);else{let v=new URL(e.url),S=v.pathname+v.search;throw as(404,{pathname:S})}}catch(y){return{type:"error",result:y}}finally{h&&e.signal.removeEventListener("abort",h)}return d}async function lB(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function cB(e){let{result:t,type:n}=e;if(lb(t)){let r;try{r=await lB(t)}catch(a){return{type:"error",error:a}}return n==="error"?{type:"error",error:new Ud(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?UC(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:hB(t),statusCode:xd(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:xd(t)?t.status:void 0}:UC(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function uB(e,t,n,r,a){let o=e.headers.get("Location");if(nt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!ib(o)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);o=kv(new URL(t.url),c,a,o),e.headers.set("Location",o)}return e}function BC(e,t,n,r){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(ib(e)){let o=e,c=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(a.includes(c.protocol))throw new Error("Invalid redirect location");let d=ds(c.pathname,n)!=null;if(c.origin===t.origin&&d)return c.pathname+c.search+c.hash}try{let o=r.createURL(e);if(a.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Gl(e,t,n,r){let a=e.createURL($R(t)).toString(),o={signal:n};if(r&&$n(r.formMethod)){let{formMethod:c,formEncType:d}=r;o.method=c.toUpperCase(),d==="application/json"?(o.headers=new Headers({"Content-Type":d}),o.body=JSON.stringify(r.json)):d==="text/plain"?o.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?o.body=Mv(r.formData):o.body=r.formData}return new Request(a,o)}function Mv(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function zC(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function dB(e,t,n,r=!1,a=!1){let o={},c=null,d,h=!1,f={},m=n&&_r(n[1])?n[1].error:void 0;return e.forEach(p=>{if(!(p.route.id in t))return;let y=p.route.id,v=t[y];if(nt(!Mo(v),"Cannot handle redirect results in processLoaderData"),_r(v)){let S=v.error;if(m!==void 0&&(S=m,m=void 0),c=c||{},a)c[y]=S;else{let N=ji(e,y);c[N.route.id]==null&&(c[N.route.id]=S)}r||(o[y]=PR),h||(h=!0,d=xd(v.error)?v.error.status:500),v.headers&&(f[y]=v.headers)}else o[y]=v.data,v.statusCode&&v.statusCode!==200&&!h&&(d=v.statusCode),v.headers&&(f[y]=v.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:c,statusCode:d||200,loaderHeaders:f}}function FC(e,t,n,r,a,o){let{loaderData:c,errors:d}=dB(t,n,r);return a.filter(h=>!h.matches||h.matches.some(f=>f.shouldLoad)).forEach(h=>{let{key:f,match:m,controller:p}=h;if(p&&p.signal.aborted)return;let y=o[f];if(nt(y,"Did not find corresponding fetcher result"),_r(y)){let v=ji(e.matches,m?.route.id);d&&d[v.route.id]||(d={...d,[v.route.id]:y.error}),e.fetchers.delete(f)}else if(Mo(y))nt(!1,"Unhandled fetcher revalidation redirect");else{let v=$a(y.data);e.fetchers.set(f,v)}}),{loaderData:c,errors:d}}function $C(e,t,n,r){let a=Object.entries(t).filter(([,o])=>o!==PR).reduce((o,[c,d])=>(o[c]=d,o),{});for(let o of n){let c=o.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&o.route.loader&&(a[c]=e[c]),r&&r.hasOwnProperty(c))break}return a}function VC(e){return e?_r(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ji(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function jh(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function as(e,{pathname:t,routeId:n,method:r,type:a,message:o}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?d=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?d=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(d=`Invalid request method "${r.toUpperCase()}"`)),new Ud(e||500,c,new Error(d),!0)}function Ch(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(Mo(a))return{key:r,result:a}}}function $R(e){let t=typeof e=="string"?Yi(e):e;return ua({...t,hash:""})}function fB(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function hB(e){return new Ud(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function mB(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&pB(n))}function pB(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function gB(e){return lb(e.result)&&OR.has(e.result.status)}function _r(e){return e.type==="error"}function Mo(e){return(e&&e.type)==="redirect"}function UC(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function lb(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function xB(e){return OR.has(e)}function yB(e){return lb(e)&&xB(e.status)&&e.headers.has("Location")}function vB(e){return YI.has(e.toUpperCase())}function $n(e){return WI.has(e.toUpperCase())}function cb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Zh(e,t){let n=typeof t=="string"?Yi(t).search:t.search;if(e[e.length-1].route.index&&cb(n||""))return e[e.length-1];let r=_R(e);return r[r.length-1]}function HC(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:o,json:c}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function py(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function bB(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ku(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function wB(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function $a(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function SB(e,t){try{let n=e.sessionStorage.getItem(MR);if(n){let r=JSON.parse(n);for(let[a,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function NB(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(MR,JSON.stringify(n))}catch(r){Zt(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function GC(){let e,t,n=new Promise((r,a)=>{e=async o=>{r(o);try{await n}catch{}},t=async o=>{a(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Jo=x.createContext(null);Jo.displayName="DataRouter";var Gd=x.createContext(null);Gd.displayName="DataRouterState";var VR=x.createContext(!1);function jB(){return x.useContext(VR)}var ub=x.createContext({isTransitioning:!1});ub.displayName="ViewTransition";var UR=x.createContext(new Map);UR.displayName="Fetchers";var CB=x.createContext(null);CB.displayName="Await";var Fr=x.createContext(null);Fr.displayName="Navigation";var sp=x.createContext(null);sp.displayName="Location";var xs=x.createContext({outlet:null,matches:[],isDataRoute:!1});xs.displayName="Route";var db=x.createContext(null);db.displayName="RouteError";var HR="REACT_ROUTER_ERROR",EB="REDIRECT",TB="ROUTE_ERROR_RESPONSE";function _B(e){if(e.startsWith(`${HR}:${EB}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function RB(e){if(e.startsWith(`${HR}:${TB}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ud(t.status,t.statusText,t.data)}catch{}}function DB(e,{relative:t}={}){nt(wc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=x.useContext(Fr),{hash:a,pathname:o,search:c}=qd(e,{relative:t}),d=o;return n!=="/"&&(d=o==="/"?n:na([n,o])),r.createHref({pathname:d,search:c,hash:a})}function wc(){return x.useContext(sp)!=null}function ga(){return nt(wc(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(sp).location}var GR="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qR(e){x.useContext(Fr).static||x.useLayoutEffect(e)}function Sc(){let{isDataRoute:e}=x.useContext(xs);return e?GB():kB()}function kB(){nt(wc(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Jo),{basename:t,navigator:n}=x.useContext(Fr),{matches:r}=x.useContext(xs),{pathname:a}=ga(),o=JSON.stringify(np(r)),c=x.useRef(!1);return qR(()=>{c.current=!0}),x.useCallback((h,f={})=>{if(Zt(c.current,GR),!c.current)return;if(typeof h=="number"){n.go(h);return}let m=rp(h,JSON.parse(o),a,f.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:na([t,m.pathname])),(f.replace?n.replace:n.push)(m,f.state,f)},[t,n,o,a,e])}var AB=x.createContext(null);function OB(e){let t=x.useContext(xs).outlet;return x.useMemo(()=>t&&x.createElement(AB.Provider,{value:e},t),[t,e])}function WR(){let{matches:e}=x.useContext(xs),t=e[e.length-1];return t?t.params:{}}function qd(e,{relative:t}={}){let{matches:n}=x.useContext(xs),{pathname:r}=ga(),a=JSON.stringify(np(n));return x.useMemo(()=>rp(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function MB(e,t,n,r,a){nt(wc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=x.useContext(Fr),{matches:c}=x.useContext(xs),d=c[c.length-1],h=d?d.params:{},f=d?d.pathname:"/",m=d?d.pathnameBase:"/",p=d&&d.route;{let E=p&&p.path||"";YR(f,!p||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
+
12
+ Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=ga(),v;v=y;let S=v.pathname||"/",N=S;if(m!=="/"){let E=m.replace(/^\//,"").split("/");N="/"+S.replace(/^\//,"").split("/").slice(E.length).join("/")}let C=Ni(e,{pathname:N});return Zt(p||C!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Zt(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),zB(C&&C.map(E=>Object.assign({},E,{params:Object.assign({},h,E.params),pathname:na([m,o.encodeLocation?o.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:na([m,o.encodeLocation?o.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),c,n,r,a)}function PB(){let e=HB(),t=xd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:o},"ErrorBoundary")," or"," ",x.createElement("code",{style:o},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:a},n):null,c)}var LB=x.createElement(PB,null),KR=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=RB(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(xs.Provider,{value:this.props.routeContext},x.createElement(db.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(IB,{error:e},t):t}};KR.contextType=VR;var gy=new WeakMap;function IB({children:e,error:t}){let{basename:n}=x.useContext(Fr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=_B(t.digest);if(r){let a=gy.get(t);if(a)throw a;let o=DR(r.location,n);if(RR&&!gy.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw gy.set(t,c),c}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function BB({routeContext:e,match:t,children:n}){let r=x.useContext(Jo);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(xs.Provider,{value:e},n)}function zB(e,t=[],n=null,r=null,a=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,c=n?.errors;if(c!=null){let m=o.findIndex(p=>p.route.id&&c?.[p.route.id]!==void 0);nt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let d=!1,h=-1;if(n)for(let m=0;m<o.length;m++){let p=o[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(h=m),p.route.id){let{loaderData:y,errors:v}=n,S=p.route.loader&&!y.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||S){d=!0,h>=0?o=o.slice(0,h+1):o=[o[0]];break}}}let f=n&&r?(m,p)=>{r(m,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:Hd(n.matches),errorInfo:p})}:void 0;return o.reduceRight((m,p,y)=>{let v,S=!1,N=null,C=null;n&&(v=c&&p.route.id?c[p.route.id]:void 0,N=p.route.errorElement||LB,d&&(h<0&&y===0?(YR("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):h===y&&(S=!0,C=p.route.hydrateFallbackElement||null)));let j=t.concat(o.slice(0,y+1)),E=()=>{let R;return v?R=N:S?R=C:p.route.Component?R=x.createElement(p.route.Component,null):p.route.element?R=p.route.element:R=m,x.createElement(BB,{match:p,routeContext:{outlet:m,matches:j,isDataRoute:n!=null},children:R})};return n&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?x.createElement(KR,{location:n.location,revalidation:n.revalidation,component:N,error:v,children:E(),routeContext:{outlet:null,matches:j,isDataRoute:!0},onError:f}):E()},null)}function fb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function FB(e){let t=x.useContext(Jo);return nt(t,fb(e)),t}function $B(e){let t=x.useContext(Gd);return nt(t,fb(e)),t}function VB(e){let t=x.useContext(xs);return nt(t,fb(e)),t}function hb(e){let t=VB(e),n=t.matches[t.matches.length-1];return nt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function UB(){return hb("useRouteId")}function HB(){let e=x.useContext(db),t=$B("useRouteError"),n=hb("useRouteError");return e!==void 0?e:t.errors?.[n]}function GB(){let{router:e}=FB("useNavigate"),t=hb("useNavigate"),n=x.useRef(!1);return qR(()=>{n.current=!0}),x.useCallback(async(a,o={})=>{Zt(n.current,GR),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var qC={};function YR(e,t,n){!t&&!qC[e]&&(qC[e]=!0,Zt(!1,n))}var WC={};function KC(e,t){!e&&!WC[t]&&(WC[t]=!0,console.warn(t))}var qB="useOptimistic",YC=tp[qB],WB=()=>{};function KB(e){return YC?YC(e):[e,WB]}function YB(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Zt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:x.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Zt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:x.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Zt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:x.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var XB=["HydrateFallback","hydrateFallbackElement"],QB=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function JB({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=jB()||r;let[o,c]=x.useState(e.state),[d,h]=KB(o),[f,m]=x.useState(),[p,y]=x.useState({isTransitioning:!1}),[v,S]=x.useState(),[N,C]=x.useState(),[j,E]=x.useState(),R=x.useRef(new Map),A=x.useCallback((D,{deletedFetchers:B,newErrors:W,flushSync:M,viewTransitionOpts:V})=>{W&&n&&Object.values(W).forEach(F=>n(F,{location:D.location,params:D.matches[0]?.params??{},unstable_pattern:Hd(D.matches)})),D.fetchers.forEach((F,H)=>{F.data!==void 0&&R.current.set(H,F.data)}),B.forEach(F=>R.current.delete(F)),KC(M===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let G=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(KC(V==null||G,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!V||!G){t&&M?t(()=>c(D)):r===!1?c(D):x.startTransition(()=>{r===!0&&h(F=>XC(F,D)),c(D)});return}if(t&&M){t(()=>{N&&(v?.resolve(),N.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:V.currentLocation,nextLocation:V.nextLocation})});let F=e.window.document.startViewTransition(()=>{t(()=>c(D))});F.finished.finally(()=>{t(()=>{S(void 0),C(void 0),m(void 0),y({isTransitioning:!1})})}),t(()=>C(F));return}N?(v?.resolve(),N.skipTransition(),E({state:D,currentLocation:V.currentLocation,nextLocation:V.nextLocation})):(m(D),y({isTransitioning:!0,flushSync:!1,currentLocation:V.currentLocation,nextLocation:V.nextLocation}))},[e.window,t,N,v,r,h,n]);x.useLayoutEffect(()=>e.subscribe(A),[e,A]),x.useEffect(()=>{p.isTransitioning&&!p.flushSync&&S(new QB)},[p]),x.useEffect(()=>{if(v&&f&&e.window){let D=f,B=v.promise,W=e.window.document.startViewTransition(async()=>{r===!1?c(D):x.startTransition(()=>{r===!0&&h(M=>XC(M,D)),c(D)}),await B});W.finished.finally(()=>{S(void 0),C(void 0),m(void 0),y({isTransitioning:!1})}),C(W)}},[f,v,e.window,r,h]),x.useEffect(()=>{v&&f&&d.location.key===f.location.key&&v.resolve()},[v,N,d.location,f]),x.useEffect(()=>{!p.isTransitioning&&j&&(m(j.state),y({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}),E(void 0))},[p.isTransitioning,j]);let _=x.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:D=>e.navigate(D),push:(D,B,W)=>e.navigate(D,{state:B,preventScrollReset:W?.preventScrollReset}),replace:(D,B,W)=>e.navigate(D,{replace:!0,state:B,preventScrollReset:W?.preventScrollReset})}),[e]),O=e.basename||"/",T=x.useMemo(()=>({router:e,navigator:_,static:!1,basename:O,onError:n}),[e,_,O,n]);return x.createElement(x.Fragment,null,x.createElement(Jo.Provider,{value:T},x.createElement(Gd.Provider,{value:d},x.createElement(UR.Provider,{value:R.current},x.createElement(ub.Provider,{value:p},x.createElement(r6,{basename:O,location:d.location,navigationType:d.historyAction,navigator:_,unstable_useTransitions:r},x.createElement(ZB,{routes:e.routes,future:e.future,state:d,onError:n})))))),null)}function XC(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var ZB=x.memo(e6);function e6({routes:e,future:t,state:n,onError:r}){return MB(e,void 0,n,r,t)}function t6({to:e,replace:t,state:n,relative:r}){nt(wc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=x.useContext(Fr);Zt(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=x.useContext(xs),{pathname:c}=ga(),d=Sc(),h=rp(e,np(o),c,r==="path"),f=JSON.stringify(h);return x.useEffect(()=>{d(JSON.parse(f),{replace:t,state:n,relative:r})},[d,f,r,t,n]),null}function n6(e){return OB(e.context)}function r6({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1,unstable_useTransitions:c}){nt(!wc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),h=x.useMemo(()=>({basename:d,navigator:a,static:o,unstable_useTransitions:c,future:{}}),[d,a,o,c]);typeof n=="string"&&(n=Yi(n));let{pathname:f="/",search:m="",hash:p="",state:y=null,key:v="default"}=n,S=x.useMemo(()=>{let N=ds(f,d);return N==null?null:{location:{pathname:N,search:m,hash:p,state:y,key:v},navigationType:r}},[d,f,m,p,y,v,r]);return Zt(S!=null,`<Router basename="${d}"> is not able to match the URL "${f}${m}${p}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:x.createElement(Fr.Provider,{value:h},x.createElement(sp.Provider,{children:t,value:S}))}var em="get",tm="application/x-www-form-urlencoded";function ap(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function s6(e){return ap(e)&&e.tagName.toLowerCase()==="button"}function a6(e){return ap(e)&&e.tagName.toLowerCase()==="form"}function i6(e){return ap(e)&&e.tagName.toLowerCase()==="input"}function o6(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function l6(e,t){return e.button===0&&(!t||t==="_self")&&!o6(e)}function Pv(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function c6(e,t){let n=Pv(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}var Eh=null;function u6(){if(Eh===null)try{new FormData(document.createElement("form"),0),Eh=!1}catch{Eh=!0}return Eh}var d6=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xy(e){return e!=null&&!d6.has(e)?(Zt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${tm}"`),null):e}function f6(e,t){let n,r,a,o,c;if(a6(e)){let d=e.getAttribute("action");r=d?ds(d,t):null,n=e.getAttribute("method")||em,a=xy(e.getAttribute("enctype"))||tm,o=new FormData(e)}else if(s6(e)||i6(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(r=h?ds(h,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||em,a=xy(e.getAttribute("formenctype"))||xy(d.getAttribute("enctype"))||tm,o=new FormData(d,e),!u6()){let{name:f,type:m,value:p}=e;if(m==="image"){let y=f?`${f}.`:"";o.append(`${y}x`,"0"),o.append(`${y}y`,"0")}else f&&o.append(f,p)}}else{if(ap(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=em,r=null,a=tm,c=e}return o&&a==="text/plain"&&(c=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function mb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function h6(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&ds(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function m6(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function p6(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function g6(e,t,n){let r=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let c=await m6(o,n);return c.links?c.links():[]}return[]}));return b6(r.flat(1).filter(p6).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function QC(e,t,n,r,a,o){let c=(h,f)=>n[f]?h.route.id!==n[f].route.id:!0,d=(h,f)=>n[f].pathname!==h.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==h.params["*"];return o==="assets"?t.filter((h,f)=>c(h,f)||d(h,f)):o==="data"?t.filter((h,f)=>{let m=r.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(c(h,f)||d(h,f))return!0;if(h.route.shouldRevalidate){let p=h.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function x6(e,t,{includeHydrateFallback:n}={}){return y6(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function y6(e){return[...new Set(e)]}function v6(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function b6(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let o=JSON.stringify(v6(a));return n.has(o)||(n.add(o),r.push({key:o,link:a})),r},[])}function XR(){let e=x.useContext(Jo);return mb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function w6(){let e=x.useContext(Gd);return mb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var pb=x.createContext(void 0);pb.displayName="FrameworkContext";function QR(){let e=x.useContext(pb);return mb(e,"You must render this element inside a <HydratedRouter> element"),e}function S6(e,t){let n=x.useContext(pb),[r,a]=x.useState(!1),[o,c]=x.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:f,onMouseLeave:m,onTouchStart:p}=t,y=x.useRef(null);x.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let N=j=>{j.forEach(E=>{c(E.isIntersecting)})},C=new IntersectionObserver(N,{threshold:.5});return y.current&&C.observe(y.current),()=>{C.disconnect()}}},[e]),x.useEffect(()=>{if(r){let N=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(N)}}},[r]);let v=()=>{a(!0)},S=()=>{a(!1),c(!1)};return n?e!=="intent"?[o,y,{}]:[o,y,{onFocus:Au(d,v),onBlur:Au(h,S),onMouseEnter:Au(f,v),onMouseLeave:Au(m,S),onTouchStart:Au(p,v)}]:[!1,y,{}]}function Au(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function N6({page:e,...t}){let{router:n}=XR(),r=x.useMemo(()=>Ni(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?x.createElement(C6,{page:e,matches:r,...t}):null}function j6(e){let{manifest:t,routeModules:n}=QR(),[r,a]=x.useState([]);return x.useEffect(()=>{let o=!1;return g6(e,t,n).then(c=>{o||a(c)}),()=>{o=!0}},[e,t,n]),r}function C6({page:e,matches:t,...n}){let r=ga(),{future:a,manifest:o,routeModules:c}=QR(),{basename:d}=XR(),{loaderData:h,matches:f}=w6(),m=x.useMemo(()=>QC(e,t,f,o,r,"data"),[e,t,f,o,r]),p=x.useMemo(()=>QC(e,t,f,o,r,"assets"),[e,t,f,o,r]),y=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let N=new Set,C=!1;if(t.forEach(E=>{let R=o.routes[E.route.id];!R||!R.hasLoader||(!m.some(A=>A.route.id===E.route.id)&&E.route.id in h&&c[E.route.id]?.shouldRevalidate||R.hasClientLoader?C=!0:N.add(E.route.id))}),N.size===0)return[];let j=h6(e,d,a.unstable_trailingSlashAwareDataRequests,"data");return C&&N.size>0&&j.searchParams.set("_routes",t.filter(E=>N.has(E.route.id)).map(E=>E.route.id).join(",")),[j.pathname+j.search]},[d,a.unstable_trailingSlashAwareDataRequests,h,r,o,m,t,e,c]),v=x.useMemo(()=>x6(p,o),[p,o]),S=j6(p);return x.createElement(x.Fragment,null,y.map(N=>x.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...n})),v.map(N=>x.createElement("link",{key:N,rel:"modulepreload",href:N,...n})),S.map(({key:N,link:C})=>x.createElement("link",{key:N,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function E6(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var T6=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{T6&&(window.__reactRouterVersion="7.13.0")}catch{}function _6(e,t){return ZI({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:pI({window:t?.window}),hydrationData:R6(),routes:e,mapRouteProperties:YB,hydrationRouteProperties:XB,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function R6(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:D6(e.errors)}),e}function D6(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new Ud(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let c=new o(a.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}var JR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ZR=x.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:o,replace:c,state:d,target:h,to:f,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y,...v},S){let{basename:N,unstable_useTransitions:C}=x.useContext(Fr),j=typeof f=="string"&&JR.test(f),E=DR(f,N);f=E.to;let R=DB(f,{relative:a}),[A,_,O]=S6(r,v),T=M6(f,{replace:c,state:d,target:h,preventScrollReset:m,relative:a,viewTransition:p,unstable_defaultShouldRevalidate:y,unstable_useTransitions:C});function D(W){t&&t(W),W.defaultPrevented||T(W)}let B=x.createElement("a",{...v,...O,href:E.absoluteURL||R,onClick:E.isExternal||o?t:D,ref:E6(S,_),target:h,"data-discover":!j&&n==="render"?"true":void 0});return A&&!j?x.createElement(x.Fragment,null,B,x.createElement(N6,{page:R})):B});ZR.displayName="Link";var k6=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:o,to:c,viewTransition:d,children:h,...f},m){let p=qd(c,{relative:f.relative}),y=ga(),v=x.useContext(Gd),{navigator:S,basename:N}=x.useContext(Fr),C=v!=null&&F6(p)&&d===!0,j=S.encodeLocation?S.encodeLocation(p).pathname:p.pathname,E=y.pathname,R=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(E=E.toLowerCase(),R=R?R.toLowerCase():null,j=j.toLowerCase()),R&&N&&(R=ds(R,N)||R);const A=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let _=E===j||!a&&E.startsWith(j)&&E.charAt(A)==="/",O=R!=null&&(R===j||!a&&R.startsWith(j)&&R.charAt(j.length)==="/"),T={isActive:_,isPending:O,isTransitioning:C},D=_?t:void 0,B;typeof r=="function"?B=r(T):B=[r,_?"active":null,O?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let W=typeof o=="function"?o(T):o;return x.createElement(ZR,{...f,"aria-current":D,className:B,ref:m,style:W,to:c,viewTransition:d},typeof h=="function"?h(T):h)});k6.displayName="NavLink";var A6=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:c=em,action:d,onSubmit:h,relative:f,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y,...v},S)=>{let{unstable_useTransitions:N}=x.useContext(Fr),C=B6(),j=z6(d,{relative:f}),E=c.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&JR.test(d),A=_=>{if(h&&h(_),_.defaultPrevented)return;_.preventDefault();let O=_.nativeEvent.submitter,T=O?.getAttribute("formmethod")||c,D=()=>C(O||_.currentTarget,{fetcherKey:t,method:T,navigate:n,replace:a,state:o,relative:f,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y});N&&n!==!1?x.startTransition(()=>D()):D()};return x.createElement("form",{ref:S,method:E,action:j,onSubmit:r?h:A,...v,"data-discover":!R&&e==="render"?"true":void 0})});A6.displayName="Form";function O6(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function eD(e){let t=x.useContext(Jo);return nt(t,O6(e)),t}function M6(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let f=Sc(),m=ga(),p=qd(e,{relative:o});return x.useCallback(y=>{if(l6(y,t)){y.preventDefault();let v=n!==void 0?n:ua(m)===ua(p),S=()=>f(e,{replace:v,state:r,preventScrollReset:a,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:d});h?x.startTransition(()=>S()):S()}},[m,f,p,n,r,t,e,a,o,c,d,h])}function P6(e){Zt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=x.useRef(Pv(e)),n=x.useRef(!1),r=ga(),a=x.useMemo(()=>c6(r.search,n.current?null:t.current),[r.search]),o=Sc(),c=x.useCallback((d,h)=>{const f=Pv(typeof d=="function"?d(new URLSearchParams(a)):d);n.current=!0,o("?"+f,h)},[o,a]);return[a,c]}var L6=0,I6=()=>`__${String(++L6)}__`;function B6(){let{router:e}=eD("useSubmit"),{basename:t}=x.useContext(Fr),n=UB(),r=e.fetch,a=e.navigate;return x.useCallback(async(o,c={})=>{let{action:d,method:h,encType:f,formData:m,body:p}=f6(o,t);if(c.navigate===!1){let y=c.fetcherKey||I6();await r(y,n,c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:p,formMethod:c.method||h,formEncType:c.encType||f,flushSync:c.flushSync})}else await a(c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:p,formMethod:c.method||h,formEncType:c.encType||f,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,a,t,n])}function z6(e,{relative:t}={}){let{basename:n}=x.useContext(Fr),r=x.useContext(xs);nt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),o={...qd(e||".",{relative:t})},c=ga();if(e==null){o.search=c.search;let d=new URLSearchParams(o.search),h=d.getAll("index");if(h.some(m=>m==="")){d.delete("index"),h.filter(p=>p).forEach(p=>d.append("index",p));let m=d.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:na([n,o.pathname])),ua(o)}function F6(e,{relative:t}={}){let n=x.useContext(ub);nt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=eD("useViewTransitionState"),a=qd(e,{relative:t});if(!n.isTransitioning)return!1;let o=ds(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=ds(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ym(a.pathname,c)!=null||ym(a.pathname,o)!=null}var Nc=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(){}},$6={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},V6=class{#e=$6;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Po=new V6;function U6(e){setTimeout(e,0)}var Uo=typeof window>"u"||"Deno"in globalThis;function Jn(){}function H6(e,t){return typeof e=="function"?e(t):e}function Lv(e){return typeof e=="number"&&e>=0&&e!==1/0}function tD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function _i(e,t){return typeof e=="function"?e(t):e}function is(e,t){return typeof e=="function"?e(t):e}function JC(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:c,stale:d}=e;if(c){if(r){if(t.queryHash!==gb(c,t.options))return!1}else if(!yd(t.queryKey,c))return!1}if(n!=="all"){const h=t.isActive();if(n==="active"&&!h||n==="inactive"&&h)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||a&&a!==t.state.fetchStatus||o&&!o(t))}function ZC(e,t){const{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Ho(t.options.mutationKey)!==Ho(o))return!1}else if(!yd(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function gb(e,t){return(t?.queryKeyHashFn||Ho)(e)}function Ho(e){return JSON.stringify(e,(t,n)=>Iv(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function yd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>yd(e[n],t[n])):!1}var G6=Object.prototype.hasOwnProperty;function nD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=eE(e)&&eE(t);if(!r&&!(Iv(e)&&Iv(t)))return t;const o=(r?e:Object.keys(e)).length,c=r?t:Object.keys(t),d=c.length,h=r?new Array(d):{};let f=0;for(let m=0;m<d;m++){const p=r?m:c[m],y=e[p],v=t[p];if(y===v){h[p]=y,(r?m<o:G6.call(e,p))&&f++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){h[p]=v;continue}const S=nD(y,v,n+1);h[p]=S,S===y&&f++}return o===d&&f===o?e:h}function vm(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function eE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Iv(e){if(!tE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!tE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function tE(e){return Object.prototype.toString.call(e)==="[object Object]"}function q6(e){return new Promise(t=>{Po.setTimeout(t,e)})}function Bv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?nD(e,t):t}function W6(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function K6(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xb=Symbol();function rD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===xb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function yb(e,t){return typeof e=="function"?e(...t):!!e}function Y6(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??=t(),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var X6=class extends Nc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Uo&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},vb=new X6;function zv(){let e,t;const n=new Promise((a,o)=>{e=a,t=o});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var Q6=U6;function J6(){let e=[],t=0,n=d=>{d()},r=d=>{d()},a=Q6;const o=d=>{t?e.push(d):a(()=>{n(d)})},c=()=>{const d=e;e=[],d.length&&a(()=>{r(()=>{d.forEach(h=>{n(h)})})})};return{batch:d=>{let h;t++;try{h=d()}finally{t--,t||c()}return h},batchCalls:d=>(...h)=>{o(()=>{d(...h)})},schedule:o,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{r=d},setScheduler:d=>{a=d}}}var yn=J6(),Z6=class extends Nc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Uo&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},bm=new Z6;function ez(e){return Math.min(1e3*2**e,3e4)}function sD(e){return(e??"online")==="online"?bm.isOnline():!0}var Fv=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function aD(e){let t=!1,n=0,r;const a=zv(),o=()=>a.status!=="pending",c=N=>{if(!o()){const C=new Fv(N);y(C),e.onCancel?.(C)}},d=()=>{t=!0},h=()=>{t=!1},f=()=>vb.isFocused()&&(e.networkMode==="always"||bm.isOnline())&&e.canRun(),m=()=>sD(e.networkMode)&&e.canRun(),p=N=>{o()||(r?.(),a.resolve(N))},y=N=>{o()||(r?.(),a.reject(N))},v=()=>new Promise(N=>{r=C=>{(o()||f())&&N(C)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),S=()=>{if(o())return;let N;const C=n===0?e.initialPromise:void 0;try{N=C??e.fn()}catch(j){N=Promise.reject(j)}Promise.resolve(N).then(p).catch(j=>{if(o())return;const E=e.retry??(Uo?0:3),R=e.retryDelay??ez,A=typeof R=="function"?R(n,j):R,_=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,j);if(t||!_){y(j);return}n++,e.onFail?.(n,j),q6(A).then(()=>f()?void 0:v()).then(()=>{t?y(j):S()})})};return{promise:a,status:()=>a.status,cancel:c,continue:()=>(r?.(),a),cancelRetry:d,continueRetry:h,canStart:m,start:()=>(m()?S():v().then(S),a)}}var iD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Lv(this.gcTime)&&(this.#e=Po.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Uo?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Po.clearTimeout(this.#e),this.#e=void 0)}},tz=class extends iD{#e;#t;#n;#s;#r;#i;#o;constructor(e){super(),this.#o=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=rE(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=rE(this.options);t.data!==void 0&&(this.setState(nE(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Bv(this.state.data,e,this.options);return this.#a({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Jn).catch(Jn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>is(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>_i(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!tD(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.options)}const n=new AbortController,r=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},a=()=>{const d=rD(this.options,t),f=(()=>{const m={client:this.#s,queryKey:this.queryKey,meta:this.meta};return r(m),m})();return this.#o=!1,this.options.persister?this.options.persister(d,f,this):d(f)},c=(()=>{const d={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:a};return r(d),d})();this.options.behavior?.onFetch(c,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#a({type:"fetch",meta:c.fetchOptions?.meta}),this.#r=aD({initialPromise:t?.initialPromise,fn:c.fetchFn,onCancel:d=>{d instanceof Fv&&d.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(d,h)=>{this.#a({type:"failed",failureCount:d,error:h})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const d=await this.#r.start();if(d===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#n.config.onSuccess?.(d,this),this.#n.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof Fv){if(d.silent)return this.#r.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#a({type:"error",error:d}),this.#n.config.onError?.(d,this),this.#n.config.onSettled?.(this.state.data,d,this),d}finally{this.scheduleGc()}}#a(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...oD(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...nE(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const a=e.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),yn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function oD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function nE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var nz=class extends Nc{constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.#o=zv(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#i;#o;#a;#p;#f;#h;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),sE(this.#t,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $v(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $v(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof is(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!vm(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&aE(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||is(this.options.enabled,this.#t)!==is(t.enabled,this.#t)||_i(this.options.staleTime,this.#t)!==_i(t.staleTime,this.#t))&&this.#g();const a=this.#x();r&&(this.#t!==n||is(this.options.enabled,this.#t)!==is(t.enabled,this.#t)||a!==this.#l)&&this.#y(a)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return sz(this,n)&&(this.#s=n,this.#i=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Jn)),t}#g(){this.#b();const e=_i(this.options.staleTime,this.#t);if(Uo||this.#s.isStale||!Lv(e))return;const n=tD(this.#s.dataUpdatedAt,e)+1;this.#c=Po.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#x(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#l=e,!(Uo||is(this.options.enabled,this.#t)===!1||!Lv(this.#l)||this.#l===0)&&(this.#u=Po.setInterval(()=>{(this.options.refetchIntervalInBackground||vb.isFocused())&&this.#d()},this.#l))}#v(){this.#g(),this.#y(this.#x())}#b(){this.#c&&(Po.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Po.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,a=this.#s,o=this.#r,c=this.#i,h=e!==n?e.state:this.#n,{state:f}=e;let m={...f},p=!1,y;if(t._optimisticResults){const D=this.hasListeners(),B=!D&&sE(e,t),W=D&&aE(e,n,t,r);(B||W)&&(m={...m,...oD(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:S,status:N}=m;y=m.data;let C=!1;if(t.placeholderData!==void 0&&y===void 0&&N==="pending"){let D;a?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(D=a.data,C=!0):D=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,D!==void 0&&(N="success",y=Bv(a?.data,D,t),p=!0)}if(t.select&&y!==void 0&&!C)if(a&&y===o?.data&&t.select===this.#p)y=this.#f;else try{this.#p=t.select,y=t.select(y),y=Bv(a?.data,y,t),this.#f=y,this.#a=null}catch(D){this.#a=D}this.#a&&(v=this.#a,y=this.#f,S=Date.now(),N="error");const j=m.fetchStatus==="fetching",E=N==="pending",R=N==="error",A=E&&j,_=y!==void 0,T={status:N,fetchStatus:m.fetchStatus,isPending:E,isSuccess:N==="success",isError:R,isInitialLoading:A,isLoading:A,data:y,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:S,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>h.dataUpdateCount||m.errorUpdateCount>h.errorUpdateCount,isFetching:j,isRefetching:j&&!E,isLoadingError:R&&!_,isPaused:m.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:R&&_,isStale:bb(e,t),refetch:this.refetch,promise:this.#o,isEnabled:is(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const D=T.data!==void 0,B=T.status==="error"&&!D,W=G=>{B?G.reject(T.error):D&&G.resolve(T.data)},M=()=>{const G=this.#o=T.promise=zv();W(G)},V=this.#o;switch(V.status){case"pending":e.queryHash===n.queryHash&&W(V);break;case"fulfilled":(B||T.data!==V.value)&&M();break;case"rejected":(!B||T.error!==V.reason)&&M();break}}return T}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#i=this.options,this.#r.data!==void 0&&(this.#h=this.#t),vm(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,a=typeof r=="function"?r():r;if(a==="all"||!a&&!this.#m.size)return!0;const o=new Set(a??this.#m);return this.options.throwOnError&&o.add("error"),Object.keys(this.#s).some(c=>{const d=c;return this.#s[d]!==e[d]&&o.has(d)})};this.#N({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#N(e){yn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function rz(e,t){return is(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function sE(e,t){return rz(e,t)||e.state.data!==void 0&&$v(e,t,t.refetchOnMount)}function $v(e,t,n){if(is(t.enabled,e)!==!1&&_i(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&bb(e,t)}return!1}function aE(e,t,n,r){return(e!==t||is(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&bb(e,n)}function bb(e,t){return is(t.enabled,e)!==!1&&e.isStaleByTime(_i(t.staleTime,e))}function sz(e,t){return!vm(e.getCurrentResult(),t)}function iE(e){return{onFetch:(t,n)=>{const r=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],c=t.state.data?.pageParams||[];let d={pages:[],pageParams:[]},h=0;const f=async()=>{let m=!1;const p=S=>{Y6(S,()=>t.signal,()=>m=!0)},y=rD(t.options,t.fetchOptions),v=async(S,N,C)=>{if(m)return Promise.reject();if(N==null&&S.pages.length)return Promise.resolve(S);const E=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:N,direction:C?"backward":"forward",meta:t.options.meta};return p(O),O})(),R=await y(E),{maxPages:A}=t.options,_=C?K6:W6;return{pages:_(S.pages,R,A),pageParams:_(S.pageParams,N,A)}};if(a&&o.length){const S=a==="backward",N=S?az:oE,C={pages:o,pageParams:c},j=N(r,C);d=await v(C,j,S)}else{const S=e??o.length;do{const N=h===0?c[0]??r.initialPageParam:oE(r,d);if(h>0&&N==null)break;d=await v(d,N),h++}while(h<S)}return d};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function oE(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function az(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var iz=class extends iD{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||lD(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=aD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,c)=>{this.#r({type:"failed",failureCount:o,error:c})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",a=!this.#s.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const c=await this.options.onMutate?.(e,n);c!==this.state.context&&this.#r({type:"pending",context:c,variables:e,isPaused:a})}const o=await this.#s.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(c){Promise.reject(c)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(c){Promise.reject(c)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(c){Promise.reject(c)}throw this.#r({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),yn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function lD(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oz=class extends Nc{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new iz({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Th(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Th(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Th(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(a=>a.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Th(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){yn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>ZC(t,n))}findAll(e={}){return this.getAll().filter(t=>ZC(e,t))}notify(e){yn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return yn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Jn))))}};function Th(e){return e.options.scope?.id}var lz=class extends Nc{#e;#t=void 0;#n;#s;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),vm(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Ho(n.mutationKey)!==Ho(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#i()}mutate(t,n){return this.#s=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??lD();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){yn.batch(()=>{if(this.#s&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,n,r,a)}catch(o){Promise.reject(o)}try{this.#s.onSettled?.(t.data,null,n,r,a)}catch(o){Promise.reject(o)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,n,r,a)}catch(o){Promise.reject(o)}try{this.#s.onSettled?.(void 0,t.error,n,r,a)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},cz=class extends Nc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??gb(r,t);let o=this.get(a);return o||(o=new tz({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){yn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>JC(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>JC(e,n)):t}notify(e){yn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){yn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){yn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},uz=class{#e;#t;#n;#s;#r;#i;#o;#a;constructor(e={}){this.#e=e.queryCache||new cz,this.#t=e.mutationCache||new oz,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=vb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=bm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(_i(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,c=H6(t,o);if(c!==void 0)return this.#e.build(this,r).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return yn.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;yn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return yn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=yn.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Jn).catch(Jn)}invalidateQueries(e,t={}){return yn.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=yn.batch(()=>this.#e.findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,n);return n.throwOnError||(o=o.catch(Jn)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Jn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(_i(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jn).catch(Jn)}fetchInfiniteQuery(e){return e.behavior=iE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jn).catch(Jn)}ensureInfiniteQueryData(e){return e.behavior=iE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return bm.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(Ho(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{yd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Ho(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{yd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=gb(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===xb&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},cD=x.createContext(void 0),Ga=e=>{const t=x.useContext(cD);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},dz=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(cD.Provider,{value:e,children:t})),uD=x.createContext(!1),fz=()=>x.useContext(uD);uD.Provider;function hz(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var mz=x.createContext(hz()),pz=()=>x.useContext(mz),gz=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?yb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},xz=e=>{x.useEffect(()=>{e.clearReset()},[e])},yz=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||yb(n,[e.error,r])),vz=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},bz=(e,t)=>e.isLoading&&e.isFetching&&!t,wz=(e,t)=>e?.suspense&&t.isPending,lE=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Sz(e,t,n){const r=fz(),a=pz(),o=Ga(),c=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const d=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",vz(c),gz(c,a,d),xz(a);const h=!o.getQueryCache().get(c.queryHash),[f]=x.useState(()=>new t(o,c)),m=f.getOptimisticResult(c),p=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(y=>{const v=p?f.subscribe(yn.batchCalls(y)):Jn;return f.updateResult(),v},[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setOptions(c)},[c,f]),wz(c,m))throw lE(c,f,a);if(yz({result:m,errorResetBoundary:a,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw m.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(c,m),c.experimental_prefetchInRender&&!Uo&&bz(m,r)&&(h?lE(c,f,a):d?.promise)?.catch(Jn).finally(()=>{f.updateResult()}),c.notifyOnChangeProps?m:f.trackResult(m)}function wb(e,t){return Sz(e,nz)}function dD(e,t){const n=Ga(),[r]=x.useState(()=>new lz(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const a=x.useSyncExternalStore(x.useCallback(c=>r.subscribe(yn.batchCalls(c)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=x.useCallback((c,d)=>{r.mutate(c,d).catch(Jn)},[r]);if(a.error&&yb(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}const Bo=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,da=globalThis,ed="10.39.0";function ip(){return Sb(da),da}function Sb(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||ed,t[ed]=t[ed]||{}}function Nb(e,t,n=da){const r=n.__SENTRY__=n.__SENTRY__||{},a=r[ed]=r[ed]||{};return a[e]||(a[e]=t())}const Nz="Sentry Logger ",cE={};function fD(e){if(!("console"in da))return e();const t=da.console,n={},r=Object.keys(cE);r.forEach(a=>{const o=cE[a];n[a]=t[a],t[a]=o});try{return e()}finally{r.forEach(a=>{t[a]=n[a]})}}function jz(){Cb().enabled=!0}function Cz(){Cb().enabled=!1}function hD(){return Cb().enabled}function Ez(...e){jb("log",...e)}function Tz(...e){jb("warn",...e)}function _z(...e){jb("error",...e)}function jb(e,...t){Bo&&hD()&&fD(()=>{da.console[e](`${Nz}[${e}]:`,...t)})}function Cb(){return Bo?Nb("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const ks={enable:jz,disable:Cz,isEnabled:hD,log:Ez,warn:Tz,error:_z},mD=Object.prototype.toString;function Rz(e){switch(mD.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Oz(e,Error)}}function Dz(e,t){return mD.call(e)===`[object ${t}]`}function kz(e){return Dz(e,"Object")}function Az(e){return!!(e?.then&&typeof e.then=="function")}function Oz(e,t){try{return e instanceof t}catch{return!1}}function Mz(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Bo&&ks.log(`Failed to add non-enumerable property "${t}" to object`,e)}}let Ml;function op(e){if(Ml!==void 0)return Ml?Ml(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=da;return t in n&&typeof n[t]=="function"?(Ml=n[t],Ml(e)):(Ml=null,e())}function Vv(){return op(()=>Math.random())}function Pz(){return op(()=>Date.now())}function Lz(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Iz(){const e=da;return e.crypto||e.msCrypto}let yy;function Bz(){return Vv()*16}function td(e=Iz()){try{if(e?.randomUUID)return op(()=>e.randomUUID()).replace(/-/g,"")}catch{}return yy||(yy="10000000100040008000"+1e11),yy.replace(/[018]/g,t=>(t^(Bz()&15)>>t/4).toString(16))}const pD=1e3;function gD(){return Pz()/pD}function zz(){const{performance:e}=da;if(!e?.now||!e.timeOrigin)return gD;const t=e.timeOrigin;return()=>(t+op(()=>e.now()))/pD}let uE;function Fz(){return(uE??(uE=zz()))()}function $z(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Fz(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:td()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function xD(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=xD(r[a],t[a],n-1));return r}function dE(){return td()}const Uv="_sentrySpan";function fE(e,t){t?Mz(e,Uv,t):delete e[Uv]}function hE(e){return e[Uv]}const Vz=100;class zi{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:dE(),sampleRand:Vv()}}clone(){const t=new zi;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,fE(t,hE(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&$z(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof zi?n.getScopeData():kz(n)?t:void 0,{tags:a,attributes:o,extra:c,user:d,contexts:h,level:f,fingerprint:m=[],propagationContext:p,conversationId:y}=r||{};return this._tags={...this._tags,...a},this._attributes={...this._attributes,...o},this._extra={...this._extra,...c},this._contexts={...this._contexts,...h},d&&Object.keys(d).length&&(this._user=d),f&&(this._level=f),m.length&&(this._fingerprint=m),p&&(this._propagationContext=p),y&&(this._conversationId=y),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,fE(this,void 0),this._attachments=[],this.setPropagationContext({traceId:dE(),sampleRand:Vv()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:Vz;if(r<=0)return this;const a={timestamp:gD(),...t,message:t.message?Lz(t.message,2048):t.message};return this._breadcrumbs.push(a),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:hE(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=xD(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n?.event_id||td();if(!this._client)return Bo&&ks.warn("No client configured on scope - will not capture exception!"),r;const a=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:a,...n,event_id:r},this),r}captureMessage(t,n,r){const a=r?.event_id||td();if(!this._client)return Bo&&ks.warn("No client configured on scope - will not capture message!"),a;const o=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:o,...r,event_id:a},this),a}captureEvent(t,n){const r=t.event_id||n?.event_id||td();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(Bo&&ks.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function Uz(){return Nb("defaultCurrentScope",()=>new zi)}function Hz(){return Nb("defaultIsolationScope",()=>new zi)}class Gz{constructor(t,n){let r;t?r=t:r=new zi;let a;n?a=n:a=new zi,this._stack=[{scope:r}],this._isolationScope=a}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(a){throw this._popScope(),a}return Az(r)?r.then(a=>(this._popScope(),a),a=>{throw this._popScope(),a}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function uc(){const e=ip(),t=Sb(e);return t.stack=t.stack||new Gz(Uz(),Hz())}function qz(e){return uc().withScope(e)}function Wz(e,t){const n=uc();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function mE(e){return uc().withScope(()=>e(uc().getIsolationScope()))}function Kz(){return{withIsolationScope:mE,withScope:qz,withSetScope:Wz,withSetIsolationScope:(e,t)=>mE(t),getCurrentScope:()=>uc().getScope(),getIsolationScope:()=>uc().getIsolationScope()}}function Eb(e){const t=Sb(e);return t.acs?t.acs:Kz()}function Tb(){const e=ip();return Eb(e).getCurrentScope()}function Yz(){const e=ip();return Eb(e).getIsolationScope()}function yD(...e){const t=ip(),n=Eb(t);if(e.length===2){const[r,a]=e;return r?n.withSetScope(r,a):n.withScope(a)}return n.withScope(e[0])}function vD(){return Tb().getClient()}const Xz=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Qz(e){return e==="http"||e==="https"}function Jz(e,t=!1){const{host:n,path:r,pass:a,port:o,projectId:c,protocol:d,publicKey:h}=e;return`${d}://${h}${t&&a?`:${a}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${c}`}function Zz(e){const t=Xz.exec(e);if(!t){fD(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,a="",o="",c="",d=""]=t.slice(1);let h="",f=d;const m=f.split("/");if(m.length>1&&(h=m.slice(0,-1).join("/"),f=m.pop()),f){const p=f.match(/^\d+/);p&&(f=p[0])}return bD({host:o,pass:a,path:h,projectId:f,port:c,protocol:n,publicKey:r})}function bD(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function eF(e){if(!Bo)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(c=>e[c]?!1:(ks.error(`Invalid Sentry Dsn: ${c} missing`),!0))?!1:n.match(/^\d+$/)?Qz(r)?t&&isNaN(parseInt(t,10))?(ks.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(ks.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(ks.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function tF(e){const t=typeof e=="string"?Zz(e):bD(e);if(!(!t||!eF(t)))return t}function nF(e){if(e)return rF(e)?{captureContext:e}:aF(e)?{captureContext:e}:e}function rF(e){return e instanceof zi||typeof e=="function"}const sF=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function aF(e){return Object.keys(e).some(t=>sF.includes(t))}function iF(e,t){return Tb().captureException(e,nF(t))}function oF(){return Yz().lastEventId()}function lF(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function cF(e,t){const n=tF(e);if(!n)return"";const r=`${lF(n)}embed/error-page/`;let a=`dsn=${Jz(n)}`;for(const o in t)if(o!=="dsn"&&o!=="onClose")if(o==="user"){const c=t.user;if(!c)continue;c.name&&(a+=`&name=${encodeURIComponent(c.name)}`),c.email&&(a+=`&email=${encodeURIComponent(c.email)}`)}else a+=`&${encodeURIComponent(o)}=${encodeURIComponent(t[o])}`;return`${r}?${a}`}const _h=da,pE=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function gE(e={}){const t=_h.document,n=t?.head||t?.body;if(!n){pE&&ks.error("[showReportDialog] Global document not defined");return}const r=Tb(),o=vD()?.getDsn();if(!o){pE&&ks.error("[showReportDialog] DSN not configured");return}const c={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||oF()},d=_h.document.createElement("script");d.async=!0,d.crossOrigin="anonymous",d.src=cF(o,c);const{onLoad:h,onClose:f}=c;if(h&&(d.onload=h),f){const m=p=>{if(p.data==="__sentry_reportdialog_closed__")try{f()}finally{_h.removeEventListener("message",m)}};_h.addEventListener("message",m)}n.appendChild(d)}function uF(e){const t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function dF(e,t){const n=new WeakSet;function r(a,o){if(!n.has(a)){if(a.cause)return n.add(a),r(a.cause,o);a.cause=o}}r(e,t)}function fF(e,{componentStack:t},n){if(uF(x.version)&&Rz(e)&&t){const r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,dF(e,r)}return yD(r=>(r.setContext("react",{componentStack:t}),iF(e,n)))}const hF=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,vy={componentStack:null,error:null,eventId:null};let mF=class extends x.Component{constructor(t){super(t),this.state=vy,this._openFallbackReportDialog=!0;const n=vD();n&&t.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&gE({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){const{componentStack:r}=n,{beforeCapture:a,onError:o,showDialog:c,dialogOptions:d}=this.props;yD(h=>{a&&a(h,t,r);const f=this.props.handled!=null?this.props.handled:!!this.props.fallback,m=fF(t,n,{mechanism:{handled:f,type:"auto.function.react.error_boundary"}});o&&o(t,r,m),c&&(this._lastEventId=m,this._openFallbackReportDialog&&gE({...d,eventId:m})),this.setState({error:t,componentStack:r,eventId:m})})}componentDidMount(){const{onMount:t}=this.props;t&&t()}componentWillUnmount(){const{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:a}=this.props;a&&(this.state===vy?a(null,null,null):a(t,n,r)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){const{onReset:t}=this.props,{error:n,componentStack:r,eventId:a}=this.state;t&&t(n,r,a),this.setState(vy)}render(){const{fallback:t,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;const a=typeof t=="function"?x.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):t;return x.isValidElement(a)?a:(t&&hF&&ks.warn("fallback did not produce a valid ReactElement"),null)}};const _b=x.createContext({});function Rb(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const wD=typeof window<"u",SD=wD?x.useLayoutEffect:x.useEffect,lp=x.createContext(null);function Db(e,t){e.indexOf(t)===-1&&e.push(t)}function wm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const fa=(e,t,n)=>n>t?t:n<e?e:n;let kb=()=>{};const Va={},ND=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function jD(e){return typeof e=="object"&&e!==null}const CD=e=>/^0[^.\s]+$/u.test(e);function Ab(e){let t;return()=>(t===void 0&&(t=e()),t)}const cs=e=>e,pF=(e,t)=>n=>t(e(n)),Wd=(...e)=>e.reduce(pF),vd=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Ob{constructor(){this.subscriptions=[]}add(t){return Db(this.subscriptions,t),()=>wm(this.subscriptions,t)}notify(t,n,r){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,n,r);else for(let o=0;o<a;o++){const c=this.subscriptions[o];c&&c(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ms=e=>e*1e3,os=e=>e/1e3;function ED(e,t){return t?e*(1e3/t):0}const TD=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,gF=1e-7,xF=12;function yF(e,t,n,r,a){let o,c,d=0;do c=t+(n-t)/2,o=TD(c,r,a)-e,o>0?n=c:t=c;while(Math.abs(o)>gF&&++d<xF);return c}function Kd(e,t,n,r){if(e===t&&n===r)return cs;const a=o=>yF(o,0,1,e,n);return o=>o===0||o===1?o:TD(a(o),t,r)}const _D=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,RD=e=>t=>1-e(1-t),DD=Kd(.33,1.53,.69,.99),Mb=RD(DD),kD=_D(Mb),AD=e=>(e*=2)<1?.5*Mb(e):.5*(2-Math.pow(2,-10*(e-1))),Pb=e=>1-Math.sin(Math.acos(e)),OD=RD(Pb),MD=_D(Pb),vF=Kd(.42,0,1,1),bF=Kd(0,0,.58,1),PD=Kd(.42,0,.58,1),wF=e=>Array.isArray(e)&&typeof e[0]!="number",LD=e=>Array.isArray(e)&&typeof e[0]=="number",SF={linear:cs,easeIn:vF,easeInOut:PD,easeOut:bF,circIn:Pb,circInOut:MD,circOut:OD,backIn:Mb,backInOut:kD,backOut:DD,anticipate:AD},NF=e=>typeof e=="string",xE=e=>{if(LD(e)){kb(e.length===4);const[t,n,r,a]=e;return Kd(t,n,r,a)}else if(NF(e))return SF[e];return e},Rh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function jF(e,t){let n=new Set,r=new Set,a=!1,o=!1;const c=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function h(m){c.has(m)&&(f.schedule(m),e()),m(d)}const f={schedule:(m,p=!1,y=!1)=>{const S=y&&a?n:r;return p&&c.add(m),S.has(m)||S.add(m),m},cancel:m=>{r.delete(m),c.delete(m)},process:m=>{if(d=m,a){o=!0;return}a=!0,[n,r]=[r,n],n.forEach(h),n.clear(),a=!1,o&&(o=!1,f.process(m))}};return f}const CF=40;function ID(e,t){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,c=Rh.reduce((R,A)=>(R[A]=jF(o),R),{}),{setup:d,read:h,resolveKeyframes:f,preUpdate:m,update:p,preRender:y,render:v,postRender:S}=c,N=()=>{const R=Va.useManualTiming?a.timestamp:performance.now();n=!1,Va.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(R-a.timestamp,CF),1)),a.timestamp=R,a.isProcessing=!0,d.process(a),h.process(a),f.process(a),m.process(a),p.process(a),y.process(a),v.process(a),S.process(a),a.isProcessing=!1,n&&t&&(r=!1,e(N))},C=()=>{n=!0,r=!0,a.isProcessing||e(N)};return{schedule:Rh.reduce((R,A)=>{const _=c[A];return R[A]=(O,T=!1,D=!1)=>(n||C(),_.schedule(O,T,D)),R},{}),cancel:R=>{for(let A=0;A<Rh.length;A++)c[Rh[A]].cancel(R)},state:a,steps:c}}const{schedule:Mt,cancel:Fi,state:An,steps:by}=ID(typeof requestAnimationFrame<"u"?requestAnimationFrame:cs,!0);let nm;function EF(){nm=void 0}const Zn={now:()=>(nm===void 0&&Zn.set(An.isProcessing||Va.useManualTiming?An.timestamp:performance.now()),nm),set:e=>{nm=e,queueMicrotask(EF)}},BD=e=>t=>typeof t=="string"&&t.startsWith(e),zD=BD("--"),TF=BD("var(--"),Lb=e=>TF(e)?_F.test(e.split("/*")[0].trim()):!1,_F=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function yE(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const jc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},bd={...jc,transform:e=>fa(0,1,e)},Dh={...jc,default:1},nd=e=>Math.round(e*1e5)/1e5,Ib=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function RF(e){return e==null}const DF=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bb=(e,t)=>n=>!!(typeof n=="string"&&DF.test(n)&&n.startsWith(e)||t&&!RF(n)&&Object.prototype.hasOwnProperty.call(n,t)),FD=(e,t,n)=>r=>{if(typeof r!="string")return r;const[a,o,c,d]=r.match(Ib);return{[e]:parseFloat(a),[t]:parseFloat(o),[n]:parseFloat(c),alpha:d!==void 0?parseFloat(d):1}},kF=e=>fa(0,255,e),wy={...jc,transform:e=>Math.round(kF(e))},Lo={test:Bb("rgb","red"),parse:FD("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+wy.transform(e)+", "+wy.transform(t)+", "+wy.transform(n)+", "+nd(bd.transform(r))+")"};function AF(e){let t="",n="",r="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,r+=r,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}}const Hv={test:Bb("#"),parse:AF,transform:Lo.transform},Yd=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),wi=Yd("deg"),ra=Yd("%"),Le=Yd("px"),OF=Yd("vh"),MF=Yd("vw"),vE={...ra,parse:e=>ra.parse(e)/100,transform:e=>ra.transform(e*100)},Ql={test:Bb("hsl","hue"),parse:FD("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ra.transform(nd(t))+", "+ra.transform(nd(n))+", "+nd(bd.transform(r))+")"},dn={test:e=>Lo.test(e)||Hv.test(e)||Ql.test(e),parse:e=>Lo.test(e)?Lo.parse(e):Ql.test(e)?Ql.parse(e):Hv.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Lo.transform(e):Ql.transform(e),getAnimatableNone:e=>{const t=dn.parse(e);return t.alpha=0,dn.transform(t)}},PF=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function LF(e){return isNaN(e)&&typeof e=="string"&&(e.match(Ib)?.length||0)+(e.match(PF)?.length||0)>0}const $D="number",VD="color",IF="var",BF="var(",bE="${}",zF=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function wd(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},a=[];let o=0;const d=t.replace(zF,h=>(dn.test(h)?(r.color.push(o),a.push(VD),n.push(dn.parse(h))):h.startsWith(BF)?(r.var.push(o),a.push(IF),n.push(h)):(r.number.push(o),a.push($D),n.push(parseFloat(h))),++o,bE)).split(bE);return{values:n,split:d,indexes:r,types:a}}function UD(e){return wd(e).values}function HD(e){const{split:t,types:n}=wd(e),r=t.length;return a=>{let o="";for(let c=0;c<r;c++)if(o+=t[c],a[c]!==void 0){const d=n[c];d===$D?o+=nd(a[c]):d===VD?o+=dn.transform(a[c]):o+=a[c]}return o}}const FF=e=>typeof e=="number"?0:dn.test(e)?dn.getAnimatableNone(e):e;function $F(e){const t=UD(e);return HD(e)(t.map(FF))}const $i={test:LF,parse:UD,createTransformer:HD,getAnimatableNone:$F};function Sy(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function VF({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let a=0,o=0,c=0;if(!t)a=o=c=n;else{const d=n<.5?n*(1+t):n+t-n*t,h=2*n-d;a=Sy(h,d,e+1/3),o=Sy(h,d,e),c=Sy(h,d,e-1/3)}return{red:Math.round(a*255),green:Math.round(o*255),blue:Math.round(c*255),alpha:r}}function Sm(e,t){return n=>n>0?t:e}const Gt=(e,t,n)=>e+(t-e)*n,Ny=(e,t,n)=>{const r=e*e,a=n*(t*t-r)+r;return a<0?0:Math.sqrt(a)},UF=[Hv,Lo,Ql],HF=e=>UF.find(t=>t.test(e));function wE(e){const t=HF(e);if(!t)return!1;let n=t.parse(e);return t===Ql&&(n=VF(n)),n}const SE=(e,t)=>{const n=wE(e),r=wE(t);if(!n||!r)return Sm(e,t);const a={...n};return o=>(a.red=Ny(n.red,r.red,o),a.green=Ny(n.green,r.green,o),a.blue=Ny(n.blue,r.blue,o),a.alpha=Gt(n.alpha,r.alpha,o),Lo.transform(a))},Gv=new Set(["none","hidden"]);function GF(e,t){return Gv.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function qF(e,t){return n=>Gt(e,t,n)}function zb(e){return typeof e=="number"?qF:typeof e=="string"?Lb(e)?Sm:dn.test(e)?SE:YF:Array.isArray(e)?GD:typeof e=="object"?dn.test(e)?SE:WF:Sm}function GD(e,t){const n=[...e],r=n.length,a=e.map((o,c)=>zb(o)(o,t[c]));return o=>{for(let c=0;c<r;c++)n[c]=a[c](o);return n}}function WF(e,t){const n={...e,...t},r={};for(const a in n)e[a]!==void 0&&t[a]!==void 0&&(r[a]=zb(e[a])(e[a],t[a]));return a=>{for(const o in r)n[o]=r[o](a);return n}}function KF(e,t){const n=[],r={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],c=e.indexes[o][r[o]],d=e.values[c]??0;n[a]=d,r[o]++}return n}const YF=(e,t)=>{const n=$i.createTransformer(t),r=wd(e),a=wd(t);return r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length?Gv.has(e)&&!a.values.length||Gv.has(t)&&!r.values.length?GF(e,t):Wd(GD(KF(r,a),a.values),n):Sm(e,t)};function qD(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Gt(e,t,n):zb(e)(e,t)}const XF=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Mt.update(t,n),stop:()=>Fi(t),now:()=>An.isProcessing?An.timestamp:Zn.now()}},WD=(e,t,n=10)=>{let r="";const a=Math.max(Math.round(t/n),2);for(let o=0;o<a;o++)r+=Math.round(e(o/(a-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Nm=2e4;function Fb(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Nm;)t+=n,r=e.next(t);return t>=Nm?1/0:t}function QF(e,t=100,n){const r=n({...e,keyframes:[0,t]}),a=Math.min(Fb(r),Nm);return{type:"keyframes",ease:o=>r.next(a*o).value/t,duration:os(a)}}const JF=5;function KD(e,t,n){const r=Math.max(t-JF,0);return ED(n-e(r),t-r)}const Qt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},jy=.001;function ZF({duration:e=Qt.duration,bounce:t=Qt.bounce,velocity:n=Qt.velocity,mass:r=Qt.mass}){let a,o,c=1-t;c=fa(Qt.minDamping,Qt.maxDamping,c),e=fa(Qt.minDuration,Qt.maxDuration,os(e)),c<1?(a=f=>{const m=f*c,p=m*e,y=m-n,v=qv(f,c),S=Math.exp(-p);return jy-y/v*S},o=f=>{const p=f*c*e,y=p*n+n,v=Math.pow(c,2)*Math.pow(f,2)*e,S=Math.exp(-p),N=qv(Math.pow(f,2),c);return(-a(f)+jy>0?-1:1)*((y-v)*S)/N}):(a=f=>{const m=Math.exp(-f*e),p=(f-n)*e+1;return-jy+m*p},o=f=>{const m=Math.exp(-f*e),p=(n-f)*(e*e);return m*p});const d=5/e,h=t8(a,o,d);if(e=Ms(e),isNaN(h))return{stiffness:Qt.stiffness,damping:Qt.damping,duration:e};{const f=Math.pow(h,2)*r;return{stiffness:f,damping:c*2*Math.sqrt(r*f),duration:e}}}const e8=12;function t8(e,t,n){let r=n;for(let a=1;a<e8;a++)r=r-e(r)/t(r);return r}function qv(e,t){return e*Math.sqrt(1-t*t)}const n8=["duration","bounce"],r8=["stiffness","damping","mass"];function NE(e,t){return t.some(n=>e[n]!==void 0)}function s8(e){let t={velocity:Qt.velocity,stiffness:Qt.stiffness,damping:Qt.damping,mass:Qt.mass,isResolvedFromDuration:!1,...e};if(!NE(e,r8)&&NE(e,n8))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,o=2*fa(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Qt.mass,stiffness:a,damping:o}}else{const n=ZF(e);t={...t,...n,mass:Qt.mass},t.isResolvedFromDuration=!0}return t}function jm(e=Qt.visualDuration,t=Qt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:a}=n;const o=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],d={done:!1,value:o},{stiffness:h,damping:f,mass:m,duration:p,velocity:y,isResolvedFromDuration:v}=s8({...n,velocity:-os(n.velocity||0)}),S=y||0,N=f/(2*Math.sqrt(h*m)),C=c-o,j=os(Math.sqrt(h/m)),E=Math.abs(C)<5;r||(r=E?Qt.restSpeed.granular:Qt.restSpeed.default),a||(a=E?Qt.restDelta.granular:Qt.restDelta.default);let R;if(N<1){const _=qv(j,N);R=O=>{const T=Math.exp(-N*j*O);return c-T*((S+N*j*C)/_*Math.sin(_*O)+C*Math.cos(_*O))}}else if(N===1)R=_=>c-Math.exp(-j*_)*(C+(S+j*C)*_);else{const _=j*Math.sqrt(N*N-1);R=O=>{const T=Math.exp(-N*j*O),D=Math.min(_*O,300);return c-T*((S+N*j*C)*Math.sinh(D)+_*C*Math.cosh(D))/_}}const A={calculatedDuration:v&&p||null,next:_=>{const O=R(_);if(v)d.done=_>=p;else{let T=_===0?S:0;N<1&&(T=_===0?Ms(S):KD(R,_,O));const D=Math.abs(T)<=r,B=Math.abs(c-O)<=a;d.done=D&&B}return d.value=d.done?c:O,d},toString:()=>{const _=Math.min(Fb(A),Nm),O=WD(T=>A.next(_*T).value,_,30);return _+"ms "+O},toTransition:()=>{}};return A}jm.applyToOptions=e=>{const t=QF(e,100,jm);return e.ease=t.ease,e.duration=Ms(t.duration),e.type="keyframes",e};function Wv({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:c,min:d,max:h,restDelta:f=.5,restSpeed:m}){const p=e[0],y={done:!1,value:p},v=D=>d!==void 0&&D<d||h!==void 0&&D>h,S=D=>d===void 0?h:h===void 0||Math.abs(d-D)<Math.abs(h-D)?d:h;let N=n*t;const C=p+N,j=c===void 0?C:c(C);j!==C&&(N=j-p);const E=D=>-N*Math.exp(-D/r),R=D=>j+E(D),A=D=>{const B=E(D),W=R(D);y.done=Math.abs(B)<=f,y.value=y.done?j:W};let _,O;const T=D=>{v(y.value)&&(_=D,O=jm({keyframes:[y.value,S(y.value)],velocity:KD(R,D,y.value),damping:a,stiffness:o,restDelta:f,restSpeed:m}))};return T(0),{calculatedDuration:null,next:D=>{let B=!1;return!O&&_===void 0&&(B=!0,A(D),T(D)),_!==void 0&&D>=_?O.next(D-_):(!B&&A(D),y)}}}function a8(e,t,n){const r=[],a=n||Va.mix||qD,o=e.length-1;for(let c=0;c<o;c++){let d=a(e[c],e[c+1]);if(t){const h=Array.isArray(t)?t[c]||cs:t;d=Wd(h,d)}r.push(d)}return r}function i8(e,t,{clamp:n=!0,ease:r,mixer:a}={}){const o=e.length;if(kb(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const d=a8(t,r,a),h=d.length,f=m=>{if(c&&m<e[0])return t[0];let p=0;if(h>1)for(;p<e.length-2&&!(m<e[p+1]);p++);const y=vd(e[p],e[p+1],m);return d[p](y)};return n?m=>f(fa(e[0],e[o-1],m)):f}function o8(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const a=vd(0,t,r);e.push(Gt(n,1,a))}}function l8(e){const t=[0];return o8(t,e.length-1),t}function c8(e,t){return e.map(n=>n*t)}function u8(e,t){return e.map(()=>t||PD).splice(0,e.length-1)}function rd({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const a=wF(r)?r.map(xE):xE(r),o={done:!1,value:t[0]},c=c8(n&&n.length===t.length?n:l8(t),e),d=i8(c,t,{ease:Array.isArray(a)?a:u8(t,a)});return{calculatedDuration:e,next:h=>(o.value=d(h),o.done=h>=e,o)}}const d8=e=>e!==null;function $b(e,{repeat:t,repeatType:n="loop"},r,a=1){const o=e.filter(d8),d=a<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!d||r===void 0?o[d]:r}const f8={decay:Wv,inertia:Wv,tween:rd,keyframes:rd,spring:jm};function YD(e){typeof e.type=="string"&&(e.type=f8[e.type])}class Vb{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const h8=e=>e/100;class Ub extends Vb{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Zn.now()&&this.tick(Zn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;YD(t);const{type:n=rd,repeat:r=0,repeatDelay:a=0,repeatType:o,velocity:c=0}=t;let{keyframes:d}=t;const h=n||rd;h!==rd&&typeof d[0]!="number"&&(this.mixKeyframes=Wd(h8,qD(d[0],d[1])),d=[0,100]);const f=h({...t,keyframes:d});o==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...d].reverse(),velocity:-c})),f.calculatedDuration===null&&(f.calculatedDuration=Fb(f));const{calculatedDuration:m}=f;this.calculatedDuration=m,this.resolvedDuration=m+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=f}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:a,mixKeyframes:o,mirroredGenerator:c,resolvedDuration:d,calculatedDuration:h}=this;if(this.startTime===null)return r.next(0);const{delay:f=0,keyframes:m,repeat:p,repeatType:y,repeatDelay:v,type:S,onUpdate:N,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const j=this.currentTime-f*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?j<0:j>a;this.currentTime=Math.max(j,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let R=this.currentTime,A=r;if(p){const D=Math.min(this.currentTime,a)/d;let B=Math.floor(D),W=D%1;!W&&D>=1&&(W=1),W===1&&B--,B=Math.min(B,p+1),B%2&&(y==="reverse"?(W=1-W,v&&(W-=v/d)):y==="mirror"&&(A=c)),R=fa(0,1,W)*d}const _=E?{done:!1,value:m[0]}:A.next(R);o&&(_.value=o(_.value));let{done:O}=_;!E&&h!==null&&(O=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return T&&S!==Wv&&(_.value=$b(m,this.options,C,this.speed)),N&&N(_.value),T&&this.finish(),_}then(t,n){return this.finished.then(t,n)}get duration(){return os(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+os(t)}get time(){return os(this.currentTime)}set time(t){t=Ms(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Zn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=os(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=XF,startTime:n}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Zn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function m8(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Io=e=>e*180/Math.PI,Kv=e=>{const t=Io(Math.atan2(e[1],e[0]));return Yv(t)},p8={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Kv,rotateZ:Kv,skewX:e=>Io(Math.atan(e[1])),skewY:e=>Io(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Yv=e=>(e=e%360,e<0&&(e+=360),e),jE=Kv,CE=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),EE=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),g8={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:CE,scaleY:EE,scale:e=>(CE(e)+EE(e))/2,rotateX:e=>Yv(Io(Math.atan2(e[6],e[5]))),rotateY:e=>Yv(Io(Math.atan2(-e[2],e[0]))),rotateZ:jE,rotate:jE,skewX:e=>Io(Math.atan(e[4])),skewY:e=>Io(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Xv(e){return e.includes("scale")?1:0}function Qv(e,t){if(!e||e==="none")return Xv(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=g8,a=n;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=p8,a=d}if(!a)return Xv(t);const o=r[t],c=a[1].split(",").map(y8);return typeof o=="function"?o(c):c[o]}const x8=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Qv(n,t)};function y8(e){return parseFloat(e.trim())}const Cc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ec=new Set(Cc),TE=e=>e===jc||e===Le,v8=new Set(["x","y","z"]),b8=Cc.filter(e=>!v8.has(e));function w8(e){const t=[];return b8.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ei={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Qv(t,"x"),y:(e,{transform:t})=>Qv(t,"y")};Ei.translateX=Ei.x;Ei.translateY=Ei.y;const zo=new Set;let Jv=!1,Zv=!1,e0=!1;function XD(){if(Zv){const e=Array.from(zo).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const a=w8(r);a.length&&(n.set(r,a),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const a=n.get(r);a&&a.forEach(([o,c])=>{r.getValue(o)?.set(c)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Zv=!1,Jv=!1,zo.forEach(e=>e.complete(e0)),zo.clear()}function QD(){zo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Zv=!0)})}function S8(){e0=!0,QD(),XD(),e0=!1}class Hb{constructor(t,n,r,a,o,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=a,this.element=o,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(zo.add(this),Jv||(Jv=!0,Mt.read(QD),Mt.resolveKeyframes(XD))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:a}=this;if(t[0]===null){const o=a?.get(),c=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const d=r.readValue(n,c);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=c),a&&o===void 0&&a.set(t[0])}m8(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),zo.delete(this)}cancel(){this.state==="scheduled"&&(zo.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const N8=e=>e.startsWith("--");function j8(e,t,n){N8(t)?e.style.setProperty(t,n):e.style[t]=n}const C8=Ab(()=>window.ScrollTimeline!==void 0),E8={};function T8(e,t){const n=Ab(e);return()=>E8[t]??n()}const JD=T8(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Yu=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,_E={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yu([0,.65,.55,1]),circOut:Yu([.55,0,1,.45]),backIn:Yu([.31,.01,.66,-.59]),backOut:Yu([.33,1.53,.69,.99])};function ZD(e,t){if(e)return typeof e=="function"?JD()?WD(e,t):"ease-out":LD(e)?Yu(e):Array.isArray(e)?e.map(n=>ZD(n,t)||_E.easeOut):_E[e]}function _8(e,t,n,{delay:r=0,duration:a=300,repeat:o=0,repeatType:c="loop",ease:d="easeOut",times:h}={},f=void 0){const m={[t]:n};h&&(m.offset=h);const p=ZD(d,a);Array.isArray(p)&&(m.easing=p);const y={delay:r,duration:a,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:o+1,direction:c==="reverse"?"alternate":"normal"};return f&&(y.pseudoElement=f),e.animate(m,y)}function ek(e){return typeof e=="function"&&"applyToOptions"in e}function R8({type:e,...t}){return ek(e)&&JD()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class tk extends Vb{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:a,pseudoElement:o,allowFlatten:c=!1,finalKeyframe:d,onComplete:h}=t;this.isPseudoElement=!!o,this.allowFlatten=c,this.options=t,kb(typeof t.type!="string");const f=R8(t);this.animation=_8(n,r,a,f,o),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const m=$b(a,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(m):j8(n,r,m),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return os(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+os(t)}get time(){return os(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ms(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&C8()?(this.animation.timeline=t,cs):n(this)}}const nk={anticipate:AD,backInOut:kD,circInOut:MD};function D8(e){return e in nk}function k8(e){typeof e.ease=="string"&&D8(e.ease)&&(e.ease=nk[e.ease])}const Cy=10;class A8 extends tk{constructor(t){k8(t),YD(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:a,element:o,...c}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const d=new Ub({...c,autoplay:!1}),h=Math.max(Cy,Zn.now()-this.startTime),f=fa(0,Cy,h-Cy);n.setWithVelocity(d.sample(Math.max(0,h-f)).value,d.sample(h).value,f),d.stop()}}const RE=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&($i.test(e)||e==="0")&&!e.startsWith("url("));function O8(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function M8(e,t,n,r){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],c=RE(a,t),d=RE(o,t);return!c||!d?!1:O8(e)||(n==="spring"||ek(n))&&r}function t0(e){e.duration=0,e.type="keyframes"}const P8=new Set(["opacity","clipPath","filter","transform"]),L8=Ab(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function I8(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:a,damping:o,type:c}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:f}=t.owner.getProps();return L8()&&n&&P8.has(n)&&(n!=="transform"||!f)&&!h&&!r&&a!=="mirror"&&o!==0&&c!=="inertia"}const B8=40;class z8 extends Vb{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:a=0,repeatDelay:o=0,repeatType:c="loop",keyframes:d,name:h,motionValue:f,element:m,...p}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Zn.now();const y={autoplay:t,delay:n,type:r,repeat:a,repeatDelay:o,repeatType:c,name:h,motionValue:f,element:m,...p},v=m?.KeyframeResolver||Hb;this.keyframeResolver=new v(d,(S,N,C)=>this.onKeyframesResolved(S,N,y,!C),h,f,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,a){this.keyframeResolver=void 0;const{name:o,type:c,velocity:d,delay:h,isHandoff:f,onUpdate:m}=r;this.resolvedAt=Zn.now(),M8(t,o,c,d)||((Va.instantAnimations||!h)&&m?.($b(t,r,n)),t[0]=t[t.length-1],t0(r),r.repeat=0);const y={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>B8?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},v=!f&&I8(y),S=y.motionValue?.owner?.current,N=v?new A8({...y,element:S}):new Ub(y);N.finished.then(()=>{this.notifyFinished()}).catch(cs),this.pendingTimeline&&(this.stopTimeline=N.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=N}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),S8()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function rk(e,t,n,r=0,a=1){const o=Array.from(e).sort((f,m)=>f.sortNodePosition(m)).indexOf(t),c=e.size,d=(c-1)*r;return typeof n=="function"?n(o,c):a===1?o*r:d-o*r}const F8=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $8(e){const t=F8.exec(e);if(!t)return[,];const[,n,r,a]=t;return[`--${n??r}`,a]}function sk(e,t,n=1){const[r,a]=$8(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const c=o.trim();return ND(c)?parseFloat(c):c}return Lb(a)?sk(a,t,n+1):a}const V8={type:"spring",stiffness:500,damping:25,restSpeed:10},U8=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),H8={type:"keyframes",duration:.8},G8={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},q8=(e,{keyframes:t})=>t.length>2?H8:Ec.has(e)?e.startsWith("scale")?U8(t[1]):V8:G8,W8=e=>e!==null;function K8(e,{repeat:t,repeatType:n="loop"},r){const a=e.filter(W8),o=t&&n!=="loop"&&t%2===1?0:a.length-1;return a[o]}function ak(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Gb(e,t){const n=e?.[t]??e?.default??e;return n!==e?ak(n,e):n}function Y8({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:a,repeat:o,repeatType:c,repeatDelay:d,from:h,elapsed:f,...m}){return!!Object.keys(m).length}const qb=(e,t,n,r={},a,o)=>c=>{const d=Gb(r,e)||{},h=d.delay||r.delay||0;let{elapsed:f=0}=r;f=f-Ms(h);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-f,onUpdate:y=>{t.set(y),d.onUpdate&&d.onUpdate(y)},onComplete:()=>{c(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:o?void 0:a};Y8(d)||Object.assign(m,q8(e,m)),m.duration&&(m.duration=Ms(m.duration)),m.repeatDelay&&(m.repeatDelay=Ms(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let p=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(t0(m),m.delay===0&&(p=!0)),(Va.instantAnimations||Va.skipAnimations||a?.shouldSkipAnimations)&&(p=!0,t0(m),m.delay=0),m.allowFlatten=!d.type&&!d.ease,p&&!o&&t.get()!==void 0){const y=K8(m.keyframes,d);if(y!==void 0){Mt.update(()=>{m.onUpdate(y),m.onComplete()});return}}return d.isSync?new Ub(m):new z8(m)};function DE(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Wb(e,t,n,r){if(typeof t=="function"){const[a,o]=DE(r);t=t(n!==void 0?n:e.custom,a,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,o]=DE(r);t=t(n!==void 0?n:e.custom,a,o)}return t}function sc(e,t,n){const r=e.getProps();return Wb(r,t,n!==void 0?n:r.custom,e)}const ik=new Set(["width","height","top","left","right","bottom",...Cc]),kE=30,X8=e=>!isNaN(parseFloat(e));class Q8{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const a=Zn.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Zn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=X8(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ob);const r=this.events[t].add(n);return t==="change"?()=>{r(),Mt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Zn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>kE)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,kE);return ED(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function dc(e,t){return new Q8(e,t)}const n0=e=>Array.isArray(e);function J8(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,dc(n))}function Z8(e){return n0(e)?e[e.length-1]||0:e}function e$(e,t){const n=sc(e,t);let{transitionEnd:r={},transition:a={},...o}=n||{};o={...o,...r};for(const c in o){const d=Z8(o[c]);J8(e,c,d)}}const Vn=e=>!!(e&&e.getVelocity);function t$(e){return!!(Vn(e)&&e.add)}function r0(e,t){const n=e.getValue("willChange");if(t$(n))return n.add(t);if(!n&&Va.WillChange){const r=new Va.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Kb(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const n$="framerAppearId",ok="data-"+Kb(n$);function lk(e){return e.props[ok]}function r$({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ck(e,t,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:o,transitionEnd:c,...d}=t;const h=e.getDefaultTransition();o=o?ak(o,h):h;const f=o?.reduceMotion;r&&(o=r);const m=[],p=a&&e.animationState&&e.animationState.getState()[a];for(const y in d){const v=e.getValue(y,e.latestValues[y]??null),S=d[y];if(S===void 0||p&&r$(p,y))continue;const N={delay:n,...Gb(o||{},y)},C=v.get();if(C!==void 0&&!v.isAnimating&&!Array.isArray(S)&&S===C&&!N.velocity)continue;let j=!1;if(window.MotionHandoffAnimation){const A=lk(e);if(A){const _=window.MotionHandoffAnimation(A,y,Mt);_!==null&&(N.startTime=_,j=!0)}}r0(e,y);const E=f??e.shouldReduceMotion;v.start(qb(y,v,S,E&&ik.has(y)?{type:!1}:N,e,j));const R=v.animation;R&&m.push(R)}if(c){const y=()=>Mt.update(()=>{c&&e$(e,c)});m.length?Promise.all(m).then(y):y()}return m}function s0(e,t,n={}){const r=sc(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(a=n.transitionOverride);const o=r?()=>Promise.all(ck(e,r,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:f=0,staggerChildren:m,staggerDirection:p}=a;return s$(e,t,h,f,m,p,n)}:()=>Promise.resolve(),{when:d}=a;if(d){const[h,f]=d==="beforeChildren"?[o,c]:[c,o];return h().then(()=>f())}else return Promise.all([o(),c(n.delay)])}function s$(e,t,n=0,r=0,a=0,o=1,c){const d=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),d.push(s0(h,t,{...c,delay:n+(typeof r=="function"?0:r)+rk(e.variantChildren,h,r,a,o)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(d)}function a$(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const a=t.map(o=>s0(e,o,n));r=Promise.all(a)}else if(typeof t=="string")r=s0(e,t,n);else{const a=typeof t=="function"?sc(e,t,n.custom):t;r=Promise.all(ck(e,a,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const i$={test:e=>e==="auto",parse:e=>e},uk=e=>t=>t.test(e),dk=[jc,Le,ra,wi,MF,OF,i$],AE=e=>dk.find(uk(e));function o$(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||CD(e):!0}const l$=new Set(["brightness","contrast","saturate","opacity"]);function c$(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Ib)||[];if(!r)return e;const a=n.replace(r,"");let o=l$.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+a+")"}const u$=/\b([a-z-]*)\(.*?\)/gu,a0={...$i,getAnimatableNone:e=>{const t=e.match(u$);return t?t.map(c$).join(" "):e}},OE={...jc,transform:Math.round},d$={rotate:wi,rotateX:wi,rotateY:wi,rotateZ:wi,scale:Dh,scaleX:Dh,scaleY:Dh,scaleZ:Dh,skew:wi,skewX:wi,skewY:wi,distance:Le,translateX:Le,translateY:Le,translateZ:Le,x:Le,y:Le,z:Le,perspective:Le,transformPerspective:Le,opacity:bd,originX:vE,originY:vE,originZ:Le},Yb={borderWidth:Le,borderTopWidth:Le,borderRightWidth:Le,borderBottomWidth:Le,borderLeftWidth:Le,borderRadius:Le,borderTopLeftRadius:Le,borderTopRightRadius:Le,borderBottomRightRadius:Le,borderBottomLeftRadius:Le,width:Le,maxWidth:Le,height:Le,maxHeight:Le,top:Le,right:Le,bottom:Le,left:Le,inset:Le,insetBlock:Le,insetBlockStart:Le,insetBlockEnd:Le,insetInline:Le,insetInlineStart:Le,insetInlineEnd:Le,padding:Le,paddingTop:Le,paddingRight:Le,paddingBottom:Le,paddingLeft:Le,paddingBlock:Le,paddingBlockStart:Le,paddingBlockEnd:Le,paddingInline:Le,paddingInlineStart:Le,paddingInlineEnd:Le,margin:Le,marginTop:Le,marginRight:Le,marginBottom:Le,marginLeft:Le,marginBlock:Le,marginBlockStart:Le,marginBlockEnd:Le,marginInline:Le,marginInlineStart:Le,marginInlineEnd:Le,fontSize:Le,backgroundPositionX:Le,backgroundPositionY:Le,...d$,zIndex:OE,fillOpacity:bd,strokeOpacity:bd,numOctaves:OE},f$={...Yb,color:dn,backgroundColor:dn,outlineColor:dn,fill:dn,stroke:dn,borderColor:dn,borderTopColor:dn,borderRightColor:dn,borderBottomColor:dn,borderLeftColor:dn,filter:a0,WebkitFilter:a0},fk=e=>f$[e];function hk(e,t){let n=fk(e);return n!==a0&&(n=$i),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const h$=new Set(["auto","none","0"]);function m$(e,t,n){let r=0,a;for(;r<e.length&&!a;){const o=e[r];typeof o=="string"&&!h$.has(o)&&wd(o).values.length&&(a=e[r]),r++}if(a&&n)for(const o of t)e[o]=hk(n,a)}class p$ extends Hb{constructor(t,n,r,a,o){super(t,n,r,a,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<t.length;m++){let p=t[m];if(typeof p=="string"&&(p=p.trim(),Lb(p))){const y=sk(p,n.current);y!==void 0&&(t[m]=y),m===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!ik.has(r)||t.length!==2)return;const[a,o]=t,c=AE(a),d=AE(o),h=yE(a),f=yE(o);if(h!==f&&Ei[r]){this.needsMeasurement=!0;return}if(c!==d)if(TE(c)&&TE(d))for(let m=0;m<t.length;m++){const p=t[m];typeof p=="string"&&(t[m]=parseFloat(p))}else Ei[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let a=0;a<t.length;a++)(t[a]===null||o$(t[a]))&&r.push(a);r.length&&m$(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ei[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&t.getValue(r,a).jump(a,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const a=t.getValue(n);a&&a.jump(this.measuredOrigin,!1);const o=r.length-1,c=r[o];r[o]=Ei[n](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,h])=>{t.getValue(d).set(h)}),this.resolveNoneKeyframes()}}const g$=new Set(["opacity","clipPath","filter","transform"]);function mk(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const a=n?.[e]??r.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(r=>r!=null)}const pk=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function i0(e){return jD(e)&&"offsetHeight"in e}const{schedule:Xb}=ID(queueMicrotask,!1),Rs={x:!1,y:!1};function gk(){return Rs.x||Rs.y}function x$(e){return e==="x"||e==="y"?Rs[e]?null:(Rs[e]=!0,()=>{Rs[e]=!1}):Rs.x||Rs.y?null:(Rs.x=Rs.y=!0,()=>{Rs.x=Rs.y=!1})}function xk(e,t){const n=mk(e),r=new AbortController,a={passive:!0,...t,signal:r.signal};return[n,a,()=>r.abort()]}function y$(e){return!(e.pointerType==="touch"||gk())}function v$(e,t,n={}){const[r,a,o]=xk(e,n);return r.forEach(c=>{let d=!1,h=!1,f;const m=()=>{c.removeEventListener("pointerleave",S)},p=C=>{f&&(f(C),f=void 0),m()},y=C=>{d=!1,window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),h&&(h=!1,p(C))},v=()=>{d=!0,window.addEventListener("pointerup",y,a),window.addEventListener("pointercancel",y,a)},S=C=>{if(C.pointerType!=="touch"){if(d){h=!0;return}p(C)}},N=C=>{if(!y$(C))return;h=!1;const j=t(c,C);typeof j=="function"&&(f=j,c.addEventListener("pointerleave",S,a))};c.addEventListener("pointerenter",N,a),c.addEventListener("pointerdown",v,a)}),o}const yk=(e,t)=>t?e===t?!0:yk(e,t.parentElement):!1,Qb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,b$=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function w$(e){return b$.has(e.tagName)||e.isContentEditable===!0}const S$=new Set(["INPUT","SELECT","TEXTAREA"]);function N$(e){return S$.has(e.tagName)||e.isContentEditable===!0}const rm=new WeakSet;function ME(e){return t=>{t.key==="Enter"&&e(t)}}function Ey(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const j$=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ME(()=>{if(rm.has(n))return;Ey(n,"down");const a=ME(()=>{Ey(n,"up")}),o=()=>Ey(n,"cancel");n.addEventListener("keyup",a,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function PE(e){return Qb(e)&&!gk()}const LE=new WeakSet;function C$(e,t,n={}){const[r,a,o]=xk(e,n),c=d=>{const h=d.currentTarget;if(!PE(d)||LE.has(d))return;rm.add(h),n.stopPropagation&&LE.add(d);const f=t(h,d),m=(v,S)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",y),rm.has(h)&&rm.delete(h),PE(v)&&typeof f=="function"&&f(v,{success:S})},p=v=>{m(v,h===window||h===document||n.useGlobalTarget||yk(h,v.target))},y=v=>{m(v,!1)};window.addEventListener("pointerup",p,a),window.addEventListener("pointercancel",y,a)};return r.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",c,a),i0(d)&&(d.addEventListener("focus",f=>j$(f,a)),!w$(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),o}function Jb(e){return jD(e)&&"ownerSVGElement"in e}const sm=new WeakMap;let am;const vk=(e,t,n)=>(r,a)=>a&&a[0]?a[0][e+"Size"]:Jb(r)&&"getBBox"in r?r.getBBox()[t]:r[n],E$=vk("inline","width","offsetWidth"),T$=vk("block","height","offsetHeight");function _$({target:e,borderBoxSize:t}){sm.get(e)?.forEach(n=>{n(e,{get width(){return E$(e,t)},get height(){return T$(e,t)}})})}function R$(e){e.forEach(_$)}function D$(){typeof ResizeObserver>"u"||(am=new ResizeObserver(R$))}function k$(e,t){am||D$();const n=mk(e);return n.forEach(r=>{let a=sm.get(r);a||(a=new Set,sm.set(r,a)),a.add(t),am?.observe(r)}),()=>{n.forEach(r=>{const a=sm.get(r);a?.delete(t),a?.size||am?.unobserve(r)})}}const im=new Set;let Jl;function A$(){Jl=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};im.forEach(t=>t(e))},window.addEventListener("resize",Jl)}function O$(e){return im.add(e),Jl||A$(),()=>{im.delete(e),!im.size&&typeof Jl=="function"&&(window.removeEventListener("resize",Jl),Jl=void 0)}}function IE(e,t){return typeof e=="function"?O$(e):k$(e,t)}function M$(e){return Jb(e)&&e.tagName==="svg"}const P$=[...dk,dn,$i],L$=e=>P$.find(uk(e)),BE=()=>({translate:0,scale:1,origin:0,originPoint:0}),Zl=()=>({x:BE(),y:BE()}),zE=()=>({min:0,max:0}),xn=()=>({x:zE(),y:zE()}),I$=new WeakMap;function cp(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Sd(e){return typeof e=="string"||Array.isArray(e)}const Zb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ew=["initial",...Zb];function up(e){return cp(e.animate)||ew.some(t=>Sd(e[t]))}function bk(e){return!!(up(e)||e.variants)}function B$(e,t,n){for(const r in t){const a=t[r],o=n[r];if(Vn(a))e.addValue(r,a);else if(Vn(o))e.addValue(r,dc(a,{owner:e}));else if(o!==a)if(e.hasValue(r)){const c=e.getValue(r);c.liveStyle===!0?c.jump(a):c.hasAnimated||c.set(a)}else{const c=e.getStaticValue(r);e.addValue(r,dc(c!==void 0?c:a,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const o0={current:null},wk={current:!1},z$=typeof window<"u";function F$(){if(wk.current=!0,!!z$)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>o0.current=e.matches;e.addEventListener("change",t),t()}else o0.current=!1}const FE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Cm={};function Sk(e){Cm=e}function $$(){return Cm}class V${scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:a,skipAnimations:o,blockInitialAnimation:c,visualState:d},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Hb,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=Zn.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Mt.render(this.render,!1,!0))};const{latestValues:f,renderState:m}=d;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.skipAnimationsConfig=o,this.options=h,this.blockInitialAnimation=!!c,this.isControllingVariants=up(n),this.isVariantNode=bk(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in y){const S=y[v];f[v]!==void 0&&Vn(S)&&S.set(f[v])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,I$.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(wk.current||F$(),this.shouldReduceMotion=o0.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Fi(this.notifyUpdate),Fi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&g$.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:d,times:h,ease:f,duration:m}=n.accelerate,p=new tk({element:this.current,name:t,keyframes:d,times:h,ease:f,duration:Ms(m)}),y=c(p);this.valueSubscriptions.set(t,()=>{y(),p.cancel()});return}const r=Ec.has(t);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&Mt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Cm){const n=Cm[t];if(!n)continue;const{isEnabled:r,Feature:a}=n;if(!this.features[t]&&a&&r(this.props)&&(this.features[t]=new a(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):xn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<FE.length;r++){const a=FE[r];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const o="on"+a,c=t[o];c&&(this.propEventSubscriptions[a]=this.on(a,c))}this.prevMotionValues=B$(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=dc(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(ND(r)||CD(r))?r=parseFloat(r):!L$(r)&&$i.test(n)&&(r=hk(t,n)),this.setBaseTarget(t,Vn(r)?r.get():r)),Vn(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Wb(this.props,n,this.presenceContext?.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Vn(a)?a:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ob),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Xb.render(this.render)}}class Nk extends V${constructor(){super(...arguments),this.KeyframeResolver=p$}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Vn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Xi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function jk({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function U$({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function H$(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ty(e){return e===void 0||e===1}function l0({scale:e,scaleX:t,scaleY:n}){return!Ty(e)||!Ty(t)||!Ty(n)}function ko(e){return l0(e)||Ck(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ck(e){return $E(e.x)||$E(e.y)}function $E(e){return e&&e!=="0%"}function Em(e,t,n){const r=e-n,a=t*r;return n+a}function VE(e,t,n,r,a){return a!==void 0&&(e=Em(e,a,r)),Em(e,n,r)+t}function c0(e,t=0,n=1,r,a){e.min=VE(e.min,t,n,r,a),e.max=VE(e.max,t,n,r,a)}function Ek(e,{x:t,y:n}){c0(e.x,t.translate,t.scale,t.originPoint),c0(e.y,n.translate,n.scale,n.originPoint)}const UE=.999999999999,HE=1.0000000000001;function G$(e,t,n,r=!1){const a=n.length;if(!a)return;t.x=t.y=1;let o,c;for(let d=0;d<a;d++){o=n[d],c=o.projectionDelta;const{visualElement:h}=o.options;h&&h.props.style&&h.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&tc(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),c&&(t.x*=c.x.scale,t.y*=c.y.scale,Ek(e,c)),r&&ko(o.latestValues)&&tc(e,o.latestValues))}t.x<HE&&t.x>UE&&(t.x=1),t.y<HE&&t.y>UE&&(t.y=1)}function ec(e,t){e.min=e.min+t,e.max=e.max+t}function GE(e,t,n,r,a=.5){const o=Gt(e.min,e.max,a);c0(e,t,n,o,r)}function tc(e,t){GE(e.x,t.x,t.scaleX,t.scale,t.originX),GE(e.y,t.y,t.scaleY,t.scale,t.originY)}function Tk(e,t){return jk(H$(e.getBoundingClientRect(),t))}function q$(e,t,n){const r=Tk(e,n),{scroll:a}=t;return a&&(ec(r.x,a.offset.x),ec(r.y,a.offset.y)),r}const W$={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},K$=Cc.length;function Y$(e,t,n){let r="",a=!0;for(let o=0;o<K$;o++){const c=Cc[o],d=e[c];if(d===void 0)continue;let h=!0;if(typeof d=="number")h=d===(c.startsWith("scale")?1:0);else{const f=parseFloat(d);h=c.startsWith("scale")?f===1:f===0}if(!h||n){const f=pk(d,Yb[c]);if(!h){a=!1;const m=W$[c]||c;r+=`${m}(${f}) `}n&&(t[c]=f)}}return r=r.trim(),n?r=n(t,a?"":r):a&&(r="none"),r}function tw(e,t,n){const{style:r,vars:a,transformOrigin:o}=e;let c=!1,d=!1;for(const h in t){const f=t[h];if(Ec.has(h)){c=!0;continue}else if(zD(h)){a[h]=f;continue}else{const m=pk(f,Yb[h]);h.startsWith("origin")?(d=!0,o[h]=m):r[h]=m}}if(t.transform||(c||n?r.transform=Y$(t,e.transform,n):r.transform&&(r.transform="none")),d){const{originX:h="50%",originY:f="50%",originZ:m=0}=o;r.transformOrigin=`${h} ${f} ${m}`}}function _k(e,{style:t,vars:n},r,a){const o=e.style;let c;for(c in t)o[c]=t[c];a?.applyProjectionStyles(o,r);for(c in n)o.setProperty(c,n[c])}function qE(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ou={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Le.test(e))e=parseFloat(e);else return e;const n=qE(e,t.target.x),r=qE(e,t.target.y);return`${n}% ${r}%`}},X$={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,a=$i.parse(e);if(a.length>5)return r;const o=$i.createTransformer(e),c=typeof a[0]!="number"?1:0,d=n.x.scale*t.x,h=n.y.scale*t.y;a[0+c]/=d,a[1+c]/=h;const f=Gt(d,h,.5);return typeof a[2+c]=="number"&&(a[2+c]/=f),typeof a[3+c]=="number"&&(a[3+c]/=f),o(a)}},u0={borderRadius:{...Ou,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ou,borderTopRightRadius:Ou,borderBottomLeftRadius:Ou,borderBottomRightRadius:Ou,boxShadow:X$};function Rk(e,{layout:t,layoutId:n}){return Ec.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!u0[e]||e==="opacity")}function nw(e,t,n){const r=e.style,a=t?.style,o={};if(!r)return o;for(const c in r)(Vn(r[c])||a&&Vn(a[c])||Rk(c,e)||n?.getValue(c)?.liveStyle!==void 0)&&(o[c]=r[c]);return o}function Q$(e){return window.getComputedStyle(e)}class J$ extends Nk{constructor(){super(...arguments),this.type="html",this.renderInstance=_k}readValueFromInstance(t,n){if(Ec.has(n))return this.projection?.isProjecting?Xv(n):x8(t,n);{const r=Q$(t),a=(zD(n)?r.getPropertyValue(n):r[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Tk(t,n)}build(t,n,r){tw(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return nw(t,n,r)}}const Z$={offset:"stroke-dashoffset",array:"stroke-dasharray"},eV={offset:"strokeDashoffset",array:"strokeDasharray"};function tV(e,t,n=1,r=0,a=!0){e.pathLength=1;const o=a?Z$:eV;e[o.offset]=`${-r}`,e[o.array]=`${t} ${n}`}const nV=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Dk(e,{attrX:t,attrY:n,attrScale:r,pathLength:a,pathSpacing:o=1,pathOffset:c=0,...d},h,f,m){if(tw(e,d,f),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:y}=e;p.transform&&(y.transform=p.transform,delete p.transform),(y.transform||p.transformOrigin)&&(y.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),y.transform&&(y.transformBox=m?.transformBox??"fill-box",delete p.transformBox);for(const v of nV)p[v]!==void 0&&(y[v]=p[v],delete p[v]);t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),a!==void 0&&tV(p,a,o,c,!1)}const kk=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Ak=e=>typeof e=="string"&&e.toLowerCase()==="svg";function rV(e,t,n,r){_k(e,t,void 0,r);for(const a in t.attrs)e.setAttribute(kk.has(a)?a:Kb(a),t.attrs[a])}function Ok(e,t,n){const r=nw(e,t,n);for(const a in e)if(Vn(e[a])||Vn(t[a])){const o=Cc.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[o]=e[a]}return r}class sV extends Nk{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ec.has(n)){const r=fk(n);return r&&r.default||0}return n=kk.has(n)?n:Kb(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Ok(t,n,r)}build(t,n,r){Dk(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,a){rV(t,n,r,a)}mount(t){this.isSVGTag=Ak(t.tagName),super.mount(t)}}const aV=ew.length;function Mk(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Mk(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<aV;n++){const r=ew[n],a=e.props[r];(Sd(a)||a===!1)&&(t[r]=a)}return t}function Pk(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const iV=[...Zb].reverse(),oV=Zb.length;function lV(e){return t=>Promise.all(t.map(({animation:n,options:r})=>a$(e,n,r)))}function cV(e){let t=lV(e),n=WE(),r=!0;const a=h=>(f,m)=>{const p=sc(e,m,h==="exit"?e.presenceContext?.custom:void 0);if(p){const{transition:y,transitionEnd:v,...S}=p;f={...f,...S,...v}}return f};function o(h){t=h(e)}function c(h){const{props:f}=e,m=Mk(e.parent)||{},p=[],y=new Set;let v={},S=1/0;for(let C=0;C<oV;C++){const j=iV[C],E=n[j],R=f[j]!==void 0?f[j]:m[j],A=Sd(R),_=j===h?E.isActive:null;_===!1&&(S=C);let O=R===m[j]&&R!==f[j]&&A;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),E.protectedKeys={...v},!E.isActive&&_===null||!R&&!E.prevProp||cp(R)||typeof R=="boolean")continue;if(j==="exit"&&E.isActive&&_!==!0){E.prevResolvedValues&&(v={...v,...E.prevResolvedValues});continue}const T=uV(E.prevProp,R);let D=T||j===h&&E.isActive&&!O&&A||C>S&&A,B=!1;const W=Array.isArray(R)?R:[R];let M=W.reduce(a(j),{});_===!1&&(M={});const{prevResolvedValues:V={}}=E,G={...V,...M},F=U=>{D=!0,y.has(U)&&(B=!0,y.delete(U)),E.needsAnimating[U]=!0;const z=e.getValue(U);z&&(z.liveStyle=!1)};for(const U in G){const z=M[U],te=V[U];if(v.hasOwnProperty(U))continue;let oe=!1;n0(z)&&n0(te)?oe=!Pk(z,te):oe=z!==te,oe?z!=null?F(U):y.add(U):z!==void 0&&y.has(U)?F(U):E.protectedKeys[U]=!0}E.prevProp=R,E.prevResolvedValues=M,E.isActive&&(v={...v,...M}),r&&e.blockInitialAnimation&&(D=!1);const H=O&&T;D&&(!H||B)&&p.push(...W.map(U=>{const z={type:j};if(typeof U=="string"&&r&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:te}=e,oe=sc(te,U);if(te.enteringChildren&&oe){const{delayChildren:L}=oe.transition||{};z.delay=rk(te.enteringChildren,e,L)}}return{animation:U,options:z}}))}if(y.size){const C={};if(typeof f.initial!="boolean"){const j=sc(e,Array.isArray(f.initial)?f.initial[0]:f.initial);j&&j.transition&&(C.transition=j.transition)}y.forEach(j=>{const E=e.getBaseTarget(j),R=e.getValue(j);R&&(R.liveStyle=!0),C[j]=E??null}),p.push({animation:C})}let N=!!p.length;return r&&(f.initial===!1||f.initial===f.animate)&&!e.manuallyAnimateOnMount&&(N=!1),r=!1,N?t(p):Promise.resolve()}function d(h,f){if(n[h].isActive===f)return Promise.resolve();e.variantChildren?.forEach(p=>p.animationState?.setActive(h,f)),n[h].isActive=f;const m=c(h);for(const p in n)n[p].protectedKeys={};return m}return{animateChanges:c,setActive:d,setAnimateFunction:o,getState:()=>n,reset:()=>{n=WE()}}}function uV(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Pk(t,e):!1}function No(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function WE(){return{animate:No(!0),whileInView:No(),whileHover:No(),whileTap:No(),whileDrag:No(),whileFocus:No(),exit:No()}}function KE(e,t){e.min=t.min,e.max=t.max}function Ts(e,t){KE(e.x,t.x),KE(e.y,t.y)}function YE(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Lk=1e-4,dV=1-Lk,fV=1+Lk,Ik=.01,hV=0-Ik,mV=0+Ik;function er(e){return e.max-e.min}function pV(e,t,n){return Math.abs(e-t)<=n}function XE(e,t,n,r=.5){e.origin=r,e.originPoint=Gt(t.min,t.max,e.origin),e.scale=er(n)/er(t),e.translate=Gt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=dV&&e.scale<=fV||isNaN(e.scale))&&(e.scale=1),(e.translate>=hV&&e.translate<=mV||isNaN(e.translate))&&(e.translate=0)}function sd(e,t,n,r){XE(e.x,t.x,n.x,r?r.originX:void 0),XE(e.y,t.y,n.y,r?r.originY:void 0)}function QE(e,t,n){e.min=n.min+t.min,e.max=e.min+er(t)}function gV(e,t,n){QE(e.x,t.x,n.x),QE(e.y,t.y,n.y)}function JE(e,t,n){e.min=t.min-n.min,e.max=e.min+er(t)}function Tm(e,t,n){JE(e.x,t.x,n.x),JE(e.y,t.y,n.y)}function ZE(e,t,n,r,a){return e-=t,e=Em(e,1/n,r),a!==void 0&&(e=Em(e,1/a,r)),e}function xV(e,t=0,n=1,r=.5,a,o=e,c=e){if(ra.test(t)&&(t=parseFloat(t),t=Gt(c.min,c.max,t/100)-c.min),typeof t!="number")return;let d=Gt(o.min,o.max,r);e===o&&(d-=t),e.min=ZE(e.min,t,n,d,a),e.max=ZE(e.max,t,n,d,a)}function e2(e,t,[n,r,a],o,c){xV(e,t[n],t[r],t[a],t.scale,o,c)}const yV=["x","scaleX","originX"],vV=["y","scaleY","originY"];function t2(e,t,n,r){e2(e.x,t,yV,n?n.x:void 0,r?r.x:void 0),e2(e.y,t,vV,n?n.y:void 0,r?r.y:void 0)}function n2(e){return e.translate===0&&e.scale===1}function Bk(e){return n2(e.x)&&n2(e.y)}function r2(e,t){return e.min===t.min&&e.max===t.max}function bV(e,t){return r2(e.x,t.x)&&r2(e.y,t.y)}function s2(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function zk(e,t){return s2(e.x,t.x)&&s2(e.y,t.y)}function a2(e){return er(e.x)/er(e.y)}function i2(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Xs(e){return[e("x"),e("y")]}function wV(e,t,n){let r="";const a=e.x.translate/t.x,o=e.y.translate/t.y,c=n?.z||0;if((a||o||c)&&(r=`translate3d(${a}px, ${o}px, ${c}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:f,rotate:m,rotateX:p,rotateY:y,skewX:v,skewY:S}=n;f&&(r=`perspective(${f}px) ${r}`),m&&(r+=`rotate(${m}deg) `),p&&(r+=`rotateX(${p}deg) `),y&&(r+=`rotateY(${y}deg) `),v&&(r+=`skewX(${v}deg) `),S&&(r+=`skewY(${S}deg) `)}const d=e.x.scale*t.x,h=e.y.scale*t.y;return(d!==1||h!==1)&&(r+=`scale(${d}, ${h})`),r||"none"}const Fk=["TopLeft","TopRight","BottomLeft","BottomRight"],SV=Fk.length,o2=e=>typeof e=="string"?parseFloat(e):e,l2=e=>typeof e=="number"||Le.test(e);function NV(e,t,n,r,a,o){a?(e.opacity=Gt(0,n.opacity??1,jV(r)),e.opacityExit=Gt(t.opacity??1,0,CV(r))):o&&(e.opacity=Gt(t.opacity??1,n.opacity??1,r));for(let c=0;c<SV;c++){const d=`border${Fk[c]}Radius`;let h=c2(t,d),f=c2(n,d);if(h===void 0&&f===void 0)continue;h||(h=0),f||(f=0),h===0||f===0||l2(h)===l2(f)?(e[d]=Math.max(Gt(o2(h),o2(f),r),0),(ra.test(f)||ra.test(h))&&(e[d]+="%")):e[d]=f}(t.rotate||n.rotate)&&(e.rotate=Gt(t.rotate||0,n.rotate||0,r))}function c2(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const jV=$k(0,.5,OD),CV=$k(.5,.95,cs);function $k(e,t,n){return r=>r<e?0:r>t?1:n(vd(e,t,r))}function EV(e,t,n){const r=Vn(e)?e:dc(e);return r.start(qb("",r,t,n)),r.animation}function Nd(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const TV=(e,t)=>e.depth-t.depth;class _V{constructor(){this.children=[],this.isDirty=!1}add(t){Db(this.children,t),this.isDirty=!0}remove(t){wm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(TV),this.isDirty=!1,this.children.forEach(t)}}function RV(e,t){const n=Zn.now(),r=({timestamp:a})=>{const o=a-n;o>=t&&(Fi(r),e(o-t))};return Mt.setup(r,!0),()=>Fi(r)}function om(e){return Vn(e)?e.get():e}class DV{constructor(){this.members=[]}add(t){Db(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const a=r.instance;a&&a.isConnected===!1&&r.isPresent!==!1&&!r.snapshot&&wm(this.members,r)}t.scheduleRender()}remove(t){if(wm(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(a=>t===a);if(n===0)return!1;let r;for(let a=n;a>=0;a--){const o=this.members[a],c=o.instance;if(o.isPresent!==!1&&(!c||c.isConnected!==!1)){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender();const a=r.options.layoutDependency,o=t.options.layoutDependency;if(!(a!==void 0&&o!==void 0&&a===o)){const h=r.instance;h&&h.isConnected===!1&&!r.snapshot||(t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:d}=t.options;d===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const lm={hasAnimatedSinceResize:!0,hasEverUpdated:!1},_y=["","X","Y","Z"],kV=1e3;let AV=0;function Ry(e,t,n,r){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Vk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=lk(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Mt,!(a||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Vk(r)}function Uk({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(c={},d=t?.()){this.id=AV++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(PV),this.nodes.forEach(zV),this.nodes.forEach(FV),this.nodes.forEach(LV)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new _V)}addEventListener(c,d){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Ob),this.eventHandlers.get(c).add(d)}notifyListeners(c,...d){const h=this.eventHandlers.get(c);h&&h.notify(...d)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=Jb(c)&&!M$(c),this.instance=c;const{layoutId:d,layout:h,visualElement:f}=this.options;if(f&&!f.current&&f.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||d)&&(this.isLayoutDirty=!0),e){let m,p=0;const y=()=>this.root.updateBlockedByResize=!1;Mt.read(()=>{p=window.innerWidth}),e(c,()=>{const v=window.innerWidth;v!==p&&(p=v,this.root.updateBlockedByResize=!0,m&&m(),m=RV(y,250),lm.hasAnimatedSinceResize&&(lm.hasAnimatedSinceResize=!1,this.nodes.forEach(f2)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&f&&(d||h)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:p,hasRelativeLayoutChanged:y,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||f.getDefaultTransition()||GV,{onLayoutAnimationStart:N,onLayoutAnimationComplete:C}=f.getProps(),j=!this.targetLayout||!zk(this.targetLayout,v),E=!p&&y;if(this.options.layoutRoot||this.resumeFrom||E||p&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={...Gb(S,"layout"),onPlay:N,onComplete:C};(f.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(m,E)}else p||f2(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Fi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach($V),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Vk(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const p=this.path[m];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(u2);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(d2);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(BV),this.nodes.forEach(OV),this.nodes.forEach(MV)):this.nodes.forEach(d2),this.clearAllSnapshots();const d=Zn.now();An.delta=fa(0,1e3/60,d-An.timestamp),An.timestamp=d,An.isProcessing=!0,by.update.process(An),by.preRender.process(An),by.render.process(An),An.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Xb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(IV),this.sharedNodes.forEach(VV)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Mt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Mt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!er(this.snapshot.measuredBox.x)&&!er(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=xn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(d=!1),d&&this.instance){const h=r(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!a)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!Bk(this.projectionDelta),h=this.getTransformTemplate(),f=h?h(this.latestValues,""):void 0,m=f!==this.prevTransformTemplateValue;c&&this.instance&&(d||ko(this.latestValues)||m)&&(a(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return c&&(h=this.removeTransform(h)),qV(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return xn();const d=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(WV))){const{scroll:f}=this.root;f&&(ec(d.x,f.offset.x),ec(d.y,f.offset.y))}return d}removeElementScroll(c){const d=xn();if(Ts(d,c),this.scroll?.wasRoot)return d;for(let h=0;h<this.path.length;h++){const f=this.path[h],{scroll:m,options:p}=f;f!==this.root&&m&&p.layoutScroll&&(m.wasRoot&&Ts(d,c),ec(d.x,m.offset.x),ec(d.y,m.offset.y))}return d}applyTransform(c,d=!1){const h=xn();Ts(h,c);for(let f=0;f<this.path.length;f++){const m=this.path[f];!d&&m.options.layoutScroll&&m.scroll&&m!==m.root&&tc(h,{x:-m.scroll.offset.x,y:-m.scroll.offset.y}),ko(m.latestValues)&&tc(h,m.latestValues)}return ko(this.latestValues)&&tc(h,this.latestValues),h}removeTransform(c){const d=xn();Ts(d,c);for(let h=0;h<this.path.length;h++){const f=this.path[h];if(!f.instance||!ko(f.latestValues))continue;l0(f.latestValues)&&f.updateSnapshot();const m=xn(),p=f.measurePageBox();Ts(m,p),t2(d,f.latestValues,f.snapshot?f.snapshot.layoutBox:void 0,m)}return ko(this.latestValues)&&t2(d,this.latestValues),d}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==An.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==d;if(!(c||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:p}=this.options;if(!this.layout||!(m||p))return;this.resolvedRelativeTargetAt=An.timestamp;const y=this.getClosestProjectingParent();y&&this.linkedParentVersion!==y.layoutVersion&&!y.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(y&&y.layout?this.createRelativeTarget(y,this.layout.layoutBox,y.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=xn(),this.targetWithTransforms=xn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),gV(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ts(this.target,this.layout.layoutBox),Ek(this.target,this.targetDelta)):Ts(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?this.createRelativeTarget(y,this.target,y.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||l0(this.parent.latestValues)||Ck(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(c,d,h){this.relativeParent=c,this.linkedParentVersion=c.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xn(),this.relativeTargetOrigin=xn(),Tm(this.relativeTargetOrigin,d,h),Ts(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const c=this.getLead(),d=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===An.timestamp&&(h=!1),h)return;const{layout:f,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||m))return;Ts(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;G$(this.layoutCorrected,this.treeScale,this.path,d),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=xn());const{target:v}=c;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(YE(this.prevProjectionDelta.x,this.projectionDelta.x),YE(this.prevProjectionDelta.y,this.projectionDelta.y)),sd(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!i2(this.projectionDelta.x,this.prevProjectionDelta.x)||!i2(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){if(this.options.visualElement?.scheduleRender(),c){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Zl(),this.projectionDelta=Zl(),this.projectionDeltaWithTransform=Zl()}setAnimationOrigin(c,d=!1){const h=this.snapshot,f=h?h.latestValues:{},m={...this.latestValues},p=Zl();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const y=xn(),v=h?h.source:void 0,S=this.layout?this.layout.source:void 0,N=v!==S,C=this.getStack(),j=!C||C.members.length<=1,E=!!(N&&!j&&this.options.crossfade===!0&&!this.path.some(HV));this.animationProgress=0;let R;this.mixTargetDelta=A=>{const _=A/1e3;h2(p.x,c.x,_),h2(p.y,c.y,_),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Tm(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),UV(this.relativeTarget,this.relativeTargetOrigin,y,_),R&&bV(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=xn()),Ts(R,this.relativeTarget)),N&&(this.animationValues=m,NV(m,f,this.latestValues,_,E,j)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Fi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Mt.update(()=>{lm.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=dc(0)),this.currentAnimation=EV(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),c.onUpdate&&c.onUpdate(d)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(kV),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:d,target:h,layout:f,latestValues:m}=c;if(!(!d||!h||!f)){if(this!==c&&this.layout&&f&&Hk(this.options.animationType,this.layout.layoutBox,f.layoutBox)){h=this.target||xn();const p=er(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+p;const y=er(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+y}Ts(d,h),tc(d,m),sd(this.projectionDeltaWithTransform,this.layoutCorrected,d,m)}}registerSharedNode(c,d){this.sharedNodes.has(c)||this.sharedNodes.set(c,new DV),this.sharedNodes.get(c).add(d);const f=d.options.initialPromotionConfig;d.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(d):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:d,preserveFollowOpacity:h}={}){const f=this.getStack();f&&f.promote(this,h),c&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let d=!1;const{latestValues:h}=c;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const f={};h.z&&Ry("z",c,f,this.animationValues);for(let m=0;m<_y.length;m++)Ry(`rotate${_y[m]}`,c,f,this.animationValues),Ry(`skew${_y[m]}`,c,f,this.animationValues);c.render();for(const m in f)c.setStaticValue(m,f[m]),this.animationValues&&(this.animationValues[m]=f[m]);c.scheduleRender()}applyProjectionStyles(c,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=om(d?.pointerEvents)||"",c.transform=h?h(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=om(d?.pointerEvents)||""),this.hasProjected&&!ko(this.latestValues)&&(c.transform=h?h({},""):"none",this.hasProjected=!1);return}c.visibility="";const m=f.animationValues||f.latestValues;this.applyTransformsToTarget();let p=wV(this.projectionDeltaWithTransform,this.treeScale,m);h&&(p=h(m,p)),c.transform=p;const{x:y,y:v}=this.projectionDelta;c.transformOrigin=`${y.origin*100}% ${v.origin*100}% 0`,f.animationValues?c.opacity=f===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:c.opacity=f===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const S in u0){if(m[S]===void 0)continue;const{correct:N,applyTo:C,isCSSVariable:j}=u0[S],E=p==="none"?m[S]:N(m[S],f);if(C){const R=C.length;for(let A=0;A<R;A++)c[C[A]]=E}else j?this.options.visualElement.renderState.vars[S]=E:c[S]=E}this.options.layoutId&&(c.pointerEvents=f===this?om(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(u2),this.root.sharedNodes.clear()}}}function OV(e){e.updateLayout()}function MV(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;a==="size"?Xs(m=>{const p=o?t.measuredBox[m]:t.layoutBox[m],y=er(p);p.min=n[m].min,p.max=p.min+y}):Hk(a,t.layoutBox,n)&&Xs(m=>{const p=o?t.measuredBox[m]:t.layoutBox[m],y=er(n[m]);p.max=p.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+y)});const c=Zl();sd(c,n,t.layoutBox);const d=Zl();o?sd(d,e.applyTransform(r,!0),t.measuredBox):sd(d,n,t.layoutBox);const h=!Bk(c);let f=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:p,layout:y}=m;if(p&&y){const v=xn();Tm(v,t.layoutBox,p.layoutBox);const S=xn();Tm(S,n,y.layoutBox),zk(v,S)||(f=!0),m.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=v,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:d,layoutDelta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function PV(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function LV(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function IV(e){e.clearSnapshot()}function u2(e){e.clearMeasurements()}function d2(e){e.isLayoutDirty=!1}function BV(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function f2(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zV(e){e.resolveTargetDelta()}function FV(e){e.calcProjection()}function $V(e){e.resetSkewAndRotation()}function VV(e){e.removeLeadSnapshot()}function h2(e,t,n){e.translate=Gt(t.translate,0,n),e.scale=Gt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function m2(e,t,n,r){e.min=Gt(t.min,n.min,r),e.max=Gt(t.max,n.max,r)}function UV(e,t,n,r){m2(e.x,t.x,n.x,r),m2(e.y,t.y,n.y,r)}function HV(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const GV={duration:.45,ease:[.4,0,.1,1]},p2=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),g2=p2("applewebkit/")&&!p2("chrome/")?Math.round:cs;function x2(e){e.min=g2(e.min),e.max=g2(e.max)}function qV(e){x2(e.x),x2(e.y)}function Hk(e,t,n){return e==="position"||e==="preserve-aspect"&&!pV(a2(t),a2(n),.2)}function WV(e){return e!==e.root&&e.scroll?.wasRoot}const KV=Uk({attachResizeListener:(e,t)=>Nd(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Dy={current:void 0},Gk=Uk({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Dy.current){const e=new KV({});e.mount(window),e.setOptions({layoutScroll:!0}),Dy.current=e}return Dy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),rw=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function y2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function YV(...e){return t=>{let n=!1;const r=e.map(a=>{const o=y2(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a<r.length;a++){const o=r[a];typeof o=="function"?o():y2(e[a],null)}}}}function XV(...e){return x.useCallback(YV(...e),e)}class QV extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,a=i0(r)&&r.offsetWidth||0,o=i0(r)&&r.offsetHeight||0,c=this.props.sizeRef.current;c.height=n.offsetHeight||0,c.width=n.offsetWidth||0,c.top=n.offsetTop,c.left=n.offsetLeft,c.right=a-c.width-c.left,c.bottom=o-c.height-c.top}return null}componentDidUpdate(){}render(){return this.props.children}}function JV({children:e,isPresent:t,anchorX:n,anchorY:r,root:a,pop:o}){const c=x.useId(),d=x.useRef(null),h=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:f}=x.useContext(rw),m=e.props?.ref??e?.ref,p=XV(d,m);return x.useInsertionEffect(()=>{const{width:y,height:v,top:S,left:N,right:C,bottom:j}=h.current;if(t||o===!1||!d.current||!y||!v)return;const E=n==="left"?`left: ${N}`:`right: ${C}`,R=r==="bottom"?`bottom: ${j}`:`top: ${S}`;d.current.dataset.motionPopId=c;const A=document.createElement("style");f&&(A.nonce=f);const _=a??document.head;return _.appendChild(A),A.sheet&&A.sheet.insertRule(`
13
+ [data-motion-pop-id="${c}"] {
14
+ position: absolute !important;
15
+ width: ${y}px !important;
16
+ height: ${v}px !important;
17
+ ${E}px !important;
18
+ ${R}px !important;
19
+ }
20
+ `),()=>{_.contains(A)&&_.removeChild(A)}},[t]),l.jsx(QV,{isPresent:t,childRef:d,sizeRef:h,pop:o,children:o===!1?e:x.cloneElement(e,{ref:p})})}const ZV=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:a,presenceAffectsLayout:o,mode:c,anchorX:d,anchorY:h,root:f})=>{const m=Rb(eU),p=x.useId();let y=!0,v=x.useMemo(()=>(y=!1,{id:p,initial:t,isPresent:n,custom:a,onExitComplete:S=>{m.set(S,!0);for(const N of m.values())if(!N)return;r&&r()},register:S=>(m.set(S,!1),()=>m.delete(S))}),[n,m,r]);return o&&y&&(v={...v}),x.useMemo(()=>{m.forEach((S,N)=>m.set(N,!1))},[n]),x.useEffect(()=>{!n&&!m.size&&r&&r()},[n]),e=l.jsx(JV,{pop:c==="popLayout",isPresent:n,anchorX:d,anchorY:h,root:f,children:e}),l.jsx(lp.Provider,{value:v,children:e})};function eU(){return new Map}function qk(e=!0){const t=x.useContext(lp);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=t,o=x.useId();x.useEffect(()=>{if(e)return a(o)},[e]);const c=x.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,c]:[!0]}const kh=e=>e.key||"";function v2(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const tU=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:a=!0,mode:o="sync",propagate:c=!1,anchorX:d="left",anchorY:h="top",root:f})=>{const[m,p]=qk(c),y=x.useMemo(()=>v2(e),[e]),v=c&&!m?[]:y.map(kh),S=x.useRef(!0),N=x.useRef(y),C=Rb(()=>new Map),j=x.useRef(new Set),[E,R]=x.useState(y),[A,_]=x.useState(y);SD(()=>{S.current=!1,N.current=y;for(let D=0;D<A.length;D++){const B=kh(A[D]);v.includes(B)?(C.delete(B),j.current.delete(B)):C.get(B)!==!0&&C.set(B,!1)}},[A,v.length,v.join("-")]);const O=[];if(y!==E){let D=[...y];for(let B=0;B<A.length;B++){const W=A[B],M=kh(W);v.includes(M)||(D.splice(B,0,W),O.push(W))}return o==="wait"&&O.length&&(D=O),_(v2(D)),R(y),null}const{forceRender:T}=x.useContext(_b);return l.jsx(l.Fragment,{children:A.map(D=>{const B=kh(D),W=c&&!m?!1:y===A||v.includes(B),M=()=>{if(j.current.has(B))return;if(j.current.add(B),C.has(B))C.set(B,!0);else return;let V=!0;C.forEach(G=>{G||(V=!1)}),V&&(T?.(),_(N.current),c&&p?.(),r&&r())};return l.jsx(ZV,{isPresent:W,initial:!S.current||n?void 0:!1,custom:t,presenceAffectsLayout:a,mode:o,root:f,onExitComplete:W?void 0:M,anchorX:d,anchorY:h,children:D},B)})})},Wk=x.createContext({strict:!1}),b2={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let w2=!1;function nU(){if(w2)return;const e={};for(const t in b2)e[t]={isEnabled:n=>b2[t].some(r=>!!n[r])};Sk(e),w2=!0}function Kk(){return nU(),$$()}function rU(e){const t=Kk();for(const n in e)t[n]={...t[n],...e[n]};Sk(t)}const sU=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function _m(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||sU.has(e)}let Yk=e=>!_m(e);function aU(e){typeof e=="function"&&(Yk=t=>t.startsWith("on")?!_m(t):e(t))}try{aU(require("@emotion/is-prop-valid").default)}catch{}function iU(e,t,n){const r={};for(const a in e)a==="values"&&typeof e.values=="object"||(Yk(a)||n===!0&&_m(a)||!t&&!_m(a)||e.draggable&&a.startsWith("onDrag"))&&(r[a]=e[a]);return r}const dp=x.createContext({});function oU(e,t){if(up(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Sd(n)?n:void 0,animate:Sd(r)?r:void 0}}return e.inherit!==!1?t:{}}function lU(e){const{initial:t,animate:n}=oU(e,x.useContext(dp));return x.useMemo(()=>({initial:t,animate:n}),[S2(t),S2(n)])}function S2(e){return Array.isArray(e)?e.join(" "):e}const sw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Xk(e,t,n){for(const r in t)!Vn(t[r])&&!Rk(r,n)&&(e[r]=t[r])}function cU({transformTemplate:e},t){return x.useMemo(()=>{const n=sw();return tw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function uU(e,t){const n=e.style||{},r={};return Xk(r,n,e),Object.assign(r,cU(e,t)),r}function dU(e,t){const n={},r=uU(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Qk=()=>({...sw(),attrs:{}});function fU(e,t,n,r){const a=x.useMemo(()=>{const o=Qk();return Dk(o,t,Ak(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Xk(o,e.style,e),a.style={...o,...a.style}}return a}const hU=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function aw(e){return typeof e!="string"||e.includes("-")?!1:!!(hU.indexOf(e)>-1||/[A-Z]/u.test(e))}function mU(e,t,n,{latestValues:r},a,o=!1,c){const h=(c??aw(e)?fU:dU)(t,r,a,e),f=iU(t,typeof e=="string",o),m=e!==x.Fragment?{...f,...h,ref:n}:{},{children:p}=t,y=x.useMemo(()=>Vn(p)?p.get():p,[p]);return x.createElement(e,{...m,children:y})}function pU({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,a){return{latestValues:gU(n,r,a,e),renderState:t()}}function gU(e,t,n,r){const a={},o=r(e,{});for(const y in o)a[y]=om(o[y]);let{initial:c,animate:d}=e;const h=up(e),f=bk(e);t&&f&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),d===void 0&&(d=t.animate));let m=n?n.initial===!1:!1;m=m||c===!1;const p=m?d:c;if(p&&typeof p!="boolean"&&!cp(p)){const y=Array.isArray(p)?p:[p];for(let v=0;v<y.length;v++){const S=Wb(e,y[v]);if(S){const{transitionEnd:N,transition:C,...j}=S;for(const E in j){let R=j[E];if(Array.isArray(R)){const A=m?R.length-1:0;R=R[A]}R!==null&&(a[E]=R)}for(const E in N)a[E]=N[E]}}}return a}const Jk=e=>(t,n)=>{const r=x.useContext(dp),a=x.useContext(lp),o=()=>pU(e,t,r,a);return n?o():Rb(o)},xU=Jk({scrapeMotionValuesFromProps:nw,createRenderState:sw}),yU=Jk({scrapeMotionValuesFromProps:Ok,createRenderState:Qk}),vU=Symbol.for("motionComponentSymbol");function bU(e,t,n){const r=x.useRef(n);x.useInsertionEffect(()=>{r.current=n});const a=x.useRef(null);return x.useCallback(o=>{o&&e.onMount?.(o),t&&(o?t.mount(o):t.unmount());const c=r.current;if(typeof c=="function")if(o){const d=c(o);typeof d=="function"&&(a.current=d)}else a.current?(a.current(),a.current=null):c(o);else c&&(c.current=o)},[t])}const Zk=x.createContext({});function ql(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wU(e,t,n,r,a,o){const{visualElement:c}=x.useContext(dp),d=x.useContext(Wk),h=x.useContext(lp),f=x.useContext(rw),m=f.reducedMotion,p=f.skipAnimations,y=x.useRef(null),v=x.useRef(!1);r=r||d.renderer,!y.current&&r&&(y.current=r(e,{visualState:t,parent:c,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,skipAnimations:p,isSVG:o}),v.current&&y.current&&(y.current.manuallyAnimateOnMount=!0));const S=y.current,N=x.useContext(Zk);S&&!S.projection&&a&&(S.type==="html"||S.type==="svg")&&SU(y.current,n,a,N);const C=x.useRef(!1);x.useInsertionEffect(()=>{S&&C.current&&S.update(n,h)});const j=n[ok],E=x.useRef(!!j&&!window.MotionHandoffIsComplete?.(j)&&window.MotionHasOptimisedAnimation?.(j));return SD(()=>{v.current=!0,S&&(C.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),E.current&&S.animationState&&S.animationState.animateChanges())}),x.useEffect(()=>{S&&(!E.current&&S.animationState&&S.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(j)}),E.current=!1),S.enteringChildren=void 0)}),S}function SU(e,t,n,r){const{layoutId:a,layout:o,drag:c,dragConstraints:d,layoutScroll:h,layoutRoot:f,layoutCrossfade:m}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:eA(e.parent)),e.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:!!c||d&&ql(d),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:m,layoutScroll:h,layoutRoot:f})}function eA(e){if(e)return e.options.allowProjection!==!1?e.projection:eA(e.parent)}function ky(e,{forwardMotionProps:t=!1,type:n}={},r,a){r&&rU(r);const o=n?n==="svg":aw(e),c=o?yU:xU;function d(f,m){let p;const y={...x.useContext(rw),...f,layoutId:NU(f)},{isStatic:v}=y,S=lU(f),N=c(f,v);if(!v&&wD){jU();const C=CU(y);p=C.MeasureLayout,S.visualElement=wU(e,N,y,a,C.ProjectionNode,o)}return l.jsxs(dp.Provider,{value:S,children:[p&&S.visualElement?l.jsx(p,{visualElement:S.visualElement,...y}):null,mU(e,f,bU(N,S.visualElement,m),N,v,t,o)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=x.forwardRef(d);return h[vU]=e,h}function NU({layoutId:e}){const t=x.useContext(_b).id;return t&&e!==void 0?t+"-"+e:e}function jU(e,t){x.useContext(Wk).strict}function CU(e){const t=Kk(),{drag:n,layout:r}=t;if(!n&&!r)return{};const a={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function EU(e,t){if(typeof Proxy>"u")return ky;const n=new Map,r=(o,c)=>ky(o,c,e,t),a=(o,c)=>r(o,c);return new Proxy(a,{get:(o,c)=>c==="create"?r:(n.has(c)||n.set(c,ky(c,void 0,e,t)),n.get(c))})}const TU=(e,t)=>t.isSVG??aw(e)?new sV(t):new J$(t,{allowProjection:e!==x.Fragment});class _U extends Xi{constructor(t){super(t),t.animationState||(t.animationState=cV(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();cp(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let RU=0;class DU extends Xi{constructor(){super(...arguments),this.id=RU++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const a=this.node.animationState.setActive("exit",!t);n&&!t&&a.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const kU={animation:{Feature:_U},exit:{Feature:DU}};function Xd(e){return{point:{x:e.pageX,y:e.pageY}}}const AU=e=>t=>Qb(t)&&e(t,Xd(t));function ad(e,t,n,r){return Nd(e,t,AU(n),r)}const tA=({current:e})=>e?e.ownerDocument.defaultView:null,N2=(e,t)=>Math.abs(e-t);function OU(e,t){const n=N2(e.x,t.x),r=N2(e.y,t.y);return Math.sqrt(n**2+r**2)}const j2=new Set(["auto","scroll"]);class nA{constructor(t,n,{transformPagePoint:r,contextWindow:a=window,dragSnapToOrigin:o=!1,distanceThreshold:c=3,element:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Oy(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,N=OU(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!N)return;const{point:C}=v,{timestamp:j}=An;this.history.push({...C,timestamp:j});const{onStart:E,onMove:R}=this.handlers;S||(E&&E(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,v)},this.handlePointerMove=(v,S)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=Ay(S,this.transformPagePoint),Mt.update(this.updatePoint,!0)},this.handlePointerUp=(v,S)=>{this.end();const{onEnd:N,onSessionEnd:C,resumeAnimation:j}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&j&&j(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const E=Oy(v.type==="pointercancel"?this.lastMoveEventInfo:Ay(S,this.transformPagePoint),this.history);this.startEvent&&N&&N(v,E),C&&C(v,E)},!Qb(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=c,this.contextWindow=a||window;const h=Xd(t),f=Ay(h,this.transformPagePoint),{point:m}=f,{timestamp:p}=An;this.history=[{...m,timestamp:p}];const{onSessionStart:y}=n;y&&y(t,Oy(f,this.history)),this.removeListeners=Wd(ad(this.contextWindow,"pointermove",this.handlePointerMove),ad(this.contextWindow,"pointerup",this.handlePointerUp),ad(this.contextWindow,"pointercancel",this.handlePointerUp)),d&&this.startScrollTracking(d)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(j2.has(r.overflowX)||j2.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,a=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:a.x-n.x,y:a.y-n.y};o.x===0&&o.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,a),Mt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Fi(this.updatePoint)}}function Ay(e,t){return t?{point:t(e.point)}:e}function C2(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Oy({point:e},t){return{point:e,delta:C2(e,rA(t)),offset:C2(e,MU(t)),velocity:PU(t,.1)}}function MU(e){return e[0]}function rA(e){return e[e.length-1]}function PU(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const a=rA(e);for(;n>=0&&(r=e[n],!(a.timestamp-r.timestamp>Ms(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&a.timestamp-r.timestamp>Ms(t)*2&&(r=e[1]);const o=os(a.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const c={x:(a.x-r.x)/o,y:(a.y-r.y)/o};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function LU(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Gt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Gt(n,e,r.max):Math.min(e,n)),e}function E2(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function IU(e,{top:t,left:n,bottom:r,right:a}){return{x:E2(e.x,n,a),y:E2(e.y,t,r)}}function T2(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function BU(e,t){return{x:T2(e.x,t.x),y:T2(e.y,t.y)}}function zU(e,t){let n=.5;const r=er(e),a=er(t);return a>r?n=vd(t.min,t.max-r,e.min):r>a&&(n=vd(e.min,e.max-a,t.min)),fa(0,1,n)}function FU(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const d0=.35;function $U(e=d0){return e===!1?e=0:e===!0&&(e=d0),{x:_2(e,"left","right"),y:_2(e,"top","bottom")}}function _2(e,t,n){return{min:R2(e,t),max:R2(e,n)}}function R2(e,t){return typeof e=="number"?e:e[t]||0}const VU=new WeakMap;class UU{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=xn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const o=p=>{n&&this.snapToCursor(Xd(p).point),this.stopAnimation()},c=(p,y)=>{const{drag:v,dragPropagation:S,onDragStart:N}=this.getProps();if(v&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=x$(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Xs(j=>{let E=this.getAxisMotionValue(j).get()||0;if(ra.test(E)){const{projection:R}=this.visualElement;if(R&&R.layout){const A=R.layout.layoutBox[j];A&&(E=er(A)*(parseFloat(E)/100))}}this.originPoint[j]=E}),N&&Mt.update(()=>N(p,y),!1,!0),r0(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},d=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y;const{dragPropagation:v,dragDirectionLock:S,onDirectionLock:N,onDrag:C}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:j}=y;if(S&&this.currentDirection===null){this.currentDirection=GU(j),this.currentDirection!==null&&N&&N(this.currentDirection);return}this.updateAxis("x",y.point,j),this.updateAxis("y",y.point,j),this.visualElement.render(),C&&Mt.update(()=>C(p,y),!1,!0)},h=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y,this.stop(p,y),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new nA(t,{onSessionStart:o,onStart:c,onMove:d,onSessionEnd:h,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:r,contextWindow:tA(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,a=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!a||!r)return;const{velocity:c}=a;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&Mt.postRender(()=>d(r,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:a}=this.getProps();if(!r||!Ah(t,a,this.currentDirection))return;const o=this.getAxisMotionValue(t);let c=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(c=LU(c,this.constraints[t],this.elastic[t])),o.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,a=this.constraints;t&&ql(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=IU(r.layoutBox,t):this.constraints=!1,this.elastic=$U(n),a!==this.constraints&&!ql(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Xs(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=FU(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ql(t))return!1;const r=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const o=q$(r,a.root,this.visualElement.getTransformPagePoint());let c=BU(a.layout.layoutBox,o);if(n){const d=n(U$(c));this.hasMutatedConstraints=!!d,d&&(c=jk(d))}return c}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:o,dragSnapToOrigin:c,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},f=Xs(m=>{if(!Ah(m,n,this.currentDirection))return;let p=h&&h[m]||{};c&&(p={min:0,max:0});const y=a?200:1e6,v=a?40:1e7,S={type:"inertia",velocity:r?t[m]:0,bounceStiffness:y,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...o,...p};return this.startAxisValueAnimation(m,S)});return Promise.all(f).then(d)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r0(this.visualElement,t),r.start(qb(t,r,0,n,this.visualElement,!1))}stopAnimation(){Xs(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),a=r[n];return a||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Xs(n=>{const{drag:r}=this.getProps();if(!Ah(n,r,this.currentDirection))return;const{projection:a}=this.visualElement,o=this.getAxisMotionValue(n);if(a&&a.layout){const{min:c,max:d}=a.layout.layoutBox[n],h=o.get()||0;o.set(t[n]-Gt(c,d,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ql(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};Xs(c=>{const d=this.getAxisMotionValue(c);if(d&&this.constraints!==!1){const h=d.get();a[c]=zU({min:h,max:h},this.constraints[c])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Xs(c=>{if(!Ah(c,t,null))return;const d=this.getAxisMotionValue(c),{min:h,max:f}=this.constraints[c];d.set(Gt(h,f,a[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;VU.set(this.visualElement,this);const t=this.visualElement.current,n=ad(t,"pointerdown",f=>{const{drag:m,dragListener:p=!0}=this.getProps(),y=f.target,v=y!==t&&N$(y);m&&p&&!v&&this.start(f)});let r;const a=()=>{const{dragConstraints:f}=this.getProps();ql(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),r||(r=HU(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,c=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Mt.read(a);const d=Nd(window,"resize",()=>this.scalePositionWithinConstraints()),h=o.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(Xs(p=>{const y=this.getAxisMotionValue(p);y&&(this.originPoint[p]+=f[p].translate,y.set(y.get()+f[p].translate))}),this.visualElement.render())}));return()=>{d(),n(),c(),h&&h(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:a=!1,dragConstraints:o=!1,dragElastic:c=d0,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:o,dragElastic:c,dragMomentum:d}}}function D2(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function HU(e,t,n){const r=IE(e,D2(n)),a=IE(t,D2(n));return()=>{r(),a()}}function Ah(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function GU(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class qU extends Xi{constructor(t){super(t),this.removeGroupControls=cs,this.removeListeners=cs,this.controls=new UU(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cs}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const My=e=>(t,n)=>{e&&Mt.update(()=>e(t,n),!1,!0)};class WU extends Xi{constructor(){super(...arguments),this.removePointerDownListener=cs}onPointerDown(t){this.session=new nA(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tA(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:My(t),onStart:My(n),onMove:My(r),onEnd:(o,c)=>{delete this.session,a&&Mt.postRender(()=>a(o,c))}}}mount(){this.removePointerDownListener=ad(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Py=!1;class KU extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:a}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),r&&r.register&&a&&r.register(o),Py&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),lm.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:a,isPresent:o}=this.props,{projection:c}=r;return c&&(c.isPresent=o,t.layoutDependency!==n&&c.setOptions({...c.options,layoutDependency:n}),Py=!0,a||t.layoutDependency!==n||n===void 0||t.isPresent!==o?c.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?c.promote():c.relegate()||Mt.postRender(()=>{const d=c.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Xb.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=t;Py=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),r&&r.deregister&&r.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function sA(e){const[t,n]=qk(),r=x.useContext(_b);return l.jsx(KU,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(Zk),isPresent:t,safeToRemove:n})}const YU={pan:{Feature:WU},drag:{Feature:qU,ProjectionNode:Gk,MeasureLayout:sA}};function k2(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,o=r[a];o&&Mt.postRender(()=>o(t,Xd(t)))}class XU extends Xi{mount(){const{current:t}=this.node;t&&(this.unmount=v$(t,(n,r)=>(k2(this.node,r,"Start"),a=>k2(this.node,a,"End"))))}unmount(){}}class QU extends Xi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Wd(Nd(this.node.current,"focus",()=>this.onFocus()),Nd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function A2(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const a="onTap"+(n==="End"?"":n),o=r[a];o&&Mt.postRender(()=>o(t,Xd(t)))}class JU extends Xi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=C$(t,(a,o)=>(A2(this.node,o,"Start"),(c,{success:d})=>A2(this.node,c,d?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}}const f0=new WeakMap,Ly=new WeakMap,ZU=e=>{const t=f0.get(e.target);t&&t(e)},eH=e=>{e.forEach(ZU)};function tH({root:e,...t}){const n=e||document;Ly.has(n)||Ly.set(n,{});const r=Ly.get(n),a=JSON.stringify(t);return r[a]||(r[a]=new IntersectionObserver(eH,{root:e,...t})),r[a]}function nH(e,t,n){const r=tH(t);return f0.set(e,n),r.observe(e),()=>{f0.delete(e),r.unobserve(e)}}const rH={some:0,all:1};class sH extends Xi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:o}=t,c={root:n?n.current:void 0,rootMargin:r,threshold:typeof a=="number"?a:rH[a]},d=h=>{const{isIntersecting:f}=h;if(this.isInView===f||(this.isInView=f,o&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:p}=this.node.getProps(),y=f?m:p;y&&y(h)};return nH(this.node.current,c,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(aH(t,n))&&this.startObserver()}unmount(){}}function aH({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const iH={inView:{Feature:sH},tap:{Feature:JU},focus:{Feature:QU},hover:{Feature:XU}},oH={layout:{ProjectionNode:Gk,MeasureLayout:sA}},lH={...kU,...iH,...YU,...oH},cH=EU(lH,TU),Qd={backendBaseUrl:"http://localhost:8000",appName:"Draft"},tr={boards:{all:["boards"],detail:e=>["boards",e],view:e=>["boards",e,"view"]},tickets:{all:["tickets"],detail:e=>["tickets",e]},goals:{all:["goals"],detail:e=>["goals",e],byBoard:e=>["goals","board",e]},jobs:{all:["jobs"],detail:e=>["jobs",e],byTicket:e=>["jobs","ticket",e]},revisions:{all:["revisions"],detail:e=>["revisions",e],byTicket:e=>["revisions","ticket",e]},evidence:{byTicket:e=>["evidence","ticket",e],byJob:e=>["evidence","job",e]},executors:{available:["executors","available"],profiles:["executors","profiles"]},planner:{status:["planner","status"]}};async function aA(e){return Ae(`/boards/${e}/config`)}async function iA(e,t){return Ae(`/boards/${e}/config`,{method:"PUT",body:JSON.stringify(t)})}async function uH(e){return Ae(`/boards/${e}/config`,{method:"DELETE"})}async function dH(e){return Ae(`/executors/${e}/models`)}async function oA(e){const t=e?`?board_id=${e}`:"";return Ae(`/executors/profiles${t}`)}async function fH(e,t){const n=t?`?board_id=${t}`:"";return Ae(`/executors/profiles${n}`,{method:"PUT",body:JSON.stringify(e)})}async function hH(e){return Ae(`/boards/${e}`,{method:"DELETE"})}async function mH(e){return Ae(`/boards/${e}/tickets`,{method:"DELETE"})}async function pH(e){const t=e?`?board_id=${e}`:"";return Ae(`/settings/planner${t}`)}async function gH(e,t){const n=t?`?board_id=${t}`:"";return Ae(`/settings/planner${n}`,{method:"PUT",body:JSON.stringify(e)})}async function O2(e){const t=e?`?board_id=${e}`:"";return Ae(`/settings/planner/check${t}`)}const Tc=Qd.backendBaseUrl;class xH extends Error{status;constructor(t,n){super(t),this.name="ApiError",this.status=n}}async function Ae(e,t){const n=`${Tc}${e}`,r=await fetch(n,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!r.ok){const o=(await r.json().catch(c=>(console.error(`Failed to parse error response JSON from ${e}:`,c),{}))).detail||`HTTP error ${r.status}`;throw new xH(o,r.status)}if(r.status!==204)return r.json()}async function yH(){return Ae("/boards")}async function vH(e){return Ae(e?`/boards/${e}/board`:"/board")}async function bH(e){return Ae("/boards",{method:"POST",body:JSON.stringify(e)})}async function wH(e){return Ae("/repos/discover",{method:"POST",body:JSON.stringify(e)})}async function SH(e){return Ae(`/tickets/${e}`,{method:"DELETE"})}async function NH(e){return Ae(`/tickets/${e}/events`)}async function jH(e){return Ae("/goals",{method:"POST",body:JSON.stringify(e)})}async function iw(e){const t=e?`?board_id=${encodeURIComponent(e)}`:"";return Ae(`/goals${t}`)}async function Pl(e,t){return Ae(`/goals/${e}`,{method:"PATCH",body:JSON.stringify(t)})}async function lA(e){return Ae(`/goals/${e}`,{method:"DELETE"})}async function CH(e){return Ae("/tickets",{method:"POST",body:JSON.stringify(e)})}async function Iy(e,t){return Ae(`/tickets/${e}`,{method:"PATCH",body:JSON.stringify(t)})}async function cm(e,t){return Ae(`/tickets/${e}/transition`,{method:"POST",body:JSON.stringify(t)})}async function EH(e){return Ae(`/tickets/${e}`)}async function cA(e,t){const n=t?`/tickets/${e}/execute?executor_profile=${encodeURIComponent(t)}`:`/tickets/${e}/execute`;return Ae(n,{method:"POST"})}async function TH(e){return Ae(`/tickets/${e}/evidence`)}async function _H(e){return Ae(`/tickets/${e}/dependents`)}async function RH(e){const t=`${Tc}/evidence/${e}/stdout`,n=await fetch(t);if(!n.ok)throw new Error(`HTTP error ${n.status}`);return n.text()}async function DH(e){const t=`${Tc}/evidence/${e}/stderr`,n=await fetch(t);if(!n.ok)throw new Error(`HTTP error ${n.status}`);return n.text()}async function kH(e){return Ae(`/goals/${e}`)}async function AH(e){return Ae("/tickets/accept",{method:"POST",body:JSON.stringify(e)})}async function OH(e){return Ae(`/goals/${e}/reflect-on-tickets`,{method:"POST"})}async function MH(e){return Ae("/tickets/bulk-update-priority",{method:"POST",body:JSON.stringify(e)})}async function PH(e){return Ae("/planner/start",{method:"POST",body:JSON.stringify({})})}async function uA(e=!1){return Ae(`/planner/status${e?"?health_check=true":""}`)}async function LH(e){return Ae(`/tickets/${e}/revisions`)}async function IH(e){return Ae(`/revisions/${e}`)}async function BH(e){return Ae(`/revisions/${e}/diff`)}async function zH(e,t){return Ae(`/revisions/${e}/comments`,{method:"POST",body:JSON.stringify(t)})}async function FH(e,t=!0){const n=new URLSearchParams;return n.set("include_resolved",String(t)),Ae(`/revisions/${e}/comments?${n.toString()}`)}async function $H(e){return Ae(`/comments/${e}/resolve`,{method:"POST"})}async function VH(e){return Ae(`/comments/${e}/unresolve`,{method:"POST"})}async function UH(e,t){return Ae(`/revisions/${e}/review`,{method:"POST",body:JSON.stringify(t)})}async function HH(e,t){return Ae(`/tickets/${e}/merge`,{method:"POST",body:JSON.stringify(t)})}async function GH(e){return Ae(`/tickets/${e}/merge-status`)}async function M2(e){return Ae(`/tickets/${e}/jobs`)}async function qH(e){return Ae(`/jobs/${e}/cancel`,{method:"POST"})}async function dA(e){const t=`${Tc}/jobs/${e}/logs`,n=await fetch(t);if(!n.ok)throw new Error(`HTTP error ${n.status}`);return n.text()}async function fA(){return Ae("/jobs/queue")}async function WH(e){return Ae("/maintenance/cleanup",{method:"POST",body:JSON.stringify(e)})}async function KH(e=100,t){const n=new URLSearchParams({limit:e.toString()});return Ae(`/debug/orchestrator/logs?${n}`)}async function YH(){return Ae("/debug/status")}async function XH(e=50){return Ae(`/debug/events/recent?limit=${e}`)}function QH(e,t){const n=new EventSource(`${Tc}/debug/orchestrator/stream`);return n.onmessage=r=>{try{const a=JSON.parse(r.data);e(a)}catch(a){console.error("Failed to parse orchestrator log:",a)}},t&&(n.onerror=t),n}function JH(e,t,n){const r=new EventSource(`${Tc}/jobs/${e}/logs/stream`),a=(o,c)=>{try{const d=o.data;if(c==="finished"){t({status:"completed"}),r.close();return}if(c==="error"){t({error:d});return}if(c==="progress"){try{const h=JSON.parse(d);t({progress:h.progress_pct,stage:h.stage})}catch{t({content:d})}return}if(c==="normalized"){try{const h=JSON.parse(d);h.timestamp=h.timestamp||new Date().toISOString(),t({normalized:h})}catch(h){console.error("Failed to parse normalized entry:",h),t({content:d+`
21
+ `})}return}t({content:d+`
22
+ `})}catch(d){console.error("Failed to parse agent log:",d)}};return r.addEventListener("stdout",o=>a(o,"stdout")),r.addEventListener("stderr",o=>a(o,"stderr")),r.addEventListener("info",o=>a(o,"info")),r.addEventListener("error",o=>a(o,"error")),r.addEventListener("progress",o=>a(o,"progress")),r.addEventListener("normalized",o=>a(o,"normalized")),r.addEventListener("finished",o=>a(o,"finished")),r.onmessage=o=>{try{const c=JSON.parse(o.data);t(c)}catch{t({content:o.data+`
23
+ `})}},n&&(r.onerror=n),r}async function ZH(e,t){return Ae(`/tickets/${e}/queue`,{method:"POST",body:JSON.stringify({message:t})})}async function P2(e){return Ae(`/tickets/${e}/queue`)}async function e9(e){return Ae(`/tickets/${e}/queue`,{method:"DELETE"})}async function t9(e){return Ae(`/tickets/${e}/conflict-status`)}async function n9(e,t="main"){return Ae(`/tickets/${e}/rebase?onto_branch=${encodeURIComponent(t)}`,{method:"POST"})}async function r9(e){return Ae(`/tickets/${e}/continue-rebase`,{method:"POST"})}async function s9(e){return Ae(`/tickets/${e}/abort-conflict`,{method:"POST"})}async function a9(e){return Ae(`/tickets/${e}/push`,{method:"POST"})}async function i9(e){return Ae(`/tickets/${e}/force-push`,{method:"POST"})}async function hA(e,t=10,n=50,r=150){const a=new URLSearchParams;return e&&a.set("goal_id",e),a.set("daily_budget",t.toString()),a.set("weekly_budget",n.toString()),a.set("monthly_budget",r.toString()),Ae(`/dashboard?${a.toString()}`)}async function o9(){return Ae("/agents")}async function l9(e,t=!0){const n=new URLSearchParams({include_entries:String(t)});return Ae(`/tickets/${e}/agent-logs?${n.toString()}`)}async function c9(e){return Ae("/pull-requests",{method:"POST",body:JSON.stringify(e)})}async function u9(e){return Ae(`/pull-requests/${e}/refresh`,{method:"POST"})}function d9(){return wb({queryKey:tr.boards.all,queryFn:yH,staleTime:2e3})}const f9=new Set(["executing","verifying","EXECUTING","VERIFYING"]);function ow(e,t=!0){return wb({queryKey:tr.boards.view(e??""),queryFn:()=>vH(e),enabled:!!e,staleTime:2e3,refetchInterval:t?n=>{if(n.state.fetchStatus==="idle"&&n.state.status==="error")return 3e4;const r=n.state.data;return r?.columns&&!r.columns.some(o=>f9.has(o.state))?15e3:3e3}:!1})}function h9(e=!1){return wb({queryKey:[...tr.planner.status,e],queryFn:()=>uA(e),staleTime:1e4})}const L2=e=>{let t;const n=new Set,r=(f,m)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const y=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(v=>v(t,y))}},a=()=>t,d={setState:r,getState:a,getInitialState:()=>h,subscribe:f=>(n.add(f),()=>n.delete(f))},h=t=e(r,a,d);return d},m9=(e=>e?L2(e):L2),p9=e=>e;function g9(e,t=p9){const n=ge.useSyncExternalStore(e.subscribe,ge.useCallback(()=>t(e.getState()),[e,t]),ge.useCallback(()=>t(e.getInitialState()),[e,t]));return ge.useDebugValue(n),n}const I2=e=>{const t=m9(e),n=r=>g9(t,r);return Object.assign(n,t),n},fp=(e=>e?I2(e):I2),lw=fp(e=>({currentBoardId:localStorage.getItem("currentBoardId"),setCurrentBoardId:t=>{localStorage.setItem("currentBoardId",t),e({currentBoardId:t})},clearCurrentBoard:()=>{localStorage.removeItem("currentBoardId"),e({currentBoardId:null})}}));function x9(e,t){if(t){const n=e.find(r=>r.id===t);if(n)return n}return e.length>0?e[0]:null}const mA=x.createContext(null);function y9({children:e}){const t=Ga(),{currentBoardId:n,setCurrentBoardId:r}=lw(),{data:a,isLoading:o,error:c}=d9(),d=x.useMemo(()=>a?.boards??[],[a?.boards]),h=x.useMemo(()=>x9(d,n),[d,n]);x.useEffect(()=>{!h&&d.length>0&&r(d[0].id)},[h,d,r]);async function f(){await t.invalidateQueries({queryKey:tr.boards.all})}const m={currentBoard:h,setCurrentBoard:r,boards:d,isLoading:o,error:c,refreshBoards:f};return l.jsx(mA.Provider,{value:m,children:e})}function ys(){const e=x.useContext(mA);if(!e)throw new Error("useBoard must be used within BoardProvider");return e}var Zo=SR();const cw=ab(Zo);function Rm(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ue(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function v9(e,t){const n=x.createContext(t),r=o=>{const{children:c,...d}=o,h=x.useMemo(()=>d,Object.values(d));return l.jsx(n.Provider,{value:h,children:c})};r.displayName=e+"Provider";function a(o){const c=x.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,a]}function vs(e,t=[]){let n=[];function r(o,c){const d=x.createContext(c),h=n.length;n=[...n,c];const f=p=>{const{scope:y,children:v,...S}=p,N=y?.[e]?.[h]||d,C=x.useMemo(()=>S,Object.values(S));return l.jsx(N.Provider,{value:C,children:v})};f.displayName=o+"Provider";function m(p,y){const v=y?.[e]?.[h]||d,S=x.useContext(v);if(S)return S;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[f,m]}const a=()=>{const o=n.map(c=>x.createContext(c));return function(d){const h=d?.[e]||o;return x.useMemo(()=>({[`__scope${e}`]:{...d,[e]:h}}),[d,h])}};return a.scopeName=e,[r,b9(a,...t)]}function b9(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const c=r.reduce((d,{useScope:h,scopeName:f})=>{const p=h(o)[`__scope${f}`];return{...d,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function B2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fs(...e){return t=>{let n=!1;const r=e.map(a=>{const o=B2(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a<r.length;a++){const o=r[a];typeof o=="function"?o():B2(e[a],null)}}}}function rt(...e){return x.useCallback(fs(...e),e)}function z2(e){const t=w9(e),n=x.forwardRef((r,a)=>{const{children:o,...c}=r,d=x.Children.toArray(o),h=d.find(N9);if(h){const f=h.props.children,m=d.map(p=>p===h?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:p);return l.jsx(t,{...c,ref:a,children:x.isValidElement(f)?x.cloneElement(f,void 0,m):null})}return l.jsx(t,{...c,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function w9(e){const t=x.forwardRef((n,r)=>{const{children:a,...o}=n;if(x.isValidElement(a)){const c=C9(a),d=j9(o,a.props);return a.type!==x.Fragment&&(d.ref=r?fs(r,c):c),x.cloneElement(a,d)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var S9=Symbol("radix.slottable");function N9(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S9}function j9(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...d)=>{const h=o(...d);return a(...d),h}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function C9(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function uw(e){const t=e+"CollectionProvider",[n,r]=vs(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=N=>{const{scope:C,children:j}=N,E=ge.useRef(null),R=ge.useRef(new Map).current;return l.jsx(a,{scope:C,itemMap:R,collectionRef:E,children:j})};c.displayName=t;const d=e+"CollectionSlot",h=z2(d),f=ge.forwardRef((N,C)=>{const{scope:j,children:E}=N,R=o(d,j),A=rt(C,R.collectionRef);return l.jsx(h,{ref:A,children:E})});f.displayName=d;const m=e+"CollectionItemSlot",p="data-radix-collection-item",y=z2(m),v=ge.forwardRef((N,C)=>{const{scope:j,children:E,...R}=N,A=ge.useRef(null),_=rt(C,A),O=o(m,j);return ge.useEffect(()=>(O.itemMap.set(A,{ref:A,...R}),()=>{O.itemMap.delete(A)})),l.jsx(y,{[p]:"",ref:_,children:E})});v.displayName=m;function S(N){const C=o(e+"CollectionConsumer",N);return ge.useCallback(()=>{const E=C.collectionRef.current;if(!E)return[];const R=Array.from(E.querySelectorAll(`[${p}]`));return Array.from(C.itemMap.values()).sort((O,T)=>R.indexOf(O.ref.current)-R.indexOf(T.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:c,Slot:f,ItemSlot:v},S,r]}var E9=x.createContext(void 0);function hp(e){const t=x.useContext(E9);return e||t||"ltr"}function T9(e){const t=_9(e),n=x.forwardRef((r,a)=>{const{children:o,...c}=r,d=x.Children.toArray(o),h=d.find(D9);if(h){const f=h.props.children,m=d.map(p=>p===h?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:p);return l.jsx(t,{...c,ref:a,children:x.isValidElement(f)?x.cloneElement(f,void 0,m):null})}return l.jsx(t,{...c,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function _9(e){const t=x.forwardRef((n,r)=>{const{children:a,...o}=n;if(x.isValidElement(a)){const c=A9(a),d=k9(o,a.props);return a.type!==x.Fragment&&(d.ref=r?fs(r,c):c),x.cloneElement(a,d)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var R9=Symbol("radix.slottable");function D9(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===R9}function k9(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...d)=>{const h=o(...d);return a(...d),h}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function A9(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var O9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],He=O9.reduce((e,t)=>{const n=T9(`Primitive.${t}`),r=x.forwardRef((a,o)=>{const{asChild:c,...d}=a,h=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(h,{...d,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function M9(e,t){e&&Zo.flushSync(()=>e.dispatchEvent(t))}function Vi(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function P9(e,t=globalThis?.document){const n=Vi(e);x.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var L9="DismissableLayer",h0="dismissableLayer.update",I9="dismissableLayer.pointerDownOutside",B9="dismissableLayer.focusOutside",F2,pA=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jd=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:c,onDismiss:d,...h}=e,f=x.useContext(pA),[m,p]=x.useState(null),y=m?.ownerDocument??globalThis?.document,[,v]=x.useState({}),S=rt(t,T=>p(T)),N=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),j=N.indexOf(C),E=m?N.indexOf(m):-1,R=f.layersWithOutsidePointerEventsDisabled.size>0,A=E>=j,_=$9(T=>{const D=T.target,B=[...f.branches].some(W=>W.contains(D));!A||B||(a?.(T),c?.(T),T.defaultPrevented||d?.())},y),O=V9(T=>{const D=T.target;[...f.branches].some(W=>W.contains(D))||(o?.(T),c?.(T),T.defaultPrevented||d?.())},y);return P9(T=>{E===f.layers.size-1&&(r?.(T),!T.defaultPrevented&&d&&(T.preventDefault(),d()))},y),x.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(F2=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),$2(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=F2)}},[m,y,n,f]),x.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),$2())},[m,f]),x.useEffect(()=>{const T=()=>v({});return document.addEventListener(h0,T),()=>document.removeEventListener(h0,T)},[]),l.jsx(He.div,{...h,ref:S,style:{pointerEvents:R?A?"auto":"none":void 0,...e.style},onFocusCapture:Ue(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ue(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ue(e.onPointerDownCapture,_.onPointerDownCapture)})});Jd.displayName=L9;var z9="DismissableLayerBranch",F9=x.forwardRef((e,t)=>{const n=x.useContext(pA),r=x.useRef(null),a=rt(t,r);return x.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),l.jsx(He.div,{...e,ref:a})});F9.displayName=z9;function $9(e,t=globalThis?.document){const n=Vi(e),r=x.useRef(!1),a=x.useRef(()=>{});return x.useEffect(()=>{const o=d=>{if(d.target&&!r.current){let h=function(){gA(I9,n,f,{discrete:!0})};const f={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=h,t.addEventListener("click",a.current,{once:!0})):h()}else t.removeEventListener("click",a.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function V9(e,t=globalThis?.document){const n=Vi(e),r=x.useRef(!1);return x.useEffect(()=>{const a=o=>{o.target&&!r.current&&gA(B9,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $2(){const e=new CustomEvent(h0);document.dispatchEvent(e)}function gA(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?M9(a,o):a.dispatchEvent(o)}var By=0;function dw(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??V2()),document.body.insertAdjacentElement("beforeend",e[1]??V2()),By++,()=>{By===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),By--}},[])}function V2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zy="focusScope.autoFocusOnMount",Fy="focusScope.autoFocusOnUnmount",U2={bubbles:!1,cancelable:!0},U9="FocusScope",mp=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...c}=e,[d,h]=x.useState(null),f=Vi(a),m=Vi(o),p=x.useRef(null),y=rt(t,N=>h(N)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let N=function(R){if(v.paused||!d)return;const A=R.target;d.contains(A)?p.current=A:Si(p.current,{select:!0})},C=function(R){if(v.paused||!d)return;const A=R.relatedTarget;A!==null&&(d.contains(A)||Si(p.current,{select:!0}))},j=function(R){if(document.activeElement===document.body)for(const _ of R)_.removedNodes.length>0&&Si(d)};document.addEventListener("focusin",N),document.addEventListener("focusout",C);const E=new MutationObserver(j);return d&&E.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",C),E.disconnect()}}},[r,d,v.paused]),x.useEffect(()=>{if(d){G2.add(v);const N=document.activeElement;if(!d.contains(N)){const j=new CustomEvent(zy,U2);d.addEventListener(zy,f),d.dispatchEvent(j),j.defaultPrevented||(H9(Y9(xA(d)),{select:!0}),document.activeElement===N&&Si(d))}return()=>{d.removeEventListener(zy,f),setTimeout(()=>{const j=new CustomEvent(Fy,U2);d.addEventListener(Fy,m),d.dispatchEvent(j),j.defaultPrevented||Si(N??document.body,{select:!0}),d.removeEventListener(Fy,m),G2.remove(v)},0)}}},[d,f,m,v]);const S=x.useCallback(N=>{if(!n&&!r||v.paused)return;const C=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,j=document.activeElement;if(C&&j){const E=N.currentTarget,[R,A]=G9(E);R&&A?!N.shiftKey&&j===A?(N.preventDefault(),n&&Si(R,{select:!0})):N.shiftKey&&j===R&&(N.preventDefault(),n&&Si(A,{select:!0})):j===E&&N.preventDefault()}},[n,r,v.paused]);return l.jsx(He.div,{tabIndex:-1,...c,ref:y,onKeyDown:S})});mp.displayName=U9;function H9(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Si(r,{select:t}),document.activeElement!==n)return}function G9(e){const t=xA(e),n=H2(t,e),r=H2(t.reverse(),e);return[n,r]}function xA(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function H2(e,t){for(const n of e)if(!q9(n,{upTo:t}))return n}function q9(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function W9(e){return e instanceof HTMLInputElement&&"select"in e}function Si(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&W9(e)&&t&&e.select()}}var G2=K9();function K9(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=q2(e,t),e.unshift(t)},remove(t){e=q2(e,t),e[0]?.resume()}}}function q2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Y9(e){return e.filter(t=>t.tagName!=="A")}var Gn=globalThis?.document?x.useLayoutEffect:()=>{},X9=tp[" useId ".trim().toString()]||(()=>{}),Q9=0;function Un(e){const[t,n]=x.useState(X9());return Gn(()=>{n(r=>r??String(Q9++))},[e]),e||(t?`radix-${t}`:"")}const J9=["top","right","bottom","left"],Ui=Math.min,Dr=Math.max,Dm=Math.round,Oh=Math.floor,sa=e=>({x:e,y:e}),Z9={left:"right",right:"left",bottom:"top",top:"bottom"},e7={start:"end",end:"start"};function m0(e,t,n){return Dr(e,Ui(t,n))}function Ua(e,t){return typeof e=="function"?e(t):e}function Ha(e){return e.split("-")[0]}function _c(e){return e.split("-")[1]}function fw(e){return e==="x"?"y":"x"}function hw(e){return e==="y"?"height":"width"}const t7=new Set(["top","bottom"]);function Zs(e){return t7.has(Ha(e))?"y":"x"}function mw(e){return fw(Zs(e))}function n7(e,t,n){n===void 0&&(n=!1);const r=_c(e),a=mw(e),o=hw(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(c=km(c)),[c,km(c)]}function r7(e){const t=km(e);return[p0(e),t,p0(t)]}function p0(e){return e.replace(/start|end/g,t=>e7[t])}const W2=["left","right"],K2=["right","left"],s7=["top","bottom"],a7=["bottom","top"];function i7(e,t,n){switch(e){case"top":case"bottom":return n?t?K2:W2:t?W2:K2;case"left":case"right":return t?s7:a7;default:return[]}}function o7(e,t,n,r){const a=_c(e);let o=i7(Ha(e),n==="start",r);return a&&(o=o.map(c=>c+"-"+a),t&&(o=o.concat(o.map(p0)))),o}function km(e){return e.replace(/left|right|bottom|top/g,t=>Z9[t])}function l7(e){return{top:0,right:0,bottom:0,left:0,...e}}function yA(e){return typeof e!="number"?l7(e):{top:e,right:e,bottom:e,left:e}}function Am(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function Y2(e,t,n){let{reference:r,floating:a}=e;const o=Zs(t),c=mw(t),d=hw(c),h=Ha(t),f=o==="y",m=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,y=r[d]/2-a[d]/2;let v;switch(h){case"top":v={x:m,y:r.y-a.height};break;case"bottom":v={x:m,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:p};break;case"left":v={x:r.x-a.width,y:p};break;default:v={x:r.x,y:r.y}}switch(_c(t)){case"start":v[c]-=y*(n&&f?-1:1);break;case"end":v[c]+=y*(n&&f?-1:1);break}return v}const c7=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:c}=n,d=o.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let f=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:p}=Y2(f,r,h),y=r,v={},S=0;for(let N=0;N<d.length;N++){const{name:C,fn:j}=d[N],{x:E,y:R,data:A,reset:_}=await j({x:m,y:p,initialPlacement:r,placement:y,strategy:a,middlewareData:v,rects:f,platform:c,elements:{reference:e,floating:t}});m=E??m,p=R??p,v={...v,[C]:{...v[C],...A}},_&&S<=50&&(S++,typeof _=="object"&&(_.placement&&(y=_.placement),_.rects&&(f=_.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):_.rects),{x:m,y:p}=Y2(f,y,h)),N=-1)}return{x:m,y:p,placement:y,strategy:a,middlewareData:v}};async function jd(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:o,rects:c,elements:d,strategy:h}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:y=!1,padding:v=0}=Ua(t,e),S=yA(v),C=d[y?p==="floating"?"reference":"floating":p],j=Am(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(d.floating)),boundary:f,rootBoundary:m,strategy:h})),E=p==="floating"?{x:r,y:a,width:c.floating.width,height:c.floating.height}:c.reference,R=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d.floating)),A=await(o.isElement==null?void 0:o.isElement(R))?await(o.getScale==null?void 0:o.getScale(R))||{x:1,y:1}:{x:1,y:1},_=Am(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:E,offsetParent:R,strategy:h}):E);return{top:(j.top-_.top+S.top)/A.y,bottom:(_.bottom-j.bottom+S.bottom)/A.y,left:(j.left-_.left+S.left)/A.x,right:(_.right-j.right+S.right)/A.x}}const u7=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:c,elements:d,middlewareData:h}=t,{element:f,padding:m=0}=Ua(e,t)||{};if(f==null)return{};const p=yA(m),y={x:n,y:r},v=mw(a),S=hw(v),N=await c.getDimensions(f),C=v==="y",j=C?"top":"left",E=C?"bottom":"right",R=C?"clientHeight":"clientWidth",A=o.reference[S]+o.reference[v]-y[v]-o.floating[S],_=y[v]-o.reference[v],O=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f));let T=O?O[R]:0;(!T||!await(c.isElement==null?void 0:c.isElement(O)))&&(T=d.floating[R]||o.floating[S]);const D=A/2-_/2,B=T/2-N[S]/2-1,W=Ui(p[j],B),M=Ui(p[E],B),V=W,G=T-N[S]-M,F=T/2-N[S]/2+D,H=m0(V,F,G),P=!h.arrow&&_c(a)!=null&&F!==H&&o.reference[S]/2-(F<V?W:M)-N[S]/2<0,U=P?F<V?F-V:F-G:0;return{[v]:y[v]+U,data:{[v]:H,centerOffset:F-H-U,...P&&{alignmentOffset:U}},reset:P}}}),d7=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:c,initialPlacement:d,platform:h,elements:f}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:N=!0,...C}=Ua(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const j=Ha(a),E=Zs(d),R=Ha(d)===d,A=await(h.isRTL==null?void 0:h.isRTL(f.floating)),_=y||(R||!N?[km(d)]:r7(d)),O=S!=="none";!y&&O&&_.push(...o7(d,N,S,A));const T=[d,..._],D=await jd(t,C),B=[];let W=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&B.push(D[j]),p){const F=n7(a,c,A);B.push(D[F[0]],D[F[1]])}if(W=[...W,{placement:a,overflows:B}],!B.every(F=>F<=0)){var M,V;const F=(((M=o.flip)==null?void 0:M.index)||0)+1,H=T[F];if(H&&(!(p==="alignment"?E!==Zs(H):!1)||W.every(z=>Zs(z.placement)===E?z.overflows[0]>0:!0)))return{data:{index:F,overflows:W},reset:{placement:H}};let P=(V=W.filter(U=>U.overflows[0]<=0).sort((U,z)=>U.overflows[1]-z.overflows[1])[0])==null?void 0:V.placement;if(!P)switch(v){case"bestFit":{var G;const U=(G=W.filter(z=>{if(O){const te=Zs(z.placement);return te===E||te==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(te=>te>0).reduce((te,oe)=>te+oe,0)]).sort((z,te)=>z[1]-te[1])[0])==null?void 0:G[0];U&&(P=U);break}case"initialPlacement":P=d;break}if(a!==P)return{reset:{placement:P}}}return{}}}};function X2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Q2(e){return J9.some(t=>e[t]>=0)}const f7=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Ua(e,t);switch(r){case"referenceHidden":{const o=await jd(t,{...a,elementContext:"reference"}),c=X2(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Q2(c)}}}case"escaped":{const o=await jd(t,{...a,altBoundary:!0}),c=X2(o,n.floating);return{data:{escapedOffsets:c,escaped:Q2(c)}}}default:return{}}}}},vA=new Set(["left","top"]);async function h7(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=Ha(n),d=_c(n),h=Zs(n)==="y",f=vA.has(c)?-1:1,m=o&&h?-1:1,p=Ua(t,e);let{mainAxis:y,crossAxis:v,alignmentAxis:S}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return d&&typeof S=="number"&&(v=d==="end"?S*-1:S),h?{x:v*m,y:y*f}:{x:y*f,y:v*m}}const m7=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:c,middlewareData:d}=t,h=await h7(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:a+h.x,y:o+h.y,data:{...h,placement:c}}}}},p7=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:j,y:E}=C;return{x:j,y:E}}},...h}=Ua(e,t),f={x:n,y:r},m=await jd(t,h),p=Zs(Ha(a)),y=fw(p);let v=f[y],S=f[p];if(o){const C=y==="y"?"top":"left",j=y==="y"?"bottom":"right",E=v+m[C],R=v-m[j];v=m0(E,v,R)}if(c){const C=p==="y"?"top":"left",j=p==="y"?"bottom":"right",E=S+m[C],R=S-m[j];S=m0(E,S,R)}const N=d.fn({...t,[y]:v,[p]:S});return{...N,data:{x:N.x-n,y:N.y-r,enabled:{[y]:o,[p]:c}}}}}},g7=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:c}=t,{offset:d=0,mainAxis:h=!0,crossAxis:f=!0}=Ua(e,t),m={x:n,y:r},p=Zs(a),y=fw(p);let v=m[y],S=m[p];const N=Ua(d,t),C=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:0,crossAxis:0,...N};if(h){const R=y==="y"?"height":"width",A=o.reference[y]-o.floating[R]+C.mainAxis,_=o.reference[y]+o.reference[R]-C.mainAxis;v<A?v=A:v>_&&(v=_)}if(f){var j,E;const R=y==="y"?"width":"height",A=vA.has(Ha(a)),_=o.reference[p]-o.floating[R]+(A&&((j=c.offset)==null?void 0:j[p])||0)+(A?0:C.crossAxis),O=o.reference[p]+o.reference[R]+(A?0:((E=c.offset)==null?void 0:E[p])||0)-(A?C.crossAxis:0);S<_?S=_:S>O&&(S=O)}return{[y]:v,[p]:S}}}},x7=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:c,elements:d}=t,{apply:h=()=>{},...f}=Ua(e,t),m=await jd(t,f),p=Ha(a),y=_c(a),v=Zs(a)==="y",{width:S,height:N}=o.floating;let C,j;p==="top"||p==="bottom"?(C=p,j=y===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(j=p,C=y==="end"?"top":"bottom");const E=N-m.top-m.bottom,R=S-m.left-m.right,A=Ui(N-m[C],E),_=Ui(S-m[j],R),O=!t.middlewareData.shift;let T=A,D=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=E),O&&!y){const W=Dr(m.left,0),M=Dr(m.right,0),V=Dr(m.top,0),G=Dr(m.bottom,0);v?D=S-2*(W!==0||M!==0?W+M:Dr(m.left,m.right)):T=N-2*(V!==0||G!==0?V+G:Dr(m.top,m.bottom))}await h({...t,availableWidth:D,availableHeight:T});const B=await c.getDimensions(d.floating);return S!==B.width||N!==B.height?{reset:{rects:!0}}:{}}}};function pp(){return typeof window<"u"}function Rc(e){return bA(e)?(e.nodeName||"").toLowerCase():"#document"}function Mr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xa(e){var t;return(t=(bA(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bA(e){return pp()?e instanceof Node||e instanceof Mr(e).Node:!1}function Ps(e){return pp()?e instanceof Element||e instanceof Mr(e).Element:!1}function ha(e){return pp()?e instanceof HTMLElement||e instanceof Mr(e).HTMLElement:!1}function J2(e){return!pp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mr(e).ShadowRoot}const y7=new Set(["inline","contents"]);function Zd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ls(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!y7.has(a)}const v7=new Set(["table","td","th"]);function b7(e){return v7.has(Rc(e))}const w7=[":popover-open",":modal"];function gp(e){return w7.some(t=>{try{return e.matches(t)}catch{return!1}})}const S7=["transform","translate","scale","rotate","perspective"],N7=["transform","translate","scale","rotate","perspective","filter"],j7=["paint","layout","strict","content"];function pw(e){const t=gw(),n=Ps(e)?Ls(e):e;return S7.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||N7.some(r=>(n.willChange||"").includes(r))||j7.some(r=>(n.contain||"").includes(r))}function C7(e){let t=Hi(e);for(;ha(t)&&!fc(t);){if(pw(t))return t;if(gp(t))return null;t=Hi(t)}return null}function gw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const E7=new Set(["html","body","#document"]);function fc(e){return E7.has(Rc(e))}function Ls(e){return Mr(e).getComputedStyle(e)}function xp(e){return Ps(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hi(e){if(Rc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||J2(e)&&e.host||xa(e);return J2(t)?t.host:t}function wA(e){const t=Hi(e);return fc(t)?e.ownerDocument?e.ownerDocument.body:e.body:ha(t)&&Zd(t)?t:wA(t)}function Cd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=wA(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),c=Mr(a);if(o){const d=g0(c);return t.concat(c,c.visualViewport||[],Zd(a)?a:[],d&&n?Cd(d):[])}return t.concat(a,Cd(a,[],n))}function g0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function SA(e){const t=Ls(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=ha(e),o=a?e.offsetWidth:n,c=a?e.offsetHeight:r,d=Dm(n)!==o||Dm(r)!==c;return d&&(n=o,r=c),{width:n,height:r,$:d}}function xw(e){return Ps(e)?e:e.contextElement}function ac(e){const t=xw(e);if(!ha(t))return sa(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=SA(t);let c=(o?Dm(n.width):n.width)/r,d=(o?Dm(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const T7=sa(0);function NA(e){const t=Mr(e);return!gw()||!t.visualViewport?T7:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _7(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Mr(e)?!1:t}function Go(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=xw(e);let c=sa(1);t&&(r?Ps(r)&&(c=ac(r)):c=ac(e));const d=_7(o,n,r)?NA(o):sa(0);let h=(a.left+d.x)/c.x,f=(a.top+d.y)/c.y,m=a.width/c.x,p=a.height/c.y;if(o){const y=Mr(o),v=r&&Ps(r)?Mr(r):r;let S=y,N=g0(S);for(;N&&r&&v!==S;){const C=ac(N),j=N.getBoundingClientRect(),E=Ls(N),R=j.left+(N.clientLeft+parseFloat(E.paddingLeft))*C.x,A=j.top+(N.clientTop+parseFloat(E.paddingTop))*C.y;h*=C.x,f*=C.y,m*=C.x,p*=C.y,h+=R,f+=A,S=Mr(N),N=g0(S)}}return Am({width:m,height:p,x:h,y:f})}function yp(e,t){const n=xp(e).scrollLeft;return t?t.left+n:Go(xa(e)).left+n}function jA(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-yp(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function R7(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",c=xa(r),d=t?gp(t.floating):!1;if(r===c||d&&o)return n;let h={scrollLeft:0,scrollTop:0},f=sa(1);const m=sa(0),p=ha(r);if((p||!p&&!o)&&((Rc(r)!=="body"||Zd(c))&&(h=xp(r)),ha(r))){const v=Go(r);f=ac(r),m.x=v.x+r.clientLeft,m.y=v.y+r.clientTop}const y=c&&!p&&!o?jA(c,h):sa(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-h.scrollLeft*f.x+m.x+y.x,y:n.y*f.y-h.scrollTop*f.y+m.y+y.y}}function D7(e){return Array.from(e.getClientRects())}function k7(e){const t=xa(e),n=xp(e),r=e.ownerDocument.body,a=Dr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Dr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+yp(e);const d=-n.scrollTop;return Ls(r).direction==="rtl"&&(c+=Dr(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:c,y:d}}const Z2=25;function A7(e,t){const n=Mr(e),r=xa(e),a=n.visualViewport;let o=r.clientWidth,c=r.clientHeight,d=0,h=0;if(a){o=a.width,c=a.height;const m=gw();(!m||m&&t==="fixed")&&(d=a.offsetLeft,h=a.offsetTop)}const f=yp(r);if(f<=0){const m=r.ownerDocument,p=m.body,y=getComputedStyle(p),v=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(r.clientWidth-p.clientWidth-v);S<=Z2&&(o-=S)}else f<=Z2&&(o+=f);return{width:o,height:c,x:d,y:h}}const O7=new Set(["absolute","fixed"]);function M7(e,t){const n=Go(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=ha(e)?ac(e):sa(1),c=e.clientWidth*o.x,d=e.clientHeight*o.y,h=a*o.x,f=r*o.y;return{width:c,height:d,x:h,y:f}}function eT(e,t,n){let r;if(t==="viewport")r=A7(e,n);else if(t==="document")r=k7(xa(e));else if(Ps(t))r=M7(t,n);else{const a=NA(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Am(r)}function CA(e,t){const n=Hi(e);return n===t||!Ps(n)||fc(n)?!1:Ls(n).position==="fixed"||CA(n,t)}function P7(e,t){const n=t.get(e);if(n)return n;let r=Cd(e,[],!1).filter(d=>Ps(d)&&Rc(d)!=="body"),a=null;const o=Ls(e).position==="fixed";let c=o?Hi(e):e;for(;Ps(c)&&!fc(c);){const d=Ls(c),h=pw(c);!h&&d.position==="fixed"&&(a=null),(o?!h&&!a:!h&&d.position==="static"&&!!a&&O7.has(a.position)||Zd(c)&&!h&&CA(e,c))?r=r.filter(m=>m!==c):a=d,c=Hi(c)}return t.set(e,r),r}function L7(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const c=[...n==="clippingAncestors"?gp(t)?[]:P7(t,this._c):[].concat(n),r],d=c[0],h=c.reduce((f,m)=>{const p=eT(t,m,a);return f.top=Dr(p.top,f.top),f.right=Ui(p.right,f.right),f.bottom=Ui(p.bottom,f.bottom),f.left=Dr(p.left,f.left),f},eT(t,d,a));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function I7(e){const{width:t,height:n}=SA(e);return{width:t,height:n}}function B7(e,t,n){const r=ha(t),a=xa(t),o=n==="fixed",c=Go(e,!0,o,t);let d={scrollLeft:0,scrollTop:0};const h=sa(0);function f(){h.x=yp(a)}if(r||!r&&!o)if((Rc(t)!=="body"||Zd(a))&&(d=xp(t)),r){const v=Go(t,!0,o,t);h.x=v.x+t.clientLeft,h.y=v.y+t.clientTop}else a&&f();o&&!r&&a&&f();const m=a&&!r&&!o?jA(a,d):sa(0),p=c.left+d.scrollLeft-h.x-m.x,y=c.top+d.scrollTop-h.y-m.y;return{x:p,y,width:c.width,height:c.height}}function $y(e){return Ls(e).position==="static"}function tT(e,t){if(!ha(e)||Ls(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xa(e)===n&&(n=n.ownerDocument.body),n}function EA(e,t){const n=Mr(e);if(gp(e))return n;if(!ha(e)){let a=Hi(e);for(;a&&!fc(a);){if(Ps(a)&&!$y(a))return a;a=Hi(a)}return n}let r=tT(e,t);for(;r&&b7(r)&&$y(r);)r=tT(r,t);return r&&fc(r)&&$y(r)&&!pw(r)?n:r||C7(e)||n}const z7=async function(e){const t=this.getOffsetParent||EA,n=this.getDimensions,r=await n(e.floating);return{reference:B7(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function F7(e){return Ls(e).direction==="rtl"}const $7={convertOffsetParentRelativeRectToViewportRelativeRect:R7,getDocumentElement:xa,getClippingRect:L7,getOffsetParent:EA,getElementRects:z7,getClientRects:D7,getDimensions:I7,getScale:ac,isElement:Ps,isRTL:F7};function TA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function V7(e,t){let n=null,r;const a=xa(e);function o(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),o();const f=e.getBoundingClientRect(),{left:m,top:p,width:y,height:v}=f;if(d||t(),!y||!v)return;const S=Oh(p),N=Oh(a.clientWidth-(m+y)),C=Oh(a.clientHeight-(p+v)),j=Oh(m),R={rootMargin:-S+"px "+-N+"px "+-C+"px "+-j+"px",threshold:Dr(0,Ui(1,h))||1};let A=!0;function _(O){const T=O[0].intersectionRatio;if(T!==h){if(!A)return c();T?c(!1,T):r=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!TA(f,e.getBoundingClientRect())&&c(),A=!1}try{n=new IntersectionObserver(_,{...R,root:a.ownerDocument})}catch{n=new IntersectionObserver(_,R)}n.observe(e)}return c(!0),o}function U7(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,f=xw(e),m=a||o?[...f?Cd(f):[],...Cd(t)]:[];m.forEach(j=>{a&&j.addEventListener("scroll",n,{passive:!0}),o&&j.addEventListener("resize",n)});const p=f&&d?V7(f,n):null;let y=-1,v=null;c&&(v=new ResizeObserver(j=>{let[E]=j;E&&E.target===f&&v&&(v.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var R;(R=v)==null||R.observe(t)})),n()}),f&&!h&&v.observe(f),v.observe(t));let S,N=h?Go(e):null;h&&C();function C(){const j=Go(e);N&&!TA(N,j)&&n(),N=j,S=requestAnimationFrame(C)}return n(),()=>{var j;m.forEach(E=>{a&&E.removeEventListener("scroll",n),o&&E.removeEventListener("resize",n)}),p?.(),(j=v)==null||j.disconnect(),v=null,h&&cancelAnimationFrame(S)}}const H7=m7,G7=p7,q7=d7,W7=x7,K7=f7,nT=u7,Y7=g7,X7=(e,t,n)=>{const r=new Map,a={platform:$7,...n},o={...a.platform,_c:r};return c7(e,t,{...a,platform:o})};var Q7=typeof document<"u",J7=function(){},um=Q7?x.useLayoutEffect:J7;function Om(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Om(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!Om(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function _A(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rT(e,t){const n=_A(e);return Math.round(t*n)/n}function Vy(e){const t=x.useRef(e);return um(()=>{t.current=e}),t}function Z7(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:c}={},transform:d=!0,whileElementsMounted:h,open:f}=e,[m,p]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,v]=x.useState(r);Om(y,r)||v(r);const[S,N]=x.useState(null),[C,j]=x.useState(null),E=x.useCallback(z=>{z!==O.current&&(O.current=z,N(z))},[]),R=x.useCallback(z=>{z!==T.current&&(T.current=z,j(z))},[]),A=o||S,_=c||C,O=x.useRef(null),T=x.useRef(null),D=x.useRef(m),B=h!=null,W=Vy(h),M=Vy(a),V=Vy(f),G=x.useCallback(()=>{if(!O.current||!T.current)return;const z={placement:t,strategy:n,middleware:y};M.current&&(z.platform=M.current),X7(O.current,T.current,z).then(te=>{const oe={...te,isPositioned:V.current!==!1};F.current&&!Om(D.current,oe)&&(D.current=oe,Zo.flushSync(()=>{p(oe)}))})},[y,t,n,M,V]);um(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[f]);const F=x.useRef(!1);um(()=>(F.current=!0,()=>{F.current=!1}),[]),um(()=>{if(A&&(O.current=A),_&&(T.current=_),A&&_){if(W.current)return W.current(A,_,G);G()}},[A,_,G,W,B]);const H=x.useMemo(()=>({reference:O,floating:T,setReference:E,setFloating:R}),[E,R]),P=x.useMemo(()=>({reference:A,floating:_}),[A,_]),U=x.useMemo(()=>{const z={position:n,left:0,top:0};if(!P.floating)return z;const te=rT(P.floating,m.x),oe=rT(P.floating,m.y);return d?{...z,transform:"translate("+te+"px, "+oe+"px)",..._A(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:oe}},[n,d,P.floating,m.x,m.y]);return x.useMemo(()=>({...m,update:G,refs:H,elements:P,floatingStyles:U}),[m,G,H,P,U])}const eG=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?nT({element:r.current,padding:a}).fn(n):{}:r?nT({element:r,padding:a}).fn(n):{}}}},tG=(e,t)=>({...H7(e),options:[e,t]}),nG=(e,t)=>({...G7(e),options:[e,t]}),rG=(e,t)=>({...Y7(e),options:[e,t]}),sG=(e,t)=>({...q7(e),options:[e,t]}),aG=(e,t)=>({...W7(e),options:[e,t]}),iG=(e,t)=>({...K7(e),options:[e,t]}),oG=(e,t)=>({...eG(e),options:[e,t]});var lG="Arrow",RA=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return l.jsx(He.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});RA.displayName=lG;var cG=RA;function vp(e){const[t,n]=x.useState(void 0);return Gn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[0];let c,d;if("borderBoxSize"in o){const h=o.borderBoxSize,f=Array.isArray(h)?h[0]:h;c=f.inlineSize,d=f.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var yw="Popper",[DA,Dc]=vs(yw),[uG,kA]=DA(yw),AA=e=>{const{__scopePopper:t,children:n}=e,[r,a]=x.useState(null);return l.jsx(uG,{scope:t,anchor:r,onAnchorChange:a,children:n})};AA.displayName=yw;var OA="PopperAnchor",MA=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=kA(OA,n),c=x.useRef(null),d=rt(t,c),h=x.useRef(null);return x.useEffect(()=>{const f=h.current;h.current=r?.current||c.current,f!==h.current&&o.onAnchorChange(h.current)}),r?null:l.jsx(He.div,{...a,ref:d})});MA.displayName=OA;var vw="PopperContent",[dG,fG]=DA(vw),PA=x.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:h=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:y=!1,updatePositionStrategy:v="optimized",onPlaced:S,...N}=e,C=kA(vw,n),[j,E]=x.useState(null),R=rt(t,ne=>E(ne)),[A,_]=x.useState(null),O=vp(A),T=O?.width??0,D=O?.height??0,B=r+(o!=="center"?"-"+o:""),W=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},M=Array.isArray(f)?f:[f],V=M.length>0,G={padding:W,boundary:M.filter(mG),altBoundary:V},{refs:F,floatingStyles:H,placement:P,isPositioned:U,middlewareData:z}=Z7({strategy:"fixed",placement:B,whileElementsMounted:(...ne)=>U7(...ne,{animationFrame:v==="always"}),elements:{reference:C.anchor},middleware:[tG({mainAxis:a+D,alignmentAxis:c}),h&&nG({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?rG():void 0,...G}),h&&sG({...G}),aG({...G,apply:({elements:ne,rects:xe,availableWidth:be,availableHeight:De})=>{const{width:Ke,height:we}=xe.reference,_e=ne.floating.style;_e.setProperty("--radix-popper-available-width",`${be}px`),_e.setProperty("--radix-popper-available-height",`${De}px`),_e.setProperty("--radix-popper-anchor-width",`${Ke}px`),_e.setProperty("--radix-popper-anchor-height",`${we}px`)}}),A&&oG({element:A,padding:d}),pG({arrowWidth:T,arrowHeight:D}),y&&iG({strategy:"referenceHidden",...G})]}),[te,oe]=BA(P),L=Vi(S);Gn(()=>{U&&L?.()},[U,L]);const $=z.arrow?.x,X=z.arrow?.y,Q=z.arrow?.centerOffset!==0,[q,ce]=x.useState();return Gn(()=>{j&&ce(window.getComputedStyle(j).zIndex)},[j]),l.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:U?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(dG,{scope:n,placedSide:te,onArrowChange:_,arrowX:$,arrowY:X,shouldHideArrow:Q,children:l.jsx(He.div,{"data-side":te,"data-align":oe,...N,ref:R,style:{...N.style,animation:U?void 0:"none"}})})})});PA.displayName=vw;var LA="PopperArrow",hG={top:"bottom",right:"left",bottom:"top",left:"right"},IA=x.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=fG(LA,r),c=hG[o.placedSide];return l.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:l.jsx(cG,{...a,ref:n,style:{...a.style,display:"block"}})})});IA.displayName=LA;function mG(e){return e!==null}var pG=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,c=a.arrow?.centerOffset!==0,d=c?0:e.arrowWidth,h=c?0:e.arrowHeight,[f,m]=BA(n),p={start:"0%",center:"50%",end:"100%"}[m],y=(a.arrow?.x??0)+d/2,v=(a.arrow?.y??0)+h/2;let S="",N="";return f==="bottom"?(S=c?p:`${y}px`,N=`${-h}px`):f==="top"?(S=c?p:`${y}px`,N=`${r.floating.height+h}px`):f==="right"?(S=`${-h}px`,N=c?p:`${v}px`):f==="left"&&(S=`${r.floating.width+h}px`,N=c?p:`${v}px`),{data:{x:S,y:N}}}});function BA(e){const[t,n="center"]=e.split("-");return[t,n]}var bw=AA,bp=MA,ww=PA,Sw=IA,gG="Portal",ef=x.forwardRef((e,t)=>{const{container:n,...r}=e,[a,o]=x.useState(!1);Gn(()=>o(!0),[]);const c=n||a&&globalThis?.document?.body;return c?cw.createPortal(l.jsx(He.div,{...r,ref:t}),c):null});ef.displayName=gG;function xG(e){const t=yG(e),n=x.forwardRef((r,a)=>{const{children:o,...c}=r,d=x.Children.toArray(o),h=d.find(bG);if(h){const f=h.props.children,m=d.map(p=>p===h?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:p);return l.jsx(t,{...c,ref:a,children:x.isValidElement(f)?x.cloneElement(f,void 0,m):null})}return l.jsx(t,{...c,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function yG(e){const t=x.forwardRef((n,r)=>{const{children:a,...o}=n;if(x.isValidElement(a)){const c=SG(a),d=wG(o,a.props);return a.type!==x.Fragment&&(d.ref=r?fs(r,c):c),x.cloneElement(a,d)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vG=Symbol("radix.slottable");function bG(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vG}function wG(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...d)=>{const h=o(...d);return a(...d),h}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function SG(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var NG=tp[" useInsertionEffect ".trim().toString()]||Gn;function ma({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,o,c]=jG({defaultProp:t,onChange:n}),d=e!==void 0,h=d?e:a;{const m=x.useRef(e!==void 0);x.useEffect(()=>{const p=m.current;p!==d&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=d},[d,r])}const f=x.useCallback(m=>{if(d){const p=CG(m)?m(e):m;p!==e&&c.current?.(p)}else o(m)},[d,e,o,c]);return[h,f]}function jG({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),a=x.useRef(n),o=x.useRef(t);return NG(()=>{o.current=t},[t]),x.useEffect(()=>{a.current!==n&&(o.current?.(n),a.current=n)},[n,a]),[n,r,o]}function CG(e){return typeof e=="function"}function wp(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var zA=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),EG="VisuallyHidden",FA=x.forwardRef((e,t)=>l.jsx(He.span,{...e,ref:t,style:{...zA,...e.style}}));FA.displayName=EG;var TG=FA,_G=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ll=new WeakMap,Mh=new WeakMap,Ph={},Uy=0,$A=function(e){return e&&(e.host||$A(e.parentNode))},RG=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=$A(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},DG=function(e,t,n,r){var a=RG(t,Array.isArray(e)?e:[e]);Ph[n]||(Ph[n]=new WeakMap);var o=Ph[n],c=[],d=new Set,h=new Set(a),f=function(p){!p||d.has(p)||(d.add(p),f(p.parentNode))};a.forEach(f);var m=function(p){!p||h.has(p)||Array.prototype.forEach.call(p.children,function(y){if(d.has(y))m(y);else try{var v=y.getAttribute(r),S=v!==null&&v!=="false",N=(Ll.get(y)||0)+1,C=(o.get(y)||0)+1;Ll.set(y,N),o.set(y,C),c.push(y),N===1&&S&&Mh.set(y,!0),C===1&&y.setAttribute(n,"true"),S||y.setAttribute(r,"true")}catch(j){console.error("aria-hidden: cannot operate on ",y,j)}})};return m(t),d.clear(),Uy++,function(){c.forEach(function(p){var y=Ll.get(p)-1,v=o.get(p)-1;Ll.set(p,y),o.set(p,v),y||(Mh.has(p)||p.removeAttribute(r),Mh.delete(p)),v||p.removeAttribute(n)}),Uy--,Uy||(Ll=new WeakMap,Ll=new WeakMap,Mh=new WeakMap,Ph={})}},Nw=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=_G(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),DG(r,a,n,"aria-hidden")):function(){return null}},Js=function(){return Js=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Js.apply(this,arguments)};function VA(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function kG(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var dm="right-scroll-bar-position",fm="width-before-scroll-bar",AG="with-scroll-bars-hidden",OG="--removed-body-scroll-bar-size";function Hy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function MG(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var PG=typeof window<"u"?x.useLayoutEffect:x.useEffect,sT=new WeakMap;function LG(e,t){var n=MG(null,function(r){return e.forEach(function(a){return Hy(a,r)})});return PG(function(){var r=sT.get(n);if(r){var a=new Set(r),o=new Set(e),c=n.current;a.forEach(function(d){o.has(d)||Hy(d,null)}),o.forEach(function(d){a.has(d)||Hy(d,c)})}sT.set(n,e)},[e]),n}function IG(e){return e}function BG(e,t){t===void 0&&(t=IG);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var c=t(o,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(o){for(r=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(d){return o(d)},filter:function(){return n}}},assignMedium:function(o){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(o),c=n}var h=function(){var m=c;c=[],m.forEach(o)},f=function(){return Promise.resolve().then(h)};f(),n={push:function(m){c.push(m),f()},filter:function(m){return c=c.filter(m),n}}}};return a}function zG(e){e===void 0&&(e={});var t=BG(null);return t.options=Js({async:!0,ssr:!1},e),t}var UA=function(e){var t=e.sideCar,n=VA(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Js({},n))};UA.isSideCarExport=!0;function FG(e,t){return e.useMedium(t),UA}var HA=zG(),Gy=function(){},Sp=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Gy,onWheelCapture:Gy,onTouchMoveCapture:Gy}),a=r[0],o=r[1],c=e.forwardProps,d=e.children,h=e.className,f=e.removeScrollBar,m=e.enabled,p=e.shards,y=e.sideCar,v=e.noRelative,S=e.noIsolation,N=e.inert,C=e.allowPinchZoom,j=e.as,E=j===void 0?"div":j,R=e.gapMode,A=VA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=y,O=LG([n,t]),T=Js(Js({},A),a);return x.createElement(x.Fragment,null,m&&x.createElement(_,{sideCar:HA,removeScrollBar:f,shards:p,noRelative:v,noIsolation:S,inert:N,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:R}),c?x.cloneElement(x.Children.only(d),Js(Js({},T),{ref:O})):x.createElement(E,Js({},T,{className:h,ref:O}),d))});Sp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Sp.classNames={fullWidth:fm,zeroRight:dm};var $G=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function VG(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$G();return t&&e.setAttribute("nonce",t),e}function UG(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HG(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var GG=function(){var e=0,t=null;return{add:function(n){e==0&&(t=VG())&&(UG(t,n),HG(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qG=function(){var e=GG();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},GA=function(){var e=qG(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},WG={left:0,top:0,right:0,gap:0},qy=function(e){return parseInt(e||"",10)||0},KG=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[qy(n),qy(r),qy(a)]},YG=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return WG;var t=KG(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},XG=GA(),ic="data-scroll-locked",QG=function(e,t,n,r){var a=e.left,o=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
24
+ .`.concat(AG,` {
25
+ overflow: hidden `).concat(r,`;
26
+ padding-right: `).concat(d,"px ").concat(r,`;
27
+ }
28
+ body[`).concat(ic,`] {
29
+ overflow: hidden `).concat(r,`;
30
+ overscroll-behavior: contain;
31
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
32
+ padding-left: `.concat(a,`px;
33
+ padding-top: `).concat(o,`px;
34
+ padding-right: `).concat(c,`px;
35
+ margin-left:0;
36
+ margin-top:0;
37
+ margin-right: `).concat(d,"px ").concat(r,`;
38
+ `),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
39
+ }
40
+
41
+ .`).concat(dm,` {
42
+ right: `).concat(d,"px ").concat(r,`;
43
+ }
44
+
45
+ .`).concat(fm,` {
46
+ margin-right: `).concat(d,"px ").concat(r,`;
47
+ }
48
+
49
+ .`).concat(dm," .").concat(dm,` {
50
+ right: 0 `).concat(r,`;
51
+ }
52
+
53
+ .`).concat(fm," .").concat(fm,` {
54
+ margin-right: 0 `).concat(r,`;
55
+ }
56
+
57
+ body[`).concat(ic,`] {
58
+ `).concat(OG,": ").concat(d,`px;
59
+ }
60
+ `)},aT=function(){var e=parseInt(document.body.getAttribute(ic)||"0",10);return isFinite(e)?e:0},JG=function(){x.useEffect(function(){return document.body.setAttribute(ic,(aT()+1).toString()),function(){var e=aT()-1;e<=0?document.body.removeAttribute(ic):document.body.setAttribute(ic,e.toString())}},[])},ZG=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;JG();var o=x.useMemo(function(){return YG(a)},[a]);return x.createElement(XG,{styles:QG(o,!t,a,n?"":"!important")})},x0=!1;if(typeof window<"u")try{var Lh=Object.defineProperty({},"passive",{get:function(){return x0=!0,!0}});window.addEventListener("test",Lh,Lh),window.removeEventListener("test",Lh,Lh)}catch{x0=!1}var Il=x0?{passive:!1}:!1,eq=function(e){return e.tagName==="TEXTAREA"},qA=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!eq(e)&&n[t]==="visible")},tq=function(e){return qA(e,"overflowY")},nq=function(e){return qA(e,"overflowX")},iT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=WA(e,r);if(a){var o=KA(e,r),c=o[1],d=o[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rq=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},sq=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},WA=function(e,t){return e==="v"?tq(t):nq(t)},KA=function(e,t){return e==="v"?rq(t):sq(t)},aq=function(e,t){return e==="h"&&t==="rtl"?-1:1},iq=function(e,t,n,r,a){var o=aq(e,window.getComputedStyle(t).direction),c=o*r,d=n.target,h=t.contains(d),f=!1,m=c>0,p=0,y=0;do{if(!d)break;var v=KA(e,d),S=v[0],N=v[1],C=v[2],j=N-C-o*S;(S||j)&&WA(e,d)&&(p+=j,y+=S);var E=d.parentNode;d=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!h&&d!==document.body||h&&(t.contains(d)||t===d));return(m&&Math.abs(p)<1||!m&&Math.abs(y)<1)&&(f=!0),f},Ih=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oT=function(e){return[e.deltaX,e.deltaY]},lT=function(e){return e&&"current"in e?e.current:e},oq=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lq=function(e){return`
61
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
62
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
63
+ `)},cq=0,Bl=[];function uq(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),a=x.useState(cq++)[0],o=x.useState(GA)[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var N=kG([e.lockRef.current],(e.shards||[]).map(lT),!0).filter(Boolean);return N.forEach(function(C){return C.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),N.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var d=x.useCallback(function(N,C){if("touches"in N&&N.touches.length===2||N.type==="wheel"&&N.ctrlKey)return!c.current.allowPinchZoom;var j=Ih(N),E=n.current,R="deltaX"in N?N.deltaX:E[0]-j[0],A="deltaY"in N?N.deltaY:E[1]-j[1],_,O=N.target,T=Math.abs(R)>Math.abs(A)?"h":"v";if("touches"in N&&T==="h"&&O.type==="range")return!1;var D=window.getSelection(),B=D&&D.anchorNode,W=B?B===O||B.contains(O):!1;if(W)return!1;var M=iT(T,O);if(!M)return!0;if(M?_=T:(_=T==="v"?"h":"v",M=iT(T,O)),!M)return!1;if(!r.current&&"changedTouches"in N&&(R||A)&&(r.current=_),!_)return!0;var V=r.current||_;return iq(V,C,N,V==="h"?R:A)},[]),h=x.useCallback(function(N){var C=N;if(!(!Bl.length||Bl[Bl.length-1]!==o)){var j="deltaY"in C?oT(C):Ih(C),E=t.current.filter(function(_){return _.name===C.type&&(_.target===C.target||C.target===_.shadowParent)&&oq(_.delta,j)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var R=(c.current.shards||[]).map(lT).filter(Boolean).filter(function(_){return _.contains(C.target)}),A=R.length>0?d(C,R[0]):!c.current.noIsolation;A&&C.cancelable&&C.preventDefault()}}},[]),f=x.useCallback(function(N,C,j,E){var R={name:N,delta:C,target:j,should:E,shadowParent:dq(j)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(A){return A!==R})},1)},[]),m=x.useCallback(function(N){n.current=Ih(N),r.current=void 0},[]),p=x.useCallback(function(N){f(N.type,oT(N),N.target,d(N,e.lockRef.current))},[]),y=x.useCallback(function(N){f(N.type,Ih(N),N.target,d(N,e.lockRef.current))},[]);x.useEffect(function(){return Bl.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:y}),document.addEventListener("wheel",h,Il),document.addEventListener("touchmove",h,Il),document.addEventListener("touchstart",m,Il),function(){Bl=Bl.filter(function(N){return N!==o}),document.removeEventListener("wheel",h,Il),document.removeEventListener("touchmove",h,Il),document.removeEventListener("touchstart",m,Il)}},[]);var v=e.removeScrollBar,S=e.inert;return x.createElement(x.Fragment,null,S?x.createElement(o,{styles:lq(a)}):null,v?x.createElement(ZG,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dq(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fq=FG(HA,uq);var Np=x.forwardRef(function(e,t){return x.createElement(Sp,Js({},e,{ref:t,sideCar:fq}))});Np.classNames=Sp.classNames;var hq=[" ","Enter","ArrowUp","ArrowDown"],mq=[" ","Enter"],qo="Select",[jp,Cp,pq]=uw(qo),[kc]=vs(qo,[pq,Dc]),Ep=Dc(),[gq,Qi]=kc(qo),[xq,yq]=kc(qo),YA=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:c,defaultValue:d,onValueChange:h,dir:f,name:m,autoComplete:p,disabled:y,required:v,form:S}=e,N=Ep(t),[C,j]=x.useState(null),[E,R]=x.useState(null),[A,_]=x.useState(!1),O=hp(f),[T,D]=ma({prop:r,defaultProp:a??!1,onChange:o,caller:qo}),[B,W]=ma({prop:c,defaultProp:d,onChange:h,caller:qo}),M=x.useRef(null),V=C?S||!!C.closest("form"):!0,[G,F]=x.useState(new Set),H=Array.from(G).map(P=>P.props.value).join(";");return l.jsx(bw,{...N,children:l.jsxs(gq,{required:v,scope:t,trigger:C,onTriggerChange:j,valueNode:E,onValueNodeChange:R,valueNodeHasChildren:A,onValueNodeHasChildrenChange:_,contentId:Un(),value:B,onValueChange:W,open:T,onOpenChange:D,dir:O,triggerPointerDownPosRef:M,disabled:y,children:[l.jsx(jp.Provider,{scope:t,children:l.jsx(xq,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(P=>{F(U=>new Set(U).add(P))},[]),onNativeOptionRemove:x.useCallback(P=>{F(U=>{const z=new Set(U);return z.delete(P),z})},[]),children:n})}),V?l.jsxs(vO,{"aria-hidden":!0,required:v,tabIndex:-1,name:m,autoComplete:p,value:B,onChange:P=>W(P.target.value),disabled:y,form:S,children:[B===void 0?l.jsx("option",{value:""}):null,Array.from(G)]},H):null]})})};YA.displayName=qo;var XA="SelectTrigger",QA=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,o=Ep(n),c=Qi(XA,n),d=c.disabled||r,h=rt(t,c.onTriggerChange),f=Cp(n),m=x.useRef("touch"),[p,y,v]=wO(N=>{const C=f().filter(R=>!R.disabled),j=C.find(R=>R.value===c.value),E=SO(C,N,j);E!==void 0&&c.onValueChange(E.value)}),S=N=>{d||(c.onOpenChange(!0),v()),N&&(c.triggerPointerDownPosRef.current={x:Math.round(N.pageX),y:Math.round(N.pageY)})};return l.jsx(bp,{asChild:!0,...o,children:l.jsx(He.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":bO(c.value)?"":void 0,...a,ref:h,onClick:Ue(a.onClick,N=>{N.currentTarget.focus(),m.current!=="mouse"&&S(N)}),onPointerDown:Ue(a.onPointerDown,N=>{m.current=N.pointerType;const C=N.target;C.hasPointerCapture(N.pointerId)&&C.releasePointerCapture(N.pointerId),N.button===0&&N.ctrlKey===!1&&N.pointerType==="mouse"&&(S(N),N.preventDefault())}),onKeyDown:Ue(a.onKeyDown,N=>{const C=p.current!=="";!(N.ctrlKey||N.altKey||N.metaKey)&&N.key.length===1&&y(N.key),!(C&&N.key===" ")&&hq.includes(N.key)&&(S(),N.preventDefault())})})})});QA.displayName=XA;var JA="SelectValue",ZA=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:c="",...d}=e,h=Qi(JA,n),{onValueNodeHasChildrenChange:f}=h,m=o!==void 0,p=rt(t,h.onValueNodeChange);return Gn(()=>{f(m)},[f,m]),l.jsx(He.span,{...d,ref:p,style:{pointerEvents:"none"},children:bO(h.value)?l.jsx(l.Fragment,{children:c}):o})});ZA.displayName=JA;var vq="SelectIcon",eO=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return l.jsx(He.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});eO.displayName=vq;var bq="SelectPortal",tO=e=>l.jsx(ef,{asChild:!0,...e});tO.displayName=bq;var Wo="SelectContent",nO=x.forwardRef((e,t)=>{const n=Qi(Wo,e.__scopeSelect),[r,a]=x.useState();if(Gn(()=>{a(new DocumentFragment)},[]),!n.open){const o=r;return o?Zo.createPortal(l.jsx(rO,{scope:e.__scopeSelect,children:l.jsx(jp.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),o):null}return l.jsx(sO,{...e,ref:t})});nO.displayName=Wo;var Ds=10,[rO,Ji]=kc(Wo),wq="SelectContentImpl",Sq=xG("SelectContent.RemoveScroll"),sO=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:c,side:d,sideOffset:h,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:y,collisionPadding:v,sticky:S,hideWhenDetached:N,avoidCollisions:C,...j}=e,E=Qi(Wo,n),[R,A]=x.useState(null),[_,O]=x.useState(null),T=rt(t,ne=>A(ne)),[D,B]=x.useState(null),[W,M]=x.useState(null),V=Cp(n),[G,F]=x.useState(!1),H=x.useRef(!1);x.useEffect(()=>{if(R)return Nw(R)},[R]),dw();const P=x.useCallback(ne=>{const[xe,...be]=V().map(we=>we.ref.current),[De]=be.slice(-1),Ke=document.activeElement;for(const we of ne)if(we===Ke||(we?.scrollIntoView({block:"nearest"}),we===xe&&_&&(_.scrollTop=0),we===De&&_&&(_.scrollTop=_.scrollHeight),we?.focus(),document.activeElement!==Ke))return},[V,_]),U=x.useCallback(()=>P([D,R]),[P,D,R]);x.useEffect(()=>{G&&U()},[G,U]);const{onOpenChange:z,triggerPointerDownPosRef:te}=E;x.useEffect(()=>{if(R){let ne={x:0,y:0};const xe=De=>{ne={x:Math.abs(Math.round(De.pageX)-(te.current?.x??0)),y:Math.abs(Math.round(De.pageY)-(te.current?.y??0))}},be=De=>{ne.x<=10&&ne.y<=10?De.preventDefault():R.contains(De.target)||z(!1),document.removeEventListener("pointermove",xe),te.current=null};return te.current!==null&&(document.addEventListener("pointermove",xe),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",be,{capture:!0})}}},[R,z,te]),x.useEffect(()=>{const ne=()=>z(!1);return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[z]);const[oe,L]=wO(ne=>{const xe=V().filter(Ke=>!Ke.disabled),be=xe.find(Ke=>Ke.ref.current===document.activeElement),De=SO(xe,ne,be);De&&setTimeout(()=>De.ref.current.focus())}),$=x.useCallback((ne,xe,be)=>{const De=!H.current&&!be;(E.value!==void 0&&E.value===xe||De)&&(B(ne),De&&(H.current=!0))},[E.value]),X=x.useCallback(()=>R?.focus(),[R]),Q=x.useCallback((ne,xe,be)=>{const De=!H.current&&!be;(E.value!==void 0&&E.value===xe||De)&&M(ne)},[E.value]),q=r==="popper"?y0:aO,ce=q===y0?{side:d,sideOffset:h,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:y,collisionPadding:v,sticky:S,hideWhenDetached:N,avoidCollisions:C}:{};return l.jsx(rO,{scope:n,content:R,viewport:_,onViewportChange:O,itemRefCallback:$,selectedItem:D,onItemLeave:X,itemTextRefCallback:Q,focusSelectedItem:U,selectedItemText:W,position:r,isPositioned:G,searchRef:oe,children:l.jsx(Np,{as:Sq,allowPinchZoom:!0,children:l.jsx(mp,{asChild:!0,trapped:E.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:Ue(a,ne=>{E.trigger?.focus({preventScroll:!0}),ne.preventDefault()}),children:l.jsx(Jd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:l.jsx(q,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:ne=>ne.preventDefault(),...j,...ce,onPlaced:()=>F(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ue(j.onKeyDown,ne=>{const xe=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!xe&&ne.key.length===1&&L(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let De=V().filter(Ke=>!Ke.disabled).map(Ke=>Ke.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(De=De.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Ke=ne.target,we=De.indexOf(Ke);De=De.slice(we+1)}setTimeout(()=>P(De)),ne.preventDefault()}})})})})})})});sO.displayName=wq;var Nq="SelectItemAlignedPosition",aO=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,o=Qi(Wo,n),c=Ji(Wo,n),[d,h]=x.useState(null),[f,m]=x.useState(null),p=rt(t,T=>m(T)),y=Cp(n),v=x.useRef(!1),S=x.useRef(!0),{viewport:N,selectedItem:C,selectedItemText:j,focusSelectedItem:E}=c,R=x.useCallback(()=>{if(o.trigger&&o.valueNode&&d&&f&&N&&C&&j){const T=o.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),B=o.valueNode.getBoundingClientRect(),W=j.getBoundingClientRect();if(o.dir!=="rtl"){const Ke=W.left-D.left,we=B.left-Ke,_e=T.left-we,vt=T.width+_e,en=Math.max(vt,D.width),Pt=window.innerWidth-Ds,vn=Rm(we,[Ds,Math.max(Ds,Pt-en)]);d.style.minWidth=vt+"px",d.style.left=vn+"px"}else{const Ke=D.right-W.right,we=window.innerWidth-B.right-Ke,_e=window.innerWidth-T.right-we,vt=T.width+_e,en=Math.max(vt,D.width),Pt=window.innerWidth-Ds,vn=Rm(we,[Ds,Math.max(Ds,Pt-en)]);d.style.minWidth=vt+"px",d.style.right=vn+"px"}const M=y(),V=window.innerHeight-Ds*2,G=N.scrollHeight,F=window.getComputedStyle(f),H=parseInt(F.borderTopWidth,10),P=parseInt(F.paddingTop,10),U=parseInt(F.borderBottomWidth,10),z=parseInt(F.paddingBottom,10),te=H+P+G+z+U,oe=Math.min(C.offsetHeight*5,te),L=window.getComputedStyle(N),$=parseInt(L.paddingTop,10),X=parseInt(L.paddingBottom,10),Q=T.top+T.height/2-Ds,q=V-Q,ce=C.offsetHeight/2,ne=C.offsetTop+ce,xe=H+P+ne,be=te-xe;if(xe<=Q){const Ke=M.length>0&&C===M[M.length-1].ref.current;d.style.bottom="0px";const we=f.clientHeight-N.offsetTop-N.offsetHeight,_e=Math.max(q,ce+(Ke?X:0)+we+U),vt=xe+_e;d.style.height=vt+"px"}else{const Ke=M.length>0&&C===M[0].ref.current;d.style.top="0px";const _e=Math.max(Q,H+N.offsetTop+(Ke?$:0)+ce)+be;d.style.height=_e+"px",N.scrollTop=xe-Q+N.offsetTop}d.style.margin=`${Ds}px 0`,d.style.minHeight=oe+"px",d.style.maxHeight=V+"px",r?.(),requestAnimationFrame(()=>v.current=!0)}},[y,o.trigger,o.valueNode,d,f,N,C,j,o.dir,r]);Gn(()=>R(),[R]);const[A,_]=x.useState();Gn(()=>{f&&_(window.getComputedStyle(f).zIndex)},[f]);const O=x.useCallback(T=>{T&&S.current===!0&&(R(),E?.(),S.current=!1)},[R,E]);return l.jsx(Cq,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:v,onScrollButtonChange:O,children:l.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:l.jsx(He.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});aO.displayName=Nq;var jq="SelectPopperPosition",y0=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Ds,...o}=e,c=Ep(n);return l.jsx(ww,{...c,...o,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});y0.displayName=jq;var[Cq,jw]=kc(Wo,{}),v0="SelectViewport",iO=x.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,o=Ji(v0,n),c=jw(v0,n),d=rt(t,o.onViewportChange),h=x.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(jp.Slot,{scope:n,children:l.jsx(He.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ue(a.onScroll,f=>{const m=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:y}=c;if(y?.current&&p){const v=Math.abs(h.current-m.scrollTop);if(v>0){const S=window.innerHeight-Ds*2,N=parseFloat(p.style.minHeight),C=parseFloat(p.style.height),j=Math.max(N,C);if(j<S){const E=j+v,R=Math.min(S,E),A=E-R;p.style.height=R+"px",p.style.bottom==="0px"&&(m.scrollTop=A>0?A:0,p.style.justifyContent="flex-end")}}}h.current=m.scrollTop})})})]})});iO.displayName=v0;var oO="SelectGroup",[Eq,Tq]=kc(oO),lO=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Un();return l.jsx(Eq,{scope:n,id:a,children:l.jsx(He.div,{role:"group","aria-labelledby":a,...r,ref:t})})});lO.displayName=oO;var cO="SelectLabel",uO=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Tq(cO,n);return l.jsx(He.div,{id:a.id,...r,ref:t})});uO.displayName=cO;var Mm="SelectItem",[_q,dO]=kc(Mm),fO=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...c}=e,d=Qi(Mm,n),h=Ji(Mm,n),f=d.value===r,[m,p]=x.useState(o??""),[y,v]=x.useState(!1),S=rt(t,E=>h.itemRefCallback?.(E,r,a)),N=Un(),C=x.useRef("touch"),j=()=>{a||(d.onValueChange(r),d.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(_q,{scope:n,value:r,disabled:a,textId:N,isSelected:f,onItemTextChange:x.useCallback(E=>{p(R=>R||(E?.textContent??"").trim())},[]),children:l.jsx(jp.ItemSlot,{scope:n,value:r,disabled:a,textValue:m,children:l.jsx(He.div,{role:"option","aria-labelledby":N,"data-highlighted":y?"":void 0,"aria-selected":f&&y,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...c,ref:S,onFocus:Ue(c.onFocus,()=>v(!0)),onBlur:Ue(c.onBlur,()=>v(!1)),onClick:Ue(c.onClick,()=>{C.current!=="mouse"&&j()}),onPointerUp:Ue(c.onPointerUp,()=>{C.current==="mouse"&&j()}),onPointerDown:Ue(c.onPointerDown,E=>{C.current=E.pointerType}),onPointerMove:Ue(c.onPointerMove,E=>{C.current=E.pointerType,a?h.onItemLeave?.():C.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ue(c.onPointerLeave,E=>{E.currentTarget===document.activeElement&&h.onItemLeave?.()}),onKeyDown:Ue(c.onKeyDown,E=>{h.searchRef?.current!==""&&E.key===" "||(mq.includes(E.key)&&j(),E.key===" "&&E.preventDefault())})})})})});fO.displayName=Mm;var Xu="SelectItemText",hO=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=e,c=Qi(Xu,n),d=Ji(Xu,n),h=dO(Xu,n),f=yq(Xu,n),[m,p]=x.useState(null),y=rt(t,j=>p(j),h.onItemTextChange,j=>d.itemTextRefCallback?.(j,h.value,h.disabled)),v=m?.textContent,S=x.useMemo(()=>l.jsx("option",{value:h.value,disabled:h.disabled,children:v},h.value),[h.disabled,h.value,v]),{onNativeOptionAdd:N,onNativeOptionRemove:C}=f;return Gn(()=>(N(S),()=>C(S)),[N,C,S]),l.jsxs(l.Fragment,{children:[l.jsx(He.span,{id:h.textId,...o,ref:y}),h.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Zo.createPortal(o.children,c.valueNode):null]})});hO.displayName=Xu;var mO="SelectItemIndicator",pO=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return dO(mO,n).isSelected?l.jsx(He.span,{"aria-hidden":!0,...r,ref:t}):null});pO.displayName=mO;var b0="SelectScrollUpButton",gO=x.forwardRef((e,t)=>{const n=Ji(b0,e.__scopeSelect),r=jw(b0,e.__scopeSelect),[a,o]=x.useState(!1),c=rt(t,r.onScrollButtonChange);return Gn(()=>{if(n.viewport&&n.isPositioned){let d=function(){const f=h.scrollTop>0;o(f)};const h=n.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),a?l.jsx(yO,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=n;d&&h&&(d.scrollTop=d.scrollTop-h.offsetHeight)}}):null});gO.displayName=b0;var w0="SelectScrollDownButton",xO=x.forwardRef((e,t)=>{const n=Ji(w0,e.__scopeSelect),r=jw(w0,e.__scopeSelect),[a,o]=x.useState(!1),c=rt(t,r.onScrollButtonChange);return Gn(()=>{if(n.viewport&&n.isPositioned){let d=function(){const f=h.scrollHeight-h.clientHeight,m=Math.ceil(h.scrollTop)<f;o(m)};const h=n.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),a?l.jsx(yO,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=n;d&&h&&(d.scrollTop=d.scrollTop+h.offsetHeight)}}):null});xO.displayName=w0;var yO=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,o=Ji("SelectScrollButton",n),c=x.useRef(null),d=Cp(n),h=x.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return x.useEffect(()=>()=>h(),[h]),Gn(()=>{d().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),l.jsx(He.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Ue(a.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Ue(a.onPointerMove,()=>{o.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Ue(a.onPointerLeave,()=>{h()})})}),Rq="SelectSeparator",Dq=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(He.div,{"aria-hidden":!0,...r,ref:t})});Dq.displayName=Rq;var S0="SelectArrow",kq=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Ep(n),o=Qi(S0,n),c=Ji(S0,n);return o.open&&c.position==="popper"?l.jsx(Sw,{...a,...r,ref:t}):null});kq.displayName=S0;var Aq="SelectBubbleInput",vO=x.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=x.useRef(null),o=rt(r,a),c=wp(t);return x.useEffect(()=>{const d=a.current;if(!d)return;const h=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(h,"value").set;if(c!==t&&m){const p=new Event("change",{bubbles:!0});m.call(d,t),d.dispatchEvent(p)}},[c,t]),l.jsx(He.select,{...n,style:{...zA,...n.style},ref:o,defaultValue:t})});vO.displayName=Aq;function bO(e){return e===""||e===void 0}function wO(e){const t=Vi(e),n=x.useRef(""),r=x.useRef(0),a=x.useCallback(c=>{const d=n.current+c;t(d),(function h(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>h(""),1e3))})(d)},[t]),o=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function SO(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let c=Oq(e,Math.max(o,0));a.length===1&&(c=c.filter(f=>f!==n));const h=c.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return h!==n?h:void 0}function Oq(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Mq=YA,Pq=QA,Lq=ZA,Iq=eO,Bq=tO,zq=nO,Fq=iO,$q=lO,Vq=uO,Uq=fO,Hq=hO,Gq=pO,qq=gO,Wq=xO;const Kq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yq=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),cT=e=>{const t=Yq(e);return t.charAt(0).toUpperCase()+t.slice(1)},NO=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Xq=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Qq={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Jq=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:c,...d},h)=>x.createElement("svg",{ref:h,...Qq,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:NO("lucide",a),...!o&&!Xq(d)&&{"aria-hidden":"true"},...d},[...c.map(([f,m])=>x.createElement(f,m)),...Array.isArray(o)?o:[o]]));const Ne=(e,t)=>{const n=x.forwardRef(({className:r,...a},o)=>x.createElement(Jq,{ref:o,iconNode:t,className:NO(`lucide-${Kq(cT(e))}`,`lucide-${e}`,r),...a}));return n.displayName=cT(e),n};const Zq=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],id=Ne("activity",Zq);const eW=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Cw=Ne("arrow-down",eW);const tW=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Tp=Ne("arrow-right",tW);const nW=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Ew=Ne("arrow-up",nW);const rW=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],sW=Ne("ban",rW);const aW=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],uT=Ne("bell",aW);const iW=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],kr=Ne("bot",iW);const oW=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],tf=Ne("brain",oW);const lW=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],N0=Ne("bug",lW);const cW=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],jO=Ne("calendar",cW);const uW=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],dW=Ne("chart-column",uW);const fW=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],qt=Ne("check",fW);const hW=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],$r=Ne("chevron-down",hW);const mW=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],CO=Ne("chevron-left",mW);const pW=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zi=Ne("chevron-right",pW);const gW=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Tw=Ne("chevron-up",gW);const xW=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Hn=Ne("circle-alert",xW);const yW=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],As=Ne("circle-check-big",yW);const vW=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],aa=Ne("circle-check",vW);const bW=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Is=Ne("circle-x",bW);const wW=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],EO=Ne("circle",wW);const SW=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],_p=Ne("clock",SW);const NW=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],jW=Ne("code",NW);const CW=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],TO=Ne("copy",CW);const EW=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],od=Ne("cpu",EW);const TW=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],Rp=Ne("dollar-sign",TW);const _W=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Dp=Ne("external-link",_W);const RW=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],Fo=Ne("file-code",RW);const DW=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],kW=Ne("file-exclamation-point",DW);const AW=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],OW=Ne("file-plus",AW);const MW=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],_w=Ne("file-text",MW);const PW=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]],LW=Ne("file-x",PW);const IW=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],_O=Ne("flask-conical",IW);const BW=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],RO=Ne("folder-git-2",BW);const zW=[["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M14 13h3",key:"1dgedf"}],["path",{d:"M7 13h3",key:"1pygq7"}]],j0=Ne("folder-git",zW);const FW=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],$W=Ne("folder-open",FW);const VW=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],Ko=Ne("git-branch",VW);const UW=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],Rw=Ne("git-merge",UW);const HW=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],hc=Ne("git-pull-request",HW);const GW=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],DO=Ne("grip-vertical",GW);const qW=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],WW=Ne("hard-drive",qW);const KW=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],YW=Ne("inbox",KW);const XW=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Bs=Ne("info",XW);const QW=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],C0=Ne("keyboard",QW);const JW=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],kO=Ne("lightbulb",JW);const ZW=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],eK=Ne("link",ZW);const tK=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],AO=Ne("list-checks",tK);const nK=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],OO=Ne("list-ordered",nK);const rK=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ke=Ne("loader-circle",rK);const sK=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Ed=Ne("lock",sK);const aK=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],iK=Ne("maximize-2",aK);const oK=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],lK=Ne("message-square-plus",oK);const cK=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],el=Ne("message-square",cK);const uK=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],dK=Ne("minimize-2",uK);const fK=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Wy=Ne("monitor",fK);const hK=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Ky=Ne("moon",hK);const mK=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],pK=Ne("octagon-x",mK);const gK=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],xK=Ne("pause",gK);const yK=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],E0=Ne("pencil",yK);const vK=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ia=Ne("play",vK);const bK=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],wK=Ne("plug",bK);const SK=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ld=Ne("plus",SK);const NK=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],jK=Ne("power",NK);const CK=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],pa=Ne("refresh-cw",CK);const EK=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Pm=Ne("rocket",EK);const TK=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],MO=Ne("rotate-ccw",TK);const _K=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],nf=Ne("save",_K);const RK=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],dT=Ne("scroll-text",RK);const DK=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],kp=Ne("search",DK);const kK=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],AK=Ne("send",kK);const OK=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Td=Ne("settings",OK);const MK=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],_d=Ne("sparkles",MK);const PK=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],LK=Ne("square-terminal",PK);const IK=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],PO=Ne("square",IK);const BK=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Yy=Ne("sun",BK);const zK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],oa=Ne("target",zK);const FK=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],la=Ne("terminal",FK);const $K=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],VK=Ne("timer",$K);const UK=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Gi=Ne("trash-2",UK);const HK=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],GK=Ne("trending-up",HK);const qK=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],eo=Ne("triangle-alert",qK);const WK=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],KK=Ne("upload",WK);const YK=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],LO=Ne("user",YK);const XK=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],IO=Ne("wifi-off",XK);const QK=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],JK=Ne("wifi",QK);const ZK=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],BO=Ne("wrench",ZK);const eY=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],On=Ne("x",eY);const tY=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],hs=Ne("zap",tY);function zO(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=zO(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function FO(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=zO(e))&&(r&&(r+=" "),r+=t);return r}const nY=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},rY=(e,t)=>({classGroupId:e,validator:t}),$O=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Lm="-",fT=[],sY="arbitrary..",aY=e=>{const t=oY(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return iY(c);const d=c.split(Lm),h=d[0]===""&&d.length>1?1:0;return VO(d,h,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const h=r[c],f=n[c];return h?f?nY(f,h):h:f||fT}return n[c]||fT}}},VO=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],o=n.nextPart.get(a);if(o){const f=VO(e,t+1,o);if(f)return f}const c=n.validators;if(c===null)return;const d=t===0?e.join(Lm):e.slice(t).join(Lm),h=c.length;for(let f=0;f<h;f++){const m=c[f];if(m.validator(d))return m.classGroupId}},iY=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?sY+r:void 0})(),oY=e=>{const{theme:t,classGroups:n}=e;return lY(n,t)},lY=(e,t)=>{const n=$O();for(const r in e){const a=e[r];Dw(a,n,r,t)}return n},Dw=(e,t,n,r)=>{const a=e.length;for(let o=0;o<a;o++){const c=e[o];cY(c,t,n,r)}},cY=(e,t,n,r)=>{if(typeof e=="string"){uY(e,t,n);return}if(typeof e=="function"){dY(e,t,n,r);return}fY(e,t,n,r)},uY=(e,t,n)=>{const r=e===""?t:UO(t,e);r.classGroupId=n},dY=(e,t,n,r)=>{if(hY(e)){Dw(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(rY(n,e))},fY=(e,t,n,r)=>{const a=Object.entries(e),o=a.length;for(let c=0;c<o;c++){const[d,h]=a[c];Dw(h,UO(t,d),n,r)}},UO=(e,t)=>{let n=e;const r=t.split(Lm),a=r.length;for(let o=0;o<a;o++){const c=r[o];let d=n.nextPart.get(c);d||(d=$O(),n.nextPart.set(c,d)),n=d}return n},hY=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,mY=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(o,c)=>{n[o]=c,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=r[o])!==void 0)return a(o,c),c},set(o,c){o in n?n[o]=c:a(o,c)}}},T0="!",hT=":",pY=[],mT=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),gY=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const o=[];let c=0,d=0,h=0,f;const m=a.length;for(let N=0;N<m;N++){const C=a[N];if(c===0&&d===0){if(C===hT){o.push(a.slice(h,N)),h=N+1;continue}if(C==="/"){f=N;continue}}C==="["?c++:C==="]"?c--:C==="("?d++:C===")"&&d--}const p=o.length===0?a:a.slice(h);let y=p,v=!1;p.endsWith(T0)?(y=p.slice(0,-1),v=!0):p.startsWith(T0)&&(y=p.slice(1),v=!0);const S=f&&f>h?f-h:void 0;return mT(o,v,y,S)};if(t){const a=t+hT,o=r;r=c=>c.startsWith(a)?o(c.slice(a.length)):mT(pY,!1,c,void 0,!0)}if(n){const a=r;r=o=>n({className:o,parseClassName:a})}return r},xY=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let o=0;o<n.length;o++){const c=n[o],d=c[0]==="[",h=t.has(c);d||h?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(c)):a.push(c)}return a.length>0&&(a.sort(),r.push(...a)),r}},yY=e=>({cache:mY(e.cacheSize),parseClassName:gY(e),sortModifiers:xY(e),...aY(e)}),vY=/\s+/,bY=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,c=[],d=e.trim().split(vY);let h="";for(let f=d.length-1;f>=0;f-=1){const m=d[f],{isExternal:p,modifiers:y,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:N}=n(m);if(p){h=m+(h.length>0?" "+h:h);continue}let C=!!N,j=r(C?S.substring(0,N):S);if(!j){if(!C){h=m+(h.length>0?" "+h:h);continue}if(j=r(S),!j){h=m+(h.length>0?" "+h:h);continue}C=!1}const E=y.length===0?"":y.length===1?y[0]:o(y).join(":"),R=v?E+T0:E,A=R+j;if(c.indexOf(A)>-1)continue;c.push(A);const _=a(j,C);for(let O=0;O<_.length;++O){const T=_[O];c.push(R+T)}h=m+(h.length>0?" "+h:h)}return h},wY=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=HO(n))&&(a&&(a+=" "),a+=r);return a},HO=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=HO(e[r]))&&(n&&(n+=" "),n+=t);return n},SY=(e,...t)=>{let n,r,a,o;const c=h=>{const f=t.reduce((m,p)=>p(m),e());return n=yY(f),r=n.cache.get,a=n.cache.set,o=d,d(h)},d=h=>{const f=r(h);if(f)return f;const m=bY(h,n);return a(h,m),m};return o=c,(...h)=>o(wY(...h))},NY=[],gn=e=>{const t=n=>n[e]||NY;return t.isThemeGetter=!0,t},GO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jY=/^\d+\/\d+$/,CY=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,EY=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,TY=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_Y=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RY=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zl=e=>jY.test(e),tt=e=>!!e&&!Number.isNaN(Number(e)),yi=e=>!!e&&Number.isInteger(Number(e)),Xy=e=>e.endsWith("%")&&tt(e.slice(0,-1)),za=e=>CY.test(e),DY=()=>!0,kY=e=>EY.test(e)&&!TY.test(e),WO=()=>!1,AY=e=>_Y.test(e),OY=e=>RY.test(e),MY=e=>!Me(e)&&!Pe(e),PY=e=>Ac(e,XO,WO),Me=e=>GO.test(e),jo=e=>Ac(e,QO,kY),Qy=e=>Ac(e,FY,tt),pT=e=>Ac(e,KO,WO),LY=e=>Ac(e,YO,OY),Bh=e=>Ac(e,JO,AY),Pe=e=>qO.test(e),Mu=e=>Oc(e,QO),IY=e=>Oc(e,$Y),gT=e=>Oc(e,KO),BY=e=>Oc(e,XO),zY=e=>Oc(e,YO),zh=e=>Oc(e,JO,!0),Ac=(e,t,n)=>{const r=GO.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Oc=(e,t,n=!1)=>{const r=qO.exec(e);return r?r[1]?t(r[1]):n:!1},KO=e=>e==="position"||e==="percentage",YO=e=>e==="image"||e==="url",XO=e=>e==="length"||e==="size"||e==="bg-size",QO=e=>e==="length",FY=e=>e==="number",$Y=e=>e==="family-name",JO=e=>e==="shadow",VY=()=>{const e=gn("color"),t=gn("font"),n=gn("text"),r=gn("font-weight"),a=gn("tracking"),o=gn("leading"),c=gn("breakpoint"),d=gn("container"),h=gn("spacing"),f=gn("radius"),m=gn("shadow"),p=gn("inset-shadow"),y=gn("text-shadow"),v=gn("drop-shadow"),S=gn("blur"),N=gn("perspective"),C=gn("aspect"),j=gn("ease"),E=gn("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...A(),Pe,Me],O=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],D=()=>[Pe,Me,h],B=()=>[zl,"full","auto",...D()],W=()=>[yi,"none","subgrid",Pe,Me],M=()=>["auto",{span:["full",yi,Pe,Me]},yi,Pe,Me],V=()=>[yi,"auto",Pe,Me],G=()=>["auto","min","max","fr",Pe,Me],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...D()],U=()=>[zl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],z=()=>[e,Pe,Me],te=()=>[...A(),gT,pT,{position:[Pe,Me]}],oe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",BY,PY,{size:[Pe,Me]}],$=()=>[Xy,Mu,jo],X=()=>["","none","full",f,Pe,Me],Q=()=>["",tt,Mu,jo],q=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[tt,Xy,gT,pT],xe=()=>["","none",S,Pe,Me],be=()=>["none",tt,Pe,Me],De=()=>["none",tt,Pe,Me],Ke=()=>[tt,Pe,Me],we=()=>[zl,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[za],breakpoint:[za],color:[DY],container:[za],"drop-shadow":[za],ease:["in","out","in-out"],font:[MY],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[za],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[za],shadow:[za],spacing:["px",tt],text:[za],"text-shadow":[za],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",zl,Me,Pe,C]}],container:["container"],columns:[{columns:[tt,Me,Pe,d]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{start:B()}],end:[{end:B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[yi,"auto",Pe,Me]}],basis:[{basis:[zl,"full","auto",d,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[tt,zl,"auto","initial","none",Me]}],grow:[{grow:["",tt,Pe,Me]}],shrink:[{shrink:["",tt,Pe,Me]}],order:[{order:[yi,"first","last","none",Pe,Me]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[d,"screen",...U()]}],"min-w":[{"min-w":[d,"screen","none",...U()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",n,Mu,jo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Pe,Qy]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xy,Me]}],"font-family":[{font:[IY,Me,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Pe,Me]}],"line-clamp":[{"line-clamp":[tt,"none",Pe,Qy]}],leading:[{leading:[o,...D()]}],"list-image":[{"list-image":["none",Pe,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Pe,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:[tt,"from-font","auto",Pe,jo]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[tt,"auto",Pe,Me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe,Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pe,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},yi,Pe,Me],radial:["",Pe,Me],conic:[yi,Pe,Me]},zY,LY]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...q(),"hidden","none"]}],"divide-style":[{divide:[...q(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[tt,Pe,Me]}],"outline-w":[{outline:["",tt,Mu,jo]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",m,zh,Bh]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",p,zh,Bh]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[tt,jo]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",y,zh,Bh]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[tt,Pe,Me]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[tt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[Pe,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[tt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Pe,Me]}],filter:[{filter:["","none",Pe,Me]}],blur:[{blur:xe()}],brightness:[{brightness:[tt,Pe,Me]}],contrast:[{contrast:[tt,Pe,Me]}],"drop-shadow":[{"drop-shadow":["","none",v,zh,Bh]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",tt,Pe,Me]}],"hue-rotate":[{"hue-rotate":[tt,Pe,Me]}],invert:[{invert:["",tt,Pe,Me]}],saturate:[{saturate:[tt,Pe,Me]}],sepia:[{sepia:["",tt,Pe,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Pe,Me]}],"backdrop-blur":[{"backdrop-blur":xe()}],"backdrop-brightness":[{"backdrop-brightness":[tt,Pe,Me]}],"backdrop-contrast":[{"backdrop-contrast":[tt,Pe,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",tt,Pe,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[tt,Pe,Me]}],"backdrop-invert":[{"backdrop-invert":["",tt,Pe,Me]}],"backdrop-opacity":[{"backdrop-opacity":[tt,Pe,Me]}],"backdrop-saturate":[{"backdrop-saturate":[tt,Pe,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",tt,Pe,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Pe,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[tt,"initial",Pe,Me]}],ease:[{ease:["linear","initial",j,Pe,Me]}],delay:[{delay:[tt,Pe,Me]}],animate:[{animate:["none",E,Pe,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,Pe,Me]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:De()}],"scale-x":[{"scale-x":De()}],"scale-y":[{"scale-y":De()}],"scale-z":[{"scale-z":De()}],"scale-3d":["scale-3d"],skew:[{skew:Ke()}],"skew-x":[{"skew-x":Ke()}],"skew-y":[{"skew-y":Ke()}],transform:[{transform:[Pe,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:we()}],"translate-x":[{"translate-x":we()}],"translate-y":[{"translate-y":we()}],"translate-z":[{"translate-z":we()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pe,Me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pe,Me]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[tt,Mu,jo,Qy]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},UY=SY(VY);function ue(...e){return UY(FO(e))}function ms({...e}){return l.jsx(Mq,{"data-slot":"select",...e})}function HY({...e}){return l.jsx($q,{"data-slot":"select-group",...e})}function ps({...e}){return l.jsx(Lq,{"data-slot":"select-value",...e})}function gs({className:e,size:t="default",children:n,...r}){return l.jsxs(Pq,{"data-slot":"select-trigger","data-size":t,className:ue("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,l.jsx(Iq,{asChild:!0,children:l.jsx($r,{className:"size-4 opacity-50"})})]})}function zs({className:e,children:t,position:n="item-aligned",align:r="center",...a}){return l.jsx(Bq,{children:l.jsxs(zq,{"data-slot":"select-content",className:ue("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...a,children:[l.jsx(qY,{}),l.jsx(Fq,{className:ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),l.jsx(WY,{})]})})}function GY({className:e,...t}){return l.jsx(Vq,{"data-slot":"select-label",className:ue("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function Vt({className:e,children:t,...n}){return l.jsxs(Uq,{"data-slot":"select-item",className:ue("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[l.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:l.jsx(Gq,{children:l.jsx(qt,{className:"size-4"})})}),l.jsx(Hq,{children:t})]})}function qY({className:e,...t}){return l.jsx(qq,{"data-slot":"select-scroll-up-button",className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Tw,{className:"size-4"})})}function WY({className:e,...t}){return l.jsx(Wq,{"data-slot":"select-scroll-down-button",className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx($r,{className:"size-4"})})}function un({className:e,...t}){return l.jsx("div",{className:ue("animate-pulse rounded-md bg-muted",e),...t})}function KY(){const{currentBoard:e,boards:t,setCurrentBoard:n,isLoading:r}=ys();return r?l.jsx(un,{className:"h-9 w-[220px]"}):t.length===0?l.jsx("div",{className:"text-sm text-muted-foreground",children:"No projects yet"}):l.jsxs(ms,{value:e?.id||"",onValueChange:n,children:[l.jsx(gs,{className:"w-[220px]",children:l.jsx(ps,{placeholder:"Select project..."})}),l.jsx(zs,{children:t.map(a=>l.jsx(Vt,{value:a.id,children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{className:"font-medium",children:a.name}),a.description&&l.jsx("span",{className:"text-xs text-muted-foreground truncate max-w-[180px]",children:a.description})]})},a.id))})]})}function YY(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var ya=e=>{const{present:t,children:n}=e,r=XY(t),a=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),o=rt(r.ref,QY(a));return typeof n=="function"||r.isPresent?x.cloneElement(a,{ref:o}):null};ya.displayName="Presence";function XY(e){const[t,n]=x.useState(),r=x.useRef(null),a=x.useRef(e),o=x.useRef("none"),c=e?"mounted":"unmounted",[d,h]=YY(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Fh(r.current);o.current=d==="mounted"?f:"none"},[d]),Gn(()=>{const f=r.current,m=a.current;if(m!==e){const y=o.current,v=Fh(f);e?h("MOUNT"):v==="none"||f?.display==="none"?h("UNMOUNT"):h(m&&y!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,h]),Gn(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,p=v=>{const N=Fh(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&N&&(h("ANIMATION_END"),!a.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},y=v=>{v.target===t&&(o.current=Fh(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Fh(e){return e?.animationName||"none"}function QY(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function JY(e){const t=ZY(e),n=x.forwardRef((r,a)=>{const{children:o,...c}=r,d=x.Children.toArray(o),h=d.find(tX);if(h){const f=h.props.children,m=d.map(p=>p===h?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:p);return l.jsx(t,{...c,ref:a,children:x.isValidElement(f)?x.cloneElement(f,void 0,m):null})}return l.jsx(t,{...c,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function ZY(e){const t=x.forwardRef((n,r)=>{const{children:a,...o}=n;if(x.isValidElement(a)){const c=rX(a),d=nX(o,a.props);return a.type!==x.Fragment&&(d.ref=r?fs(r,c):c),x.cloneElement(a,d)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eX=Symbol("radix.slottable");function tX(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eX}function nX(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...d)=>{const h=o(...d);return a(...d),h}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function rX(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ap="Dialog",[ZO,eM]=vs(Ap),[sX,Fs]=ZO(Ap),tM=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:c=!0}=e,d=x.useRef(null),h=x.useRef(null),[f,m]=ma({prop:r,defaultProp:a??!1,onChange:o,caller:Ap});return l.jsx(sX,{scope:t,triggerRef:d,contentRef:h,contentId:Un(),titleId:Un(),descriptionId:Un(),open:f,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(p=>!p),[m]),modal:c,children:n})};tM.displayName=Ap;var nM="DialogTrigger",rM=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fs(nM,n),o=rt(t,a.triggerRef);return l.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ow(a.open),...r,ref:o,onClick:Ue(e.onClick,a.onOpenToggle)})});rM.displayName=nM;var kw="DialogPortal",[aX,sM]=ZO(kw,{forceMount:void 0}),aM=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=Fs(kw,t);return l.jsx(aX,{scope:t,forceMount:n,children:x.Children.map(r,c=>l.jsx(ya,{present:n||o.open,children:l.jsx(ef,{asChild:!0,container:a,children:c})}))})};aM.displayName=kw;var Im="DialogOverlay",iM=x.forwardRef((e,t)=>{const n=sM(Im,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=Fs(Im,e.__scopeDialog);return o.modal?l.jsx(ya,{present:r||o.open,children:l.jsx(oX,{...a,ref:t})}):null});iM.displayName=Im;var iX=JY("DialogOverlay.RemoveScroll"),oX=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fs(Im,n);return l.jsx(Np,{as:iX,allowPinchZoom:!0,shards:[a.contentRef],children:l.jsx(He.div,{"data-state":Ow(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Yo="DialogContent",oM=x.forwardRef((e,t)=>{const n=sM(Yo,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=Fs(Yo,e.__scopeDialog);return l.jsx(ya,{present:r||o.open,children:o.modal?l.jsx(lX,{...a,ref:t}):l.jsx(cX,{...a,ref:t})})});oM.displayName=Yo;var lX=x.forwardRef((e,t)=>{const n=Fs(Yo,e.__scopeDialog),r=x.useRef(null),a=rt(t,n.contentRef,r);return x.useEffect(()=>{const o=r.current;if(o)return Nw(o)},[]),l.jsx(lM,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ue(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ue(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&o.preventDefault()}),onFocusOutside:Ue(e.onFocusOutside,o=>o.preventDefault())})}),cX=x.forwardRef((e,t)=>{const n=Fs(Yo,e.__scopeDialog),r=x.useRef(!1),a=x.useRef(!1);return l.jsx(lM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=o.target;n.triggerRef.current?.contains(c)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),lM=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...c}=e,d=Fs(Yo,n),h=x.useRef(null),f=rt(t,h);return dw(),l.jsxs(l.Fragment,{children:[l.jsx(mp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:l.jsx(Jd,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Ow(d.open),...c,ref:f,onDismiss:()=>d.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(dX,{titleId:d.titleId}),l.jsx(hX,{contentRef:h,descriptionId:d.descriptionId})]})]})}),Aw="DialogTitle",cM=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fs(Aw,n);return l.jsx(He.h2,{id:a.titleId,...r,ref:t})});cM.displayName=Aw;var uM="DialogDescription",dM=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fs(uM,n);return l.jsx(He.p,{id:a.descriptionId,...r,ref:t})});dM.displayName=uM;var fM="DialogClose",hM=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Fs(fM,n);return l.jsx(He.button,{type:"button",...r,ref:t,onClick:Ue(e.onClick,()=>a.onOpenChange(!1))})});hM.displayName=fM;function Ow(e){return e?"open":"closed"}var mM="DialogTitleWarning",[uX,pM]=v9(mM,{contentName:Yo,titleName:Aw,docsSlug:"dialog"}),dX=({titleId:e})=>{const t=pM(mM),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
64
+
65
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
66
+
67
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},fX="DialogDescriptionWarning",hX=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pM(fX).contentName}}.`;return x.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Mw=tM,mX=rM,Pw=aM,Lw=iM,Iw=oM,gM=cM,xM=dM,Bw=hM;function Br({...e}){return l.jsx(Mw,{"data-slot":"dialog",...e})}function pX({...e}){return l.jsx(Pw,{"data-slot":"dialog-portal",...e})}function gX({className:e,...t}){return l.jsx(Lw,{"data-slot":"dialog-overlay",className:ue("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t})}function zr({className:e,children:t,showCloseButton:n=!0,...r}){return l.jsxs(pX,{"data-slot":"dialog-portal",children:[l.jsx(gX,{}),l.jsxs(Iw,{"data-slot":"dialog-content",className:ue("bg-white data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",e),...r,children:[t,n&&l.jsxs(Bw,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[l.jsx(On,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function $s({className:e,...t}){return l.jsx("div",{"data-slot":"dialog-header",className:ue("flex flex-col gap-2 text-center sm:text-left",e),...t})}function rf({className:e,...t}){return l.jsx("div",{"data-slot":"dialog-footer",className:ue("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Vs({className:e,...t}){return l.jsx(gM,{"data-slot":"dialog-title",className:ue("text-lg leading-none font-semibold",e),...t})}function Us({className:e,...t}){return l.jsx(xM,{"data-slot":"dialog-description",className:ue("text-muted-foreground text-sm",e),...t})}function Ln({className:e,type:t,...n}){return l.jsx("input",{type:t,"data-slot":"input",className:ue("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var xX=Symbol.for("react.lazy"),Bm=tp[" use ".trim().toString()];function yX(e){return typeof e=="object"&&e!==null&&"then"in e}function yM(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===xX&&"_payload"in e&&yX(e._payload)}function vM(e){const t=vX(e),n=x.forwardRef((r,a)=>{let{children:o,...c}=r;yM(o)&&typeof Bm=="function"&&(o=Bm(o._payload));const d=x.Children.toArray(o),h=d.find(wX);if(h){const f=h.props.children,m=d.map(p=>p===h?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:p);return l.jsx(t,{...c,ref:a,children:x.isValidElement(f)?x.cloneElement(f,void 0,m):null})}return l.jsx(t,{...c,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}var bM=vM("Slot");function vX(e){const t=x.forwardRef((n,r)=>{let{children:a,...o}=n;if(yM(a)&&typeof Bm=="function"&&(a=Bm(a._payload)),x.isValidElement(a)){const c=NX(a),d=SX(o,a.props);return a.type!==x.Fragment&&(d.ref=r?fs(r,c):c),x.cloneElement(a,d)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bX=Symbol("radix.slottable");function wX(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bX}function SX(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...d)=>{const h=o(...d);return a(...d),h}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function NX(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const xT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yT=FO,zw=(e,t)=>n=>{var r;if(t?.variants==null)return yT(e,n?.class,n?.className);const{variants:a,defaultVariants:o}=t,c=Object.keys(a).map(f=>{const m=n?.[f],p=o?.[f];if(m===null)return null;const y=xT(m)||xT(p);return a[f][y]}),d=n&&Object.entries(n).reduce((f,m)=>{let[p,y]=m;return y===void 0||(f[p]=y),f},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:p,className:y,...v}=m;return Object.entries(v).every(S=>{let[N,C]=S;return Array.isArray(C)?C.includes({...o,...d}[N]):{...o,...d}[N]===C})?[...f,p,y]:f},[]);return yT(e,c,h,n?.class,n?.className)},Op=zw("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:scale-[0.97] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ye=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},o)=>{const c=r?bM:"button";return l.jsx(c,{className:ue(Op({variant:t,size:n,className:e})),ref:o,...a})});ye.displayName="Button";var Mp="Checkbox",[jX]=vs(Mp),[CX,Fw]=jX(Mp);function EX(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:o,form:c,name:d,onCheckedChange:h,required:f,value:m="on",internal_do_not_use_render:p}=e,[y,v]=ma({prop:n,defaultProp:a??!1,onChange:h,caller:Mp}),[S,N]=x.useState(null),[C,j]=x.useState(null),E=x.useRef(!1),R=S?!!c||!!S.closest("form"):!0,A={checked:y,disabled:o,setChecked:v,control:S,setControl:N,name:d,form:c,value:m,hasConsumerStoppedPropagationRef:E,required:f,defaultChecked:Ri(a)?!1:a,isFormControl:R,bubbleInput:C,setBubbleInput:j};return l.jsx(CX,{scope:t,...A,children:TX(p)?p(A):r})}var wM="CheckboxTrigger",SM=x.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:o,value:c,disabled:d,checked:h,required:f,setControl:m,setChecked:p,hasConsumerStoppedPropagationRef:y,isFormControl:v,bubbleInput:S}=Fw(wM,e),N=rt(a,m),C=x.useRef(h);return x.useEffect(()=>{const j=o?.form;if(j){const E=()=>p(C.current);return j.addEventListener("reset",E),()=>j.removeEventListener("reset",E)}},[o,p]),l.jsx(He.button,{type:"button",role:"checkbox","aria-checked":Ri(h)?"mixed":h,"aria-required":f,"data-state":TM(h),"data-disabled":d?"":void 0,disabled:d,value:c,...r,ref:N,onKeyDown:Ue(t,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Ue(n,j=>{p(E=>Ri(E)?!0:!E),S&&v&&(y.current=j.isPropagationStopped(),y.current||j.stopPropagation())})})});SM.displayName=wM;var $w=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:c,disabled:d,value:h,onCheckedChange:f,form:m,...p}=e;return l.jsx(EX,{__scopeCheckbox:n,checked:a,defaultChecked:o,disabled:d,required:c,onCheckedChange:f,name:r,form:m,value:h,internal_do_not_use_render:({isFormControl:y})=>l.jsxs(l.Fragment,{children:[l.jsx(SM,{...p,ref:t,__scopeCheckbox:n}),y&&l.jsx(EM,{__scopeCheckbox:n})]})})});$w.displayName=Mp;var NM="CheckboxIndicator",jM=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=Fw(NM,n);return l.jsx(ya,{present:r||Ri(o.checked)||o.checked===!0,children:l.jsx(He.span,{"data-state":TM(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});jM.displayName=NM;var CM="CheckboxBubbleInput",EM=x.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:c,required:d,disabled:h,name:f,value:m,form:p,bubbleInput:y,setBubbleInput:v}=Fw(CM,e),S=rt(n,v),N=wp(o),C=vp(r);x.useEffect(()=>{const E=y;if(!E)return;const R=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(R,"checked").set,O=!a.current;if(N!==o&&_){const T=new Event("click",{bubbles:O});E.indeterminate=Ri(o),_.call(E,Ri(o)?!1:o),E.dispatchEvent(T)}},[y,N,o,a]);const j=x.useRef(Ri(o)?!1:o);return l.jsx(He.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??j.current,required:d,disabled:h,name:f,value:m,form:p,...t,tabIndex:-1,ref:S,style:{...t.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});EM.displayName=CM;function TX(e){return typeof e=="function"}function Ri(e){return e==="indeterminate"}function TM(e){return Ri(e)?"indeterminate":e?"checked":"unchecked"}const _M=x.forwardRef(({className:e,...t},n)=>l.jsx($w,{ref:n,className:ue("peer h-4 w-4 shrink-0 rounded-xs border border-input ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:l.jsx(jM,{className:ue("flex items-center justify-center text-current"),children:l.jsx(qt,{className:"h-4 w-4"})})}));_M.displayName=$w.displayName;const _X=zw("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function kt({className:e,variant:t,asChild:n=!1,...r}){const a=n?bM:"span";return l.jsx(a,{"data-slot":"badge",className:ue(_X({variant:t}),e),...r})}function RX(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const DX=e=>{switch(e){case"success":return OX;case"info":return PX;case"warning":return MX;case"error":return LX;default:return null}},kX=Array(12).fill(0),AX=({visible:e,className:t})=>ge.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ge.createElement("div",{className:"sonner-spinner"},kX.map((n,r)=>ge.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),OX=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),MX=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),PX=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),LX=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),IX=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ge.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ge.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),BX=()=>{const[e,t]=ge.useState(document.hidden);return ge.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let _0=1;class zX{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...a}=t,o=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:_0++,c=this.toasts.find(h=>h.id===o),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),c?this.toasts=this.toasts.map(h=>h.id===o?(this.publish({...h,...t,id:o,title:r}),{...h,...t,id:o,dismissible:d,title:r}):h):this.addToast({title:r,...a,dismissible:d,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,c;const d=a.then(async f=>{if(c=["resolve",f],ge.isValidElement(f))o=!1,this.create({id:r,type:"default",message:f});else if($X(f)&&!f.ok){o=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,y=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,S=typeof p=="object"&&!ge.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:y,...S})}else if(f instanceof Error){o=!1;const p=typeof n.error=="function"?await n.error(f):n.error,y=typeof n.description=="function"?await n.description(f):n.description,S=typeof p=="object"&&!ge.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:y,...S})}else if(n.success!==void 0){o=!1;const p=typeof n.success=="function"?await n.success(f):n.success,y=typeof n.description=="function"?await n.description(f):n.description,S=typeof p=="object"&&!ge.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:y,...S})}}).catch(async f=>{if(c=["reject",f],n.error!==void 0){o=!1;const m=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,v=typeof m=="object"&&!ge.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:p,...v})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),h=()=>new Promise((f,m)=>d.then(()=>c[0]==="reject"?m(c[1]):f(c[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:h}:Object.assign(r,{unwrap:h})},this.custom=(t,n)=>{const r=n?.id||_0++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const gr=new zX,FX=(e,t)=>{const n=t?.id||_0++;return gr.addToast({title:e,...t,id:n}),n},$X=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",VX=FX,UX=()=>gr.toasts,HX=()=>gr.getActiveToasts(),me=Object.assign(VX,{success:gr.success,info:gr.info,warning:gr.warning,error:gr.error,custom:gr.custom,message:gr.message,promise:gr.promise,dismiss:gr.dismiss,loading:gr.loading},{getHistory:UX,getToasts:HX});RX("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function $h(e){return e.label!==void 0}const GX=3,qX="24px",WX="16px",vT=4e3,KX=356,YX=14,XX=45,QX=200;function Ys(...e){return e.filter(Boolean).join(" ")}function JX(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const ZX=e=>{var t,n,r,a,o,c,d,h,f;const{invert:m,toast:p,unstyled:y,interacting:v,setHeights:S,visibleToasts:N,heights:C,index:j,toasts:E,expanded:R,removeToast:A,defaultRichColors:_,closeButton:O,style:T,cancelButtonStyle:D,actionButtonStyle:B,className:W="",descriptionClassName:M="",duration:V,position:G,gap:F,expandByDefault:H,classNames:P,icons:U,closeButtonAriaLabel:z="Close toast"}=e,[te,oe]=ge.useState(null),[L,$]=ge.useState(null),[X,Q]=ge.useState(!1),[q,ce]=ge.useState(!1),[ne,xe]=ge.useState(!1),[be,De]=ge.useState(!1),[Ke,we]=ge.useState(!1),[_e,vt]=ge.useState(0),[en,Pt]=ge.useState(0),vn=ge.useRef(p.duration||V||vT),Hs=ge.useRef(null),Qe=ge.useRef(null),qn=j===0,va=j+1<=N,Bt=p.type,Wn=p.dismissible!==!1,Nt=p.className||"",yr=p.descriptionClassName||"",qr=ge.useMemo(()=>C.findIndex(Ge=>Ge.toastId===p.id)||0,[C,p.id]),vr=ge.useMemo(()=>{var Ge;return(Ge=p.closeButton)!=null?Ge:O},[p.closeButton,O]),mn=ge.useMemo(()=>p.duration||V||vT,[p.duration,V]),jn=ge.useRef(0),rr=ge.useRef(0),ba=ge.useRef(0),sr=ge.useRef(null),[bs,At]=G.split("-"),Cn=ge.useMemo(()=>C.reduce((Ge,Tt,zt)=>zt>=qr?Ge:Ge+Tt.height,0),[C,qr]),tn=BX(),Ka=p.invert||m,Wr=Bt==="loading";rr.current=ge.useMemo(()=>qr*F+Cn,[qr,Cn]),ge.useEffect(()=>{vn.current=mn},[mn]),ge.useEffect(()=>{Q(!0)},[]),ge.useEffect(()=>{const Ge=Qe.current;if(Ge){const Tt=Ge.getBoundingClientRect().height;return Pt(Tt),S(zt=>[{toastId:p.id,height:Tt,position:p.position},...zt]),()=>S(zt=>zt.filter(Ut=>Ut.toastId!==p.id))}},[S,p.id]),ge.useLayoutEffect(()=>{if(!X)return;const Ge=Qe.current,Tt=Ge.style.height;Ge.style.height="auto";const zt=Ge.getBoundingClientRect().height;Ge.style.height=Tt,Pt(zt),S(Ut=>Ut.find(Ee=>Ee.toastId===p.id)?Ut.map(Ee=>Ee.toastId===p.id?{...Ee,height:zt}:Ee):[{toastId:p.id,height:zt,position:p.position},...Ut])},[X,p.title,p.description,S,p.id,p.jsx,p.action,p.cancel]);const Bn=ge.useCallback(()=>{ce(!0),vt(rr.current),S(Ge=>Ge.filter(Tt=>Tt.toastId!==p.id)),setTimeout(()=>{A(p)},QX)},[p,A,S,rr]);ge.useEffect(()=>{if(p.promise&&Bt==="loading"||p.duration===1/0||p.type==="loading")return;let Ge;return R||v||tn?(()=>{if(ba.current<jn.current){const Ut=new Date().getTime()-jn.current;vn.current=vn.current-Ut}ba.current=new Date().getTime()})():vn.current!==1/0&&(jn.current=new Date().getTime(),Ge=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Bn()},vn.current)),()=>clearTimeout(Ge)},[R,v,p,Bt,tn,Bn]),ge.useEffect(()=>{p.delete&&(Bn(),p.onDismiss==null||p.onDismiss.call(p,p))},[Bn,p.delete]);function ar(){var Ge;if(U?.loading){var Tt;return ge.createElement("div",{className:Ys(P?.loader,p==null||(Tt=p.classNames)==null?void 0:Tt.loader,"sonner-loader"),"data-visible":Bt==="loading"},U.loading)}return ge.createElement(AX,{className:Ys(P?.loader,p==null||(Ge=p.classNames)==null?void 0:Ge.loader),visible:Bt==="loading"})}const ir=p.icon||U?.[Bt]||DX(Bt);var or,lr;return ge.createElement("li",{tabIndex:0,ref:Qe,className:Ys(W,Nt,P?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,P?.default,P?.[Bt],p==null||(n=p.classNames)==null?void 0:n[Bt]),"data-sonner-toast":"","data-rich-colors":(or=p.richColors)!=null?or:_,"data-styled":!(p.jsx||p.unstyled||y),"data-mounted":X,"data-promise":!!p.promise,"data-swiped":Ke,"data-removed":q,"data-visible":va,"data-y-position":bs,"data-x-position":At,"data-index":j,"data-front":qn,"data-swiping":ne,"data-dismissible":Wn,"data-type":Bt,"data-invert":Ka,"data-swipe-out":be,"data-swipe-direction":L,"data-expanded":!!(R||H&&X),"data-testid":p.testId,style:{"--index":j,"--toasts-before":j,"--z-index":E.length-j,"--offset":`${q?_e:rr.current}px`,"--initial-height":H?"auto":`${en}px`,...T,...p.style},onDragEnd:()=>{xe(!1),oe(null),sr.current=null},onPointerDown:Ge=>{Ge.button!==2&&(Wr||!Wn||(Hs.current=new Date,vt(rr.current),Ge.target.setPointerCapture(Ge.pointerId),Ge.target.tagName!=="BUTTON"&&(xe(!0),sr.current={x:Ge.clientX,y:Ge.clientY})))},onPointerUp:()=>{var Ge,Tt,zt;if(be||!Wn)return;sr.current=null;const Ut=Number(((Ge=Qe.current)==null?void 0:Ge.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),fe=Number(((Tt=Qe.current)==null?void 0:Tt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ee=new Date().getTime()-((zt=Hs.current)==null?void 0:zt.getTime()),et=te==="x"?Ut:fe,En=Math.abs(et)/Ee;if(Math.abs(et)>=XX||En>.11){vt(rr.current),p.onDismiss==null||p.onDismiss.call(p,p),$(te==="x"?Ut>0?"right":"left":fe>0?"down":"up"),Bn(),De(!0);return}else{var K,Z;(K=Qe.current)==null||K.style.setProperty("--swipe-amount-x","0px"),(Z=Qe.current)==null||Z.style.setProperty("--swipe-amount-y","0px")}we(!1),xe(!1),oe(null)},onPointerMove:Ge=>{var Tt,zt,Ut;if(!sr.current||!Wn||((Tt=window.getSelection())==null?void 0:Tt.toString().length)>0)return;const Ee=Ge.clientY-sr.current.y,et=Ge.clientX-sr.current.x;var En;const K=(En=e.swipeDirections)!=null?En:JX(G);!te&&(Math.abs(et)>1||Math.abs(Ee)>1)&&oe(Math.abs(et)>Math.abs(Ee)?"x":"y");let Z={x:0,y:0};const ae=ve=>1/(1.5+Math.abs(ve)/20);if(te==="y"){if(K.includes("top")||K.includes("bottom"))if(K.includes("top")&&Ee<0||K.includes("bottom")&&Ee>0)Z.y=Ee;else{const ve=Ee*ae(Ee);Z.y=Math.abs(ve)<Math.abs(Ee)?ve:Ee}}else if(te==="x"&&(K.includes("left")||K.includes("right")))if(K.includes("left")&&et<0||K.includes("right")&&et>0)Z.x=et;else{const ve=et*ae(et);Z.x=Math.abs(ve)<Math.abs(et)?ve:et}(Math.abs(Z.x)>0||Math.abs(Z.y)>0)&&we(!0),(zt=Qe.current)==null||zt.style.setProperty("--swipe-amount-x",`${Z.x}px`),(Ut=Qe.current)==null||Ut.style.setProperty("--swipe-amount-y",`${Z.y}px`)}},vr&&!p.jsx&&Bt!=="loading"?ge.createElement("button",{"aria-label":z,"data-disabled":Wr,"data-close-button":!0,onClick:Wr||!Wn?()=>{}:()=>{Bn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Ys(P?.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(lr=U?.close)!=null?lr:IX):null,(Bt||p.icon||p.promise)&&p.icon!==null&&(U?.[Bt]!==null||p.icon)?ge.createElement("div",{"data-icon":"",className:Ys(P?.icon,p==null||(a=p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||ar():null,p.type!=="loading"?ir:null):null,ge.createElement("div",{"data-content":"",className:Ys(P?.content,p==null||(o=p.classNames)==null?void 0:o.content)},ge.createElement("div",{"data-title":"",className:Ys(P?.title,p==null||(c=p.classNames)==null?void 0:c.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ge.createElement("div",{"data-description":"",className:Ys(M,yr,P?.description,p==null||(d=p.classNames)==null?void 0:d.description)},typeof p.description=="function"?p.description():p.description):null),ge.isValidElement(p.cancel)?p.cancel:p.cancel&&$h(p.cancel)?ge.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||D,onClick:Ge=>{$h(p.cancel)&&Wn&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ge),Bn())},className:Ys(P?.cancelButton,p==null||(h=p.classNames)==null?void 0:h.cancelButton)},p.cancel.label):null,ge.isValidElement(p.action)?p.action:p.action&&$h(p.action)?ge.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||B,onClick:Ge=>{$h(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ge),!Ge.defaultPrevented&&Bn())},className:Ys(P?.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function bT(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function eQ(e,t){const n={};return[e,t].forEach((r,a)=>{const o=a===1,c=o?"--mobile-offset":"--offset",d=o?WX:qX;function h(f){["top","right","bottom","left"].forEach(m=>{n[`${c}-${m}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?h(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${c}-${f}`]=d:n[`${c}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):h(d)}),n}const tQ=ge.forwardRef(function(t,n){const{id:r,invert:a,position:o="bottom-right",hotkey:c=["altKey","KeyT"],expand:d,closeButton:h,className:f,offset:m,mobileOffset:p,theme:y="light",richColors:v,duration:S,style:N,visibleToasts:C=GX,toastOptions:j,dir:E=bT(),gap:R=YX,icons:A,containerAriaLabel:_="Notifications"}=t,[O,T]=ge.useState([]),D=ge.useMemo(()=>r?O.filter(X=>X.toasterId===r):O.filter(X=>!X.toasterId),[O,r]),B=ge.useMemo(()=>Array.from(new Set([o].concat(D.filter(X=>X.position).map(X=>X.position)))),[D,o]),[W,M]=ge.useState([]),[V,G]=ge.useState(!1),[F,H]=ge.useState(!1),[P,U]=ge.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=ge.useRef(null),te=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),oe=ge.useRef(null),L=ge.useRef(!1),$=ge.useCallback(X=>{T(Q=>{var q;return(q=Q.find(ce=>ce.id===X.id))!=null&&q.delete||gr.dismiss(X.id),Q.filter(({id:ce})=>ce!==X.id)})},[]);return ge.useEffect(()=>gr.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{T(Q=>Q.map(q=>q.id===X.id?{...q,delete:!0}:q))});return}setTimeout(()=>{cw.flushSync(()=>{T(Q=>{const q=Q.findIndex(ce=>ce.id===X.id);return q!==-1?[...Q.slice(0,q),{...Q[q],...X},...Q.slice(q+1)]:[X,...Q]})})})}),[O]),ge.useEffect(()=>{if(y!=="system"){U(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:Q})=>{U(Q?"dark":"light")})}catch{X.addListener(({matches:q})=>{try{U(q?"dark":"light")}catch(ce){console.error(ce)}})}},[y]),ge.useEffect(()=>{O.length<=1&&G(!1)},[O]),ge.useEffect(()=>{const X=Q=>{var q;if(c.every(xe=>Q[xe]||Q.code===xe)){var ne;G(!0),(ne=z.current)==null||ne.focus()}Q.code==="Escape"&&(document.activeElement===z.current||(q=z.current)!=null&&q.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[c]),ge.useEffect(()=>{if(z.current)return()=>{oe.current&&(oe.current.focus({preventScroll:!0}),oe.current=null,L.current=!1)}},[z.current]),ge.createElement("section",{ref:n,"aria-label":`${_} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((X,Q)=>{var q;const[ce,ne]=X.split("-");return D.length?ge.createElement("ol",{key:X,dir:E==="auto"?bT():E,tabIndex:-1,ref:z,className:f,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":ce,"data-x-position":ne,style:{"--front-toast-height":`${((q=W[0])==null?void 0:q.height)||0}px`,"--width":`${KX}px`,"--gap":`${R}px`,...N,...eQ(m,p)},onBlur:xe=>{L.current&&!xe.currentTarget.contains(xe.relatedTarget)&&(L.current=!1,oe.current&&(oe.current.focus({preventScroll:!0}),oe.current=null))},onFocus:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||L.current||(L.current=!0,oe.current=xe.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{F||G(!1)},onDragEnd:()=>G(!1),onPointerDown:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},D.filter(xe=>!xe.position&&Q===0||xe.position===X).map((xe,be)=>{var De,Ke;return ge.createElement(ZX,{key:xe.id,icons:A,index:be,toast:xe,defaultRichColors:v,duration:(De=j?.duration)!=null?De:S,className:j?.className,descriptionClassName:j?.descriptionClassName,invert:a,visibleToasts:C,closeButton:(Ke=j?.closeButton)!=null?Ke:h,interacting:F,position:X,style:j?.style,unstyled:j?.unstyled,classNames:j?.classNames,cancelButtonStyle:j?.cancelButtonStyle,actionButtonStyle:j?.actionButtonStyle,closeButtonAriaLabel:j?.closeButtonAriaLabel,removeToast:$,toasts:D.filter(we=>we.position==xe.position),heights:W.filter(we=>we.position==xe.position),setHeights:M,expandByDefault:d,gap:R,expanded:V,swipeDirections:t.swipeDirections})})):null}))});function nQ({open:e,onOpenChange:t,onReposAdded:n}){const{refreshBoards:r}=ys(),[a,o]=x.useState("~/code"),[c,d]=x.useState([]),[h,f]=x.useState(new Set),[m,p]=x.useState(!1),[y,v]=x.useState(!1),[S,N]=x.useState(null),[C,j]=x.useState(!1),E=x.useCallback(async()=>{if(!a.trim()){me.error("Please enter a path to scan");return}p(!0),d([]),f(new Set),N(null);try{const O=(await wH({search_paths:[a],max_depth:3})).discovered.filter(T=>T.is_valid);d(O),O.length===0?me.info("No git repositories found",{description:`No repositories found in ${a}`}):me.success(`Found ${O.length} repository${O.length>1?"s":""}`)}catch(_){console.error("Discovery failed:",_);const O=_ instanceof Error?_.message:"Unknown error";N(O),me.error("Failed to discover repositories",{description:O})}finally{p(!1)}},[a]);async function R(){if(h.size!==0){v(!0);try{let _=0,O=0;for(const T of h)try{const D=c.find(B=>B.path===T);if(!D){console.error(`Could not find metadata for ${T}`),O++;continue}await bH({name:D.display_name||D.name,repo_root:T,default_branch:D.default_branch||void 0}),_++}catch(D){console.error(`Failed to create board for repo ${T}:`,D),O++}_>0&&(me.success(`Created ${_} board${_>1?"s":""}`),await r(),n?.(),t(!1)),O>0&&me.warning(`${_} created, ${O} failed`)}catch(_){console.error("Failed to create boards:",_);const O=_ instanceof Error?_.message:"Unknown error";me.error("Failed to create boards",{description:O})}finally{v(!1)}}}function A(_){const O=new Set(h);O.has(_)?O.delete(_):O.add(_),f(O)}return x.useEffect(()=>{e&&!C&&(j(!0),E()),e||j(!1)},[e,C,E]),l.jsx(Br,{open:e,onOpenChange:t,children:l.jsxs(zr,{className:"max-w-3xl max-h-[80vh] flex flex-col",children:[l.jsxs($s,{children:[l.jsx(Vs,{children:"Discover Repositories"}),l.jsx(Us,{children:"Scan your filesystem for git repositories and create boards for them"})]}),l.jsxs("div",{className:"space-y-4 flex-1 overflow-hidden flex flex-col",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Ln,{placeholder:"Path to scan (e.g., ~/code, ~/projects)",value:a,onChange:_=>o(_.target.value),onKeyDown:_=>{_.key==="Enter"&&!m&&E()},disabled:m}),l.jsx(ye,{onClick:E,disabled:m||!a,children:m?l.jsxs(l.Fragment,{children:[l.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Scanning..."]}):l.jsxs(l.Fragment,{children:[l.jsx(kp,{className:"mr-2 h-4 w-4"}),"Scan"]})})]}),c.length>0?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-sm text-muted-foreground",children:["Found ",c.length," repositories"]}),l.jsx("div",{className:"flex-1 overflow-y-auto space-y-2 border rounded-lg p-2",children:c.map(_=>l.jsxs("div",{className:"flex items-start gap-3 p-3 border rounded hover:bg-accent/50 transition-colors cursor-pointer",onClick:()=>A(_.path),children:[l.jsx(_M,{checked:h.has(_.path),onCheckedChange:()=>A(_.path),onClick:O=>O.stopPropagation()}),l.jsx(RO,{className:"h-5 w-5 text-muted-foreground mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"font-medium",children:_.name}),_.default_branch&&l.jsx(kt,{variant:"secondary",className:"text-xs",children:_.default_branch})]}),l.jsx("p",{className:"text-xs text-muted-foreground break-all",children:_.path}),_.remote_url&&l.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:_.remote_url})]})]},_.path))})]}):m?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx(ke,{className:"h-8 w-8 animate-spin text-muted-foreground mx-auto mb-2"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Scanning for git repositories..."})]})}):S?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx(Hn,{className:"h-8 w-8 mx-auto mb-2 text-red-500"}),l.jsx("p",{className:"text-sm font-medium text-red-600 mb-1",children:"Discovery failed"}),l.jsx("p",{className:"text-xs text-muted-foreground max-w-md",children:S})]})}):l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsxs("div",{className:"text-center text-muted-foreground",children:[l.jsx(Hn,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),l.jsx("p",{className:"text-sm",children:"Enter a path and click Scan to discover repositories"}),l.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Example: ~/code, ~/projects, /Users/your-name/dev"})]})}),h.size>0&&l.jsxs("div",{className:"flex items-center justify-between pt-4 border-t",children:[l.jsxs("span",{className:"text-sm text-muted-foreground",children:[h.size," selected"]}),l.jsx(ye,{onClick:R,disabled:y,children:y?l.jsxs(l.Fragment,{children:[l.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating boards..."]}):`Create ${h.size} Board${h.size>1?"s":""}`})]})]})]})})}var rQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sQ=rQ.reduce((e,t)=>{const n=vM(`Primitive.${t}`),r=x.forwardRef((a,o)=>{const{asChild:c,...d}=a,h=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(h,{...d,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),aQ="Label",RM=x.forwardRef((e,t)=>l.jsx(sQ.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));RM.displayName=aQ;var iQ=RM;function ct({className:e,...t}){return l.jsx(iQ,{"data-slot":"label",className:ue("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Mc({className:e,...t}){return l.jsx("textarea",{"data-slot":"textarea",className:ue("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}var Pp="Switch",[oQ]=vs(Pp),[lQ,cQ]=oQ(Pp),DM=x.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:o,required:c,disabled:d,value:h="on",onCheckedChange:f,form:m,...p}=e,[y,v]=x.useState(null),S=rt(t,R=>v(R)),N=x.useRef(!1),C=y?m||!!y.closest("form"):!0,[j,E]=ma({prop:a,defaultProp:o??!1,onChange:f,caller:Pp});return l.jsxs(lQ,{scope:n,checked:j,disabled:d,children:[l.jsx(He.button,{type:"button",role:"switch","aria-checked":j,"aria-required":c,"data-state":MM(j),"data-disabled":d?"":void 0,disabled:d,value:h,...p,ref:S,onClick:Ue(e.onClick,R=>{E(A=>!A),C&&(N.current=R.isPropagationStopped(),N.current||R.stopPropagation())})}),C&&l.jsx(OM,{control:y,bubbles:!N.current,name:r,value:h,checked:j,required:c,disabled:d,form:m,style:{transform:"translateX(-100%)"}})]})});DM.displayName=Pp;var kM="SwitchThumb",AM=x.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=cQ(kM,n);return l.jsx(He.span,{"data-state":MM(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});AM.displayName=kM;var uQ="SwitchBubbleInput",OM=x.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},o)=>{const c=x.useRef(null),d=rt(c,o),h=wp(n),f=vp(t);return x.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(h!==n&&v){const S=new Event("click",{bubbles:r});v.call(m,n),m.dispatchEvent(S)}},[h,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:d,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});OM.displayName=uQ;function MM(e){return e?"checked":"unchecked"}var PM=DM,dQ=AM;const Pn=x.forwardRef(({className:e,...t},n)=>l.jsx(PM,{className:ue("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:l.jsx(dQ,{className:ue("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Pn.displayName=PM.displayName;function fQ({open:e,onOpenChange:t,onSuccess:n}){const{currentBoard:r}=ys(),[a,o]=x.useState(""),[c,d]=x.useState(""),[h,f]=x.useState(!1),[m,p]=x.useState({}),[y,v]=x.useState(!1),[S,N]=x.useState(!1),[C,j]=x.useState(!1),[E,R]=x.useState(!1),[A,_]=x.useState(!1),[O,T]=x.useState(!1),[D,B]=x.useState(""),W=F=>{N(F),F?(j(!0),R(!0),_(!0),T(!0)):(j(!1),R(!1),_(!1),T(!1))},M=async F=>{if(F.preventDefault(),!a.trim()){p({title:"Title is required"});return}f(!0);try{await jH({title:a.trim(),description:c.trim()||null,board_id:r?.id??null,autonomy_enabled:S,auto_approve_tickets:C,auto_approve_revisions:E,auto_merge:A,auto_approve_followups:O,max_auto_approvals:D?parseInt(D,10):null}),me.success(S?"Goal created with full autonomy":"Goal created successfully"),V(),t(!1),n?.()}catch(H){const P=H instanceof Error?H.message:"Failed to create goal";me.error(P)}finally{f(!1)}},V=()=>{o(""),d(""),p({}),v(!1),N(!1),j(!1),R(!1),_(!1),T(!1),B("")},G=F=>{F||V(),t(F)};return l.jsx(Br,{open:e,onOpenChange:G,children:l.jsx(zr,{className:"sm:max-w-[480px]",children:l.jsxs("form",{onSubmit:M,children:[l.jsxs($s,{children:[l.jsx(Vs,{children:"Create New Goal"}),l.jsx(Us,{children:"Goals help organize related tickets together. Create a goal to start tracking work items."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ct,{htmlFor:"goal-title",children:"Title"}),l.jsx(Ln,{id:"goal-title",placeholder:"Enter goal title...",value:a,onChange:F=>{o(F.target.value),p(H=>{const P={...H};return delete P.title,P})},disabled:h,autoFocus:!0,className:ue(m.title&&"border-destructive")}),m.title&&l.jsx("p",{className:"text-xs text-destructive mt-1",children:m.title})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ct,{htmlFor:"goal-description",children:"Description"}),l.jsx(Mc,{id:"goal-description",placeholder:"Describe the goal... (optional)",value:c,onChange:F=>d(F.target.value),disabled:h,rows:3})]}),l.jsxs("div",{className:"border rounded-lg",children:[l.jsxs("button",{type:"button",className:"flex items-center justify-between w-full p-3 text-sm font-medium text-left hover:bg-muted/50 rounded-lg",onClick:()=>v(!y),children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(hs,{className:"h-4 w-4 text-amber-500"}),"Full Autonomy Mode"]}),y?l.jsx($r,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(Zi,{className:"h-4 w-4 text-muted-foreground"})]}),y&&l.jsxs("div",{className:"px-3 pb-3 space-y-3",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable autonomous execution. The system will decompose, execute, verify, approve, and merge changes automatically with safety rails."}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ct,{htmlFor:"autonomy-master",className:"text-sm font-medium",children:"Enable Autonomy"}),l.jsx(Pn,{id:"autonomy-master",checked:S,onCheckedChange:W,disabled:h})]}),S&&l.jsxs("div",{className:"space-y-2.5 pl-3 border-l-2 border-amber-500/30",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ct,{htmlFor:"auto-tickets",className:"text-xs",children:"Auto-approve tickets"}),l.jsx(Pn,{id:"auto-tickets",checked:C,onCheckedChange:j,disabled:h})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ct,{htmlFor:"auto-revisions",className:"text-xs",children:"Auto-approve revisions"}),l.jsx(Pn,{id:"auto-revisions",checked:E,onCheckedChange:R,disabled:h})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ct,{htmlFor:"auto-merge",className:"text-xs",children:"Auto-merge on completion"}),l.jsx(Pn,{id:"auto-merge",checked:A,onCheckedChange:_,disabled:h})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ct,{htmlFor:"auto-followups",className:"text-xs",children:"Auto-approve follow-ups"}),l.jsx(Pn,{id:"auto-followups",checked:O,onCheckedChange:T,disabled:h})]}),l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx(ct,{htmlFor:"max-approvals",className:"text-xs whitespace-nowrap",children:"Max auto-approvals"}),l.jsx(Ln,{id:"max-approvals",type:"number",min:"1",placeholder:"Unlimited",value:D,onChange:F=>B(F.target.value),disabled:h,className:"w-24 h-7 text-xs"})]})]}),S&&l.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/30 p-2 rounded",children:"Safety rails: Diffs over 500 lines, sensitive files (.env, .pem, secrets), and failed verification will still require human review."})]})]})]}),l.jsxs(rf,{children:[l.jsx(ye,{type:"button",variant:"outline",onClick:()=>G(!1),disabled:h,children:"Cancel"}),l.jsxs(ye,{type:"submit",disabled:h,children:[h&&l.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Create Goal"]})]})]})})})}const it={PROPOSED:"proposed",PLANNED:"planned",EXECUTING:"executing",VERIFYING:"verifying",NEEDS_HUMAN:"needs_human",BLOCKED:"blocked",DONE:"done",ABANDONED:"abandoned"},oc={HUMAN:"human",PLANNER:"planner",SYSTEM:"system",EXECUTOR:"executor"},hQ={TRANSITIONED:"transitioned"},ea={OPEN:"open",CHANGES_REQUESTED:"changes_requested",APPROVED:"approved",SUPERSEDED:"superseded"},mQ={MERGE:"merge",REBASE:"rebase"},Fa={QUEUED:"queued",RUNNING:"running",SUCCEEDED:"succeeded",FAILED:"failed"},hn={P0:"P0",P1:"P1",P2:"P2",P3:"P3"},Rd={[hn.P0]:90,[hn.P1]:70,[hn.P2]:50,[hn.P3]:30},pQ={[hn.P0]:"P0 - Critical",[hn.P1]:"P1 - High",[hn.P2]:"P2 - Medium",[hn.P3]:"P3 - Low"},gQ={[hn.P0]:"bg-red-500",[hn.P1]:"bg-orange-500",[hn.P2]:"bg-blue-500",[hn.P3]:"bg-slate-500"},cd=[it.PROPOSED,it.PLANNED,it.EXECUTING,it.VERIFYING,it.NEEDS_HUMAN,it.BLOCKED,it.DONE,it.ABANDONED],Rr={[it.PROPOSED]:"Proposed",[it.PLANNED]:"Planned",[it.EXECUTING]:"Executing",[it.VERIFYING]:"Verifying",[it.NEEDS_HUMAN]:"Needs Review",[it.BLOCKED]:"Blocked",[it.DONE]:"Done",[it.ABANDONED]:"Abandoned"},R0={[ea.OPEN]:"Open",[ea.CHANGES_REQUESTED]:"Changes Requested",[ea.APPROVED]:"Approved",[ea.SUPERSEDED]:"Superseded"},D0={[ea.OPEN]:"bg-blue-500",[ea.CHANGES_REQUESTED]:"bg-orange-500",[ea.APPROVED]:"bg-emerald-500",[ea.SUPERSEDED]:"bg-gray-400"};function xQ({open:e,onOpenChange:t,onSuccess:n}){const{currentBoard:r}=ys(),[a,o]=x.useState([]),[c,d]=x.useState(!1),[h,f]=x.useState(null),[m,p]=x.useState(""),[y,v]=x.useState(""),[S,N]=x.useState(""),[C,j]=x.useState(""),[E,R]=x.useState(!1),[A,_]=x.useState({});x.useEffect(()=>{e&&(d(!0),f(null),iw(r?.id).then(B=>{o(B.goals),B.goals.length===1&&p(B.goals[0].id)}).catch(B=>{f(B.message||"Failed to load goals")}).finally(()=>{d(!1)}))},[e,r?.id]);const O=async B=>{B.preventDefault();const W={};if(m||(W.goal="Please select a goal"),y.trim()||(W.title="Title is required"),Object.keys(W).length>0){_(W);return}R(!0);try{await CH({goal_id:m,title:y.trim(),description:S.trim()||null,priority:C?parseInt(C,10):null,actor_type:oc.HUMAN}),me.success("Ticket created successfully"),T(),t(!1),n?.()}catch(M){const V=M instanceof Error?M.message:"Failed to create ticket";me.error(V)}finally{R(!1)}},T=()=>{p(""),v(""),N(""),j(""),_({})},D=B=>{B||T(),t(B)};return l.jsx(Br,{open:e,onOpenChange:D,children:l.jsx(zr,{className:"sm:max-w-[500px]",children:l.jsxs("form",{onSubmit:O,children:[l.jsxs($s,{children:[l.jsx(Vs,{children:"Create New Ticket"}),l.jsx(Us,{children:"Create a ticket to track a specific task. Tickets are linked to goals and follow a workflow through different states."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ct,{htmlFor:"ticket-goal",children:"Goal"}),c?l.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground py-2",children:[l.jsx(ke,{className:"h-4 w-4 animate-spin"}),"Loading goals..."]}):h?l.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive py-2",children:[l.jsx(Hn,{className:"h-4 w-4"}),h]}):a.length===0?l.jsx("div",{className:"text-sm text-muted-foreground py-2",children:"No goals found. Please create a goal first."}):l.jsxs(ms,{value:m,onValueChange:B=>{p(B),_(W=>{const M={...W};return delete M.goal,M})},disabled:E,children:[l.jsx(gs,{id:"ticket-goal",className:ue(A.goal&&"border-destructive"),children:l.jsx(ps,{placeholder:"Select a goal..."})}),l.jsx(zs,{children:a.map(B=>l.jsx(Vt,{value:B.id,children:B.title},B.id))})]}),A.goal&&l.jsx("p",{className:"text-xs text-destructive mt-1",children:A.goal})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ct,{htmlFor:"ticket-title",children:"Title"}),l.jsx(Ln,{id:"ticket-title",placeholder:"Enter ticket title...",value:y,onChange:B=>{v(B.target.value),_(W=>{const M={...W};return delete M.title,M})},disabled:E,className:ue(A.title&&"border-destructive")}),A.title&&l.jsx("p",{className:"text-xs text-destructive mt-1",children:A.title})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ct,{htmlFor:"ticket-description",children:"Description"}),l.jsx(Mc,{id:"ticket-description",placeholder:"Describe the ticket... (optional)",value:S,onChange:B=>N(B.target.value),disabled:E,rows:3})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ct,{htmlFor:"ticket-priority",children:"Priority (0-100)"}),l.jsx(Ln,{id:"ticket-priority",type:"number",min:0,max:100,placeholder:"50 (optional)",value:C,onChange:B=>j(B.target.value),disabled:E}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Higher values = higher priority. 75+ = High, 50-74 = Medium, 25-49 = Low"})]})]}),l.jsxs(rf,{children:[l.jsx(ye,{type:"button",variant:"outline",onClick:()=>D(!1),disabled:E,children:"Cancel"}),l.jsxs(ye,{type:"submit",disabled:E||c||a.length===0,children:[E&&l.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Create Ticket"]})]})]})})})}var yQ=Symbol("radix.slottable");function vQ(e){const t=({children:n})=>l.jsx(l.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=yQ,t}var LM="AlertDialog",[bQ]=vs(LM,[eM]),qa=eM(),IM=e=>{const{__scopeAlertDialog:t,...n}=e,r=qa(t);return l.jsx(Mw,{...r,...n,modal:!0})};IM.displayName=LM;var wQ="AlertDialogTrigger",BM=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=qa(n);return l.jsx(mX,{...a,...r,ref:t})});BM.displayName=wQ;var SQ="AlertDialogPortal",zM=e=>{const{__scopeAlertDialog:t,...n}=e,r=qa(t);return l.jsx(Pw,{...r,...n})};zM.displayName=SQ;var NQ="AlertDialogOverlay",FM=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=qa(n);return l.jsx(Lw,{...a,...r,ref:t})});FM.displayName=NQ;var lc="AlertDialogContent",[jQ,CQ]=bQ(lc),EQ=vQ("AlertDialogContent"),$M=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,o=qa(n),c=x.useRef(null),d=rt(t,c),h=x.useRef(null);return l.jsx(uX,{contentName:lc,titleName:VM,docsSlug:"alert-dialog",children:l.jsx(jQ,{scope:n,cancelRef:h,children:l.jsxs(Iw,{role:"alertdialog",...o,...a,ref:d,onOpenAutoFocus:Ue(a.onOpenAutoFocus,f=>{f.preventDefault(),h.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[l.jsx(EQ,{children:r}),l.jsx(_Q,{contentRef:c})]})})})});$M.displayName=lc;var VM="AlertDialogTitle",UM=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=qa(n);return l.jsx(gM,{...a,...r,ref:t})});UM.displayName=VM;var HM="AlertDialogDescription",GM=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=qa(n);return l.jsx(xM,{...a,...r,ref:t})});GM.displayName=HM;var TQ="AlertDialogAction",qM=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=qa(n);return l.jsx(Bw,{...a,...r,ref:t})});qM.displayName=TQ;var WM="AlertDialogCancel",KM=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=CQ(WM,n),o=qa(n),c=rt(t,a);return l.jsx(Bw,{...o,...r,ref:c})});KM.displayName=WM;var _Q=({contentRef:e})=>{const t=`\`${lc}\` requires a description for the component to be accessible for screen reader users.
68
+
69
+ You can add a description to the \`${lc}\` by passing a \`${HM}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
70
+
71
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${lc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
72
+
73
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},RQ=IM,DQ=BM,kQ=zM,YM=FM,XM=$M,QM=qM,JM=KM,ZM=UM,e5=GM;const $o=RQ,AQ=DQ,OQ=kQ,t5=x.forwardRef(({className:e,...t},n)=>l.jsx(YM,{className:ue("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));t5.displayName=YM.displayName;const Di=x.forwardRef(({className:e,...t},n)=>l.jsxs(OQ,{children:[l.jsx(t5,{}),l.jsx(XM,{ref:n,className:ue("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Di.displayName=XM.displayName;const ki=({className:e,...t})=>l.jsx("div",{className:ue("flex flex-col space-y-2 text-center sm:text-left",e),...t});ki.displayName="AlertDialogHeader";const Ai=({className:e,...t})=>l.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ai.displayName="AlertDialogFooter";const Oi=x.forwardRef(({className:e,...t},n)=>l.jsx(ZM,{ref:n,className:ue("text-lg font-semibold",e),...t}));Oi.displayName=ZM.displayName;const Mi=x.forwardRef(({className:e,...t},n)=>l.jsx(e5,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));Mi.displayName=e5.displayName;const Pi=x.forwardRef(({className:e,...t},n)=>l.jsx(QM,{ref:n,className:ue(Op(),e),...t}));Pi.displayName=QM.displayName;const Li=x.forwardRef(({className:e,...t},n)=>l.jsx(JM,{ref:n,className:ue(Op({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Li.displayName=JM.displayName;var n5=["PageUp","PageDown"],r5=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],s5={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Pc="Slider",[k0,MQ,PQ]=uw(Pc),[a5]=vs(Pc,[PQ]),[LQ,Lp]=a5(Pc),i5=x.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:o=1,orientation:c="horizontal",disabled:d=!1,minStepsBetweenThumbs:h=0,defaultValue:f=[r],value:m,onValueChange:p=()=>{},onValueCommit:y=()=>{},inverted:v=!1,form:S,...N}=e,C=x.useRef(new Set),j=x.useRef(0),R=c==="horizontal"?IQ:BQ,[A=[],_]=ma({prop:m,defaultProp:f,onChange:M=>{[...C.current][j.current]?.focus(),p(M)}}),O=x.useRef(A);function T(M){const V=UQ(A,M);W(M,V)}function D(M){W(M,j.current)}function B(){const M=O.current[j.current];A[j.current]!==M&&y(A)}function W(M,V,{commit:G}={commit:!1}){const F=WQ(o),H=KQ(Math.round((M-r)/o)*o+r,F),P=Rm(H,[r,a]);_((U=[])=>{const z=$Q(U,P,V);if(qQ(z,h*o)){j.current=z.indexOf(P);const te=String(z)!==String(U);return te&&G&&y(z),te?z:U}else return U})}return l.jsx(LQ,{scope:e.__scopeSlider,name:n,disabled:d,min:r,max:a,valueIndexToChangeRef:j,thumbs:C.current,values:A,orientation:c,form:S,children:l.jsx(k0.Provider,{scope:e.__scopeSlider,children:l.jsx(k0.Slot,{scope:e.__scopeSlider,children:l.jsx(R,{"aria-disabled":d,"data-disabled":d?"":void 0,...N,ref:t,onPointerDown:Ue(N.onPointerDown,()=>{d||(O.current=A)}),min:r,max:a,inverted:v,onSlideStart:d?void 0:T,onSlideMove:d?void 0:D,onSlideEnd:d?void 0:B,onHomeKeyDown:()=>!d&&W(r,0,{commit:!0}),onEndKeyDown:()=>!d&&W(a,A.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:V})=>{if(!d){const H=n5.includes(M.key)||M.shiftKey&&r5.includes(M.key)?10:1,P=j.current,U=A[P],z=o*H*V;W(U+z,P,{commit:!0})}}})})})})});i5.displayName=Pc;var[o5,l5]=a5(Pc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),IQ=x.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:o,onSlideStart:c,onSlideMove:d,onSlideEnd:h,onStepKeyDown:f,...m}=e,[p,y]=x.useState(null),v=rt(t,R=>y(R)),S=x.useRef(void 0),N=hp(a),C=N==="ltr",j=C&&!o||!C&&o;function E(R){const A=S.current||p.getBoundingClientRect(),_=[0,A.width],T=Vw(_,j?[n,r]:[r,n]);return S.current=A,T(R-A.left)}return l.jsx(o5,{scope:e.__scopeSlider,startEdge:j?"left":"right",endEdge:j?"right":"left",direction:j?1:-1,size:"width",children:l.jsx(c5,{dir:N,"data-orientation":"horizontal",...m,ref:v,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:R=>{const A=E(R.clientX);c?.(A)},onSlideMove:R=>{const A=E(R.clientX);d?.(A)},onSlideEnd:()=>{S.current=void 0,h?.()},onStepKeyDown:R=>{const _=s5[j?"from-left":"from-right"].includes(R.key);f?.({event:R,direction:_?-1:1})}})})}),BQ=x.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:h,...f}=e,m=x.useRef(null),p=rt(t,m),y=x.useRef(void 0),v=!a;function S(N){const C=y.current||m.current.getBoundingClientRect(),j=[0,C.height],R=Vw(j,v?[r,n]:[n,r]);return y.current=C,R(N-C.top)}return l.jsx(o5,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:l.jsx(c5,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:N=>{const C=S(N.clientY);o?.(C)},onSlideMove:N=>{const C=S(N.clientY);c?.(C)},onSlideEnd:()=>{y.current=void 0,d?.()},onStepKeyDown:N=>{const j=s5[v?"from-bottom":"from-top"].includes(N.key);h?.({event:N,direction:j?-1:1})}})})}),c5=x.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:c,onEndKeyDown:d,onStepKeyDown:h,...f}=e,m=Lp(Pc,n);return l.jsx(He.span,{...f,ref:t,onKeyDown:Ue(e.onKeyDown,p=>{p.key==="Home"?(c(p),p.preventDefault()):p.key==="End"?(d(p),p.preventDefault()):n5.concat(r5).includes(p.key)&&(h(p),p.preventDefault())}),onPointerDown:Ue(e.onPointerDown,p=>{const y=p.target;y.setPointerCapture(p.pointerId),p.preventDefault(),m.thumbs.has(y)?y.focus():r(p)}),onPointerMove:Ue(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Ue(e.onPointerUp,p=>{const y=p.target;y.hasPointerCapture(p.pointerId)&&(y.releasePointerCapture(p.pointerId),o(p))})})}),u5="SliderTrack",d5=x.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Lp(u5,n);return l.jsx(He.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});d5.displayName=u5;var A0="SliderRange",f5=x.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Lp(A0,n),o=l5(A0,n),c=x.useRef(null),d=rt(t,c),h=a.values.length,f=a.values.map(y=>p5(y,a.min,a.max)),m=h>1?Math.min(...f):0,p=100-Math.max(...f);return l.jsx(He.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:d,style:{...e.style,[o.startEdge]:m+"%",[o.endEdge]:p+"%"}})});f5.displayName=A0;var O0="SliderThumb",h5=x.forwardRef((e,t)=>{const n=MQ(e.__scopeSlider),[r,a]=x.useState(null),o=rt(t,d=>a(d)),c=x.useMemo(()=>r?n().findIndex(d=>d.ref.current===r):-1,[n,r]);return l.jsx(zQ,{...e,ref:o,index:c})}),zQ=x.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...o}=e,c=Lp(O0,n),d=l5(O0,n),[h,f]=x.useState(null),m=rt(t,E=>f(E)),p=h?c.form||!!h.closest("form"):!0,y=vp(h),v=c.values[r],S=v===void 0?0:p5(v,c.min,c.max),N=VQ(r,c.values.length),C=y?.[d.size],j=C?HQ(C,S,d.direction):0;return x.useEffect(()=>{if(h)return c.thumbs.add(h),()=>{c.thumbs.delete(h)}},[h,c.thumbs]),l.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[d.startEdge]:`calc(${S}% + ${j}px)`},children:[l.jsx(k0.ItemSlot,{scope:e.__scopeSlider,children:l.jsx(He.span,{role:"slider","aria-label":e["aria-label"]||N,"aria-valuemin":c.min,"aria-valuenow":v,"aria-valuemax":c.max,"aria-orientation":c.orientation,"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,tabIndex:c.disabled?void 0:0,...o,ref:m,style:v===void 0?{display:"none"}:e.style,onFocus:Ue(e.onFocus,()=>{c.valueIndexToChangeRef.current=r})})}),p&&l.jsx(m5,{name:a??(c.name?c.name+(c.values.length>1?"[]":""):void 0),form:c.form,value:v},r)]})});h5.displayName=O0;var FQ="RadioBubbleInput",m5=x.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=x.useRef(null),o=rt(a,r),c=wp(t);return x.useEffect(()=>{const d=a.current;if(!d)return;const h=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(h,"value").set;if(c!==t&&m){const p=new Event("input",{bubbles:!0});m.call(d,t),d.dispatchEvent(p)}},[c,t]),l.jsx(He.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});m5.displayName=FQ;function $Q(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,o)=>a-o)}function p5(e,t,n){const o=100/(n-t)*(e-t);return Rm(o,[0,100])}function VQ(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function UQ(e,t){if(e.length===1)return 0;const n=e.map(a=>Math.abs(a-t)),r=Math.min(...n);return n.indexOf(r)}function HQ(e,t,n){const r=e/2,o=Vw([0,50],[0,r]);return(r-o(t)*n)*n}function GQ(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function qQ(e,t){if(t>0){const n=GQ(e);return Math.min(...n)>=t}return!0}function Vw(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function WQ(e){return(String(e).split(".")[1]||"").length}function KQ(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var g5=i5,YQ=d5,XQ=f5,QQ=h5;const Uw=x.forwardRef(({className:e,...t},n)=>l.jsxs(g5,{ref:n,className:ue("relative flex w-full touch-none select-none items-center",e),...t,children:[l.jsx(YQ,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:l.jsx(XQ,{className:"absolute h-full bg-primary"})}),l.jsx(QQ,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Uw.displayName=g5.displayName;const JQ=zw("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),M0=x.forwardRef(({className:e,variant:t,...n},r)=>l.jsx("div",{ref:r,role:"alert",className:ue(JQ({variant:t}),e),...n}));M0.displayName="Alert";const ZQ=x.forwardRef(({className:e,...t},n)=>l.jsx("h5",{ref:n,className:ue("mb-1 font-medium leading-none tracking-tight",e),...t}));ZQ.displayName="AlertTitle";const P0=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ue("text-sm [&_p]:leading-relaxed",e),...t}));P0.displayName="AlertDescription";const eJ=[{id:"cursor-agent",name:"Cursor Agent (Headless)"},{id:"claude",name:"Claude Code CLI (Headless)"},{id:"cursor",name:"Cursor IDE (Interactive)"}];function tJ({open:e,onOpenChange:t,boardId:n,onTicketsDeleted:r,onBoardDeleted:a}){const o=Sc(),[c,d]=x.useState(!1),[h,f]=x.useState(!1),[m,p]=x.useState(!1),[y,v]=x.useState(!1),[S,N]=x.useState(!1),[C,j]=x.useState(!1),[E,R]=x.useState(!1),[A,_]=x.useState(!1),[O,T]=x.useState(!1),[D,B]=x.useState(""),[W,M]=x.useState("auto"),[V,G]=x.useState(300),[F,H]=x.useState("cursor-agent"),[P,U]=x.useState([]);x.useEffect(()=>{F&&(async()=>{j(!0);try{const q=await dH(F);U(q),W&&W!=="auto"&&(q.some(ne=>ne.id===W)||M("auto"))}catch(q){const ce=q instanceof Error?q.message:"Failed to load models";me.error(ce),U([])}finally{j(!1)}})()},[F]),x.useEffect(()=>{e&&z()},[e,n]);const z=async()=>{d(!0);try{const Q=await aA(n);if(N(Q.has_overrides),Q.config?.execute_config){const q=Q.config.execute_config;q.executor_model!==void 0&&M(q.executor_model),q.timeout!==void 0&&G(q.timeout),q.preferred_executor!==void 0&&H(q.preferred_executor)}}catch(Q){const q=Q instanceof Error?Q.message:"Failed to load board config";me.error(q)}finally{d(!1)}},te=async()=>{f(!0);try{await iA(n,{execute_config:{executor_model:W,timeout:V,preferred_executor:F}}),me.success("Board settings saved"),t(!1)}catch(Q){const q=Q instanceof Error?Q.message:"Failed to save settings";me.error(q)}finally{f(!1)}},oe=async()=>{f(!0);try{await uH(n),me.success("Board settings reset to defaults"),M("auto"),G(300),H("cursor-agent"),N(!1),t(!1)}catch(Q){const q=Q instanceof Error?Q.message:"Failed to reset settings";me.error(q)}finally{f(!1),R(!1)}},L=()=>{t(!1)},$=async()=>{if(D!=="DELETE"){me.error("You must type 'DELETE' exactly to confirm");return}p(!0);try{const Q=await mH(n);me.success(Q.message),r?.(),t(!1)}catch(Q){const q=Q instanceof Error?Q.message:"Failed to delete tickets";me.error(q)}finally{p(!1),_(!1),B("")}},X=async()=>{v(!0);try{await hH(n),me.success("Board deleted successfully"),t(!1),a?.()}catch(Q){const q=Q instanceof Error?Q.message:"Failed to delete board";me.error(q)}finally{v(!1),T(!1)}};return c?l.jsx(Br,{open:e,onOpenChange:t,children:l.jsx(zr,{className:"sm:max-w-[550px]",children:l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(ke,{className:"h-8 w-8 animate-spin text-muted-foreground"})})})}):l.jsxs(l.Fragment,{children:[l.jsx(Br,{open:e,onOpenChange:t,children:l.jsxs(zr,{className:"sm:max-w-[550px]",children:[l.jsxs($s,{children:[l.jsx(Vs,{children:"Board Settings"}),l.jsx(Us,{children:"Configure execution settings for this board."})]}),l.jsxs("div",{className:"space-y-6 py-4",children:[S&&l.jsxs(M0,{children:[l.jsx(Bs,{className:"h-4 w-4"}),l.jsx(P0,{children:"This board has custom execution settings configured."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ct,{htmlFor:"model",children:"Execution Model"}),l.jsxs(ms,{value:W||"auto",onValueChange:Q=>M(Q),disabled:C,children:[l.jsx(gs,{id:"model",disabled:C,children:C?l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(ke,{className:"h-3 w-3 animate-spin"}),"Loading models..."]}):l.jsx(ps,{placeholder:"Select model"})}),l.jsx(zs,{children:P.map(Q=>l.jsx(Vt,{value:Q.id,children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{children:Q.name}),l.jsx("span",{className:"text-xs text-muted-foreground",children:Q.description})]})},Q.id))})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Default: Auto (intelligent model selection)"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ct,{htmlFor:"timeout",children:"Execution Timeout"}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:[V,"s"]})]}),l.jsx(Uw,{id:"timeout",min:60,max:900,step:30,value:[V],onValueChange:Q=>G(Q[0]),className:"w-full"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Maximum time for executor CLI to run (60-900 seconds)"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ct,{htmlFor:"executor",children:"Preferred Executor"}),l.jsxs(ms,{value:F,onValueChange:H,children:[l.jsx(gs,{id:"executor",children:l.jsx(ps,{})}),l.jsx(zs,{children:eJ.map(Q=>l.jsx(Vt,{value:Q.id,children:Q.name},Q.id))})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Which CLI tool to use for code execution. Each executor supports different model options."})]}),l.jsxs(M0,{children:[l.jsx(Bs,{className:"h-4 w-4"}),l.jsxs(P0,{className:"text-xs",children:["Additional settings (YOLO mode, verify commands, planner, etc.) can be configured in the"," ",l.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 underline underline-offset-2 hover:text-foreground transition-colors",onClick:()=>{t(!1),o("/settings?tab=executors")},children:["Settings page",l.jsx(Dp,{className:"h-3 w-3"})]})]})]}),l.jsx("div",{className:"border-t pt-6 mt-6",children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Hn,{className:"h-5 w-5 text-red-600 mt-0.5"}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-red-600",children:"Danger Zone"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Destructive actions that cannot be undone"})]})]}),l.jsx(ye,{type:"button",variant:"destructive",onClick:()=>_(!0),disabled:m||y||h,className:"w-full gap-2",children:m?l.jsxs(l.Fragment,{children:[l.jsx(ke,{className:"h-4 w-4 animate-spin"}),"Deleting..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Gi,{className:"h-4 w-4"}),"Delete All Tickets"]})}),l.jsx(ye,{type:"button",variant:"destructive",onClick:()=>T(!0),disabled:m||y||h,className:"w-full gap-2",children:y?l.jsxs(l.Fragment,{children:[l.jsx(ke,{className:"h-4 w-4 animate-spin"}),"Deleting Board..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Gi,{className:"h-4 w-4"}),"Delete Board"]})})]})})]}),l.jsxs(rf,{className:"flex items-center justify-between sm:justify-between",children:[l.jsxs(ye,{type:"button",variant:"outline",onClick:()=>R(!0),disabled:!S||h,className:"gap-2",children:[l.jsx(MO,{className:"h-4 w-4"}),"Reset to Defaults"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(ye,{type:"button",variant:"outline",onClick:L,disabled:h,children:"Cancel"}),l.jsx(ye,{type:"button",onClick:te,disabled:h,children:h?l.jsxs(l.Fragment,{children:[l.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save"})]})]})]})}),l.jsx($o,{open:E,onOpenChange:R,children:l.jsxs(Di,{children:[l.jsxs(ki,{children:[l.jsx(Oi,{children:"Reset Board Settings?"}),l.jsx(Mi,{children:"This will reset all board settings to defaults."})]}),l.jsxs(Ai,{children:[l.jsx(Li,{children:"Cancel"}),l.jsx(Pi,{onClick:oe,children:"Reset"})]})]})}),l.jsx($o,{open:A,onOpenChange:Q=>{_(Q),Q||B("")},children:l.jsxs(Di,{children:[l.jsxs(ki,{children:[l.jsx(Oi,{children:"Delete All Tickets?"}),l.jsx(Mi,{children:"This will permanently delete all tickets, jobs, revisions, workspaces, and evidence files. This action cannot be undone."})]}),l.jsxs("div",{className:"py-2",children:[l.jsx(ct,{htmlFor:"delete-confirm",children:"Type DELETE to confirm:"}),l.jsx(Ln,{id:"delete-confirm",value:D,onChange:Q=>B(Q.target.value),placeholder:"DELETE",className:"mt-2"})]}),l.jsxs(Ai,{children:[l.jsx(Li,{children:"Cancel"}),l.jsx(Pi,{onClick:$,disabled:D!=="DELETE",className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete All"})]})]})}),l.jsx($o,{open:O,onOpenChange:T,children:l.jsxs(Di,{children:[l.jsxs(ki,{children:[l.jsx(Oi,{children:"Delete Board?"}),l.jsx(Mi,{children:"This will delete the board and all its tickets. This action cannot be undone."})]}),l.jsxs(Ai,{children:[l.jsx(Li,{children:"Cancel"}),l.jsx(Pi,{onClick:X,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Board"})]})]})})]})}function nJ({tickets:e,goalId:t,onClose:n,onAccepted:r}){const[a,o]=x.useState(()=>{const _={};return e.forEach((O,T)=>{_[T]=!0}),_}),[c,d]=x.useState({}),[h,f]=x.useState(!1),[m,p]=x.useState(!1),y=_=>{o(O=>({...O,[_]:!O[_]}))},v=_=>{d(O=>({...O,[_]:!O[_]}))},S=()=>{const _={};e.forEach((O,T)=>{_[T]=!0}),o(_)},N=()=>{o({})},C=Object.values(a).filter(Boolean).length,j=()=>Object.entries(a).filter(([_,O])=>O).map(([_])=>e[parseInt(_)].id),E=async _=>{const O=j();if(O.length===0){me.error("No tickets selected");return}_?p(!0):f(!0);try{const T=await AH({ticket_ids:O,goal_id:t,actor_type:oc.HUMAN,reason:"Accepted from AI-generated proposal",queue_first:_});if(T.accepted_count>0){let D=`Accepted ${T.accepted_count} ticket${T.accepted_count>1?"s":""}.`;if(T.queued_job_id&&T.queued_ticket_id){const W=e.find(M=>M.id===T.queued_ticket_id)?.title||T.queued_ticket_id;D+=` Queued: "${W}"`}me.success(D)}if(T.failed_count>0){const D=T.rejected.map(B=>B.error).filter(Boolean).join(", ");me.error(`Failed to accept ${T.failed_count} ticket${T.failed_count>1?"s":""}: ${D}`)}T.accepted_count>0&&r()}catch(T){const D=T instanceof Error?T.message:"Failed to accept tickets";me.error(D)}finally{f(!1),p(!1)}},R=()=>E(!1),A=()=>E(!0);return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:[l.jsx(_d,{className:"h-4 w-4 text-primary"}),"AI-Suggested Tickets (",e.length,")"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(ye,{variant:"ghost",size:"sm",onClick:S,className:"text-xs h-7",children:"Select All"}),l.jsx(ye,{variant:"ghost",size:"sm",onClick:N,className:"text-xs h-7",children:"Deselect All"})]})]}),l.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto pr-1",children:e.map((_,O)=>l.jsxs("div",{className:ue("border rounded-lg transition-colors",a[O]?"border-primary/50 bg-primary/5":"border-border bg-background"),children:[l.jsxs("div",{className:"flex items-start gap-3 p-3 cursor-pointer",onClick:()=>y(O),children:[l.jsx("div",{className:ue("mt-0.5 h-5 w-5 rounded border flex items-center justify-center flex-shrink-0 transition-colors",a[O]?"bg-primary border-primary text-primary-foreground":"border-muted-foreground/30"),children:a[O]&&l.jsx(qt,{className:"h-3.5 w-3.5"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("h4",{className:"text-sm font-medium leading-snug",children:_.title}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:_.description})]}),l.jsx(ye,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 flex-shrink-0",onClick:T=>{T.stopPropagation(),v(O)},children:c[O]?l.jsx($r,{className:"h-4 w-4"}):l.jsx(Zi,{className:"h-4 w-4"})})]}),c[O]&&l.jsxs("div",{className:"px-3 pb-3 pt-0 space-y-3 border-t mx-3 mt-1",children:[l.jsxs("div",{className:"pt-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground mb-1.5",children:[l.jsx(_w,{className:"h-3.5 w-3.5"}),"Description"]}),l.jsx("p",{className:"text-xs leading-relaxed whitespace-pre-wrap",children:_.description})]}),_.verification.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground mb-1.5",children:[l.jsx(la,{className:"h-3.5 w-3.5"}),"Verification Commands"]}),l.jsx("div",{className:"space-y-1",children:_.verification.map((T,D)=>l.jsx("code",{className:"block text-xs bg-muted px-2 py-1.5 rounded font-mono",children:T},D))})]}),_.notes&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Notes"}),l.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:_.notes})]})]})]},_.id))}),l.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[l.jsxs("div",{className:"text-xs text-muted-foreground",children:[C," of ",e.length," selected"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(ye,{variant:"outline",size:"sm",onClick:n,disabled:h||m,children:[l.jsx(On,{className:"mr-1.5 h-3.5 w-3.5"}),"Cancel"]}),l.jsx(ye,{variant:"outline",size:"sm",onClick:R,disabled:h||m||C===0,children:h?l.jsxs(l.Fragment,{children:[l.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Accepting..."]}):l.jsxs(l.Fragment,{children:[l.jsx(aa,{className:"mr-1.5 h-3.5 w-3.5"}),"Accept (",C,")"]})}),l.jsx(ye,{size:"sm",onClick:A,disabled:h||m||C===0,title:"Accept tickets and immediately queue the first one for execution",children:m?l.jsxs(l.Fragment,{children:[l.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Queueing..."]}):l.jsxs(l.Fragment,{children:[l.jsx(ia,{className:"mr-1.5 h-3.5 w-3.5"}),"Accept & Queue"]})})]})]})]})}const rJ={good:{icon:aa,color:"text-emerald-500",label:"Good Quality"},needs_work:{icon:eo,color:"text-amber-500",label:"Needs Work"},insufficient:{icon:Is,color:"text-red-500",label:"Insufficient"}};function wT({bucket:e}){return l.jsx("span",{className:ue("inline-flex items-center px-2 py-0.5 rounded text-xs font-medium text-white",gQ[e]),children:e})}function sJ(e,t){const n=e.filter(c=>t[c.ticket_id]);let r=0,a=0,o=0;for(const c of n){const d=Rd[c.current_bucket],h=Rd[c.suggested_bucket];h>d?r++:h<d&&a++,c.suggested_bucket==="P0"&&c.current_bucket!=="P0"&&o++}return{total:n.length,up:r,down:a,toP0:o}}function aJ({open:e,onOpenChange:t,goalId:n,goalTitle:r,onPrioritiesUpdated:a}){const[o,c]=x.useState(!1),[d,h]=x.useState(!1),[f,m]=x.useState(null),[p,y]=x.useState({}),[v,S]=x.useState({}),N=x.useMemo(()=>f?sJ(f.suggested_changes,p):{total:0,up:0,down:0,toP0:0},[f,p]),C=async()=>{c(!0),m(null);try{const _=await OH(n);m(_);const O={},T={};_.suggested_changes.forEach(D=>{O[D.ticket_id]=!0,T[D.ticket_id]=!0}),y(O),S(T)}catch(_){const O=_ instanceof Error?_.message:"Reflection failed";me.error(O)}finally{c(!1)}},j=async()=>{if(!f)return;const _=f.suggested_changes.filter(D=>p[D.ticket_id]);if(_.length===0){me.error("No changes selected");return}if(!_.some(D=>v[D.ticket_id])&&_.length>0){me.error("Please review the rationale for at least one change before applying");return}const T=_.some(D=>D.suggested_bucket==="P0"&&D.current_bucket!=="P0");h(!0);try{const D=await MH({goal_id:n,updates:_.map(B=>({ticket_id:B.ticket_id,priority_bucket:B.suggested_bucket})),allow_p0:T});D.updated_count>0&&(me.success(`Updated ${D.updated_count} ticket${D.updated_count>1?"s":""}`),a(),t(!1)),D.failed_count>0&&me.error(`Failed to update ${D.failed_count} tickets`)}catch(D){const B=D instanceof Error?D.message:"Update failed";me.error(B)}finally{h(!1)}},E=_=>{y(O=>({...O,[_]:!O[_]}))},R=(_,O)=>{O.stopPropagation(),S(T=>({...T,[_]:!T[_]}))},A=Object.values(p).filter(Boolean).length;return l.jsx(Br,{open:e,onOpenChange:t,children:l.jsxs(zr,{className:"max-w-2xl max-h-[85vh] overflow-hidden flex flex-col",children:[l.jsxs($s,{children:[l.jsxs(Vs,{className:"flex items-center gap-2",children:[l.jsx(_d,{className:"h-5 w-5 text-primary"}),"AI Reflection"]}),l.jsxs(Us,{children:['Analyze proposed tickets for "',r,'"']})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto space-y-4 pr-1",children:[!o&&!f&&l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx(kO,{className:"h-12 w-12 text-muted-foreground mb-4"}),l.jsx("p",{className:"text-muted-foreground mb-4",children:"Run AI reflection to evaluate ticket quality, identify coverage gaps, and get priority suggestions."}),l.jsxs(ye,{onClick:C,children:[l.jsx(_d,{className:"mr-2 h-4 w-4"}),"Run Reflection"]})]}),o&&l.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[l.jsx(ke,{className:"h-8 w-8 animate-spin text-primary mb-4"}),l.jsx("p",{className:"text-muted-foreground",children:"Analyzing tickets..."})]}),f&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"rounded-lg border p-4",children:[l.jsx("div",{className:"flex items-center gap-2 mb-2",children:(()=>{const _=rJ[f.overall_quality],O=_.icon;return l.jsxs(l.Fragment,{children:[l.jsx(O,{className:ue("h-5 w-5",_.color)}),l.jsx("span",{className:"font-medium",children:_.label})]})})()}),l.jsx("p",{className:"text-sm text-muted-foreground",children:f.quality_notes})]}),f.coverage_gaps.length>0&&l.jsxs("div",{className:"rounded-lg border p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Bs,{className:"h-5 w-5 text-blue-500"}),l.jsx("span",{className:"font-medium",children:"Coverage Gaps"})]}),l.jsx("ul",{className:"space-y-1",children:f.coverage_gaps.map((_,O)=>l.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[l.jsx("span",{className:"text-muted-foreground/50",children:"•"}),_]},O))})]}),f.suggested_changes.length>0&&N.total>0&&l.jsxs("div",{className:ue("rounded-lg border p-3 flex items-center gap-3",N.toP0>0?"border-red-500/50 bg-red-500/5":"border-amber-500/50 bg-amber-500/5"),children:[l.jsx(hs,{className:ue("h-5 w-5 flex-shrink-0",N.toP0>0?"text-red-500":"text-amber-500")}),l.jsxs("div",{className:"text-sm",children:[l.jsxs("span",{className:"font-medium",children:["You are changing ",N.total," ticket",N.total!==1?"s":"",":"]})," ",l.jsxs("span",{className:"text-muted-foreground",children:[N.up>0&&l.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[l.jsx(Ew,{className:"h-3 w-3 text-red-500"}),N.up," up"]}),N.up>0&&N.down>0&&", ",N.down>0&&l.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[l.jsx(Cw,{className:"h-3 w-3 text-emerald-500"}),N.down," down"]}),N.toP0>0&&l.jsxs("span",{className:"ml-1 text-red-600 font-medium",children:["(",N.toP0," moved into P0!)"]})]})]})]}),f.suggested_changes.length>0&&l.jsxs("div",{className:"rounded-lg border p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Tp,{className:"h-5 w-5 text-primary"}),l.jsx("span",{className:"font-medium",children:"Suggested Priority Changes"})]}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:[A," of ",f.suggested_changes.length," ","selected"]})]}),l.jsx("div",{className:"space-y-2",children:f.suggested_changes.map(_=>l.jsx(iJ,{change:_,selected:p[_.ticket_id]??!1,expanded:v[_.ticket_id]??!1,onToggle:()=>E(_.ticket_id),onToggleReason:O=>R(_.ticket_id,O)},_.ticket_id))})]}),f.suggested_changes.length===0&&l.jsxs("div",{className:"text-center py-4 text-muted-foreground",children:[l.jsx(aa,{className:"h-8 w-8 mx-auto mb-2 text-emerald-500"}),"No priority changes suggested"]})]})]}),f&&l.jsxs("div",{className:"flex items-center justify-between pt-4 border-t",children:[l.jsx(ye,{variant:"ghost",size:"sm",onClick:C,disabled:o,children:"Re-run Reflection"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(ye,{variant:"outline",onClick:()=>t(!1),disabled:d,children:[l.jsx(On,{className:"mr-1.5 h-3.5 w-3.5"}),"Cancel"]}),f.suggested_changes.length>0&&l.jsx(ye,{onClick:j,disabled:d||A===0,className:ue(N.toP0>0&&"bg-red-600 hover:bg-red-700"),children:d?l.jsxs(l.Fragment,{children:[l.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Applying..."]}):l.jsxs(l.Fragment,{children:[l.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"}),"Apply Selected (",A,")"]})})]})]})]})})}function iJ({change:e,selected:t,expanded:n,onToggle:r,onToggleReason:a}){const o=Rd[e.suggested_bucket]>Rd[e.current_bucket],c=e.suggested_bucket==="P0"&&e.current_bucket!=="P0";return l.jsxs("div",{className:ue("rounded-lg border cursor-pointer transition-colors",t?c?"border-red-500/50 bg-red-500/5":"border-primary/50 bg-primary/5":"border-border hover:bg-muted/50"),children:[l.jsxs("div",{className:"flex items-center gap-3 p-3",onClick:r,children:[l.jsx("div",{className:ue("h-5 w-5 rounded border flex items-center justify-center flex-shrink-0 transition-colors",t?c?"bg-red-600 border-red-600 text-white":"bg-primary border-primary text-primary-foreground":"border-muted-foreground/30"),children:t&&l.jsx(qt,{className:"h-3.5 w-3.5"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"text-sm font-medium truncate",children:e.ticket_title}),o&&l.jsx(Ew,{className:"h-3.5 w-3.5 text-red-500 flex-shrink-0"}),!o&&l.jsx(Cw,{className:"h-3.5 w-3.5 text-emerald-500 flex-shrink-0"})]}),l.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[l.jsx(wT,{bucket:e.current_bucket}),l.jsx(Tp,{className:"h-3 w-3 text-muted-foreground"}),l.jsx(wT,{bucket:e.suggested_bucket})]})]}),l.jsxs(ye,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:a,children:[n?"Hide":"Show"," reason"]})]}),n&&l.jsx("div",{className:"px-3 pb-3 pt-0",children:l.jsxs("div",{className:"ml-8 p-2 rounded bg-muted/50 text-xs text-muted-foreground",children:[l.jsx("span",{className:"font-medium text-foreground",children:"Rationale: "}),e.reason]})})]})}const oJ={thinking:tf,assistant_message:el,system_message:kr,tool_use:Fo,error_message:Hn},lJ={read_file:Fo,write_file:Fo,edit_file:Fo,list_dir:$W,search:kp,shell:LK},cJ={thinking:"Thinking",assistant_message:"Response",system_message:"System",tool_use:"Tool",error_message:"Error"};function uJ({entry:e}){const[t,n]=x.useState(!1),a=e.content.split(`
74
+ `)[0]?.slice(0,120)||"...";return l.jsxs("div",{className:"py-1.5 px-2.5 rounded border-l-2 border-l-violet-300 bg-violet-50/50",children:[l.jsxs("button",{className:"flex items-start gap-2 w-full text-left",onClick:()=>n(!t),children:[l.jsx(tf,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0 text-violet-400"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"text-[10px] font-medium text-violet-500 uppercase tracking-wider",children:"Thinking"}),t?l.jsx($r,{className:"h-3 w-3 text-violet-400"}):l.jsx(Zi,{className:"h-3 w-3 text-violet-400"})]}),!t&&l.jsx("p",{className:"text-xs text-violet-600/70 italic truncate mt-0.5",children:a})]})]}),t&&l.jsx("div",{className:"mt-1.5 ml-5.5 text-xs text-violet-700/80 italic whitespace-pre-wrap leading-relaxed max-h-[200px] overflow-y-auto",children:e.content})]})}function dJ({entry:e}){const t=e.action_type&&lJ[e.action_type]||Fo,n=e.tool_status==="completed";return l.jsx("div",{className:"py-1.5 px-2.5 rounded border-l-2 border-l-gray-300 bg-gray-50/50",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(t,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0 text-gray-400"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"text-[10px] font-medium text-gray-500 uppercase tracking-wider",children:e.tool_name||"Tool"}),n&&l.jsx(qt,{className:"h-3 w-3 text-green-500"})]}),l.jsx("p",{className:"text-xs text-gray-600 font-mono whitespace-pre-wrap break-words mt-0.5",children:e.content})]})]})})}function fJ({entry:e,isStreaming:t}){const[n,r]=x.useState(!1),a=e.content.length,o=a>200,c=e.content.slice(0,120).split(`
75
+ `)[0]||"...";return l.jsx("div",{className:"py-1.5 px-2.5 rounded border-l-2 border-l-emerald-400 bg-emerald-50/30",children:l.jsxs("button",{className:"flex items-start gap-2 w-full text-left",onClick:()=>r(!n),children:[l.jsx(el,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0 text-emerald-500"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"text-[10px] font-medium text-emerald-600 uppercase tracking-wider",children:"Agent Response"}),t&&l.jsx("span",{className:"inline-block w-1.5 h-3 bg-emerald-500 animate-pulse rounded-sm"}),o&&l.jsx(l.Fragment,{children:n?l.jsx($r,{className:"h-3 w-3 text-emerald-400"}):l.jsx(Zi,{className:"h-3 w-3 text-emerald-400"})}),l.jsx("span",{className:"text-[10px] text-emerald-400/70 ml-auto",children:a>0&&`${a} chars`})]}),!o||n?l.jsx("pre",{className:"text-xs text-gray-700 whitespace-pre-wrap break-words mt-0.5 leading-relaxed font-mono max-h-[300px] overflow-y-auto",children:e.content}):l.jsx("p",{className:"text-xs text-emerald-600/70 truncate mt-0.5 font-mono",children:c})]})]})})}function hJ({entry:e}){const t=oJ[e.entry_type]||kr,n=cJ[e.entry_type]||"System",r=e.entry_type==="error_message";return l.jsx("div",{className:ue("py-1.5 px-2.5 rounded border-l-2",r?"border-l-red-400 bg-red-50/50":"border-l-gray-300 bg-gray-50/30"),children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(t,{className:ue("h-3.5 w-3.5 mt-0.5 flex-shrink-0",r?"text-red-400":"text-gray-400")}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("span",{className:ue("text-[10px] font-medium uppercase tracking-wider",r?"text-red-500":"text-gray-500"),children:n}),l.jsx("p",{className:ue("text-xs whitespace-pre-wrap break-words mt-0.5",r?"text-red-600":"text-gray-600"),children:e.content})]})]})})}function mJ({entry:e,isStreaming:t}){switch(e.entry_type){case"thinking":return l.jsx(uJ,{entry:e});case"tool_use":return l.jsx(dJ,{entry:e});case"assistant_message":return l.jsx(fJ,{entry:e,isStreaming:t});default:return l.jsx(hJ,{entry:e})}}const ST={0:{label:"P0",color:"text-red-700",bg:"bg-red-100",border:"border-red-200"},1:{label:"P1",color:"text-orange-700",bg:"bg-orange-100",border:"border-orange-200"},2:{label:"P2",color:"text-blue-700",bg:"bg-blue-100",border:"border-blue-200"},3:{label:"P3",color:"text-gray-600",bg:"bg-gray-100",border:"border-gray-200"}};function pJ({priority:e}){const t=ST[e]||ST[2];return l.jsx("span",{className:ue("inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold border",t.bg,t.color,t.border),children:t.label})}function gJ({ticket:e}){return l.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-3 space-y-1.5",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(pJ,{priority:e.priority}),l.jsx("h4",{className:"text-sm font-medium text-gray-900 leading-tight flex-1",children:e.title})]}),e.description&&l.jsx("p",{className:"text-xs text-gray-500 leading-relaxed pl-0.5",children:e.description}),e.blocked_by_title&&l.jsxs("div",{className:"flex items-center gap-1.5 pl-0.5",children:[l.jsx(eK,{className:"h-3 w-3 text-amber-500 flex-shrink-0"}),l.jsxs("span",{className:"text-[11px] text-amber-600",children:["Blocked by: ",e.blocked_by_title]})]})]})}function xJ({open:e,onOpenChange:t,goalId:n,onComplete:r,onShowTickets:a}){const[o,c]=x.useState(new Map),[d,h]=x.useState([]),[f,m]=x.useState([]),[p,y]=x.useState([]),[v,S]=x.useState(!1),[N,C]=x.useState(!1),[j,E]=x.useState(null),[R,A]=x.useState(0),[_,O]=x.useState(!1),T=x.useRef(null),D=x.useRef(null),B=x.useRef(r),W=x.useRef(t),M=x.useRef(a);x.useEffect(()=>{B.current=r},[r]),x.useEffect(()=>{W.current=t},[t]),x.useEffect(()=>{M.current=a},[a]),x.useEffect(()=>{D.current&&!_&&(D.current.scrollTop=D.current.scrollHeight)},[o,d,f,p,_]),x.useEffect(()=>{if(v&&R>0&&p.length>0){const H=setTimeout(()=>O(!0),600);return()=>clearTimeout(H)}},[v,R,p.length]),x.useEffect(()=>{if(!e)return;c(new Map),h([]),m([]),y([]),S(!1),C(!1),E(null),A(0),O(!1);const P=new EventSource(`${Qd.backendBaseUrl}/goals/${n}/generate-tickets/stream`);return P.onmessage=U=>{let z;try{z=JSON.parse(U.data)}catch{console.warn("SSE: ignoring non-JSON frame",U.data);return}switch(z.type){case"agent_normalized":z.entry&&c(te=>{const oe=new Map(te);return oe.set(z.entry.sequence,z.entry),oe});break;case"agent_output":z.message&&h(te=>[...te,z.message]);break;case"ticket":z.ticket&&y(te=>[...te,z.ticket]);break;case"complete":S(!0),A(z.count||0),P.close(),B.current();break;case"error":C(!0),E(z.message||"An error occurred"),P.close();break;case"status":z.message&&m(te=>[...te,z.message]);break}},P.onerror=U=>{console.error("SSE error:",U),P.close(),S(z=>(z||C(te=>(te||E("Connection lost. Please try again."),!0)),z))},()=>{P.close(),T.current&&(clearTimeout(T.current),T.current=null)}},[e,n]);const V=Array.from(o.values()).sort((H,P)=>H.sequence-P.sequence),G=V.length>0,F=G||d.length>0||f.length>0;return l.jsx(Br,{open:e,onOpenChange:t,children:l.jsxs(zr,{className:"sm:max-w-[680px] max-h-[85vh] flex flex-col",onInteractOutside:H=>{!v&&!N&&H.preventDefault()},onEscapeKeyDown:H=>{!v&&!N&&H.preventDefault()},children:[l.jsxs($s,{className:"flex-shrink-0",children:[l.jsxs(Vs,{className:"flex items-center gap-2",children:[!v&&!N&&l.jsxs("span",{className:"relative flex h-2.5 w-2.5",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-500 opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-blue-500"})]}),v&&!_&&l.jsx(As,{className:"h-5 w-5 text-green-600"}),N&&l.jsx(Is,{className:"h-5 w-5 text-red-600"}),_?`✅ ${R} Ticket${R!==1?"s":""} Generated`:v?"Tickets Generated":N?"Generation Failed":"Agent Generating Tickets"]}),l.jsx(Us,{children:_?"Ready for your review":v?`Created ${R} ticket(s) successfully`:N?j:"Watching the AI agent analyze your codebase and plan tickets..."})]}),_?l.jsxs("div",{className:"flex-1 min-h-0 max-h-[500px] overflow-y-auto py-2",children:[(()=>{const H=p.filter(z=>z.priority<=1).length,P=p.filter(z=>z.blocked_by_title).length,U=[];return H>0&&U.push(`${H} high priority`),P>0&&U.push(`${P} with dependencies`),U.length===0?null:l.jsx("div",{className:"mb-3 px-1",children:l.jsx("p",{className:"text-xs text-gray-500",children:U.join(" · ")})})})(),l.jsx("div",{className:"space-y-2 px-1",children:p.map(H=>l.jsx(gJ,{ticket:H},H.id))})]}):l.jsxs("div",{ref:D,className:"flex-1 min-h-0 max-h-[500px] overflow-y-auto space-y-1.5 py-2",children:[f.map((H,P)=>{const z=P===f.length-1&&!v&&!N&&!G;return l.jsx("div",{className:"py-1.5 px-2.5 rounded border-l-2 border-l-blue-300 bg-blue-50/30",children:l.jsxs("div",{className:"flex items-center gap-2",children:[z?l.jsx(ke,{className:"h-3 w-3 animate-spin text-blue-400 flex-shrink-0"}):l.jsx(qt,{className:"h-3 w-3 text-blue-400 flex-shrink-0"}),l.jsx("p",{className:"text-xs text-blue-600",children:H})]})},`status-${P}`)}),G&&V.map((H,P)=>l.jsx(mJ,{entry:H,isStreaming:!v&&!N&&P===V.length-1},H.sequence)),!G&&d.length>0&&d.map((H,P)=>l.jsx("div",{className:"py-1 px-2.5 text-xs font-mono text-gray-600 whitespace-pre-wrap break-words",children:H},P)),p.map(H=>l.jsx("div",{className:"py-1.5 px-2.5 rounded border-l-2 border-l-green-400 bg-green-50/50",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(As,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0 text-green-500"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"text-[10px] font-medium text-green-600 uppercase tracking-wider",children:"Created"}),l.jsxs("span",{className:"text-[10px] text-green-500/70",children:["P",H.priority]})]}),l.jsx("p",{className:"text-xs text-gray-700 font-medium mt-0.5",children:H.title})]})]})},H.id)),v&&l.jsx("div",{className:"py-2 px-2.5 rounded border-l-2 border-l-green-500 bg-green-50/70",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(As,{className:"h-4 w-4 text-green-600"}),l.jsxs("p",{className:"text-sm font-medium text-green-700",children:["Generation complete — ",R," ","ticket(s) created"]})]})}),N&&l.jsx("div",{className:"py-2 px-2.5 rounded border-l-2 border-l-red-400 bg-red-50/70",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Is,{className:"h-4 w-4 mt-0.5 text-red-500"}),l.jsx("p",{className:"text-sm text-red-700",children:j})]})}),!F&&!v&&!N&&l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground gap-3",children:[l.jsx(ke,{className:"h-6 w-6 animate-spin text-blue-500"}),l.jsx("span",{className:"text-sm text-gray-500",children:"Starting agent..."})]})]}),(v||N)&&l.jsx(rf,{className:"flex-shrink-0 pt-2",children:_&&a?l.jsxs(ye,{onClick:()=>M.current?.(),className:"gap-2",children:["Approve & View Board",l.jsx(Tp,{className:"h-4 w-4"})]}):v&&R>0&&a?l.jsxs(ye,{onClick:()=>M.current?.(),className:"gap-2",children:[l.jsx(As,{className:"h-4 w-4"}),"Show me tickets"]}):l.jsx(ye,{variant:"outline",onClick:()=>W.current(!1),children:"Close"})})]})})}function yJ(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function vJ({goalId:e,open:t,onOpenChange:n,onTicketsAccepted:r,onGoalDeleted:a}){const[o,c]=x.useState(null),[d,h]=x.useState(!1),[f]=x.useState(!1),[m,p]=x.useState(null),[y,v]=x.useState([]),[S,N]=x.useState(!1),[C,j]=x.useState(!1),[E,R]=x.useState(!1),[A,_]=x.useState(!1),[O,T]=x.useState(!1),[D,B]=x.useState(null),[W,M]=x.useState(!1),[V,G]=x.useState(!1),[F,H]=x.useState(""),[P,U]=x.useState(""),[z,te]=x.useState(!1),oe=x.useCallback(async we=>{h(!0),p(null);try{const _e=await kH(we);c(_e)}catch(_e){const vt=_e instanceof Error?_e.message:"Failed to load goal";p(vt)}finally{h(!1)}},[]),L=x.useCallback(async we=>{M(!0);try{const _e=await hA(we);B(_e)}catch{B(null)}finally{M(!1)}},[]);x.useEffect(()=>{e&&t&&(oe(e),L(e),v([]),N(!1))},[e,t,oe,L]);const $=async()=>{if(e){T(!0);try{await lA(e),me.success("Goal deleted successfully"),_(!1),n(!1),a?.(),r?.()}catch(we){const _e=we instanceof Error?we.message:"Failed to delete goal";me.error(_e)}finally{T(!1)}}},X=()=>{o&&(H(o.title),U(o.description||""),G(!0))},Q=()=>{G(!1)},q=async()=>{if(!(!e||!F.trim())){te(!0);try{await Pl(e,{title:F.trim(),description:P.trim()||null}),await oe(e),G(!1),me.success("Goal updated"),r?.()}catch(we){const _e=we instanceof Error?we.message:"Failed to update goal";me.error(_e)}finally{te(!1)}}},ce=()=>{e&&R(!0)},ne=()=>{r?.(),oe(e)},xe=()=>{R(!1),n(!1),r?.()},be=()=>{N(!1),v([])},De=()=>{N(!1),v([]),r?.(),n(!1)},Ke=()=>{r?.()};return e?l.jsxs(l.Fragment,{children:[l.jsx(Br,{open:t,onOpenChange:n,children:l.jsxs(zr,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:[l.jsxs($s,{children:[l.jsx(Vs,{className:"text-lg flex items-center gap-2",children:d?"Loading...":V?l.jsx(Ln,{value:F,onChange:we=>H(we.target.value),className:"text-lg font-semibold h-auto py-1",autoFocus:!0}):l.jsxs(l.Fragment,{children:[o?.title||"Goal Details",o&&l.jsx("button",{onClick:X,className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"Edit goal",children:l.jsx(E0,{className:"h-3.5 w-3.5"})})]})}),l.jsx(Us,{className:"sr-only",children:"Goal details and ticket generation"})]}),d?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(ke,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):m&&!o?l.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-center",children:[l.jsx(Hn,{className:"h-8 w-8 text-destructive"}),l.jsx("p",{className:"text-sm text-destructive",children:m}),l.jsx(ye,{variant:"outline",size:"sm",onClick:()=>e&&oe(e),children:"Try Again"})]}):o?l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[V?l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Description"}),l.jsx(Mc,{value:P,onChange:we=>U(we.target.value),placeholder:"Describe the goal... (optional)",rows:3})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(ye,{size:"sm",onClick:q,disabled:z||!F.trim(),children:[z?l.jsx(ke,{className:"h-3.5 w-3.5 animate-spin mr-1"}):l.jsx(nf,{className:"h-3.5 w-3.5 mr-1"}),"Save"]}),l.jsxs(ye,{size:"sm",variant:"ghost",onClick:Q,disabled:z,children:[l.jsx(On,{className:"h-3.5 w-3.5 mr-1"}),"Cancel"]})]})]}):l.jsx(l.Fragment,{children:o.description&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Description"}),l.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-line",children:o.description})]})}),l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(jO,{className:"h-3.5 w-3.5"}),l.jsxs("span",{children:["Created ",yJ(o.created_at)]})]})]}),l.jsxs("div",{className:"border rounded-lg p-3 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(hs,{className:ue("h-4 w-4",o.autonomy_enabled?"text-amber-500":"text-muted-foreground")}),l.jsx("span",{className:"text-sm font-medium",children:"Autonomy"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[o.autonomy_enabled&&l.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.auto_approval_count," auto-actions",o.max_auto_approvals?` / ${o.max_auto_approvals} max`:""]}),l.jsx(Pn,{checked:o.autonomy_enabled,onCheckedChange:async we=>{try{await Pl(e,we?{autonomy_enabled:!0,auto_approve_tickets:!0,auto_approve_revisions:!0,auto_merge:!0,auto_approve_followups:!0}:{autonomy_enabled:!1,auto_approve_tickets:!1,auto_approve_revisions:!1,auto_merge:!1,auto_approve_followups:!1}),await oe(e),me.success(we?"Autonomy enabled":"Autonomy disabled")}catch(_e){me.error(_e instanceof Error?_e.message:"Failed to update")}}})]})]}),o.autonomy_enabled&&l.jsxs("div",{className:"space-y-2.5 pl-3 border-l-2 border-amber-500/30",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ct,{className:"text-xs",children:"Auto-approve tickets"}),l.jsx(Pn,{checked:o.auto_approve_tickets,onCheckedChange:async we=>{try{await Pl(e,{auto_approve_tickets:we}),await oe(e)}catch(_e){me.error(_e instanceof Error?_e.message:"Failed to update")}}})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ct,{className:"text-xs",children:"Auto-approve revisions"}),l.jsx(Pn,{checked:o.auto_approve_revisions,onCheckedChange:async we=>{try{await Pl(e,{auto_approve_revisions:we}),await oe(e)}catch(_e){me.error(_e instanceof Error?_e.message:"Failed to update")}}})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ct,{className:"text-xs",children:"Auto-merge on completion"}),l.jsx(Pn,{checked:o.auto_merge,onCheckedChange:async we=>{try{await Pl(e,{auto_merge:we}),await oe(e)}catch(_e){me.error(_e instanceof Error?_e.message:"Failed to update")}}})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ct,{className:"text-xs",children:"Auto-approve follow-ups"}),l.jsx(Pn,{checked:o.auto_approve_followups,onCheckedChange:async we=>{try{await Pl(e,{auto_approve_followups:we}),await oe(e)}catch(_e){me.error(_e instanceof Error?_e.message:"Failed to update")}}})]})]})]}),W?l.jsx("div",{className:"border rounded-lg p-3",children:l.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[l.jsx(ke,{className:"h-4 w-4 animate-spin"}),l.jsx("span",{children:"Loading cost data..."})]})}):D&&D.agent.total_cost_usd>0?l.jsxs("div",{className:"border rounded-lg p-3 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Rp,{className:"h-4 w-4 text-blue-500"}),l.jsx("span",{className:"text-sm font-medium",children:"Cost Tracking"}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:[D.agent.total_sessions," session",D.agent.total_sessions!==1?"s":""]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex justify-between text-xs",children:[l.jsx("span",{className:"text-muted-foreground",children:"Today"}),l.jsxs("span",{className:"font-medium",children:["$",D.budget.daily_spent.toFixed(2),D.budget.daily_budget?` / $${D.budget.daily_budget}`:""]})]}),D.budget.daily_budget?l.jsx("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:l.jsx("div",{className:ue("h-full transition-all rounded-full",D.budget.daily_spent/D.budget.daily_budget>.8?"bg-red-500":D.budget.daily_spent/D.budget.daily_budget>.6?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,D.budget.daily_spent/D.budget.daily_budget*100)}%`}})}):null]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex justify-between text-xs",children:[l.jsx("span",{className:"text-muted-foreground",children:"This Week"}),l.jsxs("span",{className:"font-medium",children:["$",D.budget.weekly_spent.toFixed(2),D.budget.weekly_budget?` / $${D.budget.weekly_budget}`:""]})]}),D.budget.weekly_budget?l.jsx("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:l.jsx("div",{className:ue("h-full transition-all rounded-full",D.budget.weekly_spent/D.budget.weekly_budget>.8?"bg-red-500":D.budget.weekly_spent/D.budget.weekly_budget>.6?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,D.budget.weekly_spent/D.budget.weekly_budget*100)}%`}})}):null]}),l.jsxs("div",{className:"pt-2 border-t flex justify-between text-xs",children:[l.jsx("span",{className:"text-muted-foreground",children:"Total Agent Cost"}),l.jsxs("span",{className:"font-semibold",children:["$",D.agent.total_cost_usd.toFixed(4)]})]}),D.budget.warning_threshold_reached&&l.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-amber-600 dark:text-amber-400",children:[l.jsx(Hn,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"Approaching budget limit"})]})]}):null,S&&y.length>0?l.jsx(nJ,{tickets:y,goalId:e,onClose:be,onAccepted:De}):l.jsx(l.Fragment,{children:l.jsx("div",{className:"border-t pt-6",children:l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"text-sm font-medium",children:"AI Ticket Generation"}),l.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Use AI to analyze this goal and generate proposed tickets with verification commands. The AI will examine the repository structure and create actionable work items."}),m&&l.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-md bg-destructive/10 text-destructive text-xs",children:[l.jsx(Hn,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),l.jsx("span",{children:m})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(ye,{onClick:ce,disabled:f,className:"flex-1",children:f?l.jsxs(l.Fragment,{children:[l.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Generating..."]}):l.jsxs(l.Fragment,{children:[l.jsx(_d,{className:"mr-2 h-4 w-4"}),"Generate Tickets"]})}),l.jsxs(ye,{variant:"outline",onClick:()=>j(!0),disabled:f,title:"Reflect on existing proposed tickets",children:[l.jsx(kO,{className:"mr-2 h-4 w-4"}),"Reflect"]})]})]})})}),l.jsx(aJ,{open:C,onOpenChange:j,goalId:e,goalTitle:o?.title||"",onPrioritiesUpdated:Ke}),e&&l.jsx(xJ,{open:E,onOpenChange:R,goalId:e,onComplete:ne,onShowTickets:xe}),l.jsx("div",{className:"border-t pt-4",children:l.jsxs(ye,{variant:"ghost",size:"sm",onClick:()=>_(!0),className:"text-destructive hover:text-destructive hover:bg-destructive/10 gap-2",children:[l.jsx(Gi,{className:"h-4 w-4"}),"Delete Goal"]})})]}):null]})}),l.jsx($o,{open:A,onOpenChange:_,children:l.jsxs(Di,{children:[l.jsxs(ki,{children:[l.jsx(Oi,{children:"Delete goal"}),l.jsxs(Mi,{children:['Delete "',o?.title,'"? This will also delete all tickets, jobs, and data associated with this goal. This action cannot be undone.']})]}),l.jsxs(Ai,{children:[l.jsx(Li,{children:"Cancel"}),l.jsxs(Pi,{onClick:$,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[O?l.jsx(ke,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]}):null}function bJ(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"})}function wJ({open:e,onOpenChange:t,onBoardRefresh:n}){const{currentBoard:r}=ys(),[a,o]=x.useState([]),[c,d]=x.useState(!1),[h,f]=x.useState(null),[m,p]=x.useState(null),[y,v]=x.useState(!1),[S,N]=x.useState(null),[C,j]=x.useState(null),E=x.useCallback(async()=>{d(!0),f(null);try{const T=await iw(r?.id);o(T.goals)}catch(T){const D=T instanceof Error?T.message:"Failed to load goals";f(D),me.error(D)}finally{d(!1)}},[r?.id]);x.useEffect(()=>{e&&E()},[e,E]);const R=T=>{p(T),v(!0)},A=()=>{v(!1),p(null),n?.(),t(!1)},_=()=>{v(!1),p(null),E(),n?.()},O=async()=>{if(S){j(S.id);try{await lA(S.id),me.success("Goal deleted successfully"),N(null),E(),n?.()}catch(T){const D=T instanceof Error?T.message:"Failed to delete goal";me.error(D)}finally{j(null)}}};return l.jsxs(l.Fragment,{children:[l.jsx(Br,{open:e,onOpenChange:t,children:l.jsxs(zr,{className:"sm:max-w-[600px] max-h-[80vh] overflow-hidden",children:[l.jsxs($s,{children:[l.jsxs(Vs,{className:"flex items-center gap-2",children:[l.jsx(oa,{className:"h-5 w-5"}),"Goals"]}),l.jsx(Us,{children:"Select a goal to view details and generate AI-powered tickets."})]}),l.jsx("div",{className:"mt-2",children:c?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(ke,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):h?l.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-center",children:[l.jsx(Hn,{className:"h-8 w-8 text-destructive"}),l.jsx("p",{className:"text-sm text-destructive",children:h}),l.jsx(ye,{variant:"outline",size:"sm",onClick:E,children:"Try Again"})]}):a.length===0?l.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-center",children:[l.jsx(oa,{className:"h-10 w-10 text-muted-foreground/50"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:"No goals yet"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Create a goal to start generating tickets with AI"})]})]}):l.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto pr-4",children:a.map(T=>l.jsx("button",{onClick:()=>R(T.id),className:ue("w-full text-left p-4 rounded-lg border transition-colors","hover:bg-muted/50 hover:border-primary/30","focus:outline-none focus:ring-2 focus:ring-primary/20"),children:l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[l.jsx("h3",{className:"text-sm font-medium truncate pr-4",children:T.title}),T.description&&l.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2 pr-4",children:T.description}),l.jsxs("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-muted-foreground",children:[l.jsx(jO,{className:"h-3 w-3 flex-shrink-0"}),l.jsx("span",{children:bJ(T.created_at)})]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 pr-1",children:[T.autonomy_enabled&&l.jsxs("div",{className:"flex items-center gap-1 text-xs text-amber-600 dark:text-amber-400",title:"Autonomy enabled",children:[l.jsx(hs,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"Auto"})]}),l.jsxs("div",{className:"flex items-center gap-1 text-xs text-primary",children:[l.jsx(_d,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"AI"})]}),l.jsx("button",{onClick:D=>{D.stopPropagation(),N(T)},disabled:C===T.id,className:"p-1 rounded text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",title:"Delete goal",children:C===T.id?l.jsx(ke,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(Gi,{className:"h-3.5 w-3.5"})}),l.jsx(Zi,{className:"h-4 w-4 text-muted-foreground"})]})]})},T.id))})})]})}),l.jsx(vJ,{goalId:m,open:y,onOpenChange:v,onTicketsAccepted:A,onGoalDeleted:_}),l.jsx($o,{open:!!S,onOpenChange:T=>!T&&N(null),children:l.jsxs(Di,{children:[l.jsxs(ki,{children:[l.jsx(Oi,{children:"Delete goal"}),l.jsxs(Mi,{children:['Delete "',S?.title,'"? This will also delete all tickets, jobs, and data associated with this goal. This action cannot be undone.']})]}),l.jsxs(Ai,{children:[l.jsx(Li,{children:"Cancel"}),l.jsxs(Pi,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[C?l.jsx(ke,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function SJ({jobId:e,ticketTitle:t,isRunning:n=!1,className:r}){const[a,o]=x.useState(""),[c,d]=x.useState(!0),[h,f]=x.useState(null),[m,p]=x.useState(!0),[y,v]=x.useState(!0),[S,N]=x.useState(!1),C=x.useRef(null),j=x.useRef(null),E=x.useCallback(async()=>{try{const T=await dA(e);o(T),f(null)}catch(T){const D=T instanceof Error?T.message:"Failed to load logs";f(D)}finally{d(!1)}},[e]);x.useEffect(()=>{E()},[E]),x.useEffect(()=>{if(!n)return;const T=setInterval(()=>{E()},2e3);return()=>clearInterval(T)},[n,E]),x.useEffect(()=>{y&&C.current&&m&&C.current.scrollIntoView({behavior:"smooth"})},[a,y,m]);const R=x.useCallback(()=>{if(!j.current)return;const{scrollTop:T,scrollHeight:D,clientHeight:B}=j.current,W=D-T-B<50;v(W)},[]),A=async()=>{try{await navigator.clipboard.writeText(a),N(!0),me.success("Logs copied to clipboard"),setTimeout(()=>N(!1),2e3)}catch{me.error("Failed to copy logs")}},O=a.split(`
76
+ `).length;return l.jsxs("div",{className:ue("rounded-lg border border-border overflow-hidden",r),children:[l.jsxs("div",{className:ue("flex items-center justify-between px-3 py-2 cursor-pointer transition-colors","bg-zinc-900 hover:bg-zinc-800",n&&"border-l-2 border-l-emerald-500"),onClick:()=>p(!m),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(la,{className:"h-4 w-4 text-zinc-400"}),l.jsx("span",{className:"text-sm font-medium text-zinc-200 truncate max-w-[250px]",children:t}),n&&l.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-emerald-400 font-medium uppercase tracking-wide",children:[l.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-emerald-500"})]}),"Live"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:"text-[10px] text-zinc-500",children:[O," lines"]}),m?l.jsx(Tw,{className:"h-4 w-4 text-zinc-500"}):l.jsx($r,{className:"h-4 w-4 text-zinc-500"})]})]}),m&&l.jsx("div",{className:"relative",children:c&&!a?l.jsx("div",{className:"flex items-center justify-center py-8 bg-zinc-950",children:l.jsx(ke,{className:"h-5 w-5 animate-spin text-zinc-500"})}):h&&!a?l.jsx("div",{className:"flex items-center justify-center py-8 bg-zinc-950",children:l.jsx("p",{className:"text-sm text-zinc-500",children:h})}):l.jsxs(l.Fragment,{children:[l.jsx(ye,{variant:"ghost",size:"sm",onClick:A,className:"absolute top-2 right-2 h-7 px-2 bg-zinc-800/80 hover:bg-zinc-700 text-zinc-400 z-10",children:S?l.jsx(qt,{className:"h-3.5 w-3.5 text-emerald-400"}):l.jsx(TO,{className:"h-3.5 w-3.5"})}),l.jsx("div",{ref:j,onScroll:R,className:ue("bg-zinc-950 overflow-auto font-mono text-xs","max-h-[300px] min-h-[100px]"),children:l.jsxs("pre",{className:"p-3 text-zinc-300 whitespace-pre-wrap break-words",children:[a||"No logs available yet...",l.jsx("div",{ref:C})]})}),n&&!y&&l.jsx("button",{onClick:()=>{v(!0),C.current?.scrollIntoView({behavior:"smooth"})},className:"absolute bottom-2 right-2 px-2 py-1 rounded bg-zinc-800 text-zinc-400 text-[10px] hover:bg-zinc-700 transition-colors",children:"↓ Resume auto-scroll"})]})})]})}function NT(e){const t=new Date(e),r=new Date().getTime()-t.getTime(),a=Math.floor(r/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:t.toLocaleDateString()}function NJ({kind:e}){const t={execute:"bg-blue-500/15 text-blue-600 border-blue-500/30",verify:"bg-purple-500/15 text-purple-600 border-purple-500/30",resume:"bg-amber-500/15 text-amber-600 border-amber-500/30"};return l.jsx(kt,{variant:"outline",className:ue("text-[10px] px-1.5 py-0",t[e]||""),children:e})}function jT({job:e,isRunning:t,onCancel:n,cancelingId:r,showLogs:a,onToggleLogs:o}){const c=r===e.id;return l.jsxs("div",{className:"space-y-2",children:[l.jsx("div",{className:ue("p-3 rounded-lg border transition-colors",t?"bg-emerald-500/5 border-emerald-500/30":"bg-muted/30 border-border hover:bg-muted/50"),children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t?l.jsxs("div",{className:"flex items-center gap-1.5 text-emerald-600",children:[l.jsxs("span",{className:"relative flex h-2 w-2",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]}),l.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide",children:"Running"})]}):l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(_p,{className:"h-3 w-3"}),l.jsxs("span",{className:"text-[10px] font-medium uppercase tracking-wide",children:["#",e.queue_position]})]}),l.jsx(NJ,{kind:e.kind})]}),l.jsx("h4",{className:"text-sm font-medium truncate",title:e.ticket_title,children:e.ticket_title}),l.jsxs("div",{className:"flex items-center gap-3 mt-1.5 text-[10px] text-muted-foreground",children:[l.jsxs("span",{className:"font-mono",title:e.ticket_id,children:[e.ticket_id.slice(0,8),"..."]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(VK,{className:"h-3 w-3"}),t&&e.started_at?`started ${NT(e.started_at)}`:`queued ${NT(e.created_at)}`]})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[t&&l.jsxs(ye,{variant:"ghost",size:"sm",onClick:o,className:ue("h-7 px-2 text-xs",a&&"bg-accent"),title:"View logs",children:[l.jsx(_w,{className:"h-3.5 w-3.5 mr-1"}),"Logs",a?l.jsx(Tw,{className:"h-3 w-3 ml-1"}):l.jsx($r,{className:"h-3 w-3 ml-1"})]}),l.jsxs(ye,{variant:"ghost",size:"sm",onClick:()=>n(e.id),disabled:c,className:ue("h-7 px-2 text-xs","text-red-600 hover:text-red-700 hover:bg-red-100","dark:text-red-400 dark:hover:text-red-300 dark:hover:bg-red-900/30"),title:t?"Stop job":"Cancel job",children:[c?l.jsx(ke,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(PO,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"ml-1",children:t?"Stop":"Cancel"})]})]})]})}),t&&a&&l.jsx(SJ,{jobId:e.id,ticketTitle:e.ticket_title,isRunning:!0,className:"ml-2"})]})}function jJ({open:e,onOpenChange:t}){const[n,r]=x.useState(null),[a,o]=x.useState(!1),[c,d]=x.useState(null),[h,f]=x.useState(null),[m,p]=x.useState(new Set),y=x.useCallback(async()=>{o(!0),d(null);try{const C=await fA();r(C)}catch(C){const j=C instanceof Error?C.message:"Failed to load queue status";d(j),me.error(j)}finally{o(!1)}},[]);x.useEffect(()=>{e&&y()},[e,y]),x.useEffect(()=>{if(!e)return;const C=setInterval(()=>{y()},3e3);return()=>clearInterval(C)},[e,y]);const v=x.useCallback(async C=>{f(C);try{const j=await qH(C);me.success(j.message),await y()}catch(j){const E=j instanceof Error?j.message:"Failed to cancel job";me.error(E)}finally{f(null)}},[y]),S=x.useCallback(C=>{p(j=>{const E=new Set(j);return E.has(C)?E.delete(C):E.add(C),E})},[]),N=n&&n.total_running===0&&n.total_queued===0;return l.jsx(Br,{open:e,onOpenChange:t,children:l.jsxs(zr,{className:"sm:max-w-[600px] max-h-[85vh] overflow-hidden flex flex-col",children:[l.jsxs($s,{children:[l.jsxs(Vs,{className:"flex items-center gap-2",children:[l.jsx(OO,{className:"h-5 w-5"}),"Activity Monitor"]}),l.jsx(Us,{children:"View running jobs, queue status, and live logs. Stop jobs if needed."})]}),l.jsxs("div",{className:"mt-2 flex-1 min-h-0 overflow-hidden flex flex-col",children:[a&&!n?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(ke,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):c?l.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-center",children:[l.jsx(Hn,{className:"h-8 w-8 text-destructive"}),l.jsx("p",{className:"text-sm text-destructive",children:c}),l.jsx(ye,{variant:"outline",size:"sm",onClick:y,children:"Try Again"})]}):N?l.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 text-center",children:[l.jsx(hs,{className:"h-10 w-10 text-muted-foreground/50"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:"Queue is empty"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"No jobs are currently running or waiting"})]})]}):l.jsxs("div",{className:"space-y-4 flex-1 overflow-y-auto pr-2",children:[n&&n.running.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(ia,{className:"h-4 w-4 text-emerald-600"}),l.jsxs("h3",{className:"text-sm font-medium",children:["Running (",n.total_running,")"]})]}),l.jsx("div",{className:"space-y-2",children:n.running.map(C=>l.jsx(jT,{job:C,isRunning:!0,onCancel:v,cancelingId:h,showLogs:m.has(C.id),onToggleLogs:()=>S(C.id)},C.id))})]}),n&&n.queued.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(_p,{className:"h-4 w-4 text-muted-foreground"}),l.jsxs("h3",{className:"text-sm font-medium",children:["Queued (",n.total_queued,")"]})]}),l.jsx("div",{className:"space-y-2",children:n.queued.map(C=>l.jsx(jT,{job:C,isRunning:!1,onCancel:v,cancelingId:h,showLogs:!1,onToggleLogs:()=>{}},C.id))})]})]}),n&&!N&&l.jsxs("div",{className:"flex items-center justify-between mt-4 pt-3 border-t flex-shrink-0",children:[l.jsxs("span",{className:"text-[10px] text-muted-foreground flex items-center gap-1",children:[l.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-emerald-500"})]}),"Auto-refreshing every 3s"]}),l.jsxs(ye,{variant:"ghost",size:"sm",onClick:y,disabled:a,className:"h-7 text-xs",children:[l.jsx(pa,{className:ue("h-3 w-3 mr-1",a&&"animate-spin")}),"Refresh"]})]})]})]})})}const CT={proposed:{fill:"#64748b",stroke:"#475569",text:"#f1f5f9"},planned:{fill:"#3b82f6",stroke:"#2563eb",text:"#eff6ff"},executing:{fill:"#10b981",stroke:"#059669",text:"#ecfdf5"},verifying:{fill:"#8b5cf6",stroke:"#7c3aed",text:"#f5f3ff"},needs_human:{fill:"#f59e0b",stroke:"#d97706",text:"#fffbeb"},blocked:{fill:"#ef4444",stroke:"#dc2626",text:"#fef2f2"},done:{fill:"#22c55e",stroke:"#16a34a",text:"#f0fdf4"},abandoned:{fill:"#9ca3af",stroke:"#6b7280",text:"#f9fafb"}};function CJ({highlightedTicketId:e}={}){const[t,n]=x.useState([]),[r,a]=x.useState(!0),[o,c]=x.useState(null),[d,h]=x.useState(null),[f,m]=x.useState(null);x.useEffect(()=>{if(e)m(e);else{const E=new URLSearchParams(window.location.search).get("highlight");m(E)}},[e]),x.useEffect(()=>{const j=E=>{E.key==="Escape"&&f&&(m(null),window.history.replaceState({},"",window.location.pathname))};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[f]),x.useEffect(()=>{const j=async()=>{try{const R=await fetch(`${Qd.backendBaseUrl}/board`);if(!R.ok)throw new Error("Failed to fetch tickets");const _=(await R.json()).columns.flatMap(O=>O.tickets);n(_)}catch(R){c(R instanceof Error?R.message:"Unknown error")}finally{a(!1)}};j();const E=setInterval(j,3e3);return()=>clearInterval(E)},[]);const{nodes:p,edges:y,stats:v}=x.useMemo(()=>{if(t.length===0)return{nodes:[],edges:[],stats:{totalTickets:0,hasCycle:!1,maxLayer:0}};const j=new Map,E=new Map;t.forEach(F=>{j.set(F.id,{...F,layer:-1,x:0,y:0,dependents:[]}),E.set(F.id,[])}),t.forEach(F=>{if(F.blocked_by_ticket_id){const H=E.get(F.blocked_by_ticket_id);H&&H.push(F.id)}}),E.forEach((F,H)=>{const P=j.get(H);P&&(P.dependents=F)});const R=new Set,A=new Set;let _=!1;const O=F=>{if(A.has(F))return _=!0,0;if(R.has(F))return j.get(F)?.layer??0;A.add(F);const H=j.get(F);if(!H)return 0;let P=0;return H.blocked_by_ticket_id&&(P=O(H.blocked_by_ticket_id)+1),H.layer=P,A.delete(F),R.add(F),P};t.forEach(F=>O(F.id));const T=new Map;let D=0;j.forEach(F=>{D=Math.max(D,F.layer),T.has(F.layer)||T.set(F.layer,[]),T.get(F.layer)?.push(F)}),T.forEach(F=>{F.sort((H,P)=>H.priority!==null&&P.priority!==null?P.priority-H.priority:H.priority!==null?-1:P.priority!==null?1:H.title.localeCompare(P.title))});const B=80,W=240,M=100,V=[];for(let F=0;F<=D;F++)(T.get(F)||[]).forEach((P,U)=>{P.x=F*W+50,P.y=U*(B+M)+50,V.push(P)});const G=[];return V.forEach(F=>{if(F.blocked_by_ticket_id){const H=j.get(F.blocked_by_ticket_id);H&&G.push({from:H.id,to:F.id,fromNode:H,toNode:F})}}),{nodes:V,edges:G,stats:{totalTickets:t.length,hasCycle:_,maxLayer:D},ticketMap:j}},[t]),S=x.useMemo(()=>{if(!f)return null;const j=new Set;j.add(f);const E=A=>{const _=t.find(O=>O.id===A);_?.blocked_by_ticket_id&&!j.has(_.blocked_by_ticket_id)&&(j.add(_.blocked_by_ticket_id),E(_.blocked_by_ticket_id))},R=A=>{t.forEach(_=>{_.blocked_by_ticket_id===A&&!j.has(_.id)&&(j.add(_.id),R(_.id))})};return E(f),R(f),j},[f,t]);if(r)return l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(ke,{className:"h-6 w-6 animate-spin text-muted-foreground"})});if(o)return l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-destructive",children:[l.jsx(Hn,{className:"h-8 w-8 mb-2"}),l.jsx("p",{className:"text-sm",children:"Failed to load DAG"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:o})]});if(p.length===0)return l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[l.jsx(Ko,{className:"h-12 w-12 mb-3 opacity-50"}),l.jsx("p",{className:"text-sm font-medium",children:"No tickets to visualize"}),l.jsx("p",{className:"text-xs",children:"Create some tickets with dependencies to see the DAG"})]});const N=Math.max(...p.map(j=>j.x))+250,C=Math.max(...p.map(j=>j.y))+100;return l.jsxs("div",{className:"h-full overflow-auto bg-slate-50 dark:bg-slate-950",children:[l.jsxs("div",{className:"sticky top-0 z-10 bg-background/95 backdrop-blur border-b px-4 py-2 flex items-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ko,{className:"h-4 w-4 text-blue-500"}),l.jsx("span",{className:"text-sm font-semibold",children:"Ticket Dependency Graph"})]}),l.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[l.jsxs("span",{children:["Tickets: ",v.totalTickets]}),l.jsxs("span",{children:["Layers: ",v.maxLayer+1]}),l.jsxs("span",{children:["Dependencies: ",y.length]}),S&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(kt,{variant:"default",className:"text-[10px] bg-amber-500 hover:bg-amber-600",children:["🎯 Highlighting ",S.size," connected ticket",S.size!==1?"s":""]}),l.jsx("button",{onClick:()=>{m(null),window.history.replaceState({},"",window.location.pathname)},className:"p-1 rounded hover:bg-muted transition-colors",title:"Clear highlight","aria-label":"Clear ticket highlight and show all tickets",children:l.jsx(On,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]}),v.hasCycle&&l.jsx(kt,{variant:"destructive",className:"text-[10px]",children:"⚠️ Cycle Detected!"})]}),l.jsxs("div",{className:"ml-auto flex items-center gap-2 text-xs",children:[l.jsx(Bs,{className:"h-3 w-3 text-muted-foreground"}),l.jsxs("span",{className:"text-muted-foreground",children:["Hover over nodes for details",f&&" • Press ESC to clear highlight"]})]})]}),l.jsx("div",{className:"p-8",children:l.jsxs("svg",{width:N,height:C,className:"rounded-lg bg-white dark:bg-slate-900 shadow-sm",style:{minWidth:"100%",minHeight:"500px"},children:[l.jsxs("defs",{children:[l.jsx("pattern",{id:"grid",width:"20",height:"20",patternUnits:"userSpaceOnUse",children:l.jsx("path",{d:"M 20 0 L 0 0 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5",className:"text-slate-200 dark:text-slate-800"})}),l.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",children:l.jsx("polygon",{points:"0 0, 10 3, 0 6",fill:"#94a3b8",className:"dark:fill-slate-600"})}),l.jsxs("filter",{id:"glow",children:[l.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),l.jsxs("feMerge",{children:[l.jsx("feMergeNode",{in:"coloredBlur"}),l.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),l.jsx("rect",{width:"100%",height:"100%",fill:"url(#grid)"}),y.map((j,E)=>{const R=j.fromNode.x+180,A=j.fromNode.y+35,_=j.toNode.x-10,O=j.toNode.y+35,T=d===j.fromNode.id||d===j.toNode.id,D=S?.has(j.fromNode.id)&&S?.has(j.toNode.id),B=S!==null&&!D,W=(R+_)/2;return l.jsx("g",{children:l.jsx("path",{d:`M ${R} ${A} C ${W} ${A}, ${W} ${O}, ${_} ${O}`,fill:"none",stroke:T?"#3b82f6":"#94a3b8",strokeWidth:T?"3":"2",className:ue("transition-all",T&&"dark:stroke-blue-400"),markerEnd:"url(#arrowhead)",opacity:B?.15:T?1:.5})},`edge-${E}`)}),p.map(j=>{const E=CT[j.state]||CT.proposed,R=d===j.id,A=f===j.id,_=S?.has(j.id)??!1,O=y.some(B=>B.fromNode.id===j.id||B.toNode.id===j.id)&&d!==null,T=S!==null&&!_,D=R||O&&!R;return l.jsxs("g",{transform:`translate(${j.x}, ${j.y})`,onMouseEnter:()=>h(j.id),onMouseLeave:()=>h(null),className:"cursor-pointer",style:{transition:"all 0.2s ease"},children:[l.jsx("rect",{width:"170",height:"70",rx:"8",x:"2",y:"2",fill:"black",opacity:"0.1"}),l.jsx("rect",{width:"170",height:"70",rx:"8",fill:E.fill,stroke:A?"#fbbf24":E.stroke,strokeWidth:A?"4":R?"3":"2",className:"transition-all",filter:j.state==="executing"||A?"url(#glow)":void 0,opacity:T?.25:D&&!R?.4:1}),l.jsxs("g",{children:[l.jsx("circle",{cx:"12",cy:"12",r:"4",fill:E.text,opacity:"0.8"}),j.priority!==null&&l.jsxs("g",{transform:"translate(145, 8)",children:[l.jsx("rect",{width:"18",height:"18",rx:"3",fill:"black",opacity:"0.2"}),l.jsxs("text",{x:"9",y:"13",textAnchor:"middle",fill:E.text,className:"text-[10px] font-bold",children:["P",j.priority>=80?"0":j.priority>=60?"1":j.priority>=40?"2":"3"]})]}),l.jsx("text",{x:"85",y:"22",textAnchor:"middle",fill:E.text,className:"text-[9px] font-mono opacity-70",children:j.id.slice(0,8)}),l.jsx("text",{x:"85",y:"40",textAnchor:"middle",fill:E.text,className:"text-xs font-semibold",children:j.title.length>20?j.title.slice(0,20)+"...":j.title}),l.jsx("text",{x:"85",y:"56",textAnchor:"middle",fill:E.text,className:"text-[10px] uppercase font-medium opacity-80",children:j.state==="needs_human"?"needs human":j.state.replace("_"," ")}),j.blocked_by_ticket_id&&l.jsxs("g",{transform:"translate(8, 60)",children:[l.jsx("circle",{cx:"0",cy:"0",r:"2",fill:E.text,opacity:"0.6"}),l.jsx("text",{x:"5",y:"3",fill:E.text,className:"text-[8px]",opacity:"0.7",children:"blocked"})]}),j.dependents.length>0&&l.jsx("g",{transform:"translate(140, 60)",children:l.jsxs("text",{x:"0",y:"3",fill:E.text,className:"text-[8px] text-right",opacity:"0.7",children:[j.dependents.length," deps"]})})]}),R&&l.jsxs("g",{transform:"translate(85, -25)",children:[l.jsx("rect",{x:"-80",y:"-15",width:"160",height:"30",rx:"4",fill:"black",opacity:"0.9"}),l.jsx("text",{x:"0",y:"-5",textAnchor:"middle",fill:"white",className:"text-[10px] font-medium",children:j.title}),l.jsxs("text",{x:"0",y:"6",textAnchor:"middle",fill:"white",className:"text-[9px]",opacity:"0.8",children:["Priority: ",j.priority??"None"," • ",j.state]})]})]},j.id)})]})})]})}function Fl(e){try{return new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return e}}function EJ({level:e}){const t={DEBUG:"bg-gray-500/15 text-gray-500 border-gray-500/30",INFO:"bg-blue-500/15 text-blue-500 border-blue-500/30",WARNING:"bg-amber-500/15 text-amber-600 border-amber-500/30",ERROR:"bg-red-500/15 text-red-500 border-red-500/30"};return l.jsx(kt,{variant:"outline",className:ue("text-[9px] px-1 py-0 font-mono",t[e]||t.INFO),children:e})}function TJ({state:e}){const t={proposed:"bg-slate-500/15 text-slate-600",planned:"bg-blue-500/15 text-blue-600",executing:"bg-emerald-500/15 text-emerald-600",verifying:"bg-purple-500/15 text-purple-600",needs_review:"bg-amber-500/15 text-amber-600",needs_human:"bg-orange-500/15 text-orange-600",blocked:"bg-red-500/15 text-red-600",done:"bg-green-500/15 text-green-600",abandoned:"bg-gray-500/15 text-gray-500"};return l.jsx(kt,{variant:"outline",className:ue("text-[10px] px-1.5",t[e]||""),children:e})}function _J({isOpen:e,onClose:t}){const[n,r]=x.useState("status"),[a,o]=x.useState(!1),[c,d]=x.useState(!1),[h,f]=x.useState(null),[m,p]=x.useState(null),[y,v]=x.useState([]),[S,N]=x.useState([]),[C,j]=x.useState(null),[E,R]=x.useState(""),[A,_]=x.useState(!1),[O,T]=x.useState(!0),[D,B]=x.useState(!1),W=x.useRef(null),M=x.useRef(null),V=x.useCallback(async()=>{try{const L=await YH();f(L)}catch(L){console.error("Failed to load system status:",L)}},[]),G=x.useCallback(async()=>{try{const L=await fA();p(L)}catch(L){console.error("Failed to load queue status:",L)}},[]),F=x.useCallback(async()=>{try{const L=await KH(200);v(L.logs)}catch(L){console.error("Failed to load orchestrator logs:",L)}},[]),H=x.useCallback(async()=>{try{const L=await XH(100);N(L)}catch(L){console.error("Failed to load recent events:",L)}},[]),P=x.useCallback(async L=>{_(!0);try{const $=await dA(L);R($)}catch($){R(`Error loading logs: ${$}`)}finally{_(!1)}},[]),U=x.useCallback(()=>{M.current&&M.current.close();const L=QH($=>{v(X=>[...X,$].slice(-500))},$=>{console.error("Orchestrator stream error:",$),d(!1)});M.current=L,d(!0)},[]),z=x.useCallback(()=>{M.current&&(M.current.close(),M.current=null),d(!1)},[]);x.useEffect(()=>{if(!e)return;V(),G(),F(),H();const L=setInterval(()=>{V(),n==="queue"&&G(),n==="events"&&H(),C&&n==="agent"&&P(C)},2e3);return()=>{clearInterval(L),z()}},[e,n,C,V,G,F,H,P,z]),x.useEffect(()=>{O&&W.current&&W.current.scrollIntoView({behavior:"smooth"})},[y,E,O]);const te=x.useCallback(()=>{const L=n==="orchestrator"?y.map($=>`[${$.timestamp}] ${$.level}: ${$.message}`).join(`
77
+ `):E;navigator.clipboard.writeText(L).then(()=>{B(!0),setTimeout(()=>B(!1),2e3)})},[n,y,E]);if(!e)return null;const oe=[{id:"status",label:"Status",icon:l.jsx(id,{className:"h-3.5 w-3.5"})},{id:"queue",label:"Queue",icon:l.jsx(OO,{className:"h-3.5 w-3.5"})},{id:"dag",label:"DAG",icon:l.jsx(Ko,{className:"h-3.5 w-3.5"})},{id:"orchestrator",label:"Orchestrator",icon:l.jsx(hs,{className:"h-3.5 w-3.5"})},{id:"agent",label:"Agent",icon:l.jsx(la,{className:"h-3.5 w-3.5"})},{id:"events",label:"Events",icon:l.jsx(dT,{className:"h-3.5 w-3.5"})}];return l.jsxs("div",{className:ue("fixed bottom-0 left-0 right-0 z-50 bg-background border-t shadow-lg transition-all duration-200",a?"h-10":"h-[45vh]"),children:[l.jsxs("div",{className:"flex items-center justify-between px-3 h-10 border-b bg-muted/30",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(N0,{className:"h-4 w-4 text-amber-500"}),l.jsx("span",{className:"text-sm font-semibold",children:"Debug Panel"}),c&&l.jsxs("div",{className:"flex items-center gap-1.5 text-emerald-500",children:[l.jsxs("span",{className:"relative flex h-2 w-2",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]}),l.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide",children:"Live"})]})]}),!a&&l.jsx("div",{className:"flex items-center gap-1",children:oe.map(L=>l.jsxs(ye,{variant:n===L.id?"secondary":"ghost",size:"sm",onClick:()=>r(L.id),className:"h-7 px-2.5 text-xs gap-1.5",children:[L.icon,L.label]},L.id))}),l.jsxs("div",{className:"flex items-center gap-1",children:[!a&&n==="orchestrator"&&l.jsx(ye,{variant:c?"secondary":"ghost",size:"sm",onClick:c?z:U,className:"h-7 px-2 text-xs",children:c?l.jsxs(l.Fragment,{children:[l.jsx(Is,{className:"h-3 w-3 mr-1"}),"Stop"]}):l.jsxs(l.Fragment,{children:[l.jsx(ia,{className:"h-3 w-3 mr-1"}),"Stream"]})}),!a&&(n==="orchestrator"||n==="agent")&&l.jsx(ye,{variant:"ghost",size:"sm",onClick:te,className:"h-7 px-2 text-xs",children:D?l.jsx(qt,{className:"h-3 w-3"}):l.jsx(TO,{className:"h-3 w-3"})}),l.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>o(!a),className:"h-7 w-7 p-0",children:a?l.jsx(iK,{className:"h-3.5 w-3.5"}):l.jsx(dK,{className:"h-3.5 w-3.5"})}),l.jsx(ye,{variant:"ghost",size:"sm",onClick:t,className:"h-7 w-7 p-0",children:l.jsx(On,{className:"h-4 w-4"})})]})]}),!a&&l.jsxs("div",{className:"h-[calc(45vh-2.5rem)] overflow-hidden",children:[n==="status"&&l.jsx("div",{className:"p-4 h-full overflow-y-auto",children:h?l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[l.jsx(ia,{className:"h-4 w-4 text-emerald-500"}),"Running Jobs (",h.running_jobs.length,")"]}),h.running_jobs.length===0?l.jsx("p",{className:"text-xs text-muted-foreground",children:"No jobs running"}):l.jsx("div",{className:"space-y-2",children:h.running_jobs.map(L=>l.jsxs("div",{className:"p-2 rounded border bg-emerald-500/5 border-emerald-500/20 cursor-pointer hover:bg-emerald-500/10",onClick:()=>{j(L.job_id),r("agent"),P(L.job_id)},children:[l.jsx("p",{className:"text-xs font-medium truncate",children:L.ticket_title}),l.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[L.kind," • ",L.started_at?Fl(L.started_at):"Starting..."]}),L.log_preview&&l.jsx("pre",{className:"mt-1 text-[10px] text-muted-foreground font-mono truncate",children:L.log_preview.split(`
78
+ `).pop()})]},L.job_id))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[l.jsx(id,{className:"h-4 w-4 text-blue-500"}),"Tickets by State"]}),l.jsxs("div",{className:"space-y-1",children:[Object.entries(h.tickets_by_state).map(([L,$])=>l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(TJ,{state:L}),l.jsx("span",{className:"text-sm font-mono",children:$})]},L)),Object.keys(h.tickets_by_state).length===0&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"No tickets"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[l.jsx(hs,{className:"h-4 w-4 text-amber-500"}),"Quick Stats"]}),l.jsxs("div",{className:"space-y-2 text-sm",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:"Queued Jobs"}),l.jsx("span",{className:"font-mono",children:h.queued_count})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:"Events (1h)"}),l.jsx("span",{className:"font-mono",children:h.recent_events_count})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:"Last Update"}),l.jsx("span",{className:"font-mono text-xs",children:Fl(h.timestamp)})]})]})]})]}):l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(ke,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}),n==="dag"&&l.jsx("div",{className:"h-full",children:l.jsx(CJ,{})}),n==="queue"&&l.jsx("div",{className:"p-4 h-full overflow-y-auto",children:m?l.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[l.jsx(ia,{className:"h-4 w-4 text-emerald-500"}),"Running (",m.total_running,")"]}),m.running.length===0?l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No jobs running"}):l.jsx("div",{className:"space-y-2",children:m.running.map(L=>l.jsxs("div",{className:"p-3 rounded-lg border bg-emerald-500/5 border-emerald-500/20 cursor-pointer hover:bg-emerald-500/10 transition-colors",onClick:()=>{j(L.id),r("agent"),P(L.id)},children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx(kt,{variant:"outline",className:"text-[10px] bg-emerald-500/10 text-emerald-600 border-emerald-500/30",children:L.kind}),l.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:L.id.slice(0,8)})]}),l.jsx("p",{className:"text-sm font-medium truncate",children:L.ticket_title}),l.jsxs("p",{className:"text-[10px] text-muted-foreground mt-1",children:["Started: ",L.started_at?Fl(L.started_at):"Starting..."]})]},L.id))})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[l.jsx(xK,{className:"h-4 w-4 text-amber-500"}),"Queued (",m.total_queued,")"]}),m.queued.length===0?l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No jobs in queue"}):l.jsx("div",{className:"space-y-2",children:m.queued.map((L,$)=>l.jsxs("div",{className:"p-3 rounded-lg border bg-amber-500/5 border-amber-500/20",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:"text-xs font-mono text-amber-600 bg-amber-500/10 px-1.5 py-0.5 rounded",children:["#",$+1]}),l.jsx(kt,{variant:"outline",className:"text-[10px] bg-amber-500/10 text-amber-600 border-amber-500/30",children:L.kind})]}),l.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:L.id.slice(0,8)})]}),l.jsx("p",{className:"text-sm font-medium truncate",children:L.ticket_title}),l.jsxs("p",{className:"text-[10px] text-muted-foreground mt-1",children:["Queued: ",Fl(L.created_at)]})]},L.id))})]})]}):l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(ke,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}),n==="orchestrator"&&l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsx("div",{className:"flex-1 overflow-y-auto p-2 font-mono text-xs bg-black/5 dark:bg-white/5",children:y.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[l.jsx(la,{className:"h-8 w-8 mb-2 opacity-50"}),l.jsx("p",{children:"No orchestrator logs yet"}),l.jsx("p",{className:"text-[10px]",children:"Run the planner to generate logs"})]}):l.jsxs("div",{className:"space-y-0.5",children:[y.map((L,$)=>l.jsxs("div",{className:"flex items-start gap-2 hover:bg-muted/30 px-1 py-0.5 rounded",children:[l.jsx("span",{className:"text-muted-foreground shrink-0 w-20",children:Fl(L.timestamp)}),l.jsx(EJ,{level:L.level}),l.jsx("span",{className:"flex-1",children:L.message}),Object.keys(L.data).length>0&&l.jsx("span",{className:"text-muted-foreground text-[10px] shrink-0",children:JSON.stringify(L.data)})]},$)),l.jsx("div",{ref:W})]})}),l.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-t bg-muted/20 text-[10px]",children:[l.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:O,onChange:L=>T(L.target.checked),className:"w-3 h-3"}),"Auto-scroll"]}),l.jsxs("span",{className:"text-muted-foreground",children:[y.length," entries"]})]})]}),n==="agent"&&l.jsxs("div",{className:"h-full flex flex-col",children:[h&&h.running_jobs.length>0&&l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:"Job:"}),l.jsxs("select",{value:C||"",onChange:L=>{j(L.target.value||null),L.target.value&&P(L.target.value)},className:"text-xs bg-muted/30 border rounded px-2 py-1",children:[l.jsx("option",{value:"",children:"Select a job..."}),h.running_jobs.map(L=>l.jsxs("option",{value:L.job_id,children:[L.ticket_title," (",L.kind,")"]},L.job_id))]}),C&&l.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>P(C),className:"h-6 px-2 text-xs",children:l.jsx(pa,{className:"h-3 w-3"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-2 font-mono text-xs bg-black/5 dark:bg-white/5 whitespace-pre-wrap",children:A?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(ke,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):E?l.jsxs(l.Fragment,{children:[E,l.jsx("div",{ref:W})]}):l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[l.jsx(la,{className:"h-8 w-8 mb-2 opacity-50"}),l.jsx("p",{children:"Select a running job to view logs"})]})})]}),n==="events"&&l.jsx("div",{className:"h-full overflow-y-auto p-2",children:S.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[l.jsx(dT,{className:"h-8 w-8 mb-2 opacity-50"}),l.jsx("p",{children:"No recent events"})]}):l.jsx("div",{className:"space-y-1",children:S.map(L=>l.jsxs("div",{className:"flex items-start gap-2 p-2 rounded hover:bg-muted/30 text-xs",children:[l.jsx("span",{className:"text-muted-foreground shrink-0 w-16 font-mono",children:Fl(L.created_at)}),l.jsx(kt,{variant:"outline",className:"text-[9px] px-1 shrink-0",children:L.event_type}),l.jsxs("span",{className:"text-muted-foreground shrink-0",children:[L.actor_type,"/",L.actor_id]}),l.jsx("span",{className:"flex-1 truncate",title:L.ticket_title||void 0,children:L.ticket_title||L.ticket_id.slice(0,8)})]},L.id))})})]})]})}function Vr({className:e,...t}){return l.jsx("div",{"data-slot":"card",className:ue("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Ur({className:e,...t}){return l.jsx("div",{"data-slot":"card-header",className:ue("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Hr({className:e,...t}){return l.jsx("div",{"data-slot":"card-title",className:ue("leading-none font-semibold",e),...t})}function Wa({className:e,...t}){return l.jsx("div",{"data-slot":"card-description",className:ue("text-muted-foreground text-sm",e),...t})}function Gr({className:e,...t}){return l.jsx("div",{"data-slot":"card-content",className:ue("px-6",e),...t})}const RJ={budget:{daily_budget:10,daily_spent:0,daily_remaining:10,weekly_budget:50,weekly_spent:0,weekly_remaining:50,monthly_budget:150,monthly_spent:0,monthly_remaining:150,is_over_budget:!1,warning_threshold_reached:!1},sprint:{total_tickets:0,completed_tickets:0,in_progress_tickets:0,blocked_tickets:0,completion_rate:0,avg_cycle_time_hours:0,velocity:0},agent:{total_sessions:0,successful_sessions:0,success_rate:0,avg_turns_per_session:0,most_used_agent:"claude",total_cost_usd:0},cost_trend:[]};function DJ({budget:e}){const t=e.daily_spent/(e.daily_budget??1)*100,n=e.weekly_spent/(e.weekly_budget??1)*100;return l.jsxs(Vr,{className:"min-w-0",children:[l.jsx(Ur,{className:"pb-2",children:l.jsxs(Hr,{className:"text-sm font-medium flex items-center gap-2",children:[l.jsx(Rp,{className:"h-4 w-4"}),"Budget Status",e.warning_threshold_reached&&l.jsxs(kt,{variant:"destructive",className:"ml-auto",children:[l.jsx(eo,{className:"h-3 w-3 mr-1"}),"Near Limit"]})]})}),l.jsxs(Gr,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between text-sm",children:[l.jsx("span",{className:"text-muted-foreground",children:"Today"}),l.jsxs("span",{className:"font-medium",children:["$",e.daily_spent.toFixed(2)," / $",e.daily_budget]})]}),l.jsx("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:l.jsx("div",{className:ue("h-full transition-all",t>80?"bg-red-500":t>60?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,t)}%`}})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between text-sm",children:[l.jsx("span",{className:"text-muted-foreground",children:"This Week"}),l.jsxs("span",{className:"font-medium",children:["$",e.weekly_spent.toFixed(2)," / $",e.weekly_budget]})]}),l.jsx("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:l.jsx("div",{className:ue("h-full transition-all",n>80?"bg-red-500":n>60?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,n)}%`}})})]}),l.jsx("div",{className:"pt-2 border-t",children:l.jsxs("div",{className:"flex justify-between text-sm",children:[l.jsx("span",{className:"text-muted-foreground",children:"Monthly Remaining"}),l.jsxs("span",{className:"font-semibold text-emerald-600",children:["$",e.monthly_remaining.toFixed(2)]})]})})]})]})}function kJ({sprint:e}){return l.jsxs(Vr,{className:"min-w-0",children:[l.jsx(Ur,{className:"pb-2",children:l.jsxs(Hr,{className:"text-sm font-medium flex items-center gap-2",children:[l.jsx(oa,{className:"h-4 w-4"}),"Sprint Progress"]})}),l.jsx(Gr,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"relative w-16 h-16",children:[l.jsxs("svg",{className:"w-full h-full -rotate-90",children:[l.jsx("circle",{cx:"32",cy:"32",r:"28",stroke:"currentColor",strokeWidth:"6",fill:"none",className:"text-muted"}),l.jsx("circle",{cx:"32",cy:"32",r:"28",stroke:"currentColor",strokeWidth:"6",fill:"none",strokeDasharray:`${e.completion_rate*1.76} 176`,className:"text-emerald-500"})]}),l.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l.jsxs("span",{className:"text-sm font-bold",children:[e.completion_rate.toFixed(0),"%"]})})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"text-2xl font-bold",children:[e.completed_tickets,"/",e.total_tickets]}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"tickets completed"})]})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[l.jsxs("div",{className:"p-2 bg-blue-500/10 rounded-lg",children:[l.jsx("div",{className:"text-lg font-semibold text-blue-600",children:e.in_progress_tickets}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"In Progress"})]}),l.jsxs("div",{className:"p-2 bg-amber-500/10 rounded-lg",children:[l.jsx("div",{className:"text-lg font-semibold text-amber-600",children:e.blocked_tickets}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"Blocked"})]}),l.jsxs("div",{className:"p-2 bg-muted rounded-lg",children:[l.jsx("div",{className:"text-lg font-semibold",children:e.total_tickets-e.completed_tickets-e.in_progress_tickets-e.blocked_tickets}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"Remaining"})]})]})]})})]})}function AJ({sprint:e,agent:t}){return l.jsxs(Vr,{className:"min-w-0",children:[l.jsx(Ur,{className:"pb-2",children:l.jsxs(Hr,{className:"text-sm font-medium flex items-center gap-2",children:[l.jsx(hs,{className:"h-4 w-4"}),"Velocity & Efficiency"]})}),l.jsx(Gr,{children:l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-2xl font-bold",children:e.velocity.toFixed(1)}),l.jsx(GK,{className:"h-4 w-4 text-emerald-500"})]}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"tickets/day"})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(_p,{className:"h-4 w-4 text-muted-foreground"}),l.jsxs("span",{className:"text-2xl font-bold",children:[e.avg_cycle_time_hours.toFixed(1),"h"]})]}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"avg cycle time"})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(aa,{className:"h-4 w-4 text-emerald-500"}),l.jsxs("span",{className:"text-2xl font-bold",children:[t.success_rate.toFixed(0),"%"]})]}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"agent success"})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"text-2xl font-bold",children:t.avg_turns_per_session.toFixed(1)}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"turns/session"})]})]})})]})}function OJ({trend:e}){const t=Math.max(...e.map(n=>n.cost),1);return l.jsxs(Vr,{className:"min-w-0",children:[l.jsx(Ur,{className:"pb-2",children:l.jsxs(Hr,{className:"text-sm font-medium flex items-center gap-2",children:[l.jsx(dW,{className:"h-4 w-4"}),"Cost Trend (7 days)"]})}),l.jsxs(Gr,{children:[l.jsx("div",{className:"flex items-end gap-1 h-24",children:e.map((n,r)=>l.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1",children:[l.jsx("div",{className:ue("w-full rounded-t transition-all",n.cost>0?"bg-blue-500":"bg-muted"),style:{height:`${n.cost/t*100}%`,minHeight:n.cost>0?4:0}}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:n.date})]},r))}),l.jsxs("div",{className:"mt-2 text-right text-xs text-muted-foreground",children:["Total: $",e.reduce((n,r)=>n+r.cost,0).toFixed(2)]})]})]})}function x5({goalId:e}){const[t,n]=x.useState(RJ),[r,a]=x.useState(!0),[o,c]=x.useState(null),d=async()=>{a(!0),c(null);try{const h=await hA(e);n(h)}catch(h){console.error("Failed to fetch dashboard:",h),c(h instanceof Error?h.message:"Failed to load dashboard")}finally{a(!1)}};return x.useEffect(()=>{d()},[e]),l.jsxs("div",{className:"space-y-4 p-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Sprint Dashboard"}),l.jsx(ye,{variant:"ghost",size:"sm",onClick:d,disabled:r,children:l.jsx(pa,{className:ue("h-4 w-4",r&&"animate-spin")})})]}),o&&l.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm",children:o}),l.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2",children:[l.jsx(DJ,{budget:t.budget}),l.jsx(kJ,{sprint:t.sprint}),l.jsx(AJ,{sprint:t.sprint,agent:t.agent}),l.jsx(OJ,{trend:t.cost_trend})]})]})}function MJ(e){const{shortcuts:t,enabled:n=!0,target:r=document}=e,a=x.useRef([]),o=x.useRef(null),c=x.useCallback(f=>{const m=f.toLowerCase().split("+"),p=new Set,y=[];for(const v of m){const S=v.trim();["ctrl","control","cmd","meta","alt","shift"].includes(S)?p.add(S==="control"?"ctrl":S==="cmd"?"meta":S):y.push(S)}return{keys:y,modifiers:p}},[]),d=x.useCallback((f,m)=>{const{keys:p,modifiers:y}=c(m.key);if(p.length>1)return!1;const v=p[0],S=f.ctrlKey||f.metaKey,N=f.altKey,C=f.shiftKey,j=y.has("ctrl")||y.has("meta"),E=y.has("alt"),R=y.has("shift");return S!==j||N!==E||C!==R?!1:f.key.toLowerCase()===v||f.code.toLowerCase()===v.toLowerCase()},[c]),h=x.useCallback(f=>{const m=t.filter(y=>{if(y.key.split(" ").length<=1)return!1;const N=[...a.current,f].join(" ");return y.key===N?!0:y.key.startsWith(N+" ")});if(m.length===0)return a.current=[],null;a.current.push(f);const p=m.find(y=>y.key===a.current.join(" "));return p?(a.current=[],o.current&&clearTimeout(o.current),p):(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{a.current=[]},1e3),null)},[t]);x.useEffect(()=>{if(!n)return;const f=m=>{const p=m.target;if(p.tagName==="INPUT"||p.tagName==="TEXTAREA"||p.isContentEditable)return;const y=m.key.toLowerCase(),v=h(y);if(v){m.preventDefault(),v.handler();return}if(!(a.current.length>0)){for(const S of t)if(d(m,S)){m.preventDefault(),S.handler();break}}};return r.addEventListener("keydown",f),()=>{r.removeEventListener("keydown",f),o.current&&clearTimeout(o.current)}},[n,t,r,d,h])}function PJ({shortcuts:e=[],open:t,onOpenChange:n}){const[r,a]=x.useState(!1),o=t!==void 0?t:r,c=n||a;MJ({shortcuts:[{key:"?",handler:()=>c(!0),description:"Show keyboard shortcuts",category:"Help"}],enabled:!o});const d=e.reduce((f,m)=>{const p=m.category||"Other";return f[p]||(f[p]=[]),f[p].push(m),f},{}),h=f=>f.split(" ").map(m=>m.split("+").map(p=>p==="ctrl"?"Ctrl":p==="cmd"||p==="meta"?"⌘":p==="alt"?"Alt":p==="shift"?"Shift":p.toUpperCase()).join("+")).join(" ");return l.jsx(Br,{open:o,onOpenChange:c,children:l.jsxs(zr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[l.jsxs($s,{children:[l.jsx(Vs,{children:"Keyboard Shortcuts"}),l.jsxs(Us,{children:["Navigate faster with keyboard shortcuts. Press ",l.jsx("kbd",{children:"?"})," anytime to see this help."]})]}),l.jsx("div",{className:"space-y-6 mt-4",children:Object.entries(d).sort(([f],[m])=>f==="Global"?-1:m==="Global"?1:f.localeCompare(m)).map(([f,m])=>l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground mb-2",children:f}),l.jsx("div",{className:"space-y-1",children:m.map((p,y)=>l.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded hover:bg-accent",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:p.description||p.key}),l.jsx("kbd",{className:"px-2 py-1 text-xs font-mono bg-secondary border border-border rounded",children:h(p.key)})]},`${p.key}-${y}`))})]},f))}),l.jsx("div",{className:"mt-6 pt-4 border-t text-xs text-muted-foreground",children:l.jsxs("p",{children:["Tip: Keyboard shortcuts are disabled when typing in text fields. Press ",l.jsx("kbd",{children:"Esc"})," ","to close dialogs and return focus to the main view."]})})]})})}const Jy="smart-kanban-walkthrough-completed",ET="1.0";function y5(){const[e,t]=x.useState(()=>{const m=(typeof window<"u"?localStorage.getItem(Jy):null)!==ET;return{isFirstRun:m,currentStep:0,totalSteps:6,isOpen:m}});return{...e,nextStep:()=>{t(f=>({...f,currentStep:Math.min(f.currentStep+1,f.totalSteps-1)}))},prevStep:()=>{t(f=>({...f,currentStep:Math.max(f.currentStep-1,0)}))},goToStep:f=>{t(m=>({...m,currentStep:Math.max(0,Math.min(f,m.totalSteps-1))}))},completeWalkthrough:()=>{localStorage.setItem(Jy,ET),t(f=>({...f,isFirstRun:!1,isOpen:!1}))},openWalkthrough:()=>{t(f=>({...f,isOpen:!0,currentStep:0}))},closeWalkthrough:()=>{t(f=>({...f,isOpen:!1}))},resetWalkthrough:()=>{localStorage.removeItem(Jy),t({isFirstRun:!0,currentStep:0,totalSteps:6,isOpen:!0})}}}function LJ(){const{isOpen:e,currentStep:t,totalSteps:n,nextStep:r,prevStep:a,completeWalkthrough:o,closeWalkthrough:c}=y5(),d=[{title:"Welcome to Draft!",description:"The Autonomous Delivery System for Codebases",icon:l.jsx(Pm,{className:"h-8 w-8 text-blue-500"}),details:["Draft autonomously plans, executes, and verifies code changes","You define goals in plain English, AI handles the implementation","Full transparency with evidence trails for every action","Let's walk through your first autonomous delivery in 5 quick steps"]},{title:"Step 1: View the Demo Goal",description:"See a pre-loaded goal ready for execution",icon:l.jsx(oa,{className:"h-8 w-8 text-green-500"}),details:['Look for the demo goal: "Fix the calculator bugs and add missing tests"',"This goal describes what needs to be done, not how to do it","Draft will break it down into concrete tickets","Click on the goal card to see the full description"]},{title:"Step 2: Generate Tickets",description:"Watch AI plan the implementation",icon:l.jsx(_w,{className:"h-8 w-8 text-purple-500"}),details:['Click "Generate Tickets" button on the goal card',"Draft analyzes the demo-repo codebase","AI creates tickets with dependencies and priorities","Review the proposed tickets - they're in PROPOSED state awaiting your approval"]},{title:"Step 3: Execute Autonomously",description:"Watch the AI agent implement changes",icon:l.jsx(ia,{className:"h-8 w-8 text-amber-500"}),details:['Click "Accept All" to approve the generated tickets',"Select a ticket and click Execute","Watch real-time logs as the AI agent works","Each ticket runs in an isolated git worktree","Automatic verification runs after execution"]},{title:"Step 4: Review the Evidence",description:"Full transparency into what changed",icon:l.jsx(As,{className:"h-8 w-8 text-teal-500"}),details:["View the complete diff of all code changes","Check test results and verification output","Review the execution plan and actions taken","See cost breakdown if API keys are configured","Approve changes or request modifications"]},{title:"Step 5: Merge to Main",description:"Safe, automated merge with checklist",icon:l.jsx(Rw,{className:"h-8 w-8 text-red-500"}),details:["Once all tickets are approved, merge to main branch","Draft runs final safety checks","All worktrees are cleaned up automatically","Changes are now in your main branch!","🎉 Congratulations! You've completed your first autonomous delivery!"]}],h=d[t],f=t===d.length-1,m=t===0,p=()=>{f?o():r()},y=()=>{o()};return e?l.jsx(Br,{open:e,onOpenChange:c,children:l.jsxs(zr,{className:"max-w-2xl",showCloseButton:!1,children:[l.jsx($s,{children:l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"flex-shrink-0 mt-1",children:h.icon}),l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Vs,{className:"text-xl",children:h.title}),l.jsxs(kt,{variant:"outline",className:"ml-auto",children:[t+1," / ",n]})]}),l.jsx(Us,{className:"text-base",children:h.description})]})]})}),l.jsx("div",{className:"space-y-3 py-4",children:h.details.map((v,S)=>l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"flex-shrink-0 mt-0.5",children:l.jsx("div",{className:"h-5 w-5 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center text-xs font-medium",children:S+1})}),l.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:v})]},S))}),l.jsx("div",{className:"flex gap-1 py-2",children:d.map((v,S)=>l.jsx("div",{className:`h-1.5 flex-1 rounded-full transition-colors ${S===t?"bg-blue-500":S<t?"bg-blue-300":"bg-gray-200"}`},S))}),l.jsxs(rf,{className:"sm:justify-between",children:[l.jsxs(ye,{variant:"ghost",size:"sm",onClick:y,className:"text-muted-foreground",children:[l.jsx(On,{className:"h-4 w-4 mr-1.5"}),"Skip Tutorial"]}),l.jsxs("div",{className:"flex gap-2",children:[!m&&l.jsxs(ye,{variant:"outline",size:"sm",onClick:a,children:[l.jsx(CO,{className:"h-4 w-4 mr-1.5"}),"Previous"]}),l.jsx(ye,{onClick:p,children:f?l.jsxs(l.Fragment,{children:["Get Started",l.jsx(Pm,{className:"h-4 w-4 ml-1.5"})]}):l.jsxs(l.Fragment,{children:["Next",l.jsx(Zi,{className:"h-4 w-4 ml-1.5"})]})})]})]})]})}):null}function IJ(e){const t=BJ(e),n=x.forwardRef((r,a)=>{const{children:o,...c}=r,d=x.Children.toArray(o),h=d.find(FJ);if(h){const f=h.props.children,m=d.map(p=>p===h?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:p);return l.jsx(t,{...c,ref:a,children:x.isValidElement(f)?x.cloneElement(f,void 0,m):null})}return l.jsx(t,{...c,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function BJ(e){const t=x.forwardRef((n,r)=>{const{children:a,...o}=n;if(x.isValidElement(a)){const c=VJ(a),d=$J(o,a.props);return a.type!==x.Fragment&&(d.ref=r?fs(r,c):c),x.cloneElement(a,d)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zJ=Symbol("radix.slottable");function FJ(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zJ}function $J(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...d)=>{const h=o(...d);return a(...d),h}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function VJ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ip="Popover",[v5]=vs(Ip,[Dc]),sf=Dc(),[UJ,to]=v5(Ip),b5=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:c=!1}=e,d=sf(t),h=x.useRef(null),[f,m]=x.useState(!1),[p,y]=ma({prop:r,defaultProp:a??!1,onChange:o,caller:Ip});return l.jsx(bw,{...d,children:l.jsx(UJ,{scope:t,contentId:Un(),triggerRef:h,open:p,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(v=>!v),[y]),hasCustomAnchor:f,onCustomAnchorAdd:x.useCallback(()=>m(!0),[]),onCustomAnchorRemove:x.useCallback(()=>m(!1),[]),modal:c,children:n})})};b5.displayName=Ip;var w5="PopoverAnchor",HJ=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=to(w5,n),o=sf(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=a;return x.useEffect(()=>(c(),()=>d()),[c,d]),l.jsx(bp,{...o,...r,ref:t})});HJ.displayName=w5;var S5="PopoverTrigger",N5=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=to(S5,n),o=sf(n),c=rt(t,a.triggerRef),d=l.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":_5(a.open),...r,ref:c,onClick:Ue(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?d:l.jsx(bp,{asChild:!0,...o,children:d})});N5.displayName=S5;var Hw="PopoverPortal",[GJ,qJ]=v5(Hw,{forceMount:void 0}),j5=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,o=to(Hw,t);return l.jsx(GJ,{scope:t,forceMount:n,children:l.jsx(ya,{present:n||o.open,children:l.jsx(ef,{asChild:!0,container:a,children:r})})})};j5.displayName=Hw;var mc="PopoverContent",C5=x.forwardRef((e,t)=>{const n=qJ(mc,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,o=to(mc,e.__scopePopover);return l.jsx(ya,{present:r||o.open,children:o.modal?l.jsx(KJ,{...a,ref:t}):l.jsx(YJ,{...a,ref:t})})});C5.displayName=mc;var WJ=IJ("PopoverContent.RemoveScroll"),KJ=x.forwardRef((e,t)=>{const n=to(mc,e.__scopePopover),r=x.useRef(null),a=rt(t,r),o=x.useRef(!1);return x.useEffect(()=>{const c=r.current;if(c)return Nw(c)},[]),l.jsx(Np,{as:WJ,allowPinchZoom:!0,children:l.jsx(E5,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ue(e.onCloseAutoFocus,c=>{c.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ue(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,f=d.button===2||h;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Ue(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),YJ=x.forwardRef((e,t)=>{const n=to(mc,e.__scopePopover),r=x.useRef(!1),a=x.useRef(!1);return l.jsx(E5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=o.target;n.triggerRef.current?.contains(c)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),E5=x.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:m,...p}=e,y=to(mc,n),v=sf(n);return dw(),l.jsx(mp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:l.jsx(Jd,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:m,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:l.jsx(ww,{"data-state":_5(y.open),role:"dialog",id:y.contentId,...v,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T5="PopoverClose",XJ=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=to(T5,n);return l.jsx(He.button,{type:"button",...r,ref:t,onClick:Ue(e.onClick,()=>a.onOpenChange(!1))})});XJ.displayName=T5;var QJ="PopoverArrow",JJ=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=sf(n);return l.jsx(Sw,{...a,...r,ref:t})});JJ.displayName=QJ;function _5(e){return e?"open":"closed"}var ZJ=b5,eZ=N5,tZ=j5,R5=C5;const D5=ZJ,k5=eZ,Gw=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>l.jsx(tZ,{children:l.jsx(R5,{ref:a,align:t,sideOffset:n,className:ue("z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Gw.displayName=R5.displayName;function nZ(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var o;const c=h=>h===null?null:JSON.parse(h,void 0),d=(o=n.getItem(a))!=null?o:null;return d instanceof Promise?d.then(c):c(d)},setItem:(a,o)=>n.setItem(a,JSON.stringify(o,void 0)),removeItem:a=>n.removeItem(a)}}const L0=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return L0(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return L0(r)(n)}}}},rZ=(e,t)=>(n,r,a)=>{let o={storage:nZ(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,j)=>({...j,...C}),...t},c=!1,d=0;const h=new Set,f=new Set;let m=o.storage;if(!m)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...C)},r,a);const p=()=>{const C=o.partialize({...r()});return m.setItem(o.name,{state:C,version:o.version})},y=a.setState;a.setState=(C,j)=>(y(C,j),p());const v=e((...C)=>(n(...C),p()),r,a);a.getInitialState=()=>v;let S;const N=()=>{var C,j;if(!m)return;const E=++d;c=!1,h.forEach(A=>{var _;return A((_=r())!=null?_:v)});const R=((j=o.onRehydrateStorage)==null?void 0:j.call(o,(C=r())!=null?C:v))||void 0;return L0(m.getItem.bind(m))(o.name).then(A=>{if(A)if(typeof A.version=="number"&&A.version!==o.version){if(o.migrate){const _=o.migrate(A.state,A.version);return _ instanceof Promise?_.then(O=>[!0,O]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,A.state];return[!1,void 0]}).then(A=>{var _;if(E!==d)return;const[O,T]=A;if(S=o.merge(T,(_=r())!=null?_:v),n(S,!0),O)return p()}).then(()=>{E===d&&(R?.(S,void 0),S=r(),c=!0,f.forEach(A=>A(S)))}).catch(A=>{E===d&&R?.(void 0,A)})};return a.persist={setOptions:C=>{o={...o,...C},C.storage&&(m=C.storage)},clearStorage:()=>{m?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>N(),hasHydrated:()=>c,onHydrate:C=>(h.add(C),()=>{h.delete(C)}),onFinishHydration:C=>(f.add(C),()=>{f.delete(C)})},o.skipHydration||N(),S||v},sZ=rZ,aZ=50,Wl=fp()(sZ((e,t)=>({notifications:[],addNotification:n=>e(r=>({notifications:[{...n,id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,timestamp:Date.now(),read:!1},...r.notifications].slice(0,aZ)})),markRead:n=>e(r=>({notifications:r.notifications.map(a=>a.id===n?{...a,read:!0}:a)})),markAllRead:()=>e(n=>({notifications:n.notifications.map(r=>({...r,read:!0}))})),clearAll:()=>e({notifications:[]}),unreadCount:()=>t().notifications.filter(n=>!n.read).length}),{name:"telem-notifications"})),Vh=43200,TT=1440,_T=Symbol.for("constructDateFrom");function qw(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&_T in e?e[_T](t):e instanceof Date?new e.constructor(t):new Date(t)}function qi(e,t){return qw(e,e)}let iZ={};function oZ(){return iZ}function RT(e){const t=qi(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ww(e,...t){const n=qw.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function hm(e,t){const n=+qi(e)-+qi(t);return n<0?-1:n>0?1:n}function lZ(e){return qw(e,Date.now())}function cZ(e,t,n){const[r,a]=Ww(n?.in,e,t),o=r.getFullYear()-a.getFullYear(),c=r.getMonth()-a.getMonth();return o*12+c}function uZ(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function dZ(e,t){return+qi(e)-+qi(t)}function fZ(e,t){const n=qi(e);return n.setHours(23,59,59,999),n}function hZ(e,t){const n=qi(e),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function mZ(e,t){const n=qi(e);return+fZ(n)==+hZ(n)}function pZ(e,t,n){const[r,a,o]=Ww(n?.in,e,e,t),c=hm(a,o),d=Math.abs(cZ(a,o));if(d<1)return 0;a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-c*d);let h=hm(a,o)===-c;mZ(r)&&d===1&&hm(r,o)===1&&(h=!1);const f=c*(d-+h);return f===0?0:f}function gZ(e,t,n){const r=dZ(e,t)/1e3;return uZ(n?.roundingMethod)(r)}const xZ={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},yZ=(e,t,n)=>{let r;const a=xZ[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Zy(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const vZ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bZ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wZ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},SZ={date:Zy({formats:vZ,defaultWidth:"full"}),time:Zy({formats:bZ,defaultWidth:"full"}),dateTime:Zy({formats:wZ,defaultWidth:"full"})},NZ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},jZ=(e,t,n,r)=>NZ[e];function Pu(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=n?.width?String(n.width):c;a=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=n?.width?String(n.width):e.defaultWidth;a=e.values[d]||e.values[c]}const o=e.argumentCallback?e.argumentCallback(t):t;return a[o]}}const CZ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},EZ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},TZ={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},_Z={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},RZ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},DZ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},kZ=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},AZ={ordinalNumber:kZ,era:Pu({values:CZ,defaultWidth:"wide"}),quarter:Pu({values:EZ,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Pu({values:TZ,defaultWidth:"wide"}),day:Pu({values:_Z,defaultWidth:"wide"}),dayPeriod:Pu({values:RZ,defaultWidth:"wide",formattingValues:DZ,defaultFormattingWidth:"wide"})};function Lu(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(a);if(!o)return null;const c=o[0],d=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],h=Array.isArray(d)?MZ(d,p=>p.test(c)):OZ(d,p=>p.test(c));let f;f=e.valueCallback?e.valueCallback(h):h,f=n.valueCallback?n.valueCallback(f):f;const m=t.slice(c.length);return{value:f,rest:m}}}function OZ(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function MZ(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function PZ(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],o=t.match(e.parsePattern);if(!o)return null;let c=e.valueCallback?e.valueCallback(o[0]):o[0];c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(a.length);return{value:c,rest:d}}}const LZ=/^(\d+)(th|st|nd|rd)?/i,IZ=/\d+/i,BZ={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},zZ={any:[/^b/i,/^(a|c)/i]},FZ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$Z={any:[/1/i,/2/i,/3/i,/4/i]},VZ={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},UZ={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},HZ={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},GZ={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},qZ={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},WZ={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},KZ={ordinalNumber:PZ({matchPattern:LZ,parsePattern:IZ,valueCallback:e=>parseInt(e,10)}),era:Lu({matchPatterns:BZ,defaultMatchWidth:"wide",parsePatterns:zZ,defaultParseWidth:"any"}),quarter:Lu({matchPatterns:FZ,defaultMatchWidth:"wide",parsePatterns:$Z,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Lu({matchPatterns:VZ,defaultMatchWidth:"wide",parsePatterns:UZ,defaultParseWidth:"any"}),day:Lu({matchPatterns:HZ,defaultMatchWidth:"wide",parsePatterns:GZ,defaultParseWidth:"any"}),dayPeriod:Lu({matchPatterns:qZ,defaultMatchWidth:"any",parsePatterns:WZ,defaultParseWidth:"any"})},YZ={code:"en-US",formatDistance:yZ,formatLong:SZ,formatRelative:jZ,localize:AZ,match:KZ,options:{weekStartsOn:0,firstWeekContainsDate:1}};function XZ(e,t,n){const r=oZ(),a=n?.locale??r.locale??YZ,o=2520,c=hm(e,t);if(isNaN(c))throw new RangeError("Invalid time value");const d=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:c}),[h,f]=Ww(n?.in,...c>0?[t,e]:[e,t]),m=gZ(f,h),p=(RT(f)-RT(h))/1e3,y=Math.round((m-p)/60);let v;if(y<2)return n?.includeSeconds?m<5?a.formatDistance("lessThanXSeconds",5,d):m<10?a.formatDistance("lessThanXSeconds",10,d):m<20?a.formatDistance("lessThanXSeconds",20,d):m<40?a.formatDistance("halfAMinute",0,d):m<60?a.formatDistance("lessThanXMinutes",1,d):a.formatDistance("xMinutes",1,d):y===0?a.formatDistance("lessThanXMinutes",1,d):a.formatDistance("xMinutes",y,d);if(y<45)return a.formatDistance("xMinutes",y,d);if(y<90)return a.formatDistance("aboutXHours",1,d);if(y<TT){const S=Math.round(y/60);return a.formatDistance("aboutXHours",S,d)}else{if(y<o)return a.formatDistance("xDays",1,d);if(y<Vh){const S=Math.round(y/TT);return a.formatDistance("xDays",S,d)}else if(y<Vh*2)return v=Math.round(y/Vh),a.formatDistance("aboutXMonths",v,d)}if(v=pZ(f,h),v<12){const S=Math.round(y/Vh);return a.formatDistance("xMonths",S,d)}else{const S=v%12,N=Math.trunc(v/12);return S<3?a.formatDistance("aboutXYears",N,d):S<9?a.formatDistance("overXYears",N,d):a.formatDistance("almostXYears",N+1,d)}}function Kw(e,t){return XZ(e,lZ(e),t)}function QZ({type:e}){switch(e){case"success":return l.jsx(As,{className:"h-4 w-4 text-emerald-500 flex-shrink-0"});case"error":return l.jsx(Hn,{className:"h-4 w-4 text-red-500 flex-shrink-0"});case"warning":return l.jsx(eo,{className:"h-4 w-4 text-amber-500 flex-shrink-0"});default:return l.jsx(Bs,{className:"h-4 w-4 text-blue-500 flex-shrink-0"})}}function JZ(){const e=Sc(),{currentBoard:t}=ys(),n=Wl(m=>m.notifications),r=Wl(m=>m.markRead),a=Wl(m=>m.markAllRead),o=Wl(m=>m.clearAll),c=Wl(m=>m.notifications.filter(p=>!p.read).length),[d,h]=x.useState(!1),f=m=>{r(m.id),m.ticketId&&t?.id&&(h(!1),e(`/boards/${t.id}/tickets/${m.ticketId}`))};return l.jsxs(D5,{open:d,onOpenChange:h,children:[l.jsx(k5,{asChild:!0,children:l.jsxs(ye,{variant:"ghost",size:"sm",className:"h-8 relative",title:"Notifications",children:[l.jsx(uT,{className:"h-4 w-4"}),c>0&&l.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center h-4 min-w-[16px] rounded-full bg-destructive text-destructive-foreground text-[10px] font-bold px-1",children:c>9?"9+":c})]})}),l.jsxs(Gw,{className:"w-80 p-0",align:"end",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b",children:[l.jsx("span",{className:"text-sm font-medium",children:"Notifications"}),l.jsxs("div",{className:"flex items-center gap-1",children:[c>0&&l.jsxs(ye,{variant:"ghost",size:"sm",className:"h-6 text-xs px-2",onClick:a,children:[l.jsx(qt,{className:"h-3 w-3 mr-1"}),"Mark all read"]}),n.length>0&&l.jsxs(ye,{variant:"ghost",size:"sm",className:"h-6 text-xs px-2",onClick:o,children:[l.jsx(Gi,{className:"h-3 w-3 mr-1"}),"Clear"]})]})]}),l.jsx("div",{className:"max-h-[360px] overflow-y-auto",children:n.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[l.jsx(uT,{className:"h-8 w-8 mb-2 opacity-30"}),l.jsx("p",{className:"text-xs",children:"No notifications yet"})]}):n.map(m=>l.jsxs("button",{className:ue("w-full text-left px-3 py-2.5 flex items-start gap-2.5 hover:bg-muted/50 transition-colors border-b border-border/30 last:border-0",!m.read&&"bg-muted/30",m.ticketId&&"cursor-pointer"),onClick:()=>f(m),children:[l.jsx(QZ,{type:m.type}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:ue("text-xs",!m.read&&"font-medium"),children:m.title}),m.description&&l.jsx("p",{className:"text-[11px] text-muted-foreground truncate mt-0.5",children:m.description}),l.jsx("p",{className:"text-[10px] text-muted-foreground/60 mt-1",children:Kw(m.timestamp,{addSuffix:!0})})]}),!m.read&&l.jsx("span",{className:"h-2 w-2 rounded-full bg-primary flex-shrink-0 mt-1"})]},m.id))})]})]})}var DT=1,ZZ=.9,eee=.8,tee=.17,ev=.1,tv=.999,nee=.9999,ree=.99,see=/[\\\/_+.#"@\[\(\{&]/,aee=/[\\\/_+.#"@\[\(\{&]/g,iee=/[\s-]/,A5=/[\s-]/g;function I0(e,t,n,r,a,o,c){if(o===t.length)return a===e.length?DT:ree;var d=`${a},${o}`;if(c[d]!==void 0)return c[d];for(var h=r.charAt(o),f=n.indexOf(h,a),m=0,p,y,v,S;f>=0;)p=I0(e,t,n,r,f+1,o+1,c),p>m&&(f===a?p*=DT:see.test(e.charAt(f-1))?(p*=eee,v=e.slice(a,f-1).match(aee),v&&a>0&&(p*=Math.pow(tv,v.length))):iee.test(e.charAt(f-1))?(p*=ZZ,S=e.slice(a,f-1).match(A5),S&&a>0&&(p*=Math.pow(tv,S.length))):(p*=tee,a>0&&(p*=Math.pow(tv,f-a))),e.charAt(f)!==t.charAt(o)&&(p*=nee)),(p<ev&&n.charAt(f-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(f-1)!==r.charAt(o))&&(y=I0(e,t,n,r,f+1,o+2,c),y*ev>p&&(p=y*ev)),p>m&&(m=p),f=n.indexOf(h,f+1);return c[d]=m,m}function kT(e){return e.toLowerCase().replace(A5," ")}function oee(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,I0(e,t,kT(e),kT(t),0,0,{})}var Iu='[cmdk-group=""]',nv='[cmdk-group-items=""]',lee='[cmdk-group-heading=""]',O5='[cmdk-item=""]',AT=`${O5}:not([aria-disabled="true"])`,B0="cmdk-item-select",Kl="data-value",cee=(e,t,n)=>oee(e,t,n),M5=x.createContext(void 0),af=()=>x.useContext(M5),P5=x.createContext(void 0),Yw=()=>x.useContext(P5),L5=x.createContext(void 0),I5=x.forwardRef((e,t)=>{let n=Yl(()=>{var $,X;return{search:"",value:(X=($=e.value)!=null?$:e.defaultValue)!=null?X:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Yl(()=>new Set),a=Yl(()=>new Map),o=Yl(()=>new Map),c=Yl(()=>new Set),d=B5(e),{label:h,children:f,value:m,onValueChange:p,filter:y,shouldFilter:v,loop:S,disablePointerSelection:N=!1,vimBindings:C=!0,...j}=e,E=Un(),R=Un(),A=Un(),_=x.useRef(null),O=bee();Xo(()=>{if(m!==void 0){let $=m.trim();n.current.value=$,T.emit()}},[m]),Xo(()=>{O(6,G)},[]);let T=x.useMemo(()=>({subscribe:$=>(c.current.add($),()=>c.current.delete($)),snapshot:()=>n.current,setState:($,X,Q)=>{var q,ce,ne,xe;if(!Object.is(n.current[$],X)){if(n.current[$]=X,$==="search")V(),W(),O(1,M);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let be=document.getElementById(A);be?be.focus():(q=document.getElementById(E))==null||q.focus()}if(O(7,()=>{var be;n.current.selectedItemId=(be=F())==null?void 0:be.id,T.emit()}),Q||O(5,G),((ce=d.current)==null?void 0:ce.value)!==void 0){let be=X??"";(xe=(ne=d.current).onValueChange)==null||xe.call(ne,be);return}}T.emit()}},emit:()=>{c.current.forEach($=>$())}}),[]),D=x.useMemo(()=>({value:($,X,Q)=>{var q;X!==((q=o.current.get($))==null?void 0:q.value)&&(o.current.set($,{value:X,keywords:Q}),n.current.filtered.items.set($,B(X,Q)),O(2,()=>{W(),T.emit()}))},item:($,X)=>(r.current.add($),X&&(a.current.has(X)?a.current.get(X).add($):a.current.set(X,new Set([$]))),O(3,()=>{V(),W(),n.current.value||M(),T.emit()}),()=>{o.current.delete($),r.current.delete($),n.current.filtered.items.delete($);let Q=F();O(4,()=>{V(),Q?.getAttribute("id")===$&&M(),T.emit()})}),group:$=>(a.current.has($)||a.current.set($,new Set),()=>{o.current.delete($),a.current.delete($)}),filter:()=>d.current.shouldFilter,label:h||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:E,inputId:A,labelId:R,listInnerRef:_}),[]);function B($,X){var Q,q;let ce=(q=(Q=d.current)==null?void 0:Q.filter)!=null?q:cee;return $?ce($,n.current.search,X):0}function W(){if(!n.current.search||d.current.shouldFilter===!1)return;let $=n.current.filtered.items,X=[];n.current.filtered.groups.forEach(q=>{let ce=a.current.get(q),ne=0;ce.forEach(xe=>{let be=$.get(xe);ne=Math.max(be,ne)}),X.push([q,ne])});let Q=_.current;H().sort((q,ce)=>{var ne,xe;let be=q.getAttribute("id"),De=ce.getAttribute("id");return((ne=$.get(De))!=null?ne:0)-((xe=$.get(be))!=null?xe:0)}).forEach(q=>{let ce=q.closest(nv);ce?ce.appendChild(q.parentElement===ce?q:q.closest(`${nv} > *`)):Q.appendChild(q.parentElement===Q?q:q.closest(`${nv} > *`))}),X.sort((q,ce)=>ce[1]-q[1]).forEach(q=>{var ce;let ne=(ce=_.current)==null?void 0:ce.querySelector(`${Iu}[${Kl}="${encodeURIComponent(q[0])}"]`);ne?.parentElement.appendChild(ne)})}function M(){let $=H().find(Q=>Q.getAttribute("aria-disabled")!=="true"),X=$?.getAttribute(Kl);T.setState("value",X||void 0)}function V(){var $,X,Q,q;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ce=0;for(let ne of r.current){let xe=(X=($=o.current.get(ne))==null?void 0:$.value)!=null?X:"",be=(q=(Q=o.current.get(ne))==null?void 0:Q.keywords)!=null?q:[],De=B(xe,be);n.current.filtered.items.set(ne,De),De>0&&ce++}for(let[ne,xe]of a.current)for(let be of xe)if(n.current.filtered.items.get(be)>0){n.current.filtered.groups.add(ne);break}n.current.filtered.count=ce}function G(){var $,X,Q;let q=F();q&&((($=q.parentElement)==null?void 0:$.firstChild)===q&&((Q=(X=q.closest(Iu))==null?void 0:X.querySelector(lee))==null||Q.scrollIntoView({block:"nearest"})),q.scrollIntoView({block:"nearest"}))}function F(){var $;return($=_.current)==null?void 0:$.querySelector(`${O5}[aria-selected="true"]`)}function H(){var $;return Array.from((($=_.current)==null?void 0:$.querySelectorAll(AT))||[])}function P($){let X=H()[$];X&&T.setState("value",X.getAttribute(Kl))}function U($){var X;let Q=F(),q=H(),ce=q.findIndex(xe=>xe===Q),ne=q[ce+$];(X=d.current)!=null&&X.loop&&(ne=ce+$<0?q[q.length-1]:ce+$===q.length?q[0]:q[ce+$]),ne&&T.setState("value",ne.getAttribute(Kl))}function z($){let X=F(),Q=X?.closest(Iu),q;for(;Q&&!q;)Q=$>0?yee(Q,Iu):vee(Q,Iu),q=Q?.querySelector(AT);q?T.setState("value",q.getAttribute(Kl)):U($)}let te=()=>P(H().length-1),oe=$=>{$.preventDefault(),$.metaKey?te():$.altKey?z(1):U(1)},L=$=>{$.preventDefault(),$.metaKey?P(0):$.altKey?z(-1):U(-1)};return x.createElement(He.div,{ref:t,tabIndex:-1,...j,"cmdk-root":"",onKeyDown:$=>{var X;(X=j.onKeyDown)==null||X.call(j,$);let Q=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||Q))switch($.key){case"n":case"j":{C&&$.ctrlKey&&oe($);break}case"ArrowDown":{oe($);break}case"p":case"k":{C&&$.ctrlKey&&L($);break}case"ArrowUp":{L($);break}case"Home":{$.preventDefault(),P(0);break}case"End":{$.preventDefault(),te();break}case"Enter":{$.preventDefault();let q=F();if(q){let ce=new Event(B0);q.dispatchEvent(ce)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:See},h),Bp(e,$=>x.createElement(P5.Provider,{value:T},x.createElement(M5.Provider,{value:D},$))))}),uee=x.forwardRef((e,t)=>{var n,r;let a=Un(),o=x.useRef(null),c=x.useContext(L5),d=af(),h=B5(e),f=(r=(n=h.current)==null?void 0:n.forceMount)!=null?r:c?.forceMount;Xo(()=>{if(!f)return d.item(a,c?.id)},[f]);let m=z5(a,o,[e.value,e.children,o],e.keywords),p=Yw(),y=Wi(O=>O.value&&O.value===m.current),v=Wi(O=>f||d.filter()===!1?!0:O.search?O.filtered.items.get(a)>0:!0);x.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(B0,S),()=>O.removeEventListener(B0,S)},[v,e.onSelect,e.disabled]);function S(){var O,T;N(),(T=(O=h.current).onSelect)==null||T.call(O,m.current)}function N(){p.setState("value",m.current,!0)}if(!v)return null;let{disabled:C,value:j,onSelect:E,forceMount:R,keywords:A,..._}=e;return x.createElement(He.div,{ref:fs(o,t),..._,id:a,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!y,"data-disabled":!!C,"data-selected":!!y,onPointerMove:C||d.getDisablePointerSelection()?void 0:N,onClick:C?void 0:S},e.children)}),dee=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,c=Un(),d=x.useRef(null),h=x.useRef(null),f=Un(),m=af(),p=Wi(v=>a||m.filter()===!1?!0:v.search?v.filtered.groups.has(c):!0);Xo(()=>m.group(c),[]),z5(c,d,[e.value,e.heading,h]);let y=x.useMemo(()=>({id:c,forceMount:a}),[a]);return x.createElement(He.div,{ref:fs(d,t),...o,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&x.createElement("div",{ref:h,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Bp(e,v=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},x.createElement(L5.Provider,{value:y},v))))}),fee=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=x.useRef(null),o=Wi(c=>!c.search);return!n&&!o?null:x.createElement(He.div,{ref:fs(a,t),...r,"cmdk-separator":"",role:"separator"})}),hee=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=Yw(),c=Wi(f=>f.search),d=Wi(f=>f.selectedItemId),h=af();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(He.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":h.listId,"aria-labelledby":h.labelId,"aria-activedescendant":d,id:h.inputId,type:"text",value:a?e.value:c,onChange:f=>{a||o.setState("search",f.target.value),n?.(f.target.value)}})}),mee=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,o=x.useRef(null),c=x.useRef(null),d=Wi(f=>f.selectedItemId),h=af();return x.useEffect(()=>{if(c.current&&o.current){let f=c.current,m=o.current,p,y=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=f.offsetHeight;m.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return y.observe(f),()=>{cancelAnimationFrame(p),y.unobserve(f)}}},[]),x.createElement(He.div,{ref:fs(o,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":r,id:h.listId},Bp(e,f=>x.createElement("div",{ref:fs(c,h.listInnerRef),"cmdk-list-sizer":""},f)))}),pee=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:c,...d}=e;return x.createElement(Mw,{open:n,onOpenChange:r},x.createElement(Pw,{container:c},x.createElement(Lw,{"cmdk-overlay":"",className:a}),x.createElement(Iw,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(I5,{ref:t,...d}))))}),gee=x.forwardRef((e,t)=>Wi(n=>n.filtered.count===0)?x.createElement(He.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),xee=x.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...o}=e;return x.createElement(He.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Bp(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),vi=Object.assign(I5,{List:mee,Item:uee,Input:hee,Group:dee,Separator:fee,Dialog:pee,Empty:gee,Loading:xee});function yee(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function vee(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function B5(e){let t=x.useRef(e);return Xo(()=>{t.current=e}),t}var Xo=typeof window>"u"?x.useEffect:x.useLayoutEffect;function Yl(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Wi(e){let t=Yw(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function z5(e,t,n,r=[]){let a=x.useRef(),o=af();return Xo(()=>{var c;let d=(()=>{var f;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(f=m.current.textContent)==null?void 0:f.trim():a.current}})(),h=r.map(f=>f.trim());o.value(e,d,h),(c=t.current)==null||c.setAttribute(Kl,d),a.current=d}),a}var bee=()=>{let[e,t]=x.useState(),n=Yl(()=>new Map);return Xo(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function wee(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Bp({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(wee(t),{ref:t.ref},n(t.props.children)):n(t)}var See={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const of=fp(e=>({selectedTicketId:null,detailDrawerOpen:!1,selectTicket:t=>e({selectedTicketId:t,detailDrawerOpen:!0}),clearSelection:()=>e({selectedTicketId:null,detailDrawerOpen:!1}),setDetailDrawerOpen:t=>e(n=>({detailDrawerOpen:t,selectedTicketId:t?n.selectedTicketId:null}))})),Nee={proposed:"bg-slate-400",planned:"bg-blue-400",executing:"bg-amber-400",verifying:"bg-purple-400",needs_human:"bg-orange-400",blocked:"bg-red-400",done:"bg-emerald-400",abandoned:"bg-gray-400"};function jee({commands:e}){const[t,n]=x.useState(!1),r=Ga(),a=lw(m=>m.currentBoardId),o=of(m=>m.selectTicket);x.useEffect(()=>{const m=p=>{(p.metaKey||p.ctrlKey)&&p.key==="k"&&(p.preventDefault(),n(y=>!y)),p.key==="Escape"&&n(!1)};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[]);const c=x.useMemo(()=>{if(!a)return[];const m=r.getQueryData(tr.boards.view(a));return m?.columns?m.columns.flatMap(p=>p.tickets):[]},[a,r,t]),d=x.useMemo(()=>{const m={};for(const p of e){const y=p.category||"Other";m[y]||(m[y]=[]),m[y].push(p)}return Object.entries(m).sort(([p],[y])=>p.localeCompare(y))},[e]),h=x.useCallback(m=>{n(!1),o(m)},[o]),f=x.useCallback(m=>{n(!1),m.onSelect()},[]);return t?l.jsxs("div",{className:"fixed inset-0 z-50",children:[l.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>n(!1)}),l.jsx("div",{className:"absolute top-[20%] left-1/2 -translate-x-1/2 w-full max-w-lg",children:l.jsxs(vi,{className:"rounded-xl border border-border bg-popover shadow-2xl overflow-hidden",loop:!0,children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[l.jsx(kp,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsx(vi.Input,{placeholder:"Search tickets, actions...",className:"flex h-11 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground",autoFocus:!0})]}),l.jsxs(vi.List,{className:"max-h-80 overflow-y-auto p-1.5",children:[l.jsx(vi.Empty,{className:"py-6 text-center text-sm text-muted-foreground",children:"No results found."}),d.map(([m,p])=>l.jsx(vi.Group,{heading:m,className:"px-1 [&_[cmdk-group-heading]]:text-[11px] [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5",children:p.map(y=>{const v=y.icon;return l.jsxs(vi.Item,{value:`${y.label} ${y.description||""} ${(y.keywords||[]).join(" ")}`,onSelect:()=>f(y),className:"flex items-center justify-between gap-2 px-2 py-1.5 text-sm rounded-md cursor-pointer aria-selected:bg-accent",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[v&&l.jsx(v,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex flex-col min-w-0",children:[l.jsx("span",{className:"truncate",children:y.label}),y.description&&l.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:y.description})]})]}),y.shortcut&&l.jsx("kbd",{className:"px-1.5 py-0.5 text-[10px] font-mono bg-muted border border-border rounded shrink-0",children:y.shortcut})]},y.id)})},m)),c.length>0&&l.jsx(vi.Group,{heading:"Tickets",className:"px-1 [&_[cmdk-group-heading]]:text-[11px] [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5",children:c.map(m=>l.jsxs(vi.Item,{value:`${m.title} ${m.id}`,onSelect:()=>h(m.id),className:"flex items-center gap-2 px-2 py-1.5 text-sm rounded-md cursor-pointer aria-selected:bg-accent",children:[l.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${Nee[m.state]||"bg-gray-400"}`}),l.jsx("span",{className:"truncate flex-1",children:m.title}),l.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:Rr[m.state]})]},m.id))})]}),l.jsxs("div",{className:"border-t border-border px-3 py-2 flex items-center justify-between text-[11px] text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{children:[l.jsx("kbd",{className:"bg-muted px-1 py-0.5 rounded text-[10px]",children:"↑↓"})," ","navigate"]}),l.jsxs("span",{children:[l.jsx("kbd",{className:"bg-muted px-1 py-0.5 rounded text-[10px]",children:"↵"})," ","select"]}),l.jsxs("span",{children:[l.jsx("kbd",{className:"bg-muted px-1 py-0.5 rounded text-[10px]",children:"esc"})," ","close"]})]}),l.jsxs("span",{children:[l.jsx("kbd",{className:"bg-muted px-1 py-0.5 rounded text-[10px]",children:"⌘K"})," ","to open"]})]})]})})]}):null}function Cee({status:e}){if(!e.isOffline)return null;const t=e.lastSeen?`Last connected ${Eee(e.lastSeen)}`:"Never connected";return l.jsxs("div",{className:"fixed inset-x-0 top-0 z-[100] flex items-center justify-center gap-3 bg-destructive/95 px-4 py-3 text-destructive-foreground shadow-lg backdrop-blur-sm",children:[l.jsx(IO,{className:"h-5 w-5 shrink-0"}),l.jsxs("div",{className:"text-sm font-medium",children:["Backend is unreachable.",l.jsx("span",{className:"ml-2 text-xs opacity-75",children:t})]}),l.jsxs(ye,{size:"sm",variant:"secondary",onClick:()=>e.wake(),disabled:e.waking,className:"ml-2 h-7 gap-1.5",children:[e.waking?l.jsx(ke,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(jK,{className:"h-3.5 w-3.5"}),e.waking?"Starting...":"Start Backend"]})]})}function Eee(e){const t=Math.round((Date.now()-e)/1e3);if(t<60)return`${t}s ago`;const n=Math.round(t/60);return n<60?`${n}m ago`:`${Math.round(n/60)}h ago`}let Tee=class extends x.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("ErrorBoundary caught:",t,n)}handleRetry=()=>{this.setState({hasError:!1,error:null})};render(){return this.state.hasError?this.props.fallback?this.props.fallback:l.jsxs("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[l.jsx(Hn,{className:"h-12 w-12 text-destructive mb-4"}),l.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Something went wrong"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-md",children:this.state.error?.message||"An unexpected error occurred."}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(ye,{variant:"outline",onClick:this.handleRetry,children:[l.jsx(pa,{className:"h-4 w-4 mr-2"}),"Try Again"]}),l.jsx(ye,{variant:"outline",onClick:()=>window.location.reload(),children:"Reload Page"})]})]}):this.props.children}};const Xw={dark:{name:"dark",displayName:"Dark",colors:{background:"hsl(220 20% 10%)",foreground:"hsl(0 0% 95%)",card:"hsl(220 15% 13%)",cardForeground:"hsl(0 0% 95%)",popover:"hsl(220 15% 13%)",popoverForeground:"hsl(0 0% 95%)",primary:"hsl(25 82% 54%)",primaryForeground:"hsl(0 0% 100%)",secondary:"hsl(220 15% 18%)",secondaryForeground:"hsl(0 0% 80%)",muted:"hsl(220 15% 18%)",mutedForeground:"hsl(0 0% 50%)",accent:"hsl(220 15% 22%)",accentForeground:"hsl(0 0% 90%)",destructive:"hsl(0 72% 51%)",destructiveForeground:"hsl(0 0% 100%)",border:"hsl(220 15% 25%)",input:"hsl(220 15% 25%)",ring:"hsl(25 82% 54%)"}},light:{name:"light",displayName:"Light",colors:{background:"hsl(0 0% 98%)",foreground:"hsl(0 0% 10%)",card:"hsl(0 0% 100%)",cardForeground:"hsl(0 0% 10%)",popover:"hsl(0 0% 100%)",popoverForeground:"hsl(0 0% 10%)",primary:"hsl(25 82% 54%)",primaryForeground:"hsl(0 0% 100%)",secondary:"hsl(0 0% 96%)",secondaryForeground:"hsl(0 0% 10%)",muted:"hsl(0 0% 96%)",mutedForeground:"hsl(0 0% 45%)",accent:"hsl(0 0% 94%)",accentForeground:"hsl(0 0% 10%)",destructive:"hsl(0 84% 60%)",destructiveForeground:"hsl(0 0% 98%)",border:"hsl(0 0% 90%)",input:"hsl(0 0% 90%)",ring:"hsl(25 82% 54%)"}},hud:{name:"hud",displayName:"HUD (Monitoring)",colors:{background:"hsl(200 80% 5%)",foreground:"hsl(180 100% 70%)",card:"hsl(200 50% 10%)",cardForeground:"hsl(180 100% 70%)",popover:"hsl(200 50% 10%)",popoverForeground:"hsl(180 100% 70%)",primary:"hsl(120 100% 50%)",primaryForeground:"hsl(200 80% 5%)",secondary:"hsl(200 60% 8%)",secondaryForeground:"hsl(180 80% 50%)",muted:"hsl(200 60% 8%)",mutedForeground:"hsl(180 40% 35%)",accent:"hsl(180 100% 15%)",accentForeground:"hsl(180 100% 70%)",destructive:"hsl(0 100% 50%)",destructiveForeground:"hsl(0 0% 100%)",border:"hsl(180 100% 30%)",input:"hsl(180 100% 30%)",ring:"hsl(120 100% 50%)"},effects:{glow:!0,scanlines:!0}}},_ee={background:"background",foreground:"foreground",card:"card",cardForeground:"card-foreground",popover:"popover",popoverForeground:"popover-foreground",primary:"primary",primaryForeground:"primary-foreground",secondary:"secondary",secondaryForeground:"secondary-foreground",muted:"muted",mutedForeground:"muted-foreground",accent:"accent",accentForeground:"accent-foreground",destructive:"destructive",destructiveForeground:"destructive-foreground",border:"border",input:"input",ring:"ring"};function F5(e){const t=Xw[e];if(!t){console.warn(`Theme "${e}" not found`);return}const n=document.documentElement;for(const[r,a]of Object.entries(t.colors)){const o=_ee[r];o&&n.style.setProperty(`--color-${o}`,a)}n.style.setProperty("--color-textHigh",t.colors.foreground),n.style.setProperty("--color-textNormal",t.colors.secondaryForeground),n.style.setProperty("--color-textLow",t.colors.mutedForeground),n.style.setProperty("--color-brand",t.colors.primary),n.classList.remove("theme-dark","theme-light","theme-hud"),n.classList.add(`theme-${t.name}`),n.classList.toggle("effect-glow",!!t.effects?.glow),n.classList.toggle("effect-scanlines",!!t.effects?.scanlines)}function $5(){const e=localStorage.getItem("smart-kanban-theme");return e&&Xw[e]?e:"dark"}function Ree(e){localStorage.setItem("smart-kanban-theme",e)}function Dee({variant:e="dropdown",className:t=""}){const[n,r]=x.useState($5());x.useEffect(()=>{F5(n)},[n]);const a=o=>{r(o),Ree(o)};return e==="buttons"?l.jsxs("div",{className:`flex items-center gap-1 ${t}`,children:[l.jsx(ye,{size:"sm",variant:n==="light"?"default":"ghost",onClick:()=>a("light"),title:"Light theme",children:l.jsx(Yy,{className:"h-4 w-4"})}),l.jsx(ye,{size:"sm",variant:n==="dark"?"default":"ghost",onClick:()=>a("dark"),title:"Dark theme",children:l.jsx(Ky,{className:"h-4 w-4"})}),l.jsx(ye,{size:"sm",variant:n==="hud"?"default":"ghost",onClick:()=>a("hud"),title:"HUD mode (monitoring)",children:l.jsx(Wy,{className:"h-4 w-4"})})]}):l.jsxs("div",{className:t,children:[l.jsxs(ms,{value:n,onValueChange:a,children:[l.jsx(gs,{className:"w-[180px]",children:l.jsxs("div",{className:"flex items-center gap-2",children:[n==="light"&&l.jsx(Yy,{className:"h-4 w-4"}),n==="dark"&&l.jsx(Ky,{className:"h-4 w-4"}),n==="hud"&&l.jsx(Wy,{className:"h-4 w-4"}),l.jsx(ps,{placeholder:"Select theme"})]})}),l.jsx(zs,{children:l.jsxs(HY,{children:[l.jsx(GY,{children:"Theme"}),Object.entries(Xw).map(([o,c])=>l.jsx(Vt,{value:o,children:l.jsxs("div",{className:"flex items-center gap-2",children:[o==="light"&&l.jsx(Yy,{className:"h-4 w-4"}),o==="dark"&&l.jsx(Ky,{className:"h-4 w-4"}),o==="hud"&&l.jsx(Wy,{className:"h-4 w-4"}),l.jsx("span",{children:c.displayName})]})},o))]})})]}),n==="hud"&&l.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"HUD mode includes glow effects and scanlines for a futuristic monitoring dashboard look."})]})}const kee=1e4,Aee=3e4,OT=2,Oee=6e4;function Mee(){const[e,t]=x.useState(!1),[n,r]=x.useState(null),[a,o]=x.useState(!1),c=x.useRef(0),d=x.useRef(void 0),h=x.useRef(0),f=x.useCallback(async()=>{try{if((await fetch(`${Qd.backendBaseUrl}/health`,{method:"GET",signal:AbortSignal.timeout(5e3)})).ok){c.current=0,t(!1),r(Date.now());return}}catch{}if(c.current+=1,c.current>=OT){t(!0);const y=Date.now();y-h.current>Oee&&(h.current=y,fetch("/__api/wake-backend",{signal:AbortSignal.timeout(2e4)}).then(v=>{v.ok&&(c.current=0,t(!1),r(Date.now()))}).catch(()=>{}))}},[]),m=x.useCallback(()=>{c.current=0,f()},[f]),p=x.useCallback(async()=>{o(!0);try{(await fetch("/__api/wake-backend",{signal:AbortSignal.timeout(2e4)})).ok&&(c.current=0,t(!1),r(Date.now()))}catch{}finally{o(!1)}},[]);return x.useEffect(()=>{f();const y=()=>{d.current=setTimeout(()=>{f().finally(y)},c.current>=OT?Aee:kee)};return y(),()=>clearTimeout(d.current)},[f]),{isOffline:e,lastSeen:n,retry:m,wake:p,waking:a}}var Pee=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var o in a)a.hasOwnProperty(o)&&(r[o]=a[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Lee=Object.prototype.hasOwnProperty;function z0(e,t){return Lee.call(e,t)}function F0(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var r=[];for(var a in e)z0(e,a)&&r.push(a);return r}function Ar(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function $0(e){for(var t=0,n=e.length,r;t<n;){if(r=e.charCodeAt(t),r>=48&&r<=57){t++;continue}return!1}return!0}function Ao(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function V5(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function V0(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(V0(e[t]))return!0}else if(typeof e=="object"){for(var r=F0(e),a=r.length,o=0;o<a;o++)if(V0(e[r[o]]))return!0}}return!1}function MT(e,t){var n=[e];for(var r in t){var a=typeof t[r]=="object"?JSON.stringify(t[r],null,2):t[r];typeof a<"u"&&n.push(r+": "+a)}return n.join(`
79
+ `)}var U5=(function(e){Pee(t,e);function t(n,r,a,o,c){var d=this.constructor,h=e.call(this,MT(n,{name:r,index:a,operation:o,tree:c}))||this;return h.name=r,h.index=a,h.operation=o,h.tree=c,Object.setPrototypeOf(h,d.prototype),h.message=MT(n,{name:r,index:a,operation:o,tree:c}),h}return t})(Error),Jt=U5,Iee=Ar,nc={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=zm(n,this.path);r&&(r=Ar(r));var a=Vo(n,{op:"remove",path:this.from}).removed;return Vo(n,{op:"add",path:this.path,value:a}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=zm(n,this.from);return Vo(n,{op:"add",path:this.path,value:Ar(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:Dd(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},Bee={add:function(e,t,n){return $0(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var r=e.splice(t,1);return{newDocument:n,removed:r[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:nc.move,copy:nc.copy,test:nc.test,_get:nc._get};function zm(e,t){if(t=="")return e;var n={op:"_get",path:t};return Vo(e,n),n.value}function Vo(e,t,n,r,a,o){if(n===void 0&&(n=!1),r===void 0&&(r=!0),a===void 0&&(a=!0),o===void 0&&(o=0),n&&(typeof n=="function"?n(t,0,e,t.path):Fm(t,0)),t.path===""){var c={newDocument:e};if(t.op==="add")return c.newDocument=t.value,c;if(t.op==="replace")return c.newDocument=t.value,c.removed=e,c;if(t.op==="move"||t.op==="copy")return c.newDocument=zm(e,t.from),t.op==="move"&&(c.removed=e),c;if(t.op==="test"){if(c.test=Dd(e,t.value),c.test===!1)throw new Jt("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return c.newDocument=e,c}else{if(t.op==="remove")return c.removed=e,c.newDocument=null,c;if(t.op==="_get")return t.value=e,c;if(n)throw new Jt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return c}}else{r||(e=Ar(e));var d=t.path||"",h=d.split("/"),f=e,m=1,p=h.length,y=void 0,v=void 0,S=void 0;for(typeof n=="function"?S=n:S=Fm;;){if(v=h[m],v&&v.indexOf("~")!=-1&&(v=V5(v)),a&&(v=="__proto__"||v=="prototype"&&m>0&&h[m-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&y===void 0&&(f[v]===void 0?y=h.slice(0,m).join("/"):m==p-1&&(y=t.path),y!==void 0&&S(t,0,e,y)),m++,Array.isArray(f)){if(v==="-")v=f.length;else{if(n&&!$0(v))throw new Jt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);$0(v)&&(v=~~v)}if(m>=p){if(n&&t.op==="add"&&v>f.length)throw new Jt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var c=Bee[t.op].call(t,f,v,e);if(c.test===!1)throw new Jt("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return c}}else if(m>=p){var c=nc[t.op].call(t,f,v,e);if(c.test===!1)throw new Jt("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return c}if(f=f[v],n&&m<p&&(!f||typeof f!="object"))throw new Jt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}function zp(e,t,n,r,a){if(r===void 0&&(r=!0),a===void 0&&(a=!0),n&&!Array.isArray(t))throw new Jt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(e=Ar(e));for(var o=new Array(t.length),c=0,d=t.length;c<d;c++)o[c]=Vo(e,t[c],n,!0,a,c),e=o[c].newDocument;return o.newDocument=e,o}function zee(e,t,n){var r=Vo(e,t);if(r.test===!1)throw new Jt("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return r.newDocument}function Fm(e,t,n,r){if(typeof e!="object"||e===null||Array.isArray(e))throw new Jt("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(nc[e.op]){if(typeof e.path!="string")throw new Jt("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Jt('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Jt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Jt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&V0(e.value))throw new Jt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var a=e.path.split("/").length,o=r.split("/").length;if(a!==o+1&&a!==o)throw new Jt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==r)throw new Jt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var c={op:"_get",path:e.from,value:void 0},d=H5([c],n);if(d&&d.name==="OPERATION_PATH_UNRESOLVABLE")throw new Jt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Jt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function H5(e,t,n){try{if(!Array.isArray(e))throw new Jt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)zp(Ar(t),Ar(e),n||!0);else{n=n||Fm;for(var r=0;r<e.length;r++)n(e[r],r,t,void 0)}}catch(a){if(a instanceof Jt)return a;throw a}}function Dd(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),r=Array.isArray(t),a,o,c;if(n&&r){if(o=e.length,o!=t.length)return!1;for(a=o;a--!==0;)if(!Dd(e[a],t[a]))return!1;return!0}if(n!=r)return!1;var d=Object.keys(e);if(o=d.length,o!==Object.keys(t).length)return!1;for(a=o;a--!==0;)if(!t.hasOwnProperty(d[a]))return!1;for(a=o;a--!==0;)if(c=d[a],!Dd(e[c],t[c]))return!1;return!0}return e!==e&&t!==t}const Fee=Object.freeze(Object.defineProperty({__proto__:null,JsonPatchError:Jt,_areEquals:Dd,applyOperation:Vo,applyPatch:zp,applyReducer:zee,deepClone:Iee,getValueByPointer:zm,validate:H5,validator:Fm},Symbol.toStringTag,{value:"Module"}));var Qw=new WeakMap,$ee=(function(){function e(t){this.observers=new Map,this.obj=t}return e})(),Vee=(function(){function e(t,n){this.callback=t,this.observer=n}return e})();function Uee(e){return Qw.get(e)}function Hee(e,t){return e.observers.get(t)}function Gee(e,t){e.observers.delete(t.callback)}function qee(e,t){t.unobserve()}function Wee(e,t){var n=[],r,a=Uee(e);if(!a)a=new $ee(e),Qw.set(e,a);else{var o=Hee(a,t);r=o&&o.observer}if(r)return r;if(r={},a.value=Ar(e),t){r.callback=t,r.next=null;var c=function(){U0(r)},d=function(){clearTimeout(r.next),r.next=setTimeout(c)};typeof window<"u"&&(window.addEventListener("mouseup",d),window.addEventListener("keyup",d),window.addEventListener("mousedown",d),window.addEventListener("keydown",d),window.addEventListener("change",d))}return r.patches=n,r.object=e,r.unobserve=function(){U0(r),clearTimeout(r.next),Gee(a,r),typeof window<"u"&&(window.removeEventListener("mouseup",d),window.removeEventListener("keyup",d),window.removeEventListener("mousedown",d),window.removeEventListener("keydown",d),window.removeEventListener("change",d))},a.observers.set(t,new Vee(t,r)),r}function U0(e,t){t===void 0&&(t=!1);var n=Qw.get(e.object);Jw(n.value,e.object,e.patches,"",t),e.patches.length&&zp(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function Jw(e,t,n,r,a){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=F0(t),c=F0(e),d=!1,h=c.length-1;h>=0;h--){var f=c[h],m=e[f];if(z0(t,f)&&!(t[f]===void 0&&m!==void 0&&Array.isArray(t)===!1)){var p=t[f];typeof m=="object"&&m!=null&&typeof p=="object"&&p!=null&&Array.isArray(m)===Array.isArray(p)?Jw(m,p,n,r+"/"+Ao(f),a):m!==p&&(a&&n.push({op:"test",path:r+"/"+Ao(f),value:Ar(m)}),n.push({op:"replace",path:r+"/"+Ao(f),value:Ar(p)}))}else Array.isArray(e)===Array.isArray(t)?(a&&n.push({op:"test",path:r+"/"+Ao(f),value:Ar(m)}),n.push({op:"remove",path:r+"/"+Ao(f)}),d=!0):(a&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}))}if(!(!d&&o.length==c.length))for(var h=0;h<o.length;h++){var f=o[h];!z0(e,f)&&t[f]!==void 0&&n.push({op:"add",path:r+"/"+Ao(f),value:Ar(t[f])})}}}function Kee(e,t,n){n===void 0&&(n=!1);var r=[];return Jw(e,t,r,"",n),r}const Yee=Object.freeze(Object.defineProperty({__proto__:null,compare:Kee,generate:U0,observe:Wee,unobserve:qee},Symbol.toStringTag,{value:"Module"}));Object.assign({},Fee,Yee,{JsonPatchError:U5,deepClone:Ar,escapePathComponent:Ao,unescapePathComponent:V5});const Xee=window.location.protocol==="https:"?"wss:":"ws:",Qee="localhost:8000",Jee=`${Xee}//${Qee}`;function Zee(e){const t=Ga(),[n,r]=x.useState("disconnected"),[a,o]=x.useState(null),[c,d]=x.useState([]),[h,f]=x.useState(),m=x.useRef(null),p=x.useRef(null),y=x.useRef(null),v=x.useRef(new Set),S=x.useRef(0),N=x.useCallback(C=>(v.current.add(C),()=>{v.current.delete(C)}),[]);return x.useEffect(()=>{if(!e){r("disconnected");return}let C=0;const j=5,E=2e3;function R(){m.current&&m.current.close(),r("connecting"),f(void 0);const A=new WebSocket(`${Jee}/ws/board/${e}`);m.current=A,A.onopen=()=>{r("connected"),C=0,A.send("subscribe"),y.current=setInterval(()=>{A.readyState===WebSocket.OPEN&&A.send("ping")},3e4)},A.onclose=_=>{r("disconnected"),y.current&&(clearInterval(y.current),y.current=null),_.code!==1e3&&C<j&&(C++,p.current=setTimeout(()=>{R()},Math.min(E*2**C,3e4)))},A.onerror=()=>{r("error"),f("WebSocket connection error")},A.onmessage=_=>{try{if(_.data==="pong")return;const O=JSON.parse(_.data);if(o(O),O.type!=="subscribed"&&d(T=>{const D=[...T,O];return D.length>100?D.slice(-100):D}),e){const T=tr.boards.view(e);if(O.type==="snapshot"&&O.data)t.setQueryData(T,O.data),S.current=O.seq??0;else if(O.type==="patch"&&O.ops){const D=S.current+1;if(O.seq!==void 0&&O.seq!==D)console.warn(`Patch seq gap: expected ${D}, got ${O.seq}. Requesting resync.`),m.current?.readyState===WebSocket.OPEN&&m.current.send(JSON.stringify({type:"resync"}));else{const B=t.getQueryData(T);if(B)try{const W=zp(structuredClone(B),O.ops,!1,!1).newDocument;t.setQueryData(T,W),S.current=O.seq??S.current+1}catch(W){console.warn("Failed to apply JSON patch, requesting resync:",W),m.current?.readyState===WebSocket.OPEN&&m.current.send(JSON.stringify({type:"resync"}))}else m.current?.readyState===WebSocket.OPEN&&m.current.send(JSON.stringify({type:"resync"}))}}else O.type!=="subscribed"&&t.invalidateQueries({queryKey:T})}v.current.forEach(T=>{try{T(O)}catch(D){console.error("Board update listener error:",D)}})}catch(O){console.error("Failed to parse WebSocket message:",O)}}}return R(),()=>{p.current&&clearTimeout(p.current),y.current&&clearInterval(y.current),m.current&&m.current.close(1e3,"Component unmounted")}},[e]),{isConnected:n==="connected",status:n,lastUpdate:a,updates:c,error:h,subscribe:N}}function ete(e){const{subscribe:t,status:n,isConnected:r}=Zee(e),a=Wl(o=>o.addNotification);return x.useEffect(()=>e?t(c=>{if(c.type==="job_completed"){const d=c.data?.status==="SUCCEEDED";a({type:d?"success":"error",title:d?"Job completed":"Job failed",description:c.ticket_id?`Ticket ${c.ticket_id.slice(0,8)}...`:void 0,ticketId:c.ticket_id})}if(c.type==="ticket_update"&&c.data){const d=c.data.state;d==="needs_human"?a({type:"warning",title:"Ticket needs review",description:c.data.title||`Ticket ${c.ticket_id?.slice(0,8)}...`,ticketId:c.ticket_id}):d==="blocked"?a({type:"error",title:"Ticket blocked",description:c.data.title||`Ticket ${c.ticket_id?.slice(0,8)}...`,ticketId:c.ticket_id}):d==="done"&&a({type:"success",title:"Ticket completed",description:c.data.title||`Ticket ${c.ticket_id?.slice(0,8)}...`,ticketId:c.ticket_id})}}):void 0,[e,t,a]),{wsStatus:n,wsConnected:r}}const tte=({...e})=>l.jsx(tQ,{theme:"system",className:"toaster group",icons:{success:l.jsx(aa,{className:"size-4"}),info:l.jsx(Bs,{className:"size-4"}),warning:l.jsx(eo,{className:"size-4"}),error:l.jsx(pK,{className:"size-4"}),loading:l.jsx(ke,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e});function nte(e){const t=[];return e.ctrl&&t.push("ctrl"),e.alt&&t.push("alt"),e.shift&&t.push("shift"),e.meta&&t.push("meta"),t.push(e.key.toLowerCase()),t.join("+")}function rte(e,t){return t.ctrl&&!e.ctrlKey||t.alt&&!e.altKey||t.shift&&!e.shiftKey||t.meta&&!e.metaKey||!t.ctrl&&e.ctrlKey||!t.alt&&e.altKey||!t.shift&&e.shiftKey||!t.meta&&e.metaKey?!1:e.key.toLowerCase()===t.key.toLowerCase()}function ste(e,t={}){const{enabled:n=!0}=t,r=x.useMemo(()=>{const o=new Map;return e.forEach(c=>{c.disabled||o.set(nte(c),c)}),o},[e]),a=x.useCallback(o=>{const c=o.target;if(!(c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.isContentEditable)){for(const d of r.values())if(rte(o,d)){o.preventDefault(),o.stopPropagation(),d.action();return}}},[r]);return x.useEffect(()=>{if(n)return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n,a]),{shortcuts:Array.from(r.values())}}function ate(e){const t=[{key:"g",description:"Go to board",action:e.onGoToBoard||(()=>{}),disabled:!e.onGoToBoard},{key:"j",description:"Navigate down",action:e.onNavigateDown||(()=>{}),disabled:!e.onNavigateDown},{key:"k",description:"Navigate up",action:e.onNavigateUp||(()=>{}),disabled:!e.onNavigateUp},{key:"Enter",description:"Select/Open",action:e.onSelect||(()=>{}),disabled:!e.onSelect},{key:"n",description:"New ticket",action:e.onNewTicket||(()=>{}),disabled:!e.onNewTicket},{key:"e",description:"Execute ticket",action:e.onExecute||(()=>{}),disabled:!e.onExecute},{key:"r",description:"Refresh",action:e.onRefresh||(()=>{}),disabled:!e.onRefresh},{key:"/",description:"Search",action:e.onSearch||(()=>{}),disabled:!e.onSearch},{key:"k",ctrl:!0,description:"Command palette",action:e.onSearch||(()=>{}),disabled:!e.onSearch},{key:"b",description:"Toggle sidebar",action:e.onToggleSidebar||(()=>{}),disabled:!e.onToggleSidebar},{key:"?",description:"Show shortcuts help",action:e.onHelp||(()=>{}),disabled:!e.onHelp}].filter(n=>!n.disabled);return ste(t)}const G5=fp(e=>({goalDialogOpen:!1,ticketDialogOpen:!1,goalsListOpen:!1,queueStatusOpen:!1,debugPanelOpen:!1,dashboardOpen:!1,shortcutsHelpOpen:!1,repoDiscoveryOpen:!1,boardSettingsOpen:!1,setGoalDialogOpen:t=>e({goalDialogOpen:t}),setTicketDialogOpen:t=>e({ticketDialogOpen:t}),setGoalsListOpen:t=>e({goalsListOpen:t}),setQueueStatusOpen:t=>e({queueStatusOpen:t}),setDebugPanelOpen:t=>e({debugPanelOpen:t}),setDashboardOpen:t=>e({dashboardOpen:t}),setShortcutsHelpOpen:t=>e({shortcutsHelpOpen:t}),setRepoDiscoveryOpen:t=>e({repoDiscoveryOpen:t}),setBoardSettingsOpen:t=>e({boardSettingsOpen:t}),toggleDebugPanel:()=>e(t=>({debugPanelOpen:!t.debugPanelOpen}))}));function ite(){const e=Mee(),t=Ga(),n=Sc(),r=ga(),{boardId:a}=WR(),o=G5(),{currentBoard:c,setCurrentBoard:d}=ys();x.useEffect(()=>{a&&a!==c?.id&&d(a)},[a,c?.id,d]);const{wsStatus:h}=ete(c?.id),{selectTicket:f,selectedTicketId:m}=of(),[p,y]=x.useState(0),v=x.useCallback(()=>{y(j=>j+1),t.invalidateQueries({queryKey:tr.boards.all})},[t]),{data:S}=ow(c?.id,!1),N=x.useMemo(()=>S?.columns?.flatMap(j=>j.tickets.map(E=>E.id))??[],[S?.columns]),C=x.useCallback(j=>{if(N.length===0)return;const E=m?N.indexOf(m):-1;let R;j==="down"?R=E<N.length-1?E+1:0:R=E>0?E-1:N.length-1,f(N[R])},[N,m,f]);return ate({onNewTicket:()=>o.setTicketDialogOpen(!0),onRefresh:v,onGoToBoard:()=>{o.setDashboardOpen(!1),n("/")},onHelp:()=>o.setShortcutsHelpOpen(!0),onNavigateDown:()=>C("down"),onNavigateUp:()=>C("up"),onSelect:()=>{m&&c?.id&&n(`/boards/${c.id}/tickets/${m}`)}}),l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsx(Cee,{status:e}),l.jsx("header",{className:"border-b border-border bg-card sticky top-0 z-40 shadow-sm",children:l.jsx("div",{className:"container mx-auto px-6 py-3",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("h1",{className:"text-base font-bold text-foreground uppercase tracking-wider cursor-pointer",onClick:()=>n("/"),children:Qd.appName}),l.jsx(KY,{}),l.jsxs(ye,{variant:"outline",size:"sm",onClick:()=>o.setRepoDiscoveryOpen(!0),className:"h-8",title:"Discover and add projects",children:[l.jsx(RO,{className:"h-4 w-4 mr-1.5"}),"Add Projects"]})]}),l.jsxs("nav",{className:"flex items-center gap-2",children:[c&&l.jsx("div",{className:"flex items-center gap-1.5 px-2 h-8 text-xs text-muted-foreground",title:`WebSocket: ${h}`,children:h==="connected"?l.jsx(JK,{className:"h-3.5 w-3.5 text-emerald-500"}):h==="connecting"?l.jsx(ke,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):l.jsx(IO,{className:"h-3.5 w-3.5 text-destructive"})}),l.jsx(Dee,{variant:"buttons"}),l.jsxs(ye,{variant:o.debugPanelOpen?"secondary":"ghost",size:"sm",onClick:()=>o.toggleDebugPanel(),className:"h-8",title:"Debug Panel - Live logs and system status",children:[l.jsx(N0,{className:"h-4 w-4 mr-1.5"}),"Debug"]}),l.jsxs(ye,{variant:"outline",size:"sm",onClick:()=>o.setGoalsListOpen(!0),className:"h-8",children:[l.jsx(oa,{className:"h-4 w-4 mr-1.5"}),"Goals"]}),l.jsxs(ye,{variant:"outline",size:"sm",onClick:()=>o.setGoalDialogOpen(!0),className:"h-8",children:[l.jsx(ld,{className:"h-4 w-4 mr-1.5"}),"New Goal"]}),l.jsxs(ye,{variant:"default",size:"sm",onClick:()=>o.setTicketDialogOpen(!0),className:"h-8",children:[l.jsx(ld,{className:"h-4 w-4 mr-1.5"}),"New Ticket"]}),l.jsx(JZ,{}),l.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>n("/settings"),className:"h-8",title:"Settings",children:l.jsx(Td,{className:"h-4 w-4"})}),l.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>o.setShortcutsHelpOpen(!0),className:"h-8",title:"Keyboard Shortcuts (?)",children:l.jsx(C0,{className:"h-4 w-4"})})]})]})})}),l.jsx("main",{className:"container mx-auto px-6 py-4",children:l.jsx(Tee,{children:l.jsx(tU,{mode:"wait",children:l.jsx(cH.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.15,ease:"easeOut"},children:l.jsx(n6,{context:{refreshTrigger:p,refreshBoard:v,currentBoard:c}})},r.pathname)})})}),l.jsx(fQ,{open:o.goalDialogOpen,onOpenChange:o.setGoalDialogOpen,onSuccess:v}),l.jsx(xQ,{open:o.ticketDialogOpen,onOpenChange:o.setTicketDialogOpen,onSuccess:v}),l.jsx(wJ,{open:o.goalsListOpen,onOpenChange:o.setGoalsListOpen,onBoardRefresh:v}),l.jsx(jJ,{open:o.queueStatusOpen,onOpenChange:o.setQueueStatusOpen}),l.jsx(nQ,{open:o.repoDiscoveryOpen,onOpenChange:o.setRepoDiscoveryOpen,onReposAdded:v}),c&&l.jsx(tJ,{open:o.boardSettingsOpen,onOpenChange:o.setBoardSettingsOpen,boardId:c.id,onTicketsDeleted:v,onBoardDeleted:()=>{t.invalidateQueries({queryKey:tr.boards.all}),n("/")}}),l.jsx(_J,{isOpen:o.debugPanelOpen,onClose:()=>o.setDebugPanelOpen(!1)}),l.jsx(Br,{open:o.dashboardOpen,onOpenChange:o.setDashboardOpen,children:l.jsx(zr,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:l.jsx(x5,{})})}),l.jsx(PJ,{open:o.shortcutsHelpOpen,onOpenChange:o.setShortcutsHelpOpen}),l.jsx(LJ,{}),l.jsx(jee,{commands:[{id:"new-ticket",label:"Create New Ticket",description:"Add a new ticket to the board",icon:ld,shortcut:"n",category:"Actions",onSelect:()=>o.setTicketDialogOpen(!0),keywords:["add","ticket","task"]},{id:"new-goal",label:"Create New Goal",description:"Define a new development goal",icon:oa,category:"Actions",onSelect:()=>o.setGoalDialogOpen(!0),keywords:["add","goal","objective"]},{id:"goals",label:"View Goals",description:"Browse all goals",icon:oa,category:"Navigation",onSelect:()=>o.setGoalsListOpen(!0)},{id:"settings",label:"Open Settings",icon:Td,category:"Navigation",onSelect:()=>n("/settings")},{id:"debug",label:"Toggle Debug Panel",icon:N0,category:"Navigation",onSelect:()=>o.toggleDebugPanel()},{id:"refresh",label:"Refresh Board",description:"Re-fetch all board data",category:"Actions",onSelect:v,keywords:["reload","update"]},{id:"shortcuts",label:"Keyboard Shortcuts",icon:C0,category:"Help",onSelect:()=>o.setShortcutsHelpOpen(!0)}]}),l.jsx(tte,{richColors:!0,position:"bottom-right"})]})}function Qn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ote=typeof Symbol=="function"&&Symbol.observable||"@@observable",PT=ote,LT=()=>Math.random().toString(36).substring(7).split("").join("."),lte={INIT:`@@redux/INIT${LT()}`,REPLACE:`@@redux/REPLACE${LT()}`},IT=lte;function cte(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function q5(e,t,n){if(typeof e!="function")throw new Error(Qn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Qn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Qn(1));return n(q5)(e,t)}let r=e,a=t,o=new Map,c=o,d=0,h=!1;function f(){c===o&&(c=new Map,o.forEach((C,j)=>{c.set(j,C)}))}function m(){if(h)throw new Error(Qn(3));return a}function p(C){if(typeof C!="function")throw new Error(Qn(4));if(h)throw new Error(Qn(5));let j=!0;f();const E=d++;return c.set(E,C),function(){if(j){if(h)throw new Error(Qn(6));j=!1,f(),c.delete(E),o=null}}}function y(C){if(!cte(C))throw new Error(Qn(7));if(typeof C.type>"u")throw new Error(Qn(8));if(typeof C.type!="string")throw new Error(Qn(17));if(h)throw new Error(Qn(9));try{h=!0,a=r(a,C)}finally{h=!1}return(o=c).forEach(E=>{E()}),C}function v(C){if(typeof C!="function")throw new Error(Qn(10));r=C,y({type:IT.REPLACE})}function S(){const C=p;return{subscribe(j){if(typeof j!="object"||j===null)throw new Error(Qn(11));function E(){const A=j;A.next&&A.next(m())}return E(),{unsubscribe:C(E)}},[PT](){return this}}}return y({type:IT.INIT}),{dispatch:y,subscribe:p,getState:m,replaceReducer:v,[PT]:S}}function BT(e,t){return function(...n){return t(e.apply(this,n))}}function zT(e,t){if(typeof e=="function")return BT(e,t);if(typeof e!="object"||e===null)throw new Error(Qn(16));const n={};for(const r in e){const a=e[r];typeof a=="function"&&(n[r]=BT(a,t))}return n}function W5(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function ute(...e){return t=>(n,r)=>{const a=t(n,r);let o=()=>{throw new Error(Qn(15))};const c={getState:a.getState,dispatch:(h,...f)=>o(h,...f)},d=e.map(h=>h(c));return o=W5(...d)(a.dispatch),{...a,dispatch:o}}}var rv={exports:{}},sv={};var FT;function dte(){if(FT)return sv;FT=1;var e=Vd();function t(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,a=e.useRef,o=e.useEffect,c=e.useMemo,d=e.useDebugValue;return sv.useSyncExternalStoreWithSelector=function(h,f,m,p,y){var v=a(null);if(v.current===null){var S={hasValue:!1,value:null};v.current=S}else S=v.current;v=c(function(){function C(_){if(!j){if(j=!0,E=_,_=p(_),y!==void 0&&S.hasValue){var O=S.value;if(y(O,_))return R=O}return R=_}if(O=R,n(E,_))return O;var T=p(_);return y!==void 0&&y(O,T)?(E=_,O):(E=_,R=T)}var j=!1,E,R,A=m===void 0?null:m;return[function(){return C(f())},A===null?void 0:function(){return C(A())}]},[f,m,p,y]);var N=r(h,v[0],v[1]);return o(function(){S.hasValue=!0,S.value=N},[N]),d(N),N},sv}var $T;function fte(){return $T||($T=1,rv.exports=dte()),rv.exports}fte();var hte=x.version.startsWith("19"),mte=Symbol.for(hte?"react.transitional.element":"react.element"),pte=Symbol.for("react.portal"),gte=Symbol.for("react.fragment"),xte=Symbol.for("react.strict_mode"),yte=Symbol.for("react.profiler"),vte=Symbol.for("react.consumer"),bte=Symbol.for("react.context"),K5=Symbol.for("react.forward_ref"),wte=Symbol.for("react.suspense"),Ste=Symbol.for("react.suspense_list"),Zw=Symbol.for("react.memo"),Nte=Symbol.for("react.lazy"),jte=K5,Cte=Zw;function Ete(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case mte:switch(e=e.type,e){case gte:case yte:case xte:case wte:case Ste:return e;default:switch(e=e&&e.$$typeof,e){case bte:case K5:case Nte:case Zw:return e;case vte:return e;default:return t}}case pte:return t}}}function Tte(e){return Ete(e)===Zw}function _te(e,t,n,r,{areStatesEqual:a,areOwnPropsEqual:o,areStatePropsEqual:c}){let d=!1,h,f,m,p,y;function v(E,R){return h=E,f=R,m=e(h,f),p=t(r,f),y=n(m,p,f),d=!0,y}function S(){return m=e(h,f),t.dependsOnOwnProps&&(p=t(r,f)),y=n(m,p,f),y}function N(){return e.dependsOnOwnProps&&(m=e(h,f)),t.dependsOnOwnProps&&(p=t(r,f)),y=n(m,p,f),y}function C(){const E=e(h,f),R=!c(E,m);return m=E,R&&(y=n(m,p,f)),y}function j(E,R){const A=!o(R,f),_=!a(E,h,R,f);return h=E,f=R,A&&_?S():A?N():_?C():y}return function(R,A){return d?j(R,A):v(R,A)}}function Rte(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...a}){const o=t(e,a),c=n(e,a),d=r(e,a);return _te(o,c,d,e,a)}function Dte(e,t){const n={};for(const r in e){const a=e[r];typeof a=="function"&&(n[r]=(...o)=>t(a(...o)))}return n}function H0(e){return function(n){const r=e(n);function a(){return r}return a.dependsOnOwnProps=!1,a}}function VT(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Y5(e,t){return function(r,{displayName:a}){const o=function(d,h){return o.dependsOnOwnProps?o.mapToProps(d,h):o.mapToProps(d,void 0)};return o.dependsOnOwnProps=!0,o.mapToProps=function(d,h){o.mapToProps=e,o.dependsOnOwnProps=VT(e);let f=o(d,h);return typeof f=="function"&&(o.mapToProps=f,o.dependsOnOwnProps=VT(f),f=o(d,h)),f},o}}function e1(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function kte(e){return e&&typeof e=="object"?H0(t=>Dte(e,t)):e?typeof e=="function"?Y5(e):e1(e,"mapDispatchToProps"):H0(t=>({dispatch:t}))}function Ate(e){return e?typeof e=="function"?Y5(e):e1(e,"mapStateToProps"):H0(()=>({}))}function Ote(e,t,n){return{...n,...e,...t}}function Mte(e){return function(n,{displayName:r,areMergedPropsEqual:a}){let o=!1,c;return function(h,f,m){const p=e(h,f,m);return o?a(p,c)||(c=p):(o=!0,c=p),c}}}function Pte(e){return e?typeof e=="function"?Mte(e):e1(e,"mergeProps"):()=>Ote}function Lte(e){e()}function Ite(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Lte(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const a=t={callback:n,next:null,prev:t};return a.prev?a.prev.next=a:e=a,function(){!r||e===null||(r=!1,a.next?a.next.prev=a.prev:t=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}var UT={notify(){},get:()=>[]};function X5(e,t){let n,r=UT,a=0,o=!1;function c(N){m();const C=r.subscribe(N);let j=!1;return()=>{j||(j=!0,C(),p())}}function d(){r.notify()}function h(){S.onStateChange&&S.onStateChange()}function f(){return o}function m(){a++,n||(n=t?t.addNestedSub(h):e.subscribe(h),r=Ite())}function p(){a--,n&&a===0&&(n(),n=void 0,r.clear(),r=UT)}function y(){o||(o=!0,m())}function v(){o&&(o=!1,p())}const S={addNestedSub:c,notifyNestedSubs:d,handleChangeWrapper:h,isSubscribed:f,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return S}var Bte=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",zte=Bte(),Fte=()=>typeof navigator<"u"&&navigator.product==="ReactNative",$te=Fte(),Vte=()=>zte||$te?x.useLayoutEffect:x.useEffect,$m=Vte();function HT(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function av(e,t){if(HT(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let a=0;a<n.length;a++)if(!Object.prototype.hasOwnProperty.call(t,n[a])||!HT(e[n[a]],t[n[a]]))return!1;return!0}var Ute={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Hte={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Gte={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Q5={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},qte={[jte]:Gte,[Cte]:Q5};function GT(e){return Tte(e)?Q5:qte[e.$$typeof]||Ute}var Wte=Object.defineProperty,Kte=Object.getOwnPropertyNames,qT=Object.getOwnPropertySymbols,Yte=Object.getOwnPropertyDescriptor,Xte=Object.getPrototypeOf,WT=Object.prototype;function G0(e,t){if(typeof t!="string"){if(WT){const o=Xte(t);o&&o!==WT&&G0(e,o)}let n=Kte(t);qT&&(n=n.concat(qT(t)));const r=GT(e),a=GT(t);for(let o=0;o<n.length;++o){const c=n[o];if(!Hte[c]&&!(a&&a[c])&&!(r&&r[c])){const d=Yte(t,c);try{Wte(e,c,d)}catch{}}}}return e}var Qte=Symbol.for("react-redux-context"),Jte=typeof globalThis<"u"?globalThis:{};function Zte(){if(!x.createContext)return{};const e=Jte[Qte]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var J5=Zte(),ene=[null,null];function tne(e,t,n){$m(()=>e(...t),n)}function nne(e,t,n,r,a,o){e.current=r,n.current=!1,a.current&&(a.current=null,o())}function rne(e,t,n,r,a,o,c,d,h,f,m){if(!e)return()=>{};let p=!1,y=null;const v=()=>{if(p||!d.current)return;const N=t.getState();let C,j;try{C=r(N,a.current)}catch(E){j=E,y=E}j||(y=null),C===o.current?c.current||f():(o.current=C,h.current=C,c.current=!0,m())};return n.onStateChange=v,n.trySubscribe(),v(),()=>{if(p=!0,n.tryUnsubscribe(),n.onStateChange=null,y)throw y}}function sne(e,t){return e===t}function ane(e,t,n,{pure:r,areStatesEqual:a=sne,areOwnPropsEqual:o=av,areStatePropsEqual:c=av,areMergedPropsEqual:d=av,forwardRef:h=!1,context:f=J5}={}){const m=f,p=Ate(e),y=kte(t),v=Pte(n),S=!!e;return C=>{const j=C.displayName||C.name||"Component",E=`Connect(${j})`,R={shouldHandleStateChanges:S,displayName:E,wrappedComponentName:j,WrappedComponent:C,initMapStateToProps:p,initMapDispatchToProps:y,initMergeProps:v,areStatesEqual:a,areStatePropsEqual:c,areOwnPropsEqual:o,areMergedPropsEqual:d};function A(T){const[D,B,W]=x.useMemo(()=>{const{reactReduxForwardedRef:we,..._e}=T;return[T.context,we,_e]},[T]),M=x.useMemo(()=>{let we=m;return D?.Consumer,we},[D,m]),V=x.useContext(M),G=!!T.store&&!!T.store.getState&&!!T.store.dispatch,F=!!V&&!!V.store,H=G?T.store:V.store,P=F?V.getServerState:H.getState,U=x.useMemo(()=>Rte(H.dispatch,R),[H]),[z,te]=x.useMemo(()=>{if(!S)return ene;const we=X5(H,G?void 0:V.subscription),_e=we.notifyNestedSubs.bind(we);return[we,_e]},[H,G,V]),oe=x.useMemo(()=>G?V:{...V,subscription:z},[G,V,z]),L=x.useRef(void 0),$=x.useRef(W),X=x.useRef(void 0),Q=x.useRef(!1),q=x.useRef(!1),ce=x.useRef(void 0);$m(()=>(q.current=!0,()=>{q.current=!1}),[]);const ne=x.useMemo(()=>()=>X.current&&W===$.current?X.current:U(H.getState(),W),[H,W]),xe=x.useMemo(()=>_e=>z?rne(S,H,z,U,$,L,Q,q,X,te,_e):()=>{},[z]);tne(nne,[$,L,Q,W,X,te]);let be;try{be=x.useSyncExternalStore(xe,ne,P?()=>U(P(),W):ne)}catch(we){throw ce.current&&(we.message+=`
80
+ The error may be correlated with this previous error:
81
+ ${ce.current.stack}
82
+
83
+ `),we}$m(()=>{ce.current=void 0,X.current=void 0,L.current=be});const De=x.useMemo(()=>x.createElement(C,{...be,ref:B}),[B,C,be]);return x.useMemo(()=>S?x.createElement(M.Provider,{value:oe},De):De,[M,De,oe])}const O=x.memo(A);if(O.WrappedComponent=C,O.displayName=A.displayName=E,h){const D=x.forwardRef(function(W,M){return x.createElement(O,{...W,reactReduxForwardedRef:M})});return D.displayName=E,D.WrappedComponent=C,G0(D,C)}return G0(O,C)}}var Z5=ane;function ine(e){const{children:t,context:n,serverState:r,store:a}=e,o=x.useMemo(()=>{const h=X5(a);return{store:a,subscription:h,getServerState:r?()=>r:void 0}},[a,r]),c=x.useMemo(()=>a.getState(),[a]);$m(()=>{const{subscription:h}=o;return h.onStateChange=h.notifyNestedSubs,h.trySubscribe(),c!==a.getState()&&h.notifyNestedSubs(),()=>{h.tryUnsubscribe(),h.onStateChange=void 0}},[o,c]);const d=n||J5;return x.createElement(d.Provider,{value:o},t)}var one=ine,lne="Invariant failed";function cne(e,t){throw new Error(lne)}var Os=function(t){var n=t.top,r=t.right,a=t.bottom,o=t.left,c=r-o,d=a-n,h={top:n,right:r,bottom:a,left:o,width:c,height:d,x:o,y:n,center:{x:(r+o)/2,y:(a+n)/2}};return h},t1=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},KT=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},une=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},iv={top:0,right:0,bottom:0,left:0},n1=function(t){var n=t.borderBox,r=t.margin,a=r===void 0?iv:r,o=t.border,c=o===void 0?iv:o,d=t.padding,h=d===void 0?iv:d,f=Os(t1(n,a)),m=Os(KT(n,c)),p=Os(KT(m,h));return{marginBox:f,borderBox:Os(n),paddingBox:m,contentBox:p,margin:a,border:c,padding:h}},ss=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var a=Number(n);return isNaN(a)&&cne(),a},dne=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Vm=function(t,n){var r=t.borderBox,a=t.border,o=t.margin,c=t.padding,d=une(r,n);return n1({borderBox:d,border:a,margin:o,padding:c})},Um=function(t,n){return n===void 0&&(n=dne()),Vm(t,n)},eP=function(t,n){var r={top:ss(n.marginTop),right:ss(n.marginRight),bottom:ss(n.marginBottom),left:ss(n.marginLeft)},a={top:ss(n.paddingTop),right:ss(n.paddingRight),bottom:ss(n.paddingBottom),left:ss(n.paddingLeft)},o={top:ss(n.borderTopWidth),right:ss(n.borderRightWidth),bottom:ss(n.borderBottomWidth),left:ss(n.borderLeftWidth)};return n1({borderBox:t,margin:r,padding:a,border:o})},tP=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return eP(n,r)},kd=function(t){var n=[],r=null,a=function(){for(var c=arguments.length,d=new Array(c),h=0;h<c;h++)d[h]=arguments[h];n=d,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return a.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},a};function Hm(){return Hm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hm.apply(null,arguments)}function nP(e,t){}nP.bind(null,"warn");nP.bind(null,"error");function Ii(){}function fne(e,t){return{...e,...t}}function ls(e,t,n){const r=t.map(a=>{const o=fne(n,a.options);return e.addEventListener(a.eventName,a.fn,o),function(){e.removeEventListener(a.eventName,a.fn,o)}});return function(){r.forEach(o=>{o()})}}const hne="Invariant failed";class Gm extends Error{}Gm.prototype.toString=function(){return this.message};function je(e,t){throw new Gm(hne)}class mne extends ge.Component{constructor(...t){super(...t),this.callbacks=null,this.unbind=Ii,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&r.tryAbort(),n.error instanceof Gm&&n.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=n=>{this.callbacks=n}}componentDidMount(){this.unbind=ls(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(t){if(t instanceof Gm){this.setState({});return}throw t}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const pne=`
84
+ Press space bar to start a drag.
85
+ When dragging you can use the arrow keys to move the item around and escape to cancel.
86
+ Some screen readers may require you to be in focus mode or to use your pass through key
87
+ `,qm=e=>e+1,gne=e=>`
88
+ You have lifted an item in position ${qm(e.source.index)}
89
+ `,rP=(e,t)=>{const n=e.droppableId===t.droppableId,r=qm(e.index),a=qm(t.index);return n?`
90
+ You have moved the item from position ${r}
91
+ to position ${a}
92
+ `:`
93
+ You have moved the item from position ${r}
94
+ in list ${e.droppableId}
95
+ to list ${t.droppableId}
96
+ in position ${a}
97
+ `},sP=(e,t,n)=>t.droppableId===n.droppableId?`
98
+ The item ${e}
99
+ has been combined with ${n.draggableId}`:`
100
+ The item ${e}
101
+ in list ${t.droppableId}
102
+ has been combined with ${n.draggableId}
103
+ in list ${n.droppableId}
104
+ `,xne=e=>{const t=e.destination;if(t)return rP(e.source,t);const n=e.combine;return n?sP(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},YT=e=>`
105
+ The item has returned to its starting position
106
+ of ${qm(e.index)}
107
+ `,yne=e=>{if(e.reason==="CANCEL")return`
108
+ Movement cancelled.
109
+ ${YT(e.source)}
110
+ `;const t=e.destination,n=e.combine;return t?`
111
+ You have dropped the item.
112
+ ${rP(e.source,t)}
113
+ `:n?`
114
+ You have dropped the item.
115
+ ${sP(e.draggableId,e.source,n)}
116
+ `:`
117
+ The item has been dropped while not over a drop area.
118
+ ${YT(e.source)}
119
+ `},mm={dragHandleUsageInstructions:pne,onDragStart:gne,onDragUpdate:xne,onDragEnd:yne};function vne(e,t){return!!(e===t||Number.isNaN(e)&&Number.isNaN(t))}function aP(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!vne(e[n],t[n]))return!1;return!0}function gt(e,t){const n=x.useState(()=>({inputs:t,result:e()}))[0],r=x.useRef(!0),a=x.useRef(n),c=r.current||!!(t&&a.current.inputs&&aP(t,a.current.inputs))?a.current:{inputs:t,result:e()};return x.useEffect(()=>{r.current=!1,a.current=c},[c]),c.result}function $e(e,t){return gt(()=>e,t)}const Nn={x:0,y:0},In=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),Or=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),Bi=(e,t)=>e.x===t.x&&e.y===t.y,Lc=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),Qo=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},Ad=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),XT=(e,t)=>Math.min(...t.map(n=>Ad(e,n))),iP=e=>t=>({x:e(t.x),y:e(t.y)});var bne=(e,t)=>{const n=Os({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n};const lf=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),QT=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],wne={top:0,right:0,bottom:0,left:0},Sne=(e,t)=>t?lf(e,t.scroll.diff.displacement):e,Nne=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,jne=(e,t)=>t&&t.shouldClipSubject?bne(t.pageMarginBox,e):Os(e);var pc=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const a=Sne(e.marginBox,r),o=Nne(a,n,t),c=jne(o,r);return{page:e,withPlaceholder:t,active:c}},r1=(e,t)=>{e.frame||je();const n=e.frame,r=Or(t,n.scroll.initial),a=Lc(r),o={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:a},max:n.scroll.max}},c=pc({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o});return{...e,frame:o,subject:c}};function Sn(e,t=aP){let n=null;function r(...a){if(n&&n.lastThis===this&&t(a,n.lastArgs))return n.lastResult;const o=e.apply(this,a);return n={lastResult:o,lastArgs:a,lastThis:this},o}return r.clear=function(){n=null},r}const oP=Sn(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),lP=Sn(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),Fp=Sn(e=>Object.values(e)),Cne=Sn(e=>Object.values(e));var Ic=Sn((e,t)=>Cne(t).filter(r=>e===r.descriptor.droppableId).sort((r,a)=>r.descriptor.index-a.descriptor.index));function s1(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function $p(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var Vp=Sn((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),Ene=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:a})=>{if(!n.isCombineEnabled||!s1(a))return null;function c(v){const S={type:"COMBINE",combine:{draggableId:v,droppableId:n.descriptor.id}};return{...a,at:S}}const d=a.displaced.all,h=d.length?d[0]:null;if(e)return h?c(h):null;const f=Vp(t,r);if(!h){if(!f.length)return null;const v=f[f.length-1];return c(v.descriptor.id)}const m=f.findIndex(v=>v.descriptor.id===h);m===-1&&je();const p=m-1;if(p<0)return null;const y=f[p];return c(y.descriptor.id)},Bc=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const cP={point:Nn,value:0},Od={invisible:{},visible:{},all:[]},Tne={displaced:Od,displacedBy:cP,at:null};var us=(e,t)=>n=>e<=n&&n<=t,uP=e=>{const t=us(e.top,e.bottom),n=us(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const o=t(r.top)||t(r.bottom),c=n(r.left)||n(r.right);if(o&&c)return!0;const h=r.top<e.top&&r.bottom>e.bottom,f=r.left<e.left&&r.right>e.right;return h&&f?!0:h&&c||f&&o}},_ne=e=>{const t=us(e.top,e.bottom),n=us(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const a1={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},dP={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var Rne=e=>t=>{const n=us(t.top,t.bottom),r=us(t.left,t.right);return a=>e===a1?n(a.top)&&n(a.bottom):r(a.left)&&r(a.right)};const Dne=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:Nn;return lf(e,n)},kne=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,Ane=(e,t,n)=>n(t)(e),i1=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:a})=>{const o=r?Dne(e,t):e;return kne(o,t,a)&&Ane(o,n,a)},One=e=>i1({...e,isVisibleThroughFrameFn:uP}),fP=e=>i1({...e,isVisibleThroughFrameFn:_ne}),Mne=e=>i1({...e,isVisibleThroughFrameFn:Rne(e.destination.axis)}),Pne=(e,t,n)=>{if(typeof n=="boolean")return n;if(!t)return!0;const{invisible:r,visible:a}=t;if(r[e])return!1;const o=a[e];return o?o.shouldAnimate:!0};function Lne(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return Os(t1(n,r))}function Md({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:a,last:o}){return e.reduce(function(d,h){const f=Lne(h,n),m=h.descriptor.id;if(d.all.push(m),!One({target:f,destination:t,viewport:r,withDroppableDisplacement:!0}))return d.invisible[h.descriptor.id]=!0,d;const y=Pne(m,o,a),v={draggableId:m,shouldAnimate:y};return d.visible[m]=v,d},{all:[],visible:{},invisible:{}})}function Ine(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function JT({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const a=Ine(e,{inHomeList:t});return{displaced:Od,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:a}}}}function Wm({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:a,last:o,index:c,forceShouldAnimate:d}){const h=Bc(e,n);if(c==null)return JT({insideDestination:t,inHomeList:h,displacedBy:a,destination:n});const f=t.find(S=>S.descriptor.index===c);if(!f)return JT({insideDestination:t,inHomeList:h,displacedBy:a,destination:n});const m=Vp(e,t),p=t.indexOf(f),y=m.slice(p);return{displaced:Md({afterDragging:y,destination:n,displacedBy:a,last:o,viewport:r.frame,forceShouldAnimate:d}),displacedBy:a,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:c}}}}function Ki(e,t){return!!t.effected[e]}var Bne=({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:a})=>{if(!t.isCombineEnabled)return null;const o=r.draggableId,d=n[o].descriptor.index;return Ki(o,a)?e?d:d-1:e?d+1:d},zne=({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const a=r.index,o=e?a+1:a-1,c=n[0].descriptor.index,d=n[n.length-1].descriptor.index,h=t?d:d+1;return o<c||o>h?null:o},Fne=({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:a,insideDestination:o,previousImpact:c,viewport:d,afterCritical:h})=>{const f=c.at;if(f||je(),f.type==="REORDER"){const p=zne({isMovingForward:e,isInHomeList:t,location:f.destination,insideDestination:o});return p==null?null:Wm({draggable:n,insideDestination:o,destination:a,viewport:d,last:c.displaced,displacedBy:c.displacedBy,index:p})}const m=Bne({isMovingForward:e,destination:a,displaced:c.displaced,draggables:r,combine:f.combine,afterCritical:h});return m==null?null:Wm({draggable:n,insideDestination:o,destination:a,viewport:d,last:c.displaced,displacedBy:c.displacedBy,index:m})},$ne=({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const a=!!(e.visible[n]||e.invisible[n]);return Ki(n,t)?a?Nn:Lc(r.point):a?r.point:Nn},Vne=({afterCritical:e,impact:t,draggables:n})=>{const r=$p(t);r||je();const a=r.draggableId,o=n[a].page.borderBox.center,c=$ne({displaced:t.displaced,afterCritical:e,combineWith:a,displacedBy:t.displacedBy});return In(o,c)};const hP=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,Une=(e,t)=>t.margin[e.end]+t.borderBox[e.size]/2,o1=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,ZT=({axis:e,moveRelativeTo:t,isMoving:n})=>Qo(e.line,t.marginBox[e.end]+hP(e,n),o1(e,t.marginBox,n)),e_=({axis:e,moveRelativeTo:t,isMoving:n})=>Qo(e.line,t.marginBox[e.start]-Une(e,n),o1(e,t.marginBox,n)),Hne=({axis:e,moveInto:t,isMoving:n})=>Qo(e.line,t.contentBox[e.start]+hP(e,n),o1(e,t.contentBox,n));var Gne=({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:a})=>{const o=Ic(r.descriptor.id,n),c=t.page,d=r.axis;if(!o.length)return Hne({axis:d,moveInto:r.page,isMoving:c});const{displaced:h,displacedBy:f}=e,m=h.all[0];if(m){const y=n[m];if(Ki(m,a))return e_({axis:d,moveRelativeTo:y.page,isMoving:c});const v=Vm(y.page,f.point);return e_({axis:d,moveRelativeTo:v,isMoving:c})}const p=o[o.length-1];if(p.descriptor.id===t.descriptor.id)return c.borderBox.center;if(Ki(p.descriptor.id,a)){const y=Vm(p.page,Lc(a.displacedBy.point));return ZT({axis:d,moveRelativeTo:y,isMoving:c})}return ZT({axis:d,moveRelativeTo:p.page,isMoving:c})},q0=(e,t)=>{const n=e.frame;return n?In(t,n.scroll.diff.displacement):t};const qne=({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:a})=>{const o=t.page.borderBox.center,c=e.at;return!n||!c?o:c.type==="REORDER"?Gne({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:a}):Vne({impact:e,draggables:r,afterCritical:a})};var Up=e=>{const t=qne(e),n=e.droppable;return n?q0(n,t):t},mP=(e,t)=>{const n=Or(t,e.scroll.initial),r=Lc(n);return{frame:Os({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function t_(e,t){return e.map(n=>t[n])}function Wne(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}var Kne=({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:a})=>{const o=mP(t,In(t.scroll.current,a)),c=n.frame?r1(n,In(n.frame.scroll.current,a)):n,d=e.displaced,h=Md({afterDragging:t_(d.all,r),destination:n,displacedBy:e.displacedBy,viewport:o.frame,last:d,forceShouldAnimate:!1}),f=Md({afterDragging:t_(d.all,r),destination:c,displacedBy:e.displacedBy,viewport:t.frame,last:d,forceShouldAnimate:!1}),m={},p={},y=[d,h,f];return d.all.forEach(S=>{const N=Wne(S,y);if(N){p[S]=N;return}m[S]=!0}),{...e,displaced:{all:d.all,invisible:m,visible:p}}},Yne=(e,t)=>In(e.scroll.diff.displacement,t),l1=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=Yne(n,e),a=Or(r,t.page.borderBox.center);return In(t.client.borderBox.center,a)},pP=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:a,onlyOnMainAxis:o=!1})=>{const c=Or(n,e.page.borderBox.center),h={target:lf(e.page.borderBox,c),destination:t,withDroppableDisplacement:a,viewport:r};return o?Mne(h):fP(h)},Xne=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:a,viewport:o,previousPageBorderBoxCenter:c,previousClientSelection:d,afterCritical:h})=>{if(!n.isEnabled)return null;const f=Ic(n.descriptor.id,r),m=Bc(t,n),p=Ene({isMovingForward:e,draggable:t,destination:n,insideDestination:f,previousImpact:a})||Fne({isMovingForward:e,isInHomeList:m,draggable:t,draggables:r,destination:n,insideDestination:f,previousImpact:a,viewport:o,afterCritical:h});if(!p)return null;const y=Up({impact:p,draggable:t,droppable:n,draggables:r,afterCritical:h});if(pP({draggable:t,destination:n,newPageBorderBoxCenter:y,viewport:o.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:l1({pageBorderBoxCenter:y,draggable:t,viewport:o}),impact:p,scrollJumpRequest:null};const S=Or(y,c),N=Kne({impact:p,viewport:o,destination:n,draggables:r,maxScrollChange:S});return{clientSelection:d,impact:N,scrollJumpRequest:S}};const Yn=e=>{const t=e.subject.active;return t||je(),t};var Qne=({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:a})=>{const o=n.subject.active;if(!o)return null;const c=n.axis,d=us(o[c.start],o[c.end]),h=Fp(r).filter(m=>m!==n).filter(m=>m.isEnabled).filter(m=>!!m.subject.active).filter(m=>uP(a.frame)(Yn(m))).filter(m=>{const p=Yn(m);return e?o[c.crossAxisEnd]<p[c.crossAxisEnd]:p[c.crossAxisStart]<o[c.crossAxisStart]}).filter(m=>{const p=Yn(m),y=us(p[c.start],p[c.end]);return d(p[c.start])||d(p[c.end])||y(o[c.start])||y(o[c.end])}).sort((m,p)=>{const y=Yn(m)[c.crossAxisStart],v=Yn(p)[c.crossAxisStart];return e?y-v:v-y}).filter((m,p,y)=>Yn(m)[c.crossAxisStart]===Yn(y[0])[c.crossAxisStart]);if(!h.length)return null;if(h.length===1)return h[0];const f=h.filter(m=>us(Yn(m)[c.start],Yn(m)[c.end])(t[c.line]));return f.length===1?f[0]:f.length>1?f.sort((m,p)=>Yn(m)[c.start]-Yn(p)[c.start])[0]:h.sort((m,p)=>{const y=XT(t,QT(Yn(m))),v=XT(t,QT(Yn(p)));return y!==v?y-v:Yn(m)[c.start]-Yn(p)[c.start]})[0]};const n_=(e,t)=>{const n=e.page.borderBox.center;return Ki(e.descriptor.id,t)?Or(n,t.displacedBy.point):n},Jne=(e,t)=>{const n=e.page.borderBox;return Ki(e.descriptor.id,t)?lf(n,Lc(t.displacedBy.point)):n};var Zne=({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:a})=>r.filter(c=>fP({target:Jne(c,a),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((c,d)=>{const h=Ad(e,q0(n,n_(c,a))),f=Ad(e,q0(n,n_(d,a)));return h<f?-1:f<h?1:c.descriptor.index-d.descriptor.index})[0]||null,cf=Sn(function(t,n){const r=n[t.line];return{value:r,point:Qo(t.line,r)}});const ere=(e,t,n)=>{const r=e.axis;if(e.descriptor.mode==="virtual")return Qo(r.line,t[r.line]);const a=e.subject.page.contentBox[r.size],h=Ic(e.descriptor.id,n).reduce((f,m)=>f+m.client.marginBox[r.size],0)+t[r.line]-a;return h<=0?null:Qo(r.line,h)},gP=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),xP=(e,t,n)=>{const r=e.frame;Bc(t,e)&&je(),e.subject.withPlaceholder&&je();const a=cf(e.axis,t.displaceBy).point,o=ere(e,a,n),c={placeholderSize:a,increasedBy:o,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const m=pc({page:e.subject.page,withPlaceholder:c,axis:e.axis,frame:e.frame});return{...e,subject:m}}const d=o?In(r.scroll.max,o):r.scroll.max,h=gP(r,d),f=pc({page:e.subject.page,withPlaceholder:c,axis:e.axis,frame:h});return{...e,subject:f,frame:h}},tre=e=>{const t=e.subject.withPlaceholder;t||je();const n=e.frame;if(!n){const c=pc({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:c}}const r=t.oldFrameMaxScroll;r||je();const a=gP(n,r),o=pc({page:e.subject.page,axis:e.axis,frame:a,withPlaceholder:null});return{...e,subject:o,frame:a}};var nre=({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:a,destination:o,viewport:c,afterCritical:d})=>{if(!t){if(n.length)return null;const p={displaced:Od,displacedBy:cP,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:0}}},y=Up({impact:p,draggable:r,droppable:o,draggables:a,afterCritical:d}),v=Bc(r,o)?o:xP(o,r,a);return pP({draggable:r,destination:v,newPageBorderBoxCenter:y,viewport:c.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?p:null}const h=e[o.axis.line]<=t.page.borderBox.center[o.axis.line],f=(()=>{const p=t.descriptor.index;return t.descriptor.id===r.descriptor.id||h?p:p+1})(),m=cf(o.axis,r.displaceBy);return Wm({draggable:r,insideDestination:n,destination:o,viewport:c,displacedBy:m,last:Od,index:f})},rre=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:a,droppables:o,viewport:c,afterCritical:d})=>{const h=Qne({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:o,viewport:c});if(!h)return null;const f=Ic(h.descriptor.id,a),m=Zne({pageBorderBoxCenter:t,viewport:c,destination:h,insideDestination:f,afterCritical:d}),p=nre({previousPageBorderBoxCenter:t,destination:h,draggable:n,draggables:a,moveRelativeTo:m,insideDestination:f,viewport:c,afterCritical:d});if(!p)return null;const y=Up({impact:p,draggable:n,droppable:h,draggables:a,afterCritical:d});return{clientSelection:l1({pageBorderBoxCenter:y,draggable:n,viewport:c}),impact:p,scrollJumpRequest:null}},Pr=e=>{const t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null};const sre=(e,t)=>{const n=Pr(e);return n?t[n]:null};var are=({state:e,type:t})=>{const n=sre(e.impact,e.dimensions.droppables),r=!!n,a=e.dimensions.droppables[e.critical.droppable.id],o=n||a,c=o.axis.direction,d=c==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||c==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(d&&!r)return null;const h=t==="MOVE_DOWN"||t==="MOVE_RIGHT",f=e.dimensions.draggables[e.critical.draggable.id],m=e.current.page.borderBoxCenter,{draggables:p,droppables:y}=e.dimensions;return d?Xne({isMovingForward:h,previousPageBorderBoxCenter:m,draggable:f,destination:o,draggables:p,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):rre({isMovingForward:h,previousPageBorderBoxCenter:m,draggable:f,isOver:o,draggables:p,droppables:y,viewport:e.viewport,afterCritical:e.afterCritical})};function Oo(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function yP(e){const t=us(e.top,e.bottom),n=us(e.left,e.right);return function(a){return t(a.y)&&n(a.x)}}function ire(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function ore({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,a=n.map(o=>{const c=o.axis,d=Qo(o.axis.line,e.center[c.line],o.page.borderBox.center[c.crossAxisLine]);return{id:o.descriptor.id,distance:Ad(r,d)}}).sort((o,c)=>c.distance-o.distance);return a[0]?a[0].id:null}function lre({pageBorderBox:e,draggable:t,droppables:n}){const r=Fp(n).filter(a=>{if(!a.isEnabled)return!1;const o=a.subject.active;if(!o||!ire(e,o))return!1;if(yP(o)(e.center))return!0;const c=a.axis,d=o.center[c.crossAxisLine],h=e[c.crossAxisStart],f=e[c.crossAxisEnd],m=us(o[c.crossAxisStart],o[c.crossAxisEnd]),p=m(h),y=m(f);return!p&&!y?!0:p?h<d:f>d});return r.length?r.length===1?r[0].descriptor.id:ore({pageBorderBox:e,draggable:t,candidates:r}):null}const vP=(e,t)=>Os(lf(e,t));var cre=(e,t)=>{const n=e.frame;return n?vP(t,n.scroll.diff.value):t};function bP({displaced:e,id:t}){return!!(e.visible[t]||e.invisible[t])}function ure({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var dre=({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:a,viewport:o,afterCritical:c})=>{const d=n.axis,h=cf(n.axis,t.displaceBy),f=h.value,m=e[d.start],p=e[d.end],v=Vp(t,r).find(N=>{const C=N.descriptor.id,j=N.page.borderBox.center[d.line],E=Ki(C,c),R=bP({displaced:a,id:C});return E?R?p<=j:m<j-f:R?p<=j+f:m<j})||null,S=ure({draggable:t,closest:v,inHomeList:Bc(t,n)});return Wm({draggable:t,insideDestination:r,destination:n,viewport:o,last:a,displacedBy:h,index:S})};const fre=4;var hre=({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:a,afterCritical:o})=>{if(!r.isCombineEnabled)return null;const c=r.axis,d=cf(r.axis,e.displaceBy),h=d.value,f=t[c.start],m=t[c.end],y=Vp(e,a).find(S=>{const N=S.descriptor.id,C=S.page.borderBox,E=C[c.size]/fre,R=Ki(N,o),A=bP({displaced:n.displaced,id:N});return R?A?m>C[c.start]+E&&m<C[c.end]-E:f>C[c.start]-h+E&&f<C[c.end]-h-E:A?m>C[c.start]+h+E&&m<C[c.end]+h-E:f>C[c.start]+E&&f<C[c.end]-E});return y?{displacedBy:d,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:y.descriptor.id,droppableId:r.descriptor.id}}}:null},wP=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:a,viewport:o,afterCritical:c})=>{const d=vP(t.page.borderBox,e),h=lre({pageBorderBox:d,draggable:t,droppables:r});if(!h)return Tne;const f=r[h],m=Ic(f.descriptor.id,n),p=cre(f,d);return hre({pageBorderBoxWithDroppableScroll:p,draggable:t,previousImpact:a,destination:f,insideDestination:m,afterCritical:c})||dre({pageBorderBoxWithDroppableScroll:p,draggable:t,destination:f,insideDestination:m,last:a.displaced,viewport:o,afterCritical:c})},c1=(e,t)=>({...e,[t.descriptor.id]:t});const mre=({previousImpact:e,impact:t,droppables:n})=>{const r=Pr(e),a=Pr(t);if(!r||r===a)return n;const o=n[r];if(!o.subject.withPlaceholder)return n;const c=tre(o);return c1(n,c)};var pre=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:a})=>{const o=mre({previousImpact:r,impact:a,droppables:n}),c=Pr(a);if(!c)return o;const d=n[c];if(Bc(e,d)||d.subject.withPlaceholder)return o;const h=xP(d,e,t);return c1(o,h)},ud=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:a,scrollJumpRequest:o})=>{const c=r||e.viewport,d=n||e.dimensions,h=t||e.current.client.selection,f=Or(h,e.initial.client.selection),m={offset:f,selection:h,borderBoxCenter:In(e.initial.client.borderBoxCenter,f)},p={selection:In(m.selection,c.scroll.current),borderBoxCenter:In(m.borderBoxCenter,c.scroll.current),offset:In(m.offset,c.scroll.diff.value)},y={client:m,page:p};if(e.phase==="COLLECTING")return{...e,dimensions:d,viewport:c,current:y};const v=d.draggables[e.critical.draggable.id],S=a||wP({pageOffset:p.offset,draggable:v,draggables:d.draggables,droppables:d.droppables,previousImpact:e.impact,viewport:c,afterCritical:e.afterCritical}),N=pre({draggable:v,impact:S,previousImpact:e.impact,draggables:d.draggables,droppables:d.droppables});return{...e,current:y,dimensions:{draggables:d.draggables,droppables:N},impact:S,viewport:c,scrollJumpRequest:o||null,forceShouldAnimate:o?!1:null}};function gre(e,t){return e.map(n=>t[n])}var SP=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:a})=>{const o=e.displaced,c=gre(o.all,n),d=Md({afterDragging:c,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:a,last:o});return{...e,displaced:d}},NP=({impact:e,draggable:t,droppable:n,draggables:r,viewport:a,afterCritical:o})=>{const c=Up({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o});return l1({pageBorderBoxCenter:c,draggable:t,viewport:a})},jP=({state:e,dimensions:t,viewport:n})=>{e.movementMode!=="SNAP"&&je();const r=e.impact,a=n||e.viewport,o=t||e.dimensions,{draggables:c,droppables:d}=o,h=c[e.critical.draggable.id],f=Pr(r);f||je();const m=d[f],p=SP({impact:r,viewport:a,destination:m,draggables:c}),y=NP({impact:p,draggable:h,droppable:m,draggables:c,viewport:a,afterCritical:e.afterCritical});return ud({impact:p,clientSelection:y,state:e,dimensions:o,viewport:a})},xre=e=>({index:e.index,droppableId:e.droppableId}),CP=({draggable:e,home:t,draggables:n,viewport:r})=>{const a=cf(t.axis,e.displaceBy),o=Ic(t.descriptor.id,n),c=o.indexOf(e);c===-1&&je();const d=o.slice(c+1),h=d.reduce((y,v)=>(y[v.descriptor.id]=!0,y),{}),f={inVirtualList:t.descriptor.mode==="virtual",displacedBy:a,effected:h};return{impact:{displaced:Md({afterDragging:d,destination:t,displacedBy:a,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:a,at:{type:"REORDER",destination:xre(e.descriptor)}},afterCritical:f}},yre=(e,t)=>({draggables:e.draggables,droppables:c1(e.droppables,t)}),vre=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Vm(e.client,t),a=Um(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:a}},bre=e=>{const t=e.frame;return t||je(),t},wre=({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(a=>{const o=a.descriptor.droppableId,c=t[o],h=bre(c).scroll.diff.value,f=In(r,h);return vre({draggable:a,offset:f,initialWindowScroll:n.scroll.initial})})},Sre=({state:e,published:t})=>{const n=t.modified.map(j=>{const E=e.dimensions.droppables[j.droppableId];return r1(E,j.scroll)}),r={...e.dimensions.droppables,...oP(n)},a=lP(wre({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),o={...e.dimensions.draggables,...a};t.removals.forEach(j=>{delete o[j]});const c={droppables:r,draggables:o},d=Pr(e.impact),h=d?c.droppables[d]:null,f=c.draggables[e.critical.draggable.id],m=c.droppables[e.critical.droppable.id],{impact:p,afterCritical:y}=CP({draggable:f,home:m,draggables:o,viewport:e.viewport}),v=h&&h.isCombineEnabled?e.impact:p,S=wP({pageOffset:e.current.page.offset,draggable:c.draggables[e.critical.draggable.id],draggables:c.draggables,droppables:c.droppables,previousImpact:v,viewport:e.viewport,afterCritical:y}),N={...e,phase:"DRAGGING",impact:S,onLiftImpact:p,dimensions:c,afterCritical:y,forceShouldAnimate:!1};return e.phase==="COLLECTING"?N:{...N,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const W0=e=>e.movementMode==="SNAP",ov=(e,t,n)=>{const r=yre(e.dimensions,t);return!W0(e)||n?ud({state:e,dimensions:r}):jP({state:e,dimensions:r})};function lv(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const r_={phase:"IDLE",completed:null,shouldFlush:!1};var Nre=(e=r_,t)=>{if(t.type==="FLUSH")return{...r_,shouldFlush:!0};if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&je();const{critical:n,clientSelection:r,viewport:a,dimensions:o,movementMode:c}=t.payload,d=o.draggables[n.draggable.id],h=o.droppables[n.droppable.id],f={selection:r,borderBoxCenter:d.client.borderBox.center,offset:Nn},m={client:f,page:{selection:In(f.selection,a.scroll.initial),borderBoxCenter:In(f.selection,a.scroll.initial),offset:In(f.selection,a.scroll.diff.value)}},p=Fp(o.droppables).every(N=>!N.isFixedOnPage),{impact:y,afterCritical:v}=CP({draggable:d,home:h,draggables:o.draggables,viewport:a});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:c,dimensions:o,initial:m,current:m,isWindowScrollAllowed:p,impact:y,afterCritical:v,onLiftImpact:y,viewport:a,scrollJumpRequest:null,forceShouldAnimate:null}}if(t.type==="COLLECTION_STARTING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"?e:(e.phase!=="DRAGGING"&&je(),{...e,phase:"COLLECTING"});if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||je(),Sre({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;Oo(e)||je();const{client:n}=t.payload;return Bi(n,e.current.client.selection)?e:ud({state:e,clientSelection:n,impact:W0(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return lv(e);Oo(e)||je();const{id:n,newScroll:r}=t.payload,a=e.dimensions.droppables[n];if(!a)return e;const o=r1(a,r);return ov(e,o,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;Oo(e)||je();const{id:n,isEnabled:r}=t.payload,a=e.dimensions.droppables[n];a||je(),a.isEnabled===r&&je();const o={...a,isEnabled:r};return ov(e,o,!0)}if(t.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(e.phase==="DROP_PENDING")return e;Oo(e)||je();const{id:n,isCombineEnabled:r}=t.payload,a=e.dimensions.droppables[n];a||je(),a.isCombineEnabled===r&&je();const o={...a,isCombineEnabled:r};return ov(e,o,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;Oo(e)||je(),e.isWindowScrollAllowed||je();const n=t.payload.newScroll;if(Bi(e.viewport.scroll.current,n))return lv(e);const r=mP(e.viewport,n);return W0(e)?jP({state:e,viewport:r}):ud({state:e,viewport:r})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!Oo(e))return e;const n=t.payload.maxScroll;if(Bi(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&je();const n=are({state:e,type:t.type});return n?ud({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){const n=t.payload.reason;return e.phase!=="COLLECTING"&&je(),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if(t.type==="DROP_ANIMATE"){const{completed:n,dropDuration:r,newHomeClientOffset:a}=t.payload;return e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||je(),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:a,dimensions:e.dimensions}}if(t.type==="DROP_COMPLETE"){const{completed:n}=t.payload;return{phase:"IDLE",completed:n,shouldFlush:!1}}return e};function jt(e,t){return e instanceof Object&&"type"in e&&e.type===t}const jre=e=>({type:"BEFORE_INITIAL_CAPTURE",payload:e}),Cre=e=>({type:"LIFT",payload:e}),Ere=e=>({type:"INITIAL_PUBLISH",payload:e}),Tre=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),_re=()=>({type:"COLLECTION_STARTING",payload:null}),Rre=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),Dre=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),kre=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),EP=e=>({type:"MOVE",payload:e}),Are=e=>({type:"MOVE_BY_WINDOW_SCROLL",payload:e}),Ore=e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}),Mre=()=>({type:"MOVE_UP",payload:null}),Pre=()=>({type:"MOVE_DOWN",payload:null}),Lre=()=>({type:"MOVE_RIGHT",payload:null}),Ire=()=>({type:"MOVE_LEFT",payload:null}),u1=()=>({type:"FLUSH",payload:null}),Bre=e=>({type:"DROP_ANIMATE",payload:e}),d1=e=>({type:"DROP_COMPLETE",payload:e}),TP=e=>({type:"DROP",payload:e}),zre=e=>({type:"DROP_PENDING",payload:e}),_P=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});var Fre=e=>({getState:t,dispatch:n})=>r=>a=>{if(!jt(a,"LIFT")){r(a);return}const{id:o,clientSelection:c,movementMode:d}=a.payload,h=t();h.phase==="DROP_ANIMATING"&&n(d1({completed:h.completed})),t().phase!=="IDLE"&&je(),n(u1()),n(jre({draggableId:o,movementMode:d}));const m={draggableId:o,scrollOptions:{shouldPublishImmediately:d==="SNAP"}},{critical:p,dimensions:y,viewport:v}=e.startPublishing(m);n(Ere({critical:p,dimensions:y,clientSelection:c,movementMode:d,viewport:v}))},$re=e=>()=>t=>n=>{jt(n,"INITIAL_PUBLISH")&&e.dragging(),jt(n,"DROP_ANIMATE")&&e.dropping(n.payload.completed.result.reason),(jt(n,"FLUSH")||jt(n,"DROP_COMPLETE"))&&e.resting(),t(n)};const f1={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Pd={opacity:{drop:0,combining:.7},scale:{drop:.75}},RP={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},Co=`${RP.outOfTheWay}s ${f1.outOfTheWay}`,dd={fluid:`opacity ${Co}`,snap:`transform ${Co}, opacity ${Co}`,drop:e=>{const t=`${e}s ${f1.drop}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${Co}`,placeholder:`height ${Co}, width ${Co}, margin ${Co}`},s_=e=>Bi(e,Nn)?void 0:`translate(${e.x}px, ${e.y}px)`,K0={moveTo:s_,drop:(e,t)=>{const n=s_(e);if(n)return t?`${n} scale(${Pd.scale.drop})`:n}},{minDropTime:Y0,maxDropTime:DP}=RP,Vre=DP-Y0,a_=1500,Ure=.6;var Hre=({current:e,destination:t,reason:n})=>{const r=Ad(e,t);if(r<=0)return Y0;if(r>=a_)return DP;const a=r/a_,o=Y0+Vre*a,c=n==="CANCEL"?o*Ure:o;return Number(c.toFixed(2))},Gre=({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:a})=>{const{draggables:o,droppables:c}=n,d=Pr(e),h=d?c[d]:null,f=c[t.descriptor.droppableId],m=NP({impact:e,draggable:t,draggables:o,afterCritical:a,droppable:h||f,viewport:r});return Or(m,t.client.borderBox.center)},qre=({draggables:e,reason:t,lastImpact:n,home:r,viewport:a,onLiftImpact:o})=>!n.at||t!=="DROP"?{impact:SP({draggables:e,impact:o,destination:r,viewport:a,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:n.at.type==="REORDER"?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:Od},didDropInsideDroppable:!0};const Wre=({getState:e,dispatch:t})=>n=>r=>{if(!jt(r,"DROP")){n(r);return}const a=e(),o=r.payload.reason;if(a.phase==="COLLECTING"){t(zre({reason:o}));return}if(a.phase==="IDLE")return;a.phase==="DROP_PENDING"&&a.isWaiting&&je(),a.phase==="DRAGGING"||a.phase==="DROP_PENDING"||je();const d=a.critical,h=a.dimensions,f=h.draggables[a.critical.draggable.id],{impact:m,didDropInsideDroppable:p}=qre({reason:o,lastImpact:a.impact,afterCritical:a.afterCritical,onLiftImpact:a.onLiftImpact,home:a.dimensions.droppables[a.critical.droppable.id],viewport:a.viewport,draggables:a.dimensions.draggables}),y=p?s1(m):null,v=p?$p(m):null,S={index:d.draggable.index,droppableId:d.droppable.id},N={draggableId:f.descriptor.id,type:f.descriptor.type,source:S,reason:o,mode:a.movementMode,destination:y,combine:v},C=Gre({impact:m,draggable:f,dimensions:h,viewport:a.viewport,afterCritical:a.afterCritical}),j={critical:a.critical,afterCritical:a.afterCritical,result:N,impact:m};if(!(!Bi(a.current.client.offset,C)||!!N.combine)){t(d1({completed:j}));return}const R=Hre({current:a.current.client.offset,destination:C,reason:o});t(Bre({newHomeClientOffset:C,dropDuration:R,completed:j}))};var kP=()=>({x:window.pageXOffset,y:window.pageYOffset});function Kre(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}function Yre({onWindowScroll:e}){function t(){e(kP())}const n=kd(t),r=Kre(n);let a=Ii;function o(){return a!==Ii}function c(){o()&&je(),a=ls(window,[r])}function d(){o()||je(),n.cancel(),a(),a=Ii}return{start:c,stop:d,isActive:o}}const Xre=e=>jt(e,"DROP_COMPLETE")||jt(e,"DROP_ANIMATE")||jt(e,"FLUSH"),Qre=e=>{const t=Yre({onWindowScroll:n=>{e.dispatch(Are({newScroll:n}))}});return n=>r=>{!t.isActive()&&jt(r,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&Xre(r)&&t.stop(),n(r)}};var Jre=e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),a=o=>{t||n||(t=!0,e(o),clearTimeout(r))};return a.wasCalled=()=>t,a},Zre=()=>{const e=[],t=a=>{const o=e.findIndex(d=>d.timerId===a);o===-1&&je();const[c]=e.splice(o,1);c.callback()};return{add:a=>{const o=setTimeout(()=>t(o)),c={timerId:o,callback:a};e.push(c)},flush:()=>{if(!e.length)return;const a=[...e];e.length=0,a.forEach(o=>{clearTimeout(o.timerId),o.callback()})}}};const ese=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index,tse=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId,nse=(e,t)=>{if(e===t)return!0;const n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r},Bu=(e,t)=>{t()},Uh=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function cv(e,t,n,r){if(!e){n(r(t));return}const a=Jre(n);e(t,{announce:a}),a.wasCalled()||n(r(t))}var rse=(e,t)=>{const n=Zre();let r=null;const a=(p,y)=>{r&&je(),Bu("onBeforeCapture",()=>{const v=e().onBeforeCapture;v&&v({draggableId:p,mode:y})})},o=(p,y)=>{r&&je(),Bu("onBeforeDragStart",()=>{const v=e().onBeforeDragStart;v&&v(Uh(p,y))})},c=(p,y)=>{r&&je();const v=Uh(p,y);r={mode:y,lastCritical:p,lastLocation:v.source,lastCombine:null},n.add(()=>{Bu("onDragStart",()=>cv(e().onDragStart,v,t,mm.onDragStart))})},d=(p,y)=>{const v=s1(y),S=$p(y);r||je();const N=!nse(p,r.lastCritical);N&&(r.lastCritical=p);const C=!ese(r.lastLocation,v);C&&(r.lastLocation=v);const j=!tse(r.lastCombine,S);if(j&&(r.lastCombine=S),!N&&!C&&!j)return;const E={...Uh(p,r.mode),combine:S,destination:v};n.add(()=>{Bu("onDragUpdate",()=>cv(e().onDragUpdate,E,t,mm.onDragUpdate))})},h=()=>{r||je(),n.flush()},f=p=>{r||je(),r=null,Bu("onDragEnd",()=>cv(e().onDragEnd,p,t,mm.onDragEnd))};return{beforeCapture:a,beforeStart:o,start:c,update:d,flush:h,drop:f,abort:()=>{if(!r)return;const p={...Uh(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};f(p)}}},sse=(e,t)=>{const n=rse(e,t);return r=>a=>o=>{if(jt(o,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(o.payload.draggableId,o.payload.movementMode);return}if(jt(o,"INITIAL_PUBLISH")){const d=o.payload.critical;n.beforeStart(d,o.payload.movementMode),a(o),n.start(d,o.payload.movementMode);return}if(jt(o,"DROP_COMPLETE")){const d=o.payload.completed.result;n.flush(),a(o),n.drop(d);return}if(a(o),jt(o,"FLUSH")){n.abort();return}const c=r.getState();c.phase==="DRAGGING"&&n.update(c.critical,c.impact)}};const ase=e=>t=>n=>{if(!jt(n,"DROP_ANIMATION_FINISHED")){t(n);return}const r=e.getState();r.phase!=="DROP_ANIMATING"&&je(),e.dispatch(d1({completed:r.completed}))},ise=e=>{let t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return a=>o=>{if((jt(o,"FLUSH")||jt(o,"DROP_COMPLETE")||jt(o,"DROP_ANIMATION_FINISHED"))&&r(),a(o),!jt(o,"DROP_ANIMATE"))return;const c={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){e.getState().phase==="DROP_ANIMATING"&&e.dispatch(_P())}};n=requestAnimationFrame(()=>{n=null,t=ls(window,[c])})}};var ose=e=>()=>t=>n=>{(jt(n,"DROP_COMPLETE")||jt(n,"FLUSH")||jt(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)},lse=e=>{let t=!1;return()=>n=>r=>{if(jt(r,"INITIAL_PUBLISH")){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(jt(r,"FLUSH")){t=!1,e.tryRestoreFocusRecorded();return}if(jt(r,"DROP_COMPLETE")){t=!1;const a=r.payload.completed.result;a.combine&&e.tryShiftRecord(a.draggableId,a.combine.draggableId),e.tryRestoreFocusRecorded()}}}};const cse=e=>jt(e,"DROP_COMPLETE")||jt(e,"DROP_ANIMATE")||jt(e,"FLUSH");var use=e=>t=>n=>r=>{if(cse(r)){e.stop(),n(r);return}if(jt(r,"INITIAL_PUBLISH")){n(r);const a=t.getState();a.phase!=="DRAGGING"&&je(),e.start(a);return}n(r),e.scroll(t.getState())};const dse=e=>t=>n=>{if(t(n),!jt(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(TP({reason:r.reason})))},fse=W5;var hse=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:a,autoScroller:o})=>q5(Nre,fse(ute($re(n),ose(e),Fre(e),Wre,ase,ise,dse,use(o),Qre,lse(t),sse(r,a))));const uv=()=>({additions:{},removals:{},modified:{}});function mse({registry:e,callbacks:t}){let n=uv(),r=null;const a=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null;const{additions:h,removals:f,modified:m}=n,p=Object.keys(h).map(S=>e.draggable.getById(S).getDimension(Nn)).sort((S,N)=>S.descriptor.index-N.descriptor.index),y=Object.keys(m).map(S=>{const C=e.droppable.getById(S).callbacks.getScrollWhileDragging();return{droppableId:S,scroll:C}}),v={additions:p,removals:Object.keys(f),modified:y};n=uv(),t.publish(v)}))};return{add:h=>{const f=h.descriptor.id;n.additions[f]=h,n.modified[h.descriptor.droppableId]=!0,n.removals[f]&&delete n.removals[f],a()},remove:h=>{const f=h.descriptor;n.removals[f.id]=!0,n.modified[f.droppableId]=!0,n.additions[f.id]&&delete n.additions[f.id],a()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n=uv())}}}var AP=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const a=Or({x:t,y:e},{x:r,y:n});return{x:Math.max(0,a.x),y:Math.max(0,a.y)}},OP=()=>{const e=document.documentElement;return e||je(),e},MP=()=>{const e=OP();return AP({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},pse=()=>{const e=kP(),t=MP(),n=e.y,r=e.x,a=OP(),o=a.clientWidth,c=a.clientHeight,d=r+o,h=n+c;return{frame:Os({top:n,left:r,right:d,bottom:h}),scroll:{initial:e,current:e,max:t,diff:{value:Nn,displacement:Nn}}}},gse=({critical:e,scrollOptions:t,registry:n})=>{const r=pse(),a=r.scroll.current,o=e.droppable,c=n.droppable.getAllByType(o.type).map(m=>m.callbacks.getDimensionAndWatchScroll(a,t)),d=n.draggable.getAllByType(e.draggable.type).map(m=>m.getDimension(a));return{dimensions:{draggables:lP(d),droppables:oP(c)},critical:e,viewport:r}};function i_(e,t,n){return!(n.descriptor.id===t.id||n.descriptor.type!==t.type||e.droppable.getById(n.descriptor.droppableId).descriptor.mode!=="virtual")}var xse=(e,t)=>{let n=null;const r=mse({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),a=(y,v)=>{e.droppable.exists(y)||je(),n&&t.updateDroppableIsEnabled({id:y,isEnabled:v})},o=(y,v)=>{n&&(e.droppable.exists(y)||je(),t.updateDroppableIsCombineEnabled({id:y,isCombineEnabled:v}))},c=(y,v)=>{n&&(e.droppable.exists(y)||je(),t.updateDroppableScroll({id:y,newScroll:v}))},d=(y,v)=>{n&&e.droppable.getById(y).callbacks.scroll(v)},h=()=>{if(!n)return;r.stop();const y=n.critical.droppable;e.droppable.getAllByType(y.type).forEach(v=>v.callbacks.dragStopped()),n.unsubscribe(),n=null},f=y=>{n||je();const v=n.critical.draggable;y.type==="ADDITION"&&i_(e,v,y.value)&&r.add(y.value),y.type==="REMOVAL"&&i_(e,v,y.value)&&r.remove(y.value)};return{updateDroppableIsEnabled:a,updateDroppableIsCombineEnabled:o,scrollDroppable:d,updateDroppableScroll:c,startPublishing:y=>{n&&je();const v=e.draggable.getById(y.draggableId),S=e.droppable.getById(v.descriptor.droppableId),N={draggable:v.descriptor,droppable:S.descriptor},C=e.subscribe(f);return n={critical:N,unsubscribe:C},gse({critical:N,registry:e,scrollOptions:y.scrollOptions})},stopPublishing:h}},PP=(e,t)=>e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP",yse=e=>{window.scrollBy(e.x,e.y)};const vse=Sn(e=>Fp(e).filter(t=>!(!t.isEnabled||!t.frame))),bse=(e,t)=>vse(t).find(r=>(r.frame||je(),yP(r.frame.pageMarginBox)(e)))||null;var wse=({center:e,destination:t,droppables:n})=>{if(t){const a=n[t];return a.frame?a:null}return bse(e,n)};const Ld={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var Sse=(e,t,n=()=>Ld)=>{const r=n(),a=e[t.size]*r.startFromPercentage,o=e[t.size]*r.maxScrollAtPercentage;return{startScrollingFrom:a,maxScrollValueAt:o}},LP=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return r===0?0:(n-e)/r},h1=1,Nse=(e,t,n=()=>Ld)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return h1;const o=1-LP({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),c=r.maxPixelScroll*r.ease(o);return Math.ceil(c)},jse=(e,t,n)=>{const r=n(),a=r.durationDampening.accelerateAt,o=r.durationDampening.stopDampeningAt,c=t,d=o,f=Date.now()-c;if(f>=o)return e;if(f<a)return h1;const m=LP({startOfRange:a,endOfRange:d,current:f}),p=e*r.ease(m);return Math.ceil(p)},o_=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:a})=>{const o=Nse(e,t,a);return o===0?0:r?Math.max(jse(o,n,a),h1):o},l_=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:a,getAutoScrollerOptions:o})=>{const c=Sse(e,r,o);return t[r.end]<t[r.start]?o_({distanceToEdge:t[r.end],thresholds:c,dragStartTime:n,shouldUseTimeDampening:a,getAutoScrollerOptions:o}):-1*o_({distanceToEdge:t[r.start],thresholds:c,dragStartTime:n,shouldUseTimeDampening:a,getAutoScrollerOptions:o})},Cse=({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,a=t.width>e.width;return!a&&!r?n:a&&r?null:{x:a?0:n.x,y:r?0:n.y}};const Ese=iP(e=>e===0?0:e);var IP=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:a,getAutoScrollerOptions:o})=>{const c={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},d=l_({container:t,distanceToEdges:c,dragStartTime:e,axis:a1,shouldUseTimeDampening:a,getAutoScrollerOptions:o}),h=l_({container:t,distanceToEdges:c,dragStartTime:e,axis:dP,shouldUseTimeDampening:a,getAutoScrollerOptions:o}),f=Ese({x:h,y:d});if(Bi(f,Nn))return null;const m=Cse({container:t,subject:n,proposedScroll:f});return m?Bi(m,Nn)?null:m:null};const Tse=iP(e=>e===0?0:e>0?1:-1),m1=(()=>{const e=(t,n)=>t<0?t:t>n?t-n:0;return({current:t,max:n,change:r})=>{const a=In(t,r),o={x:e(a.x,n.x),y:e(a.y,n.y)};return Bi(o,Nn)?null:o}})(),BP=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},a=Tse(n),o=m1({max:r,current:t,change:a});return!o||a.x!==0&&o.x===0||a.y!==0&&o.y===0},p1=(e,t)=>BP({current:e.scroll.current,max:e.scroll.max,change:t}),_se=(e,t)=>{if(!p1(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return m1({current:r,max:n,change:t})},g1=(e,t)=>{const n=e.frame;return n?BP({current:n.scroll.current,max:n.scroll.max,change:t}):!1},Rse=(e,t)=>{const n=e.frame;return!n||!g1(e,t)?null:m1({current:n.scroll.current,max:n.scroll.max,change:t})};var Dse=({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:a,getAutoScrollerOptions:o})=>{const c=IP({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:a,getAutoScrollerOptions:o});return c&&p1(e,c)?c:null},kse=({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:a,getAutoScrollerOptions:o})=>{const c=e.frame;if(!c)return null;const d=IP({dragStartTime:r,container:c.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:a,getAutoScrollerOptions:o});return d&&g1(e,d)?d:null},c_=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:a,getAutoScrollerOptions:o})=>{const c=e.current.page.borderBoxCenter,h=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const p=e.viewport,y=Dse({dragStartTime:t,viewport:p,subject:h,center:c,shouldUseTimeDampening:n,getAutoScrollerOptions:o});if(y){r(y);return}}const f=wse({center:c,destination:Pr(e.impact),droppables:e.dimensions.droppables});if(!f)return;const m=kse({dragStartTime:t,droppable:f,subject:h,center:c,shouldUseTimeDampening:n,getAutoScrollerOptions:o});m&&a(f.descriptor.id,m)},Ase=({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>Ld})=>{const r=kd(e),a=kd(t);let o=null;const c=f=>{o||je();const{shouldUseTimeDampening:m,dragStartTime:p}=o;c_({state:f,scrollWindow:r,scrollDroppable:a,dragStartTime:p,shouldUseTimeDampening:m,getAutoScrollerOptions:n})};return{start:f=>{o&&je();const m=Date.now();let p=!1;const y=()=>{p=!0};c_({state:f,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:y,scrollDroppable:y,getAutoScrollerOptions:n}),o={dragStartTime:m,shouldUseTimeDampening:p},p&&c(f)},stop:()=>{o&&(r.cancel(),a.cancel(),o=null)},scroll:c}},Ose=({move:e,scrollDroppable:t,scrollWindow:n})=>{const r=(d,h)=>{const f=In(d.current.client.selection,h);e({client:f})},a=(d,h)=>{if(!g1(d,h))return h;const f=Rse(d,h);if(!f)return t(d.descriptor.id,h),null;const m=Or(h,f);return t(d.descriptor.id,m),Or(h,m)},o=(d,h,f)=>{if(!d||!p1(h,f))return f;const m=_se(h,f);if(!m)return n(f),null;const p=Or(f,m);return n(p),Or(f,p)};return d=>{const h=d.scrollJumpRequest;if(!h)return;const f=Pr(d.impact);f||je();const m=a(d.dimensions.droppables[f],h);if(!m)return;const p=d.viewport,y=o(d.isWindowScrollAllowed,p,m);y&&r(d,y)}},Mse=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const a=Ase({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),o=Ose({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:h=>{if(!(r().disabled||h.phase!=="DRAGGING")){if(h.movementMode==="FLUID"){a.scroll(h);return}h.scrollJumpRequest&&o(h)}},start:a.start,stop:a.stop}};const gc="data-rfd",xc=(()=>{const e=`${gc}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),X0=(()=>{const e=`${gc}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Pse=(()=>{const e=`${gc}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),u_={contextId:`${gc}-scroll-container-context-id`},Lse=e=>t=>`[${t}="${e}"]`,zu=(e,t)=>e.map(n=>{const r=n.styles[t];return r?`${n.selector} { ${r} }`:""}).join(" "),Ise="pointer-events: none;";var Bse=e=>{const t=Lse(e),n=(()=>{const d=`
120
+ cursor: -webkit-grab;
121
+ cursor: grab;
122
+ `;return{selector:t(xc.contextId),styles:{always:`
123
+ -webkit-touch-callout: none;
124
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
125
+ touch-action: manipulation;
126
+ `,resting:d,dragging:Ise,dropAnimating:d}}})(),r=(()=>{const d=`
127
+ transition: ${dd.outOfTheWay};
128
+ `;return{selector:t(X0.contextId),styles:{dragging:d,dropAnimating:d,userCancel:d}}})(),a={selector:t(Pse.contextId),styles:{always:"overflow-anchor: none;"}},c=[r,n,a,{selector:"body",styles:{dragging:`
129
+ cursor: grabbing;
130
+ cursor: -webkit-grabbing;
131
+ user-select: none;
132
+ -webkit-user-select: none;
133
+ -moz-user-select: none;
134
+ -ms-user-select: none;
135
+ overflow-anchor: none;
136
+ `}}];return{always:zu(c,"always"),resting:zu(c,"resting"),dragging:zu(c,"dragging"),dropAnimating:zu(c,"dropAnimating"),userCancel:zu(c,"userCancel")}};const Lr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?x.useLayoutEffect:x.useEffect,dv=()=>{const e=document.querySelector("head");return e||je(),e},d_=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function zse(e,t){const n=gt(()=>Bse(e),[e]),r=x.useRef(null),a=x.useRef(null),o=$e(Sn(p=>{const y=a.current;y||je(),y.textContent=p}),[]),c=$e(p=>{const y=r.current;y||je(),y.textContent=p},[]);Lr(()=>{!r.current&&!a.current||je();const p=d_(t),y=d_(t);return r.current=p,a.current=y,p.setAttribute(`${gc}-always`,e),y.setAttribute(`${gc}-dynamic`,e),dv().appendChild(p),dv().appendChild(y),c(n.always),o(n.resting),()=>{const v=S=>{const N=S.current;N||je(),dv().removeChild(N),S.current=null};v(r),v(a)}},[t,c,o,n.always,n.resting,e]);const d=$e(()=>o(n.dragging),[o,n.dragging]),h=$e(p=>{if(p==="DROP"){o(n.dropAnimating);return}o(n.userCancel)},[o,n.dropAnimating,n.userCancel]),f=$e(()=>{a.current&&o(n.resting)},[o,n.resting]);return gt(()=>({dragging:d,dropping:h,resting:f}),[d,h,f])}function zP(e,t){return Array.from(e.querySelectorAll(t))}var FP=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function Hp(e){return e instanceof FP(e).HTMLElement}function Fse(e,t){const n=`[${xc.contextId}="${e}"]`,r=zP(document,n);if(!r.length)return null;const a=r.find(o=>o.getAttribute(xc.draggableId)===t);return!a||!Hp(a)?null:a}function $se(e){const t=x.useRef({}),n=x.useRef(null),r=x.useRef(null),a=x.useRef(!1),o=$e(function(y,v){const S={id:y,focus:v};return t.current[y]=S,function(){const C=t.current;C[y]!==S&&delete C[y]}},[]),c=$e(function(y){const v=Fse(e,y);v&&v!==document.activeElement&&v.focus()},[e]),d=$e(function(y,v){n.current===y&&(n.current=v)},[]),h=$e(function(){r.current||a.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const y=n.current;y&&c(y)}))},[c]),f=$e(function(y){n.current=null;const v=document.activeElement;v&&v.getAttribute(xc.draggableId)===y&&(n.current=y)},[]);return Lr(()=>(a.current=!0,function(){a.current=!1;const y=r.current;y&&cancelAnimationFrame(y)}),[]),gt(()=>({register:o,tryRecordFocus:f,tryRestoreFocusRecorded:h,tryShiftRecord:d}),[o,f,h,d])}function Vse(){const e={draggables:{},droppables:{}},t=[];function n(p){return t.push(p),function(){const v=t.indexOf(p);v!==-1&&t.splice(v,1)}}function r(p){t.length&&t.forEach(y=>y(p))}function a(p){return e.draggables[p]||null}function o(p){const y=a(p);return y||je(),y}const c={register:p=>{e.draggables[p.descriptor.id]=p,r({type:"ADDITION",value:p})},update:(p,y)=>{const v=e.draggables[y.descriptor.id];v&&v.uniqueId===p.uniqueId&&(delete e.draggables[y.descriptor.id],e.draggables[p.descriptor.id]=p)},unregister:p=>{const y=p.descriptor.id,v=a(y);v&&p.uniqueId===v.uniqueId&&(delete e.draggables[y],e.droppables[p.descriptor.droppableId]&&r({type:"REMOVAL",value:p}))},getById:o,findById:a,exists:p=>!!a(p),getAllByType:p=>Object.values(e.draggables).filter(y=>y.descriptor.type===p)};function d(p){return e.droppables[p]||null}function h(p){const y=d(p);return y||je(),y}const f={register:p=>{e.droppables[p.descriptor.id]=p},unregister:p=>{const y=d(p.descriptor.id);y&&p.uniqueId===y.uniqueId&&delete e.droppables[p.descriptor.id]},getById:h,findById:d,exists:p=>!!d(p),getAllByType:p=>Object.values(e.droppables).filter(y=>y.descriptor.type===p)};function m(){e.draggables={},e.droppables={},t.length=0}return{draggable:c,droppable:f,subscribe:n,clean:m}}function Use(){const e=gt(Vse,[]);return x.useEffect(()=>function(){e.clean()},[e]),e}var x1=ge.createContext(null),Km=()=>{const e=document.body;return e||je(),e};const Hse={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Gse=e=>`rfd-announcement-${e}`;function qse(e){const t=gt(()=>Gse(e),[e]),n=x.useRef(null);return x.useEffect(function(){const o=document.createElement("div");return n.current=o,o.id=t,o.setAttribute("aria-live","assertive"),o.setAttribute("aria-atomic","true"),Hm(o.style,Hse),Km().appendChild(o),function(){setTimeout(function(){const h=Km();h.contains(o)&&h.removeChild(o),o===n.current&&(n.current=null)})}},[t]),$e(a=>{const o=n.current;if(o){o.textContent=a;return}},[])}const Wse={separator:"::"};function y1(e,t=Wse){const n=ge.useId();return gt(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function Kse({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function Yse({contextId:e,text:t}){const n=y1("hidden-text",{separator:"-"}),r=gt(()=>Kse({contextId:e,uniqueId:n}),[n,e]);return x.useEffect(function(){const o=document.createElement("div");return o.id=r,o.textContent=t,o.style.display="none",Km().appendChild(o),function(){const d=Km();d.contains(o)&&d.removeChild(o)}},[r,t]),r}var Gp=ge.createContext(null);function $P(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),t}function Xse(){let e=null;function t(){return!!e}function n(c){return c===e}function r(c){e&&je();const d={abandon:c};return e=d,d}function a(){e||je(),e=null}function o(){e&&(e.abandon(),a())}return{isClaimed:t,isActive:n,claim:r,release:a,tryAbandon:o}}function Id(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const Qse=9,Jse=13,v1=27,VP=32,Zse=33,eae=34,tae=35,nae=36,rae=37,sae=38,aae=39,iae=40,oae={[Jse]:!0,[Qse]:!0};var UP=e=>{oae[e.keyCode]&&e.preventDefault()};const qp=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),HP=0,f_=5;function lae(e,t){return Math.abs(t.x-e.x)>=f_||Math.abs(t.y-e.y)>=f_}const h_={type:"IDLE"};function cae({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:a=>{const{button:o,clientX:c,clientY:d}=a;if(o!==HP)return;const h={x:c,y:d},f=n();if(f.type==="DRAGGING"){a.preventDefault(),f.actions.move(h);return}f.type!=="PENDING"&&je();const m=f.point;if(!lae(m,h))return;a.preventDefault();const p=f.actions.fluidLift(h);r({type:"DRAGGING",actions:p})}},{eventName:"mouseup",fn:a=>{const o=n();if(o.type!=="DRAGGING"){e();return}a.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:a=>{n().type==="DRAGGING"&&a.preventDefault(),e()}},{eventName:"keydown",fn:a=>{if(n().type==="PENDING"){e();return}if(a.keyCode===v1){a.preventDefault(),e();return}UP(a)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:a=>{const o=n();if(o.type==="IDLE"&&je(),o.actions.shouldRespectForcePress()){e();return}a.preventDefault()}},{eventName:qp,fn:e}]}function uae(e){const t=x.useRef(h_),n=x.useRef(Ii),r=gt(()=>({eventName:"mousedown",fn:function(p){if(p.defaultPrevented||p.button!==HP||p.ctrlKey||p.metaKey||p.shiftKey||p.altKey)return;const y=e.findClosestDraggableId(p);if(!y)return;const v=e.tryGetLock(y,c,{sourceEvent:p});if(!v)return;p.preventDefault();const S={x:p.clientX,y:p.clientY};n.current(),f(v,S)}}),[e]),a=gt(()=>({eventName:"webkitmouseforcewillbegin",fn:m=>{if(m.defaultPrevented)return;const p=e.findClosestDraggableId(m);if(!p)return;const y=e.findOptionsForDraggable(p);y&&(y.shouldRespectForcePress||e.canGetLock(p)&&m.preventDefault())}}),[e]),o=$e(function(){const p={passive:!1,capture:!0};n.current=ls(window,[a,r],p)},[a,r]),c=$e(()=>{t.current.type!=="IDLE"&&(t.current=h_,n.current(),o())},[o]),d=$e(()=>{const m=t.current;c(),m.type==="DRAGGING"&&m.actions.cancel({shouldBlockNextClick:!0}),m.type==="PENDING"&&m.actions.abort()},[c]),h=$e(function(){const p={capture:!0,passive:!1},y=cae({cancel:d,completed:c,getPhase:()=>t.current,setPhase:v=>{t.current=v}});n.current=ls(window,y,p)},[d,c]),f=$e(function(p,y){t.current.type!=="IDLE"&&je(),t.current={type:"PENDING",point:y,actions:p},h()},[h]);Lr(function(){return o(),function(){n.current()}},[o])}function dae(){}const fae={[eae]:!0,[Zse]:!0,[nae]:!0,[tae]:!0};function hae(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:a=>{if(a.keyCode===v1){a.preventDefault(),n();return}if(a.keyCode===VP){a.preventDefault(),r();return}if(a.keyCode===iae){a.preventDefault(),e.moveDown();return}if(a.keyCode===sae){a.preventDefault(),e.moveUp();return}if(a.keyCode===aae){a.preventDefault(),e.moveRight();return}if(a.keyCode===rae){a.preventDefault(),e.moveLeft();return}if(fae[a.keyCode]){a.preventDefault();return}UP(a)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:qp,fn:n}]}function mae(e){const t=x.useRef(dae),n=gt(()=>({eventName:"keydown",fn:function(o){if(o.defaultPrevented||o.keyCode!==VP)return;const c=e.findClosestDraggableId(o);if(!c)return;const d=e.tryGetLock(c,m,{sourceEvent:o});if(!d)return;o.preventDefault();let h=!0;const f=d.snapLift();t.current();function m(){h||je(),h=!1,t.current(),r()}t.current=ls(window,hae(f,m),{capture:!0,passive:!1})}}),[e]),r=$e(function(){const o={passive:!1,capture:!0};t.current=ls(window,[n],o)},[n]);Lr(function(){return r(),function(){t.current()}},[r])}const fv={type:"IDLE"},pae=120,gae=.15;function xae({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===v1&&n.preventDefault(),e()}},{eventName:qp,fn:e}]}function yae({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const a=n();if(a.type!=="DRAGGING"){e();return}a.hasMoved=!0;const{clientX:o,clientY:c}=r.touches[0],d={x:o,y:c};r.preventDefault(),a.actions.move(d)}},{eventName:"touchend",fn:r=>{const a=n();if(a.type!=="DRAGGING"){e();return}r.preventDefault(),a.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const a=n();a.type==="IDLE"&&je();const o=r.touches[0];if(!o||!(o.force>=gae))return;const d=a.actions.shouldRespectForcePress();if(a.type==="PENDING"){d&&e();return}if(d){if(a.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:qp,fn:e}]}function vae(e){const t=x.useRef(fv),n=x.useRef(Ii),r=$e(function(){return t.current},[]),a=$e(function(v){t.current=v},[]),o=gt(()=>({eventName:"touchstart",fn:function(v){if(v.defaultPrevented)return;const S=e.findClosestDraggableId(v);if(!S)return;const N=e.tryGetLock(S,d,{sourceEvent:v});if(!N)return;const C=v.touches[0],{clientX:j,clientY:E}=C,R={x:j,y:E};n.current(),p(N,R)}}),[e]),c=$e(function(){const v={capture:!0,passive:!1};n.current=ls(window,[o],v)},[o]),d=$e(()=>{const y=t.current;y.type!=="IDLE"&&(y.type==="PENDING"&&clearTimeout(y.longPressTimerId),a(fv),n.current(),c())},[c,a]),h=$e(()=>{const y=t.current;d(),y.type==="DRAGGING"&&y.actions.cancel({shouldBlockNextClick:!0}),y.type==="PENDING"&&y.actions.abort()},[d]),f=$e(function(){const v={capture:!0,passive:!1},S={cancel:h,completed:d,getPhase:r},N=ls(window,yae(S),v),C=ls(window,xae(S),v);n.current=function(){N(),C()}},[h,r,d]),m=$e(function(){const v=r();v.type!=="PENDING"&&je();const S=v.actions.fluidLift(v.point);a({type:"DRAGGING",actions:S,hasMoved:!1})},[r,a]),p=$e(function(v,S){r().type!=="IDLE"&&je();const N=setTimeout(m,pae);a({type:"PENDING",point:S,actions:v,longPressTimerId:N}),f()},[f,r,a,m]);Lr(function(){return c(),function(){n.current();const S=r();S.type==="PENDING"&&(clearTimeout(S.longPressTimerId),a(fv))}},[r,c,a]),Lr(function(){return ls(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const bae=["input","button","textarea","select","option","optgroup","video","audio"];function GP(e,t){if(t==null)return!1;if(bae.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:GP(e,t.parentElement)}function wae(e,t){const n=t.target;return Hp(n)?GP(e,n):!1}var Sae=e=>Os(e.getBoundingClientRect()).center;function Nae(e){return e instanceof FP(e).Element}const jae=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function qP(e,t){return e==null?null:e[jae](t)?e:qP(e.parentElement,t)}function Cae(e,t){return e.closest?e.closest(t):qP(e,t)}function Eae(e){return`[${xc.contextId}="${e}"]`}function Tae(e,t){const n=t.target;if(!Nae(n))return null;const r=Eae(e),a=Cae(n,r);return!a||!Hp(a)?null:a}function _ae(e,t){const n=Tae(e,t);return n?n.getAttribute(xc.draggableId):null}function Rae(e,t){const n=`[${X0.contextId}="${e}"]`,a=zP(document,n).find(o=>o.getAttribute(X0.id)===t);return!a||!Hp(a)?null:a}function Dae(e){e.preventDefault()}function Hh({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return!(!n()||e!==t)}function WP({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const a=n.draggable.findById(r);return!(!a||!a.options.isEnabled||!PP(t.getState(),r))}function kae({lockAPI:e,contextId:t,store:n,registry:r,draggableId:a,forceSensorStop:o,sourceEvent:c}){if(!WP({lockAPI:e,store:n,registry:r,draggableId:a}))return null;const h=r.draggable.getById(a),f=Rae(t,h.descriptor.id);if(!f||c&&!h.options.canDragInteractiveElements&&wae(f,c))return null;const m=e.claim(o||Ii);let p="PRE_DRAG";function y(){return h.options.shouldRespectForcePress}function v(){return e.isActive(m)}function S(_,O){Hh({expected:_,phase:p,isLockActive:v,shouldWarn:!0})&&n.dispatch(O())}const N=S.bind(null,"DRAGGING");function C(_){function O(){e.release(),p="COMPLETED"}p!=="PRE_DRAG"&&(O(),je()),n.dispatch(Cre(_.liftActionArgs)),p="DRAGGING";function T(D,B={shouldBlockNextClick:!1}){if(_.cleanup(),B.shouldBlockNextClick){const W=ls(window,[{eventName:"click",fn:Dae,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(W)}O(),n.dispatch(TP({reason:D}))}return{isActive:()=>Hh({expected:"DRAGGING",phase:p,isLockActive:v,shouldWarn:!1}),shouldRespectForcePress:y,drop:D=>T("DROP",D),cancel:D=>T("CANCEL",D),..._.actions}}function j(_){const O=kd(D=>{N(()=>EP({client:D}))});return{...C({liftActionArgs:{id:a,clientSelection:_,movementMode:"FLUID"},cleanup:()=>O.cancel(),actions:{move:O}}),move:O}}function E(){const _={moveUp:()=>N(Mre),moveRight:()=>N(Lre),moveDown:()=>N(Pre),moveLeft:()=>N(Ire)};return C({liftActionArgs:{id:a,clientSelection:Sae(f),movementMode:"SNAP"},cleanup:Ii,actions:_})}function R(){Hh({expected:"PRE_DRAG",phase:p,isLockActive:v,shouldWarn:!0})&&e.release()}return{isActive:()=>Hh({expected:"PRE_DRAG",phase:p,isLockActive:v,shouldWarn:!1}),shouldRespectForcePress:y,fluidLift:j,snapLift:E,abort:R}}const Aae=[uae,mae,vae];function Oae({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:a}){const o=[...a?Aae:[],...r||[]],c=x.useState(()=>Xse())[0],d=$e(function(C,j){Id(C)&&!Id(j)&&c.tryAbandon()},[c]);Lr(function(){let C=t.getState();return t.subscribe(()=>{const E=t.getState();d(C,E),C=E})},[c,t,d]),Lr(()=>c.tryAbandon,[c.tryAbandon]);const h=$e(N=>WP({lockAPI:c,registry:n,store:t,draggableId:N}),[c,n,t]),f=$e((N,C,j)=>kae({lockAPI:c,registry:n,contextId:e,store:t,draggableId:N,forceSensorStop:C||null,sourceEvent:j&&j.sourceEvent?j.sourceEvent:null}),[e,c,n,t]),m=$e(N=>_ae(e,N),[e]),p=$e(N=>{const C=n.draggable.findById(N);return C?C.options:null},[n.draggable]),y=$e(function(){c.isClaimed()&&(c.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(u1()))},[c,t]),v=$e(()=>c.isClaimed(),[c]),S=gt(()=>({canGetLock:h,tryGetLock:f,findClosestDraggableId:m,findOptionsForDraggable:p,tryReleaseLock:y,isLockClaimed:v}),[h,f,m,p,y,v]);for(let N=0;N<o.length;N++)o[N](S)}const Mae=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};Zo.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),Pae=e=>({...Ld,...e.autoScrollerOptions,durationDampening:{...Ld.durationDampening,...e.autoScrollerOptions}});function Fu(e){return e.current||je(),e.current}function Lae(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:a,dragHandleUsageInstructions:o}=e,c=x.useRef(null),d=$P(e),h=$e(()=>Mae(d.current),[d]),f=$e(()=>Pae(d.current),[d]),m=qse(t),p=Yse({contextId:t,text:o}),y=zse(t,a),v=$e(W=>{Fu(c).dispatch(W)},[]),S=gt(()=>zT({publishWhileDragging:Tre,updateDroppableScroll:Rre,updateDroppableIsEnabled:Dre,updateDroppableIsCombineEnabled:kre,collectionStarting:_re},v),[v]),N=Use(),C=gt(()=>xse(N,S),[N,S]),j=gt(()=>Mse({scrollWindow:yse,scrollDroppable:C.scrollDroppable,getAutoScrollerOptions:f,...zT({move:EP},v)}),[C.scrollDroppable,v,f]),E=$se(t),R=gt(()=>hse({announce:m,autoScroller:j,dimensionMarshal:C,focusMarshal:E,getResponders:h,styleMarshal:y}),[m,j,C,E,h,y]);c.current=R;const A=$e(()=>{const W=Fu(c);W.getState().phase!=="IDLE"&&W.dispatch(u1())},[]),_=$e(()=>{const W=Fu(c).getState();return W.phase==="DROP_ANIMATING"?!0:W.phase==="IDLE"?!1:W.isDragging},[]),O=gt(()=>({isDragging:_,tryAbort:A}),[_,A]);n(O);const T=$e(W=>PP(Fu(c).getState(),W),[]),D=$e(()=>Oo(Fu(c).getState()),[]),B=gt(()=>({marshal:C,focus:E,contextId:t,canLift:T,isMovementAllowed:D,dragHandleUsageInstructionsId:p,registry:N}),[t,C,p,E,T,D,N]);return Oae({contextId:t,store:R,registry:N,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),x.useEffect(()=>A,[A]),ge.createElement(Gp.Provider,{value:B},ge.createElement(one,{context:x1,store:R},e.children))}function Iae(){return ge.useId()}function Bae(e){const t=Iae(),n=e.dragHandleUsageInstructions||mm.dragHandleUsageInstructions;return ge.createElement(mne,null,r=>ge.createElement(Lae,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const m_={dragging:5e3,dropAnimating:4500},zae=(e,t)=>t?dd.drop(t.duration):e?dd.snap:dd.fluid,Fae=(e,t)=>{if(e)return t?Pd.opacity.drop:Pd.opacity.combining},$ae=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function Vae(e){const n=e.dimension.client,{offset:r,combineWith:a,dropping:o}=e,c=!!a,d=$ae(e),h=!!o,f=h?K0.drop(r,c):K0.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:zae(d,o),transform:f,opacity:Fae(c,h),zIndex:h?m_.dropAnimating:m_.dragging,pointerEvents:"none"}}function Uae(e){return{transform:K0.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function Hae(e){return e.type==="DRAGGING"?Vae(e):Uae(e)}function Gae(e,t,n=Nn){const r=window.getComputedStyle(t),a=t.getBoundingClientRect(),o=eP(a,r),c=Um(o,n),d={client:o,tagName:t.tagName.toLowerCase(),display:r.display},h={x:o.marginBox.width,y:o.marginBox.height};return{descriptor:e,placeholder:d,displaceBy:h,client:o,page:c}}function qae(e){const t=y1("draggable"),{descriptor:n,registry:r,getDraggableRef:a,canDragInteractiveElements:o,shouldRespectForcePress:c,isEnabled:d}=e,h=gt(()=>({canDragInteractiveElements:o,shouldRespectForcePress:c,isEnabled:d}),[o,d,c]),f=$e(v=>{const S=a();return S||je(),Gae(n,S,v)},[n,a]),m=gt(()=>({uniqueId:t,descriptor:n,options:h,getDimension:f}),[n,f,h,t]),p=x.useRef(m),y=x.useRef(!0);Lr(()=>(r.draggable.register(p.current),()=>r.draggable.unregister(p.current)),[r.draggable]),Lr(()=>{if(y.current){y.current=!1;return}const v=p.current;p.current=m,r.draggable.update(m,v)},[m,r.draggable])}var b1=ge.createContext(null);function Ym(e){const t=x.useContext(e);return t||je(),t}function Wae(e){e.preventDefault()}const Kae=e=>{const t=x.useRef(null),n=$e((O=null)=>{t.current=O},[]),r=$e(()=>t.current,[]),{contextId:a,dragHandleUsageInstructionsId:o,registry:c}=Ym(Gp),{type:d,droppableId:h}=Ym(b1),f=gt(()=>({id:e.draggableId,index:e.index,type:d,droppableId:h}),[e.draggableId,e.index,d,h]),{children:m,draggableId:p,isEnabled:y,shouldRespectForcePress:v,canDragInteractiveElements:S,isClone:N,mapped:C,dropAnimationFinished:j}=e;if(!N){const O=gt(()=>({descriptor:f,registry:c,getDraggableRef:r,canDragInteractiveElements:S,shouldRespectForcePress:v,isEnabled:y}),[f,c,r,S,v,y]);qae(O)}const E=gt(()=>y?{tabIndex:0,role:"button","aria-describedby":o,"data-rfd-drag-handle-draggable-id":p,"data-rfd-drag-handle-context-id":a,draggable:!1,onDragStart:Wae}:null,[a,o,p,y]),R=$e(O=>{C.type==="DRAGGING"&&C.dropping&&O.propertyName==="transform"&&Zo.flushSync(j)},[j,C]),A=gt(()=>{const O=Hae(C),T=C.type==="DRAGGING"&&C.dropping?R:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":a,"data-rfd-draggable-id":p,style:O,onTransitionEnd:T},dragHandleProps:E}},[a,E,p,C,R,n]),_=gt(()=>({draggableId:f.id,type:f.type,source:{index:f.index,droppableId:f.droppableId}}),[f.droppableId,f.id,f.index,f.type]);return ge.createElement(ge.Fragment,null,m(A,C.snapshot,_))};var KP=(e,t)=>e===t,YP=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const Yae=e=>e.combine?e.combine.draggableId:null,Xae=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function Qae(){const e=Sn((a,o)=>({x:a,y:o})),t=Sn((a,o,c=null,d=null,h=null)=>({isDragging:!0,isClone:o,isDropAnimating:!!h,dropAnimation:h,mode:a,draggingOver:c,combineWith:d,combineTargetFor:null})),n=Sn((a,o,c,d,h=null,f=null,m=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:h,combineWith:f,mode:o,offset:a,dimension:c,forceShouldAnimate:m,snapshot:t(o,d,h,f,null)}}));return(a,o)=>{if(Id(a)){if(a.critical.draggable.id!==o.draggableId)return null;const c=a.current.client.offset,d=a.dimensions.draggables[o.draggableId],h=Pr(a.impact),f=Xae(a.impact),m=a.forceShouldAnimate;return n(e(c.x,c.y),a.movementMode,d,o.isClone,h,f,m)}if(a.phase==="DROP_ANIMATING"){const c=a.completed;if(c.result.draggableId!==o.draggableId)return null;const d=o.isClone,h=a.dimensions.draggables[o.draggableId],f=c.result,m=f.mode,p=YP(f),y=Yae(f),S={duration:a.dropDuration,curve:f1.drop,moveTo:a.newHomeClientOffset,opacity:y?Pd.opacity.drop:null,scale:y?Pd.scale.drop:null};return{mapped:{type:"DRAGGING",offset:a.newHomeClientOffset,dimension:h,dropping:S,draggingOver:p,combineWith:y,mode:m,forceShouldAnimate:null,snapshot:t(m,d,p,y,S)}}}return null}}function XP(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const Jae={mapped:{type:"SECONDARY",offset:Nn,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:XP(null)}};function Zae(){const e=Sn((c,d)=>({x:c,y:d})),t=Sn(XP),n=Sn((c,d=null,h)=>({mapped:{type:"SECONDARY",offset:c,combineTargetFor:d,shouldAnimateDisplacement:h,snapshot:t(d)}})),r=c=>c?n(Nn,c,!0):null,a=(c,d,h,f)=>{const m=h.displaced.visible[c],p=!!(f.inVirtualList&&f.effected[c]),y=$p(h),v=y&&y.draggableId===c?d:null;if(!m){if(!p)return r(v);if(h.displaced.invisible[c])return null;const C=Lc(f.displacedBy.point),j=e(C.x,C.y);return n(j,v,!0)}if(p)return r(v);const S=h.displacedBy.point,N=e(S.x,S.y);return n(N,v,m.shouldAnimate)};return(c,d)=>{if(Id(c))return c.critical.draggable.id===d.draggableId?null:a(d.draggableId,c.critical.draggable.id,c.impact,c.afterCritical);if(c.phase==="DROP_ANIMATING"){const h=c.completed;return h.result.draggableId===d.draggableId?null:a(d.draggableId,h.result.draggableId,h.impact,h.afterCritical)}return null}}const eie=()=>{const e=Qae(),t=Zae();return(r,a)=>e(r,a)||t(r,a)||Jae},tie={dropAnimationFinished:_P},nie=Z5(eie,tie,null,{context:x1,areStatePropsEqual:KP})(Kae);function QP(e){return Ym(b1).isUsingCloneFor===e.draggableId&&!e.isClone?null:ge.createElement(nie,e)}function rie(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return ge.createElement(QP,Hm({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const JP=e=>t=>e===t,sie=JP("scroll"),aie=JP("auto"),p_=(e,t)=>t(e.overflowX)||t(e.overflowY),iie=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return p_(n,sie)||p_(n,aie)},oie=()=>!1,ZP=e=>e==null?null:e===document.body?oie()?e:null:e===document.documentElement?null:iie(e)?e:ZP(e.parentElement);var Q0=e=>({x:e.scrollLeft,y:e.scrollTop});const e3=e=>e?window.getComputedStyle(e).position==="fixed"?!0:e3(e.parentElement):!1;var lie=e=>{const t=ZP(e),n=e3(e);return{closestScrollable:t,isFixedOnPage:n}},cie=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:a,client:o,page:c,closest:d})=>{const h=(()=>{if(!d)return null;const{scrollSize:y,client:v}=d,S=AP({scrollHeight:y.scrollHeight,scrollWidth:y.scrollWidth,height:v.paddingBox.height,width:v.paddingBox.width});return{pageMarginBox:d.page.marginBox,frameClient:v,scrollSize:y,shouldClipSubject:d.shouldClipSubject,scroll:{initial:d.scroll,current:d.scroll,max:S,diff:{value:Nn,displacement:Nn}}}})(),f=a==="vertical"?a1:dP,m=pc({page:c,withPlaceholder:null,axis:f,frame:h});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:f,isEnabled:t,client:o,page:c,frame:h,subject:m}};const uie=(e,t)=>{const n=tP(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,a=n.paddingBox.left-t.scrollLeft,o=r+t.scrollHeight,c=a+t.scrollWidth,h=t1({top:r,right:c,bottom:o,left:a},n.border);return n1({borderBox:h,margin:n.margin,border:n.border,padding:n.padding})};var die=({ref:e,descriptor:t,env:n,windowScroll:r,direction:a,isDropDisabled:o,isCombineEnabled:c,shouldClipSubject:d})=>{const h=n.closestScrollable,f=uie(e,h),m=Um(f,r),p=(()=>{if(!h)return null;const v=tP(h),S={scrollHeight:h.scrollHeight,scrollWidth:h.scrollWidth};return{client:v,page:Um(v,r),scroll:Q0(h),scrollSize:S,shouldClipSubject:d}})();return cie({descriptor:t,isEnabled:!o,isCombineEnabled:c,isFixedOnPage:n.isFixedOnPage,direction:a,client:f,page:m,closest:p})};const fie={passive:!1},hie={passive:!0};var g_=e=>e.shouldPublishImmediately?fie:hie;const Gh=e=>e&&e.env.closestScrollable||null;function mie(e){const t=x.useRef(null),n=Ym(Gp),r=y1("droppable"),{registry:a,marshal:o}=n,c=$P(e),d=gt(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),h=x.useRef(d),f=gt(()=>Sn((A,_)=>{t.current||je();const O={x:A,y:_};o.updateDroppableScroll(d.id,O)}),[d.id,o]),m=$e(()=>{const A=t.current;return!A||!A.env.closestScrollable?Nn:Q0(A.env.closestScrollable)},[]),p=$e(()=>{const A=m();f(A.x,A.y)},[m,f]),y=gt(()=>kd(p),[p]),v=$e(()=>{const A=t.current,_=Gh(A);if(A&&_||je(),A.scrollOptions.shouldPublishImmediately){p();return}y()},[y,p]),S=$e((A,_)=>{t.current&&je();const O=c.current,T=O.getDroppableRef();T||je();const D=lie(T),B={ref:T,descriptor:d,env:D,scrollOptions:_};t.current=B;const W=die({ref:T,descriptor:d,env:D,windowScroll:A,direction:O.direction,isDropDisabled:O.isDropDisabled,isCombineEnabled:O.isCombineEnabled,shouldClipSubject:!O.ignoreContainerClipping}),M=D.closestScrollable;return M&&(M.setAttribute(u_.contextId,n.contextId),M.addEventListener("scroll",v,g_(B.scrollOptions))),W},[n.contextId,d,v,c]),N=$e(()=>{const A=t.current,_=Gh(A);return A&&_||je(),Q0(_)},[]),C=$e(()=>{const A=t.current;A||je();const _=Gh(A);t.current=null,_&&(y.cancel(),_.removeAttribute(u_.contextId),_.removeEventListener("scroll",v,g_(A.scrollOptions)))},[v,y]),j=$e(A=>{const _=t.current;_||je();const O=Gh(_);O||je(),O.scrollTop+=A.y,O.scrollLeft+=A.x},[]),E=gt(()=>({getDimensionAndWatchScroll:S,getScrollWhileDragging:N,dragStopped:C,scroll:j}),[C,S,N,j]),R=gt(()=>({uniqueId:r,descriptor:d,callbacks:E}),[E,d,r]);Lr(()=>(h.current=R.descriptor,a.droppable.register(R),()=>{t.current&&C(),a.droppable.unregister(R)}),[E,d,C,R,o,a.droppable]),Lr(()=>{t.current&&o.updateDroppableIsEnabled(h.current.id,!e.isDropDisabled)},[e.isDropDisabled,o]),Lr(()=>{t.current&&o.updateDroppableIsCombineEnabled(h.current.id,e.isCombineEnabled)},[e.isCombineEnabled,o])}function hv(){}const x_={width:0,height:0,margin:wne},pie=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?x_:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},gie=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=pie({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?dd.placeholder:null}},xie=e=>{const t=x.useRef(null),n=$e(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:a,onClose:o,contextId:c}=e,[d,h]=x.useState(e.animate==="open");x.useEffect(()=>d?r!=="open"?(n(),h(!1),hv):t.current?hv:(t.current=setTimeout(()=>{t.current=null,h(!1)}),n):hv,[r,d,n]);const f=$e(p=>{p.propertyName==="height"&&(a(),r==="close"&&o())},[r,o,a]),m=gie({isAnimatingOpenOnMount:d,animate:e.animate,placeholder:e.placeholder});return ge.createElement(e.placeholder.tagName,{style:m,"data-rfd-placeholder-context-id":c,onTransitionEnd:f,ref:e.innerRef})};var yie=ge.memo(xie);class vie extends ge.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const bie=e=>{const t=x.useContext(Gp);t||je();const{contextId:n,isMovementAllowed:r}=t,a=x.useRef(null),o=x.useRef(null),{children:c,droppableId:d,type:h,mode:f,direction:m,ignoreContainerClipping:p,isDropDisabled:y,isCombineEnabled:v,snapshot:S,useClone:N,updateViewportMaxScroll:C,getContainerForClone:j}=e,E=$e(()=>a.current,[]),R=$e((M=null)=>{a.current=M},[]);$e(()=>o.current,[]);const A=$e((M=null)=>{o.current=M},[]),_=$e(()=>{r()&&C({maxScroll:MP()})},[r,C]);mie({droppableId:d,type:h,mode:f,direction:m,isDropDisabled:y,isCombineEnabled:v,ignoreContainerClipping:p,getDroppableRef:E});const O=gt(()=>ge.createElement(vie,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:M,data:V,animate:G})=>ge.createElement(yie,{placeholder:V,onClose:M,innerRef:A,animate:G,contextId:n,onTransitionEnd:_})),[n,_,e.placeholder,e.shouldAnimatePlaceholder,A]),T=gt(()=>({innerRef:R,placeholder:O,droppableProps:{"data-rfd-droppable-id":d,"data-rfd-droppable-context-id":n}}),[n,d,O,R]),D=N?N.dragging.draggableId:null,B=gt(()=>({droppableId:d,type:h,isUsingCloneFor:D}),[d,D,h]);function W(){if(!N)return null;const{dragging:M,render:V}=N,G=ge.createElement(QP,{draggableId:M.draggableId,index:M.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(F,H)=>V(F,H,M));return cw.createPortal(G,j())}return ge.createElement(b1.Provider,{value:B},c(T,S),W())};function wie(){return document.body||je(),document.body}const y_={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:wie},t3=e=>{let t={...e},n;for(n in y_)e[n]===void 0&&(t={...t,[n]:y_[n]});return t},mv=(e,t)=>e===t.droppable.type,v_=(e,t)=>t.draggables[e.draggable.id],Sie=()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=Sn(o=>({draggableId:o.id,type:o.type,source:{index:o.index,droppableId:o.droppableId}})),r=Sn((o,c,d,h,f,m)=>{const p=f.descriptor.id;if(f.descriptor.droppableId===o){const S=m?{render:m,dragging:n(f.descriptor)}:null,N={isDraggingOver:d,draggingOverWith:d?p:null,draggingFromThisWith:p,isUsingPlaceholder:!0};return{placeholder:f.placeholder,shouldAnimatePlaceholder:!1,snapshot:N,useClone:S}}if(!c)return t;if(!h)return e;const v={isDraggingOver:d,draggingOverWith:p,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:f.placeholder,shouldAnimatePlaceholder:!0,snapshot:v,useClone:null}});return(o,c)=>{const d=t3(c),h=d.droppableId,f=d.type,m=!d.isDropDisabled,p=d.renderClone;if(Id(o)){const y=o.critical;if(!mv(f,y))return t;const v=v_(y,o.dimensions),S=Pr(o.impact)===h;return r(h,m,S,S,v,p)}if(o.phase==="DROP_ANIMATING"){const y=o.completed;if(!mv(f,y.critical))return t;const v=v_(y.critical,o.dimensions);return r(h,m,YP(y.result)===h,Pr(y.impact)===h,v,p)}if(o.phase==="IDLE"&&o.completed&&!o.shouldFlush){const y=o.completed;if(!mv(f,y.critical))return t;const v=Pr(y.impact)===h,S=!!(y.impact.at&&y.impact.at.type==="COMBINE"),N=y.critical.droppable.id===h;return v?S?e:t:N?e:t}return t}},Nie={updateViewportMaxScroll:Ore},b_=Z5(Sie,Nie,(e,t,n)=>({...t3(n),...e,...t}),{context:x1,areStatePropsEqual:KP})(bie);function n3({blockedByTicketId:e,blockedByTicketTitle:t,onNavigateToBlocker:n,compact:r=!1}){const a=t||"Unknown ticket",o=r?`🔒 ${a.slice(0,15)}...`:`Blocked by: ${a}`;return l.jsxs("div",{className:ue("flex items-center gap-1.5 px-2 py-1 rounded text-[10px]","bg-amber-100 dark:bg-amber-900/30","text-amber-700 dark:text-amber-400","border border-amber-200 dark:border-amber-800","transition-colors",n&&"cursor-pointer hover:bg-amber-200 dark:hover:bg-amber-900/50",r?"w-fit":"w-full"),onClick:c=>{n&&(c.stopPropagation(),n(e))},title:n?"Click to view blocker ticket":void 0,children:[l.jsx(Ed,{className:"h-3 w-3 flex-shrink-0"}),l.jsx("span",{className:"flex-1 truncate",children:o}),n&&l.jsx(Dp,{className:"h-3 w-3 flex-shrink-0 opacity-50"})]})}const jie=x.memo(function({ticket:t,index:n,onClick:r,onExecute:a,onDelete:o,onNavigateToBlocker:c}){const[d,h]=x.useState(!1),[f,m]=x.useState(!1),[p,y]=x.useState(!1),v=t.blocked_by_ticket_id!==null,S=async j=>{if(j.stopPropagation(),!(!a||d)){if(v){me.error("Cannot execute ticket",{description:t.blocked_by_ticket_title?`Blocked by: "${t.blocked_by_ticket_title}" - Complete that ticket first.`:"This ticket is blocked by a dependency. Complete the blocker first."});return}h(!0);try{await a(t),me.success(`Started execution: ${t.title}`)}catch(E){const R=E instanceof Error?E.message:"Failed to start execution";me.error(R)}finally{h(!1)}}},N=j=>{j.stopPropagation(),!f&&y(!0)},C=async()=>{m(!0);try{await SH(t.id),me.success("Ticket deleted"),o?.(t.id)}catch(j){const E=j instanceof Error?j.message:"Failed to delete ticket";me.error(E)}finally{m(!1),y(!1)}};return l.jsxs(l.Fragment,{children:[l.jsx(rie,{draggableId:t.id,index:n,children:(j,E)=>l.jsx("div",{ref:j.innerRef,...j.draggableProps,...j.dragHandleProps,className:"animate-in fade-in slide-in-from-left-4 duration-300",children:l.jsxs("div",{className:ue("cursor-pointer transition-all duration-300 ease-in-out","bg-card border border-border rounded overflow-hidden","px-2 py-2 text-xs break-words","hover:shadow-md hover:border-foreground/20 hover:scale-[1.02] hover:-translate-y-0.5","transform-gpu",v&&"opacity-70 border-amber-500/50",E.isDragging&&"shadow-xl opacity-90 rotate-2 scale-105 ring-2 ring-primary/20"),onClick:()=>r(t),children:[v&&l.jsx("div",{className:"mb-1.5",children:l.jsx(n3,{blockedByTicketId:t.blocked_by_ticket_id,blockedByTicketTitle:t.blocked_by_ticket_title,onNavigateToBlocker:c})}),t.goal_title&&l.jsxs("div",{className:"text-[10px] text-muted-foreground flex items-center gap-1 mb-1",children:[l.jsx(oa,{className:"h-2.5 w-2.5"})," ",t.goal_title]}),l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsx("div",{className:"font-normal leading-relaxed text-foreground flex-1 min-w-0 break-words",children:t.title}),l.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[t.state===it.PLANNED&&a&&l.jsx("button",{onClick:S,disabled:d||v,className:ue("p-1 rounded transition-colors focus-visible:ring-2 focus-visible:ring-ring",v?"bg-gray-100 text-gray-400 cursor-not-allowed dark:bg-gray-800 dark:text-gray-600":"bg-emerald-100 hover:bg-emerald-200 text-emerald-700 dark:bg-emerald-900/30 dark:hover:bg-emerald-900/50 dark:text-emerald-400","disabled:opacity-50"),title:v?"Cannot execute: blocked by dependency":"Execute this ticket",children:d?l.jsx(ke,{className:"h-3 w-3 animate-spin"}):v?l.jsx(Ed,{className:"h-3 w-3"}):l.jsx(ia,{className:"h-3 w-3"})}),l.jsx("button",{onClick:N,disabled:f,className:ue("p-1 rounded transition-colors focus-visible:ring-2 focus-visible:ring-ring","bg-red-100 hover:bg-red-200 text-red-700","dark:bg-red-900/30 dark:hover:bg-red-900/50 dark:text-red-400","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Delete this ticket",children:f?l.jsx(ke,{className:"h-3 w-3 animate-spin"}):l.jsx(On,{className:"h-3 w-3"})})]})]}),t.description&&l.jsx("div",{className:"text-muted-foreground mt-1.5 line-clamp-2 text-[11px]",children:t.description})]})})}),l.jsx($o,{open:p,onOpenChange:y,children:l.jsxs(Di,{onClick:j=>j.stopPropagation(),children:[l.jsxs(ki,{children:[l.jsx(Oi,{children:"Delete ticket"}),l.jsxs(Mi,{children:['Delete "',t.title,'"? This action cannot be undone.']})]}),l.jsxs(Ai,{children:[l.jsx(Li,{children:"Cancel"}),l.jsxs(Pi,{onClick:C,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[f?l.jsx(ke,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})},(e,t)=>e.ticket.id===t.ticket.id&&e.ticket.title===t.ticket.title&&e.ticket.description===t.ticket.description&&e.ticket.state===t.ticket.state&&e.ticket.priority===t.ticket.priority&&e.ticket.blocked_by_ticket_id===t.ticket.blocked_by_ticket_id&&e.ticket.goal_title===t.ticket.goal_title&&e.index===t.index);function Cie(e){const t=Ga();return dD({mutationFn:({ticketId:n,data:r})=>cm(n,r),onMutate:async({ticketId:n,data:r})=>{if(!e)return;const a=tr.boards.view(e);await t.cancelQueries({queryKey:a});const o=t.getQueryData(a);if(o){let c=null;for(const d of o.columns){const h=d.tickets.find(f=>f.id===n);if(h){c=h;break}}if(c){const d={...c,state:r.to_state},h=o.columns.map(f=>f.state===c.state?{...f,tickets:f.tickets.filter(m=>m.id!==n)}:f.state===r.to_state?{...f,tickets:[d,...f.tickets]}:f);t.setQueryData(a,{...o,columns:h})}}return{snapshot:o}},onError:(n,r,a)=>{e&&a?.snapshot&&t.setQueryData(tr.boards.view(e),a.snapshot)},onSettled:()=>{e&&t.invalidateQueries({queryKey:tr.boards.view(e)})}})}function Eie(e){const t=Ga();return dD({mutationFn:n=>cA(n),onMutate:async n=>{if(!e)return;const r=tr.boards.view(e);await t.cancelQueries({queryKey:r});const a=t.getQueryData(r);if(a){let o=null;for(const c of a.columns){const d=c.tickets.find(h=>h.id===n);if(d){o=d;break}}if(o){const c={...o,state:it.EXECUTING},d=a.columns.map(h=>h.state===o.state?{...h,tickets:h.tickets.filter(f=>f.id!==n)}:h.state===it.EXECUTING?{...h,tickets:[c,...h.tickets]}:h);t.setQueryData(r,{...a,columns:d})}}return{snapshot:a}},onError:(n,r,a)=>{e&&a?.snapshot&&t.setQueryData(tr.boards.view(e),a.snapshot)},onSettled:()=>{e&&t.invalidateQueries({queryKey:tr.boards.view(e)})}})}function Tie(){return l.jsxs("div",{className:"bg-card border border-border rounded px-2 py-2 space-y-2",children:[l.jsx(un,{className:"h-3.5 w-full"}),l.jsx(un,{className:"h-3.5 w-3/4"}),l.jsx(un,{className:"h-3 w-1/2"})]})}function _ie(){return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4 px-1",children:[l.jsx(un,{className:"h-8 w-36"}),l.jsx(un,{className:"h-8 w-48"})]}),l.jsxs("div",{className:"overflow-x-auto pb-4",children:[l.jsx("div",{className:"flex gap-3 mb-2 px-1",children:cd.map(e=>l.jsx("div",{className:"flex-shrink-0 w-[180px]",children:l.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[l.jsx("span",{className:"text-muted-foreground",children:"●"}),l.jsx("span",{className:"font-medium text-muted-foreground/60",children:Rr[e]})]})},e))}),l.jsx("div",{className:"flex gap-3 px-1",children:cd.map((e,t)=>l.jsx("div",{className:"flex-shrink-0 w-[180px] space-y-2",children:Array.from({length:t<3?3:t<5?2:1}).map((n,r)=>l.jsx(Tie,{},r))},e))})]})]})}function fd({icon:e,title:t,description:n,action:r,compact:a=!1,className:o}){return a?l.jsxs("div",{className:ue("flex flex-col items-center justify-center py-6 gap-2",o),children:[l.jsx(e,{className:"h-5 w-5 text-muted-foreground/50"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:t})]}):l.jsxs("div",{className:ue("flex flex-col items-center justify-center py-8 gap-3 text-center",o),children:[l.jsx(e,{className:"h-10 w-10 text-muted-foreground/40"}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:t}),n&&l.jsx("p",{className:"text-xs text-muted-foreground/70 max-w-[240px]",children:n})]}),r&&l.jsx(ye,{variant:"outline",size:"sm",onClick:r.onClick,className:"mt-1",children:r.label})]})}function w_({refreshTrigger:e}={}){const{currentBoard:t}=ys(),n=G5(),r=Ga(),a=Cie(t?.id),o=Eie(t?.id),{selectTicket:c}=of(),[d,h]=x.useState(!1),{data:f,refetch:m}=h9(),[p,y]=x.useState(!1),[v,S]=x.useState(!1),[N,C]=x.useState(!0),[j,E]=x.useState(""),[R,A]=x.useState(new Set),[_,O]=x.useState("all"),[T,D]=x.useState([]),{data:B,isLoading:W,error:M,dataUpdatedAt:V,refetch:G}=ow(t?.id,N),F=M?M instanceof Error?M.message:"Failed to load board":null,H=new Date(V||Date.now());x.useEffect(()=>{t?.id?(O("all"),iw(t.id).then(q=>D(q.goals)).catch(()=>D([]))):D([])},[t?.id]),x.useEffect(()=>{e!==void 0&&G()},[e,G]);const P=x.useCallback(async()=>{await G()},[G]),U=x.useCallback(async()=>{h(!0),me.info("Autopilot started",{description:"Processing all planned tickets..."});try{const q=await PH();if(q.status==="completed")if(q.tickets_queued===0)me.info("Autopilot: No planned tickets",{description:q.message});else{const ce=[];q.tickets_completed>0&&ce.push(`${q.tickets_completed} completed`),q.tickets_failed>0&&ce.push(`${q.tickets_failed} failed/blocked`),me.success(`Autopilot complete: ${q.tickets_queued} ticket(s) processed`,{description:ce.join(", ")||q.message,duration:5e3})}else q.status==="timeout"?me.warning("Autopilot timed out",{description:q.message,duration:5e3}):me.error("Autopilot error",{description:q.message});await P(),m()}catch(q){const ce=q instanceof Error?q.message:"Autopilot failed";me.error("Autopilot failed",{description:ce})}finally{h(!1)}},[P,m]),z=q=>{c(q.id)},te=x.useCallback(q=>{c(q)},[c]),oe=x.useCallback(async q=>{await o.mutateAsync(q.id)},[o]),L=async q=>{const{destination:ce,source:ne,draggableId:xe}=q;if(!ce||ce.droppableId===ne.droppableId&&ce.index===ne.index)return;const be=ce.droppableId,De=ne.droppableId;if(be===De){if(!B||!t)return;const _e=tr.boards.view(t.id),vt=B.columns.map(en=>{if(en.state!==De)return en;const Pt=[...en.tickets],[vn]=Pt.splice(ne.index,1);return Pt.splice(ce.index,0,vn),{...en,tickets:Pt}});r.setQueryData(_e,{...B,columns:vt});return}if(!(!B?.columns.find(_e=>_e.state===De)?.tickets.find(_e=>_e.id===xe)||!B||!t))try{await a.mutateAsync({ticketId:xe,data:{to_state:be,actor_type:oc.HUMAN,reason:`Moved from ${Rr[De]} to ${Rr[be]}`}}),me.success(`Ticket moved to ${Rr[be]}`)}catch(_e){const vt=_e instanceof Error?_e.message:"Failed to move ticket";me.error(vt)}},$=x.useCallback(q=>{let ne=B?.columns.find(be=>be.state===q)?.tickets||[];if(_!=="all"&&(ne=ne.filter(be=>be.goal_id===_)),!j)return ne;const xe=j.toLowerCase();return ne.filter(be=>be.title.toLowerCase().includes(xe)||be.description?.toLowerCase().includes(xe))},[B,j,_]),X=x.useCallback(q=>{A(ce=>{const ne=new Set(ce);return ne.has(q)?ne.delete(q):ne.add(q),ne})},[]),Q=x.useMemo(()=>B?cd.reduce((q,ce)=>q+$(ce).length,0):0,[B,$]);return t?W&&!B?l.jsx(_ie,{}):F&&!B?l.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:l.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[l.jsx(Hn,{className:"h-8 w-8 text-destructive"}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-destructive",children:"Failed to load board"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:F})]}),l.jsxs(ye,{onClick:()=>P(),variant:"outline",size:"sm",children:[l.jsx(pa,{className:"h-4 w-4 mr-2"}),"Try Again"]})]})}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4 px-1",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(ye,{onClick:U,disabled:d||W,size:"sm",variant:"outline",className:"gap-2",children:[d?l.jsx(ke,{className:"h-4 w-4 animate-spin"}):l.jsx(hs,{className:"h-4 w-4"}),d?"Running...":"Start Autopilot"]}),l.jsxs("button",{onClick:()=>y(!p),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[l.jsx(Bs,{className:"h-3.5 w-3.5"}),f?l.jsx("span",{className:ue(f.llm_configured?"text-emerald-600":"text-amber-600"),children:f.llm_configured?`Planner ready · ${f.llm_provider??f.model}`:"Planner needs API key"}):l.jsx("span",{children:"Loading..."})]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[T.length>1&&l.jsxs(ms,{value:_,onValueChange:O,children:[l.jsxs(gs,{className:"h-8 w-40 text-xs",children:[l.jsx(oa,{className:"h-3 w-3 mr-1 flex-shrink-0"}),l.jsx(ps,{placeholder:"All goals"})]}),l.jsxs(zs,{children:[l.jsx(Vt,{value:"all",children:"All goals"}),T.map(q=>l.jsx(Vt,{value:q.id,children:q.title},q.id))]})]}),l.jsxs("div",{className:"relative",children:[l.jsx(kp,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),l.jsx("input",{type:"text",value:j,onChange:q=>E(q.target.value),placeholder:"Filter tickets...",className:"h-8 w-40 rounded-md border border-input bg-background pl-8 pr-3 text-xs placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),j&&l.jsx("button",{onClick:()=>E(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:l.jsx(On,{className:"h-3 w-3"})})]}),j&&l.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[Q," match",Q!==1?"es":""]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"relative",children:[l.jsx(Pn,{id:"auto-refresh",checked:N,onCheckedChange:C}),N&&l.jsxs("span",{className:"absolute -top-1 -right-1 flex h-2 w-2",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]})]}),l.jsxs(ct,{htmlFor:"auto-refresh",className:"text-xs text-muted-foreground cursor-pointer flex items-center gap-1.5",children:["Auto-refresh",N&&l.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["(last: ",H.toLocaleTimeString(),")"]})]})]}),l.jsxs(ye,{onClick:()=>P(),disabled:W,size:"sm",variant:"ghost",className:"gap-2",children:[l.jsx(pa,{className:ue("h-4 w-4",W&&"animate-spin")}),"Refresh"]}),l.jsx(ye,{onClick:()=>n.setBoardSettingsOpen(!0),size:"sm",variant:"ghost",title:"Board Settings",children:l.jsx(Td,{className:"h-4 w-4"})})]})]}),p&&f&&l.jsx("div",{className:"mb-4 px-1",children:l.jsxs("div",{className:"bg-muted/50 rounded-lg p-3 text-xs space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"font-medium",children:"Planner Status"}),l.jsx("button",{onClick:()=>y(!1),className:"text-muted-foreground hover:text-foreground",children:l.jsx(On,{className:"h-3.5 w-3.5"})})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"text-muted-foreground",children:"Model:"}),l.jsx("span",{className:"font-mono",children:f.model})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"text-muted-foreground",children:"LLM:"}),f.llm_configured?l.jsxs("span",{className:"flex items-center gap-1 text-emerald-600",children:[l.jsx(qt,{className:"h-3 w-3"}),f.llm_provider||"ready"]}):l.jsxs("span",{className:"flex items-center gap-1 text-amber-600",children:[l.jsx(On,{className:"h-3 w-3"}),"needs API key"]})]})]}),!f.llm_configured&&l.jsxs("div",{className:"text-[10px] text-amber-700 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 rounded px-2 py-1.5 leading-relaxed border border-amber-200 dark:border-amber-800",children:[l.jsx("strong",{children:"Why?"})," The planner uses LLM for follow-ups & reflections. Set ",l.jsx("code",{className:"font-mono",children:"ANTHROPIC_API_KEY"})," or ",l.jsx("code",{className:"font-mono",children:"OPENAI_API_KEY"})," in your ",l.jsx("code",{className:"font-mono",children:".env"}),", or switch the model to ",l.jsx("code",{className:"font-mono",children:"cli/claude"})," in the planner settings to use the Claude CLI instead. Auto-execute still works without this."]}),f.llm_configured&&l.jsxs("div",{className:"flex items-center gap-2 pt-1 border-t border-border/50",children:[l.jsx("button",{onClick:async()=>{S(!0);try{const q=await uA(!0);m(),q.llm_health?.healthy?me.success(`LLM healthy (${q.llm_health.latency_ms}ms)`):me.error(q.llm_health?.error||"LLM health check failed")}catch{me.error("Failed to run health check")}finally{S(!1)}},disabled:v,className:"text-[10px] px-2 py-1 rounded bg-muted hover:bg-muted/80 transition-colors disabled:opacity-50",children:v?l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(ke,{className:"h-2.5 w-2.5 animate-spin"}),"Checking..."]}):"Test Connection"}),f.llm_health&&l.jsx("span",{className:ue("text-[10px] flex items-center gap-1",f.llm_health.healthy?"text-emerald-600":"text-red-600"),children:f.llm_health.healthy?l.jsxs(l.Fragment,{children:[l.jsx(qt,{className:"h-2.5 w-2.5"}),"Healthy (",f.llm_health.latency_ms,"ms)"]}):l.jsxs(l.Fragment,{children:[l.jsx(On,{className:"h-2.5 w-2.5"}),f.llm_health.error?.slice(0,50)||"Failed"]})})]}),l.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[l.jsx("span",{className:"text-muted-foreground",children:"Features:"}),l.jsxs("span",{className:ue("inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px]",f.features.auto_execute?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-500"),children:[f.features.auto_execute?l.jsx(qt,{className:"h-2.5 w-2.5"}):l.jsx(On,{className:"h-2.5 w-2.5"}),"execute"]}),l.jsxs("span",{className:ue("inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px]",f.features.propose_followups?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-500"),children:[f.features.propose_followups?l.jsx(qt,{className:"h-2.5 w-2.5"}):l.jsx(On,{className:"h-2.5 w-2.5"}),"followups"]}),l.jsxs("span",{className:ue("inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px]",f.features.generate_reflections?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-500"),children:[f.features.generate_reflections?l.jsx(qt,{className:"h-2.5 w-2.5"}):l.jsx(On,{className:"h-2.5 w-2.5"}),"reflections"]})]}),l.jsxs("div",{className:"text-[10px] text-muted-foreground pt-1 border-t border-border/50",children:["Caps: ",f.max_followups_per_ticket," follow-ups/ticket, ",f.max_followups_per_tick," follow-ups/tick"]}),f.last_tick&&l.jsxs("div",{className:"pt-2 border-t border-border/50",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l.jsx("span",{className:"font-medium",children:"Last Tick"}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:new Date(f.last_tick.last_tick_at||"").toLocaleTimeString()})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-muted-foreground",children:"executed:"}),l.jsx("span",{className:ue("font-mono",f.last_tick.executed>0?"text-blue-600":""),children:f.last_tick.executed})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-muted-foreground",children:"follow-ups:"}),l.jsx("span",{className:ue("font-mono",f.last_tick.followups_created>0?"text-amber-600":""),children:f.last_tick.followups_created})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-muted-foreground",children:"reflections:"}),l.jsx("span",{className:ue("font-mono",f.last_tick.reflections_added>0?"text-emerald-600":""),children:f.last_tick.reflections_added})]})]})]})]})}),l.jsx(Bae,{onDragEnd:L,children:l.jsxs("div",{className:"overflow-x-auto pb-4",children:[l.jsx("div",{className:"flex gap-3 mb-2 px-1 sticky top-0 bg-background z-10",children:cd.map(q=>{const ce=$(q),ne=R.has(q),xe=q===it.PLANNED?ce.filter(De=>De.blocked_by_ticket_id!==null).length:0,be=q===it.PLANNED?ce.filter(De=>De.blocked_by_ticket_id===null).length:0;return l.jsx("div",{className:ue("flex-shrink-0",ne?"w-[36px]":"w-[180px]"),children:ne?l.jsxs("button",{onClick:()=>X(q),className:"flex flex-col items-center gap-1 py-1 text-muted-foreground hover:text-foreground transition-colors",title:`Expand ${Rr[q]}`,children:[l.jsx(Zi,{className:"h-3 w-3"}),l.jsx("span",{className:"text-[10px] font-medium [writing-mode:vertical-lr] rotate-180",children:Rr[q]}),ce.length>0&&l.jsx("span",{className:"text-[9px] bg-muted rounded-full px-1.5 py-0.5 min-w-[18px] text-center",children:ce.length})]}):l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[l.jsx("button",{onClick:()=>X(q),className:"text-muted-foreground hover:text-foreground transition-colors",title:`Collapse ${Rr[q]}`,children:"●"}),l.jsx("span",{className:"font-medium",children:Rr[q]}),ce.length>0&&l.jsx("span",{className:"text-[10px] bg-muted text-muted-foreground rounded-full px-1.5 py-0.5 min-w-[18px] text-center leading-none",children:ce.length})]}),q===it.PLANNED&&xe>0&&l.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-amber-600 dark:text-amber-400",children:[l.jsx(Ed,{className:"h-2.5 w-2.5"}),l.jsxs("span",{children:[xe," blocked, ",be," ready"]})]})]})},q)})}),l.jsx("div",{className:"flex gap-3 px-1",children:cd.map(q=>{const ce=$(q);return R.has(q)?l.jsx(b_,{droppableId:q,children:xe=>l.jsx("div",{ref:xe.innerRef,...xe.droppableProps,className:"flex-shrink-0 w-[36px] min-h-[400px]",children:l.jsx("div",{className:"hidden",children:xe.placeholder})})},q):l.jsx("div",{className:"flex-shrink-0 w-[180px] flex flex-col",children:l.jsx(b_,{droppableId:q,children:(xe,be)=>l.jsxs("div",{ref:xe.innerRef,...xe.droppableProps,className:ue("flex-1 min-h-[400px] transition-all duration-200 rounded-lg",be.isDraggingOver&&"bg-muted/30 ring-2 ring-primary/20"),children:[l.jsxs("div",{className:"space-y-2",children:[ce.map((De,Ke)=>l.jsx(jie,{ticket:De,index:Ke,onClick:z,onExecute:oe,onDelete:()=>P(),onNavigateToBlocker:te},De.id)),xe.placeholder]}),ce.length===0&&!be.isDraggingOver&&l.jsx(fd,{icon:YW,title:"No tickets",compact:!0})]})})},q)})})]})})]}):l.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:l.jsxs("div",{className:"flex flex-col items-center gap-4 text-center max-w-md",children:[l.jsx(oa,{className:"h-12 w-12 text-muted-foreground"}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-foreground",children:"No Project Selected"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Select a project from the dropdown above or add a new project to get started."})]})]})})}function Rie(e){return new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Die({evidence:e}){const[t,n]=x.useState(!1),[r,a]=x.useState(null),[o,c]=x.useState(null),[d,h]=x.useState(!1),[f,m]=x.useState("stdout"),p=x.useCallback(async()=>{if(!(r!==null||d)){h(!0);try{const[v,S]=await Promise.all([RH(e.id),DH(e.id)]);a(v),c(S)}catch(v){console.error("Failed to load evidence output:",v),a(""),c("")}finally{h(!1)}}},[e.id,r,d]),y=()=>{t||p(),n(!t)};return l.jsxs("div",{className:ue("border rounded-md overflow-hidden",e.succeeded?"border-emerald-500/30 bg-emerald-500/5":"border-red-500/30 bg-red-500/5"),children:[l.jsxs("button",{onClick:y,className:"w-full flex items-center gap-3 px-3 py-2.5 hover:bg-black/5 transition-colors text-left",children:[l.jsx("span",{className:"text-muted-foreground",children:t?l.jsx($r,{className:"h-4 w-4"}):l.jsx(Zi,{className:"h-4 w-4"})}),e.succeeded?l.jsx(As,{className:"h-4 w-4 text-emerald-500 flex-shrink-0"}):l.jsx(Is,{className:"h-4 w-4 text-red-500 flex-shrink-0"}),l.jsx("code",{className:"text-[12px] font-mono text-foreground truncate flex-1",children:e.command}),l.jsxs("span",{className:ue("text-[11px] font-medium px-1.5 py-0.5 rounded",e.exit_code===0?"bg-emerald-500/20 text-emerald-700":"bg-red-500/20 text-red-700"),children:["exit ",e.exit_code]}),l.jsx("span",{className:"text-[11px] text-muted-foreground flex-shrink-0",children:Rie(e.created_at)})]}),t&&l.jsxs("div",{className:"border-t border-border/50",children:[l.jsxs("div",{className:"flex border-b border-border/50",children:[l.jsxs("button",{onClick:()=>m("stdout"),className:ue("flex items-center gap-1.5 px-3 py-1.5 text-[12px] font-medium transition-colors",f==="stdout"?"text-foreground bg-muted/50 border-b-2 border-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(la,{className:"h-3 w-3"}),"stdout"]}),l.jsxs("button",{onClick:()=>m("stderr"),className:ue("flex items-center gap-1.5 px-3 py-1.5 text-[12px] font-medium transition-colors",f==="stderr"?"text-foreground bg-muted/50 border-b-2 border-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(la,{className:"h-3 w-3"}),"stderr"]})]}),l.jsx("div",{className:"p-3 bg-slate-950 max-h-[300px] overflow-auto",children:d?l.jsx("div",{className:"flex items-center justify-center py-6",children:l.jsx(ke,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):l.jsx("pre",{className:"text-[11px] font-mono text-slate-300 whitespace-pre-wrap break-all",children:f==="stdout"?r||"(empty)":o||"(empty)"})})]})]})}function kie({evidence:e}){if(e.length===0)return l.jsx(fd,{icon:_O,title:"No verification evidence",description:"Evidence will appear after verification commands run"});const t=e.filter(r=>r.succeeded).length,n=e.length-t;return l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-3 text-[12px]",children:[l.jsxs("span",{className:"text-muted-foreground",children:[e.length," command",e.length!==1?"s":""," total"]}),t>0&&l.jsxs("span",{className:"text-emerald-600 flex items-center gap-1",children:[l.jsx(As,{className:"h-3 w-3"}),t," passed"]}),n>0&&l.jsxs("span",{className:"text-red-600 flex items-center gap-1",children:[l.jsx(Is,{className:"h-3 w-3"}),n," failed"]})]}),l.jsx("div",{className:"space-y-2",children:e.map(r=>l.jsx(Die,{evidence:r},r.id))})]})}function Aie(){return l.jsxs("div",{className:"space-y-10 mt-8",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx(un,{className:"h-4 w-24"}),l.jsx(un,{className:"h-4 w-full"}),l.jsx(un,{className:"h-4 w-3/4"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx(un,{className:"h-3 w-12"}),l.jsx(un,{className:"h-4 w-20"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(un,{className:"h-3 w-14"}),l.jsx(un,{className:"h-4 w-24"})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsx(un,{className:"h-3 w-32"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(un,{className:"h-12 w-full rounded-md"}),l.jsx(un,{className:"h-12 w-full rounded-md"})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsx(un,{className:"h-3 w-24"}),l.jsx("div",{className:"space-y-4",children:[1,2,3].map(e=>l.jsxs("div",{className:"border-l-2 border-border/50 pl-4 py-2 space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(un,{className:"h-3.5 w-24"}),l.jsx(un,{className:"h-3 w-20"})]}),l.jsx(un,{className:"h-3 w-3/4"})]},e))})]})]})}const S_={thinking:{icon:tf,label:"Thinking",color:"text-purple-400"},assistant_message:{icon:kr,label:"Assistant"},file_edit:{icon:Fo,label:"Edited",color:"text-blue-400"},file_create:{icon:OW,label:"Created",color:"text-green-400"},file_delete:{icon:LW,label:"Deleted",color:"text-red-400"},command_run:{icon:la,label:"Command",color:"text-amber-400"},tool_call:{icon:BO,label:"Tool",color:"text-cyan-400"},error:{icon:eo,label:"Error",color:"text-red-500"},user_message:{icon:el,label:"User",color:"text-emerald-400"},system_message:{icon:Bs,label:"System",color:"text-slate-400"},loading:{icon:ke,label:"Loading"},todo_list:{icon:AO,label:"Tasks",color:"text-violet-400"}},N_={queued:{icon:EO,color:"text-muted-foreground"},running:{icon:ia,color:"text-blue-500"},succeeded:{icon:aa,color:"text-emerald-500"},failed:{icon:Is,color:"text-red-500"},canceled:{icon:Is,color:"text-amber-500"}};function Oie(e){if(e===null)return"";if(e<60)return`${Math.round(e)}s`;const t=Math.floor(e/60),n=Math.round(e%60);return`${t}m ${n}s`}function Mie({status:e}){const t={succeeded:"bg-emerald-500",failed:"bg-red-500",running:"bg-blue-500 animate-pulse",queued:"bg-slate-400",canceled:"bg-amber-500"};return l.jsx("span",{className:ue("absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full border border-background",t[e]||"bg-slate-400")})}function Pie({content:e}){const t=e.split(/(```[\s\S]*?```)/g);return l.jsx("div",{className:"space-y-3",children:t.map((n,r)=>{if(n.startsWith("```")&&n.endsWith("```")){const a=n.slice(3,-3),o=a.indexOf(`
137
+ `),c=o>0?a.slice(0,o).trim():"",d=o>0?a.slice(o+1):a;return l.jsxs("pre",{className:"bg-muted/50 border rounded-md p-3 overflow-x-auto text-xs font-mono",children:[c&&l.jsx("div",{className:"text-[10px] text-muted-foreground uppercase mb-2 font-sans",children:c}),l.jsx("code",{children:d})]},r)}return l.jsx("div",{className:"space-y-2",children:n.split(`
138
+
139
+ `).map((a,o)=>l.jsx(Lie,{text:a},o))},r)})})}function Lie({text:e}){const t=e.split(`
140
+ `),n=t.every(a=>!a.trim()||a.trim().startsWith("- ")||a.trim().startsWith("* ")||a.trim().startsWith("• ")),r=t.every(a=>!a.trim()||/^\d+\.\s/.test(a.trim()));return n&&t.some(a=>a.trim())?l.jsx("ul",{className:"space-y-1 ml-1",children:t.map((a,o)=>{const c=a.trim();if(!c)return null;const d=c.replace(/^[-*•]\s*/,"");return l.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[l.jsx("span",{className:"text-muted-foreground mt-1.5",children:"•"}),l.jsx("span",{className:"leading-relaxed",children:pv(d)})]},o)})}):r&&t.some(a=>a.trim())?l.jsx("ol",{className:"space-y-1 ml-1",children:t.map((a,o)=>{const c=a.trim();if(!c)return null;const d=c.match(/^(\d+)\.\s*(.*)/);return d?l.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[l.jsxs("span",{className:"text-muted-foreground font-medium min-w-[1.5rem]",children:[d[1],"."]}),l.jsx("span",{className:"leading-relaxed",children:pv(d[2])})]},o):null})}):e.trim().startsWith("## ")?l.jsx("h3",{className:"text-sm font-semibold mt-3 mb-1",children:e.trim().slice(3)}):e.trim().startsWith("# ")?l.jsx("h2",{className:"text-base font-semibold mt-4 mb-2",children:e.trim().slice(2)}):l.jsx("p",{className:"text-sm leading-relaxed",children:t.map((a,o)=>l.jsxs("span",{children:[pv(a),o<t.length-1&&l.jsx("br",{})]},o))})}function pv(e){return e.split(/(`[^`]+`)/g).map((n,r)=>n.startsWith("`")&&n.endsWith("`")?l.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:n.slice(1,-1)},r):n.split(/(\*\*[^*]+\*\*)/g).map((o,c)=>o.startsWith("**")&&o.endsWith("**")?l.jsx("strong",{children:o.slice(2,-2)},`${r}-${c}`):o))}function Iie({todos:e}){return l.jsx("div",{className:"space-y-1.5",children:e.map((t,n)=>l.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[t.completed?l.jsx(qt,{className:"h-4 w-4 text-emerald-500 mt-0.5 shrink-0"}):l.jsx(PO,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),l.jsx("span",{className:ue(t.completed&&"text-muted-foreground line-through"),children:t.content})]},n))})}function Bie({entry:e}){const[t,n]=x.useState(e.entry_type==="assistant_message"||e.entry_type==="todo_list"),r=S_[e.entry_type]||S_.system_message,a=r.icon,o=e.metadata,c=e.entry_type==="thinking",d=e.entry_type==="error",h=e.entry_type==="assistant_message",f=e.entry_type==="todo_list",m=e.content.length>300||o.diff;return h?l.jsx("div",{className:"text-sm",children:l.jsx(Pie,{content:e.content})}):f&&o.todos?l.jsxs("div",{className:"flex items-start gap-3 text-sm",children:[l.jsx("span",{className:"relative shrink-0 mt-0.5",children:l.jsx(AO,{className:ue("h-4 w-4",r.color)})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:["Todos (",o.todos.length,")"]}),l.jsx(Iie,{todos:o.todos})]})]}):l.jsxs("div",{className:ue("flex items-start gap-3 text-sm",c&&"text-muted-foreground",d&&"text-red-500"),children:[l.jsx("span",{className:"relative shrink-0 mt-0.5",children:l.jsx(a,{className:ue("h-4 w-4",r.color)})}),l.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[(o.file_path||o.command||o.tool_name)&&l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.file_path&&l.jsx("code",{className:"text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:o.file_path}),o.tool_name&&l.jsx("span",{className:"text-xs text-muted-foreground",children:o.tool_name}),o.command&&l.jsxs("code",{className:"text-xs bg-muted px-1.5 py-0.5 rounded font-mono truncate max-w-[300px]",children:["$ ",o.command]}),o.exit_code!==void 0&&l.jsxs("span",{className:ue("text-xs",o.exit_code===0?"text-emerald-500":"text-red-500"),children:["exit ",o.exit_code]})]}),l.jsx("div",{className:ue("text-sm",c&&"opacity-70 italic",!t&&m&&"line-clamp-3"),children:l.jsxs("span",{className:"whitespace-pre-wrap break-words font-light leading-relaxed",children:[t?e.content:e.content.slice(0,250),!t&&e.content.length>250&&"..."]})}),m&&l.jsxs("button",{onClick:()=>n(!t),className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",children:[l.jsx($r,{className:ue("h-3 w-3 transition-transform",t&&"rotate-180")}),t?"Show less":"Show more"]}),t&&o.diff&&l.jsx("pre",{className:"mt-2 text-xs bg-muted/50 p-3 rounded overflow-x-auto font-mono border",children:o.diff})]})]})}function zie({jobId:e,jobStatus:t}){const[n,r]=x.useState(new Map),[a,o]=x.useState(""),c=x.useRef(null);x.useEffect(()=>{if(t!=="running"&&t!=="queued")return;const h=JH(e,f=>{f.content&&o(m=>m+f.content),f.normalized&&r(m=>{const p=new Map(m);return p.set(f.normalized.sequence,f.normalized),p}),c.current&&(c.current.scrollTop=c.current.scrollHeight)},f=>{console.warn("Agent log SSE error:",f)});return()=>h.close()},[e,t]);const d=Array.from(n.values()).sort((h,f)=>h.sequence-f.sequence);return d.length===0&&!a?l.jsxs("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:[l.jsx(ke,{className:"h-4 w-4 animate-spin mx-auto mb-2"}),"Waiting for agent output..."]}):l.jsx("div",{ref:c,className:"max-h-[400px] overflow-auto bg-gray-50 p-3",children:d.length>0?d.map(h=>l.jsx(Fie,{entry:h},h.sequence)):l.jsx("pre",{className:"text-xs text-gray-600 whitespace-pre-wrap",children:a})})}function Fie({entry:e}){const[t,n]=x.useState(e.entry_type!=="thinking"),a=(()=>{switch(e.entry_type){case"thinking":return{icon:tf,label:"Thinking"};case"assistant_message":return{icon:el,label:"Response"};case"system_message":return{icon:kr,label:"System"};case"tool_use":return{icon:la,label:"Tool"};case"error_message":return{icon:eo,label:"Error"};default:return{icon:Bs,label:"Info"}}})(),o=a.icon,c=e.entry_type==="thinking",d=e.entry_type==="error_message";return l.jsx("div",{className:ue("py-2 px-3 rounded border-l-2 mb-2",c?"border-l-gray-300 bg-gray-100":"",e.entry_type==="assistant_message"?"border-l-blue-400 bg-white":"",e.entry_type==="tool_use"?"border-l-gray-400 bg-white":"",d?"border-l-red-400 bg-red-50":"",e.entry_type==="system_message"?"border-l-gray-300 bg-gray-100":""),children:l.jsxs("div",{className:ue("flex items-start gap-2",c&&"cursor-pointer"),onClick:()=>c&&n(!t),children:[l.jsx(o,{className:"h-4 w-4 mt-0.5 text-gray-400 shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 mb-1",children:[l.jsx("span",{className:"font-medium",children:a.label}),e.tool_name&&l.jsx("span",{className:"bg-gray-100 text-gray-600 px-1.5 py-0.5 rounded font-mono text-[10px]",children:e.tool_name}),e.tool_status==="completed"&&l.jsx(qt,{className:"h-3 w-3 text-green-500"}),c&&l.jsx("span",{className:"text-gray-400",children:t?"▼":"▶"})]}),(t||!c)&&l.jsx("div",{className:ue("text-sm whitespace-pre-wrap break-words",c?"text-gray-500 italic text-xs":"text-gray-700",d&&"text-red-600"),children:e.content})]})]})})}function $ie({execution:e,defaultExpanded:t=!1,onJobComplete:n}){const[r,a]=x.useState(t),o=N_[e.job_status]||N_.queued,c=o.icon,d=e.job_status==="running"||e.job_status==="queued",h=x.useRef(d);return x.useEffect(()=>{h.current&&!d&&n?.(),h.current=d},[d,n]),l.jsxs("div",{className:"rounded-md border overflow-hidden bg-card",children:[l.jsxs("button",{onClick:()=>a(!r),className:ue("w-full px-4 py-3 flex items-center gap-3 text-left","bg-muted/30 hover:bg-muted/50 transition-colors"),children:[l.jsxs("span",{className:"relative shrink-0",children:[l.jsx(c,{className:ue("h-4 w-4",o.color)}),l.jsx(Mie,{status:e.job_status})]}),l.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-3",children:[l.jsx("span",{className:"text-sm font-medium capitalize",children:e.job_kind}),l.jsx("span",{className:ue("text-xs capitalize",o.color),children:e.job_status})]}),l.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[e.duration_seconds!==null&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(_p,{className:"h-3 w-3"}),Oie(e.duration_seconds)]}),l.jsxs("span",{children:[e.entry_count," entries"]})]}),l.jsx($r,{className:ue("h-4 w-4 shrink-0 text-muted-foreground transition-transform",!r&&"-rotate-90")})]}),r&&l.jsx("div",{className:"border-t bg-background",children:d?l.jsx(zie,{jobId:e.job_id,jobStatus:e.job_status}):e.entries.length>0?l.jsx("div",{className:"px-4 py-4 space-y-4",children:e.entries.map(f=>l.jsx(Bie,{entry:f},f.id))}):l.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No log entries recorded"})})]})}function Vie({ticketId:e,className:t}){const[n,r]=x.useState(null),[a,o]=x.useState(!0),[c,d]=x.useState(null),h=x.useCallback(async()=>{o(!0),d(null);try{const m=await l9(e);r(m)}catch(m){console.error("[AgentActivityLog] Error loading logs:",m),d(m instanceof Error?m.message:"Failed to load agent logs")}finally{o(!1)}},[e]);x.useEffect(()=>{h()},[h]);const f=n?.executions.some(m=>m.job_status==="running"||m.job_status==="queued");return x.useEffect(()=>{if(!f)return;const m=setInterval(()=>{h()},3e3);return()=>clearInterval(m)},[f,h]),a?l.jsxs("div",{className:ue("flex items-center gap-2 py-6 text-muted-foreground",t),children:[l.jsx(ke,{className:"h-4 w-4 animate-spin"}),l.jsx("span",{className:"text-sm",children:"Loading agent activity..."})]}):c?l.jsxs("div",{className:ue("text-center py-6",t),children:[l.jsx(eo,{className:"h-5 w-5 text-red-500 mx-auto mb-2"}),l.jsx("p",{className:"text-sm text-red-500 mb-3",children:c}),l.jsxs(ye,{variant:"outline",size:"sm",onClick:h,children:[l.jsx(pa,{className:"h-3 w-3 mr-1.5"}),"Retry"]})]}):!n||n.total_jobs===0?l.jsxs("div",{className:ue("text-center py-6",t),children:[l.jsx(tf,{className:"h-5 w-5 mx-auto mb-2 text-muted-foreground/50"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No agent activity yet"}),l.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Logs will appear here after execution"})]}):l.jsxs("div",{className:ue("space-y-4",t),children:[l.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{children:[n.total_jobs," execution",n.total_jobs!==1?"s":""]}),l.jsx("span",{className:"text-border",children:"·"}),l.jsxs("span",{children:[n.total_entries," entries"]})]}),l.jsx(ye,{variant:"ghost",size:"sm",onClick:h,className:"h-6 w-6 p-0",children:l.jsx(pa,{className:"h-3 w-3"})})]}),l.jsx("div",{className:"space-y-3",children:n.executions.map((m,p)=>l.jsx($ie,{execution:m,defaultExpanded:p===0,onJobComplete:h},m.job_id))})]})}var _s={},gv={exports:{}};var j_;function Uie(){return j_||(j_=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",c=0;c<arguments.length;c++){var d=arguments[c];d&&(o=a(o,r(d)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var c="";for(var d in o)t.call(o,d)&&o[d]&&(c=a(c,d));return c}function a(o,c){return c?o?o+" "+c:o+c:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(gv)),gv.exports}var Xn={},xv={},yv={},C_;function no(){return C_||(C_=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(){}t.prototype={diff:function(a,o){var c,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},h=d.callback;typeof d=="function"&&(h=d,d={}),this.options=d;var f=this;function m(T){return h?(setTimeout(function(){h(void 0,T)},0),!0):T}a=this.castInput(a),o=this.castInput(o),a=this.removeEmpty(this.tokenize(a)),o=this.removeEmpty(this.tokenize(o));var p=o.length,y=a.length,v=1,S=p+y;d.maxEditLength&&(S=Math.min(S,d.maxEditLength));var N=(c=d.timeout)!==null&&c!==void 0?c:1/0,C=Date.now()+N,j=[{oldPos:-1,lastComponent:void 0}],E=this.extractCommon(j[0],o,a,0);if(j[0].oldPos+1>=y&&E+1>=p)return m([{value:this.join(o),count:o.length}]);var R=-1/0,A=1/0;function _(){for(var T=Math.max(R,-v);T<=Math.min(A,v);T+=2){var D=void 0,B=j[T-1],W=j[T+1];B&&(j[T-1]=void 0);var M=!1;if(W){var V=W.oldPos-T;M=W&&0<=V&&V<p}var G=B&&B.oldPos+1<y;if(!M&&!G){j[T]=void 0;continue}if(!G||M&&B.oldPos+1<W.oldPos?D=f.addToPath(W,!0,void 0,0):D=f.addToPath(B,void 0,!0,1),E=f.extractCommon(D,o,a,T),D.oldPos+1>=y&&E+1>=p)return m(n(f,D.lastComponent,o,a,f.useLongestToken));j[T]=D,D.oldPos+1>=y&&(A=Math.min(A,T-1)),E+1>=p&&(R=Math.max(R,T+1))}v++}if(h)(function T(){setTimeout(function(){if(v>S||Date.now()>C)return h();_()||T()},0)})();else for(;v<=S&&Date.now()<=C;){var O=_();if(O)return O}},addToPath:function(a,o,c,d){var h=a.lastComponent;return h&&h.added===o&&h.removed===c?{oldPos:a.oldPos+d,lastComponent:{count:h.count+1,added:o,removed:c,previousComponent:h.previousComponent}}:{oldPos:a.oldPos+d,lastComponent:{count:1,added:o,removed:c,previousComponent:h}}},extractCommon:function(a,o,c,d){for(var h=o.length,f=c.length,m=a.oldPos,p=m-d,y=0;p+1<h&&m+1<f&&this.equals(o[p+1],c[m+1]);)p++,m++,y++;return y&&(a.lastComponent={count:y,previousComponent:a.lastComponent}),a.oldPos=m,p},equals:function(a,o){return this.options.comparator?this.options.comparator(a,o):a===o||this.options.ignoreCase&&a.toLowerCase()===o.toLowerCase()},removeEmpty:function(a){for(var o=[],c=0;c<a.length;c++)a[c]&&o.push(a[c]);return o},castInput:function(a){return a},tokenize:function(a){return a.split("")},join:function(a){return a.join("")}};function n(r,a,o,c,d){for(var h=[],f;a;)h.push(a),f=a.previousComponent,delete a.previousComponent,a=f;h.reverse();for(var m=0,p=h.length,y=0,v=0;m<p;m++){var S=h[m];if(S.removed){if(S.value=r.join(c.slice(v,v+S.count)),v+=S.count,m&&h[m-1].added){var C=h[m-1];h[m-1]=h[m],h[m]=C}}else{if(!S.added&&d){var N=o.slice(y,y+S.count);N=N.map(function(E,R){var A=c[v+R];return A.length>E.length?A:E}),S.value=r.join(N)}else S.value=r.join(o.slice(y,y+S.count));y+=S.count,S.added||(v+=S.count)}}var j=h[p-1];return p>1&&typeof j.value=="string"&&(j.added||j.removed)&&r.equals("",j.value)&&(h[p-2].value+=j.value,h.pop()),h}})(yv)),yv}var $l={},E_;function Hie(){if(E_)return $l;E_=1,Object.defineProperty($l,"__esModule",{value:!0}),$l.diffChars=r,$l.characterDiff=void 0;var e=t(no());function t(a){return a&&a.__esModule?a:{default:a}}var n=new e.default;$l.characterDiff=n;function r(a,o,c){return n.diff(a,o,c)}return $l}var Eo={},qh={},T_;function r3(){if(T_)return qh;T_=1,Object.defineProperty(qh,"__esModule",{value:!0}),qh.generateOptions=e;function e(t,n){if(typeof t=="function")n.callback=t;else if(t)for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}return qh}var __;function Gie(){if(__)return Eo;__=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.diffWords=c,Eo.diffWordsWithSpace=d,Eo.wordDiff=void 0;var e=n(no()),t=r3();function n(h){return h&&h.__esModule?h:{default:h}}var r=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,a=/\S/,o=new e.default;Eo.wordDiff=o,o.equals=function(h,f){return this.options.ignoreCase&&(h=h.toLowerCase(),f=f.toLowerCase()),h===f||this.options.ignoreWhitespace&&!a.test(h)&&!a.test(f)},o.tokenize=function(h){for(var f=h.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),m=0;m<f.length-1;m++)!f[m+1]&&f[m+2]&&r.test(f[m])&&r.test(f[m+2])&&(f[m]+=f[m+2],f.splice(m+1,2),m--);return f};function c(h,f,m){return m=(0,t.generateOptions)(m,{ignoreWhitespace:!0}),o.diff(h,f,m)}function d(h,f,m){return o.diff(h,f,m)}return Eo}var To={},R_;function w1(){if(R_)return To;R_=1,Object.defineProperty(To,"__esModule",{value:!0}),To.diffLines=a,To.diffTrimmedLines=o,To.lineDiff=void 0;var e=n(no()),t=r3();function n(c){return c&&c.__esModule?c:{default:c}}var r=new e.default;To.lineDiff=r,r.tokenize=function(c){this.options.stripTrailingCr&&(c=c.replace(/\r\n/g,`
141
+ `));var d=[],h=c.split(/(\n|\r\n)/);h[h.length-1]||h.pop();for(var f=0;f<h.length;f++){var m=h[f];f%2&&!this.options.newlineIsToken?d[d.length-1]+=m:(this.options.ignoreWhitespace&&(m=m.trim()),d.push(m))}return d};function a(c,d,h){return r.diff(c,d,h)}function o(c,d,h){var f=(0,t.generateOptions)(h,{ignoreWhitespace:!0});return r.diff(c,d,f)}return To}var Vl={},D_;function qie(){if(D_)return Vl;D_=1,Object.defineProperty(Vl,"__esModule",{value:!0}),Vl.diffSentences=r,Vl.sentenceDiff=void 0;var e=t(no());function t(a){return a&&a.__esModule?a:{default:a}}var n=new e.default;Vl.sentenceDiff=n,n.tokenize=function(a){return a.split(/(\S.+?[.!?])(?=\s+|$)/)};function r(a,o,c){return n.diff(a,o,c)}return Vl}var Ul={},k_;function Wie(){if(k_)return Ul;k_=1,Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.diffCss=r,Ul.cssDiff=void 0;var e=t(no());function t(a){return a&&a.__esModule?a:{default:a}}var n=new e.default;Ul.cssDiff=n,n.tokenize=function(a){return a.split(/([{}:;,]|\s+)/)};function r(a,o,c){return n.diff(a,o,c)}return Ul}var _o={},A_;function Kie(){if(A_)return _o;A_=1,Object.defineProperty(_o,"__esModule",{value:!0}),_o.diffJson=c,_o.canonicalize=d,_o.jsonDiff=void 0;var e=n(no()),t=w1();function n(h){return h&&h.__esModule?h:{default:h}}function r(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?r=function(m){return typeof m}:r=function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},r(h)}var a=Object.prototype.toString,o=new e.default;_o.jsonDiff=o,o.useLongestToken=!0,o.tokenize=t.lineDiff.tokenize,o.castInput=function(h){var f=this.options,m=f.undefinedReplacement,p=f.stringifyReplacer,y=p===void 0?function(v,S){return typeof S>"u"?m:S}:p;return typeof h=="string"?h:JSON.stringify(d(h,null,null,y),y," ")},o.equals=function(h,f){return e.default.prototype.equals.call(o,h.replace(/,([\r\n])/g,"$1"),f.replace(/,([\r\n])/g,"$1"))};function c(h,f,m){return o.diff(h,f,m)}function d(h,f,m,p,y){f=f||[],m=m||[],p&&(h=p(y,h));var v;for(v=0;v<f.length;v+=1)if(f[v]===h)return m[v];var S;if(a.call(h)==="[object Array]"){for(f.push(h),S=new Array(h.length),m.push(S),v=0;v<h.length;v+=1)S[v]=d(h[v],f,m,p,y);return f.pop(),m.pop(),S}if(h&&h.toJSON&&(h=h.toJSON()),r(h)==="object"&&h!==null){f.push(h),S={},m.push(S);var N=[],C;for(C in h)h.hasOwnProperty(C)&&N.push(C);for(N.sort(),v=0;v<N.length;v+=1)C=N[v],S[C]=d(h[C],f,m,p,C);f.pop(),m.pop()}else S=h;return S}return _o}var Hl={},O_;function Yie(){if(O_)return Hl;O_=1,Object.defineProperty(Hl,"__esModule",{value:!0}),Hl.diffArrays=r,Hl.arrayDiff=void 0;var e=t(no());function t(a){return a&&a.__esModule?a:{default:a}}var n=new e.default;Hl.arrayDiff=n,n.tokenize=function(a){return a.slice()},n.join=n.removeEmpty=function(a){return a};function r(a,o,c){return n.diff(a,o,c)}return Hl}var $u={},Wh={},M_;function S1(){if(M_)return Wh;M_=1,Object.defineProperty(Wh,"__esModule",{value:!0}),Wh.parsePatch=e;function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.split(/\r\n|[\n\v\f\r\x85]/),a=t.match(/\r\n|[\n\v\f\r\x85]/g)||[],o=[],c=0;function d(){var m={};for(o.push(m);c<r.length;){var p=r[c];if(/^(\-\-\-|\+\+\+|@@)\s/.test(p))break;var y=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(p);y&&(m.index=y[1]),c++}for(h(m),h(m),m.hunks=[];c<r.length;){var v=r[c];if(/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(v))break;if(/^@@/.test(v))m.hunks.push(f());else{if(v&&n.strict)throw new Error("Unknown line "+(c+1)+" "+JSON.stringify(v));c++}}}function h(m){var p=/^(---|\+\+\+)\s+(.*)$/.exec(r[c]);if(p){var y=p[1]==="---"?"old":"new",v=p[2].split(" ",2),S=v[0].replace(/\\\\/g,"\\");/^".*"$/.test(S)&&(S=S.substr(1,S.length-2)),m[y+"FileName"]=S,m[y+"Header"]=(v[1]||"").trim(),c++}}function f(){var m=c,p=r[c++],y=p.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),v={oldStart:+y[1],oldLines:typeof y[2]>"u"?1:+y[2],newStart:+y[3],newLines:typeof y[4]>"u"?1:+y[4],lines:[],linedelimiters:[]};v.oldLines===0&&(v.oldStart+=1),v.newLines===0&&(v.newStart+=1);for(var S=0,N=0;c<r.length&&!(r[c].indexOf("--- ")===0&&c+2<r.length&&r[c+1].indexOf("+++ ")===0&&r[c+2].indexOf("@@")===0);c++){var C=r[c].length==0&&c!=r.length-1?" ":r[c][0];if(C==="+"||C==="-"||C===" "||C==="\\")v.lines.push(r[c]),v.linedelimiters.push(a[c]||`
142
+ `),C==="+"?S++:C==="-"?N++:C===" "&&(S++,N++);else break}if(!S&&v.newLines===1&&(v.newLines=0),!N&&v.oldLines===1&&(v.oldLines=0),n.strict){if(S!==v.newLines)throw new Error("Added line count did not match for hunk at line "+(m+1));if(N!==v.oldLines)throw new Error("Removed line count did not match for hunk at line "+(m+1))}return v}for(;c<r.length;)d();return o}return Wh}var vv={},P_;function Xie(){return P_||(P_=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(n,r,a){var o=!0,c=!1,d=!1,h=1;return function f(){if(o&&!d){if(c?h++:o=!1,n+h<=a)return h;d=!0}if(!c)return d||(o=!0),r<=n-h?-h++:(c=!0,f())}}})(vv)),vv}var L_;function Qie(){if(L_)return $u;L_=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.applyPatch=r,$u.applyPatches=a;var e=S1(),t=n(Xie());function n(o){return o&&o.__esModule?o:{default:o}}function r(o,c){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof c=="string"&&(c=(0,e.parsePatch)(c)),Array.isArray(c)){if(c.length>1)throw new Error("applyPatch only works with a single input.");c=c[0]}var h=o.split(/\r\n|[\n\v\f\r\x85]/),f=o.match(/\r\n|[\n\v\f\r\x85]/g)||[],m=c.hunks,p=d.compareLine||function(oe,L,$,X){return L===X},y=0,v=d.fuzzFactor||0,S=0,N=0,C,j;function E(oe,L){for(var $=0;$<oe.lines.length;$++){var X=oe.lines[$],Q=X.length>0?X[0]:" ",q=X.length>0?X.substr(1):X;if(Q===" "||Q==="-"){if(!p(L+1,h[L],Q,q)&&(y++,y>v))return!1;L++}}return!0}for(var R=0;R<m.length;R++){for(var A=m[R],_=h.length-A.oldLines,O=0,T=N+A.oldStart-1,D=(0,t.default)(T,S,_);O!==void 0;O=D())if(E(A,T+O)){A.offset=N+=O;break}if(O===void 0)return!1;S=A.offset+A.oldStart+A.oldLines}for(var B=0,W=0;W<m.length;W++){var M=m[W],V=M.oldStart+M.offset+B-1;B+=M.newLines-M.oldLines;for(var G=0;G<M.lines.length;G++){var F=M.lines[G],H=F.length>0?F[0]:" ",P=F.length>0?F.substr(1):F,U=M.linedelimiters&&M.linedelimiters[G]||`
143
+ `;if(H===" ")V++;else if(H==="-")h.splice(V,1),f.splice(V,1);else if(H==="+")h.splice(V,0,P),f.splice(V,0,U),V++;else if(H==="\\"){var z=M.lines[G-1]?M.lines[G-1][0]:null;z==="+"?C=!0:z==="-"&&(j=!0)}}}if(C)for(;!h[h.length-1];)h.pop(),f.pop();else j&&(h.push(""),f.push(`
144
+ `));for(var te=0;te<h.length-1;te++)h[te]=h[te]+f[te];return h.join("")}function a(o,c){typeof o=="string"&&(o=(0,e.parsePatch)(o));var d=0;function h(){var f=o[d++];if(!f)return c.complete();c.loadFile(f,function(m,p){if(m)return c.complete(m);var y=r(p,f,c);c.patched(f,y,function(v){if(v)return c.complete(v);h()})})}h()}return $u}var Vu={},Ro={},I_;function s3(){if(I_)return Ro;I_=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.structuredPatch=d,Ro.formatPatch=h,Ro.createTwoFilesPatch=f,Ro.createPatch=m;var e=w1();function t(p){return o(p)||a(p)||r(p)||n()}function n(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
145
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(p,y){if(p){if(typeof p=="string")return c(p,y);var v=Object.prototype.toString.call(p).slice(8,-1);if(v==="Object"&&p.constructor&&(v=p.constructor.name),v==="Map"||v==="Set")return Array.from(p);if(v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v))return c(p,y)}}function a(p){if(typeof Symbol<"u"&&Symbol.iterator in Object(p))return Array.from(p)}function o(p){if(Array.isArray(p))return c(p)}function c(p,y){(y==null||y>p.length)&&(y=p.length);for(var v=0,S=new Array(y);v<y;v++)S[v]=p[v];return S}function d(p,y,v,S,N,C,j){j||(j={}),typeof j.context>"u"&&(j.context=4);var E=(0,e.diffLines)(v,S,j);if(!E)return;E.push({value:"",lines:[]});function R(V){return V.map(function(G){return" "+G})}for(var A=[],_=0,O=0,T=[],D=1,B=1,W=function(G){var F=E[G],H=F.lines||F.value.replace(/\n$/,"").split(`
146
+ `);if(F.lines=H,F.added||F.removed){var P;if(!_){var U=E[G-1];_=D,O=B,U&&(T=j.context>0?R(U.lines.slice(-j.context)):[],_-=T.length,O-=T.length)}(P=T).push.apply(P,t(H.map(function(q){return(F.added?"+":"-")+q}))),F.added?B+=H.length:D+=H.length}else{if(_)if(H.length<=j.context*2&&G<E.length-2){var z;(z=T).push.apply(z,t(R(H)))}else{var te,oe=Math.min(H.length,j.context);(te=T).push.apply(te,t(R(H.slice(0,oe))));var L={oldStart:_,oldLines:D-_+oe,newStart:O,newLines:B-O+oe,lines:T};if(G>=E.length-2&&H.length<=j.context){var $=/\n$/.test(v),X=/\n$/.test(S),Q=H.length==0&&T.length>L.oldLines;!$&&Q&&v.length>0&&T.splice(L.oldLines,0,"\"),(!$&&!Q||!X)&&T.push("\")}A.push(L),_=0,O=0,T=[]}D+=H.length,B+=H.length}},M=0;M<E.length;M++)W(M);return{oldFileName:p,newFileName:y,oldHeader:N,newHeader:C,hunks:A}}function h(p){if(Array.isArray(p))return p.map(h).join(`
147
+ `);var y=[];p.oldFileName==p.newFileName&&y.push("Index: "+p.oldFileName),y.push("==================================================================="),y.push("--- "+p.oldFileName+(typeof p.oldHeader>"u"?"":" "+p.oldHeader)),y.push("+++ "+p.newFileName+(typeof p.newHeader>"u"?"":" "+p.newHeader));for(var v=0;v<p.hunks.length;v++){var S=p.hunks[v];S.oldLines===0&&(S.oldStart-=1),S.newLines===0&&(S.newStart-=1),y.push("@@ -"+S.oldStart+","+S.oldLines+" +"+S.newStart+","+S.newLines+" @@"),y.push.apply(y,S.lines)}return y.join(`
148
+ `)+`
149
+ `}function f(p,y,v,S,N,C,j){return h(d(p,y,v,S,N,C,j))}function m(p,y,v,S,N,C){return f(p,p,y,v,S,N,C)}return Ro}var Uu={},B_;function Jie(){if(B_)return Uu;B_=1,Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.arrayEqual=e,Uu.arrayStartsWith=t;function e(n,r){return n.length!==r.length?!1:t(n,r)}function t(n,r){if(r.length>n.length)return!1;for(var a=0;a<r.length;a++)if(r[a]!==n[a])return!1;return!0}return Uu}var z_;function Zie(){if(z_)return Vu;z_=1,Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.calcLineCount=f,Vu.merge=m;var e=s3(),t=S1(),n=Jie();function r(M){return d(M)||c(M)||o(M)||a()}function a(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
150
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(M,V){if(M){if(typeof M=="string")return h(M,V);var G=Object.prototype.toString.call(M).slice(8,-1);if(G==="Object"&&M.constructor&&(G=M.constructor.name),G==="Map"||G==="Set")return Array.from(M);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return h(M,V)}}function c(M){if(typeof Symbol<"u"&&Symbol.iterator in Object(M))return Array.from(M)}function d(M){if(Array.isArray(M))return h(M)}function h(M,V){(V==null||V>M.length)&&(V=M.length);for(var G=0,F=new Array(V);G<V;G++)F[G]=M[G];return F}function f(M){var V=W(M.lines),G=V.oldLines,F=V.newLines;G!==void 0?M.oldLines=G:delete M.oldLines,F!==void 0?M.newLines=F:delete M.newLines}function m(M,V,G){M=p(M,G),V=p(V,G);var F={};(M.index||V.index)&&(F.index=M.index||V.index),(M.newFileName||V.newFileName)&&(y(M)?y(V)?(F.oldFileName=v(F,M.oldFileName,V.oldFileName),F.newFileName=v(F,M.newFileName,V.newFileName),F.oldHeader=v(F,M.oldHeader,V.oldHeader),F.newHeader=v(F,M.newHeader,V.newHeader)):(F.oldFileName=M.oldFileName,F.newFileName=M.newFileName,F.oldHeader=M.oldHeader,F.newHeader=M.newHeader):(F.oldFileName=V.oldFileName||M.oldFileName,F.newFileName=V.newFileName||M.newFileName,F.oldHeader=V.oldHeader||M.oldHeader,F.newHeader=V.newHeader||M.newHeader)),F.hunks=[];for(var H=0,P=0,U=0,z=0;H<M.hunks.length||P<V.hunks.length;){var te=M.hunks[H]||{oldStart:1/0},oe=V.hunks[P]||{oldStart:1/0};if(S(te,oe))F.hunks.push(N(te,U)),H++,z+=te.newLines-te.oldLines;else if(S(oe,te))F.hunks.push(N(oe,z)),P++,U+=oe.newLines-oe.oldLines;else{var L={oldStart:Math.min(te.oldStart,oe.oldStart),oldLines:0,newStart:Math.min(te.newStart+U,oe.oldStart+z),newLines:0,lines:[]};C(L,te.oldStart,te.lines,oe.oldStart,oe.lines),P++,H++,F.hunks.push(L)}}return F}function p(M,V){if(typeof M=="string"){if(/^@@/m.test(M)||/^Index:/m.test(M))return(0,t.parsePatch)(M)[0];if(!V)throw new Error("Must provide a base reference or pass in a patch");return(0,e.structuredPatch)(void 0,void 0,V,M)}return M}function y(M){return M.newFileName&&M.newFileName!==M.oldFileName}function v(M,V,G){return V===G?V:(M.conflict=!0,{mine:V,theirs:G})}function S(M,V){return M.oldStart<V.oldStart&&M.oldStart+M.oldLines<V.oldStart}function N(M,V){return{oldStart:M.oldStart,oldLines:M.oldLines,newStart:M.newStart+V,newLines:M.newLines,lines:M.lines}}function C(M,V,G,F,H){var P={offset:V,lines:G,index:0},U={offset:F,lines:H,index:0};for(A(M,P,U),A(M,U,P);P.index<P.lines.length&&U.index<U.lines.length;){var z=P.lines[P.index],te=U.lines[U.index];if((z[0]==="-"||z[0]==="+")&&(te[0]==="-"||te[0]==="+"))j(M,P,U);else if(z[0]==="+"&&te[0]===" "){var oe;(oe=M.lines).push.apply(oe,r(O(P)))}else if(te[0]==="+"&&z[0]===" "){var L;(L=M.lines).push.apply(L,r(O(U)))}else z[0]==="-"&&te[0]===" "?E(M,P,U):te[0]==="-"&&z[0]===" "?E(M,U,P,!0):z===te?(M.lines.push(z),P.index++,U.index++):R(M,O(P),O(U))}_(M,P),_(M,U),f(M)}function j(M,V,G){var F=O(V),H=O(G);if(D(F)&&D(H)){if((0,n.arrayStartsWith)(F,H)&&B(G,F,F.length-H.length)){var P;(P=M.lines).push.apply(P,r(F));return}else if((0,n.arrayStartsWith)(H,F)&&B(V,H,H.length-F.length)){var U;(U=M.lines).push.apply(U,r(H));return}}else if((0,n.arrayEqual)(F,H)){var z;(z=M.lines).push.apply(z,r(F));return}R(M,F,H)}function E(M,V,G,F){var H=O(V),P=T(G,H);if(P.merged){var U;(U=M.lines).push.apply(U,r(P.merged))}else R(M,F?P:H,F?H:P)}function R(M,V,G){M.conflict=!0,M.lines.push({conflict:!0,mine:V,theirs:G})}function A(M,V,G){for(;V.offset<G.offset&&V.index<V.lines.length;){var F=V.lines[V.index++];M.lines.push(F),V.offset++}}function _(M,V){for(;V.index<V.lines.length;){var G=V.lines[V.index++];M.lines.push(G)}}function O(M){for(var V=[],G=M.lines[M.index][0];M.index<M.lines.length;){var F=M.lines[M.index];if(G==="-"&&F[0]==="+"&&(G="+"),G===F[0])V.push(F),M.index++;else break}return V}function T(M,V){for(var G=[],F=[],H=0,P=!1,U=!1;H<V.length&&M.index<M.lines.length;){var z=M.lines[M.index],te=V[H];if(te[0]==="+")break;if(P=P||z[0]!==" ",F.push(te),H++,z[0]==="+")for(U=!0;z[0]==="+";)G.push(z),z=M.lines[++M.index];te.substr(1)===z.substr(1)?(G.push(z),M.index++):U=!0}if((V[H]||"")[0]==="+"&&P&&(U=!0),U)return G;for(;H<V.length;)F.push(V[H++]);return{merged:F,changes:G}}function D(M){return M.reduce(function(V,G){return V&&G[0]==="-"},!0)}function B(M,V,G){for(var F=0;F<G;F++){var H=V[V.length-G+F].substr(1);if(M.lines[M.index+F]!==" "+H)return!1}return M.index+=G,!0}function W(M){var V=0,G=0;return M.forEach(function(F){if(typeof F!="string"){var H=W(F.mine),P=W(F.theirs);V!==void 0&&(H.oldLines===P.oldLines?V+=H.oldLines:V=void 0),G!==void 0&&(H.newLines===P.newLines?G+=H.newLines:G=void 0)}else G!==void 0&&(F[0]==="+"||F[0]===" ")&&G++,V!==void 0&&(F[0]==="-"||F[0]===" ")&&V++}),{oldLines:V,newLines:G}}return Vu}var Kh={},F_;function eoe(){if(F_)return Kh;F_=1,Object.defineProperty(Kh,"__esModule",{value:!0}),Kh.reversePatch=r;function e(a,o){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);o&&(d=d.filter(function(h){return Object.getOwnPropertyDescriptor(a,h).enumerable})),c.push.apply(c,d)}return c}function t(a){for(var o=1;o<arguments.length;o++){var c=arguments[o]!=null?arguments[o]:{};o%2?e(Object(c),!0).forEach(function(d){n(a,d,c[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):e(Object(c)).forEach(function(d){Object.defineProperty(a,d,Object.getOwnPropertyDescriptor(c,d))})}return a}function n(a,o,c){return o in a?Object.defineProperty(a,o,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[o]=c,a}function r(a){return Array.isArray(a)?a.map(r).reverse():t(t({},a),{},{oldFileName:a.newFileName,oldHeader:a.newHeader,newFileName:a.oldFileName,newHeader:a.oldHeader,hunks:a.hunks.map(function(o){return{oldLines:o.newLines,oldStart:o.newStart,newLines:o.oldLines,newStart:o.oldStart,linedelimiters:o.linedelimiters,lines:o.lines.map(function(c){return c.startsWith("-")?"+".concat(c.slice(1)):c.startsWith("+")?"-".concat(c.slice(1)):c})}})})}return Kh}var Yh={},$_;function toe(){if($_)return Yh;$_=1,Object.defineProperty(Yh,"__esModule",{value:!0}),Yh.convertChangesToDMP=e;function e(t){for(var n=[],r,a,o=0;o<t.length;o++)r=t[o],r.added?a=1:r.removed?a=-1:a=0,n.push([a,r.value]);return n}return Yh}var Xh={},V_;function noe(){if(V_)return Xh;V_=1,Object.defineProperty(Xh,"__esModule",{value:!0}),Xh.convertChangesToXML=e;function e(n){for(var r=[],a=0;a<n.length;a++){var o=n[a];o.added?r.push("<ins>"):o.removed&&r.push("<del>"),r.push(t(o.value)),o.added?r.push("</ins>"):o.removed&&r.push("</del>")}return r.join("")}function t(n){var r=n;return r=r.replace(/&/g,"&amp;"),r=r.replace(/</g,"&lt;"),r=r.replace(/>/g,"&gt;"),r=r.replace(/"/g,"&quot;"),r}return Xh}var U_;function roe(){return U_||(U_=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Diff",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"diffChars",{enumerable:!0,get:function(){return n.diffChars}}),Object.defineProperty(e,"diffWords",{enumerable:!0,get:function(){return r.diffWords}}),Object.defineProperty(e,"diffWordsWithSpace",{enumerable:!0,get:function(){return r.diffWordsWithSpace}}),Object.defineProperty(e,"diffLines",{enumerable:!0,get:function(){return a.diffLines}}),Object.defineProperty(e,"diffTrimmedLines",{enumerable:!0,get:function(){return a.diffTrimmedLines}}),Object.defineProperty(e,"diffSentences",{enumerable:!0,get:function(){return o.diffSentences}}),Object.defineProperty(e,"diffCss",{enumerable:!0,get:function(){return c.diffCss}}),Object.defineProperty(e,"diffJson",{enumerable:!0,get:function(){return d.diffJson}}),Object.defineProperty(e,"canonicalize",{enumerable:!0,get:function(){return d.canonicalize}}),Object.defineProperty(e,"diffArrays",{enumerable:!0,get:function(){return h.diffArrays}}),Object.defineProperty(e,"applyPatch",{enumerable:!0,get:function(){return f.applyPatch}}),Object.defineProperty(e,"applyPatches",{enumerable:!0,get:function(){return f.applyPatches}}),Object.defineProperty(e,"parsePatch",{enumerable:!0,get:function(){return m.parsePatch}}),Object.defineProperty(e,"merge",{enumerable:!0,get:function(){return p.merge}}),Object.defineProperty(e,"reversePatch",{enumerable:!0,get:function(){return y.reversePatch}}),Object.defineProperty(e,"structuredPatch",{enumerable:!0,get:function(){return v.structuredPatch}}),Object.defineProperty(e,"createTwoFilesPatch",{enumerable:!0,get:function(){return v.createTwoFilesPatch}}),Object.defineProperty(e,"createPatch",{enumerable:!0,get:function(){return v.createPatch}}),Object.defineProperty(e,"formatPatch",{enumerable:!0,get:function(){return v.formatPatch}}),Object.defineProperty(e,"convertChangesToDMP",{enumerable:!0,get:function(){return S.convertChangesToDMP}}),Object.defineProperty(e,"convertChangesToXML",{enumerable:!0,get:function(){return N.convertChangesToXML}});var t=C(no()),n=Hie(),r=Gie(),a=w1(),o=qie(),c=Wie(),d=Kie(),h=Yie(),f=Qie(),m=S1(),p=Zie(),y=eoe(),v=s3(),S=toe(),N=noe();function C(j){return j&&j.__esModule?j:{default:j}}})(xv)),xv}var H_;function soe(){if(H_)return Xn;H_=1;var e=Xn&&Xn.__createBinding||(Object.create?(function(m,p,y,v){v===void 0&&(v=y);var S=Object.getOwnPropertyDescriptor(p,y);(!S||("get"in S?!p.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return p[y]}}),Object.defineProperty(m,v,S)}):(function(m,p,y,v){v===void 0&&(v=y),m[v]=p[y]})),t=Xn&&Xn.__setModuleDefault||(Object.create?(function(m,p){Object.defineProperty(m,"default",{enumerable:!0,value:p})}):function(m,p){m.default=p}),n=Xn&&Xn.__importStar||function(m){if(m&&m.__esModule)return m;var p={};if(m!=null)for(var y in m)y!=="default"&&Object.prototype.hasOwnProperty.call(m,y)&&e(p,m,y);return t(p,m),p};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.computeLineInformation=Xn.DiffMethod=Xn.DiffType=void 0;const r=n(roe()),a=r;var o;(function(m){m[m.DEFAULT=0]="DEFAULT",m[m.ADDED=1]="ADDED",m[m.REMOVED=2]="REMOVED",m[m.CHANGED=3]="CHANGED"})(o||(Xn.DiffType=o={}));var c;(function(m){m.CHARS="diffChars",m.WORDS="diffWords",m.WORDS_WITH_SPACE="diffWordsWithSpace",m.LINES="diffLines",m.TRIMMED_LINES="diffTrimmedLines",m.SENTENCES="diffSentences",m.CSS="diffCss",m.JSON="diffJson"})(c||(Xn.DiffMethod=c={}));const d=m=>m===""?[]:m.replace(/\n$/,"").split(`
151
+ `),h=(m,p,y=c.CHARS)=>{const v=a[y](m,p),S={left:[],right:[]};return v.forEach(({added:N,removed:C,value:j})=>{const E={};return N&&(E.type=o.ADDED,E.value=j,S.right.push(E)),C&&(E.type=o.REMOVED,E.value=j,S.left.push(E)),!C&&!N&&(E.type=o.DEFAULT,E.value=j,S.right.push(E),S.left.push(E)),E}),S},f=(m,p,y=!1,v=c.CHARS,S=0,N=[])=>{let C=[];typeof m=="string"&&typeof p=="string"?C=r.diffLines(m.trimRight(),p.trimRight(),{newlineIsToken:!1,ignoreWhitespace:!1,ignoreCase:!1}):C=r.diffJson(m,p);let j=S,E=S,R=[],A=0;const _=[],O=[],T=(D,B,W,M,V)=>d(D).map((F,H)=>{const P={},U={};if(!(O.includes(`${B}-${H}`)||V&&H!==0)){if(W||M){let z=!0;if(M){E+=1,P.lineNumber=E,P.type=o.REMOVED,P.value=F||" ";const te=C[B+1];if(te&&te.added){const oe=d(te.value)[H];if(oe){const L=T(oe,B,!0,!1,!0),{value:$,lineNumber:X,type:Q}=L[0].right;if(O.push(`${B+1}-${H}`),U.lineNumber=X,P.value===$)z=!1,U.type=0,P.type=0,U.value=$;else if(U.type=Q,y)U.value=$;else{const q=h(F,$,v);U.value=q.right,P.value=q.left}}}}else j+=1,U.lineNumber=j,U.type=o.ADDED,U.value=F;z&&!V&&(_.includes(A)||_.push(A))}else E+=1,j+=1,P.lineNumber=E,P.type=o.DEFAULT,P.value=F,U.lineNumber=j,U.type=o.DEFAULT,U.value=F;return(N?.includes(`L-${P.lineNumber}`)||N?.includes(`R-${U.lineNumber}`)&&!_.includes(A))&&_.push(A),V||(A+=1),{right:U,left:P}}}).filter(Boolean);return C.forEach(({added:D,removed:B,value:W},M)=>{R=[...R,...T(W,M,D,B)]}),{lineInformation:R,diffLines:_}};return Xn.computeLineInformation=f,Xn}var bi={};function aoe(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function ioe(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var ooe=(function(){function e(n){var r=this;this._insertTag=function(a){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(a,o),r.tags.push(a)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(ioe(this));var a=this.tags[this.tags.length-1];if(this.isSpeedy){var o=aoe(a);try{o.insertRule(r,o.cssRules.length)}catch{}}else a.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var a;return(a=r.parentNode)==null?void 0:a.removeChild(r)}),this.tags=[],this.ctr=0},e})(),Fn="-ms-",Xm="-moz-",wt="-webkit-",a3="comm",N1="rule",j1="decl",loe="@import",i3="@keyframes",coe="@layer",uoe=Math.abs,Wp=String.fromCharCode,doe=Object.assign;function foe(e,t){return Mn(e,0)^45?(((t<<2^Mn(e,0))<<2^Mn(e,1))<<2^Mn(e,2))<<2^Mn(e,3):0}function o3(e){return e.trim()}function hoe(e,t){return(e=t.exec(e))?e[0]:e}function St(e,t,n){return e.replace(t,n)}function J0(e,t){return e.indexOf(t)}function Mn(e,t){return e.charCodeAt(t)|0}function Bd(e,t,n){return e.slice(t,n)}function Qs(e){return e.length}function C1(e){return e.length}function Qh(e,t){return t.push(e),e}function moe(e,t){return e.map(t).join("")}var Kp=1,yc=1,l3=0,xr=0,fn=0,zc="";function Yp(e,t,n,r,a,o,c){return{value:e,root:t,parent:n,type:r,props:a,children:o,line:Kp,column:yc,length:c,return:""}}function Hu(e,t){return doe(Yp("",null,null,"",null,null,0),e,{length:-e.length},t)}function poe(){return fn}function goe(){return fn=xr>0?Mn(zc,--xr):0,yc--,fn===10&&(yc=1,Kp--),fn}function Ir(){return fn=xr<l3?Mn(zc,xr++):0,yc++,fn===10&&(yc=1,Kp++),fn}function ca(){return Mn(zc,xr)}function pm(){return xr}function uf(e,t){return Bd(zc,e,t)}function zd(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function c3(e){return Kp=yc=1,l3=Qs(zc=e),xr=0,[]}function u3(e){return zc="",e}function gm(e){return o3(uf(xr-1,Z0(e===91?e+2:e===40?e+1:e)))}function xoe(e){for(;(fn=ca())&&fn<33;)Ir();return zd(e)>2||zd(fn)>3?"":" "}function yoe(e,t){for(;--t&&Ir()&&!(fn<48||fn>102||fn>57&&fn<65||fn>70&&fn<97););return uf(e,pm()+(t<6&&ca()==32&&Ir()==32))}function Z0(e){for(;Ir();)switch(fn){case e:return xr;case 34:case 39:e!==34&&e!==39&&Z0(fn);break;case 40:e===41&&Z0(e);break;case 92:Ir();break}return xr}function voe(e,t){for(;Ir()&&e+fn!==57;)if(e+fn===84&&ca()===47)break;return"/*"+uf(t,xr-1)+"*"+Wp(e===47?e:Ir())}function boe(e){for(;!zd(ca());)Ir();return uf(e,xr)}function woe(e){return u3(xm("",null,null,null,[""],e=c3(e),0,[0],e))}function xm(e,t,n,r,a,o,c,d,h){for(var f=0,m=0,p=c,y=0,v=0,S=0,N=1,C=1,j=1,E=0,R="",A=a,_=o,O=r,T=R;C;)switch(S=E,E=Ir()){case 40:if(S!=108&&Mn(T,p-1)==58){J0(T+=St(gm(E),"&","&\f"),"&\f")!=-1&&(j=-1);break}case 34:case 39:case 91:T+=gm(E);break;case 9:case 10:case 13:case 32:T+=xoe(S);break;case 92:T+=yoe(pm()-1,7);continue;case 47:switch(ca()){case 42:case 47:Qh(Soe(voe(Ir(),pm()),t,n),h);break;default:T+="/"}break;case 123*N:d[f++]=Qs(T)*j;case 125*N:case 59:case 0:switch(E){case 0:case 125:C=0;case 59+m:j==-1&&(T=St(T,/\f/g,"")),v>0&&Qs(T)-p&&Qh(v>32?q_(T+";",r,n,p-1):q_(St(T," ","")+";",r,n,p-2),h);break;case 59:T+=";";default:if(Qh(O=G_(T,t,n,f,m,a,d,R,A=[],_=[],p),o),E===123)if(m===0)xm(T,t,O,O,A,o,p,d,_);else switch(y===99&&Mn(T,3)===110?100:y){case 100:case 108:case 109:case 115:xm(e,O,O,r&&Qh(G_(e,O,O,0,0,a,d,R,a,A=[],p),_),a,_,p,d,r?A:_);break;default:xm(T,O,O,O,[""],_,0,d,_)}}f=m=v=0,N=j=1,R=T="",p=c;break;case 58:p=1+Qs(T),v=S;default:if(N<1){if(E==123)--N;else if(E==125&&N++==0&&goe()==125)continue}switch(T+=Wp(E),E*N){case 38:j=m>0?1:(T+="\f",-1);break;case 44:d[f++]=(Qs(T)-1)*j,j=1;break;case 64:ca()===45&&(T+=gm(Ir())),y=ca(),m=p=Qs(R=T+=boe(pm())),E++;break;case 45:S===45&&Qs(T)==2&&(N=0)}}return o}function G_(e,t,n,r,a,o,c,d,h,f,m){for(var p=a-1,y=a===0?o:[""],v=C1(y),S=0,N=0,C=0;S<r;++S)for(var j=0,E=Bd(e,p+1,p=uoe(N=c[S])),R=e;j<v;++j)(R=o3(N>0?y[j]+" "+E:St(E,/&\f/g,y[j])))&&(h[C++]=R);return Yp(e,t,n,a===0?N1:d,h,f,m)}function Soe(e,t,n){return Yp(e,t,n,a3,Wp(poe()),Bd(e,2,-2),0)}function q_(e,t,n,r){return Yp(e,t,n,j1,Bd(e,0,r),Bd(e,r+1,-1),r)}function cc(e,t){for(var n="",r=C1(e),a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function Noe(e,t,n,r){switch(e.type){case coe:if(e.children.length)break;case loe:case j1:return e.return=e.return||e.value;case a3:return"";case i3:return e.return=e.value+"{"+cc(e.children,r)+"}";case N1:e.value=e.props.join(",")}return Qs(n=cc(e.children,r))?e.return=e.value+"{"+n+"}":""}function joe(e){var t=C1(e);return function(n,r,a,o){for(var c="",d=0;d<t;d++)c+=e[d](n,r,a,o)||"";return c}}function Coe(e){return function(t){t.root||(t=t.return)&&e(t)}}function Eoe(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Toe=function(t,n,r){for(var a=0,o=0;a=o,o=ca(),a===38&&o===12&&(n[r]=1),!zd(o);)Ir();return uf(t,xr)},_oe=function(t,n){var r=-1,a=44;do switch(zd(a)){case 0:a===38&&ca()===12&&(n[r]=1),t[r]+=Toe(xr-1,n,r);break;case 2:t[r]+=gm(a);break;case 4:if(a===44){t[++r]=ca()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Wp(a)}while(a=Ir());return t},Roe=function(t,n){return u3(_oe(c3(t),n))},W_=new WeakMap,Doe=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,a=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!W_.get(r))&&!a){W_.set(t,!0);for(var o=[],c=Roe(n,o),d=r.props,h=0,f=0;h<c.length;h++)for(var m=0;m<d.length;m++,f++)t.props[f]=o[h]?c[h].replace(/&\f/g,d[m]):d[m]+" "+c[h]}}},koe=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function d3(e,t){switch(foe(e,t)){case 5103:return wt+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return wt+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return wt+e+Xm+e+Fn+e+e;case 6828:case 4268:return wt+e+Fn+e+e;case 6165:return wt+e+Fn+"flex-"+e+e;case 5187:return wt+e+St(e,/(\w+).+(:[^]+)/,wt+"box-$1$2"+Fn+"flex-$1$2")+e;case 5443:return wt+e+Fn+"flex-item-"+St(e,/flex-|-self/,"")+e;case 4675:return wt+e+Fn+"flex-line-pack"+St(e,/align-content|flex-|-self/,"")+e;case 5548:return wt+e+Fn+St(e,"shrink","negative")+e;case 5292:return wt+e+Fn+St(e,"basis","preferred-size")+e;case 6060:return wt+"box-"+St(e,"-grow","")+wt+e+Fn+St(e,"grow","positive")+e;case 4554:return wt+St(e,/([^-])(transform)/g,"$1"+wt+"$2")+e;case 6187:return St(St(St(e,/(zoom-|grab)/,wt+"$1"),/(image-set)/,wt+"$1"),e,"")+e;case 5495:case 3959:return St(e,/(image-set\([^]*)/,wt+"$1$`$1");case 4968:return St(St(e,/(.+:)(flex-)?(.*)/,wt+"box-pack:$3"+Fn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+wt+e+e;case 4095:case 3583:case 4068:case 2532:return St(e,/(.+)-inline(.+)/,wt+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Qs(e)-1-t>6)switch(Mn(e,t+1)){case 109:if(Mn(e,t+4)!==45)break;case 102:return St(e,/(.+:)(.+)-([^]+)/,"$1"+wt+"$2-$3$1"+Xm+(Mn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~J0(e,"stretch")?d3(St(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Mn(e,t+1)!==115)break;case 6444:switch(Mn(e,Qs(e)-3-(~J0(e,"!important")&&10))){case 107:return St(e,":",":"+wt)+e;case 101:return St(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+wt+(Mn(e,14)===45?"inline-":"")+"box$3$1"+wt+"$2$3$1"+Fn+"$2box$3")+e}break;case 5936:switch(Mn(e,t+11)){case 114:return wt+e+Fn+St(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return wt+e+Fn+St(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return wt+e+Fn+St(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return wt+e+Fn+e+e}return e}var Aoe=function(t,n,r,a){if(t.length>-1&&!t.return)switch(t.type){case j1:t.return=d3(t.value,t.length);break;case i3:return cc([Hu(t,{value:St(t.value,"@","@"+wt)})],a);case N1:if(t.length)return moe(t.props,function(o){switch(hoe(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return cc([Hu(t,{props:[St(o,/:(read-\w+)/,":"+Xm+"$1")]})],a);case"::placeholder":return cc([Hu(t,{props:[St(o,/:(plac\w+)/,":"+wt+"input-$1")]}),Hu(t,{props:[St(o,/:(plac\w+)/,":"+Xm+"$1")]}),Hu(t,{props:[St(o,/:(plac\w+)/,Fn+"input-$1")]})],a)}return""})}},Ooe=[Aoe],Moe=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(N){var C=N.getAttribute("data-emotion");C.indexOf(" ")!==-1&&(document.head.appendChild(N),N.setAttribute("data-s",""))})}var a=t.stylisPlugins||Ooe,o={},c,d=[];c=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(N){for(var C=N.getAttribute("data-emotion").split(" "),j=1;j<C.length;j++)o[C[j]]=!0;d.push(N)});var h,f=[Doe,koe];{var m,p=[Noe,Coe(function(N){m.insert(N)})],y=joe(f.concat(a,p)),v=function(C){return cc(woe(C),y)};h=function(C,j,E,R){m=E,v(C?C+"{"+j.styles+"}":j.styles),R&&(S.inserted[j.name]=!0)}}var S={key:n,sheet:new ooe({key:n,container:c,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:h};return S.sheet.hydrate(d),S};function Poe(e){for(var t=0,n,r=0,a=e.length;a>=4;++r,a-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Loe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ioe=/[A-Z]|^ms/g,Boe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,f3=function(t){return t.charCodeAt(1)===45},K_=function(t){return t!=null&&typeof t!="boolean"},bv=Eoe(function(e){return f3(e)?e:e.replace(Ioe,"-$&").toLowerCase()}),Y_=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Boe,function(r,a,o){return Ti={name:a,styles:o,next:Ti},a})}return Loe[t]!==1&&!f3(t)&&typeof n=="number"&&n!==0?n+"px":n};function Qm(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var a=n;if(a.anim===1)return Ti={name:a.name,styles:a.styles,next:Ti},a.name;var o=n;if(o.styles!==void 0){var c=o.next;if(c!==void 0)for(;c!==void 0;)Ti={name:c.name,styles:c.styles,next:Ti},c=c.next;var d=o.styles+";";return d}return zoe(e,t,n)}}var h=n;if(t==null)return h;var f=t[h];return f!==void 0?f:h}function zoe(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=Qm(e,t,n[a])+";";else for(var o in n){var c=n[o];if(typeof c!="object"){var d=c;t!=null&&t[d]!==void 0?r+=o+"{"+t[d]+"}":K_(d)&&(r+=bv(o)+":"+Y_(o,d)+";")}else if(Array.isArray(c)&&typeof c[0]=="string"&&(t==null||t[c[0]]===void 0))for(var h=0;h<c.length;h++)K_(c[h])&&(r+=bv(o)+":"+Y_(o,c[h])+";");else{var f=Qm(e,t,c);switch(o){case"animation":case"animationName":{r+=bv(o)+":"+f+";";break}default:r+=o+"{"+f+"}"}}}return r}var X_=/label:\s*([^\s;{]+)\s*(;|$)/g,Ti;function wv(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,a="";Ti=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,a+=Qm(n,t,o);else{var c=o;a+=c[0]}for(var d=1;d<e.length;d++)if(a+=Qm(n,t,e[d]),r){var h=o;a+=h[d]}X_.lastIndex=0;for(var f="",m;(m=X_.exec(a))!==null;)f+="-"+m[1];var p=Poe(a)+f;return{name:p,styles:a,next:Ti}}function h3(e,t,n){var r="";return n.split(" ").forEach(function(a){e[a]!==void 0?t.push(e[a]+";"):a&&(r+=a+" ")}),r}var Foe=function(t,n,r){var a=t.key+"-"+n.name;t.registered[a]===void 0&&(t.registered[a]=n.styles)},$oe=function(t,n,r){Foe(t,n);var a=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+a:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function Q_(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function J_(e,t,n){var r=[],a=h3(e,r,n);return r.length<2?n:a+t(r)}var Voe=function(t){var n=Moe(t);n.sheet.speedy=function(d){this.isSpeedy=d},n.compat=!0;var r=function(){for(var h=arguments.length,f=new Array(h),m=0;m<h;m++)f[m]=arguments[m];var p=wv(f,n.registered,void 0);return $oe(n,p),n.key+"-"+p.name},a=function(){for(var h=arguments.length,f=new Array(h),m=0;m<h;m++)f[m]=arguments[m];var p=wv(f,n.registered),y="animation-"+p.name;return Q_(n,{name:p.name,styles:"@keyframes "+y+"{"+p.styles+"}"}),y},o=function(){for(var h=arguments.length,f=new Array(h),m=0;m<h;m++)f[m]=arguments[m];var p=wv(f,n.registered);Q_(n,p)},c=function(){for(var h=arguments.length,f=new Array(h),m=0;m<h;m++)f[m]=arguments[m];return J_(n.registered,r,Uoe(f))};return{css:r,cx:c,injectGlobal:o,keyframes:a,hydrate:function(h){h.forEach(function(f){n.inserted[f]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:h3.bind(null,n.registered),merge:J_.bind(null,n.registered,r)}},Uoe=function e(t){for(var n="",r=0;r<t.length;r++){var a=t[r];if(a!=null){var o=void 0;switch(typeof a){case"boolean":break;case"object":{if(Array.isArray(a))o=e(a);else{o="";for(var c in a)a[c]&&c&&(o&&(o+=" "),o+=c)}break}default:o=a}o&&(n&&(n+=" "),n+=o)}}return n};const Hoe=Object.freeze(Object.defineProperty({__proto__:null,default:Voe},Symbol.toStringTag,{value:"Module"})),Goe=bR(Hoe);var Z_;function qoe(){if(Z_)return bi;Z_=1;var e=bi&&bi.__rest||function(r,a){var o={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&a.indexOf(c)<0&&(o[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,c=Object.getOwnPropertySymbols(r);d<c.length;d++)a.indexOf(c[d])<0&&Object.prototype.propertyIsEnumerable.call(r,c[d])&&(o[c[d]]=r[c[d]]);return o},t=bi&&bi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bi,"__esModule",{value:!0});const n=t(Goe);return bi.default=(r,a=!1,o="")=>{const{variables:c={}}=r,d=e(r,["variables"]),h={light:Object.assign({diffViewerBackground:"#fff",diffViewerColor:"#212529",addedBackground:"#e6ffed",addedColor:"#24292e",removedBackground:"#ffeef0",removedColor:"#24292e",changedBackground:"#fffbdd",wordAddedBackground:"#acf2bd",wordRemovedBackground:"#fdb8c0",addedGutterBackground:"#cdffd8",removedGutterBackground:"#ffdce0",gutterBackground:"#f7f7f7",gutterBackgroundDark:"#f3f1f1",highlightBackground:"#fffbdd",highlightGutterBackground:"#fff5b1",codeFoldGutterBackground:"#dbedff",codeFoldBackground:"#f1f8ff",emptyLineBackground:"#fafbfc",gutterColor:"#212529",addedGutterColor:"#212529",removedGutterColor:"#212529",codeFoldContentColor:"#212529",diffViewerTitleBackground:"#fafbfc",diffViewerTitleColor:"#212529",diffViewerTitleBorderColor:"#eee"},c.light||{}),dark:Object.assign({diffViewerBackground:"#2e303c",diffViewerColor:"#FFF",addedBackground:"#044B53",addedColor:"white",removedBackground:"#632F34",removedColor:"white",changedBackground:"#3e302c",wordAddedBackground:"#055d67",wordRemovedBackground:"#7d383f",addedGutterBackground:"#034148",removedGutterBackground:"#632b30",gutterBackground:"#2c2f3a",gutterBackgroundDark:"#262933",highlightBackground:"#2a3967",highlightGutterBackground:"#2d4077",codeFoldGutterBackground:"#21232b",codeFoldBackground:"#262831",emptyLineBackground:"#363946",gutterColor:"#666c87",addedGutterColor:"#8c8c8c",removedGutterColor:"#8c8c8c",codeFoldContentColor:"#656a8b",diffViewerTitleBackground:"#2f323e",diffViewerTitleColor:"#555a7b",diffViewerTitleBorderColor:"#353846"},c.dark||{})},f=a?h.dark:h.light,{css:m,cx:p}=(0,n.default)({key:"react-diff",nonce:o}),y=m({width:"100%",label:"content"}),v=m({[`.${y}`]:{width:"50%"},label:"split-view"}),S=m({width:"100%",background:f.diffViewerBackground,pre:{margin:0,whiteSpace:"pre-wrap",lineHeight:"25px"},label:"diff-container",borderCollapse:"collapse"}),N=m({color:f.codeFoldContentColor,label:"code-fold-content"}),C=m({color:f.diffViewerColor,label:"content-text"}),j=m({background:f.diffViewerTitleBackground,padding:10,borderBottom:`1px solid ${f.diffViewerTitleBorderColor}`,label:"title-block",":last-child":{borderLeft:`1px solid ${f.diffViewerTitleBorderColor}`},[`.${C}`]:{color:f.diffViewerTitleColor}}),E=m({color:f.gutterColor,label:"line-number"}),R=m({background:f.removedBackground,color:f.removedColor,pre:{color:f.removedColor},[`.${E}`]:{color:f.removedGutterColor},label:"diff-removed"}),A=m({background:f.addedBackground,color:f.addedColor,pre:{color:f.addedColor},[`.${E}`]:{color:f.addedGutterColor},label:"diff-added"}),_=m({background:f.changedBackground,[`.${E}`]:{color:f.gutterColor},label:"diff-changed"}),O=m({padding:2,display:"inline-flex",borderRadius:4,wordBreak:"break-all",label:"word-diff"}),T=m({background:f.wordAddedBackground,label:"word-added"}),D=m({background:f.wordRemovedBackground,label:"word-removed"}),B=m({backgroundColor:f.codeFoldGutterBackground,label:"code-fold-gutter"}),W=m({backgroundColor:f.codeFoldBackground,height:40,fontSize:14,fontWeight:700,label:"code-fold",a:{textDecoration:"underline !important",cursor:"pointer",pre:{display:"inline"}}}),M=m({backgroundColor:f.emptyLineBackground,label:"empty-line"}),V=m({width:25,paddingLeft:10,paddingRight:10,userSelect:"none",label:"marker",[`&.${A}`]:{pre:{color:f.addedColor}},[`&.${R}`]:{pre:{color:f.removedColor}}}),G=m({background:f.highlightBackground,label:"highlighted-line",[`.${T}, .${D}`]:{backgroundColor:"initial"}}),F=m({label:"highlighted-gutter"}),H=m({userSelect:"none",minWidth:50,padding:"0 10px",whiteSpace:"nowrap",label:"gutter",textAlign:"right",background:f.gutterBackground,"&:hover":{cursor:"pointer",background:f.gutterBackgroundDark,pre:{opacity:1}},pre:{opacity:.5},[`&.${A}`]:{background:f.addedGutterBackground},[`&.${R}`]:{background:f.removedGutterBackground},[`&.${F}`]:{background:f.highlightGutterBackground,"&:hover":{background:f.highlightGutterBackground}}}),P=m({"&:hover":{background:f.gutterBackground,cursor:"initial"},label:"empty-gutter"}),U=m({verticalAlign:"baseline",label:"line"}),z={diffContainer:S,diffRemoved:R,diffAdded:A,diffChanged:_,splitView:v,marker:V,highlightedGutter:F,highlightedLine:G,gutter:H,line:U,wordDiff:O,wordAdded:T,wordRemoved:D,codeFoldGutter:B,codeFold:W,emptyGutter:P,emptyLine:M,lineNumber:E,contentText:C,content:y,codeFoldContent:N,titleBlock:j},te=Object.keys(d).reduce((oe,L)=>Object.assign(Object.assign({},oe),{[L]:m(d[L])}),{});return Object.keys(z).reduce((oe,L)=>Object.assign(Object.assign({},oe),{[L]:te[L]?p(z[L],te[L]):z[L]}),{})},bi}var Gu={},eR;function Woe(){if(eR)return Gu;eR=1,Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.computeHiddenBlocks=void 0;function e(t,n,r){let a=0,o,c={},d=[];return t.forEach((h,f)=>{const m=n.some(p=>p>=f-r&&p<=f+r);!m&&o==null?(o={index:a,startLine:f,endLine:f,lines:1},d.push(o),c[f]=o.index,a++):m?o=void 0:(o.endLine=f,o.lines++,c[f]=o.index)}),{lineBlocks:c,blocks:d}}return Gu.computeHiddenBlocks=e,Gu}var tR=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Koe(e,t){return!!(e===t||tR(e)&&tR(t))}function Yoe(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Koe(e[n],t[n]))return!1;return!0}function Xoe(e,t){t===void 0&&(t=Yoe);var n=null;function r(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];if(n&&n.lastThis===this&&t(a,n.lastArgs))return n.lastResult;var c=e.apply(this,a);return n={lastResult:c,lastArgs:a,lastThis:this},c}return r.clear=function(){n=null},r}const Qoe=Object.freeze(Object.defineProperty({__proto__:null,default:Xoe},Symbol.toStringTag,{value:"Module"})),Joe=bR(Qoe);var nR;function Zoe(){return nR||(nR=1,(function(e){var t=_s&&_s.__createBinding||(Object.create?(function(N,C,j,E){E===void 0&&(E=j);var R=Object.getOwnPropertyDescriptor(C,j);(!R||("get"in R?!C.__esModule:R.writable||R.configurable))&&(R={enumerable:!0,get:function(){return C[j]}}),Object.defineProperty(N,E,R)}):(function(N,C,j,E){E===void 0&&(E=j),N[E]=C[j]})),n=_s&&_s.__setModuleDefault||(Object.create?(function(N,C){Object.defineProperty(N,"default",{enumerable:!0,value:C})}):function(N,C){N.default=C}),r=_s&&_s.__importStar||function(N){if(N&&N.__esModule)return N;var C={};if(N!=null)for(var j in N)j!=="default"&&Object.prototype.hasOwnProperty.call(N,j)&&t(C,N,j);return n(C,N),C},a=_s&&_s.__importDefault||function(N){return N&&N.__esModule?N:{default:N}};Object.defineProperty(e,"__esModule",{value:!0}),e.DiffMethod=e.LineNumberPrefix=void 0;const o=wR(),c=r(Vd()),d=a(Uie()),h=soe();Object.defineProperty(e,"DiffMethod",{enumerable:!0,get:function(){return h.DiffMethod}});const f=a(qoe()),m=Woe(),p=Joe,y=p.default||p;var v;(function(N){N.LEFT="L",N.RIGHT="R"})(v||(e.LineNumberPrefix=v={}));class S extends c.Component{constructor(C){super(C),this.resetCodeBlocks=()=>this.state.expandedBlocks.length>0?(this.setState({expandedBlocks:[]}),!0):!1,this.onBlockExpand=j=>{const E=this.state.expandedBlocks.slice();E.push(j),this.setState({expandedBlocks:E})},this.computeStyles=y(f.default),this.onLineNumberClickProxy=j=>this.props.onLineNumberClick?E=>this.props.onLineNumberClick(j,E):()=>{},this.renderWordDiff=(j,E)=>j.map((R,A)=>(0,o.jsx)("span",{className:(0,d.default)(this.styles.wordDiff,{[this.styles.wordAdded]:R.type===h.DiffType.ADDED,[this.styles.wordRemoved]:R.type===h.DiffType.REMOVED}),children:E?E(R.value):R.value},A)),this.renderLine=(j,E,R,A,_,O)=>{const T=`${R}-${j}`,D=`${O}-${_}`,B=this.props.highlightLines.includes(T)||this.props.highlightLines.includes(D),W=E===h.DiffType.ADDED,M=E===h.DiffType.REMOVED,V=E===h.DiffType.CHANGED;let G;return Array.isArray(A)?G=this.renderWordDiff(A,this.props.renderContent):this.props.renderContent?G=this.props.renderContent(A):G=A,(0,o.jsxs)(c.Fragment,{children:[!this.props.hideLineNumbers&&(0,o.jsx)("td",{onClick:j&&this.onLineNumberClickProxy(T),className:(0,d.default)(this.styles.gutter,{[this.styles.emptyGutter]:!j,[this.styles.diffAdded]:W,[this.styles.diffRemoved]:M,[this.styles.diffChanged]:V,[this.styles.highlightedGutter]:B}),children:(0,o.jsx)("pre",{className:this.styles.lineNumber,children:j})}),!this.props.splitView&&!this.props.hideLineNumbers&&(0,o.jsx)("td",{onClick:_&&this.onLineNumberClickProxy(D),className:(0,d.default)(this.styles.gutter,{[this.styles.emptyGutter]:!_,[this.styles.diffAdded]:W,[this.styles.diffRemoved]:M,[this.styles.diffChanged]:V,[this.styles.highlightedGutter]:B}),children:(0,o.jsx)("pre",{className:this.styles.lineNumber,children:_})}),this.props.renderGutter?this.props.renderGutter({lineNumber:j,type:E,prefix:R,value:A,additionalLineNumber:_,additionalPrefix:O,styles:this.styles}):null,!this.props.hideMarkers&&(0,o.jsx)("td",{className:(0,d.default)(this.styles.marker,{[this.styles.emptyLine]:!G,[this.styles.diffAdded]:W,[this.styles.diffRemoved]:M,[this.styles.diffChanged]:V,[this.styles.highlightedLine]:B}),children:(0,o.jsxs)("pre",{children:[W&&"+",M&&"-"]})}),(0,o.jsx)("td",{className:(0,d.default)(this.styles.content,{[this.styles.emptyLine]:!G,[this.styles.diffAdded]:W,[this.styles.diffRemoved]:M,[this.styles.diffChanged]:V,[this.styles.highlightedLine]:B}),children:(0,o.jsx)("pre",{className:this.styles.contentText,children:G})})]})},this.renderSplitView=({left:j,right:E},R)=>(0,o.jsxs)("tr",{className:this.styles.line,children:[this.renderLine(j.lineNumber,j.type,v.LEFT,j.value),this.renderLine(E.lineNumber,E.type,v.RIGHT,E.value)]},R),this.renderInlineView=({left:j,right:E},R)=>{let A;return j.type===h.DiffType.REMOVED&&E.type===h.DiffType.ADDED?(0,o.jsxs)(c.Fragment,{children:[(0,o.jsx)("tr",{className:this.styles.line,children:this.renderLine(j.lineNumber,j.type,v.LEFT,j.value,null)}),(0,o.jsx)("tr",{className:this.styles.line,children:this.renderLine(null,E.type,v.RIGHT,E.value,E.lineNumber)})]},R):(j.type===h.DiffType.REMOVED&&(A=this.renderLine(j.lineNumber,j.type,v.LEFT,j.value,null)),j.type===h.DiffType.DEFAULT&&(A=this.renderLine(j.lineNumber,j.type,v.LEFT,j.value,E.lineNumber,v.RIGHT)),E.type===h.DiffType.ADDED&&(A=this.renderLine(null,E.type,v.RIGHT,E.value,E.lineNumber)),(0,o.jsx)("tr",{className:this.styles.line,children:A},R))},this.onBlockClickProxy=j=>()=>this.onBlockExpand(j),this.renderSkippedLineIndicator=(j,E,R,A)=>{const{hideLineNumbers:_,splitView:O}=this.props,T=this.props.codeFoldMessageRenderer?this.props.codeFoldMessageRenderer(j,R,A):(0,o.jsxs)("pre",{className:this.styles.codeFoldContent,children:["Expand ",j," lines ..."]}),D=(0,o.jsx)("td",{children:(0,o.jsx)("a",{onClick:this.onBlockClickProxy(E),tabIndex:0,children:T})}),B=!O&&!_;return(0,o.jsxs)("tr",{className:this.styles.codeFold,children:[!_&&(0,o.jsx)("td",{className:this.styles.codeFoldGutter}),this.props.renderGutter?(0,o.jsx)("td",{className:this.styles.codeFoldGutter}):null,(0,o.jsx)("td",{className:(0,d.default)({[this.styles.codeFoldGutter]:B})}),B?(0,o.jsxs)(c.Fragment,{children:[(0,o.jsx)("td",{}),D]}):(0,o.jsxs)(c.Fragment,{children:[D,this.props.renderGutter?(0,o.jsx)("td",{}):null,(0,o.jsx)("td",{})]}),(0,o.jsx)("td",{}),(0,o.jsx)("td",{})]},`${R}-${A}`)},this.renderDiff=()=>{const{oldValue:j,newValue:E,splitView:R,disableWordDiff:A,compareMethod:_,linesOffset:O}=this.props,{lineInformation:T,diffLines:D}=(0,h.computeLineInformation)(j,E,A,_,O,this.props.alwaysShowLines),B=this.props.extraLinesSurroundingDiff<0?0:Math.round(this.props.extraLinesSurroundingDiff),{lineBlocks:W,blocks:M}=(0,m.computeHiddenBlocks)(T,D,B);return T.map((V,G)=>{if(this.props.showDiffOnly){const H=W[G];if(H!==void 0){const P=M[H].endLine===G;if(!this.state.expandedBlocks.includes(H)&&P)return(0,o.jsx)(c.Fragment,{children:this.renderSkippedLineIndicator(M[H].lines,H,V.left.lineNumber,V.right.lineNumber)},G);if(!this.state.expandedBlocks.includes(H))return null}}return R?this.renderSplitView(V,G):this.renderInlineView(V,G)})},this.render=()=>{const{oldValue:j,newValue:E,useDarkTheme:R,leftTitle:A,rightTitle:_,splitView:O,hideLineNumbers:T,hideMarkers:D,nonce:B}=this.props;if(this.props.compareMethod!==h.DiffMethod.JSON&&(typeof j!="string"||typeof E!="string"))throw Error('"oldValue" and "newValue" should be strings');this.styles=this.computeStyles(this.props.styles,R,B);const W=this.renderDiff();let M=T?2:3,V=T?2:4;D&&(M-=1,V-=1);const G=this.props.renderGutter?1:0,F=(A||_)&&(0,o.jsxs)("tr",{children:[(0,o.jsx)("td",{colSpan:(O?M:V)+G,className:this.styles.titleBlock,children:(0,o.jsx)("pre",{className:this.styles.contentText,children:A})}),O&&(0,o.jsx)("td",{colSpan:M+G,className:this.styles.titleBlock,children:(0,o.jsx)("pre",{className:this.styles.contentText,children:_})})]});return(0,o.jsx)("table",{className:(0,d.default)(this.styles.diffContainer,{[this.styles.splitView]:O}),children:(0,o.jsxs)("tbody",{children:[F,W]})})},this.state={expandedBlocks:[]}}}S.defaultProps={oldValue:"",newValue:"",splitView:!0,highlightLines:[],disableWordDiff:!1,compareMethod:h.DiffMethod.CHARS,styles:{},hideLineNumbers:!1,hideMarkers:!1,extraLinesSurroundingDiff:3,showDiffOnly:!0,useDarkTheme:!1,linesOffset:0,nonce:""},e.default=S})(_s)),_s}var m3=Zoe();const ele=ab(m3),tle={human:LO,agent:kr,system:od},nle={human:"Reviewer",agent:"Agent",system:"System"};function rle({comment:e,onResolve:t,onUnresolve:n,readOnly:r=!1}){const a=tle[e.author_type]||LO,o=nle[e.author_type]||"Unknown",c=Kw(new Date(e.created_at),{addSuffix:!0});return l.jsxs("div",{className:`border rounded-lg p-3 mb-2 ${e.resolved?"border-border bg-muted/50 opacity-60":"border-border bg-card"}`,children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(a,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"font-medium text-foreground",children:o}),l.jsx("span",{className:"text-muted-foreground",children:"·"}),l.jsx("span",{className:"text-muted-foreground",children:c}),e.resolved&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-muted-foreground",children:"·"}),l.jsxs("span",{className:"text-emerald-600 text-xs flex items-center gap-1",children:[l.jsx(As,{className:"h-3 w-3"}),"Resolved"]})]})]}),!r&&l.jsx("div",{className:"flex-shrink-0",children:e.resolved?l.jsxs(ye,{size:"sm",variant:"ghost",onClick:n,className:"text-xs h-7 px-2 text-muted-foreground hover:text-foreground",children:[l.jsx(EO,{className:"h-3 w-3 mr-1"}),"Unresolve"]}):l.jsxs(ye,{size:"sm",variant:"ghost",onClick:t,className:"text-xs h-7 px-2 text-emerald-600 hover:text-emerald-700",children:[l.jsx(As,{className:"h-3 w-3 mr-1"}),"Resolve"]})})]}),e.line_content&&l.jsxs("div",{className:"mt-2 px-2 py-1.5 bg-muted rounded border border-border",children:[l.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1",children:l.jsxs("span",{className:"font-mono",children:[e.file_path,":",e.line_number]})}),l.jsx("code",{className:"text-xs font-mono text-foreground block",children:e.line_content})]}),l.jsx("div",{className:"mt-2 text-sm text-foreground whitespace-pre-wrap",children:e.body})]})}function sle(e){const t=[],n=e.split(/^diff --git /m).filter(Boolean);for(const r of n){const a="diff --git "+r,o=/^diff --git a\/(.+?) b\/(.+)$/m.exec(a);if(!o)continue;const c=o[2],d=[],h=[],f=[],m=a.split(`
152
+ `);let p=!1;for(const y of m){if(y.startsWith("@@")){p=!0,f.push(y);continue}p&&(y.startsWith("-")&&!y.startsWith("---")?d.push(y.substring(1)):y.startsWith("+")&&!y.startsWith("+++")?h.push(y.substring(1)):y.startsWith(" ")&&(d.push(y.substring(1)),h.push(y.substring(1))))}t.push({filePath:c,oldContent:d.join(`
153
+ `),newContent:h.join(`
154
+ `),hunkHeaders:f})}return t}function ale({onSubmit:e,onCancel:t,isSubmitting:n,lineNumber:r}){const[a,o]=x.useState(""),c=()=>{a.trim()&&(e(a.trim()),o(""))},d=h=>{h.key==="Escape"?t():h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&c()};return l.jsxs("div",{className:"bg-white border border-slate-300 rounded-md shadow-lg overflow-hidden",children:[l.jsxs("div",{className:"bg-slate-50 px-3 py-2 border-b border-slate-200 flex items-center justify-between",children:[l.jsxs("span",{className:"text-sm font-medium text-slate-700",children:["Comment on line ",r]}),l.jsxs("span",{className:"text-xs text-slate-500",children:[navigator.platform?.includes("Mac")?"⌘":"Ctrl","+Enter to submit"]})]}),l.jsx("div",{className:"p-3",children:l.jsx(Mc,{value:a,onChange:h=>o(h.target.value),onKeyDown:d,placeholder:"Leave a comment...",className:"min-h-[100px] bg-white border-slate-300 text-slate-900 placeholder:text-slate-400 focus:border-blue-500 focus:ring-blue-500",disabled:n,autoFocus:!0})}),l.jsxs("div",{className:"bg-slate-50 px-3 py-2 border-t border-slate-200 flex justify-end gap-2",children:[l.jsx(ye,{size:"sm",variant:"outline",onClick:t,disabled:n,className:"text-slate-600 border-slate-300 hover:bg-slate-100",children:"Cancel"}),l.jsx(ye,{size:"sm",onClick:c,disabled:!a.trim()||n,className:"bg-emerald-600 hover:bg-emerald-700 text-white",children:n?"Adding...":"Add comment"})]})]})}function ile({file:e,comments:t,onAddComment:n,onResolveComment:r,onUnresolveComment:a,readOnly:o}){const[c,d]=x.useState(null),[h,f]=x.useState(0),[m,p]=x.useState(!1),[y,v]=x.useState({}),S=x.useRef(null),N=x.useRef(!1),C=t.reduce((_,O)=>(_[O.line_number]||(_[O.line_number]=[]),_[O.line_number].push(O),_),{});ge.useEffect(()=>{if(!S.current||Object.keys(C).length===0)return;const _={},O=S.current,T=O.querySelectorAll("tr");for(const[D]of Object.entries(C)){const B=parseInt(D,10);for(const W of T){const M=W.querySelectorAll("pre");for(const V of M)if(V.textContent?.trim()===String(B)){const G=W.getBoundingClientRect(),F=O.getBoundingClientRect();_[B]=G.bottom-F.top;break}if(_[B])break}}v(_)},[C,e]);const j=async _=>{if(c!==null){p(!0);try{const T=e.newContent.split(`
155
+ `)[c-1]||"";await n(c,_,T),d(null)}finally{p(!1)}}},E=(_,O)=>{if(!S.current)return 0;const T=S.current,D=T.querySelectorAll("tr");for(const B of D){const W=B.querySelectorAll("pre");for(const M of W)if(M.textContent?.trim()===String(_)){const V=B.getBoundingClientRect(),G=T.getBoundingClientRect();return V.bottom-G.top}}if(O){const B=T.getBoundingClientRect();return O.clientY-B.top+20}return 0},R=(_,O)=>{if(N.current=!0,o)return;const T=_.match(/^R-(\d+)$/),D=_.match(/^L-(\d+)$/),B=_.match(/^undefined-(\d+)$/),W=_.match(/^.*?-(\d+)$/);let M=null;if(T)M=parseInt(T[1],10);else if(D)M=parseInt(D[1],10);else if(B)M=parseInt(B[1],10);else if(W)M=parseInt(W[1],10);else return;if(c===M)d(null);else{const V=E(M,O);f(V),d(M)}},A={variables:{dark:{diffViewerBackground:"hsl(0 0% 98%)",diffViewerColor:"hsl(0 0% 10%)",addedBackground:"#06b6d420",addedColor:"#059669",removedBackground:"#dc262620",removedColor:"#dc2626",wordAddedBackground:"#05966940",wordRemovedBackground:"#dc262640",addedGutterBackground:"#06b6d430",removedGutterBackground:"#dc262630",gutterBackground:"hsl(0 0% 96%)",gutterBackgroundDark:"hsl(0 0% 94%)",highlightBackground:"hsl(0 0% 90%)",highlightGutterBackground:"hsl(0 0% 90%)",codeFoldGutterBackground:"hsl(0 0% 94%)",codeFoldBackground:"hsl(0 0% 96%)",emptyLineBackground:"hsl(0 0% 98%)",gutterColor:"hsl(0 0% 45%)",addedGutterColor:"#059669",removedGutterColor:"#dc2626",codeFoldContentColor:"hsl(0 0% 45%)"}},line:{padding:"4px 10px","&:hover":{background:"hsl(0 0% 90%)"}},gutter:{padding:"0 10px",minWidth:"40px",cursor:o?"default":"pointer",userSelect:"none","&:hover":o?{}:{background:"hsl(0 0% 85%)"}},contentText:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"13px"}};return l.jsxs("div",{className:"border border-border rounded-lg overflow-hidden mb-4",children:[l.jsx("div",{className:"bg-muted px-4 py-2 border-b border-border",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"font-mono text-sm text-foreground",children:e.filePath}),!o&&l.jsx("span",{className:"text-xs text-muted-foreground italic",children:"Click on line numbers to add comments"})]})}),l.jsxs("div",{className:"relative",ref:_=>{S.current=_},onClick:_=>{if(o)return;const T=_.target.closest("td");if(!T)return;if(window.getComputedStyle(T).cursor==="pointer"||T.querySelector("pre")){const M=T.querySelector("pre")?.textContent?.trim();if(M&&/^\d+$/.test(M)){const V=parseInt(M,10);if(!N.current)if(c===V)d(null);else{const G=E(V,_);f(G),d(V)}N.current=!1}}},children:[l.jsx(ele,{oldValue:e.oldContent,newValue:e.newContent,splitView:!1,useDarkTheme:!1,styles:A,compareMethod:m3.DiffMethod.WORDS,hideLineNumbers:!1,onLineNumberClick:R,showDiffOnly:!1}),Object.entries(C).map(([_,O])=>{const T=parseInt(_,10),D=y[T];return D===void 0?null:l.jsx("div",{className:"absolute left-0 right-0 z-40 px-2",style:{top:`${D}px`},children:l.jsx("div",{className:"space-y-2",children:O.map(B=>l.jsx(rle,{comment:B,onResolve:()=>r(B.id),onUnresolve:()=>a(B.id),readOnly:o},B.id))})},_)}),c!==null&&l.jsx("div",{className:"absolute left-0 right-0 z-50 px-2",style:{top:`${h}px`},ref:_=>{_&&!_.dataset.scrolled&&(_.dataset.scrolled="true",_.scrollIntoView({behavior:"smooth",block:"nearest"}))},children:l.jsx(ale,{onSubmit:j,onCancel:()=>d(null),isSubmitting:m,lineNumber:c})})]})]})}function ole({diffPatch:e,comments:t,onAddComment:n,onResolveComment:r,onUnresolveComment:a,readOnly:o=!1}){if(!e)return l.jsx("div",{className:"text-center text-muted-foreground py-8",children:"No diff content available"});const c=sle(e);return c.length===0?l.jsx("div",{className:"text-center text-muted-foreground py-8",children:"No changes in this revision"}):l.jsx("div",{className:"space-y-4",children:c.map(d=>{const h=t.filter(f=>f.file_path===d.filePath);return l.jsx(ile,{file:d,comments:h,onAddComment:(f,m,p)=>n(d.filePath,f,m,p),onResolveComment:r,onUnresolveComment:a,readOnly:o},d.filePath)})})}function lle({unresolvedCount:e,onSubmitReview:t,isSubmitting:n,hasExistingReview:r=!1}){const[a,o]=x.useState(""),[c,d]=x.useState(e>0?"changes_requested":"approved"),[h,f]=x.useState(!0),[m,p]=x.useState(!1),[y,v]=x.useState(!1),S=C=>{v(C),C&&d(e>0?"changes_requested":"approved")},N=async()=>{c==="approved"?await t("approved",a||"Approved",!1,m):await t("changes_requested",a,h,!1),v(!1)};return r?l.jsxs(ye,{variant:"outline",disabled:!0,className:"text-emerald-600 border-emerald-600",children:[l.jsx(As,{className:"h-4 w-4 mr-2"}),"Reviewed"]}):l.jsxs(D5,{open:y,onOpenChange:S,children:[l.jsx(k5,{asChild:!0,children:l.jsxs(ye,{className:"bg-emerald-600 hover:bg-emerald-700 text-white",children:["Review changes",l.jsx($r,{className:"h-4 w-4 ml-2"})]})}),l.jsxs(Gw,{className:"w-[400px] p-0",align:"end",children:[l.jsxs("div",{className:"border-b border-border px-4 py-3",children:[l.jsx("h3",{className:"font-semibold text-foreground",children:"Finish your review"}),e>0&&l.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[e," pending comment",e!==1?"s":""," will be submitted"]})]}),l.jsxs("div",{className:"p-4",children:[l.jsx(Mc,{value:a,onChange:C=>o(C.target.value),placeholder:"Leave a comment",className:"min-h-[100px] bg-background border-border text-foreground mb-4",disabled:n}),l.jsxs("div",{className:"space-y-3 mb-4",children:[l.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-2 rounded hover:bg-muted/50",children:[l.jsx("input",{type:"radio",name:"review-decision",value:"approved",checked:c==="approved",onChange:()=>d("approved"),className:"mt-1 text-emerald-600 focus:ring-emerald-500"}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-foreground",children:"Approve"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Submit feedback and approve these changes"})]})]}),l.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-2 rounded hover:bg-muted/50",children:[l.jsx("input",{type:"radio",name:"review-decision",value:"changes_requested",checked:c==="changes_requested",onChange:()=>d("changes_requested"),className:"mt-1 text-orange-600 focus:ring-orange-500"}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-foreground",children:"Request changes"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Submit feedback that must be addressed before merging"})]})]})]}),c==="approved"&&l.jsxs("div",{className:"mb-4 p-3 bg-muted/30 rounded-md border border-border",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"After approval:"}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-sm",children:[l.jsx("input",{type:"radio",name:"merge-strategy",checked:!m,onChange:()=>p(!1),className:"text-emerald-600 focus:ring-emerald-500",disabled:n}),l.jsx(Rw,{className:"h-4 w-4 text-emerald-600"}),l.jsx("span",{className:"text-foreground",children:"Merge to main & cleanup"})]}),l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-sm",children:[l.jsx("input",{type:"radio",name:"merge-strategy",checked:m,onChange:()=>p(!0),className:"text-blue-600 focus:ring-blue-500",disabled:n}),l.jsx(hc,{className:"h-4 w-4 text-blue-600"}),l.jsx("span",{className:"text-foreground",children:"Create GitHub PR"})]})]})]}),c==="changes_requested"&&l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer mb-4 text-sm",children:[l.jsx("input",{type:"checkbox",checked:h,onChange:C=>f(C.target.checked),className:"rounded border-border bg-background text-emerald-600 focus:ring-emerald-500",disabled:n}),l.jsx("span",{className:"text-foreground",children:"Auto-run agent to fix issues"})]})]}),l.jsx("div",{className:"border-t border-border px-4 py-3 bg-muted/30 flex justify-end",children:l.jsx(ye,{onClick:N,disabled:n,className:"bg-emerald-600 hover:bg-emerald-700 text-white",children:n?"Submitting...":"Submit review"})})]})]})}function cle({revisions:e,selectedRevisionId:t,onSelectRevision:n}){return e.length===0?l.jsx("div",{className:"text-center text-muted-foreground py-4",children:"No revisions yet"}):l.jsx("div",{className:"space-y-2",children:e.map(r=>{const a=r.id===t,o=Kw(new Date(r.created_at),{addSuffix:!0});return l.jsxs("button",{onClick:()=>n(r.id),className:`w-full text-left p-3 rounded-lg border transition-colors ${a?"border-primary bg-primary/10":"border-border bg-card hover:border-foreground/20"}`,children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ko,{className:"h-4 w-4 text-muted-foreground"}),l.jsxs("span",{className:"font-medium text-foreground",children:["Revision #",r.number]})]}),l.jsx(kt,{className:`${D0[r.status]} text-white text-xs`,children:R0[r.status]})]}),l.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:o}),r.unresolved_comment_count>0&&l.jsxs("span",{className:"flex items-center gap-1 text-orange-600",children:[l.jsx(el,{className:"h-3 w-3"}),r.unresolved_comment_count," unresolved"]})]})]},r.id)})})}function ule({ticketTitle:e,revisions:t,onRevisionUpdated:n,onClose:r}){const[a,o]=x.useState(t[0]?.id||null),[c,d]=x.useState(null),[h,f]=x.useState([]),[m,p]=x.useState([]),[y,v]=x.useState(!1),[S,N]=x.useState(!1),[C,j]=x.useState(null),E=x.useCallback(async M=>{v(!0);try{const[V,G,F]=await Promise.all([IH(M),BH(M),FH(M)]);d(V),f(G.files),p(F.comments),G.files.length>0&&j(H=>H||G.files[0].path)}catch(V){console.error("Failed to load revision details:",V),me.error("Failed to load revision details")}finally{v(!1)}},[]);x.useEffect(()=>{a&&E(a)},[a,E]);const R=async(M,V,G,F)=>{if(a)try{const H=await zH(a,{file_path:M,line_number:V,body:G,line_content:F});p(P=>[...P,H]),me.success("Comment added")}catch(H){console.error("Failed to add comment:",H),me.error("Failed to add comment")}},A=async M=>{try{const V=await $H(M);p(G=>G.map(F=>F.id===M?V:F)),me.success("Comment resolved")}catch(V){console.error("Failed to resolve comment:",V),me.error("Failed to resolve comment")}},_=async M=>{try{const V=await VH(M);p(G=>G.map(F=>F.id===M?V:F)),me.success("Comment unresolved")}catch(V){console.error("Failed to unresolve comment:",V),me.error("Failed to unresolve comment")}},O=async(M,V,G,F)=>{if(a){N(!0);try{await UH(a,{decision:M,summary:V,auto_run_fix:G,create_pr:F});let H;M==="approved"?F?H="Revision approved! GitHub PR created.":H="Revision approved! Changes merged to main.":H="Changes requested. Agent will re-run to address feedback.",me.success(H),n()}catch(H){console.error("Failed to submit review:",H),me.error("Failed to submit review")}finally{N(!1)}}},T=()=>{a&&E(a),n()},D=m.filter(M=>!M.resolved).length,B=c?.status!==ea.OPEN,W=c?.status===ea.OPEN;return l.jsxs("div",{className:"flex flex-col h-full bg-background text-foreground",children:[l.jsx("div",{className:"flex-shrink-0 border-b border-border px-6 py-3",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[r&&l.jsxs(ye,{variant:"ghost",size:"sm",onClick:r,className:"text-muted-foreground hover:text-foreground",children:[l.jsx(CO,{className:"h-4 w-4 mr-1"}),"Back"]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold",children:e}),c&&l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[l.jsx(Ko,{className:"h-4 w-4 text-muted-foreground"}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:["Revision #",c.number]}),l.jsx(kt,{className:`${D0[c.status]} text-white text-xs`,children:R0[c.status]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[D>0&&l.jsxs("span",{className:"text-sm text-muted-foreground",children:[D," pending comment",D!==1?"s":""]}),l.jsxs(ye,{variant:"ghost",size:"sm",onClick:T,disabled:y,children:[l.jsx(pa,{className:`h-4 w-4 mr-1 ${y?"animate-spin":""}`}),"Refresh"]}),W?l.jsx(lle,{unresolvedCount:D,onSubmitReview:O,isSubmitting:S,hasExistingReview:B}):c?l.jsx(kt,{className:`${D0[c.status]} text-white`,children:R0[c.status]}):null]})]})}),l.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[l.jsxs("div",{className:"w-[220px] flex-shrink-0 border-r border-border flex flex-col overflow-hidden",children:[l.jsxs("div",{className:"p-3 border-b border-border",children:[l.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"Revisions"}),l.jsx(cle,{revisions:t,selectedRevisionId:a,onSelectRevision:o})]}),l.jsxs("div",{className:"flex-1 p-3 overflow-y-auto",children:[l.jsxs("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-2 flex items-center gap-1",children:[l.jsx(Fo,{className:"h-3 w-3"}),"Changed Files"]}),h.length===0?l.jsx("p",{className:"text-xs text-muted-foreground",children:"No files changed"}):l.jsx("div",{className:"space-y-1",children:h.map(M=>{const G=m.filter(F=>F.file_path===M.path).filter(F=>!F.resolved).length;return l.jsxs("button",{onClick:()=>j(M.path),className:`w-full text-left p-2 rounded text-xs transition-colors ${C===M.path?"bg-muted text-foreground":"text-foreground hover:bg-muted/50"}`,children:[l.jsx("div",{className:"truncate font-mono text-[11px]",children:M.path.split("/").pop()}),l.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-[10px]",children:[l.jsxs("span",{className:"text-emerald-600",children:["+",M.additions]}),l.jsxs("span",{className:"text-red-600",children:["-",M.deletions]}),G>0&&l.jsxs("span",{className:"text-orange-600 flex items-center gap-0.5",children:[l.jsx(el,{className:"h-2.5 w-2.5"}),G]})]})]},M.path)})})]})]}),l.jsx("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:y?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(ke,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):l.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:l.jsx(ole,{diffPatch:c?.diff_patch||null,comments:m,onAddComment:R,onResolveComment:A,onUnresolveComment:_,readOnly:!W})})})]})]})}function dle({ticketId:e,conflictStatus:t,pushStatus:n,onResolved:r}){const[a,o]=x.useState(!1),[c,d]=x.useState(!1),[h,f]=x.useState(!1),[m,p]=x.useState(!1),[y,v]=x.useState(!1),[S,N]=x.useState(!1),C=x.useCallback(async()=>{o(!0);try{const D=await n9(e);D.success?(me.success("Rebase completed"),r()):D.has_conflicts?(me.warning("Rebase paused",{description:`Conflicts in ${D.conflicted_files.length} file(s). Resolve and continue.`}),r()):me.error("Rebase failed",{description:D.message})}catch(D){me.error("Rebase failed",{description:D instanceof Error?D.message:"Unknown error"})}finally{o(!1)}},[e,r]),j=x.useCallback(async()=>{d(!0);try{const D=await r9(e);D.success?(me.success("Rebase completed"),r()):D.has_conflicts?(me.warning("More conflicts found",{description:`${D.conflicted_files.length} file(s) still in conflict`}),r()):me.error("Continue failed",{description:D.message})}catch(D){me.error("Continue failed",{description:D instanceof Error?D.message:"Unknown error"})}finally{d(!1)}},[e,r]),E=x.useCallback(async()=>{f(!0);try{const D=await s9(e);D.success?(me.success("Operation aborted"),r()):me.error("Abort failed",{description:D.message})}catch(D){me.error("Abort failed",{description:D instanceof Error?D.message:"Unknown error"})}finally{f(!1)}},[e,r]),R=x.useCallback(async()=>{p(!0);try{const D=await a9(e);D.success?(me.success("Branch pushed to remote"),r()):me.error("Push failed",{description:D.message})}catch(D){me.error("Push failed",{description:D instanceof Error?D.message:"Unknown error"})}finally{p(!1)}},[e,r]),A=x.useCallback(async()=>{v(!0);try{const D=await i9(e);D.success?(me.success("Branch force-pushed to remote"),N(!1),r()):me.error("Force-push failed",{description:D.message})}catch(D){me.error("Force-push failed",{description:D instanceof Error?D.message:"Unknown error"})}finally{v(!1)}},[e,r]),{divergence:_}=t,O=!t.has_conflict&&_&&!_.up_to_date;if(n?.needs_push&&!t.has_conflict)return l.jsxs("div",{className:"rounded-lg border border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/20 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Ew,{className:"h-4 w-4 text-blue-500 mt-0.5 shrink-0"}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-[13px] font-medium text-blue-700 dark:text-blue-300",children:[n.ahead," local commit",n.ahead!==1?"s":""," not pushed"]}),l.jsx("p",{className:"text-[12px] text-blue-600 dark:text-blue-400 mt-1",children:n.remote_exists?"Push to update the remote branch.":"Push to create the remote branch."})]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(ye,{size:"sm",variant:"outline",onClick:R,disabled:m,className:"flex-1",children:[m?l.jsx(ke,{className:"h-3.5 w-3.5 mr-2 animate-spin"}):l.jsx(KK,{className:"h-3.5 w-3.5 mr-2"}),"Push"]}),n.remote_exists&&l.jsx(l.Fragment,{children:S?l.jsxs("div",{className:"flex gap-1",children:[l.jsxs(ye,{size:"sm",variant:"destructive",onClick:A,disabled:y,children:[y?l.jsx(ke,{className:"h-3.5 w-3.5 mr-1 animate-spin"}):null,"Confirm"]}),l.jsx(ye,{size:"sm",variant:"ghost",onClick:()=>N(!1),children:"Cancel"})]}):l.jsx(ye,{size:"sm",variant:"outline",onClick:()=>N(!0),className:"text-amber-600 hover:text-amber-700 border-amber-200",children:"Force Push"})})]})]});if(O)return l.jsxs("div",{className:"rounded-lg border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-900/20 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Cw,{className:"h-4 w-4 text-amber-500 mt-0.5 shrink-0"}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-[13px] font-medium text-amber-700 dark:text-amber-300",children:["Branch is ",_.behind," commit",_.behind!==1?"s":""," behind main"]}),l.jsx("p",{className:"text-[12px] text-amber-600 dark:text-amber-400 mt-1",children:"Rebase to incorporate latest changes before merging."})]})]}),l.jsxs(ye,{size:"sm",variant:"outline",onClick:C,disabled:a,className:"w-full",children:[a?l.jsx(ke,{className:"h-3.5 w-3.5 mr-2 animate-spin"}):l.jsx(Ko,{className:"h-3.5 w-3.5 mr-2"}),"Rebase onto main"]})]});if(!t.has_conflict)return null;const T=t.operation==="rebase"?"Rebase":t.operation==="merge"?"Merge":t.operation==="cherry_pick"?"Cherry-pick":"Operation";return l.jsxs("div",{className:"rounded-lg border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(eo,{className:"h-4 w-4 text-red-500 mt-0.5 shrink-0"}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-[13px] font-medium text-red-700 dark:text-red-300",children:[T," conflict"]}),l.jsxs("p",{className:"text-[12px] text-red-600 dark:text-red-400 mt-1",children:[t.conflicted_files.length," file",t.conflicted_files.length!==1?"s":""," with conflicts"]})]})]}),t.conflicted_files.length>0&&l.jsx("div",{className:"bg-red-100/50 dark:bg-red-900/30 rounded-md p-2 space-y-1",children:t.conflicted_files.map(D=>l.jsxs("div",{className:"flex items-center gap-2 text-[12px]",children:[l.jsx(kW,{className:"h-3 w-3 text-red-400 shrink-0"}),l.jsx("code",{className:"text-red-700 dark:text-red-300 font-mono truncate",children:D})]},D))}),l.jsxs("div",{className:"flex gap-2",children:[t.can_continue&&l.jsxs(ye,{size:"sm",variant:"outline",onClick:j,disabled:c,className:"flex-1",children:[c?l.jsx(ke,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}):l.jsx(MO,{className:"h-3.5 w-3.5 mr-1.5"}),"Continue"]}),t.can_abort&&l.jsxs(ye,{size:"sm",variant:"outline",onClick:E,disabled:h,className:"flex-1 text-red-600 hover:text-red-700 border-red-200",children:[h?l.jsx(ke,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}):l.jsx(Is,{className:"h-3.5 w-3.5 mr-1.5"}),"Abort"]})]})]})}function fle({ticket:e,onPRCreated:t}){const[n,r]=x.useState(!1);if(e.pr_number||!["DONE","REVIEW"].includes(e.state))return null;const a=async()=>{r(!0);try{const o=await c9({ticket_id:e.id,title:e.title,base_branch:"main"});me.success(`PR #${o.pr_number} created successfully`),t?.()}catch(o){me.error(o instanceof Error?o.message:"An unexpected error occurred")}finally{r(!1)}};return l.jsx(ye,{onClick:a,disabled:n,size:"sm",className:"gap-2",children:n?l.jsxs(l.Fragment,{children:[l.jsx(ke,{className:"w-4 h-4 animate-spin"}),"Creating PR..."]}):l.jsxs(l.Fragment,{children:[l.jsx(hc,{className:"w-4 h-4"}),"Create Pull Request"]})})}function hle({ticket:e,onRefresh:t}){const[n,r]=x.useState(!1);if(!e.pr_number)return null;const a=e.pr_state||"OPEN",o={OPEN:{color:"bg-blue-500",label:"Open",icon:hc},CLOSED:{color:"bg-gray-500",label:"Closed",icon:hc},MERGED:{color:"bg-purple-500",label:"Merged",icon:aa}},c=o[a]||o.OPEN,d=c.icon,h=async f=>{f.stopPropagation(),r(!0);try{await u9(e.id),me.success("PR status refreshed"),t?.()}catch(m){me.error(m instanceof Error?m.message:"Could not fetch PR status")}finally{r(!1)}};return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(kt,{className:ue("gap-1.5",c.color,"text-white"),children:[l.jsx(d,{className:"w-3 h-3"}),l.jsxs("span",{children:["PR #",e.pr_number]}),l.jsx("span",{className:"opacity-80",children:"•"}),l.jsx("span",{children:c.label})]}),l.jsx("a",{href:e.pr_url||"#",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700",onClick:f=>f.stopPropagation(),children:l.jsx(Dp,{className:"w-4 h-4"})}),l.jsx(ye,{variant:"ghost",size:"sm",onClick:h,disabled:n,className:"h-6 w-6 p-0",children:l.jsx(pa,{className:ue("w-3 h-3",n&&"animate-spin")})})]})}function rR(e){return new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function mle(e){return e===null?{label:"Not set",color:"text-muted-foreground"}:e>=75?{label:`${e} (High)`,color:"text-red-500"}:e>=50?{label:`${e} (Medium)`,color:"text-amber-500"}:e>=25?{label:`${e} (Low)`,color:"text-yellow-600"}:{label:`${e} (Lowest)`,color:"text-emerald-500"}}function ple(e){return e===null?"":e>=80?hn.P0:e>=60?hn.P1:e>=40?hn.P2:hn.P3}function gle(){const{selectedTicketId:e,clearSelection:t,selectTicket:n}=of(),[r,a]=x.useState(null),[o,c]=x.useState([]),[d,h]=x.useState([]),[f,m]=x.useState([]),[p,y]=x.useState([]),[v,S]=x.useState([]),[N,C]=x.useState(null),[j,E]=x.useState(!1),[R,A]=x.useState(!1),[_,O]=x.useState(!1),[T,D]=x.useState(null),[B,W]=x.useState(!1),[M,V]=x.useState([]),[G,F]=x.useState(""),[H,P]=x.useState(!1),[U,z]=x.useState(""),[te,oe]=x.useState(null),[L,$]=x.useState(!1),[X,Q]=x.useState(null),[q,ce]=x.useState(!1),[ne,xe]=x.useState(!1),[be,De]=x.useState(""),[Ke,we]=x.useState(""),[_e,vt]=x.useState(!1),[en,Pt]=x.useState(!1),vn=x.useRef(null),Hs=x.useRef(null);x.useEffect(()=>{oA().then(V).catch(()=>{})},[]);const Qe=x.useCallback(async fe=>{E(!0),D(null);try{const[Ee,et,En,K,Z,ae,ve,Se]=await Promise.all([EH(fe),NH(fe).catch(()=>({events:[]})),TH(fe).catch(()=>({evidence:[]})),LH(fe).catch(()=>({revisions:[]})),GH(fe).catch(()=>null),M2(fe).catch(()=>({jobs:[]})),_H(fe).catch(()=>[]),t9(fe).catch(()=>null)]);a(Ee),c(et.events),h(En.evidence),m(K.revisions),C(Z),y(ae.jobs),S(ve),Q(Se)}catch(Ee){D(Ee instanceof Error?Ee.message:"Failed to load ticket")}finally{E(!1)}},[]);x.useEffect(()=>{e&&(O(!1),z(""),oe(null),Qe(e))},[e,Qe]);const qn=p.some(fe=>fe.status===Fa.RUNNING||fe.status===Fa.QUEUED);x.useEffect(()=>{if(!qn||!e)return;const fe=setInterval(()=>{M2(e).then(Ee=>y(Ee.jobs)).catch(()=>{}),P2(e).then(oe).catch(()=>{})},5e3);return()=>clearInterval(fe)},[qn,e]),x.useEffect(()=>{e&&qn&&P2(e).then(oe).catch(()=>{})},[e,qn]);const{currentBoard:va}=ys(),{data:Bt,dataUpdatedAt:Wn}=ow(va?.id,!1),Nt=x.useMemo(()=>Bt?.columns?Bt.columns.flatMap(fe=>fe.tickets.map(Ee=>Ee.id)):[],[Bt]);x.useEffect(()=>{if(!e||Nt.length===0)return;const fe=Ee=>{const et=Ee.target.tagName;if(et==="INPUT"||et==="TEXTAREA"||et==="SELECT")return;const En=Nt.indexOf(e);En!==-1&&(Ee.key==="j"&&En<Nt.length-1?(Ee.preventDefault(),n(Nt[En+1])):Ee.key==="k"&&En>0?(Ee.preventDefault(),n(Nt[En-1])):Ee.key==="Escape"&&(Ee.preventDefault(),t()))};return window.addEventListener("keydown",fe),()=>window.removeEventListener("keydown",fe)},[e,Nt,n,t]);const[yr,qr]=x.useState(0);x.useEffect(()=>{if(Wn&&Wn!==yr&&yr!==0&&e&&Bt?.columns)for(const fe of Bt.columns){const Ee=fe.tickets.find(et=>et.id===e);if(Ee&&r&&Ee.state!==r.state){Qe(e);break}}qr(Wn??0)},[Wn,e,Bt,r,Qe,yr]);const vr=x.useMemo(()=>{const fe=[];return o.forEach(Ee=>fe.push({id:Ee.id,type:"event",timestamp:Ee.created_at,data:Ee})),p.forEach(Ee=>fe.push({id:Ee.id,type:"job",timestamp:Ee.created_at,data:Ee})),fe.sort((Ee,et)=>new Date(et.timestamp).getTime()-new Date(Ee.timestamp).getTime()),fe},[o,p]),mn=x.useCallback(async()=>{if(r)try{await cm(r.id,{to_state:it.PLANNED,actor_type:oc.HUMAN}),me.success("Ticket accepted"),Qe(r.id)}catch(fe){me.error("Failed to accept ticket",{description:fe instanceof Error?fe.message:"Unknown error"})}},[r,Qe]),jn=x.useCallback(async()=>{if(r)try{await cm(r.id,{to_state:it.PLANNED,actor_type:oc.HUMAN}),me.success("Ticket unblocked"),Qe(r.id)}catch(fe){me.error("Failed to unblock ticket",{description:fe instanceof Error?fe.message:"Unknown error"})}},[r,Qe]),rr=x.useCallback(async()=>{if(r){W(!0);try{await cA(r.id,G||void 0),me.success("Execution started"),Qe(r.id)}catch(fe){me.error("Failed to start execution",{description:fe instanceof Error?fe.message:"Unknown error"})}finally{W(!1)}}},[r,G,Qe]),ba=x.useCallback(async()=>{if(!(!r||!U.trim())){$(!0);try{const fe=await ZH(r.id,U.trim());oe(fe),z(""),me.success("Follow-up queued",{description:"Will execute after current job completes"})}catch(fe){me.error("Failed to queue follow-up",{description:fe instanceof Error?fe.message:"Unknown error"})}finally{$(!1)}}},[r,U]),sr=x.useCallback(async()=>{if(r)try{const fe=await e9(r.id);oe(fe),me.success("Queued message cancelled")}catch{}},[r]),bs=x.useCallback(async()=>{if(r)try{await cm(r.id,{to_state:it.ABANDONED,actor_type:oc.HUMAN,reason:"Abandoned by user"}),me.success("Ticket abandoned"),Qe(r.id)}catch(fe){me.error("Failed to abandon ticket",{description:fe instanceof Error?fe.message:"Unknown error"})}},[r,Qe]),At=x.useCallback(async()=>{if(r){A(!0);try{const fe=await HH(r.id,{strategy:mQ.MERGE,delete_worktree:!0,cleanup_artifacts:!0});fe.success?(me.success(fe.pull_warning?"Merge successful (with warning)":"Merge successful!",{description:fe.pull_warning||fe.message}),Qe(r.id)):me.error("Merge failed",{description:fe.message})}catch(fe){me.error("Merge failed",{description:fe instanceof Error?fe.message:"Unknown error"})}finally{A(!1)}}},[r,Qe]),Cn=x.useCallback(fe=>{n(fe)},[n]),tn=x.useCallback(()=>{r&&Qe(r.id)},[r,Qe]),Ka=x.useCallback(()=>{r&&(De(r.title),ce(!0),setTimeout(()=>vn.current?.focus(),0))},[r]),Wr=x.useCallback(()=>{ce(!1),De("")},[]),Bn=x.useCallback(async()=>{if(!(!r||!be.trim())){if(be.trim()===r.title){Wr();return}vt(!0);try{await Iy(r.id,{title:be.trim()}),me.success("Title updated"),ce(!1),Qe(r.id)}catch(fe){me.error("Failed to update title",{description:fe instanceof Error?fe.message:"Unknown error"})}finally{vt(!1)}}},[r,be,Wr,Qe]),ar=x.useCallback(()=>{r&&(we(r.description||""),xe(!0),setTimeout(()=>Hs.current?.focus(),0))},[r]),ir=x.useCallback(()=>{xe(!1),we("")},[]),or=x.useCallback(async()=>{if(!r)return;const fe=Ke.trim()||null;if(fe===(r.description||null)){ir();return}Pt(!0);try{await Iy(r.id,{description:fe}),me.success("Description updated"),xe(!1),Qe(r.id)}catch(Ee){me.error("Failed to update description",{description:Ee instanceof Error?Ee.message:"Unknown error"})}finally{Pt(!1)}},[r,Ke,ir,Qe]),lr=x.useCallback(async fe=>{if(!r)return;const Ee=fe?Rd[fe]:null;if(Ee!==r.priority)try{await Iy(r.id,{priority:Ee}),me.success("Priority updated",{description:fe?pQ[fe]:"Priority cleared"}),Qe(r.id)}catch(et){me.error("Failed to update priority",{description:et instanceof Error?et.message:"Unknown error"})}},[r,Qe]);if(x.useEffect(()=>{ce(!1),xe(!1)},[e]),!e)return null;if(j&&!r)return l.jsx("div",{className:"h-full overflow-y-auto p-6",children:l.jsx(Aie,{})});if(T)return l.jsx("div",{className:"h-full flex items-center justify-center p-6",children:l.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[l.jsx(Hn,{className:"h-6 w-6 text-destructive"}),l.jsx("p",{className:"text-sm text-destructive",children:T})]})});if(!r)return null;const Ge=mle(r.priority),Tt=r&&(r.state===it.NEEDS_HUMAN||r.state===it.DONE||r.state===it.VERIFYING),zt=[it.PLANNED,it.BLOCKED].includes(r.state),Ut=[it.PROPOSED,it.PLANNED,it.NEEDS_HUMAN,it.BLOCKED].includes(r.state);return l.jsxs(l.Fragment,{children:[_&&f.length>0&&l.jsx("div",{className:"fixed inset-0 z-50 bg-background",children:l.jsx(ule,{ticketId:r.id,ticketTitle:r.title,revisions:f,onRevisionUpdated:tn,onClose:()=>O(!1)})}),l.jsxs("div",{className:"h-full overflow-y-auto border-l border-border bg-background",children:[l.jsxs("div",{className:"sticky top-0 z-10 bg-background border-b border-border/40 px-6 py-4",children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[q?l.jsxs("div",{className:"flex-1 pr-4 space-y-2",children:[l.jsx(Ln,{ref:vn,value:be,onChange:fe=>De(fe.target.value),onKeyDown:fe=>{fe.key==="Enter"?(fe.preventDefault(),Bn()):fe.key==="Escape"&&(fe.preventDefault(),Wr())},disabled:_e,className:"text-[15px] font-semibold",placeholder:"Ticket title"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(ye,{size:"sm",variant:"default",onClick:Bn,disabled:_e||!be.trim(),className:"h-7 px-2 text-[12px]",children:[_e?l.jsx(ke,{className:"h-3 w-3 animate-spin mr-1"}):l.jsx(qt,{className:"h-3 w-3 mr-1"}),"Save"]}),l.jsx(ye,{size:"sm",variant:"ghost",onClick:Wr,disabled:_e,className:"h-7 px-2 text-[12px]",children:"Cancel"})]})]}):l.jsxs("div",{className:"flex items-start gap-1.5 group pr-4",children:[l.jsx("h2",{className:"text-[15px] leading-relaxed font-semibold text-foreground",children:r.title}),l.jsx("button",{onClick:Ka,className:"mt-1 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",title:"Edit title",children:l.jsx(E0,{className:"h-3.5 w-3.5"})})]}),l.jsx(ye,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 flex-shrink-0",onClick:t,children:l.jsx(On,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex items-center gap-3 mt-3",children:[l.jsx(hle,{ticket:r,onRefresh:()=>Qe(r.id)}),l.jsx(fle,{ticket:r,onPRCreated:()=>Qe(r.id)})]})]}),l.jsxs("div",{className:"px-6 py-6 space-y-10",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 group",children:[l.jsx("h3",{className:"section-label",children:"Description"}),!ne&&l.jsx("button",{onClick:ar,className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",title:"Edit description",children:l.jsx(E0,{className:"h-3 w-3"})})]}),ne?l.jsxs("div",{className:"space-y-2",children:[l.jsx(Mc,{ref:Hs,value:Ke,onChange:fe=>we(fe.target.value),onKeyDown:fe=>{fe.key==="Escape"&&(fe.preventDefault(),ir()),fe.key==="Enter"&&(fe.metaKey||fe.ctrlKey)&&(fe.preventDefault(),or())},disabled:en,className:"text-[13px] leading-relaxed min-h-[80px]",placeholder:"Add a description..."}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(ye,{size:"sm",variant:"default",onClick:or,disabled:en,className:"h-7 px-2 text-[12px]",children:[en?l.jsx(ke,{className:"h-3 w-3 animate-spin mr-1"}):l.jsx(qt,{className:"h-3 w-3 mr-1"}),"Save"]}),l.jsx(ye,{size:"sm",variant:"ghost",onClick:ir,disabled:en,className:"h-7 px-2 text-[12px]",children:"Cancel"}),l.jsx("span",{className:"text-[11px] text-muted-foreground ml-auto",children:"Ctrl+Enter to save"})]})]}):l.jsx("p",{className:"text-[13px] leading-relaxed text-foreground cursor-pointer hover:bg-muted/50 rounded-md px-2 py-1 -mx-2 -my-1 transition-colors",onClick:ar,children:r.description||l.jsx("span",{className:"text-muted-foreground italic",children:"No description provided -- click to add"})})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"section-label",children:"State"}),l.jsx("p",{className:"text-[13px] text-foreground",children:Rr[r.state]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"section-label",children:"Priority"}),l.jsxs(ms,{value:ple(r.priority)||"none",onValueChange:fe=>lr(fe==="none"?"":fe),children:[l.jsx(gs,{size:"sm",className:"h-8 text-[13px] w-full",children:l.jsx(ps,{children:l.jsx("span",{className:ue("font-medium",Ge.color),children:Ge.label})})}),l.jsxs(zs,{children:[l.jsx(Vt,{value:"none",children:l.jsx("span",{className:"text-muted-foreground",children:"Not set"})}),l.jsx(Vt,{value:hn.P0,children:l.jsx("span",{className:"text-red-500 font-medium",children:"P0 - Critical (90)"})}),l.jsx(Vt,{value:hn.P1,children:l.jsx("span",{className:"text-orange-500 font-medium",children:"P1 - High (70)"})}),l.jsx(Vt,{value:hn.P2,children:l.jsx("span",{className:"text-blue-500 font-medium",children:"P2 - Medium (50)"})}),l.jsx(Vt,{value:hn.P3,children:l.jsx("span",{className:"text-slate-500 font-medium",children:"P3 - Low (30)"})})]})]})]})]}),r.state===it.PROPOSED&&l.jsx("div",{className:"space-y-3",children:l.jsxs(ye,{onClick:mn,className:"w-full",variant:"default",children:[l.jsx(qt,{className:"h-4 w-4 mr-2"}),"Accept"]})}),r.state===it.BLOCKED&&l.jsx("div",{className:"space-y-3",children:l.jsxs(ye,{onClick:jn,className:"w-full",variant:"outline",children:[l.jsx(Ed,{className:"h-4 w-4 mr-2"}),"Unblock"]})}),(zt||qn)&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("h3",{className:"section-label flex items-center gap-2",children:[l.jsx(ia,{className:"h-3.5 w-3.5"}),"Agent Actions"]}),zt&&!qn&&l.jsxs("div",{className:"space-y-3",children:[M.length>1&&l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>P(!H),className:"flex items-center gap-1.5 text-[12px] text-muted-foreground hover:text-foreground transition-colors",children:[l.jsx($r,{className:ue("h-3 w-3 transition-transform",H&&"rotate-180")}),G?`Profile: ${G}`:"Default executor profile"]}),H&&l.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[l.jsx("button",{onClick:()=>{F(""),P(!1)},className:ue("px-2.5 py-1 rounded-md text-[12px] border transition-colors",G?"border-border hover:border-foreground/50":"bg-foreground text-background border-foreground"),children:"Default"}),M.map(fe=>l.jsxs("button",{onClick:()=>{F(fe.name),P(!1)},className:ue("px-2.5 py-1 rounded-md text-[12px] border transition-colors",G===fe.name?"bg-foreground text-background border-foreground":"border-border hover:border-foreground/50"),children:[fe.name,l.jsx("span",{className:"ml-1 text-[10px] opacity-60",children:fe.executor_type})]},fe.name))]})]}),l.jsxs(ye,{onClick:rr,disabled:B,className:"w-full",children:[B?l.jsx(ke,{className:"h-4 w-4 mr-2 animate-spin"}):l.jsx(ia,{className:"h-4 w-4 mr-2"}),"Execute",G?` (${G})`:""]})]}),qn&&r.state===it.EXECUTING&&l.jsxs("div",{className:"space-y-3",children:[te?.status==="queued"&&te.message&&l.jsxs("div",{className:"bg-violet-50 dark:bg-violet-900/20 rounded-lg p-3 space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[11px] font-medium text-violet-600 dark:text-violet-400 uppercase tracking-wide",children:"Queued follow-up"}),l.jsx("button",{onClick:sr,className:"text-[11px] text-muted-foreground hover:text-destructive transition-colors",children:"Cancel"})]}),l.jsx("p",{className:"text-[12px] text-foreground leading-relaxed",children:te.message})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("div",{className:"flex-1 relative",children:[l.jsx(lK,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"}),l.jsx("input",{type:"text",placeholder:"Queue next instruction...",value:U,onChange:fe=>z(fe.target.value),onKeyDown:fe=>{fe.key==="Enter"&&!fe.shiftKey&&U.trim()&&(fe.preventDefault(),ba())},className:"w-full rounded-md border border-border bg-background pl-9 pr-3 py-2 text-[13px] placeholder:text-muted-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring"})]}),l.jsx(ye,{size:"sm",onClick:ba,disabled:L||!U.trim(),className:"h-[38px] px-3",children:L?l.jsx(ke,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(AK,{className:"h-3.5 w-3.5"})})]}),l.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Queue the next instruction while the agent is working. It will auto-execute when done."})]})]}),(r.blocked_by_ticket_id||v.length>0)&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("h3",{className:"section-label flex items-center gap-2",children:[l.jsx(Ko,{className:"h-3.5 w-3.5"}),"Dependencies"]}),r.blocked_by_ticket_id&&l.jsx("div",{className:"bg-amber-50 dark:bg-amber-900/20 rounded-lg p-3 space-y-2",children:l.jsx(n3,{blockedByTicketId:r.blocked_by_ticket_id,blockedByTicketTitle:r.blocked_by_ticket_title,onNavigateToBlocker:Cn})}),v.length>0&&l.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-3 space-y-1.5",children:v.map(fe=>l.jsxs("button",{className:"w-full text-left text-[12px] flex items-center gap-2 p-2 rounded hover:bg-blue-100 dark:hover:bg-blue-900/40 transition-colors",onClick:()=>Cn(fe.id),children:[l.jsx(Ed,{className:"h-3 w-3 flex-shrink-0 text-blue-600 dark:text-blue-400"}),l.jsx("span",{className:"flex-1 truncate text-foreground",children:fe.title}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:Rr[fe.state]})]},fe.id))})]}),Tt&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("h3",{className:"section-label flex items-center gap-2",children:[l.jsx(hc,{className:"h-3.5 w-3.5"}),"Code Changes"]}),f.length>0?l.jsxs("div",{className:"space-y-3",children:[l.jsxs("p",{className:"text-[13px] text-muted-foreground",children:[f.length," revision",f.length!==1?"s":""," available.",f[0]&&f[0].unresolved_comment_count>0&&l.jsxs("span",{className:"text-orange-500 ml-1",children:["(",f[0].unresolved_comment_count," unresolved comment",f[0].unresolved_comment_count!==1?"s":"",")"]})]}),l.jsxs(ye,{onClick:()=>O(!0),className:"w-full",variant:"outline",children:[l.jsx(Dp,{className:"h-4 w-4 mr-2"}),"Review Changes"]})]}):l.jsx(fd,{icon:hc,title:"No revisions yet",compact:!0})]}),N&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("h3",{className:"section-label flex items-center gap-2",children:[l.jsx(j0,{className:"h-3.5 w-3.5"}),"Worktree & Merge"]}),N.is_merged?l.jsxs("div",{className:"flex items-center gap-2 text-emerald-500",children:[l.jsx(qt,{className:"h-4 w-4"}),l.jsx("span",{className:"text-[13px] font-medium",children:"Merged to main"})]}):N.workspace?l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"bg-muted/50 rounded-lg p-3 space-y-2",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx("span",{className:"text-[11px] text-muted-foreground min-w-[60px]",children:"Branch:"}),l.jsx("code",{className:"text-[12px] text-foreground font-mono",children:String(N.workspace.branch_name??"")})]})}),X&&(X.has_conflict||X.divergence&&!X.divergence.up_to_date)&&l.jsx(dle,{ticketId:r.id,conflictStatus:X,onResolved:()=>Qe(r.id)}),N.can_merge&&l.jsxs(ye,{onClick:At,disabled:R,className:"w-full",variant:"default",children:[R?l.jsx(ke,{className:"h-4 w-4 mr-2 animate-spin"}):l.jsx(Rw,{className:"h-4 w-4 mr-2"}),"Merge to Main"]})]}):l.jsx(fd,{icon:j0,title:"No active worktree",compact:!0})]}),Ut&&l.jsx("div",{className:"space-y-3",children:l.jsxs($o,{children:[l.jsx(AQ,{asChild:!0,children:l.jsxs(ye,{variant:"destructive",className:"w-full",size:"sm",children:[l.jsx(sW,{className:"h-4 w-4 mr-2"}),"Abandon Ticket"]})}),l.jsxs(Di,{children:[l.jsxs(ki,{children:[l.jsx(Oi,{children:"Abandon this ticket?"}),l.jsx(Mi,{children:"This will mark the ticket as abandoned. Any associated worktree will be cleaned up. This action cannot be easily undone."})]}),l.jsxs(Ai,{children:[l.jsx(Li,{children:"Cancel"}),l.jsx(Pi,{onClick:bs,className:Op({variant:"destructive"}),children:"Abandon"})]})]})]})}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("h3",{className:"section-label flex items-center gap-2",children:[l.jsx(id,{className:"h-3.5 w-3.5"}),"Agent Activity",p.some(fe=>fe.status===Fa.RUNNING)&&l.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-emerald-400 font-medium uppercase tracking-wide",children:[l.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-emerald-500"})]}),"Live"]})]}),l.jsx(Vie,{ticketId:r.id})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("h3",{className:"section-label flex items-center gap-2",children:[l.jsx(_O,{className:"h-3.5 w-3.5"}),"Verification Evidence"]}),l.jsx(kie,{evidence:d})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("h3",{className:"section-label flex items-center gap-2",children:[l.jsx(id,{className:"h-3.5 w-3.5"}),"Activity Timeline",l.jsxs("span",{className:"text-[10px] text-muted-foreground font-normal",children:[vr.length," event",vr.length!==1?"s":""]})]}),vr.length===0?l.jsx(fd,{icon:id,title:"No activity recorded",compact:!0}):l.jsx("div",{className:"space-y-1",children:vr.map(fe=>{if(fe.type==="event"){const et=fe.data;return l.jsxs("div",{className:"border-l-2 border-border/50 pl-4 py-2 space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[12px] font-medium capitalize text-foreground",children:et.event_type}),l.jsx("span",{className:"text-[11px] text-muted-foreground",children:rR(et.created_at)})]}),et.event_type===hQ.TRANSITIONED&&et.from_state&&et.to_state&&l.jsxs("div",{className:"flex items-center gap-2 text-[12px]",children:[l.jsx("span",{className:"text-muted-foreground",children:Rr[et.from_state]}),l.jsx(Tp,{className:"h-3 w-3 text-muted-foreground/60"}),l.jsx("span",{className:"text-foreground font-medium",children:Rr[et.to_state]})]}),et.reason&&l.jsx("p",{className:"text-[12px] text-muted-foreground leading-relaxed",children:et.reason})]},fe.id)}const Ee=fe.data;return l.jsxs("div",{className:ue("border-l-2 pl-4 py-2 space-y-1",Ee.status===Fa.SUCCEEDED?"border-emerald-300":Ee.status===Fa.FAILED?"border-red-300":Ee.status===Fa.RUNNING?"border-blue-300":"border-border/50"),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-[12px] font-medium text-foreground capitalize flex items-center gap-1.5",children:[Ee.status===Fa.RUNNING&&l.jsx(ke,{className:"h-3 w-3 animate-spin text-blue-500"}),Ee.status===Fa.SUCCEEDED&&l.jsx(qt,{className:"h-3 w-3 text-emerald-500"}),Ee.status===Fa.FAILED&&l.jsx(Hn,{className:"h-3 w-3 text-red-500"}),Ee.kind," job"]}),l.jsx("span",{className:"text-[11px] text-muted-foreground",children:rR(Ee.created_at)})]}),Ee.error_message&&l.jsx("p",{className:"text-[11px] text-red-500 leading-relaxed truncate",children:Ee.error_message})]},fe.id)})})]}),l.jsxs("div",{className:"text-[11px] text-muted-foreground text-center py-2 border-t border-border/30",children:[l.jsx("kbd",{className:"px-1 py-0.5 rounded border bg-muted text-[10px]",children:"j"}),l.jsx("span",{className:"mx-1",children:"/"}),l.jsx("kbd",{className:"px-1 py-0.5 rounded border bg-muted text-[10px]",children:"k"}),l.jsx("span",{className:"ml-1",children:"navigate tickets"}),l.jsx("span",{className:"mx-2",children:"·"}),l.jsx("kbd",{className:"px-1 py-0.5 rounded border bg-muted text-[10px]",children:"esc"}),l.jsx("span",{className:"ml-1",children:"close"})]})]})]})]})}function Sv(){const{selectedTicketId:e,detailDrawerOpen:t,selectTicket:n}=of(),{boardId:r,ticketId:a}=WR(),{setCurrentBoardId:o}=lw();return x.useEffect(()=>{r&&o(r)},[r,o]),x.useEffect(()=>{a&&!e&&n(a)},[a,e,n]),t&&!!e?l.jsxs("div",{className:"flex gap-0 min-h-[calc(100vh-120px)]",children:[l.jsx("div",{className:"flex-1 min-w-0 overflow-x-auto",children:l.jsx(w_,{})}),l.jsx("div",{className:"w-[420px] flex-shrink-0 border-l border-border",children:l.jsx(gle,{})})]}):l.jsx(w_,{})}function xle(){return l.jsx("div",{className:"max-w-4xl mx-auto",children:l.jsx(x5,{})})}var Nv="rovingFocusGroup.onEntryFocus",yle={bubbles:!1,cancelable:!0},df="RovingFocusGroup",[eb,p3,vle]=uw(df),[ble,g3]=vs(df,[vle]),[wle,Sle]=ble(df),x3=x.forwardRef((e,t)=>l.jsx(eb.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(eb.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Nle,{...e,ref:t})})}));x3.displayName=df;var Nle=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:h,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...p}=e,y=x.useRef(null),v=rt(t,y),S=hp(o),[N,C]=ma({prop:c,defaultProp:d??null,onChange:h,caller:df}),[j,E]=x.useState(!1),R=Vi(f),A=p3(n),_=x.useRef(!1),[O,T]=x.useState(0);return x.useEffect(()=>{const D=y.current;if(D)return D.addEventListener(Nv,R),()=>D.removeEventListener(Nv,R)},[R]),l.jsx(wle,{scope:n,orientation:r,dir:S,loop:a,currentTabStopId:N,onItemFocus:x.useCallback(D=>C(D),[C]),onItemShiftTab:x.useCallback(()=>E(!0),[]),onFocusableItemAdd:x.useCallback(()=>T(D=>D+1),[]),onFocusableItemRemove:x.useCallback(()=>T(D=>D-1),[]),children:l.jsx(He.div,{tabIndex:j||O===0?-1:0,"data-orientation":r,...p,ref:v,style:{outline:"none",...e.style},onMouseDown:Ue(e.onMouseDown,()=>{_.current=!0}),onFocus:Ue(e.onFocus,D=>{const B=!_.current;if(D.target===D.currentTarget&&B&&!j){const W=new CustomEvent(Nv,yle);if(D.currentTarget.dispatchEvent(W),!W.defaultPrevented){const M=A().filter(P=>P.focusable),V=M.find(P=>P.active),G=M.find(P=>P.id===N),H=[V,G,...M].filter(Boolean).map(P=>P.ref.current);b3(H,m)}}_.current=!1}),onBlur:Ue(e.onBlur,()=>E(!1))})})}),y3="RovingFocusGroupItem",v3=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,children:c,...d}=e,h=Un(),f=o||h,m=Sle(y3,n),p=m.currentTabStopId===f,y=p3(n),{onFocusableItemAdd:v,onFocusableItemRemove:S,currentTabStopId:N}=m;return x.useEffect(()=>{if(r)return v(),()=>S()},[r,v,S]),l.jsx(eb.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:l.jsx(He.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...d,ref:t,onMouseDown:Ue(e.onMouseDown,C=>{r?m.onItemFocus(f):C.preventDefault()}),onFocus:Ue(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Ue(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){m.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const j=Ele(C,m.orientation,m.dir);if(j!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let R=y().filter(A=>A.focusable).map(A=>A.ref.current);if(j==="last")R.reverse();else if(j==="prev"||j==="next"){j==="prev"&&R.reverse();const A=R.indexOf(C.currentTarget);R=m.loop?Tle(R,A+1):R.slice(A+1)}setTimeout(()=>b3(R))}}),children:typeof c=="function"?c({isCurrentTabStop:p,hasTabStop:N!=null}):c})})});v3.displayName=y3;var jle={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cle(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ele(e,t,n){const r=Cle(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return jle[r]}function b3(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Tle(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _le=x3,Rle=v3,Xp="Tabs",[Dle]=vs(Xp,[g3]),w3=g3(),[kle,E1]=Dle(Xp),S3=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:c="horizontal",dir:d,activationMode:h="automatic",...f}=e,m=hp(d),[p,y]=ma({prop:r,onChange:a,defaultProp:o??"",caller:Xp});return l.jsx(kle,{scope:n,baseId:Un(),value:p,onValueChange:y,orientation:c,dir:m,activationMode:h,children:l.jsx(He.div,{dir:m,"data-orientation":c,...f,ref:t})})});S3.displayName=Xp;var N3="TabsList",j3=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,o=E1(N3,n),c=w3(n);return l.jsx(_le,{asChild:!0,...c,orientation:o.orientation,dir:o.dir,loop:r,children:l.jsx(He.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});j3.displayName=N3;var C3="TabsTrigger",E3=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,c=E1(C3,n),d=w3(n),h=R3(c.baseId,r),f=D3(c.baseId,r),m=r===c.value;return l.jsx(Rle,{asChild:!0,...d,focusable:!a,active:m,children:l.jsx(He.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:h,...o,ref:t,onMouseDown:Ue(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?c.onValueChange(r):p.preventDefault()}),onKeyDown:Ue(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&c.onValueChange(r)}),onFocus:Ue(e.onFocus,()=>{const p=c.activationMode!=="manual";!m&&!a&&p&&c.onValueChange(r)})})})});E3.displayName=C3;var T3="TabsContent",_3=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:o,...c}=e,d=E1(T3,n),h=R3(d.baseId,r),f=D3(d.baseId,r),m=r===d.value,p=x.useRef(m);return x.useEffect(()=>{const y=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(y)},[]),l.jsx(ya,{present:a||m,children:({present:y})=>l.jsx(He.div,{"data-state":m?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":h,hidden:!y,id:f,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:y&&o})})});_3.displayName=T3;function R3(e,t){return`${e}-trigger-${t}`}function D3(e,t){return`${e}-content-${t}`}var Ale=S3,k3=j3,A3=E3,O3=_3;const Ole=Ale,M3=x.forwardRef(({className:e,...t},n)=>l.jsx(k3,{ref:n,className:ue("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));M3.displayName=k3.displayName;const Qu=x.forwardRef(({className:e,...t},n)=>l.jsx(A3,{ref:n,className:ue("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Qu.displayName=A3.displayName;const Ju=x.forwardRef(({className:e,...t},n)=>l.jsx(O3,{ref:n,className:ue("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ju.displayName=O3.displayName;const P3={vscode:{name:"VS Code",protocol:"vscode://",fileTemplate:"vscode://file{path}",lineTemplate:"vscode://file{path}:{line}"},cursor:{name:"Cursor",protocol:"cursor://",fileTemplate:"cursor://file{path}",lineTemplate:"cursor://file{path}:{line}"},default:{name:"System Default",protocol:"file://",fileTemplate:"file://{path}",lineTemplate:"file://{path}"}};let T1="vscode";function Mle(e){T1=e,typeof window<"u"&&localStorage.setItem("draft_preferred_editor",e)}function Ple(){return T1}function Lle(){return Object.entries(P3).map(([e,t])=>({type:e,name:t.name}))}function Ile(){if(typeof window>"u")return;const e=localStorage.getItem("draft_preferred_editor");e&&e in P3&&(T1=e)}typeof window<"u"&&Ile();var Ble=Symbol("radix.slottable");function zle(e){const t=({children:n})=>l.jsx(l.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ble,t}var[Qp]=vs("Tooltip",[Dc]),Jp=Dc(),L3="TooltipProvider",Fle=700,tb="tooltip.open",[$le,_1]=Qp(L3),I3=e=>{const{__scopeTooltip:t,delayDuration:n=Fle,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:o}=e,c=x.useRef(!0),d=x.useRef(!1),h=x.useRef(0);return x.useEffect(()=>{const f=h.current;return()=>window.clearTimeout(f)},[]),l.jsx($le,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(h.current),c.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:x.useCallback(f=>{d.current=f},[]),disableHoverableContent:a,children:o})};I3.displayName=L3;var Fd="Tooltip",[Vle,ff]=Qp(Fd),B3=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:o,disableHoverableContent:c,delayDuration:d}=e,h=_1(Fd,e.__scopeTooltip),f=Jp(t),[m,p]=x.useState(null),y=Un(),v=x.useRef(0),S=c??h.disableHoverableContent,N=d??h.delayDuration,C=x.useRef(!1),[j,E]=ma({prop:r,defaultProp:a??!1,onChange:T=>{T?(h.onOpen(),document.dispatchEvent(new CustomEvent(tb))):h.onClose(),o?.(T)},caller:Fd}),R=x.useMemo(()=>j?C.current?"delayed-open":"instant-open":"closed",[j]),A=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,C.current=!1,E(!0)},[E]),_=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,E(!1)},[E]),O=x.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{C.current=!0,E(!0),v.current=0},N)},[N,E]);return x.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),l.jsx(bw,{...f,children:l.jsx(Vle,{scope:t,contentId:y,open:j,stateAttribute:R,trigger:m,onTriggerChange:p,onTriggerEnter:x.useCallback(()=>{h.isOpenDelayedRef.current?O():A()},[h.isOpenDelayedRef,O,A]),onTriggerLeave:x.useCallback(()=>{S?_():(window.clearTimeout(v.current),v.current=0)},[_,S]),onOpen:A,onClose:_,disableHoverableContent:S,children:n})})};B3.displayName=Fd;var nb="TooltipTrigger",z3=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=ff(nb,n),o=_1(nb,n),c=Jp(n),d=x.useRef(null),h=rt(t,d,a.onTriggerChange),f=x.useRef(!1),m=x.useRef(!1),p=x.useCallback(()=>f.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),l.jsx(bp,{asChild:!0,...c,children:l.jsx(He.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:h,onPointerMove:Ue(e.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),m.current=!0)}),onPointerLeave:Ue(e.onPointerLeave,()=>{a.onTriggerLeave(),m.current=!1}),onPointerDown:Ue(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ue(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Ue(e.onBlur,a.onClose),onClick:Ue(e.onClick,a.onClose)})})});z3.displayName=nb;var R1="TooltipPortal",[Ule,Hle]=Qp(R1,{forceMount:void 0}),F3=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,o=ff(R1,t);return l.jsx(Ule,{scope:t,forceMount:n,children:l.jsx(ya,{present:n||o.open,children:l.jsx(ef,{asChild:!0,container:a,children:r})})})};F3.displayName=R1;var vc="TooltipContent",$3=x.forwardRef((e,t)=>{const n=Hle(vc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...o}=e,c=ff(vc,e.__scopeTooltip);return l.jsx(ya,{present:r||c.open,children:c.disableHoverableContent?l.jsx(V3,{side:a,...o,ref:t}):l.jsx(Gle,{side:a,...o,ref:t})})}),Gle=x.forwardRef((e,t)=>{const n=ff(vc,e.__scopeTooltip),r=_1(vc,e.__scopeTooltip),a=x.useRef(null),o=rt(t,a),[c,d]=x.useState(null),{trigger:h,onClose:f}=n,m=a.current,{onPointerInTransitChange:p}=r,y=x.useCallback(()=>{d(null),p(!1)},[p]),v=x.useCallback((S,N)=>{const C=S.currentTarget,j={x:S.clientX,y:S.clientY},E=Xle(j,C.getBoundingClientRect()),R=Qle(j,E),A=Jle(N.getBoundingClientRect()),_=ece([...R,...A]);d(_),p(!0)},[p]);return x.useEffect(()=>()=>y(),[y]),x.useEffect(()=>{if(h&&m){const S=C=>v(C,m),N=C=>v(C,h);return h.addEventListener("pointerleave",S),m.addEventListener("pointerleave",N),()=>{h.removeEventListener("pointerleave",S),m.removeEventListener("pointerleave",N)}}},[h,m,v,y]),x.useEffect(()=>{if(c){const S=N=>{const C=N.target,j={x:N.clientX,y:N.clientY},E=h?.contains(C)||m?.contains(C),R=!Zle(j,c);E?y():R&&(y(),f())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[h,m,c,f,y]),l.jsx(V3,{...e,ref:o})}),[qle,Wle]=Qp(Fd,{isInside:!1}),Kle=zle("TooltipContent"),V3=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:c,...d}=e,h=ff(vc,n),f=Jp(n),{onClose:m}=h;return x.useEffect(()=>(document.addEventListener(tb,m),()=>document.removeEventListener(tb,m)),[m]),x.useEffect(()=>{if(h.trigger){const p=y=>{y.target?.contains(h.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[h.trigger,m]),l.jsx(Jd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:p=>p.preventDefault(),onDismiss:m,children:l.jsxs(ww,{"data-state":h.stateAttribute,...f,...d,ref:t,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Kle,{children:r}),l.jsx(qle,{scope:n,isInside:!0,children:l.jsx(TG,{id:h.contentId,role:"tooltip",children:a||r})})]})})});$3.displayName=vc;var U3="TooltipArrow",Yle=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Jp(n);return Wle(U3,n).isInside?null:l.jsx(Sw,{...a,...r,ref:t})});Yle.displayName=U3;function Xle(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,a,o)){case o:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Qle(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Jle(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function Zle(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,c=t.length-1;o<t.length;c=o++){const d=t[o],h=t[c],f=d.x,m=d.y,p=h.x,y=h.y;m>r!=y>r&&n<(p-f)*(r-m)/(y-m)+f&&(a=!a)}return a}function ece(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),tce(t)}function tce(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const o=t[t.length-1],c=t[t.length-2];if((o.x-c.x)*(a.y-c.y)>=(o.y-c.y)*(a.x-c.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const o=n[n.length-1],c=n[n.length-2];if((o.x-c.x)*(a.y-c.y)>=(o.y-c.y)*(a.x-c.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var nce=I3,rce=B3,sce=z3,ace=F3,H3=$3;const ice=nce,oce=rce,lce=sce,G3=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(ace,{children:l.jsx(H3,{ref:r,sideOffset:t,className:ue("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));G3.displayName=H3.displayName;const sR={claude:l.jsx(kr,{className:"h-4 w-4"}),cursor:l.jsx(kr,{className:"h-4 w-4"}),amp:l.jsx(hs,{className:"h-4 w-4"}),aider:l.jsx(kr,{className:"h-4 w-4"}),gemini:l.jsx(kr,{className:"h-4 w-4"}),codex:l.jsx(kr,{className:"h-4 w-4"})};function jv({enabled:e,label:t,icon:n}){return l.jsx(ice,{children:l.jsxs(oce,{children:[l.jsx(lce,{asChild:!0,children:l.jsxs(kt,{variant:e?"default":"outline",className:ue("text-xs gap-1",!e&&"opacity-50"),children:[n,e?l.jsx(qt,{className:"h-3 w-3"}):l.jsx(On,{className:"h-3 w-3"})]})}),l.jsx(G3,{children:l.jsxs("p",{children:[t,": ",e?"Supported":"Not supported"]})})]})})}function cce({agent:e}){return l.jsxs("div",{className:"mt-2 p-3 bg-muted/50 rounded-lg space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(kt,{variant:e.available?"default":"destructive",children:e.available?"Available":"Not Installed"}),l.jsx("span",{className:"text-muted-foreground",children:e.description})]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsx(jv,{enabled:e.supports_yolo,label:"Auto Mode (YOLO)",icon:l.jsx(hs,{className:"h-3 w-3"})}),l.jsx(jv,{enabled:e.supports_session_resume,label:"Session Resume",icon:l.jsx(el,{className:"h-3 w-3"})}),l.jsx(jv,{enabled:e.supports_mcp,label:"MCP Support",icon:l.jsx(wK,{className:"h-3 w-3"})})]}),(e.cost_per_1k_input||e.cost_per_1k_output)&&l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(Rp,{className:"h-3 w-3"}),l.jsxs("span",{children:["$",e.cost_per_1k_input?.toFixed(3)||"?","/1K in, $",e.cost_per_1k_output?.toFixed(3)||"?","/1K out"]})]})]})}function uce({value:e,onChange:t,disabled:n=!1,className:r,showDetails:a=!1}){const[o,c]=x.useState([]),[d,h]=x.useState("claude"),[f,m]=x.useState(!0),[p,y]=x.useState(null);x.useEffect(()=>{(async()=>{try{const N=await o9();c(N.agents),h(N.default_agent),!e&&N.default_agent&&t(N.default_agent)}catch(N){console.error("Failed to load agents:",N),y("Failed to load agents")}finally{m(!1)}})()},[]);const v=o.find(S=>S.type===e);return f?l.jsx(ms,{disabled:!0,children:l.jsx(gs,{className:r,children:l.jsx(ps,{placeholder:"Loading agents..."})})}):p?l.jsx("div",{className:"text-sm text-red-500",children:p}):l.jsxs("div",{className:"space-y-2",children:[l.jsxs(ms,{value:e||d,onValueChange:t,disabled:n,children:[l.jsx(gs,{className:ue("w-full",r),children:l.jsx(ps,{placeholder:"Select an AI agent",children:v&&l.jsxs("div",{className:"flex items-center gap-2",children:[sR[v.type]||l.jsx(kr,{className:"h-4 w-4"}),l.jsx("span",{children:v.name}),!v.available&&l.jsx(kt,{variant:"outline",className:"ml-auto text-xs",children:"Not installed"})]})})}),l.jsx(zs,{children:o.map(S=>l.jsx(Vt,{value:S.type,disabled:!S.available,children:l.jsxs("div",{className:"flex items-center gap-2 w-full",children:[sR[S.type]||l.jsx(kr,{className:"h-4 w-4"}),l.jsx("span",{children:S.name}),!S.available&&l.jsx(kt,{variant:"outline",className:"ml-auto text-xs opacity-50",children:"Not installed"}),S.available&&S.supports_yolo&&l.jsx(hs,{className:"h-3 w-3 text-amber-500 ml-auto"})]})},S.type))})]}),a&&v&&l.jsx(cce,{agent:v})]})}const dce={success:[{frequency:523.25,duration:100,type:"sine",volume:.3},{frequency:659.25,duration:100,type:"sine",volume:.3},{frequency:783.99,duration:200,type:"sine",volume:.3}],error:[{frequency:220,duration:150,type:"sawtooth",volume:.2},{frequency:207.65,duration:300,type:"sawtooth",volume:.2}],warning:[{frequency:440,duration:100,type:"triangle",volume:.25},{frequency:440,duration:100,type:"triangle",volume:.25},{frequency:440,duration:100,type:"triangle",volume:.25}],notification:[{frequency:880,duration:100,type:"sine",volume:.2},{frequency:1108.73,duration:150,type:"sine",volume:.2}],start:[{frequency:392,duration:80,type:"sine",volume:.2},{frequency:523.25,duration:100,type:"sine",volume:.2}]};let Cv=null,q3=!0,W3=.5;function K3(){return Cv||(Cv=new(window.AudioContext||window.webkitAudioContext)),Cv}async function fce(e,t){const n=K3(),r=n.createOscillator(),a=n.createGain();r.connect(a),a.connect(n.destination),r.type=e.type,r.frequency.setValueAtTime(e.frequency,t);const o=e.volume*W3;a.gain.setValueAtTime(0,t),a.gain.linearRampToValueAtTime(o,t+.01),a.gain.exponentialRampToValueAtTime(.001,t+e.duration/1e3),r.start(t),r.stop(t+e.duration/1e3)}async function bc(e){if(q3)try{const t=K3();t.state==="suspended"&&await t.resume();const n=dce[e];let r=t.currentTime;for(const a of n)await fce(a,r),r+=a.duration/1e3+.05}catch(t){console.warn("Failed to play sound:",t)}}function hce(){if(typeof window>"u")return;const e=localStorage.getItem("draft_sound_enabled");e!==null&&(q3=e==="true");const t=localStorage.getItem("draft_volume");t!==null&&(W3=parseFloat(t))}typeof window<"u"&&hce();const Ev={daily:10,weekly:50,monthly:150,warningThreshold:80,pauseOnExceed:!1};function mce(){if(typeof window>"u")return Ev;const e=localStorage.getItem("draft_budget");if(e)try{return JSON.parse(e)}catch{return Ev}return Ev}function pce(e){typeof window<"u"&&localStorage.setItem("draft_budget",JSON.stringify(e))}function gce({editor:e,onEditorChange:t}){return l.jsxs(Vr,{children:[l.jsxs(Ur,{children:[l.jsxs(Hr,{className:"section-header flex items-center gap-2",children:[l.jsx(jW,{className:"h-5 w-5"}),"Editor Integration"]}),l.jsx(Wa,{children:"Choose how files open when clicking on diffs or file paths"})]}),l.jsx(Gr,{className:"space-y-4",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx(ct,{children:"Preferred Editor"}),l.jsxs(ms,{value:e,onValueChange:t,children:[l.jsx(gs,{children:l.jsx(ps,{})}),l.jsx(zs,{children:Lle().map(n=>l.jsx(Vt,{value:n.type,children:n.name},n.type))})]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Files will open in ",e==="vscode"?"VS Code":e==="cursor"?"Cursor":"your system default"]})]})})]})}function xce({defaultAgent:e,onAgentChange:t}){return l.jsxs(Vr,{children:[l.jsxs(Ur,{children:[l.jsxs(Hr,{className:"section-header flex items-center gap-2",children:[l.jsx(kr,{className:"h-5 w-5"}),"AI Agent"]}),l.jsx(Wa,{children:"Configure your default AI coding agent"})]}),l.jsx(Gr,{className:"space-y-4",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx(ct,{children:"Default Agent"}),l.jsx(uce,{value:e,onChange:t,showDetails:!0})]})})]})}function yce(){const{currentBoard:e}=ys(),t=e?.id,[n,r]=x.useState([]),[a,o]=x.useState(!0),[c,d]=x.useState(!1),[h,f]=x.useState(!1);x.useEffect(()=>{oA(t).then(S=>r(S)).catch(()=>{}).finally(()=>o(!1))},[t]);const m=()=>{r(S=>[...S,{name:"",executor_type:"claude",timeout:600,extra_flags:[],model:null,env:{}}]),f(!0)},p=S=>{r(N=>N.filter((C,j)=>j!==S)),f(!0)},y=(S,N,C)=>{r(j=>j.map((E,R)=>R===S?{...E,[N]:C}:E)),f(!0)},v=async()=>{d(!0);try{const S=await fH(n.filter(N=>N.name.trim()),t);r(S),f(!1),bc("success")}catch{}finally{d(!1)}};return l.jsxs(Vr,{children:[l.jsx(Ur,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsxs(Hr,{className:"section-header flex items-center gap-2",children:[l.jsx(od,{className:"h-5 w-5"}),"Executor Profiles"]}),l.jsx(Wa,{children:"Named execution strategies (e.g. fast, thorough) with per-profile settings"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[h&&l.jsxs(ye,{size:"sm",onClick:v,disabled:c,children:[c?l.jsx(ke,{className:"h-3 w-3 mr-1 animate-spin"}):l.jsx(nf,{className:"h-3 w-3 mr-1"}),"Save"]}),l.jsxs(ye,{size:"sm",variant:"outline",onClick:m,children:[l.jsx(ld,{className:"h-3 w-3 mr-1"}),"Add Profile"]})]})]})}),l.jsx(Gr,{className:"space-y-3",children:a?l.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[l.jsx(ke,{className:"h-4 w-4 animate-spin"}),"Loading profiles..."]}):n.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:'No profiles configured. Add a profile to create execution strategies like "fast" (Haiku, 5min timeout) or "thorough" (Opus, 20min timeout).'}):n.map((S,N)=>l.jsxs("div",{className:"border rounded-lg p-3 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(DO,{className:"h-4 w-4 text-muted-foreground"}),l.jsx(Ln,{placeholder:"Profile name (e.g. fast)",value:S.name,onChange:C=>y(N,"name",C.target.value),className:"flex-1 h-8 text-sm"}),l.jsxs(ms,{value:S.executor_type,onValueChange:C=>y(N,"executor_type",C),children:[l.jsx(gs,{className:"w-[130px] h-8 text-sm",children:l.jsx(ps,{})}),l.jsxs(zs,{children:[l.jsx(Vt,{value:"claude",children:"Claude"}),l.jsx(Vt,{value:"codex",children:"Codex"}),l.jsx(Vt,{value:"gemini",children:"Gemini"}),l.jsx(Vt,{value:"cursor",children:"Cursor"}),l.jsx(Vt,{value:"cursor-agent",children:"Cursor Agent"}),l.jsx(Vt,{value:"amp",children:"Amp"}),l.jsx(Vt,{value:"droid",children:"Droid"}),l.jsx(Vt,{value:"opencode",children:"OpenCode"})]})]}),l.jsx(ye,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:()=>p(N),children:l.jsx(Gi,{className:"h-3.5 w-3.5"})})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(ct,{className:"text-xs",children:"Timeout (seconds)"}),l.jsx(Ln,{type:"number",value:S.timeout,onChange:C=>y(N,"timeout",parseInt(C.target.value)||600),className:"h-8 text-sm",min:60,step:60})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(ct,{className:"text-xs",children:"Model override"}),l.jsx(Ln,{placeholder:"e.g. claude-haiku-4-5-20251001",value:S.model||"",onChange:C=>y(N,"model",C.target.value||""),className:"h-8 text-sm"})]})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(ct,{className:"text-xs",children:"Extra CLI flags (comma-separated)"}),l.jsx(Ln,{placeholder:"e.g. --model, claude-haiku-4-5-20251001",value:(S.extra_flags||[]).join(", "),onChange:C=>y(N,"extra_flags",C.target.value.split(",").map(j=>j.trim()).filter(Boolean)),className:"h-8 text-sm font-mono"})]})]},N))})]})}function vce({budget:e,onBudgetChange:t}){return l.jsxs(Vr,{children:[l.jsxs(Ur,{children:[l.jsxs(Hr,{className:"section-header flex items-center gap-2",children:[l.jsx(Rp,{className:"h-5 w-5"}),"Cost Budget"]}),l.jsx(Wa,{children:"Set spending limits for AI agent usage"})]}),l.jsxs(Gr,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ct,{children:"Daily Budget"}),l.jsxs("div",{className:"relative",children:[l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:"$"}),l.jsx(Ln,{type:"number",value:e.daily,onChange:n=>t("daily",parseFloat(n.target.value)||0),className:"pl-7",min:0,step:1})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ct,{children:"Weekly Budget"}),l.jsxs("div",{className:"relative",children:[l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:"$"}),l.jsx(Ln,{type:"number",value:e.weekly,onChange:n=>t("weekly",parseFloat(n.target.value)||0),className:"pl-7",min:0,step:5})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ct,{children:"Monthly Budget"}),l.jsxs("div",{className:"relative",children:[l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:"$"}),l.jsx(Ln,{type:"number",value:e.monthly,onChange:n=>t("monthly",parseFloat(n.target.value)||0),className:"pl-7",min:0,step:10})]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ct,{children:"Warning Threshold"}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(Uw,{value:[e.warningThreshold],onValueChange:n=>t("warningThreshold",n[0]),max:100,step:5,className:"flex-1"}),l.jsxs("span",{className:"text-sm text-muted-foreground w-12",children:[e.warningThreshold,"%"]})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Show warning when spending reaches this % of budget"})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx(ct,{htmlFor:"pause-toggle",children:"Pause on Budget Exceed"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Stop automated execution when budget is exceeded"})]}),l.jsx(Pn,{id:"pause-toggle",checked:e.pauseOnExceed,onCheckedChange:n=>t("pauseOnExceed",n)})]})]})]})}function bce(){return l.jsxs(Vr,{children:[l.jsxs(Ur,{children:[l.jsxs(Hr,{className:"section-header flex items-center gap-2",children:[l.jsx(C0,{className:"h-5 w-5"}),"Keyboard Shortcuts"]}),l.jsx(Wa,{children:"Navigate and interact faster with keyboard shortcuts"})]}),l.jsx(Gr,{children:l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Press ",l.jsx(kt,{variant:"outline",className:"font-mono mx-1",children:"?"}),"anywhere in the app to view all keyboard shortcuts."]})})]})}function wce(){const{openWalkthrough:e,resetWalkthrough:t}=y5();return l.jsxs(Vr,{children:[l.jsxs(Ur,{children:[l.jsxs(Hr,{className:"section-header flex items-center gap-2",children:[l.jsx(Pm,{className:"h-5 w-5"}),"Welcome Tutorial"]}),l.jsx(Wa,{children:"Replay the welcome walkthrough or reset your tutorial progress"})]}),l.jsxs(Gr,{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:"Replay Walkthrough"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"View the step-by-step guide again"})]}),l.jsxs(ye,{variant:"outline",size:"sm",onClick:e,children:[l.jsx(Pm,{className:"h-4 w-4 mr-2"}),"Start Tutorial"]})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:"Reset Progress"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Mark walkthrough as not completed (will auto-open on next load)"})]}),l.jsx(ye,{variant:"outline",size:"sm",onClick:()=>{t(),bc("success")},children:"Reset"})]})]})]})}const Tv=[{label:"Anthropic Claude Sonnet 4.5",value:"anthropic/claude-sonnet-4-5-20250929",provider:"anthropic",description:"Claude Sonnet 4.5 via direct Anthropic API"},{label:"Anthropic Claude Haiku 4.5",value:"anthropic/claude-haiku-4-5-20251001",provider:"anthropic",description:"Fast and cost-effective via direct Anthropic API"},{label:"AWS Bedrock — Claude Sonnet 4.5",value:"bedrock/anthropic.claude-sonnet-4-5-20250929-v1:0",provider:"bedrock",description:"Claude Sonnet 4.5 via AWS Bedrock"},{label:"AWS Bedrock — Claude Haiku 4.5",value:"bedrock/anthropic.claude-haiku-4-5-20251001-v1:0",provider:"bedrock",description:"Claude Haiku 4.5 via AWS Bedrock"},{label:"OpenAI GPT-4o",value:"gpt-4o",provider:"openai",description:"OpenAI's flagship model"},{label:"OpenAI GPT-4o Mini",value:"gpt-4o-mini",provider:"openai",description:"Fast and affordable"}];function Sce(e){return e==="cli/claude"||e.startsWith("cli/")?"cli":e.startsWith("anthropic/")?"anthropic":e.startsWith("bedrock/")?"bedrock":e.startsWith("gpt")?"openai":"custom"}function Nce(e){switch(e){case"anthropic":return"Set ANTHROPIC_API_KEY in backend/.env";case"openai":return"Set OPENAI_API_KEY in backend/.env";case"bedrock":return"Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in backend/.env";default:return"Set the appropriate API key for your model provider in backend/.env"}}function jce({onDirty:e}){const{currentBoard:t}=ys(),n=t?.id,[r,a]=x.useState(""),[o,c]=x.useState(""),[d,h]=x.useState("claude"),[f,m]=x.useState(null),[p,y]=x.useState(!1),[v,S]=x.useState(!1),[N,C]=x.useState(!1),j=r.startsWith("cli/");x.useEffect(()=>{pH(n).then(D=>{a(D.model),c(D.agent_path),D.preferred_executor&&h(D.preferred_executor),C(!0)}).catch(D=>{console.error("Failed to load planner config:",D),C(!0)})},[n]),x.useEffect(()=>{N&&r&&O2(n).then(m).catch(()=>m({status:"offline",model:r,error:"Failed to connect"}))},[N,n]);const E=x.useCallback(async()=>{y(!0),m(null);try{const D=await O2(n);m(D)}catch(D){m({status:"offline",model:r,error:String(D)})}finally{y(!1)}},[r,n]),R=x.useCallback(async()=>{S(!0);try{const D=await gH({model:r,agent_path:o},n);a(D.model),c(D.agent_path),bc("success"),E()}catch(D){console.error("Failed to save planner config:",D)}finally{S(!1)}},[r,o,n,E]),A=x.useCallback(D=>{a(D?`cli/${d}`:Tv[0].value),m(null),e?.()},[e,d]),_=Sce(r),O=Tv.find(D=>D.value===r),T=!!O;return N?l.jsxs(Vr,{children:[l.jsxs(Ur,{children:[l.jsxs(Hr,{className:"section-header flex items-center gap-2",children:[l.jsx(od,{className:"h-5 w-5"}),"Planner LLM"]}),l.jsx(Wa,{children:"Configure the LLM used for ticket generation, follow-ups, and reflections"})]}),l.jsxs(Gr,{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx(ct,{htmlFor:"same-as-executor",children:"Same as executor"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use the same CLI agent (",d,") as your execution agent"]})]}),l.jsx(Pn,{id:"same-as-executor",checked:j,onCheckedChange:A})]}),j?l.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[p?l.jsxs(kt,{variant:"outline",children:[l.jsx(ke,{className:"h-3 w-3 mr-1 animate-spin"}),"Checking..."]}):f?.status==="online"?l.jsxs(kt,{variant:"default",children:[l.jsx(aa,{className:"h-3 w-3 mr-1"}),"Available"]}):f?.status==="offline"?l.jsxs(kt,{variant:"destructive",children:[l.jsx(Is,{className:"h-3 w-3 mr-1"}),"Not Installed"]}):l.jsxs(kt,{variant:"outline",children:[l.jsx(ke,{className:"h-3 w-3 mr-1 animate-spin"}),"Checking..."]}),l.jsxs("span",{className:"text-muted-foreground",children:["Uses the same ",d," CLI as ticket execution — no extra API key needed"]})]}),f?.status==="offline"&&l.jsxs("div",{className:"mt-1 p-2 bg-background rounded border text-sm space-y-1",children:[l.jsxs("p",{className:"font-medium flex items-center gap-1 text-xs",children:[l.jsx(Bs,{className:"h-3.5 w-3.5"}),"Setup required"]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Install Claude Code CLI or turn off this toggle to use an API model instead."})]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ct,{children:"LLM Model"}),l.jsxs(ms,{value:T?r:"__custom__",onValueChange:D=>{D!=="__custom__"&&(a(D),e?.())},children:[l.jsx(gs,{children:l.jsx(ps,{placeholder:"Select a model",children:O&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(od,{className:"h-4 w-4"}),l.jsx("span",{children:O.label})]})})}),l.jsxs(zs,{children:[Tv.map(D=>l.jsx(Vt,{value:D.value,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(od,{className:"h-4 w-4"}),l.jsx("span",{children:D.label})]})},D.value)),l.jsx(Vt,{value:"__custom__",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Td,{className:"h-4 w-4"}),l.jsx("span",{children:"Custom model..."})]})})]})]}),!T&&l.jsx(Ln,{placeholder:"e.g., bedrock/arn:aws:bedrock:us-east-2:...",value:r,onChange:D=>{a(D.target.value),e?.()}})]}),l.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[p?l.jsxs(kt,{variant:"outline",children:[l.jsx(ke,{className:"h-3 w-3 mr-1 animate-spin"}),"Checking..."]}):f?.status==="online"?l.jsxs(kt,{variant:"default",children:[l.jsx(aa,{className:"h-3 w-3 mr-1"}),"Available"]}):f?.status==="offline"?l.jsxs(kt,{variant:"destructive",children:[l.jsx(Is,{className:"h-3 w-3 mr-1"}),"Not Connected"]}):l.jsxs(kt,{variant:"outline",children:[l.jsx(ke,{className:"h-3 w-3 mr-1 animate-spin"}),"Checking..."]}),l.jsx("span",{className:"text-muted-foreground",children:O?.description??`Custom model via ${_}`})]}),f?.status==="offline"&&l.jsxs("div",{className:"mt-1 p-2 bg-background rounded border text-sm space-y-1",children:[l.jsxs("p",{className:"font-medium flex items-center gap-1 text-xs",children:[l.jsx(Bs,{className:"h-3.5 w-3.5"}),"Setup required"]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[Nce(_),". Then restart the backend."]}),f.error&&l.jsx("p",{className:"text-xs text-muted-foreground font-mono break-all",children:f.error.slice(0,150)})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(ye,{size:"sm",variant:"outline",onClick:E,disabled:p,children:[p?l.jsx(ke,{className:"h-4 w-4 mr-2 animate-spin"}):l.jsx(aa,{className:"h-4 w-4 mr-2"}),"Test Connection"]}),l.jsxs(ye,{size:"sm",onClick:R,disabled:v,children:[v?l.jsx(ke,{className:"h-4 w-4 mr-2 animate-spin"}):l.jsx(nf,{className:"h-4 w-4 mr-2"}),"Save"]})]})]})]}):null}function Cce(){const{currentBoard:e}=ys(),[t,n]=x.useState([]),[r,a]=x.useState(!0),[o,c]=x.useState(!1),[d,h]=x.useState("");x.useEffect(()=>{e?.id&&aA(e.id).then(v=>{const S=v.config?.verify_config?.commands||[];n(S)}).catch(()=>{}).finally(()=>a(!1))},[e?.id]);const f=x.useCallback(async()=>{if(e?.id){c(!0);try{await iA(e.id,{config:{verify_config:{commands:t}}}),bc("success")}catch{}finally{c(!1)}}},[e?.id,t]),m=()=>{d.trim()&&(n(v=>[...v,d.trim()]),h(""))},p=v=>{n(S=>S.filter((N,C)=>C!==v))},y=(v,S)=>{n(N=>{const C=[...N],[j]=C.splice(v,1);return C.splice(S,0,j),C})};return l.jsxs(Vr,{children:[l.jsxs(Ur,{children:[l.jsxs(Hr,{className:"section-header flex items-center gap-2",children:[l.jsx(la,{className:"h-5 w-5"}),"Verification Commands"]}),l.jsx(Wa,{children:"Commands run after each agent execution to verify the changes. They run sequentially in the ticket's worktree."})]}),l.jsx(Gr,{className:"space-y-4",children:r?l.jsx("div",{className:"flex items-center justify-center py-4",children:l.jsx(ke,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):l.jsxs(l.Fragment,{children:[t.length===0?l.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No verification commands configured. Add commands to automatically verify agent changes."}):l.jsx("div",{className:"space-y-2",children:t.map((v,S)=>l.jsxs("div",{className:"flex items-center gap-2 group",children:[l.jsx("div",{className:"flex flex-col gap-0.5",children:l.jsx("button",{onClick:()=>S>0&&y(S,S-1),disabled:S===0,className:"text-muted-foreground/50 hover:text-muted-foreground disabled:opacity-30 transition-colors",children:l.jsx(DO,{className:"h-3 w-3"})})}),l.jsx("code",{className:"flex-1 text-sm font-mono bg-muted/50 rounded px-3 py-2 text-foreground",children:v}),l.jsx("button",{onClick:()=>p(S),className:"opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all",children:l.jsx(Gi,{className:"h-3.5 w-3.5"})})]},S))}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Ln,{value:d,onChange:v=>h(v.target.value),placeholder:"e.g., npm test, pytest -q, make lint",className:"font-mono text-sm",onKeyDown:v=>{v.key==="Enter"&&d.trim()&&(v.preventDefault(),m())}}),l.jsx(ye,{size:"sm",variant:"outline",onClick:m,disabled:!d.trim(),children:l.jsx(ld,{className:"h-4 w-4"})})]}),l.jsxs(ye,{size:"sm",onClick:f,disabled:o,children:[o?l.jsx(ke,{className:"h-4 w-4 mr-2 animate-spin"}):l.jsx(nf,{className:"h-4 w-4 mr-2"}),"Save Commands"]})]})})]})}function Ece(){const[e]=P6(),t=e.get("tab")||"general",[n,r]=x.useState(Ple()),[a,o]=x.useState(()=>localStorage.getItem("draft_default_agent")??"claude"),[c,d]=x.useState(mce),[h,f]=x.useState(!1),[m,p]=x.useState(!1),[y,v]=x.useState(null),[S,N]=x.useState(!0),[C,j]=x.useState(!0),[E,R]=x.useState(!0),A=async()=>{p(!0),v(null);try{const D=await WH({dry_run:S,delete_worktrees:C,delete_evidence:E});v(D),D.dry_run?me.info("Dry run complete",{description:"No files were actually deleted. Review the results below."}):(me.success("Cleanup complete",{description:`Deleted ${D.worktrees_deleted} worktree(s) and ${D.evidence_files_deleted} evidence file(s).`}),bc("success"))}catch(D){me.error("Cleanup failed",{description:D instanceof Error?D.message:"Unknown error"})}finally{p(!1)}},_=D=>{r(D),Mle(D),f(!0)},O=(D,B)=>{d(W=>({...W,[D]:B})),f(!0)},T=()=>{pce(c),typeof window<"u"&&localStorage.setItem("draft_default_agent",a),f(!1),bc("success")};return l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{children:[l.jsxs("h1",{className:"page-title flex items-center gap-2",children:[l.jsx(Td,{className:"h-5 w-5"}),"Settings"]}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Configure Draft to match your workflow"})]}),h&&l.jsxs(ye,{onClick:T,children:[l.jsx(nf,{className:"h-4 w-4 mr-2"}),"Save Changes"]})]}),l.jsxs(Ole,{defaultValue:t,children:[l.jsxs(M3,{children:[l.jsx(Qu,{value:"general",children:"General"}),l.jsx(Qu,{value:"executors",children:"Executors"}),l.jsx(Qu,{value:"budget",children:"Budget"}),l.jsx(Qu,{value:"maintenance",children:"Maintenance"})]}),l.jsxs(Ju,{value:"general",className:"space-y-6 mt-4",children:[l.jsx(gce,{editor:n,onEditorChange:_}),l.jsx(bce,{}),l.jsx(wce,{})]}),l.jsxs(Ju,{value:"executors",className:"space-y-6 mt-4",children:[l.jsx(xce,{defaultAgent:a,onAgentChange:D=>{o(D),f(!0)}}),l.jsx(yce,{}),l.jsx(Cce,{}),l.jsx(jce,{onDirty:()=>f(!0)})]}),l.jsx(Ju,{value:"budget",className:"space-y-6 mt-4",children:l.jsx(vce,{budget:c,onBudgetChange:O})}),l.jsx(Ju,{value:"maintenance",className:"space-y-6 mt-4",children:l.jsxs(Vr,{children:[l.jsxs(Ur,{children:[l.jsxs(Hr,{className:"section-header flex items-center gap-2",children:[l.jsx(BO,{className:"h-4 w-4"}),"Cleanup"]}),l.jsx(Wa,{children:"Remove stale worktrees and old evidence files to free up disk space."})]}),l.jsxs(Gr,{className:"space-y-5",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(ct,{htmlFor:"cleanup-dry-run",className:"flex flex-col gap-1",children:[l.jsx("span",{className:"text-sm font-medium",children:"Dry run"}),l.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Preview what would be deleted without actually deleting"})]}),l.jsx(Pn,{id:"cleanup-dry-run",checked:S,onCheckedChange:N})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(ct,{htmlFor:"cleanup-worktrees",className:"flex flex-col gap-1",children:[l.jsxs("span",{className:"text-sm font-medium flex items-center gap-1.5",children:[l.jsx(j0,{className:"h-3.5 w-3.5"}),"Delete stale worktrees"]}),l.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Remove worktrees for tickets in terminal states"})]}),l.jsx(Pn,{id:"cleanup-worktrees",checked:C,onCheckedChange:j})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(ct,{htmlFor:"cleanup-evidence",className:"flex flex-col gap-1",children:[l.jsxs("span",{className:"text-sm font-medium flex items-center gap-1.5",children:[l.jsx(WW,{className:"h-3.5 w-3.5"}),"Delete old evidence"]}),l.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Remove orphaned evidence files from completed jobs"})]}),l.jsx(Pn,{id:"cleanup-evidence",checked:E,onCheckedChange:R})]})]}),l.jsxs(ye,{onClick:A,disabled:m||!C&&!E,variant:S?"outline":"destructive",className:"w-full",children:[m?l.jsx(ke,{className:"h-4 w-4 mr-2 animate-spin"}):l.jsx(Gi,{className:"h-4 w-4 mr-2"}),S?"Preview Cleanup":"Run Cleanup"]}),y&&l.jsxs("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h4",{className:"text-sm font-medium",children:y.dry_run?"Dry Run Results":"Cleanup Results"}),y.dry_run&&l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-amber-600 dark:text-amber-400 font-medium bg-amber-100 dark:bg-amber-900/30 px-1.5 py-0.5 rounded",children:"Preview"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-muted-foreground text-xs",children:"Worktrees deleted"}),l.jsx("p",{className:"font-medium",children:y.worktrees_deleted})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-muted-foreground text-xs",children:"Worktrees failed"}),l.jsx("p",{className:"font-medium",children:y.worktrees_failed})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-muted-foreground text-xs",children:"Worktrees skipped"}),l.jsx("p",{className:"font-medium",children:y.worktrees_skipped})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-muted-foreground text-xs",children:"Evidence files deleted"}),l.jsx("p",{className:"font-medium",children:y.evidence_files_deleted})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-muted-foreground text-xs",children:"Evidence files failed"}),l.jsx("p",{className:"font-medium",children:y.evidence_files_failed})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-muted-foreground text-xs",children:"Disk space freed"}),l.jsx("p",{className:"font-medium",children:y.bytes_freed>=1048576?`${(y.bytes_freed/1048576).toFixed(1)} MB`:y.bytes_freed>=1024?`${(y.bytes_freed/1024).toFixed(1)} KB`:`${y.bytes_freed} bytes`})]})]}),y.details.length>0&&l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"Details"}),l.jsx("div",{className:"max-h-40 overflow-y-auto rounded bg-background border p-2 space-y-0.5",children:y.details.map((D,B)=>l.jsx("p",{className:"text-xs text-foreground font-mono",children:D},B))})]})]})]})]})})]})]})}const Tce=_6([{path:"/",element:l.jsx(y9,{children:l.jsx(ite,{})}),children:[{index:!0,element:l.jsx(Sv,{})},{path:"boards/:boardId",element:l.jsx(Sv,{})},{path:"boards/:boardId/tickets/:ticketId",element:l.jsx(Sv,{})},{path:"boards/:boardId/dashboard",element:l.jsx(xle,{})},{path:"settings",element:l.jsx(Ece,{})},{path:"*",element:l.jsx(t6,{to:"/",replace:!0})}]}]),Ye=e=>typeof e=="string",qu=()=>{let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n},aR=e=>e==null?"":""+e,_ce=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Rce=/###/g,iR=e=>e&&e.indexOf("###")>-1?e.replace(Rce,"."):e,oR=e=>!e||Ye(e),hd=(e,t,n)=>{const r=Ye(t)?t.split("."):t;let a=0;for(;a<r.length-1;){if(oR(e))return{};const o=iR(r[a]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++a}return oR(e)?{}:{obj:e,k:iR(r[a])}},lR=(e,t,n)=>{const{obj:r,k:a}=hd(e,t,Object);if(r!==void 0||t.length===1){r[a]=n;return}let o=t[t.length-1],c=t.slice(0,t.length-1),d=hd(e,c,Object);for(;d.obj===void 0&&c.length;)o=`${c[c.length-1]}.${o}`,c=c.slice(0,c.length-1),d=hd(e,c,Object),d?.obj&&typeof d.obj[`${d.k}.${o}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${o}`]=n},Dce=(e,t,n,r)=>{const{obj:a,k:o}=hd(e,t,Object);a[o]=a[o]||[],a[o].push(n)},Jm=(e,t)=>{const{obj:n,k:r}=hd(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},kce=(e,t,n)=>{const r=Jm(e,n);return r!==void 0?r:Jm(t,n)},Y3=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Ye(e[r])||e[r]instanceof String||Ye(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Y3(e[r],t[r],n):e[r]=t[r]);return e},Do=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Ace={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Oce=e=>Ye(e)?e.replace(/[&<>"'\/]/g,t=>Ace[t]):e;class Mce{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const Pce=[" ",",","?","!",";"],Lce=new Mce(20),Ice=(e,t,n)=>{t=t||"",n=n||"";const r=Pce.filter(c=>t.indexOf(c)<0&&n.indexOf(c)<0);if(r.length===0)return!0;const a=Lce.getRegExp(`(${r.map(c=>c==="?"?"\\?":c).join("|")})`);let o=!a.test(e);if(!o){const c=e.indexOf(n);c>0&&!a.test(e.substring(0,c))&&(o=!0)}return o},rb=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let a=e;for(let o=0;o<r.length;){if(!a||typeof a!="object")return;let c,d="";for(let h=o;h<r.length;++h)if(h!==o&&(d+=n),d+=r[h],c=a[d],c!==void 0){if(["string","number","boolean"].indexOf(typeof c)>-1&&h<r.length-1)continue;o+=h-o+1;break}a=c}return a},$d=e=>e?.replace("_","-"),Bce={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class Zm{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Bce,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,a){return a&&!this.debug?null:(Ye(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Zm(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Zm(this.logger,t)}}var ta=new Zm;class Zp{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([a,o])=>{for(let c=0;c<o;c++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,o])=>{for(let c=0;c<o;c++)a.apply(a,[t,...n])})}}class cR extends Zp{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,a={}){const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;t.indexOf(".")>-1?d=t.split("."):(d=[t,n],r&&(Array.isArray(r)?d.push(...r):Ye(r)&&o?d.push(...r.split(o)):d.push(r)));const h=Jm(this.data,d);return!h&&!n&&!r&&t.indexOf(".")>-1&&(t=d[0],n=d[1],r=d.slice(2).join(".")),h||!c||!Ye(r)?h:rb(this.data?.[t]?.[n],r,o)}addResource(t,n,r,a,o={silent:!1}){const c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let d=[t,n];r&&(d=d.concat(c?r.split(c):r)),t.indexOf(".")>-1&&(d=t.split("."),a=n,n=d[1]),this.addNamespaces(n),lR(this.data,d,a),o.silent||this.emit("added",t,n,r,a)}addResources(t,n,r,a={silent:!1}){for(const o in r)(Ye(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});a.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,a,o,c={silent:!1,skipCopy:!1}){let d=[t,n];t.indexOf(".")>-1&&(d=t.split("."),a=r,r=n,n=d[1]),this.addNamespaces(n);let h=Jm(this.data,d)||{};c.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?Y3(h,r,o):h={...h,...r},lR(this.data,d,h),c.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var X3={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(o=>{t=this.processors[o]?.process(t,n,r,a)??t}),t}};const Q3=Symbol("i18next/PATH_KEY");function zce(){const e=[],t=Object.create(null);let n;return t.get=(r,a)=>(n?.revoke?.(),a===Q3?e:(e.push(a),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function sb(e,t){const{[Q3]:n}=e(zce());return n.join(t?.keySeparator??".")}const uR={},_v=e=>!Ye(e)&&typeof e!="boolean"&&typeof e!="number";class ep extends Zp{constructor(t,n={}){super(),_ce(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ta.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const a=this.resolve(t,r);if(a?.res===void 0)return!1;const o=_v(a.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const c=r&&t.indexOf(r)>-1,d=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Ice(t,r,a);if(c&&!d){const h=t.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:t,namespaces:Ye(o)?[o]:o};const f=t.split(r);(r!==a||r===a&&this.options.ns.indexOf(f[0])>-1)&&(o=f.shift()),t=f.join(a)}return{key:t,namespaces:Ye(o)?[o]:o}}translate(t,n,r){let a=typeof n=="object"?{...n}:n;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a=="object"&&(a={...a}),a||(a={}),t==null)return"";typeof t=="function"&&(t=sb(t,{...this.options,...a})),Array.isArray(t)||(t=[String(t)]);const o=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,c=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:d,namespaces:h}=this.extractFromKey(t[t.length-1],a),f=h[h.length-1];let m=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;m===void 0&&(m=":");const p=a.lng||this.language,y=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p?.toLowerCase()==="cimode")return y?o?{res:`${f}${m}${d}`,usedKey:d,exactUsedKey:d,usedLng:p,usedNS:f,usedParams:this.getUsedParamsDetails(a)}:`${f}${m}${d}`:o?{res:d,usedKey:d,exactUsedKey:d,usedLng:p,usedNS:f,usedParams:this.getUsedParamsDetails(a)}:d;const v=this.resolve(t,a);let S=v?.res;const N=v?.usedKey||d,C=v?.exactUsedKey||d,j=["[object Number]","[object Function]","[object RegExp]"],E=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,R=!this.i18nFormat||this.i18nFormat.handleAsObject,A=a.count!==void 0&&!Ye(a.count),_=ep.hasDefaultValue(a),O=A?this.pluralResolver.getSuffix(p,a.count,a):"",T=a.ordinal&&A?this.pluralResolver.getSuffix(p,a.count,{ordinal:!1}):"",D=A&&!a.ordinal&&a.count===0,B=D&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${O}`]||a[`defaultValue${T}`]||a.defaultValue;let W=S;R&&!S&&_&&(W=B);const M=_v(W),V=Object.prototype.toString.apply(W);if(R&&W&&M&&j.indexOf(V)<0&&!(Ye(E)&&Array.isArray(W))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const G=this.options.returnedObjectHandler?this.options.returnedObjectHandler(N,W,{...a,ns:h}):`key '${d} (${this.language})' returned an object instead of string.`;return o?(v.res=G,v.usedParams=this.getUsedParamsDetails(a),v):G}if(c){const G=Array.isArray(W),F=G?[]:{},H=G?C:N;for(const P in W)if(Object.prototype.hasOwnProperty.call(W,P)){const U=`${H}${c}${P}`;_&&!S?F[P]=this.translate(U,{...a,defaultValue:_v(B)?B[P]:void 0,joinArrays:!1,ns:h}):F[P]=this.translate(U,{...a,joinArrays:!1,ns:h}),F[P]===U&&(F[P]=W[P])}S=F}}else if(R&&Ye(E)&&Array.isArray(S))S=S.join(E),S&&(S=this.extendTranslation(S,t,a,r));else{let G=!1,F=!1;!this.isValidLookup(S)&&_&&(G=!0,S=B),this.isValidLookup(S)||(F=!0,S=d);const P=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&F?void 0:S,U=_&&B!==S&&this.options.updateMissing;if(F||G||U){if(this.logger.log(U?"updateKey":"missingKey",p,f,d,U?B:S),c){const L=this.resolve(d,{...a,keySeparator:!1});L&&L.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let z=[];const te=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&te&&te[0])for(let L=0;L<te.length;L++)z.push(te[L]);else this.options.saveMissingTo==="all"?z=this.languageUtils.toResolveHierarchy(a.lng||this.language):z.push(a.lng||this.language);const oe=(L,$,X)=>{const Q=_&&X!==S?X:P;this.options.missingKeyHandler?this.options.missingKeyHandler(L,f,$,Q,U,a):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(L,f,$,Q,U,a),this.emit("missingKey",L,f,$,S)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?z.forEach(L=>{const $=this.pluralResolver.getSuffixes(L,a);D&&a[`defaultValue${this.options.pluralSeparator}zero`]&&$.indexOf(`${this.options.pluralSeparator}zero`)<0&&$.push(`${this.options.pluralSeparator}zero`),$.forEach(X=>{oe([L],d+X,a[`defaultValue${X}`]||B)})}):oe(z,d,B))}S=this.extendTranslation(S,t,a,v,r),F&&S===d&&this.options.appendNamespaceToMissingKey&&(S=`${f}${m}${d}`),(F||G)&&this.options.parseMissingKeyHandler&&(S=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}${m}${d}`:d,G?S:void 0,a))}return o?(v.res=S,v.usedParams=this.getUsedParamsDetails(a),v):S}extendTranslation(t,n,r,a,o){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const h=Ye(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(h){const p=t.match(this.interpolator.nestingRegexp);f=p&&p.length}let m=r.replace&&!Ye(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),t=this.interpolator.interpolate(t,m,r.lng||this.language||a.usedLng,r),h){const p=t.match(this.interpolator.nestingRegexp),y=p&&p.length;f<y&&(r.nest=!1)}!r.lng&&a&&a.res&&(r.lng=this.language||a.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...p)=>o?.[0]===p[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${n[0]}`),null):this.translate(...p,n),r)),r.interpolation&&this.interpolator.reset()}const c=r.postProcess||this.options.postProcess,d=Ye(c)?[c]:c;return t!=null&&d?.length&&r.applyPostProcessor!==!1&&(t=X3.handle(d,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,a,o,c,d;return Ye(t)&&(t=[t]),t.forEach(h=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(h,n),m=f.key;a=m;let p=f.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const y=n.count!==void 0&&!Ye(n.count),v=y&&!n.ordinal&&n.count===0,S=n.context!==void 0&&(Ye(n.context)||typeof n.context=="number")&&n.context!=="",N=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(C=>{this.isValidLookup(r)||(d=C,!uR[`${N[0]}-${C}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(d)&&(uR[`${N[0]}-${C}`]=!0,this.logger.warn(`key "${a}" for languages "${N.join(", ")}" won't get resolved as namespace "${d}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),N.forEach(j=>{if(this.isValidLookup(r))return;c=j;const E=[m];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(E,m,j,C,n);else{let A;y&&(A=this.pluralResolver.getSuffix(j,n.count,n));const _=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(n.ordinal&&A.indexOf(O)===0&&E.push(m+A.replace(O,this.options.pluralSeparator)),E.push(m+A),v&&E.push(m+_)),S){const T=`${m}${this.options.contextSeparator||"_"}${n.context}`;E.push(T),y&&(n.ordinal&&A.indexOf(O)===0&&E.push(T+A.replace(O,this.options.pluralSeparator)),E.push(T+A),v&&E.push(T+_))}}let R;for(;R=E.pop();)this.isValidLookup(r)||(o=R,r=this.getResource(j,C,R,n))}))})}),{res:r,usedKey:a,exactUsedKey:o,usedLng:c,usedNS:d}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,a={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,a):this.resourceStore.getResource(t,n,r,a)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!Ye(t.replace);let a=r?t.replace:t;if(r&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const o of n)delete a[o]}return a}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class dR{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ta.create("languageUtils")}getScriptPartFromCode(t){if(t=$d(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=$d(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Ye(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const a=this.getScriptPartFromCode(r);if(this.isSupportedCode(a))return n=a;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(c=>{if(c===o)return c;if(!(c.indexOf("-")<0&&o.indexOf("-")<0)&&(c.indexOf("-")>0&&o.indexOf("-")<0&&c.substring(0,c.indexOf("-"))===o||c.indexOf(o)===0&&o.length>1))return c})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Ye(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),a=[],o=c=>{c&&(this.isSupportedCode(c)?a.push(c):this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`))};return Ye(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):Ye(t)&&o(this.formatLanguageCode(t)),r.forEach(c=>{a.indexOf(c)<0&&o(this.formatLanguageCode(c))}),a}}const fR={zero:0,one:1,two:2,few:3,many:4,other:5},hR={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Fce{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=ta.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=$d(t==="dev"?"en":t),a=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:a});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let c;try{c=new Intl.PluralRules(r,{type:a})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),hR;if(!t.match(/-|_/))return hR;const h=this.languageUtils.getLanguagePartFromCode(t);c=this.getRule(h,n)}return this.pluralRulesCache[o]=c,c}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(a=>`${n}${a}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((a,o)=>fR[a]-fR[o]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(t,n,r={}){const a=this.getRule(t,r);return a?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const mR=(e,t,n,r=".",a=!0)=>{let o=kce(e,t,n);return!o&&a&&Ye(n)&&(o=rb(e,n,r),o===void 0&&(o=rb(t,n,r))),o},Rv=e=>e.replace(/\$/g,"$$$$");class pR{constructor(t={}){this.logger=ta.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:a,prefix:o,prefixEscaped:c,suffix:d,suffixEscaped:h,formatSeparator:f,unescapeSuffix:m,unescapePrefix:p,nestingPrefix:y,nestingPrefixEscaped:v,nestingSuffix:S,nestingSuffixEscaped:N,nestingOptionsSeparator:C,maxReplaces:j,alwaysFormat:E}=t.interpolation;this.escape=n!==void 0?n:Oce,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=o?Do(o):c||"{{",this.suffix=d?Do(d):h||"}}",this.formatSeparator=f||",",this.unescapePrefix=m?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=y?Do(y):v||Do("$t("),this.nestingSuffix=S?Do(S):N||Do(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=j||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,a){let o,c,d;const h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=v=>{if(v.indexOf(this.formatSeparator)<0){const j=mR(n,h,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(j,void 0,r,{...a,...n,interpolationkey:v}):j}const S=v.split(this.formatSeparator),N=S.shift().trim(),C=S.join(this.formatSeparator).trim();return this.format(mR(n,h,N,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...a,...n,interpolationkey:N})};this.resetRegExp();const m=a?.missingInterpolationHandler||this.options.missingInterpolationHandler,p=a?.interpolation?.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:v=>Rv(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?Rv(this.escape(v)):Rv(v)}].forEach(v=>{for(d=0;o=v.regex.exec(t);){const S=o[1].trim();if(c=f(S),c===void 0)if(typeof m=="function"){const C=m(t,o,a);c=Ye(C)?C:""}else if(a&&Object.prototype.hasOwnProperty.call(a,S))c="";else if(p){c=o[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${t}`),c="";else!Ye(c)&&!this.useRawValueToEscape&&(c=aR(c));const N=v.safeValue(c);if(t=t.replace(o[0],N),p?(v.regex.lastIndex+=c.length,v.regex.lastIndex-=o[0].length):v.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),t}nest(t,n,r={}){let a,o,c;const d=(h,f)=>{const m=this.nestingOptionsSeparator;if(h.indexOf(m)<0)return h;const p=h.split(new RegExp(`${Do(m)}[ ]*{`));let y=`{${p[1]}`;h=p[0],y=this.interpolate(y,c);const v=y.match(/'/g),S=y.match(/"/g);((v?.length??0)%2===0&&!S||(S?.length??0)%2!==0)&&(y=y.replace(/'/g,'"'));try{c=JSON.parse(y),f&&(c={...f,...c})}catch(N){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,N),`${h}${m}${y}`}return c.defaultValue&&c.defaultValue.indexOf(this.prefix)>-1&&delete c.defaultValue,h};for(;a=this.nestingRegexp.exec(t);){let h=[];c={...r},c=c.replace&&!Ye(c.replace)?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;const f=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(f!==-1&&(h=a[1].slice(f).split(this.formatSeparator).map(m=>m.trim()).filter(Boolean),a[1]=a[1].slice(0,f)),o=n(d.call(this,a[1].trim(),c),c),o&&a[0]===t&&!Ye(o))return o;Ye(o)||(o=aR(o)),o||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),o=""),h.length&&(o=h.reduce((m,p)=>this.format(m,p,r.lng,{...r,interpolationkey:a[1].trim()}),o.trim())),t=t.replace(a[0],o),this.regexp.lastIndex=0}return t}}const $ce=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);t==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(c=>{if(c){const[d,...h]=c.split(":"),f=h.join(":").trim().replace(/^'+|'+$/g,""),m=d.trim();n[m]||(n[m]=f),f==="false"&&(n[m]=!1),f==="true"&&(n[m]=!0),isNaN(f)||(n[m]=parseInt(f,10))}})}return{formatName:t,formatOptions:n}},gR=e=>{const t={};return(n,r,a)=>{let o=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(o={...o,[a.interpolationkey]:void 0});const c=r+JSON.stringify(o);let d=t[c];return d||(d=e($d(r),a),t[c]=d),d(n)}},Vce=e=>(t,n,r)=>e($d(n),r)(t);class Uce{constructor(t={}){this.logger=ta.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?gR:Vce;this.formats={number:r((a,o)=>{const c=new Intl.NumberFormat(a,{...o});return d=>c.format(d)}),currency:r((a,o)=>{const c=new Intl.NumberFormat(a,{...o,style:"currency"});return d=>c.format(d)}),datetime:r((a,o)=>{const c=new Intl.DateTimeFormat(a,{...o});return d=>c.format(d)}),relativetime:r((a,o)=>{const c=new Intl.RelativeTimeFormat(a,{...o});return d=>c.format(d,o.range||"day")}),list:r((a,o)=>{const c=new Intl.ListFormat(a,{...o});return d=>c.format(d)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=gR(n)}format(t,n,r,a={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(d=>d.indexOf(")")>-1)){const d=o.findIndex(h=>h.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,d)].join(this.formatSeparator)}return o.reduce((d,h)=>{const{formatName:f,formatOptions:m}=$ce(h);if(this.formats[f]){let p=d;try{const y=a?.formatParams?.[a.interpolationkey]||{},v=y.locale||y.lng||a.locale||a.lng||r;p=this.formats[f](d,v,{...m,...a,...y})}catch(y){this.logger.warn(y)}return p}else this.logger.warn(`there was no format function for ${f}`);return d},t)}}const Hce=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Gce extends Zp{constructor(t,n,r,a={}){super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=ta.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,a.backend,a)}queueLoad(t,n,r,a){const o={},c={},d={},h={};return t.forEach(f=>{let m=!0;n.forEach(p=>{const y=`${f}|${p}`;!r.reload&&this.store.hasResourceBundle(f,p)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?c[y]===void 0&&(c[y]=!0):(this.state[y]=1,m=!1,c[y]===void 0&&(c[y]=!0),o[y]===void 0&&(o[y]=!0),h[p]===void 0&&(h[p]=!0)))}),m||(d[f]=!0)}),(Object.keys(o).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(o),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(h)}}loaded(t,n,r){const a=t.split("|"),o=a[0],c=a[1];n&&this.emit("failedLoading",o,c,n),!n&&r&&this.store.addResourceBundle(o,c,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const d={};this.queue.forEach(h=>{Dce(h.loaded,[o],c),Hce(h,t),n&&h.errors.push(n),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(f=>{d[f]||(d[f]={});const m=h.loaded[f];m.length&&m.forEach(p=>{d[f][p]===void 0&&(d[f][p]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(h=>!h.done)}read(t,n,r,a=0,o=this.retryTimeout,c){if(!t.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:a,wait:o,callback:c});return}this.readingCalls++;const d=(f,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(f&&m&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,a+1,o*2,c)},o);return}c(f,m)},h=this.backend[r].bind(this.backend);if(h.length===2){try{const f=h(t,n);f&&typeof f.then=="function"?f.then(m=>d(null,m)).catch(d):d(null,f)}catch(f){d(f)}return}return h(t,n,d)}prepareLoading(t,n,r={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();Ye(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ye(n)&&(n=[n]);const o=this.queueLoad(t,n,r,a);if(!o.toLoad.length)return o.pending.length||a(),null;o.toLoad.forEach(c=>{this.loadOne(c)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),a=r[0],o=r[1];this.read(a,o,"read",void 0,void 0,(c,d)=>{c&&this.logger.warn(`${n}loading namespace ${o} for language ${a} failed`,c),!c&&d&&this.logger.log(`${n}loaded namespace ${o} for language ${a}`,d),this.loaded(t,c,d)})}saveMissing(t,n,r,a,o,c={},d=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const h={...c,isUpdate:o},f=this.backend.create.bind(this.backend);if(f.length<6)try{let m;f.length===5?m=f(t,n,r,a,h):m=f(t,n,r,a),m&&typeof m.then=="function"?m.then(p=>d(null,p)).catch(d):d(null,m)}catch(m){d(m)}else f(t,n,r,a,d,h)}!t||!t[0]||this.store.addResource(t[0],n,r,a)}}}const Dv=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Ye(e[1])&&(t.defaultValue=e[1]),Ye(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),xR=e=>(Ye(e.ns)&&(e.ns=[e.ns]),Ye(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ye(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Jh=()=>{},qce=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};let yR=!1;const Wce=e=>!!(e?.modules?.backend?.name?.indexOf("Locize")>0||e?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||e?.options?.backend?.backends&&e.options.backend.backends.some(t=>t?.name?.indexOf("Locize")>0||t?.constructor?.name?.indexOf("Locize")>0));class md extends Zp{constructor(t={},n){if(super(),this.options=xR(t),this.services={},this.logger=ta,this.modules={external:[]},qce(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Ye(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Dv();this.options={...r,...this.options,...xR(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Wce(this)&&!yR&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),yR=!0);const a=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?ta.init(a(this.modules.logger),this.options):ta.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=Uce;const m=new dR(this.options);this.store=new cR(this.options.resources,this.options);const p=this.services;p.logger=ta,p.resourceStore=this.store,p.languageUtils=m,p.pluralResolver=new Fce(m,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),f&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(p.formatter=a(f),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new pR(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new Gce(a(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(v,...S)=>{this.emit(v,...S)}),this.modules.languageDetector&&(p.languageDetector=a(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=a(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new ep(this.services,this.options),this.translator.on("*",(v,...S)=>{this.emit(v,...S)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Jh),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=(...m)=>this.store[f](...m)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...m)=>(this.store[f](...m),this)});const d=qu(),h=()=>{const f=(m,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),d.resolve(p),n(m,p)};if(this.languages&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),d}loadResources(t,n=Jh){let r=n;const a=Ye(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(a?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],c=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(f=>{f!=="cimode"&&o.indexOf(f)<0&&o.push(f)})};a?c(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>c(h)),this.options.preload?.forEach?.(d=>c(d)),this.services.backendConnector.load(o,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(d)})}else r(null)}reloadResources(t,n,r){const a=qu();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Jh),this.services.backendConnector.reload(t,n,o=>{a.resolve(),r(o)}),a}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&X3.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=qu();this.emit("languageChanging",t);const a=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},o=(d,h)=>{h?this.isLanguageChangingTo===t&&(a(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,r.resolve((...f)=>this.t(...f)),n&&n(d,(...f)=>this.t(...f))},c=d=>{!t&&!d&&this.services.languageDetector&&(d=[]);const h=Ye(d)?d:d&&d[0],f=this.store.hasLanguageSomeTranslations(h)?h:this.services.languageUtils.getBestMatchFromCodes(Ye(d)?[d]:d);f&&(this.language||a(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector?.cacheUserLanguage?.(f)),this.loadResources(f,m=>{o(m,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),r}getFixedT(t,n,r){const a=(o,c,...d)=>{let h;typeof c!="object"?h=this.options.overloadTranslationOptionHandler([o,c].concat(d)):h={...c},h.lng=h.lng||a.lng,h.lngs=h.lngs||a.lngs,h.ns=h.ns||a.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||r||a.keyPrefix);const f=this.options.keySeparator||".";let m;return h.keyPrefix&&Array.isArray(o)?m=o.map(p=>(typeof p=="function"&&(p=sb(p,{...this.options,...c})),`${h.keyPrefix}${f}${p}`)):(typeof o=="function"&&(o=sb(o,{...this.options,...c})),m=h.keyPrefix?`${h.keyPrefix}${f}${o}`:o),this.t(m,h)};return Ye(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const c=(d,h)=>{const f=this.services.backendConnector.state[`${d}|${h}`];return f===-1||f===0||f===2};if(n.precheck){const d=n.precheck(this,c);if(d!==void 0)return d}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(r,t)&&(!a||c(o,t)))}loadNamespaces(t,n){const r=qu();return this.options.ns?(Ye(t)&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=qu();Ye(t)&&(t=[t]);const a=this.options.preload||[],o=t.filter(c=>a.indexOf(c)<0&&this.services.languageUtils.isSupportedCode(c));return o.length?(this.options.preload=a.concat(o),this.loadResources(c=>{r.resolve(),n&&n(c)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const a=new Intl.Locale(t);if(a&&a.getTextInfo){const o=a.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new dR(Dv());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new md(t,n);return r.createInstance=md.createInstance,r}cloneInstance(t={},n=Jh){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},o=new md(a);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(d=>{o[d]=this[d]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const d=Object.keys(this.store.data).reduce((h,f)=>(h[f]={...this.store.data[f]},h[f]=Object.keys(h[f]).reduce((m,p)=>(m[p]={...h[f][p]},m),h[f]),h),{});o.store=new cR(d,a),o.services.resourceStore=o.store}if(t.interpolation){const h={...Dv().interpolation,...this.options.interpolation,...t.interpolation},f={...a,interpolation:h};o.services.interpolator=new pR(f)}return o.translator=new ep(o.services,a),o.translator.on("*",(d,...h)=>{o.emit(d,...h)}),o.init(a,n),o.translator.options=a,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const nr=md.createInstance();nr.createInstance;nr.dir;nr.init;nr.loadResources;nr.reloadResources;nr.use;nr.changeLanguage;nr.getFixedT;nr.t;nr.exists;nr.setDefaultNamespace;nr.hasLoadedNamespace;nr.loadNamespaces;nr.loadLanguages;const Kce=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Yce={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Xce=e=>Yce[e],Qce=e=>e.replace(Kce,Xce);let vR={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Qce,transDefaultProps:void 0};const Jce=(e={})=>{vR={...vR,...e}},Zce={type:"3rdParty",init(e){Jce(e.options.react)}},eue={title:"Draft",loading:"Loading...",error:"Something went wrong",retry:"Retry",cancel:"Cancel",save:"Save",delete:"Delete",close:"Close",confirm:"Confirm",search:"Search...",noResults:"No results found"},tue={title:"Board",createBoard:"Create Board",selectBoard:"Select a board",noBoards:"No boards yet",settings:"Board Settings",refresh:"Refresh"},nue={create:"Create Ticket",edit:"Edit Ticket",title:"Title",description:"Description",state:"State",priority:"Priority",assignee:"Assignee",noTickets:"No tickets in this column",dragHint:"Drag to reorder",execute:"Execute",verify:"Verify",approve:"Approve",reject:"Reject",abandon:"Abandon",viewDetails:"View Details",viewLogs:"View Logs",queueMessage:"Queue Follow-up",dependencies:"Dependencies",blockedBy:"Blocked by"},rue={create:"Create Goal",edit:"Edit Goal",title:"Goal Title",description:"Goal Description",generateTickets:"Generate Tickets",noGoals:"No goals yet",budget:"Budget",progress:"Progress"},sue={running:"Running",queued:"Queued",succeeded:"Succeeded",failed:"Failed",canceled:"Canceled",viewOutput:"View Output",cancel:"Cancel Job",duration:"Duration"},aue={select:"Select Executor",available:"Available",unavailable:"Not Available",setup:"Setup Required",configure:"Configure"},iue={proposed:"Proposed",planned:"Planned",executing:"Executing",verifying:"Verifying",needs_human:"Needs Human",blocked:"Blocked",done:"Done",abandoned:"Abandoned"},oue={backlog:"Backlog",todo:"To Do",inProgress:"In Progress",review:"Review",done:"Done"},lue={approve:"Approve",requestChanges:"Request Changes",comment:"Add Comment",viewDiff:"View Diff",noRevisions:"No revisions yet"},cue={title:"Settings",general:"General",executors:"Executors",verification:"Verification",planner:"Planner",advanced:"Advanced"},uue={title:"Terminal",connecting:"Connecting...",connected:"Connected",disconnected:"Disconnected",clear:"Clear",selectJob:"Select a job to view output"},due={title:"Files",loading:"Loading files...",noWorktree:"No worktree found for this ticket.",error:"Failed to load file tree"},fue={app:eue,board:tue,ticket:nue,goal:rue,job:sue,executor:aue,state:iue,column:oue,review:lue,settings:cue,terminal:uue,fileTree:due};nr.use(Zce).init({resources:{en:{translation:fue}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});F5($5());const hue=new uz({defaultOptions:{queries:{staleTime:2e3,refetchOnWindowFocus:!0,retry:1}}});fI.createRoot(document.getElementById("root")).render(l.jsx(x.StrictMode,{children:l.jsx(mF,{fallback:l.jsx("div",{className:"p-8 text-center text-destructive",children:"Something went wrong. Please reload the page."}),children:l.jsx(dz,{client:hue,children:l.jsx(JB,{router:Tce})})})}));