@agile-vibe-coding/avc 0.1.1 → 0.3.1

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 (239) hide show
  1. package/cli/agent-loader.js +21 -0
  2. package/cli/agents/agent-selector.md +152 -0
  3. package/cli/agents/architecture-recommender.md +418 -0
  4. package/cli/agents/code-implementer.md +117 -0
  5. package/cli/agents/code-validator.md +80 -0
  6. package/cli/agents/context-reviewer-epic.md +101 -0
  7. package/cli/agents/context-reviewer-story.md +92 -0
  8. package/cli/agents/context-writer-epic.md +145 -0
  9. package/cli/agents/context-writer-story.md +111 -0
  10. package/cli/agents/database-deep-dive.md +470 -0
  11. package/cli/agents/database-recommender.md +634 -0
  12. package/cli/agents/doc-distributor.md +176 -0
  13. package/cli/agents/doc-writer-epic.md +42 -0
  14. package/cli/agents/doc-writer-story.md +43 -0
  15. package/cli/agents/documentation-updater.md +203 -0
  16. package/cli/agents/duplicate-detector.md +110 -0
  17. package/cli/agents/epic-story-decomposer.md +559 -0
  18. package/cli/agents/feature-context-generator.md +91 -0
  19. package/cli/agents/gap-checker-epic.md +52 -0
  20. package/cli/agents/impact-checker-story.md +51 -0
  21. package/cli/agents/migration-guide-generator.md +305 -0
  22. package/cli/agents/mission-scope-generator.md +143 -0
  23. package/cli/agents/mission-scope-validator.md +146 -0
  24. package/cli/agents/project-context-extractor.md +122 -0
  25. package/cli/agents/project-documentation-creator.json +226 -0
  26. package/cli/agents/project-documentation-creator.md +595 -0
  27. package/cli/agents/question-prefiller.md +269 -0
  28. package/cli/agents/refiner-epic.md +39 -0
  29. package/cli/agents/refiner-story.md +42 -0
  30. package/cli/agents/scaffolding-generator.md +99 -0
  31. package/cli/agents/seed-validator.md +71 -0
  32. package/cli/agents/story-doc-enricher.md +133 -0
  33. package/cli/agents/story-scope-reviewer.md +147 -0
  34. package/cli/agents/story-splitter.md +83 -0
  35. package/cli/agents/suggestion-business-analyst.md +88 -0
  36. package/cli/agents/suggestion-deployment-architect.md +263 -0
  37. package/cli/agents/suggestion-product-manager.md +129 -0
  38. package/cli/agents/suggestion-security-specialist.md +156 -0
  39. package/cli/agents/suggestion-technical-architect.md +269 -0
  40. package/cli/agents/suggestion-ux-researcher.md +93 -0
  41. package/cli/agents/task-subtask-decomposer.md +188 -0
  42. package/cli/agents/validator-documentation.json +183 -0
  43. package/cli/agents/validator-documentation.md +455 -0
  44. package/cli/agents/validator-selector.md +211 -0
  45. package/cli/ansi-colors.js +21 -0
  46. package/cli/api-reference-tool.js +368 -0
  47. package/cli/build-docs.js +29 -8
  48. package/cli/ceremony-history.js +369 -0
  49. package/cli/checks/catalog.json +76 -0
  50. package/cli/checks/code/quality.json +26 -0
  51. package/cli/checks/code/testing.json +14 -0
  52. package/cli/checks/code/traceability.json +26 -0
  53. package/cli/checks/cross-refs/epic.json +171 -0
  54. package/cli/checks/cross-refs/story.json +149 -0
  55. package/cli/checks/epic/api.json +114 -0
  56. package/cli/checks/epic/backend.json +126 -0
  57. package/cli/checks/epic/cloud.json +126 -0
  58. package/cli/checks/epic/data.json +102 -0
  59. package/cli/checks/epic/database.json +114 -0
  60. package/cli/checks/epic/developer.json +182 -0
  61. package/cli/checks/epic/devops.json +174 -0
  62. package/cli/checks/epic/frontend.json +162 -0
  63. package/cli/checks/epic/mobile.json +102 -0
  64. package/cli/checks/epic/qa.json +90 -0
  65. package/cli/checks/epic/security.json +184 -0
  66. package/cli/checks/epic/solution-architect.json +192 -0
  67. package/cli/checks/epic/test-architect.json +90 -0
  68. package/cli/checks/epic/ui.json +102 -0
  69. package/cli/checks/epic/ux.json +90 -0
  70. package/cli/checks/fixes/epic-fix-template.md +10 -0
  71. package/cli/checks/fixes/story-fix-template.md +10 -0
  72. package/cli/checks/story/api.json +186 -0
  73. package/cli/checks/story/backend.json +102 -0
  74. package/cli/checks/story/cloud.json +102 -0
  75. package/cli/checks/story/data.json +210 -0
  76. package/cli/checks/story/database.json +102 -0
  77. package/cli/checks/story/developer.json +168 -0
  78. package/cli/checks/story/devops.json +102 -0
  79. package/cli/checks/story/frontend.json +174 -0
  80. package/cli/checks/story/mobile.json +102 -0
  81. package/cli/checks/story/qa.json +210 -0
  82. package/cli/checks/story/security.json +198 -0
  83. package/cli/checks/story/solution-architect.json +230 -0
  84. package/cli/checks/story/test-architect.json +210 -0
  85. package/cli/checks/story/ui.json +102 -0
  86. package/cli/checks/story/ux.json +102 -0
  87. package/cli/coding-order.js +401 -0
  88. package/cli/command-logger.js +49 -12
  89. package/cli/components/static-output.js +63 -0
  90. package/cli/console-output-manager.js +94 -0
  91. package/cli/dependency-checker.js +72 -0
  92. package/cli/docs-sync.js +306 -0
  93. package/cli/epic-story-validator.js +659 -0
  94. package/cli/evaluation-prompts.js +1008 -0
  95. package/cli/execution-context.js +195 -0
  96. package/cli/generate-summary-table.js +340 -0
  97. package/cli/init-model-config.js +704 -0
  98. package/cli/init.js +1737 -278
  99. package/cli/kanban-server-manager.js +227 -0
  100. package/cli/llm-claude.js +150 -1
  101. package/cli/llm-gemini.js +109 -0
  102. package/cli/llm-local.js +493 -0
  103. package/cli/llm-mock.js +233 -0
  104. package/cli/llm-openai.js +454 -0
  105. package/cli/llm-provider.js +379 -3
  106. package/cli/llm-token-limits.js +211 -0
  107. package/cli/llm-verifier.js +662 -0
  108. package/cli/llm-xiaomi.js +143 -0
  109. package/cli/message-constants.js +49 -0
  110. package/cli/message-manager.js +334 -0
  111. package/cli/message-types.js +96 -0
  112. package/cli/messaging-api.js +291 -0
  113. package/cli/micro-check-fixer.js +335 -0
  114. package/cli/micro-check-runner.js +449 -0
  115. package/cli/micro-check-scorer.js +148 -0
  116. package/cli/micro-check-validator.js +538 -0
  117. package/cli/model-pricing.js +192 -0
  118. package/cli/model-query-engine.js +468 -0
  119. package/cli/model-recommendation-analyzer.js +495 -0
  120. package/cli/model-selector.js +270 -0
  121. package/cli/output-buffer.js +107 -0
  122. package/cli/process-manager.js +73 -2
  123. package/cli/prompt-logger.js +57 -0
  124. package/cli/repl-ink.js +4625 -1094
  125. package/cli/repl-old.js +3 -4
  126. package/cli/seed-processor.js +962 -0
  127. package/cli/sprint-planning-processor.js +4162 -0
  128. package/cli/template-processor.js +2149 -105
  129. package/cli/templates/project.md +25 -8
  130. package/cli/templates/vitepress-config.mts.template +5 -4
  131. package/cli/token-tracker.js +547 -0
  132. package/cli/tools/generate-story-validators.js +317 -0
  133. package/cli/tools/generate-validators.js +669 -0
  134. package/cli/update-checker.js +19 -17
  135. package/cli/update-notifier.js +4 -4
  136. package/cli/validation-router.js +667 -0
  137. package/cli/verification-tracker.js +563 -0
  138. package/cli/worktree-runner.js +654 -0
  139. package/kanban/README.md +386 -0
  140. package/kanban/client/README.md +205 -0
  141. package/kanban/client/components.json +20 -0
  142. package/kanban/client/dist/assets/index-D_KC5EQT.css +1 -0
  143. package/kanban/client/dist/assets/index-DjY5zqW7.js +351 -0
  144. package/kanban/client/dist/index.html +16 -0
  145. package/kanban/client/dist/vite.svg +1 -0
  146. package/kanban/client/index.html +15 -0
  147. package/kanban/client/package-lock.json +9442 -0
  148. package/kanban/client/package.json +44 -0
  149. package/kanban/client/postcss.config.js +6 -0
  150. package/kanban/client/public/vite.svg +1 -0
  151. package/kanban/client/src/App.jsx +651 -0
  152. package/kanban/client/src/components/ProjectFileEditorPopup.jsx +117 -0
  153. package/kanban/client/src/components/ceremony/AskArchPopup.jsx +420 -0
  154. package/kanban/client/src/components/ceremony/AskModelPopup.jsx +629 -0
  155. package/kanban/client/src/components/ceremony/CeremonyWorkflowModal.jsx +1133 -0
  156. package/kanban/client/src/components/ceremony/EpicStorySelectionModal.jsx +254 -0
  157. package/kanban/client/src/components/ceremony/ProviderSwitcherButton.jsx +290 -0
  158. package/kanban/client/src/components/ceremony/SponsorCallModal.jsx +686 -0
  159. package/kanban/client/src/components/ceremony/SprintPlanningModal.jsx +838 -0
  160. package/kanban/client/src/components/ceremony/steps/ArchitectureStep.jsx +150 -0
  161. package/kanban/client/src/components/ceremony/steps/CompleteStep.jsx +136 -0
  162. package/kanban/client/src/components/ceremony/steps/DatabaseStep.jsx +202 -0
  163. package/kanban/client/src/components/ceremony/steps/DeploymentStep.jsx +123 -0
  164. package/kanban/client/src/components/ceremony/steps/MissionStep.jsx +106 -0
  165. package/kanban/client/src/components/ceremony/steps/ReviewAnswersStep.jsx +329 -0
  166. package/kanban/client/src/components/ceremony/steps/RunningStep.jsx +249 -0
  167. package/kanban/client/src/components/kanban/CardDetailModal.jsx +646 -0
  168. package/kanban/client/src/components/kanban/EpicSection.jsx +146 -0
  169. package/kanban/client/src/components/kanban/FilterToolbar.jsx +222 -0
  170. package/kanban/client/src/components/kanban/GroupingSelector.jsx +63 -0
  171. package/kanban/client/src/components/kanban/KanbanBoard.jsx +211 -0
  172. package/kanban/client/src/components/kanban/KanbanCard.jsx +147 -0
  173. package/kanban/client/src/components/kanban/KanbanColumn.jsx +90 -0
  174. package/kanban/client/src/components/kanban/RefineWorkItemPopup.jsx +784 -0
  175. package/kanban/client/src/components/kanban/RunButton.jsx +162 -0
  176. package/kanban/client/src/components/kanban/SeedButton.jsx +176 -0
  177. package/kanban/client/src/components/layout/LoadingScreen.jsx +82 -0
  178. package/kanban/client/src/components/process/ProcessMonitorBar.jsx +80 -0
  179. package/kanban/client/src/components/settings/AgentEditorPopup.jsx +171 -0
  180. package/kanban/client/src/components/settings/AgentsTab.jsx +381 -0
  181. package/kanban/client/src/components/settings/ApiKeysTab.jsx +142 -0
  182. package/kanban/client/src/components/settings/CeremonyModelsTab.jsx +105 -0
  183. package/kanban/client/src/components/settings/CheckEditorPopup.jsx +507 -0
  184. package/kanban/client/src/components/settings/CostThresholdsTab.jsx +95 -0
  185. package/kanban/client/src/components/settings/ModelPricingTab.jsx +269 -0
  186. package/kanban/client/src/components/settings/OpenAIAuthSection.jsx +412 -0
  187. package/kanban/client/src/components/settings/ServersTab.jsx +121 -0
  188. package/kanban/client/src/components/settings/SettingsModal.jsx +84 -0
  189. package/kanban/client/src/components/stats/CostModal.jsx +384 -0
  190. package/kanban/client/src/components/ui/badge.jsx +27 -0
  191. package/kanban/client/src/components/ui/dialog.jsx +121 -0
  192. package/kanban/client/src/components/ui/tabs.jsx +85 -0
  193. package/kanban/client/src/hooks/__tests__/useGrouping.test.js +232 -0
  194. package/kanban/client/src/hooks/useGrouping.js +177 -0
  195. package/kanban/client/src/hooks/useWebSocket.js +120 -0
  196. package/kanban/client/src/lib/__tests__/api.test.js +196 -0
  197. package/kanban/client/src/lib/__tests__/status-grouping.test.js +94 -0
  198. package/kanban/client/src/lib/api.js +515 -0
  199. package/kanban/client/src/lib/status-grouping.js +154 -0
  200. package/kanban/client/src/lib/utils.js +11 -0
  201. package/kanban/client/src/main.jsx +10 -0
  202. package/kanban/client/src/store/__tests__/kanbanStore.test.js +164 -0
  203. package/kanban/client/src/store/ceremonyStore.js +172 -0
  204. package/kanban/client/src/store/filterStore.js +201 -0
  205. package/kanban/client/src/store/kanbanStore.js +123 -0
  206. package/kanban/client/src/store/processStore.js +65 -0
  207. package/kanban/client/src/store/sprintPlanningStore.js +33 -0
  208. package/kanban/client/src/styles/globals.css +59 -0
  209. package/kanban/client/tailwind.config.js +77 -0
  210. package/kanban/client/vite.config.js +28 -0
  211. package/kanban/client/vitest.config.js +28 -0
  212. package/kanban/dev-start.sh +47 -0
  213. package/kanban/package.json +12 -0
  214. package/kanban/server/index.js +537 -0
  215. package/kanban/server/routes/ceremony.js +454 -0
  216. package/kanban/server/routes/costs.js +163 -0
  217. package/kanban/server/routes/openai-oauth.js +366 -0
  218. package/kanban/server/routes/processes.js +50 -0
  219. package/kanban/server/routes/settings.js +736 -0
  220. package/kanban/server/routes/websocket.js +281 -0
  221. package/kanban/server/routes/work-items.js +487 -0
  222. package/kanban/server/services/CeremonyService.js +1441 -0
  223. package/kanban/server/services/FileSystemScanner.js +95 -0
  224. package/kanban/server/services/FileWatcher.js +144 -0
  225. package/kanban/server/services/HierarchyBuilder.js +196 -0
  226. package/kanban/server/services/ProcessRegistry.js +122 -0
  227. package/kanban/server/services/TaskRunnerService.js +261 -0
  228. package/kanban/server/services/WorkItemReader.js +123 -0
  229. package/kanban/server/services/WorkItemRefineService.js +510 -0
  230. package/kanban/server/start.js +49 -0
  231. package/kanban/server/utils/kanban-logger.js +132 -0
  232. package/kanban/server/utils/markdown.js +91 -0
  233. package/kanban/server/utils/status-grouping.js +107 -0
  234. package/kanban/server/workers/run-task-worker.js +121 -0
  235. package/kanban/server/workers/seed-worker.js +94 -0
  236. package/kanban/server/workers/sponsor-call-worker.js +92 -0
  237. package/kanban/server/workers/sprint-planning-worker.js +212 -0
  238. package/package.json +19 -7
  239. package/cli/agents/documentation.md +0 -302
@@ -0,0 +1,351 @@
1
+ var VI=Object.defineProperty;var UI=(e,t,n)=>t in e?VI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qh=(e,t,n)=>UI(e,typeof t!="symbol"?t+"":t,n);function WI(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function Qr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jh={exports:{}},fl={},Zh={exports:{}},ze={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var x1;function qI(){if(x1)return ze;x1=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;function v(M){return M===null||typeof M!="object"?null:(M=m&&M[m]||M["@@iterator"],typeof M=="function"?M:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function j(M,V,ie){this.props=M,this.context=V,this.refs=S,this.updater=ie||x}j.prototype.isReactComponent={},j.prototype.setState=function(M,V){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,V,"setState")},j.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function k(){}k.prototype=j.prototype;function C(M,V,ie){this.props=M,this.context=V,this.refs=S,this.updater=ie||x}var E=C.prototype=new k;E.constructor=C,w(E,j.prototype),E.isPureReactComponent=!0;var O=Array.isArray,P=Object.prototype.hasOwnProperty,A={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function D(M,V,ie){var fe,te={},le=null,pe=null;if(V!=null)for(fe in V.ref!==void 0&&(pe=V.ref),V.key!==void 0&&(le=""+V.key),V)P.call(V,fe)&&!_.hasOwnProperty(fe)&&(te[fe]=V[fe]);var Se=arguments.length-2;if(Se===1)te.children=ie;else if(1<Se){for(var H=Array(Se),me=0;me<Se;me++)H[me]=arguments[me+2];te.children=H}if(M&&M.defaultProps)for(fe in Se=M.defaultProps,Se)te[fe]===void 0&&(te[fe]=Se[fe]);return{$$typeof:e,type:M,key:le,ref:pe,props:te,_owner:A.current}}function $(M,V){return{$$typeof:e,type:M.type,key:V,ref:M.ref,props:M.props,_owner:M._owner}}function q(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function X(M){var V={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(ie){return V[ie]})}var L=/\/+/g;function Z(M,V){return typeof M=="object"&&M!==null&&M.key!=null?X(""+M.key):V.toString(36)}function J(M,V,ie,fe,te){var le=typeof M;(le==="undefined"||le==="boolean")&&(M=null);var pe=!1;if(M===null)pe=!0;else switch(le){case"string":case"number":pe=!0;break;case"object":switch(M.$$typeof){case e:case t:pe=!0}}if(pe)return pe=M,te=te(pe),M=fe===""?"."+Z(pe,0):fe,O(te)?(ie="",M!=null&&(ie=M.replace(L,"$&/")+"/"),J(te,V,ie,"",function(me){return me})):te!=null&&(q(te)&&(te=$(te,ie+(!te.key||pe&&pe.key===te.key?"":(""+te.key).replace(L,"$&/")+"/")+M)),V.push(te)),1;if(pe=0,fe=fe===""?".":fe+":",O(M))for(var Se=0;Se<M.length;Se++){le=M[Se];var H=fe+Z(le,Se);pe+=J(le,V,ie,H,te)}else if(H=v(M),typeof H=="function")for(M=H.call(M),Se=0;!(le=M.next()).done;)le=le.value,H=fe+Z(le,Se++),pe+=J(le,V,ie,H,te);else if(le==="object")throw V=String(M),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return pe}function ne(M,V,ie){if(M==null)return M;var fe=[],te=0;return J(M,fe,"","",function(le){return V.call(ie,le,te++)}),fe}function re(M){if(M._status===-1){var V=M._result;V=V(),V.then(function(ie){(M._status===0||M._status===-1)&&(M._status=1,M._result=ie)},function(ie){(M._status===0||M._status===-1)&&(M._status=2,M._result=ie)}),M._status===-1&&(M._status=0,M._result=V)}if(M._status===1)return M._result.default;throw M._result}var B={current:null},F={transition:null},G={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:F,ReactCurrentOwner:A};function W(){throw Error("act(...) is not supported in production builds of React.")}return ze.Children={map:ne,forEach:function(M,V,ie){ne(M,function(){V.apply(this,arguments)},ie)},count:function(M){var V=0;return ne(M,function(){V++}),V},toArray:function(M){return ne(M,function(V){return V})||[]},only:function(M){if(!q(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},ze.Component=j,ze.Fragment=n,ze.Profiler=i,ze.PureComponent=C,ze.StrictMode=r,ze.Suspense=d,ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=G,ze.act=W,ze.cloneElement=function(M,V,ie){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var fe=w({},M.props),te=M.key,le=M.ref,pe=M._owner;if(V!=null){if(V.ref!==void 0&&(le=V.ref,pe=A.current),V.key!==void 0&&(te=""+V.key),M.type&&M.type.defaultProps)var Se=M.type.defaultProps;for(H in V)P.call(V,H)&&!_.hasOwnProperty(H)&&(fe[H]=V[H]===void 0&&Se!==void 0?Se[H]:V[H])}var H=arguments.length-2;if(H===1)fe.children=ie;else if(1<H){Se=Array(H);for(var me=0;me<H;me++)Se[me]=arguments[me+2];fe.children=Se}return{$$typeof:e,type:M.type,key:te,ref:le,props:fe,_owner:pe}},ze.createContext=function(M){return M={$$typeof:l,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:a,_context:M},M.Consumer=M},ze.createElement=D,ze.createFactory=function(M){var V=D.bind(null,M);return V.type=M,V},ze.createRef=function(){return{current:null}},ze.forwardRef=function(M){return{$$typeof:u,render:M}},ze.isValidElement=q,ze.lazy=function(M){return{$$typeof:h,_payload:{_status:-1,_result:M},_init:re}},ze.memo=function(M,V){return{$$typeof:p,type:M,compare:V===void 0?null:V}},ze.startTransition=function(M){var V=F.transition;F.transition={};try{M()}finally{F.transition=V}},ze.unstable_act=W,ze.useCallback=function(M,V){return B.current.useCallback(M,V)},ze.useContext=function(M){return B.current.useContext(M)},ze.useDebugValue=function(){},ze.useDeferredValue=function(M){return B.current.useDeferredValue(M)},ze.useEffect=function(M,V){return B.current.useEffect(M,V)},ze.useId=function(){return B.current.useId()},ze.useImperativeHandle=function(M,V,ie){return B.current.useImperativeHandle(M,V,ie)},ze.useInsertionEffect=function(M,V){return B.current.useInsertionEffect(M,V)},ze.useLayoutEffect=function(M,V){return B.current.useLayoutEffect(M,V)},ze.useMemo=function(M,V){return B.current.useMemo(M,V)},ze.useReducer=function(M,V,ie){return B.current.useReducer(M,V,ie)},ze.useRef=function(M){return B.current.useRef(M)},ze.useState=function(M){return B.current.useState(M)},ze.useSyncExternalStore=function(M,V,ie){return B.current.useSyncExternalStore(M,V,ie)},ze.useTransition=function(){return B.current.useTransition()},ze.version="18.3.1",ze}var y1;function vo(){return y1||(y1=1,Zh.exports=qI()),Zh.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var b1;function KI(){if(b1)return fl;b1=1;var e=vo(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(u,d,p){var h,m={},v=null,x=null;p!==void 0&&(v=""+p),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(x=d.ref);for(h in d)r.call(d,h)&&!a.hasOwnProperty(h)&&(m[h]=d[h]);if(u&&u.defaultProps)for(h in d=u.defaultProps,d)m[h]===void 0&&(m[h]=d[h]);return{$$typeof:t,type:u,key:v,ref:x,props:m,_owner:i.current}}return fl.Fragment=n,fl.jsx=l,fl.jsxs=l,fl}var w1;function HI(){return w1||(w1=1,Jh.exports=KI()),Jh.exports}var c=HI(),b=vo();const Va=Qr(b),GI=WI({__proto__:null,default:Va},[b]);var Du={},em={exports:{}},On={},tm={exports:{}},nm={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var j1;function YI(){return j1||(j1=1,(function(e){function t(F,G){var W=F.length;F.push(G);e:for(;0<W;){var M=W-1>>>1,V=F[M];if(0<i(V,G))F[M]=G,F[W]=V,W=M;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var G=F[0],W=F.pop();if(W!==G){F[0]=W;e:for(var M=0,V=F.length,ie=V>>>1;M<ie;){var fe=2*(M+1)-1,te=F[fe],le=fe+1,pe=F[le];if(0>i(te,W))le<V&&0>i(pe,te)?(F[M]=pe,F[le]=W,M=le):(F[M]=te,F[fe]=W,M=fe);else if(le<V&&0>i(pe,W))F[M]=pe,F[le]=W,M=le;else break e}}return G}function i(F,G){var W=F.sortIndex-G.sortIndex;return W!==0?W:F.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],p=[],h=1,m=null,v=3,x=!1,w=!1,S=!1,j=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(F){for(var G=n(p);G!==null;){if(G.callback===null)r(p);else if(G.startTime<=F)r(p),G.sortIndex=G.expirationTime,t(d,G);else break;G=n(p)}}function O(F){if(S=!1,E(F),!w)if(n(d)!==null)w=!0,re(P);else{var G=n(p);G!==null&&B(O,G.startTime-F)}}function P(F,G){w=!1,S&&(S=!1,k(D),D=-1),x=!0;var W=v;try{for(E(G),m=n(d);m!==null&&(!(m.expirationTime>G)||F&&!X());){var M=m.callback;if(typeof M=="function"){m.callback=null,v=m.priorityLevel;var V=M(m.expirationTime<=G);G=e.unstable_now(),typeof V=="function"?m.callback=V:m===n(d)&&r(d),E(G)}else r(d);m=n(d)}if(m!==null)var ie=!0;else{var fe=n(p);fe!==null&&B(O,fe.startTime-G),ie=!1}return ie}finally{m=null,v=W,x=!1}}var A=!1,_=null,D=-1,$=5,q=-1;function X(){return!(e.unstable_now()-q<$)}function L(){if(_!==null){var F=e.unstable_now();q=F;var G=!0;try{G=_(!0,F)}finally{G?Z():(A=!1,_=null)}}else A=!1}var Z;if(typeof C=="function")Z=function(){C(L)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,ne=J.port2;J.port1.onmessage=L,Z=function(){ne.postMessage(null)}}else Z=function(){j(L,0)};function re(F){_=F,A||(A=!0,Z())}function B(F,G){D=j(function(){F(e.unstable_now())},G)}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(F){F.callback=null},e.unstable_continueExecution=function(){w||x||(w=!0,re(P))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(F){switch(v){case 1:case 2:case 3:var G=3;break;default:G=v}var W=v;v=G;try{return F()}finally{v=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,G){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var W=v;v=F;try{return G()}finally{v=W}},e.unstable_scheduleCallback=function(F,G,W){var M=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?M+W:M):W=M,F){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=W+V,F={id:h++,callback:G,priorityLevel:F,startTime:W,expirationTime:V,sortIndex:-1},W>M?(F.sortIndex=W,t(p,F),n(d)===null&&F===n(p)&&(S?(k(D),D=-1):S=!0,B(O,W-M))):(F.sortIndex=V,t(d,F),w||x||(w=!0,re(P))),F},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(F){var G=v;return function(){var W=v;v=G;try{return F.apply(this,arguments)}finally{v=W}}}})(nm)),nm}var S1;function XI(){return S1||(S1=1,tm.exports=YI()),tm.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var N1;function QI(){if(N1)return On;N1=1;var e=vo(),t=XI();function n(s){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+s,f=1;f<arguments.length;f++)o+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+s+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function a(s,o){l(s,o),l(s+"Capture",o)}function l(s,o){for(i[s]=o,s=0;s<o.length;s++)r.add(o[s])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[: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]*$/,h={},m={};function v(s){return d.call(m,s)?!0:d.call(h,s)?!1:p.test(s)?m[s]=!0:(h[s]=!0,!1)}function x(s,o,f,g){if(f!==null&&f.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return g?!1:f!==null?!f.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function w(s,o,f,g){if(o===null||typeof o>"u"||x(s,o,f,g))return!0;if(g)return!1;if(f!==null)switch(f.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function S(s,o,f,g,y,N,T){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=g,this.attributeNamespace=y,this.mustUseProperty=f,this.propertyName=s,this.type=o,this.sanitizeURL=N,this.removeEmptyString=T}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){j[s]=new S(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var o=s[0];j[o]=new S(o,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){j[s]=new S(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){j[s]=new S(s,2,!1,s,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){j[s]=new S(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){j[s]=new S(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){j[s]=new S(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){j[s]=new S(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){j[s]=new S(s,5,!1,s.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function C(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var o=s.replace(k,C);j[o]=new S(o,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var o=s.replace(k,C);j[o]=new S(o,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var o=s.replace(k,C);j[o]=new S(o,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){j[s]=new S(s,1,!1,s.toLowerCase(),null,!1,!1)}),j.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){j[s]=new S(s,1,!1,s.toLowerCase(),null,!0,!0)});function E(s,o,f,g){var y=j.hasOwnProperty(o)?j[o]:null;(y!==null?y.type!==0:g||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(w(o,f,y,g)&&(f=null),g||y===null?v(o)&&(f===null?s.removeAttribute(o):s.setAttribute(o,""+f)):y.mustUseProperty?s[y.propertyName]=f===null?y.type===3?!1:"":f:(o=y.attributeName,g=y.attributeNamespace,f===null?s.removeAttribute(o):(y=y.type,f=y===3||y===4&&f===!0?"":""+f,g?s.setAttributeNS(g,o,f):s.setAttribute(o,f))))}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),A=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),q=Symbol.for("react.provider"),X=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),F=Symbol.iterator;function G(s){return s===null||typeof s!="object"?null:(s=F&&s[F]||s["@@iterator"],typeof s=="function"?s:null)}var W=Object.assign,M;function V(s){if(M===void 0)try{throw Error()}catch(f){var o=f.stack.trim().match(/\n( *(at )?)/);M=o&&o[1]||""}return`
34
+ `+M+s}var ie=!1;function fe(s,o){if(!s||ie)return"";ie=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(Y){var g=Y}Reflect.construct(s,[],o)}else{try{o.call()}catch(Y){g=Y}s.call(o.prototype)}else{try{throw Error()}catch(Y){g=Y}s()}}catch(Y){if(Y&&g&&typeof Y.stack=="string"){for(var y=Y.stack.split(`
35
+ `),N=g.stack.split(`
36
+ `),T=y.length-1,I=N.length-1;1<=T&&0<=I&&y[T]!==N[I];)I--;for(;1<=T&&0<=I;T--,I--)if(y[T]!==N[I]){if(T!==1||I!==1)do if(T--,I--,0>I||y[T]!==N[I]){var R=`
37
+ `+y[T].replace(" at new "," at ");return s.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",s.displayName)),R}while(1<=T&&0<=I);break}}}finally{ie=!1,Error.prepareStackTrace=f}return(s=s?s.displayName||s.name:"")?V(s):""}function te(s){switch(s.tag){case 5:return V(s.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return s=fe(s.type,!1),s;case 11:return s=fe(s.type.render,!1),s;case 1:return s=fe(s.type,!0),s;default:return""}}function le(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case _:return"Fragment";case A:return"Portal";case $:return"Profiler";case D:return"StrictMode";case Z:return"Suspense";case J:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case X:return(s.displayName||"Context")+".Consumer";case q:return(s._context.displayName||"Context")+".Provider";case L:var o=s.render;return s=s.displayName,s||(s=o.displayName||o.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case ne:return o=s.displayName||null,o!==null?o:le(s.type)||"Memo";case re:o=s._payload,s=s._init;try{return le(s(o))}catch{}}return null}function pe(s){var o=s.type;switch(s.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=o.render,s=s.displayName||s.name||"",o.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return le(o);case 8:return o===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Se(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function H(s){var o=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function me(s){var o=H(s)?"checked":"value",f=Object.getOwnPropertyDescriptor(s.constructor.prototype,o),g=""+s[o];if(!s.hasOwnProperty(o)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var y=f.get,N=f.set;return Object.defineProperty(s,o,{configurable:!0,get:function(){return y.call(this)},set:function(T){g=""+T,N.call(this,T)}}),Object.defineProperty(s,o,{enumerable:f.enumerable}),{getValue:function(){return g},setValue:function(T){g=""+T},stopTracking:function(){s._valueTracker=null,delete s[o]}}}}function Oe(s){s._valueTracker||(s._valueTracker=me(s))}function se(s){if(!s)return!1;var o=s._valueTracker;if(!o)return!0;var f=o.getValue(),g="";return s&&(g=H(s)?s.checked?"true":"false":s.value),s=g,s!==f?(o.setValue(s),!0):!1}function $e(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}}function De(s,o){var f=o.checked;return W({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??s._wrapperState.initialChecked})}function Je(s,o){var f=o.defaultValue==null?"":o.defaultValue,g=o.checked!=null?o.checked:o.defaultChecked;f=Se(o.value!=null?o.value:f),s._wrapperState={initialChecked:g,initialValue:f,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function et(s,o){o=o.checked,o!=null&&E(s,"checked",o,!1)}function Mt(s,o){et(s,o);var f=Se(o.value),g=o.type;if(f!=null)g==="number"?(f===0&&s.value===""||s.value!=f)&&(s.value=""+f):s.value!==""+f&&(s.value=""+f);else if(g==="submit"||g==="reset"){s.removeAttribute("value");return}o.hasOwnProperty("value")?bn(s,o.type,f):o.hasOwnProperty("defaultValue")&&bn(s,o.type,Se(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(s.defaultChecked=!!o.defaultChecked)}function Mn(s,o,f){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var g=o.type;if(!(g!=="submit"&&g!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+s._wrapperState.initialValue,f||o===s.value||(s.value=o),s.defaultValue=o}f=s.name,f!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,f!==""&&(s.name=f)}function bn(s,o,f){(o!=="number"||$e(s.ownerDocument)!==s)&&(f==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+f&&(s.defaultValue=""+f))}var wn=Array.isArray;function jn(s,o,f,g){if(s=s.options,o){o={};for(var y=0;y<f.length;y++)o["$"+f[y]]=!0;for(f=0;f<s.length;f++)y=o.hasOwnProperty("$"+s[f].value),s[f].selected!==y&&(s[f].selected=y),y&&g&&(s[f].defaultSelected=!0)}else{for(f=""+Se(f),o=null,y=0;y<s.length;y++){if(s[y].value===f){s[y].selected=!0,g&&(s[y].defaultSelected=!0);return}o!==null||s[y].disabled||(o=s[y])}o!==null&&(o.selected=!0)}}function he(s,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return W({},o,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function ke(s,o){var f=o.value;if(f==null){if(f=o.children,o=o.defaultValue,f!=null){if(o!=null)throw Error(n(92));if(wn(f)){if(1<f.length)throw Error(n(93));f=f[0]}o=f}o==null&&(o=""),f=o}s._wrapperState={initialValue:Se(f)}}function Me(s,o){var f=Se(o.value),g=Se(o.defaultValue);f!=null&&(f=""+f,f!==s.value&&(s.value=f),o.defaultValue==null&&s.defaultValue!==f&&(s.defaultValue=f)),g!=null&&(s.defaultValue=""+g)}function Ze(s){var o=s.textContent;o===s._wrapperState.initialValue&&o!==""&&o!==null&&(s.value=o)}function Ct(s){switch(s){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function It(s,o){return s==null||s==="http://www.w3.org/1999/xhtml"?Ct(o):s==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var Dt,un=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,f,g,y){MSApp.execUnsafeLocalFunction(function(){return s(o,f,g,y)})}:s})(function(s,o){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=o;else{for(Dt=Dt||document.createElement("div"),Dt.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=Dt.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;o.firstChild;)s.appendChild(o.firstChild)}});function Ge(s,o){if(o){var f=s.firstChild;if(f&&f===s.lastChild&&f.nodeType===3){f.nodeValue=o;return}}s.textContent=o}var Rt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},In=["Webkit","ms","Moz","O"];Object.keys(Rt).forEach(function(s){In.forEach(function(o){o=o+s.charAt(0).toUpperCase()+s.substring(1),Rt[o]=Rt[s]})});function da(s,o,f){return o==null||typeof o=="boolean"||o===""?"":f||typeof o!="number"||o===0||Rt.hasOwnProperty(s)&&Rt[s]?(""+o).trim():o+"px"}function fa(s,o){s=s.style;for(var f in o)if(o.hasOwnProperty(f)){var g=f.indexOf("--")===0,y=da(f,o[f],g);f==="float"&&(f="cssFloat"),g?s.setProperty(f,y):s[f]=y}}var ws=W({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Jr(s,o){if(o){if(ws[s]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,s));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function Tr(s,o){if(s.indexOf("-")===-1)return typeof o.is=="string";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 fr=null;function Ii(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var pr=null,dn=null,hr=null;function Zr(s){if(s=Qo(s)){if(typeof pr!="function")throw Error(n(280));var o=s.stateNode;o&&(o=Xc(o),pr(s.stateNode,s.type,o))}}function Di(s){dn?hr?hr.push(s):hr=[s]:dn=s}function pa(){if(dn){var s=dn,o=hr;if(hr=dn=null,Zr(s),o)for(s=0;s<o.length;s++)Zr(o[s])}}function ha(s,o){return s(o)}function js(){}var ei=!1;function Ss(s,o,f){if(ei)return s(o,f);ei=!0;try{return ha(s,o,f)}finally{ei=!1,(dn!==null||hr!==null)&&(js(),pa())}}function mr(s,o){var f=s.stateNode;if(f===null)return null;var g=Xc(f);if(g===null)return null;f=g[o];e:switch(o){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(f&&typeof f!="function")throw Error(n(231,o,typeof f));return f}var de=!1;if(u)try{var _e={};Object.defineProperty(_e,"passive",{get:function(){de=!0}}),window.addEventListener("test",_e,_e),window.removeEventListener("test",_e,_e)}catch{de=!1}function ee(s,o,f,g,y,N,T,I,R){var Y=Array.prototype.slice.call(arguments,3);try{o.apply(f,Y)}catch(oe){this.onError(oe)}}var Re=!1,Ye=null,fn=!1,Ri=null,Fe={onError:function(s){Re=!0,Ye=s}};function gp(s,o,f,g,y,N,T,I,R){Re=!1,Ye=null,ee.apply(Fe,arguments)}function Be(s,o,f,g,y,N,T,I,R){if(gp.apply(this,arguments),Re){if(Re){var Y=Ye;Re=!1,Ye=null}else throw Error(n(198));fn||(fn=!0,Ri=Y)}}function Ns(s){var o=s,f=s;if(s.alternate)for(;o.return;)o=o.return;else{s=o;do o=s,(o.flags&4098)!==0&&(f=o.return),s=o.return;while(s)}return o.tag===3?f:null}function By(s){if(s.tag===13){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function Vy(s){if(Ns(s)!==s)throw Error(n(188))}function J_(s){var o=s.alternate;if(!o){if(o=Ns(s),o===null)throw Error(n(188));return o!==s?null:s}for(var f=s,g=o;;){var y=f.return;if(y===null)break;var N=y.alternate;if(N===null){if(g=y.return,g!==null){f=g;continue}break}if(y.child===N.child){for(N=y.child;N;){if(N===f)return Vy(y),s;if(N===g)return Vy(y),o;N=N.sibling}throw Error(n(188))}if(f.return!==g.return)f=y,g=N;else{for(var T=!1,I=y.child;I;){if(I===f){T=!0,f=y,g=N;break}if(I===g){T=!0,g=y,f=N;break}I=I.sibling}if(!T){for(I=N.child;I;){if(I===f){T=!0,f=N,g=y;break}if(I===g){T=!0,g=N,f=y;break}I=I.sibling}if(!T)throw Error(n(189))}}if(f.alternate!==g)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?s:o}function Uy(s){return s=J_(s),s!==null?Wy(s):null}function Wy(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var o=Wy(s);if(o!==null)return o;s=s.sibling}return null}var qy=t.unstable_scheduleCallback,Ky=t.unstable_cancelCallback,Z_=t.unstable_shouldYield,eM=t.unstable_requestPaint,wt=t.unstable_now,tM=t.unstable_getCurrentPriorityLevel,vp=t.unstable_ImmediatePriority,Hy=t.unstable_UserBlockingPriority,Ec=t.unstable_NormalPriority,nM=t.unstable_LowPriority,Gy=t.unstable_IdlePriority,Tc=null,_r=null;function rM(s){if(_r&&typeof _r.onCommitFiberRoot=="function")try{_r.onCommitFiberRoot(Tc,s,void 0,(s.current.flags&128)===128)}catch{}}var gr=Math.clz32?Math.clz32:aM,iM=Math.log,sM=Math.LN2;function aM(s){return s>>>=0,s===0?32:31-(iM(s)/sM|0)|0}var _c=64,Mc=4194304;function Mo(s){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: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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Ic(s,o){var f=s.pendingLanes;if(f===0)return 0;var g=0,y=s.suspendedLanes,N=s.pingedLanes,T=f&268435455;if(T!==0){var I=T&~y;I!==0?g=Mo(I):(N&=T,N!==0&&(g=Mo(N)))}else T=f&~y,T!==0?g=Mo(T):N!==0&&(g=Mo(N));if(g===0)return 0;if(o!==0&&o!==g&&(o&y)===0&&(y=g&-g,N=o&-o,y>=N||y===16&&(N&4194240)!==0))return o;if((g&4)!==0&&(g|=f&16),o=s.entangledLanes,o!==0)for(s=s.entanglements,o&=g;0<o;)f=31-gr(o),y=1<<f,g|=s[f],o&=~y;return g}function oM(s,o){switch(s){case 1:case 2:case 4:return o+250;case 8:case 16:case 32:case 64: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 o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lM(s,o){for(var f=s.suspendedLanes,g=s.pingedLanes,y=s.expirationTimes,N=s.pendingLanes;0<N;){var T=31-gr(N),I=1<<T,R=y[T];R===-1?((I&f)===0||(I&g)!==0)&&(y[T]=oM(I,o)):R<=o&&(s.expiredLanes|=I),N&=~I}}function xp(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Yy(){var s=_c;return _c<<=1,(_c&4194240)===0&&(_c=64),s}function yp(s){for(var o=[],f=0;31>f;f++)o.push(s);return o}function Io(s,o,f){s.pendingLanes|=o,o!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,o=31-gr(o),s[o]=f}function cM(s,o){var f=s.pendingLanes&~o;s.pendingLanes=o,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=o,s.mutableReadLanes&=o,s.entangledLanes&=o,o=s.entanglements;var g=s.eventTimes;for(s=s.expirationTimes;0<f;){var y=31-gr(f),N=1<<y;o[y]=0,g[y]=-1,s[y]=-1,f&=~N}}function bp(s,o){var f=s.entangledLanes|=o;for(s=s.entanglements;f;){var g=31-gr(f),y=1<<g;y&o|s[g]&o&&(s[g]|=o),f&=~y}}var Xe=0;function Xy(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var Qy,wp,Jy,Zy,eb,jp=!1,Dc=[],Li=null,$i=null,zi=null,Do=new Map,Ro=new Map,Fi=[],uM="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 submit".split(" ");function tb(s,o){switch(s){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":$i=null;break;case"mouseover":case"mouseout":zi=null;break;case"pointerover":case"pointerout":Do.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ro.delete(o.pointerId)}}function Lo(s,o,f,g,y,N){return s===null||s.nativeEvent!==N?(s={blockedOn:o,domEventName:f,eventSystemFlags:g,nativeEvent:N,targetContainers:[y]},o!==null&&(o=Qo(o),o!==null&&wp(o)),s):(s.eventSystemFlags|=g,o=s.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),s)}function dM(s,o,f,g,y){switch(o){case"focusin":return Li=Lo(Li,s,o,f,g,y),!0;case"dragenter":return $i=Lo($i,s,o,f,g,y),!0;case"mouseover":return zi=Lo(zi,s,o,f,g,y),!0;case"pointerover":var N=y.pointerId;return Do.set(N,Lo(Do.get(N)||null,s,o,f,g,y)),!0;case"gotpointercapture":return N=y.pointerId,Ro.set(N,Lo(Ro.get(N)||null,s,o,f,g,y)),!0}return!1}function nb(s){var o=ks(s.target);if(o!==null){var f=Ns(o);if(f!==null){if(o=f.tag,o===13){if(o=By(f),o!==null){s.blockedOn=o,eb(s.priority,function(){Jy(f)});return}}else if(o===3&&f.stateNode.current.memoizedState.isDehydrated){s.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Rc(s){if(s.blockedOn!==null)return!1;for(var o=s.targetContainers;0<o.length;){var f=Np(s.domEventName,s.eventSystemFlags,o[0],s.nativeEvent);if(f===null){f=s.nativeEvent;var g=new f.constructor(f.type,f);fr=g,f.target.dispatchEvent(g),fr=null}else return o=Qo(f),o!==null&&wp(o),s.blockedOn=f,!1;o.shift()}return!0}function rb(s,o,f){Rc(s)&&f.delete(o)}function fM(){jp=!1,Li!==null&&Rc(Li)&&(Li=null),$i!==null&&Rc($i)&&($i=null),zi!==null&&Rc(zi)&&(zi=null),Do.forEach(rb),Ro.forEach(rb)}function $o(s,o){s.blockedOn===o&&(s.blockedOn=null,jp||(jp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,fM)))}function zo(s){function o(y){return $o(y,s)}if(0<Dc.length){$o(Dc[0],s);for(var f=1;f<Dc.length;f++){var g=Dc[f];g.blockedOn===s&&(g.blockedOn=null)}}for(Li!==null&&$o(Li,s),$i!==null&&$o($i,s),zi!==null&&$o(zi,s),Do.forEach(o),Ro.forEach(o),f=0;f<Fi.length;f++)g=Fi[f],g.blockedOn===s&&(g.blockedOn=null);for(;0<Fi.length&&(f=Fi[0],f.blockedOn===null);)nb(f),f.blockedOn===null&&Fi.shift()}var ma=O.ReactCurrentBatchConfig,Lc=!0;function pM(s,o,f,g){var y=Xe,N=ma.transition;ma.transition=null;try{Xe=1,Sp(s,o,f,g)}finally{Xe=y,ma.transition=N}}function hM(s,o,f,g){var y=Xe,N=ma.transition;ma.transition=null;try{Xe=4,Sp(s,o,f,g)}finally{Xe=y,ma.transition=N}}function Sp(s,o,f,g){if(Lc){var y=Np(s,o,f,g);if(y===null)Bp(s,o,g,$c,f),tb(s,g);else if(dM(y,s,o,f,g))g.stopPropagation();else if(tb(s,g),o&4&&-1<uM.indexOf(s)){for(;y!==null;){var N=Qo(y);if(N!==null&&Qy(N),N=Np(s,o,f,g),N===null&&Bp(s,o,g,$c,f),N===y)break;y=N}y!==null&&g.stopPropagation()}else Bp(s,o,g,null,f)}}var $c=null;function Np(s,o,f,g){if($c=null,s=Ii(g),s=ks(s),s!==null)if(o=Ns(s),o===null)s=null;else if(f=o.tag,f===13){if(s=By(o),s!==null)return s;s=null}else if(f===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;s=null}else o!==s&&(s=null);return $c=s,null}function ib(s){switch(s){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(tM()){case vp:return 1;case Hy:return 4;case Ec:case nM:return 16;case Gy:return 536870912;default:return 16}default:return 16}}var Bi=null,kp=null,zc=null;function sb(){if(zc)return zc;var s,o=kp,f=o.length,g,y="value"in Bi?Bi.value:Bi.textContent,N=y.length;for(s=0;s<f&&o[s]===y[s];s++);var T=f-s;for(g=1;g<=T&&o[f-g]===y[N-g];g++);return zc=y.slice(s,1<g?1-g:void 0)}function Fc(s){var o=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&o===13&&(s=13)):s=o,s===10&&(s=13),32<=s||s===13?s:0}function Bc(){return!0}function ab(){return!1}function Dn(s){function o(f,g,y,N,T){this._reactName=f,this._targetInst=y,this.type=g,this.nativeEvent=N,this.target=T,this.currentTarget=null;for(var I in s)s.hasOwnProperty(I)&&(f=s[I],this[I]=f?f(N):N[I]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Bc:ab,this.isPropagationStopped=ab,this}return W(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Bc)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Bc)},persist:function(){},isPersistent:Bc}),o}var ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pp=Dn(ga),Fo=W({},ga,{view:0,detail:0}),mM=Dn(Fo),Cp,Op,Bo,Vc=W({},Fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ep,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!==Bo&&(Bo&&s.type==="mousemove"?(Cp=s.screenX-Bo.screenX,Op=s.screenY-Bo.screenY):Op=Cp=0,Bo=s),Cp)},movementY:function(s){return"movementY"in s?s.movementY:Op}}),ob=Dn(Vc),gM=W({},Vc,{dataTransfer:0}),vM=Dn(gM),xM=W({},Fo,{relatedTarget:0}),Ap=Dn(xM),yM=W({},ga,{animationName:0,elapsedTime:0,pseudoElement:0}),bM=Dn(yM),wM=W({},ga,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),jM=Dn(wM),SM=W({},ga,{data:0}),lb=Dn(SM),NM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kM={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"},PM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function CM(s){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(s):(s=PM[s])?!!o[s]:!1}function Ep(){return CM}var OM=W({},Fo,{key:function(s){if(s.key){var o=NM[s.key]||s.key;if(o!=="Unidentified")return o}return s.type==="keypress"?(s=Fc(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?kM[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ep,charCode:function(s){return s.type==="keypress"?Fc(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Fc(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),AM=Dn(OM),EM=W({},Vc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cb=Dn(EM),TM=W({},Fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ep}),_M=Dn(TM),MM=W({},ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),IM=Dn(MM),DM=W({},Vc,{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}),RM=Dn(DM),LM=[9,13,27,32],Tp=u&&"CompositionEvent"in window,Vo=null;u&&"documentMode"in document&&(Vo=document.documentMode);var $M=u&&"TextEvent"in window&&!Vo,ub=u&&(!Tp||Vo&&8<Vo&&11>=Vo),db=" ",fb=!1;function pb(s,o){switch(s){case"keyup":return LM.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hb(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var va=!1;function zM(s,o){switch(s){case"compositionend":return hb(o);case"keypress":return o.which!==32?null:(fb=!0,db);case"textInput":return s=o.data,s===db&&fb?null:s;default:return null}}function FM(s,o){if(va)return s==="compositionend"||!Tp&&pb(s,o)?(s=sb(),zc=kp=Bi=null,va=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return ub&&o.locale!=="ko"?null:o.data;default:return null}}var BM={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 mb(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o==="input"?!!BM[s.type]:o==="textarea"}function gb(s,o,f,g){Di(g),o=Hc(o,"onChange"),0<o.length&&(f=new Pp("onChange","change",null,f,g),s.push({event:f,listeners:o}))}var Uo=null,Wo=null;function VM(s){Ib(s,0)}function Uc(s){var o=ja(s);if(se(o))return s}function UM(s,o){if(s==="change")return o}var vb=!1;if(u){var _p;if(u){var Mp="oninput"in document;if(!Mp){var xb=document.createElement("div");xb.setAttribute("oninput","return;"),Mp=typeof xb.oninput=="function"}_p=Mp}else _p=!1;vb=_p&&(!document.documentMode||9<document.documentMode)}function yb(){Uo&&(Uo.detachEvent("onpropertychange",bb),Wo=Uo=null)}function bb(s){if(s.propertyName==="value"&&Uc(Wo)){var o=[];gb(o,Wo,s,Ii(s)),Ss(VM,o)}}function WM(s,o,f){s==="focusin"?(yb(),Uo=o,Wo=f,Uo.attachEvent("onpropertychange",bb)):s==="focusout"&&yb()}function qM(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Uc(Wo)}function KM(s,o){if(s==="click")return Uc(o)}function HM(s,o){if(s==="input"||s==="change")return Uc(o)}function GM(s,o){return s===o&&(s!==0||1/s===1/o)||s!==s&&o!==o}var vr=typeof Object.is=="function"?Object.is:GM;function qo(s,o){if(vr(s,o))return!0;if(typeof s!="object"||s===null||typeof o!="object"||o===null)return!1;var f=Object.keys(s),g=Object.keys(o);if(f.length!==g.length)return!1;for(g=0;g<f.length;g++){var y=f[g];if(!d.call(o,y)||!vr(s[y],o[y]))return!1}return!0}function wb(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function jb(s,o){var f=wb(s);s=0;for(var g;f;){if(f.nodeType===3){if(g=s+f.textContent.length,s<=o&&g>=o)return{node:f,offset:o-s};s=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=wb(f)}}function Sb(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?Sb(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function Nb(){for(var s=window,o=$e();o instanceof s.HTMLIFrameElement;){try{var f=typeof o.contentWindow.location.href=="string"}catch{f=!1}if(f)s=o.contentWindow;else break;o=$e(s.document)}return o}function Ip(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}function YM(s){var o=Nb(),f=s.focusedElem,g=s.selectionRange;if(o!==f&&f&&f.ownerDocument&&Sb(f.ownerDocument.documentElement,f)){if(g!==null&&Ip(f)){if(o=g.start,s=g.end,s===void 0&&(s=o),"selectionStart"in f)f.selectionStart=o,f.selectionEnd=Math.min(s,f.value.length);else if(s=(o=f.ownerDocument||document)&&o.defaultView||window,s.getSelection){s=s.getSelection();var y=f.textContent.length,N=Math.min(g.start,y);g=g.end===void 0?N:Math.min(g.end,y),!s.extend&&N>g&&(y=g,g=N,N=y),y=jb(f,N);var T=jb(f,g);y&&T&&(s.rangeCount!==1||s.anchorNode!==y.node||s.anchorOffset!==y.offset||s.focusNode!==T.node||s.focusOffset!==T.offset)&&(o=o.createRange(),o.setStart(y.node,y.offset),s.removeAllRanges(),N>g?(s.addRange(o),s.extend(T.node,T.offset)):(o.setEnd(T.node,T.offset),s.addRange(o)))}}for(o=[],s=f;s=s.parentNode;)s.nodeType===1&&o.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<o.length;f++)s=o[f],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var XM=u&&"documentMode"in document&&11>=document.documentMode,xa=null,Dp=null,Ko=null,Rp=!1;function kb(s,o,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Rp||xa==null||xa!==$e(g)||(g=xa,"selectionStart"in g&&Ip(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}),Ko&&qo(Ko,g)||(Ko=g,g=Hc(Dp,"onSelect"),0<g.length&&(o=new Pp("onSelect","select",null,o,f),s.push({event:o,listeners:g}),o.target=xa)))}function Wc(s,o){var f={};return f[s.toLowerCase()]=o.toLowerCase(),f["Webkit"+s]="webkit"+o,f["Moz"+s]="moz"+o,f}var ya={animationend:Wc("Animation","AnimationEnd"),animationiteration:Wc("Animation","AnimationIteration"),animationstart:Wc("Animation","AnimationStart"),transitionend:Wc("Transition","TransitionEnd")},Lp={},Pb={};u&&(Pb=document.createElement("div").style,"AnimationEvent"in window||(delete ya.animationend.animation,delete ya.animationiteration.animation,delete ya.animationstart.animation),"TransitionEvent"in window||delete ya.transitionend.transition);function qc(s){if(Lp[s])return Lp[s];if(!ya[s])return s;var o=ya[s],f;for(f in o)if(o.hasOwnProperty(f)&&f in Pb)return Lp[s]=o[f];return s}var Cb=qc("animationend"),Ob=qc("animationiteration"),Ab=qc("animationstart"),Eb=qc("transitionend"),Tb=new Map,_b="abort auxClick 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(" ");function Vi(s,o){Tb.set(s,o),a(o,[s])}for(var $p=0;$p<_b.length;$p++){var zp=_b[$p],QM=zp.toLowerCase(),JM=zp[0].toUpperCase()+zp.slice(1);Vi(QM,"on"+JM)}Vi(Cb,"onAnimationEnd"),Vi(Ob,"onAnimationIteration"),Vi(Ab,"onAnimationStart"),Vi("dblclick","onDoubleClick"),Vi("focusin","onFocus"),Vi("focusout","onBlur"),Vi(Eb,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ho="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(" "),ZM=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ho));function Mb(s,o,f){var g=s.type||"unknown-event";s.currentTarget=f,Be(g,o,void 0,s),s.currentTarget=null}function Ib(s,o){o=(o&4)!==0;for(var f=0;f<s.length;f++){var g=s[f],y=g.event;g=g.listeners;e:{var N=void 0;if(o)for(var T=g.length-1;0<=T;T--){var I=g[T],R=I.instance,Y=I.currentTarget;if(I=I.listener,R!==N&&y.isPropagationStopped())break e;Mb(y,I,Y),N=R}else for(T=0;T<g.length;T++){if(I=g[T],R=I.instance,Y=I.currentTarget,I=I.listener,R!==N&&y.isPropagationStopped())break e;Mb(y,I,Y),N=R}}}if(fn)throw s=Ri,fn=!1,Ri=null,s}function at(s,o){var f=o[Hp];f===void 0&&(f=o[Hp]=new Set);var g=s+"__bubble";f.has(g)||(Db(o,s,2,!1),f.add(g))}function Fp(s,o,f){var g=0;o&&(g|=4),Db(f,s,g,o)}var Kc="_reactListening"+Math.random().toString(36).slice(2);function Go(s){if(!s[Kc]){s[Kc]=!0,r.forEach(function(f){f!=="selectionchange"&&(ZM.has(f)||Fp(f,!1,s),Fp(f,!0,s))});var o=s.nodeType===9?s:s.ownerDocument;o===null||o[Kc]||(o[Kc]=!0,Fp("selectionchange",!1,o))}}function Db(s,o,f,g){switch(ib(o)){case 1:var y=pM;break;case 4:y=hM;break;default:y=Sp}f=y.bind(null,o,f,s),y=void 0,!de||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(y=!0),g?y!==void 0?s.addEventListener(o,f,{capture:!0,passive:y}):s.addEventListener(o,f,!0):y!==void 0?s.addEventListener(o,f,{passive:y}):s.addEventListener(o,f,!1)}function Bp(s,o,f,g,y){var N=g;if((o&1)===0&&(o&2)===0&&g!==null)e:for(;;){if(g===null)return;var T=g.tag;if(T===3||T===4){var I=g.stateNode.containerInfo;if(I===y||I.nodeType===8&&I.parentNode===y)break;if(T===4)for(T=g.return;T!==null;){var R=T.tag;if((R===3||R===4)&&(R=T.stateNode.containerInfo,R===y||R.nodeType===8&&R.parentNode===y))return;T=T.return}for(;I!==null;){if(T=ks(I),T===null)return;if(R=T.tag,R===5||R===6){g=N=T;continue e}I=I.parentNode}}g=g.return}Ss(function(){var Y=N,oe=Ii(f),ce=[];e:{var ae=Tb.get(s);if(ae!==void 0){var ge=Pp,ye=s;switch(s){case"keypress":if(Fc(f)===0)break e;case"keydown":case"keyup":ge=AM;break;case"focusin":ye="focus",ge=Ap;break;case"focusout":ye="blur",ge=Ap;break;case"beforeblur":case"afterblur":ge=Ap;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=ob;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=vM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=_M;break;case Cb:case Ob:case Ab:ge=bM;break;case Eb:ge=IM;break;case"scroll":ge=mM;break;case"wheel":ge=RM;break;case"copy":case"cut":case"paste":ge=jM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=cb}var be=(o&4)!==0,jt=!be&&s==="scroll",U=be?ae!==null?ae+"Capture":null:ae;be=[];for(var z=Y,K;z!==null;){K=z;var ue=K.stateNode;if(K.tag===5&&ue!==null&&(K=ue,U!==null&&(ue=mr(z,U),ue!=null&&be.push(Yo(z,ue,K)))),jt)break;z=z.return}0<be.length&&(ae=new ge(ae,ye,null,f,oe),ce.push({event:ae,listeners:be}))}}if((o&7)===0){e:{if(ae=s==="mouseover"||s==="pointerover",ge=s==="mouseout"||s==="pointerout",ae&&f!==fr&&(ye=f.relatedTarget||f.fromElement)&&(ks(ye)||ye[ti]))break e;if((ge||ae)&&(ae=oe.window===oe?oe:(ae=oe.ownerDocument)?ae.defaultView||ae.parentWindow:window,ge?(ye=f.relatedTarget||f.toElement,ge=Y,ye=ye?ks(ye):null,ye!==null&&(jt=Ns(ye),ye!==jt||ye.tag!==5&&ye.tag!==6)&&(ye=null)):(ge=null,ye=Y),ge!==ye)){if(be=ob,ue="onMouseLeave",U="onMouseEnter",z="mouse",(s==="pointerout"||s==="pointerover")&&(be=cb,ue="onPointerLeave",U="onPointerEnter",z="pointer"),jt=ge==null?ae:ja(ge),K=ye==null?ae:ja(ye),ae=new be(ue,z+"leave",ge,f,oe),ae.target=jt,ae.relatedTarget=K,ue=null,ks(oe)===Y&&(be=new be(U,z+"enter",ye,f,oe),be.target=K,be.relatedTarget=jt,ue=be),jt=ue,ge&&ye)t:{for(be=ge,U=ye,z=0,K=be;K;K=ba(K))z++;for(K=0,ue=U;ue;ue=ba(ue))K++;for(;0<z-K;)be=ba(be),z--;for(;0<K-z;)U=ba(U),K--;for(;z--;){if(be===U||U!==null&&be===U.alternate)break t;be=ba(be),U=ba(U)}be=null}else be=null;ge!==null&&Rb(ce,ae,ge,be,!1),ye!==null&&jt!==null&&Rb(ce,jt,ye,be,!0)}}e:{if(ae=Y?ja(Y):window,ge=ae.nodeName&&ae.nodeName.toLowerCase(),ge==="select"||ge==="input"&&ae.type==="file")var je=UM;else if(mb(ae))if(vb)je=HM;else{je=qM;var Pe=WM}else(ge=ae.nodeName)&&ge.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(je=KM);if(je&&(je=je(s,Y))){gb(ce,je,f,oe);break e}Pe&&Pe(s,ae,Y),s==="focusout"&&(Pe=ae._wrapperState)&&Pe.controlled&&ae.type==="number"&&bn(ae,"number",ae.value)}switch(Pe=Y?ja(Y):window,s){case"focusin":(mb(Pe)||Pe.contentEditable==="true")&&(xa=Pe,Dp=Y,Ko=null);break;case"focusout":Ko=Dp=xa=null;break;case"mousedown":Rp=!0;break;case"contextmenu":case"mouseup":case"dragend":Rp=!1,kb(ce,f,oe);break;case"selectionchange":if(XM)break;case"keydown":case"keyup":kb(ce,f,oe)}var Ce;if(Tp)e:{switch(s){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else va?pb(s,f)&&(Te="onCompositionEnd"):s==="keydown"&&f.keyCode===229&&(Te="onCompositionStart");Te&&(ub&&f.locale!=="ko"&&(va||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&va&&(Ce=sb()):(Bi=oe,kp="value"in Bi?Bi.value:Bi.textContent,va=!0)),Pe=Hc(Y,Te),0<Pe.length&&(Te=new lb(Te,s,null,f,oe),ce.push({event:Te,listeners:Pe}),Ce?Te.data=Ce:(Ce=hb(f),Ce!==null&&(Te.data=Ce)))),(Ce=$M?zM(s,f):FM(s,f))&&(Y=Hc(Y,"onBeforeInput"),0<Y.length&&(oe=new lb("onBeforeInput","beforeinput",null,f,oe),ce.push({event:oe,listeners:Y}),oe.data=Ce))}Ib(ce,o)})}function Yo(s,o,f){return{instance:s,listener:o,currentTarget:f}}function Hc(s,o){for(var f=o+"Capture",g=[];s!==null;){var y=s,N=y.stateNode;y.tag===5&&N!==null&&(y=N,N=mr(s,f),N!=null&&g.unshift(Yo(s,N,y)),N=mr(s,o),N!=null&&g.push(Yo(s,N,y))),s=s.return}return g}function ba(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function Rb(s,o,f,g,y){for(var N=o._reactName,T=[];f!==null&&f!==g;){var I=f,R=I.alternate,Y=I.stateNode;if(R!==null&&R===g)break;I.tag===5&&Y!==null&&(I=Y,y?(R=mr(f,N),R!=null&&T.unshift(Yo(f,R,I))):y||(R=mr(f,N),R!=null&&T.push(Yo(f,R,I)))),f=f.return}T.length!==0&&s.push({event:o,listeners:T})}var eI=/\r\n?/g,tI=/\u0000|\uFFFD/g;function Lb(s){return(typeof s=="string"?s:""+s).replace(eI,`
38
+ `).replace(tI,"")}function Gc(s,o,f){if(o=Lb(o),Lb(s)!==o&&f)throw Error(n(425))}function Yc(){}var Vp=null,Up=null;function Wp(s,o){return s==="textarea"||s==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var qp=typeof setTimeout=="function"?setTimeout:void 0,nI=typeof clearTimeout=="function"?clearTimeout:void 0,$b=typeof Promise=="function"?Promise:void 0,rI=typeof queueMicrotask=="function"?queueMicrotask:typeof $b<"u"?function(s){return $b.resolve(null).then(s).catch(iI)}:qp;function iI(s){setTimeout(function(){throw s})}function Kp(s,o){var f=o,g=0;do{var y=f.nextSibling;if(s.removeChild(f),y&&y.nodeType===8)if(f=y.data,f==="/$"){if(g===0){s.removeChild(y),zo(o);return}g--}else f!=="$"&&f!=="$?"&&f!=="$!"||g++;f=y}while(f);zo(o)}function Ui(s){for(;s!=null;s=s.nextSibling){var o=s.nodeType;if(o===1||o===3)break;if(o===8){if(o=s.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return s}function zb(s){s=s.previousSibling;for(var o=0;s;){if(s.nodeType===8){var f=s.data;if(f==="$"||f==="$!"||f==="$?"){if(o===0)return s;o--}else f==="/$"&&o++}s=s.previousSibling}return null}var wa=Math.random().toString(36).slice(2),Mr="__reactFiber$"+wa,Xo="__reactProps$"+wa,ti="__reactContainer$"+wa,Hp="__reactEvents$"+wa,sI="__reactListeners$"+wa,aI="__reactHandles$"+wa;function ks(s){var o=s[Mr];if(o)return o;for(var f=s.parentNode;f;){if(o=f[ti]||f[Mr]){if(f=o.alternate,o.child!==null||f!==null&&f.child!==null)for(s=zb(s);s!==null;){if(f=s[Mr])return f;s=zb(s)}return o}s=f,f=s.parentNode}return null}function Qo(s){return s=s[Mr]||s[ti],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function ja(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(n(33))}function Xc(s){return s[Xo]||null}var Gp=[],Sa=-1;function Wi(s){return{current:s}}function ot(s){0>Sa||(s.current=Gp[Sa],Gp[Sa]=null,Sa--)}function rt(s,o){Sa++,Gp[Sa]=s.current,s.current=o}var qi={},nn=Wi(qi),Sn=Wi(!1),Ps=qi;function Na(s,o){var f=s.type.contextTypes;if(!f)return qi;var g=s.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===o)return g.__reactInternalMemoizedMaskedChildContext;var y={},N;for(N in f)y[N]=o[N];return g&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=o,s.__reactInternalMemoizedMaskedChildContext=y),y}function Nn(s){return s=s.childContextTypes,s!=null}function Qc(){ot(Sn),ot(nn)}function Fb(s,o,f){if(nn.current!==qi)throw Error(n(168));rt(nn,o),rt(Sn,f)}function Bb(s,o,f){var g=s.stateNode;if(o=o.childContextTypes,typeof g.getChildContext!="function")return f;g=g.getChildContext();for(var y in g)if(!(y in o))throw Error(n(108,pe(s)||"Unknown",y));return W({},f,g)}function Jc(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||qi,Ps=nn.current,rt(nn,s),rt(Sn,Sn.current),!0}function Vb(s,o,f){var g=s.stateNode;if(!g)throw Error(n(169));f?(s=Bb(s,o,Ps),g.__reactInternalMemoizedMergedChildContext=s,ot(Sn),ot(nn),rt(nn,s)):ot(Sn),rt(Sn,f)}var ni=null,Zc=!1,Yp=!1;function Ub(s){ni===null?ni=[s]:ni.push(s)}function oI(s){Zc=!0,Ub(s)}function Ki(){if(!Yp&&ni!==null){Yp=!0;var s=0,o=Xe;try{var f=ni;for(Xe=1;s<f.length;s++){var g=f[s];do g=g(!0);while(g!==null)}ni=null,Zc=!1}catch(y){throw ni!==null&&(ni=ni.slice(s+1)),qy(vp,Ki),y}finally{Xe=o,Yp=!1}}return null}var ka=[],Pa=0,eu=null,tu=0,Hn=[],Gn=0,Cs=null,ri=1,ii="";function Os(s,o){ka[Pa++]=tu,ka[Pa++]=eu,eu=s,tu=o}function Wb(s,o,f){Hn[Gn++]=ri,Hn[Gn++]=ii,Hn[Gn++]=Cs,Cs=s;var g=ri;s=ii;var y=32-gr(g)-1;g&=~(1<<y),f+=1;var N=32-gr(o)+y;if(30<N){var T=y-y%5;N=(g&(1<<T)-1).toString(32),g>>=T,y-=T,ri=1<<32-gr(o)+y|f<<y|g,ii=N+s}else ri=1<<N|f<<y|g,ii=s}function Xp(s){s.return!==null&&(Os(s,1),Wb(s,1,0))}function Qp(s){for(;s===eu;)eu=ka[--Pa],ka[Pa]=null,tu=ka[--Pa],ka[Pa]=null;for(;s===Cs;)Cs=Hn[--Gn],Hn[Gn]=null,ii=Hn[--Gn],Hn[Gn]=null,ri=Hn[--Gn],Hn[Gn]=null}var Rn=null,Ln=null,dt=!1,xr=null;function qb(s,o){var f=Jn(5,null,null,0);f.elementType="DELETED",f.stateNode=o,f.return=s,o=s.deletions,o===null?(s.deletions=[f],s.flags|=16):o.push(f)}function Kb(s,o){switch(s.tag){case 5:var f=s.type;return o=o.nodeType!==1||f.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(s.stateNode=o,Rn=s,Ln=Ui(o.firstChild),!0):!1;case 6:return o=s.pendingProps===""||o.nodeType!==3?null:o,o!==null?(s.stateNode=o,Rn=s,Ln=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(f=Cs!==null?{id:ri,overflow:ii}:null,s.memoizedState={dehydrated:o,treeContext:f,retryLane:1073741824},f=Jn(18,null,null,0),f.stateNode=o,f.return=s,s.child=f,Rn=s,Ln=null,!0):!1;default:return!1}}function Jp(s){return(s.mode&1)!==0&&(s.flags&128)===0}function Zp(s){if(dt){var o=Ln;if(o){var f=o;if(!Kb(s,o)){if(Jp(s))throw Error(n(418));o=Ui(f.nextSibling);var g=Rn;o&&Kb(s,o)?qb(g,f):(s.flags=s.flags&-4097|2,dt=!1,Rn=s)}}else{if(Jp(s))throw Error(n(418));s.flags=s.flags&-4097|2,dt=!1,Rn=s}}}function Hb(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Rn=s}function nu(s){if(s!==Rn)return!1;if(!dt)return Hb(s),dt=!0,!1;var o;if((o=s.tag!==3)&&!(o=s.tag!==5)&&(o=s.type,o=o!=="head"&&o!=="body"&&!Wp(s.type,s.memoizedProps)),o&&(o=Ln)){if(Jp(s))throw Gb(),Error(n(418));for(;o;)qb(s,o),o=Ui(o.nextSibling)}if(Hb(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));e:{for(s=s.nextSibling,o=0;s;){if(s.nodeType===8){var f=s.data;if(f==="/$"){if(o===0){Ln=Ui(s.nextSibling);break e}o--}else f!=="$"&&f!=="$!"&&f!=="$?"||o++}s=s.nextSibling}Ln=null}}else Ln=Rn?Ui(s.stateNode.nextSibling):null;return!0}function Gb(){for(var s=Ln;s;)s=Ui(s.nextSibling)}function Ca(){Ln=Rn=null,dt=!1}function eh(s){xr===null?xr=[s]:xr.push(s)}var lI=O.ReactCurrentBatchConfig;function Jo(s,o,f){if(s=f.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var g=f.stateNode}if(!g)throw Error(n(147,s));var y=g,N=""+s;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===N?o.ref:(o=function(T){var I=y.refs;T===null?delete I[N]:I[N]=T},o._stringRef=N,o)}if(typeof s!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,s))}return s}function ru(s,o){throw s=Object.prototype.toString.call(o),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":s))}function Yb(s){var o=s._init;return o(s._payload)}function Xb(s){function o(U,z){if(s){var K=U.deletions;K===null?(U.deletions=[z],U.flags|=16):K.push(z)}}function f(U,z){if(!s)return null;for(;z!==null;)o(U,z),z=z.sibling;return null}function g(U,z){for(U=new Map;z!==null;)z.key!==null?U.set(z.key,z):U.set(z.index,z),z=z.sibling;return U}function y(U,z){return U=es(U,z),U.index=0,U.sibling=null,U}function N(U,z,K){return U.index=K,s?(K=U.alternate,K!==null?(K=K.index,K<z?(U.flags|=2,z):K):(U.flags|=2,z)):(U.flags|=1048576,z)}function T(U){return s&&U.alternate===null&&(U.flags|=2),U}function I(U,z,K,ue){return z===null||z.tag!==6?(z=qh(K,U.mode,ue),z.return=U,z):(z=y(z,K),z.return=U,z)}function R(U,z,K,ue){var je=K.type;return je===_?oe(U,z,K.props.children,ue,K.key):z!==null&&(z.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===re&&Yb(je)===z.type)?(ue=y(z,K.props),ue.ref=Jo(U,z,K),ue.return=U,ue):(ue=Cu(K.type,K.key,K.props,null,U.mode,ue),ue.ref=Jo(U,z,K),ue.return=U,ue)}function Y(U,z,K,ue){return z===null||z.tag!==4||z.stateNode.containerInfo!==K.containerInfo||z.stateNode.implementation!==K.implementation?(z=Kh(K,U.mode,ue),z.return=U,z):(z=y(z,K.children||[]),z.return=U,z)}function oe(U,z,K,ue,je){return z===null||z.tag!==7?(z=Rs(K,U.mode,ue,je),z.return=U,z):(z=y(z,K),z.return=U,z)}function ce(U,z,K){if(typeof z=="string"&&z!==""||typeof z=="number")return z=qh(""+z,U.mode,K),z.return=U,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case P:return K=Cu(z.type,z.key,z.props,null,U.mode,K),K.ref=Jo(U,null,z),K.return=U,K;case A:return z=Kh(z,U.mode,K),z.return=U,z;case re:var ue=z._init;return ce(U,ue(z._payload),K)}if(wn(z)||G(z))return z=Rs(z,U.mode,K,null),z.return=U,z;ru(U,z)}return null}function ae(U,z,K,ue){var je=z!==null?z.key:null;if(typeof K=="string"&&K!==""||typeof K=="number")return je!==null?null:I(U,z,""+K,ue);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case P:return K.key===je?R(U,z,K,ue):null;case A:return K.key===je?Y(U,z,K,ue):null;case re:return je=K._init,ae(U,z,je(K._payload),ue)}if(wn(K)||G(K))return je!==null?null:oe(U,z,K,ue,null);ru(U,K)}return null}function ge(U,z,K,ue,je){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return U=U.get(K)||null,I(z,U,""+ue,je);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case P:return U=U.get(ue.key===null?K:ue.key)||null,R(z,U,ue,je);case A:return U=U.get(ue.key===null?K:ue.key)||null,Y(z,U,ue,je);case re:var Pe=ue._init;return ge(U,z,K,Pe(ue._payload),je)}if(wn(ue)||G(ue))return U=U.get(K)||null,oe(z,U,ue,je,null);ru(z,ue)}return null}function ye(U,z,K,ue){for(var je=null,Pe=null,Ce=z,Te=z=0,zt=null;Ce!==null&&Te<K.length;Te++){Ce.index>Te?(zt=Ce,Ce=null):zt=Ce.sibling;var Ue=ae(U,Ce,K[Te],ue);if(Ue===null){Ce===null&&(Ce=zt);break}s&&Ce&&Ue.alternate===null&&o(U,Ce),z=N(Ue,z,Te),Pe===null?je=Ue:Pe.sibling=Ue,Pe=Ue,Ce=zt}if(Te===K.length)return f(U,Ce),dt&&Os(U,Te),je;if(Ce===null){for(;Te<K.length;Te++)Ce=ce(U,K[Te],ue),Ce!==null&&(z=N(Ce,z,Te),Pe===null?je=Ce:Pe.sibling=Ce,Pe=Ce);return dt&&Os(U,Te),je}for(Ce=g(U,Ce);Te<K.length;Te++)zt=ge(Ce,U,Te,K[Te],ue),zt!==null&&(s&&zt.alternate!==null&&Ce.delete(zt.key===null?Te:zt.key),z=N(zt,z,Te),Pe===null?je=zt:Pe.sibling=zt,Pe=zt);return s&&Ce.forEach(function(ts){return o(U,ts)}),dt&&Os(U,Te),je}function be(U,z,K,ue){var je=G(K);if(typeof je!="function")throw Error(n(150));if(K=je.call(K),K==null)throw Error(n(151));for(var Pe=je=null,Ce=z,Te=z=0,zt=null,Ue=K.next();Ce!==null&&!Ue.done;Te++,Ue=K.next()){Ce.index>Te?(zt=Ce,Ce=null):zt=Ce.sibling;var ts=ae(U,Ce,Ue.value,ue);if(ts===null){Ce===null&&(Ce=zt);break}s&&Ce&&ts.alternate===null&&o(U,Ce),z=N(ts,z,Te),Pe===null?je=ts:Pe.sibling=ts,Pe=ts,Ce=zt}if(Ue.done)return f(U,Ce),dt&&Os(U,Te),je;if(Ce===null){for(;!Ue.done;Te++,Ue=K.next())Ue=ce(U,Ue.value,ue),Ue!==null&&(z=N(Ue,z,Te),Pe===null?je=Ue:Pe.sibling=Ue,Pe=Ue);return dt&&Os(U,Te),je}for(Ce=g(U,Ce);!Ue.done;Te++,Ue=K.next())Ue=ge(Ce,U,Te,Ue.value,ue),Ue!==null&&(s&&Ue.alternate!==null&&Ce.delete(Ue.key===null?Te:Ue.key),z=N(Ue,z,Te),Pe===null?je=Ue:Pe.sibling=Ue,Pe=Ue);return s&&Ce.forEach(function(BI){return o(U,BI)}),dt&&Os(U,Te),je}function jt(U,z,K,ue){if(typeof K=="object"&&K!==null&&K.type===_&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case P:e:{for(var je=K.key,Pe=z;Pe!==null;){if(Pe.key===je){if(je=K.type,je===_){if(Pe.tag===7){f(U,Pe.sibling),z=y(Pe,K.props.children),z.return=U,U=z;break e}}else if(Pe.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===re&&Yb(je)===Pe.type){f(U,Pe.sibling),z=y(Pe,K.props),z.ref=Jo(U,Pe,K),z.return=U,U=z;break e}f(U,Pe);break}else o(U,Pe);Pe=Pe.sibling}K.type===_?(z=Rs(K.props.children,U.mode,ue,K.key),z.return=U,U=z):(ue=Cu(K.type,K.key,K.props,null,U.mode,ue),ue.ref=Jo(U,z,K),ue.return=U,U=ue)}return T(U);case A:e:{for(Pe=K.key;z!==null;){if(z.key===Pe)if(z.tag===4&&z.stateNode.containerInfo===K.containerInfo&&z.stateNode.implementation===K.implementation){f(U,z.sibling),z=y(z,K.children||[]),z.return=U,U=z;break e}else{f(U,z);break}else o(U,z);z=z.sibling}z=Kh(K,U.mode,ue),z.return=U,U=z}return T(U);case re:return Pe=K._init,jt(U,z,Pe(K._payload),ue)}if(wn(K))return ye(U,z,K,ue);if(G(K))return be(U,z,K,ue);ru(U,K)}return typeof K=="string"&&K!==""||typeof K=="number"?(K=""+K,z!==null&&z.tag===6?(f(U,z.sibling),z=y(z,K),z.return=U,U=z):(f(U,z),z=qh(K,U.mode,ue),z.return=U,U=z),T(U)):f(U,z)}return jt}var Oa=Xb(!0),Qb=Xb(!1),iu=Wi(null),su=null,Aa=null,th=null;function nh(){th=Aa=su=null}function rh(s){var o=iu.current;ot(iu),s._currentValue=o}function ih(s,o,f){for(;s!==null;){var g=s.alternate;if((s.childLanes&o)!==o?(s.childLanes|=o,g!==null&&(g.childLanes|=o)):g!==null&&(g.childLanes&o)!==o&&(g.childLanes|=o),s===f)break;s=s.return}}function Ea(s,o){su=s,th=Aa=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&o)!==0&&(kn=!0),s.firstContext=null)}function Yn(s){var o=s._currentValue;if(th!==s)if(s={context:s,memoizedValue:o,next:null},Aa===null){if(su===null)throw Error(n(308));Aa=s,su.dependencies={lanes:0,firstContext:s}}else Aa=Aa.next=s;return o}var As=null;function sh(s){As===null?As=[s]:As.push(s)}function Jb(s,o,f,g){var y=o.interleaved;return y===null?(f.next=f,sh(o)):(f.next=y.next,y.next=f),o.interleaved=f,si(s,g)}function si(s,o){s.lanes|=o;var f=s.alternate;for(f!==null&&(f.lanes|=o),f=s,s=s.return;s!==null;)s.childLanes|=o,f=s.alternate,f!==null&&(f.childLanes|=o),f=s,s=s.return;return f.tag===3?f.stateNode:null}var Hi=!1;function ah(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zb(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function ai(s,o){return{eventTime:s,lane:o,tag:0,payload:null,callback:null,next:null}}function Gi(s,o,f){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Ve&2)!==0){var y=g.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),g.pending=o,si(s,f)}return y=g.interleaved,y===null?(o.next=o,sh(g)):(o.next=y.next,y.next=o),g.interleaved=o,si(s,f)}function au(s,o,f){if(o=o.updateQueue,o!==null&&(o=o.shared,(f&4194240)!==0)){var g=o.lanes;g&=s.pendingLanes,f|=g,o.lanes=f,bp(s,f)}}function ew(s,o){var f=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,f===g)){var y=null,N=null;if(f=f.firstBaseUpdate,f!==null){do{var T={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};N===null?y=N=T:N=N.next=T,f=f.next}while(f!==null);N===null?y=N=o:N=N.next=o}else y=N=o;f={baseState:g.baseState,firstBaseUpdate:y,lastBaseUpdate:N,shared:g.shared,effects:g.effects},s.updateQueue=f;return}s=f.lastBaseUpdate,s===null?f.firstBaseUpdate=o:s.next=o,f.lastBaseUpdate=o}function ou(s,o,f,g){var y=s.updateQueue;Hi=!1;var N=y.firstBaseUpdate,T=y.lastBaseUpdate,I=y.shared.pending;if(I!==null){y.shared.pending=null;var R=I,Y=R.next;R.next=null,T===null?N=Y:T.next=Y,T=R;var oe=s.alternate;oe!==null&&(oe=oe.updateQueue,I=oe.lastBaseUpdate,I!==T&&(I===null?oe.firstBaseUpdate=Y:I.next=Y,oe.lastBaseUpdate=R))}if(N!==null){var ce=y.baseState;T=0,oe=Y=R=null,I=N;do{var ae=I.lane,ge=I.eventTime;if((g&ae)===ae){oe!==null&&(oe=oe.next={eventTime:ge,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var ye=s,be=I;switch(ae=o,ge=f,be.tag){case 1:if(ye=be.payload,typeof ye=="function"){ce=ye.call(ge,ce,ae);break e}ce=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=be.payload,ae=typeof ye=="function"?ye.call(ge,ce,ae):ye,ae==null)break e;ce=W({},ce,ae);break e;case 2:Hi=!0}}I.callback!==null&&I.lane!==0&&(s.flags|=64,ae=y.effects,ae===null?y.effects=[I]:ae.push(I))}else ge={eventTime:ge,lane:ae,tag:I.tag,payload:I.payload,callback:I.callback,next:null},oe===null?(Y=oe=ge,R=ce):oe=oe.next=ge,T|=ae;if(I=I.next,I===null){if(I=y.shared.pending,I===null)break;ae=I,I=ae.next,ae.next=null,y.lastBaseUpdate=ae,y.shared.pending=null}}while(!0);if(oe===null&&(R=ce),y.baseState=R,y.firstBaseUpdate=Y,y.lastBaseUpdate=oe,o=y.shared.interleaved,o!==null){y=o;do T|=y.lane,y=y.next;while(y!==o)}else N===null&&(y.shared.lanes=0);_s|=T,s.lanes=T,s.memoizedState=ce}}function tw(s,o,f){if(s=o.effects,o.effects=null,s!==null)for(o=0;o<s.length;o++){var g=s[o],y=g.callback;if(y!==null){if(g.callback=null,g=f,typeof y!="function")throw Error(n(191,y));y.call(g)}}}var Zo={},Ir=Wi(Zo),el=Wi(Zo),tl=Wi(Zo);function Es(s){if(s===Zo)throw Error(n(174));return s}function oh(s,o){switch(rt(tl,o),rt(el,s),rt(Ir,Zo),s=o.nodeType,s){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:It(null,"");break;default:s=s===8?o.parentNode:o,o=s.namespaceURI||null,s=s.tagName,o=It(o,s)}ot(Ir),rt(Ir,o)}function Ta(){ot(Ir),ot(el),ot(tl)}function nw(s){Es(tl.current);var o=Es(Ir.current),f=It(o,s.type);o!==f&&(rt(el,s),rt(Ir,f))}function lh(s){el.current===s&&(ot(Ir),ot(el))}var ht=Wi(0);function lu(s){for(var o=s;o!==null;){if(o.tag===13){var f=o.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ch=[];function uh(){for(var s=0;s<ch.length;s++)ch[s]._workInProgressVersionPrimary=null;ch.length=0}var cu=O.ReactCurrentDispatcher,dh=O.ReactCurrentBatchConfig,Ts=0,mt=null,Ot=null,Lt=null,uu=!1,nl=!1,rl=0,cI=0;function rn(){throw Error(n(321))}function fh(s,o){if(o===null)return!1;for(var f=0;f<o.length&&f<s.length;f++)if(!vr(s[f],o[f]))return!1;return!0}function ph(s,o,f,g,y,N){if(Ts=N,mt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,cu.current=s===null||s.memoizedState===null?pI:hI,s=f(g,y),nl){N=0;do{if(nl=!1,rl=0,25<=N)throw Error(n(301));N+=1,Lt=Ot=null,o.updateQueue=null,cu.current=mI,s=f(g,y)}while(nl)}if(cu.current=pu,o=Ot!==null&&Ot.next!==null,Ts=0,Lt=Ot=mt=null,uu=!1,o)throw Error(n(300));return s}function hh(){var s=rl!==0;return rl=0,s}function Dr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?mt.memoizedState=Lt=s:Lt=Lt.next=s,Lt}function Xn(){if(Ot===null){var s=mt.alternate;s=s!==null?s.memoizedState:null}else s=Ot.next;var o=Lt===null?mt.memoizedState:Lt.next;if(o!==null)Lt=o,Ot=s;else{if(s===null)throw Error(n(310));Ot=s,s={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},Lt===null?mt.memoizedState=Lt=s:Lt=Lt.next=s}return Lt}function il(s,o){return typeof o=="function"?o(s):o}function mh(s){var o=Xn(),f=o.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=s;var g=Ot,y=g.baseQueue,N=f.pending;if(N!==null){if(y!==null){var T=y.next;y.next=N.next,N.next=T}g.baseQueue=y=N,f.pending=null}if(y!==null){N=y.next,g=g.baseState;var I=T=null,R=null,Y=N;do{var oe=Y.lane;if((Ts&oe)===oe)R!==null&&(R=R.next={lane:0,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),g=Y.hasEagerState?Y.eagerState:s(g,Y.action);else{var ce={lane:oe,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null};R===null?(I=R=ce,T=g):R=R.next=ce,mt.lanes|=oe,_s|=oe}Y=Y.next}while(Y!==null&&Y!==N);R===null?T=g:R.next=I,vr(g,o.memoizedState)||(kn=!0),o.memoizedState=g,o.baseState=T,o.baseQueue=R,f.lastRenderedState=g}if(s=f.interleaved,s!==null){y=s;do N=y.lane,mt.lanes|=N,_s|=N,y=y.next;while(y!==s)}else y===null&&(f.lanes=0);return[o.memoizedState,f.dispatch]}function gh(s){var o=Xn(),f=o.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=s;var g=f.dispatch,y=f.pending,N=o.memoizedState;if(y!==null){f.pending=null;var T=y=y.next;do N=s(N,T.action),T=T.next;while(T!==y);vr(N,o.memoizedState)||(kn=!0),o.memoizedState=N,o.baseQueue===null&&(o.baseState=N),f.lastRenderedState=N}return[N,g]}function rw(){}function iw(s,o){var f=mt,g=Xn(),y=o(),N=!vr(g.memoizedState,y);if(N&&(g.memoizedState=y,kn=!0),g=g.queue,vh(ow.bind(null,f,g,s),[s]),g.getSnapshot!==o||N||Lt!==null&&Lt.memoizedState.tag&1){if(f.flags|=2048,sl(9,aw.bind(null,f,g,y,o),void 0,null),$t===null)throw Error(n(349));(Ts&30)!==0||sw(f,o,y)}return y}function sw(s,o,f){s.flags|=16384,s={getSnapshot:o,value:f},o=mt.updateQueue,o===null?(o={lastEffect:null,stores:null},mt.updateQueue=o,o.stores=[s]):(f=o.stores,f===null?o.stores=[s]:f.push(s))}function aw(s,o,f,g){o.value=f,o.getSnapshot=g,lw(o)&&cw(s)}function ow(s,o,f){return f(function(){lw(o)&&cw(s)})}function lw(s){var o=s.getSnapshot;s=s.value;try{var f=o();return!vr(s,f)}catch{return!0}}function cw(s){var o=si(s,1);o!==null&&jr(o,s,1,-1)}function uw(s){var o=Dr();return typeof s=="function"&&(s=s()),o.memoizedState=o.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:il,lastRenderedState:s},o.queue=s,s=s.dispatch=fI.bind(null,mt,s),[o.memoizedState,s]}function sl(s,o,f,g){return s={tag:s,create:o,destroy:f,deps:g,next:null},o=mt.updateQueue,o===null?(o={lastEffect:null,stores:null},mt.updateQueue=o,o.lastEffect=s.next=s):(f=o.lastEffect,f===null?o.lastEffect=s.next=s:(g=f.next,f.next=s,s.next=g,o.lastEffect=s)),s}function dw(){return Xn().memoizedState}function du(s,o,f,g){var y=Dr();mt.flags|=s,y.memoizedState=sl(1|o,f,void 0,g===void 0?null:g)}function fu(s,o,f,g){var y=Xn();g=g===void 0?null:g;var N=void 0;if(Ot!==null){var T=Ot.memoizedState;if(N=T.destroy,g!==null&&fh(g,T.deps)){y.memoizedState=sl(o,f,N,g);return}}mt.flags|=s,y.memoizedState=sl(1|o,f,N,g)}function fw(s,o){return du(8390656,8,s,o)}function vh(s,o){return fu(2048,8,s,o)}function pw(s,o){return fu(4,2,s,o)}function hw(s,o){return fu(4,4,s,o)}function mw(s,o){if(typeof o=="function")return s=s(),o(s),function(){o(null)};if(o!=null)return s=s(),o.current=s,function(){o.current=null}}function gw(s,o,f){return f=f!=null?f.concat([s]):null,fu(4,4,mw.bind(null,o,s),f)}function xh(){}function vw(s,o){var f=Xn();o=o===void 0?null:o;var g=f.memoizedState;return g!==null&&o!==null&&fh(o,g[1])?g[0]:(f.memoizedState=[s,o],s)}function xw(s,o){var f=Xn();o=o===void 0?null:o;var g=f.memoizedState;return g!==null&&o!==null&&fh(o,g[1])?g[0]:(s=s(),f.memoizedState=[s,o],s)}function yw(s,o,f){return(Ts&21)===0?(s.baseState&&(s.baseState=!1,kn=!0),s.memoizedState=f):(vr(f,o)||(f=Yy(),mt.lanes|=f,_s|=f,s.baseState=!0),o)}function uI(s,o){var f=Xe;Xe=f!==0&&4>f?f:4,s(!0);var g=dh.transition;dh.transition={};try{s(!1),o()}finally{Xe=f,dh.transition=g}}function bw(){return Xn().memoizedState}function dI(s,o,f){var g=Ji(s);if(f={lane:g,action:f,hasEagerState:!1,eagerState:null,next:null},ww(s))jw(o,f);else if(f=Jb(s,o,f,g),f!==null){var y=hn();jr(f,s,g,y),Sw(f,o,g)}}function fI(s,o,f){var g=Ji(s),y={lane:g,action:f,hasEagerState:!1,eagerState:null,next:null};if(ww(s))jw(o,y);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=o.lastRenderedReducer,N!==null))try{var T=o.lastRenderedState,I=N(T,f);if(y.hasEagerState=!0,y.eagerState=I,vr(I,T)){var R=o.interleaved;R===null?(y.next=y,sh(o)):(y.next=R.next,R.next=y),o.interleaved=y;return}}catch{}finally{}f=Jb(s,o,y,g),f!==null&&(y=hn(),jr(f,s,g,y),Sw(f,o,g))}}function ww(s){var o=s.alternate;return s===mt||o!==null&&o===mt}function jw(s,o){nl=uu=!0;var f=s.pending;f===null?o.next=o:(o.next=f.next,f.next=o),s.pending=o}function Sw(s,o,f){if((f&4194240)!==0){var g=o.lanes;g&=s.pendingLanes,f|=g,o.lanes=f,bp(s,f)}}var pu={readContext:Yn,useCallback:rn,useContext:rn,useEffect:rn,useImperativeHandle:rn,useInsertionEffect:rn,useLayoutEffect:rn,useMemo:rn,useReducer:rn,useRef:rn,useState:rn,useDebugValue:rn,useDeferredValue:rn,useTransition:rn,useMutableSource:rn,useSyncExternalStore:rn,useId:rn,unstable_isNewReconciler:!1},pI={readContext:Yn,useCallback:function(s,o){return Dr().memoizedState=[s,o===void 0?null:o],s},useContext:Yn,useEffect:fw,useImperativeHandle:function(s,o,f){return f=f!=null?f.concat([s]):null,du(4194308,4,mw.bind(null,o,s),f)},useLayoutEffect:function(s,o){return du(4194308,4,s,o)},useInsertionEffect:function(s,o){return du(4,2,s,o)},useMemo:function(s,o){var f=Dr();return o=o===void 0?null:o,s=s(),f.memoizedState=[s,o],s},useReducer:function(s,o,f){var g=Dr();return o=f!==void 0?f(o):o,g.memoizedState=g.baseState=o,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:o},g.queue=s,s=s.dispatch=dI.bind(null,mt,s),[g.memoizedState,s]},useRef:function(s){var o=Dr();return s={current:s},o.memoizedState=s},useState:uw,useDebugValue:xh,useDeferredValue:function(s){return Dr().memoizedState=s},useTransition:function(){var s=uw(!1),o=s[0];return s=uI.bind(null,s[1]),Dr().memoizedState=s,[o,s]},useMutableSource:function(){},useSyncExternalStore:function(s,o,f){var g=mt,y=Dr();if(dt){if(f===void 0)throw Error(n(407));f=f()}else{if(f=o(),$t===null)throw Error(n(349));(Ts&30)!==0||sw(g,o,f)}y.memoizedState=f;var N={value:f,getSnapshot:o};return y.queue=N,fw(ow.bind(null,g,N,s),[s]),g.flags|=2048,sl(9,aw.bind(null,g,N,f,o),void 0,null),f},useId:function(){var s=Dr(),o=$t.identifierPrefix;if(dt){var f=ii,g=ri;f=(g&~(1<<32-gr(g)-1)).toString(32)+f,o=":"+o+"R"+f,f=rl++,0<f&&(o+="H"+f.toString(32)),o+=":"}else f=cI++,o=":"+o+"r"+f.toString(32)+":";return s.memoizedState=o},unstable_isNewReconciler:!1},hI={readContext:Yn,useCallback:vw,useContext:Yn,useEffect:vh,useImperativeHandle:gw,useInsertionEffect:pw,useLayoutEffect:hw,useMemo:xw,useReducer:mh,useRef:dw,useState:function(){return mh(il)},useDebugValue:xh,useDeferredValue:function(s){var o=Xn();return yw(o,Ot.memoizedState,s)},useTransition:function(){var s=mh(il)[0],o=Xn().memoizedState;return[s,o]},useMutableSource:rw,useSyncExternalStore:iw,useId:bw,unstable_isNewReconciler:!1},mI={readContext:Yn,useCallback:vw,useContext:Yn,useEffect:vh,useImperativeHandle:gw,useInsertionEffect:pw,useLayoutEffect:hw,useMemo:xw,useReducer:gh,useRef:dw,useState:function(){return gh(il)},useDebugValue:xh,useDeferredValue:function(s){var o=Xn();return Ot===null?o.memoizedState=s:yw(o,Ot.memoizedState,s)},useTransition:function(){var s=gh(il)[0],o=Xn().memoizedState;return[s,o]},useMutableSource:rw,useSyncExternalStore:iw,useId:bw,unstable_isNewReconciler:!1};function yr(s,o){if(s&&s.defaultProps){o=W({},o),s=s.defaultProps;for(var f in s)o[f]===void 0&&(o[f]=s[f]);return o}return o}function yh(s,o,f,g){o=s.memoizedState,f=f(g,o),f=f==null?o:W({},o,f),s.memoizedState=f,s.lanes===0&&(s.updateQueue.baseState=f)}var hu={isMounted:function(s){return(s=s._reactInternals)?Ns(s)===s:!1},enqueueSetState:function(s,o,f){s=s._reactInternals;var g=hn(),y=Ji(s),N=ai(g,y);N.payload=o,f!=null&&(N.callback=f),o=Gi(s,N,y),o!==null&&(jr(o,s,y,g),au(o,s,y))},enqueueReplaceState:function(s,o,f){s=s._reactInternals;var g=hn(),y=Ji(s),N=ai(g,y);N.tag=1,N.payload=o,f!=null&&(N.callback=f),o=Gi(s,N,y),o!==null&&(jr(o,s,y,g),au(o,s,y))},enqueueForceUpdate:function(s,o){s=s._reactInternals;var f=hn(),g=Ji(s),y=ai(f,g);y.tag=2,o!=null&&(y.callback=o),o=Gi(s,y,g),o!==null&&(jr(o,s,g,f),au(o,s,g))}};function Nw(s,o,f,g,y,N,T){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,N,T):o.prototype&&o.prototype.isPureReactComponent?!qo(f,g)||!qo(y,N):!0}function kw(s,o,f){var g=!1,y=qi,N=o.contextType;return typeof N=="object"&&N!==null?N=Yn(N):(y=Nn(o)?Ps:nn.current,g=o.contextTypes,N=(g=g!=null)?Na(s,y):qi),o=new o(f,N),s.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=hu,s.stateNode=o,o._reactInternals=s,g&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=y,s.__reactInternalMemoizedMaskedChildContext=N),o}function Pw(s,o,f,g){s=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(f,g),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(f,g),o.state!==s&&hu.enqueueReplaceState(o,o.state,null)}function bh(s,o,f,g){var y=s.stateNode;y.props=f,y.state=s.memoizedState,y.refs={},ah(s);var N=o.contextType;typeof N=="object"&&N!==null?y.context=Yn(N):(N=Nn(o)?Ps:nn.current,y.context=Na(s,N)),y.state=s.memoizedState,N=o.getDerivedStateFromProps,typeof N=="function"&&(yh(s,o,N,f),y.state=s.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(o=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),o!==y.state&&hu.enqueueReplaceState(y,y.state,null),ou(s,f,y,g),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308)}function _a(s,o){try{var f="",g=o;do f+=te(g),g=g.return;while(g);var y=f}catch(N){y=`
39
+ Error generating stack: `+N.message+`
40
+ `+N.stack}return{value:s,source:o,stack:y,digest:null}}function wh(s,o,f){return{value:s,source:null,stack:f??null,digest:o??null}}function jh(s,o){try{console.error(o.value)}catch(f){setTimeout(function(){throw f})}}var gI=typeof WeakMap=="function"?WeakMap:Map;function Cw(s,o,f){f=ai(-1,f),f.tag=3,f.payload={element:null};var g=o.value;return f.callback=function(){wu||(wu=!0,Lh=g),jh(s,o)},f}function Ow(s,o,f){f=ai(-1,f),f.tag=3;var g=s.type.getDerivedStateFromError;if(typeof g=="function"){var y=o.value;f.payload=function(){return g(y)},f.callback=function(){jh(s,o)}}var N=s.stateNode;return N!==null&&typeof N.componentDidCatch=="function"&&(f.callback=function(){jh(s,o),typeof g!="function"&&(Xi===null?Xi=new Set([this]):Xi.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})}),f}function Aw(s,o,f){var g=s.pingCache;if(g===null){g=s.pingCache=new gI;var y=new Set;g.set(o,y)}else y=g.get(o),y===void 0&&(y=new Set,g.set(o,y));y.has(f)||(y.add(f),s=EI.bind(null,s,o,f),o.then(s,s))}function Ew(s){do{var o;if((o=s.tag===13)&&(o=s.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return s;s=s.return}while(s!==null);return null}function Tw(s,o,f,g,y){return(s.mode&1)===0?(s===o?s.flags|=65536:(s.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(o=ai(-1,1),o.tag=2,Gi(f,o,1))),f.lanes|=1),s):(s.flags|=65536,s.lanes=y,s)}var vI=O.ReactCurrentOwner,kn=!1;function pn(s,o,f,g){o.child=s===null?Qb(o,null,f,g):Oa(o,s.child,f,g)}function _w(s,o,f,g,y){f=f.render;var N=o.ref;return Ea(o,y),g=ph(s,o,f,g,N,y),f=hh(),s!==null&&!kn?(o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~y,oi(s,o,y)):(dt&&f&&Xp(o),o.flags|=1,pn(s,o,g,y),o.child)}function Mw(s,o,f,g,y){if(s===null){var N=f.type;return typeof N=="function"&&!Wh(N)&&N.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(o.tag=15,o.type=N,Iw(s,o,N,g,y)):(s=Cu(f.type,null,g,o,o.mode,y),s.ref=o.ref,s.return=o,o.child=s)}if(N=s.child,(s.lanes&y)===0){var T=N.memoizedProps;if(f=f.compare,f=f!==null?f:qo,f(T,g)&&s.ref===o.ref)return oi(s,o,y)}return o.flags|=1,s=es(N,g),s.ref=o.ref,s.return=o,o.child=s}function Iw(s,o,f,g,y){if(s!==null){var N=s.memoizedProps;if(qo(N,g)&&s.ref===o.ref)if(kn=!1,o.pendingProps=g=N,(s.lanes&y)!==0)(s.flags&131072)!==0&&(kn=!0);else return o.lanes=s.lanes,oi(s,o,y)}return Sh(s,o,f,g,y)}function Dw(s,o,f){var g=o.pendingProps,y=g.children,N=s!==null?s.memoizedState:null;if(g.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},rt(Ia,$n),$n|=f;else{if((f&1073741824)===0)return s=N!==null?N.baseLanes|f:f,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:s,cachePool:null,transitions:null},o.updateQueue=null,rt(Ia,$n),$n|=s,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=N!==null?N.baseLanes:f,rt(Ia,$n),$n|=g}else N!==null?(g=N.baseLanes|f,o.memoizedState=null):g=f,rt(Ia,$n),$n|=g;return pn(s,o,y,f),o.child}function Rw(s,o){var f=o.ref;(s===null&&f!==null||s!==null&&s.ref!==f)&&(o.flags|=512,o.flags|=2097152)}function Sh(s,o,f,g,y){var N=Nn(f)?Ps:nn.current;return N=Na(o,N),Ea(o,y),f=ph(s,o,f,g,N,y),g=hh(),s!==null&&!kn?(o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~y,oi(s,o,y)):(dt&&g&&Xp(o),o.flags|=1,pn(s,o,f,y),o.child)}function Lw(s,o,f,g,y){if(Nn(f)){var N=!0;Jc(o)}else N=!1;if(Ea(o,y),o.stateNode===null)gu(s,o),kw(o,f,g),bh(o,f,g,y),g=!0;else if(s===null){var T=o.stateNode,I=o.memoizedProps;T.props=I;var R=T.context,Y=f.contextType;typeof Y=="object"&&Y!==null?Y=Yn(Y):(Y=Nn(f)?Ps:nn.current,Y=Na(o,Y));var oe=f.getDerivedStateFromProps,ce=typeof oe=="function"||typeof T.getSnapshotBeforeUpdate=="function";ce||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(I!==g||R!==Y)&&Pw(o,T,g,Y),Hi=!1;var ae=o.memoizedState;T.state=ae,ou(o,g,T,y),R=o.memoizedState,I!==g||ae!==R||Sn.current||Hi?(typeof oe=="function"&&(yh(o,f,oe,g),R=o.memoizedState),(I=Hi||Nw(o,f,I,g,ae,R,Y))?(ce||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=g,o.memoizedState=R),T.props=g,T.state=R,T.context=Y,g=I):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),g=!1)}else{T=o.stateNode,Zb(s,o),I=o.memoizedProps,Y=o.type===o.elementType?I:yr(o.type,I),T.props=Y,ce=o.pendingProps,ae=T.context,R=f.contextType,typeof R=="object"&&R!==null?R=Yn(R):(R=Nn(f)?Ps:nn.current,R=Na(o,R));var ge=f.getDerivedStateFromProps;(oe=typeof ge=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(I!==ce||ae!==R)&&Pw(o,T,g,R),Hi=!1,ae=o.memoizedState,T.state=ae,ou(o,g,T,y);var ye=o.memoizedState;I!==ce||ae!==ye||Sn.current||Hi?(typeof ge=="function"&&(yh(o,f,ge,g),ye=o.memoizedState),(Y=Hi||Nw(o,f,Y,g,ae,ye,R)||!1)?(oe||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(g,ye,R),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(g,ye,R)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||I===s.memoizedProps&&ae===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||I===s.memoizedProps&&ae===s.memoizedState||(o.flags|=1024),o.memoizedProps=g,o.memoizedState=ye),T.props=g,T.state=ye,T.context=R,g=Y):(typeof T.componentDidUpdate!="function"||I===s.memoizedProps&&ae===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||I===s.memoizedProps&&ae===s.memoizedState||(o.flags|=1024),g=!1)}return Nh(s,o,f,g,N,y)}function Nh(s,o,f,g,y,N){Rw(s,o);var T=(o.flags&128)!==0;if(!g&&!T)return y&&Vb(o,f,!1),oi(s,o,N);g=o.stateNode,vI.current=o;var I=T&&typeof f.getDerivedStateFromError!="function"?null:g.render();return o.flags|=1,s!==null&&T?(o.child=Oa(o,s.child,null,N),o.child=Oa(o,null,I,N)):pn(s,o,I,N),o.memoizedState=g.state,y&&Vb(o,f,!0),o.child}function $w(s){var o=s.stateNode;o.pendingContext?Fb(s,o.pendingContext,o.pendingContext!==o.context):o.context&&Fb(s,o.context,!1),oh(s,o.containerInfo)}function zw(s,o,f,g,y){return Ca(),eh(y),o.flags|=256,pn(s,o,f,g),o.child}var kh={dehydrated:null,treeContext:null,retryLane:0};function Ph(s){return{baseLanes:s,cachePool:null,transitions:null}}function Fw(s,o,f){var g=o.pendingProps,y=ht.current,N=!1,T=(o.flags&128)!==0,I;if((I=T)||(I=s!==null&&s.memoizedState===null?!1:(y&2)!==0),I?(N=!0,o.flags&=-129):(s===null||s.memoizedState!==null)&&(y|=1),rt(ht,y&1),s===null)return Zp(o),s=o.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((o.mode&1)===0?o.lanes=1:s.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(T=g.children,s=g.fallback,N?(g=o.mode,N=o.child,T={mode:"hidden",children:T},(g&1)===0&&N!==null?(N.childLanes=0,N.pendingProps=T):N=Ou(T,g,0,null),s=Rs(s,g,f,null),N.return=o,s.return=o,N.sibling=s,o.child=N,o.child.memoizedState=Ph(f),o.memoizedState=kh,s):Ch(o,T));if(y=s.memoizedState,y!==null&&(I=y.dehydrated,I!==null))return xI(s,o,T,g,I,y,f);if(N){N=g.fallback,T=o.mode,y=s.child,I=y.sibling;var R={mode:"hidden",children:g.children};return(T&1)===0&&o.child!==y?(g=o.child,g.childLanes=0,g.pendingProps=R,o.deletions=null):(g=es(y,R),g.subtreeFlags=y.subtreeFlags&14680064),I!==null?N=es(I,N):(N=Rs(N,T,f,null),N.flags|=2),N.return=o,g.return=o,g.sibling=N,o.child=g,g=N,N=o.child,T=s.child.memoizedState,T=T===null?Ph(f):{baseLanes:T.baseLanes|f,cachePool:null,transitions:T.transitions},N.memoizedState=T,N.childLanes=s.childLanes&~f,o.memoizedState=kh,g}return N=s.child,s=N.sibling,g=es(N,{mode:"visible",children:g.children}),(o.mode&1)===0&&(g.lanes=f),g.return=o,g.sibling=null,s!==null&&(f=o.deletions,f===null?(o.deletions=[s],o.flags|=16):f.push(s)),o.child=g,o.memoizedState=null,g}function Ch(s,o){return o=Ou({mode:"visible",children:o},s.mode,0,null),o.return=s,s.child=o}function mu(s,o,f,g){return g!==null&&eh(g),Oa(o,s.child,null,f),s=Ch(o,o.pendingProps.children),s.flags|=2,o.memoizedState=null,s}function xI(s,o,f,g,y,N,T){if(f)return o.flags&256?(o.flags&=-257,g=wh(Error(n(422))),mu(s,o,T,g)):o.memoizedState!==null?(o.child=s.child,o.flags|=128,null):(N=g.fallback,y=o.mode,g=Ou({mode:"visible",children:g.children},y,0,null),N=Rs(N,y,T,null),N.flags|=2,g.return=o,N.return=o,g.sibling=N,o.child=g,(o.mode&1)!==0&&Oa(o,s.child,null,T),o.child.memoizedState=Ph(T),o.memoizedState=kh,N);if((o.mode&1)===0)return mu(s,o,T,null);if(y.data==="$!"){if(g=y.nextSibling&&y.nextSibling.dataset,g)var I=g.dgst;return g=I,N=Error(n(419)),g=wh(N,g,void 0),mu(s,o,T,g)}if(I=(T&s.childLanes)!==0,kn||I){if(g=$t,g!==null){switch(T&-T){case 4:y=2;break;case 16:y=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:y=32;break;case 536870912:y=268435456;break;default:y=0}y=(y&(g.suspendedLanes|T))!==0?0:y,y!==0&&y!==N.retryLane&&(N.retryLane=y,si(s,y),jr(g,s,y,-1))}return Uh(),g=wh(Error(n(421))),mu(s,o,T,g)}return y.data==="$?"?(o.flags|=128,o.child=s.child,o=TI.bind(null,s),y._reactRetry=o,null):(s=N.treeContext,Ln=Ui(y.nextSibling),Rn=o,dt=!0,xr=null,s!==null&&(Hn[Gn++]=ri,Hn[Gn++]=ii,Hn[Gn++]=Cs,ri=s.id,ii=s.overflow,Cs=o),o=Ch(o,g.children),o.flags|=4096,o)}function Bw(s,o,f){s.lanes|=o;var g=s.alternate;g!==null&&(g.lanes|=o),ih(s.return,o,f)}function Oh(s,o,f,g,y){var N=s.memoizedState;N===null?s.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:g,tail:f,tailMode:y}:(N.isBackwards=o,N.rendering=null,N.renderingStartTime=0,N.last=g,N.tail=f,N.tailMode=y)}function Vw(s,o,f){var g=o.pendingProps,y=g.revealOrder,N=g.tail;if(pn(s,o,g.children,f),g=ht.current,(g&2)!==0)g=g&1|2,o.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=o.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Bw(s,f,o);else if(s.tag===19)Bw(s,f,o);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break e;for(;s.sibling===null;){if(s.return===null||s.return===o)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}g&=1}if(rt(ht,g),(o.mode&1)===0)o.memoizedState=null;else switch(y){case"forwards":for(f=o.child,y=null;f!==null;)s=f.alternate,s!==null&&lu(s)===null&&(y=f),f=f.sibling;f=y,f===null?(y=o.child,o.child=null):(y=f.sibling,f.sibling=null),Oh(o,!1,y,f,N);break;case"backwards":for(f=null,y=o.child,o.child=null;y!==null;){if(s=y.alternate,s!==null&&lu(s)===null){o.child=y;break}s=y.sibling,y.sibling=f,f=y,y=s}Oh(o,!0,f,null,N);break;case"together":Oh(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function gu(s,o){(o.mode&1)===0&&s!==null&&(s.alternate=null,o.alternate=null,o.flags|=2)}function oi(s,o,f){if(s!==null&&(o.dependencies=s.dependencies),_s|=o.lanes,(f&o.childLanes)===0)return null;if(s!==null&&o.child!==s.child)throw Error(n(153));if(o.child!==null){for(s=o.child,f=es(s,s.pendingProps),o.child=f,f.return=o;s.sibling!==null;)s=s.sibling,f=f.sibling=es(s,s.pendingProps),f.return=o;f.sibling=null}return o.child}function yI(s,o,f){switch(o.tag){case 3:$w(o),Ca();break;case 5:nw(o);break;case 1:Nn(o.type)&&Jc(o);break;case 4:oh(o,o.stateNode.containerInfo);break;case 10:var g=o.type._context,y=o.memoizedProps.value;rt(iu,g._currentValue),g._currentValue=y;break;case 13:if(g=o.memoizedState,g!==null)return g.dehydrated!==null?(rt(ht,ht.current&1),o.flags|=128,null):(f&o.child.childLanes)!==0?Fw(s,o,f):(rt(ht,ht.current&1),s=oi(s,o,f),s!==null?s.sibling:null);rt(ht,ht.current&1);break;case 19:if(g=(f&o.childLanes)!==0,(s.flags&128)!==0){if(g)return Vw(s,o,f);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),rt(ht,ht.current),g)break;return null;case 22:case 23:return o.lanes=0,Dw(s,o,f)}return oi(s,o,f)}var Uw,Ah,Ww,qw;Uw=function(s,o){for(var f=o.child;f!==null;){if(f.tag===5||f.tag===6)s.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===o)break;for(;f.sibling===null;){if(f.return===null||f.return===o)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},Ah=function(){},Ww=function(s,o,f,g){var y=s.memoizedProps;if(y!==g){s=o.stateNode,Es(Ir.current);var N=null;switch(f){case"input":y=De(s,y),g=De(s,g),N=[];break;case"select":y=W({},y,{value:void 0}),g=W({},g,{value:void 0}),N=[];break;case"textarea":y=he(s,y),g=he(s,g),N=[];break;default:typeof y.onClick!="function"&&typeof g.onClick=="function"&&(s.onclick=Yc)}Jr(f,g);var T;f=null;for(Y in y)if(!g.hasOwnProperty(Y)&&y.hasOwnProperty(Y)&&y[Y]!=null)if(Y==="style"){var I=y[Y];for(T in I)I.hasOwnProperty(T)&&(f||(f={}),f[T]="")}else Y!=="dangerouslySetInnerHTML"&&Y!=="children"&&Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&Y!=="autoFocus"&&(i.hasOwnProperty(Y)?N||(N=[]):(N=N||[]).push(Y,null));for(Y in g){var R=g[Y];if(I=y!=null?y[Y]:void 0,g.hasOwnProperty(Y)&&R!==I&&(R!=null||I!=null))if(Y==="style")if(I){for(T in I)!I.hasOwnProperty(T)||R&&R.hasOwnProperty(T)||(f||(f={}),f[T]="");for(T in R)R.hasOwnProperty(T)&&I[T]!==R[T]&&(f||(f={}),f[T]=R[T])}else f||(N||(N=[]),N.push(Y,f)),f=R;else Y==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,I=I?I.__html:void 0,R!=null&&I!==R&&(N=N||[]).push(Y,R)):Y==="children"?typeof R!="string"&&typeof R!="number"||(N=N||[]).push(Y,""+R):Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&(i.hasOwnProperty(Y)?(R!=null&&Y==="onScroll"&&at("scroll",s),N||I===R||(N=[])):(N=N||[]).push(Y,R))}f&&(N=N||[]).push("style",f);var Y=N;(o.updateQueue=Y)&&(o.flags|=4)}},qw=function(s,o,f,g){f!==g&&(o.flags|=4)};function al(s,o){if(!dt)switch(s.tailMode){case"hidden":o=s.tail;for(var f=null;o!==null;)o.alternate!==null&&(f=o),o=o.sibling;f===null?s.tail=null:f.sibling=null;break;case"collapsed":f=s.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?o||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function sn(s){var o=s.alternate!==null&&s.alternate.child===s.child,f=0,g=0;if(o)for(var y=s.child;y!==null;)f|=y.lanes|y.childLanes,g|=y.subtreeFlags&14680064,g|=y.flags&14680064,y.return=s,y=y.sibling;else for(y=s.child;y!==null;)f|=y.lanes|y.childLanes,g|=y.subtreeFlags,g|=y.flags,y.return=s,y=y.sibling;return s.subtreeFlags|=g,s.childLanes=f,o}function bI(s,o,f){var g=o.pendingProps;switch(Qp(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sn(o),null;case 1:return Nn(o.type)&&Qc(),sn(o),null;case 3:return g=o.stateNode,Ta(),ot(Sn),ot(nn),uh(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(s===null||s.child===null)&&(nu(o)?o.flags|=4:s===null||s.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,xr!==null&&(Fh(xr),xr=null))),Ah(s,o),sn(o),null;case 5:lh(o);var y=Es(tl.current);if(f=o.type,s!==null&&o.stateNode!=null)Ww(s,o,f,g,y),s.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!g){if(o.stateNode===null)throw Error(n(166));return sn(o),null}if(s=Es(Ir.current),nu(o)){g=o.stateNode,f=o.type;var N=o.memoizedProps;switch(g[Mr]=o,g[Xo]=N,s=(o.mode&1)!==0,f){case"dialog":at("cancel",g),at("close",g);break;case"iframe":case"object":case"embed":at("load",g);break;case"video":case"audio":for(y=0;y<Ho.length;y++)at(Ho[y],g);break;case"source":at("error",g);break;case"img":case"image":case"link":at("error",g),at("load",g);break;case"details":at("toggle",g);break;case"input":Je(g,N),at("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!N.multiple},at("invalid",g);break;case"textarea":ke(g,N),at("invalid",g)}Jr(f,N),y=null;for(var T in N)if(N.hasOwnProperty(T)){var I=N[T];T==="children"?typeof I=="string"?g.textContent!==I&&(N.suppressHydrationWarning!==!0&&Gc(g.textContent,I,s),y=["children",I]):typeof I=="number"&&g.textContent!==""+I&&(N.suppressHydrationWarning!==!0&&Gc(g.textContent,I,s),y=["children",""+I]):i.hasOwnProperty(T)&&I!=null&&T==="onScroll"&&at("scroll",g)}switch(f){case"input":Oe(g),Mn(g,N,!0);break;case"textarea":Oe(g),Ze(g);break;case"select":case"option":break;default:typeof N.onClick=="function"&&(g.onclick=Yc)}g=y,o.updateQueue=g,g!==null&&(o.flags|=4)}else{T=y.nodeType===9?y:y.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=Ct(f)),s==="http://www.w3.org/1999/xhtml"?f==="script"?(s=T.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof g.is=="string"?s=T.createElement(f,{is:g.is}):(s=T.createElement(f),f==="select"&&(T=s,g.multiple?T.multiple=!0:g.size&&(T.size=g.size))):s=T.createElementNS(s,f),s[Mr]=o,s[Xo]=g,Uw(s,o,!1,!1),o.stateNode=s;e:{switch(T=Tr(f,g),f){case"dialog":at("cancel",s),at("close",s),y=g;break;case"iframe":case"object":case"embed":at("load",s),y=g;break;case"video":case"audio":for(y=0;y<Ho.length;y++)at(Ho[y],s);y=g;break;case"source":at("error",s),y=g;break;case"img":case"image":case"link":at("error",s),at("load",s),y=g;break;case"details":at("toggle",s),y=g;break;case"input":Je(s,g),y=De(s,g),at("invalid",s);break;case"option":y=g;break;case"select":s._wrapperState={wasMultiple:!!g.multiple},y=W({},g,{value:void 0}),at("invalid",s);break;case"textarea":ke(s,g),y=he(s,g),at("invalid",s);break;default:y=g}Jr(f,y),I=y;for(N in I)if(I.hasOwnProperty(N)){var R=I[N];N==="style"?fa(s,R):N==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&un(s,R)):N==="children"?typeof R=="string"?(f!=="textarea"||R!=="")&&Ge(s,R):typeof R=="number"&&Ge(s,""+R):N!=="suppressContentEditableWarning"&&N!=="suppressHydrationWarning"&&N!=="autoFocus"&&(i.hasOwnProperty(N)?R!=null&&N==="onScroll"&&at("scroll",s):R!=null&&E(s,N,R,T))}switch(f){case"input":Oe(s),Mn(s,g,!1);break;case"textarea":Oe(s),Ze(s);break;case"option":g.value!=null&&s.setAttribute("value",""+Se(g.value));break;case"select":s.multiple=!!g.multiple,N=g.value,N!=null?jn(s,!!g.multiple,N,!1):g.defaultValue!=null&&jn(s,!!g.multiple,g.defaultValue,!0);break;default:typeof y.onClick=="function"&&(s.onclick=Yc)}switch(f){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return sn(o),null;case 6:if(s&&o.stateNode!=null)qw(s,o,s.memoizedProps,g);else{if(typeof g!="string"&&o.stateNode===null)throw Error(n(166));if(f=Es(tl.current),Es(Ir.current),nu(o)){if(g=o.stateNode,f=o.memoizedProps,g[Mr]=o,(N=g.nodeValue!==f)&&(s=Rn,s!==null))switch(s.tag){case 3:Gc(g.nodeValue,f,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&Gc(g.nodeValue,f,(s.mode&1)!==0)}N&&(o.flags|=4)}else g=(f.nodeType===9?f:f.ownerDocument).createTextNode(g),g[Mr]=o,o.stateNode=g}return sn(o),null;case 13:if(ot(ht),g=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(dt&&Ln!==null&&(o.mode&1)!==0&&(o.flags&128)===0)Gb(),Ca(),o.flags|=98560,N=!1;else if(N=nu(o),g!==null&&g.dehydrated!==null){if(s===null){if(!N)throw Error(n(318));if(N=o.memoizedState,N=N!==null?N.dehydrated:null,!N)throw Error(n(317));N[Mr]=o}else Ca(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;sn(o),N=!1}else xr!==null&&(Fh(xr),xr=null),N=!0;if(!N)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=f,o):(g=g!==null,g!==(s!==null&&s.memoizedState!==null)&&g&&(o.child.flags|=8192,(o.mode&1)!==0&&(s===null||(ht.current&1)!==0?At===0&&(At=3):Uh())),o.updateQueue!==null&&(o.flags|=4),sn(o),null);case 4:return Ta(),Ah(s,o),s===null&&Go(o.stateNode.containerInfo),sn(o),null;case 10:return rh(o.type._context),sn(o),null;case 17:return Nn(o.type)&&Qc(),sn(o),null;case 19:if(ot(ht),N=o.memoizedState,N===null)return sn(o),null;if(g=(o.flags&128)!==0,T=N.rendering,T===null)if(g)al(N,!1);else{if(At!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(T=lu(s),T!==null){for(o.flags|=128,al(N,!1),g=T.updateQueue,g!==null&&(o.updateQueue=g,o.flags|=4),o.subtreeFlags=0,g=f,f=o.child;f!==null;)N=f,s=g,N.flags&=14680066,T=N.alternate,T===null?(N.childLanes=0,N.lanes=s,N.child=null,N.subtreeFlags=0,N.memoizedProps=null,N.memoizedState=null,N.updateQueue=null,N.dependencies=null,N.stateNode=null):(N.childLanes=T.childLanes,N.lanes=T.lanes,N.child=T.child,N.subtreeFlags=0,N.deletions=null,N.memoizedProps=T.memoizedProps,N.memoizedState=T.memoizedState,N.updateQueue=T.updateQueue,N.type=T.type,s=T.dependencies,N.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),f=f.sibling;return rt(ht,ht.current&1|2),o.child}s=s.sibling}N.tail!==null&&wt()>Da&&(o.flags|=128,g=!0,al(N,!1),o.lanes=4194304)}else{if(!g)if(s=lu(T),s!==null){if(o.flags|=128,g=!0,f=s.updateQueue,f!==null&&(o.updateQueue=f,o.flags|=4),al(N,!0),N.tail===null&&N.tailMode==="hidden"&&!T.alternate&&!dt)return sn(o),null}else 2*wt()-N.renderingStartTime>Da&&f!==1073741824&&(o.flags|=128,g=!0,al(N,!1),o.lanes=4194304);N.isBackwards?(T.sibling=o.child,o.child=T):(f=N.last,f!==null?f.sibling=T:o.child=T,N.last=T)}return N.tail!==null?(o=N.tail,N.rendering=o,N.tail=o.sibling,N.renderingStartTime=wt(),o.sibling=null,f=ht.current,rt(ht,g?f&1|2:f&1),o):(sn(o),null);case 22:case 23:return Vh(),g=o.memoizedState!==null,s!==null&&s.memoizedState!==null!==g&&(o.flags|=8192),g&&(o.mode&1)!==0?($n&1073741824)!==0&&(sn(o),o.subtreeFlags&6&&(o.flags|=8192)):sn(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function wI(s,o){switch(Qp(o),o.tag){case 1:return Nn(o.type)&&Qc(),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return Ta(),ot(Sn),ot(nn),uh(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 5:return lh(o),null;case 13:if(ot(ht),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(n(340));Ca()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return ot(ht),null;case 4:return Ta(),null;case 10:return rh(o.type._context),null;case 22:case 23:return Vh(),null;case 24:return null;default:return null}}var vu=!1,an=!1,jI=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Ma(s,o){var f=s.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(g){vt(s,o,g)}else f.current=null}function Eh(s,o,f){try{f()}catch(g){vt(s,o,g)}}var Kw=!1;function SI(s,o){if(Vp=Lc,s=Nb(),Ip(s)){if("selectionStart"in s)var f={start:s.selectionStart,end:s.selectionEnd};else e:{f=(f=s.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var y=g.anchorOffset,N=g.focusNode;g=g.focusOffset;try{f.nodeType,N.nodeType}catch{f=null;break e}var T=0,I=-1,R=-1,Y=0,oe=0,ce=s,ae=null;t:for(;;){for(var ge;ce!==f||y!==0&&ce.nodeType!==3||(I=T+y),ce!==N||g!==0&&ce.nodeType!==3||(R=T+g),ce.nodeType===3&&(T+=ce.nodeValue.length),(ge=ce.firstChild)!==null;)ae=ce,ce=ge;for(;;){if(ce===s)break t;if(ae===f&&++Y===y&&(I=T),ae===N&&++oe===g&&(R=T),(ge=ce.nextSibling)!==null)break;ce=ae,ae=ce.parentNode}ce=ge}f=I===-1||R===-1?null:{start:I,end:R}}else f=null}f=f||{start:0,end:0}}else f=null;for(Up={focusedElem:s,selectionRange:f},Lc=!1,ve=o;ve!==null;)if(o=ve,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,ve=s;else for(;ve!==null;){o=ve;try{var ye=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var be=ye.memoizedProps,jt=ye.memoizedState,U=o.stateNode,z=U.getSnapshotBeforeUpdate(o.elementType===o.type?be:yr(o.type,be),jt);U.__reactInternalSnapshotBeforeUpdate=z}break;case 3:var K=o.stateNode.containerInfo;K.nodeType===1?K.textContent="":K.nodeType===9&&K.documentElement&&K.removeChild(K.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ue){vt(o,o.return,ue)}if(s=o.sibling,s!==null){s.return=o.return,ve=s;break}ve=o.return}return ye=Kw,Kw=!1,ye}function ol(s,o,f){var g=o.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var y=g=g.next;do{if((y.tag&s)===s){var N=y.destroy;y.destroy=void 0,N!==void 0&&Eh(o,f,N)}y=y.next}while(y!==g)}}function xu(s,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var f=o=o.next;do{if((f.tag&s)===s){var g=f.create;f.destroy=g()}f=f.next}while(f!==o)}}function Th(s){var o=s.ref;if(o!==null){var f=s.stateNode;switch(s.tag){case 5:s=f;break;default:s=f}typeof o=="function"?o(s):o.current=s}}function Hw(s){var o=s.alternate;o!==null&&(s.alternate=null,Hw(o)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(o=s.stateNode,o!==null&&(delete o[Mr],delete o[Xo],delete o[Hp],delete o[sI],delete o[aI])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Gw(s){return s.tag===5||s.tag===3||s.tag===4}function Yw(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Gw(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.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 _h(s,o,f){var g=s.tag;if(g===5||g===6)s=s.stateNode,o?f.nodeType===8?f.parentNode.insertBefore(s,o):f.insertBefore(s,o):(f.nodeType===8?(o=f.parentNode,o.insertBefore(s,f)):(o=f,o.appendChild(s)),f=f._reactRootContainer,f!=null||o.onclick!==null||(o.onclick=Yc));else if(g!==4&&(s=s.child,s!==null))for(_h(s,o,f),s=s.sibling;s!==null;)_h(s,o,f),s=s.sibling}function Mh(s,o,f){var g=s.tag;if(g===5||g===6)s=s.stateNode,o?f.insertBefore(s,o):f.appendChild(s);else if(g!==4&&(s=s.child,s!==null))for(Mh(s,o,f),s=s.sibling;s!==null;)Mh(s,o,f),s=s.sibling}var Gt=null,br=!1;function Yi(s,o,f){for(f=f.child;f!==null;)Xw(s,o,f),f=f.sibling}function Xw(s,o,f){if(_r&&typeof _r.onCommitFiberUnmount=="function")try{_r.onCommitFiberUnmount(Tc,f)}catch{}switch(f.tag){case 5:an||Ma(f,o);case 6:var g=Gt,y=br;Gt=null,Yi(s,o,f),Gt=g,br=y,Gt!==null&&(br?(s=Gt,f=f.stateNode,s.nodeType===8?s.parentNode.removeChild(f):s.removeChild(f)):Gt.removeChild(f.stateNode));break;case 18:Gt!==null&&(br?(s=Gt,f=f.stateNode,s.nodeType===8?Kp(s.parentNode,f):s.nodeType===1&&Kp(s,f),zo(s)):Kp(Gt,f.stateNode));break;case 4:g=Gt,y=br,Gt=f.stateNode.containerInfo,br=!0,Yi(s,o,f),Gt=g,br=y;break;case 0:case 11:case 14:case 15:if(!an&&(g=f.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){y=g=g.next;do{var N=y,T=N.destroy;N=N.tag,T!==void 0&&((N&2)!==0||(N&4)!==0)&&Eh(f,o,T),y=y.next}while(y!==g)}Yi(s,o,f);break;case 1:if(!an&&(Ma(f,o),g=f.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=f.memoizedProps,g.state=f.memoizedState,g.componentWillUnmount()}catch(I){vt(f,o,I)}Yi(s,o,f);break;case 21:Yi(s,o,f);break;case 22:f.mode&1?(an=(g=an)||f.memoizedState!==null,Yi(s,o,f),an=g):Yi(s,o,f);break;default:Yi(s,o,f)}}function Qw(s){var o=s.updateQueue;if(o!==null){s.updateQueue=null;var f=s.stateNode;f===null&&(f=s.stateNode=new jI),o.forEach(function(g){var y=_I.bind(null,s,g);f.has(g)||(f.add(g),g.then(y,y))})}}function wr(s,o){var f=o.deletions;if(f!==null)for(var g=0;g<f.length;g++){var y=f[g];try{var N=s,T=o,I=T;e:for(;I!==null;){switch(I.tag){case 5:Gt=I.stateNode,br=!1;break e;case 3:Gt=I.stateNode.containerInfo,br=!0;break e;case 4:Gt=I.stateNode.containerInfo,br=!0;break e}I=I.return}if(Gt===null)throw Error(n(160));Xw(N,T,y),Gt=null,br=!1;var R=y.alternate;R!==null&&(R.return=null),y.return=null}catch(Y){vt(y,o,Y)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)Jw(o,s),o=o.sibling}function Jw(s,o){var f=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(wr(o,s),Rr(s),g&4){try{ol(3,s,s.return),xu(3,s)}catch(be){vt(s,s.return,be)}try{ol(5,s,s.return)}catch(be){vt(s,s.return,be)}}break;case 1:wr(o,s),Rr(s),g&512&&f!==null&&Ma(f,f.return);break;case 5:if(wr(o,s),Rr(s),g&512&&f!==null&&Ma(f,f.return),s.flags&32){var y=s.stateNode;try{Ge(y,"")}catch(be){vt(s,s.return,be)}}if(g&4&&(y=s.stateNode,y!=null)){var N=s.memoizedProps,T=f!==null?f.memoizedProps:N,I=s.type,R=s.updateQueue;if(s.updateQueue=null,R!==null)try{I==="input"&&N.type==="radio"&&N.name!=null&&et(y,N),Tr(I,T);var Y=Tr(I,N);for(T=0;T<R.length;T+=2){var oe=R[T],ce=R[T+1];oe==="style"?fa(y,ce):oe==="dangerouslySetInnerHTML"?un(y,ce):oe==="children"?Ge(y,ce):E(y,oe,ce,Y)}switch(I){case"input":Mt(y,N);break;case"textarea":Me(y,N);break;case"select":var ae=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!N.multiple;var ge=N.value;ge!=null?jn(y,!!N.multiple,ge,!1):ae!==!!N.multiple&&(N.defaultValue!=null?jn(y,!!N.multiple,N.defaultValue,!0):jn(y,!!N.multiple,N.multiple?[]:"",!1))}y[Xo]=N}catch(be){vt(s,s.return,be)}}break;case 6:if(wr(o,s),Rr(s),g&4){if(s.stateNode===null)throw Error(n(162));y=s.stateNode,N=s.memoizedProps;try{y.nodeValue=N}catch(be){vt(s,s.return,be)}}break;case 3:if(wr(o,s),Rr(s),g&4&&f!==null&&f.memoizedState.isDehydrated)try{zo(o.containerInfo)}catch(be){vt(s,s.return,be)}break;case 4:wr(o,s),Rr(s);break;case 13:wr(o,s),Rr(s),y=s.child,y.flags&8192&&(N=y.memoizedState!==null,y.stateNode.isHidden=N,!N||y.alternate!==null&&y.alternate.memoizedState!==null||(Rh=wt())),g&4&&Qw(s);break;case 22:if(oe=f!==null&&f.memoizedState!==null,s.mode&1?(an=(Y=an)||oe,wr(o,s),an=Y):wr(o,s),Rr(s),g&8192){if(Y=s.memoizedState!==null,(s.stateNode.isHidden=Y)&&!oe&&(s.mode&1)!==0)for(ve=s,oe=s.child;oe!==null;){for(ce=ve=oe;ve!==null;){switch(ae=ve,ge=ae.child,ae.tag){case 0:case 11:case 14:case 15:ol(4,ae,ae.return);break;case 1:Ma(ae,ae.return);var ye=ae.stateNode;if(typeof ye.componentWillUnmount=="function"){g=ae,f=ae.return;try{o=g,ye.props=o.memoizedProps,ye.state=o.memoizedState,ye.componentWillUnmount()}catch(be){vt(g,f,be)}}break;case 5:Ma(ae,ae.return);break;case 22:if(ae.memoizedState!==null){t1(ce);continue}}ge!==null?(ge.return=ae,ve=ge):t1(ce)}oe=oe.sibling}e:for(oe=null,ce=s;;){if(ce.tag===5){if(oe===null){oe=ce;try{y=ce.stateNode,Y?(N=y.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none"):(I=ce.stateNode,R=ce.memoizedProps.style,T=R!=null&&R.hasOwnProperty("display")?R.display:null,I.style.display=da("display",T))}catch(be){vt(s,s.return,be)}}}else if(ce.tag===6){if(oe===null)try{ce.stateNode.nodeValue=Y?"":ce.memoizedProps}catch(be){vt(s,s.return,be)}}else if((ce.tag!==22&&ce.tag!==23||ce.memoizedState===null||ce===s)&&ce.child!==null){ce.child.return=ce,ce=ce.child;continue}if(ce===s)break e;for(;ce.sibling===null;){if(ce.return===null||ce.return===s)break e;oe===ce&&(oe=null),ce=ce.return}oe===ce&&(oe=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:wr(o,s),Rr(s),g&4&&Qw(s);break;case 21:break;default:wr(o,s),Rr(s)}}function Rr(s){var o=s.flags;if(o&2){try{e:{for(var f=s.return;f!==null;){if(Gw(f)){var g=f;break e}f=f.return}throw Error(n(160))}switch(g.tag){case 5:var y=g.stateNode;g.flags&32&&(Ge(y,""),g.flags&=-33);var N=Yw(s);Mh(s,N,y);break;case 3:case 4:var T=g.stateNode.containerInfo,I=Yw(s);_h(s,I,T);break;default:throw Error(n(161))}}catch(R){vt(s,s.return,R)}s.flags&=-3}o&4096&&(s.flags&=-4097)}function NI(s,o,f){ve=s,Zw(s)}function Zw(s,o,f){for(var g=(s.mode&1)!==0;ve!==null;){var y=ve,N=y.child;if(y.tag===22&&g){var T=y.memoizedState!==null||vu;if(!T){var I=y.alternate,R=I!==null&&I.memoizedState!==null||an;I=vu;var Y=an;if(vu=T,(an=R)&&!Y)for(ve=y;ve!==null;)T=ve,R=T.child,T.tag===22&&T.memoizedState!==null?n1(y):R!==null?(R.return=T,ve=R):n1(y);for(;N!==null;)ve=N,Zw(N),N=N.sibling;ve=y,vu=I,an=Y}e1(s)}else(y.subtreeFlags&8772)!==0&&N!==null?(N.return=y,ve=N):e1(s)}}function e1(s){for(;ve!==null;){var o=ve;if((o.flags&8772)!==0){var f=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:an||xu(5,o);break;case 1:var g=o.stateNode;if(o.flags&4&&!an)if(f===null)g.componentDidMount();else{var y=o.elementType===o.type?f.memoizedProps:yr(o.type,f.memoizedProps);g.componentDidUpdate(y,f.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var N=o.updateQueue;N!==null&&tw(o,N,g);break;case 3:var T=o.updateQueue;if(T!==null){if(f=null,o.child!==null)switch(o.child.tag){case 5:f=o.child.stateNode;break;case 1:f=o.child.stateNode}tw(o,T,f)}break;case 5:var I=o.stateNode;if(f===null&&o.flags&4){f=I;var R=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&f.focus();break;case"img":R.src&&(f.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var Y=o.alternate;if(Y!==null){var oe=Y.memoizedState;if(oe!==null){var ce=oe.dehydrated;ce!==null&&zo(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}an||o.flags&512&&Th(o)}catch(ae){vt(o,o.return,ae)}}if(o===s){ve=null;break}if(f=o.sibling,f!==null){f.return=o.return,ve=f;break}ve=o.return}}function t1(s){for(;ve!==null;){var o=ve;if(o===s){ve=null;break}var f=o.sibling;if(f!==null){f.return=o.return,ve=f;break}ve=o.return}}function n1(s){for(;ve!==null;){var o=ve;try{switch(o.tag){case 0:case 11:case 15:var f=o.return;try{xu(4,o)}catch(R){vt(o,f,R)}break;case 1:var g=o.stateNode;if(typeof g.componentDidMount=="function"){var y=o.return;try{g.componentDidMount()}catch(R){vt(o,y,R)}}var N=o.return;try{Th(o)}catch(R){vt(o,N,R)}break;case 5:var T=o.return;try{Th(o)}catch(R){vt(o,T,R)}}}catch(R){vt(o,o.return,R)}if(o===s){ve=null;break}var I=o.sibling;if(I!==null){I.return=o.return,ve=I;break}ve=o.return}}var kI=Math.ceil,yu=O.ReactCurrentDispatcher,Ih=O.ReactCurrentOwner,Qn=O.ReactCurrentBatchConfig,Ve=0,$t=null,kt=null,Yt=0,$n=0,Ia=Wi(0),At=0,ll=null,_s=0,bu=0,Dh=0,cl=null,Pn=null,Rh=0,Da=1/0,li=null,wu=!1,Lh=null,Xi=null,ju=!1,Qi=null,Su=0,ul=0,$h=null,Nu=-1,ku=0;function hn(){return(Ve&6)!==0?wt():Nu!==-1?Nu:Nu=wt()}function Ji(s){return(s.mode&1)===0?1:(Ve&2)!==0&&Yt!==0?Yt&-Yt:lI.transition!==null?(ku===0&&(ku=Yy()),ku):(s=Xe,s!==0||(s=window.event,s=s===void 0?16:ib(s.type)),s)}function jr(s,o,f,g){if(50<ul)throw ul=0,$h=null,Error(n(185));Io(s,f,g),((Ve&2)===0||s!==$t)&&(s===$t&&((Ve&2)===0&&(bu|=f),At===4&&Zi(s,Yt)),Cn(s,g),f===1&&Ve===0&&(o.mode&1)===0&&(Da=wt()+500,Zc&&Ki()))}function Cn(s,o){var f=s.callbackNode;lM(s,o);var g=Ic(s,s===$t?Yt:0);if(g===0)f!==null&&Ky(f),s.callbackNode=null,s.callbackPriority=0;else if(o=g&-g,s.callbackPriority!==o){if(f!=null&&Ky(f),o===1)s.tag===0?oI(i1.bind(null,s)):Ub(i1.bind(null,s)),rI(function(){(Ve&6)===0&&Ki()}),f=null;else{switch(Xy(g)){case 1:f=vp;break;case 4:f=Hy;break;case 16:f=Ec;break;case 536870912:f=Gy;break;default:f=Ec}f=f1(f,r1.bind(null,s))}s.callbackPriority=o,s.callbackNode=f}}function r1(s,o){if(Nu=-1,ku=0,(Ve&6)!==0)throw Error(n(327));var f=s.callbackNode;if(Ra()&&s.callbackNode!==f)return null;var g=Ic(s,s===$t?Yt:0);if(g===0)return null;if((g&30)!==0||(g&s.expiredLanes)!==0||o)o=Pu(s,g);else{o=g;var y=Ve;Ve|=2;var N=a1();($t!==s||Yt!==o)&&(li=null,Da=wt()+500,Is(s,o));do try{OI();break}catch(I){s1(s,I)}while(!0);nh(),yu.current=N,Ve=y,kt!==null?o=0:($t=null,Yt=0,o=At)}if(o!==0){if(o===2&&(y=xp(s),y!==0&&(g=y,o=zh(s,y))),o===1)throw f=ll,Is(s,0),Zi(s,g),Cn(s,wt()),f;if(o===6)Zi(s,g);else{if(y=s.current.alternate,(g&30)===0&&!PI(y)&&(o=Pu(s,g),o===2&&(N=xp(s),N!==0&&(g=N,o=zh(s,N))),o===1))throw f=ll,Is(s,0),Zi(s,g),Cn(s,wt()),f;switch(s.finishedWork=y,s.finishedLanes=g,o){case 0:case 1:throw Error(n(345));case 2:Ds(s,Pn,li);break;case 3:if(Zi(s,g),(g&130023424)===g&&(o=Rh+500-wt(),10<o)){if(Ic(s,0)!==0)break;if(y=s.suspendedLanes,(y&g)!==g){hn(),s.pingedLanes|=s.suspendedLanes&y;break}s.timeoutHandle=qp(Ds.bind(null,s,Pn,li),o);break}Ds(s,Pn,li);break;case 4:if(Zi(s,g),(g&4194240)===g)break;for(o=s.eventTimes,y=-1;0<g;){var T=31-gr(g);N=1<<T,T=o[T],T>y&&(y=T),g&=~N}if(g=y,g=wt()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*kI(g/1960))-g,10<g){s.timeoutHandle=qp(Ds.bind(null,s,Pn,li),g);break}Ds(s,Pn,li);break;case 5:Ds(s,Pn,li);break;default:throw Error(n(329))}}}return Cn(s,wt()),s.callbackNode===f?r1.bind(null,s):null}function zh(s,o){var f=cl;return s.current.memoizedState.isDehydrated&&(Is(s,o).flags|=256),s=Pu(s,o),s!==2&&(o=Pn,Pn=f,o!==null&&Fh(o)),s}function Fh(s){Pn===null?Pn=s:Pn.push.apply(Pn,s)}function PI(s){for(var o=s;;){if(o.flags&16384){var f=o.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var g=0;g<f.length;g++){var y=f[g],N=y.getSnapshot;y=y.value;try{if(!vr(N(),y))return!1}catch{return!1}}}if(f=o.child,o.subtreeFlags&16384&&f!==null)f.return=o,o=f;else{if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Zi(s,o){for(o&=~Dh,o&=~bu,s.suspendedLanes|=o,s.pingedLanes&=~o,s=s.expirationTimes;0<o;){var f=31-gr(o),g=1<<f;s[f]=-1,o&=~g}}function i1(s){if((Ve&6)!==0)throw Error(n(327));Ra();var o=Ic(s,0);if((o&1)===0)return Cn(s,wt()),null;var f=Pu(s,o);if(s.tag!==0&&f===2){var g=xp(s);g!==0&&(o=g,f=zh(s,g))}if(f===1)throw f=ll,Is(s,0),Zi(s,o),Cn(s,wt()),f;if(f===6)throw Error(n(345));return s.finishedWork=s.current.alternate,s.finishedLanes=o,Ds(s,Pn,li),Cn(s,wt()),null}function Bh(s,o){var f=Ve;Ve|=1;try{return s(o)}finally{Ve=f,Ve===0&&(Da=wt()+500,Zc&&Ki())}}function Ms(s){Qi!==null&&Qi.tag===0&&(Ve&6)===0&&Ra();var o=Ve;Ve|=1;var f=Qn.transition,g=Xe;try{if(Qn.transition=null,Xe=1,s)return s()}finally{Xe=g,Qn.transition=f,Ve=o,(Ve&6)===0&&Ki()}}function Vh(){$n=Ia.current,ot(Ia)}function Is(s,o){s.finishedWork=null,s.finishedLanes=0;var f=s.timeoutHandle;if(f!==-1&&(s.timeoutHandle=-1,nI(f)),kt!==null)for(f=kt.return;f!==null;){var g=f;switch(Qp(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&Qc();break;case 3:Ta(),ot(Sn),ot(nn),uh();break;case 5:lh(g);break;case 4:Ta();break;case 13:ot(ht);break;case 19:ot(ht);break;case 10:rh(g.type._context);break;case 22:case 23:Vh()}f=f.return}if($t=s,kt=s=es(s.current,null),Yt=$n=o,At=0,ll=null,Dh=bu=_s=0,Pn=cl=null,As!==null){for(o=0;o<As.length;o++)if(f=As[o],g=f.interleaved,g!==null){f.interleaved=null;var y=g.next,N=f.pending;if(N!==null){var T=N.next;N.next=y,g.next=T}f.pending=g}As=null}return s}function s1(s,o){do{var f=kt;try{if(nh(),cu.current=pu,uu){for(var g=mt.memoizedState;g!==null;){var y=g.queue;y!==null&&(y.pending=null),g=g.next}uu=!1}if(Ts=0,Lt=Ot=mt=null,nl=!1,rl=0,Ih.current=null,f===null||f.return===null){At=1,ll=o,kt=null;break}e:{var N=s,T=f.return,I=f,R=o;if(o=Yt,I.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var Y=R,oe=I,ce=oe.tag;if((oe.mode&1)===0&&(ce===0||ce===11||ce===15)){var ae=oe.alternate;ae?(oe.updateQueue=ae.updateQueue,oe.memoizedState=ae.memoizedState,oe.lanes=ae.lanes):(oe.updateQueue=null,oe.memoizedState=null)}var ge=Ew(T);if(ge!==null){ge.flags&=-257,Tw(ge,T,I,N,o),ge.mode&1&&Aw(N,Y,o),o=ge,R=Y;var ye=o.updateQueue;if(ye===null){var be=new Set;be.add(R),o.updateQueue=be}else ye.add(R);break e}else{if((o&1)===0){Aw(N,Y,o),Uh();break e}R=Error(n(426))}}else if(dt&&I.mode&1){var jt=Ew(T);if(jt!==null){(jt.flags&65536)===0&&(jt.flags|=256),Tw(jt,T,I,N,o),eh(_a(R,I));break e}}N=R=_a(R,I),At!==4&&(At=2),cl===null?cl=[N]:cl.push(N),N=T;do{switch(N.tag){case 3:N.flags|=65536,o&=-o,N.lanes|=o;var U=Cw(N,R,o);ew(N,U);break e;case 1:I=R;var z=N.type,K=N.stateNode;if((N.flags&128)===0&&(typeof z.getDerivedStateFromError=="function"||K!==null&&typeof K.componentDidCatch=="function"&&(Xi===null||!Xi.has(K)))){N.flags|=65536,o&=-o,N.lanes|=o;var ue=Ow(N,I,o);ew(N,ue);break e}}N=N.return}while(N!==null)}l1(f)}catch(je){o=je,kt===f&&f!==null&&(kt=f=f.return);continue}break}while(!0)}function a1(){var s=yu.current;return yu.current=pu,s===null?pu:s}function Uh(){(At===0||At===3||At===2)&&(At=4),$t===null||(_s&268435455)===0&&(bu&268435455)===0||Zi($t,Yt)}function Pu(s,o){var f=Ve;Ve|=2;var g=a1();($t!==s||Yt!==o)&&(li=null,Is(s,o));do try{CI();break}catch(y){s1(s,y)}while(!0);if(nh(),Ve=f,yu.current=g,kt!==null)throw Error(n(261));return $t=null,Yt=0,At}function CI(){for(;kt!==null;)o1(kt)}function OI(){for(;kt!==null&&!Z_();)o1(kt)}function o1(s){var o=d1(s.alternate,s,$n);s.memoizedProps=s.pendingProps,o===null?l1(s):kt=o,Ih.current=null}function l1(s){var o=s;do{var f=o.alternate;if(s=o.return,(o.flags&32768)===0){if(f=bI(f,o,$n),f!==null){kt=f;return}}else{if(f=wI(f,o),f!==null){f.flags&=32767,kt=f;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{At=6,kt=null;return}}if(o=o.sibling,o!==null){kt=o;return}kt=o=s}while(o!==null);At===0&&(At=5)}function Ds(s,o,f){var g=Xe,y=Qn.transition;try{Qn.transition=null,Xe=1,AI(s,o,f,g)}finally{Qn.transition=y,Xe=g}return null}function AI(s,o,f,g){do Ra();while(Qi!==null);if((Ve&6)!==0)throw Error(n(327));f=s.finishedWork;var y=s.finishedLanes;if(f===null)return null;if(s.finishedWork=null,s.finishedLanes=0,f===s.current)throw Error(n(177));s.callbackNode=null,s.callbackPriority=0;var N=f.lanes|f.childLanes;if(cM(s,N),s===$t&&(kt=$t=null,Yt=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||ju||(ju=!0,f1(Ec,function(){return Ra(),null})),N=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||N){N=Qn.transition,Qn.transition=null;var T=Xe;Xe=1;var I=Ve;Ve|=4,Ih.current=null,SI(s,f),Jw(f,s),YM(Up),Lc=!!Vp,Up=Vp=null,s.current=f,NI(f),eM(),Ve=I,Xe=T,Qn.transition=N}else s.current=f;if(ju&&(ju=!1,Qi=s,Su=y),N=s.pendingLanes,N===0&&(Xi=null),rM(f.stateNode),Cn(s,wt()),o!==null)for(g=s.onRecoverableError,f=0;f<o.length;f++)y=o[f],g(y.value,{componentStack:y.stack,digest:y.digest});if(wu)throw wu=!1,s=Lh,Lh=null,s;return(Su&1)!==0&&s.tag!==0&&Ra(),N=s.pendingLanes,(N&1)!==0?s===$h?ul++:(ul=0,$h=s):ul=0,Ki(),null}function Ra(){if(Qi!==null){var s=Xy(Su),o=Qn.transition,f=Xe;try{if(Qn.transition=null,Xe=16>s?16:s,Qi===null)var g=!1;else{if(s=Qi,Qi=null,Su=0,(Ve&6)!==0)throw Error(n(331));var y=Ve;for(Ve|=4,ve=s.current;ve!==null;){var N=ve,T=N.child;if((ve.flags&16)!==0){var I=N.deletions;if(I!==null){for(var R=0;R<I.length;R++){var Y=I[R];for(ve=Y;ve!==null;){var oe=ve;switch(oe.tag){case 0:case 11:case 15:ol(8,oe,N)}var ce=oe.child;if(ce!==null)ce.return=oe,ve=ce;else for(;ve!==null;){oe=ve;var ae=oe.sibling,ge=oe.return;if(Hw(oe),oe===Y){ve=null;break}if(ae!==null){ae.return=ge,ve=ae;break}ve=ge}}}var ye=N.alternate;if(ye!==null){var be=ye.child;if(be!==null){ye.child=null;do{var jt=be.sibling;be.sibling=null,be=jt}while(be!==null)}}ve=N}}if((N.subtreeFlags&2064)!==0&&T!==null)T.return=N,ve=T;else e:for(;ve!==null;){if(N=ve,(N.flags&2048)!==0)switch(N.tag){case 0:case 11:case 15:ol(9,N,N.return)}var U=N.sibling;if(U!==null){U.return=N.return,ve=U;break e}ve=N.return}}var z=s.current;for(ve=z;ve!==null;){T=ve;var K=T.child;if((T.subtreeFlags&2064)!==0&&K!==null)K.return=T,ve=K;else e:for(T=z;ve!==null;){if(I=ve,(I.flags&2048)!==0)try{switch(I.tag){case 0:case 11:case 15:xu(9,I)}}catch(je){vt(I,I.return,je)}if(I===T){ve=null;break e}var ue=I.sibling;if(ue!==null){ue.return=I.return,ve=ue;break e}ve=I.return}}if(Ve=y,Ki(),_r&&typeof _r.onPostCommitFiberRoot=="function")try{_r.onPostCommitFiberRoot(Tc,s)}catch{}g=!0}return g}finally{Xe=f,Qn.transition=o}}return!1}function c1(s,o,f){o=_a(f,o),o=Cw(s,o,1),s=Gi(s,o,1),o=hn(),s!==null&&(Io(s,1,o),Cn(s,o))}function vt(s,o,f){if(s.tag===3)c1(s,s,f);else for(;o!==null;){if(o.tag===3){c1(o,s,f);break}else if(o.tag===1){var g=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Xi===null||!Xi.has(g))){s=_a(f,s),s=Ow(o,s,1),o=Gi(o,s,1),s=hn(),o!==null&&(Io(o,1,s),Cn(o,s));break}}o=o.return}}function EI(s,o,f){var g=s.pingCache;g!==null&&g.delete(o),o=hn(),s.pingedLanes|=s.suspendedLanes&f,$t===s&&(Yt&f)===f&&(At===4||At===3&&(Yt&130023424)===Yt&&500>wt()-Rh?Is(s,0):Dh|=f),Cn(s,o)}function u1(s,o){o===0&&((s.mode&1)===0?o=1:(o=Mc,Mc<<=1,(Mc&130023424)===0&&(Mc=4194304)));var f=hn();s=si(s,o),s!==null&&(Io(s,o,f),Cn(s,f))}function TI(s){var o=s.memoizedState,f=0;o!==null&&(f=o.retryLane),u1(s,f)}function _I(s,o){var f=0;switch(s.tag){case 13:var g=s.stateNode,y=s.memoizedState;y!==null&&(f=y.retryLane);break;case 19:g=s.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(o),u1(s,f)}var d1;d1=function(s,o,f){if(s!==null)if(s.memoizedProps!==o.pendingProps||Sn.current)kn=!0;else{if((s.lanes&f)===0&&(o.flags&128)===0)return kn=!1,yI(s,o,f);kn=(s.flags&131072)!==0}else kn=!1,dt&&(o.flags&1048576)!==0&&Wb(o,tu,o.index);switch(o.lanes=0,o.tag){case 2:var g=o.type;gu(s,o),s=o.pendingProps;var y=Na(o,nn.current);Ea(o,f),y=ph(null,o,g,s,y,f);var N=hh();return o.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Nn(g)?(N=!0,Jc(o)):N=!1,o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,ah(o),y.updater=hu,o.stateNode=y,y._reactInternals=o,bh(o,g,s,f),o=Nh(null,o,g,!0,N,f)):(o.tag=0,dt&&N&&Xp(o),pn(null,o,y,f),o=o.child),o;case 16:g=o.elementType;e:{switch(gu(s,o),s=o.pendingProps,y=g._init,g=y(g._payload),o.type=g,y=o.tag=II(g),s=yr(g,s),y){case 0:o=Sh(null,o,g,s,f);break e;case 1:o=Lw(null,o,g,s,f);break e;case 11:o=_w(null,o,g,s,f);break e;case 14:o=Mw(null,o,g,yr(g.type,s),f);break e}throw Error(n(306,g,""))}return o;case 0:return g=o.type,y=o.pendingProps,y=o.elementType===g?y:yr(g,y),Sh(s,o,g,y,f);case 1:return g=o.type,y=o.pendingProps,y=o.elementType===g?y:yr(g,y),Lw(s,o,g,y,f);case 3:e:{if($w(o),s===null)throw Error(n(387));g=o.pendingProps,N=o.memoizedState,y=N.element,Zb(s,o),ou(o,g,null,f);var T=o.memoizedState;if(g=T.element,N.isDehydrated)if(N={element:g,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},o.updateQueue.baseState=N,o.memoizedState=N,o.flags&256){y=_a(Error(n(423)),o),o=zw(s,o,g,f,y);break e}else if(g!==y){y=_a(Error(n(424)),o),o=zw(s,o,g,f,y);break e}else for(Ln=Ui(o.stateNode.containerInfo.firstChild),Rn=o,dt=!0,xr=null,f=Qb(o,null,g,f),o.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Ca(),g===y){o=oi(s,o,f);break e}pn(s,o,g,f)}o=o.child}return o;case 5:return nw(o),s===null&&Zp(o),g=o.type,y=o.pendingProps,N=s!==null?s.memoizedProps:null,T=y.children,Wp(g,y)?T=null:N!==null&&Wp(g,N)&&(o.flags|=32),Rw(s,o),pn(s,o,T,f),o.child;case 6:return s===null&&Zp(o),null;case 13:return Fw(s,o,f);case 4:return oh(o,o.stateNode.containerInfo),g=o.pendingProps,s===null?o.child=Oa(o,null,g,f):pn(s,o,g,f),o.child;case 11:return g=o.type,y=o.pendingProps,y=o.elementType===g?y:yr(g,y),_w(s,o,g,y,f);case 7:return pn(s,o,o.pendingProps,f),o.child;case 8:return pn(s,o,o.pendingProps.children,f),o.child;case 12:return pn(s,o,o.pendingProps.children,f),o.child;case 10:e:{if(g=o.type._context,y=o.pendingProps,N=o.memoizedProps,T=y.value,rt(iu,g._currentValue),g._currentValue=T,N!==null)if(vr(N.value,T)){if(N.children===y.children&&!Sn.current){o=oi(s,o,f);break e}}else for(N=o.child,N!==null&&(N.return=o);N!==null;){var I=N.dependencies;if(I!==null){T=N.child;for(var R=I.firstContext;R!==null;){if(R.context===g){if(N.tag===1){R=ai(-1,f&-f),R.tag=2;var Y=N.updateQueue;if(Y!==null){Y=Y.shared;var oe=Y.pending;oe===null?R.next=R:(R.next=oe.next,oe.next=R),Y.pending=R}}N.lanes|=f,R=N.alternate,R!==null&&(R.lanes|=f),ih(N.return,f,o),I.lanes|=f;break}R=R.next}}else if(N.tag===10)T=N.type===o.type?null:N.child;else if(N.tag===18){if(T=N.return,T===null)throw Error(n(341));T.lanes|=f,I=T.alternate,I!==null&&(I.lanes|=f),ih(T,f,o),T=N.sibling}else T=N.child;if(T!==null)T.return=N;else for(T=N;T!==null;){if(T===o){T=null;break}if(N=T.sibling,N!==null){N.return=T.return,T=N;break}T=T.return}N=T}pn(s,o,y.children,f),o=o.child}return o;case 9:return y=o.type,g=o.pendingProps.children,Ea(o,f),y=Yn(y),g=g(y),o.flags|=1,pn(s,o,g,f),o.child;case 14:return g=o.type,y=yr(g,o.pendingProps),y=yr(g.type,y),Mw(s,o,g,y,f);case 15:return Iw(s,o,o.type,o.pendingProps,f);case 17:return g=o.type,y=o.pendingProps,y=o.elementType===g?y:yr(g,y),gu(s,o),o.tag=1,Nn(g)?(s=!0,Jc(o)):s=!1,Ea(o,f),kw(o,g,y),bh(o,g,y,f),Nh(null,o,g,!0,s,f);case 19:return Vw(s,o,f);case 22:return Dw(s,o,f)}throw Error(n(156,o.tag))};function f1(s,o){return qy(s,o)}function MI(s,o,f,g){this.tag=s,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,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 Jn(s,o,f,g){return new MI(s,o,f,g)}function Wh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function II(s){if(typeof s=="function")return Wh(s)?1:0;if(s!=null){if(s=s.$$typeof,s===L)return 11;if(s===ne)return 14}return 2}function es(s,o){var f=s.alternate;return f===null?(f=Jn(s.tag,o,s.key,s.mode),f.elementType=s.elementType,f.type=s.type,f.stateNode=s.stateNode,f.alternate=s,s.alternate=f):(f.pendingProps=o,f.type=s.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=s.flags&14680064,f.childLanes=s.childLanes,f.lanes=s.lanes,f.child=s.child,f.memoizedProps=s.memoizedProps,f.memoizedState=s.memoizedState,f.updateQueue=s.updateQueue,o=s.dependencies,f.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},f.sibling=s.sibling,f.index=s.index,f.ref=s.ref,f}function Cu(s,o,f,g,y,N){var T=2;if(g=s,typeof s=="function")Wh(s)&&(T=1);else if(typeof s=="string")T=5;else e:switch(s){case _:return Rs(f.children,y,N,o);case D:T=8,y|=8;break;case $:return s=Jn(12,f,o,y|2),s.elementType=$,s.lanes=N,s;case Z:return s=Jn(13,f,o,y),s.elementType=Z,s.lanes=N,s;case J:return s=Jn(19,f,o,y),s.elementType=J,s.lanes=N,s;case B:return Ou(f,y,N,o);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case q:T=10;break e;case X:T=9;break e;case L:T=11;break e;case ne:T=14;break e;case re:T=16,g=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return o=Jn(T,f,o,y),o.elementType=s,o.type=g,o.lanes=N,o}function Rs(s,o,f,g){return s=Jn(7,s,g,o),s.lanes=f,s}function Ou(s,o,f,g){return s=Jn(22,s,g,o),s.elementType=B,s.lanes=f,s.stateNode={isHidden:!1},s}function qh(s,o,f){return s=Jn(6,s,null,o),s.lanes=f,s}function Kh(s,o,f){return o=Jn(4,s.children!==null?s.children:[],s.key,o),o.lanes=f,o.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},o}function DI(s,o,f,g,y){this.tag=o,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=yp(0),this.expirationTimes=yp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yp(0),this.identifierPrefix=g,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Hh(s,o,f,g,y,N,T,I,R){return s=new DI(s,o,f,I,R),o===1?(o=1,N===!0&&(o|=8)):o=0,N=Jn(3,null,null,o),s.current=N,N.stateNode=s,N.memoizedState={element:g,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},ah(N),s}function RI(s,o,f){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:g==null?null:""+g,children:s,containerInfo:o,implementation:f}}function p1(s){if(!s)return qi;s=s._reactInternals;e:{if(Ns(s)!==s||s.tag!==1)throw Error(n(170));var o=s;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(Nn(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(n(171))}if(s.tag===1){var f=s.type;if(Nn(f))return Bb(s,f,o)}return o}function h1(s,o,f,g,y,N,T,I,R){return s=Hh(f,g,!0,s,y,N,T,I,R),s.context=p1(null),f=s.current,g=hn(),y=Ji(f),N=ai(g,y),N.callback=o??null,Gi(f,N,y),s.current.lanes=y,Io(s,y,g),Cn(s,g),s}function Au(s,o,f,g){var y=o.current,N=hn(),T=Ji(y);return f=p1(f),o.context===null?o.context=f:o.pendingContext=f,o=ai(N,T),o.payload={element:s},g=g===void 0?null:g,g!==null&&(o.callback=g),s=Gi(y,o,T),s!==null&&(jr(s,y,T,N),au(s,y,T)),T}function Eu(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function m1(s,o){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var f=s.retryLane;s.retryLane=f!==0&&f<o?f:o}}function Gh(s,o){m1(s,o),(s=s.alternate)&&m1(s,o)}function LI(){return null}var g1=typeof reportError=="function"?reportError:function(s){console.error(s)};function Yh(s){this._internalRoot=s}Tu.prototype.render=Yh.prototype.render=function(s){var o=this._internalRoot;if(o===null)throw Error(n(409));Au(s,o,null,null)},Tu.prototype.unmount=Yh.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var o=s.containerInfo;Ms(function(){Au(null,s,null,null)}),o[ti]=null}};function Tu(s){this._internalRoot=s}Tu.prototype.unstable_scheduleHydration=function(s){if(s){var o=Zy();s={blockedOn:null,target:s,priority:o};for(var f=0;f<Fi.length&&o!==0&&o<Fi[f].priority;f++);Fi.splice(f,0,s),f===0&&nb(s)}};function Xh(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function _u(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function v1(){}function $I(s,o,f,g,y){if(y){if(typeof g=="function"){var N=g;g=function(){var Y=Eu(T);N.call(Y)}}var T=h1(o,g,s,0,null,!1,!1,"",v1);return s._reactRootContainer=T,s[ti]=T.current,Go(s.nodeType===8?s.parentNode:s),Ms(),T}for(;y=s.lastChild;)s.removeChild(y);if(typeof g=="function"){var I=g;g=function(){var Y=Eu(R);I.call(Y)}}var R=Hh(s,0,!1,null,null,!1,!1,"",v1);return s._reactRootContainer=R,s[ti]=R.current,Go(s.nodeType===8?s.parentNode:s),Ms(function(){Au(o,R,f,g)}),R}function Mu(s,o,f,g,y){var N=f._reactRootContainer;if(N){var T=N;if(typeof y=="function"){var I=y;y=function(){var R=Eu(T);I.call(R)}}Au(o,T,s,y)}else T=$I(f,o,s,y,g);return Eu(T)}Qy=function(s){switch(s.tag){case 3:var o=s.stateNode;if(o.current.memoizedState.isDehydrated){var f=Mo(o.pendingLanes);f!==0&&(bp(o,f|1),Cn(o,wt()),(Ve&6)===0&&(Da=wt()+500,Ki()))}break;case 13:Ms(function(){var g=si(s,1);if(g!==null){var y=hn();jr(g,s,1,y)}}),Gh(s,1)}},wp=function(s){if(s.tag===13){var o=si(s,134217728);if(o!==null){var f=hn();jr(o,s,134217728,f)}Gh(s,134217728)}},Jy=function(s){if(s.tag===13){var o=Ji(s),f=si(s,o);if(f!==null){var g=hn();jr(f,s,o,g)}Gh(s,o)}},Zy=function(){return Xe},eb=function(s,o){var f=Xe;try{return Xe=s,o()}finally{Xe=f}},pr=function(s,o,f){switch(o){case"input":if(Mt(s,f),o=f.name,f.type==="radio"&&o!=null){for(f=s;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<f.length;o++){var g=f[o];if(g!==s&&g.form===s.form){var y=Xc(g);if(!y)throw Error(n(90));se(g),Mt(g,y)}}}break;case"textarea":Me(s,f);break;case"select":o=f.value,o!=null&&jn(s,!!f.multiple,o,!1)}},ha=Bh,js=Ms;var zI={usingClientEntryPoint:!1,Events:[Qo,ja,Xc,Di,pa,Bh]},dl={findFiberByHostInstance:ks,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},FI={bundleType:dl.bundleType,version:dl.version,rendererPackageName:dl.rendererPackageName,rendererConfig:dl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=Uy(s),s===null?null:s.stateNode},findFiberByHostInstance:dl.findFiberByHostInstance||LI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Iu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Iu.isDisabled&&Iu.supportsFiber)try{Tc=Iu.inject(FI),_r=Iu}catch{}}return On.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=zI,On.createPortal=function(s,o){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Xh(o))throw Error(n(200));return RI(s,o,null,f)},On.createRoot=function(s,o){if(!Xh(s))throw Error(n(299));var f=!1,g="",y=g1;return o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onRecoverableError!==void 0&&(y=o.onRecoverableError)),o=Hh(s,1,!1,null,null,f,!1,g,y),s[ti]=o.current,Go(s.nodeType===8?s.parentNode:s),new Yh(o)},On.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var o=s._reactInternals;if(o===void 0)throw typeof s.render=="function"?Error(n(188)):(s=Object.keys(s).join(","),Error(n(268,s)));return s=Uy(o),s=s===null?null:s.stateNode,s},On.flushSync=function(s){return Ms(s)},On.hydrate=function(s,o,f){if(!_u(o))throw Error(n(200));return Mu(null,s,o,!0,f)},On.hydrateRoot=function(s,o,f){if(!Xh(s))throw Error(n(405));var g=f!=null&&f.hydratedSources||null,y=!1,N="",T=g1;if(f!=null&&(f.unstable_strictMode===!0&&(y=!0),f.identifierPrefix!==void 0&&(N=f.identifierPrefix),f.onRecoverableError!==void 0&&(T=f.onRecoverableError)),o=h1(o,null,s,1,f??null,y,!1,N,T),s[ti]=o.current,Go(s),g)for(s=0;s<g.length;s++)f=g[s],y=f._getVersion,y=y(f._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[f,y]:o.mutableSourceEagerHydrationData.push(f,y);return new Tu(o)},On.render=function(s,o,f){if(!_u(o))throw Error(n(200));return Mu(null,s,o,!1,f)},On.unmountComponentAtNode=function(s){if(!_u(s))throw Error(n(40));return s._reactRootContainer?(Ms(function(){Mu(null,null,s,!1,function(){s._reactRootContainer=null,s[ti]=null})}),!0):!1},On.unstable_batchedUpdates=Bh,On.unstable_renderSubtreeIntoContainer=function(s,o,f,g){if(!_u(f))throw Error(n(200));if(s==null||s._reactInternals===void 0)throw Error(n(38));return Mu(s,o,f,!1,g)},On.version="18.3.1-next-f1338f8080-20240426",On}var k1;function c2(){if(k1)return em.exports;k1=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(),em.exports=QI(),em.exports}var P1;function JI(){if(P1)return Du;P1=1;var e=c2();return Du.createRoot=e.createRoot,Du.hydrateRoot=e.hydrateRoot,Du}var ZI=JI();const e3=Qr(ZI);/**
41
+ * @license lucide-react v0.468.0 - ISC
42
+ *
43
+ * This source code is licensed under the ISC license.
44
+ * See the LICENSE file in the root directory of this source tree.
45
+ */const t3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u2=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
46
+ * @license lucide-react v0.468.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */var n3={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"};/**
51
+ * @license lucide-react v0.468.0 - ISC
52
+ *
53
+ * This source code is licensed under the ISC license.
54
+ * See the LICENSE file in the root directory of this source tree.
55
+ */const r3=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:l,...u},d)=>b.createElement("svg",{ref:d,...n3,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:u2("lucide",i),...u},[...l.map(([p,h])=>b.createElement(p,h)),...Array.isArray(a)?a:[a]]));/**
56
+ * @license lucide-react v0.468.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */const Ie=(e,t)=>{const n=b.forwardRef(({className:r,...i},a)=>b.createElement(r3,{ref:a,iconNode:t,className:u2(`lucide-${t3(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
61
+ * @license lucide-react v0.468.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const i3=Ie("Activity",[["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"}]]);/**
66
+ * @license lucide-react v0.468.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const d2=Ie("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/**
71
+ * @license lucide-react v0.468.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const f2=Ie("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
76
+ * @license lucide-react v0.468.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const s3=Ie("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
81
+ * @license lucide-react v0.468.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const a3=Ie("Calendar",[["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"}]]);/**
86
+ * @license lucide-react v0.468.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const p2=Ie("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
91
+ * @license lucide-react v0.468.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const $l=Ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
96
+ * @license lucide-react v0.468.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const Hr=Ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
101
+ * @license lucide-react v0.468.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const o3=Ie("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
106
+ * @license lucide-react v0.468.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const sr=Ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
111
+ * @license lucide-react v0.468.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const Nv=Ie("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
116
+ * @license lucide-react v0.468.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const l3=Ie("CircleAlert",[["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"}]]);/**
121
+ * @license lucide-react v0.468.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const h2=Ie("DollarSign",[["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"}]]);/**
126
+ * @license lucide-react v0.468.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const c3=Ie("ExternalLink",[["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"}]]);/**
131
+ * @license lucide-react v0.468.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const kv=Ie("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
136
+ * @license lucide-react v0.468.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const vd=Ie("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
141
+ * @license lucide-react v0.468.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const u3=Ie("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
146
+ * @license lucide-react v0.468.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const d3=Ie("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
151
+ * @license lucide-react v0.468.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const Pv=Ie("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
156
+ * @license lucide-react v0.468.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const f3=Ie("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
161
+ * @license lucide-react v0.468.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const m2=Ie("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
166
+ * @license lucide-react v0.468.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const p3=Ie("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
171
+ * @license lucide-react v0.468.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const h3=Ie("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
176
+ * @license lucide-react v0.468.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const xd=Ie("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
181
+ * @license lucide-react v0.468.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const C1=Ie("Lock",[["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"}]]);/**
186
+ * @license lucide-react v0.468.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const yd=Ie("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
191
+ * @license lucide-react v0.468.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const ac=Ie("Pencil",[["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"}]]);/**
196
+ * @license lucide-react v0.468.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const O1=Ie("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
201
+ * @license lucide-react v0.468.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const m3=Ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
206
+ * @license lucide-react v0.468.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const g3=Ie("RefreshCw",[["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"}]]);/**
211
+ * @license lucide-react v0.468.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const g2=Ie("RotateCcw",[["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"}]]);/**
216
+ * @license lucide-react v0.468.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const v3=Ie("Save",[["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"}]]);/**
221
+ * @license lucide-react v0.468.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const x3=Ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
226
+ * @license lucide-react v0.468.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const to=Ie("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
231
+ * @license lucide-react v0.468.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const y3=Ie("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
236
+ * @license lucide-react v0.468.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const A1=Ie("Sprout",[["path",{d:"M7 20h10",key:"e6iznv"}],["path",{d:"M10 20c5.5-2.5.8-6.4 3-10",key:"161w41"}],["path",{d:"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",key:"9gtqwd"}],["path",{d:"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",key:"bkxnd2"}]]);/**
241
+ * @license lucide-react v0.468.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const b3=Ie("Target",[["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"}]]);/**
246
+ * @license lucide-react v0.468.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const w3=Ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
251
+ * @license lucide-react v0.468.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const vi=Ie("TriangleAlert",[["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"}]]);/**
256
+ * @license lucide-react v0.468.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const j3=Ie("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
261
+ * @license lucide-react v0.468.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const ig=Ie("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
266
+ * @license lucide-react v0.468.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const S3=Ie("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
271
+ * @license lucide-react v0.468.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const xn=Ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),oc="/api";async function we(e,t={}){const n=`${oc}${e}`;try{const r=await fetch(n,{...t,headers:{"Content-Type":"application/json",...t.headers}});if(!r.ok){const i=await r.json().catch(()=>({}));throw new Error(i.error||`HTTP ${r.status}: ${r.statusText}`)}return await r.json()}catch(r){throw console.error(`API Error [${e}]:`,r),r}}async function N3(){return we("/health")}async function k3(e={}){const t=new URLSearchParams;e.type&&t.append("type",e.type),e.status&&t.append("status",e.status),e.search&&t.append("search",e.search);const n=t.toString(),r=n?`/work-items?${n}`:"/work-items";return we(r)}async function P3(){return we("/work-items/grouped")}async function C3(e){return we(`/work-items/${e}`)}async function sg(e){const t=`${oc}/work-items/${e}/doc`,n=await fetch(t);return n.ok?await n.text():""}async function O3(e){const t=`${oc}/work-items/${e}/doc/raw`,n=await fetch(t);return n.ok?await n.text():""}async function A3(e,t){return we(`/work-items/${e}/doc`,{method:"PUT",body:JSON.stringify({content:t})})}async function E1(){return(await we("/settings/title")).title||"AVC Kanban Board"}async function E3(){return(await we("/settings/docs-url")).url||"http://localhost:4173"}async function T3(e){return we("/settings/title",{method:"PUT",body:JSON.stringify({title:e})})}async function _3(){const e=`${oc}/project/doc`,t=await fetch(e);return t.ok?t.text():""}async function M3(){const e=`${oc}/project/doc/raw`,t=await fetch(e);return t.ok?t.text():""}async function I3(e){return we("/project/doc",{method:"PUT",body:JSON.stringify({content:e})})}async function T1(){return we("/project/status")}async function Tn(){return we("/settings")}async function bd(e){return we("/settings/api-keys",{method:"PUT",body:JSON.stringify(e)})}async function zl(e,t){return we("/settings/ceremonies",{method:"PUT",body:JSON.stringify({ceremonies:e,missionGenerator:t})})}async function _1(e){return we("/settings/general",{method:"PUT",body:JSON.stringify(e)})}async function D3(e){return we("/settings/models",{method:"PUT",body:JSON.stringify({models:e})})}async function R3(e){return we("/settings/cost-thresholds",{method:"PUT",body:JSON.stringify({thresholds:e})})}async function L3(){return we("/ceremony/status")}async function $3(e,t,n){return we("/ceremony/analyze/database",{method:"POST",body:JSON.stringify({mission:e,scope:t,strategy:n})})}async function M1(e,t,n,r){return we("/ceremony/analyze/architecture",{method:"POST",body:JSON.stringify({mission:e,scope:t,dbContext:n,strategy:r})})}async function z3(e,t,n,r,i){return we("/ceremony/analyze/prefill",{method:"POST",body:JSON.stringify({mission:e,scope:t,arch:n,dbContext:r,strategy:i})})}async function F3(e){return we("/ceremony/run",{method:"POST",body:JSON.stringify({requirements:e})})}async function B3(e=null){return we("/ceremony/sprint-planning/run",{method:"POST",...e?{body:JSON.stringify({resumeFrom:e})}:{}})}async function V3(){return we("/ceremony/sprint-planning/resumable")}const U3=(e,t)=>we("/ceremony/sprint-planning/confirm-selection",{method:"POST",body:JSON.stringify({selectedEpicIds:e,selectedStoryIds:t})}),v2=()=>we("/ceremony/pause",{method:"POST"}),x2=()=>we("/ceremony/resume",{method:"POST"}),Qa=(e=!1)=>we("/ceremony/cancel",{method:"POST",body:JSON.stringify({keepItems:e})}),y2=()=>we("/ceremony/reset",{method:"POST"}),I1=()=>we("/ceremony/cost-limit-continue",{method:"POST"}),W3=(e=null,t=null)=>we("/ceremony/quota-continue",{method:"POST",body:JSON.stringify({newProvider:e,newModel:t})});async function ds(){const[e,t]=await Promise.all([we("/ceremony/models"),we("/settings/local-models").catch(()=>({servers:[]}))]),n=(t.servers||[]).flatMap(r=>r.models.map(i=>({modelId:i.id,displayName:`${i.id} (${r.label})`,provider:"local",hasApiKey:!0})));return[...e,...n]}async function q3(){return we("/settings/local-models")}async function K3(e,t,n,r,i){return we("/ceremony/generate-mission",{method:"POST",body:JSON.stringify({description:e,modelId:t,provider:n,validatorModelId:r,validatorProvider:i})})}async function H3(e,t,n,r,i,a,l){return we("/ceremony/refine-mission",{method:"POST",body:JSON.stringify({missionStatement:e,initialScope:t,refinementRequest:n,modelId:r,provider:i,validatorModelId:a,validatorProvider:l})})}async function G3(e,t,n){return we("/ceremony/generate-architecture",{method:"POST",body:JSON.stringify({description:e,modelId:t,provider:n})})}async function Y3(e,t,n,r){return we("/ceremony/refine-architecture",{method:"POST",body:JSON.stringify({currentArch:e,refinementRequest:t,modelId:n,provider:r})})}async function X3(e,t,n,r,i,a,l){return we("/ceremony/refine-field",{method:"POST",body:JSON.stringify({fieldKey:e,fieldLabel:t,currentValue:n,refinementRequest:r,context:i,modelId:a,provider:l})})}async function Q3(){try{return await we("/ceremony/sponsor-call/draft")}catch{return null}}async function J3(e){return we("/ceremony/sponsor-call/draft",{method:"PUT",body:JSON.stringify(e)})}async function D1(){try{return await we("/ceremony/sponsor-call/draft",{method:"DELETE"})}catch{}}async function Z3(){return we("/settings/agents")}async function eD(e){return we(`/settings/agents/${encodeURIComponent(e)}`)}async function tD(e,t){return we(`/settings/agents/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({content:t})})}async function nD(e){return we(`/settings/agents/${encodeURIComponent(e)}`,{method:"DELETE"})}async function rD(){return we("/settings/checks")}async function iD(e,t){return we(`/settings/checks/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}async function sD(e,t,n){return we(`/settings/checks/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({content:n})})}async function aD(e,t){return we(`/settings/checks/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"DELETE"})}async function oD(e,t){return we(`/work-items/${e}/refine`,{method:"POST",body:JSON.stringify(t)})}async function lD(e,t,n=[]){return we(`/work-items/${e}`,{method:"PUT",body:JSON.stringify({proposedItem:t,storyChanges:n})})}async function cD(){return we("/settings/openai-oauth/login",{method:"POST"})}async function uD(){return we("/settings/openai-oauth/logout",{method:"POST"})}async function dD(){return we("/settings/openai-oauth/status")}async function fD(){return we("/settings/openai-oauth/test",{method:"POST"})}async function pD(e){return we("/settings/openai-oauth/fallback",{method:"POST",body:JSON.stringify({enabled:e})})}async function rm(){return we("/costs/summary")}async function hD(e=30){return we(typeof e=="number"?`/costs/history?days=${e}`:`/costs/history?from=${e.from}&to=${e.to}`)}async function b2(e){return we(`/work-items/${e}/dependency-status`)}async function mD(e){return we("/ceremony/seed/run",{method:"POST",body:JSON.stringify({storyId:e})})}async function gD(e){return we("/ceremony/run-task/run",{method:"POST",body:JSON.stringify({taskId:e})})}const vD=`ws://${window.location.host}/ws`,xD=5,yD=2e3;function bD(e={}){const{onMessage:t,onConnected:n,onDisconnected:r,onError:i}=e,[a,l]=b.useState("connecting"),u=b.useRef(null),d=b.useRef(null),p=b.useRef(0),h=b.useRef(t),m=b.useRef(n),v=b.useRef(r),x=b.useRef(i);h.current=t,m.current=n,v.current=r,x.current=i;const w=b.useCallback(()=>{var k,C;if(((k=u.current)==null?void 0:k.readyState)!==WebSocket.OPEN)try{const E=new WebSocket(vD);E.onopen=()=>{var O;console.log("WebSocket connected"),p.current=0,l("connected"),(O=m.current)==null||O.call(m)},E.onmessage=O=>{var P;try{const A=JSON.parse(O.data);(P=h.current)==null||P.call(h,A)}catch(A){console.error("WebSocket message parse error:",A)}},E.onerror=O=>{var P;console.error("WebSocket error:",O),(P=x.current)==null||P.call(x,O)},E.onclose=()=>{var O;console.log("WebSocket disconnected"),u.current=null,(O=v.current)==null||O.call(v),p.current<xD?(p.current++,console.log(`Reconnecting... (attempt ${p.current})`),l("connecting"),d.current=setTimeout(w,yD)):(console.error("Max reconnection attempts reached"),l("disconnected"))},u.current=E}catch(E){console.error("WebSocket connection error:",E),(C=x.current)==null||C.call(x,E)}},[]),S=b.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null),u.current&&(u.current.close(),u.current=null)},[]),j=b.useCallback(k=>{var C;((C=u.current)==null?void 0:C.readyState)===WebSocket.OPEN?u.current.send(JSON.stringify(k)):console.warn("WebSocket not connected, cannot send message")},[]);return b.useEffect(()=>(w(),()=>{S()}),[w,S]),{wsStatus:a,send:j,disconnect:S,reconnect:w}}const R1=e=>{let t;const n=new Set,r=(p,h)=>{const m=typeof p=="function"?p(t):p;if(!Object.is(m,t)){const v=t;t=h??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(x=>x(t,v))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>d,subscribe:p=>(n.add(p),()=>n.delete(p))},d=t=e(r,i,u);return u},wD=(e=>e?R1(e):R1),jD=e=>e;function SD(e,t=jD){const n=Va.useSyncExternalStore(e.subscribe,Va.useCallback(()=>t(e.getState()),[e,t]),Va.useCallback(()=>t(e.getInitialState()),[e,t]));return Va.useDebugValue(n),n}const L1=e=>{const t=wD(e),n=r=>SD(t,r);return Object.assign(n,t),n},lc=(e=>e?L1(e):L1),jf=lc((e,t)=>({workItems:[],groupedItems:{},loading:!1,error:null,lastUpdated:null,ceremonyActive:!1,loadWorkItems:async(n={})=>{e({loading:!0,error:null});try{const r=await k3(n);e({workItems:r.items||[],loading:!1,lastUpdated:Date.now(),error:null})}catch(r){e({loading:!1,error:r.message}),console.error("Failed to load work items:",r)}},loadGroupedItems:async()=>{e({loading:!0,error:null});try{const n=await P3();e({groupedItems:n,loading:!1,lastUpdated:Date.now(),error:null})}catch(n){e({loading:!1,error:n.message}),console.error("Failed to load grouped items:",n)}},refresh:async()=>{const{loadWorkItems:n}=t();await n()},updateWorkItem:(n,r)=>{e(i=>({workItems:i.workItems.map(a=>a.id===n?{...a,...r}:a)}))},addWorkItem:n=>{e(r=>({workItems:[...r.workItems,n]}))},removeWorkItem:n=>{e(r=>({workItems:r.workItems.filter(i=>i.id!==n)}))},clearError:()=>{e({error:null})},setCeremonyActive:n=>{e({ceremonyActive:n})}}));function ND(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var a;const l=d=>d===null?null:JSON.parse(d,void 0),u=(a=n.getItem(i))!=null?a:null;return u instanceof Promise?u.then(l):l(u)},setItem:(i,a)=>n.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>n.removeItem(i)}}const ag=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ag(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ag(r)(n)}}}},kD=(e,t)=>(n,r,i)=>{let a={storage:ND(()=>window.localStorage),partialize:j=>j,version:0,merge:(j,k)=>({...k,...j}),...t},l=!1,u=0;const d=new Set,p=new Set;let h=a.storage;if(!h)return e((...j)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...j)},r,i);const m=()=>{const j=a.partialize({...r()});return h.setItem(a.name,{state:j,version:a.version})},v=i.setState;i.setState=(j,k)=>(v(j,k),m());const x=e((...j)=>(n(...j),m()),r,i);i.getInitialState=()=>x;let w;const S=()=>{var j,k;if(!h)return;const C=++u;l=!1,d.forEach(O=>{var P;return O((P=r())!=null?P:x)});const E=((k=a.onRehydrateStorage)==null?void 0:k.call(a,(j=r())!=null?j:x))||void 0;return ag(h.getItem.bind(h))(a.name).then(O=>{if(O)if(typeof O.version=="number"&&O.version!==a.version){if(a.migrate){const P=a.migrate(O.state,O.version);return P instanceof Promise?P.then(A=>[!0,A]):[!0,P]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,O.state];return[!1,void 0]}).then(O=>{var P;if(C!==u)return;const[A,_]=O;if(w=a.merge(_,(P=r())!=null?P:x),n(w,!0),A)return m()}).then(()=>{C===u&&(E==null||E(w,void 0),w=r(),l=!0,p.forEach(O=>O(w)))}).catch(O=>{C===u&&(E==null||E(void 0,O))})};return i.persist={setOptions:j=>{a={...a,...j},j.storage&&(h=j.storage)},clearStorage:()=>{h==null||h.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>S(),hasHydrated:()=>l,onHydrate:j=>(d.add(j),()=>{d.delete(j)}),onFinishHydration:j=>(p.add(j),()=>{p.delete(j)})},a.skipHydration||S(),w||x},PD=kD,Sf=lc(PD((e,t)=>({typeFilters:{epic:!0,story:!0,task:!0,subtask:!0},columnVisibility:{Backlog:!0,Ready:!0,"In Progress":!0,Review:!0,Done:!0},searchQuery:"",groupBy:"epic",toggleTypeFilter:n=>{e(r=>({typeFilters:{...r.typeFilters,[n]:!r.typeFilters[n]}}))},setAllTypeFilters:n=>{e({typeFilters:{epic:n,story:n,task:n,subtask:n}})},toggleColumnVisibility:n=>{e(r=>({columnVisibility:{...r.columnVisibility,[n]:!r.columnVisibility[n]}}))},setAllColumnsVisibility:n=>{e(r=>{const i={};return Object.keys(r.columnVisibility).forEach(a=>{i[a]=n}),{columnVisibility:i}})},applyPreset:n=>{switch(n){case"all":t().setAllColumnsVisibility(!0),t().setAllTypeFilters(!0);break;case"active":e({columnVisibility:{Backlog:!1,Ready:!0,"In Progress":!0,Review:!0,Done:!1}});break;case"hide-completed":e({columnVisibility:{Backlog:!0,Ready:!0,"In Progress":!0,Review:!0,Done:!1}});break}},setSearchQuery:n=>{e({searchQuery:n})},clearSearch:()=>{e({searchQuery:""})},setGroupBy:n=>{e({groupBy:n})},getActiveTypes:()=>{const{typeFilters:n}=t();return Object.entries(n).filter(([r,i])=>i).map(([r])=>r)},getVisibleColumns:()=>{const{columnVisibility:n}=t();return Object.entries(n).filter(([r,i])=>i).map(([r])=>r)},resetFilters:()=>{e({typeFilters:{epic:!0,story:!0,task:!0,subtask:!0},columnVisibility:{Backlog:!0,Ready:!0,"In Progress":!0,Review:!0,Done:!0},searchQuery:"",groupBy:"epic"})}}),{name:"avc-kanban-filters",partialize:e=>({typeFilters:e.typeFilters,columnVisibility:e.columnVisibility,groupBy:e.groupBy})})),ar=lc((e,t)=>({isOpen:!1,wizardStep:1,analyzing:!1,strategy:null,mission:"",initialScope:"",dbResult:null,dbChoice:null,archOptions:[],selectedArch:null,prefillResult:null,requirements:{MISSION_STATEMENT:"",INITIAL_SCOPE:"",TARGET_USERS:"",DEPLOYMENT_TARGET:"",TECHNICAL_CONSIDERATIONS:"",TECHNICAL_EXCLUSIONS:"",SECURITY_AND_COMPLIANCE_REQUIREMENTS:""},missionProgressLog:[],progressLog:[],ceremonyStatus:"idle",ceremonyResult:null,ceremonyError:null,isPaused:!1,processId:null,openWizard:()=>e({isOpen:!0}),closeWizard:()=>e({isOpen:!1}),reopenWizard:()=>e(n=>({isOpen:!0,wizardStep:n.ceremonyStatus==="complete"?7:6})),resetWizard:()=>e({wizardStep:1,analyzing:!1,strategy:null,mission:"",initialScope:"",dbResult:null,dbChoice:null,archOptions:[],selectedArch:null,prefillResult:null,requirements:{MISSION_STATEMENT:"",INITIAL_SCOPE:"",TARGET_USERS:"",DEPLOYMENT_TARGET:"",TECHNICAL_CONSIDERATIONS:"",TECHNICAL_EXCLUSIONS:"",SECURITY_AND_COMPLIANCE_REQUIREMENTS:""},progressLog:[],ceremonyStatus:"idle",ceremonyResult:null,ceremonyError:null}),setStrategy:n=>e({strategy:n}),setMission:n=>e({mission:n}),setInitialScope:n=>e({initialScope:n}),setDbResult:n=>e({dbResult:n}),setDbChoice:n=>e({dbChoice:n}),setArchOptions:n=>e({archOptions:n}),setSelectedArch:n=>e({selectedArch:n}),setPrefillResult:n=>e({prefillResult:n}),setAnalyzing:n=>e({analyzing:n}),setWizardStep:n=>e({wizardStep:n}),updateRequirement:(n,r)=>e(i=>({requirements:{...i.requirements,[n]:r}})),setRequirements:n=>e({requirements:n}),appendProgress:n=>e(r=>({progressLog:[...r.progressLog,n]})),setProgressLog:n=>e({progressLog:Array.isArray(n)?n:[]}),appendMissionProgress:n=>e(r=>({missionProgressLog:[...r.missionProgressLog,n]})),clearMissionProgress:()=>e({missionProgressLog:[]}),setCeremonyStatus:n=>e({ceremonyStatus:n}),setCeremonyResult:n=>e({ceremonyResult:n}),setCeremonyError:n=>e({ceremonyError:n}),setPaused:n=>e({isPaused:n}),setProcessId:n=>e({processId:n}),applyPrefill:(n,r,i,a)=>{e(l=>({prefillResult:n,requirements:{...l.requirements,MISSION_STATEMENT:i,INITIAL_SCOPE:a,TARGET_USERS:n.TARGET_USERS||"",DEPLOYMENT_TARGET:n.DEPLOYMENT_TARGET||"",TECHNICAL_CONSIDERATIONS:n.TECHNICAL_CONSIDERATIONS||"",SECURITY_AND_COMPLIANCE_REQUIREMENTS:n.SECURITY_AND_COMPLIANCE_REQUIREMENTS||""}}))},startRun:()=>e({ceremonyStatus:"running",progressLog:[],ceremonyResult:null,ceremonyError:null})})),xo=lc(e=>({isOpen:!1,step:1,status:"idle",isPaused:!1,progressLog:[],result:null,error:null,processId:null,decomposedHierarchy:null,openModal:()=>e({isOpen:!0,step:1,status:"idle",isPaused:!1,progressLog:[],result:null,error:null,processId:null,decomposedHierarchy:null}),closeModal:()=>e({isOpen:!1}),reopenModal:()=>e(t=>({isOpen:!0,step:t.status==="complete"?4:t.status==="awaiting-selection"?3:t.status==="running"||t.status==="error"?2:1})),setStep:t=>e({step:t}),setStatus:t=>e({status:t}),setPaused:t=>e({isPaused:t}),appendProgress:t=>e(n=>({progressLog:[...n.progressLog,t]})),setProgressLog:t=>e({progressLog:Array.isArray(t)?t:[]}),setResult:t=>e({result:t}),setError:t=>e({error:t}),setProcessId:t=>e({processId:t}),setDecomposedHierarchy:t=>e({decomposedHierarchy:t})})),w2=lc((e,t)=>({processes:[],handleProcessMessage:n=>{const{processes:r}=t();switch(n.type){case"process:list":e({processes:n.processes});break;case"process:started":if(r.find(i=>i.id===n.processId))break;e({processes:[...r,{id:n.processId,type:n.processType,label:n.label,status:"running",startedAt:n.startedAt,endedAt:null}]});break;case"process:status":{const i=r.map(a=>a.id===n.processId?{...a,status:n.status,endedAt:n.endedAt??a.endedAt}:a);e({processes:i}),n.status==="cancelled"&&setTimeout(()=>{e(a=>({processes:a.processes.filter(l=>l.id!==n.processId)}))},1e3);break}}},clearCompleted:async()=>{try{await fetch("/api/processes",{method:"DELETE"})}catch{}e(n=>({processes:n.processes.filter(r=>!["complete","error","cancelled"].includes(r.status))}))}})),Cv=b.createContext({});function Ov(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const Nf=b.createContext(null),Av=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class CD extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function OD({children:e,isPresent:t}){const n=b.useId(),r=b.useRef(null),i=b.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=b.useContext(Av);return b.useInsertionEffect(()=>{const{width:l,height:u,top:d,left:p}=i.current;if(t||!r.current||!l||!u)return;r.current.dataset.motionPopId=n;const h=document.createElement("style");return a&&(h.nonce=a),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
276
+ [data-motion-pop-id="${n}"] {
277
+ position: absolute !important;
278
+ width: ${l}px !important;
279
+ height: ${u}px !important;
280
+ top: ${d}px !important;
281
+ left: ${p}px !important;
282
+ }
283
+ `),()=>{document.head.removeChild(h)}},[t]),c.jsx(CD,{isPresent:t,childRef:r,sizeRef:i,children:b.cloneElement(e,{ref:r})})}const AD=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:l})=>{const u=Ov(ED),d=b.useId(),p=b.useCallback(m=>{u.set(m,!0);for(const v of u.values())if(!v)return;r&&r()},[u,r]),h=b.useMemo(()=>({id:d,initial:t,isPresent:n,custom:i,onExitComplete:p,register:m=>(u.set(m,!1),()=>u.delete(m))}),a?[Math.random(),p]:[n,p]);return b.useMemo(()=>{u.forEach((m,v)=>u.set(v,!1))},[n]),b.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),l==="popLayout"&&(e=c.jsx(OD,{isPresent:n,children:e})),c.jsx(Nf.Provider,{value:h,children:e})};function ED(){return new Map}function j2(e=!0){const t=b.useContext(Nf);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,a=b.useId();b.useEffect(()=>{e&&i(a)},[e]);const l=b.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,l]:[!0]}const Ru=e=>e.key||"";function $1(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const Ev=typeof window<"u",S2=Ev?b.useLayoutEffect:b.useEffect,N2=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a="sync",propagate:l=!1})=>{const[u,d]=j2(l),p=b.useMemo(()=>$1(e),[e]),h=l&&!u?[]:p.map(Ru),m=b.useRef(!0),v=b.useRef(p),x=Ov(()=>new Map),[w,S]=b.useState(p),[j,k]=b.useState(p);S2(()=>{m.current=!1,v.current=p;for(let O=0;O<j.length;O++){const P=Ru(j[O]);h.includes(P)?x.delete(P):x.get(P)!==!0&&x.set(P,!1)}},[j,h.length,h.join("-")]);const C=[];if(p!==w){let O=[...p];for(let P=0;P<j.length;P++){const A=j[P],_=Ru(A);h.includes(_)||(O.splice(P,0,A),C.push(A))}a==="wait"&&C.length&&(O=C),k($1(O)),S(p);return}const{forceRender:E}=b.useContext(Cv);return c.jsx(c.Fragment,{children:j.map(O=>{const P=Ru(O),A=l&&!u?!1:p===j||h.includes(P),_=()=>{if(x.has(P))x.set(P,!0);else return;let D=!0;x.forEach($=>{$||(D=!1)}),D&&(E==null||E(),k(v.current),l&&(d==null||d()),r&&r())};return c.jsx(AD,{isPresent:A,initial:!m.current||n?void 0:!1,custom:A?void 0:t,presenceAffectsLayout:i,mode:a,onExitComplete:A?void 0:_,children:O},P)})})},Vn=e=>e;let k2=Vn;function Tv(e){let t;return()=>(t===void 0&&(t=e()),t)}const no=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},hi=e=>e*1e3,mi=e=>e/1e3,TD={useManualTiming:!1};function _D(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function u(p){a.has(p)&&(d.schedule(p),e()),p(l)}const d={schedule:(p,h=!1,m=!1)=>{const x=m&&r?t:n;return h&&a.add(p),x.has(p)||x.add(p),p},cancel:p=>{n.delete(p),a.delete(p)},process:p=>{if(l=p,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(u),t.clear(),r=!1,i&&(i=!1,d.process(p))}};return d}const Lu=["read","resolveKeyframes","update","preRender","render","postRender"],MD=40;function P2(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,l=Lu.reduce((k,C)=>(k[C]=_D(a),k),{}),{read:u,resolveKeyframes:d,update:p,preRender:h,render:m,postRender:v}=l,x=()=>{const k=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(k-i.timestamp,MD),1),i.timestamp=k,i.isProcessing=!0,u.process(i),d.process(i),p.process(i),h.process(i),m.process(i),v.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(x))},w=()=>{n=!0,r=!0,i.isProcessing||e(x)};return{schedule:Lu.reduce((k,C)=>{const E=l[C];return k[C]=(O,P=!1,A=!1)=>(n||w(),E.schedule(O,P,A)),k},{}),cancel:k=>{for(let C=0;C<Lu.length;C++)l[Lu[C]].cancel(k)},state:i,steps:l}}const{schedule:ut,cancel:fs,state:Qt,steps:im}=P2(typeof requestAnimationFrame<"u"?requestAnimationFrame:Vn,!0),C2=b.createContext({strict:!1}),z1={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"]},ro={};for(const e in z1)ro[e]={isEnabled:t=>z1[e].some(n=>!!t[n])};function ID(e){for(const t in e)ro[t]={...ro[t],...e[t]}}const DD=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","ignoreStrict","viewport"]);function wd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||DD.has(e)}let O2=e=>!wd(e);function RD(e){e&&(O2=t=>t.startsWith("on")?!wd(t):e(t))}try{RD(require("@emotion/is-prop-valid").default)}catch{}function LD(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(O2(i)||n===!0&&wd(i)||!t&&!wd(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function $D(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const kf=b.createContext({});function Fl(e){return typeof e=="string"||Array.isArray(e)}function Pf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const _v=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Mv=["initial",..._v];function Cf(e){return Pf(e.animate)||Mv.some(t=>Fl(e[t]))}function A2(e){return!!(Cf(e)||e.variants)}function zD(e,t){if(Cf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Fl(n)?n:void 0,animate:Fl(r)?r:void 0}}return e.inherit!==!1?t:{}}function FD(e){const{initial:t,animate:n}=zD(e,b.useContext(kf));return b.useMemo(()=>({initial:t,animate:n}),[F1(t),F1(n)])}function F1(e){return Array.isArray(e)?e.join(" "):e}const BD=Symbol.for("motionComponentSymbol");function Ua(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function VD(e,t,n){return b.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ua(n)&&(n.current=r))},[t])}const Iv=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),UD="framerAppearId",E2="data-"+Iv(UD),{schedule:Dv}=P2(queueMicrotask,!1),T2=b.createContext({});function WD(e,t,n,r,i){var a,l;const{visualElement:u}=b.useContext(kf),d=b.useContext(C2),p=b.useContext(Nf),h=b.useContext(Av).reducedMotion,m=b.useRef(null);r=r||d.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:u,props:n,presenceContext:p,blockInitialAnimation:p?p.initial===!1:!1,reducedMotionConfig:h}));const v=m.current,x=b.useContext(T2);v&&!v.projection&&i&&(v.type==="html"||v.type==="svg")&&qD(m.current,n,i,x);const w=b.useRef(!1);b.useInsertionEffect(()=>{v&&w.current&&v.update(n,p)});const S=n[E2],j=b.useRef(!!S&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,S))&&((l=window.MotionHasOptimisedAnimation)===null||l===void 0?void 0:l.call(window,S)));return S2(()=>{v&&(w.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),Dv.render(v.render),j.current&&v.animationState&&v.animationState.animateChanges())}),b.useEffect(()=>{v&&(!j.current&&v.animationState&&v.animationState.animateChanges(),j.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)===null||k===void 0||k.call(window,S)}),j.current=!1))}),v}function qD(e,t,n,r){const{layoutId:i,layout:a,drag:l,dragConstraints:u,layoutScroll:d,layoutRoot:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:_2(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!l||u&&Ua(u),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:d,layoutRoot:p})}function _2(e){if(e)return e.options.allowProjection!==!1?e.projection:_2(e.parent)}function KD({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var a,l;e&&ID(e);function u(p,h){let m;const v={...b.useContext(Av),...p,layoutId:HD(p)},{isStatic:x}=v,w=FD(p),S=r(p,x);if(!x&&Ev){GD();const j=YD(v);m=j.MeasureLayout,w.visualElement=WD(i,S,v,t,j.ProjectionNode)}return c.jsxs(kf.Provider,{value:w,children:[m&&w.visualElement?c.jsx(m,{visualElement:w.visualElement,...v}):null,n(i,p,VD(S,w.visualElement,h),S,x,w.visualElement)]})}u.displayName=`motion.${typeof i=="string"?i:`create(${(l=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&l!==void 0?l:""})`}`;const d=b.forwardRef(u);return d[BD]=i,d}function HD({layoutId:e}){const t=b.useContext(Cv).id;return t&&e!==void 0?t+"-"+e:e}function GD(e,t){b.useContext(C2).strict}function YD(e){const{drag:t,layout:n}=ro;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const XD=["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 Rv(e){return typeof e!="string"||e.includes("-")?!1:!!(XD.indexOf(e)>-1||/[A-Z]/u.test(e))}function B1(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Lv(e,t,n,r){if(typeof t=="function"){const[i,a]=B1(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=B1(r);t=t(n!==void 0?n:e.custom,i,a)}return t}const og=e=>Array.isArray(e),QD=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),JD=e=>og(e)?e[e.length-1]||0:e,cn=e=>!!(e&&e.getVelocity);function od(e){const t=cn(e)?e.get():e;return QD(t)?t.toValue():t}function ZD({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,a){const l={latestValues:e4(r,i,a,e),renderState:t()};return n&&(l.onMount=u=>n({props:r,current:u,...l}),l.onUpdate=u=>n(u)),l}const M2=e=>(t,n)=>{const r=b.useContext(kf),i=b.useContext(Nf),a=()=>ZD(e,t,r,i);return n?a():Ov(a)};function e4(e,t,n,r){const i={},a=r(e,{});for(const v in a)i[v]=od(a[v]);let{initial:l,animate:u}=e;const d=Cf(e),p=A2(e);t&&p&&!d&&e.inherit!==!1&&(l===void 0&&(l=t.initial),u===void 0&&(u=t.animate));let h=n?n.initial===!1:!1;h=h||l===!1;const m=h?u:l;if(m&&typeof m!="boolean"&&!Pf(m)){const v=Array.isArray(m)?m:[m];for(let x=0;x<v.length;x++){const w=Lv(e,v[x]);if(w){const{transitionEnd:S,transition:j,...k}=w;for(const C in k){let E=k[C];if(Array.isArray(E)){const O=h?E.length-1:0;E=E[O]}E!==null&&(i[C]=E)}for(const C in S)i[C]=S[C]}}}return i}const yo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],aa=new Set(yo),I2=e=>t=>typeof t=="string"&&t.startsWith(e),D2=I2("--"),t4=I2("var(--"),$v=e=>t4(e)?n4.test(e.split("/*")[0].trim()):!1,n4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,R2=(e,t)=>t&&typeof e=="number"?t.transform(e):e,xi=(e,t,n)=>n>t?t:n<e?e:n,bo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Bl={...bo,transform:e=>xi(0,1,e)},$u={...bo,default:1},cc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),is=cc("deg"),Ur=cc("%"),Ee=cc("px"),r4=cc("vh"),i4=cc("vw"),V1={...Ur,parse:e=>Ur.parse(e)/100,transform:e=>Ur.transform(e*100)},s4={borderWidth:Ee,borderTopWidth:Ee,borderRightWidth:Ee,borderBottomWidth:Ee,borderLeftWidth:Ee,borderRadius:Ee,radius:Ee,borderTopLeftRadius:Ee,borderTopRightRadius:Ee,borderBottomRightRadius:Ee,borderBottomLeftRadius:Ee,width:Ee,maxWidth:Ee,height:Ee,maxHeight:Ee,top:Ee,right:Ee,bottom:Ee,left:Ee,padding:Ee,paddingTop:Ee,paddingRight:Ee,paddingBottom:Ee,paddingLeft:Ee,margin:Ee,marginTop:Ee,marginRight:Ee,marginBottom:Ee,marginLeft:Ee,backgroundPositionX:Ee,backgroundPositionY:Ee},a4={rotate:is,rotateX:is,rotateY:is,rotateZ:is,scale:$u,scaleX:$u,scaleY:$u,scaleZ:$u,skew:is,skewX:is,skewY:is,distance:Ee,translateX:Ee,translateY:Ee,translateZ:Ee,x:Ee,y:Ee,z:Ee,perspective:Ee,transformPerspective:Ee,opacity:Bl,originX:V1,originY:V1,originZ:Ee},U1={...bo,transform:Math.round},zv={...s4,...a4,zIndex:U1,size:Ee,fillOpacity:Bl,strokeOpacity:Bl,numOctaves:U1},o4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},l4=yo.length;function c4(e,t,n){let r="",i=!0;for(let a=0;a<l4;a++){const l=yo[a],u=e[l];if(u===void 0)continue;let d=!0;if(typeof u=="number"?d=u===(l.startsWith("scale")?1:0):d=parseFloat(u)===0,!d||n){const p=R2(u,zv[l]);if(!d){i=!1;const h=o4[l]||l;r+=`${h}(${p}) `}n&&(t[l]=p)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Fv(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let l=!1,u=!1;for(const d in t){const p=t[d];if(aa.has(d)){l=!0;continue}else if(D2(d)){i[d]=p;continue}else{const h=R2(p,zv[d]);d.startsWith("origin")?(u=!0,a[d]=h):r[d]=h}}if(t.transform||(l||n?r.transform=c4(t,e.transform,n):r.transform&&(r.transform="none")),u){const{originX:d="50%",originY:p="50%",originZ:h=0}=a;r.transformOrigin=`${d} ${p} ${h}`}}const u4={offset:"stroke-dashoffset",array:"stroke-dasharray"},d4={offset:"strokeDashoffset",array:"strokeDasharray"};function f4(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?u4:d4;e[a.offset]=Ee.transform(-r);const l=Ee.transform(t),u=Ee.transform(n);e[a.array]=`${l} ${u}`}function W1(e,t,n){return typeof e=="string"?e:Ee.transform(t+n*e)}function p4(e,t,n){const r=W1(t,e.x,e.width),i=W1(n,e.y,e.height);return`${r} ${i}`}function Bv(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:l,pathSpacing:u=1,pathOffset:d=0,...p},h,m){if(Fv(e,p,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:v,style:x,dimensions:w}=e;v.transform&&(w&&(x.transform=v.transform),delete v.transform),w&&(i!==void 0||a!==void 0||x.transform)&&(x.transformOrigin=p4(w,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(v.x=t),n!==void 0&&(v.y=n),r!==void 0&&(v.scale=r),l!==void 0&&f4(v,l,u,d,!1)}const Vv=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),L2=()=>({...Vv(),attrs:{}}),Uv=e=>typeof e=="string"&&e.toLowerCase()==="svg";function $2(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const a in n)e.style.setProperty(a,n[a])}const z2=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"]);function F2(e,t,n,r){$2(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(z2.has(i)?i:Iv(i),t.attrs[i])}const jd={};function h4(e){Object.assign(jd,e)}function B2(e,{layout:t,layoutId:n}){return aa.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!jd[e]||e==="opacity")}function Wv(e,t,n){var r;const{style:i}=e,a={};for(const l in i)(cn(i[l])||t.style&&cn(t.style[l])||B2(l,e)||((r=n==null?void 0:n.getValue(l))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[l]=i[l]);return a}function V2(e,t,n){const r=Wv(e,t,n);for(const i in e)if(cn(e[i])||cn(t[i])){const a=yo.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}function m4(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const q1=["x","y","width","height","cx","cy","r"],g4={useVisualState:M2({scrapeMotionValuesFromProps:V2,createRenderState:L2,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let a=!!e.drag;if(!a){for(const u in i)if(aa.has(u)){a=!0;break}}if(!a)return;let l=!t;if(t)for(let u=0;u<q1.length;u++){const d=q1[u];e[d]!==t[d]&&(l=!0)}l&&ut.read(()=>{m4(n,r),ut.render(()=>{Bv(r,i,Uv(n.tagName),e.transformTemplate),F2(n,r)})})}})},v4={useVisualState:M2({scrapeMotionValuesFromProps:Wv,createRenderState:Vv})};function U2(e,t,n){for(const r in t)!cn(t[r])&&!B2(r,n)&&(e[r]=t[r])}function x4({transformTemplate:e},t){return b.useMemo(()=>{const n=Vv();return Fv(n,t,e),Object.assign({},n.vars,n.style)},[t])}function y4(e,t){const n=e.style||{},r={};return U2(r,n,e),Object.assign(r,x4(e,t)),r}function b4(e,t){const n={},r=y4(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}function w4(e,t,n,r){const i=b.useMemo(()=>{const a=L2();return Bv(a,t,Uv(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};U2(a,e.style,e),i.style={...a,...i.style}}return i}function j4(e=!1){return(n,r,i,{latestValues:a},l)=>{const d=(Rv(n)?w4:b4)(r,a,l,n),p=LD(r,typeof n=="string",e),h=n!==b.Fragment?{...p,...d,ref:i}:{},{children:m}=r,v=b.useMemo(()=>cn(m)?m.get():m,[m]);return b.createElement(n,{...h,children:v})}}function S4(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const l={...Rv(r)?g4:v4,preloadedFeatures:e,useRender:j4(i),createVisualElement:t,Component:r};return KD(l)}}function W2(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}function Of(e,t,n){const r=e.getProps();return Lv(r,t,n!==void 0?n:r.custom,e)}const N4=Tv(()=>window.ScrollTimeline!==void 0);class k4{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(N4()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class P4 extends k4{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function qv(e,t){return e?e[t]||e.default||e:void 0}const lg=2e4;function q2(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<lg;)t+=n,r=e.next(t);return t>=lg?1/0:t}function Kv(e){return typeof e=="function"}function K1(e,t){e.timeline=t,e.onfinish=null}const Hv=e=>Array.isArray(e)&&typeof e[0]=="number",C4={linearEasing:void 0};function O4(e,t){const n=Tv(e);return()=>{var r;return(r=C4[t])!==null&&r!==void 0?r:n()}}const Sd=O4(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),K2=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=e(no(0,i-1,a))+", ";return`linear(${r.substring(0,r.length-2)})`};function H2(e){return!!(typeof e=="function"&&Sd()||!e||typeof e=="string"&&(e in cg||Sd())||Hv(e)||Array.isArray(e)&&e.every(H2))}const Pl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,cg={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pl([0,.65,.55,1]),circOut:Pl([.55,0,1,.45]),backIn:Pl([.31,.01,.66,-.59]),backOut:Pl([.33,1.53,.69,.99])};function G2(e,t){if(e)return typeof e=="function"&&Sd()?K2(e,t):Hv(e)?Pl(e):Array.isArray(e)?e.map(n=>G2(n,t)||cg.easeOut):cg[e]}const Sr={x:!1,y:!1};function Y2(){return Sr.x||Sr.y}function A4(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const a=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function X2(e,t){const n=A4(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function H1(e){return t=>{t.pointerType==="touch"||Y2()||e(t)}}function E4(e,t,n={}){const[r,i,a]=X2(e,n),l=H1(u=>{const{target:d}=u,p=t(u);if(typeof p!="function"||!d)return;const h=H1(m=>{p(m),d.removeEventListener("pointerleave",h)});d.addEventListener("pointerleave",h,i)});return r.forEach(u=>{u.addEventListener("pointerenter",l,i)}),a}const Q2=(e,t)=>t?e===t?!0:Q2(e,t.parentElement):!1,Gv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,T4=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function _4(e){return T4.has(e.tagName)||e.tabIndex!==-1}const Cl=new WeakSet;function G1(e){return t=>{t.key==="Enter"&&e(t)}}function sm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const M4=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=G1(()=>{if(Cl.has(n))return;sm(n,"down");const i=G1(()=>{sm(n,"up")}),a=()=>sm(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Y1(e){return Gv(e)&&!Y2()}function I4(e,t,n={}){const[r,i,a]=X2(e,n),l=u=>{const d=u.currentTarget;if(!Y1(u)||Cl.has(d))return;Cl.add(d);const p=t(u),h=(x,w)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",v),!(!Y1(x)||!Cl.has(d))&&(Cl.delete(d),typeof p=="function"&&p(x,{success:w}))},m=x=>{h(x,n.useGlobalTarget||Q2(d,x.target))},v=x=>{h(x,!1)};window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",v,i)};return r.forEach(u=>{!_4(u)&&u.getAttribute("tabindex")===null&&(u.tabIndex=0),(n.useGlobalTarget?window:u).addEventListener("pointerdown",l,i),u.addEventListener("focus",p=>M4(p,i),i)}),a}function D4(e){return e==="x"||e==="y"?Sr[e]?null:(Sr[e]=!0,()=>{Sr[e]=!1}):Sr.x||Sr.y?null:(Sr.x=Sr.y=!0,()=>{Sr.x=Sr.y=!1})}const J2=new Set(["width","height","top","left","right","bottom",...yo]);let ld;function R4(){ld=void 0}const Wr={now:()=>(ld===void 0&&Wr.set(Qt.isProcessing||TD.useManualTiming?Qt.timestamp:performance.now()),ld),set:e=>{ld=e,queueMicrotask(R4)}};function Yv(e,t){e.indexOf(t)===-1&&e.push(t)}function Xv(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Qv{constructor(){this.subscriptions=[]}add(t){return Yv(this.subscriptions,t),()=>Xv(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let a=0;a<i;a++){const l=this.subscriptions[a];l&&l(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Z2(e,t){return t?e*(1e3/t):0}const X1=30,L4=e=>!isNaN(parseFloat(e));class $4{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=Wr.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Wr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=L4(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 Qv);const r=this.events[t].add(n);return t==="change"?()=>{r(),ut.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,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}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()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Wr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>X1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,X1);return Z2(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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Vl(e,t){return new $4(e,t)}function z4(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Vl(n))}function F4(e,t){const n=Of(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const l in a){const u=JD(a[l]);z4(e,l,u)}}function B4(e){return!!(cn(e)&&e.add)}function ug(e,t){const n=e.getValue("willChange");if(B4(n))return n.add(t)}function eO(e){return e.props[E2]}const tO=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,V4=1e-7,U4=12;function W4(e,t,n,r,i){let a,l,u=0;do l=t+(n-t)/2,a=tO(l,r,i)-e,a>0?n=l:t=l;while(Math.abs(a)>V4&&++u<U4);return l}function uc(e,t,n,r){if(e===t&&n===r)return Vn;const i=a=>W4(a,0,1,e,n);return a=>a===0||a===1?a:tO(i(a),t,r)}const nO=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,rO=e=>t=>1-e(1-t),iO=uc(.33,1.53,.69,.99),Jv=rO(iO),sO=nO(Jv),aO=e=>(e*=2)<1?.5*Jv(e):.5*(2-Math.pow(2,-10*(e-1))),Zv=e=>1-Math.sin(Math.acos(e)),oO=rO(Zv),lO=nO(Zv),cO=e=>/^0[^.\s]+$/u.test(e);function q4(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||cO(e):!0}const _l=e=>Math.round(e*1e5)/1e5,ex=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function K4(e){return e==null}const H4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tx=(e,t)=>n=>!!(typeof n=="string"&&H4.test(n)&&n.startsWith(e)||t&&!K4(n)&&Object.prototype.hasOwnProperty.call(n,t)),uO=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,l,u]=r.match(ex);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(l),alpha:u!==void 0?parseFloat(u):1}},G4=e=>xi(0,255,e),am={...bo,transform:e=>Math.round(G4(e))},Ws={test:tx("rgb","red"),parse:uO("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+am.transform(e)+", "+am.transform(t)+", "+am.transform(n)+", "+_l(Bl.transform(r))+")"};function Y4(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const dg={test:tx("#"),parse:Y4,transform:Ws.transform},Wa={test:tx("hsl","hue"),parse:uO("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ur.transform(_l(t))+", "+Ur.transform(_l(n))+", "+_l(Bl.transform(r))+")"},on={test:e=>Ws.test(e)||dg.test(e)||Wa.test(e),parse:e=>Ws.test(e)?Ws.parse(e):Wa.test(e)?Wa.parse(e):dg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ws.transform(e):Wa.transform(e)},X4=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Q4(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ex))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(X4))===null||n===void 0?void 0:n.length)||0)>0}const dO="number",fO="color",J4="var",Z4="var(",Q1="${}",eR=/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 Ul(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const u=t.replace(eR,d=>(on.test(d)?(r.color.push(a),i.push(fO),n.push(on.parse(d))):d.startsWith(Z4)?(r.var.push(a),i.push(J4),n.push(d)):(r.number.push(a),i.push(dO),n.push(parseFloat(d))),++a,Q1)).split(Q1);return{values:n,split:u,indexes:r,types:i}}function pO(e){return Ul(e).values}function hO(e){const{split:t,types:n}=Ul(e),r=t.length;return i=>{let a="";for(let l=0;l<r;l++)if(a+=t[l],i[l]!==void 0){const u=n[l];u===dO?a+=_l(i[l]):u===fO?a+=on.transform(i[l]):a+=i[l]}return a}}const tR=e=>typeof e=="number"?0:e;function nR(e){const t=pO(e);return hO(e)(t.map(tR))}const ps={test:Q4,parse:pO,createTransformer:hO,getAnimatableNone:nR},rR=new Set(["brightness","contrast","saturate","opacity"]);function iR(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ex)||[];if(!r)return e;const i=n.replace(r,"");let a=rR.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const sR=/\b([a-z-]*)\(.*?\)/gu,fg={...ps,getAnimatableNone:e=>{const t=e.match(sR);return t?t.map(iR).join(" "):e}},aR={...zv,color:on,backgroundColor:on,outlineColor:on,fill:on,stroke:on,borderColor:on,borderTopColor:on,borderRightColor:on,borderBottomColor:on,borderLeftColor:on,filter:fg,WebkitFilter:fg},nx=e=>aR[e];function mO(e,t){let n=nx(e);return n!==fg&&(n=ps),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const oR=new Set(["auto","none","0"]);function lR(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!oR.has(a)&&Ul(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=mO(n,i)}const J1=e=>e===bo||e===Ee,Z1=(e,t)=>parseFloat(e.split(", ")[t]),ej=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Z1(i[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?Z1(a[1],e):0}},cR=new Set(["x","y","z"]),uR=yo.filter(e=>!cR.has(e));function dR(e){const t=[];return uR.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const io={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:ej(4,13),y:ej(5,14)};io.translateX=io.x;io.translateY=io.y;const Gs=new Set;let pg=!1,hg=!1;function gO(){if(hg){const e=Array.from(Gs).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=dR(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,l])=>{var u;(u=r.getValue(a))===null||u===void 0||u.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}hg=!1,pg=!1,Gs.forEach(e=>e.complete()),Gs.clear()}function vO(){Gs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(hg=!0)})}function fR(){vO(),gO()}class rx{constructor(t,n,r,i,a,l=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=l}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Gs.add(this),pg||(pg=!0,ut.read(vO),ut.resolveKeyframes(gO))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const l=i==null?void 0:i.get(),u=t[t.length-1];if(l!==void 0)t[0]=l;else if(r&&n){const d=r.readValue(n,u);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=u),i&&l===void 0&&i.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Gs.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Gs.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const xO=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),pR=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function hR(e){const t=pR.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function yO(e,t,n=1){const[r,i]=hR(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const l=a.trim();return xO(l)?parseFloat(l):l}return $v(i)?yO(i,t,n+1):i}const bO=e=>t=>t.test(e),mR={test:e=>e==="auto",parse:e=>e},wO=[bo,Ee,Ur,is,i4,r4,mR],tj=e=>wO.find(bO(e));class jO extends rx{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let p=t[d];if(typeof p=="string"&&(p=p.trim(),$v(p))){const h=yO(p,n.current);h!==void 0&&(t[d]=h),d===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!J2.has(r)||t.length!==2)return;const[i,a]=t,l=tj(i),u=tj(a);if(l!==u)if(J1(l)&&J1(u))for(let d=0;d<t.length;d++){const p=t[d];typeof p=="string"&&(t[d]=parseFloat(p))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)q4(t[i])&&r.push(i);r.length&&lR(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=io[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const a=n.getValue(r);a&&a.jump(this.measuredOrigin,!1);const l=i.length-1,u=i[l];i[l]=io[r](n.measureViewportBox(),window.getComputedStyle(n.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([d,p])=>{n.getValue(d).set(p)}),this.resolveNoneKeyframes()}}const nj=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ps.test(e)||e==="0")&&!e.startsWith("url("));function gR(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 vR(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],l=nj(i,t),u=nj(a,t);return!l||!u?!1:gR(e)||(n==="spring"||Kv(n))&&r}const xR=e=>e!==null;function Af(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(xR),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const yR=40;class SO{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:l="loop",...u}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Wr.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:l,...u},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>yR?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&fR(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Wr.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:l,onComplete:u,onUpdate:d,isGenerator:p}=this.options;if(!p&&!vR(t,r,i,a))if(l)this.options.duration=0;else{d&&d(Af(t,this.options,n)),u&&u(),this.resolveFinishedPromise();return}const h=this.initPlayback(t,n);h!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...h},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const gt=(e,t,n)=>e+(t-e)*n;function om(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 bR({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,l=0;if(!t)i=a=l=n;else{const u=n<.5?n*(1+t):n+t-n*t,d=2*n-u;i=om(d,u,e+1/3),a=om(d,u,e),l=om(d,u,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:r}}function Nd(e,t){return n=>n>0?t:e}const lm=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},wR=[dg,Ws,Wa],jR=e=>wR.find(t=>t.test(e));function rj(e){const t=jR(e);if(!t)return!1;let n=t.parse(e);return t===Wa&&(n=bR(n)),n}const ij=(e,t)=>{const n=rj(e),r=rj(t);if(!n||!r)return Nd(e,t);const i={...n};return a=>(i.red=lm(n.red,r.red,a),i.green=lm(n.green,r.green,a),i.blue=lm(n.blue,r.blue,a),i.alpha=gt(n.alpha,r.alpha,a),Ws.transform(i))},SR=(e,t)=>n=>t(e(n)),dc=(...e)=>e.reduce(SR),mg=new Set(["none","hidden"]);function NR(e,t){return mg.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function kR(e,t){return n=>gt(e,t,n)}function ix(e){return typeof e=="number"?kR:typeof e=="string"?$v(e)?Nd:on.test(e)?ij:OR:Array.isArray(e)?NO:typeof e=="object"?on.test(e)?ij:PR:Nd}function NO(e,t){const n=[...e],r=n.length,i=e.map((a,l)=>ix(a)(a,t[l]));return a=>{for(let l=0;l<r;l++)n[l]=i[l](a);return n}}function PR(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ix(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function CR(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const l=t.types[a],u=e.indexes[l][i[l]],d=(n=e.values[u])!==null&&n!==void 0?n:0;r[a]=d,i[l]++}return r}const OR=(e,t)=>{const n=ps.createTransformer(t),r=Ul(e),i=Ul(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?mg.has(e)&&!i.values.length||mg.has(t)&&!r.values.length?NR(e,t):dc(NO(CR(r,i),i.values),n):Nd(e,t)};function kO(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?gt(e,t,n):ix(e)(e,t)}const AR=5;function PO(e,t,n){const r=Math.max(t-AR,0);return Z2(n-e(r),t-r)}const yt={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},cm=.001;function ER({duration:e=yt.duration,bounce:t=yt.bounce,velocity:n=yt.velocity,mass:r=yt.mass}){let i,a,l=1-t;l=xi(yt.minDamping,yt.maxDamping,l),e=xi(yt.minDuration,yt.maxDuration,mi(e)),l<1?(i=p=>{const h=p*l,m=h*e,v=h-n,x=gg(p,l),w=Math.exp(-m);return cm-v/x*w},a=p=>{const m=p*l*e,v=m*n+n,x=Math.pow(l,2)*Math.pow(p,2)*e,w=Math.exp(-m),S=gg(Math.pow(p,2),l);return(-i(p)+cm>0?-1:1)*((v-x)*w)/S}):(i=p=>{const h=Math.exp(-p*e),m=(p-n)*e+1;return-cm+h*m},a=p=>{const h=Math.exp(-p*e),m=(n-p)*(e*e);return h*m});const u=5/e,d=_R(i,a,u);if(e=hi(e),isNaN(d))return{stiffness:yt.stiffness,damping:yt.damping,duration:e};{const p=Math.pow(d,2)*r;return{stiffness:p,damping:l*2*Math.sqrt(r*p),duration:e}}}const TR=12;function _R(e,t,n){let r=n;for(let i=1;i<TR;i++)r=r-e(r)/t(r);return r}function gg(e,t){return e*Math.sqrt(1-t*t)}const MR=["duration","bounce"],IR=["stiffness","damping","mass"];function sj(e,t){return t.some(n=>e[n]!==void 0)}function DR(e){let t={velocity:yt.velocity,stiffness:yt.stiffness,damping:yt.damping,mass:yt.mass,isResolvedFromDuration:!1,...e};if(!sj(e,IR)&&sj(e,MR))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*xi(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:yt.mass,stiffness:i,damping:a}}else{const n=ER(e);t={...t,...n,mass:yt.mass},t.isResolvedFromDuration=!0}return t}function CO(e=yt.visualDuration,t=yt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],u={done:!1,value:a},{stiffness:d,damping:p,mass:h,duration:m,velocity:v,isResolvedFromDuration:x}=DR({...n,velocity:-mi(n.velocity||0)}),w=v||0,S=p/(2*Math.sqrt(d*h)),j=l-a,k=mi(Math.sqrt(d/h)),C=Math.abs(j)<5;r||(r=C?yt.restSpeed.granular:yt.restSpeed.default),i||(i=C?yt.restDelta.granular:yt.restDelta.default);let E;if(S<1){const P=gg(k,S);E=A=>{const _=Math.exp(-S*k*A);return l-_*((w+S*k*j)/P*Math.sin(P*A)+j*Math.cos(P*A))}}else if(S===1)E=P=>l-Math.exp(-k*P)*(j+(w+k*j)*P);else{const P=k*Math.sqrt(S*S-1);E=A=>{const _=Math.exp(-S*k*A),D=Math.min(P*A,300);return l-_*((w+S*k*j)*Math.sinh(D)+P*j*Math.cosh(D))/P}}const O={calculatedDuration:x&&m||null,next:P=>{const A=E(P);if(x)u.done=P>=m;else{let _=0;S<1&&(_=P===0?hi(w):PO(E,P,A));const D=Math.abs(_)<=r,$=Math.abs(l-A)<=i;u.done=D&&$}return u.value=u.done?l:A,u},toString:()=>{const P=Math.min(q2(O),lg),A=K2(_=>O.next(P*_).value,P,30);return P+"ms "+A}};return O}function aj({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:l,min:u,max:d,restDelta:p=.5,restSpeed:h}){const m=e[0],v={done:!1,value:m},x=D=>u!==void 0&&D<u||d!==void 0&&D>d,w=D=>u===void 0?d:d===void 0||Math.abs(u-D)<Math.abs(d-D)?u:d;let S=n*t;const j=m+S,k=l===void 0?j:l(j);k!==j&&(S=k-m);const C=D=>-S*Math.exp(-D/r),E=D=>k+C(D),O=D=>{const $=C(D),q=E(D);v.done=Math.abs($)<=p,v.value=v.done?k:q};let P,A;const _=D=>{x(v.value)&&(P=D,A=CO({keyframes:[v.value,w(v.value)],velocity:PO(E,D,v.value),damping:i,stiffness:a,restDelta:p,restSpeed:h}))};return _(0),{calculatedDuration:null,next:D=>{let $=!1;return!A&&P===void 0&&($=!0,O(D),_(D)),P!==void 0&&D>=P?A.next(D-P):(!$&&O(D),v)}}}const RR=uc(.42,0,1,1),LR=uc(0,0,.58,1),OO=uc(.42,0,.58,1),$R=e=>Array.isArray(e)&&typeof e[0]!="number",zR={linear:Vn,easeIn:RR,easeInOut:OO,easeOut:LR,circIn:Zv,circInOut:lO,circOut:oO,backIn:Jv,backInOut:sO,backOut:iO,anticipate:aO},oj=e=>{if(Hv(e)){k2(e.length===4);const[t,n,r,i]=e;return uc(t,n,r,i)}else if(typeof e=="string")return zR[e];return e};function FR(e,t,n){const r=[],i=n||kO,a=e.length-1;for(let l=0;l<a;l++){let u=i(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||Vn:t;u=dc(d,u)}r.push(u)}return r}function BR(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(k2(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=FR(t,r,i),d=u.length,p=h=>{if(l&&h<e[0])return t[0];let m=0;if(d>1)for(;m<e.length-2&&!(h<e[m+1]);m++);const v=no(e[m],e[m+1],h);return u[m](v)};return n?h=>p(xi(e[0],e[a-1],h)):p}function VR(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=no(0,t,r);e.push(gt(n,1,i))}}function UR(e){const t=[0];return VR(t,e.length-1),t}function WR(e,t){return e.map(n=>n*t)}function qR(e,t){return e.map(()=>t||OO).splice(0,e.length-1)}function kd({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=$R(r)?r.map(oj):oj(r),a={done:!1,value:t[0]},l=WR(n&&n.length===t.length?n:UR(t),e),u=BR(l,t,{ease:Array.isArray(i)?i:qR(t,i)});return{calculatedDuration:e,next:d=>(a.value=u(d),a.done=d>=e,a)}}const KR=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ut.update(t,!0),stop:()=>fs(t),now:()=>Qt.isProcessing?Qt.timestamp:Wr.now()}},HR={decay:aj,inertia:aj,tween:kd,keyframes:kd,spring:CO},GR=e=>e/100;class sx extends SO{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:d}=this.options;d&&d()};const{name:n,motionValue:r,element:i,keyframes:a}=this.options,l=(i==null?void 0:i.KeyframeResolver)||rx,u=(d,p)=>this.onKeyframesResolved(d,p);this.resolver=new l(a,u,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:l=0}=this.options,u=Kv(n)?n:HR[n]||kd;let d,p;u!==kd&&typeof t[0]!="number"&&(d=dc(GR,kO(t[0],t[1])),t=[0,100]);const h=u({...this.options,keyframes:t});a==="mirror"&&(p=u({...this.options,keyframes:[...t].reverse(),velocity:-l})),h.calculatedDuration===null&&(h.calculatedDuration=q2(h));const{calculatedDuration:m}=h,v=m+i,x=v*(r+1)-i;return{generator:h,mirroredGenerator:p,mapPercentToKeyframes:d,calculatedDuration:m,resolvedDuration:v,totalDuration:x}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:D}=this.options;return{done:!0,value:D[D.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:l,mapPercentToKeyframes:u,keyframes:d,calculatedDuration:p,totalDuration:h,resolvedDuration:m}=r;if(this.startTime===null)return a.next(0);const{delay:v,repeat:x,repeatType:w,repeatDelay:S,onUpdate:j}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-h/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const k=this.currentTime-v*(this.speed>=0?1:-1),C=this.speed>=0?k<0:k>h;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=h);let E=this.currentTime,O=a;if(x){const D=Math.min(this.currentTime,h)/m;let $=Math.floor(D),q=D%1;!q&&D>=1&&(q=1),q===1&&$--,$=Math.min($,x+1),!!($%2)&&(w==="reverse"?(q=1-q,S&&(q-=S/m)):w==="mirror"&&(O=l)),E=xi(0,1,q)*m}const P=C?{done:!1,value:d[0]}:O.next(E);u&&(P.value=u(P.value));let{done:A}=P;!C&&p!==null&&(A=this.speed>=0?this.currentTime>=h:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return _&&i!==void 0&&(P.value=Af(d,this.options,i)),j&&j(P.value),_&&this.finish(),P}get duration(){const{resolved:t}=this;return t?mi(t.calculatedDuration):0}get time(){return mi(this.currentTime)}set time(t){t=hi(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=mi(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=KR,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const YR=new Set(["opacity","clipPath","filter","transform"]);function XR(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:l="loop",ease:u="easeInOut",times:d}={}){const p={[t]:n};d&&(p.offset=d);const h=G2(u,i);return Array.isArray(h)&&(p.easing=h),e.animate(p,{delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"})}const QR=Tv(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Pd=10,JR=2e4;function ZR(e){return Kv(e.type)||e.type==="spring"||!H2(e.ease)}function eL(e,t){const n=new sx({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let a=0;for(;!r.done&&a<JR;)r=n.sample(a),i.push(r.value),a+=Pd;return{times:void 0,keyframes:i,duration:a-Pd,ease:"linear"}}const AO={anticipate:aO,backInOut:sO,circInOut:lO};function tL(e){return e in AO}class lj extends SO{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:a}=this.options;this.resolver=new jO(a,(l,u)=>this.onKeyframesResolved(l,u),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:a,type:l,motionValue:u,name:d,startTime:p}=this.options;if(!u.owner||!u.owner.current)return!1;if(typeof a=="string"&&Sd()&&tL(a)&&(a=AO[a]),ZR(this.options)){const{onComplete:m,onUpdate:v,motionValue:x,element:w,...S}=this.options,j=eL(t,S);t=j.keyframes,t.length===1&&(t[1]=t[0]),r=j.duration,i=j.times,a=j.ease,l="keyframes"}const h=XR(u.owner.current,d,t,{...this.options,duration:r,times:i,ease:a});return h.startTime=p??this.calcStartTime(),this.pendingTimeline?(K1(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:m}=this.options;u.set(Af(t,this.options,n)),m&&m(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:r,times:i,type:l,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return mi(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return mi(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=hi(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Vn;const{animation:r}=n;K1(r,t)}return Vn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:a,ease:l,times:u}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:p,onUpdate:h,onComplete:m,element:v,...x}=this.options,w=new sx({...x,keyframes:r,duration:i,type:a,ease:l,times:u,isGenerator:!0}),S=hi(this.time);p.setWithVelocity(w.sample(S-Pd).value,w.sample(S).value,Pd)}const{onStop:d}=this.options;d&&d(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:a,damping:l,type:u}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:p}=n.owner.getProps();return QR()&&r&&YR.has(r)&&!d&&!p&&!i&&a!=="mirror"&&l!==0&&u!=="inertia"}}const nL={type:"spring",stiffness:500,damping:25,restSpeed:10},rL=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),iL={type:"keyframes",duration:.8},sL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},aL=(e,{keyframes:t})=>t.length>2?iL:aa.has(e)?e.startsWith("scale")?rL(t[1]):nL:sL;function oL({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:l,repeatDelay:u,from:d,elapsed:p,...h}){return!!Object.keys(h).length}const ax=(e,t,n,r={},i,a)=>l=>{const u=qv(r,e)||{},d=u.delay||r.delay||0;let{elapsed:p=0}=r;p=p-hi(d);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-p,onUpdate:v=>{t.set(v),u.onUpdate&&u.onUpdate(v)},onComplete:()=>{l(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:a?void 0:i};oL(u)||(h={...h,...aL(e,h)}),h.duration&&(h.duration=hi(h.duration)),h.repeatDelay&&(h.repeatDelay=hi(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let m=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(h.duration=0,h.delay===0&&(m=!0)),m&&!a&&t.get()!==void 0){const v=Af(h.keyframes,u);if(v!==void 0)return ut.update(()=>{h.onUpdate(v),h.onComplete()}),new P4([])}return!a&&lj.supports(h)?new lj(h):new sx(h)};function lL({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function EO(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:l=e.getDefaultTransition(),transitionEnd:u,...d}=t;r&&(l=r);const p=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const m in d){const v=e.getValue(m,(a=e.latestValues[m])!==null&&a!==void 0?a:null),x=d[m];if(x===void 0||h&&lL(h,m))continue;const w={delay:n,...qv(l||{},m)};let S=!1;if(window.MotionHandoffAnimation){const k=eO(e);if(k){const C=window.MotionHandoffAnimation(k,m,ut);C!==null&&(w.startTime=C,S=!0)}}ug(e,m),v.start(ax(m,v,x,e.shouldReduceMotion&&J2.has(m)?{type:!1}:w,e,S));const j=v.animation;j&&p.push(j)}return u&&Promise.all(p).then(()=>{ut.update(()=>{u&&F4(e,u)})}),p}function vg(e,t,n={}){var r;const i=Of(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const l=i?()=>Promise.all(EO(e,i,n)):()=>Promise.resolve(),u=e.variantChildren&&e.variantChildren.size?(p=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:v}=a;return cL(e,t,h+p,m,v,n)}:()=>Promise.resolve(),{when:d}=a;if(d){const[p,h]=d==="beforeChildren"?[l,u]:[u,l];return p().then(()=>h())}else return Promise.all([l(),u(n.delay)])}function cL(e,t,n=0,r=0,i=1,a){const l=[],u=(e.variantChildren.size-1)*r,d=i===1?(p=0)=>p*r:(p=0)=>u-p*r;return Array.from(e.variantChildren).sort(uL).forEach((p,h)=>{p.notify("AnimationStart",t),l.push(vg(p,t,{...a,delay:n+d(h)}).then(()=>p.notify("AnimationComplete",t)))}),Promise.all(l)}function uL(e,t){return e.sortNodePosition(t)}function dL(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>vg(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=vg(e,t,n);else{const i=typeof t=="function"?Of(e,t,n.custom):t;r=Promise.all(EO(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const fL=Mv.length;function TO(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?TO(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<fL;n++){const r=Mv[n],i=e.props[r];(Fl(i)||i===!1)&&(t[r]=i)}return t}const pL=[..._v].reverse(),hL=_v.length;function mL(e){return t=>Promise.all(t.map(({animation:n,options:r})=>dL(e,n,r)))}function gL(e){let t=mL(e),n=cj(),r=!0;const i=d=>(p,h)=>{var m;const v=Of(e,h,d==="exit"?(m=e.presenceContext)===null||m===void 0?void 0:m.custom:void 0);if(v){const{transition:x,transitionEnd:w,...S}=v;p={...p,...S,...w}}return p};function a(d){t=d(e)}function l(d){const{props:p}=e,h=TO(e.parent)||{},m=[],v=new Set;let x={},w=1/0;for(let j=0;j<hL;j++){const k=pL[j],C=n[k],E=p[k]!==void 0?p[k]:h[k],O=Fl(E),P=k===d?C.isActive:null;P===!1&&(w=j);let A=E===h[k]&&E!==p[k]&&O;if(A&&r&&e.manuallyAnimateOnMount&&(A=!1),C.protectedKeys={...x},!C.isActive&&P===null||!E&&!C.prevProp||Pf(E)||typeof E=="boolean")continue;const _=vL(C.prevProp,E);let D=_||k===d&&C.isActive&&!A&&O||j>w&&O,$=!1;const q=Array.isArray(E)?E:[E];let X=q.reduce(i(k),{});P===!1&&(X={});const{prevResolvedValues:L={}}=C,Z={...L,...X},J=B=>{D=!0,v.has(B)&&($=!0,v.delete(B)),C.needsAnimating[B]=!0;const F=e.getValue(B);F&&(F.liveStyle=!1)};for(const B in Z){const F=X[B],G=L[B];if(x.hasOwnProperty(B))continue;let W=!1;og(F)&&og(G)?W=!W2(F,G):W=F!==G,W?F!=null?J(B):v.add(B):F!==void 0&&v.has(B)?J(B):C.protectedKeys[B]=!0}C.prevProp=E,C.prevResolvedValues=X,C.isActive&&(x={...x,...X}),r&&e.blockInitialAnimation&&(D=!1),D&&(!(A&&_)||$)&&m.push(...q.map(B=>({animation:B,options:{type:k}})))}if(v.size){const j={};v.forEach(k=>{const C=e.getBaseTarget(k),E=e.getValue(k);E&&(E.liveStyle=!0),j[k]=C??null}),m.push({animation:j})}let S=!!m.length;return r&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(S=!1),r=!1,S?t(m):Promise.resolve()}function u(d,p){var h;if(n[d].isActive===p)return Promise.resolve();(h=e.variantChildren)===null||h===void 0||h.forEach(v=>{var x;return(x=v.animationState)===null||x===void 0?void 0:x.setActive(d,p)}),n[d].isActive=p;const m=l(d);for(const v in n)n[v].protectedKeys={};return m}return{animateChanges:l,setActive:u,setAnimateFunction:a,getState:()=>n,reset:()=>{n=cj(),r=!0}}}function vL(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!W2(t,e):!1}function Ls(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function cj(){return{animate:Ls(!0),whileInView:Ls(),whileHover:Ls(),whileTap:Ls(),whileDrag:Ls(),whileFocus:Ls(),exit:Ls()}}class gs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class xL extends gs{constructor(t){super(t),t.animationState||(t.animationState=gL(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Pf(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(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let yL=0;class bL extends gs{constructor(){super(...arguments),this.id=yL++}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 i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const wL={animation:{Feature:xL},exit:{Feature:bL}};function Wl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function fc(e){return{point:{x:e.pageX,y:e.pageY}}}const jL=e=>t=>Gv(t)&&e(t,fc(t));function Ml(e,t,n,r){return Wl(e,t,jL(n),r)}const uj=(e,t)=>Math.abs(e-t);function SL(e,t){const n=uj(e.x,t.x),r=uj(e.y,t.y);return Math.sqrt(n**2+r**2)}class _O{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=dm(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,x=SL(m.offset,{x:0,y:0})>=3;if(!v&&!x)return;const{point:w}=m,{timestamp:S}=Qt;this.history.push({...w,timestamp:S});const{onStart:j,onMove:k}=this.handlers;v||(j&&j(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,m)},this.handlePointerMove=(m,v)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=um(v,this.transformPagePoint),ut.update(this.updatePoint,!0)},this.handlePointerUp=(m,v)=>{this.end();const{onEnd:x,onSessionEnd:w,resumeAnimation:S}=this.handlers;if(this.dragSnapToOrigin&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=dm(m.type==="pointercancel"?this.lastMoveEventInfo:um(v,this.transformPagePoint),this.history);this.startEvent&&x&&x(m,j),w&&w(m,j)},!Gv(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const l=fc(t),u=um(l,this.transformPagePoint),{point:d}=u,{timestamp:p}=Qt;this.history=[{...d,timestamp:p}];const{onSessionStart:h}=n;h&&h(t,dm(u,this.history)),this.removeListeners=dc(Ml(this.contextWindow,"pointermove",this.handlePointerMove),Ml(this.contextWindow,"pointerup",this.handlePointerUp),Ml(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),fs(this.updatePoint)}}function um(e,t){return t?{point:t(e.point)}:e}function dj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dm({point:e},t){return{point:e,delta:dj(e,MO(t)),offset:dj(e,NL(t)),velocity:kL(t,.1)}}function NL(e){return e[0]}function MO(e){return e[e.length-1]}function kL(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=MO(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>hi(t)));)n--;if(!r)return{x:0,y:0};const a=mi(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const l={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}const IO=1e-4,PL=1-IO,CL=1+IO,DO=.01,OL=0-DO,AL=0+DO;function Wn(e){return e.max-e.min}function EL(e,t,n){return Math.abs(e-t)<=n}function fj(e,t,n,r=.5){e.origin=r,e.originPoint=gt(t.min,t.max,e.origin),e.scale=Wn(n)/Wn(t),e.translate=gt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=PL&&e.scale<=CL||isNaN(e.scale))&&(e.scale=1),(e.translate>=OL&&e.translate<=AL||isNaN(e.translate))&&(e.translate=0)}function Il(e,t,n,r){fj(e.x,t.x,n.x,r?r.originX:void 0),fj(e.y,t.y,n.y,r?r.originY:void 0)}function pj(e,t,n){e.min=n.min+t.min,e.max=e.min+Wn(t)}function TL(e,t,n){pj(e.x,t.x,n.x),pj(e.y,t.y,n.y)}function hj(e,t,n){e.min=t.min-n.min,e.max=e.min+Wn(t)}function Dl(e,t,n){hj(e.x,t.x,n.x),hj(e.y,t.y,n.y)}function _L(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 mj(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 ML(e,{top:t,left:n,bottom:r,right:i}){return{x:mj(e.x,n,i),y:mj(e.y,t,r)}}function gj(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 IL(e,t){return{x:gj(e.x,t.x),y:gj(e.y,t.y)}}function DL(e,t){let n=.5;const r=Wn(e),i=Wn(t);return i>r?n=no(t.min,t.max-r,e.min):r>i&&(n=no(e.min,e.max-i,t.min)),xi(0,1,n)}function RL(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 xg=.35;function LL(e=xg){return e===!1?e=0:e===!0&&(e=xg),{x:vj(e,"left","right"),y:vj(e,"top","bottom")}}function vj(e,t,n){return{min:xj(e,t),max:xj(e,n)}}function xj(e,t){return typeof e=="number"?e:e[t]||0}const yj=()=>({translate:0,scale:1,origin:0,originPoint:0}),qa=()=>({x:yj(),y:yj()}),bj=()=>({min:0,max:0}),St=()=>({x:bj(),y:bj()});function rr(e){return[e("x"),e("y")]}function RO({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function $L({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function zL(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 fm(e){return e===void 0||e===1}function yg({scale:e,scaleX:t,scaleY:n}){return!fm(e)||!fm(t)||!fm(n)}function zs(e){return yg(e)||LO(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function LO(e){return wj(e.x)||wj(e.y)}function wj(e){return e&&e!=="0%"}function Cd(e,t,n){const r=e-n,i=t*r;return n+i}function jj(e,t,n,r,i){return i!==void 0&&(e=Cd(e,i,r)),Cd(e,n,r)+t}function bg(e,t=0,n=1,r,i){e.min=jj(e.min,t,n,r,i),e.max=jj(e.max,t,n,r,i)}function $O(e,{x:t,y:n}){bg(e.x,t.translate,t.scale,t.originPoint),bg(e.y,n.translate,n.scale,n.originPoint)}const Sj=.999999999999,Nj=1.0000000000001;function FL(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,l;for(let u=0;u<i;u++){a=n[u],l=a.projectionDelta;const{visualElement:d}=a.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Ha(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,$O(e,l)),r&&zs(a.latestValues)&&Ha(e,a.latestValues))}t.x<Nj&&t.x>Sj&&(t.x=1),t.y<Nj&&t.y>Sj&&(t.y=1)}function Ka(e,t){e.min=e.min+t,e.max=e.max+t}function kj(e,t,n,r,i=.5){const a=gt(e.min,e.max,i);bg(e,t,n,a,r)}function Ha(e,t){kj(e.x,t.x,t.scaleX,t.scale,t.originX),kj(e.y,t.y,t.scaleY,t.scale,t.originY)}function zO(e,t){return RO(zL(e.getBoundingClientRect(),t))}function BL(e,t,n){const r=zO(e,n),{scroll:i}=t;return i&&(Ka(r.x,i.offset.x),Ka(r.y,i.offset.y)),r}const FO=({current:e})=>e?e.ownerDocument.defaultView:null,VL=new WeakMap;class UL{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=St(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=h=>{const{dragSnapToOrigin:m}=this.getProps();m?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(fc(h).point)},a=(h,m)=>{const{drag:v,dragPropagation:x,onDragStart:w}=this.getProps();if(v&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=D4(v),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rr(j=>{let k=this.getAxisMotionValue(j).get()||0;if(Ur.test(k)){const{projection:C}=this.visualElement;if(C&&C.layout){const E=C.layout.layoutBox[j];E&&(k=Wn(E)*(parseFloat(k)/100))}}this.originPoint[j]=k}),w&&ut.postRender(()=>w(h,m)),ug(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},l=(h,m)=>{const{dragPropagation:v,dragDirectionLock:x,onDirectionLock:w,onDrag:S}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:j}=m;if(x&&this.currentDirection===null){this.currentDirection=WL(j),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",m.point,j),this.updateAxis("y",m.point,j),this.visualElement.render(),S&&S(h,m)},u=(h,m)=>this.stop(h,m),d=()=>rr(h=>{var m;return this.getAnimationState(h)==="paused"&&((m=this.getAxisMotionValue(h).animation)===null||m===void 0?void 0:m.play())}),{dragSnapToOrigin:p}=this.getProps();this.panSession=new _O(t,{onSessionStart:i,onStart:a,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,contextWindow:FO(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&ut.postRender(()=>a(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!zu(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=_L(l,this.constraints[t],this.elastic[t])),a.set(l)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&Ua(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=ML(i.layoutBox,n):this.constraints=!1,this.elastic=LL(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&rr(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=RL(i.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ua(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=BL(r,i.root,this.visualElement.getTransformPagePoint());let l=IL(i.layout.layoutBox,a);if(n){const u=n($L(l));this.hasMutatedConstraints=!!u,u&&(l=RO(u))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:l,onDragTransitionEnd:u}=this.getProps(),d=this.constraints||{},p=rr(h=>{if(!zu(h,n,this.currentDirection))return;let m=d&&d[h]||{};l&&(m={min:0,max:0});const v=i?200:1e6,x=i?40:1e7,w={type:"inertia",velocity:r?t[h]:0,bounceStiffness:v,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...a,...m};return this.startAxisValueAnimation(h,w)});return Promise.all(p).then(u)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ug(this.visualElement,t),r.start(ax(t,r,0,n,this.visualElement,!1))}stopAnimation(){rr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){rr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){rr(n=>{const{drag:r}=this.getProps();if(!zu(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:l,max:u}=i.layout.layoutBox[n];a.set(t[n]-gt(l,u,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ua(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};rr(l=>{const u=this.getAxisMotionValue(l);if(u&&this.constraints!==!1){const d=u.get();i[l]=DL({min:d,max:d},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),rr(l=>{if(!zu(l,t,null))return;const u=this.getAxisMotionValue(l),{min:d,max:p}=this.constraints[l];u.set(gt(d,p,i[l]))})}addListeners(){if(!this.visualElement.current)return;VL.set(this.visualElement,this);const t=this.visualElement.current,n=Ml(t,"pointerdown",d=>{const{drag:p,dragListener:h=!0}=this.getProps();p&&h&&this.start(d)}),r=()=>{const{dragConstraints:d}=this.getProps();Ua(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ut.read(r);const l=Wl(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:p})=>{this.isDragging&&p&&(rr(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=d[h].translate,m.set(m.get()+d[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),a(),u&&u()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:l=xg,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:l,dragMomentum:u}}}function zu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function WL(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class qL extends gs{constructor(t){super(t),this.removeGroupControls=Vn,this.removeListeners=Vn,this.controls=new UL(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Vn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Pj=e=>(t,n)=>{e&&ut.postRender(()=>e(t,n))};class KL extends gs{constructor(){super(...arguments),this.removePointerDownListener=Vn}onPointerDown(t){this.session=new _O(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:FO(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Pj(t),onStart:Pj(n),onMove:r,onEnd:(a,l)=>{delete this.session,i&&ut.postRender(()=>i(a,l))}}}mount(){this.removePointerDownListener=Ml(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const cd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Cj(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const pl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ee.test(e))e=parseFloat(e);else return e;const n=Cj(e,t.target.x),r=Cj(e,t.target.y);return`${n}% ${r}%`}},HL={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=ps.parse(e);if(i.length>5)return r;const a=ps.createTransformer(e),l=typeof i[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;i[0+l]/=u,i[1+l]/=d;const p=gt(u,d,.5);return typeof i[2+l]=="number"&&(i[2+l]/=p),typeof i[3+l]=="number"&&(i[3+l]/=p),a(i)}};class GL extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;h4(YL),a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),cd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,l=r.projection;return l&&(l.isPresent=a,i||t.layoutDependency!==n||n===void 0?l.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?l.promote():l.relegate()||ut.postRender(()=>{const u=l.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Dv.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function BO(e){const[t,n]=j2(),r=b.useContext(Cv);return c.jsx(GL,{...e,layoutGroup:r,switchLayoutGroup:b.useContext(T2),isPresent:t,safeToRemove:n})}const YL={borderRadius:{...pl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:pl,borderTopRightRadius:pl,borderBottomLeftRadius:pl,borderBottomRightRadius:pl,boxShadow:HL};function XL(e,t,n){const r=cn(e)?e:Vl(e);return r.start(ax("",r,t,n)),r.animation}function QL(e){return e instanceof SVGElement&&e.tagName!=="svg"}const JL=(e,t)=>e.depth-t.depth;class ZL{constructor(){this.children=[],this.isDirty=!1}add(t){Yv(this.children,t),this.isDirty=!0}remove(t){Xv(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(JL),this.isDirty=!1,this.children.forEach(t)}}function e$(e,t){const n=Wr.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(fs(r),e(a-t))};return ut.read(r,!0),()=>fs(r)}const VO=["TopLeft","TopRight","BottomLeft","BottomRight"],t$=VO.length,Oj=e=>typeof e=="string"?parseFloat(e):e,Aj=e=>typeof e=="number"||Ee.test(e);function n$(e,t,n,r,i,a){i?(e.opacity=gt(0,n.opacity!==void 0?n.opacity:1,r$(r)),e.opacityExit=gt(t.opacity!==void 0?t.opacity:1,0,i$(r))):a&&(e.opacity=gt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let l=0;l<t$;l++){const u=`border${VO[l]}Radius`;let d=Ej(t,u),p=Ej(n,u);if(d===void 0&&p===void 0)continue;d||(d=0),p||(p=0),d===0||p===0||Aj(d)===Aj(p)?(e[u]=Math.max(gt(Oj(d),Oj(p),r),0),(Ur.test(p)||Ur.test(d))&&(e[u]+="%")):e[u]=p}(t.rotate||n.rotate)&&(e.rotate=gt(t.rotate||0,n.rotate||0,r))}function Ej(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const r$=UO(0,.5,oO),i$=UO(.5,.95,Vn);function UO(e,t,n){return r=>r<e?0:r>t?1:n(no(e,t,r))}function Tj(e,t){e.min=t.min,e.max=t.max}function Zn(e,t){Tj(e.x,t.x),Tj(e.y,t.y)}function _j(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Mj(e,t,n,r,i){return e-=t,e=Cd(e,1/n,r),i!==void 0&&(e=Cd(e,1/i,r)),e}function s$(e,t=0,n=1,r=.5,i,a=e,l=e){if(Ur.test(t)&&(t=parseFloat(t),t=gt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let u=gt(a.min,a.max,r);e===a&&(u-=t),e.min=Mj(e.min,t,n,u,i),e.max=Mj(e.max,t,n,u,i)}function Ij(e,t,[n,r,i],a,l){s$(e,t[n],t[r],t[i],t.scale,a,l)}const a$=["x","scaleX","originX"],o$=["y","scaleY","originY"];function Dj(e,t,n,r){Ij(e.x,t,a$,n?n.x:void 0,r?r.x:void 0),Ij(e.y,t,o$,n?n.y:void 0,r?r.y:void 0)}function Rj(e){return e.translate===0&&e.scale===1}function WO(e){return Rj(e.x)&&Rj(e.y)}function Lj(e,t){return e.min===t.min&&e.max===t.max}function l$(e,t){return Lj(e.x,t.x)&&Lj(e.y,t.y)}function $j(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function qO(e,t){return $j(e.x,t.x)&&$j(e.y,t.y)}function zj(e){return Wn(e.x)/Wn(e.y)}function Fj(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class c${constructor(){this.members=[]}add(t){Yv(this.members,t),t.scheduleRender()}remove(t){if(Xv(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(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){r=a;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(),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:i}=t.options;i===!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)}}function u$(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,l=(n==null?void 0:n.z)||0;if((i||a||l)&&(r=`translate3d(${i}px, ${a}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:p,rotate:h,rotateX:m,rotateY:v,skewX:x,skewY:w}=n;p&&(r=`perspective(${p}px) ${r}`),h&&(r+=`rotate(${h}deg) `),m&&(r+=`rotateX(${m}deg) `),v&&(r+=`rotateY(${v}deg) `),x&&(r+=`skewX(${x}deg) `),w&&(r+=`skewY(${w}deg) `)}const u=e.x.scale*t.x,d=e.y.scale*t.y;return(u!==1||d!==1)&&(r+=`scale(${u}, ${d})`),r||"none"}const Fs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ol=typeof window<"u"&&window.MotionDebug!==void 0,pm=["","X","Y","Z"],d$={visibility:"hidden"},Bj=1e3;let f$=0;function hm(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function KO(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=eO(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ut,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&KO(r)}function HO({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(l={},u=t==null?void 0:t()){this.id=f$++,this.animationId=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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ol&&(Fs.totalNodes=Fs.resolvedTargetDeltas=Fs.recalculatedProjection=0),this.nodes.forEach(m$),this.nodes.forEach(b$),this.nodes.forEach(w$),this.nodes.forEach(g$),Ol&&window.MotionDebug.record(Fs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new ZL)}addEventListener(l,u){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Qv),this.eventHandlers.get(l).add(u)}notifyListeners(l,...u){const d=this.eventHandlers.get(l);d&&d.notify(...u)}hasListeners(l){return this.eventHandlers.has(l)}mount(l,u=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=QL(l),this.instance=l;const{layoutId:d,layout:p,visualElement:h}=this.options;if(h&&!h.current&&h.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),u&&(p||d)&&(this.isLayoutDirty=!0),e){let m;const v=()=>this.root.updateBlockedByResize=!1;e(l,()=>{this.root.updateBlockedByResize=!0,m&&m(),m=e$(v,250),cd.hasAnimatedSinceResize&&(cd.hasAnimatedSinceResize=!1,this.nodes.forEach(Uj))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&h&&(d||p)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:v,hasRelativeTargetChanged:x,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||h.getDefaultTransition()||P$,{onLayoutAnimationStart:j,onLayoutAnimationComplete:k}=h.getProps(),C=!this.targetLayout||!qO(this.targetLayout,w)||x,E=!v&&x;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||E||v&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,E);const O={...qv(S,"layout"),onPlay:j,onComplete:k};(h.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else v||Uj(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,fs(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(j$),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&KO(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const m=this.path[h];m.shouldResetTransform=!0,m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:u,layout:d}=this.options;if(u===void 0&&!d)return;const p=this.getTransformTemplate();this.prevTransformTemplateValue=p?p(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Vj);return}this.isUpdating||this.nodes.forEach(x$),this.isUpdating=!1,this.nodes.forEach(y$),this.nodes.forEach(p$),this.nodes.forEach(h$),this.clearAllSnapshots();const u=Wr.now();Qt.delta=xi(0,1e3/60,u-Qt.timestamp),Qt.timestamp=u,Qt.isProcessing=!0,im.update.process(Qt),im.preRender.process(Qt),im.render.process(Qt),Qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Dv.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(v$),this.sharedNodes.forEach(S$)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ut.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ut.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutCorrected=St(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(u=!1),u){const d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!i)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!WO(this.projectionDelta),d=this.getTransformTemplate(),p=d?d(this.latestValues,""):void 0,h=p!==this.prevTransformTemplateValue;l&&(u||zs(this.latestValues)||h)&&(i(this.instance,p),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const u=this.measurePageBox();let d=this.removeElementScroll(u);return l&&(d=this.removeTransform(d)),C$(d),{animationId:this.root.animationId,measuredBox:u,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:u}=this.options;if(!u)return St();const d=u.measureViewportBox();if(!(((l=this.scroll)===null||l===void 0?void 0:l.wasRoot)||this.path.some(O$))){const{scroll:h}=this.root;h&&(Ka(d.x,h.offset.x),Ka(d.y,h.offset.y))}return d}removeElementScroll(l){var u;const d=St();if(Zn(d,l),!((u=this.scroll)===null||u===void 0)&&u.wasRoot)return d;for(let p=0;p<this.path.length;p++){const h=this.path[p],{scroll:m,options:v}=h;h!==this.root&&m&&v.layoutScroll&&(m.wasRoot&&Zn(d,l),Ka(d.x,m.offset.x),Ka(d.y,m.offset.y))}return d}applyTransform(l,u=!1){const d=St();Zn(d,l);for(let p=0;p<this.path.length;p++){const h=this.path[p];!u&&h.options.layoutScroll&&h.scroll&&h!==h.root&&Ha(d,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),zs(h.latestValues)&&Ha(d,h.latestValues)}return zs(this.latestValues)&&Ha(d,this.latestValues),d}removeTransform(l){const u=St();Zn(u,l);for(let d=0;d<this.path.length;d++){const p=this.path[d];if(!p.instance||!zs(p.latestValues))continue;yg(p.latestValues)&&p.updateSnapshot();const h=St(),m=p.measurePageBox();Zn(h,m),Dj(u,p.latestValues,p.snapshot?p.snapshot.layoutBox:void 0,h)}return zs(this.latestValues)&&Dj(u,this.latestValues),u}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.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!==Qt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var u;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const p=!!this.resumingFrom||this!==d;if(!(l||p&&this.isSharedProjectionDirty||this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:v}=this.options;if(!(!this.layout||!(m||v))){if(this.resolvedRelativeTargetAt=Qt.timestamp,!this.targetDelta&&!this.relativeTarget){const x=this.getClosestProjectingParent();x&&x.layout&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=St(),this.relativeTargetOrigin=St(),Dl(this.relativeTargetOrigin,this.layout.layoutBox,x.layout.layoutBox),Zn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=St(),this.targetWithTransforms=St()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),TL(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Zn(this.target,this.layout.layoutBox),$O(this.target,this.targetDelta)):Zn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const x=this.getClosestProjectingParent();x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=St(),this.relativeTargetOrigin=St(),Dl(this.relativeTargetOrigin,this.target,x.target),Zn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ol&&Fs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||yg(this.parent.latestValues)||LO(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var l;const u=this.getLead(),d=!!this.resumingFrom||this!==u;let p=!0;if((this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty)&&(p=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(p=!1),this.resolvedRelativeTargetAt===Qt.timestamp&&(p=!1),p)return;const{layout:h,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||!(h||m))return;Zn(this.layoutCorrected,this.layout.layoutBox);const v=this.treeScale.x,x=this.treeScale.y;FL(this.layoutCorrected,this.treeScale,this.path,d),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=St());const{target:w}=u;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_j(this.prevProjectionDelta.x,this.projectionDelta.x),_j(this.prevProjectionDelta.y,this.projectionDelta.y)),Il(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==v||this.treeScale.y!==x||!Fj(this.projectionDelta.x,this.prevProjectionDelta.x)||!Fj(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w)),Ol&&Fs.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var u;if((u=this.options.visualElement)===null||u===void 0||u.scheduleRender(),l){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qa(),this.projectionDelta=qa(),this.projectionDeltaWithTransform=qa()}setAnimationOrigin(l,u=!1){const d=this.snapshot,p=d?d.latestValues:{},h={...this.latestValues},m=qa();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const v=St(),x=d?d.source:void 0,w=this.layout?this.layout.source:void 0,S=x!==w,j=this.getStack(),k=!j||j.members.length<=1,C=!!(S&&!k&&this.options.crossfade===!0&&!this.path.some(k$));this.animationProgress=0;let E;this.mixTargetDelta=O=>{const P=O/1e3;Wj(m.x,l.x,P),Wj(m.y,l.y,P),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Dl(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),N$(this.relativeTarget,this.relativeTargetOrigin,v,P),E&&l$(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=St()),Zn(E,this.relativeTarget)),S&&(this.animationValues=h,n$(h,p,this.latestValues,P,C,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(fs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ut.update(()=>{cd.hasAnimatedSinceResize=!0,this.currentAnimation=XL(0,Bj,{...l,onUpdate:u=>{this.mixTargetDelta(u),l.onUpdate&&l.onUpdate(u)},onComplete:()=>{l.onComplete&&l.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 l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Bj),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:u,target:d,layout:p,latestValues:h}=l;if(!(!u||!d||!p)){if(this!==l&&this.layout&&p&&GO(this.options.animationType,this.layout.layoutBox,p.layoutBox)){d=this.target||St();const m=Wn(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+m;const v=Wn(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+v}Zn(u,d),Ha(u,h),Il(this.projectionDeltaWithTransform,this.layoutCorrected,u,h)}}registerSharedNode(l,u){this.sharedNodes.has(l)||this.sharedNodes.set(l,new c$),this.sharedNodes.get(l).add(u);const p=u.options.initialPromotionConfig;u.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(u):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var l;const{layoutId:u}=this.options;return u?((l=this.getStack())===null||l===void 0?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:u}=this.options;return u?(l=this.getStack())===null||l===void 0?void 0:l.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:u,preserveFollowOpacity:d}={}){const p=this.getStack();p&&p.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let u=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(u=!0),!u)return;const p={};d.z&&hm("z",l,p,this.animationValues);for(let h=0;h<pm.length;h++)hm(`rotate${pm[h]}`,l,p,this.animationValues),hm(`skew${pm[h]}`,l,p,this.animationValues);l.render();for(const h in p)l.setStaticValue(h,p[h]),this.animationValues&&(this.animationValues[h]=p[h]);l.scheduleRender()}getProjectionStyles(l){var u,d;if(!this.instance||this.isSVG)return;if(!this.isVisible)return d$;const p={visibility:""},h=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,p.opacity="",p.pointerEvents=od(l==null?void 0:l.pointerEvents)||"",p.transform=h?h(this.latestValues,""):"none",p;const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){const S={};return this.options.layoutId&&(S.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,S.pointerEvents=od(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!zs(this.latestValues)&&(S.transform=h?h({},""):"none",this.hasProjected=!1),S}const v=m.animationValues||m.latestValues;this.applyTransformsToTarget(),p.transform=u$(this.projectionDeltaWithTransform,this.treeScale,v),h&&(p.transform=h(v,p.transform));const{x,y:w}=this.projectionDelta;p.transformOrigin=`${x.origin*100}% ${w.origin*100}% 0`,m.animationValues?p.opacity=m===this?(d=(u=v.opacity)!==null&&u!==void 0?u:this.latestValues.opacity)!==null&&d!==void 0?d:1:this.preserveOpacity?this.latestValues.opacity:v.opacityExit:p.opacity=m===this?v.opacity!==void 0?v.opacity:"":v.opacityExit!==void 0?v.opacityExit:0;for(const S in jd){if(v[S]===void 0)continue;const{correct:j,applyTo:k}=jd[S],C=p.transform==="none"?v[S]:j(v[S],m);if(k){const E=k.length;for(let O=0;O<E;O++)p[k[O]]=C}else p[S]=C}return this.options.layoutId&&(p.pointerEvents=m===this?od(l==null?void 0:l.pointerEvents)||"":"none"),p}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var u;return(u=l.currentAnimation)===null||u===void 0?void 0:u.stop()}),this.root.nodes.forEach(Vj),this.root.sharedNodes.clear()}}}function p$(e){e.updateLayout()}function h$(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:a}=e.options,l=n.source!==e.layout.source;a==="size"?rr(m=>{const v=l?n.measuredBox[m]:n.layoutBox[m],x=Wn(v);v.min=r[m].min,v.max=v.min+x}):GO(a,n.layoutBox,r)&&rr(m=>{const v=l?n.measuredBox[m]:n.layoutBox[m],x=Wn(r[m]);v.max=v.min+x,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+x)});const u=qa();Il(u,r,n.layoutBox);const d=qa();l?Il(d,e.applyTransform(i,!0),n.measuredBox):Il(d,r,n.layoutBox);const p=!WO(u);let h=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:v,layout:x}=m;if(v&&x){const w=St();Dl(w,n.layoutBox,v.layoutBox);const S=St();Dl(S,r,x.layoutBox),qO(w,S)||(h=!0),m.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=w,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:d,layoutDelta:u,hasLayoutChanged:p,hasRelativeTargetChanged:h})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function m$(e){Ol&&Fs.totalNodes++,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 g$(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function v$(e){e.clearSnapshot()}function Vj(e){e.clearMeasurements()}function x$(e){e.isLayoutDirty=!1}function y$(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Uj(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function b$(e){e.resolveTargetDelta()}function w$(e){e.calcProjection()}function j$(e){e.resetSkewAndRotation()}function S$(e){e.removeLeadSnapshot()}function Wj(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 qj(e,t,n,r){e.min=gt(t.min,n.min,r),e.max=gt(t.max,n.max,r)}function N$(e,t,n,r){qj(e.x,t.x,n.x,r),qj(e.y,t.y,n.y,r)}function k$(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const P$={duration:.45,ease:[.4,0,.1,1]},Kj=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Hj=Kj("applewebkit/")&&!Kj("chrome/")?Math.round:Vn;function Gj(e){e.min=Hj(e.min),e.max=Hj(e.max)}function C$(e){Gj(e.x),Gj(e.y)}function GO(e,t,n){return e==="position"||e==="preserve-aspect"&&!EL(zj(t),zj(n),.2)}function O$(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const A$=HO({attachResizeListener:(e,t)=>Wl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),mm={current:void 0},YO=HO({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!mm.current){const e=new A$({});e.mount(window),e.setOptions({layoutScroll:!0}),mm.current=e}return mm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),E$={pan:{Feature:KL},drag:{Feature:qL,ProjectionNode:YO,MeasureLayout:BO}};function Yj(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,a=r[i];a&&ut.postRender(()=>a(t,fc(t)))}class T$ extends gs{mount(){const{current:t}=this.node;t&&(this.unmount=E4(t,n=>(Yj(this.node,n,"Start"),r=>Yj(this.node,r,"End"))))}unmount(){}}class _$ extends gs{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=dc(Wl(this.node.current,"focus",()=>this.onFocus()),Wl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Xj(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),a=r[i];a&&ut.postRender(()=>a(t,fc(t)))}class M$ extends gs{mount(){const{current:t}=this.node;t&&(this.unmount=I4(t,n=>(Xj(this.node,n,"Start"),(r,{success:i})=>Xj(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const wg=new WeakMap,gm=new WeakMap,I$=e=>{const t=wg.get(e.target);t&&t(e)},D$=e=>{e.forEach(I$)};function R$({root:e,...t}){const n=e||document;gm.has(n)||gm.set(n,{});const r=gm.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(D$,{root:e,...t})),r[i]}function L$(e,t,n){const r=R$(t);return wg.set(e,n),r.observe(e),()=>{wg.delete(e),r.unobserve(e)}}const $$={some:0,all:1};class z$ extends gs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:a}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:$$[i]},u=d=>{const{isIntersecting:p}=d;if(this.isInView===p||(this.isInView=p,a&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),v=p?h:m;v&&v(d)};return L$(this.node.current,l,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(F$(t,n))&&this.startObserver()}unmount(){}}function F$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const B$={inView:{Feature:z$},tap:{Feature:M$},focus:{Feature:_$},hover:{Feature:T$}},V$={layout:{ProjectionNode:YO,MeasureLayout:BO}},jg={current:null},XO={current:!1};function U$(){if(XO.current=!0,!!Ev)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>jg.current=e.matches;e.addListener(t),t()}else jg.current=!1}const W$=[...wO,on,ps],q$=e=>W$.find(bO(e)),Qj=new WeakMap;function K$(e,t,n){for(const r in t){const i=t[r],a=n[r];if(cn(i))e.addValue(r,i);else if(cn(a))e.addValue(r,Vl(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(i):l.hasAnimated||l.set(i)}else{const l=e.getStaticValue(r);e.addValue(r,Vl(l!==void 0?l:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Jj=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class H${scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=rx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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 x=Wr.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,ut.render(this.render,!1,!0))};const{latestValues:d,renderState:p,onUpdate:h}=l;this.onUpdate=h,this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=p,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=u,this.blockInitialAnimation=!!a,this.isControllingVariants=Cf(n),this.isVariantNode=A2(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:m,...v}=this.scrapeMotionValuesFromProps(n,{},this);for(const x in v){const w=v[x];d[x]!==void 0&&cn(w)&&w.set(d[x],!1)}}mount(t){this.current=t,Qj.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)),XO.current||U$(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:jg.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Qj.delete(this.current),this.projection&&this.projection.unmount(),fs(this.notifyUpdate),fs(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(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}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=aa.has(t),i=n.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&&ut.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let l;window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),l&&l(),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 ro){const n=ro[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):St()}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<Jj.length;r++){const i=Jj[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,l=t[a];l&&(this.propEventSubscriptions[i]=this.on(i,l))}this.prevMotionValues=K$(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}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=Vl(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(xO(i)||cO(i))?i=parseFloat(i):!q$(i)&&ps.test(n)&&(i=mO(t,n)),this.setBaseTarget(t,cn(i)?i.get():i)),cn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const l=Lv(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);l&&(i=l[t])}if(r&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!cn(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qv),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class QO extends H${constructor(){super(...arguments),this.KeyframeResolver=jO}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[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;cn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function G$(e){return window.getComputedStyle(e)}class Y$ extends QO{constructor(){super(...arguments),this.type="html",this.renderInstance=$2}readValueFromInstance(t,n){if(aa.has(n)){const r=nx(n);return r&&r.default||0}else{const r=G$(t),i=(D2(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return zO(t,n)}build(t,n,r){Fv(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Wv(t,n,r)}}class X$ extends QO{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=St}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(aa.has(n)){const r=nx(n);return r&&r.default||0}return n=z2.has(n)?n:Iv(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return V2(t,n,r)}build(t,n,r){Bv(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){F2(t,n,r,i)}mount(t){this.isSVGTag=Uv(t.tagName),super.mount(t)}}const Q$=(e,t)=>Rv(e)?new X$(t):new Y$(t,{allowProjection:e!==b.Fragment}),J$=S4({...wL,...B$,...E$,...V$},Q$),qr=$D(J$),ox={Backlog:["planned","pending"],Ready:["ready"],"In Progress":["implementing","feedback"],Review:["implemented","testing"],Done:["completed"]},Z$={planned:{color:"gray",icon:"📋",label:"Planned"},pending:{color:"slate",icon:"⏸️",label:"Pending"},ready:{color:"blue",icon:"🚀",label:"Ready"},implementing:{color:"yellow",icon:"⚙️",label:"Implementing"},feedback:{color:"amber",icon:"💬",label:"Feedback"},implemented:{color:"purple",icon:"✅",label:"Implemented"},testing:{color:"violet",icon:"🧪",label:"Testing"},completed:{color:"green",icon:"🎉",label:"Completed"},blocked:{color:"red",icon:"🚫",label:"Blocked"}},Od=["Backlog","Ready","In Progress","Review","Done"],e6={Backlog:{color:"slate",bgColor:"bg-slate-100",borderColor:"border-slate-300"},Ready:{color:"blue",bgColor:"bg-blue-100",borderColor:"border-blue-300"},"In Progress":{color:"yellow",bgColor:"bg-yellow-100",borderColor:"border-yellow-300"},Review:{color:"purple",bgColor:"bg-purple-100",borderColor:"border-purple-300"},Done:{color:"green",bgColor:"bg-green-100",borderColor:"border-green-300"}};function t6(e){for(const[t,n]of Object.entries(ox))if(n.includes(e))return t;return null}function so(e){return Z$[e]||null}function n6(e){return e6[e]||null}function ao(e){const t={};Od.forEach(n=>{t[n]=[]}),e.forEach(n=>{const r=t6(n.status);r&&t[r]&&t[r].push(n)});for(const n of Od)t[n].sort((r,i)=>{var u,d;const a=((u=r.metadata)==null?void 0:u.codingOrder)??1/0,l=((d=i.metadata)==null?void 0:d.codingOrder)??1/0;return a!==l?a-l:(r.id||"").localeCompare(i.id||"")});return t}function JO(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=JO(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function st(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=JO(e))&&(r&&(r+=" "),r+=t);return r}const lx="-",r6=e=>{const t=s6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const u=l.split(lx);return u[0]===""&&u.length!==1&&u.shift(),ZO(u,t)||i6(l)},getConflictingClassGroupIds:(l,u)=>{const d=n[l]||[];return u&&r[l]?[...d,...r[l]]:d}}},ZO=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?ZO(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(lx);return(l=t.validators.find(({validator:u})=>u(a)))==null?void 0:l.classGroupId},Zj=/^\[(.+)\]$/,i6=e=>{if(Zj.test(e)){const t=Zj.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},s6=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return o6(Object.entries(e.classGroups),n).forEach(([a,l])=>{Sg(l,r,a,t)}),r},Sg=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:eS(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(a6(i)){Sg(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,l])=>{Sg(l,eS(t,a),n,r)})})},eS=(e,t)=>{let n=e;return t.split(lx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},a6=e=>e.isThemeGetter,o6=(e,t)=>t?e.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([l,u])=>[t+l,u])):a);return[n,i]}):e,l6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,l)=>{n.set(a,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let l=n.get(a);if(l!==void 0)return l;if((l=r.get(a))!==void 0)return i(a,l),l},set(a,l){n.has(a)?n.set(a,l):i(a,l)}}},eA="!",c6=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,l=u=>{const d=[];let p=0,h=0,m;for(let j=0;j<u.length;j++){let k=u[j];if(p===0){if(k===i&&(r||u.slice(j,j+a)===t)){d.push(u.slice(h,j)),h=j+a;continue}if(k==="/"){m=j;continue}}k==="["?p++:k==="]"&&p--}const v=d.length===0?u:u.substring(h),x=v.startsWith(eA),w=x?v.substring(1):v,S=m&&m>h?m-h:void 0;return{modifiers:d,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:S}};return n?u=>n({className:u,parseClassName:l}):l},u6=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},d6=e=>({cache:l6(e.cacheSize),parseClassName:c6(e),...r6(e)}),f6=/\s+/,p6=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],l=e.trim().split(f6);let u="";for(let d=l.length-1;d>=0;d-=1){const p=l[d],{modifiers:h,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:x}=n(p);let w=!!x,S=r(w?v.substring(0,x):v);if(!S){if(!w){u=p+(u.length>0?" "+u:u);continue}if(S=r(v),!S){u=p+(u.length>0?" "+u:u);continue}w=!1}const j=u6(h).join(":"),k=m?j+eA:j,C=k+S;if(a.includes(C))continue;a.push(C);const E=i(S,w);for(let O=0;O<E.length;++O){const P=E[O];a.push(k+P)}u=p+(u.length>0?" "+u:u)}return u};function h6(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=tA(t))&&(r&&(r+=" "),r+=n);return r}const tA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=tA(e[r]))&&(n&&(n+=" "),n+=t);return n};function m6(e,...t){let n,r,i,a=l;function l(d){const p=t.reduce((h,m)=>m(h),e());return n=d6(p),r=n.cache.get,i=n.cache.set,a=u,u(d)}function u(d){const p=r(d);if(p)return p;const h=p6(d,n);return i(d,h),h}return function(){return a(h6.apply(null,arguments))}}const lt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},nA=/^\[(?:([a-z-]+):)?(.+)\]$/i,g6=/^\d+\/\d+$/,v6=new Set(["px","full","screen"]),x6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,y6=/\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$/,b6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,j6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ci=e=>Ja(e)||v6.has(e)||g6.test(e),ns=e=>wo(e,"length",E6),Ja=e=>!!e&&!Number.isNaN(Number(e)),vm=e=>wo(e,"number",Ja),hl=e=>!!e&&Number.isInteger(Number(e)),S6=e=>e.endsWith("%")&&Ja(e.slice(0,-1)),Le=e=>nA.test(e),rs=e=>x6.test(e),N6=new Set(["length","size","percentage"]),k6=e=>wo(e,N6,rA),P6=e=>wo(e,"position",rA),C6=new Set(["image","url"]),O6=e=>wo(e,C6,_6),A6=e=>wo(e,"",T6),ml=()=>!0,wo=(e,t,n)=>{const r=nA.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},E6=e=>y6.test(e)&&!b6.test(e),rA=()=>!1,T6=e=>w6.test(e),_6=e=>j6.test(e),M6=()=>{const e=lt("colors"),t=lt("spacing"),n=lt("blur"),r=lt("brightness"),i=lt("borderColor"),a=lt("borderRadius"),l=lt("borderSpacing"),u=lt("borderWidth"),d=lt("contrast"),p=lt("grayscale"),h=lt("hueRotate"),m=lt("invert"),v=lt("gap"),x=lt("gradientColorStops"),w=lt("gradientColorStopPositions"),S=lt("inset"),j=lt("margin"),k=lt("opacity"),C=lt("padding"),E=lt("saturate"),O=lt("scale"),P=lt("sepia"),A=lt("skew"),_=lt("space"),D=lt("translate"),$=()=>["auto","contain","none"],q=()=>["auto","hidden","clip","visible","scroll"],X=()=>["auto",Le,t],L=()=>[Le,t],Z=()=>["",ci,ns],J=()=>["auto",Ja,Le],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",Le],W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[Ja,Le];return{cacheSize:500,separator:":",theme:{colors:[ml],spacing:[ci,ns],blur:["none","",rs,Le],brightness:M(),borderColor:[e],borderRadius:["none","","full",rs,Le],borderSpacing:L(),borderWidth:Z(),contrast:M(),grayscale:G(),hueRotate:M(),invert:G(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[S6,ns],inset:X(),margin:X(),opacity:M(),padding:L(),saturate:M(),scale:M(),sepia:G(),skew:M(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",Le]}],container:["container"],columns:[{columns:[rs]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"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"],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:[...ne(),Le]}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",hl,Le]}],basis:[{basis:X()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Le]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",hl,Le]}],"grid-cols":[{"grid-cols":[ml]}],"col-start-end":[{col:["auto",{span:["full",hl,Le]},Le]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[ml]}],"row-start-end":[{row:["auto",{span:[hl,Le]},Le]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Le]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Le,t]}],"min-w":[{"min-w":[Le,t,"min","max","fit"]}],"max-w":[{"max-w":[Le,t,"none","full","min","max","fit","prose",{screen:[rs]},rs]}],h:[{h:[Le,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Le,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Le,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Le,t,"auto","min","max","fit"]}],"font-size":[{text:["base",rs,ns]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",vm]}],"font-family":[{font:[ml]}],"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:["tighter","tight","normal","wide","wider","widest",Le]}],"line-clamp":[{"line-clamp":["none",Ja,vm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ci,Le]}],"list-image":[{"list-image":["none",Le]}],"list-style-type":[{list:["none","disc","decimal",Le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ci,ns]}],"underline-offset":[{"underline-offset":["auto",ci,Le]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ne(),P6]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",k6]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},O6]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:re()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[ci,Le]}],"outline-w":[{outline:[ci,ns]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[ci,ns]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",rs,A6]}],"shadow-color":[{shadow:[ml]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",rs,Le]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[m]}],saturate:[{saturate:[E]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Le]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",Le]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",Le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[hl,Le]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Le]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",Le]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",Le]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ci,ns,vm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},I6=m6(M6);function We(...e){return I6(st(e))}const tS={epic:{color:"indigo",icon:"🏛️",label:"Epic"},story:{color:"blue",icon:"📖",label:"Story"},task:{color:"emerald",icon:"⚙️",label:"Task"},subtask:{color:"gray",icon:"📝",label:"Subtask"}};function D6({workItem:e,onClick:t}){var a;const n=so(e.status),r=tS[e.type]||tS.task,i=e.status==="blocked";return c.jsxs(qr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.2,ease:"easeOut"},whileHover:{scale:1.02,y:-2},whileTap:{scale:.98},onClick:t,className:We("group cursor-pointer bg-white rounded-lg border shadow-sm","hover:shadow-lg transition-all duration-200",i?"border-red-300":"border-slate-200"),children:[c.jsx("div",{className:"p-3 pb-2 border-b border-slate-100",children:c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:We("px-2 py-1 rounded-full text-xs font-medium",(n==null?void 0:n.color)==="gray"&&"bg-gray-100 text-gray-700",(n==null?void 0:n.color)==="slate"&&"bg-slate-100 text-slate-700",(n==null?void 0:n.color)==="blue"&&"bg-blue-100 text-blue-700",(n==null?void 0:n.color)==="yellow"&&"bg-yellow-100 text-yellow-700",(n==null?void 0:n.color)==="amber"&&"bg-amber-100 text-amber-700",(n==null?void 0:n.color)==="purple"&&"bg-purple-100 text-purple-700",(n==null?void 0:n.color)==="violet"&&"bg-violet-100 text-violet-700",(n==null?void 0:n.color)==="green"&&"bg-green-100 text-green-700",(n==null?void 0:n.color)==="red"&&"bg-red-100 text-red-700"),children:[n==null?void 0:n.icon," ",n==null?void 0:n.label]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[((a=e.metadata)==null?void 0:a.codingPhase)&&c.jsxs("div",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold bg-amber-100 text-amber-800 border border-amber-300",title:`Implementation Phase ${e.metadata.codingPhase}`,children:["P",e.metadata.codingPhase]}),c.jsx("div",{className:We("px-2 py-1 rounded border text-xs font-medium",r.color==="indigo"&&"border-indigo-300 bg-indigo-50 text-indigo-700",r.color==="blue"&&"border-blue-300 bg-blue-50 text-blue-700",r.color==="emerald"&&"border-emerald-300 bg-emerald-50 text-emerald-700",r.color==="gray"&&"border-gray-300 bg-gray-50 text-gray-700"),children:r.label})]})]})}),c.jsxs("div",{className:"p-3 pb-2",children:[i&&c.jsxs("div",{className:"flex items-center gap-2 mb-2 text-red-600 text-sm",children:[c.jsx(l3,{className:"w-4 h-4"}),c.jsx("span",{className:"font-medium",children:"Blocked"})]}),c.jsx("h4",{className:"font-semibold text-base text-slate-900 mb-2 line-clamp-2 group-hover:text-blue-600 transition-colors",children:e.name}),c.jsxs("div",{className:"space-y-1 text-sm text-slate-600",children:[e.epicName&&e.type!=="epic"&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(yd,{className:"w-4 h-4 flex-shrink-0"}),c.jsxs("span",{className:"truncate",children:["Epic: ",e.epicName]})]}),e.children&&e.children.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(b3,{className:"w-4 h-4 flex-shrink-0"}),c.jsxs("span",{children:[e.children.length," ",e.children.length===1?"child":"children"," •"," ",e.children.filter(l=>l.status==="completed").length," ","completed"]})]}),e.dependencies&&e.dependencies.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(m2,{className:"w-4 h-4 flex-shrink-0"}),c.jsxs("span",{children:[e.dependencies.length," ",e.dependencies.length===1?"dependency":"dependencies"]})]})]})]}),c.jsx("div",{className:"px-3 py-2 border-t border-slate-100",children:c.jsx("span",{className:"text-xs text-slate-400",children:e.id})})]})}function iA({columnName:e,statuses:t,workItems:n,onCardClick:r}){const i=n6(e),a=t.reduce((u,d)=>(u[d]=n.filter(p=>p.status===d).length,u),{}),l=n.length;return c.jsxs("div",{className:We("flex flex-col rounded-lg p-4 min-w-[320px] max-w-[380px]",(i==null?void 0:i.bgColor)||"bg-slate-100"),children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:e}),c.jsxs("span",{className:We("text-sm px-3 py-1 rounded-full font-medium",(i==null?void 0:i.color)==="slate"&&"bg-slate-200 text-slate-700",(i==null?void 0:i.color)==="blue"&&"bg-blue-200 text-blue-700",(i==null?void 0:i.color)==="yellow"&&"bg-yellow-200 text-yellow-700",(i==null?void 0:i.color)==="purple"&&"bg-purple-200 text-purple-700",(i==null?void 0:i.color)==="green"&&"bg-green-200 text-green-700"),children:[l," ",l===1?"item":"items"]})]}),t.length>1&&l>0&&c.jsx("div",{className:"text-xs text-slate-600 mb-3 flex flex-wrap gap-2",children:t.map(u=>{const d=a[u],p=so(u);return d===0?null:c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{children:p==null?void 0:p.icon}),c.jsxs("span",{children:[p==null?void 0:p.label,": ",d]})]},u)})}),c.jsx("div",{className:"flex flex-col gap-3 overflow-y-auto flex-1 min-h-0",children:n.length===0?c.jsx(qr.div,{initial:{opacity:0},animate:{opacity:1},className:"flex items-center justify-center py-8 text-slate-400 text-sm",children:"No items"}):n.map((u,d)=>c.jsx(qr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.2,delay:d*.05},children:c.jsx(D6,{workItem:u,onClick:()=>r==null?void 0:r(u)})},u.id))})]})}function R6({group:e,columnVisibility:t,onCardClick:n}){const[r,i]=b.useState(!0),{name:a,epic:l,items:u,columns:d}=e,p=e.type==="ungrouped",h=u.length,m=u.filter(S=>S.status==="completed").length,v=h>0?m/h*100:0,x=l==null?void 0:l.status,w=x?so(x):null;return c.jsxs("div",{className:"mb-8",children:[c.jsx("div",{className:We("mb-4 pb-4 border-b-2",p?"border-slate-300":"border-indigo-300"),children:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[c.jsx("button",{onClick:()=>i(!r),className:"text-slate-600 hover:text-slate-900 transition-colors mt-3 flex-shrink-0",children:r?c.jsx(Hr,{className:"w-5 h-5"}):c.jsx(sr,{className:"w-5 h-5"})}),l&&!p?c.jsx("button",{onClick:()=>n==null?void 0:n(l),className:"flex-1 min-w-0 text-left p-3 border border-indigo-200 rounded-lg hover:border-indigo-400 hover:bg-indigo-50 transition-colors",title:"View epic details",children:c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[c.jsxs("span",{className:"text-lg font-bold text-indigo-900",children:["🏛️ ",a]}),w&&c.jsxs("span",{className:We("px-2 py-0.5 rounded-full text-xs font-medium",w.color==="green"&&"bg-green-100 text-green-700",w.color==="blue"&&"bg-blue-100 text-blue-700",w.color==="yellow"&&"bg-yellow-100 text-yellow-700"),children:[w.icon," ",w.label]})]}),(l==null?void 0:l.description)&&c.jsx("p",{className:"text-sm text-slate-500 line-clamp-2",children:l.description})]}),c.jsx(sr,{className:"w-4 h-4 text-indigo-400 mt-1 flex-shrink-0"})]})}):c.jsx("div",{className:"flex-1 py-2",children:c.jsxs("h2",{className:We("text-xl font-bold",p?"text-slate-600":"text-indigo-900"),children:[p?"📂":"🏛️"," ",a]})})]}),c.jsxs("div",{className:"text-right flex-shrink-0",children:[c.jsxs("div",{className:"text-sm text-slate-600 mb-1",children:[m," / ",h," completed"]}),c.jsx("div",{className:"w-48 h-2 bg-slate-200 rounded-full overflow-hidden",children:c.jsx(qr.div,{initial:{width:0},animate:{width:`${v}%`},transition:{duration:.5,ease:"easeOut"},className:We("h-full",p?"bg-slate-500":"bg-indigo-600")})})]})]})}),r&&c.jsx(qr.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},className:"flex gap-4 overflow-x-auto pb-4",children:Od.filter(S=>t[S]).map(S=>{const j=ox[S],k=d[S]||[];return c.jsx(iA,{columnName:S,statuses:j,workItems:k,onCardClick:n},`${e.id}-${S}`)})})]})}function L6(e,t){return b.useMemo(()=>{switch(t){case"status":return nS(e);case"epic":return $6(e);case"type":return z6(e);case"phase":return F6(e);default:return nS(e)}},[e,t])}function nS(e){const t=ao(e);return{mode:"columns",groups:Od.map(n=>({id:n,name:n,items:t[n]||[],type:"column"}))}}function $6(e){const n=e.filter(i=>i.type==="epic").map(i=>{const a=e.filter(u=>u.epicId===i.id),l=ao(a);return{id:i.id,name:i.name,epic:i,items:a,columns:l,type:"epic"}}),r=e.filter(i=>!i.epicId&&i.type!=="epic");if(r.length>0){const i=ao(r);n.push({id:"ungrouped",name:"No Epic",items:r,columns:i,type:"ungrouped"})}return{mode:"sections",groups:n}}function z6(e){return{mode:"sections",groups:[{id:"epic",name:"Epics"},{id:"story",name:"Stories"},{id:"task",name:"Tasks"},{id:"subtask",name:"Subtasks"}].map(r=>{const i=e.filter(l=>l.type===r.id),a=ao(i);return{id:r.id,name:r.name,items:i,columns:a,type:"type"}}).filter(r=>r.items.length>0)}}function F6(e){var a;const t=new Map,n=[];for(const l of e){const u=(a=l.metadata)==null?void 0:a.codingPhase;u!=null?(t.has(u)||t.set(u,[]),t.get(u).push(l)):n.push(l)}const i=[...t.entries()].sort((l,u)=>l[0]-u[0]).map(([l,u])=>{u.sort((m,v)=>{var x,w;return(((x=m.metadata)==null?void 0:x.codingOrder)??0)-(((w=v.metadata)==null?void 0:w.codingOrder)??0)});const d=ao(u),p=[...new Set(u.filter(m=>m.type==="epic").map(m=>m.name))],h=p.length>0?`Phase ${l}: ${p.join(", ")}`:`Phase ${l}`;return{id:`phase-${l}`,name:h,items:u,columns:d,type:"phase"}});return n.length>0&&i.push({id:"unphased",name:"No Phase",items:n,columns:ao(n),type:"ungrouped"}),{mode:"sections",groups:i}}function B6({onCardClick:e,onStartProject:t,projectFilesReady:n,onEditProjectDoc:r,onStartSprintPlanning:i,onOpenSprintPlanningSelection:a,sponsorCallRunning:l}){const[u,d]=b.useState(null),{workItems:p,loading:h}=jf(),{typeFilters:m,columnVisibility:v,searchQuery:x,groupBy:w}=Sf(),S=b.useMemo(()=>{let C=p.filter(E=>m[E.type]);if(x.trim()){const E=x.toLowerCase();C=C.filter(O=>O.name.toLowerCase().includes(E)||O.id.toLowerCase().includes(E)||O.description&&O.description.toLowerCase().includes(E)||O.epicName&&O.epicName.toLowerCase().includes(E))}return C},[p,m,x]),j=L6(S,w),k=C=>{d(C),e==null||e(C)};return h&&p.length===0?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),c.jsx("p",{className:"text-slate-600",children:"Loading work items..."})]})}):S.length===0&&p.length>0?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-6xl mb-4",children:"🔍"}),c.jsx("h3",{className:"text-xl font-semibold text-slate-900 mb-2",children:"No items match your filters"}),c.jsx("p",{className:"text-slate-600",children:"Try adjusting your filters or search query"})]})}):p.length===0?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx("div",{className:"text-center",children:t?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-6xl mb-4",children:"📋"}),c.jsx("h3",{className:"text-xl font-semibold text-slate-900 mb-2",children:"No Work Items"}),c.jsx("p",{className:"text-sm text-slate-500 mb-4",children:"Run the Sponsor Call ceremony to set up your project."}),c.jsx("button",{onClick:t,className:"px-5 py-2.5 text-sm font-medium bg-slate-900 text-white rounded-lg hover:bg-slate-700 transition-colors",children:"🚀 Start Project"})]}):n?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-5xl mb-4",children:"🏃"}),c.jsx("h3",{className:"text-lg font-semibold text-slate-900 mb-3",children:"Ready for Sprint Planning"}),c.jsx("p",{className:"text-sm text-slate-500 mb-2 max-w-sm",children:"Your project is set up and ready for sprint planning."}),c.jsxs("p",{className:"text-sm text-slate-700 font-medium mb-5 max-w-sm",children:["Review ",c.jsx("code",{className:"bg-slate-100 px-1 rounded text-xs",children:"doc.md"})," before starting — this file is the foundation of every Epic and Story that will be planned."]}),c.jsx("div",{className:"flex items-center justify-center gap-3 mb-6",children:c.jsx("button",{onClick:r,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium border border-slate-200 rounded-lg hover:bg-slate-50 transition-colors text-slate-700",children:"📄 Documentation"})}),i?c.jsx("button",{onClick:i,className:"px-5 py-2.5 text-sm font-medium bg-slate-900 text-white rounded-lg hover:bg-slate-700 transition-colors",children:"🚀 Start Sprint Planning"}):a?c.jsxs("button",{onClick:a,className:"flex items-center gap-2 px-5 py-2.5 text-sm font-medium bg-amber-500 text-white rounded-lg hover:bg-amber-600 transition-colors animate-pulse",children:[c.jsx("span",{children:"⚠"}),"Sprint planning needs your input"]}):c.jsx("p",{className:"text-xs text-slate-400",children:"Sprint planning is running…"})]}):l?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-5xl mb-4",children:"📋"}),c.jsx("h3",{className:"text-lg font-semibold text-slate-900 mb-3",children:"Sponsor Call is running…"}),c.jsx("p",{className:"text-sm text-slate-500 max-w-sm",children:"The Sponsor Call ceremony is generating your project definition. Work items will appear here once it completes."})]}):null})}):j.mode==="sections"?c.jsx(qr.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:.3},children:j.groups.length===0?c.jsx("div",{className:"text-center py-12",children:c.jsx("p",{className:"text-slate-600",children:"No groups to display"})}):j.groups.map((C,E)=>c.jsx(qr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,delay:E*.1},children:c.jsx(R6,{group:C,columnVisibility:v,onCardClick:k})},C.id))},w):c.jsx(qr.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:.3},className:"flex gap-4 overflow-x-auto pb-4",children:c.jsx(N2,{mode:"sync",children:j.groups.filter(C=>v[C.name]).map(C=>c.jsx(iA,{columnName:C.name,statuses:ox[C.name],workItems:C.items,onCardClick:k},C.id))})},w)}const V6={doc:{title:"Project Documentation",filename:"doc.md",load:M3,save:I3}};function U6({fileType:e,onClose:t}){const n=V6[e],[r,i]=b.useState(""),[a,l]=b.useState(""),[u,d]=b.useState(!0),[p,h]=b.useState(!1),[m,v]=b.useState(!1),x=r!==a;b.useEffect(()=>{n.load().then(j=>{i(j??""),l(j??""),d(!1)})},[e]);const w=async()=>{if(!(!x||p)){h(!0);try{await n.save(r),l(r),v(!0),setTimeout(()=>v(!1),2e3)}finally{h(!1)}}},S=()=>{x?i(a):t()};return c.jsxs("div",{className:"fixed inset-0 z-[80] flex items-center justify-center",onClick:j=>{j.target===j.currentTarget&&t()},children:[c.jsx("div",{className:"absolute inset-0 bg-black/40"}),c.jsxs("div",{className:"relative z-10 w-full max-w-3xl h-[80vh] mx-4 bg-white rounded-xl shadow-2xl flex flex-col",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-slate-200 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-semibold text-slate-900",children:n.title}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5 font-mono",children:n.filename})]}),c.jsx("button",{onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors",title:"Close",children:c.jsx(xn,{className:"w-5 h-5"})})]}),c.jsx("div",{className:"flex-1 overflow-hidden p-4",children:u?c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-slate-400"})}):c.jsx("textarea",{className:"w-full h-full resize-none font-mono text-sm text-slate-800 border border-slate-200 rounded-lg p-3 focus:outline-none focus:ring-2 focus:ring-slate-300",value:r,onChange:j=>i(j.target.value),spellCheck:!1})}),c.jsxs("div",{className:"flex items-center justify-end gap-3 px-5 py-3 border-t border-slate-200 flex-shrink-0",children:[m&&c.jsx("span",{className:"text-sm text-green-600 font-medium mr-auto",children:"Saved ✓"}),c.jsx("button",{onClick:S,disabled:!x,className:"px-4 py-2 text-sm font-medium text-slate-700 border border-slate-200 rounded-lg hover:bg-slate-50 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Cancel"}),c.jsx("button",{onClick:w,disabled:!x||p,className:"px-4 py-2 text-sm font-medium bg-slate-900 text-white rounded-lg hover:bg-slate-700 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:p?"Saving…":"Save"})]})]})]})}function W6(){const{groupBy:e,setGroupBy:t}=Sf(),n=[{value:"status",label:"Status",icon:f3,description:"Traditional kanban columns"},{value:"epic",label:"Epic",icon:yd,description:"Hierarchical epic sections"},{value:"type",label:"Type",icon:s3,description:"Separate boards by type"},{value:"phase",label:"Phase",icon:h3,description:"Implementation order by dependencies"}];return c.jsx("div",{className:"flex items-center gap-0.5 bg-slate-100 rounded-md p-0.5",children:n.map(({value:r,label:i,icon:a,description:l})=>{const u=e===r;return c.jsxs("button",{onClick:()=>t(r),title:l,className:We("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-all",u?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:bg-slate-200"),children:[c.jsx(a,{className:"w-3.5 h-3.5"}),c.jsx("span",{children:i})]},r)})})}function q6(){const[e,t]=b.useState(""),{typeFilters:n,columnVisibility:r,searchQuery:i,toggleTypeFilter:a,setAllTypeFilters:l,toggleColumnVisibility:u,applyPreset:d,setSearchQuery:p,clearSearch:h,resetFilters:m}=Sf(),{refresh:v,loading:x}=jf(),w=[{key:"epic",label:"Epics",icon:"🏛️"},{key:"story",label:"Stories",icon:"📖"},{key:"task",label:"Tasks",icon:"⚙️"},{key:"subtask",label:"Subtasks",icon:"📝"}],S=[{key:"Backlog",label:"Backlog"},{key:"Ready",label:"Ready"},{key:"In Progress",label:"In Progress"},{key:"Review",label:"Review"},{key:"Done",label:"Done"}],j=O=>{const P=O.target.value;t(P),clearTimeout(window.searchDebounce),window.searchDebounce=setTimeout(()=>{p(P)},300)},k=()=>{t(""),h()},C=Object.values(n).every(O=>O),E=Object.values(n).some(O=>O);return c.jsx("div",{className:"bg-white border-b border-slate-200 shadow-sm",children:c.jsx("div",{className:"max-w-full px-4 py-2",children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("button",{onClick:()=>l(!C),className:We("-ml-1.5 p-1.5 rounded-md transition-colors flex-shrink-0",C?"text-blue-600 hover:bg-blue-50":E?"text-slate-500 hover:bg-slate-100":"text-slate-400 hover:bg-slate-100"),title:C?"Deselect all types":"Select all types",children:c.jsx(d3,{className:"w-4 h-4"})}),c.jsx("div",{className:"flex items-center gap-1",children:w.map(({key:O,label:P,icon:A})=>c.jsxs("button",{onClick:()=>a(O),className:We("px-2.5 py-1 rounded-md text-xs font-medium transition-colors","flex items-center gap-1",n[O]?"bg-blue-100 text-blue-700 hover:bg-blue-200":"bg-slate-100 text-slate-400 hover:bg-slate-200"),children:[c.jsx("span",{className:"text-sm leading-none",children:A}),c.jsx("span",{children:P})]},O))}),c.jsx("div",{className:"w-px h-5 bg-slate-200 flex-shrink-0"}),c.jsx(W6,{})]}),c.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[c.jsxs("div",{className:"relative group",children:[c.jsxs("button",{className:"px-2.5 py-1 rounded-md text-xs font-medium bg-slate-100 text-slate-700 hover:bg-slate-200 transition-colors flex items-center gap-1.5",children:[c.jsx(vd,{className:"w-3.5 h-3.5"}),"Columns"]}),c.jsxs("div",{className:"absolute right-0 top-full mt-2 bg-white border border-slate-200 rounded-lg shadow-lg py-2 min-w-[180px] opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all z-10",children:[c.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-slate-500 border-b border-slate-100",children:"COLUMN VISIBILITY"}),S.map(({key:O,label:P})=>c.jsxs("button",{onClick:()=>u(O),className:"w-full px-3 py-2 text-sm text-left hover:bg-slate-50 flex items-center justify-between",children:[c.jsx("span",{children:P}),r[O]?c.jsx(vd,{className:"w-4 h-4 text-blue-600"}):c.jsx(kv,{className:"w-4 h-4 text-slate-400"})]},O)),c.jsxs("div",{className:"border-t border-slate-100 mt-2 pt-2 px-3",children:[c.jsx("button",{onClick:()=>d("all"),className:"text-xs text-blue-600 hover:text-blue-700 font-medium",children:"Show All"}),c.jsx("span",{className:"text-slate-300 mx-2",children:"•"}),c.jsx("button",{onClick:()=>d("active"),className:"text-xs text-blue-600 hover:text-blue-700 font-medium",children:"Active Work"}),c.jsx("span",{className:"text-slate-300 mx-2",children:"•"}),c.jsx("button",{onClick:()=>d("hide-completed"),className:"text-xs text-blue-600 hover:text-blue-700 font-medium",children:"Hide Done"})]})]})]}),c.jsxs("div",{className:"relative",children:[c.jsx(x3,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-slate-400"}),c.jsx("input",{type:"text",placeholder:"Search...",value:e,onChange:j,className:"pl-8 pr-7 py-1 w-44 border border-slate-200 rounded-md text-xs focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"}),e&&c.jsx("button",{onClick:k,className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",children:c.jsx(xn,{className:"w-3.5 h-3.5"})})]}),c.jsx("button",{onClick:v,disabled:x,className:We("p-1.5 rounded-md transition-colors",x?"bg-slate-100 text-slate-400 cursor-not-allowed":"bg-slate-100 text-slate-700 hover:bg-slate-200"),title:"Refresh",children:c.jsx(g3,{className:We("w-3.5 h-3.5",x&&"animate-spin")})}),c.jsx("button",{onClick:m,className:"px-2.5 py-1 rounded-md text-xs font-medium bg-slate-100 text-slate-700 hover:bg-slate-200 transition-colors",children:"Reset"})]})]})})})}const rS={running:"bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100",paused:"bg-amber-50 text-amber-700 border-amber-200 hover:bg-amber-100",complete:"bg-green-50 text-green-700 border-green-200 hover:bg-green-100",error:"bg-red-50 text-red-700 border-red-200 hover:bg-red-100",cancelled:"bg-slate-50 text-slate-500 border-slate-200 hover:bg-slate-100"},iS={running:c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-500 animate-pulse flex-shrink-0"}),paused:c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 flex-shrink-0"}),complete:c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 flex-shrink-0"}),error:c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 flex-shrink-0"}),cancelled:c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-slate-400 flex-shrink-0"})};function K6(e,t){const n=(t??Date.now())-e,r=Math.floor(n/1e3);return r<60?`${r}s`:`${Math.floor(r/60)}m ${r%60}s`}function H6(){const{processes:e,clearCompleted:t}=w2(),n=e.filter(a=>!(a.type==="sponsor-call"&&a.status!=="running")&&!(a.type==="sprint-planning"&&a.status==="cancelled"));if(n.length===0)return null;const r=n.some(a=>["complete","error","cancelled"].includes(a.status)),i=a=>{a.type==="sprint-planning"?xo.getState().reopenModal():a.type==="sponsor-call"&&ar.getState().reopenWizard()};return c.jsxs("div",{className:"flex items-center gap-2 px-4 py-1.5 bg-white border-b border-slate-200 flex-shrink-0 flex-wrap",children:[c.jsx(i3,{className:"w-4 h-4 text-slate-400 flex-shrink-0"}),n.map(a=>c.jsxs("button",{onClick:()=>i(a),title:"Click to view",className:`flex items-center gap-1.5 text-xs px-2.5 py-1 rounded-full border transition-colors cursor-pointer ${rS[a.status]??rS.cancelled}`,children:[iS[a.status]??iS.cancelled,c.jsx("span",{className:"font-medium",children:a.label}),c.jsx("span",{className:"opacity-60",children:K6(a.startedAt,a.endedAt)})]},a.id)),r&&c.jsx("button",{onClick:t,className:"ml-auto text-xs text-slate-400 hover:text-slate-600 px-2 py-0.5 transition-colors",children:"Clear done"})]})}function G6({open:e,onOpenChange:t,children:n}){return b.useEffect(()=>{const r=i=>{i.key==="Escape"&&e&&t(!1)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]),b.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]),c.jsx(N2,{children:e&&c.jsxs(c.Fragment,{children:[c.jsx(qr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>t(!1),className:"fixed inset-0 bg-black/50 z-50"}),c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:n})]})})}function Y6({className:e,children:t,onClose:n}){return c.jsxs(qr.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},onClick:r=>r.stopPropagation(),className:We("relative bg-white rounded-lg shadow-xl max-w-4xl w-full h-[90vh] overflow-hidden","flex flex-col",e),children:[c.jsxs("button",{onClick:n,className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 transition-opacity z-10",children:[c.jsx(xn,{className:"h-5 w-5"}),c.jsx("span",{className:"sr-only",children:"Close"})]}),t]})}function X6({className:e,children:t}){return c.jsx("div",{className:We("flex flex-col space-y-1.5 px-6 pt-6 pb-4",e),children:t})}function Q6({className:e,children:t}){return c.jsx("h2",{className:We("text-2xl font-semibold leading-none tracking-tight",e),children:t})}function J6({className:e,children:t}){return c.jsx("p",{className:We("text-sm text-slate-600",e),children:t})}const cx=b.createContext();function sS({defaultValue:e,value:t,onValueChange:n,children:r,className:i}){const[a,l]=b.useState(t||e);b.useEffect(()=>{t!==void 0&&l(t)},[t]);const u=d=>{l(d),n==null||n(d)};return c.jsx(cx.Provider,{value:{selectedTab:a,setSelectedTab:u},children:c.jsx("div",{className:We("w-full",i),children:r})})}function Z6({className:e,children:t}){return c.jsx("div",{className:We("inline-flex h-10 items-center justify-start rounded-md bg-slate-100 p-1 text-slate-600",e),children:t})}function Fu({value:e,children:t,className:n}){const{selectedTab:r,setSelectedTab:i}=b.useContext(cx),a=r===e;return c.jsx("button",{onClick:()=>i(e),className:We("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5","text-sm font-medium ring-offset-white transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",a?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:bg-slate-200",n),children:t})}function Bu({value:e,children:t,className:n}){const{selectedTab:r}=b.useContext(cx);return r!==e?null:c.jsx("div",{className:We("mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-slate-950 focus-visible:ring-offset-2",n),children:t})}function Ga({variant:e="default",className:t,children:n}){return c.jsx("div",{className:We("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold","transition-colors focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2",{"border-transparent bg-slate-900 text-slate-50 hover:bg-slate-900/80":e==="default","border-transparent bg-slate-100 text-slate-900 hover:bg-slate-100/80":e==="secondary","border-transparent bg-red-100 text-red-900 hover:bg-red-100/80":e==="destructive","border-slate-200 text-slate-900":e==="outline"},t),children:n})}function ez({storyId:e,onStarted:t}){const[n,r]=b.useState("idle"),[i,a]=b.useState([]),[l,u]=b.useState(null),[d,p]=b.useState([]),[h,m]=b.useState(!1),[v,x]=b.useState(null),w=b.useRef(null);b.useEffect(()=>{w.current&&(w.current.scrollTop=w.current.scrollHeight)},[d]),b.useEffect(()=>{if(!v)return;const k=C=>{const E=C.detail;!E||E.processId!==v||(E.type==="seed:progress"?p(O=>[...O,E.message]):E.type==="seed:complete"?(r("complete"),p(O=>[...O,"Seed complete — tasks created."]),t==null||t()):E.type==="seed:error"&&(r("error"),u(E.error||"Seed failed"),p(O=>[...O,`Error: ${E.error}`])))};return window.addEventListener("avc-ws-message",k),()=>window.removeEventListener("avc-ws-message",k)},[v,t]);const S=async()=>{if(!(n==="checking"||n==="seeding")){r("checking"),u(null),a([]),p([]);try{const k=await b2(e);if(!k.ready){r("blocked"),a(k.blockers||[]);return}r("seeding"),m(!0),p(["Starting seed ceremony..."]);const C=await mD(e);x(C.processId),p(E=>[...E,`Process started: ${C.processId}`])}catch(k){u(k.message),r("error")}}},j=()=>{r("idle"),a([]),u(null),p([]),m(!1),x(null)};return n==="blocked"?c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2 text-amber-700 text-sm bg-amber-50 border border-amber-200 rounded-lg px-3 py-2",children:[c.jsx(vi,{className:"w-4 h-4 flex-shrink-0"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-medium",children:"Dependencies not met"}),c.jsx("ul",{className:"mt-1 text-xs space-y-0.5",children:i.map(k=>c.jsxs("li",{children:[k.id,": ",k.name," (",k.status,")"]},k.id))})]})]}),c.jsx("button",{onClick:j,className:"text-xs text-slate-500 hover:text-slate-700",children:"Dismiss"})]}):(n==="seeding"||n==="complete"||n==="error")&&h?c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[n==="seeding"&&c.jsx(xd,{className:"w-4 h-4 animate-spin text-green-600"}),n==="complete"&&c.jsx(A1,{className:"w-4 h-4 text-green-600"}),n==="error"&&c.jsx(vi,{className:"w-4 h-4 text-red-600"}),c.jsx("span",{className:We(n==="seeding"&&"text-green-700",n==="complete"&&"text-green-700",n==="error"&&"text-red-700"),children:n==="seeding"?"Seeding...":n==="complete"?"Seed Complete":"Seed Failed"})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{onClick:()=>m(!h),className:"p-1 text-slate-400 hover:text-slate-600",children:h?c.jsx(Nv,{className:"w-3.5 h-3.5"}):c.jsx(Hr,{className:"w-3.5 h-3.5"})}),n!=="seeding"&&c.jsx("button",{onClick:j,className:"p-1 text-slate-400 hover:text-slate-600",children:c.jsx(xn,{className:"w-3.5 h-3.5"})})]})]}),h&&c.jsxs("div",{ref:w,className:"max-h-32 overflow-y-auto bg-slate-900 text-slate-300 text-xs font-mono rounded-md p-2 space-y-0.5",children:[d.map((k,C)=>c.jsx("div",{className:We(k.startsWith("Error")&&"text-red-400",k.includes("complete")&&"text-green-400"),children:k},C)),n==="seeding"&&c.jsx("div",{className:"text-slate-500 animate-pulse",children:"..."})]})]}):c.jsxs("div",{className:"space-y-1",children:[c.jsxs("button",{onClick:S,disabled:n==="checking",className:We("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors",n==="checking"?"bg-green-100 text-green-700 cursor-wait":"bg-green-600 text-white hover:bg-green-700"),children:[n==="checking"?c.jsx(xd,{className:"w-4 h-4 animate-spin"}):c.jsx(A1,{className:"w-4 h-4"}),n==="checking"?"Checking...":"Seed"]}),l&&c.jsx("p",{className:"text-xs text-red-600",children:l})]})}function tz({taskId:e,onStarted:t}){const[n,r]=b.useState("idle"),[i,a]=b.useState([]),[l,u]=b.useState(null),[d,p]=b.useState([]),[h,m]=b.useState(!1),[v,x]=b.useState(null),w=b.useRef(null);b.useEffect(()=>{w.current&&(w.current.scrollTop=w.current.scrollHeight)},[d]),b.useEffect(()=>{if(!v)return;const k=C=>{const E=C.detail;!E||E.processId!==v||(E.type==="run-task:progress"?p(O=>[...O,E.message]):E.type==="run-task:complete"?(r("complete"),p(O=>[...O,"Task complete — code committed."]),t==null||t()):E.type==="run-task:error"&&(r("error"),u(E.error||"Run failed"),p(O=>[...O,`Error: ${E.error}`])))};return window.addEventListener("avc-ws-message",k),()=>window.removeEventListener("avc-ws-message",k)},[v,t]);const S=async()=>{if(!(n==="checking"||n==="running")){r("checking"),u(null),a([]),p([]);try{const k=await b2(e);if(!k.ready){r("blocked"),a(k.blockers||[]);return}r("running"),m(!0),p(["Starting task implementation..."]);const C=await gD(e);x(C.processId),p(E=>[...E,`Process started: ${C.processId}`])}catch(k){u(k.message),r("error")}}},j=()=>{r("idle"),a([]),u(null),p([]),m(!1),x(null)};return n==="blocked"?c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2 text-amber-700 text-sm bg-amber-50 border border-amber-200 rounded-lg px-3 py-2",children:[c.jsx(vi,{className:"w-4 h-4 flex-shrink-0"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-medium",children:"Dependencies not met"}),c.jsx("ul",{className:"mt-1 text-xs space-y-0.5",children:i.map(k=>c.jsxs("li",{children:[k.id,": ",k.name," (",k.status,")"]},k.id))})]})]}),c.jsx("button",{onClick:j,className:"text-xs text-slate-500 hover:text-slate-700",children:"Dismiss"})]}):(n==="running"||n==="complete"||n==="error")&&h?c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[n==="running"&&c.jsx(xd,{className:"w-4 h-4 animate-spin text-blue-600"}),n==="complete"&&c.jsx(O1,{className:"w-4 h-4 text-green-600"}),n==="error"&&c.jsx(vi,{className:"w-4 h-4 text-red-600"}),c.jsx("span",{className:We(n==="running"&&"text-blue-700",n==="complete"&&"text-green-700",n==="error"&&"text-red-700"),children:n==="running"?"Implementing...":n==="complete"?"Complete":"Failed"})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{onClick:()=>m(!h),className:"p-1 text-slate-400 hover:text-slate-600",children:h?c.jsx(Nv,{className:"w-3.5 h-3.5"}):c.jsx(Hr,{className:"w-3.5 h-3.5"})}),n!=="running"&&c.jsx("button",{onClick:j,className:"p-1 text-slate-400 hover:text-slate-600",children:c.jsx(xn,{className:"w-3.5 h-3.5"})})]})]}),h&&c.jsxs("div",{ref:w,className:"max-h-32 overflow-y-auto bg-slate-900 text-slate-300 text-xs font-mono rounded-md p-2 space-y-0.5",children:[d.map((k,C)=>c.jsx("div",{className:We(k.startsWith("Error")&&"text-red-400",k.includes("complete")&&"text-green-400"),children:k},C)),n==="running"&&c.jsx("div",{className:"text-slate-500 animate-pulse",children:"..."})]})]}):c.jsxs("div",{className:"space-y-1",children:[c.jsxs("button",{onClick:S,disabled:n==="checking",className:We("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors",n==="checking"?"bg-blue-100 text-blue-700 cursor-wait":"bg-blue-600 text-white hover:bg-blue-700"),children:[n==="checking"?c.jsx(xd,{className:"w-4 h-4 animate-spin"}):c.jsx(O1,{className:"w-4 h-4"}),n==="checking"?"Checking...":"Run"]}),l&&c.jsx("p",{className:"text-xs text-red-600",children:l})]})}function nz(e=""){return e==="claude"?"anthropic":e}function aS({label:e,value:t,onChange:n,models:r,disabled:i}){const a=[...new Set(r.map(u=>u.provider))],l=r.find(u=>u.modelId===t);return c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:e}),c.jsxs("select",{value:t,onChange:u=>n(u.target.value),disabled:i||r.length===0,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 focus:outline-none focus:ring-2 focus:ring-violet-500 disabled:opacity-60 bg-white",children:[r.length===0&&c.jsx("option",{value:"",children:"Loading…"}),a.map(u=>c.jsx("optgroup",{label:u.charAt(0).toUpperCase()+u.slice(1),children:r.filter(d=>d.provider===u).map(d=>c.jsxs("option",{value:d.modelId,children:[d.displayName,d.hasApiKey?"":" (no key)"]},d.modelId))},u))]}),l&&!l.hasApiKey&&c.jsxs("p",{className:"text-xs text-amber-600 mt-0.5",children:["⚠ No API key — add to ",c.jsx("code",{children:".env"})]})]})}function xm({label:e,before:t,after:n}){const r=Array.isArray(t)?t.join(`
284
+ `):t??"",i=Array.isArray(n)?n.join(`
285
+ `):n??"";return!r&&!i||r===i?null:c.jsxs("div",{className:"mb-3",children:[c.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-1",children:e}),r&&c.jsx("div",{className:"mb-1 px-2.5 py-2 bg-red-50 border border-red-100 rounded text-xs text-red-700 leading-relaxed line-through",children:r}),i&&c.jsx("div",{className:"px-2.5 py-2 bg-green-50 border border-green-100 rounded text-xs text-green-700 leading-relaxed",children:i})]})}function rz({impact:e,checked:t,onToggle:n}){var a;const[r,i]=b.useState(!1);return c.jsxs("div",{className:`border rounded-lg overflow-hidden transition-colors ${t?"border-violet-300 bg-violet-50":"border-slate-200 bg-white"}`,children:[c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[c.jsx("input",{type:"checkbox",checked:t,onChange:n,className:"flex-shrink-0 accent-violet-600"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-xs font-medium text-slate-800 truncate",children:((a=e.proposedStory)==null?void 0:a.name)??e.storyId}),c.jsx("p",{className:"text-xs text-slate-400 truncate",children:e.storyId})]}),e.changesNeeded&&c.jsx("button",{type:"button",onClick:()=>i(l=>!l),className:"flex-shrink-0 text-slate-400 hover:text-slate-600",children:r?c.jsx(Hr,{className:"w-3.5 h-3.5"}):c.jsx(sr,{className:"w-3.5 h-3.5"})})]}),r&&e.changesNeeded&&c.jsx("div",{className:"px-3 pb-3 pt-1 border-t border-slate-100",children:c.jsx("p",{className:"text-xs text-slate-600 leading-relaxed",children:e.changesNeeded})})]})}function iz({story:e,checked:t,onToggle:n}){const[r,i]=b.useState(!1),a=(e==null?void 0:e.acceptance)??(e==null?void 0:e.acceptanceCriteria)??[];return c.jsxs("div",{className:`border rounded-lg overflow-hidden transition-colors ${t?"border-emerald-300 bg-emerald-50":"border-slate-200 bg-white"}`,children:[c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[c.jsx("input",{type:"checkbox",checked:t,onChange:n,className:"flex-shrink-0 accent-emerald-600"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[c.jsx("span",{className:"flex-shrink-0 text-xs font-bold px-1.5 py-0.5 rounded bg-emerald-100 text-emerald-700",children:"NEW"}),c.jsx("p",{className:"text-xs font-medium text-slate-800 truncate",children:e==null?void 0:e.name})]}),(e==null?void 0:e.description)&&c.jsx("p",{className:"text-xs text-slate-500 truncate",children:e.description})]}),c.jsx("button",{type:"button",onClick:()=>i(l=>!l),className:"flex-shrink-0 text-slate-400 hover:text-slate-600",children:r?c.jsx(Hr,{className:"w-3.5 h-3.5"}):c.jsx(sr,{className:"w-3.5 h-3.5"})})]}),r&&c.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-slate-100 space-y-2",children:[(e==null?void 0:e.description)&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-0.5",children:"Description"}),c.jsx("p",{className:"text-xs text-slate-700 leading-relaxed",children:e.description})]}),a.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-0.5",children:"Acceptance Criteria"}),c.jsx("ul",{className:"space-y-0.5",children:a.map((l,u)=>c.jsxs("li",{className:"flex items-start gap-1 text-xs text-slate-700",children:[c.jsx("span",{className:"text-slate-400 mt-0.5 flex-shrink-0",children:"•"}),c.jsx("span",{children:l})]},u))})]})]})]})}const sz={critical:"text-red-600",major:"text-orange-600",minor:"text-amber-600"},az={critical:"bg-red-50 border-red-100",major:"bg-orange-50 border-orange-100",minor:"bg-amber-50 border-amber-100"};function oS(e){return e>=95?"bg-green-100 text-green-700":e>=80?"bg-amber-100 text-amber-700":"bg-red-100 text-red-700"}function oz({item:e,refineProgress:t,refineResult:n,refineError:r,onClose:i,onAccepted:a}){var H,me,Oe,se,$e,De,Je,et,Mt,Mn,bn,wn,jn;const l=(H=e==null?void 0:e.metadata)==null?void 0:H.validationResult,u=[...((l==null?void 0:l.criticalIssues)||[]).map(he=>({...he,severity:"critical"})),...((l==null?void 0:l.majorIssues)||[]).map(he=>({...he,severity:"major"})),...((l==null?void 0:l.minorIssues)||[]).map(he=>({...he,severity:"minor"}))],[d,p]=b.useState(()=>new Set(u.map((he,ke)=>he.severity==="critical"?ke:null).filter(he=>he!==null))),[h,m]=b.useState(""),[v,x]=b.useState([]),[w,S]=b.useState(""),[j,k]=b.useState(""),[C,E]=b.useState(""),[O,P]=b.useState(!1),[A,_]=b.useState([]),D=b.useRef(null),[$,q]=b.useState(null),[X,L]=b.useState(!1),[Z,J]=b.useState(""),ne=n?"results":O||t?"running":"configure";b.useEffect(()=>{Promise.all([ds(),Tn()]).then(([he,ke])=>{x(he);const Me=he.filter(Ge=>{var Rt,In;return(In=(Rt=ke.apiKeys)==null?void 0:Rt[nz(Ge.provider)])==null?void 0:In.isSet}),Ze=Ge=>/pro|opus|sonnet/i.test(Ge),Ct=Ge=>/flash|lite|haiku|mini/i.test(Ge),It=Me.find(Ge=>Ze(Ge.modelId))||Me[0],Dt=It?It.modelId:he.length>0?he[0].modelId:"";S(Dt);const un=Me.find(Ge=>Ct(Ge.modelId)&&Ge.modelId!==Dt)||Me.find(Ge=>Ge.modelId!==Dt)||It;k(un?un.modelId:Dt)}).catch(()=>E("Failed to load models."))},[]),b.useEffect(()=>{t!=null&&t.message&&_(he=>[...he,t.message])},[t]),b.useEffect(()=>{var he;(he=D.current)==null||he.scrollIntoView({behavior:"smooth"})},[A]),b.useEffect(()=>{var Me;if(!n)return;P(!1);const he=((Me=n.result)==null?void 0:Me.storyImpacts)||[],ke={};he.forEach((Ze,Ct)=>{ke[Ct]=Ze.type==="new"||Ze.impacted===!0}),q(ke)},[n]),b.useEffect(()=>{r&&(P(!1),E(typeof r.error=="string"?r.error:"Refinement failed — please try again."))},[r]);function re(he){p(ke=>{const Me=new Set(ke);return Me.has(he)?Me.delete(he):Me.add(he),Me})}async function B(){const he=v.find(Ze=>Ze.modelId===w),ke=v.find(Ze=>Ze.modelId===j);if(!he||!ke)return;const Me=u.filter((Ze,Ct)=>d.has(Ct));P(!0),E(""),_([]);try{await oD(e.id,{refinementRequest:h,selectedIssues:Me,modelId:w,provider:he.provider,validatorModelId:j,validatorProvider:ke.provider})}catch(Ze){P(!1),E(Ze.message||"Failed to start refinement.")}}async function F(){if(!n)return;const{proposedItem:he,storyImpacts:ke=[]}=n.result,Me=ke.filter((Ze,Ct)=>$==null?void 0:$[Ct]).map(Ze=>({type:Ze.type,storyId:Ze.storyId??null,proposedStory:Ze.proposedStory}));L(!0),J("");try{await lD(e.id,he,Me),a==null||a()}catch(Ze){J(Ze.message||"Failed to apply changes."),L(!1)}}const G=v.find(he=>he.modelId===w),W=v.find(he=>he.modelId===j),M=!O&&!!w&&!!j&&!!G&&!!W,V=d.size,ie=n==null?void 0:n.result,fe=(ie==null?void 0:ie.storyImpacts)||[],te=fe.map((he,ke)=>({impact:he,i:ke})).filter(({impact:he})=>he.type==="update"&&he.impacted),le=fe.map((he,ke)=>({impact:he,i:ke})).filter(({impact:he})=>he.type==="new"),pe=Object.values($||{}).filter(Boolean).length,Se=e.type==="epic";return c.jsx("div",{className:"fixed inset-0 z-[80] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:he=>{he.target===he.currentTarget&&ne!=="running"&&i()},children:c.jsxs("div",{className:`bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden w-full transition-all duration-200 ${ne==="results"?"max-w-2xl":"max-w-xl"}`,style:{maxHeight:"88vh"},children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-sm font-semibold text-slate-900 flex items-center gap-1.5",children:[c.jsx(ig,{className:"w-3.5 h-3.5 text-violet-600"}),"Refine with AI",ne!=="configure"&&c.jsx("span",{className:`ml-1 text-xs font-medium px-1.5 py-0.5 rounded ${ne==="running"?"bg-blue-100 text-blue-700":"bg-violet-100 text-violet-700"}`,children:ne==="running"?"Running…":"Results"})]}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5 truncate max-w-xs",children:e.name})]}),ne!=="running"&&c.jsx("button",{type:"button",onClick:i,className:"text-slate-400 hover:text-slate-600 transition-colors ml-4 flex-shrink-0","aria-label":"Close",children:c.jsx(xn,{className:"w-4 h-4"})})]}),ne==="configure"&&c.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-4 min-h-0",children:[u.length>0?c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsxs("p",{className:"text-xs font-semibold text-slate-600 uppercase tracking-wide",children:["Validation Issues (",u.length,")"]}),c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsx("button",{type:"button",onClick:()=>p(new Set(u.map((he,ke)=>ke))),className:"text-violet-600 hover:text-violet-800 transition-colors",children:"All"}),c.jsx("span",{className:"text-slate-300",children:"|"}),c.jsx("button",{type:"button",onClick:()=>p(new Set),className:"text-slate-400 hover:text-slate-600 transition-colors",children:"None"})]})]}),c.jsx("ul",{className:"space-y-1.5 max-h-52 overflow-y-auto pr-0.5",children:u.map((he,ke)=>c.jsxs("li",{onClick:()=>re(ke),className:`rounded-lg border px-3 py-2 cursor-pointer flex items-start gap-2.5 transition-shadow ${d.has(ke)?"ring-2 ring-violet-400":""} ${az[he.severity]??"bg-slate-50 border-slate-100"}`,children:[c.jsx("input",{type:"checkbox",checked:d.has(ke),onChange:()=>re(ke),onClick:Me=>Me.stopPropagation(),className:"mt-0.5 flex-shrink-0 accent-violet-600"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("span",{className:`text-xs font-semibold uppercase ${sz[he.severity]??"text-slate-500"}`,children:he.severity}),c.jsx("p",{className:"text-xs text-slate-800 mt-0.5 leading-snug",children:he.description}),he.suggestion&&c.jsxs("p",{className:"text-xs text-slate-500 mt-0.5 leading-snug",children:[c.jsx("span",{className:"font-medium",children:"Suggestion:"})," ",he.suggestion]})]})]},ke))})]}):c.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 bg-green-50 border border-green-100 rounded-lg",children:[c.jsx($l,{className:"w-3.5 h-3.5 text-green-600 flex-shrink-0"}),c.jsx("p",{className:"text-xs text-green-700",children:"No validation issues found — you can still refine with a custom request."})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:["Refinement request"," ",c.jsx("span",{className:"text-slate-400",children:"(optional)"})]}),c.jsx("textarea",{value:h,onChange:he=>m(he.target.value),rows:3,placeholder:Se?"E.g. Sharpen the scope, add examples, expand the features list…":"E.g. Make acceptance criteria more testable, add edge cases…",className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-violet-500 resize-none"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(aS,{label:"Generator Model",value:w,onChange:S,models:v,disabled:!1}),c.jsx(aS,{label:"Validator Model",value:j,onChange:k,models:v,disabled:!1})]}),C&&c.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 bg-red-50 border border-red-100 rounded-lg",children:[c.jsx(vi,{className:"w-3.5 h-3.5 text-red-500 flex-shrink-0 mt-0.5"}),c.jsx("p",{className:"text-xs text-red-700",children:C})]})]}),ne==="running"&&c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden px-5 py-4 min-h-0",children:[c.jsxs("div",{className:"flex flex-col items-center gap-3 mb-4 flex-shrink-0",children:[c.jsx("span",{className:"w-8 h-8 border-2 border-violet-200 border-t-violet-600 rounded-full animate-spin"}),c.jsxs("p",{className:"text-sm font-medium text-slate-700",children:["Refining ",e.type,"…"]})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto bg-slate-50 rounded-lg px-3 py-2.5 space-y-1 min-h-0",children:[A.length===0?c.jsx("p",{className:"text-xs text-slate-400 italic",children:"Starting…"}):A.map((he,ke)=>c.jsx("p",{className:"text-xs text-slate-600 leading-snug",children:he},ke)),c.jsx("div",{ref:D})]})]}),ne==="results"&&ie&&c.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5 min-h-0",children:[(()=>{var Me,Ze,Ct,It,Dt,un;const he=(Ze=(Me=e==null?void 0:e.metadata)==null?void 0:Me.validationResult)==null?void 0:Ze.averageScore,ke=((Ct=ie.validationResult)==null?void 0:Ct.averageScore)??((un=(Dt=(It=ie.proposedItem)==null?void 0:It.metadata)==null?void 0:Dt.validationResult)==null?void 0:un.averageScore);return ke==null?null:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide",children:"Validation Score"}),c.jsxs("div",{className:"flex items-center gap-2",children:[he!=null&&c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:`text-xs font-bold px-2 py-0.5 rounded-full ${oS(he)}`,children:[he,"/100"]}),c.jsx("span",{className:"text-slate-400 text-xs",children:"→"})]}),c.jsxs("span",{className:`text-xs font-bold px-2 py-0.5 rounded-full ${oS(ke)}`,children:[ke,"/100"]})]})]})})(),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Proposed Changes"}),c.jsx(xm,{label:"Description",before:(me=ie.originalItem)==null?void 0:me.description,after:(Oe=ie.proposedItem)==null?void 0:Oe.description}),Se&&c.jsx(xm,{label:"Features",before:(se=ie.originalItem)==null?void 0:se.features,after:($e=ie.proposedItem)==null?void 0:$e.features}),!Se&&c.jsx(xm,{label:"Acceptance Criteria",before:((De=ie.originalItem)==null?void 0:De.acceptance)??((Je=ie.originalItem)==null?void 0:Je.acceptanceCriteria),after:((et=ie.proposedItem)==null?void 0:et.acceptance)??((Mt=ie.proposedItem)==null?void 0:Mt.acceptanceCriteria)}),((Mn=ie.originalItem)==null?void 0:Mn.description)===((bn=ie.proposedItem)==null?void 0:bn.description)&&!((wn=ie.originalItem)!=null&&wn.features)&&!((jn=ie.originalItem)!=null&&jn.acceptanceCriteria)&&c.jsx("p",{className:"text-xs text-slate-400 italic",children:"No textual changes detected — check dependencies or metadata."})]}),te.length>0&&c.jsxs("div",{children:[c.jsxs("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:["Existing Stories to Update (",te.length,")"]}),c.jsx("div",{className:"space-y-2",children:te.map(({impact:he,i:ke})=>c.jsx(rz,{impact:he,checked:($==null?void 0:$[ke])??!0,onToggle:()=>q(Me=>({...Me,[ke]:!(Me!=null&&Me[ke])}))},ke))})]}),le.length>0&&c.jsxs("div",{children:[c.jsxs("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:["New Stories to Add (",le.length,")"]}),c.jsx("div",{className:"space-y-2",children:le.map(({impact:he,i:ke})=>c.jsx(iz,{story:he.proposedStory,checked:($==null?void 0:$[ke])??!0,onToggle:()=>q(Me=>({...Me,[ke]:!(Me!=null&&Me[ke])}))},ke))})]}),Z&&c.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 bg-red-50 border border-red-100 rounded-lg",children:[c.jsx(vi,{className:"w-3.5 h-3.5 text-red-500 flex-shrink-0 mt-0.5"}),c.jsx("p",{className:"text-xs text-red-700",children:Z})]})]}),c.jsxs("div",{className:"px-5 py-3 border-t border-slate-100 flex-shrink-0 flex items-center justify-between gap-2",children:[ne==="configure"&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:i,className:"px-4 py-1.5 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Cancel"}),c.jsxs("button",{type:"button",onClick:B,disabled:!M,className:"flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium text-white bg-violet-600 rounded-lg hover:bg-violet-700 transition-colors disabled:opacity-40",children:[c.jsx(ig,{className:"w-3.5 h-3.5"}),V>0?`Refine (${V} issue${V!==1?"s":""})`:"Refine"]})]}),ne==="running"&&c.jsx("p",{className:"w-full text-center text-xs text-slate-400 italic",children:"Waiting for LLM response — please keep this window open."}),ne==="results"&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:i,disabled:X,className:"px-4 py-1.5 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors disabled:opacity-40",children:"Discard"}),c.jsx("button",{type:"button",onClick:F,disabled:X,className:"flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium text-white bg-violet-600 rounded-lg hover:bg-violet-700 transition-colors disabled:opacity-40",children:X?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Applying…"]}):c.jsxs(c.Fragment,{children:[c.jsx($l,{className:"w-3.5 h-3.5"}),pe>0?`Accept + ${pe} story change${pe!==1?"s":""}`:"Accept Changes"]})})]})]})]})})}function ym({item:e,fallbackName:t,fallbackId:n,onItemClick:r}){const i=e?ud[e.type]:null,a=e?so(e.status):null;return c.jsx("button",{onClick:()=>e&&(r==null?void 0:r(e)),disabled:!e,className:"w-full text-left p-4 border border-slate-200 rounded-lg hover:border-blue-300 hover:bg-blue-50 transition-colors disabled:opacity-50 disabled:cursor-default",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"font-medium text-slate-900 mb-1 truncate",children:(e==null?void 0:e.name)??t}),(e==null?void 0:e.description)&&c.jsx("p",{className:"text-xs text-slate-500 mb-1 line-clamp-2",children:e.description}),(a||i)&&c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a&&c.jsxs(Ga,{variant:"secondary",className:We("text-xs",a.color==="green"&&"bg-green-100 text-green-700",a.color==="blue"&&"bg-blue-100 text-blue-700",a.color==="yellow"&&"bg-yellow-100 text-yellow-700",a.color==="purple"&&"bg-purple-100 text-purple-700",a.color==="red"&&"bg-red-100 text-red-700"),children:[a.icon," ",a.label]}),i&&c.jsxs(Ga,{variant:"outline",className:"text-xs",children:[i.icon," ",i.label]})]})]}),e&&c.jsx(sr,{className:"w-4 h-4 text-slate-400 mt-1 flex-shrink-0 ml-2"})]})})}function lz({item:e}){const[t,n]=b.useState(!1),[r,i]=b.useState(null),a=async()=>{if(r!==null){n(!t);return}const u=e.id==="project"?await _3():await sg(e.id).catch(()=>"");i(u||'<p class="text-slate-400 italic">No content</p>'),n(!0)},l=e.id==="project";return c.jsxs("div",{className:"w-full",children:[c.jsxs("button",{onClick:a,className:`inline-flex items-center gap-1 px-2 py-0.5 rounded font-medium ${l?"bg-indigo-50 hover:bg-indigo-100 text-indigo-700":"bg-slate-100 hover:bg-slate-200 text-slate-600"}`,children:[t?c.jsx(Nv,{className:"w-3 h-3"}):c.jsx(sr,{className:"w-3 h-3"}),e.name," — doc.md"]}),t&&r&&c.jsx("div",{className:"mt-2 ml-4 p-3 border-l-2 border-slate-200 prose prose-sm prose-slate max-w-none",children:c.jsx("div",{dangerouslySetInnerHTML:{__html:r}})})]})}const ud={epic:{color:"indigo",icon:"🏛️",label:"Epic"},story:{color:"blue",icon:"📖",label:"Story"},task:{color:"emerald",icon:"⚙️",label:"Task"},subtask:{color:"gray",icon:"📝",label:"Subtask"}};function cz({workItem:e,open:t,onOpenChange:n,onNavigate:r,onItemClick:i,allItems:a,refineProgress:l,refineResult:u,refineError:d,onClearRefine:p}){const[h,m]=b.useState("documentation"),[v,x]=b.useState(null),[w,S]=b.useState(null),[j,k]=b.useState(!1),[C,E]=b.useState(null),[O,P]=b.useState(!1),[A,_]=b.useState(""),[D,$]=b.useState(!1),[q,X]=b.useState([]),L=jf(M=>M.ceremonyActive),[Z,J]=b.useState(!1),ne=()=>{J(!1),p==null||p(),re()};b.useEffect(()=>{t&&e&&re()},[t,e==null?void 0:e.id]),b.useEffect(()=>{!j&&w===null&&m("details")},[j,w]),b.useEffect(()=>{if(!t)return;const M=V=>{V.key==="ArrowLeft"?r==null||r("prev"):V.key==="ArrowRight"&&(r==null||r("next"))};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[t,r]);const re=async()=>{if(e){k(!0),E(null),P(!1);try{const M=await C3(e.id);x(M);const V=[{id:"project",name:"Project"}];if(a){const fe=[];let te=M.parentId;for(;te;){const le=a.find(pe=>pe.id===te);if(!le)break;fe.unshift(le),te=le.parentId}V.push(...fe)}X(V);const ie=await sg(e.id).catch(()=>null);S(ie||null)}catch(M){E(M.message),console.error("Failed to load work item details:",M)}finally{k(!1)}}},B=async()=>{const M=await O3(e.id);_(M),P(!0)},F=async()=>{$(!0);try{await A3(e.id,A);const M=await sg(e.id);S(M),P(!1)}finally{$(!1)}};if(!e)return null;const G=so(e.status),W=ud[e.type]||ud.task;return c.jsxs(G6,{open:t,onOpenChange:n,children:[c.jsxs(Y6,{onClose:()=>n(!1),children:[c.jsx(X6,{children:c.jsx("div",{className:"flex items-start justify-between pr-8",children:c.jsxs("div",{className:"flex-1",children:[c.jsx(Q6,{className:"mb-2",children:e.name}),c.jsxs(J6,{className:"flex items-center gap-2 flex-wrap",children:[c.jsxs(Ga,{variant:"secondary",className:We((G==null?void 0:G.color)==="blue"&&"bg-blue-100 text-blue-700",(G==null?void 0:G.color)==="yellow"&&"bg-yellow-100 text-yellow-700",(G==null?void 0:G.color)==="green"&&"bg-green-100 text-green-700",(G==null?void 0:G.color)==="purple"&&"bg-purple-100 text-purple-700",(G==null?void 0:G.color)==="red"&&"bg-red-100 text-red-700"),children:[G==null?void 0:G.icon," ",G==null?void 0:G.label]}),c.jsxs(Ga,{variant:"outline",children:[W.icon," ",W.label]}),c.jsx("span",{className:"text-slate-400 text-xs",children:e.id})]})]})})}),c.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[c.jsxs("div",{className:"px-6 pb-2 border-b border-slate-100 flex items-center justify-between gap-4",children:[c.jsx(sS,{value:h,onValueChange:m,children:c.jsxs(Z6,{children:[w&&c.jsxs(Fu,{value:"documentation",children:[c.jsx(f2,{className:"w-4 h-4 mr-2"}),"Documentation"]}),c.jsxs(Fu,{value:"details",children:[c.jsx(u3,{className:"w-4 h-4 mr-2"}),"Details"]}),(v==null?void 0:v.children)&&v.children.length>0&&c.jsxs(Fu,{value:"children",children:[c.jsx(j3,{className:"w-4 h-4 mr-2"}),"Children (",v.children.length,")"]}),(v==null?void 0:v.functions)&&v.functions.length>0&&c.jsxs(Fu,{value:"code",children:["Code (",v.functions.length,")"]})]})}),c.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(()=>{var pe;const M=(pe=v==null?void 0:v.metadata)==null?void 0:pe.validationResult;if(!M)return null;const V=M.averageScore??null,ie=(M.criticalIssues||[]).length,fe=(M.majorIssues||[]).length,te=(M.minorIssues||[]).length,le=ie+fe+te;return c.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-500",children:[c.jsxs("span",{className:`font-bold px-2 py-0.5 rounded-full ${V>=95?"bg-green-100 text-green-700":V>=80?"bg-amber-100 text-amber-700":"bg-red-100 text-red-700"}`,children:[V,"/100"]}),le>0&&c.jsxs("span",{children:[ie>0&&c.jsxs("span",{className:"text-red-600 font-medium",children:[ie," critical"]}),ie>0&&fe>0&&c.jsx("span",{className:"mx-0.5",children:"·"}),fe>0&&c.jsxs("span",{className:"text-orange-600 font-medium",children:[fe," major"]}),(ie>0||fe>0)&&te>0&&c.jsx("span",{className:"mx-0.5",children:"·"}),te>0&&c.jsxs("span",{className:"text-amber-600",children:[te," minor"]})]})]})})(),v&&!L&&c.jsxs("div",{className:"flex items-center gap-2",children:[e.type==="story"&&(!v.children||v.children.length===0)&&c.jsx(ez,{storyId:e.id,onStarted:re}),e.type==="task"&&(e.status==="planned"||e.status==="ready"||e.status==="failed")&&c.jsx(tz,{taskId:e.id,onStarted:re}),c.jsxs("button",{onClick:()=>J(!0),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-violet-700 bg-violet-50 border border-violet-200 rounded-lg hover:bg-violet-100 transition-colors",children:[c.jsx(ig,{className:"w-3.5 h-3.5"}),"Refine with AI"]})]})]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:j?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}):C?c.jsx("div",{className:"text-center py-12",children:c.jsxs("p",{className:"text-red-600",children:["Failed to load details: ",C]})}):c.jsxs(sS,{value:h,children:[w&&c.jsxs(Bu,{value:"documentation",children:[q.length>0&&c.jsx("div",{className:"mb-4 flex flex-wrap items-center gap-2 text-xs text-slate-500",children:q.map(M=>c.jsx(lz,{item:M,fileType:"doc"},M.id))}),c.jsx("div",{className:"flex justify-end mb-2",children:L?c.jsxs("span",{className:"flex items-center gap-1 px-2 py-1 text-xs text-slate-400",children:[c.jsx(C1,{className:"w-3 h-3"})," Read-only during ceremony"]}):O?c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("button",{onClick:()=>P(!1),className:"flex items-center gap-1 px-2 py-1 text-xs text-slate-600 hover:text-slate-900 border border-slate-200 rounded",children:[c.jsx(xn,{className:"w-3 h-3"})," Cancel"]}),c.jsxs("button",{onClick:F,disabled:D,className:"flex items-center gap-1 px-2 py-1 text-xs text-white bg-indigo-600 hover:bg-indigo-700 rounded disabled:opacity-50",children:[c.jsx(v3,{className:"w-3 h-3"})," ",D?"Saving…":"Save"]})]}):c.jsxs("button",{onClick:B,className:"flex items-center gap-1 px-2 py-1 text-xs text-slate-600 hover:text-slate-900 border border-slate-200 rounded",children:[c.jsx(ac,{className:"w-3 h-3"})," Edit"]})}),O?c.jsx("textarea",{className:"w-full h-96 p-3 text-sm font-mono border border-slate-300 rounded focus:outline-none focus:ring-2 focus:ring-indigo-400 resize-y",value:A,onChange:M=>_(M.target.value)}):c.jsx("div",{className:"prose prose-slate max-w-none",children:c.jsx("div",{dangerouslySetInnerHTML:{__html:w}})})]}),c.jsx(Bu,{value:"details",children:c.jsxs("div",{className:"space-y-6",children:[(v==null?void 0:v.created)&&c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500",children:[c.jsx(a3,{className:"w-4 h-4"}),c.jsxs("span",{children:["Created ",new Date(v.created).toLocaleDateString()]})]}),(v==null?void 0:v.parentName)&&(()=>{const M=a==null?void 0:a.find(V=>V.id===v.parentId);return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[c.jsx(yd,{className:"w-4 h-4"}),c.jsx("span",{children:"Parent"})]}),c.jsx(ym,{item:M,fallbackName:v.parentName,fallbackId:v.parentId,onItemClick:i})]})})(),(v==null?void 0:v.epicName)&&e.type!=="epic"&&(()=>{const M=a==null?void 0:a.find(V=>V.id===v.epicId);return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[c.jsx(yd,{className:"w-4 h-4"}),c.jsx("span",{children:"Epic"})]}),c.jsx(ym,{item:M,fallbackName:v.epicName,fallbackId:v.epicId,onItemClick:i})]})})(),(()=>{const M=e.type==="epic"?v==null?void 0:v.features:v==null?void 0:v.acceptance;return!M||M.length===0?null:c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[c.jsx(p3,{className:"w-4 h-4"}),c.jsx("span",{children:"Acceptance Criteria"}),c.jsxs("span",{className:"ml-auto flex items-center gap-1 text-xs font-normal text-slate-400",children:[c.jsx(C1,{className:"w-3 h-3"}),"updated by tests"]})]}),c.jsx("ul",{className:"space-y-1.5",children:M.map((V,ie)=>c.jsxs("li",{className:"flex items-start gap-2.5 text-sm text-slate-700",children:[c.jsx("input",{type:"checkbox",readOnly:!0,disabled:!0,className:"mt-0.5 h-4 w-4 flex-shrink-0 rounded border-slate-300 text-indigo-600 cursor-not-allowed opacity-60"}),c.jsx("span",{className:"leading-snug",children:V})]},ie))})]})})(),(v==null?void 0:v.dependencies)&&v.dependencies.length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[c.jsx(m2,{className:"w-4 h-4"}),c.jsxs("span",{children:["Depends On (",v.dependencies.length,")"]})]}),c.jsx("div",{className:"space-y-2",children:v.dependencies.map(M=>{const V=a==null?void 0:a.find(ie=>ie.id===M);return c.jsx(ym,{item:V,fallbackName:M,fallbackId:M,onItemClick:i},M)})})]})]})}),(v==null?void 0:v.children)&&v.children.length>0&&c.jsx(Bu,{value:"children",children:c.jsx("div",{className:"space-y-2",children:v.children.map(M=>{const V=so(M.status),ie=ud[M.type],fe=a==null?void 0:a.find(te=>te.id===M.id);return c.jsx("button",{onClick:()=>fe&&(i==null?void 0:i(fe)),className:"w-full text-left p-4 border border-slate-200 rounded-lg hover:border-blue-300 hover:bg-blue-50 transition-colors cursor-pointer",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"font-medium text-slate-900 mb-1",children:M.name}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(Ga,{variant:"secondary",className:We("text-xs",(V==null?void 0:V.color)==="green"&&"bg-green-100 text-green-700",(V==null?void 0:V.color)==="blue"&&"bg-blue-100 text-blue-700",(V==null?void 0:V.color)==="yellow"&&"bg-yellow-100 text-yellow-700"),children:[V==null?void 0:V.icon," ",V==null?void 0:V.label]}),c.jsxs(Ga,{variant:"outline",className:"text-xs",children:[ie==null?void 0:ie.icon," ",ie==null?void 0:ie.label]})]})]}),c.jsx(sr,{className:"w-4 h-4 text-slate-400 mt-1 flex-shrink-0"})]})},M.id)})})}),(v==null?void 0:v.functions)&&v.functions.length>0&&c.jsx(Bu,{value:"code",children:c.jsx("div",{className:"space-y-2",children:v.functions.map((M,V)=>c.jsxs("div",{className:"flex items-start gap-3 p-2 rounded-lg border border-slate-200 hover:bg-slate-50",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"text-sm font-mono text-blue-700 truncate",children:M.name}),M.pure&&c.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-medium rounded bg-green-100 text-green-700 border border-green-200",children:"pure"}),M.type==="exported"&&c.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-medium rounded bg-blue-100 text-blue-700 border border-blue-200",children:"export"})]}),c.jsx("div",{className:"text-xs text-slate-500 mt-0.5 truncate",children:M.file}),M.satisfies&&c.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:M.satisfies}),M.task&&c.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:["Task: ",M.task]})]}),M.lines&&c.jsxs("span",{className:"text-xs text-slate-400 whitespace-nowrap",children:[M.lines,"L"]})]},M.name||V))})})]})})]}),r&&c.jsxs("div",{className:"px-6 py-4 border-t border-slate-100 flex items-center justify-between",children:[c.jsxs("button",{onClick:()=>r("prev"),className:"flex items-center gap-2 text-sm text-slate-600 hover:text-slate-900 transition-colors",children:[c.jsx(o3,{className:"w-4 h-4"}),"Previous"]}),c.jsx("span",{className:"text-xs text-slate-400",children:"Use ← → to navigate"}),c.jsxs("button",{onClick:()=>r("next"),className:"flex items-center gap-2 text-sm text-slate-600 hover:text-slate-900 transition-colors",children:["Next",c.jsx(sr,{className:"w-4 h-4"})]})]})]}),Z&&v&&c.jsx(oz,{item:v,refineProgress:(l==null?void 0:l.itemId)===v.id?l:null,refineResult:(u==null?void 0:u.itemId)===v.id?u:null,refineError:(d==null?void 0:d.itemId)===v.id?d:null,onClose:()=>{J(!1),p==null||p()},onAccepted:ne})]})}function sA({agentName:e,onClose:t,onSaved:n,onReset:r}){const[i,a]=b.useState(null),[l,u]=b.useState(""),[d,p]=b.useState(!0),[h,m]=b.useState(!1),[v,x]=b.useState(!1),[w,S]=b.useState(null),[j,k]=b.useState(!1);b.useEffect(()=>{p(!0),S(null),k(!1),eD(e).then(_=>{a(_),u(_.content)}).catch(_=>S(_.message)).finally(()=>p(!1))},[e]);const C=i&&l!==i.content,E=async()=>{if(!(!i||!C)){m(!0),S(null);try{j?(await nD(e),a(_=>({..._,content:_.defaultContent,isCustomized:!1})),k(!1),r==null||r()):(await tD(e,l),a(_=>({..._,content:l,isCustomized:!0})),n==null||n()),x(!0),setTimeout(()=>x(!1),2e3)}catch(_){S(_.message)}finally{m(!1)}}},O=()=>{t()},P=()=>{i!=null&&i.defaultContent&&(u(i.defaultContent),k(!0))},A=(i==null?void 0:i.isCustomized)&&!j;return c.jsx("div",{className:"fixed inset-0 z-[90] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:_=>{_.target===_.currentTarget&&t()},children:c.jsxs("div",{className:"w-full max-w-4xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",style:{height:"85vh"},children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("span",{className:"text-sm font-mono font-medium text-slate-700 truncate",children:e}),(i==null?void 0:i.isCustomized)&&!j&&c.jsx("span",{className:"flex-shrink-0 text-xs font-medium px-1.5 py-0.5 rounded bg-amber-100 text-amber-700",children:"Custom"}),j&&c.jsx("span",{className:"flex-shrink-0 text-xs font-medium px-1.5 py-0.5 rounded bg-blue-100 text-blue-700",children:"Reset pending — save to apply"})]}),c.jsx("button",{type:"button",onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors ml-4 flex-shrink-0","aria-label":"Close",children:c.jsx(xn,{className:"w-4 h-4"})})]}),d?c.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-slate-400",children:[c.jsx("span",{className:"w-4 h-4 border border-slate-300 border-t-slate-600 rounded-full animate-spin mr-2"}),"Loading…"]}):w&&!i?c.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-red-500 px-6 text-center",children:w}):c.jsx("textarea",{value:l,onChange:_=>{u(_.target.value),k(!1)},className:"flex-1 resize-none font-mono text-xs text-slate-800 leading-relaxed px-5 py-4 focus:outline-none",spellCheck:!1}),c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[w&&!d&&c.jsx("p",{className:"text-xs text-red-600",children:w}),v&&c.jsx("p",{className:"text-xs text-green-600 font-medium",children:"Saved ✓"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("button",{type:"button",onClick:P,disabled:!A,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-slate-500 hover:text-amber-600 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:A?"Load default content into editor":"Only available for customized agents",children:[c.jsx(g2,{className:"w-3 h-3"}),"Reset to default"]}),c.jsx("button",{type:"button",onClick:O,className:"px-3 py-1.5 text-xs font-medium text-slate-500 hover:text-slate-700 transition-colors",children:"Cancel"}),c.jsx("button",{type:"button",onClick:E,disabled:!C||h,className:"px-3 py-1.5 text-xs font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40",children:h?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):j?"Save & Reset":"Save"})]})]})]})})}const uz=["critical","major","minor"],Rl={critical:"bg-red-100 text-red-800 border-red-200",major:"bg-amber-100 text-amber-800 border-amber-200",minor:"bg-slate-100 text-slate-600 border-slate-200"};function dz({isCrossRef:e}){const[t,n]=b.useState(!1);return c.jsxs("div",{className:"mb-2",children:[c.jsxs("button",{type:"button",onClick:()=>n(!t),className:"flex items-center gap-1.5 text-[11px] text-blue-600 hover:text-blue-800 transition-colors",children:[c.jsx(Pv,{className:"w-3.5 h-3.5"}),t?"Hide guide":"How micro-checks work & field reference"]}),t&&c.jsxs("div",{className:"mt-2 text-[11px] leading-relaxed text-slate-600 bg-blue-50/60 border border-blue-100 rounded-lg px-4 py-3 space-y-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold text-slate-700 mb-1",children:"How micro-checks are used in ceremonies"}),c.jsxs("p",{children:["During Sprint Planning validation, each epic and story is evaluated by hundreds of small, independent checks instead of a single monolithic LLM call.",e?" Cross-reference checks (Tier 2) run after all domain checks complete. They verify consistency across perspectives — for example, that security requirements match API endpoint access controls, or that database PII fields align with privacy policies.":" Domain checks (Tier 1) run first, in parallel. Each check makes 1–2 short LLM calls: an optional applicability gate, then a YES/NO quality question. Failed checks are scored deterministically and critical/major failures trigger atomic auto-fixes (Tier 3)."]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold text-slate-700 mb-1",children:"Severity levels"}),c.jsxs("ul",{className:"list-none space-y-0.5 ml-1",children:[c.jsxs("li",{children:[c.jsx("span",{className:"font-mono font-semibold text-red-700",children:"critical"})," — Failure blocks the score below 70. A single critical failure caps the score at 60; each additional one drops it by 10. Auto-fix is always attempted."]}),c.jsxs("li",{children:[c.jsx("span",{className:"font-mono font-semibold text-amber-700",children:"major"})," — Failure caps the score between 70–89. Each major failure reduces the cap by 5. Auto-fix is attempted."]}),c.jsxs("li",{children:[c.jsx("span",{className:"font-mono font-semibold text-slate-500",children:"minor"})," — Only minor failures allow scores of 95–100. Minor failures are reported but not auto-fixed."]})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold text-slate-700 mb-1",children:"Field reference"}),c.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 ml-1",children:[c.jsx("dt",{className:"font-mono text-slate-700",children:"severity"}),c.jsx("dd",{children:"How much a failure impacts the score (see above)."}),c.jsx("dt",{className:"font-mono text-slate-700",children:"category"}),c.jsx("dd",{children:'Grouping label for reporting (e.g. "security", "data-modeling"). Helps cluster related failures.'}),!e&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-mono text-slate-700",children:"applicabilityQuestion"}),c.jsx("dd",{children:'Optional gate question asked before the main check. If the LLM answers NO, the check is skipped as not applicable. Leave empty to always run. Example: "Does this epic involve user authentication?"'}),c.jsx("dt",{className:"font-mono text-slate-700",children:"universal"}),c.jsx("dd",{children:"If true, the applicability gate is skipped and the check always runs. Useful for checks that apply to every epic/story regardless of domain."})]}),c.jsx("dt",{className:"font-mono text-slate-700",children:"question"}),c.jsx("dd",{children:'The YES/NO quality question sent to the LLM. A YES answer means the check passes. Write it so that YES = good quality. Example: "Does this story include acceptance criteria that cover error scenarios?"'}),c.jsx("dt",{className:"font-mono text-slate-700",children:"failDescription"}),c.jsx("dd",{children:"Human-readable explanation shown when the check fails. Describes what quality gap was detected."}),c.jsx("dt",{className:"font-mono text-slate-700",children:"failSuggestion"}),c.jsx("dd",{children:"Actionable guidance for the auto-fixer (or a human) on how to address the failure. Be specific — this drives the Tier 3 atomic fix prompt."}),e&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-mono text-slate-700",children:"perspectives"}),c.jsx("dd",{children:'Which domain perspectives this cross-reference check bridges (e.g. ["security", "api"]). Read-only — set in the JSON directly.'}),c.jsx("dt",{className:"font-mono text-slate-700",children:"dependsOn"}),c.jsx("dd",{children:"Tier 1 check IDs whose evidence this check needs. The cross-ref check only runs if all dependencies have results. Read-only — set in the JSON directly."})]})]})]}),c.jsxs("p",{className:"text-[10px] text-slate-400 italic",children:["Customized checks are saved to ",c.jsx("span",{className:"font-mono",children:".avc/customized-agents/checks/"}),' and override the built-in defaults. Use "Reset to default" to revert.']})]})]})}function Vu({label:e,value:t,onChange:n,placeholder:r,rows:i=2}){return c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"text-[11px] font-medium text-slate-500 uppercase tracking-wide",children:e}),c.jsx("textarea",{value:t||"",onChange:a=>n(a.target.value),placeholder:r,rows:i,className:"mt-0.5 w-full text-xs text-slate-800 border border-slate-200 rounded-md px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-blue-400 focus:border-blue-400 resize-none leading-relaxed"})]})}function fz({value:e,onChange:t}){return c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"text-[11px] font-medium text-slate-500 uppercase tracking-wide",children:"Severity"}),c.jsx("select",{value:e||"major",onChange:n=>t(n.target.value),className:"mt-0.5 w-full text-xs border border-slate-200 rounded-md px-2 py-1.5 bg-white text-slate-800 focus:outline-none focus:ring-1 focus:ring-blue-400",children:uz.map(n=>c.jsx("option",{value:n,children:n.charAt(0).toUpperCase()+n.slice(1)},n))})]})}function gl({label:e,value:t}){return c.jsxs("span",{className:"text-[10px] text-slate-400",children:[c.jsxs("span",{className:"font-medium",children:[e,":"]})," ",c.jsx("span",{className:"font-mono text-slate-500",children:t})]})}function pz({check:e,index:t,isCrossRef:n,expanded:r,onToggle:i,onChange:a,onDelete:l}){const u=Rl[e.severity]||Rl.minor,d=(h,m)=>{a(t,{...e,[h]:m})},p=(e.question||"").length>90?e.question.slice(0,90)+"…":e.question||"(no question)";return c.jsxs("div",{className:`border rounded-lg overflow-hidden ${r?"border-blue-200 shadow-sm":"border-slate-200"}`,children:[c.jsxs("button",{type:"button",onClick:i,className:`w-full flex items-center gap-2 px-3 py-2 text-left transition-colors ${r?"bg-blue-50/50":"bg-white hover:bg-slate-50"}`,children:[r?c.jsx(Hr,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}):c.jsx(sr,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}),c.jsx("span",{className:`flex-shrink-0 text-[10px] font-semibold px-1.5 py-0.5 rounded border ${u}`,children:e.severity||"major"}),c.jsx("span",{className:"flex-shrink-0 text-[10px] font-mono text-slate-400",children:e.id}),c.jsx("span",{className:"flex-1 text-xs text-slate-600 truncate min-w-0",children:p})]}),r&&c.jsxs("div",{className:"px-3 pb-3 pt-1 bg-white border-t border-slate-100",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-2 flex-wrap",children:[c.jsx(gl,{label:"id",value:e.id}),e.category&&c.jsx(gl,{label:"category",value:e.category}),n&&e.perspectives&&c.jsx(gl,{label:"perspectives",value:e.perspectives.join(", ")}),n&&e.dependsOn&&c.jsx(gl,{label:"dependsOn",value:e.dependsOn.join(", ")}),!n&&e.universal!==void 0&&c.jsx(gl,{label:"universal",value:e.universal?"yes":"no"})]}),c.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-x-3 gap-y-2",children:[c.jsx("div",{className:"col-span-2 sm:col-span-1",children:c.jsx(fz,{value:e.severity,onChange:h=>d("severity",h)})}),c.jsx("div",{className:"col-span-2 sm:col-span-1",children:c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"text-[11px] font-medium text-slate-500 uppercase tracking-wide",children:"Category"}),c.jsx("input",{type:"text",value:e.category||"",onChange:h=>d("category",h.target.value),className:"mt-0.5 w-full text-xs border border-slate-200 rounded-md px-2.5 py-1.5 text-slate-800 focus:outline-none focus:ring-1 focus:ring-blue-400"})]})})]}),c.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[!n&&!e.universal&&c.jsx(Vu,{label:"Applicability Question",value:e.applicabilityQuestion,onChange:h=>d("applicabilityQuestion",h),placeholder:"When should this check run? (leave empty = always)",rows:2}),c.jsx(Vu,{label:"Question",value:e.question,onChange:h=>d("question",h),placeholder:"The YES/NO quality question asked to the LLM",rows:3}),c.jsx(Vu,{label:"Fail Description",value:e.failDescription,onChange:h=>d("failDescription",h),placeholder:"What's wrong when this check fails",rows:2}),c.jsx(Vu,{label:"Fail Suggestion",value:e.failSuggestion,onChange:h=>d("failSuggestion",h),placeholder:"How to fix the failure",rows:2})]}),c.jsx("div",{className:"mt-3 flex justify-end",children:c.jsxs("button",{type:"button",onClick:()=>l(t),className:"flex items-center gap-1 text-[11px] text-red-500 hover:text-red-700 transition-colors",children:[c.jsx(w3,{className:"w-3 h-3"}),"Remove check"]})})]})]})}function aA({scope:e,perspective:t,onClose:n,onSaved:r,onReset:i}){const[a,l]=b.useState(null),[u,d]=b.useState(null),[p,h]=b.useState([]),[m,v]=b.useState(null),[x,w]=b.useState(!0),[S,j]=b.useState(!1),[k,C]=b.useState(!1),[E,O]=b.useState(null),[P,A]=b.useState(!1),_=e==="cross-refs",D=_?`cross-refs/${t}.json`:`${e}/${t}.json`;b.useEffect(()=>{w(!0),O(null),A(!1),v(null),iD(e,t).then(B=>{l(B);try{const F=JSON.parse(B.content);d(F),h(JSON.parse(JSON.stringify(F.checks||[])))}catch{O("Failed to parse check file")}}).catch(B=>O(B.message)).finally(()=>w(!1))},[e,t]);const $=(()=>{if(!a)return!1;try{const B=JSON.parse(a.content);return JSON.stringify(p)!==JSON.stringify(B.checks||[])}catch{return!1}})(),q=(B,F)=>{h(G=>G.map((W,M)=>M===B?F:W)),A(!1)},X=B=>{h(F=>F.filter((G,W)=>W!==B)),m===B?v(null):m>B&&v(m-1),A(!1)},L=()=>{const F=`${_?"xref":e==="epic"?t.slice(0,3)+"-epic":t.slice(0,3)+"-story"}-${String(p.length+1).padStart(2,"0")}`,G=_?{id:F,tier:2,perspectives:[],severity:"major",category:"consistency",dependsOn:[],question:"",failDescription:"",failSuggestion:""}:{id:F,tier:1,perspective:t,severity:"major",category:"",universal:!1,applicabilityQuestion:"",question:"",failDescription:"",failSuggestion:""};h(W=>[...W,G]),v(p.length),A(!1)},Z=async()=>{if(a){j(!0),O(null);try{if(P){await aD(e,t);const B=JSON.parse(a.defaultContent);d(B),h(JSON.parse(JSON.stringify(B.checks||[]))),l(F=>({...F,content:F.defaultContent,isCustomized:!1})),A(!1),i==null||i()}else{const B={...u,checks:p},F=JSON.stringify(B,null,2);await sD(e,t,F),l(G=>({...G,content:F,isCustomized:!0})),r==null||r()}C(!0),setTimeout(()=>C(!1),2e3)}catch(B){O(B.message)}finally{j(!1)}}},J=()=>{if(a!=null&&a.defaultContent){try{const B=JSON.parse(a.defaultContent);h(JSON.parse(JSON.stringify(B.checks||[])))}catch{}A(!0),v(null)}},ne=(a==null?void 0:a.isCustomized)&&!P,re={critical:0,major:0,minor:0};return p.forEach(B=>{re[B.severity]!==void 0&&re[B.severity]++}),c.jsx("div",{className:"fixed inset-0 z-[90] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:B=>{B.target===B.currentTarget&&n()},children:c.jsxs("div",{className:"w-full max-w-3xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",style:{height:"85vh"},children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-wrap",children:[c.jsx("span",{className:"text-sm font-mono font-medium text-slate-700 truncate",children:D}),c.jsxs("span",{className:"flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded bg-blue-50 text-blue-600",children:[p.length," checks"]}),re.critical>0&&c.jsxs("span",{className:`flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded border ${Rl.critical}`,children:[re.critical," critical"]}),re.major>0&&c.jsxs("span",{className:`flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded border ${Rl.major}`,children:[re.major," major"]}),re.minor>0&&c.jsxs("span",{className:`flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded border ${Rl.minor}`,children:[re.minor," minor"]}),(a==null?void 0:a.isCustomized)&&!P&&c.jsx("span",{className:"flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded bg-amber-100 text-amber-700",children:"Custom"}),P&&c.jsx("span",{className:"flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded bg-blue-100 text-blue-700",children:"Reset pending — save to apply"})]}),c.jsx("button",{type:"button",onClick:n,className:"text-slate-400 hover:text-slate-600 transition-colors ml-4 flex-shrink-0","aria-label":"Close",children:c.jsx(xn,{className:"w-4 h-4"})})]}),x?c.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-slate-400",children:[c.jsx("span",{className:"w-4 h-4 border border-slate-300 border-t-slate-600 rounded-full animate-spin mr-2"}),"Loading…"]}):E&&!a?c.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-red-500 px-6 text-center",children:E}):c.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 px-4 py-3",children:c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx(dz,{isCrossRef:_}),p.map((B,F)=>c.jsx(pz,{check:B,index:F,isCrossRef:_,expanded:m===F,onToggle:()=>v(m===F?null:F),onChange:q,onDelete:X},B.id||F)),c.jsxs("button",{type:"button",onClick:L,className:"flex items-center justify-center gap-1.5 py-2 border-2 border-dashed border-slate-200 rounded-lg text-xs text-slate-400 hover:text-blue-600 hover:border-blue-300 transition-colors",children:[c.jsx(m3,{className:"w-3.5 h-3.5"}),"Add check"]})]})}),c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[E&&!x&&c.jsx("p",{className:"text-xs text-red-600",children:E}),k&&c.jsx("p",{className:"text-xs text-green-600 font-medium",children:"Saved"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("button",{type:"button",onClick:J,disabled:!ne,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-slate-500 hover:text-amber-600 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:ne?"Revert to built-in defaults":"Only available for customized checks",children:[c.jsx(g2,{className:"w-3 h-3"}),"Reset to default"]}),c.jsx("button",{type:"button",onClick:n,className:"px-3 py-1.5 text-xs font-medium text-slate-500 hover:text-slate-700 transition-colors",children:"Cancel"}),c.jsx("button",{type:"button",onClick:Z,disabled:!$&&!P||S,className:"px-3 py-1.5 text-xs font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40",children:S?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):P?"Save & Reset":"Save"})]})]})]})})}const hz={claude:"anthropic",gemini:"gemini",openai:"openai",xiaomi:"xiaomi",local:"local"},lS={claude:"Claude",gemini:"Gemini",openai:"OpenAI",xiaomi:"Xiaomi MiMo",local:"Local LLM",custom:"Custom"};function mz(e){var n,r,i,a,l;const t=new Set;for(const u of Object.values((e==null?void 0:e.stages)||{}))u!=null&&u.provider&&t.add(u.provider);return(n=e==null?void 0:e.validation)!=null&&n.provider&&t.add(e.validation.provider),(i=(r=e==null?void 0:e.validation)==null?void 0:r.documentation)!=null&&i.provider&&t.add(e.validation.documentation.provider),(l=(a=e==null?void 0:e.validation)==null?void 0:a.refinement)!=null&&l.provider&&t.add(e.validation.refinement.provider),t.size===0?(e==null?void 0:e.provider)||null:t.size===1?[...t][0]:"custom"}function gz(e,t){var l,u,d;const n=(l=e.providerPresets)==null?void 0:l[t];if(!n)return e;const r={...e,provider:n.provider,defaultModel:n.defaultModel},i={},a=new Set([...Object.keys(r.stages||{}),...Object.keys(n.stages||{})]);for(const p of a){const h=((u=r.stages)==null?void 0:u[p])??{},m=(d=n.stages)==null?void 0:d[p];m?i[p]={...h,provider:m.provider,model:m.model}:i[p]=h}return r.stages=i,n.validation&&r.validation&&(r.validation={...r.validation,provider:n.validation.provider,model:n.validation.model},n.validation.refinement&&r.validation.refinement&&(r.validation.refinement={...r.validation.refinement,provider:n.validation.refinement.provider,model:n.validation.refinement.model}),n.validation.documentation&&r.validation.documentation&&(r.validation.documentation={...r.validation.documentation,provider:n.validation.documentation.provider,model:n.validation.documentation.model})),r}function vz(e,t){const n={...e,provider:"local",defaultModel:t},r={};for(const[i,a]of Object.entries(n.stages||{}))r[i]={...a,provider:"local",model:t};return n.stages=r,n.validation&&(n.validation={...n.validation,provider:"local",model:t},n.validation.documentation&&(n.validation.documentation={...n.validation.documentation,provider:"local",model:t}),n.validation.refinement&&(n.validation.refinement={...n.validation.refinement,provider:"local",model:t})),n}function xz({ceremonyName:e,ceremonies:t,apiKeys:n,onApplied:r}){const[i,a]=b.useState(!1),[l,u]=b.useState(!1),[d,p]=b.useState(null),[h,m]=b.useState(!1),v=b.useRef(null),x=t==null?void 0:t.find(P=>P.name===e),w=mz(x),S=x==null?void 0:x.providerPresets;if(b.useEffect(()=>{if(!i)return;const P=A=>{v.current&&!v.current.contains(A.target)&&(a(!1),m(!1))};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[i]),b.useEffect(()=>{!i||d!==null||q3().then(P=>p(P.servers||[])).catch(()=>p([]))},[i,d]),!S||Object.keys(S).length===0)return null;const j=Object.keys(S),k=lS[w]||w||"—",C=async P=>{if(!x||P===w){a(!1);return}a(!1),m(!1),u(!0);try{const A=gz(x,P),_=t.map(D=>D.name===e?A:D);await zl(_,null),r(_)}finally{u(!1)}},E=async P=>{if(x){a(!1),m(!1),u(!0);try{const A=vz(x,P),_=t.map(D=>D.name===e?A:D);await zl(_,null),r(_)}finally{u(!1)}}},O=(d||[]).flatMap(P=>P.models.map(A=>({id:A.id,server:P.label})));return c.jsxs("div",{className:"relative",ref:v,children:[c.jsxs("button",{type:"button",disabled:l,onClick:()=>{a(P=>!P),m(!1)},className:"flex items-center gap-1 text-xs px-2 py-1 rounded-md bg-slate-100 hover:bg-slate-200 text-slate-600 hover:text-slate-800 transition-colors disabled:opacity-60",title:"Switch AI provider preset",children:[l?c.jsx("span",{className:"w-3 h-3 border border-slate-400 border-t-slate-700 rounded-full animate-spin"}):c.jsxs("span",{className:"font-medium",children:["⚡ ",k]}),!l&&c.jsx(Hr,{className:"w-3 h-3"})]}),i&&c.jsxs("div",{className:"absolute right-0 mt-1 w-56 bg-white border border-slate-200 rounded-lg shadow-lg z-50 py-1",children:[j.filter(P=>P!=="local").map(P=>{var q;const A=lS[P]||P,_=hz[P],D=((q=n==null?void 0:n[_])==null?void 0:q.isSet)??!1,$=P===w;return c.jsxs("button",{type:"button",onClick:()=>C(P),className:"w-full flex items-center justify-between px-3 py-2 text-sm text-left hover:bg-slate-50 transition-colors",children:[c.jsx("span",{className:$?"font-medium text-slate-900":"text-slate-700",children:A}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[$&&c.jsx($l,{className:"w-3.5 h-3.5 text-blue-500"}),c.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded-full ${D?"bg-green-100 text-green-700":"bg-slate-100 text-slate-400"}`,children:D?"key set":"no key"})]})]},P)}),c.jsx("div",{className:"border-t border-slate-100 my-1"}),c.jsxs("button",{type:"button",onClick:()=>{O.length===1?E(O[0].id):m(P=>!P)},className:"w-full flex items-center justify-between px-3 py-2 text-sm text-left hover:bg-slate-50 transition-colors",children:[c.jsx("span",{className:w==="local"?"font-medium text-slate-900":"text-slate-700",children:"🖥 Local LLM"}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[w==="local"&&c.jsx($l,{className:"w-3.5 h-3.5 text-blue-500"}),d===null?c.jsx("span",{className:"w-3 h-3 border border-slate-300 border-t-slate-500 rounded-full animate-spin"}):O.length>0?c.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-green-100 text-green-700",children:[O.length," model",O.length!==1?"s":""]}):c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-slate-100 text-slate-400",children:"offline"})]})]}),h&&O.length>0&&c.jsx("div",{className:"border-t border-slate-100 bg-slate-50 py-1 max-h-48 overflow-y-auto",children:O.map(P=>c.jsxs("button",{type:"button",onClick:()=>E(P.id),className:"w-full px-4 py-1.5 text-xs text-left hover:bg-slate-100 transition-colors flex items-center justify-between gap-2",children:[c.jsx("span",{className:"text-slate-700 truncate",children:P.id}),c.jsx("span",{className:"text-[10px] text-slate-400 flex-shrink-0",children:P.server})]},`${P.server}-${P.id}`))}),h&&O.length===0&&c.jsx("div",{className:"px-4 py-2 text-xs text-slate-400",children:"No local server detected. Start LM Studio, Ollama, or similar."})]})]})}const yz={"mission-scope-generator":"Mission Scope Generator","mission-scope-validator":"Mission Scope Validator","suggestion-ux-researcher":"UX Researcher","suggestion-product-manager":"Product Manager","suggestion-deployment-architect":"Deployment Architect","suggestion-technical-architect":"Technical Architect","suggestion-security-specialist":"Security Specialist","architecture-recommender":"Architecture Recommender","question-prefiller":"Question Prefiller","project-documentation-creator":"Documentation Creator","validator-documentation":"Documentation Validator","doc-distributor":"Doc Distributor","feature-context-generator":"Feature Context Generator","epic-story-decomposer":"Epic/Story Decomposer","story-scope-reviewer":"Story Scope Reviewer","project-context-extractor":"Project Context Extractor","agent-selector":"Agent Selector","context-writer-epic":"Context Writer (Epic)","context-reviewer-epic":"Context Reviewer (Epic)","context-writer-story":"Context Writer (Story)","context-reviewer-story":"Context Reviewer (Story)","doc-writer-epic":"Doc Writer (Epic)","doc-writer-story":"Doc Writer (Story)","story-doc-enricher":"Story Doc Enricher","validator-selector":"Validator Selector","validator-epic-solution-architect":"Solution Architect (Epic)","validator-epic-developer":"Developer (Epic)","validator-epic-security":"Security (Epic)","validator-epic-backend":"Backend (Epic)","validator-epic-frontend":"Frontend (Epic)","validator-epic-ux":"UX (Epic)","validator-story-developer":"Developer (Story)","validator-story-qa":"QA (Story)","validator-story-test-architect":"Test Architect (Story)","validator-story-solution-architect":"Solution Architect (Story)","validator-story-security":"Security (Story)","validator-story-backend":"Backend (Story)","validator-story-frontend":"Frontend (Story)","validator-story-ux":"UX (Story)","story-splitter":"Story Splitter"},bz=["solution-architect","developer","security","devops","cloud","backend","database","api","frontend","ui","ux","mobile","data","qa","test-architect"],wz={generate:{label:"Generate",cls:"bg-blue-50 text-blue-700 border-blue-200"},validate:{label:"Validate",cls:"bg-amber-50 text-amber-700 border-amber-200"},refine:{label:"Refine",cls:"bg-orange-50 text-orange-700 border-orange-200"},input:{label:"User Input",cls:"bg-purple-50 text-purple-700 border-purple-200"},cross:{label:"Cross-validate",cls:"bg-indigo-50 text-indigo-700 border-indigo-200"},output:{label:"Write",cls:"bg-emerald-50 text-emerald-700 border-emerald-200"},read:{label:"Read",cls:"bg-sky-50 text-sky-700 border-sky-200"},process:{label:"Process",cls:"bg-slate-50 text-slate-600 border-slate-200"}},jz={blue:{dot:"bg-blue-500",label:"text-blue-600"},purple:{dot:"bg-purple-500",label:"text-purple-600"},amber:{dot:"bg-amber-500",label:"text-amber-600"},green:{dot:"bg-green-500",label:"text-green-600"},emerald:{dot:"bg-emerald-500",label:"text-emerald-600"}},cS={amber:{border:"border-amber-400",bg:"bg-amber-50",hdr:"bg-amber-100",hdrBorder:"border-amber-300",text:"text-amber-800",subtext:"text-amber-600",line:"bg-amber-400",chip:"bg-amber-200 text-amber-900",arrow:"text-amber-500",condLine:"bg-amber-300"},indigo:{border:"border-indigo-400",bg:"bg-indigo-50",hdr:"bg-indigo-100",hdrBorder:"border-indigo-300",text:"text-indigo-800",subtext:"text-indigo-600",line:"bg-indigo-400",chip:"bg-indigo-200 text-indigo-900",arrow:"text-indigo-500",condLine:"bg-indigo-300"}};function Sz(e,t){var n,r,i,a,l,u,d,p,h,m,v,x,w,S,j,k,C,E,O,P;return[{id:"mission",label:"Mission & Scope",color:"blue",steps:[{type:"generate",label:"Generate mission statement & initial scope",model:(r=(n=e.stages)==null?void 0:n.suggestions)==null?void 0:r.model,stageKey:"suggestions",agent:"mission-scope-generator"},{type:"loop-group",loopParamType:"missionGen",loop:{max:(t==null?void 0:t.maxIterations)??3,threshold:(t==null?void 0:t.acceptanceThreshold)??95},steps:[{type:"validate",label:"Validate quality against acceptance threshold",model:(i=e.validation)==null?void 0:i.model,validationKey:"top",agent:"mission-scope-validator"},{type:"refine",label:"Refine based on validation issues",model:(l=(a=e.stages)==null?void 0:a.suggestions)==null?void 0:l.model,stageKey:"suggestions",sharedWith:"Mission generator",agent:"mission-scope-generator"}]}]},{id:"questionnaire",label:"Questionnaire",color:"purple",steps:[{type:"input",label:"5 project definition questions (user-provided or skipped)"},{type:"generate",label:"Auto-fill any skipped questions",model:(d=(u=e.stages)==null?void 0:u.suggestions)==null?void 0:d.model,stageKey:"suggestions",sharedWith:"Mission generator",agents:[{slug:"suggestion-product-manager",note:"fills Initial Scope"},{slug:"suggestion-ux-researcher",note:"fills Target Users"},{slug:"suggestion-deployment-architect",note:"fills Deployment Target"},{slug:"suggestion-technical-architect",note:"fills Technical Considerations"},{slug:"suggestion-security-specialist",note:"fills Security & Compliance"}]},{type:"generate",label:"Architecture recommendation",model:(h=(p=e.stages)==null?void 0:p["architecture-recommendation"])==null?void 0:h.model,stageKey:"architecture-recommendation",agent:"architecture-recommender"},{type:"generate",label:"Pre-fill answers from architecture analysis",model:(v=(m=e.stages)==null?void 0:m["question-prefilling"])==null?void 0:v.model,stageKey:"question-prefilling",agent:"question-prefiller"}]},{id:"documentation",label:"Documentation",color:"amber",steps:[{type:"generate",label:"Generate project documentation (doc.md)",model:(w=(x=e.stages)==null?void 0:x.documentation)==null?void 0:w.model,stageKey:"documentation",agent:"project-documentation-creator"},{type:"loop-group",loopParamType:"docContext",loop:{max:((S=e.validation)==null?void 0:S.maxIterations)??100,threshold:((j=e.validation)==null?void 0:j.acceptanceThreshold)??95},steps:[{type:"validate",label:"Validate documentation quality",model:((C=(k=e.validation)==null?void 0:k.documentation)==null?void 0:C.model)??((E=e.validation)==null?void 0:E.model),validationKey:"documentation",agent:"validator-documentation"},{type:"refine",label:"Improve documentation based on issues",model:(P=(O=e.stages)==null?void 0:O.documentation)==null?void 0:P.model,stageKey:"documentation",sharedWith:"Documentation generator",agent:"project-documentation-creator"}]}]},{id:"output",label:"Output",color:"emerald",steps:[{type:"output",label:".avc/project/doc.md written",files:[{name:"project/doc.md",direction:"out"}]}]}]}function Nz(e){var n,r,i,a,l,u,d,p,h,m,v,x,w,S,j,k,C,E,O,P,A,_,D,$,q,X,L,Z,J,ne,re,B;const t=e.defaultModel;return[{id:"scope",label:"Scope Collection",color:"blue",steps:[{type:"read",label:"Read project scope",files:[{name:"project/doc.md",direction:"in",note:".avc/project/doc.md — scope section extracted and sent to decomposer"}]},{type:"read",label:"Analyse existing Epics & Stories (deduplication baseline)"}]},{id:"decomposition",label:"Decomposition",color:"purple",steps:[{type:"generate",label:"Decompose scope into Epics and Stories",model:((r=(n=e.stages)==null?void 0:n.decomposition)==null?void 0:r.model)??t,stageKey:"decomposition",agent:"epic-story-decomposer",files:[{name:"project/doc.md",direction:"in",note:"scope text extracted from doc.md"}]},{type:"generate",label:"Detect semantic duplicates among new epics and against existing on-disk epics — merge overlapping items automatically",model:((a=(i=e.stages)==null?void 0:i.decomposition)==null?void 0:a.model)??t,stageKey:"decomposition",sharedWith:"Decomposer",agent:"duplicate-detector"},{type:"process",label:"Review each Epic's stories and split any that mix too many concerns (one LLM call per Epic in parallel)",model:((u=(l=e.stages)==null?void 0:l.decomposition)==null?void 0:u.model)??t,stageKey:"decomposition",sharedWith:"Decomposer",agent:"story-scope-reviewer"}]},{id:"context-generation",label:"Context Generation",color:"violet",steps:[{type:"generate",label:"Write + independently review each Epic/Story context.md (Write → Review → Refine, up to 3 rounds per item)",model:((p=(d=e.stages)==null?void 0:d["context-generation"])==null?void 0:p.model)??t,stageKey:"context-generation",agents:[{slug:"context-writer-epic",note:"writes epic context.md"},{slug:"context-reviewer-epic",note:"audits epic context against source JSON"},{slug:"context-writer-story",note:"writes story context.md"},{slug:"context-reviewer-story",note:"audits story context against source JSON"}],files:[{name:"{epic}/context.md",direction:"out"},{name:"{story}/context.md",direction:"out"}]}]},{id:"validation",label:"Micro-Check Validation (3-Tier)",color:"amber",steps:[{type:"generate",label:"Extract project context (once) — infers deployment type, tech stack, cloud/mobile presence to filter validators",model:((m=(h=e.stages)==null?void 0:h.validation)==null?void 0:m.model)??t,stageKey:"validation",agent:"project-context-extractor"},{type:"generate",label:"AI-select relevant validators per Epic / Story — excludes inapplicable roles (e.g. cloud if no cloud services). Runs once per Epic, once per Story.",model:((x=(v=e.stages)==null?void 0:v.validation)==null?void 0:x.model)??t,stageKey:"validation",sharedWith:"Validation",agent:"agent-selector"},{type:"validate",label:"Tier 1: Run domain checks per perspective — each check is 1-2 YES/NO LLM calls, run in parallel",model:((S=(w=e.stages)==null?void 0:w.validation)==null?void 0:S.model)??t,stageKey:"validation",sharedWith:"Validation",params:[{key:"concurrency",label:"Parallel checks",value:((k=(j=e.stages)==null?void 0:j.validation)==null?void 0:k.concurrency)??5,min:1,max:20},{key:"batchSize",label:"Checks per batch",value:((E=(C=e.stages)==null?void 0:C.validation)==null?void 0:E.batchSize)??8,min:1,max:20}],checks:bz.flatMap(F=>[{scope:"epic",perspective:F,label:`${F} (Epic)`},{scope:"story",perspective:F,label:`${F} (Story)`}])},{type:"cross",label:"Tier 2: Cross-reference consistency checks — verify perspectives agree (e.g., security ↔ API, database ↔ architecture). Runs after Tier 1 using evidence from domain checks.",model:((P=(O=e.stages)==null?void 0:O.validation)==null?void 0:P.model)??t,stageKey:"validation",sharedWith:"Validation",checks:[{scope:"cross-refs",perspective:"epic",label:"Epic Cross-Refs"},{scope:"cross-refs",perspective:"story",label:"Story Cross-Refs"}]},{type:"refine",label:"Tier 3: Deterministic scoring + auto-fix critical/major failures (atomic per-check fixes with regression revert)",model:((_=(A=e.stages)==null?void 0:A.validation)==null?void 0:_.model)??t,stageKey:"validation",sharedWith:"Validation",params:[{key:"maxFixAttempts",label:"Max fix attempts",value:(($=(D=e.stages)==null?void 0:D.validation)==null?void 0:$.maxFixAttempts)??3,min:0,max:10}]},{type:"process",label:"If story still below threshold with 15+ ACs and scope issues detected: split into 2-3 focused stories, replace in epic, and re-validate each split story",model:((X=(q=e.stages)==null?void 0:q.validation)==null?void 0:X.model)??t,stageKey:"validation",sharedWith:"Validation",agent:"story-splitter"}]},{id:"output",label:"Documentation & Output",color:"emerald",steps:[{type:"process",label:"Renumber hierarchy IDs + write context.md files with final IDs"},{type:"generate",label:"Generate narrative doc.md for each Epic from its canonical context.md",model:((Z=(L=e.stages)==null?void 0:L["doc-generation"])==null?void 0:Z.model)??t,stageKey:"doc-generation",agent:"doc-writer-epic",files:[{name:"project/doc.md",direction:"in",note:"project context"},{name:"{epic}/context.md",direction:"in",note:"canonical spec — single source of truth"},{name:"{epic}/doc.md",direction:"out",note:"narrative documentation"}]},{type:"generate",label:"Generate narrative doc.md for each Story from its canonical context.md",model:((ne=(J=e.stages)==null?void 0:J["doc-generation"])==null?void 0:ne.model)??t,stageKey:"doc-generation",agent:"doc-writer-story",files:[{name:"{epic}/context.md",direction:"in",note:"parent epic context"},{name:"{story}/context.md",direction:"in",note:"canonical spec — single source of truth"},{name:"{story}/doc.md",direction:"out",note:"narrative documentation"}]},{type:"generate",label:"Enrich Story docs with missing implementation detail — API contracts, error tables, DB fields, business rules. Runs once per Story.",model:((B=(re=e.stages)==null?void 0:re.enrichment)==null?void 0:B.model)??t,stageKey:"enrichment",agent:"story-doc-enricher",files:[{name:"{story}/doc.md",direction:"inout",note:"read then overwritten with enriched content"}]},{type:"output",label:"Write Epic & Story work.json files",files:[{name:"{epic}/work.json",direction:"out"},{name:"{story}/work.json",direction:"out"}]}]}]}function kz(e){var t,n,r,i;return[{id:"decompose",label:"Decompose Story",color:"blue",steps:[{type:"read",label:"Read story, epic, and project context"},{type:"generate",label:"Decompose story into tasks and subtasks",model:(n=(t=e==null?void 0:e.stages)==null?void 0:t.decomposition)==null?void 0:n.model,stageKey:"decomposition",agent:"task-subtask-decomposer"},{type:"process",label:"Validate task/subtask structure and IDs (deterministic)"}]},{id:"context-gen",label:"Task Documentation",color:"green",steps:[{type:"generate",label:"Generate context.md for each task and subtask",model:(i=(r=e==null?void 0:e.stages)==null?void 0:r["context-generation"])==null?void 0:i.model,stageKey:"context-generation"},{type:"output",label:"Write work.json, context.md, and doc.md files"}]}]}function Pz(e){var t,n,r,i,a,l;return[{id:"implement",label:"Code Generation",color:"blue",steps:[{type:"read",label:"Create git worktree and read documentation chain"},{type:"generate",label:"AI generates code following traceability rules",model:(n=(t=e==null?void 0:e.stages)==null?void 0:t["code-generation"])==null?void 0:n.model,stageKey:"code-generation",agent:"code-implementer"}]},{id:"validate",label:"Code Validation",color:"amber",steps:[{type:"validate",label:"Verify code against quality and traceability checks",model:(i=(r=e==null?void 0:e.stages)==null?void 0:r["code-validation"])==null?void 0:i.model,stageKey:"code-validation",agent:"code-validator"},{type:"generate",label:"Fix violations and regenerate (if needed, up to 3 iterations)",model:(l=(a=e==null?void 0:e.stages)==null?void 0:a["code-generation"])==null?void 0:l.model,stageKey:"code-generation"}]},{id:"test-merge",label:"Test & Merge",color:"green",steps:[{type:"validate",label:"Run tests in worktree"},{type:"output",label:"Commit, merge to main, update function registry"}]}]}const Cz={"sponsor-call":Sz,"sprint-planning":e=>Nz(e),seed:e=>kz(e),run:e=>Pz(e)};function Oz(e,t){var n;return e?((n=t.find(r=>r.modelId===e))==null?void 0:n.displayName)||e:"—"}function Az({value:e,models:t,onChange:n}){const r=[...new Set(t.map(i=>i.provider))];return c.jsxs("select",{value:e||"",onChange:i=>n(i.target.value),onClick:i=>i.stopPropagation(),className:"text-xs border border-slate-300 rounded px-1.5 py-0.5 bg-white text-slate-800 focus:outline-none focus:ring-1 focus:ring-blue-400 max-w-[200px]",children:[!e&&c.jsx("option",{value:"",children:"— select —"}),r.map(i=>c.jsx("optgroup",{label:i.charAt(0).toUpperCase()+i.slice(1),children:t.filter(a=>a.provider===i).map(a=>c.jsx("option",{value:a.modelId,children:a.displayName||a.modelId},a.modelId))},i))]})}function Ez({slug:e,onOpen:t}){const n=yz[e]||e;return c.jsxs("button",{type:"button",onClick:()=>t(e),className:"inline-flex items-center gap-1 text-[10px] font-medium text-blue-600 hover:text-blue-800 bg-blue-50 hover:bg-blue-100 border border-blue-200 hover:border-blue-300 px-1.5 py-0.5 rounded transition-colors whitespace-nowrap",title:`Edit ${n} agent instructions`,children:[n,c.jsx(ac,{className:"w-2.5 h-2.5 flex-shrink-0"})]})}function Tz({step:e,onOpenAgent:t}){const n=e.agents?e.agents.map(r=>typeof r=="string"?{slug:r,note:null}:r):e.agent?[{slug:e.agent,note:null}]:[];return n.length===0?null:c.jsxs("div",{className:"mt-1.5",children:[c.jsx("span",{className:"text-[10px] text-slate-400 font-medium",children:"Agent(s)"}),c.jsx("div",{className:"mt-1 flex flex-col gap-1",children:n.map(({slug:r,note:i})=>c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx(Ez,{slug:r,onOpen:t}),i&&c.jsx("span",{className:"text-[10px] text-slate-400 italic",children:i})]},r))})]})}function _z({step:e,onOpenCheck:t}){return!e.checks||e.checks.length===0?null:c.jsxs("div",{className:"mt-1.5",children:[c.jsx("span",{className:"text-[10px] text-slate-400 font-medium",children:"Check definitions"}),c.jsx("div",{className:"mt-1 max-h-28 overflow-y-auto border border-slate-100 rounded-md px-1.5 py-1 flex flex-wrap gap-1",children:e.checks.map(n=>c.jsxs("button",{type:"button",onClick:()=>t({scope:n.scope,perspective:n.perspective}),className:"inline-flex items-center gap-1 text-[10px] font-medium text-amber-700 hover:text-amber-900 bg-amber-50 hover:bg-amber-100 border border-amber-200 hover:border-amber-300 px-1.5 py-0.5 rounded transition-colors whitespace-nowrap",title:`Edit ${n.scope}/${n.perspective}.json`,children:[n.label,c.jsx(ac,{className:"w-2.5 h-2.5 flex-shrink-0"})]},`${n.scope}/${n.perspective}`))})]})}function Mz({files:e,className:t=""}){return!e||e.length===0?null:c.jsx("div",{className:`flex items-center gap-1 flex-wrap ${t}`,children:e.map((n,r)=>{const i=n.direction==="in",a=n.direction==="inout",l=a?"bg-purple-50 text-purple-700 border-purple-200":i?"bg-sky-50 text-sky-700 border-sky-200":"bg-emerald-50 text-emerald-700 border-emerald-200",u=a?"↕":i?"←":"→";return c.jsxs("span",{className:`inline-flex items-center gap-0.5 text-[10px] font-mono font-medium px-1.5 py-0.5 rounded border whitespace-nowrap ${l}`,title:n.note,children:[c.jsx("span",{className:"font-sans mr-0.5",children:u}),n.name]},r)})})}function Iz({type:e}){const t=wz[e]||{label:e,cls:"bg-slate-50 text-slate-600 border-slate-200"};return c.jsx("span",{className:`inline-block text-xs font-medium px-2 py-0.5 rounded border whitespace-nowrap ${t.cls}`,children:t.label})}function oA({step:e,models:t,editable:n,onStageModelChange:r,onValidationModelChange:i,onStageParamChange:a,onOpenAgent:l,onOpenCheck:u}){const d=!["input","output","read","process"].includes(e.type),p=n&&!e.sharedWith&&(e.stageKey||e.validationKey);return c.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg px-3 py-2.5 shadow-sm",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"flex-shrink-0",children:c.jsx(Iz,{type:e.type})}),c.jsx(Mz,{files:e.files,className:"flex-1 min-w-0"}),d&&(e.sharedWith?c.jsxs("p",{className:"text-[10px] text-slate-400 italic flex-shrink-0",children:["↑ ",e.sharedWith]}):p?c.jsx(Az,{value:e.model,models:t,onChange:h=>{e.stageKey?r(e.stageKey,h):i(e.validationKey,h)}}):c.jsx("p",{className:"text-[10px] text-slate-400 flex-shrink-0",children:e.note?e.note:Oz(e.model,t)}))]}),c.jsx("p",{className:"text-xs text-slate-700 leading-snug text-left mt-2 pl-1",children:e.label}),c.jsxs("div",{className:"pl-1",children:[c.jsx(Tz,{step:e,onOpenAgent:l}),u&&c.jsx(_z,{step:e,onOpenCheck:u})]}),e.params&&e.params.length>0&&c.jsx("div",{className:"mt-2 pl-1 flex items-center gap-3 flex-wrap",children:e.params.map(h=>c.jsxs("label",{className:"flex items-center gap-1.5 text-[11px] text-slate-600",children:[c.jsxs("span",{className:"font-medium",children:[h.label,":"]}),n&&e.stageKey&&a?c.jsx("input",{type:"number",min:h.min,max:h.max,value:h.value,onChange:m=>a(e.stageKey,h.key,Number(m.target.value)),onClick:m=>m.stopPropagation(),className:"w-12 text-xs border border-slate-300 rounded px-1.5 py-0.5 bg-white text-slate-800 text-center focus:outline-none focus:ring-1 focus:ring-blue-400"}):c.jsx("span",{className:"font-mono",children:h.value})]},h.key))})]})}function Dz({group:e,models:t,editable:n,onStageModelChange:r,onValidationModelChange:i,onStageParamChange:a,onLoopParamChange:l,onOpenAgent:u,onOpenCheck:d}){const{loop:p,steps:h}=e,v=h.some(S=>S.type==="cross")?cS.indigo:cS.amber,x=h.length>1,w=n&&e.loopParamType&&!e.loopParamReadOnly;return c.jsxs("div",{className:`rounded-xl border-2 border-dashed ${v.border} overflow-hidden`,children:[c.jsxs("div",{className:`${v.hdr} border-b-2 border-dashed ${v.hdrBorder} px-3 py-2 flex items-center gap-2 flex-wrap`,children:[c.jsx("span",{className:`text-xl font-black leading-none ${v.text}`,children:"↺"}),c.jsx("span",{className:`text-xs font-bold ${v.text} tracking-wide`,children:"Iteration Loop"}),c.jsxs("div",{className:"ml-auto flex items-center gap-1.5 flex-wrap",children:[p.max!=null&&(w?c.jsxs("label",{className:`text-xs font-semibold ${v.chip} px-2 py-0.5 rounded-full flex items-center gap-1`,children:["up to",c.jsx("input",{type:"number",min:"1",max:"200",value:p.max,onChange:S=>l(e.loopParamType,"maxIterations",Number(S.target.value)),onClick:S=>S.stopPropagation(),className:"w-10 bg-transparent border-b border-current text-center focus:outline-none"}),"iter"]}):c.jsx("span",{className:`text-xs font-semibold ${v.chip} px-2 py-0.5 rounded-full`,children:e.loopParamReadOnly?`↑ ${p.max} iter`:`up to ${p.max} iter`})),p.threshold!=null&&(w?c.jsxs("label",{className:`text-xs font-semibold ${v.chip} px-2 py-0.5 rounded-full flex items-center gap-1`,children:["≥",c.jsx("input",{type:"number",min:"0",max:"100",value:p.threshold,onChange:S=>l(e.loopParamType,"acceptanceThreshold",Number(S.target.value)),onClick:S=>S.stopPropagation(),className:"w-10 bg-transparent border-b border-current text-center focus:outline-none"}),"/100"]}):c.jsx("span",{className:`text-xs font-semibold ${v.chip} px-2 py-0.5 rounded-full`,children:e.loopParamReadOnly?`↑ ≥${p.threshold}/100`:`≥${p.threshold}/100`}))]})]}),c.jsxs("div",{className:`${v.bg} p-3 flex gap-2 items-stretch`,children:[c.jsx("div",{className:"flex-1 flex flex-col",children:h.map((S,j)=>c.jsxs("div",{children:[c.jsx(oA,{step:S,models:t,editable:n,onStageModelChange:r,onValidationModelChange:i,onStageParamChange:a,onOpenAgent:u,onOpenCheck:d}),j<h.length-1&&c.jsxs("div",{className:"flex items-center gap-2 my-1.5 ml-3",children:[c.jsx("div",{className:`w-px h-4 ${v.condLine}`}),c.jsx("span",{className:`text-xs ${v.subtext} italic`,children:"score < threshold → retry"})]})]},j))}),x&&c.jsxs("div",{className:`flex flex-col items-center flex-shrink-0 ${v.arrow}`,style:{width:22},children:[c.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:c.jsx("path",{d:"M2 7 L7 1 L12 7",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}),c.jsx("div",{className:`w-0.5 flex-1 ${v.line} my-1 rounded-full`,style:{minHeight:36}}),c.jsx("span",{className:`text-[9px] font-bold tracking-widest uppercase ${v.text} opacity-70`,style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:"retry"})]})]})]})}function Rz({label:e,color:t}){const n=jz[t]||{dot:"bg-slate-400",label:"text-slate-600"};return c.jsxs("div",{className:"flex items-center gap-2 mt-5 mb-2",children:[c.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${n.dot}`}),c.jsx("span",{className:`text-xs font-semibold uppercase tracking-wide ${n.label}`,children:e})]})}function Lz(){return c.jsx("div",{className:"w-px h-4 bg-slate-200 ml-4"})}function ux({ceremony:e,allCeremonies:t,apiKeys:n,models:r=[],missionGenValidation:i=null,onClose:a,onSave:l,onCeremoniesUpdated:u,readOnly:d=!1}){const[p,h]=b.useState(()=>JSON.parse(JSON.stringify(e||{}))),[m,v]=b.useState(()=>JSON.parse(JSON.stringify(i||{maxIterations:3,acceptanceThreshold:95}))),[x,w]=b.useState(!1),[S,j]=b.useState(null),[k,C]=b.useState(null),[E,O]=b.useState(null),P=e!=null&&e.name?Cz[e.name]:null,A=P?P(p,m):null,_=!d&&!!l,D=(J,ne)=>{const re=r.find(B=>B.modelId===ne);h(B=>{var F,G,W;return{...B,stages:{...B.stages,[J]:{...(F=B.stages)==null?void 0:F[J],model:ne,provider:(re==null?void 0:re.provider)||((W=(G=B.stages)==null?void 0:G[J])==null?void 0:W.provider)||""}}}})},$=(J,ne)=>{const re=r.find(B=>B.modelId===ne);h(J==="top"?B=>{var F;return{...B,validation:{...B.validation,model:ne,provider:(re==null?void 0:re.provider)||((F=B.validation)==null?void 0:F.provider)||""}}}:B=>{var F,G,W;return{...B,validation:{...B.validation,[J]:{...(F=B.validation)==null?void 0:F[J],model:ne,provider:(re==null?void 0:re.provider)||((W=(G=B.validation)==null?void 0:G[J])==null?void 0:W.provider)||""}}}})},q=(J,ne,re)=>{h(B=>{var F;return{...B,stages:{...B.stages,[J]:{...(F=B.stages)==null?void 0:F[J],[ne]:re}}}})},X=(J,ne,re)=>{J==="missionGen"?v(B=>({...B,[ne]:re})):J==="docContext"&&h(B=>({...B,validation:{...B.validation,[ne]:re}}))},L=async()=>{w(!0),j(null);try{await l(p,m),a()}catch{j("Failed to save. Please try again.")}finally{w(!1)}},Z=()=>{h(JSON.parse(JSON.stringify(e||{}))),v(JSON.parse(JSON.stringify(i||{maxIterations:3,acceptanceThreshold:95}))),a()};return c.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[c.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:_?void 0:a}),c.jsxs("div",{className:"relative bg-slate-50 rounded-2xl shadow-2xl w-full max-w-xl mx-4 flex flex-col",style:{height:"85vh"},children:[c.jsxs("div",{className:"flex items-center justify-between px-5 pt-4 pb-3 border-b border-slate-200 flex-shrink-0 bg-white rounded-t-2xl",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-900",children:_?"Configure Models":"Ceremony Workflow"}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:(e==null?void 0:e.displayName)||(e==null?void 0:e.name)||"Unknown ceremony"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[_&&t&&c.jsx(xz,{ceremonyName:e==null?void 0:e.name,ceremonies:t.map(J=>J.name===(e==null?void 0:e.name)?p:J),apiKeys:n,onApplied:J=>{const ne=J.find(re=>re.name===(e==null?void 0:e.name));ne&&h(JSON.parse(JSON.stringify(ne))),u==null||u(J)}}),c.jsx("button",{type:"button",onClick:_?Z:a,className:"text-slate-400 hover:text-slate-600 transition-colors",children:c.jsx(xn,{className:"w-4 h-4"})})]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-5 pb-5",children:A===null?c.jsx("div",{className:"flex items-center justify-center h-32",children:c.jsx("p",{className:"text-sm text-slate-400",children:"Workflow diagram coming soon for this ceremony."})}):A.map((J,ne)=>c.jsxs("div",{children:[c.jsx(Rz,{label:J.label,color:J.color}),J.steps.map((re,B)=>c.jsxs("div",{children:[re.type==="loop-group"?c.jsx(Dz,{group:re,models:r,editable:_,onStageModelChange:D,onValidationModelChange:$,onStageParamChange:q,onLoopParamChange:X,onOpenAgent:C,onOpenCheck:O}):c.jsx(oA,{step:re,models:r,editable:_,onStageModelChange:D,onValidationModelChange:$,onStageParamChange:q,onOpenAgent:C,onOpenCheck:O}),B<J.steps.length-1&&c.jsx(Lz,{})]},B)),ne<A.length-1&&c.jsx("div",{className:"mt-3 border-t border-dashed border-slate-200"})]},J.id))}),_&&c.jsxs("div",{className:"flex-shrink-0 border-t border-slate-200 bg-white rounded-b-2xl px-5 py-3 flex items-center justify-between",children:[c.jsx("div",{children:S&&c.jsx("p",{className:"text-xs text-red-600",children:S})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{type:"button",onClick:Z,className:"px-3 py-1.5 text-sm text-slate-600 hover:text-slate-900 transition-colors",children:"Cancel"}),c.jsx("button",{type:"button",onClick:L,disabled:x,className:"px-4 py-1.5 text-sm font-medium bg-slate-900 text-white rounded-lg hover:bg-slate-700 transition-colors disabled:opacity-40 flex items-center gap-2",children:x?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3.5 h-3.5 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving…"]}):"Save Changes"})]})]})]}),k&&c.jsx(sA,{agentName:`${k}.md`,onClose:()=>C(null)}),E&&c.jsx(aA,{scope:E.scope,perspective:E.perspective,onClose:()=>O(null)})]})}const $z=[{id:"local-mvp",icon:"💻",title:"Local MVP First",subtitle:"Start on your machine, migrate later",bullets:["Zero cloud costs during development","Fast iteration — no deployment delays","SQLite or local PostgreSQL/MongoDB","Docker Compose for production parity"],color:"blue"},{id:"cloud",icon:"☁️",title:"Cloud Deployment",subtitle:"Production-ready from day one",bullets:["Managed infrastructure (AWS / Azure / GCP)","Auto-scaling and high availability","Managed databases with backups","CI/CD pipeline recommendations","Monthly cost estimates included"],color:"purple"}];function zz({onNext:e}){const{strategy:t,setStrategy:n}=ar(),r={blue:{border:"border-blue-500",bg:"bg-blue-50",icon:"text-blue-600",bullet:"bg-blue-500",btn:"bg-blue-600 hover:bg-blue-700"},purple:{border:"border-purple-500",bg:"bg-purple-50",icon:"text-purple-600",bullet:"bg-purple-500",btn:"bg-purple-600 hover:bg-purple-700"}},i=a=>{n(a)};return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Deployment Strategy"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Choose how you want to deploy your project. This shapes architecture and technology recommendations."})]}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:$z.map(a=>{const l=r[a.color],u=t===a.id;return c.jsxs("button",{onClick:()=>i(a.id),className:`text-left rounded-xl border-2 p-5 transition-all ${u?`${l.border} ${l.bg}`:"border-slate-200 hover:border-slate-300 bg-white"}`,children:[c.jsx("div",{className:`text-3xl mb-3 ${l.icon}`,children:a.icon}),c.jsx("div",{className:"font-semibold text-slate-900 text-base",children:a.title}),c.jsx("div",{className:"text-xs text-slate-500 mb-3",children:a.subtitle}),c.jsx("ul",{className:"space-y-1",children:a.bullets.map((d,p)=>c.jsxs("li",{className:"flex items-start gap-2 text-xs text-slate-600",children:[c.jsx("span",{className:`mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 ${l.bullet}`}),d]},p))})]},a.id)})}),c.jsxs("div",{className:"flex items-start gap-2 px-1 py-2 text-xs text-slate-400",children:[c.jsx(Pv,{className:"w-3.5 h-3.5 flex-shrink-0 mt-0.5 text-slate-300"}),c.jsx("p",{children:"Technologies listed (e.g. SQLite, MongoDB) are illustrative examples. The ceremony tailors all recommendations to your actual requirements — your project may end up using a vector database, a search engine, no database at all, or something else entirely."})]}),c.jsxs("div",{className:"flex items-center justify-end gap-3 pt-2",children:[c.jsx("button",{type:"button",onClick:e,className:"text-sm text-slate-400 hover:text-slate-600 transition-colors",children:"Skip — let the model decide"}),c.jsx("button",{type:"button",onClick:e,disabled:!t,className:"px-5 py-2 bg-slate-900 text-white text-sm font-medium rounded-lg disabled:opacity-40 hover:bg-slate-700 transition-colors",children:"Continue"})]})]})}function bm(e=""){return e==="claude"?"anthropic":e}const Fz={claude:"Anthropic API Key (ANTHROPIC_API_KEY)",anthropic:"Anthropic API Key (ANTHROPIC_API_KEY)",gemini:"Google Gemini API Key (GEMINI_API_KEY)",openai:"OpenAI API Key (OPENAI_API_KEY)",xiaomi:"Xiaomi MiMo API Key (XIAOMI_API_KEY)"};function Bz({issues:e,onClose:t,onRefineWithIssues:n}){const[r,i]=b.useState(new Set),a={critical:"text-red-600",major:"text-orange-600",minor:"text-amber-600"},l={critical:"bg-red-50 border-red-100",major:"bg-orange-50 border-orange-100",minor:"bg-amber-50 border-amber-100"};function u(d){i(p=>{const h=new Set(p);return h.has(d)?h.delete(d):h.add(d),h})}return c.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/40 backdrop-blur-sm p-4",onClick:d=>{d.target===d.currentTarget&&t()},children:c.jsxs("div",{className:"w-full max-w-lg bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden max-h-[70vh]",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"Validation Issues"}),c.jsxs("p",{className:"text-xs text-slate-400 mt-0.5",children:[e.length," issue",e.length!==1?"s":""," found during validation"]})]}),c.jsx("button",{type:"button",onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors text-xl leading-none ml-4","aria-label":"Close",children:"×"})]}),c.jsx("ul",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-2",children:e.map((d,p)=>c.jsxs("li",{onClick:()=>u(p),className:`rounded-lg border px-3 py-2.5 cursor-pointer flex items-start gap-2.5 ${r.has(p)?"ring-2 ring-blue-500":""} ${l[d.severity]??"bg-slate-50 border-slate-100"}`,children:[c.jsx("input",{type:"checkbox",checked:r.has(p),onChange:()=>u(p),onClick:h=>h.stopPropagation(),className:"mt-0.5 flex-shrink-0 accent-blue-600"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"flex items-center gap-2 mb-1",children:c.jsx("span",{className:`text-xs font-semibold uppercase ${a[d.severity]??"text-slate-600"}`,children:d.severity})}),c.jsx("p",{className:"text-sm text-slate-800 leading-snug",children:d.description}),d.suggestion&&c.jsxs("p",{className:"text-xs text-slate-500 mt-1 leading-snug",children:[c.jsx("span",{className:"font-medium",children:"Suggestion:"})," ",d.suggestion]})]})]},p))}),c.jsxs("div",{className:"px-5 py-3 border-t border-slate-100 flex-shrink-0 flex items-center justify-between gap-2",children:[c.jsx("button",{type:"button",onClick:()=>{n(e.filter((d,p)=>r.has(p))),t()},disabled:r.size===0,className:"px-4 py-1.5 text-xs text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-40",children:"Refine with selected"}),c.jsx("button",{type:"button",onClick:t,className:"px-4 py-1.5 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Close"})]})]})})}function Vz({onSubmit:e,onClose:t}){const[n,r]=b.useState("");return c.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/40 backdrop-blur-sm p-4",onClick:i=>{i.target===i.currentTarget&&t()},children:c.jsxs("div",{className:"w-full max-w-md bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"Refine Mission & Scope"}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Describe what you'd like to change or improve."})]}),c.jsx("button",{type:"button",onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors text-xl leading-none ml-4","aria-label":"Close",children:"×"})]}),c.jsx("div",{className:"px-5 py-4 flex flex-col gap-3",children:c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"What would you like to change or improve?"}),c.jsx("textarea",{value:n,onChange:i=>r(i.target.value),rows:4,placeholder:"E.g. Focus more on enterprise teams, make the mission mention mobile specifically…",autoFocus:!0,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none"})]})}),c.jsxs("div",{className:"px-5 py-3 border-t border-slate-100 flex-shrink-0 flex items-center justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:t,className:"px-4 py-1.5 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Cancel"}),c.jsx("button",{type:"button",onClick:()=>e(n),disabled:!n.trim(),className:"px-4 py-1.5 text-xs text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-40",children:"Refine"})]})]})})}function Uz({onUse:e,onClose:t,onOpenSettings:n}){var ie,fe;const[r,i]=b.useState([]),[a,l]=b.useState(""),[u,d]=b.useState(""),[p,h]=b.useState(""),[m,v]=b.useState(!1),[x,w]=b.useState(null),[S,j]=b.useState(""),[k,C]=b.useState(!1),[E,O]=b.useState(!1),{missionProgressLog:P,clearMissionProgress:A}=ar(),_=P[P.length-1]??null,[D,$]=b.useState(null);b.useEffect(()=>{Promise.all([ds(),Tn()]).then(([te,le])=>{i(te),$(le.apiKeys??{});const pe=te.filter($e=>{var De,Je;return(Je=(De=le.apiKeys)==null?void 0:De[bm($e.provider)])==null?void 0:Je.isSet}),Se=$e=>/pro|opus|sonnet/i.test($e),H=$e=>/flash|lite|haiku|mini/i.test($e),me=pe.find($e=>Se($e.modelId))||pe[0],Oe=me?me.modelId:te.length>0?te[0].modelId:"";l(Oe);const se=pe.find($e=>H($e.modelId)&&$e.modelId!==Oe)||pe.find($e=>$e.modelId!==Oe)||me;d(se?se.modelId:Oe)}).catch(()=>j("Failed to load available models."))},[]);function q(){Promise.all([Tn(),ds()]).then(([te,le])=>{$(te.apiKeys??{}),i(le)}).catch(()=>{})}b.useEffect(()=>(document.addEventListener("avc:settings-saved",q),()=>document.removeEventListener("avc:settings-saved",q)),[]);const X=r.find(te=>te.modelId===a),L=r.find(te=>te.modelId===u),Z=(()=>{var le,pe;if(!D)return[];const te=new Set;return X&&!((le=D[bm(X.provider)])!=null&&le.isSet)&&te.add(X.provider),L&&!((pe=D[bm(L.provider)])!=null&&pe.isSet)&&te.add(L.provider),[...te]})();async function J(){if(!(!p.trim()||!a||!X||!u||!L)){v(!0),j(""),w(null),C(!1),A();try{const te=await K3(p.trim(),a,X.provider,u,L.provider);w(te)}catch(te){j(te.message||"Generation failed. Please try again.")}finally{v(!1)}}}async function ne(te){const{missionStatement:le,initialScope:pe}=x;O(!1),w(null),v(!0),j(""),C(!1),A();try{const Se=await H3(le,pe,te,a,X.provider,u,L.provider);w(Se)}catch(Se){j(Se.message||"Refinement failed. Please try again.")}finally{v(!1)}}function re(te){C(!1);const le=`Fix the following validation issues:
286
+ `+te.map(pe=>`- [${pe.severity.toUpperCase()}] ${pe.field}: ${pe.description} → ${pe.suggestion}`).join(`
287
+ `);ne(le)}function B(){x&&e(x.missionStatement,x.initialScope)}function F(){w(null),j(""),C(!1)}const G=[...new Set(r.map(te=>te.provider))],W=(x==null?void 0:x.validationScore)!=null&&x.validationScore>=75,M=!m&&p.trim().length>0&&!!a&&!!u&&Z.length===0;function V({label:te,value:le,onChange:pe}){const Se=r.find(H=>H.modelId===le);return c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:te}),c.jsxs("select",{value:le,onChange:H=>pe(H.target.value),disabled:m||r.length===0,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-60 bg-white",children:[r.length===0&&c.jsx("option",{value:"",children:"Loading…"}),G.map(H=>c.jsx("optgroup",{label:H.charAt(0).toUpperCase()+H.slice(1),children:r.filter(me=>me.provider===H).map(me=>c.jsxs("option",{value:me.modelId,children:[me.displayName,me.hasApiKey?"":" (no key)"]},me.modelId))},H))]}),Se&&!Se.hasApiKey&&c.jsxs("p",{className:"text-xs text-amber-600 mt-0.5",children:["⚠ No API key — add to ",c.jsx("code",{children:".env"})]})]})}return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:te=>{te.target===te.currentTarget&&t()},children:c.jsxs("div",{className:"w-full max-w-5xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden h-[540px]",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"✨ Ask a Model"}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Describe your idea — an LLM generates and validates your mission & scope."})]}),c.jsx("button",{type:"button",onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors text-xl leading-none ml-4","aria-label":"Close",children:"×"})]}),c.jsxs("div",{className:"flex flex-1 min-h-0",children:[c.jsxs("div",{className:"w-2/5 min-w-0 border-r border-slate-100 flex flex-col px-4 py-4 gap-3",children:[c.jsx(V,{label:"Generator Model",value:a,onChange:l}),c.jsx(V,{label:"Validator Model",value:u,onChange:d}),Z.length>0&&c.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-amber-50 border border-amber-200 rounded-lg",children:[c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(vi,{className:"w-3.5 h-3.5 text-amber-500 flex-shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold text-amber-900",children:"API Key Missing"}),c.jsx("ul",{className:"mt-1 space-y-0.5",children:Z.map(te=>c.jsxs("li",{className:"flex items-center gap-1.5 text-xs text-amber-800",children:[c.jsx("span",{className:"w-1 h-1 rounded-full bg-amber-400 flex-shrink-0"}),Fz[te]||te]},te))})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[n&&c.jsxs("button",{type:"button",onClick:()=>n(),className:"flex items-center gap-1 text-xs font-medium bg-slate-900 text-white px-2.5 py-1 rounded-md hover:bg-slate-700 transition-colors",children:[c.jsx(to,{className:"w-3 h-3"}),"Settings"]}),c.jsx("button",{type:"button",onClick:q,className:"text-xs text-slate-500 hover:text-slate-800 transition-colors",children:"Re-check"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"What are you building?"}),c.jsx("textarea",{value:p,onChange:te=>h(te.target.value),rows:4,placeholder:"E.g. A recipe sharing app for home cooks…",disabled:m,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none disabled:opacity-60"})]}),S&&c.jsx("p",{className:"text-xs text-red-600 bg-red-50 rounded-md px-2 py-1.5",children:S}),(x==null?void 0:x.validationScore)!=null&&c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsxs("span",{className:`inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full ${W?"bg-green-50 text-green-700 border border-green-200":"bg-amber-50 text-amber-700 border border-amber-200"}`,children:[W?"✓":"⚠"," ",x.validationScore,"/100  · ",x.iterations," iter",x.iterations!==1?"s":""]}),((ie=x.issues)==null?void 0:ie.length)>0&&c.jsxs("button",{type:"button",onClick:()=>C(!0),className:"text-xs text-slate-400 hover:text-slate-600 underline underline-offset-2 transition-colors",children:["Issues (",x.issues.length,")"]})]}),c.jsx("div",{className:"flex-1"}),c.jsxs("div",{className:"flex flex-col gap-2",children:[x?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:B,className:"w-full px-3 py-2 bg-slate-900 text-white text-xs font-medium rounded-lg hover:bg-slate-700 transition-colors",children:"Use This"}),c.jsx("button",{type:"button",onClick:()=>O(!0),className:"w-full px-3 py-2 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Refine"}),c.jsx("button",{type:"button",onClick:F,className:"w-full px-3 py-2 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Try Again"})]}):c.jsx("button",{type:"button",onClick:J,disabled:!M,className:"w-full px-3 py-2 bg-blue-600 text-white text-xs font-medium rounded-lg disabled:opacity-40 hover:bg-blue-700 transition-colors flex items-center justify-center gap-2",children:m?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Generating…"]}):"Generate"}),c.jsx("button",{type:"button",onClick:t,className:"w-full px-3 py-1.5 text-xs text-slate-400 hover:text-slate-600 transition-colors",children:"Cancel"})]})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[m&&c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-8 text-center",children:[c.jsx("span",{className:"w-8 h-8 border-3 border-blue-200 border-t-blue-600 rounded-full animate-spin",style:{borderWidth:3}}),c.jsx("p",{className:"text-sm font-medium text-slate-700",children:_?_.message:"Starting…"}),c.jsx("p",{className:"text-xs text-slate-400",children:"This may take a moment while the models validate and refine the output."})]}),!m&&!x&&c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 px-8 text-center text-slate-300",children:[c.jsx("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})}),c.jsx("p",{className:"text-sm font-medium text-slate-400",children:"Generated mission & scope will appear here"}),c.jsx("p",{className:"text-xs text-slate-300",children:"Fill in the form and click Generate"})]}),!m&&x&&c.jsxs("div",{className:"flex-1 flex flex-col gap-4 px-5 py-4 overflow-y-auto",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Mission Statement"}),c.jsx("p",{className:"text-sm text-slate-800 bg-slate-50 rounded-lg px-3 py-2.5 leading-relaxed",children:x.missionStatement})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[c.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Initial Scope"}),c.jsx("div",{className:"flex-1 text-sm text-slate-800 bg-slate-50 rounded-lg px-3 py-2.5 leading-relaxed overflow-y-auto min-h-0",children:x.initialScope.split(`
288
+ `).map((te,le)=>c.jsx("p",{className:"mb-1 last:mb-0",children:te},le))})]})]})]})]})]})}),k&&((fe=x==null?void 0:x.issues)==null?void 0:fe.length)>0&&c.jsx(Bz,{issues:x.issues,onClose:()=>C(!1),onRefineWithIssues:re}),E&&x&&c.jsx(Vz,{onSubmit:ne,onClose:()=>O(!1)})]})}function Wz({onNext:e,onBack:t,analyzing:n,onOpenSettings:r}){const{mission:i,setMission:a,initialScope:l,setInitialScope:u}=ar(),[d,p]=b.useState(!1),h=i.trim().length>0&&l.trim().length>0;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Mission & Scope"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Describe what your project does and what it will deliver in the first version."})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsxs("label",{className:"block text-sm font-medium text-slate-700",children:["Mission Statement ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx("button",{type:"button",onClick:()=>p(!0),className:"text-xs text-blue-600 hover:text-blue-700 flex items-center gap-1 transition-colors",children:"✨ Ask a Model"})]}),c.jsx("p",{className:"text-xs text-slate-400 mb-2",children:'A concise statement describing the core purpose and value proposition. Example: "Enable small businesses to manage inventory through an intuitive mobile-first platform."'}),c.jsx("textarea",{value:i,onChange:m=>a(m.target.value),rows:3,placeholder:"Enter your mission statement...",className:"w-full rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none"}),!i.trim()&&c.jsx("p",{className:"text-xs text-red-500 mt-1",children:"Mission statement is required."})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:["Initial Scope ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx("p",{className:"text-xs text-slate-400 mb-2",children:'Describe key features, main workflows, and core functionality for the first version. Example: "Users can create tasks, assign them to team members, track progress, and set deadlines."'}),c.jsx("textarea",{value:l,onChange:m=>u(m.target.value),rows:4,placeholder:"Describe the initial scope and features...",className:"w-full rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none"})]})]}),c.jsxs("div",{className:"flex items-center justify-between pt-2",children:[c.jsx("button",{type:"button",onClick:t,disabled:n,className:"text-sm text-slate-400 hover:text-slate-600 disabled:opacity-40 transition-colors",children:"← Back"}),c.jsx("button",{onClick:e,disabled:!h||n,className:"px-5 py-2 bg-slate-900 text-white text-sm font-medium rounded-lg disabled:opacity-40 hover:bg-slate-700 transition-colors flex items-center gap-2",children:n?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Analysing…"]}):"Continue"})]}),d&&c.jsx(Uz,{onUse:(m,v)=>{a(m),u(v),p(!1)},onClose:()=>p(!1),onOpenSettings:r})]})}function qz(e){if(!e)return null;const n=(String(e).toLowerCase().match(/\d+/g)||[]).map(Number).filter(i=>i>0),r=n.length?n.reduce((i,a)=>i+a,0)/n.length:0;return r===0?{symbols:"Free",color:"text-green-600"}:r<=50?{symbols:"$",color:"text-green-600"}:r<=150?{symbols:"$$",color:"text-amber-500"}:r<=350?{symbols:"$$$",color:"text-orange-500"}:{symbols:"$$$$",color:"text-red-500"}}function uS({option:e,type:t,selected:n,onSelect:r}){const i=t==="sql"?"SQL":"NoSQL",u={blue:{badge:"bg-blue-100 text-blue-700",border:"border-blue-500",bg:"bg-blue-50",btn:"ring-blue-500"},emerald:{badge:"bg-emerald-100 text-emerald-700",border:"border-emerald-500",bg:"bg-emerald-50",btn:"ring-emerald-500"}}[t==="sql"?"blue":"emerald"];return c.jsxs("button",{onClick:()=>r(t),className:`text-left rounded-xl border-2 p-5 w-full transition-all ${n?`${u.border} ${u.bg}`:"border-slate-200 hover:border-slate-300 bg-white"}`,children:[c.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[c.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full ${u.badge}`,children:i}),c.jsx("span",{className:"font-semibold text-slate-900",children:e.database})]}),e.specificVersion&&c.jsxs("p",{className:"text-xs text-slate-500 mb-2",children:["Version: ",e.specificVersion]}),e.estimatedCosts&&(()=>{const d=qz(e.estimatedCosts.monthly);return d?c.jsx("p",{className:`text-sm font-semibold mb-2 ${d.color}`,children:d.symbols}):null})(),e.keyStrengths&&e.keyStrengths.length>0&&c.jsxs("div",{className:"mt-2",children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-1",children:"Strengths"}),c.jsx("ul",{className:"space-y-0.5",children:e.keyStrengths.slice(0,3).map((d,p)=>c.jsxs("li",{className:"text-xs text-slate-600 flex items-start gap-1.5",children:[c.jsx("span",{className:"mt-1 w-1 h-1 rounded-full bg-slate-400 flex-shrink-0"}),d]},p))})]}),e.tradeoffs&&c.jsx("p",{className:"text-xs text-slate-400 mt-2 italic",children:e.tradeoffs})]})}function Kz({onNext:e,onBack:t,analyzing:n}){const{dbResult:r,dbChoice:i,setDbChoice:a}=ar();if(!r)return c.jsx("div",{className:"flex items-center justify-center py-16",children:c.jsx("div",{className:"text-center text-slate-400",children:c.jsx("p",{children:"Loading database analysis..."})})});const{comparison:l,rationale:u}=r;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Database Choice"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Choose between SQL and NoSQL based on your project's data needs."}),u&&c.jsx("p",{className:"text-sm text-slate-600 mt-2 bg-slate-50 border border-slate-200 rounded-lg px-3 py-2",children:u})]}),l&&c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsx(uS,{option:l.sqlOption,type:"sql",selected:i==="sql",onSelect:a}),c.jsx(uS,{option:l.nosqlOption,type:"nosql",selected:i==="nosql",onSelect:a})]}),r.keyMetrics&&c.jsxs("div",{className:"rounded-xl border border-slate-200 bg-slate-50 overflow-hidden",children:[c.jsxs("div",{className:"flex items-center gap-1.5 px-4 py-2 border-b border-slate-200 bg-white",children:[c.jsx(p2,{className:"w-3.5 h-3.5 text-slate-400"}),c.jsx("span",{className:"text-xs font-semibold text-slate-500",children:"Project metrics analysed"})]}),c.jsxs("div",{className:"flex divide-x divide-slate-200",children:[r.keyMetrics.estimatedReadWriteRatio&&c.jsxs("div",{className:"flex-1 px-4 py-3",children:[c.jsx("p",{className:"text-[10px] font-medium text-slate-400 uppercase tracking-wide mb-1",children:"Read / Write ratio"}),c.jsx("p",{className:"text-sm font-semibold text-slate-700",children:r.keyMetrics.estimatedReadWriteRatio})]}),r.keyMetrics.expectedThroughput&&c.jsxs("div",{className:"flex-1 px-4 py-3",children:[c.jsx("p",{className:"text-[10px] font-medium text-slate-400 uppercase tracking-wide mb-1",children:"Expected throughput"}),c.jsx("p",{className:"text-sm font-semibold text-slate-700",children:r.keyMetrics.expectedThroughput})]}),r.keyMetrics.dataComplexity&&c.jsxs("div",{className:"flex-1 px-4 py-3",children:[c.jsx("p",{className:"text-[10px] font-medium text-slate-400 uppercase tracking-wide mb-1",children:"Data complexity"}),c.jsx("p",{className:"text-sm font-semibold text-slate-700",children:r.keyMetrics.dataComplexity})]})]})]}),c.jsxs("div",{className:"flex items-start gap-2 px-1 py-2 text-xs text-slate-400",children:[c.jsx(Pv,{className:"w-3.5 h-3.5 flex-shrink-0 mt-0.5 text-slate-300"}),c.jsx("p",{children:"The SQL and NoSQL candidates above are AI-suggested based on your mission and scope — specific technology (e.g. PostgreSQL vs MySQL, MongoDB vs DynamoDB) and configuration will be refined during architecture analysis. Skipping lets the model choose the best fit autonomously, which may include a vector database, a time-series store, or no database at all."})]}),c.jsxs("div",{className:"flex items-center justify-between pt-2",children:[c.jsx("button",{type:"button",onClick:t,disabled:n,className:"text-sm text-slate-400 hover:text-slate-600 disabled:opacity-40 transition-colors",children:"← Back"}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{type:"button",onClick:e,disabled:n,className:"text-sm text-slate-400 hover:text-slate-600 disabled:opacity-40 transition-colors",children:"Skip — let the model decide"}),c.jsx("button",{onClick:e,disabled:!i||n,className:"px-5 py-2 bg-slate-900 text-white text-sm font-medium rounded-lg disabled:opacity-40 hover:bg-slate-700 transition-colors flex items-center gap-2",children:n?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Analyzing..."]}):"Continue"})]})]})]})}function dS(e=""){return e==="claude"?"anthropic":e}const Hz={claude:"Anthropic API Key (ANTHROPIC_API_KEY)",anthropic:"Anthropic API Key (ANTHROPIC_API_KEY)",gemini:"Google Gemini API Key (GEMINI_API_KEY)",openai:"OpenAI API Key (OPENAI_API_KEY)",xiaomi:"Xiaomi MiMo API Key (XIAOMI_API_KEY)"},Gz={Free:"text-green-600",$:"text-green-600",$$:"text-amber-500",$$$:"text-orange-500",$$$$:"text-red-500"};function Yz({onSubmit:e,onClose:t}){const[n,r]=b.useState("");return c.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/40 backdrop-blur-sm p-4",onClick:i=>{i.target===i.currentTarget&&t()},children:c.jsxs("div",{className:"w-full max-w-md bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"Refine Architecture"}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Describe what you'd like to change or improve."})]}),c.jsx("button",{type:"button",onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors text-xl leading-none ml-4","aria-label":"Close",children:"×"})]}),c.jsx("div",{className:"px-5 py-4 flex flex-col gap-3",children:c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"What would you like to change or improve?"}),c.jsx("textarea",{value:n,onChange:i=>r(i.target.value),rows:4,placeholder:"E.g. Make it fully serverless, add edge caching, keep everything local…",autoFocus:!0,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none"})]})}),c.jsxs("div",{className:"px-5 py-3 border-t border-slate-100 flex-shrink-0 flex items-center justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:t,className:"px-4 py-1.5 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Cancel"}),c.jsx("button",{type:"button",onClick:()=>e(n),disabled:!n.trim(),className:"px-4 py-1.5 text-xs text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-40",children:"Refine"})]})]})})}function Xz({onUse:e,onClose:t,onOpenSettings:n}){const[r,i]=b.useState([]),[a,l]=b.useState(""),[u,d]=b.useState(""),[p,h]=b.useState(!1),[m,v]=b.useState(null),[x,w]=b.useState(""),[S,j]=b.useState(!1),[k,C]=b.useState(null);b.useEffect(()=>{Promise.all([ds(),Tn()]).then(([Z,J])=>{i(Z),C(J.apiKeys??{});const ne=Z.filter(F=>{var G,W;return(W=(G=J.apiKeys)==null?void 0:G[dS(F.provider)])==null?void 0:W.isSet}),re=F=>/pro|opus|sonnet/i.test(F),B=ne.find(F=>re(F.modelId))||ne[0];l(B?B.modelId:Z.length>0?Z[0].modelId:"")}).catch(()=>w("Failed to load available models."))},[]);function E(){Tn().then(Z=>C(Z.apiKeys??{})).catch(()=>{})}const O=r.find(Z=>Z.modelId===a),P=(()=>{var J;if(!k||!O)return[];const Z=new Set;return(J=k[dS(O.provider)])!=null&&J.isSet||Z.add(O.provider),[...Z]})();async function A(){if(!(!u.trim()||!a||!O)){h(!0),w(""),v(null);try{const Z=await G3(u.trim(),a,O.provider);v(Z)}catch(Z){w(Z.message||"Generation failed. Please try again.")}finally{h(!1)}}}async function _(Z){j(!1),v(null),h(!0),w("");try{const J=await Y3(m,Z,a,O.provider);v(J)}catch(J){w(J.message||"Refinement failed. Please try again.")}finally{h(!1)}}function D(){m&&e(m)}function $(){v(null),w("")}const q=[...new Set(r.map(Z=>Z.provider))],X=!p&&u.trim().length>0&&!!a&&P.length===0;function L({label:Z,value:J,onChange:ne}){const re=r.find(B=>B.modelId===J);return c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:Z}),c.jsxs("select",{value:J,onChange:B=>ne(B.target.value),disabled:p||r.length===0,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-60 bg-white",children:[r.length===0&&c.jsx("option",{value:"",children:"Loading…"}),q.map(B=>c.jsx("optgroup",{label:B.charAt(0).toUpperCase()+B.slice(1),children:r.filter(F=>F.provider===B).map(F=>c.jsxs("option",{value:F.modelId,children:[F.displayName,F.hasApiKey?"":" (no key)"]},F.modelId))},B))]}),re&&!re.hasApiKey&&c.jsxs("p",{className:"text-xs text-amber-600 mt-0.5",children:["⚠ No API key — add to ",c.jsx("code",{children:".env"})]})]})}return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:Z=>{Z.target===Z.currentTarget&&t()},children:c.jsxs("div",{className:"w-full max-w-5xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden h-[540px]",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"✨ Ask a Model"}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Describe the architecture you need — an LLM will generate it for you."})]}),c.jsx("button",{type:"button",onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors text-xl leading-none ml-4","aria-label":"Close",children:"×"})]}),c.jsxs("div",{className:"flex flex-1 min-h-0",children:[c.jsxs("div",{className:"w-2/5 min-w-0 border-r border-slate-100 flex flex-col px-4 py-4 gap-3",children:[c.jsx(L,{label:"Generator Model",value:a,onChange:l}),P.length>0&&c.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-amber-50 border border-amber-200 rounded-lg",children:[c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(vi,{className:"w-3.5 h-3.5 text-amber-500 flex-shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold text-amber-900",children:"API Key Missing"}),c.jsx("ul",{className:"mt-1 space-y-0.5",children:P.map(Z=>c.jsxs("li",{className:"flex items-center gap-1.5 text-xs text-amber-800",children:[c.jsx("span",{className:"w-1 h-1 rounded-full bg-amber-400 flex-shrink-0"}),Hz[Z]||Z]},Z))})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[n&&c.jsxs("button",{type:"button",onClick:()=>n(),className:"flex items-center gap-1 text-xs font-medium bg-slate-900 text-white px-2.5 py-1 rounded-md hover:bg-slate-700 transition-colors",children:[c.jsx(to,{className:"w-3 h-3"}),"Settings"]}),c.jsx("button",{type:"button",onClick:E,className:"text-xs text-slate-500 hover:text-slate-800 transition-colors",children:"Re-check"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"Describe the architecture you need"}),c.jsx("textarea",{value:u,onChange:Z=>d(Z.target.value),rows:4,placeholder:"E.g. Microservices with Docker, local first, easy to scale to cloud later…",disabled:p,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none disabled:opacity-60"})]}),x&&c.jsx("p",{className:"text-xs text-red-600 bg-red-50 rounded-md px-2 py-1.5",children:x}),c.jsx("div",{className:"flex-1"}),c.jsxs("div",{className:"flex flex-col gap-2",children:[m?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:D,className:"w-full px-3 py-2 bg-slate-900 text-white text-xs font-medium rounded-lg hover:bg-slate-700 transition-colors",children:"Use This"}),c.jsx("button",{type:"button",onClick:()=>j(!0),className:"w-full px-3 py-2 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Refine"}),c.jsx("button",{type:"button",onClick:$,className:"w-full px-3 py-2 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Try Again"})]}):c.jsx("button",{type:"button",onClick:A,disabled:!X,className:"w-full px-3 py-2 bg-blue-600 text-white text-xs font-medium rounded-lg disabled:opacity-40 hover:bg-blue-700 transition-colors flex items-center justify-center gap-2",children:p?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Generating…"]}):"Generate"}),c.jsx("button",{type:"button",onClick:t,className:"w-full px-3 py-1.5 text-xs text-slate-400 hover:text-slate-600 transition-colors",children:"Cancel"})]})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[p&&c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-8 text-center",children:[c.jsx("span",{className:"w-8 h-8 border-3 border-blue-200 border-t-blue-600 rounded-full animate-spin",style:{borderWidth:3}}),c.jsx("p",{className:"text-sm font-medium text-slate-700",children:"Generating architecture…"}),c.jsx("p",{className:"text-xs text-slate-400",children:"The model is crafting a custom architecture based on your description."})]}),!p&&!m&&c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 px-8 text-center text-slate-300",children:[c.jsx("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})}),c.jsx("p",{className:"text-sm font-medium text-slate-400",children:"Custom architecture will appear here"}),c.jsx("p",{className:"text-xs text-slate-300",children:"Fill in the form and click Generate"})]}),!p&&m&&c.jsxs("div",{className:"flex-1 flex flex-col gap-3 px-5 py-4 overflow-y-auto",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsx("span",{className:"font-semibold text-slate-900 text-sm",children:m.name}),m.requiresCloudProvider?c.jsx("span",{className:"text-xs bg-purple-100 text-purple-700 px-2 py-0.5 rounded-full",children:"Cloud"}):c.jsx("span",{className:"text-xs bg-green-100 text-green-700 px-2 py-0.5 rounded-full",children:"Local"})]}),c.jsx("p",{className:"text-xs text-slate-600 leading-relaxed",children:m.description}),m.bestFor&&c.jsxs("p",{className:"text-xs text-slate-500 italic",children:["Best for: ",m.bestFor]}),m.costTier&&c.jsx("p",{className:`text-sm font-semibold ${Gz[m.costTier]??"text-slate-500"}`,children:m.costTier}),m.migrationPath&&c.jsxs("p",{className:"text-xs text-slate-400",children:["Migration: ",m.migrationPath.estimatedMigrationEffort,"(",m.migrationPath.migrationComplexity,")"]})]})]})]})]})}),S&&m&&c.jsx(Yz,{onSubmit:_,onClose:()=>j(!1)})]})}const Qz={Free:"text-green-600",$:"text-green-600",$$:"text-amber-500",$$$:"text-orange-500",$$$$:"text-red-500"};function Jz({arch:e,selected:t,onSelect:n}){return c.jsxs("button",{onClick:()=>n(e),className:`text-left rounded-xl border-2 p-4 w-full transition-all ${t?"border-indigo-500 bg-indigo-50":"border-slate-200 hover:border-slate-300 bg-white"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[c.jsx("span",{className:"font-semibold text-slate-900 text-sm",children:e.name}),e.requiresCloudProvider?c.jsx("span",{className:"text-xs bg-purple-100 text-purple-700 px-2 py-0.5 rounded-full whitespace-nowrap",children:"Cloud"}):c.jsx("span",{className:"text-xs bg-green-100 text-green-700 px-2 py-0.5 rounded-full whitespace-nowrap",children:"Local"})]}),c.jsx("p",{className:"text-xs text-slate-600 mb-2 line-clamp-3",children:e.description}),e.bestFor&&c.jsxs("p",{className:"text-xs text-slate-500 italic",children:["Best for: ",e.bestFor]}),e.costTier&&c.jsx("p",{className:`mt-2 text-sm font-semibold ${Qz[e.costTier]??"text-slate-500"}`,children:e.costTier}),e.migrationPath&&c.jsxs("div",{className:"mt-2 text-xs text-slate-400",children:["Migration to cloud: ",e.migrationPath.estimatedMigrationEffort," (",e.migrationPath.migrationComplexity,")"]})]})}function Zz({onNext:e,onBack:t,analyzing:n,onOpenSettings:r}){const{archOptions:i,selectedArch:a,setSelectedArch:l,setArchOptions:u}=ar(),[d,p]=b.useState(!1);return!i||i.length===0?c.jsx("div",{className:"flex items-center justify-center py-16",children:c.jsx("div",{className:"text-center text-slate-400",children:c.jsx("p",{children:"Loading architecture recommendations..."})})}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Architecture Selection"}),c.jsx("button",{type:"button",onClick:()=>p(!0),disabled:n,className:"text-xs text-blue-600 hover:text-blue-700 flex items-center gap-1 transition-colors disabled:opacity-40",children:"✨ Ask a Model"})]}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Choose the deployment architecture that fits your project best."})]}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:i.map((h,m)=>c.jsx(Jz,{arch:h,selected:a===h,onSelect:l},m))}),c.jsxs("div",{className:"flex items-center justify-between pt-2",children:[c.jsx("button",{type:"button",onClick:t,disabled:n,className:"text-sm text-slate-400 hover:text-slate-600 disabled:opacity-40 transition-colors",children:"← Back"}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{type:"button",onClick:e,disabled:n,className:"text-sm text-slate-400 hover:text-slate-600 disabled:opacity-40 transition-colors",children:"Skip — let the model decide"}),c.jsx("button",{onClick:e,disabled:!a||n,className:"px-5 py-2 bg-slate-900 text-white text-sm font-medium rounded-lg disabled:opacity-40 hover:bg-slate-700 transition-colors flex items-center gap-2",children:n?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Preparing requirements…"]}):"Continue"})]})]}),d&&c.jsx(Xz,{onUse:h=>{u([...i,h]),l(h),p(!1)},onClose:()=>p(!1),onOpenSettings:r})]})}const fS=[{key:"TARGET_USERS",label:"Target Users",description:"Who will use this application? List different user types and their roles.",rows:3,required:!0},{key:"DEPLOYMENT_TARGET",label:"Deployment Target",description:"Where and how will this application be deployed?",rows:3,required:!0},{key:"TECHNICAL_CONSIDERATIONS",label:"Technical Considerations",description:"Technology stack, architectural patterns, scalability, and performance requirements.",rows:4,required:!0},{key:"TECHNICAL_EXCLUSIONS",label:"Technical Exclusions",description:"Technologies, frameworks, or services to explicitly exclude from recommendations. Leave blank if none.",rows:2,required:!1},{key:"SECURITY_AND_COMPLIANCE_REQUIREMENTS",label:"Security & Compliance Requirements",description:"Security, privacy, or regulatory requirements your application must meet. Examples: GDPR compliance, PCI DSS, two-factor authentication.",rows:3,required:!0}];function eF(e=""){return e==="claude"?"anthropic":e}function wm({fieldKey:e,fieldLabel:t,currentValue:n,context:r,onApply:i,onClose:a}){const[l,u]=b.useState([]),[d,p]=b.useState(""),[h,m]=b.useState(""),[v,x]=b.useState(!1),[w,S]=b.useState(null),[j,k]=b.useState("");b.useEffect(()=>{Promise.all([ds(),Tn()]).then(([P,A])=>{var X;u(P);const _=A.apiKeys??{},D=P.filter(L=>{var Z;return(Z=_[eF(L.provider)])==null?void 0:Z.isSet}),$=L=>/pro|opus|sonnet/i.test(L),q=D.find(L=>$(L.modelId))||D[0];p(q?q.modelId:((X=P[0])==null?void 0:X.modelId)||"")}).catch(()=>k("Failed to load models."))},[]);const C=l.find(P=>P.modelId===d),E=[...new Set(l.map(P=>P.provider))];async function O(){if(!(!C||!h.trim())){x(!0),k(""),S(null);try{const P=await X3(e,t,n,h.trim(),r,d,C.provider);S(P.value)}catch(P){k(P.message||"Refinement failed.")}finally{x(!1)}}}return c.jsxs("div",{className:"mt-2 rounded-lg border border-blue-200 bg-blue-50/50 p-3 space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-xs font-semibold text-blue-700",children:["Ask a Model — ",t]}),c.jsx("button",{type:"button",onClick:a,className:"text-xs text-slate-400 hover:text-slate-600",children:"×"})]}),!w&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex gap-2",children:c.jsxs("select",{value:d,onChange:P=>p(P.target.value),disabled:v||l.length===0,className:"flex-1 rounded-md border border-slate-300 px-2 py-1 text-xs text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-60 bg-white",children:[l.length===0&&c.jsx("option",{value:"",children:"Loading…"}),E.map(P=>c.jsx("optgroup",{label:P.charAt(0).toUpperCase()+P.slice(1),children:l.filter(A=>A.provider===P).map(A=>c.jsxs("option",{value:A.modelId,children:[A.displayName,A.hasApiKey?"":" (no key)"]},A.modelId))},P))]})}),c.jsx("textarea",{value:h,onChange:P=>m(P.target.value),rows:2,placeholder:"What would you like to improve? E.g. Be more specific about enterprise users…",disabled:v,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none disabled:opacity-60"}),j&&c.jsx("p",{className:"text-xs text-red-600",children:j}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:a,className:"px-3 py-1 text-xs text-slate-500 hover:text-slate-700",children:"Cancel"}),c.jsx("button",{type:"button",onClick:O,disabled:v||!h.trim()||!d,className:"px-3 py-1 text-xs font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-40 flex items-center gap-1.5",children:v?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Refining…"]}):"Refine"})]})]}),w&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-xs text-slate-700 bg-white rounded-md border border-slate-200 px-2.5 py-2 whitespace-pre-wrap max-h-40 overflow-y-auto",children:w}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>{S(null),m("")},className:"px-3 py-1 text-xs text-slate-500 hover:text-slate-700",children:"Try Again"}),c.jsx("button",{type:"button",onClick:()=>{i(w),a()},className:"px-3 py-1 text-xs font-medium text-white bg-slate-900 rounded-md hover:bg-slate-700",children:"Use This"})]})]})]})}function tF({onNext:e,onBack:t}){const{requirements:n,updateRequirement:r,mission:i,setMission:a,initialScope:l,setInitialScope:u}=ar(),[d,p]=b.useState(null),h={mission:i,scope:l},m=i.trim().length>0&&l.trim().length>0&&fS.filter(x=>x.required).every(x=>{var w;return(w=n[x.key])==null?void 0:w.trim()});function v({fieldKey:x}){return c.jsxs("button",{type:"button",onClick:()=>p(d===x?null:x),className:`inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-md transition-colors ${d===x?"bg-blue-100 text-blue-700":"text-slate-400 hover:text-blue-600 hover:bg-blue-50"}`,title:"Ask a model to improve this field",children:[c.jsx(y3,{className:"w-3 h-3"}),"Ask Model"]})}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Review & Edit Requirements"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"AI has pre-filled these requirements based on your selections. Review and edit as needed."})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[c.jsxs("label",{className:"block text-sm font-medium text-slate-700",children:["Mission Statement ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx(v,{fieldKey:"MISSION_STATEMENT"})]}),c.jsx("textarea",{value:i,onChange:x=>a(x.target.value),rows:3,className:"w-full rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",placeholder:"Required..."}),d==="MISSION_STATEMENT"&&c.jsx(wm,{fieldKey:"MISSION_STATEMENT",fieldLabel:"Mission Statement",currentValue:i,context:h,onApply:x=>a(x),onClose:()=>p(null)})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[c.jsxs("label",{className:"block text-sm font-medium text-slate-700",children:["Initial Scope ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx(v,{fieldKey:"INITIAL_SCOPE"})]}),c.jsx("textarea",{value:l,onChange:x=>u(x.target.value),rows:4,className:"w-full rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",placeholder:"Required..."}),d==="INITIAL_SCOPE"&&c.jsx(wm,{fieldKey:"INITIAL_SCOPE",fieldLabel:"Initial Scope",currentValue:l,context:h,onApply:x=>u(x),onClose:()=>p(null)})]}),c.jsx("hr",{className:"border-slate-200"}),fS.map(x=>c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[c.jsxs("label",{className:"block text-sm font-medium text-slate-700",children:[x.label,x.required&&c.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),c.jsx(v,{fieldKey:x.key})]}),c.jsx("p",{className:"text-xs text-slate-400 mb-1",children:x.description}),c.jsx("textarea",{value:n[x.key]||"",onChange:w=>r(x.key,w.target.value),rows:x.rows,className:"w-full rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",placeholder:x.required?"Required...":"Optional..."}),d===x.key&&c.jsx(wm,{fieldKey:x.key,fieldLabel:x.label,currentValue:n[x.key]||"",context:h,onApply:w=>r(x.key,w),onClose:()=>p(null)})]},x.key))]}),c.jsxs("div",{className:"flex items-center justify-between pt-2",children:[c.jsx("button",{type:"button",onClick:t,className:"text-sm text-slate-400 hover:text-slate-600 transition-colors",children:"← Back"}),c.jsx("button",{onClick:e,disabled:!m,className:"px-5 py-2 bg-green-600 text-white text-sm font-medium rounded-lg disabled:opacity-40 hover:bg-green-700 transition-colors",children:"Generate Project Brief"})]})]})}function nF(e){const t=e==null?void 0:e.match(/Stage\s+(\d+(?:\.\d+)?)\/(\d+)/i);return t?{current:parseFloat(t[1]),total:parseInt(t[2])}:null}function rF(e){const t=[];for(const n of e)if(n.type==="progress")t.push({message:n.message,substeps:[],orphanDetails:[]});else if(n.type==="substep"&&t.length>0)t[t.length-1].substeps.push({text:n.substep,details:[]});else if(n.type==="detail"&&t.length>0){const r=t[t.length-1],i=r.substeps;i.length>0?i[i.length-1].details.push(n.detail):r.orphanDetails.push(n.detail)}return t}function iF({transitioning:e,onPause:t,onResume:n,onCancel:r,onBackground:i}){var P;const{progressLog:a,ceremonyStatus:l,ceremonyError:u,isPaused:d,setWizardStep:p,setCeremonyStatus:h,setCeremonyError:m}=ar(),v=b.useRef(null),[x,w]=b.useState(!1);b.useEffect(()=>{if(e==="cancelling"){w(!1);const A=setTimeout(()=>w(!0),5e3);return()=>clearTimeout(A)}w(!1)},[e]);const S=async()=>{try{await y2()}catch{}h("idle"),m(null),p(1)};b.useEffect(()=>{var A;(A=v.current)==null||A.scrollIntoView({behavior:"smooth"})},[a]),b.useEffect(()=>{l==="complete"&&p(7)},[l,p]);const j=rF(a);let k=null,C=5;for(const A of[...j].reverse()){const _=nF(A.message);if(_){k=_.current,C=_.total;break}}const E=k?Math.round(k/C*100):5,O=((P=j[j.length-1])==null?void 0:P.message)||"Starting ceremony...";if(l==="error"){const A=u==null?void 0:u.includes("already running");return c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Generation Failed"}),c.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:[c.jsx("p",{className:"text-sm font-medium text-red-700 mb-1",children:"Error"}),c.jsx("p",{className:"text-sm text-red-600",children:u||"An unknown error occurred."})]}),A?c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-sm text-slate-500",children:"A ceremony is already running on the server. You can force-stop it and reset the state — this will discard any in-progress work."}),c.jsx("button",{onClick:S,className:"px-4 py-2 text-sm rounded-lg bg-red-600 text-white hover:bg-red-700 transition-colors",children:"Force Stop & Reset"})]}):c.jsxs("p",{className:"text-sm text-slate-500",children:["Check that your API key is configured correctly in your project's ",c.jsx("code",{children:".env"})," file."]})]})}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Generating Documentation"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"The AI is generating your project documentation. Duration varies depending on the number of validation iterations — typically a few minutes, but may take longer."})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("span",{className:"text-xs font-medium text-slate-600",children:O}),c.jsxs("span",{className:"text-xs text-slate-400",children:[E,"%"]})]}),c.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:c.jsx("div",{className:"bg-blue-500 h-2 rounded-full transition-all duration-500",style:{width:`${E}%`}})})]}),c.jsx("div",{className:"bg-slate-900 rounded-lg p-4 h-56 overflow-y-auto font-mono text-xs",children:j.length===0?c.jsx("p",{className:"text-slate-400 animate-pulse",children:"Initializing..."}):c.jsxs("div",{className:"space-y-2",children:[j.map((A,_)=>{var $;const D=_===j.length-1&&l==="running";return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[D?c.jsx("span",{className:"inline-block w-3 h-3 border border-blue-400 border-t-blue-200 rounded-full animate-spin flex-shrink-0"}):c.jsx("span",{className:"text-green-500 flex-shrink-0",children:"✓"}),c.jsx("span",{className:D?"text-blue-300 font-medium":"text-slate-400",children:A.message})]}),(($=A.orphanDetails)==null?void 0:$.length)>0&&c.jsx("div",{className:"ml-5 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:A.orphanDetails.map((q,X)=>c.jsx("p",{className:"text-slate-500",children:q},X))}),A.substeps.length>0&&c.jsx("div",{className:"ml-5 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:A.substeps.map((q,X)=>c.jsxs("div",{children:[c.jsx("p",{className:"text-slate-400",children:q.text}),q.details.length>0&&c.jsx("div",{className:"ml-3 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:q.details.map((L,Z)=>c.jsx("p",{className:"text-slate-500",children:L},Z))})]},X))})]},_)}),e==="cancelling"&&c.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[c.jsx("span",{className:"inline-block w-3 h-3 border border-red-400 border-t-red-200 rounded-full animate-spin flex-shrink-0"}),c.jsx("span",{className:"text-red-400 font-medium",children:"Cancelling…"})]}),c.jsx("div",{ref:v})]})}),c.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2",children:[i&&!e&&c.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-1.5 text-xs font-medium text-slate-500 hover:text-slate-700 bg-slate-50 hover:bg-slate-100 border border-slate-200 rounded-md px-2.5 py-1.5 transition-colors",title:"Hide this window — ceremony keeps running in the background",children:[c.jsx(d2,{className:"w-3.5 h-3.5"}),"Run in Background"]}),e&&c.jsx("span",{}),c.jsxs("div",{className:"flex items-center gap-2",children:[e==="pausing"?c.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-slate-400",children:[c.jsx("span",{className:"inline-block w-3 h-3 border border-slate-400 border-t-slate-200 rounded-full animate-spin"}),"Pausing…"]}):e==="cancelling"?c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-red-400",children:[c.jsx("span",{className:"inline-block w-3 h-3 border border-red-400 border-t-red-200 rounded-full animate-spin"}),"Cancelling…"]}),x&&c.jsx("button",{onClick:S,className:"px-3 py-1.5 text-xs rounded-lg bg-red-600 text-white hover:bg-red-700 transition-colors",children:"Force Stop"})]}):d?c.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-lg border border-amber-300 bg-amber-50 text-amber-700 hover:bg-amber-100 transition-colors",children:"▶ Resume"}):c.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-600 hover:bg-slate-50 transition-colors",children:"⏸ Pause"}),!e&&c.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-lg border border-red-200 text-red-600 hover:bg-red-50 transition-colors",children:"✕ Cancel"})]})]})]})}function sF({severity:e}){const t=e==="critical"?"bg-red-100 text-red-700":e==="major"?"bg-amber-100 text-amber-700":"bg-slate-100 text-slate-500";return c.jsx("span",{className:`flex-shrink-0 px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase ${t}`,children:e})}function aF({path:e}){const t=(e==null?void 0:e.split("/").slice(-2).join("/"))||e;return c.jsxs("span",{className:"inline-flex items-center gap-1 bg-green-50 border border-green-200 text-green-700 text-xs px-2 py-1 rounded-md font-mono",children:[c.jsx("span",{children:"📄"}),t]})}function pS({label:e,value:t}){return c.jsxs("div",{className:"bg-slate-50 rounded-lg border border-slate-200 p-3 text-center",children:[c.jsx("div",{className:"text-lg font-bold text-slate-900",children:t}),c.jsx("div",{className:"text-xs text-slate-500",children:e})]})}function oF({onClose:e}){var p,h,m,v,x,w;const{ceremonyResult:t}=ar(),n=t||{},r=((p=n.tokenUsage)==null?void 0:p.input)||((h=n.tokenUsage)==null?void 0:h.inputTokens)||0,i=((m=n.tokenUsage)==null?void 0:m.output)||((v=n.tokenUsage)==null?void 0:v.outputTokens)||0;(x=n.tokenUsage)!=null&&x.total||(w=n.tokenUsage)!=null&&w.totalTokens||r+i;const a=n.outputPath&&n.contextPath?[n.outputPath,n.contextPath]:n.filesGenerated||[],l=Array.isArray(n.validationIssues)?n.validationIssues:[],u={};for(const S of l){const j=S.ruleId||S.name;u[j]?(u[j].count++,S.iteration&&!u[j].iterations.includes(S.iteration)&&u[j].iterations.push(S.iteration)):u[j]={...S,count:1,iterations:S.iteration?[S.iteration]:[]}}const d=Object.values(u);return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Documentation Generated!"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Your project documentation is ready. The kanban board will refresh automatically."})]}),a.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"Files created"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:a.map((S,j)=>c.jsx(aF,{path:S},j))})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(pS,{label:"Input tokens",value:r.toLocaleString()}),c.jsx(pS,{label:"Output tokens",value:i.toLocaleString()})]}),n.model&&c.jsxs("p",{className:"text-xs text-center text-slate-400",children:["Model: ",c.jsx("span",{className:"font-mono",children:n.model})]}),d.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Quality fixes applied"}),c.jsx("div",{className:"space-y-1.5",children:d.map((S,j)=>{var k;return c.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-md px-3 py-2 text-xs",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(sF,{severity:S.severity}),c.jsx("span",{className:"text-slate-400 flex-shrink-0",children:S.stage}),c.jsx("span",{className:"text-slate-700 font-medium",children:S.name}),S.count>1&&c.jsxs("span",{className:"ml-auto flex-shrink-0 bg-amber-200 text-amber-800 text-[10px] font-bold px-1.5 py-0.5 rounded-full",children:["×",S.count]}),((k=S.iterations)==null?void 0:k.length)>0&&c.jsxs("span",{className:"flex-shrink-0 text-slate-400",children:["iter ",S.iterations.sort((C,E)=>C-E).join(", ")]})]}),S.description&&c.jsx("p",{className:"mt-1 text-slate-500 pl-1",children:S.description})]},j)})})]}),c.jsx("div",{className:"flex justify-center pt-2",children:c.jsx("button",{onClick:e,className:"px-6 py-2 bg-slate-900 text-white text-sm font-medium rounded-lg hover:bg-slate-700 transition-colors",children:"Close"})})]})}const lF={anthropic:"Anthropic API Key (ANTHROPIC_API_KEY)",gemini:"Google Gemini API Key (GEMINI_API_KEY)",openai:"OpenAI API Key (OPENAI_API_KEY)",xiaomi:"Xiaomi MiMo API Key (XIAOMI_API_KEY)"};function jm(e=""){const t=e.toLowerCase();return t==="claude"||t==="anthropic"?"anthropic":t}function hS(e){var i;const t=(i=e.ceremonies)==null?void 0:i.find(a=>a.name==="sponsor-call"),n=new Set;if(t!=null&&t.stages&&typeof t.stages=="object")for(const a of Object.values(t.stages))a!=null&&a.provider&&n.add(jm(a.provider));if(t!=null&&t.validation&&typeof t.validation=="object"){t.validation.provider&&n.add(jm(t.validation.provider));for(const a of Object.values(t.validation))a&&typeof a=="object"&&typeof a.provider=="string"&&n.add(jm(a.provider))}const r=e.apiKeys??{};return[...n].filter(a=>{var l;return a!=="local"&&!((l=r[a])!=null&&l.isSet)})}const mS=[{id:1,label:"Strategy"},{id:2,label:"Mission"},{id:3,label:"Database"},{id:4,label:"Architecture"},{id:5,label:"Review"},{id:6,label:"Generate"},{id:7,label:"Done"}];function cF({currentStep:e,hasDb:t}){const n=t?mS:mS.filter(a=>a.id!==3),i=(a=>!t&&a>=4?a-1:a)(e);return c.jsx("div",{className:"flex items-center gap-1 flex-nowrap overflow-x-auto pb-0.5",children:n.map((a,l)=>{const u=l+1,d=i>u,p=i===u;return c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs("div",{className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full whitespace-nowrap ${p?"bg-blue-600 text-white font-medium":d?"bg-green-100 text-green-700":"bg-slate-100 text-slate-400"}`,children:[d?"✓":u," ",a.label]}),l<n.length-1&&c.jsx("span",{className:"text-slate-300 text-xs",children:"›"})]},a.id)})})}function uF({onClose:e,onOpenSettings:t,costLimitPending:n,onContinuePastCostLimit:r,onCancelFromCostLimit:i}){var js,ei,Ss,mr;const{isOpen:a,wizardStep:l,setWizardStep:u,analyzing:d,setAnalyzing:p,strategy:h,mission:m,initialScope:v,dbResult:x,setDbResult:w,dbChoice:S,archOptions:j,setArchOptions:k,selectedArch:C,applyPrefill:E,requirements:O,ceremonyStatus:P,isPaused:A,setCeremonyStatus:_,setCeremonyResult:D,setCeremonyError:$,appendProgress:q,startRun:X,resetWizard:L,closeWizard:Z,setProcessId:J,setStrategy:ne,setMission:re,setInitialScope:B,setDbChoice:F,setSelectedArch:G,setPrefillResult:W,setRequirements:M}=ar(),[V,ie]=b.useState(""),[fe,te]=b.useState(null),le=(de,_e=null)=>te(de?{message:de,retry:_e}:null),[pe,Se]=b.useState(!1),[H,me]=b.useState(null),[Oe,se]=b.useState(!1),[$e,De]=b.useState(null),[Je,et]=b.useState([]),[Mt,Mn]=b.useState(null),[bn,wn]=b.useState([]),[jn,he]=b.useState({}),[ke,Me]=b.useState({loading:!0,missing:[]}),[Ze,Ct]=b.useState(!1),[It,Dt]=b.useState(null),[un,Ge]=b.useState({ceremonies:[],apiKeys:{}});b.useEffect(()=>{let de=!1;return Tn().then(_e=>{de||(Me({loading:!1,missing:hS(_e)}),Ge(_e))}).catch(()=>{de||Me({loading:!1,missing:[]})}),()=>{de=!0}},[]),b.useEffect(()=>{if(!a||l!==1||P!=="idle")return;let de=!1;return Q3().then(_e=>{!de&&_e&&_e.wizardStep&&_e.wizardStep>1&&(Dt(_e),Ct(!0))}),()=>{de=!0}},[a]);const Rt=b.useCallback(()=>{Me({loading:!0,missing:[]}),Tn().then(de=>Me({loading:!1,missing:hS(de)})).catch(()=>Me({loading:!1,missing:[]}))},[]);b.useEffect(()=>(document.addEventListener("avc:settings-saved",Rt),()=>document.removeEventListener("avc:settings-saved",Rt)),[Rt]);const In=(de={})=>{const _e=ar.getState();J3({wizardStep:_e.wizardStep,strategy:_e.strategy,mission:_e.mission,initialScope:_e.initialScope,dbResult:_e.dbResult,dbChoice:_e.dbChoice,archOptions:_e.archOptions,selectedArch:_e.selectedArch,prefillResult:_e.prefillResult,requirements:_e.requirements,...de}).catch(()=>{})},da=()=>{const de=It;Ct(!1),Dt(null),de&&(de.strategy!=null&&ne(de.strategy),de.mission!=null&&re(de.mission),de.initialScope!=null&&B(de.initialScope),de.dbResult!=null&&w(de.dbResult),de.dbChoice!=null&&F(de.dbChoice),de.archOptions!=null&&k(de.archOptions),de.selectedArch!=null&&G(de.selectedArch),de.prefillResult!=null&&W(de.prefillResult),de.requirements!=null&&M(de.requirements),u(de.wizardStep))},fa=()=>{Ct(!1),Dt(null),D1(),L()},ws=async(de,_e)=>{const Re=(bn.length>0?bn:[de]).map(Ye=>Ye.name===de.name?de:Ye);await zl(Re,{validation:_e}),De(de),Mn(_e),wn(Re)},Jr=()=>{se(!1),Rt()};if(b.useEffect(()=>{H==="pausing"&&A&&me(null)},[A,H]),b.useEffect(()=>{H==="cancelling"&&P==="idle"&&me(null)},[P,H]),!a)return null;const Tr=(x==null?void 0:x.hasDatabaseNeeds)===!0,fr=async()=>{me("pausing");try{await v2()}catch{}},Ii=async()=>{try{await x2()}catch{}},pr=async()=>{Se(!1),me("cancelling");try{await Qa()}catch{}},dn=()=>{P!=="running"&&(Z(),e&&e())},hr=async()=>{le(null),p(!0),ie("Checking database needs…");try{const de=await $3(m,v,h);if(w(de),de.hasDatabaseNeeds)u(3),In({wizardStep:3,dbResult:de});else{ie("Analysing architecture options…");const _e=await M1(m,v,null,h);k(_e),u(4),In({wizardStep:4,dbResult:de,archOptions:_e})}}catch(de){console.error("Mission analysis error:",de),le(de.message,hr)}finally{p(!1),ie("")}},Zr=async()=>{le(null),p(!0),ie("Analysing architecture options…");try{const de=x?{...x,userChoice:S}:null,_e=await M1(m,v,de,h);k(_e),u(4),In({wizardStep:4,archOptions:_e})}catch(de){console.error("Architecture analysis error:",de),le(de.message,Zr)}finally{p(!1),ie("")}},Di=async()=>{le(null),p(!0),ie("Pre-filling requirements from your selections…");try{const de=x?{...x,userChoice:S}:null,_e=await z3(m,v,C,de,h);E(_e,h,m,v),u(5),setTimeout(()=>In({wizardStep:5,prefillResult:_e}),0)}catch(de){console.error("Prefill error:",de),le(de.message,Di)}finally{p(!1),ie("")}},pa=async()=>{D1();try{X(),u(6);const de=await F3(O);de!=null&&de.processId&&J(de.processId)}catch(de){console.error("Run ceremony error:",de),_("error"),$(de.message)}},ha=()=>{switch(l){case 1:return c.jsx(zz,{onNext:()=>{u(2),In({wizardStep:2})}});case 2:return c.jsx(Wz,{onNext:hr,onBack:()=>u(1),analyzing:d,onOpenSettings:t});case 3:return c.jsx(Kz,{onNext:Zr,onBack:()=>u(2),analyzing:d});case 4:return c.jsx(Zz,{onNext:Di,onBack:()=>u(Tr?3:2),analyzing:d,onOpenSettings:t});case 5:return c.jsx(tF,{onNext:pa,onBack:()=>u(4)});case 6:return c.jsx(iF,{transitioning:H,onPause:fr,onResume:Ii,onCancel:()=>Se(!0),onBackground:Z});case 7:return c.jsx(oF,{onClose:dn});default:return null}};return c.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[c.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:l!==6?dn:void 0}),c.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-3xl mx-4 max-h-[90vh] flex flex-col",children:[Ze&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white/90 rounded-2xl",children:c.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Resume previous session?"}),c.jsxs("p",{className:"text-sm text-slate-500",children:["A previous wizard session was saved",It!=null&&It.savedAt?` on ${new Date(It.savedAt).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`:"",". Would you like to continue where you left off?"]}),c.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[c.jsx("button",{onClick:fa,className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Start Fresh"}),c.jsx("button",{onClick:da,className:"px-4 py-2 text-sm rounded-lg bg-blue-600 text-white hover:bg-blue-700",children:"Resume"})]})]})}),n&&c.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-white/90 rounded-2xl",children:c.jsxs("div",{className:"bg-white border border-amber-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[c.jsx("div",{className:"text-3xl",children:"⚠️"}),c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Cost Limit Reached"}),c.jsxs("p",{className:"text-sm text-slate-600",children:[c.jsxs("span",{className:"font-mono font-medium",children:["$",n.cost.toFixed(4)]})," spent",n.threshold!=null&&c.jsxs(c.Fragment,{children:[" (limit: ",c.jsxs("span",{className:"font-mono",children:["$",Number(n.threshold).toFixed(2)]}),")"]})]}),c.jsx("p",{className:"text-sm text-slate-500",children:"The ceremony is paused. What would you like to do?"}),c.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[c.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-lg bg-slate-900 text-white hover:bg-slate-700",children:"Continue Anyway"}),c.jsx("button",{onClick:i,className:"px-4 py-2 text-sm rounded-lg border border-red-200 text-red-600 hover:bg-red-50",children:"Cancel Ceremony"})]}),c.jsx("p",{className:"text-xs text-slate-400",children:"Continue disables cost checking for the rest of this run."})]})}),pe&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white/90 rounded-2xl",children:c.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Stop documentation generation?"}),c.jsx("p",{className:"text-sm text-slate-500",children:"You can restart the ceremony later. Any files written so far will be kept."}),c.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[c.jsx("button",{onClick:()=>Se(!1),className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Keep Running"}),c.jsx("button",{onClick:pr,className:"px-4 py-2 text-sm rounded-lg bg-red-600 text-white hover:bg-red-700",children:"Cancel Run"})]})]})}),c.jsxs("div",{className:"flex items-start justify-between px-6 pt-5 pb-4 border-b border-slate-200 flex-shrink-0",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("h1",{className:"text-base font-semibold text-slate-900",children:"Sponsor Call Ceremony"}),c.jsx("div",{className:"mt-2",children:c.jsx(cF,{currentStep:l,hasDb:Tr})})]}),c.jsxs("div",{className:"flex items-center gap-3 ml-4 mt-0.5 flex-shrink-0",children:[P!=="running"&&c.jsxs("button",{type:"button",onClick:async()=>{var de,_e;try{const[ee,Re]=await Promise.all([Tn(),ds()]),Ye=((de=ee.ceremonies)==null?void 0:de.find(fn=>fn.name==="sponsor-call"))??{};De(Ye),et(Re),Mn(((_e=ee.missionGenerator)==null?void 0:_e.validation)??null),wn(ee.ceremonies||[]),he(ee.apiKeys||{}),se(!0)}catch{}},className:"flex items-center gap-1.5 text-xs font-medium text-slate-500 hover:text-blue-600 bg-slate-50 hover:bg-blue-50 border border-slate-200 hover:border-blue-200 rounded-md px-2.5 py-1.5 transition-colors whitespace-nowrap",title:"Configure ceremony models",children:[c.jsx(to,{className:"w-3.5 h-3.5"}),"Select Model(s)"]}),P!=="running"&&c.jsx("button",{onClick:dn,className:"text-slate-400 hover:text-slate-600 transition-colors",children:c.jsx(xn,{className:"w-5 h-5"})})]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:ke.loading?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"})}):ke.missing.length>0?c.jsxs("div",{className:"flex flex-col gap-5",children:[c.jsxs("div",{className:"flex items-start gap-3 p-4 bg-amber-50 border border-amber-200 rounded-lg",children:[c.jsx(vi,{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-amber-900",children:"API Keys Required"}),c.jsx("p",{className:"text-xs text-amber-700 mt-1",children:"Configure the following API keys before running the Sponsor Call ceremony:"}),c.jsx("ul",{className:"mt-2 space-y-1.5",children:ke.missing.map(de=>c.jsxs("li",{className:"flex items-center gap-2 text-xs text-amber-800",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 flex-shrink-0"}),lF[de]||de]},de))})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("button",{onClick:()=>t==null?void 0:t(),className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium bg-slate-900 text-white rounded-lg hover:bg-slate-700 transition-colors",children:[c.jsx(to,{className:"w-4 h-4"}),"Open Settings"]}),c.jsx("button",{onClick:Rt,className:"px-3 py-2 text-sm text-slate-500 hover:text-slate-800 transition-colors",children:"Re-check"})]})]}):ha()}),fe&&c.jsx("div",{className:"flex-shrink-0 border-t border-red-200 bg-red-50 px-6 py-3",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"text-red-500 flex-shrink-0 mt-0.5 text-sm",children:"✕"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[(js=fe.message)!=null&&js.includes("n_keep")||(ei=fe.message)!=null&&ei.includes("n_ctx")||(Ss=fe.message)!=null&&Ss.includes("context length")||(mr=fe.message)!=null&&mr.includes("context_length")?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-xs font-medium text-red-700",children:"Context length exceeded"}),c.jsx("p",{className:"text-xs text-red-600 mt-0.5",children:"The prompt is too large for this model's context window. Increase the context length in your local server (e.g. LM Studio → Model Settings → Context Length), then click Retry."})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-xs font-medium text-red-700",children:"Analysis failed"}),c.jsx("p",{className:"text-xs text-red-600 mt-0.5 break-words",children:fe.message})]}),c.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[fe.retry&&c.jsx("button",{type:"button",onClick:()=>{const de=fe.retry;le(null),de()},className:"text-xs font-medium text-white bg-red-600 hover:bg-red-700 px-3 py-1 rounded transition-colors",children:"Retry"}),c.jsx("button",{type:"button",onClick:()=>le(null),className:"text-xs font-medium text-red-700 hover:text-red-900 underline underline-offset-2",children:"Dismiss"})]})]})]})}),c.jsxs("div",{className:"flex-shrink-0 border-t border-slate-100 px-6 h-8 flex items-center gap-2",children:[V&&c.jsx("span",{className:"w-3 h-3 border-2 border-blue-300 border-t-blue-600 rounded-full animate-spin flex-shrink-0"}),c.jsx("p",{className:`text-xs truncate ${V?"text-blue-600 font-medium":"text-slate-400"}`,children:V})]})]}),Oe&&$e&&c.jsx(ux,{ceremony:$e,allCeremonies:bn,apiKeys:jn,models:Je,missionGenValidation:Mt,readOnly:P==="running",onSave:P!=="running"?ws:void 0,onClose:Jr,onCeremoniesUpdated:de=>{wn(de);const _e=de.find(ee=>ee.name==="sponsor-call");_e&&De(_e)}})]})}const gS=[{id:1,label:"Ready"},{id:2,label:"Running"},{id:3,label:"Select Epics/Stories"},{id:4,label:"Complete"}];function dF({currentStep:e}){return c.jsx("div",{className:"flex items-center gap-1 flex-nowrap",children:gS.map((t,n)=>{const r=e>t.id,i=e===t.id;return c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs("div",{className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full ${i?"bg-blue-600 text-white font-medium":r?"bg-green-100 text-green-700":"bg-slate-100 text-slate-400"}`,children:[r?"✓":t.id," ",t.label]}),n<gS.length-1&&c.jsx("span",{className:"text-slate-300 text-xs",children:"›"})]},t.id)})})}function vS({label:e,value:t}){return c.jsxs("div",{className:"bg-slate-50 rounded-lg border border-slate-200 p-3 text-center",children:[c.jsx("div",{className:"text-lg font-bold text-slate-900",children:t}),c.jsx("div",{className:"text-xs text-slate-500",children:e})]})}function fF({onStart:e,onResume:t,resumeInfo:n}){return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Ready to Plan"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"AI will decompose your project documentation into Epics and Stories using multi-agent analysis."})]}),n&&c.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 space-y-2",children:[c.jsx("p",{className:"text-sm font-medium text-amber-800",children:"Previous run can be resumed"}),c.jsxs("p",{className:"text-xs text-amber-600",children:["Stopped at: ",c.jsx("span",{className:"font-medium",children:n.checkpointLabel}),n.epics>0&&c.jsxs(c.Fragment,{children:[" · ",n.epics," epics on disk"]})]}),n.timestamp&&c.jsx("p",{className:"text-xs text-amber-500",children:new Date(n.timestamp).toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-end gap-3 pt-2",children:[n&&c.jsx("button",{onClick:t,className:"px-5 py-2 text-sm font-medium bg-amber-600 text-white rounded-lg hover:bg-amber-500 transition-colors",children:"Resume"}),c.jsx("button",{onClick:e,className:`px-5 py-2 text-sm font-medium rounded-lg transition-colors ${n?"border border-slate-200 text-slate-700 hover:bg-slate-50":"bg-slate-900 text-white hover:bg-slate-700"}`,children:n?"Start Fresh":"Start"})]})]})}function xS(e){const t=e==null?void 0:e.match(/Stage\s+(\d+(?:\.\d+)?)\/(\d+)/i);return t?{current:parseFloat(t[1]),total:parseInt(t[2])}:null}function pF(e){const t=e==null?void 0:e.match(/\((\d+)\s+epics?,\s*(\d+)\s+stories?\)/i);if(t)return{total:parseInt(t[1])+parseInt(t[2])};const n=e==null?void 0:e.match(/\((\d+)\s+stories?\)/i);return n?{total:parseInt(n[1])}:null}function hF(e){const t=[];for(const n of e)if(n.type==="progress")t.push({message:n.message,substeps:[],orphanDetails:[]});else if(n.type==="substep"&&t.length>0)t[t.length-1].substeps.push({text:n.substep,details:[]});else if(n.type==="detail"&&t.length>0){const r=t[t.length-1],i=r.substeps;i.length>0?i[i.length-1].details.push(n.detail):r.orphanDetails.push(n.detail)}return t}function mF({transitioning:e,onPause:t,onResume:n,onCancel:r,onBackground:i}){var E;const{progressLog:a,status:l,error:u,isPaused:d,setStatus:p,setStep:h,setError:m}=xo(),v=b.useRef(null),x=async()=>{try{await y2()}catch{}p("idle"),h(1),m(null)};b.useEffect(()=>{var O;(O=v.current)==null||O.scrollIntoView({behavior:"smooth"})},[a]);const w=hF(a),S={"1/6":[0,3],"2/6":[3,7],"3/6":[7,12],"4/6":[12,22],"4.5/6":[22,24],"5/6":[24,76],"6/7":[76,90],"7/7":[90,100]},j=[...w].reverse().find(O=>xS(O.message));let k=5;if(j){const O=xS(j.message),P=`${O.current}/${O.total}`,[A,_]=S[P]??[0,90],D=pF(j.message);if(D&&D.total>0){let $=0;P==="5/6"?$=j.substeps.filter(X=>{var L;return(L=X.text)==null?void 0:L.includes("Validating ")}).length:P==="6/7"?$=j.substeps.filter(X=>{var L;return(L=X.text)==null?void 0:L.includes("Distributing documentation")}).length:P==="7/7"&&($=j.substeps.filter(X=>{var L;return(L=X.text)==null?void 0:L.includes("Enriching documentation")}).length);const q=Math.min($,D.total)/D.total;k=Math.round(A+q*(_-A))}else k=A}const C=((E=w[w.length-1])==null?void 0:E.message)||"Starting…";if(l==="error"){const O=u==null?void 0:u.includes("already running");return c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Sprint Planning Failed"}),c.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:[c.jsx("p",{className:"text-sm font-medium text-red-700 mb-1",children:"Error"}),c.jsx("p",{className:"text-sm text-red-600",children:u||"An unknown error occurred."})]}),O?c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-sm text-slate-500",children:"A ceremony is already running on the server. You can force-stop it and reset the state — this will discard any in-progress work."}),c.jsx("button",{onClick:x,className:"px-4 py-2 text-sm rounded-lg bg-red-600 text-white hover:bg-red-700 transition-colors",children:"Force Stop & Reset"})]}):u==="Not found"?c.jsxs("div",{className:"space-y-3",children:[c.jsxs("p",{className:"text-sm text-slate-500",children:["The server may be running an older version. Run"," ",c.jsx("code",{className:"bg-slate-100 px-1 rounded",children:"/kanban"})," in the AVC terminal to restart it, then try again."]}),c.jsx("button",{onClick:x,className:"px-4 py-2 text-sm rounded-lg bg-slate-600 text-white hover:bg-slate-700 transition-colors",children:"Cancel & Retry"})]}):c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-sm text-slate-500",children:"You can dismiss this error and start a new sprint planning session."}),c.jsx("button",{onClick:x,className:"px-4 py-2 text-sm rounded-lg bg-slate-600 text-white hover:bg-slate-700 transition-colors",children:"Cancel & Retry"})]})]})}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Running Sprint Planning"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"The AI is decomposing your project scope and validating each work item. Duration varies with project size and validation iterations — from a few minutes to 30+ minutes for larger projects."})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("span",{className:"text-xs font-medium text-slate-600",children:C}),c.jsxs("span",{className:"text-xs text-slate-400",children:[k,"%"]})]}),c.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:c.jsx("div",{className:"bg-blue-500 h-2 rounded-full transition-all duration-500",style:{width:`${k}%`}})})]}),c.jsx("div",{className:"bg-slate-900 rounded-lg p-4 h-64 overflow-y-auto font-mono text-xs",children:w.length===0?c.jsx("p",{className:"text-slate-400 animate-pulse",children:"Initializing…"}):c.jsxs("div",{className:"space-y-2",children:[w.map((O,P)=>{var _;const A=P===w.length-1&&l==="running";return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[A?c.jsx("span",{className:"inline-block w-3 h-3 border border-blue-400 border-t-blue-200 rounded-full animate-spin flex-shrink-0"}):c.jsx("span",{className:"text-green-500 flex-shrink-0",children:"✓"}),c.jsx("span",{className:A?"text-blue-300 font-medium":"text-slate-400",children:O.message})]}),((_=O.orphanDetails)==null?void 0:_.length)>0&&c.jsx("div",{className:"ml-5 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:O.orphanDetails.map((D,$)=>c.jsx("p",{className:"text-slate-500",children:D},$))}),O.substeps.length>0&&c.jsx("div",{className:"ml-5 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:O.substeps.map((D,$)=>c.jsxs("div",{children:[c.jsx("p",{className:"text-slate-400",children:D.text}),D.details.length>0&&c.jsx("div",{className:"ml-3 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:D.details.map((q,X)=>c.jsx("p",{className:"text-slate-500",children:q},X))})]},$))})]},P)}),e==="cancelling"&&c.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[c.jsx("span",{className:"inline-block w-3 h-3 border border-red-400 border-t-red-200 rounded-full animate-spin flex-shrink-0"}),c.jsx("span",{className:"text-red-400 font-medium",children:"Cancelling…"})]}),c.jsx("div",{ref:v})]})}),c.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2",children:[i&&!e?c.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-1.5 text-xs font-medium text-slate-500 hover:text-slate-700 bg-slate-50 hover:bg-slate-100 border border-slate-200 rounded-md px-2.5 py-1.5 transition-colors",title:"Hide this window — ceremony keeps running in the background",children:[c.jsx(d2,{className:"w-3.5 h-3.5"}),"Run in Background"]}):c.jsx("span",{}),c.jsxs("div",{className:"flex items-center gap-2",children:[e==="pausing"?c.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-slate-400",children:[c.jsx("span",{className:"inline-block w-3 h-3 border border-slate-400 border-t-slate-200 rounded-full animate-spin"}),"Pausing…"]}):e==="cancelling"?c.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-red-400",children:[c.jsx("span",{className:"inline-block w-3 h-3 border border-red-400 border-t-red-200 rounded-full animate-spin"}),"Cancelling…"]}):d?c.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-lg border border-amber-300 bg-amber-50 text-amber-700 hover:bg-amber-100 transition-colors",children:"▶ Resume"}):c.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-600 hover:bg-slate-50 transition-colors",children:"⏸ Pause"}),!e&&c.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-lg border border-red-200 text-red-600 hover:bg-red-50 transition-colors",children:"✕ Cancel"})]})]})]})}const gF=[{stage:"Project Documentation",ruleId:"fix-header-formatting",name:"Fix Header Spacing",severity:"major"},{stage:"Project Documentation",ruleId:"add-section-spacing",name:"Add Section Spacing",severity:"minor"},{stage:"Project Context",ruleId:"token-count-too-short",name:"Expand If Too Short",severity:"major"},{stage:"Project Context",ruleId:"no-redundant-info",name:"Remove Truly Redundant Information",severity:"minor"},{stage:"Context Validation",ruleId:"fix-unclosed-code-blocks",name:"Fix Unclosed Code Blocks",severity:"major"}];function vF({severity:e}){const t=e==="critical"?"bg-red-100 text-red-700":e==="major"?"bg-amber-100 text-amber-700":"bg-slate-100 text-slate-500";return c.jsx("span",{className:`flex-shrink-0 px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase ${t}`,children:e})}function xF({onClose:e}){var a,l;const{result:t}=xo(),n=t||{},r=((a=n.tokenUsage)==null?void 0:a.input)||0,i=((l=n.tokenUsage)==null?void 0:l.output)||0;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-5xl mb-3",children:"✅"}),c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Sprint Planning Complete"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Your project has been decomposed into Epics and Stories. The kanban board will refresh."})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3 text-center",children:[c.jsxs("div",{className:"bg-slate-50 rounded-lg border border-slate-200 p-3",children:[c.jsx("div",{className:"text-2xl font-bold text-slate-900",children:n.epicsCreated??0}),c.jsx("div",{className:"text-xs text-slate-500",children:"Epics created"})]}),c.jsxs("div",{className:"bg-slate-50 rounded-lg border border-slate-200 p-3",children:[c.jsx("div",{className:"text-2xl font-bold text-slate-900",children:n.storiesCreated??0}),c.jsx("div",{className:"text-xs text-slate-500",children:"Stories created"})]})]}),(n.totalEpics!=null||n.totalStories!=null)&&c.jsxs("p",{className:"text-xs text-center text-slate-400",children:["Total in project: ",n.totalEpics??0," Epics · ",n.totalStories??0," Stories"]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(vS,{label:"Input tokens",value:r.toLocaleString()}),c.jsx(vS,{label:"Output tokens",value:i.toLocaleString()})]}),n.model&&c.jsxs("p",{className:"text-xs text-center text-slate-400",children:["Model: ",c.jsx("span",{className:"font-mono",children:n.model})]}),(()=>{const u=n.validationIssues===void 0,d=n.validationIssues??gF;return d.length>0?c.jsxs("div",{children:[c.jsxs("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:["Quality fixes applied",u&&c.jsx("span",{className:"ml-2 normal-case font-normal text-slate-300",children:"(example preview)"})]}),c.jsx("div",{className:"space-y-1.5",children:d.map((p,h)=>c.jsxs("div",{className:"flex items-center gap-2 text-xs bg-amber-50 border border-amber-100 rounded-md px-3 py-2",children:[c.jsx(vF,{severity:p.severity}),c.jsx("span",{className:"text-slate-400 flex-shrink-0",children:p.stage}),c.jsx("span",{className:"text-slate-600",children:p.name})]},h))})]}):null})(),c.jsx("div",{className:"flex justify-center pt-2",children:c.jsx("button",{onClick:e,className:"px-6 py-2 bg-slate-900 text-white text-sm font-medium rounded-lg hover:bg-slate-700 transition-colors",children:"Close"})})]})}function yF({quotaLimitPending:e,onContinueAfterQuota:t,onCancel:n,onConfigureModels:r}){const[i,a]=b.useState(!1);async function l(){var u,d,p,h,m;a(!0);try{const x=(u=(await Tn()).ceremonies)==null?void 0:u.find(j=>j.name==="sprint-planning"),w=((p=(d=x==null?void 0:x.stages)==null?void 0:d.validation)==null?void 0:p.provider)||null,S=((m=(h=x==null?void 0:x.stages)==null?void 0:h.validation)==null?void 0:m.model)||null;await t(w,S)}finally{a(!1)}}return c.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-white/90 rounded-2xl",children:c.jsxs("div",{className:"bg-white border border-red-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[c.jsx("div",{className:"text-3xl",children:"⚠️"}),c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"API Quota Exceeded"}),c.jsxs("p",{className:"text-sm text-slate-600",children:[c.jsx("span",{className:"font-mono font-medium",children:e.provider})," / ",c.jsx("span",{className:"font-mono text-xs",children:e.model})," returned a quota error."]}),e.validatorName&&c.jsxs("p",{className:"text-xs text-slate-400",children:["Validator: ",e.validatorName.replace("validator-story-","").replace("validator-epic-","")]}),c.jsx("p",{className:"text-sm text-slate-500",children:"The ceremony is paused. What would you like to do?"}),c.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[c.jsx("button",{onClick:l,disabled:i,className:"px-4 py-2 text-sm rounded-lg bg-slate-900 text-white hover:bg-slate-700 disabled:opacity-50",children:i?"Resuming…":"Resume"}),c.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Configure Models"}),c.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-lg border border-red-200 text-red-600 hover:bg-red-50",children:"Cancel Ceremony"})]}),c.jsxs("p",{className:"text-xs text-slate-400",children:["Use ",c.jsx("strong",{children:"Configure Models"})," to switch provider, then ",c.jsx("strong",{children:"Resume"}),"."]})]})})}function bF({onClose:e,costLimitPending:t,onContinuePastCostLimit:n,onCancelFromCostLimit:r,quotaLimitPending:i,onContinueAfterQuota:a,onCancelFromQuota:l}){const{isOpen:u,step:d,status:p,isPaused:h,setStep:m,setStatus:v,setError:x,closeModal:w,setProcessId:S}=xo(),[j,k]=b.useState(!1),[C,E]=b.useState(null),[O,P]=b.useState([]),[A,_]=b.useState([]),[D,$]=b.useState({}),[q,X]=b.useState(!1),[L,Z]=b.useState(null),[J,ne]=b.useState(null);if(b.useEffect(()=>{u&&d===1&&p!=="running"&&V3().then(te=>ne(te!=null&&te.resumable?te:null)).catch(()=>ne(null))},[u,d,p]),!u)return null;const re=p==="running"||p==="awaiting-selection",B=()=>{re||(w(),e==null||e())},F=async(te=null)=>{v("running"),m(2),ne(null);try{const le=await B3(te);le!=null&&le.processId&&S(le.processId)}catch(le){v("error"),x(le.message)}},G=async()=>{var te;try{const[le,pe]=await Promise.all([Tn(),ds()]),Se=((te=le.ceremonies)==null?void 0:te.find(H=>H.name==="sprint-planning"))??{name:"sprint-planning"};E(Se),P(pe),_(le.ceremonies||[]),$(le.apiKeys||{}),k(!0)}catch{}},W=async te=>{const pe=(A.length>0?A:[te]).map(Se=>Se.name===te.name?te:Se);await zl(pe,null),E(te),_(pe)},M=async()=>{Z("pausing");try{await v2()}catch{}},V=async()=>{try{await x2()}catch{}},ie=async(te=!1)=>{X(!1),Z("cancelling");try{await Qa(te)}catch{}};b.useEffect(()=>{L==="pausing"&&h&&Z(null)},[h,L]),b.useEffect(()=>{L==="cancelling"&&p==="idle"&&Z(null)},[p,L]);const fe=()=>{switch(d){case 1:return c.jsx(fF,{onStart:()=>F(null),onResume:()=>F(J==null?void 0:J.checkpoint),resumeInfo:J});case 2:return c.jsx(mF,{transitioning:L,onPause:M,onResume:V,onCancel:()=>X(!0),onBackground:w});case 3:return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-4 text-center",children:[c.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-400"}),c.jsx("p",{className:"text-sm text-slate-500",children:"Reviewing decomposed work…"})]});case 4:return c.jsx(xF,{onClose:B});default:return null}};return c.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[c.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:re?void 0:B}),c.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-2xl mx-4 max-h-[90vh] flex flex-col",children:[t&&c.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-white/90 rounded-2xl",children:c.jsxs("div",{className:"bg-white border border-amber-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[c.jsx("div",{className:"text-3xl",children:"⚠️"}),c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Cost Limit Reached"}),c.jsxs("p",{className:"text-sm text-slate-600",children:[c.jsxs("span",{className:"font-mono font-medium",children:["$",t.cost.toFixed(4)]})," spent",t.threshold!=null&&c.jsxs(c.Fragment,{children:[" (limit: ",c.jsxs("span",{className:"font-mono",children:["$",Number(t.threshold).toFixed(2)]}),")"]})]}),c.jsx("p",{className:"text-sm text-slate-500",children:"The ceremony is paused. What would you like to do?"}),c.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[c.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-lg bg-slate-900 text-white hover:bg-slate-700",children:"Continue Anyway"}),c.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-lg border border-red-200 text-red-600 hover:bg-red-50",children:"Cancel Ceremony"})]}),c.jsx("p",{className:"text-xs text-slate-400",children:"Continue disables cost checking for the rest of this run."})]})}),i&&c.jsx(yF,{quotaLimitPending:i,onContinueAfterQuota:a,onCancel:l,onConfigureModels:G}),q&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white/90 rounded-2xl",children:c.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Cancel sprint planning?"}),c.jsx("p",{className:"text-sm text-slate-500",children:"What should happen with epics and stories already created in this run?"}),c.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[c.jsx("button",{onClick:()=>X(!1),className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Keep Running"}),c.jsx("button",{onClick:()=>ie(!0),className:"px-4 py-2 text-sm rounded-lg border border-amber-300 bg-amber-50 text-amber-700 hover:bg-amber-100",children:"Cancel & Keep Items"}),c.jsx("button",{onClick:()=>ie(!1),className:"px-4 py-2 text-sm rounded-lg bg-red-600 text-white hover:bg-red-700",children:"Cancel & Delete Items"})]})]})}),c.jsxs("div",{className:"flex items-start justify-between px-6 pt-5 pb-4 border-b border-slate-200 flex-shrink-0",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("h1",{className:"text-base font-semibold text-slate-900",children:"Sprint Planning Ceremony"}),c.jsx("div",{className:"mt-2",children:c.jsx(dF,{currentStep:d})})]}),c.jsxs("div",{className:"flex items-center gap-3 ml-4 mt-0.5 flex-shrink-0",children:[!re&&c.jsxs("button",{type:"button",onClick:G,className:"flex items-center gap-1.5 text-xs font-medium text-slate-500 hover:text-blue-600 bg-slate-50 hover:bg-blue-50 border border-slate-200 hover:border-blue-200 rounded-md px-2.5 py-1.5 transition-colors whitespace-nowrap",title:"Configure ceremony models",children:[c.jsx(to,{className:"w-3.5 h-3.5"}),"Select Model(s)"]}),!re&&c.jsx("button",{onClick:B,className:"text-slate-400 hover:text-slate-600 transition-colors",children:c.jsx(xn,{className:"w-5 h-5"})})]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:fe()}),c.jsxs("div",{className:"flex-shrink-0 border-t border-slate-100 px-6 h-8 flex items-center gap-2",children:[p==="running"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3 h-3 border-2 border-blue-300 border-t-blue-600 rounded-full animate-spin flex-shrink-0"}),c.jsx("p",{className:"text-xs text-blue-600 font-medium truncate",children:"Running sprint planning…"})]}),p==="awaiting-selection"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-400 flex-shrink-0"}),c.jsx("p",{className:"text-xs text-amber-600 font-medium truncate",children:"Waiting for your selection to continue…"})]})]})]}),j&&C&&c.jsx(ux,{ceremony:C,allCeremonies:A,apiKeys:D,models:O,readOnly:p==="running"&&!i,onSave:p!=="running"||i?W:void 0,onClose:()=>k(!1),onCeremoniesUpdated:te=>{_(te);const le=te.find(pe=>pe.name==="sprint-planning");le&&E(le)}})]})}function wF({hierarchy:e,onConfirm:t,onCancel:n}){const[r,i]=b.useState(()=>{const k={};for(const C of e.epics)k[C.id]=!0;return k}),[a,l]=b.useState(()=>{const k={};for(const C of e.epics)for(const E of C.stories||[])k[E.id]=!0;return k}),u=Object.values(r).filter(Boolean).length,d=e.epics.length,p=Object.values(a).filter(Boolean).length,h=e.epics.reduce((k,C)=>{var E;return k+(((E=C.stories)==null?void 0:E.length)||0)},0),m=u>0,v=(k,C)=>{i(O=>({...O,[k]:C}));const E=e.epics.find(O=>O.id===k);if(E){const O={};for(const P of E.stories||[])O[P.id]=C;l(P=>({...P,...O}))}},x=(k,C,E)=>{const O={...a,[C]:E};l(O);const P=e.epics.find(A=>A.id===k);if(P){const A=(P.stories||[]).some(_=>O[_.id]);i(_=>({..._,[k]:A}))}},w=()=>{const k={},C={};for(const E of e.epics){k[E.id]=!0;for(const O of E.stories||[])C[O.id]=!0}i(k),l(C)},S=()=>{const k={},C={};for(const E of e.epics){k[E.id]=!1;for(const O of E.stories||[])C[O.id]=!1}i(k),l(C)},j=()=>{const k=Object.entries(r).filter(([,E])=>E).map(([E])=>E),C=Object.entries(a).filter(([,E])=>E).map(([E])=>E);t(k,C)};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"px-6 pt-5 pb-4 border-b border-slate-200 flex-shrink-0",children:[c.jsx("h2",{className:"text-base font-semibold text-slate-900",children:"Review Decomposed Work"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"The AI has decomposed your scope into epics and stories. Select which items to carry forward into validation — deselected items will be skipped entirely."})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4 min-h-0",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("p",{className:"text-xs text-slate-500",children:[c.jsxs("span",{className:"font-medium text-slate-700",children:[u,"/",d]})," epics ·"," ",c.jsxs("span",{className:"font-medium text-slate-700",children:[p,"/",h]})," stories selected"]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{onClick:w,className:"text-xs px-2 py-0.5 rounded border border-slate-200 text-slate-600 hover:bg-slate-50 transition-colors",children:"Select all"}),c.jsx("button",{onClick:S,className:"text-xs px-2 py-0.5 rounded border border-slate-200 text-slate-600 hover:bg-slate-50 transition-colors",children:"Deselect all"})]})]}),c.jsx("div",{className:"space-y-2",children:e.epics.map(k=>{const C=r[k.id]??!1,E=k.stories||[];return c.jsxs("div",{className:"rounded-lg border border-slate-200 overflow-hidden",children:[c.jsxs("label",{className:"flex items-start gap-3 px-4 py-3 bg-slate-50 cursor-pointer hover:bg-slate-100 select-none",children:[c.jsx("input",{type:"checkbox",checked:C,onChange:O=>v(k.id,O.target.checked),className:"mt-0.5 flex-shrink-0 accent-slate-900"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 leading-snug",children:k.name}),k.description&&c.jsx("p",{className:"text-xs text-slate-500 mt-0.5 line-clamp-2",children:k.description}),c.jsxs("p",{className:"text-xs text-slate-400 mt-0.5",children:[E.length," ",E.length===1?"story":"stories",k.domain?c.jsxs("span",{className:"ml-1 text-slate-300",children:["· ",k.domain]}):null]})]})]}),E.length>0&&c.jsx("div",{className:"divide-y divide-slate-100",children:E.map(O=>c.jsxs("label",{className:"flex items-start gap-3 px-4 py-2 pl-10 cursor-pointer hover:bg-slate-50 select-none",children:[c.jsx("input",{type:"checkbox",checked:a[O.id]??!1,onChange:P=>x(k.id,O.id,P.target.checked),className:"mt-0.5 flex-shrink-0 accent-slate-600"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs font-medium text-slate-800",children:O.name}),O.userType&&c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:O.userType})]})]},O.id))})]},k.id)})})]}),c.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-slate-200 flex-shrink-0",children:[c.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-lg border border-red-200 text-red-600 hover:bg-red-50 transition-colors",children:"✕ Cancel Run"}),c.jsx("button",{onClick:j,disabled:!m,className:"px-6 py-2 text-sm font-medium bg-slate-900 text-white rounded-lg hover:bg-slate-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:"Confirm Selection →"})]})]})}function jF(){const{status:e,decomposedHierarchy:t,setStatus:n,setStep:r,setDecomposedHierarchy:i,setError:a}=xo(),[l,u]=b.useState(!1);if(e!=="awaiting-selection"||!t)return null;const d=async(h,m)=>{i(null),n("running"),r(2);try{await U3(h,m)}catch(v){n("error"),a(v.message)}},p=async()=>{u(!1);try{await Qa()}catch{}};return c.jsxs("div",{className:"fixed inset-0 z-[80] flex items-center justify-center",children:[c.jsx("div",{className:"absolute inset-0 bg-black/60"}),c.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-2xl mx-4 max-h-[90vh] flex flex-col",children:[l&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white/90 rounded-2xl",children:c.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Cancel sprint planning?"}),c.jsx("p",{className:"text-sm text-slate-500",children:"Any epics and stories created in this run will be permanently deleted."}),c.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[c.jsx("button",{onClick:()=>u(!1),className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Go Back"}),c.jsx("button",{onClick:p,className:"px-4 py-2 text-sm rounded-lg bg-red-600 text-white hover:bg-red-700",children:"Cancel Run"})]})]})}),c.jsx(wF,{hierarchy:t,onConfirm:d,onCancel:()=>u(!0)})]})]})}function SF(e){if(e<=0)return"expired";if(e<60)return`${e}s`;const t=Math.floor(e/60);return t<60?`${t} min`:`${Math.floor(t/60)}h ${t%60}m`}function NF({apiKeyInfo:e,onSaved:t}){var F,G;const[n,r]=b.useState((e==null?void 0:e.authMode)||"api-key"),[i,a]=b.useState(""),[l,u]=b.useState(!1),[d,p]=b.useState(null),[h,m]=b.useState((F=e==null?void 0:e.oauth)!=null&&F.connected?"connected":"idle"),[v,x]=b.useState((e==null?void 0:e.oauth)||{connected:!1}),[w,S]=b.useState(null),j=b.useRef(null),k=b.useRef(null),[C,E]=b.useState(null),[O,P]=b.useState(((G=e==null?void 0:e.oauth)==null?void 0:G.fallback)??!1),[A,_]=b.useState(null);b.useEffect(()=>{var W,M;r((e==null?void 0:e.authMode)||"api-key"),x((e==null?void 0:e.oauth)||{connected:!1}),P(((W=e==null?void 0:e.oauth)==null?void 0:W.fallback)??!1),(M=e==null?void 0:e.oauth)!=null&&M.connected&&m("connected")},[e]),b.useEffect(()=>()=>{j.current&&clearInterval(j.current),k.current&&clearTimeout(k.current)},[]);const D=()=>{j.current=setInterval(async()=>{try{const W=await dD();W.connected&&(x(W),m("connected"),S(null),$(),t())}catch{}},2e3),k.current=setTimeout(()=>{$(),m("idle")},3e5)},$=()=>{j.current&&(clearInterval(j.current),j.current=null),k.current&&(clearTimeout(k.current),k.current=null)},q=W=>{W!==n&&(n==="oauth"&&h==="connecting"&&($(),m("idle"),S(null)),W==="oauth"&&m(v.connected?"connected":"idle"),r(W))},X=async()=>{m("connecting"),S(null);try{const W=await cD();S(W.authorizeUrl||null),D()}catch(W){m("idle"),console.error("OAuth connect error:",W)}},L=()=>{$(),m("idle"),S(null)},Z=async()=>{try{await uD()}catch{}m("idle"),x({connected:!1}),E(null),r("api-key"),t()},J=async W=>{_("saving");try{await pD(W),P(W),_(null)}catch(M){_({error:M.message}),setTimeout(()=>_(null),4e3)}},ne=async()=>{E("running");try{const W=await fD();E(W)}catch(W){E({error:W.message})}},re=async()=>{p("saving");try{await bd({openai:i}),p("saved"),a(""),t(),setTimeout(()=>p(null),2e3)}catch{p("error"),setTimeout(()=>p(null),2e3)}},B=async()=>{p("clearing");try{await bd({openai:""}),p("saved"),t(),setTimeout(()=>p(null),2e3)}catch{p("error"),setTimeout(()=>p(null),2e3)}};return c.jsxs("div",{className:"py-3 border-b border-slate-100 last:border-0",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[c.jsxs("div",{className:"w-36 flex-shrink-0",children:[c.jsx("p",{className:"text-sm font-medium text-slate-800",children:"OpenAI"}),c.jsx("p",{className:"text-xs text-slate-400",children:"Auth mode"})]}),c.jsxs("div",{className:"flex items-center gap-1 bg-slate-100 rounded-lg p-1",children:[c.jsx("button",{type:"button",onClick:()=>q("api-key"),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${n==="api-key"?"bg-white text-slate-800 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:"API Key"}),c.jsx("button",{type:"button",onClick:()=>q("oauth"),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${n==="oauth"?"bg-white text-slate-800 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:"Subscription"})]})]}),n==="api-key"&&c.jsxs("div",{className:"flex items-center gap-3 pl-0 pt-1",children:[c.jsx("div",{className:"w-36 flex-shrink-0",children:c.jsx("p",{className:"text-xs text-slate-400",children:"OPENAI_API_KEY"})}),c.jsx("div",{className:"w-16 flex-shrink-0",children:e!=null&&e.isSet?c.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 rounded-full px-2 py-0.5",children:"✓ Set"}):c.jsx("span",{className:"inline-flex items-center text-xs font-medium text-slate-400 bg-slate-50 border border-slate-200 rounded-full px-2 py-0.5",children:"Not set"})}),(e==null?void 0:e.isSet)&&!i&&c.jsx("p",{className:"text-xs text-slate-400 font-mono flex-shrink-0",children:e.preview}),c.jsxs("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx("input",{type:l?"text":"password",value:i,onChange:W=>a(W.target.value),placeholder:e!=null&&e.isSet?"Enter new key to update…":"sk-…",className:"w-full rounded-md border border-slate-300 px-2 py-1.5 pr-8 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono"}),c.jsx("button",{type:"button",onClick:()=>u(W=>!W),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:l?c.jsx(kv,{className:"w-3.5 h-3.5"}):c.jsx(vd,{className:"w-3.5 h-3.5"})})]}),(e==null?void 0:e.isSet)&&!i&&c.jsx("button",{type:"button",onClick:B,disabled:d==="clearing",className:"px-3 py-1.5 text-xs font-medium border border-red-200 text-red-600 rounded-md hover:bg-red-50 transition-colors disabled:opacity-40 flex-shrink-0",children:d==="clearing"?"…":"Reset"}),c.jsx("button",{type:"button",onClick:re,disabled:!i.trim()||d==="saving",className:"px-3 py-1.5 text-xs font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40 flex-shrink-0",children:d==="saving"?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):d==="saved"?"✓ Saved":d==="error"?"✗ Error":"Save"})]})]}),n==="oauth"&&c.jsxs("div",{className:"pl-0 pt-1",children:[h==="idle"&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("p",{className:"text-xs text-slate-500",children:[c.jsx("span",{className:"font-medium text-amber-700",children:"ℹ"})," ","Requires a ",c.jsx("strong",{children:"ChatGPT Pro"})," subscription ($200/mo). Only Codex-endpoint models work (",c.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:"gpt-5.2-codex"}),","," ",c.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:"gpt-5.3-codex"}),"). This endpoint is unofficial and may change without notice."]}),c.jsx("div",{children:c.jsx("button",{type:"button",onClick:X,className:"inline-flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium bg-emerald-600 text-white rounded-md hover:bg-emerald-700 transition-colors",children:"Connect with ChatGPT ↗"})})]}),h==="connecting"&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("p",{className:"text-xs text-slate-600 flex items-center gap-2",children:[c.jsx("span",{className:"w-3 h-3 border border-slate-400 border-t-slate-700 rounded-full animate-spin inline-block"}),"Waiting for browser login…"]}),w&&c.jsxs("p",{className:"text-xs text-slate-500",children:["If your browser did not open,"," ",c.jsx("a",{href:w,target:"_blank",rel:"noreferrer",className:"text-blue-600 underline break-all",children:"click here to authenticate"}),"."]}),c.jsx("div",{children:c.jsx("button",{type:"button",onClick:L,className:"px-3 py-1 text-xs font-medium border border-slate-300 rounded-md text-slate-600 hover:bg-slate-50 transition-colors",children:"Cancel"})})]}),h==="connected"&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-emerald-700 bg-emerald-50 border border-emerald-200 rounded-full px-2 py-0.5",children:"✓ Connected"}),v.accountId&&c.jsx("span",{className:"text-xs text-slate-500 font-mono",children:v.accountId}),v.expiresIn!=null&&c.jsxs("span",{className:"text-xs text-slate-400",children:["· expires in ",SF(v.expiresIn)]}),c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[c.jsx("button",{type:"button",onClick:ne,disabled:C==="running",className:"w-14 flex items-center justify-center py-1 text-xs font-medium border border-emerald-300 rounded-md text-emerald-700 hover:bg-emerald-50 transition-colors disabled:opacity-40",children:C==="running"?c.jsx("span",{className:"w-3 h-3 border border-emerald-400 border-t-emerald-700 rounded-full animate-spin"}):"Test"}),c.jsx("button",{type:"button",onClick:Z,className:"px-3 py-1 text-xs font-medium border border-slate-300 rounded-md text-slate-600 hover:bg-slate-50 transition-colors",children:"Disconnect"})]})]}),C&&C!=="running"&&c.jsx("div",{className:`text-xs rounded-md px-3 py-2 font-mono ${C.error?"bg-red-50 text-red-700 border border-red-200":"bg-slate-50 text-slate-700 border border-slate-200"}`,children:C.error?`✗ ${C.error}`:`✓ ${C.response||"Connected"} [${C.model} · ${C.elapsed}ms]`}),(e==null?void 0:e.isSet)&&c.jsxs("div",{className:"flex items-center gap-3 pt-1 border-t border-slate-100",children:[c.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:"checkbox",checked:O,disabled:A==="saving",onChange:W=>J(W.target.checked),className:"sr-only"}),c.jsx("div",{onClick:()=>A!=="saving"&&J(!O),className:`w-8 h-4 rounded-full transition-colors cursor-pointer ${O?"bg-blue-500":"bg-slate-300"} ${A==="saving"?"opacity-40":""}`,children:c.jsx("div",{className:`absolute top-0.5 left-0.5 w-3 h-3 bg-white rounded-full shadow transition-transform ${O?"translate-x-4":""}`})})]}),c.jsx("span",{className:"text-xs text-slate-600",children:"Fallback to API Key on failure"})]}),(A==null?void 0:A.error)&&c.jsx("span",{className:"text-xs text-red-600",children:A.error})]})]})]})]})}const kF=[{key:"anthropic",label:"Anthropic",envKey:"ANTHROPIC_API_KEY",placeholder:"sk-ant-…"},{key:"gemini",label:"Google (Gemini)",envKey:"GEMINI_API_KEY",placeholder:"AIza…"},{key:"xiaomi",label:"Xiaomi (MiMo)",envKey:"XIAOMI_API_KEY",placeholder:"sk-…"}];function PF({provider:e,apiKeyInfo:t,onSaved:n}){const[r,i]=b.useState(""),[a,l]=b.useState(!1),[u,d]=b.useState(null),p=async()=>{d("saving");try{await bd({[e.key]:r}),d("saved"),i(""),n(),setTimeout(()=>d(null),2e3)}catch{d("error"),setTimeout(()=>d(null),2e3)}},h=async()=>{d("clearing");try{await bd({[e.key]:""}),d("saved"),n(),setTimeout(()=>d(null),2e3)}catch{d("error"),setTimeout(()=>d(null),2e3)}};return c.jsxs("div",{className:"flex items-center gap-3 py-3 border-b border-slate-100 last:border-0",children:[c.jsxs("div",{className:"w-36 flex-shrink-0",children:[c.jsx("p",{className:"text-sm font-medium text-slate-800",children:e.label}),c.jsx("p",{className:"text-xs text-slate-400",children:e.envKey})]}),c.jsx("div",{className:"w-16 flex-shrink-0",children:t.isSet?c.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 rounded-full px-2 py-0.5",children:"✓ Set"}):c.jsx("span",{className:"inline-flex items-center text-xs font-medium text-slate-400 bg-slate-50 border border-slate-200 rounded-full px-2 py-0.5",children:"Not set"})}),t.isSet&&!r&&c.jsx("p",{className:"text-xs text-slate-400 font-mono flex-shrink-0",children:t.preview}),c.jsxs("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx("input",{type:a?"text":"password",value:r,onChange:m=>i(m.target.value),placeholder:t.isSet?"Enter new key to update…":e.placeholder,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 pr-8 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono"}),c.jsx("button",{type:"button",onClick:()=>l(m=>!m),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:a?c.jsx(kv,{className:"w-3.5 h-3.5"}):c.jsx(vd,{className:"w-3.5 h-3.5"})})]}),t.isSet&&!r&&c.jsx("button",{type:"button",onClick:h,disabled:u==="clearing",className:"px-3 py-1.5 text-xs font-medium border border-red-200 text-red-600 rounded-md hover:bg-red-50 transition-colors disabled:opacity-40 flex-shrink-0",children:u==="clearing"?"…":"Reset"}),c.jsx("button",{type:"button",onClick:p,disabled:!r.trim()||u==="saving",className:"px-3 py-1.5 text-xs font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40 flex-shrink-0",children:u==="saving"?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):u==="saved"?"✓ Saved":u==="error"?"✗ Error":"Save"})]})]})}function CF({settings:e,onSaved:t}){return c.jsxs("div",{className:"px-5 py-4",children:[c.jsxs("p",{className:"text-xs text-slate-500 mb-4",children:["API keys are stored in your project's ",c.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:".env"})," file. Enter a new key and click Save to update. Clear the field and save to remove a key."]}),c.jsxs("div",{children:[kF.map(n=>c.jsx(PF,{provider:n,apiKeyInfo:e.apiKeys[n.key],onSaved:t},n.key)),c.jsx(NF,{apiKeyInfo:e.apiKeys.openai,onSaved:t})]})]})}function OF(e){return e.replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())}const AF={"sponsor-call":"Generates mission statement and project documentation through a structured AI-guided interview.","sprint-planning":"Decomposes project scope into epics and stories with multi-agent validation and context generation.",seed:"Decomposes a story into implementable tasks and subtasks with documentation and context files.",run:"Implements task code in a git worktree using AI agents with traceability rules validation."};function EF({settings:e,models:t,onSaved:n}){const[r,i]=b.useState(()=>JSON.parse(JSON.stringify(e.ceremonies||[]))),[a,l]=b.useState(()=>{var m;return JSON.parse(JSON.stringify(((m=e.missionGenerator)==null?void 0:m.validation)||{maxIterations:3,acceptanceThreshold:95}))}),[u,d]=b.useState(null),p=async(m,v)=>{const x=r.map(S=>S.name===m.name?m:S),w=m.name==="sponsor-call"?{validation:v||a}:{validation:a};await zl(x,w),i(x),m.name==="sponsor-call"&&v&&l(v),n()};if(!r.length)return c.jsx("div",{className:"px-5 py-8 text-center",children:c.jsx("p",{className:"text-sm text-slate-500",children:"No ceremony configurations found yet. Run your first ceremony from the kanban board to populate settings here."})});const h=r.find(m=>m.name===u);return c.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[r.map(m=>{const v=AF[m.name];return c.jsxs("div",{className:"border border-slate-200 rounded-lg px-4 py-3 flex items-center justify-between gap-4",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-800",children:m.displayName||OF(m.name||"")}),v&&c.jsx("p",{className:"text-xs text-slate-500 mt-0.5 leading-relaxed",children:v})]}),c.jsxs("button",{type:"button",onClick:()=>d(m.name),className:"flex items-center gap-1.5 text-xs font-medium text-blue-600 hover:text-blue-700 bg-blue-50 hover:bg-blue-100 border border-blue-200 rounded-md px-3 py-1.5 transition-colors flex-shrink-0",children:[c.jsx(S3,{className:"w-3.5 h-3.5"}),"Configure Models"]})]},m.name)}),u&&h&&c.jsx(ux,{ceremony:h,allCeremonies:r,apiKeys:e.apiKeys,models:t,missionGenValidation:u==="sponsor-call"?a:null,onClose:()=>d(null),onSave:p,onCeremoniesUpdated:m=>{i(m),n()}})]})}function TF({settings:e,onSaved:t}){const[n,r]=b.useState(String(e.kanbanPort||4174)),[i,a]=b.useState(String(e.docsPort||4173)),[l,u]=b.useState(e.boardTitle||"AVC Kanban Board"),[d,p]=b.useState(null),[h,m]=b.useState(null),v=async()=>{p("saving");try{await _1({kanbanPort:Number(n),docsPort:Number(i)}),p("saved"),t(),setTimeout(()=>p(null),2e3)}catch{p("error"),setTimeout(()=>p(null),2e3)}},x=async()=>{const w=l.trim();if(w){m("saving");try{await _1({boardTitle:w}),m("saved"),t(),setTimeout(()=>m(null),2e3)}catch{m("error"),setTimeout(()=>m(null),2e3)}}};return c.jsxs("div",{className:"px-5 py-4 flex flex-col gap-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-3",children:"General"}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("label",{className:"text-sm text-slate-700 w-28 flex-shrink-0",children:"Board title"}),c.jsx("input",{type:"text",value:l,onChange:w=>u(w.target.value),onKeyDown:w=>{w.key==="Enter"&&x()},className:"flex-1 max-w-xs rounded-md border border-slate-300 px-2 py-1.5 text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500"}),c.jsx("button",{type:"button",onClick:x,disabled:!l.trim()||h==="saving",className:"px-3 py-1.5 text-xs font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40",children:h==="saving"?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):h==="saved"?"✓ Saved":h==="error"?"✗ Error":"Save"})]})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-3",children:"Server Ports"}),c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("label",{className:"text-sm text-slate-700 w-28 flex-shrink-0",children:"Kanban board"}),c.jsx("input",{type:"number",min:"1024",max:"65535",value:n,onChange:w=>r(w.target.value),className:"w-24 rounded-md border border-slate-300 px-2 py-1.5 text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("label",{className:"text-sm text-slate-700 w-28 flex-shrink-0",children:"Documentation"}),c.jsx("input",{type:"number",min:"1024",max:"65535",value:i,onChange:w=>a(w.target.value),className:"w-24 rounded-md border border-slate-300 px-2 py-1.5 text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),c.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[c.jsx("div",{className:"w-28 flex-shrink-0"}),c.jsx("button",{type:"button",onClick:v,disabled:d==="saving",className:"px-3 py-1.5 text-xs font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40",children:d==="saving"?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):d==="saved"?"✓ Saved":d==="error"?"✗ Error":"Save"})]})]}),c.jsxs("p",{className:"text-xs text-slate-400 mt-3",children:["Changing ports requires restarting the servers (run ",c.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:"/kanban"})," and ",c.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:"/documentation"}),")."]})]})]})}const _F=["claude","gemini","openai","xiaomi"],MF={claude:"Claude",gemini:"Gemini",openai:"OpenAI",xiaomi:"Xiaomi MiMo"},IF={claude:{active:"border-orange-500 text-orange-700",badge:"bg-orange-50 text-orange-700 border-orange-200"},gemini:{active:"border-blue-500 text-blue-700",badge:"bg-blue-50 text-blue-700 border-blue-200"},openai:{active:"border-green-500 text-green-700",badge:"bg-green-50 text-green-700 border-green-200"},xiaomi:{active:"border-purple-500 text-purple-700",badge:"bg-purple-50 text-purple-700 border-purple-200"}},DF={claude:"bg-orange-50 text-orange-700 border-orange-200",gemini:"bg-blue-50 text-blue-700 border-blue-200",openai:"bg-green-50 text-green-700 border-green-200",xiaomi:"bg-purple-50 text-purple-700 border-purple-200"},Sm=[{value:"million",label:"per 1M tokens"},{value:"thousand",label:"per 1K tokens"}];function RF(e){var n,r,i,a,l,u;const t={};for(const[d,p]of Object.entries(e))t[d]={input:String(((n=p.pricing)==null?void 0:n.input)??""),inputCached:String(((r=p.pricing)==null?void 0:r.inputCached)??""),output:String(((i=p.pricing)==null?void 0:i.output)??""),unit:((a=p.pricing)==null?void 0:a.unit)??"million",source:((l=p.pricing)==null?void 0:l.source)??"",lastUpdated:((u=p.pricing)==null?void 0:u.lastUpdated)??""};return t}function LF(e){return e?new Date(e+"T00:00:00").toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):null}function $F({settings:e,onSaved:t}){const n=e.models||{},[r,i]=b.useState(()=>RF(n)),[a,l]=b.useState(null),u=_F.filter(x=>Object.values(n).some(w=>w.provider===x)),[d,p]=b.useState(()=>u[0]||"claude"),h=Object.entries(n).filter(([,x])=>x.provider===d),m=(x,w,S)=>{i(j=>({...j,[x]:{...j[x],[w]:S}}))},v=async()=>{l("saving");try{const x={};for(const[w,S]of Object.entries(r))x[w]={pricing:{input:parseFloat(S.input)||0,inputCached:parseFloat(S.inputCached)||0,output:parseFloat(S.output)||0,unit:S.unit,source:S.source}};await D3(x),l("saved"),t(),setTimeout(()=>l(null),2e3)}catch{l("error"),setTimeout(()=>l(null),2e3)}};return h.length===0?c.jsx("div",{className:"px-5 py-8 text-center",children:c.jsx("p",{className:"text-sm text-slate-500",children:"No models configured yet. Run your first ceremony to populate model settings."})}):c.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[c.jsxs("p",{className:"text-xs text-slate-500",children:["Set the cost per token for each model. These rates are used by the cost tracker to estimate LLM spend. Prices are in ",c.jsx("strong",{children:"USD"}),"."]}),u.length>1&&c.jsx("div",{className:"flex border-b border-slate-200 -mx-5 px-5",children:u.map(x=>{const w=IF[x]||{active:"border-slate-900 text-slate-900"},S=x===d,j=Object.values(n).filter(k=>k.provider===x).length;return c.jsxs("button",{type:"button",onClick:()=>p(x),className:`px-4 py-2.5 text-sm font-medium border-b-2 -mb-px transition-colors ${S?w.active:"border-transparent text-slate-500 hover:text-slate-700"}`,children:[MF[x]||x,c.jsx("span",{className:`ml-1.5 text-xs px-1.5 py-0.5 rounded-full border ${S?w.badge:"bg-slate-100 text-slate-400 border-slate-200"}`,children:j})]},x)})}),c.jsx("div",{className:"flex flex-col gap-2",children:h.map(([x,w])=>{var k,C;const S=r[x]??{input:"",output:"",unit:"million"},j=DF[w.provider]||"bg-slate-50 text-slate-600 border-slate-200";return c.jsxs("div",{className:"border border-slate-200 rounded-lg p-4",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[c.jsx("span",{className:"text-sm font-semibold text-slate-800",children:w.displayName||x}),c.jsx("span",{className:`text-xs font-medium border rounded-full px-2 py-0.5 ${j}`,children:w.provider}),c.jsx("span",{className:"text-xs text-slate-400 font-mono ml-auto",children:x}),S.lastUpdated&&c.jsxs("span",{className:"text-xs text-slate-400 whitespace-nowrap",children:["verified ",LF(S.lastUpdated)]})]}),c.jsxs("div",{className:"grid grid-cols-[80px_1fr_1fr] gap-x-3 gap-y-2 items-center text-xs",children:[c.jsx("div",{}),c.jsx("div",{className:"text-slate-400 font-medium",children:"Price (USD $)"}),c.jsx("div",{className:"text-slate-400 font-medium",children:"Unit"}),c.jsx("label",{className:"text-slate-600 font-medium",children:"Input"}),c.jsx("input",{type:"number",min:"0",step:"0.01",value:S.input,onChange:E=>m(x,"input",E.target.value),placeholder:"0.00",className:"rounded-md border border-slate-300 px-2 py-1.5 text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 w-full max-w-[120px]"}),c.jsx("select",{value:S.unit,onChange:E=>m(x,"unit",E.target.value),className:"rounded-md border border-slate-300 px-2 py-1.5 text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white w-full max-w-[160px]",children:Sm.map(E=>c.jsx("option",{value:E.value,children:E.label},E.value))}),c.jsx("label",{className:"text-slate-600 font-medium",children:"Cache Read"}),c.jsx("input",{type:"number",min:"0",step:"0.01",value:S.inputCached,onChange:E=>m(x,"inputCached",E.target.value),placeholder:"0.00",className:"rounded-md border border-slate-300 px-2 py-1.5 text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 w-full max-w-[120px]"}),c.jsxs("span",{className:"text-slate-400 text-xs",children:[(k=Sm.find(E=>E.value===S.unit))==null?void 0:k.label," · discounted"]}),c.jsx("label",{className:"text-slate-600 font-medium",children:"Output"}),c.jsx("input",{type:"number",min:"0",step:"0.01",value:S.output,onChange:E=>m(x,"output",E.target.value),placeholder:"0.00",className:"rounded-md border border-slate-300 px-2 py-1.5 text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 w-full max-w-[120px]"}),c.jsx("span",{className:"text-slate-400",children:(C=Sm.find(E=>E.value===S.unit))==null?void 0:C.label}),c.jsx("label",{className:"text-slate-600 font-medium",children:"Source"}),c.jsxs("div",{className:"col-span-2 flex items-center gap-1.5",children:[c.jsx("input",{type:"url",value:S.source,readOnly:!0,placeholder:"https://provider.com/pricing",className:"flex-1 rounded-md border border-slate-200 bg-slate-50 px-2 py-1.5 text-xs text-slate-500 cursor-default focus:outline-none min-w-0"}),S.source&&c.jsx("a",{href:S.source,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700 shrink-0",title:"Open pricing page",children:c.jsx(c3,{className:"w-3.5 h-3.5"})})]})]})]},x)})}),c.jsx("div",{className:"flex justify-end pt-1",children:c.jsx("button",{type:"button",onClick:v,disabled:a==="saving",className:"px-4 py-2 text-sm font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40",children:a==="saving"?c.jsxs("span",{className:"inline-flex items-center gap-2",children:[c.jsx("span",{className:"w-3.5 h-3.5 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving…"]}):a==="saved"?"✓ Saved":a==="error"?"✗ Error":"Save Pricing"})})]})}const lA=[{ceremony:"Sponsor Call",color:"blue",phases:[{phase:"Mission & Scope",agents:[{slug:"mission-scope-generator",label:"Mission Scope Generator",note:"Generates mission & initial scope"},{slug:"mission-scope-validator",label:"Mission Scope Validator",note:"Validates mission quality"}]},{phase:"Questionnaire",agents:[{slug:"suggestion-product-manager",label:"Product Manager",note:"Fills Initial Scope"},{slug:"suggestion-ux-researcher",label:"UX Researcher",note:"Fills Target Users"},{slug:"suggestion-deployment-architect",label:"Deployment Architect",note:"Fills Deployment Target"},{slug:"suggestion-technical-architect",label:"Technical Architect",note:"Fills Technical Considerations"},{slug:"suggestion-security-specialist",label:"Security Specialist",note:"Fills Security & Compliance"},{slug:"architecture-recommender",label:"Architecture Recommender",note:"Recommends deployment architectures"},{slug:"database-recommender",label:"Database Recommender",note:"Recommends database type"},{slug:"database-deep-dive",label:"Database Deep Dive",note:"Detailed database analysis"},{slug:"question-prefiller",label:"Question Prefiller",note:"Pre-fills answers from architecture"}]},{phase:"Documentation",agents:[{slug:"project-documentation-creator",label:"Documentation Creator",note:"Creates project documentation"},{slug:"validator-documentation",label:"Documentation Validator",note:"Validates documentation quality"}]},{phase:"Context",agents:[{slug:"migration-guide-generator",label:"Migration Guide Generator",note:"Generates cloud migration guide"}]}]},{ceremony:"Sprint Planning",color:"purple",phases:[{phase:"Decomposition",agents:[{slug:"epic-story-decomposer",label:"Epic Story Decomposer",note:"Breaks scope into epics & stories"}]},{phase:"Contextual Selection",agents:[{slug:"project-context-extractor",label:"Project Context Extractor",note:"Extracts project traits (once per run) to inform validator selection"},{slug:"validator-selector",label:"Validator Selector",note:"Selects appropriate domain validators"},{slug:"agent-selector",label:"Agent Selector",note:"Selects relevant validators per Epic/Story based on project context"}]},{phase:"Context Generation",agents:[{slug:"context-writer-epic",label:"Context Writer (Epic)",note:"Writes complete canonical context.md — Purpose, Scope, NFRs, Success Criteria"},{slug:"context-reviewer-epic",label:"Context Reviewer (Epic)",note:"Independent accuracy audit: checks all features present, no hallucinations, sections complete"},{slug:"context-writer-story",label:"Context Writer (Story)",note:"Writes complete canonical context.md — User Story framing, Technical Notes, Scope boundaries"},{slug:"context-reviewer-story",label:"Context Reviewer (Story)",note:"Independent accuracy audit: checks all ACs present, no hallucinations, sections complete"}]},{phase:"Documentation & Enrichment",agents:[{slug:"doc-writer-epic",label:"Doc Writer (Epic)",note:"Generates narrative epic doc.md from canonical context.md"},{slug:"doc-writer-story",label:"Doc Writer (Story)",note:"Generates narrative story doc.md from canonical context.md"},{slug:"story-doc-enricher",label:"Story Doc Enricher",note:"Enriches story docs with API contracts, error tables, DB fields, business rules"}]},{phase:"Micro-Check Definitions — Epic",agents:[{slug:"checks/epic/solution-architect",label:"Solution Architect",note:"JSON",isCheck:!0},{slug:"checks/epic/developer",label:"Developer",note:"JSON",isCheck:!0},{slug:"checks/epic/security",label:"Security",note:"JSON",isCheck:!0},{slug:"checks/epic/devops",label:"DevOps",note:"JSON",isCheck:!0},{slug:"checks/epic/cloud",label:"Cloud",note:"JSON",isCheck:!0},{slug:"checks/epic/backend",label:"Backend",note:"JSON",isCheck:!0},{slug:"checks/epic/database",label:"Database",note:"JSON",isCheck:!0},{slug:"checks/epic/api",label:"API",note:"JSON",isCheck:!0},{slug:"checks/epic/frontend",label:"Frontend",note:"JSON",isCheck:!0},{slug:"checks/epic/ui",label:"UI",note:"JSON",isCheck:!0},{slug:"checks/epic/ux",label:"UX",note:"JSON",isCheck:!0},{slug:"checks/epic/mobile",label:"Mobile",note:"JSON",isCheck:!0},{slug:"checks/epic/data",label:"Data",note:"JSON",isCheck:!0},{slug:"checks/epic/qa",label:"QA",note:"JSON",isCheck:!0},{slug:"checks/epic/test-architect",label:"Test Architect",note:"JSON",isCheck:!0}]},{phase:"Micro-Check Definitions — Story",agents:[{slug:"checks/story/solution-architect",label:"Solution Architect",note:"JSON",isCheck:!0},{slug:"checks/story/developer",label:"Developer",note:"JSON",isCheck:!0},{slug:"checks/story/security",label:"Security",note:"JSON",isCheck:!0},{slug:"checks/story/devops",label:"DevOps",note:"JSON",isCheck:!0},{slug:"checks/story/cloud",label:"Cloud",note:"JSON",isCheck:!0},{slug:"checks/story/backend",label:"Backend",note:"JSON",isCheck:!0},{slug:"checks/story/database",label:"Database",note:"JSON",isCheck:!0},{slug:"checks/story/api",label:"API",note:"JSON",isCheck:!0},{slug:"checks/story/frontend",label:"Frontend",note:"JSON",isCheck:!0},{slug:"checks/story/ui",label:"UI",note:"JSON",isCheck:!0},{slug:"checks/story/ux",label:"UX",note:"JSON",isCheck:!0},{slug:"checks/story/mobile",label:"Mobile",note:"JSON",isCheck:!0},{slug:"checks/story/data",label:"Data",note:"JSON",isCheck:!0},{slug:"checks/story/qa",label:"QA",note:"JSON",isCheck:!0},{slug:"checks/story/test-architect",label:"Test Architect",note:"JSON",isCheck:!0},{slug:"story-splitter",label:"Story Splitter",note:"Splits oversized stories (15+ ACs) into 2-3 focused stories"}]},{phase:"Cross-Reference Checks",agents:[{slug:"checks/cross-refs/epic",label:"Epic Cross-Refs",note:"JSON",isCheck:!0},{slug:"checks/cross-refs/story",label:"Story Cross-Refs",note:"JSON",isCheck:!0}]}]},{ceremony:"Seed",color:"amber",phases:[{phase:"Decomposition",agents:[{slug:"task-subtask-decomposer",label:"Task Decomposer",note:"Breaks stories into tasks & subtasks"}]},{phase:"Documentation",agents:[{slug:"doc-distributor",label:"Doc Distributor",note:"Moves content from story doc into task/subtask docs"},{slug:"feature-context-generator",label:"Feature Context Generator",note:"Generates implementation context.md for each task/subtask"}]}]}],yS={blue:{border:"border-blue-200",header:"bg-blue-50",accent:"border-l-blue-400",text:"text-blue-800"},purple:{border:"border-purple-200",header:"bg-purple-50",accent:"border-l-purple-400",text:"text-purple-800"},amber:{border:"border-amber-200",header:"bg-amber-50",accent:"border-l-amber-400",text:"text-amber-800"},green:{border:"border-green-200",header:"bg-green-50",accent:"border-l-green-400",text:"text-green-800"},slate:{border:"border-slate-200",header:"bg-slate-50",accent:"border-l-slate-400",text:"text-slate-800"}},zF=new Set(lA.flatMap(e=>e.phases.flatMap(t=>t.agents.map(n=>n.slug))));function FF(){const[e,t]=b.useState({}),[n,r]=b.useState({}),[i,a]=b.useState(null),[l,u]=b.useState(null),[d,p]=b.useState(""),[h,m]=b.useState(null),[v,x]=b.useState({});b.useEffect(()=>{Z3().then(_=>{const D={};_.agents.forEach($=>{const q=$.name.replace(/\.md$/,"");D[q]=$.isCustomized}),t(D)}).catch(_=>m(_.message)),rD().then(_=>{const D={};_.checks.forEach($=>{const q=`checks/${$.scope}/${$.perspective}`;D[q]={isCustomized:$.isCustomized,checkCount:$.checkCount}}),r(D)}).catch(()=>{})},[]);const w=_=>x(D=>({...D,[_]:!D[_]})),S=_=>v[_]===!0,j=Object.keys(e).filter(_=>!zF.has(_)).map(_=>({slug:_,label:_,note:null})),k=[...lA,...j.length>0?[{ceremony:"Other",color:"slate",phases:[{phase:"Other",agents:j}]}]:[]],C=d.toLowerCase(),E=C?k.map(_=>({..._,phases:_.phases.map(D=>({...D,agents:D.agents.filter($=>$.label.toLowerCase().includes(C)||$.slug.toLowerCase().includes(C)||_.ceremony.toLowerCase().includes(C)||D.phase.toLowerCase().includes(C))})).filter(D=>D.agents.length>0)})).filter(_=>_.phases.length>0):k,O=Object.keys(e).length>0||Object.keys(n).length>0,P=C.length>0,A=_=>_.phases.flatMap(D=>D.agents).filter(D=>{var $;return D.isCheck?($=n[D.slug])==null?void 0:$.isCustomized:e[D.slug]}).length;return c.jsxs("div",{children:[c.jsxs("div",{className:"sticky top-0 bg-white z-10 px-4 py-2.5 border-b border-slate-100 flex items-center justify-between gap-3",children:[c.jsx("input",{type:"search",placeholder:"Search agents…",value:d,onChange:_=>p(_.target.value),className:"w-48 rounded border border-slate-200 px-3 py-1.5 text-xs text-slate-700 focus:outline-none focus:ring-1 focus:ring-blue-500"}),c.jsx("span",{className:"text-xs text-slate-400 italic flex-shrink-0",children:"Click any agent to edit its prompt"})]}),c.jsxs("div",{className:"px-4 py-4 flex flex-col gap-3",children:[h&&c.jsx("p",{className:"text-xs text-red-500",children:h}),E.length===0&&c.jsx("p",{className:"text-sm text-slate-400 py-4",children:"No agents match your search."}),E.map(_=>{const D=yS[_.color]||yS.slate,$=P||S(_.ceremony),q=A(_);return c.jsxs("div",{className:`rounded-xl border ${D.border} overflow-hidden`,children:[c.jsxs("button",{type:"button",onClick:()=>!P&&w(_.ceremony),className:`w-full flex items-center gap-2 px-4 py-2.5 border-l-4 ${D.header} ${D.accent} text-left`,children:[$?c.jsx(Hr,{className:"w-3.5 h-3.5 text-slate-400 flex-shrink-0"}):c.jsx(sr,{className:"w-3.5 h-3.5 text-slate-400 flex-shrink-0"}),c.jsx("span",{className:`text-sm font-semibold flex-1 ${D.text}`,children:_.ceremony}),q>0&&c.jsxs("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-amber-100 text-amber-700",children:[q," custom"]})]}),$&&c.jsx("div",{className:"divide-y divide-slate-100",children:_.phases.map(X=>{const L=`${_.ceremony}::${X.phase}`,Z=P||S(L),J=X.agents.filter(ne=>!O||ne.isCheck||ne.slug in e);return J.length===0?null:c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>!P&&w(L),className:"w-full flex items-center gap-2 pl-6 pr-4 py-2 bg-slate-50 hover:bg-slate-100 transition-colors text-left",children:[Z?c.jsx(Hr,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}):c.jsx(sr,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}),c.jsx("span",{className:"text-xs font-semibold text-slate-600 uppercase tracking-wide",children:X.phase}),c.jsx("span",{className:"text-xs text-slate-400 ml-1",children:J.length})]}),Z&&c.jsx("div",{className:"pb-1",children:J.map(ne=>{var W,M;const re=ne.isCheck,B=re?((W=n[ne.slug])==null?void 0:W.isCustomized)??!1:e[ne.slug]??!1,F=re?((M=n[ne.slug])==null?void 0:M.checkCount)??0:0,G=()=>{if(re){const V=ne.slug.split("/");u({scope:V[1],perspective:V[2]})}else a(ne.slug)};return c.jsxs("button",{type:"button",onClick:G,className:"w-full text-left pl-10 pr-4 py-1.5 hover:bg-slate-50 transition-colors flex items-center gap-3 group",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("span",{className:"text-sm text-slate-700 group-hover:text-slate-900",children:ne.label}),re&&F>0&&c.jsxs("span",{className:"text-xs text-blue-500 ml-2",children:[F," checks"]}),ne.note&&!re&&c.jsx("span",{className:"text-xs text-slate-400 italic ml-2",children:ne.note})]}),B&&c.jsx("span",{className:"flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded bg-amber-100 text-amber-700",children:"Custom"}),c.jsx(ac,{className:"w-3.5 h-3.5 text-slate-300 group-hover:text-slate-500 flex-shrink-0 transition-colors"})]},`${_.ceremony}-${ne.slug}`)})})]},X.phase)})})]},_.ceremony)})]}),i&&c.jsx(sA,{agentName:`${i}.md`,onClose:()=>a(null),onSaved:()=>t(_=>({..._,[i]:!0})),onReset:()=>t(_=>({..._,[i]:!1}))}),l&&c.jsx(aA,{scope:l.scope,perspective:l.perspective,onClose:()=>u(null),onSaved:()=>{const _=`checks/${l.scope}/${l.perspective}`;r(D=>({...D,[_]:{...D[_],isCustomized:!0}}))},onReset:()=>{const _=`checks/${l.scope}/${l.perspective}`;r(D=>({...D,[_]:{...D[_],isCustomized:!1}}))}})]})}const Ng=[{key:"sponsor-call",label:"Sponsor Call",desc:"Wizard to define project mission, scope, and architecture"},{key:"sprint-planning",label:"Sprint Planning",desc:"Decomposes project scope into epics, stories, and contexts"},{key:"seed",label:"Seed",desc:"Decomposes stories into implementable tasks and subtasks"},{key:"run",label:"Run",desc:"Implements task code in worktree with AI-powered generation and validation"}];function BF(e){const t={};for(const{key:n}of Ng){const r=e==null?void 0:e[n];t[n]=r!=null?String(r):""}return t}function VF({settings:e,onSaved:t}){const[n,r]=b.useState(()=>BF(e.costThresholds)),[i,a]=b.useState(null),l=(d,p)=>{r(h=>({...h,[d]:p}))},u=async()=>{a("saving");try{const d={};for(const{key:p}of Ng){const h=n[p].trim();d[p]=h===""?null:parseFloat(h)||null}await R3(d),a("saved"),t(),setTimeout(()=>a(null),2e3)}catch{a("error"),setTimeout(()=>a(null),2e3)}};return c.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[c.jsxs("p",{className:"text-xs text-slate-500",children:["Set a maximum spend (in ",c.jsx("strong",{children:"USD"}),") per ceremony run. Leave empty for unlimited. When the running cost exceeds the limit, the ceremony stops automatically."]}),c.jsx("div",{className:"flex flex-col gap-2",children:Ng.map(({key:d,label:p,desc:h})=>c.jsx("div",{className:"border border-slate-200 rounded-lg p-4",children:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-sm font-semibold text-slate-800",children:p}),c.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:h})]}),c.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c.jsx("span",{className:"text-sm text-slate-500",children:"$"}),c.jsx("input",{type:"number",min:"0",step:"0.01",value:n[d],onChange:m=>l(d,m.target.value),placeholder:"Unlimited",className:"rounded-md border border-slate-300 px-2 py-1.5 text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 w-28 placeholder:text-slate-400"})]})]})},d))}),c.jsx("div",{className:"flex justify-end pt-1",children:c.jsx("button",{type:"button",onClick:u,disabled:i==="saving",className:"px-4 py-2 text-sm font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40",children:i==="saving"?c.jsxs("span",{className:"inline-flex items-center gap-2",children:[c.jsx("span",{className:"w-3.5 h-3.5 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving…"]}):i==="saved"?"✓ Saved":i==="error"?"✗ Error":"Save Cost Limits"})})]})}const UF=[{id:"api-keys",label:"API Keys"},{id:"ceremonies",label:"Ceremony Models"},{id:"agents",label:"Agents"},{id:"pricing",label:"Model Pricing"},{id:"cost-thresholds",label:"Cost Limits"},{id:"servers",label:"Servers & Ports"}];function WF({settings:e,models:t,onClose:n,onSaved:r,initialTab:i}){const[a,l]=b.useState(i||"api-keys");return c.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:u=>{u.target===u.currentTarget&&n()},children:c.jsxs("div",{className:"w-full max-w-4xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",style:{height:"85vh"},children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-slate-100 flex-shrink-0",children:[c.jsx("h2",{className:"text-base font-semibold text-slate-900",children:"⚙ Project Settings"}),c.jsx("button",{type:"button",onClick:n,className:"text-slate-400 hover:text-slate-600 transition-colors ml-4","aria-label":"Close",children:c.jsx(xn,{className:"w-5 h-5"})})]}),c.jsx("div",{className:"flex border-b border-slate-100 flex-shrink-0 px-5",children:UF.map(u=>c.jsx("button",{type:"button",onClick:()=>l(u.id),className:`px-3 py-3 text-sm font-medium transition-colors border-b-2 -mb-px ${a===u.id?"border-slate-900 text-slate-900":"border-transparent text-slate-500 hover:text-slate-700"}`,children:u.label},u.id))}),c.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a==="api-keys"&&c.jsx(CF,{settings:e,onSaved:r}),a==="ceremonies"&&c.jsx(EF,{settings:e,models:t,onSaved:r}),a==="pricing"&&c.jsx($F,{settings:e,onSaved:r}),a==="cost-thresholds"&&c.jsx(VF,{settings:e,onSaved:r}),a==="servers"&&c.jsx(TF,{settings:e,onSaved:r}),a==="agents"&&c.jsx(FF,{})]})]})})}var qF=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function dx(e){if(typeof e!="string")return!1;var t=qF;return t.includes(e)}var KF=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],HF=new Set(KF);function cA(e){return typeof e!="string"?!1:HF.has(e)}function uA(e){return typeof e=="string"&&e.startsWith("data-")}function hs(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(cA(n)||uA(n))&&(t[n]=e[n]);return t}function fx(e){if(e==null)return null;if(b.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return hs(t)}return typeof e=="object"&&!Array.isArray(e)?hs(e):null}function or(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(cA(n)||uA(n)||dx(n))&&(t[n]=e[n]);return t}var GF=["children","width","height","viewBox","className","style","title","desc"];function kg(){return kg=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},kg.apply(null,arguments)}function YF(e,t){if(e==null)return{};var n,r,i=XF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function XF(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var dA=b.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:l,style:u,title:d,desc:p}=e,h=YF(e,GF),m=a||{width:r,height:i,x:0,y:0},v=st("recharts-surface",l);return b.createElement("svg",kg({},or(h),{className:v,width:r,height:i,style:u,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),b.createElement("title",null,d),b.createElement("desc",null,p),n)}),QF=["children","className"];function Pg(){return Pg=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},Pg.apply(null,arguments)}function JF(e,t){if(e==null)return{};var n,r,i=ZF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ZF(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var yi=b.forwardRef((e,t)=>{var{children:n,className:r}=e,i=JF(e,QF),a=st("recharts-layer",r);return b.createElement("g",Pg({className:a},or(i),{ref:t}),n)}),fA=c2(),eB=b.createContext(null);function it(e){return function(){return e}}const pA=Math.cos,Ad=Math.sin,Er=Math.sqrt,Ed=Math.PI,Ef=2*Ed,Cg=Math.PI,Og=2*Cg,Bs=1e-6,tB=Og-Bs;function hA(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function nB(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return hA;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class rB{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?hA:nB(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+l}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let l=this._x1,u=this._y1,d=r-t,p=i-n,h=l-t,m=u-n,v=h*h+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(v>Bs)if(!(Math.abs(m*d-p*h)>Bs)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-l,w=i-u,S=d*d+p*p,j=x*x+w*w,k=Math.sqrt(S),C=Math.sqrt(v),E=a*Math.tan((Cg-Math.acos((S+v-j)/(2*k*C)))/2),O=E/C,P=E/k;Math.abs(O-1)>Bs&&this._append`L${t+O*h},${n+O*m}`,this._append`A${a},${a},0,0,${+(m*x>h*w)},${this._x1=t+P*d},${this._y1=n+P*p}`}}arc(t,n,r,i,a,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(i),d=r*Math.sin(i),p=t+u,h=n+d,m=1^l,v=l?i-a:a-i;this._x1===null?this._append`M${p},${h}`:(Math.abs(this._x1-p)>Bs||Math.abs(this._y1-h)>Bs)&&this._append`L${p},${h}`,r&&(v<0&&(v=v%Og+Og),v>tB?this._append`A${r},${r},0,1,${m},${t-u},${n-d}A${r},${r},0,1,${m},${this._x1=p},${this._y1=h}`:v>Bs&&this._append`A${r},${r},0,${+(v>=Cg)},${m},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function px(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new rB(t)}function hx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function mA(e){this._context=e}mA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Tf(e){return new mA(e)}function gA(e){return e[0]}function vA(e){return e[1]}function xA(e,t){var n=it(!0),r=null,i=Tf,a=null,l=px(u);e=typeof e=="function"?e:e===void 0?gA:it(e),t=typeof t=="function"?t:t===void 0?vA:it(t);function u(d){var p,h=(d=hx(d)).length,m,v=!1,x;for(r==null&&(a=i(x=l())),p=0;p<=h;++p)!(p<h&&n(m=d[p],p,d))===v&&((v=!v)?a.lineStart():a.lineEnd()),v&&a.point(+e(m,p,d),+t(m,p,d));if(x)return a=null,x+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:it(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:it(+d),u):t},u.defined=function(d){return arguments.length?(n=typeof d=="function"?d:it(!!d),u):n},u.curve=function(d){return arguments.length?(i=d,r!=null&&(a=i(r)),u):i},u.context=function(d){return arguments.length?(d==null?r=a=null:a=i(r=d),u):r},u}function Uu(e,t,n){var r=null,i=it(!0),a=null,l=Tf,u=null,d=px(p);e=typeof e=="function"?e:e===void 0?gA:it(+e),t=typeof t=="function"?t:it(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?vA:it(+n);function p(m){var v,x,w,S=(m=hx(m)).length,j,k=!1,C,E=new Array(S),O=new Array(S);for(a==null&&(u=l(C=d())),v=0;v<=S;++v){if(!(v<S&&i(j=m[v],v,m))===k)if(k=!k)x=v,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),w=v-1;w>=x;--w)u.point(E[w],O[w]);u.lineEnd(),u.areaEnd()}k&&(E[v]=+e(j,v,m),O[v]=+t(j,v,m),u.point(r?+r(j,v,m):E[v],n?+n(j,v,m):O[v]))}if(C)return u=null,C+""||null}function h(){return xA().defined(i).curve(l).context(a)}return p.x=function(m){return arguments.length?(e=typeof m=="function"?m:it(+m),r=null,p):e},p.x0=function(m){return arguments.length?(e=typeof m=="function"?m:it(+m),p):e},p.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:it(+m),p):r},p.y=function(m){return arguments.length?(t=typeof m=="function"?m:it(+m),n=null,p):t},p.y0=function(m){return arguments.length?(t=typeof m=="function"?m:it(+m),p):t},p.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:it(+m),p):n},p.lineX0=p.lineY0=function(){return h().x(e).y(t)},p.lineY1=function(){return h().x(e).y(n)},p.lineX1=function(){return h().x(r).y(t)},p.defined=function(m){return arguments.length?(i=typeof m=="function"?m:it(!!m),p):i},p.curve=function(m){return arguments.length?(l=m,a!=null&&(u=l(a)),p):l},p.context=function(m){return arguments.length?(m==null?a=u=null:u=l(a=m),p):a},p}class yA{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function iB(e){return new yA(e,!0)}function sB(e){return new yA(e,!1)}const mx={draw(e,t){const n=Er(t/Ed);e.moveTo(n,0),e.arc(0,0,n,0,Ef)}},aB={draw(e,t){const n=Er(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},bA=Er(1/3),oB=bA*2,lB={draw(e,t){const n=Er(t/oB),r=n*bA;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},cB={draw(e,t){const n=Er(t),r=-n/2;e.rect(r,r,n,n)}},uB=.8908130915292852,wA=Ad(Ed/10)/Ad(7*Ed/10),dB=Ad(Ef/10)*wA,fB=-pA(Ef/10)*wA,pB={draw(e,t){const n=Er(t*uB),r=dB*n,i=fB*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=Ef*a/5,u=pA(l),d=Ad(l);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*i,d*r+u*i)}e.closePath()}},Nm=Er(3),hB={draw(e,t){const n=-Er(t/(Nm*3));e.moveTo(0,n*2),e.lineTo(-Nm*n,-n),e.lineTo(Nm*n,-n),e.closePath()}},er=-.5,tr=Er(3)/2,Ag=1/Er(12),mB=(Ag/2+1)*3,gB={draw(e,t){const n=Er(t/mB),r=n/2,i=n*Ag,a=r,l=n*Ag+n,u=-a,d=l;e.moveTo(r,i),e.lineTo(a,l),e.lineTo(u,d),e.lineTo(er*r-tr*i,tr*r+er*i),e.lineTo(er*a-tr*l,tr*a+er*l),e.lineTo(er*u-tr*d,tr*u+er*d),e.lineTo(er*r+tr*i,er*i-tr*r),e.lineTo(er*a+tr*l,er*l-tr*a),e.lineTo(er*u+tr*d,er*d-tr*u),e.closePath()}};function vB(e,t){let n=null,r=px(i);e=typeof e=="function"?e:it(e||mx),t=typeof t=="function"?t:it(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:it(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:it(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Td(){}function _d(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function jA(e){this._context=e}jA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:_d(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:_d(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xB(e){return new jA(e)}function SA(e){this._context=e}SA.prototype={areaStart:Td,areaEnd:Td,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:_d(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function yB(e){return new SA(e)}function NA(e){this._context=e}NA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:_d(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function bB(e){return new NA(e)}function kA(e){this._context=e}kA.prototype={areaStart:Td,areaEnd:Td,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function wB(e){return new kA(e)}function bS(e){return e<0?-1:1}function wS(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),u=(a*i+l*r)/(r+i);return(bS(a)+bS(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(u))||0}function jS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function km(e,t,n){var r=e._x0,i=e._y0,a=e._x1,l=e._y1,u=(a-r)/3;e._context.bezierCurveTo(r+u,i+u*t,a-u,l-u*n,a,l)}function Md(e){this._context=e}Md.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:km(this,this._t0,jS(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,km(this,jS(this,n=wS(this,e,t)),n);break;default:km(this,this._t0,n=wS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function PA(e){this._context=new CA(e)}(PA.prototype=Object.create(Md.prototype)).point=function(e,t){Md.prototype.point.call(this,t,e)};function CA(e){this._context=e}CA.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function jB(e){return new Md(e)}function SB(e){return new PA(e)}function OA(e){this._context=e}OA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=SS(e),i=SS(t),a=0,l=1;l<n;++a,++l)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function SS(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),l=new Array(n);for(i[0]=0,a[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function NB(e){return new OA(e)}function _f(e,t){this._context=e,this._t=t}_f.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function kB(e){return new _f(e,.5)}function PB(e){return new _f(e,0)}function CB(e){return new _f(e,1)}function Zs(e,t){if((l=e.length)>1)for(var n=1,r,i,a=e[t[0]],l,u=a.length;n<l;++n)for(i=a,a=e[t[n]],r=0;r<u;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Eg(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function OB(e,t){return e[t]}function AB(e){const t=[];return t.key=e,t}function EB(){var e=it([]),t=Eg,n=Zs,r=OB;function i(a){var l=Array.from(e.apply(this,arguments),AB),u,d=l.length,p=-1,h;for(const m of a)for(u=0,++p;u<d;++u)(l[u][p]=[0,+r(m,l[u].key,p,a)]).data=m;for(u=0,h=hx(t(l));u<d;++u)l[h[u]].index=u;return n(l,h),l}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:it(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:it(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Eg:typeof a=="function"?a:it(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Zs,i):n},i}function TB(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,l;i<a;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}Zs(e,t)}}function _B(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var l=0,u=0;l<i;++l)u+=e[l][n][1]||0;r[n][1]+=r[n][0]=-u/2}Zs(e,t)}}function MB(e,t){if(!(!((l=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,l;r<a;++r){for(var u=0,d=0,p=0;u<l;++u){for(var h=e[t[u]],m=h[r][1]||0,v=h[r-1][1]||0,x=(m-v)/2,w=0;w<u;++w){var S=e[t[w]],j=S[r][1]||0,k=S[r-1][1]||0;x+=j-k}d+=m,p+=x*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=p/d)}i[r-1][1]+=i[r-1][0]=n,Zs(e,t)}}var Pm={},Cm={},NS;function IB(){return NS||(NS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(Cm)),Cm}var Om={},kS;function AA(){return kS||(kS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(Om)),Om}var Am={},PS;function gx(){return PS||(PS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var r;return typeof n=="string"||typeof n=="symbol"?n:Object.is((r=n==null?void 0:n.valueOf)==null?void 0:r.call(n),-0)?"-0":String(n)}e.toKey=t})(Am)),Am}var Em={},Tm={},CS;function DB(){return CS||(CS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(t).join(",");const r=String(n);return r==="0"&&Object.is(Number(n),-0)?"-0":r}e.toString=t})(Tm)),Tm}var OS;function vx(){return OS||(OS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=DB(),n=gx();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],l=i.length;if(l===0)return a;let u=0,d="",p="",h=!1;for(i.charCodeAt(0)===46&&(a.push(""),u++);u<l;){const m=i[u];p?m==="\\"&&u+1<l?(u++,d+=i[u]):m===p?p="":d+=m:h?m==='"'||m==="'"?p=m:m==="]"?(h=!1,a.push(d),d=""):d+=m:m==="["?(h=!0,d&&(a.push(d),d="")):m==="."?d&&(a.push(d),d=""):d+=m,u++}return d&&a.push(d),a}e.toPath=r})(Em)),Em}var AS;function xx(){return AS||(AS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=IB(),n=AA(),r=gx(),i=vx();function a(u,d,p){if(u==null)return p;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return p;const h=u[d];return h===void 0?n.isDeepKey(d)?a(u,i.toPath(d),p):p:h}case"number":case"symbol":{typeof d=="number"&&(d=r.toKey(d));const h=u[d];return h===void 0?p:h}default:{if(Array.isArray(d))return l(u,d,p);if(Object.is(d==null?void 0:d.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return p;const h=u[d];return h===void 0?p:h}}}function l(u,d,p){if(d.length===0)return p;let h=u;for(let m=0;m<d.length;m++){if(h==null||t.isUnsafeProperty(d[m]))return p;h=h[d[m]]}return h===void 0?p:h}e.get=a})(Pm)),Pm}var _m,ES;function RB(){return ES||(ES=1,_m=xx().get),_m}var LB=RB();const oo=Qr(LB);var $B=4;function ls(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$B,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function bt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,l)=>{var u=n[l-1];return typeof u=="string"?i+u+a:u!==void 0?i+ls(u)+a:i+a},"")}var Fn=e=>e===0?0:e>0?1:-1,Gr=e=>typeof e=="number"&&e!=+e,ea=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ne=e=>(typeof e=="number"||e instanceof Number)&&!Gr(e),Yr=e=>Ne(e)||typeof e=="string",zB=0,ql=e=>{var t=++zB;return"".concat(e||"").concat(t)},Or=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ne(t)&&typeof t!="string")return r;var a;if(ea(t)){if(n==null)return r;var l=t.indexOf("%");a=n*parseFloat(t.slice(0,l))/100}else a=+t;return Gr(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},EA=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Zt(e,t,n){return Ne(e)&&Ne(t)?ls(e+n*(t-e)):t}function FB(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):oo(r,t))===n)}var Ut=e=>e===null||typeof e>"u",pc=e=>Ut(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Fr(e){return e!=null}function jo(){}var BB=["type","size","sizeType"];function Tg(){return Tg=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},Tg.apply(null,arguments)}function TS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _S(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TS(Object(n),!0).forEach(function(r){VB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VB(e,t,n){return(t=UB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UB(e){var t=WB(e,"string");return typeof t=="symbol"?t:t+""}function WB(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qB(e,t){if(e==null)return{};var n,r,i=KB(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function KB(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var TA={symbolCircle:mx,symbolCross:aB,symbolDiamond:lB,symbolSquare:cB,symbolStar:pB,symbolTriangle:hB,symbolWye:gB},HB=Math.PI/180,GB=e=>{var t="symbol".concat(pc(e));return TA[t]||mx},YB=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*HB;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},XB=(e,t)=>{TA["symbol".concat(pc(e))]=t},_A=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=qB(e,BB),a=_S(_S({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var u=()=>{var v=GB(l),x=vB().type(v).size(YB(n,r,l)),w=x();if(w!==null)return w},{className:d,cx:p,cy:h}=a,m=or(a);return Ne(p)&&Ne(h)&&Ne(n)?b.createElement("path",Tg({},m,{className:st("recharts-symbols",d),transform:"translate(".concat(p,", ").concat(h,")"),d:u()})):null};_A.registerSymbol=XB;var MA=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,QB=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(b.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{dx(i)&&(r[i]=(a=>n[i](n,a)))}),r},JB=(e,t,n)=>r=>(e(t,n,r),null),yx=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];dx(i)&&typeof a=="function"&&(r||(r={}),r[i]=JB(a,t,n))}),r};function MS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ZB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MS(Object(n),!0).forEach(function(r){e7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function e7(e,t,n){return(t=t7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t7(e){var t=n7(e,"string");return typeof t=="symbol"?t:t+""}function n7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ur(e,t){var n=ZB({},e),r=t,i=Object.keys(t),a=i.reduce((l,u)=>(l[u]===void 0&&r[u]!==void 0&&(l[u]=r[u]),l),n);return a}var Mm={},Im={},IS;function r7(){return IS||(IS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const l=n[a],u=r(l,a,n);i.has(u)||i.set(u,l)}return Array.from(i.values())}e.uniqBy=t})(Im)),Im}var Dm={},DS;function i7(){return DS||(DS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return function(...i){return n.apply(this,i.slice(0,r))}}e.ary=t})(Dm)),Dm}var Rm={},RS;function IA(){return RS||(RS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Rm)),Rm}var Lm={},$m={},zm={},LS;function s7(){return LS||(LS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(zm)),zm}var $S;function bx(){return $S||($S=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=s7();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})($m)),$m}var Fm={},zS;function a7(){return zS||(zS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Fm)),Fm}var FS;function o7(){return FS||(FS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bx(),n=a7();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Lm)),Lm}var Bm={},Vm={},BS;function l7(){return BS||(BS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xx();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Vm)),Vm}var Um={},Wm={},qm={},Km={},VS;function DA(){return VS||(VS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(Km)),Km}var Hm={},US;function RA(){return US||(US=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(Hm)),Hm}var Gm={},WS;function LA(){return WS||(WS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(Gm)),Gm}var qS;function c7(){return qS||(qS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=DA(),n=RA(),r=LA();function i(h,m,v){return typeof v!="function"?i(h,m,()=>{}):a(h,m,function x(w,S,j,k,C,E){const O=v(w,S,j,k,C,E);return O!==void 0?!!O:a(w,S,x,E)},new Map)}function a(h,m,v,x){if(m===h)return!0;switch(typeof m){case"object":return l(h,m,v,x);case"function":return Object.keys(m).length>0?a(h,{...m},v,x):r.isEqualsSameValueZero(h,m);default:return t.isObject(h)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(h,m)}}function l(h,m,v,x){if(m==null)return!0;if(Array.isArray(m))return d(h,m,v,x);if(m instanceof Map)return u(h,m,v,x);if(m instanceof Set)return p(h,m,v,x);const w=Object.keys(m);if(h==null||n.isPrimitive(h))return w.length===0;if(w.length===0)return!0;if(x!=null&&x.has(m))return x.get(m)===h;x==null||x.set(m,h);try{for(let S=0;S<w.length;S++){const j=w[S];if(!n.isPrimitive(h)&&!(j in h)||m[j]===void 0&&h[j]!==void 0||m[j]===null&&h[j]!==null||!v(h[j],m[j],j,h,m,x))return!1}return!0}finally{x==null||x.delete(m)}}function u(h,m,v,x){if(m.size===0)return!0;if(!(h instanceof Map))return!1;for(const[w,S]of m.entries()){const j=h.get(w);if(v(j,S,w,h,m,x)===!1)return!1}return!0}function d(h,m,v,x){if(m.length===0)return!0;if(!Array.isArray(h))return!1;const w=new Set;for(let S=0;S<m.length;S++){const j=m[S];let k=!1;for(let C=0;C<h.length;C++){if(w.has(C))continue;const E=h[C];let O=!1;if(v(E,j,S,h,m,x)&&(O=!0),O){w.add(C),k=!0;break}}if(!k)return!1}return!0}function p(h,m,v,x){return m.size===0?!0:h instanceof Set?d([...h],[...m],v,x):!1}e.isMatchWith=i,e.isSetMatch=p})(qm)),qm}var KS;function $A(){return KS||(KS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=c7();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(Wm)),Wm}var Ym={},Xm={},Qm={},HS;function u7(){return HS||(HS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(Qm)),Qm}var Jm={},GS;function wx(){return GS||(GS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(Jm)),Jm}var Zm={},YS;function zA(){return YS||(YS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",l="[object Symbol]",u="[object Date]",d="[object Map]",p="[object Set]",h="[object Array]",m="[object Function]",v="[object ArrayBuffer]",x="[object Object]",w="[object Error]",S="[object DataView]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",C="[object Uint16Array]",E="[object Uint32Array]",O="[object BigUint64Array]",P="[object Int8Array]",A="[object Int16Array]",_="[object Int32Array]",D="[object BigInt64Array]",$="[object Float32Array]",q="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=v,e.arrayTag=h,e.bigInt64ArrayTag=D,e.bigUint64ArrayTag=O,e.booleanTag=i,e.dataViewTag=S,e.dateTag=u,e.errorTag=w,e.float32ArrayTag=$,e.float64ArrayTag=q,e.functionTag=m,e.int16ArrayTag=A,e.int32ArrayTag=_,e.int8ArrayTag=P,e.mapTag=d,e.numberTag=r,e.objectTag=x,e.regexpTag=t,e.setTag=p,e.stringTag=n,e.symbolTag=l,e.uint16ArrayTag=C,e.uint32ArrayTag=E,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=k})(Zm)),Zm}var e0={},XS;function d7(){return XS||(XS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(e0)),e0}var QS;function FA(){return QS||(QS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=u7(),n=wx(),r=zA(),i=RA(),a=d7();function l(h,m){return u(h,void 0,h,new Map,m)}function u(h,m,v,x=new Map,w=void 0){const S=w==null?void 0:w(h,m,v,x);if(S!==void 0)return S;if(i.isPrimitive(h))return h;if(x.has(h))return x.get(h);if(Array.isArray(h)){const j=new Array(h.length);x.set(h,j);for(let k=0;k<h.length;k++)j[k]=u(h[k],k,v,x,w);return Object.hasOwn(h,"index")&&(j.index=h.index),Object.hasOwn(h,"input")&&(j.input=h.input),j}if(h instanceof Date)return new Date(h.getTime());if(h instanceof RegExp){const j=new RegExp(h.source,h.flags);return j.lastIndex=h.lastIndex,j}if(h instanceof Map){const j=new Map;x.set(h,j);for(const[k,C]of h)j.set(k,u(C,k,v,x,w));return j}if(h instanceof Set){const j=new Set;x.set(h,j);for(const k of h)j.add(u(k,void 0,v,x,w));return j}if(typeof Buffer<"u"&&Buffer.isBuffer(h))return h.subarray();if(a.isTypedArray(h)){const j=new(Object.getPrototypeOf(h)).constructor(h.length);x.set(h,j);for(let k=0;k<h.length;k++)j[k]=u(h[k],k,v,x,w);return j}if(h instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&h instanceof SharedArrayBuffer)return h.slice(0);if(h instanceof DataView){const j=new DataView(h.buffer.slice(0),h.byteOffset,h.byteLength);return x.set(h,j),d(j,h,v,x,w),j}if(typeof File<"u"&&h instanceof File){const j=new File([h],h.name,{type:h.type});return x.set(h,j),d(j,h,v,x,w),j}if(typeof Blob<"u"&&h instanceof Blob){const j=new Blob([h],{type:h.type});return x.set(h,j),d(j,h,v,x,w),j}if(h instanceof Error){const j=new h.constructor;return x.set(h,j),j.message=h.message,j.name=h.name,j.stack=h.stack,j.cause=h.cause,d(j,h,v,x,w),j}if(h instanceof Boolean){const j=new Boolean(h.valueOf());return x.set(h,j),d(j,h,v,x,w),j}if(h instanceof Number){const j=new Number(h.valueOf());return x.set(h,j),d(j,h,v,x,w),j}if(h instanceof String){const j=new String(h.valueOf());return x.set(h,j),d(j,h,v,x,w),j}if(typeof h=="object"&&p(h)){const j=Object.create(Object.getPrototypeOf(h));return x.set(h,j),d(j,h,v,x,w),j}return h}function d(h,m,v=h,x,w){const S=[...Object.keys(m),...t.getSymbols(m)];for(let j=0;j<S.length;j++){const k=S[j],C=Object.getOwnPropertyDescriptor(h,k);(C==null||C.writable)&&(h[k]=u(m[k],k,v,x,w))}}function p(h){switch(n.getTag(h)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=l,e.cloneDeepWithImpl=u,e.copyProperties=d})(Xm)),Xm}var JS;function f7(){return JS||(JS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=FA();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(Ym)),Ym}var ZS;function p7(){return ZS||(ZS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$A(),n=f7();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(Um)),Um}var t0={},n0={},r0={},eN;function h7(){return eN||(eN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=FA(),n=wx(),r=zA();function i(a,l){return t.cloneDeepWith(a,(u,d,p,h)=>{const m=l==null?void 0:l(u,d,p,h);if(m!==void 0)return m;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const v={};return h.set(a,v),t.copyProperties(v,a,p,h),v}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const v=new a.constructor(a==null?void 0:a.valueOf());return t.copyProperties(v,a),v}case r.argumentsTag:{const v={};return t.copyProperties(v,a),v.length=a.length,v[Symbol.iterator]=a[Symbol.iterator],v}default:return}}})}e.cloneDeepWith=i})(r0)),r0}var tN;function m7(){return tN||(tN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=h7();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(n0)),n0}var i0={},s0={},nN;function BA(){return nN||(nN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<i;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(s0)),s0}var a0={},rN;function g7(){return rN||(rN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wx();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(a0)),a0}var iN;function v7(){return iN||(iN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AA(),n=BA(),r=g7(),i=vx();function a(l,u){let d;if(Array.isArray(u)?d=u:typeof u=="string"&&t.isDeepKey(u)&&(l==null?void 0:l[u])==null?d=i.toPath(u):d=[u],d.length===0)return!1;let p=l;for(let h=0;h<d.length;h++){const m=d[h];if((p==null||!Object.hasOwn(p,m))&&!((Array.isArray(p)||r.isArguments(p))&&n.isIndex(m)&&m<p.length))return!1;p=p[m]}return!0}e.has=a})(i0)),i0}var sN;function x7(){return sN||(sN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$A(),n=gx(),r=m7(),i=xx(),a=v7();function l(u,d){switch(typeof u){case"object":{Object.is(u==null?void 0:u.valueOf(),-0)&&(u="-0");break}case"number":{u=n.toKey(u);break}}return d=r.cloneDeep(d),function(p){const h=i.get(p,u);return h===void 0?a.has(p,u):d===void 0?h===void 0:t.isMatch(h,d)}}e.matchesProperty=l})(t0)),t0}var aN;function y7(){return aN||(aN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=IA(),n=l7(),r=p7(),i=x7();function a(l){if(l==null)return t.identity;switch(typeof l){case"function":return l;case"object":return Array.isArray(l)&&l.length===2?i.matchesProperty(l[0],l[1]):r.matches(l);case"string":case"symbol":case"number":return n.property(l)}}e.iteratee=a})(Bm)),Bm}var oN;function b7(){return oN||(oN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=r7(),n=i7(),r=IA(),i=o7(),a=y7();function l(u,d=r.identity){return i.isArrayLikeObject(u)?t.uniqBy(Array.from(u),n.ary(a.iteratee(d),1)):[]}e.uniqBy=l})(Mm)),Mm}var o0,lN;function w7(){return lN||(lN=1,o0=b7().uniqBy),o0}var j7=w7();const cN=Qr(j7);function S7(e,t,n){return t===!0?cN(e,n):typeof t=="function"?cN(e,t):e}var l0={exports:{}},c0={},u0={exports:{}},d0={};/**
289
+ * @license React
290
+ * use-sync-external-store-shim.production.js
291
+ *
292
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
293
+ *
294
+ * This source code is licensed under the MIT license found in the
295
+ * LICENSE file in the root directory of this source tree.
296
+ */var uN;function N7(){if(uN)return d0;uN=1;var e=vo();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function u(m,v){var x=v(),w=r({inst:{value:x,getSnapshot:v}}),S=w[0].inst,j=w[1];return a(function(){S.value=x,S.getSnapshot=v,d(S)&&j({inst:S})},[m,x,v]),i(function(){return d(S)&&j({inst:S}),m(function(){d(S)&&j({inst:S})})},[m]),l(x),x}function d(m){var v=m.getSnapshot;m=m.value;try{var x=v();return!n(m,x)}catch{return!0}}function p(m,v){return v()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:u;return d0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,d0}var dN;function k7(){return dN||(dN=1,u0.exports=N7()),u0.exports}/**
297
+ * @license React
298
+ * use-sync-external-store-shim/with-selector.production.js
299
+ *
300
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
301
+ *
302
+ * This source code is licensed under the MIT license found in the
303
+ * LICENSE file in the root directory of this source tree.
304
+ */var fN;function P7(){if(fN)return c0;fN=1;var e=vo(),t=k7();function n(p,h){return p===h&&(p!==0||1/p===1/h)||p!==p&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return c0.useSyncExternalStoreWithSelector=function(p,h,m,v,x){var w=a(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=u(function(){function k(A){if(!C){if(C=!0,E=A,A=v(A),x!==void 0&&S.hasValue){var _=S.value;if(x(_,A))return O=_}return O=A}if(_=O,r(E,A))return _;var D=v(A);return x!==void 0&&x(_,D)?(E=A,_):(E=A,O=D)}var C=!1,E,O,P=m===void 0?null:m;return[function(){return k(h())},P===null?void 0:function(){return k(P())}]},[h,m,v,x]);var j=i(p,w[0],w[1]);return l(function(){S.hasValue=!0,S.value=j},[j]),d(j),j},c0}var pN;function C7(){return pN||(pN=1,l0.exports=P7()),l0.exports}var O7=C7(),jx=b.createContext(null),A7=e=>e,Nt=()=>{var e=b.useContext(jx);return e?e.store.dispatch:A7},dd=()=>{},E7=()=>dd,T7=(e,t)=>e===t;function Ae(e){var t=b.useContext(jx),n=b.useMemo(()=>t?r=>{if(r!=null)return e(r)}:dd,[t,e]);return O7.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:E7,t?t.store.getState:dd,t?t.store.getState:dd,n,T7)}function _7(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function M7(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function I7(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var hN=e=>Array.isArray(e)?e:[e];function D7(e){const t=Array.isArray(e[0])?e[0]:e;return I7(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function R7(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var L7=class{constructor(e){this.value=e}deref(){return this.value}},$7=typeof WeakRef<"u"?WeakRef:L7,z7=0,mN=1;function Wu(){return{s:z7,v:void 0,o:null,p:null}}function VA(e,t={}){let n=Wu();const{resultEqualityCheck:r}=t;let i,a=0;function l(){var m;let u=n;const{length:d}=arguments;for(let v=0,x=d;v<x;v++){const w=arguments[v];if(typeof w=="function"||typeof w=="object"&&w!==null){let S=u.o;S===null&&(u.o=S=new WeakMap);const j=S.get(w);j===void 0?(u=Wu(),S.set(w,u)):u=j}else{let S=u.p;S===null&&(u.p=S=new Map);const j=S.get(w);j===void 0?(u=Wu(),S.set(w,u)):u=j}}const p=u;let h;if(u.s===mN)h=u.v;else if(h=e.apply(null,arguments),a++,r){const v=((m=i==null?void 0:i.deref)==null?void 0:m.call(i))??i;v!=null&&r(v,h)&&(h=v,a!==0&&a--),i=typeof h=="object"&&h!==null||typeof h=="function"?new $7(h):h}return p.s=mN,p.v=h,h}return l.clearCache=()=>{n=Wu(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function F7(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,l=0,u,d={},p=i.pop();typeof p=="object"&&(d=p,p=i.pop()),_7(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const h={...n,...d},{memoize:m,memoizeOptions:v=[],argsMemoize:x=VA,argsMemoizeOptions:w=[]}=h,S=hN(v),j=hN(w),k=D7(i),C=m(function(){return a++,p.apply(null,arguments)},...S),E=x(function(){l++;const P=R7(k,arguments);return u=C.apply(null,P),u},...j);return Object.assign(E,{resultFunc:p,memoizedResultFunc:C,dependencies:k,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:x})};return Object.assign(r,{withTypes:()=>r}),r}var Q=F7(VA),B7=Object.assign((e,t=Q)=>{M7(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((l,u,d)=>(l[n[d]]=u,l),{}))},{withTypes:()=>B7}),f0={},p0={},h0={},gN;function V7(){return gN||(gN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const l=t(r),u=t(i);if(l===u&&l===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?u-l:l-u}return 0};e.compareValues=n})(h0)),h0}var m0={},g0={},vN;function UA(){return vN||(vN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(g0)),g0}var xN;function U7(){return xN||(xN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UA(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,l){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||l!=null&&Object.hasOwn(l,a)}e.isKey=i})(m0)),m0}var yN;function W7(){return yN||(yN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=V7(),n=U7(),r=vx();function i(a,l,u,d){if(a==null)return[];u=d?void 0:u,Array.isArray(a)||(a=Object.values(a)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(x=>String(x));const p=(x,w)=>{let S=x;for(let j=0;j<w.length&&S!=null;++j)S=S[w[j]];return S},h=(x,w)=>w==null||x==null?w:typeof x=="object"&&"key"in x?Object.hasOwn(w,x.key)?w[x.key]:p(w,x.path):typeof x=="function"?x(w):Array.isArray(x)?p(w,x):typeof w=="object"?w[x]:w,m=l.map(x=>(Array.isArray(x)&&x.length===1&&(x=x[0]),x==null||typeof x=="function"||Array.isArray(x)||n.isKey(x)?x:{key:x,path:r.toPath(x)}));return a.map(x=>({original:x,criteria:m.map(w=>h(w,x))})).slice().sort((x,w)=>{for(let S=0;S<m.length;S++){const j=t.compareValues(x.criteria[S],w.criteria[S],u[S]);if(j!==0)return j}return 0}).map(x=>x.original)}e.orderBy=i})(p0)),p0}var v0={},bN;function q7(){return bN||(bN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),l=(u,d)=>{for(let p=0;p<u.length;p++){const h=u[p];Array.isArray(h)&&d<a?l(h,d+1):i.push(h)}};return l(n,0),i}e.flatten=t})(v0)),v0}var x0={},wN;function WA(){return wN||(wN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=BA(),n=bx(),r=DA(),i=LA();function a(l,u,d){return r.isObject(d)&&(typeof u=="number"&&n.isArrayLike(d)&&t.isIndex(u)&&u<d.length||typeof u=="string"&&u in d)?i.isEqualsSameValueZero(d[u],l):!1}e.isIterateeCall=a})(x0)),x0}var jN;function K7(){return jN||(jN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=W7(),n=q7(),r=WA();function i(a,...l){const u=l.length;return u>1&&r.isIterateeCall(a,l[0],l[1])?l=[]:u>2&&r.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(a,n.flatten(l),["asc"])}e.sortBy=i})(f0)),f0}var y0,SN;function H7(){return SN||(SN=1,y0=K7().sortBy),y0}var G7=H7();const Mf=Qr(G7);var qA=e=>e.legend.settings,Y7=e=>e.legend.size,X7=e=>e.legend.payload;Q([X7,qA],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?Mf(r,n):r});var qu=1;function Q7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=b.useState({height:0,left:0,top:0,width:0}),r=b.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),l={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(l.height-t.height)>qu||Math.abs(l.left-t.left)>qu||Math.abs(l.top-t.top)>qu||Math.abs(l.width-t.width)>qu)&&n({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Xt(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 J7=typeof Symbol=="function"&&Symbol.observable||"@@observable",NN=J7,b0=()=>Math.random().toString(36).substring(7).split("").join("."),Z7={INIT:`@@redux/INIT${b0()}`,REPLACE:`@@redux/REPLACE${b0()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${b0()}`},Id=Z7;function Sx(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 KA(e,t,n){if(typeof e!="function")throw new Error(Xt(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Xt(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Xt(1));return n(KA)(e,t)}let r=e,i=t,a=new Map,l=a,u=0,d=!1;function p(){l===a&&(l=new Map,a.forEach((j,k)=>{l.set(k,j)}))}function h(){if(d)throw new Error(Xt(3));return i}function m(j){if(typeof j!="function")throw new Error(Xt(4));if(d)throw new Error(Xt(5));let k=!0;p();const C=u++;return l.set(C,j),function(){if(k){if(d)throw new Error(Xt(6));k=!1,p(),l.delete(C),a=null}}}function v(j){if(!Sx(j))throw new Error(Xt(7));if(typeof j.type>"u")throw new Error(Xt(8));if(typeof j.type!="string")throw new Error(Xt(17));if(d)throw new Error(Xt(9));try{d=!0,i=r(i,j)}finally{d=!1}return(a=l).forEach(C=>{C()}),j}function x(j){if(typeof j!="function")throw new Error(Xt(10));r=j,v({type:Id.REPLACE})}function w(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(Xt(11));function C(){const O=k;O.next&&O.next(h())}return C(),{unsubscribe:j(C)}},[NN](){return this}}}return v({type:Id.INIT}),{dispatch:v,subscribe:m,getState:h,replaceReducer:x,[NN]:w}}function e8(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Id.INIT})>"u")throw new Error(Xt(12));if(typeof n(void 0,{type:Id.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Xt(13))})}function HA(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const l=t[a];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{e8(n)}catch(a){i=a}return function(l={},u){if(i)throw i;let d=!1;const p={};for(let h=0;h<r.length;h++){const m=r[h],v=n[m],x=l[m],w=v(x,u);if(typeof w>"u")throw u&&u.type,new Error(Xt(14));p[m]=w,d=d||w!==x}return d=d||r.length!==Object.keys(l).length,d?p:l}}function Dd(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function t8(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Xt(15))};const l={getState:i.getState,dispatch:(d,...p)=>a(d,...p)},u=e.map(d=>d(l));return a=Dd(...u)(i.dispatch),{...i,dispatch:a}}}function GA(e){return Sx(e)&&"type"in e&&typeof e.type=="string"}var YA=Symbol.for("immer-nothing"),kN=Symbol.for("immer-draftable"),vn=Symbol.for("immer-state");function Nr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Bn=Object,lo=Bn.getPrototypeOf,Rd="constructor",If="prototype",_g="configurable",Ld="enumerable",fd="writable",Kl="value",bi=e=>!!e&&!!e[vn];function Ar(e){var t;return e?XA(e)||Rf(e)||!!e[kN]||!!((t=e[Rd])!=null&&t[kN])||Lf(e)||$f(e):!1}var n8=Bn[If][Rd].toString(),PN=new WeakMap;function XA(e){if(!e||!Nx(e))return!1;const t=lo(e);if(t===null||t===Bn[If])return!0;const n=Bn.hasOwnProperty.call(t,Rd)&&t[Rd];if(n===Object)return!0;if(!Ba(n))return!1;let r=PN.get(n);return r===void 0&&(r=Function.toString.call(n),PN.set(n,r)),r===n8}function Df(e,t,n=!0){hc(e)===0?(n?Reflect.ownKeys(e):Bn.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function hc(e){const t=e[vn];return t?t.type_:Rf(e)?1:Lf(e)?2:$f(e)?3:0}var CN=(e,t,n=hc(e))=>n===2?e.has(t):Bn[If].hasOwnProperty.call(e,t),Mg=(e,t,n=hc(e))=>n===2?e.get(t):e[t],$d=(e,t,n,r=hc(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function r8(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Rf=Array.isArray,Lf=e=>e instanceof Map,$f=e=>e instanceof Set,Nx=e=>typeof e=="object",Ba=e=>typeof e=="function",w0=e=>typeof e=="boolean";function i8(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ui=e=>e.copy_||e.base_,kx=e=>e.modified_?e.copy_:e.base_;function Ig(e,t){if(Lf(e))return new Map(e);if($f(e))return new Set(e);if(Rf(e))return Array[If].slice.call(e);const n=XA(e);if(t===!0||t==="class_only"&&!n){const r=Bn.getOwnPropertyDescriptors(e);delete r[vn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],u=r[l];u[fd]===!1&&(u[fd]=!0,u[_g]=!0),(u.get||u.set)&&(r[l]={[_g]:!0,[fd]:!0,[Ld]:u[Ld],[Kl]:e[l]})}return Bn.create(lo(e),r)}else{const r=lo(e);if(r!==null&&n)return{...e};const i=Bn.create(r);return Bn.assign(i,e)}}function Px(e,t=!1){return zf(e)||bi(e)||!Ar(e)||(hc(e)>1&&Bn.defineProperties(e,{set:Ku,add:Ku,clear:Ku,delete:Ku}),Bn.freeze(e),t&&Df(e,(n,r)=>{Px(r,!0)},!1)),e}function s8(){Nr(2)}var Ku={[Kl]:s8};function zf(e){return e===null||!Nx(e)?!0:Bn.isFrozen(e)}var zd="MapSet",Dg="Patches",ON="ArrayMethods",QA={};function ta(e){const t=QA[e];return t||Nr(0,e),t}var AN=e=>!!QA[e],Hl,JA=()=>Hl,a8=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:AN(zd)?ta(zd):void 0,arrayMethodsPlugin_:AN(ON)?ta(ON):void 0});function EN(e,t){t&&(e.patchPlugin_=ta(Dg),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Rg(e){Lg(e),e.drafts_.forEach(o8),e.drafts_=null}function Lg(e){e===Hl&&(Hl=e.parent_)}var TN=e=>Hl=a8(Hl,e);function o8(e){const t=e[vn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function _N(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[vn].modified_&&(Rg(t),Nr(4)),Ar(e)&&(e=MN(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[vn].base_,e,t)}else e=MN(t,n);return l8(t,e,!0),Rg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==YA?e:void 0}function MN(e,t){if(zf(t))return t;const n=t[vn];if(!n)return Fd(t,e.handledSet_,e);if(!Ff(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);tE(n,e)}return n.copy_}function l8(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Px(t,n)}function ZA(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Ff=(e,t)=>e.scope_===t,c8=[];function eE(e,t,n,r){const i=ui(e),a=e.type_;if(r!==void 0&&Mg(i,r,a)===t){$d(i,r,n,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;Df(i,(d,p)=>{if(bi(p)){const h=u.get(p)||[];h.push(d),u.set(p,h)}})}const l=e.draftLocations_.get(t)??c8;for(const u of l)$d(i,u,n,a)}function u8(e,t,n){e.callbacks_.push(function(i){var u;const a=t;if(!a||!Ff(a,i))return;(u=i.mapSetPlugin_)==null||u.fixSetContents(a);const l=kx(a);eE(e,a.draft_??a,l,n),tE(a,i)})}function tE(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}ZA(e)}}function d8(e,t,n){const{scope_:r}=e;if(bi(n)){const i=n[vn];Ff(i,r)&&i.callbacks_.push(function(){pd(e);const l=kx(i);eE(e,n,l,t)})}else Ar(n)&&e.callbacks_.push(function(){const a=ui(e);e.type_===3?a.has(n)&&Fd(n,r.handledSet_,r):Mg(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Fd(Mg(e.copy_,t,e.type_),r.handledSet_,r)})}function Fd(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||bi(e)||t.has(e)||!Ar(e)||zf(e)||(t.add(e),Df(e,(r,i)=>{if(bi(i)){const a=i[vn];if(Ff(a,n)){const l=kx(a);$d(e,r,l,e.type_),ZA(a)}}else Ar(i)&&Fd(i,t,n)})),e}function f8(e,t){const n=Rf(e),r={type_:n?1:0,scope_:t?t.scope_:JA(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Bd;n&&(i=[r],a=Gl);const{revoke:l,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=l,[u,r]}var Bd={get(e,t){if(t===vn)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=ui(e);if(!CN(i,t,e.type_))return p8(e,i,t);const a=i[t];if(e.finalized_||!Ar(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&i8(t))return a;if(a===j0(e.base_,t)){pd(e);const l=e.type_===1?+t:t,u=zg(e.scope_,a,e,l);return e.copy_[l]=u}return a},has(e,t){return t in ui(e)},ownKeys(e){return Reflect.ownKeys(ui(e))},set(e,t,n){const r=nE(ui(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=j0(ui(e),t),a=i==null?void 0:i[vn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(r8(n,i)&&(n!==void 0||CN(e.base_,t,e.type_)))return!0;pd(e),$g(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),d8(e,t,n)),!0},deleteProperty(e,t){return pd(e),j0(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),$g(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ui(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[fd]:!0,[_g]:e.type_!==1||t!=="length",[Ld]:r[Ld],[Kl]:n[t]}},defineProperty(){Nr(11)},getPrototypeOf(e){return lo(e.base_)},setPrototypeOf(){Nr(12)}},Gl={};for(let e in Bd){let t=Bd[e];Gl[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Gl.deleteProperty=function(e,t){return Gl.set.call(this,e,t,void 0)};Gl.set=function(e,t,n){return Bd.set.call(this,e[0],t,n,e[0])};function j0(e,t){const n=e[vn];return(n?ui(n):e)[t]}function p8(e,t,n){var i;const r=nE(t,n);return r?Kl in r?r[Kl]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function nE(e,t){if(!(t in e))return;let n=lo(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=lo(n)}}function $g(e){e.modified_||(e.modified_=!0,e.parent_&&$g(e.parent_))}function pd(e){e.copy_||(e.assigned_=new Map,e.copy_=Ig(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var h8=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Ba(n)&&!Ba(r)){const l=r;r=n;const u=this;return function(p=l,...h){return u.produce(p,m=>r.call(this,m,...h))}}Ba(r)||Nr(6),i!==void 0&&!Ba(i)&&Nr(7);let a;if(Ar(n)){const l=TN(this),u=zg(l,n,void 0);let d=!0;try{a=r(u),d=!1}finally{d?Rg(l):Lg(l)}return EN(l,i),_N(a,l)}else if(!n||!Nx(n)){if(a=r(n),a===void 0&&(a=n),a===YA&&(a=void 0),this.autoFreeze_&&Px(a,!0),i){const l=[],u=[];ta(Dg).generateReplacementPatches_(n,a,{patches_:l,inversePatches_:u}),i(l,u)}return a}else Nr(1,n)},this.produceWithPatches=(n,r)=>{if(Ba(n))return(u,...d)=>this.produceWithPatches(u,p=>n(p,...d));let i,a;return[this.produce(n,r,(u,d)=>{i=u,a=d}),i,a]},w0(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),w0(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),w0(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Ar(t)||Nr(8),bi(t)&&(t=Cr(t));const n=TN(this),r=zg(n,t,void 0);return r[vn].isManual_=!0,Lg(n),r}finishDraft(t,n){const r=t&&t[vn];(!r||!r.isManual_)&&Nr(9);const{scope_:i}=r;return EN(i,n),_N(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=ta(Dg).applyPatches_;return bi(t)?i(t,n):this.produce(t,a=>i(a,n))}};function zg(e,t,n,r){const[i,a]=Lf(t)?ta(zd).proxyMap_(t,n):$f(t)?ta(zd).proxySet_(t,n):f8(t,n);return((n==null?void 0:n.scope_)??JA()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?u8(n,a,r):a.callbacks_.push(function(d){var h;(h=d.mapSetPlugin_)==null||h.fixSetContents(a);const{patchPlugin_:p}=d;a.modified_&&p&&p.generatePatches_(a,[],d)}),i}function Cr(e){return bi(e)||Nr(10,e),rE(e)}function rE(e){if(!Ar(e)||zf(e))return e;const t=e[vn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ig(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Ig(e,!0);return Df(n,(i,a)=>{$d(n,i,rE(a))},r),t&&(t.finalized_=!1),n}var m8=new h8,iE=m8.produce;function sE(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var g8=sE(),v8=sE,x8=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Dd:Dd.apply(null,arguments)};function lr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Un(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>GA(r)&&r.type===e,n}var aE=class Al extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Al.prototype)}static get[Symbol.species](){return Al}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Al(...t[0].concat(this)):new Al(...t.concat(this))}};function IN(e){return Ar(e)?iE(e,()=>{}):e}function Hu(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function y8(e){return typeof e=="boolean"}var b8=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new aE;return n&&(y8(n)?l.push(g8):l.push(v8(n.extraArgument))),l},oE="RTK_autoBatch",ft=()=>e=>({payload:e,meta:{[oE]:!0}}),DN=e=>t=>{setTimeout(t,e)},lE=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,l=!1;const u=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:DN(10):e.type==="callback"?e.queueNotification:DN(e.timeout),p=()=>{l=!1,a&&(a=!1,u.forEach(h=>h()))};return Object.assign({},r,{subscribe(h){const m=()=>i&&h(),v=r.subscribe(m);return u.add(h),()=>{v(),u.delete(h)}},dispatch(h){var m;try{return i=!((m=h==null?void 0:h.meta)!=null&&m[oE]),a=!i,a&&(l||(l=!0,d(p))),r.dispatch(h)}finally{i=!0}}})},w8=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new aE(e);return r&&i.push(lE(typeof r=="object"?r:void 0)),i};function j8(e){const t=b8(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:l=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(Sx(n))u=HA(n);else throw new Error(Un(1));let d;typeof r=="function"?d=r(t):d=t();let p=Dd;i&&(p=x8({trace:!1,...typeof i=="object"&&i}));const h=t8(...d),m=w8(h);let v=typeof l=="function"?l(m):m();const x=p(...v);return KA(u,a,x)}function cE(e){const t={},n=[];let r;const i={addCase(a,l){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(Un(28));if(u in t)throw new Error(Un(29));return t[u]=l,i},addAsyncThunk(a,l){return l.pending&&(t[a.pending.type]=l.pending),l.rejected&&(t[a.rejected.type]=l.rejected),l.fulfilled&&(t[a.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:a.settled,reducer:l.settled}),i},addMatcher(a,l){return n.push({matcher:a,reducer:l}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function S8(e){return typeof e=="function"}function N8(e,t){let[n,r,i]=cE(t),a;if(S8(e))a=()=>IN(e());else{const u=IN(e);a=()=>u}function l(u=a(),d){let p=[n[d.type],...r.filter(({matcher:h})=>h(d)).map(({reducer:h})=>h)];return p.filter(h=>!!h).length===0&&(p=[i]),p.reduce((h,m)=>{if(m)if(bi(h)){const x=m(h,d);return x===void 0?h:x}else{if(Ar(h))return iE(h,v=>m(v,d));{const v=m(h,d);if(v===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return h},u)}return l.getInitialState=a,l}var k8="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",P8=(e=21)=>{let t="",n=e;for(;n--;)t+=k8[Math.random()*64|0];return t},C8=Symbol.for("rtk-slice-createasyncthunk");function O8(e,t){return`${e}/${t}`}function A8({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[C8];return function(i){const{name:a,reducerPath:l=a}=i;if(!a)throw new Error(Un(11));const u=(typeof i.reducers=="function"?i.reducers(T8()):i.reducers)||{},d=Object.keys(u),p={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(O,P){const A=typeof O=="string"?O:O.type;if(!A)throw new Error(Un(12));if(A in p.sliceCaseReducersByType)throw new Error(Un(13));return p.sliceCaseReducersByType[A]=P,h},addMatcher(O,P){return p.sliceMatchers.push({matcher:O,reducer:P}),h},exposeAction(O,P){return p.actionCreators[O]=P,h},exposeCaseReducer(O,P){return p.sliceCaseReducersByName[O]=P,h}};d.forEach(O=>{const P=u[O],A={reducerName:O,type:O8(a,O),createNotation:typeof i.reducers=="function"};M8(P)?D8(A,P,h,t):_8(A,P,h)});function m(){const[O={},P=[],A=void 0]=typeof i.extraReducers=="function"?cE(i.extraReducers):[i.extraReducers],_={...O,...p.sliceCaseReducersByType};return N8(i.initialState,D=>{for(let $ in _)D.addCase($,_[$]);for(let $ of p.sliceMatchers)D.addMatcher($.matcher,$.reducer);for(let $ of P)D.addMatcher($.matcher,$.reducer);A&&D.addDefaultCase(A)})}const v=O=>O,x=new Map,w=new WeakMap;let S;function j(O,P){return S||(S=m()),S(O,P)}function k(){return S||(S=m()),S.getInitialState()}function C(O,P=!1){function A(D){let $=D[O];return typeof $>"u"&&P&&($=Hu(w,A,k)),$}function _(D=v){const $=Hu(x,P,()=>new WeakMap);return Hu($,D,()=>{const q={};for(const[X,L]of Object.entries(i.selectors??{}))q[X]=E8(L,D,()=>Hu(w,D,k),P);return q})}return{reducerPath:O,getSelectors:_,get selectors(){return _(A)},selectSlice:A}}const E={name:a,reducer:j,actions:p.actionCreators,caseReducers:p.sliceCaseReducersByName,getInitialState:k,...C(l),injectInto(O,{reducerPath:P,...A}={}){const _=P??l;return O.inject({reducerPath:_,reducer:j},A),{...E,...C(_,!0)}}};return E}}function E8(e,t,n,r){function i(a,...l){let u=t(a);return typeof u>"u"&&r&&(u=n()),e(u,...l)}return i.unwrapped=e,i}var _n=A8();function T8(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function _8({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!I8(r))throw new Error(Un(17));a=r.reducer,l=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?lr(e,l):lr(e))}function M8(e){return e._reducerDefinitionType==="asyncThunk"}function I8(e){return e._reducerDefinitionType==="reducerWithPrepare"}function D8({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Un(18));const{payloadCreator:a,fulfilled:l,pending:u,rejected:d,settled:p,options:h}=n,m=i(e,a,h);r.exposeAction(t,m),l&&r.addCase(m.fulfilled,l),u&&r.addCase(m.pending,u),d&&r.addCase(m.rejected,d),p&&r.addMatcher(m.settled,p),r.exposeCaseReducer(t,{fulfilled:l||Gu,pending:u||Gu,rejected:d||Gu,settled:p||Gu})}function Gu(){}var R8="task",uE="listener",dE="completed",Cx="cancelled",L8=`task-${Cx}`,$8=`task-${dE}`,Fg=`${uE}-${Cx}`,z8=`${uE}-${dE}`,Bf=class{constructor(e){Qh(this,"name","TaskAbortError");Qh(this,"message");this.code=e,this.message=`${R8} ${Cx} (reason: ${e})`}},Ox=(e,t)=>{if(typeof e!="function")throw new TypeError(Un(32))},Vd=()=>{},fE=(e,t=Vd)=>(e.catch(t),e),pE=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ys=e=>{if(e.aborted)throw new Bf(e.reason)};function hE(e,t){let n=Vd;return new Promise((r,i)=>{const a=()=>i(new Bf(e.reason));if(e.aborted){a();return}n=pE(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Vd})}var F8=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Bf?"cancelled":"rejected",error:n}}finally{t==null||t()}},Ud=e=>t=>fE(hE(e,t).then(n=>(Ys(e),n))),mE=e=>{const t=Ud(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Za}=Object,RN={},Vf="listenerMiddleware",B8=(e,t)=>{const n=r=>pE(e,()=>r.abort(e.reason));return(r,i)=>{Ox(r);const a=new AbortController;n(a);const l=F8(async()=>{Ys(e),Ys(a.signal);const u=await r({pause:Ud(a.signal),delay:mE(a.signal),signal:a.signal});return Ys(a.signal),u},()=>a.abort($8));return i!=null&&i.autoJoin&&t.push(l.catch(Vd)),{result:Ud(e)(l),cancel(){a.abort(L8)}}}},V8=(e,t)=>{const n=async(r,i)=>{Ys(t);let a=()=>{};const u=[new Promise((d,p)=>{let h=e({predicate:r,effect:(m,v)=>{v.unsubscribe(),d([m,v.getState(),v.getOriginalState()])}});a=()=>{h(),p()}})];i!=null&&u.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await hE(t,Promise.race(u));return Ys(t),d}finally{a()}};return(r,i)=>fE(n(r,i))},gE=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=lr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Un(21));return Ox(a),{predicate:i,type:t,effect:a}},vE=Za(e=>{const{type:t,predicate:n,effect:r}=gE(e);return{id:P8(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Un(22))}}},{withTypes:()=>vE}),LN=(e,t)=>{const{type:n,effect:r,predicate:i}=gE(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},Bg=e=>{e.pending.forEach(t=>{t.abort(Fg)})},U8=(e,t)=>()=>{for(const n of t.keys())Bg(n);e.clear()},$N=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},xE=Za(lr(`${Vf}/add`),{withTypes:()=>xE}),W8=lr(`${Vf}/removeAll`),yE=Za(lr(`${Vf}/remove`),{withTypes:()=>yE}),q8=(...e)=>{console.error(`${Vf}/error`,...e)},mc=(e={})=>{const t=new Map,n=new Map,r=x=>{const w=n.get(x)??0;n.set(x,w+1)},i=x=>{const w=n.get(x)??1;w===1?n.delete(x):n.set(x,w-1)},{extra:a,onError:l=q8}=e;Ox(l);const u=x=>(x.unsubscribe=()=>t.delete(x.id),t.set(x.id,x),w=>{x.unsubscribe(),w!=null&&w.cancelActive&&Bg(x)}),d=x=>{const w=LN(t,x)??vE(x);return u(w)};Za(d,{withTypes:()=>d});const p=x=>{const w=LN(t,x);return w&&(w.unsubscribe(),x.cancelActive&&Bg(w)),!!w};Za(p,{withTypes:()=>p});const h=async(x,w,S,j)=>{const k=new AbortController,C=V8(d,k.signal),E=[];try{x.pending.add(k),r(x),await Promise.resolve(x.effect(w,Za({},S,{getOriginalState:j,condition:(O,P)=>C(O,P).then(Boolean),take:C,delay:mE(k.signal),pause:Ud(k.signal),extra:a,signal:k.signal,fork:B8(k.signal,E),unsubscribe:x.unsubscribe,subscribe:()=>{t.set(x.id,x)},cancelActiveListeners:()=>{x.pending.forEach((O,P,A)=>{O!==k&&(O.abort(Fg),A.delete(O))})},cancel:()=>{k.abort(Fg),x.pending.delete(k)},throwIfCancelled:()=>{Ys(k.signal)}})))}catch(O){O instanceof Bf||$N(l,O,{raisedBy:"effect"})}finally{await Promise.all(E),k.abort(z8),i(x),x.pending.delete(k)}},m=U8(t,n);return{middleware:x=>w=>S=>{if(!GA(S))return w(S);if(xE.match(S))return d(S.payload);if(W8.match(S)){m();return}if(yE.match(S))return p(S.payload);let j=x.getState();const k=()=>{if(j===RN)throw new Error(Un(23));return j};let C;try{if(C=w(S),t.size>0){const E=x.getState(),O=Array.from(t.values());for(const P of O){let A=!1;try{A=P.predicate(S,E,j)}catch(_){A=!1,$N(l,_,{raisedBy:"predicate"})}A&&h(P,S,x,k)}}}finally{j=RN}return C},startListening:d,stopListening:p,clearListeners:m}};function Un(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var K8={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},bE=_n({name:"chartLayout",initialState:K8,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:H8,setLayout:G8,setChartSize:Y8,setScale:X8}=bE.actions,Q8=bE.reducer;function wE(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Ke(e){return Number.isFinite(e)}function ms(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function zN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ya(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zN(Object(n),!0).forEach(function(r){J8(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function J8(e,t,n){return(t=Z8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z8(e){var t=eV(e,"string");return typeof t=="symbol"?t:t+""}function eV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tn(e,t,n){return Ut(e)||Ut(t)?n:Yr(t)?oo(e,t,n):typeof t=="function"?t(e):n}var tV=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:l,layout:u}=t;if((u==="vertical"||u==="horizontal"&&l==="middle")&&a!=="center"&&Ne(e[a]))return Ya(Ya({},e),{},{[a]:e[a]+(r||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&l!=="middle"&&Ne(e[l]))return Ya(Ya({},e),{},{[l]:e[l]+(i||0)})}return e},vs=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",nV=(e,t)=>{if(!t||t.length!==2||!Ne(t[0])||!Ne(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Ne(e[0])||e[0]<n)&&(i[0]=n),(!Ne(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},rV=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,l=0,u=0;u<n;++u){var d=e[u],p=d==null?void 0:d[i];if(p!=null){var h=p[1],m=p[0],v=Gr(h)?m:h;v>=0?(p[0]=a,a+=v,p[1]=a):(p[0]=l,l+=v,p[1]=l)}}}},iV=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,l=0;l<n;++l){var u=e[l],d=u==null?void 0:u[i];if(d!=null){var p=Gr(d[1])?d[0]:d[1];p>=0?(d[0]=a,a+=p,d[1]=a):(d[0]=0,d[1]=0)}}}},sV={sign:rV,expand:TB,none:Zs,silhouette:_B,wiggle:MB,positive:iV},aV=(e,t,n)=>{var r,i=(r=sV[n])!==null&&r!==void 0?r:Zs,a=EB().keys(t).value((u,d)=>Number(tn(u,d,0))).order(Eg).offset(i),l=a(e);return l.forEach((u,d)=>{u.forEach((p,h)=>{var m=tn(e[h],t[d],0);Array.isArray(m)&&m.length===2&&Ne(m[0])&&Ne(m[1])&&(p[0]=m[0],p[1]=m[1])})}),l};function oV(e){return e==null?void 0:String(e)}var FN=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:l}=e;if(t.type==="category")return n[l]?n[l].coordinate+r:null;var u=tn(a,t.dataKey,t.scale.domain()[l]);if(Ut(u))return null;var d=t.scale.map(u);return Ne(d)?d-i/2+r:null},lV=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},cV=e=>{var t=e.flat(2).filter(Ne);return[Math.min(...t),Math.max(...t)]},uV=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],dV=(e,t,n)=>{if(e!=null)return uV(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:l}=a,u=l.reduce((d,p)=>{var h=wE(p,t,n),m=cV(h);return!Ke(m[0])||!Ke(m[1])?d:[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(u[0],r[0]),Math.max(u[1],r[1])]},[1/0,-1/0]))},BN=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,VN=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Wd=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=Mf(t,h=>h.coordinate),a=1/0,l=1,u=i.length;l<u;l++){var d=i[l],p=i[l-1];a=Math.min(((d==null?void 0:d.coordinate)||0)-((p==null?void 0:p.coordinate)||0),a)}return a===1/0?0:a}return n?void 0:0};function UN(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Ya(Ya({},t),{},{dataKey:n,payload:r,value:i,name:a})}function jE(e,t){if(e)return String(e);if(typeof t=="string")return t}var fV=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},pV=(e,t)=>t==="centric"?e.angle:e.radius,Ci=e=>e.layout.width,Oi=e=>e.layout.height,hV=e=>e.layout.scale,SE=e=>e.layout.margin,Uf=Q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Wf=Q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),mV="data-recharts-item-index",gV="data-recharts-item-id",gc=60;function WN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WN(Object(n),!0).forEach(function(r){vV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vV(e,t,n){return(t=xV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xV(e){var t=yV(e,"string");return typeof t=="symbol"?t:t+""}function yV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bV=e=>e.brush.height;function wV(e){var t=Wf(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:gc;return n+i}return n},0)}function jV(e){var t=Wf(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:gc;return n+i}return n},0)}function SV(e){var t=Uf(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function NV(e){var t=Uf(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Wt=Q([Ci,Oi,SE,bV,wV,jV,SV,NV,qA,Y7],(e,t,n,r,i,a,l,u,d,p)=>{var h={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+l,bottom:(n.bottom||0)+u},v=Yu(Yu({},m),h),x=v.bottom;v.bottom+=r,v=tV(v,d,p);var w=e-v.left-v.right,S=t-v.top-v.bottom;return Yu(Yu({brushBottom:x},v),{},{width:Math.max(w,0),height:Math.max(S,0)})}),kV=Q(Wt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Ax=Q(Ci,Oi,(e,t)=>({x:0,y:0,width:e,height:t})),PV=b.createContext(null),Kn=()=>b.useContext(PV)!=null,qf=e=>e.brush,Kf=Q([qf,Wt,SE],(e,t,n)=>({height:e.height,x:Ne(e.x)?e.x:t.left,y:Ne(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Ne(e.width)?e.width:t.width})),S0={},N0={},k0={},qN;function CV(){return qN||(qN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let l,u=null;const d=a!=null&&a.includes("leading"),p=a==null||a.includes("trailing"),h=()=>{u!==null&&(n.apply(l,u),l=void 0,u=null)},m=()=>{p&&h(),S()};let v=null;const x=()=>{v!=null&&clearTimeout(v),v=setTimeout(()=>{v=null,m()},r)},w=()=>{v!==null&&(clearTimeout(v),v=null)},S=()=>{w(),l=void 0,u=null},j=()=>{h()},k=function(...C){if(i!=null&&i.aborted)return;l=this,u=C;const E=v==null;x(),d&&E&&h()};return k.schedule=x,k.cancel=S,k.flush=j,i==null||i.addEventListener("abort",S,{once:!0}),k}e.debounce=t})(k0)),k0}var KN;function OV(){return KN||(KN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CV();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:u=!0,maxWait:d}=a,p=Array(2);l&&(p[0]="leading"),u&&(p[1]="trailing");let h,m=null;const v=t.debounce(function(...S){h=r.apply(this,S),m=null},i,{edges:p}),x=function(...S){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(h=r.apply(this,S),m=Date.now(),v.cancel(),v.schedule(),h):(v.apply(this,S),h)},w=()=>(v.flush(),h);return x.cancel=v.cancel,x.flush=w,x}e.debounce=n})(N0)),N0}var HN;function AV(){return HN||(HN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=OV();function n(r,i=0,a={}){const{leading:l=!0,trailing:u=!0}=a;return t.debounce(r,i,{leading:l,maxWait:i,trailing:u})}e.throttle=n})(S0)),S0}var P0,GN;function EV(){return GN||(GN=1,P0=AV().throttle),P0}var TV=EV();const _V=Qr(TV);var YN=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},Br={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},NE=(e,t,n)=>{var{width:r=Br.width,height:i=Br.height,aspect:a,maxHeight:l}=n,u=ea(r)?e:Number(r),d=ea(i)?t:Number(i);return a&&a>0&&(u?d=u/a:d&&(u=d*a),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:u,calculatedHeight:d}},MV={width:0,height:0,overflow:"visible"},IV={width:0,overflowX:"visible"},DV={height:0,overflowY:"visible"},RV={},LV=e=>{var{width:t,height:n}=e,r=ea(t),i=ea(n);return r&&i?MV:r?IV:i?DV:RV};function $V(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Br.width,a=Br.height):i===void 0?i=r&&r>0?void 0:Br.width:a===void 0&&(a=r&&r>0?void 0:Br.height),{width:i,height:a}}function Vg(){return Vg=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},Vg.apply(null,arguments)}function XN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function QN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XN(Object(n),!0).forEach(function(r){zV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zV(e,t,n){return(t=FV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FV(e){var t=BV(e,"string");return typeof t=="symbol"?t:t+""}function BV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kE=b.createContext(Br.initialDimension);function VV(e){return ms(e.width)&&ms(e.height)}function PE(e){var{children:t,width:n,height:r}=e,i=b.useMemo(()=>({width:n,height:r}),[n,r]);return VV(i)?b.createElement(kE.Provider,{value:i},t):null}var Ex=()=>b.useContext(kE),UV=b.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Br.initialDimension,width:i,height:a,minWidth:l=Br.minWidth,minHeight:u,maxHeight:d,children:p,debounce:h=Br.debounce,id:m,className:v,onResize:x,style:w={}}=e,S=b.useRef(null),j=b.useRef();j.current=x,b.useImperativeHandle(t,()=>S.current);var[k,C]=b.useState({containerWidth:r.width,containerHeight:r.height}),E=b.useCallback((D,$)=>{C(q=>{var X=Math.round(D),L=Math.round($);return q.containerWidth===X&&q.containerHeight===L?q:{containerWidth:X,containerHeight:L}})},[]);b.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return jo;var D=L=>{var Z,J=L[0];if(J!=null){var{width:ne,height:re}=J.contentRect;E(ne,re),(Z=j.current)===null||Z===void 0||Z.call(j,ne,re)}};h>0&&(D=_V(D,h,{trailing:!0,leading:!1}));var $=new ResizeObserver(D),{width:q,height:X}=S.current.getBoundingClientRect();return E(q,X),$.observe(S.current),()=>{$.disconnect()}},[E,h]);var{containerWidth:O,containerHeight:P}=k;YN(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:A,calculatedHeight:_}=NE(O,P,{width:i,height:a,aspect:n,maxHeight:d});return YN(A!=null&&A>0||_!=null&&_>0,`The width(%s) and height(%s) of chart should be greater than 0,
305
+ please check the style of container, or the props width(%s) and height(%s),
306
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
307
+ height and width.`,A,_,i,a,l,u,n),b.createElement("div",{id:m?"".concat(m):void 0,className:st("recharts-responsive-container",v),style:QN(QN({},w),{},{width:i,height:a,minWidth:l,minHeight:u,maxHeight:d}),ref:S},b.createElement("div",{style:LV({width:i,height:a})},b.createElement(PE,{width:A,height:_},p)))}),WV=b.forwardRef((e,t)=>{var n=Ex();if(ms(n.width)&&ms(n.height))return e.children;var{width:r,height:i}=$V({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=NE(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Ne(a)&&Ne(l)?b.createElement(PE,{width:a,height:l},e.children):b.createElement(UV,Vg({},e,{width:r,height:i,ref:t}))});function Tx(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Hf=()=>{var e,t=Kn(),n=Ae(kV),r=Ae(Kf),i=(e=Ae(qf))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},qV={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},KV=()=>{var e;return(e=Ae(Wt))!==null&&e!==void 0?e:qV},HV=()=>Ae(Ci),GV=()=>Ae(Oi),nt=e=>e.layout.layoutType,So=()=>Ae(nt),CE=()=>{var e=So();if(e==="horizontal"||e==="vertical")return e},OE=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},YV=()=>{var e=So();return e!==void 0},vc=e=>{var t=Nt(),n=Kn(),{width:r,height:i}=e,a=Ex(),l=r,u=i;return a&&(l=a.width>0?a.width:r,u=a.height>0?a.height:i),b.useEffect(()=>{!n&&ms(l)&&ms(u)&&t(Y8({width:l,height:u}))},[t,n,l,u]),null},AE=Symbol.for("immer-nothing"),JN=Symbol.for("immer-draftable"),qn=Symbol.for("immer-state");function kr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Yl=Object.getPrototypeOf;function co(e){return!!e&&!!e[qn]}function na(e){var t;return e?EE(e)||Array.isArray(e)||!!e[JN]||!!((t=e.constructor)!=null&&t[JN])||xc(e)||Yf(e):!1}var XV=Object.prototype.constructor.toString(),ZN=new WeakMap;function EE(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=ZN.get(n);return r===void 0&&(r=Function.toString.call(n),ZN.set(n,r)),r===XV}function qd(e,t,n=!0){Gf(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Gf(e){const t=e[qn];return t?t.type_:Array.isArray(e)?1:xc(e)?2:Yf(e)?3:0}function Ug(e,t){return Gf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function TE(e,t,n){const r=Gf(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function QV(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xc(e){return e instanceof Map}function Yf(e){return e instanceof Set}function Vs(e){return e.copy_||e.base_}function Wg(e,t){if(xc(e))return new Map(e);if(Yf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=EE(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[qn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],u=r[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(Yl(e),r)}else{const r=Yl(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function _x(e,t=!1){return Xf(e)||co(e)||!na(e)||(Gf(e)>1&&Object.defineProperties(e,{set:Xu,add:Xu,clear:Xu,delete:Xu}),Object.freeze(e),t&&Object.values(e).forEach(n=>_x(n,!0))),e}function JV(){kr(2)}var Xu={value:JV};function Xf(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var ZV={};function ra(e){const t=ZV[e];return t||kr(0,e),t}var Xl;function _E(){return Xl}function eU(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ek(e,t){t&&(ra("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function qg(e){Kg(e),e.drafts_.forEach(tU),e.drafts_=null}function Kg(e){e===Xl&&(Xl=e.parent_)}function tk(e){return Xl=eU(Xl,e)}function tU(e){const t=e[qn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function nk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[qn].modified_&&(qg(t),kr(4)),na(e)&&(e=Kd(t,e),t.parent_||Hd(t,e)),t.patches_&&ra("Patches").generateReplacementPatches_(n[qn].base_,e,t.patches_,t.inversePatches_)):e=Kd(t,n,[]),qg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==AE?e:void 0}function Kd(e,t,n){if(Xf(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[qn];if(!i)return qd(t,(a,l)=>rk(e,i,t,a,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Hd(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let l=a,u=!1;i.type_===3&&(l=new Set(a),a.clear(),u=!0),qd(l,(d,p)=>rk(e,i,a,d,p,n,u),r),Hd(e,a,!1),n&&e.patches_&&ra("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function rk(e,t,n,r,i,a,l){if(i==null||typeof i!="object"&&!l)return;const u=Xf(i);if(!(u&&!l)){if(co(i)){const d=a&&t&&t.type_!==3&&!Ug(t.assigned_,r)?a.concat(r):void 0,p=Kd(e,i,d);if(TE(n,r,p),co(p))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(na(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;Kd(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(xc(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Hd(e,i)}}}function Hd(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_x(t,n)}function nU(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:_E(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=Mx;n&&(i=[r],a=Ql);const{revoke:l,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=l,u}var Mx={get(e,t){if(t===qn)return e;const n=Vs(e);if(!Ug(n,t))return rU(e,n,t);const r=n[t];return e.finalized_||!na(r)?r:r===C0(e.base_,t)?(O0(e),e.copy_[t]=Gg(r,e)):r},has(e,t){return t in Vs(e)},ownKeys(e){return Reflect.ownKeys(Vs(e))},set(e,t,n){const r=ME(Vs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=C0(Vs(e),t),a=i==null?void 0:i[qn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(QV(n,i)&&(n!==void 0||Ug(e.base_,t)))return!0;O0(e),Hg(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return C0(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,O0(e),Hg(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Vs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){kr(11)},getPrototypeOf(e){return Yl(e.base_)},setPrototypeOf(){kr(12)}},Ql={};qd(Mx,(e,t)=>{Ql[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ql.deleteProperty=function(e,t){return Ql.set.call(this,e,t,void 0)};Ql.set=function(e,t,n){return Mx.set.call(this,e[0],t,n,e[0])};function C0(e,t){const n=e[qn];return(n?Vs(n):e)[t]}function rU(e,t,n){var i;const r=ME(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function ME(e,t){if(!(t in e))return;let n=Yl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Yl(n)}}function Hg(e){e.modified_||(e.modified_=!0,e.parent_&&Hg(e.parent_))}function O0(e){e.copy_||(e.copy_=Wg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var iU=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const l=this;return function(d=a,...p){return l.produce(d,h=>n.call(this,h,...p))}}typeof n!="function"&&kr(6),r!==void 0&&typeof r!="function"&&kr(7);let i;if(na(t)){const a=tk(this),l=Gg(t,void 0);let u=!0;try{i=n(l),u=!1}finally{u?qg(a):Kg(a)}return ek(a,r),nk(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===AE&&(i=void 0),this.autoFreeze_&&_x(i,!0),r){const a=[],l=[];ra("Patches").generateReplacementPatches_(t,i,a,l),r(a,l)}return i}else kr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...u)=>this.produceWithPatches(l,d=>t(d,...u));let r,i;return[this.produce(t,n,(l,u)=>{r=l,i=u}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){na(e)||kr(8),co(e)&&(e=sU(e));const t=tk(this),n=Gg(e,void 0);return n[qn].isManual_=!0,Kg(t),n}finishDraft(e,t){const n=e&&e[qn];(!n||!n.isManual_)&&kr(9);const{scope_:r}=n;return ek(r,t),nk(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=ra("Patches").applyPatches_;return co(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Gg(e,t){const n=xc(e)?ra("MapSet").proxyMap_(e,t):Yf(e)?ra("MapSet").proxySet_(e,t):nU(e,t);return(t?t.scope_:_E()).drafts_.push(n),n}function sU(e){return co(e)||kr(10,e),IE(e)}function IE(e){if(!na(e)||Xf(e))return e;const t=e[qn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Wg(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Wg(e,!0);return qd(n,(i,a)=>{TE(n,i,IE(a))},r),t&&(t.finalized_=!1),n}var aU=new iU;aU.produce;var oU={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},DE=_n({name:"legend",initialState:oU,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:ft()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Cr(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:ft()},removeLegendPayload:{reducer(e,t){var n=Cr(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:ft()}}}),{setLegendSize:kte,setLegendSettings:Pte,addLegendPayload:lU,replaceLegendPayload:cU,removeLegendPayload:uU}=DE.actions,dU=DE.reducer;function Yg(){return Yg=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},Yg.apply(null,arguments)}function ik(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ik(Object(n),!0).forEach(function(r){fU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ik(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fU(e,t,n){return(t=pU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pU(e){var t=hU(e,"string");return typeof t=="symbol"?t:t+""}function hU(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mU(e){return Array.isArray(e)&&Yr(e[0])&&Yr(e[1])?e.join(" ~ "):e}var La={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1},gU=e=>{var{separator:t=La.separator,contentStyle:n,itemStyle:r,labelStyle:i=La.labelStyle,payload:a,formatter:l,itemSorter:u,wrapperClassName:d,labelClassName:p,label:h,labelFormatter:m,accessibilityLayer:v=La.accessibilityLayer}=e,x=()=>{if(a&&a.length){var P={padding:0,margin:0},A=(u?Mf(a,u):a).map((_,D)=>{if(_.type==="none")return null;var $=_.formatter||l||mU,{value:q,name:X}=_,L=q,Z=X;if($){var J=$(q,X,_,D,a);if(Array.isArray(J))[L,Z]=J;else if(J!=null)L=J;else return null}var ne=vl(vl({},La.itemStyle),{},{color:_.color||La.itemStyle.color},r);return b.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:ne},Yr(Z)?b.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,Yr(Z)?b.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,b.createElement("span",{className:"recharts-tooltip-item-value"},L),b.createElement("span",{className:"recharts-tooltip-item-unit"},_.unit||""))});return b.createElement("ul",{className:"recharts-tooltip-item-list",style:P},A)}return null},w=vl(vl({},La.contentStyle),n),S=vl({margin:0},i),j=!Ut(h),k=j?h:"",C=st("recharts-default-tooltip",d),E=st("recharts-tooltip-label",p);j&&m&&a!==void 0&&a!==null&&(k=m(h,a));var O=v?{role:"status","aria-live":"assertive"}:{};return b.createElement("div",Yg({className:C,style:w},O),b.createElement("p",{className:E,style:S},b.isValidElement(k)?k:"".concat(k)),x())},xl="recharts-tooltip-wrapper",vU={visibility:"hidden"};function xU(e){var{coordinate:t,translateX:n,translateY:r}=e;return st(xl,{["".concat(xl,"-right")]:Ne(n)&&t&&Ne(t.x)&&n>=t.x,["".concat(xl,"-left")]:Ne(n)&&t&&Ne(t.x)&&n<t.x,["".concat(xl,"-bottom")]:Ne(r)&&t&&Ne(t.y)&&r>=t.y,["".concat(xl,"-top")]:Ne(r)&&t&&Ne(t.y)&&r<t.y})}function sk(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:l,tooltipDimension:u,viewBox:d,viewBoxDimension:p}=e;if(a&&Ne(a[r]))return a[r];var h=n[r]-u-(i>0?i:0),m=n[r]+i;if(t[r])return l[r]?h:m;var v=d[r];if(v==null)return 0;if(l[r]){var x=h,w=v;return x<w?Math.max(m,v):Math.max(h,v)}if(p==null)return 0;var S=m+u,j=v+p;return S>j?Math.max(h,v):Math.max(m,v)}function yU(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function bU(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:l,tooltipBox:u,useTranslate3d:d,viewBox:p}=e,h,m,v;return u.height>0&&u.width>0&&n?(m=sk({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:u.width,viewBox:p,viewBoxDimension:p.width}),v=sk({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:u.height,viewBox:p,viewBoxDimension:p.height}),h=yU({translateX:m,translateY:v,useTranslate3d:d})):h=vU,{cssProperties:h,cssClasses:xU({translateX:m,translateY:v,coordinate:n})}}function ak(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ak(Object(n),!0).forEach(function(r){Xg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ak(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xg(e,t,n){return(t=wU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wU(e){var t=jU(e,"string");return typeof t=="symbol"?t:t+""}function jU(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class SU extends b.PureComponent{constructor(){super(...arguments),Xg(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),Xg(this,"handleKeyDown",t=>{if(t.key==="Escape"){var n,r,i,a;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(n=(r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==null&&n!==void 0?n:0,y:(i=(a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,n;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:n,animationDuration:r,animationEasing:i,children:a,coordinate:l,hasPayload:u,isAnimationActive:d,offset:p,position:h,reverseDirection:m,useTranslate3d:v,viewBox:x,wrapperStyle:w,lastBoundingBox:S,innerRef:j,hasPortalFromProps:k}=this.props,C=typeof p=="number"?p:p.x,E=typeof p=="number"?p:p.y,{cssClasses:O,cssProperties:P}=bU({allowEscapeViewBox:n,coordinate:l,offsetLeft:C,offsetTop:E,position:h,reverseDirection:m,tooltipBox:{height:S.height,width:S.width},useTranslate3d:v,viewBox:x}),A=k?{}:Qu(Qu({transition:d&&t?"transform ".concat(r,"ms ").concat(i):void 0},P),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&u?"visible":"hidden",position:"absolute",top:0,left:0}),_=Qu(Qu({},A),{},{visibility:!this.state.dismissed&&t&&u?"visible":"hidden"},w);return b.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:O,style:_,ref:j},a)}}var RE=()=>{var e;return(e=Ae(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Qg(){return Qg=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},Qg.apply(null,arguments)}function ok(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ok(Object(n),!0).forEach(function(r){NU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ok(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NU(e,t,n){return(t=kU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kU(e){var t=PU(e,"string");return typeof t=="symbol"?t:t+""}function PU(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ck={curveBasisClosed:yB,curveBasisOpen:bB,curveBasis:xB,curveBumpX:iB,curveBumpY:sB,curveLinearClosed:wB,curveLinear:Tf,curveMonotoneX:jB,curveMonotoneY:SB,curveNatural:NB,curveStep:kB,curveStepAfter:CB,curveStepBefore:PB},Gd=e=>Ke(e.x)&&Ke(e.y),uk=e=>e.base!=null&&Gd(e.base)&&Gd(e),yl=e=>e.x,bl=e=>e.y,CU=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(pc(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=ck["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return ck[n]||Tf},dk={connectNulls:!1,type:"linear"},OU=e=>{var{type:t=dk.type,points:n=[],baseLine:r,layout:i,connectNulls:a=dk.connectNulls}=e,l=CU(t,i),u=a?n.filter(Gd):n;if(Array.isArray(r)){var d,p=n.map((w,S)=>lk(lk({},w),{},{base:r[S]}));i==="vertical"?d=Uu().y(bl).x1(yl).x0(w=>w.base.x):d=Uu().x(yl).y1(bl).y0(w=>w.base.y);var h=d.defined(uk).curve(l),m=a?p.filter(uk):p;return h(m)}var v;i==="vertical"&&Ne(r)?v=Uu().y(bl).x1(yl).x0(r):Ne(r)?v=Uu().x(yl).y1(bl).y0(r):v=xA().x(yl).y(bl);var x=v.defined(Gd).curve(l);return x(u)},LE=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=So();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=n&&n.length?OU(l):r;return b.createElement("path",Qg({},hs(e),QB(e),{className:st("recharts-curve",t),d:u===null?void 0:u,ref:i}))},AU=["x","y","top","left","width","height","className"];function Jg(){return Jg=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},Jg.apply(null,arguments)}function fk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fk(Object(n),!0).forEach(function(r){TU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TU(e,t,n){return(t=_U(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _U(e){var t=MU(e,"string");return typeof t=="symbol"?t:t+""}function MU(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function IU(e,t){if(e==null)return{};var n,r,i=DU(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DU(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var RU=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),LU=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:l=0,className:u}=e,d=IU(e,AU),p=EU({x:t,y:n,top:r,left:i,width:a,height:l},d);return!Ne(t)||!Ne(n)||!Ne(a)||!Ne(l)||!Ne(r)||!Ne(i)?null:b.createElement("path",Jg({},or(p),{className:st("recharts-cross",u),d:RU(t,n,a,l,r,i)}))};function $U(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function pk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pk(Object(n),!0).forEach(function(r){zU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zU(e,t,n){return(t=FU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FU(e){var t=BU(e,"string");return typeof t=="symbol"?t:t+""}function BU(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var VU=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),$E=(e,t,n)=>e.map(r=>"".concat(VU(r)," ").concat(t,"ms ").concat(n)).join(","),UU=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Jl=(e,t)=>Object.keys(t).reduce((n,r)=>hk(hk({},n),{},{[r]:e(r,t[r])}),{});function mk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Et(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mk(Object(n),!0).forEach(function(r){WU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WU(e,t,n){return(t=qU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qU(e){var t=KU(e,"string");return typeof t=="symbol"?t:t+""}function KU(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yd=(e,t,n)=>e+(t-e)*n,Zg=e=>{var{from:t,to:n}=e;return t!==n},zE=(e,t,n)=>{var r=Jl((i,a)=>{if(Zg(a)){var[l,u]=e(a.from,a.to,a.velocity);return Et(Et({},a),{},{from:l,velocity:u})}return a},t);return n<1?Jl((i,a)=>Zg(a)&&r[i]!=null?Et(Et({},a),{},{velocity:Yd(a.velocity,r[i].velocity,n),from:Yd(a.from,r[i].from,n)}):a,t):zE(e,r,n-1)};function HU(e,t,n,r,i,a){var l,u=r.reduce((v,x)=>Et(Et({},v),{},{[x]:{from:e[x],velocity:0,to:t[x]}}),{}),d=()=>Jl((v,x)=>x.from,u),p=()=>!Object.values(u).filter(Zg).length,h=null,m=v=>{l||(l=v);var x=v-l,w=x/n.dt;u=zE(n,u,w),i(Et(Et(Et({},e),t),d())),l=v,p()||(h=a.setTimeout(m))};return()=>(h=a.setTimeout(m),()=>{var v;(v=h)===null||v===void 0||v()})}function GU(e,t,n,r,i,a,l){var u=null,d=i.reduce((m,v)=>{var x=e[v],w=t[v];return x==null||w==null?m:Et(Et({},m),{},{[v]:[x,w]})},{}),p,h=m=>{p||(p=m);var v=(m-p)/r,x=Jl((S,j)=>Yd(...j,n(v)),d);if(a(Et(Et(Et({},e),t),x)),v<1)u=l.setTimeout(h);else{var w=Jl((S,j)=>Yd(...j,n(1)),d);a(Et(Et(Et({},e),t),w))}};return()=>(u=l.setTimeout(h),()=>{var m;(m=u)===null||m===void 0||m()})}const YU=(e,t,n,r,i,a)=>{var l=UU(e,t);return n==null?()=>(i(Et(Et({},e),t)),()=>{}):n.isStepper===!0?HU(e,t,n,l,i,a):GU(e,t,n,r,l,i,a)};var Xd=1e-4,FE=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],BE=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),gk=(e,t)=>n=>{var r=FE(e,t);return BE(r,n)},XU=(e,t)=>n=>{var r=FE(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return BE(i,n)},QU=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},JU=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=QU(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},ZU=(e,t,n,r)=>{var i=gk(e,n),a=gk(t,r),l=XU(e,n),u=p=>p>1?1:p<0?0:p,d=p=>{for(var h=p>1?1:p,m=h,v=0;v<8;++v){var x=i(m)-h,w=l(m);if(Math.abs(x-h)<Xd||w<Xd)return a(m);m=u(m-x/w)}return a(m)};return d.isStepper=!1,d},vk=function(){return ZU(...JU(...arguments))},e9=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(l,u,d)=>{var p=-(l-u)*n,h=d*r,m=d+(p-h)*i/1e3,v=d*i/1e3+l;return Math.abs(v-u)<Xd&&Math.abs(m)<Xd?[u,0]:[v,m]};return a.isStepper=!0,a.dt=i,a},t9=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return vk(e);case"spring":return e9();default:if(e.split("(")[0]==="cubic-bezier")return vk(e)}return typeof e=="function"?e:null};function n9(e){var t,n=()=>null,r=!1,i=null,a=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var u=l,[d,...p]=u;if(typeof d=="number"){i=e.setTimeout(a.bind(null,p),d);return}a(d),i=e.setTimeout(a.bind(null,p));return}typeof l=="string"&&(t=l,n(t)),typeof l=="object"&&(t=l,n(t)),typeof l=="function"&&l()}};return{stop:()=>{r=!0},start:l=>{r=!1,i&&(i(),i=null),a(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class r9{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function i9(){return n9(new r9)}var s9=b.createContext(i9);function a9(e,t){var n=b.useContext(s9);return b.useMemo(()=>t??n(e),[e,t,n])}var o9=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Qf={isSsr:o9()},l9={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},xk={t:0},A0={t:1};function Ix(e){var t=ur(e,l9),{isActive:n,canBegin:r,duration:i,easing:a,begin:l,onAnimationEnd:u,onAnimationStart:d,children:p}=t,h=n==="auto"?!Qf.isSsr:n,m=a9(t.animationId,t.animationManager),[v,x]=b.useState(h?xk:A0),w=b.useRef(null);return b.useEffect(()=>{h||x(A0)},[h]),b.useEffect(()=>{if(!h||!r)return jo;var S=YU(xk,A0,t9(a),i,x,m.getTimeoutController()),j=()=>{w.current=S()};return m.start([d,l,j,i,u]),()=>{m.stop(),w.current&&w.current(),u()}},[h,r,i,a,l,d,u,m]),p(v.t)}function Dx(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=b.useRef(ql(t)),r=b.useRef(e);return r.current!==e&&(n.current=ql(t),r.current=e),n.current}var c9=["radius"],u9=["radius"],yk,bk,wk,jk,Sk,Nk,kk,Pk,Ck,Ok;function Ak(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ek(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ak(Object(n),!0).forEach(function(r){d9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ak(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function d9(e,t,n){return(t=f9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f9(e){var t=p9(e,"string");return typeof t=="symbol"?t:t+""}function p9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qd(){return Qd=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},Qd.apply(null,arguments)}function Tk(e,t){if(e==null)return{};var n,r,i=h9(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function h9(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Lr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var _k=(e,t,n,r,i)=>{var a=ls(n),l=ls(r),u=Math.min(Math.abs(a)/2,Math.abs(l)/2),d=l>=0?1:-1,p=a>=0?1:-1,h=l>=0&&a>=0||l<0&&a<0?1:0,m;if(u>0&&Array.isArray(i)){for(var v=[0,0,0,0],x=0,w=4;x<w;x++){var S,j=(S=i[x])!==null&&S!==void 0?S:0;v[x]=j>u?u:j}m=bt(yk||(yk=Lr(["M",",",""])),e,t+d*v[0]),v[0]>0&&(m+=bt(bk||(bk=Lr(["A ",",",",0,0,",",",",",""])),v[0],v[0],h,e+p*v[0],t)),m+=bt(wk||(wk=Lr(["L ",",",""])),e+n-p*v[1],t),v[1]>0&&(m+=bt(jk||(jk=Lr(["A ",",",",0,0,",`,
308
+ `,",",""])),v[1],v[1],h,e+n,t+d*v[1])),m+=bt(Sk||(Sk=Lr(["L ",",",""])),e+n,t+r-d*v[2]),v[2]>0&&(m+=bt(Nk||(Nk=Lr(["A ",",",",0,0,",`,
309
+ `,",",""])),v[2],v[2],h,e+n-p*v[2],t+r)),m+=bt(kk||(kk=Lr(["L ",",",""])),e+p*v[3],t+r),v[3]>0&&(m+=bt(Pk||(Pk=Lr(["A ",",",",0,0,",`,
310
+ `,",",""])),v[3],v[3],h,e,t+r-d*v[3])),m+="Z"}else if(u>0&&i===+i&&i>0){var k=Math.min(u,i);m=bt(Ck||(Ck=Lr(["M ",",",`
311
+ A `,",",",0,0,",",",",",`
312
+ L `,",",`
313
+ A `,",",",0,0,",",",",",`
314
+ L `,",",`
315
+ A `,",",",0,0,",",",",",`
316
+ L `,",",`
317
+ A `,",",",0,0,",",",","," Z"])),e,t+d*k,k,k,h,e+p*k,t,e+n-p*k,t,k,k,h,e+n,t+d*k,e+n,t+r-d*k,k,k,h,e+n-p*k,t+r,e+p*k,t+r,k,k,h,e,t+r-d*k)}else m=bt(Ok||(Ok=Lr(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},Mk={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},VE=e=>{var t=ur(e,Mk),n=b.useRef(null),[r,i]=b.useState(-1);b.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var B=n.current.getTotalLength();B&&i(B)}catch{}},[]);var{x:a,y:l,width:u,height:d,radius:p,className:h}=t,{animationEasing:m,animationDuration:v,animationBegin:x,isAnimationActive:w,isUpdateAnimationActive:S}=t,j=b.useRef(u),k=b.useRef(d),C=b.useRef(a),E=b.useRef(l),O=b.useMemo(()=>({x:a,y:l,width:u,height:d,radius:p}),[a,l,u,d,p]),P=Dx(O,"rectangle-");if(a!==+a||l!==+l||u!==+u||d!==+d||u===0||d===0)return null;var A=st("recharts-rectangle",h);if(!S){var _=or(t),{radius:D}=_,$=Tk(_,c9);return b.createElement("path",Qd({},$,{x:ls(a),y:ls(l),width:ls(u),height:ls(d),radius:typeof p=="number"?p:void 0,className:A,d:_k(a,l,u,d,p)}))}var q=j.current,X=k.current,L=C.current,Z=E.current,J="0px ".concat(r===-1?1:r,"px"),ne="".concat(r,"px 0px"),re=$E(["strokeDasharray"],v,typeof m=="string"?m:Mk.animationEasing);return b.createElement(Ix,{animationId:P,key:P,canBegin:r>0,duration:v,easing:m,isActive:S,begin:x},B=>{var F=Zt(q,u,B),G=Zt(X,d,B),W=Zt(L,a,B),M=Zt(Z,l,B);n.current&&(j.current=F,k.current=G,C.current=W,E.current=M);var V;w?B>0?V={transition:re,strokeDasharray:ne}:V={strokeDasharray:J}:V={strokeDasharray:ne};var ie=or(t),{radius:fe}=ie,te=Tk(ie,u9);return b.createElement("path",Qd({},te,{radius:typeof p=="number"?p:void 0,className:A,d:_k(W,M,F,G,p),ref:n,style:Ek(Ek({},V),t.style)}))})};function Ik(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ik(Object(n),!0).forEach(function(r){m9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ik(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m9(e,t,n){return(t=g9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g9(e){var t=v9(e,"string");return typeof t=="symbol"?t:t+""}function v9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jd=Math.PI/180,x9=e=>e*180/Math.PI,en=(e,t,n,r)=>({x:e+Math.cos(-Jd*r)*n,y:t+Math.sin(-Jd*r)*n}),y9=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},b9=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},w9=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,l=b9({x:n,y:r},{x:i,y:a});if(l<=0)return{radius:l,angle:0};var u=(n-i)/l,d=Math.acos(u);return r>a&&(d=2*Math.PI-d),{radius:l,angle:x9(d),angleInRadian:d}},j9=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},S9=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),l=Math.min(i,a);return e+l*360},N9=(e,t)=>{var{chartX:n,chartY:r}=e,{radius:i,angle:a}=w9({x:n,y:r},t),{innerRadius:l,outerRadius:u}=t;if(i<l||i>u||i===0)return null;var{startAngle:d,endAngle:p}=j9(t),h=a,m;if(d<=p){for(;h>p;)h-=360;for(;h<d;)h+=360;m=h>=d&&h<=p}else{for(;h>d;)h-=360;for(;h<p;)h+=360;m=h>=p&&h<=d}return m?Dk(Dk({},t),{},{radius:i,angle:S9(h,t)}):null};function UE(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,l=en(t,n,r,i),u=en(t,n,r,a);return{points:[l,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var Rk,Lk,$k,zk,Fk,Bk,Vk;function ev(){return ev=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},ev.apply(null,arguments)}function qs(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var k9=(e,t)=>{var n=Fn(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Ju=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:l,cornerRadius:u,cornerIsExternal:d}=e,p=u*(l?1:-1)+r,h=Math.asin(u/p)/Jd,m=d?i:i+a*h,v=en(t,n,p,m),x=en(t,n,r,m),w=d?i-a*h:i,S=en(t,n,p*Math.cos(h*Jd),w);return{center:v,circleTangency:x,lineTangency:S,theta:h}},WE=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:l}=e,u=k9(a,l),d=a+u,p=en(t,n,i,a),h=en(t,n,i,d),m=bt(Rk||(Rk=qs(["M ",",",`
318
+ A `,",",`,0,
319
+ `,",",`,
320
+ `,",",`
321
+ `])),p.x,p.y,i,i,+(Math.abs(u)>180),+(a>d),h.x,h.y);if(r>0){var v=en(t,n,r,a),x=en(t,n,r,d);m+=bt(Lk||(Lk=qs(["L ",",",`
322
+ A `,",",`,0,
323
+ `,",",`,
324
+ `,","," Z"])),x.x,x.y,r,r,+(Math.abs(u)>180),+(a<=d),v.x,v.y)}else m+=bt($k||($k=qs(["L ",","," Z"])),t,n);return m},P9=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:p}=e,h=Fn(p-d),{circleTangency:m,lineTangency:v,theta:x}=Ju({cx:t,cy:n,radius:i,angle:d,sign:h,cornerRadius:a,cornerIsExternal:u}),{circleTangency:w,lineTangency:S,theta:j}=Ju({cx:t,cy:n,radius:i,angle:p,sign:-h,cornerRadius:a,cornerIsExternal:u}),k=u?Math.abs(d-p):Math.abs(d-p)-x-j;if(k<0)return l?bt(zk||(zk=qs(["M ",",",`
325
+ a`,",",",0,0,1,",`,0
326
+ a`,",",",0,0,1,",`,0
327
+ `])),v.x,v.y,a,a,a*2,a,a,-a*2):WE({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:p});var C=bt(Fk||(Fk=qs(["M ",",",`
328
+ A`,",",",0,0,",",",",",`
329
+ A`,",",",0,",",",",",",",`
330
+ A`,",",",0,0,",",",",",`
331
+ `])),v.x,v.y,a,a,+(h<0),m.x,m.y,i,i,+(k>180),+(h<0),w.x,w.y,a,a,+(h<0),S.x,S.y);if(r>0){var{circleTangency:E,lineTangency:O,theta:P}=Ju({cx:t,cy:n,radius:r,angle:d,sign:h,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),{circleTangency:A,lineTangency:_,theta:D}=Ju({cx:t,cy:n,radius:r,angle:p,sign:-h,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),$=u?Math.abs(d-p):Math.abs(d-p)-P-D;if($<0&&a===0)return"".concat(C,"L").concat(t,",").concat(n,"Z");C+=bt(Bk||(Bk=qs(["L",",",`
332
+ A`,",",",0,0,",",",",",`
333
+ A`,",",",0,",",",",",",",`
334
+ A`,",",",0,0,",",",",","Z"])),_.x,_.y,a,a,+(h<0),A.x,A.y,r,r,+($>180),+(h>0),E.x,E.y,a,a,+(h<0),O.x,O.y)}else C+=bt(Vk||(Vk=qs(["L",",","Z"])),t,n);return C},C9={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},qE=e=>{var t=ur(e,C9),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:l,forceCornerRadius:u,cornerIsExternal:d,startAngle:p,endAngle:h,className:m}=t;if(a<i||p===h)return null;var v=st("recharts-sector",m),x=a-i,w=Or(l,x,0,!0),S;return w>0&&Math.abs(p-h)<360?S=P9({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(w,x/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:p,endAngle:h}):S=WE({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:p,endAngle:h}),b.createElement("path",ev({},or(t),{className:v,d:S}))};function O9(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(MA(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:l,angle:u}=t,d=en(r,i,a,u),p=en(r,i,l,u);return[{x:d.x,y:d.y},{x:p.x,y:p.y}]}return UE(t)}}var E0={},T0={},_0={},Uk;function A9(){return Uk||(Uk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UA();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(_0)),_0}var Wk;function E9(){return Wk||(Wk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=A9();function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(T0)),T0}var qk;function T9(){return qk||(qk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=WA(),n=E9();function r(i,a,l){l&&typeof l!="number"&&t.isIterateeCall(i,a,l)&&(a=l=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),l=l===void 0?i<a?1:-1:n.toFinite(l);const u=Math.max(Math.ceil((a-i)/(l||1)),0),d=new Array(u);for(let p=0;p<u;p++)d[p]=i,i+=l;return d}e.range=r})(E0)),E0}var M0,Kk;function _9(){return Kk||(Kk=1,M0=T9().range),M0}var M9=_9();const KE=Qr(M9);function cs(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function I9(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Rx(e){let t,n,r;e.length!==2?(t=cs,n=(u,d)=>cs(e(u),d),r=(u,d)=>e(u)-d):(t=e===cs||e===I9?e:D9,n=e,r=e);function i(u,d,p=0,h=u.length){if(p<h){if(t(d,d)!==0)return h;do{const m=p+h>>>1;n(u[m],d)<0?p=m+1:h=m}while(p<h)}return p}function a(u,d,p=0,h=u.length){if(p<h){if(t(d,d)!==0)return h;do{const m=p+h>>>1;n(u[m],d)<=0?p=m+1:h=m}while(p<h)}return p}function l(u,d,p=0,h=u.length){const m=i(u,d,p,h-1);return m>p&&r(u[m-1],d)>-r(u[m],d)?m-1:m}return{left:i,center:l,right:a}}function D9(){return 0}function HE(e){return e===null?NaN:+e}function*R9(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const L9=Rx(cs),yc=L9.right;Rx(HE).center;class Hk extends Map{constructor(t,n=F9){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(Gk(this,t))}has(t){return super.has(Gk(this,t))}set(t,n){return super.set($9(this,t),n)}delete(t){return super.delete(z9(this,t))}}function Gk({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function $9({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function z9({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function F9(e){return e!==null&&typeof e=="object"?e.valueOf():e}function B9(e=cs){if(e===cs)return GE;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function GE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const V9=Math.sqrt(50),U9=Math.sqrt(10),W9=Math.sqrt(2);function Zd(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=V9?10:a>=U9?5:a>=W9?2:1;let u,d,p;return i<0?(p=Math.pow(10,-i)/l,u=Math.round(e*p),d=Math.round(t*p),u/p<e&&++u,d/p>t&&--d,p=-p):(p=Math.pow(10,i)*l,u=Math.round(e/p),d=Math.round(t/p),u*p<e&&++u,d*p>t&&--d),d<u&&.5<=n&&n<2?Zd(e,t,n*2):[u,d,p]}function tv(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,l]=r?Zd(t,e,n):Zd(e,t,n);if(!(a>=i))return[];const u=a-i+1,d=new Array(u);if(r)if(l<0)for(let p=0;p<u;++p)d[p]=(a-p)/-l;else for(let p=0;p<u;++p)d[p]=(a-p)*l;else if(l<0)for(let p=0;p<u;++p)d[p]=(i+p)/-l;else for(let p=0;p<u;++p)d[p]=(i+p)*l;return d}function nv(e,t,n){return t=+t,e=+e,n=+n,Zd(e,t,n)[2]}function rv(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?nv(t,e,n):nv(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Yk(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function Xk(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function YE(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?GE:B9(i);r>n;){if(r-n>600){const d=r-n+1,p=t-n+1,h=Math.log(d),m=.5*Math.exp(2*h/3),v=.5*Math.sqrt(h*m*(d-m)/d)*(p-d/2<0?-1:1),x=Math.max(n,Math.floor(t-p*m/d+v)),w=Math.min(r,Math.floor(t+(d-p)*m/d+v));YE(e,t,x,w,i)}const a=e[t];let l=n,u=r;for(wl(e,n,t),i(e[r],a)>0&&wl(e,n,r);l<u;){for(wl(e,l,u),++l,--u;i(e[l],a)<0;)++l;for(;i(e[u],a)>0;)--u}i(e[n],a)===0?wl(e,n,u):(++u,wl(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function wl(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function q9(e,t,n){if(e=Float64Array.from(R9(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Xk(e);if(t>=1)return Yk(e);var r,i=(r-1)*t,a=Math.floor(i),l=Yk(YE(e,a).subarray(0,a+1)),u=Xk(e.subarray(a+1));return l+(u-l)*(i-a)}}function K9(e,t,n=HE){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),l=+n(e[a],a,e),u=+n(e[a+1],a+1,e);return l+(u-l)*(i-a)}}function H9(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function dr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ai(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const iv=Symbol("implicit");function Lx(){var e=new Hk,t=[],n=[],r=iv;function i(a){let l=e.get(a);if(l===void 0){if(r!==iv)return r;e.set(a,l=t.push(a)-1)}return n[l%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new Hk;for(const l of a)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Lx(t,n).unknown(r)},dr.apply(i,arguments),i}function $x(){var e=Lx().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,l,u=!1,d=0,p=0,h=.5;delete e.unknown;function m(){var v=t().length,x=i<r,w=x?i:r,S=x?r:i;a=(S-w)/Math.max(1,v-d+p*2),u&&(a=Math.floor(a)),w+=(S-w-a*(v-d))*h,l=a*(1-d),u&&(w=Math.round(w),l=Math.round(l));var j=H9(v).map(function(k){return w+a*k});return n(x?j.reverse():j)}return e.domain=function(v){return arguments.length?(t(v),m()):t()},e.range=function(v){return arguments.length?([r,i]=v,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(v){return[r,i]=v,r=+r,i=+i,u=!0,m()},e.bandwidth=function(){return l},e.step=function(){return a},e.round=function(v){return arguments.length?(u=!!v,m()):u},e.padding=function(v){return arguments.length?(d=Math.min(1,p=+v),m()):d},e.paddingInner=function(v){return arguments.length?(d=Math.min(1,v),m()):d},e.paddingOuter=function(v){return arguments.length?(p=+v,m()):p},e.align=function(v){return arguments.length?(h=Math.max(0,Math.min(1,v)),m()):h},e.copy=function(){return $x(t(),[r,i]).round(u).paddingInner(d).paddingOuter(p).align(h)},dr.apply(m(),arguments)}function XE(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return XE(t())},e}function G9(){return XE($x.apply(null,arguments).paddingInner(1))}function zx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function QE(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function bc(){}var Zl=.7,ef=1/Zl,eo="\\s*([+-]?\\d+)\\s*",ec="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Y9=/^#([0-9a-f]{3,8})$/,X9=new RegExp(`^rgb\\(${eo},${eo},${eo}\\)$`),Q9=new RegExp(`^rgb\\(${Kr},${Kr},${Kr}\\)$`),J9=new RegExp(`^rgba\\(${eo},${eo},${eo},${ec}\\)$`),Z9=new RegExp(`^rgba\\(${Kr},${Kr},${Kr},${ec}\\)$`),eW=new RegExp(`^hsl\\(${ec},${Kr},${Kr}\\)$`),tW=new RegExp(`^hsla\\(${ec},${Kr},${Kr},${ec}\\)$`),Qk={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};zx(bc,tc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Jk,formatHex:Jk,formatHex8:nW,formatHsl:rW,formatRgb:Zk,toString:Zk});function Jk(){return this.rgb().formatHex()}function nW(){return this.rgb().formatHex8()}function rW(){return JE(this).formatHsl()}function Zk(){return this.rgb().formatRgb()}function tc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Y9.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?eP(t):n===3?new An(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Zu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Zu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=X9.exec(e))?new An(t[1],t[2],t[3],1):(t=Q9.exec(e))?new An(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=J9.exec(e))?Zu(t[1],t[2],t[3],t[4]):(t=Z9.exec(e))?Zu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=eW.exec(e))?rP(t[1],t[2]/100,t[3]/100,1):(t=tW.exec(e))?rP(t[1],t[2]/100,t[3]/100,t[4]):Qk.hasOwnProperty(e)?eP(Qk[e]):e==="transparent"?new An(NaN,NaN,NaN,0):null}function eP(e){return new An(e>>16&255,e>>8&255,e&255,1)}function Zu(e,t,n,r){return r<=0&&(e=t=n=NaN),new An(e,t,n,r)}function iW(e){return e instanceof bc||(e=tc(e)),e?(e=e.rgb(),new An(e.r,e.g,e.b,e.opacity)):new An}function sv(e,t,n,r){return arguments.length===1?iW(e):new An(e,t,n,r??1)}function An(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}zx(An,sv,QE(bc,{brighter(e){return e=e==null?ef:Math.pow(ef,e),new An(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Zl:Math.pow(Zl,e),new An(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new An(Xs(this.r),Xs(this.g),Xs(this.b),tf(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tP,formatHex:tP,formatHex8:sW,formatRgb:nP,toString:nP}));function tP(){return`#${Ks(this.r)}${Ks(this.g)}${Ks(this.b)}`}function sW(){return`#${Ks(this.r)}${Ks(this.g)}${Ks(this.b)}${Ks((isNaN(this.opacity)?1:this.opacity)*255)}`}function nP(){const e=tf(this.opacity);return`${e===1?"rgb(":"rgba("}${Xs(this.r)}, ${Xs(this.g)}, ${Xs(this.b)}${e===1?")":`, ${e})`}`}function tf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ks(e){return e=Xs(e),(e<16?"0":"")+e.toString(16)}function rP(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Pr(e,t,n,r)}function JE(e){if(e instanceof Pr)return new Pr(e.h,e.s,e.l,e.opacity);if(e instanceof bc||(e=tc(e)),!e)return new Pr;if(e instanceof Pr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),l=NaN,u=a-i,d=(a+i)/2;return u?(t===a?l=(n-r)/u+(n<r)*6:n===a?l=(r-t)/u+2:l=(t-n)/u+4,u/=d<.5?a+i:2-a-i,l*=60):u=d>0&&d<1?0:l,new Pr(l,u,d,e.opacity)}function aW(e,t,n,r){return arguments.length===1?JE(e):new Pr(e,t,n,r??1)}function Pr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}zx(Pr,aW,QE(bc,{brighter(e){return e=e==null?ef:Math.pow(ef,e),new Pr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Zl:Math.pow(Zl,e),new Pr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new An(I0(e>=240?e-240:e+120,i,r),I0(e,i,r),I0(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Pr(iP(this.h),ed(this.s),ed(this.l),tf(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=tf(this.opacity);return`${e===1?"hsl(":"hsla("}${iP(this.h)}, ${ed(this.s)*100}%, ${ed(this.l)*100}%${e===1?")":`, ${e})`}`}}));function iP(e){return e=(e||0)%360,e<0?e+360:e}function ed(e){return Math.max(0,Math.min(1,e||0))}function I0(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Fx=e=>()=>e;function oW(e,t){return function(n){return e+n*t}}function lW(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function cW(e){return(e=+e)==1?ZE:function(t,n){return n-t?lW(t,n,e):Fx(isNaN(t)?n:t)}}function ZE(e,t){var n=t-e;return n?oW(e,n):Fx(isNaN(e)?t:e)}const sP=(function e(t){var n=cW(t);function r(i,a){var l=n((i=sv(i)).r,(a=sv(a)).r),u=n(i.g,a.g),d=n(i.b,a.b),p=ZE(i.opacity,a.opacity);return function(h){return i.r=l(h),i.g=u(h),i.b=d(h),i.opacity=p(h),i+""}}return r.gamma=e,r})(1);function uW(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function dW(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function fW(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),l;for(l=0;l<r;++l)i[l]=No(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(u){for(l=0;l<r;++l)a[l]=i[l](u);return a}}function pW(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function nf(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function hW(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=No(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var av=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,D0=new RegExp(av.source,"g");function mW(e){return function(){return e}}function gW(e){return function(t){return e(t)+""}}function vW(e,t){var n=av.lastIndex=D0.lastIndex=0,r,i,a,l=-1,u=[],d=[];for(e=e+"",t=t+"";(r=av.exec(e))&&(i=D0.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),u[l]?u[l]+=a:u[++l]=a),(r=r[0])===(i=i[0])?u[l]?u[l]+=i:u[++l]=i:(u[++l]=null,d.push({i:l,x:nf(r,i)})),n=D0.lastIndex;return n<t.length&&(a=t.slice(n),u[l]?u[l]+=a:u[++l]=a),u.length<2?d[0]?gW(d[0].x):mW(t):(t=d.length,function(p){for(var h=0,m;h<t;++h)u[(m=d[h]).i]=m.x(p);return u.join("")})}function No(e,t){var n=typeof t,r;return t==null||n==="boolean"?Fx(t):(n==="number"?nf:n==="string"?(r=tc(t))?(t=r,sP):vW:t instanceof tc?sP:t instanceof Date?pW:dW(t)?uW:Array.isArray(t)?fW:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?hW:nf)(e,t)}function Bx(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function xW(e,t){t===void 0&&(t=e,e=No);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(l){var u=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return a[u](l-u)}}function yW(e){return function(){return e}}function rf(e){return+e}var aP=[0,1];function gn(e){return e}function ov(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:yW(isNaN(t)?NaN:.5)}function bW(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function wW(e,t,n){var r=e[0],i=e[1],a=t[0],l=t[1];return i<r?(r=ov(i,r),a=n(l,a)):(r=ov(r,i),a=n(a,l)),function(u){return a(r(u))}}function jW(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=ov(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(u){var d=yc(e,u,1,r)-1;return a[d](i[d](u))}}function wc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Jf(){var e=aP,t=aP,n=No,r,i,a,l=gn,u,d,p;function h(){var v=Math.min(e.length,t.length);return l!==gn&&(l=bW(e[0],e[v-1])),u=v>2?jW:wW,d=p=null,m}function m(v){return v==null||isNaN(v=+v)?a:(d||(d=u(e.map(r),t,n)))(r(l(v)))}return m.invert=function(v){return l(i((p||(p=u(t,e.map(r),nf)))(v)))},m.domain=function(v){return arguments.length?(e=Array.from(v,rf),h()):e.slice()},m.range=function(v){return arguments.length?(t=Array.from(v),h()):t.slice()},m.rangeRound=function(v){return t=Array.from(v),n=Bx,h()},m.clamp=function(v){return arguments.length?(l=v?!0:gn,h()):l!==gn},m.interpolate=function(v){return arguments.length?(n=v,h()):n},m.unknown=function(v){return arguments.length?(a=v,m):a},function(v,x){return r=v,i=x,h()}}function Vx(){return Jf()(gn,gn)}function SW(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function sf(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function uo(e){return e=sf(Math.abs(e)),e?e[1]:NaN}function NW(e,t){return function(n,r){for(var i=n.length,a=[],l=0,u=e[0],d=0;i>0&&u>0&&(d+u+1>r&&(u=Math.max(1,r-d)),a.push(n.substring(i-=u,i+u)),!((d+=u+1)>r));)u=e[l=(l+1)%e.length];return a.reverse().join(t)}}function kW(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var PW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function nc(e){if(!(t=PW.exec(e)))throw new Error("invalid format: "+e);var t;return new Ux({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}nc.prototype=Ux.prototype;function Ux(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ux.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function CW(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var af;function OW(e,t){var n=sf(e,t);if(!n)return af=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(af=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+sf(e,Math.max(0,t+a-1))[0]}function oP(e,t){var n=sf(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const lP={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:SW,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>oP(e*100,t),r:oP,s:OW,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cP(e){return e}var uP=Array.prototype.map,dP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function AW(e){var t=e.grouping===void 0||e.thousands===void 0?cP:NW(uP.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?cP:kW(uP.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function p(m,v){m=nc(m);var x=m.fill,w=m.align,S=m.sign,j=m.symbol,k=m.zero,C=m.width,E=m.comma,O=m.precision,P=m.trim,A=m.type;A==="n"?(E=!0,A="g"):lP[A]||(O===void 0&&(O=12),P=!0,A="g"),(k||x==="0"&&w==="=")&&(k=!0,x="0",w="=");var _=(v&&v.prefix!==void 0?v.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),D=(j==="$"?r:/[%p]/.test(A)?l:"")+(v&&v.suffix!==void 0?v.suffix:""),$=lP[A],q=/[defgprs%]/.test(A);O=O===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,O)):Math.max(0,Math.min(20,O));function X(L){var Z=_,J=D,ne,re,B;if(A==="c")J=$(L)+J,L="";else{L=+L;var F=L<0||1/L<0;if(L=isNaN(L)?d:$(Math.abs(L),O),P&&(L=CW(L)),F&&+L==0&&S!=="+"&&(F=!1),Z=(F?S==="("?S:u:S==="-"||S==="("?"":S)+Z,J=(A==="s"&&!isNaN(L)&&af!==void 0?dP[8+af/3]:"")+J+(F&&S==="("?")":""),q){for(ne=-1,re=L.length;++ne<re;)if(B=L.charCodeAt(ne),48>B||B>57){J=(B===46?i+L.slice(ne+1):L.slice(ne))+J,L=L.slice(0,ne);break}}}E&&!k&&(L=t(L,1/0));var G=Z.length+L.length+J.length,W=G<C?new Array(C-G+1).join(x):"";switch(E&&k&&(L=t(W+L,W.length?C-J.length:1/0),W=""),w){case"<":L=Z+L+J+W;break;case"=":L=Z+W+L+J;break;case"^":L=W.slice(0,G=W.length>>1)+Z+L+J+W.slice(G);break;default:L=W+Z+L+J;break}return a(L)}return X.toString=function(){return m+""},X}function h(m,v){var x=Math.max(-8,Math.min(8,Math.floor(uo(v)/3)))*3,w=Math.pow(10,-x),S=p((m=nc(m),m.type="f",m),{suffix:dP[8+x/3]});return function(j){return S(w*j)}}return{format:p,formatPrefix:h}}var td,Wx,eT;EW({thousands:",",grouping:[3],currency:["$",""]});function EW(e){return td=AW(e),Wx=td.format,eT=td.formatPrefix,td}function TW(e){return Math.max(0,-uo(Math.abs(e)))}function _W(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(uo(t)/3)))*3-uo(Math.abs(e)))}function MW(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,uo(t)-uo(e))+1}function tT(e,t,n,r){var i=rv(e,t,n),a;switch(r=nc(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=_W(i,l))&&(r.precision=a),eT(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=MW(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=TW(i))&&(r.precision=a-(r.type==="%")*2);break}}return Wx(r)}function xs(e){var t=e.domain;return e.ticks=function(n){var r=t();return tv(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return tT(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,l=r[i],u=r[a],d,p,h=10;for(u<l&&(p=l,l=u,u=p,p=i,i=a,a=p);h-- >0;){if(p=nv(l,u,n),p===d)return r[i]=l,r[a]=u,t(r);if(p>0)l=Math.floor(l/p)*p,u=Math.ceil(u/p)*p;else if(p<0)l=Math.ceil(l*p)/p,u=Math.floor(u*p)/p;else break;d=p}return e},e}function nT(){var e=Vx();return e.copy=function(){return wc(e,nT())},dr.apply(e,arguments),xs(e)}function rT(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,rf),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return rT(e).unknown(t)},e=arguments.length?Array.from(e,rf):[0,1],xs(n)}function iT(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],l;return a<i&&(l=n,n=r,r=l,l=i,i=a,a=l),e[n]=t.floor(i),e[r]=t.ceil(a),e}function fP(e){return Math.log(e)}function pP(e){return Math.exp(e)}function IW(e){return-Math.log(-e)}function DW(e){return-Math.exp(-e)}function RW(e){return isFinite(e)?+("1e"+e):e<0?0:e}function LW(e){return e===10?RW:e===Math.E?Math.exp:t=>Math.pow(e,t)}function $W(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function hP(e){return(t,n)=>-e(-t,n)}function qx(e){const t=e(fP,pP),n=t.domain;let r=10,i,a;function l(){return i=$W(r),a=LW(r),n()[0]<0?(i=hP(i),a=hP(a),e(IW,DW)):e(fP,pP),t}return t.base=function(u){return arguments.length?(r=+u,l()):r},t.domain=function(u){return arguments.length?(n(u),l()):n()},t.ticks=u=>{const d=n();let p=d[0],h=d[d.length-1];const m=h<p;m&&([p,h]=[h,p]);let v=i(p),x=i(h),w,S;const j=u==null?10:+u;let k=[];if(!(r%1)&&x-v<j){if(v=Math.floor(v),x=Math.ceil(x),p>0){for(;v<=x;++v)for(w=1;w<r;++w)if(S=v<0?w/a(-v):w*a(v),!(S<p)){if(S>h)break;k.push(S)}}else for(;v<=x;++v)for(w=r-1;w>=1;--w)if(S=v>0?w/a(-v):w*a(v),!(S<p)){if(S>h)break;k.push(S)}k.length*2<j&&(k=tv(p,h,j))}else k=tv(v,x,Math.min(x-v,j)).map(a);return m?k.reverse():k},t.tickFormat=(u,d)=>{if(u==null&&(u=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=nc(d)).precision==null&&(d.trim=!0),d=Wx(d)),u===1/0)return d;const p=Math.max(1,r*u/t.ticks().length);return h=>{let m=h/a(Math.round(i(h)));return m*r<r-.5&&(m*=r),m<=p?d(h):""}},t.nice=()=>n(iT(n(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function sT(){const e=qx(Jf()).domain([1,10]);return e.copy=()=>wc(e,sT()).base(e.base()),dr.apply(e,arguments),e}function mP(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function gP(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Kx(e){var t=1,n=e(mP(t),gP(t));return n.constant=function(r){return arguments.length?e(mP(t=+r),gP(t)):t},xs(n)}function aT(){var e=Kx(Jf());return e.copy=function(){return wc(e,aT()).constant(e.constant())},dr.apply(e,arguments)}function vP(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function zW(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function FW(e){return e<0?-e*e:e*e}function Hx(e){var t=e(gn,gn),n=1;function r(){return n===1?e(gn,gn):n===.5?e(zW,FW):e(vP(n),vP(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},xs(t)}function Gx(){var e=Hx(Jf());return e.copy=function(){return wc(e,Gx()).exponent(e.exponent())},dr.apply(e,arguments),e}function BW(){return Gx.apply(null,arguments).exponent(.5)}function xP(e){return Math.sign(e)*e*e}function VW(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function oT(){var e=Vx(),t=[0,1],n=!1,r;function i(a){var l=VW(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(xP(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,rf)).map(xP)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return oT(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},dr.apply(i,arguments),xs(i)}function lT(){var e=[],t=[],n=[],r;function i(){var l=0,u=Math.max(1,t.length);for(n=new Array(u-1);++l<u;)n[l-1]=K9(e,l/u);return a}function a(l){return l==null||isNaN(l=+l)?r:t[yc(n,l)]}return a.invertExtent=function(l){var u=t.indexOf(l);return u<0?[NaN,NaN]:[u>0?n[u-1]:e[0],u<n.length?n[u]:e[e.length-1]]},a.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let u of l)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(cs),i()},a.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},a.unknown=function(l){return arguments.length?(r=l,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return lT().domain(e).range(t).unknown(r)},dr.apply(a,arguments)}function cT(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(d){return d!=null&&d<=d?i[yc(r,d,0,n)]:a}function u(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return l}return l.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},l.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,u()):i.slice()},l.invertExtent=function(d){var p=i.indexOf(d);return p<0?[NaN,NaN]:p<1?[e,r[0]]:p>=n?[r[n-1],t]:[r[p-1],r[p]]},l.unknown=function(d){return arguments.length&&(a=d),l},l.thresholds=function(){return r.slice()},l.copy=function(){return cT().domain([e,t]).range(i).unknown(a)},dr.apply(xs(l),arguments)}function uT(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[yc(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var l=t.indexOf(a);return[e[l-1],e[l]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return uT().domain(e).range(t).unknown(n)},dr.apply(i,arguments)}const R0=new Date,L0=new Date;function Tt(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const l=i(a),u=i.ceil(a);return a-l<u-a?l:u},i.offset=(a,l)=>(t(a=new Date(+a),l==null?1:Math.floor(l)),a),i.range=(a,l,u)=>{const d=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<l)||!(u>0))return d;let p;do d.push(p=new Date(+a)),t(a,u),e(a);while(p<a&&a<l);return d},i.filter=a=>Tt(l=>{if(l>=l)for(;e(l),!a(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!a(l););else for(;--u>=0;)for(;t(l,1),!a(l););}),n&&(i.count=(a,l)=>(R0.setTime(+a),L0.setTime(+l),e(R0),e(L0),Math.floor(n(R0,L0))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?l=>r(l)%a===0:l=>i.count(0,l)%a===0):i)),i}const of=Tt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);of.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Tt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):of);of.range;const fi=1e3,ir=fi*60,pi=ir*60,wi=pi*24,Yx=wi*7,yP=wi*30,$0=wi*365,Hs=Tt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*fi)},(e,t)=>(t-e)/fi,e=>e.getUTCSeconds());Hs.range;const Xx=Tt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*fi)},(e,t)=>{e.setTime(+e+t*ir)},(e,t)=>(t-e)/ir,e=>e.getMinutes());Xx.range;const Qx=Tt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ir)},(e,t)=>(t-e)/ir,e=>e.getUTCMinutes());Qx.range;const Jx=Tt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*fi-e.getMinutes()*ir)},(e,t)=>{e.setTime(+e+t*pi)},(e,t)=>(t-e)/pi,e=>e.getHours());Jx.range;const Zx=Tt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*pi)},(e,t)=>(t-e)/pi,e=>e.getUTCHours());Zx.range;const jc=Tt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ir)/wi,e=>e.getDate()-1);jc.range;const Zf=Tt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wi,e=>e.getUTCDate()-1);Zf.range;const dT=Tt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wi,e=>Math.floor(e/wi));dT.range;function oa(e){return Tt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ir)/Yx)}const ep=oa(0),lf=oa(1),UW=oa(2),WW=oa(3),fo=oa(4),qW=oa(5),KW=oa(6);ep.range;lf.range;UW.range;WW.range;fo.range;qW.range;KW.range;function la(e){return Tt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Yx)}const tp=la(0),cf=la(1),HW=la(2),GW=la(3),po=la(4),YW=la(5),XW=la(6);tp.range;cf.range;HW.range;GW.range;po.range;YW.range;XW.range;const ey=Tt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ey.range;const ty=Tt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ty.range;const ji=Tt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());ji.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Tt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});ji.range;const Si=Tt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Si.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Tt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Si.range;function fT(e,t,n,r,i,a){const l=[[Hs,1,fi],[Hs,5,5*fi],[Hs,15,15*fi],[Hs,30,30*fi],[a,1,ir],[a,5,5*ir],[a,15,15*ir],[a,30,30*ir],[i,1,pi],[i,3,3*pi],[i,6,6*pi],[i,12,12*pi],[r,1,wi],[r,2,2*wi],[n,1,Yx],[t,1,yP],[t,3,3*yP],[e,1,$0]];function u(p,h,m){const v=h<p;v&&([p,h]=[h,p]);const x=m&&typeof m.range=="function"?m:d(p,h,m),w=x?x.range(p,+h+1):[];return v?w.reverse():w}function d(p,h,m){const v=Math.abs(h-p)/m,x=Rx(([,,j])=>j).right(l,v);if(x===l.length)return e.every(rv(p/$0,h/$0,m));if(x===0)return of.every(Math.max(rv(p,h,m),1));const[w,S]=l[v/l[x-1][2]<l[x][2]/v?x-1:x];return w.every(S)}return[u,d]}const[QW,JW]=fT(Si,ty,tp,dT,Zx,Qx),[ZW,eq]=fT(ji,ey,ep,jc,Jx,Xx);function z0(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function F0(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function jl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function tq(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,l=e.shortDays,u=e.months,d=e.shortMonths,p=Sl(i),h=Nl(i),m=Sl(a),v=Nl(a),x=Sl(l),w=Nl(l),S=Sl(u),j=Nl(u),k=Sl(d),C=Nl(d),E={a:B,A:F,b:G,B:W,c:null,d:kP,e:kP,f:Nq,g:Iq,G:Rq,H:wq,I:jq,j:Sq,L:pT,m:kq,M:Pq,p:M,q:V,Q:OP,s:AP,S:Cq,u:Oq,U:Aq,V:Eq,w:Tq,W:_q,x:null,X:null,y:Mq,Y:Dq,Z:Lq,"%":CP},O={a:ie,A:fe,b:te,B:le,c:null,d:PP,e:PP,f:Bq,g:Qq,G:Zq,H:$q,I:zq,j:Fq,L:mT,m:Vq,M:Uq,p:pe,q:Se,Q:OP,s:AP,S:Wq,u:qq,U:Kq,V:Hq,w:Gq,W:Yq,x:null,X:null,y:Xq,Y:Jq,Z:eK,"%":CP},P={a:q,A:X,b:L,B:Z,c:J,d:SP,e:SP,f:vq,g:jP,G:wP,H:NP,I:NP,j:pq,L:gq,m:fq,M:hq,p:$,q:dq,Q:yq,s:bq,S:mq,u:aq,U:oq,V:lq,w:sq,W:cq,x:ne,X:re,y:jP,Y:wP,Z:uq,"%":xq};E.x=A(n,E),E.X=A(r,E),E.c=A(t,E),O.x=A(n,O),O.X=A(r,O),O.c=A(t,O);function A(H,me){return function(Oe){var se=[],$e=-1,De=0,Je=H.length,et,Mt,Mn;for(Oe instanceof Date||(Oe=new Date(+Oe));++$e<Je;)H.charCodeAt($e)===37&&(se.push(H.slice(De,$e)),(Mt=bP[et=H.charAt(++$e)])!=null?et=H.charAt(++$e):Mt=et==="e"?" ":"0",(Mn=me[et])&&(et=Mn(Oe,Mt)),se.push(et),De=$e+1);return se.push(H.slice(De,$e)),se.join("")}}function _(H,me){return function(Oe){var se=jl(1900,void 0,1),$e=D(se,H,Oe+="",0),De,Je;if($e!=Oe.length)return null;if("Q"in se)return new Date(se.Q);if("s"in se)return new Date(se.s*1e3+("L"in se?se.L:0));if(me&&!("Z"in se)&&(se.Z=0),"p"in se&&(se.H=se.H%12+se.p*12),se.m===void 0&&(se.m="q"in se?se.q:0),"V"in se){if(se.V<1||se.V>53)return null;"w"in se||(se.w=1),"Z"in se?(De=F0(jl(se.y,0,1)),Je=De.getUTCDay(),De=Je>4||Je===0?cf.ceil(De):cf(De),De=Zf.offset(De,(se.V-1)*7),se.y=De.getUTCFullYear(),se.m=De.getUTCMonth(),se.d=De.getUTCDate()+(se.w+6)%7):(De=z0(jl(se.y,0,1)),Je=De.getDay(),De=Je>4||Je===0?lf.ceil(De):lf(De),De=jc.offset(De,(se.V-1)*7),se.y=De.getFullYear(),se.m=De.getMonth(),se.d=De.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),Je="Z"in se?F0(jl(se.y,0,1)).getUTCDay():z0(jl(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(Je+5)%7:se.w+se.U*7-(Je+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,F0(se)):z0(se)}}function D(H,me,Oe,se){for(var $e=0,De=me.length,Je=Oe.length,et,Mt;$e<De;){if(se>=Je)return-1;if(et=me.charCodeAt($e++),et===37){if(et=me.charAt($e++),Mt=P[et in bP?me.charAt($e++):et],!Mt||(se=Mt(H,Oe,se))<0)return-1}else if(et!=Oe.charCodeAt(se++))return-1}return se}function $(H,me,Oe){var se=p.exec(me.slice(Oe));return se?(H.p=h.get(se[0].toLowerCase()),Oe+se[0].length):-1}function q(H,me,Oe){var se=x.exec(me.slice(Oe));return se?(H.w=w.get(se[0].toLowerCase()),Oe+se[0].length):-1}function X(H,me,Oe){var se=m.exec(me.slice(Oe));return se?(H.w=v.get(se[0].toLowerCase()),Oe+se[0].length):-1}function L(H,me,Oe){var se=k.exec(me.slice(Oe));return se?(H.m=C.get(se[0].toLowerCase()),Oe+se[0].length):-1}function Z(H,me,Oe){var se=S.exec(me.slice(Oe));return se?(H.m=j.get(se[0].toLowerCase()),Oe+se[0].length):-1}function J(H,me,Oe){return D(H,t,me,Oe)}function ne(H,me,Oe){return D(H,n,me,Oe)}function re(H,me,Oe){return D(H,r,me,Oe)}function B(H){return l[H.getDay()]}function F(H){return a[H.getDay()]}function G(H){return d[H.getMonth()]}function W(H){return u[H.getMonth()]}function M(H){return i[+(H.getHours()>=12)]}function V(H){return 1+~~(H.getMonth()/3)}function ie(H){return l[H.getUTCDay()]}function fe(H){return a[H.getUTCDay()]}function te(H){return d[H.getUTCMonth()]}function le(H){return u[H.getUTCMonth()]}function pe(H){return i[+(H.getUTCHours()>=12)]}function Se(H){return 1+~~(H.getUTCMonth()/3)}return{format:function(H){var me=A(H+="",E);return me.toString=function(){return H},me},parse:function(H){var me=_(H+="",!1);return me.toString=function(){return H},me},utcFormat:function(H){var me=A(H+="",O);return me.toString=function(){return H},me},utcParse:function(H){var me=_(H+="",!0);return me.toString=function(){return H},me}}}var bP={"-":"",_:" ",0:"0"},qt=/^\s*\d+/,nq=/^%/,rq=/[\\^$*+?|[\]().{}]/g;function qe(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function iq(e){return e.replace(rq,"\\$&")}function Sl(e){return new RegExp("^(?:"+e.map(iq).join("|")+")","i")}function Nl(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function sq(e,t,n){var r=qt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function aq(e,t,n){var r=qt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function oq(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function lq(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function cq(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function wP(e,t,n){var r=qt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function jP(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function uq(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function dq(e,t,n){var r=qt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function fq(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function SP(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function pq(e,t,n){var r=qt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function NP(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function hq(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function mq(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function gq(e,t,n){var r=qt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function vq(e,t,n){var r=qt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function xq(e,t,n){var r=nq.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function yq(e,t,n){var r=qt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function bq(e,t,n){var r=qt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function kP(e,t){return qe(e.getDate(),t,2)}function wq(e,t){return qe(e.getHours(),t,2)}function jq(e,t){return qe(e.getHours()%12||12,t,2)}function Sq(e,t){return qe(1+jc.count(ji(e),e),t,3)}function pT(e,t){return qe(e.getMilliseconds(),t,3)}function Nq(e,t){return pT(e,t)+"000"}function kq(e,t){return qe(e.getMonth()+1,t,2)}function Pq(e,t){return qe(e.getMinutes(),t,2)}function Cq(e,t){return qe(e.getSeconds(),t,2)}function Oq(e){var t=e.getDay();return t===0?7:t}function Aq(e,t){return qe(ep.count(ji(e)-1,e),t,2)}function hT(e){var t=e.getDay();return t>=4||t===0?fo(e):fo.ceil(e)}function Eq(e,t){return e=hT(e),qe(fo.count(ji(e),e)+(ji(e).getDay()===4),t,2)}function Tq(e){return e.getDay()}function _q(e,t){return qe(lf.count(ji(e)-1,e),t,2)}function Mq(e,t){return qe(e.getFullYear()%100,t,2)}function Iq(e,t){return e=hT(e),qe(e.getFullYear()%100,t,2)}function Dq(e,t){return qe(e.getFullYear()%1e4,t,4)}function Rq(e,t){var n=e.getDay();return e=n>=4||n===0?fo(e):fo.ceil(e),qe(e.getFullYear()%1e4,t,4)}function Lq(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+qe(t/60|0,"0",2)+qe(t%60,"0",2)}function PP(e,t){return qe(e.getUTCDate(),t,2)}function $q(e,t){return qe(e.getUTCHours(),t,2)}function zq(e,t){return qe(e.getUTCHours()%12||12,t,2)}function Fq(e,t){return qe(1+Zf.count(Si(e),e),t,3)}function mT(e,t){return qe(e.getUTCMilliseconds(),t,3)}function Bq(e,t){return mT(e,t)+"000"}function Vq(e,t){return qe(e.getUTCMonth()+1,t,2)}function Uq(e,t){return qe(e.getUTCMinutes(),t,2)}function Wq(e,t){return qe(e.getUTCSeconds(),t,2)}function qq(e){var t=e.getUTCDay();return t===0?7:t}function Kq(e,t){return qe(tp.count(Si(e)-1,e),t,2)}function gT(e){var t=e.getUTCDay();return t>=4||t===0?po(e):po.ceil(e)}function Hq(e,t){return e=gT(e),qe(po.count(Si(e),e)+(Si(e).getUTCDay()===4),t,2)}function Gq(e){return e.getUTCDay()}function Yq(e,t){return qe(cf.count(Si(e)-1,e),t,2)}function Xq(e,t){return qe(e.getUTCFullYear()%100,t,2)}function Qq(e,t){return e=gT(e),qe(e.getUTCFullYear()%100,t,2)}function Jq(e,t){return qe(e.getUTCFullYear()%1e4,t,4)}function Zq(e,t){var n=e.getUTCDay();return e=n>=4||n===0?po(e):po.ceil(e),qe(e.getUTCFullYear()%1e4,t,4)}function eK(){return"+0000"}function CP(){return"%"}function OP(e){return+e}function AP(e){return Math.floor(+e/1e3)}var $a,vT,xT;tK({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function tK(e){return $a=tq(e),vT=$a.format,$a.parse,xT=$a.utcFormat,$a.utcParse,$a}function nK(e){return new Date(e)}function rK(e){return e instanceof Date?+e:+new Date(+e)}function ny(e,t,n,r,i,a,l,u,d,p){var h=Vx(),m=h.invert,v=h.domain,x=p(".%L"),w=p(":%S"),S=p("%I:%M"),j=p("%I %p"),k=p("%a %d"),C=p("%b %d"),E=p("%B"),O=p("%Y");function P(A){return(d(A)<A?x:u(A)<A?w:l(A)<A?S:a(A)<A?j:r(A)<A?i(A)<A?k:C:n(A)<A?E:O)(A)}return h.invert=function(A){return new Date(m(A))},h.domain=function(A){return arguments.length?v(Array.from(A,rK)):v().map(nK)},h.ticks=function(A){var _=v();return e(_[0],_[_.length-1],A??10)},h.tickFormat=function(A,_){return _==null?P:p(_)},h.nice=function(A){var _=v();return(!A||typeof A.range!="function")&&(A=t(_[0],_[_.length-1],A??10)),A?v(iT(_,A)):h},h.copy=function(){return wc(h,ny(e,t,n,r,i,a,l,u,d,p))},h}function iK(){return dr.apply(ny(ZW,eq,ji,ey,ep,jc,Jx,Xx,Hs,vT).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function sK(){return dr.apply(ny(QW,JW,Si,ty,tp,Zf,Zx,Qx,Hs,xT).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function np(){var e=0,t=1,n,r,i,a,l=gn,u=!1,d;function p(m){return m==null||isNaN(m=+m)?d:l(i===0?.5:(m=(a(m)-n)*i,u?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([e,t]=m,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),p):[e,t]},p.clamp=function(m){return arguments.length?(u=!!m,p):u},p.interpolator=function(m){return arguments.length?(l=m,p):l};function h(m){return function(v){var x,w;return arguments.length?([x,w]=v,l=m(x,w),p):[l(0),l(1)]}}return p.range=h(No),p.rangeRound=h(Bx),p.unknown=function(m){return arguments.length?(d=m,p):d},function(m){return a=m,n=m(e),r=m(t),i=n===r?0:1/(r-n),p}}function ys(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function yT(){var e=xs(np()(gn));return e.copy=function(){return ys(e,yT())},Ai.apply(e,arguments)}function bT(){var e=qx(np()).domain([1,10]);return e.copy=function(){return ys(e,bT()).base(e.base())},Ai.apply(e,arguments)}function wT(){var e=Kx(np());return e.copy=function(){return ys(e,wT()).constant(e.constant())},Ai.apply(e,arguments)}function ry(){var e=Hx(np());return e.copy=function(){return ys(e,ry()).exponent(e.exponent())},Ai.apply(e,arguments)}function aK(){return ry.apply(null,arguments).exponent(.5)}function jT(){var e=[],t=gn;function n(r){if(r!=null&&!isNaN(r=+r))return t((yc(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(cs),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>q9(e,a/r))},n.copy=function(){return jT(t).domain(e)},Ai.apply(n,arguments)}function rp(){var e=0,t=.5,n=1,r=1,i,a,l,u,d,p=gn,h,m=!1,v;function x(S){return isNaN(S=+S)?v:(S=.5+((S=+h(S))-a)*(r*S<r*a?u:d),p(m?Math.max(0,Math.min(1,S)):S))}x.domain=function(S){return arguments.length?([e,t,n]=S,i=h(e=+e),a=h(t=+t),l=h(n=+n),u=i===a?0:.5/(a-i),d=a===l?0:.5/(l-a),r=a<i?-1:1,x):[e,t,n]},x.clamp=function(S){return arguments.length?(m=!!S,x):m},x.interpolator=function(S){return arguments.length?(p=S,x):p};function w(S){return function(j){var k,C,E;return arguments.length?([k,C,E]=j,p=xW(S,[k,C,E]),x):[p(0),p(.5),p(1)]}}return x.range=w(No),x.rangeRound=w(Bx),x.unknown=function(S){return arguments.length?(v=S,x):v},function(S){return h=S,i=S(e),a=S(t),l=S(n),u=i===a?0:.5/(a-i),d=a===l?0:.5/(l-a),r=a<i?-1:1,x}}function ST(){var e=xs(rp()(gn));return e.copy=function(){return ys(e,ST())},Ai.apply(e,arguments)}function NT(){var e=qx(rp()).domain([.1,1,10]);return e.copy=function(){return ys(e,NT()).base(e.base())},Ai.apply(e,arguments)}function kT(){var e=Kx(rp());return e.copy=function(){return ys(e,kT()).constant(e.constant())},Ai.apply(e,arguments)}function iy(){var e=Hx(rp());return e.copy=function(){return ys(e,iy()).exponent(e.exponent())},Ai.apply(e,arguments)}function oK(){return iy.apply(null,arguments).exponent(.5)}const El=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:$x,scaleDiverging:ST,scaleDivergingLog:NT,scaleDivergingPow:iy,scaleDivergingSqrt:oK,scaleDivergingSymlog:kT,scaleIdentity:rT,scaleImplicit:iv,scaleLinear:nT,scaleLog:sT,scaleOrdinal:Lx,scalePoint:G9,scalePow:Gx,scaleQuantile:lT,scaleQuantize:cT,scaleRadial:oT,scaleSequential:yT,scaleSequentialLog:bT,scaleSequentialPow:ry,scaleSequentialQuantile:jT,scaleSequentialSqrt:aK,scaleSequentialSymlog:wT,scaleSqrt:BW,scaleSymlog:aT,scaleThreshold:uT,scaleTime:iK,scaleUtc:sK,tickFormat:tT},Symbol.toStringTag,{value:"Module"}));var Ei=e=>e.chartData,PT=Q([Ei],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),CT=(e,t,n,r)=>r?PT(e):Ei(e),lK=(e,t,n)=>n?PT(e):Ei(e);function Ni(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Ke(t)&&Ke(n))return!0}return!1}function EP(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function OT(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Ke(n))i=n;else if(typeof n=="function")return;if(Ke(r))a=r;else if(typeof r=="function")return;var l=[i,a];if(Ni(l))return l}}function cK(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Ni(r))return EP(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,l,u;if(i==="auto")t!=null&&(l=Math.min(...t));else if(Ne(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&BN.test(i)){var d=BN.exec(i);if(d==null||d[1]==null||t==null)l=void 0;else{var p=+d[1];l=t[0]-p}}else l=t==null?void 0:t[0];if(a==="auto")t!=null&&(u=Math.max(...t));else if(Ne(a))u=a;else if(typeof a=="function")try{t!=null&&(u=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&VN.test(a)){var h=VN.exec(a);if(h==null||h[1]==null||t==null)u=void 0;else{var m=+h[1];u=t[1]+m}}else u=t==null?void 0:t[1];var v=[l,u];if(Ni(v))return t==null?v:EP(v,t,n)}}}var ko=1e9,uK={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},ay,pt=!0,cr="[DecimalError] ",Qs=cr+"Invalid argument: ",sy=cr+"Exponent out of range: ",Po=Math.floor,Us=Math.pow,dK=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,zn,Vt=1e7,ct=7,AT=9007199254740991,uf=Po(AT/ct),xe={};xe.absoluteValue=xe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};xe.comparedTo=xe.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};xe.decimalPlaces=xe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ct;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};xe.dividedBy=xe.div=function(e){return gi(this,new this.constructor(e))};xe.dividedToIntegerBy=xe.idiv=function(e){var t=this,n=t.constructor;return tt(gi(t,new n(e),0,1),n.precision)};xe.equals=xe.eq=function(e){return!this.cmp(e)};xe.exponent=function(){return Pt(this)};xe.greaterThan=xe.gt=function(e){return this.cmp(e)>0};xe.greaterThanOrEqualTo=xe.gte=function(e){return this.cmp(e)>=0};xe.isInteger=xe.isint=function(){return this.e>this.d.length-2};xe.isNegative=xe.isneg=function(){return this.s<0};xe.isPositive=xe.ispos=function(){return this.s>0};xe.isZero=function(){return this.s===0};xe.lessThan=xe.lt=function(e){return this.cmp(e)<0};xe.lessThanOrEqualTo=xe.lte=function(e){return this.cmp(e)<1};xe.logarithm=xe.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(zn))throw Error(cr+"NaN");if(n.s<1)throw Error(cr+(n.s?"NaN":"-Infinity"));return n.eq(zn)?new r(0):(pt=!1,t=gi(rc(n,a),rc(e,a),a),pt=!0,tt(t,i))};xe.minus=xe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_T(t,e):ET(t,(e.s=-e.s,e))};xe.modulo=xe.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(cr+"NaN");return n.s?(pt=!1,t=gi(n,e,0,1).times(e),pt=!0,n.minus(t)):tt(new r(n),i)};xe.naturalExponential=xe.exp=function(){return TT(this)};xe.naturalLogarithm=xe.ln=function(){return rc(this)};xe.negated=xe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};xe.plus=xe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ET(t,e):_T(t,(e.s=-e.s,e))};xe.precision=xe.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Qs+e);if(t=Pt(i)+1,r=i.d.length-1,n=r*ct+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};xe.squareRoot=xe.sqrt=function(){var e,t,n,r,i,a,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(cr+"NaN")}for(e=Pt(u),pt=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=Vr(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Po((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(i.toString()),n=d.precision,i=l=n+3;;)if(a=r,r=a.plus(gi(u,a,l+2)).times(.5),Vr(a.d).slice(0,l)===(t=Vr(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(tt(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;l+=4}return pt=!0,tt(r,n)};xe.times=xe.mul=function(e){var t,n,r,i,a,l,u,d,p,h=this,m=h.constructor,v=h.d,x=(e=new m(e)).d;if(!h.s||!e.s)return new m(0);for(e.s*=h.s,n=h.e+e.e,d=v.length,p=x.length,d<p&&(a=v,v=x,x=a,l=d,d=p,p=l),a=[],l=d+p,r=l;r--;)a.push(0);for(r=p;--r>=0;){for(t=0,i=d+r;i>r;)u=a[i]+x[r]*v[i-r-1]+t,a[i--]=u%Vt|0,t=u/Vt|0;a[i]=(a[i]+t)%Vt|0}for(;!a[--l];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,pt?tt(e,m.precision):e};xe.toDecimalPlaces=xe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Xr(e,0,ko),t===void 0?t=r.rounding:Xr(t,0,8),tt(n,e+Pt(n)+1,t))};xe.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=ia(r,!0):(Xr(e,0,ko),t===void 0?t=i.rounding:Xr(t,0,8),r=tt(new i(r),e+1,t),n=ia(r,!0,e+1)),n};xe.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?ia(i):(Xr(e,0,ko),t===void 0?t=a.rounding:Xr(t,0,8),r=tt(new a(i),e+Pt(i)+1,t),n=ia(r.abs(),!1,e+Pt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};xe.toInteger=xe.toint=function(){var e=this,t=e.constructor;return tt(new t(e),Pt(e)+1,t.rounding)};xe.toNumber=function(){return+this};xe.toPower=xe.pow=function(e){var t,n,r,i,a,l,u=this,d=u.constructor,p=12,h=+(e=new d(e));if(!e.s)return new d(zn);if(u=new d(u),!u.s){if(e.s<1)throw Error(cr+"Infinity");return u}if(u.eq(zn))return u;if(r=d.precision,e.eq(zn))return tt(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,a=u.s,l){if((n=h<0?-h:h)<=AT){for(i=new d(zn),t=Math.ceil(r/ct+4),pt=!1;n%2&&(i=i.times(u),_P(i.d,t)),n=Po(n/2),n!==0;)u=u.times(u),_P(u.d,t);return pt=!0,e.s<0?new d(zn).div(i):tt(i,r)}}else if(a<0)throw Error(cr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,pt=!1,i=e.times(rc(u,r+p)),pt=!0,i=TT(i),i.s=a,i};xe.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Pt(i),r=ia(i,n<=a.toExpNeg||n>=a.toExpPos)):(Xr(e,1,ko),t===void 0?t=a.rounding:Xr(t,0,8),i=tt(new a(i),e,t),n=Pt(i),r=ia(i,e<=n||n<=a.toExpNeg,e)),r};xe.toSignificantDigits=xe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Xr(e,1,ko),t===void 0?t=r.rounding:Xr(t,0,8)),tt(new r(n),e,t)};xe.toString=xe.valueOf=xe.val=xe.toJSON=xe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Pt(e),n=e.constructor;return ia(e,t<=n.toExpNeg||t>=n.toExpPos)};function ET(e,t){var n,r,i,a,l,u,d,p,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),pt?tt(t,m):t;if(d=e.d,p=t.d,l=e.e,i=t.e,d=d.slice(),a=l-i,a){for(a<0?(r=d,a=-a,u=p.length):(r=p,i=l,u=d.length),l=Math.ceil(m/ct),u=l>u?l+1:u+1,a>u&&(a=u,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(u=d.length,a=p.length,u-a<0&&(a=u,r=p,p=d,d=r),n=0;a;)n=(d[--a]=d[a]+p[a]+n)/Vt|0,d[a]%=Vt;for(n&&(d.unshift(n),++i),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=i,pt?tt(t,m):t}function Xr(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Qs+e)}function Vr(e){var t,n,r,i=e.length-1,a="",l=e[0];if(i>0){for(a+=l,t=1;t<i;t++)r=e[t]+"",n=ct-r.length,n&&(a+=ss(n)),a+=r;l=e[t],r=l+"",n=ct-r.length,n&&(a+=ss(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var gi=(function(){function e(r,i){var a,l=0,u=r.length;for(r=r.slice();u--;)a=r[u]*i+l,r[u]=a%Vt|0,l=a/Vt|0;return l&&r.unshift(l),r}function t(r,i,a,l){var u,d;if(a!=l)d=a>l?1:-1;else for(u=d=0;u<a;u++)if(r[u]!=i[u]){d=r[u]>i[u]?1:-1;break}return d}function n(r,i,a){for(var l=0;a--;)r[a]-=l,l=r[a]<i[a]?1:0,r[a]=l*Vt+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,l){var u,d,p,h,m,v,x,w,S,j,k,C,E,O,P,A,_,D,$=r.constructor,q=r.s==i.s?1:-1,X=r.d,L=i.d;if(!r.s)return new $(r);if(!i.s)throw Error(cr+"Division by zero");for(d=r.e-i.e,_=L.length,P=X.length,x=new $(q),w=x.d=[],p=0;L[p]==(X[p]||0);)++p;if(L[p]>(X[p]||0)&&--d,a==null?C=a=$.precision:l?C=a+(Pt(r)-Pt(i))+1:C=a,C<0)return new $(0);if(C=C/ct+2|0,p=0,_==1)for(h=0,L=L[0],C++;(p<P||h)&&C--;p++)E=h*Vt+(X[p]||0),w[p]=E/L|0,h=E%L|0;else{for(h=Vt/(L[0]+1)|0,h>1&&(L=e(L,h),X=e(X,h),_=L.length,P=X.length),O=_,S=X.slice(0,_),j=S.length;j<_;)S[j++]=0;D=L.slice(),D.unshift(0),A=L[0],L[1]>=Vt/2&&++A;do h=0,u=t(L,S,_,j),u<0?(k=S[0],_!=j&&(k=k*Vt+(S[1]||0)),h=k/A|0,h>1?(h>=Vt&&(h=Vt-1),m=e(L,h),v=m.length,j=S.length,u=t(m,S,v,j),u==1&&(h--,n(m,_<v?D:L,v))):(h==0&&(u=h=1),m=L.slice()),v=m.length,v<j&&m.unshift(0),n(S,m,j),u==-1&&(j=S.length,u=t(L,S,_,j),u<1&&(h++,n(S,_<j?D:L,j))),j=S.length):u===0&&(h++,S=[0]),w[p++]=h,u&&S[0]?S[j++]=X[O]||0:(S=[X[O]],j=1);while((O++<P||S[0]!==void 0)&&C--)}return w[0]||w.shift(),x.e=d,tt(x,l?a+Pt(x)+1:a)}})();function TT(e,t){var n,r,i,a,l,u,d=0,p=0,h=e.constructor,m=h.precision;if(Pt(e)>16)throw Error(sy+Pt(e));if(!e.s)return new h(zn);for(pt=!1,u=m,l=new h(.03125);e.abs().gte(.1);)e=e.times(l),p+=5;for(r=Math.log(Us(2,p))/Math.LN10*2+5|0,u+=r,n=i=a=new h(zn),h.precision=u;;){if(i=tt(i.times(e),u),n=n.times(++d),l=a.plus(gi(i,n,u)),Vr(l.d).slice(0,u)===Vr(a.d).slice(0,u)){for(;p--;)a=tt(a.times(a),u);return h.precision=m,t==null?(pt=!0,tt(a,m)):a}a=l}}function Pt(e){for(var t=e.e*ct,n=e.d[0];n>=10;n/=10)t++;return t}function B0(e,t,n){if(t>e.LN10.sd())throw pt=!0,n&&(e.precision=n),Error(cr+"LN10 precision limit exceeded");return tt(new e(e.LN10),t)}function ss(e){for(var t="";e--;)t+="0";return t}function rc(e,t){var n,r,i,a,l,u,d,p,h,m=1,v=10,x=e,w=x.d,S=x.constructor,j=S.precision;if(x.s<1)throw Error(cr+(x.s?"NaN":"-Infinity"));if(x.eq(zn))return new S(0);if(t==null?(pt=!1,p=j):p=t,x.eq(10))return t==null&&(pt=!0),B0(S,p);if(p+=v,S.precision=p,n=Vr(w),r=n.charAt(0),a=Pt(x),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=Vr(x.d),r=n.charAt(0),m++;a=Pt(x),r>1?(x=new S("0."+n),a++):x=new S(r+"."+n.slice(1))}else return d=B0(S,p+2,j).times(a+""),x=rc(new S(r+"."+n.slice(1)),p-v).plus(d),S.precision=j,t==null?(pt=!0,tt(x,j)):x;for(u=l=x=gi(x.minus(zn),x.plus(zn),p),h=tt(x.times(x),p),i=3;;){if(l=tt(l.times(h),p),d=u.plus(gi(l,new S(i),p)),Vr(d.d).slice(0,p)===Vr(u.d).slice(0,p))return u=u.times(2),a!==0&&(u=u.plus(B0(S,p+2,j).times(a+""))),u=gi(u,new S(m),p),S.precision=j,t==null?(pt=!0,tt(u,j)):u;u=d,i+=2}}function TP(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Po(n/ct),e.d=[],r=(n+1)%ct,n<0&&(r+=ct),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=ct;r<i;)e.d.push(+t.slice(r,r+=ct));t=t.slice(r),r=ct-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),pt&&(e.e>uf||e.e<-uf))throw Error(sy+n)}else e.s=0,e.e=0,e.d=[0];return e}function tt(e,t,n){var r,i,a,l,u,d,p,h,m=e.d;for(l=1,a=m[0];a>=10;a/=10)l++;if(r=t-l,r<0)r+=ct,i=t,p=m[h=0];else{if(h=Math.ceil((r+1)/ct),a=m.length,h>=a)return e;for(p=a=m[h],l=1;a>=10;a/=10)l++;r%=ct,i=r-ct+l}if(n!==void 0&&(a=Us(10,l-i-1),u=p/a%10|0,d=t<0||m[h+1]!==void 0||p%a,d=n<4?(u||d)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||d||n==6&&(r>0?i>0?p/Us(10,l-i):0:m[h-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=Pt(e),m.length=1,t=t-a-1,m[0]=Us(10,(ct-t%ct)%ct),e.e=Po(-t/ct)||0):(m.length=1,m[0]=e.e=e.s=0),e;if(r==0?(m.length=h,a=1,h--):(m.length=h+1,a=Us(10,ct-r),m[h]=i>0?(p/Us(10,l-i)%Us(10,i)|0)*a:0),d)for(;;)if(h==0){(m[0]+=a)==Vt&&(m[0]=1,++e.e);break}else{if(m[h]+=a,m[h]!=Vt)break;m[h--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(pt&&(e.e>uf||e.e<-uf))throw Error(sy+Pt(e));return e}function _T(e,t){var n,r,i,a,l,u,d,p,h,m,v=e.constructor,x=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),pt?tt(t,x):t;if(d=e.d,m=t.d,r=t.e,p=e.e,d=d.slice(),l=p-r,l){for(h=l<0,h?(n=d,l=-l,u=m.length):(n=m,r=p,u=d.length),i=Math.max(Math.ceil(x/ct),u)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=d.length,u=m.length,h=i<u,h&&(u=i),i=0;i<u;i++)if(d[i]!=m[i]){h=d[i]<m[i];break}l=0}for(h&&(n=d,d=m,m=n,t.s=-t.s),u=d.length,i=m.length-u;i>0;--i)d[u++]=0;for(i=m.length;i>l;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=Vt-1;--d[a],d[i]+=Vt}d[i]-=m[i]}for(;d[--u]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,pt?tt(t,x):t):new v(0)}function ia(e,t,n){var r,i=Pt(e),a=Vr(e.d),l=a.length;return t?(n&&(r=n-l)>0?a=a.charAt(0)+"."+a.slice(1)+ss(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ss(-i-1)+a,n&&(r=n-l)>0&&(a+=ss(r))):i>=l?(a+=ss(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+ss(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=ss(r))),e.s<0?"-"+a:a}function _P(e,t){if(e.length>t)return e.length=t,!0}function MT(e){var t,n,r;function i(a){var l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,a instanceof i){l.s=a.s,l.e=a.e,l.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Qs+a);if(a>0)l.s=1;else if(a<0)a=-a,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(a===~~a&&a<1e7){l.e=0,l.d=[a];return}return TP(l,a.toString())}else if(typeof a!="string")throw Error(Qs+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,dK.test(a))TP(l,a);else throw Error(Qs+a)}if(i.prototype=xe,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=MT,i.config=i.set=fK,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function fK(e){if(!e||typeof e!="object")throw Error(cr+"Object expected");var t,n,r,i=["precision",1,ko,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Po(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Qs+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Qs+n+": "+r);return this}var ay=MT(uK);zn=new ay(1);const Qe=ay;function IT(e){var t;return e===0?t=1:t=Math.floor(new Qe(e).abs().log(10).toNumber())+1,t}function DT(e,t,n){for(var r=new Qe(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var RT=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},LT=(e,t,n)=>{if(e.lte(0))return new Qe(0);var r=IT(e.toNumber()),i=new Qe(10).pow(r),a=e.div(i),l=r!==1?.05:.1,u=new Qe(Math.ceil(a.div(l).toNumber())).add(n).mul(l),d=u.mul(i);return t?new Qe(d.toNumber()):new Qe(Math.ceil(d.toNumber()))},pK=(e,t,n)=>{var r=new Qe(1),i=new Qe(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Qe(10).pow(IT(e)-1),i=new Qe(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Qe(Math.floor(e)))}else e===0?i=new Qe(Math.floor((t-1)/2)):n||(i=new Qe(Math.floor(e)));for(var l=Math.floor((t-1)/2),u=[],d=0;d<t;d++)u.push(i.add(new Qe(d-l).mul(r)).toNumber());return u},$T=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((n-t)/(r-1)))return{step:new Qe(0),tickMin:new Qe(0),tickMax:new Qe(0)};var l=LT(new Qe(n).sub(t).div(r-1),i,a),u;t<=0&&n>=0?u=new Qe(0):(u=new Qe(t).add(n).div(2),u=u.sub(new Qe(u).mod(l)));var d=Math.ceil(u.sub(t).div(l).toNumber()),p=Math.ceil(new Qe(n).sub(u).div(l).toNumber()),h=d+p+1;return h>r?$T(t,n,r,i,a+1):(h<r&&(p=n>0?p+(r-h):p,d=n>0?d:d+(r-h)),{step:l,tickMin:u.sub(new Qe(d).mul(l)),tickMax:u.add(new Qe(p).mul(l))})},hK=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(i,2),[u,d]=RT([n,r]);if(u===-1/0||d===1/0){var p=d===1/0?[u,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),d];return n>r?p.reverse():p}if(u===d)return pK(u,i,a);var{step:h,tickMin:m,tickMax:v}=$T(u,d,l,a,0),x=DT(m,v.add(new Qe(.1).mul(h)),h);return n>r?x.reverse():x},mK=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[l,u]=RT([r,i]);if(l===-1/0||u===1/0)return[r,i];if(l===u)return[l];var d=Math.max(n,2),p=LT(new Qe(u).sub(l).div(d-1),a,0),h=[...DT(new Qe(l),new Qe(u),p),u];return a===!1&&(h=h.map(m=>Math.round(m))),r>i?h.reverse():h},zT=e=>e.rootProps.maxBarSize,gK=e=>e.rootProps.barGap,FT=e=>e.rootProps.barCategoryGap,vK=e=>e.rootProps.barSize,ip=e=>e.rootProps.stackOffset,BT=e=>e.rootProps.reverseStackOrder,oy=e=>e.options.chartName,ly=e=>e.rootProps.syncId,VT=e=>e.rootProps.syncMethod,cy=e=>e.options.eventEmitter,En={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},$s={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},$r={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},sp=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function ap(e,t,n){if(n!=="auto")return n;if(e!=null)return vs(e,t)?"category":"number"}function MP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function df(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MP(Object(n),!0).forEach(function(r){xK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xK(e,t,n){return(t=yK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yK(e){var t=bK(e,"string");return typeof t=="symbol"?t:t+""}function bK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var IP={allowDataOverflow:$s.allowDataOverflow,allowDecimals:$s.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:$s.angleAxisId,includeHidden:!1,name:void 0,reversed:$s.reversed,scale:$s.scale,tick:$s.tick,tickCount:void 0,ticks:void 0,type:$s.type,unit:void 0},DP={allowDataOverflow:$r.allowDataOverflow,allowDecimals:$r.allowDecimals,allowDuplicatedCategory:$r.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:$r.radiusAxisId,includeHidden:$r.includeHidden,name:void 0,reversed:$r.reversed,scale:$r.scale,tick:$r.tick,tickCount:$r.tickCount,ticks:void 0,type:$r.type,unit:void 0},wK=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},uy=Q([wK,OE],(e,t)=>{var n;if(e!=null)return e;var r=(n=ap(t,"angleAxis",IP.type))!==null&&n!==void 0?n:"category";return df(df({},IP),{},{type:r})}),jK=(e,t)=>e.polarAxis.radiusAxis[t],dy=Q([jK,OE],(e,t)=>{var n;if(e!=null)return e;var r=(n=ap(t,"radiusAxis",DP.type))!==null&&n!==void 0?n:"category";return df(df({},DP),{},{type:r})}),op=e=>e.polarOptions,fy=Q([Ci,Oi,Wt],y9),UT=Q([op,fy],(e,t)=>{if(e!=null)return Or(e.innerRadius,t,0)}),WT=Q([op,fy],(e,t)=>{if(e!=null)return Or(e.outerRadius,t,t*.8)}),SK=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},qT=Q([op],SK);Q([uy,qT],sp);var KT=Q([fy,UT,WT],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});Q([dy,KT],sp);var HT=Q([nt,op,UT,WT,Ci,Oi],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:u,startAngle:d,endAngle:p}=t;return{cx:Or(l,i,i/2),cy:Or(u,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:p,clockWise:!1}}}),Kt=(e,t)=>t,lp=(e,t,n)=>n;function py(e){return e==null?void 0:e.id}function GT(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,l=new Map;return e.forEach(u=>{var d,p=(d=u.data)!==null&&d!==void 0?d:r;if(!(p==null||p.length===0)){var h=py(u);p.forEach((m,v)=>{var x=a==null||i?v:String(tn(m,a,null)),w=tn(m,u.dataKey,0),S;l.has(x)?S=l.get(x):S={},Object.assign(S,{[h]:w}),l.set(x,S)})}}),Array.from(l.values())}function cp(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var up=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function dp(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function NK(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var Ht=e=>{var t=nt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Co=e=>e.tooltip.settings.axisId;function kK(e){if(e in El)return El[e]();var t="scale".concat(pc(e));if(t in El)return El[t]()}function RP(e){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function l(){return a.apply(this,arguments)}return l.toString=function(){return a.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var l=i[0],u=i[1];return l<=u?a>=l&&a<=u:a>=u&&a<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,l)=>{var u=e(a);if(u!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var d=e.bandwidth();switch(l.position){case"middle":u+=d/2;break;case"end":u+=d;break}}return u}}}}function LP(e,t,n){if(typeof e=="function")return RP(e.copy().domain(t).range(n));if(e!=null){var r=kK(e);if(r!=null)return r.domain(t).range(n),RP(r)}}var PK=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Ni(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Ke(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function $P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ff(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$P(Object(n),!0).forEach(function(r){CK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$P(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CK(e,t,n){return(t=OK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OK(e){var t=AK(e,"string");return typeof t=="symbol"?t:t+""}function AK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lv=[0,"auto"],Ft={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0},YT=(e,t)=>e.cartesianAxis.xAxis[t],Ti=(e,t)=>{var n=YT(e,t);return n??Ft},Bt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:lv,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:gc},XT=(e,t)=>e.cartesianAxis.yAxis[t],_i=(e,t)=>{var n=XT(e,t);return n??Bt},EK={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},hy=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??EK},yn=(e,t,n)=>{switch(t){case"xAxis":return Ti(e,n);case"yAxis":return _i(e,n);case"zAxis":return hy(e,n);case"angleAxis":return uy(e,n);case"radiusAxis":return dy(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},TK=(e,t,n)=>{switch(t){case"xAxis":return Ti(e,n);case"yAxis":return _i(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Sc=(e,t,n)=>{switch(t){case"xAxis":return Ti(e,n);case"yAxis":return _i(e,n);case"angleAxis":return uy(e,n);case"radiusAxis":return dy(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},QT=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function JT(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var my=e=>e.graphicalItems.cartesianItems,_K=Q([Kt,lp],JT),ZT=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Nc=Q([my,yn,_K],ZT,{memoizeOptions:{resultEqualityCheck:dp}}),e5=Q([Nc],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(cp)),t5=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),MK=Q([Nc],t5),n5=e=>e.map(t=>t.data).filter(Boolean).flat(1),IK=Q([Nc],n5,{memoizeOptions:{resultEqualityCheck:dp}}),r5=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},gy=Q([IK,CT],r5),i5=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:tn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:tn(i,r)}))):e.map(r=>({value:r})),fp=Q([gy,yn,Nc],i5);function s5(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function hd(e){if(Yr(e)||e instanceof Date){var t=Number(e);if(Ke(t))return t}}function zP(e){if(Array.isArray(e)){var t=[hd(e[0]),hd(e[1])];return Ni(t)?t:void 0}var n=hd(e);if(n!=null)return[n,n]}function ki(e){return e.map(hd).filter(Fr)}function DK(e,t,n){return!n||typeof t!="number"||Gr(t)?[]:n.length?ki(n.flatMap(r=>{var i=tn(e,r.dataKey),a,l;if(Array.isArray(i)?[a,l]=i:a=l=i,!(!Ke(a)||!Ke(l)))return[t-a,t+l]})):[]}var _t=e=>{var t=Ht(e),n=Co(e);return Sc(e,t,n)},kc=Q([_t],e=>e==null?void 0:e.dataKey),RK=Q([e5,CT,_t],GT),a5=(e,t,n,r)=>{var i={},a=t.reduce((l,u)=>{if(u.stackId==null)return l;var d=l[u.stackId];return d==null&&(d=[]),d.push(u),l[u.stackId]=d,l},i);return Object.fromEntries(Object.entries(a).map(l=>{var[u,d]=l,p=r?[...d].reverse():d,h=p.map(py);return[u,{stackedData:aV(e,h,n),graphicalItems:p}]}))},cv=Q([RK,e5,ip,BT],a5),o5=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var l=dV(e,i,a);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},LK=Q([yn],e=>e.allowDataOverflow),vy=e=>{var t;if(e==null||!("domain"in e))return lv;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=ki(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:lv},l5=Q([yn],vy),c5=Q([l5,LK],OT),$K=Q([cv,Ei,Kt,c5],o5,{memoizeOptions:{resultEqualityCheck:up}}),xy=e=>e.errorBars,zK=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>s5(n,r)),pf=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),l=Math.min(...a),u=Math.max(...a);return[l,u]}},u5=(e,t,n,r,i)=>{var a,l;if(n.length>0&&e.forEach(u=>{n.forEach(d=>{var p,h,m=(p=r[d.id])===null||p===void 0?void 0:p.filter(k=>s5(i,k)),v=tn(u,(h=t.dataKey)!==null&&h!==void 0?h:d.dataKey),x=DK(u,v,m);if(x.length>=2){var w=Math.min(...x),S=Math.max(...x);(a==null||w<a)&&(a=w),(l==null||S>l)&&(l=S)}var j=zP(v);j!=null&&(a=a==null?j[0]:Math.min(a,j[0]),l=l==null?j[1]:Math.max(l,j[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(u=>{var d=zP(tn(u,t.dataKey));d!=null&&(a=a==null?d[0]:Math.min(a,d[0]),l=l==null?d[1]:Math.max(l,d[1]))}),Ke(a)&&Ke(l))return[a,l]},FK=Q([gy,yn,MK,xy,Kt],u5,{memoizeOptions:{resultEqualityCheck:up}});function BK(e){var{value:t}=e;if(Yr(t)||t instanceof Date)return t}var VK=(e,t,n)=>{var r=e.map(BK).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&EA(r))?KE(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},d5=e=>e.referenceElements.dots,Oo=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),UK=Q([d5,Kt,lp],Oo),f5=e=>e.referenceElements.areas,WK=Q([f5,Kt,lp],Oo),p5=e=>e.referenceElements.lines,qK=Q([p5,Kt,lp],Oo),h5=(e,t)=>{if(e!=null){var n=ki(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},KK=Q(UK,Kt,h5),m5=(e,t)=>{if(e!=null){var n=ki(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},HK=Q([WK,Kt],m5);function GK(e){var t;if(e.x!=null)return ki([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:ki(n)}function YK(e){var t;if(e.y!=null)return ki([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:ki(n)}var g5=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?GK(r):YK(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},XK=Q([qK,Kt],g5),QK=Q(KK,XK,HK,(e,t,n)=>pf(e,n,t)),v5=(e,t,n,r,i,a,l,u)=>{if(n!=null)return n;var d=l==="vertical"&&u==="xAxis"||l==="horizontal"&&u==="yAxis",p=d?pf(r,a,i):pf(a,i);return cK(t,p,e.allowDataOverflow)},JK=Q([yn,l5,c5,$K,FK,QK,nt,Kt],v5,{memoizeOptions:{resultEqualityCheck:up}}),ZK=[0,1],x5=(e,t,n,r,i,a,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:u,type:d}=e,p=vs(t,a);if(p&&u==null){var h;return KE(0,(h=n==null?void 0:n.length)!==null&&h!==void 0?h:0)}return d==="category"?VK(r,e,p):i==="expand"?ZK:l}},yy=Q([yn,nt,gy,fp,ip,Kt,JK],x5);function eH(e){return e in El}var y5=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string"){var a="scale".concat(pc(r));return eH(a)?a:"point"}}},Ao=Q([yn,QT,oy],y5);function by(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?LP(e.scale,n,r):LP(t,n,r)}var b5=(e,t,n)=>{var r=vy(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(r)&&(r[0]==="auto"||r[1]==="auto")&&Ni(e))return hK(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&Ni(e))return mK(e,t.tickCount,t.allowDecimals)}},wy=Q([yy,Sc,Ao],b5),w5=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Ni(t)&&Array.isArray(n)&&n.length>0){var i,a,l=t[0],u=(i=n[0])!==null&&i!==void 0?i:0,d=t[1],p=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(l,u),Math.max(d,p)]}return t},tH=Q([yn,yy,wy,Kt],w5),nH=Q(fp,yn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(ki(e.map(m=>m.value))).sort((m,v)=>m-v),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var l=a-i;if(l===0)return 1/0;for(var u=0;u<r.length-1;u++){var d=r[u],p=r[u+1];if(!(d==null||p==null)){var h=p-d;n=Math.min(n,h)}}return n/l}}),j5=Q(nH,nt,FT,Wt,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Ke(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var l=Or(n,e*a),u=e*a/2;return u-l-(u-l)/a*l}return 0}),rH=(e,t,n)=>{var r=Ti(e,t);return r==null||typeof r.padding!="string"?0:j5(e,"xAxis",t,n,r.padding)},iH=(e,t,n)=>{var r=_i(e,t);return r==null||typeof r.padding!="string"?0:j5(e,"yAxis",t,n,r.padding)},sH=Q(Ti,rH,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),aH=Q(_i,iH,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),oH=Q([Wt,sH,Kf,qf,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),lH=Q([Wt,nt,aH,Kf,qf,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:l}=i;return a?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Pc=(e,t,n,r)=>{var i;switch(t){case"xAxis":return oH(e,n,r);case"yAxis":return lH(e,n,r);case"zAxis":return(i=hy(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return qT(e);case"radiusAxis":return KT(e,n);default:return}},S5=Q([yn,Pc],sp),cH=Q([Ao,tH],PK),pp=Q([yn,Ao,cH,S5],by);Q([Nc,xy,Kt],zK);function N5(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var hp=(e,t)=>t,mp=(e,t,n)=>n,uH=Q(Uf,hp,mp,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(N5)),dH=Q(Wf,hp,mp,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(N5)),k5=(e,t)=>({width:e.width,height:t.height}),fH=(e,t)=>{var n=typeof t.width=="number"?t.width:gc;return{width:n,height:e.height}},P5=Q(Wt,Ti,k5),pH=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},hH=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},mH=Q(Oi,Wt,uH,hp,mp,(e,t,n,r,i)=>{var a={},l;return n.forEach(u=>{var d=k5(t,u);l==null&&(l=pH(t,r,e));var p=r==="top"&&!i||r==="bottom"&&i;a[u.id]=l-Number(p)*d.height,l+=(p?-1:1)*d.height}),a}),gH=Q(Ci,Wt,dH,hp,mp,(e,t,n,r,i)=>{var a={},l;return n.forEach(u=>{var d=fH(t,u);l==null&&(l=hH(t,r,e));var p=r==="left"&&!i||r==="right"&&i;a[u.id]=l-Number(p)*d.width,l+=(p?-1:1)*d.width}),a}),vH=(e,t)=>{var n=Ti(e,t);if(n!=null)return mH(e,n.orientation,n.mirror)},xH=Q([Wt,Ti,vH,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),yH=(e,t)=>{var n=_i(e,t);if(n!=null)return gH(e,n.orientation,n.mirror)},bH=Q([Wt,_i,yH,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),C5=Q(Wt,_i,(e,t)=>{var n=typeof t.width=="number"?t.width:gc;return{width:n,height:e.height}}),FP=(e,t,n)=>{switch(t){case"xAxis":return P5(e,n).width;case"yAxis":return C5(e,n).height;default:return}},O5=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:l}=n,u=vs(e,r),d=t.map(p=>p.value);if(l&&u&&a==="category"&&i&&EA(d))return d}},jy=Q([nt,fp,yn,Kt],O5),A5=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,l=vs(e,r);if(l&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},Sy=Q([nt,fp,Sc,Kt],A5);Q([nt,TK,Ao,pp,jy,Sy,Pc,wy,Kt],(e,t,n,r,i,a,l,u,d)=>{if(t!=null){var p=vs(e,d);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:d,categoricalDomain:a,duplicateDomain:i,isCategorical:p,niceTicks:u,range:l,realScaleType:n,scale:r}}});var wH=(e,t,n,r,i,a,l,u,d)=>{if(!(t==null||r==null)){var p=vs(e,d),{type:h,ticks:m,tickCount:v}=t,x=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,w=h==="category"&&r.bandwidth?r.bandwidth()/x:0;w=d==="angleAxis"&&a!=null&&a.length>=2?Fn(a[0]-a[1])*2*w:w;var S=m||i;return S?S.map((j,k)=>{var C=l?l.indexOf(j):j,E=r.map(C);return Ke(E)?{index:k,coordinate:E+w,value:j,offset:w}:null}).filter(Fr):p&&u?u.map((j,k)=>{var C=r.map(j);return Ke(C)?{coordinate:C+w,value:j,index:k,offset:w}:null}).filter(Fr):r.ticks?r.ticks(v).map((j,k)=>{var C=r.map(j);return Ke(C)?{coordinate:C+w,value:j,index:k,offset:w}:null}).filter(Fr):r.domain().map((j,k)=>{var C=r.map(j);return Ke(C)?{coordinate:C+w,value:l?l[j]:j,index:k,offset:w}:null}).filter(Fr)}},E5=Q([nt,Sc,Ao,pp,wy,Pc,jy,Sy,Kt],wH),jH=(e,t,n,r,i,a,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var u=vs(e,l),{tickCount:d}=t,p=0;return p=l==="angleAxis"&&(r==null?void 0:r.length)>=2?Fn(r[0]-r[1])*2*p:p,u&&a?a.map((h,m)=>{var v=n.map(h);return Ke(v)?{coordinate:v+p,value:h,index:m,offset:p}:null}).filter(Fr):n.ticks?n.ticks(d).map((h,m)=>{var v=n.map(h);return Ke(v)?{coordinate:v+p,value:h,index:m,offset:p}:null}).filter(Fr):n.domain().map((h,m)=>{var v=n.map(h);return Ke(v)?{coordinate:v+p,value:i?i[h]:h,index:m,offset:p}:null}).filter(Fr)}},ho=Q([nt,Sc,pp,Pc,jy,Sy,Kt],jH),mo=Q(yn,pp,(e,t)=>{if(!(e==null||t==null))return ff(ff({},e),{},{scale:t})}),SH=Q([yn,Ao,yy,S5],by);Q((e,t,n)=>hy(e,n),SH,(e,t)=>{if(!(e==null||t==null))return ff(ff({},e),{},{scale:t})});var NH=Q([nt,Uf,Wf],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),T5=e=>e.options.defaultTooltipEventType,_5=e=>e.options.validateTooltipEventTypes;function M5(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function Ny(e,t){var n=T5(e),r=_5(e);return M5(t,n,r)}function kH(e){return Ae(t=>Ny(t,e))}var I5=(e,t)=>{var n,r=Number(t);if(!(Gr(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},PH=e=>e.tooltip.settings,os={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},CH={itemInteraction:{click:os,hover:os},axisInteraction:{click:os,hover:os},keyboardInteraction:os,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},D5=_n({name:"tooltip",initialState:CH,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:ft()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Cr(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:ft()},removeTooltipEntrySettings:{reducer(e,t){var n=Cr(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:ft()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:OH,replaceTooltipEntrySettings:AH,removeTooltipEntrySettings:EH,setTooltipSettingsState:TH,setActiveMouseOverItemIndex:R5,mouseLeaveItem:_H,mouseLeaveChart:L5,setActiveClickItemIndex:MH,setMouseOverAxisIndex:$5,setMouseClickAxisIndex:IH,setSyncInteraction:uv,setKeyboardInteraction:dv}=D5.actions,DH=D5.reducer;function BP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BP(Object(n),!0).forEach(function(r){RH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RH(e,t,n){return(t=LH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LH(e){var t=$H(e,"string");return typeof t=="symbol"?t:t+""}function $H(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zH(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function FH(e){return e.index!=null}var z5=(e,t,n,r)=>{if(t==null)return os;var i=zH(e,t,n);if(i==null)return os;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(FH(i)){if(a)return nd(nd({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return nd(nd({},os),{},{coordinate:i.coordinate})};function BH(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function VH(e,t){var n=BH(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),l=Math.max(r,i);return n>=a&&n<=l}function UH(e,t,n){if(n==null||t==null)return!0;var r=tn(e,t);return r==null||!Ni(n)?!0:VH(r,n)}var ky=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!Ke(a))return i;var l=0,u=1/0;t.length>0&&(u=t.length-1);var d=Math.max(l,Math.min(a,u)),p=t[d];return p==null||UH(p,n,r)?String(d):null},F5=(e,t,n,r,i,a,l)=>{if(a!=null){var u=l[0],d=u==null?void 0:u.getPosition(a);if(d!=null)return d;var p=i==null?void 0:i[Number(a)];if(p)switch(n){case"horizontal":return{x:p.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:p.coordinate}}}},B5=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,i==null&&r!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(l=>{var u;return((u=l.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},V5=e=>e.options.tooltipPayloadSearcher,Eo=e=>e.tooltip;function VP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function UP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VP(Object(n),!0).forEach(function(r){WH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WH(e,t,n){return(t=qH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qH(e){var t=KH(e,"string");return typeof t=="symbol"?t:t+""}function KH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function HH(e,t){return e??t}var U5=(e,t,n,r,i,a,l)=>{if(!(t==null||a==null)){var{chartData:u,computedData:d,dataStartIndex:p,dataEndIndex:h}=n,m=[];return e.reduce((v,x)=>{var w,{dataDefinedOnItem:S,settings:j}=x,k=HH(S,u),C=Array.isArray(k)?wE(k,p,h):k,E=(w=j==null?void 0:j.dataKey)!==null&&w!==void 0?w:r,O=j==null?void 0:j.nameKey,P;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&l==="axis"?P=FB(C,r,i):P=a(C,t,d,O),Array.isArray(P))P.forEach(_=>{var D=UP(UP({},j),{},{name:_.name,unit:_.unit,color:void 0,fill:void 0});v.push(UN({tooltipEntrySettings:D,dataKey:_.dataKey,payload:_.payload,value:tn(_.payload,_.dataKey),name:_.name}))});else{var A;v.push(UN({tooltipEntrySettings:j,dataKey:E,payload:P,value:tn(P,E),name:(A=tn(P,O))!==null&&A!==void 0?A:j==null?void 0:j.name}))}return v},m)}},Py=Q([_t,QT,oy],y5),GH=Q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),YH=Q([Ht,Co],JT),To=Q([GH,_t,YH],ZT,{memoizeOptions:{resultEqualityCheck:dp}}),XH=Q([To],e=>e.filter(cp)),QH=Q([To],n5,{memoizeOptions:{resultEqualityCheck:dp}}),_o=Q([QH,Ei],r5),JH=Q([XH,Ei,_t],GT),Cy=Q([_o,_t,To],i5),W5=Q([_t],vy),ZH=Q([_t],e=>e.allowDataOverflow),q5=Q([W5,ZH],OT),eG=Q([To],e=>e.filter(cp)),tG=Q([JH,eG,ip,BT],a5),nG=Q([tG,Ei,Ht,q5],o5),rG=Q([To],t5),iG=Q([_o,_t,rG,xy,Ht],u5,{memoizeOptions:{resultEqualityCheck:up}}),sG=Q([d5,Ht,Co],Oo),aG=Q([sG,Ht],h5),oG=Q([f5,Ht,Co],Oo),lG=Q([oG,Ht],m5),cG=Q([p5,Ht,Co],Oo),uG=Q([cG,Ht],g5),dG=Q([aG,uG,lG],pf),fG=Q([_t,W5,q5,nG,iG,dG,nt,Ht],v5),Cc=Q([_t,nt,_o,Cy,ip,Ht,fG],x5),pG=Q([Cc,_t,Py],b5),hG=Q([_t,Cc,pG,Ht],w5),K5=e=>{var t=Ht(e),n=Co(e),r=!1;return Pc(e,t,n,r)},H5=Q([_t,K5],sp),G5=Q([_t,Py,hG,H5],by),mG=Q([nt,Cy,_t,Ht],O5),gG=Q([nt,Cy,_t,Ht],A5),vG=(e,t,n,r,i,a,l,u)=>{if(t){var{type:d}=t,p=vs(e,u);if(r){var h=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/h:0;return m=u==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?Fn(i[0]-i[1])*2*m:m,p&&l?l.map((v,x)=>{var w=r.map(v);return Ke(w)?{coordinate:w+m,value:v,index:x,offset:m}:null}).filter(Fr):r.domain().map((v,x)=>{var w=r.map(v);return Ke(w)?{coordinate:w+m,value:a?a[v]:v,index:x,offset:m}:null}).filter(Fr)}}},Mi=Q([nt,_t,Py,G5,K5,mG,gG,Ht],vG),Oy=Q([T5,_5,PH],(e,t,n)=>M5(n.shared,e,t)),Y5=e=>e.tooltip.settings.trigger,Ay=e=>e.tooltip.settings.defaultIndex,Oc=Q([Eo,Oy,Y5,Ay],z5),go=Q([Oc,_o,kc,Cc],ky),X5=Q([Mi,go],I5),Q5=Q([Oc],e=>{if(e)return e.dataKey});Q([Oc],e=>{if(e)return e.graphicalItemId});var J5=Q([Eo,Oy,Y5,Ay],B5),xG=Q([Ci,Oi,nt,Wt,Mi,Ay,J5],F5),yG=Q([Oc,xG],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),bG=Q([Oc],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),wG=Q([J5,go,Ei,kc,X5,V5,Oy],U5);Q([wG],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function WP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WP(Object(n),!0).forEach(function(r){jG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jG(e,t,n){return(t=SG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SG(e){var t=NG(e,"string");return typeof t=="symbol"?t:t+""}function NG(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kG=()=>Ae(_t),PG=()=>{var e=kG(),t=Ae(Mi),n=Ae(G5);return Wd(!e||!n?void 0:qP(qP({},e),{},{scale:n}),t)};function KP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function za(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KP(Object(n),!0).forEach(function(r){CG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CG(e,t,n){return(t=OG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OG(e){var t=AG(e,"string");return typeof t=="symbol"?t:t+""}function AG(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EG=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.chartY};if(e==="vertical")return{x:r.chartX,y:i.coordinate}}return{x:0,y:0}},TG=(e,t,n,r)=>{var i=t.find(p=>p&&p.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:l}=r;return za(za(za({},r),en(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var u=i.coordinate,{angle:d}=r;return za(za(za({},r),en(r.cx,r.cy,u,d)),{},{angle:d,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function _G(e,t){var{chartX:n,chartY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var Z5=(e,t,n,r,i)=>{var a,l=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u<l;u++){var d,p,h,m,v,x=u>0?(d=n[u-1])===null||d===void 0?void 0:d.coordinate:(p=n[l-1])===null||p===void 0?void 0:p.coordinate,w=(h=n[u])===null||h===void 0?void 0:h.coordinate,S=u>=l-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(v=n[u+1])===null||v===void 0?void 0:v.coordinate,j=void 0;if(!(x==null||w==null||S==null))if(Fn(w-x)!==Fn(S-w)){var k=[];if(Fn(S-w)===Fn(i[1]-i[0])){j=S;var C=w+i[1]-i[0];k[0]=Math.min(C,(C+x)/2),k[1]=Math.max(C,(C+x)/2)}else{j=x;var E=S+i[1]-i[0];k[0]=Math.min(w,(E+w)/2),k[1]=Math.max(w,(E+w)/2)}var O=[Math.min(w,(j+w)/2),Math.max(w,(j+w)/2)];if(e>O[0]&&e<=O[1]||e>=k[0]&&e<=k[1]){var P;return(P=n[u])===null||P===void 0?void 0:P.index}}else{var A=Math.min(x,S),_=Math.max(x,S);if(e>(A+w)/2&&e<=(_+w)/2){var D;return(D=n[u])===null||D===void 0?void 0:D.index}}}else if(t)for(var $=0;$<l;$++){var q=t[$];if(q!=null){var X=t[$+1],L=t[$-1];if($===0&&X!=null&&e<=(q.coordinate+X.coordinate)/2||$===l-1&&L!=null&&e>(q.coordinate+L.coordinate)/2||$>0&&$<l-1&&L!=null&&X!=null&&e>(q.coordinate+L.coordinate)/2&&e<=(q.coordinate+X.coordinate)/2)return q.index}}return-1},MG=()=>Ae(oy),Ey=(e,t)=>t,e_=(e,t,n)=>n,Ty=(e,t,n,r)=>r,IG=Q(Mi,e=>Mf(e,t=>t.coordinate)),_y=Q([Eo,Ey,e_,Ty],z5),My=Q([_y,_o,kc,Cc],ky),DG=(e,t,n)=>{if(t!=null){var r=Eo(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},t_=Q([Eo,Ey,e_,Ty],B5),hf=Q([Ci,Oi,nt,Wt,Mi,Ty,t_],F5),RG=Q([_y,hf],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),n_=Q([Mi,My],I5),LG=Q([t_,My,Ei,kc,n_,V5,Ey],U5),$G=Q([_y,My],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),zG=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&_G(e,l)){var u=fV(e,t),d=Z5(u,a,i,n,r),p=EG(t,i,d,e);return{activeIndex:String(d),activeCoordinate:p}}},FG=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var u=N9(e,n);if(u){var d=pV(u,t),p=Z5(d,l,a,r,i),h=TG(t,a,p,u);return{activeIndex:String(p),activeCoordinate:h}}}},BG=(e,t,n,r,i,a,l,u)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?zG(e,t,r,i,a,l,u):FG(e,t,n,r,i,a,l)},VG=Q(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),UG=Q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(En)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:NK}});function HP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function GP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HP(Object(n),!0).forEach(function(r){WG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WG(e,t,n){return(t=qG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qG(e){var t=KG(e,"string");return typeof t=="symbol"?t:t+""}function KG(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var HG={},GG={zIndexMap:Object.values(En).reduce((e,t)=>GP(GP({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),HG)},YG=new Set(Object.values(En));function XG(e){return YG.has(e)}var r_=_n({name:"zIndex",initialState:GG,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:ft()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!XG(n)&&delete e.zIndexMap[n])},prepare:ft()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:ft()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:ft()}}}),{registerZIndexPortal:QG,unregisterZIndexPortal:JG,registerZIndexPortalElement:ZG,unregisterZIndexPortalElement:eY}=r_.actions,tY=r_.reducer;function bs(e){var{zIndex:t,children:n}=e,r=YV(),i=r&&t!==void 0&&t!==0,a=Kn(),l=Nt();b.useLayoutEffect(()=>i?(l(QG({zIndex:t})),()=>{l(JG({zIndex:t}))}):jo,[l,t,i]);var u=Ae(d=>VG(d,t,a));return i?u?fA.createPortal(n,u):null:n}function fv(){return fv=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},fv.apply(null,arguments)}function YP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YP(Object(n),!0).forEach(function(r){nY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nY(e,t,n){return(t=rY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rY(e){var t=iY(e,"string");return typeof t=="symbol"?t:t+""}function iY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sY(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return b.isValidElement(t)?b.cloneElement(t,r):b.createElement(n,r)}function aY(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:l,layout:u,cursor:d,tooltipEventType:p,chartName:h}=e,m=n,v=r,x=i;if(!d||!m||h!=="ScatterChart"&&p!=="axis")return null;var w,S,j;if(h==="ScatterChart")w=m,S=LU,j=En.cursorLine;else if(h==="BarChart")w=$U(u,m,a,l),S=VE,j=En.cursorRectangle;else if(u==="radial"&&MA(m)){var{cx:k,cy:C,radius:E,startAngle:O,endAngle:P}=UE(m);w={cx:k,cy:C,startAngle:O,endAngle:P,innerRadius:E,outerRadius:E},S=qE,j=En.cursorLine}else w={points:O9(u,m,a)},S=LE,j=En.cursorLine;var A=typeof d=="object"&&"className"in d?d.className:void 0,_=rd(rd(rd(rd({stroke:"#ccc",pointerEvents:"none"},a),w),fx(d)),{},{payload:v,payloadIndex:x,className:st("recharts-tooltip-cursor",A)});return b.createElement(bs,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},b.createElement(sY,{cursor:d,cursorComp:S,cursorProps:_}))}function oY(e){var t=PG(),n=KV(),r=So(),i=MG();return t==null||n==null||r==null||i==null?null:b.createElement(aY,fv({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var i_=b.createContext(null),lY=()=>b.useContext(i_),V0={exports:{}},XP;function cY(){return XP||(XP=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(d,p,h){this.fn=d,this.context=p,this.once=h||!1}function a(d,p,h,m,v){if(typeof h!="function")throw new TypeError("The listener must be a function");var x=new i(h,m||d,v),w=n?n+p:p;return d._events[w]?d._events[w].fn?d._events[w]=[d._events[w],x]:d._events[w].push(x):(d._events[w]=x,d._eventsCount++),d}function l(d,p){--d._eventsCount===0?d._events=new r:delete d._events[p]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var p=[],h,m;if(this._eventsCount===0)return p;for(m in h=this._events)t.call(h,m)&&p.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(h)):p},u.prototype.listeners=function(p){var h=n?n+p:p,m=this._events[h];if(!m)return[];if(m.fn)return[m.fn];for(var v=0,x=m.length,w=new Array(x);v<x;v++)w[v]=m[v].fn;return w},u.prototype.listenerCount=function(p){var h=n?n+p:p,m=this._events[h];return m?m.fn?1:m.length:0},u.prototype.emit=function(p,h,m,v,x,w){var S=n?n+p:p;if(!this._events[S])return!1;var j=this._events[S],k=arguments.length,C,E;if(j.fn){switch(j.once&&this.removeListener(p,j.fn,void 0,!0),k){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,h),!0;case 3:return j.fn.call(j.context,h,m),!0;case 4:return j.fn.call(j.context,h,m,v),!0;case 5:return j.fn.call(j.context,h,m,v,x),!0;case 6:return j.fn.call(j.context,h,m,v,x,w),!0}for(E=1,C=new Array(k-1);E<k;E++)C[E-1]=arguments[E];j.fn.apply(j.context,C)}else{var O=j.length,P;for(E=0;E<O;E++)switch(j[E].once&&this.removeListener(p,j[E].fn,void 0,!0),k){case 1:j[E].fn.call(j[E].context);break;case 2:j[E].fn.call(j[E].context,h);break;case 3:j[E].fn.call(j[E].context,h,m);break;case 4:j[E].fn.call(j[E].context,h,m,v);break;default:if(!C)for(P=1,C=new Array(k-1);P<k;P++)C[P-1]=arguments[P];j[E].fn.apply(j[E].context,C)}}return!0},u.prototype.on=function(p,h,m){return a(this,p,h,m,!1)},u.prototype.once=function(p,h,m){return a(this,p,h,m,!0)},u.prototype.removeListener=function(p,h,m,v){var x=n?n+p:p;if(!this._events[x])return this;if(!h)return l(this,x),this;var w=this._events[x];if(w.fn)w.fn===h&&(!v||w.once)&&(!m||w.context===m)&&l(this,x);else{for(var S=0,j=[],k=w.length;S<k;S++)(w[S].fn!==h||v&&!w[S].once||m&&w[S].context!==m)&&j.push(w[S]);j.length?this._events[x]=j.length===1?j[0]:j:l(this,x)}return this},u.prototype.removeAllListeners=function(p){var h;return p?(h=n?n+p:p,this._events[h]&&l(this,h)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(V0)),V0.exports}var uY=cY();const dY=Qr(uY);var ic=new dY,pv="recharts.syncEvent.tooltip",QP="recharts.syncEvent.brush",fY=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Gr(n))return e[n]}},pY={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},s_=_n({name:"options",initialState:pY,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),hY=s_.reducer,{createEventEmitter:mY}=s_.actions;function gY(e){return e.tooltip.syncInteraction}var vY={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},a_=_n({name:"chartData",initialState:vY,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:JP,setDataStartEndIndexes:xY,setComputedData:Cte}=a_.actions,yY=a_.reducer,bY=["x","y"];function ZP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZP(Object(n),!0).forEach(function(r){wY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wY(e,t,n){return(t=jY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jY(e){var t=SY(e,"string");return typeof t=="symbol"?t:t+""}function SY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NY(e,t){if(e==null)return{};var n,r,i=kY(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kY(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function PY(){var e=Ae(ly),t=Ae(cy),n=Nt(),r=Ae(VT),i=Ae(Mi),a=So(),l=Hf(),u=Ae(d=>d.rootProps.className);b.useEffect(()=>{if(e==null)return jo;var d=(p,h,m)=>{if(t!==m&&e===p){if(r==="index"){var v;if(l&&h!==null&&h!==void 0&&(v=h.payload)!==null&&v!==void 0&&v.coordinate&&h.payload.sourceViewBox){var x=h.payload.coordinate,{x:w,y:S}=x,j=NY(x,bY),{x:k,y:C,width:E,height:O}=h.payload.sourceViewBox,P=Fa(Fa({},j),{},{x:l.x+(E?(w-k)/E:0)*l.width,y:l.y+(O?(S-C)/O:0)*l.height});n(Fa(Fa({},h),{},{payload:Fa(Fa({},h.payload),{},{coordinate:P})}))}else n(h);return}if(i!=null){var A;if(typeof r=="function"){var _={activeTooltipIndex:h.payload.index==null?void 0:Number(h.payload.index),isTooltipActive:h.payload.active,activeIndex:h.payload.index==null?void 0:Number(h.payload.index),activeLabel:h.payload.label,activeDataKey:h.payload.dataKey,activeCoordinate:h.payload.coordinate},D=r(i,_);A=i[D]}else r==="value"&&(A=i.find(re=>String(re.value)===h.payload.label));var{coordinate:$}=h.payload;if(A==null||h.payload.active===!1||$==null||l==null){n(uv({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:q,y:X}=$,L=Math.min(q,l.x+l.width),Z=Math.min(X,l.y+l.height),J={x:a==="horizontal"?A.coordinate:L,y:a==="horizontal"?Z:A.coordinate},ne=uv({active:h.payload.active,coordinate:J,dataKey:h.payload.dataKey,index:String(A.index),label:h.payload.label,sourceViewBox:h.payload.sourceViewBox,graphicalItemId:h.payload.graphicalItemId});n(ne)}}};return ic.on(pv,d),()=>{ic.off(pv,d)}},[u,n,t,e,r,i,a,l])}function CY(){var e=Ae(ly),t=Ae(cy),n=Nt();b.useEffect(()=>{if(e==null)return jo;var r=(i,a,l)=>{t!==l&&e===i&&n(xY(a))};return ic.on(QP,r),()=>{ic.off(QP,r)}},[n,t,e])}function OY(){var e=Nt();b.useEffect(()=>{e(mY())},[e]),PY(),CY()}function AY(e,t,n,r,i,a){var l=Ae(x=>DG(x,e,t)),u=Ae(cy),d=Ae(ly),p=Ae(VT),h=Ae(gY),m=h==null?void 0:h.active,v=Hf();b.useEffect(()=>{if(!m&&d!=null&&u!=null){var x=uv({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:void 0});ic.emit(pv,d,x,u)}},[m,n,l,i,r,u,d,p,a,v])}function eC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eC(Object(n),!0).forEach(function(r){EY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EY(e,t,n){return(t=TY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TY(e){var t=_Y(e,"string");return typeof t=="symbol"?t:t+""}function _Y(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MY(e){return e.dataKey}function IY(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(gU,t)}var nC=[],DY={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function RY(e){var t,n,r=ur(e,DY),{active:i,allowEscapeViewBox:a,animationDuration:l,animationEasing:u,content:d,filterNull:p,isAnimationActive:h,offset:m,payloadUniqBy:v,position:x,reverseDirection:w,useTranslate3d:S,wrapperStyle:j,cursor:k,shared:C,trigger:E,defaultIndex:O,portal:P,axisId:A}=r,_=Nt(),D=typeof O=="number"?String(O):O;b.useEffect(()=>{_(TH({shared:C,trigger:E,axisId:A,active:i,defaultIndex:D}))},[_,C,E,A,i,D]);var $=Hf(),q=RE(),X=kH(C),{activeIndex:L,isActive:Z}=(t=Ae(pe=>$G(pe,X,E,D)))!==null&&t!==void 0?t:{},J=Ae(pe=>LG(pe,X,E,D)),ne=Ae(pe=>n_(pe,X,E,D)),re=Ae(pe=>RG(pe,X,E,D)),B=J,F=lY(),G=(n=i??Z)!==null&&n!==void 0?n:!1,[W,M]=Q7([B,G]),V=X==="axis"?ne:void 0;AY(X,E,re,V,L,G);var ie=P??F;if(ie==null||$==null||X==null)return null;var fe=B??nC;G||(fe=nC),p&&fe.length&&(fe=S7(fe.filter(pe=>pe.value!=null&&(pe.hide!==!0||r.includeHidden)),v,MY));var te=fe.length>0,le=b.createElement(SU,{allowEscapeViewBox:a,animationDuration:l,animationEasing:u,isAnimationActive:h,active:G,coordinate:re,hasPayload:te,offset:m,position:x,reverseDirection:w,useTranslate3d:S,viewBox:$,wrapperStyle:j,lastBoundingBox:W,innerRef:M,hasPortalFromProps:!!P},IY(d,tC(tC({},r),{},{payload:fe,label:V,active:G,activeIndex:L,coordinate:re,accessibilityLayer:q})));return b.createElement(b.Fragment,null,fA.createPortal(le,ie),G&&b.createElement(oY,{cursor:k,tooltipEventType:X,coordinate:re,payload:fe,index:L}))}var o_=e=>null;o_.displayName="Cell";function LY(e,t,n){return(t=$Y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Y(e){var t=zY(e,"string");return typeof t=="symbol"?t:t+""}function zY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class FY{constructor(t){LY(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function rC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rC(Object(n),!0).forEach(function(r){VY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VY(e,t,n){return(t=UY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UY(e){var t=WY(e,"string");return typeof t=="symbol"?t:t+""}function WY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qY={cacheSize:2e3,enableCache:!0},l_=BY({},qY),iC=new FY(l_.cacheSize),KY={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},sC="recharts_measurement_span";function HY(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",l=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(l,"|").concat(u)}var aC=(e,t)=>{try{var n=document.getElementById(sC);n||(n=document.createElement("span"),n.setAttribute("id",sC),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,KY,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Ll=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Qf.isSsr)return{width:0,height:0};if(!l_.enableCache)return aC(t,n);var r=HY(t,n),i=iC.get(r);if(i)return i;var a=aC(t,n);return iC.set(r,a),a},c_;function GY(e,t,n){return(t=YY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YY(e){var t=XY(e,"string");return typeof t=="symbol"?t:t+""}function XY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oC=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,lC=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,QY=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,JY=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,ZY={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},eX=["cm","mm","pt","pc","in","Q","px"];function tX(e){return eX.includes(e)}var Xa="NaN";function nX(e,t){return e*ZY[t]}class Jt{static parse(t){var n,[,r,i]=(n=JY.exec(t))!==null&&n!==void 0?n:[];return r==null?Jt.NaN:new Jt(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Gr(t)&&(this.unit=""),n!==""&&!QY.test(n)&&(this.num=NaN,this.unit=""),tX(n)&&(this.num=nX(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Jt(NaN,""):new Jt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Jt(NaN,""):new Jt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Jt(NaN,""):new Jt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Jt(NaN,""):new Jt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Gr(this.num)}}c_=Jt;GY(Jt,"NaN",new c_(NaN,""));function u_(e){if(e==null||e.includes(Xa))return Xa;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=oC.exec(t))!==null&&n!==void 0?n:[],l=Jt.parse(r??""),u=Jt.parse(a??""),d=i==="*"?l.multiply(u):l.divide(u);if(d.isNaN())return Xa;t=t.replace(oC,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,[,h,m,v]=(p=lC.exec(t))!==null&&p!==void 0?p:[],x=Jt.parse(h??""),w=Jt.parse(v??""),S=m==="+"?x.add(w):x.subtract(w);if(S.isNaN())return Xa;t=t.replace(lC,S.toString())}return t}var cC=/\(([^()]*)\)/;function rX(e){for(var t=e,n;(n=cC.exec(t))!=null;){var[,r]=n;t=t.replace(cC,u_(r))}return t}function iX(e){var t=e.replace(/\s+/g,"");return t=rX(t),t=u_(t),t}function sX(e){try{return iX(e)}catch{return Xa}}function U0(e){var t=sX(e.slice(5,-1));return t===Xa?"":t}var aX=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],oX=["dx","dy","angle","className","breakAll"];function hv(){return hv=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},hv.apply(null,arguments)}function uC(e,t){if(e==null)return{};var n,r,i=lX(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function lX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var d_=/[ \f\n\r\t\v\u2028\u2029]+/,f_=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Ut(t)||(n?i=t.toString().split(""):i=t.toString().split(d_));var a=i.map(u=>({word:u,width:Ll(u,r).width})),l=n?0:Ll(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:l}}catch{return null}};function cX(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var p_=(e,t,n,r)=>e.reduce((i,a)=>{var{word:l,width:u}=a,d=i[i.length-1];if(d&&u!=null&&(t==null||r||d.width+u+n<Number(t)))d.words.push(l),d.width+=u+n;else{var p={words:[l],width:u};i.push(p)}return i},[]),h_=e=>e.reduce((t,n)=>t.width>n.width?t:n),uX="…",dC=(e,t,n,r,i,a,l,u)=>{var d=e.slice(0,t),p=f_({breakAll:n,style:r,children:d+uX});if(!p)return[!1,[]];var h=p_(p.wordsWithComputedWidth,a,l,u),m=h.length>i||h_(h).width>Number(a);return[m,h]},dX=(e,t,n,r,i)=>{var{maxLines:a,children:l,style:u,breakAll:d}=e,p=Ne(a),h=String(l),m=p_(t,r,n,i);if(!p||i)return m;var v=m.length>a||h_(m).width>Number(r);if(!v)return m;for(var x=0,w=h.length-1,S=0,j;x<=w&&S<=h.length-1;){var k=Math.floor((x+w)/2),C=k-1,[E,O]=dC(h,C,d,u,a,r,n,i),[P]=dC(h,k,d,u,a,r,n,i);if(!E&&!P&&(x=k+1),E&&P&&(w=k-1),!E&&P){j=O;break}S++}return j||m},fC=e=>{var t=Ut(e)?[]:e.toString().split(d_);return[{words:t,width:void 0}]},fX=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:l}=e;if((t||n)&&!Qf.isSsr){var u,d,p=f_({breakAll:a,children:r,style:i});if(p){var{wordsWithComputedWidth:h,spaceWidth:m}=p;u=h,d=m}else return fC(r);return dX({breakAll:a,children:r,maxLines:l,style:i},u,d,t,!!n)}return fC(r)},m_="#808080",pX={angle:0,breakAll:!1,capHeight:"0.71em",fill:m_,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Iy=b.forwardRef((e,t)=>{var n=ur(e,pX),{x:r,y:i,lineHeight:a,capHeight:l,fill:u,scaleToFit:d,textAnchor:p,verticalAnchor:h}=n,m=uC(n,aX),v=b.useMemo(()=>fX({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width}),[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),{dx:x,dy:w,angle:S,className:j,breakAll:k}=m,C=uC(m,oX);if(!Yr(r)||!Yr(i)||v.length===0)return null;var E=Number(r)+(Ne(x)?x:0),O=Number(i)+(Ne(w)?w:0);if(!Ke(E)||!Ke(O))return null;var P;switch(h){case"start":P=U0("calc(".concat(l,")"));break;case"middle":P=U0("calc(".concat((v.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:P=U0("calc(".concat(v.length-1," * -").concat(a,")"));break}var A=[],_=v[0];if(d&&_!=null){var D=_.width,{width:$}=m;A.push("scale(".concat(Ne($)&&Ne(D)?$/D:1,")"))}return S&&A.push("rotate(".concat(S,", ").concat(E,", ").concat(O,")")),A.length&&(C.transform=A.join(" ")),b.createElement("text",hv({},or(C),{ref:t,x:E,y:O,className:st("recharts-text",j),textAnchor:p,fill:u.includes("url")?m_:u}),v.map((q,X)=>{var L=q.words.join(k?"":" ");return b.createElement("tspan",{x:E,dy:X===0?P:a,key:"".concat(L,"-").concat(X)},L)}))});Iy.displayName="Text";function pC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pC(Object(n),!0).forEach(function(r){hX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hX(e,t,n){return(t=mX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mX(e){var t=gX(e,"string");return typeof t=="symbol"?t:t+""}function gX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vX=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:l,height:u,upperWidth:d,lowerWidth:p}=Tx(t),h=a,m=a+(d-p)/2,v=(h+m)/2,x=(d+p)/2,w=h+d/2,S=u>=0?1:-1,j=S*r,k=S>0?"end":"start",C=S>0?"start":"end",E=d>=0?1:-1,O=E*r,P=E>0?"end":"start",A=E>0?"start":"end",_=i;if(n==="top"){var D={x:h+d/2,y:l-j,horizontalAnchor:"middle",verticalAnchor:k};return _&&(D.height=Math.max(l-_.y,0),D.width=d),D}if(n==="bottom"){var $={x:m+p/2,y:l+u+j,horizontalAnchor:"middle",verticalAnchor:C};return _&&($.height=Math.max(_.y+_.height-(l+u),0),$.width=p),$}if(n==="left"){var q={x:v-O,y:l+u/2,horizontalAnchor:P,verticalAnchor:"middle"};return _&&(q.width=Math.max(q.x-_.x,0),q.height=u),q}if(n==="right"){var X={x:v+x+O,y:l+u/2,horizontalAnchor:A,verticalAnchor:"middle"};return _&&(X.width=Math.max(_.x+_.width-X.x,0),X.height=u),X}var L=_?{width:x,height:u}:{};return n==="insideLeft"?zr({x:v+O,y:l+u/2,horizontalAnchor:A,verticalAnchor:"middle"},L):n==="insideRight"?zr({x:v+x-O,y:l+u/2,horizontalAnchor:P,verticalAnchor:"middle"},L):n==="insideTop"?zr({x:h+d/2,y:l+j,horizontalAnchor:"middle",verticalAnchor:C},L):n==="insideBottom"?zr({x:m+p/2,y:l+u-j,horizontalAnchor:"middle",verticalAnchor:k},L):n==="insideTopLeft"?zr({x:h+O,y:l+j,horizontalAnchor:A,verticalAnchor:C},L):n==="insideTopRight"?zr({x:h+d-O,y:l+j,horizontalAnchor:P,verticalAnchor:C},L):n==="insideBottomLeft"?zr({x:m+O,y:l+u-j,horizontalAnchor:A,verticalAnchor:k},L):n==="insideBottomRight"?zr({x:m+p-O,y:l+u-j,horizontalAnchor:P,verticalAnchor:k},L):n&&typeof n=="object"&&(Ne(n.x)||ea(n.x))&&(Ne(n.y)||ea(n.y))?zr({x:a+Or(n.x,x),y:l+Or(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},L):zr({x:w,y:l+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},L)},xX=["labelRef"],yX=["content"];function hC(e,t){if(e==null)return{};var n,r,i=bX(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function mC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mC(Object(n),!0).forEach(function(r){wX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wX(e,t,n){return(t=jX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jX(e){var t=SX(e,"string");return typeof t=="symbol"?t:t+""}function SX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function di(){return di=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},di.apply(null,arguments)}var g_=b.createContext(null),NX=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l,children:u}=e,d=b.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l}),[t,n,r,i,a,l]);return b.createElement(g_.Provider,{value:d},u)},v_=()=>{var e=b.useContext(g_),t=Hf();return e||(t?Tx(t):void 0)},kX=b.createContext(null),PX=()=>{var e=b.useContext(kX),t=Ae(HT);return e||t},CX=e=>{var{value:t,formatter:n}=e,r=Ut(e.children)?t:e.children;return typeof n=="function"?n(r):r},Dy=e=>e!=null&&typeof e=="function",OX=(e,t)=>{var n=Fn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},AX=(e,t,n,r,i)=>{var{offset:a,className:l}=e,{cx:u,cy:d,innerRadius:p,outerRadius:h,startAngle:m,endAngle:v,clockWise:x}=i,w=(p+h)/2,S=OX(m,v),j=S>=0?1:-1,k,C;switch(t){case"insideStart":k=m+j*a,C=x;break;case"insideEnd":k=v-j*a,C=!x;break;case"end":k=v+j*a,C=x;break;default:throw new Error("Unsupported position ".concat(t))}C=S<=0?C:!C;var E=en(u,d,w,k),O=en(u,d,w,k+(C?1:-1)*359),P="M".concat(E.x,",").concat(E.y,`
335
+ A`).concat(w,",").concat(w,",0,1,").concat(C?0:1,`,
336
+ `).concat(O.x,",").concat(O.y),A=Ut(e.id)?ql("recharts-radial-line-"):e.id;return b.createElement("text",di({},r,{dominantBaseline:"central",className:st("recharts-radial-bar-label",l)}),b.createElement("defs",null,b.createElement("path",{id:A,d:P})),b.createElement("textPath",{xlinkHref:"#".concat(A)},n))},EX=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:l,startAngle:u,endAngle:d}=e,p=(u+d)/2;if(n==="outside"){var{x:h,y:m}=en(r,i,l+t,p);return{x:h,y:m,textAnchor:h>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var v=(a+l)/2,{x,y:w}=en(r,i,v,p);return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},md=e=>e!=null&&"cx"in e&&Ne(e.cx),TX={angle:0,offset:5,zIndex:En.label,position:"middle",textBreakAll:!1};function _X(e){if(!md(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function as(e){var t=ur(e,TX),{viewBox:n,parentViewBox:r,position:i,value:a,children:l,content:u,className:d="",textBreakAll:p,labelRef:h}=t,m=PX(),v=v_(),x=i==="center"?v:m??v,w,S,j;n==null?w=x:md(n)?w=n:w=Tx(n);var k=_X(w);if(!w||Ut(a)&&Ut(l)&&!b.isValidElement(u)&&typeof u!="function")return null;var C=Tl(Tl({},t),{},{viewBox:w});if(b.isValidElement(u)){var{labelRef:E}=C,O=hC(C,xX);return b.cloneElement(u,O)}if(typeof u=="function"){var{content:P}=C,A=hC(C,yX);if(S=b.createElement(u,A),b.isValidElement(S))return S}else S=CX(t);var _=or(t);if(md(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return AX(t,i,S,_,w);j=EX(w,t.offset,t.position)}else{if(!k)return null;var D=vX({viewBox:k,position:i,offset:t.offset,parentViewBox:md(r)?void 0:r});j=Tl(Tl({x:D.x,y:D.y,textAnchor:D.horizontalAnchor,verticalAnchor:D.verticalAnchor},D.width!==void 0?{width:D.width}:{}),D.height!==void 0?{height:D.height}:{})}return b.createElement(bs,{zIndex:t.zIndex},b.createElement(Iy,di({ref:h,className:st("recharts-label",d)},_,j,{textAnchor:cX(_.textAnchor)?_.textAnchor:j.textAnchor,breakAll:p}),S))}as.displayName="Label";var MX=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?b.createElement(as,di({key:"label-implicit"},r)):Yr(e)?b.createElement(as,di({key:"label-implicit",value:e},r)):b.isValidElement(e)?e.type===as?b.cloneElement(e,Tl({key:"label-implicit"},r)):b.createElement(as,di({key:"label-implicit",content:e},r)):Dy(e)?b.createElement(as,di({key:"label-implicit",content:e},r)):e&&typeof e=="object"?b.createElement(as,di({},e,{key:"label-implicit"},r)):null};function IX(e){var{label:t,labelRef:n}=e,r=v_();return MX(t,r,n)||null}var W0={},q0={},gC;function DX(){return gC||(gC=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(q0)),q0}var K0={},vC;function RX(){return vC||(vC=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(K0)),K0}var xC;function LX(){return xC||(xC=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=DX(),n=RX(),r=bx();function i(a){if(r.isArrayLike(a))return t.last(n.toArray(a))}e.last=i})(W0)),W0}var H0,yC;function $X(){return yC||(yC=1,H0=LX().last),H0}var zX=$X();const FX=Qr(zX);var BX=["valueAccessor"],VX=["dataKey","clockWise","id","textBreakAll","zIndex"];function mf(){return mf=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},mf.apply(null,arguments)}function bC(e,t){if(e==null)return{};var n,r,i=UX(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function UX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var WX=e=>Array.isArray(e.value)?FX(e.value):e.value,x_=b.createContext(void 0),qX=x_.Provider,y_=b.createContext(void 0);y_.Provider;function KX(){return b.useContext(x_)}function HX(){return b.useContext(y_)}function gd(e){var{valueAccessor:t=WX}=e,n=bC(e,BX),{dataKey:r,clockWise:i,id:a,textBreakAll:l,zIndex:u}=n,d=bC(n,VX),p=KX(),h=HX(),m=p||h;return!m||!m.length?null:b.createElement(bs,{zIndex:u??En.label},b.createElement(yi,{className:"recharts-label-list"},m.map((v,x)=>{var w,S=Ut(r)?t(v,x):tn(v.payload,r),j=Ut(a)?{}:{id:"".concat(a,"-").concat(x)};return b.createElement(as,mf({key:"label-".concat(x)},or(v),d,j,{fill:(w=n.fill)!==null&&w!==void 0?w:v.fill,parentViewBox:v.parentViewBox,value:S,textBreakAll:l,viewBox:v.viewBox,index:x,zIndex:0}))})))}gd.displayName="LabelList";function GX(e){var{label:t}=e;return t?t===!0?b.createElement(gd,{key:"labelList-implicit"}):b.isValidElement(t)||Dy(t)?b.createElement(gd,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(gd,mf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var YX={radiusAxis:{},angleAxis:{}},b_=_n({name:"polarAxis",initialState:YX,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:Ote,removeRadiusAxis:Ate,addAngleAxis:Ete,removeAngleAxis:Tte}=b_.actions,XX=b_.reducer;function QX(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var G0={exports:{}},He={};/** @license React v16.13.1
337
+ * react-is.production.min.js
338
+ *
339
+ * Copyright (c) Facebook, Inc. and its affiliates.
340
+ *
341
+ * This source code is licensed under the MIT license found in the
342
+ * LICENSE file in the root directory of this source tree.
343
+ */var wC;function JX(){if(wC)return He;wC=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,p=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,S=e?Symbol.for("react.block"):60121,j=e?Symbol.for("react.fundamental"):60117,k=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function E(P){if(typeof P=="object"&&P!==null){var A=P.$$typeof;switch(A){case t:switch(P=P.type,P){case d:case p:case r:case a:case i:case m:return P;default:switch(P=P&&P.$$typeof,P){case u:case h:case w:case x:case l:return P;default:return A}}case n:return A}}}function O(P){return E(P)===p}return He.AsyncMode=d,He.ConcurrentMode=p,He.ContextConsumer=u,He.ContextProvider=l,He.Element=t,He.ForwardRef=h,He.Fragment=r,He.Lazy=w,He.Memo=x,He.Portal=n,He.Profiler=a,He.StrictMode=i,He.Suspense=m,He.isAsyncMode=function(P){return O(P)||E(P)===d},He.isConcurrentMode=O,He.isContextConsumer=function(P){return E(P)===u},He.isContextProvider=function(P){return E(P)===l},He.isElement=function(P){return typeof P=="object"&&P!==null&&P.$$typeof===t},He.isForwardRef=function(P){return E(P)===h},He.isFragment=function(P){return E(P)===r},He.isLazy=function(P){return E(P)===w},He.isMemo=function(P){return E(P)===x},He.isPortal=function(P){return E(P)===n},He.isProfiler=function(P){return E(P)===a},He.isStrictMode=function(P){return E(P)===i},He.isSuspense=function(P){return E(P)===m},He.isValidElementType=function(P){return typeof P=="string"||typeof P=="function"||P===r||P===p||P===a||P===i||P===m||P===v||typeof P=="object"&&P!==null&&(P.$$typeof===w||P.$$typeof===x||P.$$typeof===l||P.$$typeof===u||P.$$typeof===h||P.$$typeof===j||P.$$typeof===k||P.$$typeof===C||P.$$typeof===S)},He.typeOf=E,He}var jC;function ZX(){return jC||(jC=1,G0.exports=JX()),G0.exports}var eQ=ZX(),SC=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",NC=null,Y0=null,w_=e=>{if(e===NC&&Array.isArray(Y0))return Y0;var t=[];return b.Children.forEach(e,n=>{Ut(n)||(eQ.isFragment(n)?t=t.concat(w_(n.props.children)):t.push(n))}),Y0=t,NC=e,t};function tQ(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>SC(i)):r=[SC(t)],w_(e).forEach(i=>{var a=oo(i,"type.displayName")||oo(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var X0={},kC;function nQ(){return kC||(kC=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var i;if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const a=n[Symbol.toStringTag];return a==null||!((i=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&i.writable)?!1:n.toString()===`[object ${a}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(X0)),X0}var Q0,PC;function rQ(){return PC||(PC=1,Q0=nQ().isPlainObject),Q0}var iQ=rQ();const sQ=Qr(iQ);var CC,OC,AC,EC,TC;function _C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function MC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_C(Object(n),!0).forEach(function(r){aQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_C(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aQ(e,t,n){return(t=oQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oQ(e){var t=lQ(e,"string");return typeof t=="symbol"?t:t+""}function lQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gf(){return gf=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},gf.apply(null,arguments)}function kl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var IC=(e,t,n,r,i)=>{var a=n-r,l;return l=bt(CC||(CC=kl(["M ",",",""])),e,t),l+=bt(OC||(OC=kl(["L ",",",""])),e+n,t),l+=bt(AC||(AC=kl(["L ",",",""])),e+n-a/2,t+i),l+=bt(EC||(EC=kl(["L ",",",""])),e+n-a/2-r,t+i),l+=bt(TC||(TC=kl(["L ",","," Z"])),e,t),l},cQ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},uQ=e=>{var t=ur(e,cQ),{x:n,y:r,upperWidth:i,lowerWidth:a,height:l,className:u}=t,{animationEasing:d,animationDuration:p,animationBegin:h,isUpdateAnimationActive:m}=t,v=b.useRef(null),[x,w]=b.useState(-1),S=b.useRef(i),j=b.useRef(a),k=b.useRef(l),C=b.useRef(n),E=b.useRef(r),O=Dx(e,"trapezoid-");if(b.useEffect(()=>{if(v.current&&v.current.getTotalLength)try{var J=v.current.getTotalLength();J&&w(J)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||l!==+l||i===0&&a===0||l===0)return null;var P=st("recharts-trapezoid",u);if(!m)return b.createElement("g",null,b.createElement("path",gf({},or(t),{className:P,d:IC(n,r,i,a,l)})));var A=S.current,_=j.current,D=k.current,$=C.current,q=E.current,X="0px ".concat(x===-1?1:x,"px"),L="".concat(x,"px 0px"),Z=$E(["strokeDasharray"],p,d);return b.createElement(Ix,{animationId:O,key:O,canBegin:x>0,duration:p,easing:d,isActive:m,begin:h},J=>{var ne=Zt(A,i,J),re=Zt(_,a,J),B=Zt(D,l,J),F=Zt($,n,J),G=Zt(q,r,J);v.current&&(S.current=ne,j.current=re,k.current=B,C.current=F,E.current=G);var W=J>0?{transition:Z,strokeDasharray:L}:{strokeDasharray:X};return b.createElement("path",gf({},or(t),{className:P,d:IC(F,G,ne,re,B),ref:v,style:MC(MC({},W),t.style)}))})},dQ=["option","shapeType","activeClassName"];function fQ(e,t){if(e==null)return{};var n,r,i=pQ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function pQ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function DC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DC(Object(n),!0).forEach(function(r){hQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hQ(e,t,n){return(t=mQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mQ(e){var t=gQ(e,"string");return typeof t=="symbol"?t:t+""}function gQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vQ(e,t){return vf(vf({},t),e)}function xQ(e,t){return e==="symbols"}function RC(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return b.createElement(VE,n);case"trapezoid":return b.createElement(uQ,n);case"sector":return b.createElement(qE,n);case"symbols":if(xQ(t))return b.createElement(_A,n);break;case"curve":return b.createElement(LE,n);default:return null}}function yQ(e){return b.isValidElement(e)?e.props:e}function bQ(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape"}=e,i=fQ(e,dQ),a;if(b.isValidElement(t))a=b.cloneElement(t,vf(vf({},i),yQ(t)));else if(typeof t=="function")a=t(i,i.index);else if(sQ(t)&&typeof t!="boolean"){var l=vQ(t,i);a=b.createElement(RC,{shapeType:n,elementProps:l})}else{var u=i;a=b.createElement(RC,{shapeType:n,elementProps:u})}return i.isActive?b.createElement(yi,{className:r},a):a}var j_=(e,t,n)=>{var r=Nt();return(i,a)=>l=>{e==null||e(i,a,l),r(R5({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},S_=e=>{var t=Nt();return(n,r)=>i=>{e==null||e(n,r,i),t(_H())}},N_=(e,t,n)=>{var r=Nt();return(i,a)=>l=>{e==null||e(i,a,l),r(MH({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function wQ(e){var{tooltipEntrySettings:t}=e,n=Nt(),r=Kn(),i=b.useRef(null);return b.useLayoutEffect(()=>{r||(i.current===null?n(OH(t)):i.current!==t&&n(AH({prev:i.current,next:t})),i.current=t)},[t,n,r]),b.useLayoutEffect(()=>()=>{i.current&&(n(EH(i.current)),i.current=null)},[n]),null}function jQ(e){var{legendPayload:t}=e,n=Nt(),r=Kn(),i=b.useRef(null);return b.useLayoutEffect(()=>{r||(i.current===null?n(lU(t)):i.current!==t&&n(cU({prev:i.current,next:t})),i.current=t)},[n,r,t]),b.useLayoutEffect(()=>()=>{i.current&&(n(uU(i.current)),i.current=null)},[n]),null}var J0,SQ=()=>{var[e]=b.useState(()=>ql("uid-"));return e},NQ=(J0=GI.useId)!==null&&J0!==void 0?J0:SQ;function kQ(e,t){var n=NQ();return t||(e?"".concat(e,"-").concat(n):n)}var PQ=b.createContext(void 0),CQ=e=>{var{id:t,type:n,children:r}=e,i=kQ("recharts-".concat(n),t);return b.createElement(PQ.Provider,{value:i},r(i))},OQ={cartesianItems:[],polarItems:[]},k_=_n({name:"graphicalItems",initialState:OQ,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:ft()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Cr(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:ft()},removeCartesianGraphicalItem:{reducer(e,t){var n=Cr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:ft()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:ft()},removePolarGraphicalItem:{reducer(e,t){var n=Cr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:ft()}}}),{addCartesianGraphicalItem:AQ,replaceCartesianGraphicalItem:EQ,removeCartesianGraphicalItem:TQ,addPolarGraphicalItem:_te,removePolarGraphicalItem:Mte}=k_.actions,_Q=k_.reducer,MQ=e=>{var t=Nt(),n=b.useRef(null);return b.useLayoutEffect(()=>{n.current===null?t(AQ(e)):n.current!==e&&t(EQ({prev:n.current,next:e})),n.current=e},[t,e]),b.useLayoutEffect(()=>()=>{n.current&&(t(TQ(n.current)),n.current=null)},[t]),null},IQ=b.memo(MQ);function LC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $C(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LC(Object(n),!0).forEach(function(r){DQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DQ(e,t,n){return(t=RQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RQ(e){var t=LQ(e,"string");return typeof t=="symbol"?t:t+""}function LQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var P_=0,$Q={xAxis:{},yAxis:{},zAxis:{}},C_=_n({name:"cartesianAxis",initialState:$Q,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:ft()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:ft()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:ft()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:ft()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:ft()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:ft()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:ft()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:ft()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:ft()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((a=l[0])!==null&&a!==void 0?a:0))<=1)return;var u=[...l,r].slice(-3);e.yAxis[n]=$C($C({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:zQ,replaceXAxis:FQ,removeXAxis:BQ,addYAxis:VQ,replaceYAxis:UQ,removeYAxis:WQ,addZAxis:Ite,replaceZAxis:Dte,removeZAxis:Rte,updateYAxisWidth:qQ}=C_.actions,KQ=C_.reducer,HQ=Q([Wt],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),GQ=Q([HQ,Ci,Oi],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),O_=()=>Ae(GQ),zC=(e,t,n)=>{var r=n??e;if(!Ut(r))return Or(r,t,0)},YQ=(e,t,n)=>{var r={},i=e.filter(cp),a=e.filter(p=>p.stackId==null),l=i.reduce((p,h)=>{var m=p[h.stackId];return m==null&&(m=[]),m.push(h),p[h.stackId]=m,p},r),u=Object.entries(l).map(p=>{var h,[m,v]=p,x=v.map(S=>S.dataKey),w=zC(t,n,(h=v[0])===null||h===void 0?void 0:h.barSize);return{stackId:m,dataKeys:x,barSize:w}}),d=a.map(p=>{var h=[p.dataKey].filter(v=>v!=null),m=zC(t,n,p.barSize);return{stackId:void 0,dataKeys:h,barSize:m}});return[...u,...d]};function FC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function id(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FC(Object(n),!0).forEach(function(r){XQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XQ(e,t,n){return(t=QQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QQ(e){var t=JQ(e,"string");return typeof t=="symbol"?t:t+""}function JQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ZQ(e,t,n,r,i){var a,l=r.length;if(!(l<1)){var u=Or(e,n,0,!0),d,p=[];if(Ke((a=r[0])===null||a===void 0?void 0:a.barSize)){var h=!1,m=n/l,v=r.reduce((C,E)=>C+(E.barSize||0),0);v+=(l-1)*u,v>=n&&(v-=(l-1)*u,u=0),v>=n&&m>0&&(h=!0,m*=.9,v=l*m);var x=(n-v)/2>>0,w={offset:x-u,size:0};d=r.reduce((C,E)=>{var O,P={stackId:E.stackId,dataKeys:E.dataKeys,position:{offset:w.offset+w.size+u,size:h?m:(O=E.barSize)!==null&&O!==void 0?O:0}},A=[...C,P];return w=P.position,A},p)}else{var S=Or(t,n,0,!0);n-2*S-(l-1)*u<=0&&(u=0);var j=(n-2*S-(l-1)*u)/l;j>1&&(j>>=0);var k=Ke(i)?Math.min(j,i):j;d=r.reduce((C,E,O)=>[...C,{stackId:E.stackId,dataKeys:E.dataKeys,position:{offset:S+(j+u)*O+(j-k)/2,size:k}}],p)}return d}}var eJ=(e,t,n,r,i,a,l)=>{var u=Ut(l)?t:l,d=ZQ(n,r,i!==a?i:a,e,u);return i!==a&&d!=null&&(d=d.map(p=>id(id({},p),{},{position:id(id({},p.position),{},{offset:p.position.offset-i/2})}))),d},tJ=(e,t)=>{var n=py(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(l=>l.key===n)}}}},nJ=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function rJ(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Ke(e.zIndex)?e.zIndex:t}var iJ=e=>{var{chartData:t}=e,n=Nt(),r=Kn();return b.useEffect(()=>r?()=>{}:(n(JP(t)),()=>{n(JP(void 0))}),[t,n,r]),null},BC={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},A_=_n({name:"brush",initialState:BC,reducers:{setBrushSettings(e,t){return t.payload==null?BC:t.payload}}}),{setBrushSettings:Lte}=A_.actions,sJ=A_.reducer;function aJ(e){return(e%180+180)%180}var oJ=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=aJ(i),l=a*Math.PI/180,u=Math.atan(r/n),d=l>u&&l<Math.PI-u?r/Math.sin(l):n/Math.cos(l);return Math.abs(d)},lJ={dots:[],areas:[],lines:[]},E_=_n({name:"referenceElements",initialState:lJ,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Cr(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=Cr(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=Cr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:$te,removeDot:zte,addArea:Fte,removeArea:Bte,addLine:Vte,removeLine:Ute}=E_.actions,cJ=E_.reducer,uJ=b.createContext(void 0),dJ=e=>{var{children:t}=e,[n]=b.useState("".concat(ql("recharts"),"-clip")),r=O_();if(r==null)return null;var{x:i,y:a,width:l,height:u}=r;return b.createElement(uJ.Provider,{value:n},b.createElement("defs",null,b.createElement("clipPath",{id:n},b.createElement("rect",{x:i,y:a,height:u,width:l}))),t)};function T_(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function fJ(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return oJ(r,n)}function pJ(e,t,n){var r=n==="width",{x:i,y:a,width:l,height:u}=e;return t===1?{start:r?i:a,end:r?i+l:a+u}:{start:r?i+l:a+u,end:r?i:a}}function sc(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function hJ(e,t){return T_(e,t+1)}function mJ(e,t,n,r,i){for(var a=(r||[]).slice(),{start:l,end:u}=t,d=0,p=1,h=l,m=function(){var w=r==null?void 0:r[d];if(w===void 0)return{v:T_(r,p)};var S=d,j,k=()=>(j===void 0&&(j=n(w,S)),j),C=w.coordinate,E=d===0||sc(e,C,k,h,u);E||(d=0,h=l,p+=1),E&&(h=C+e*(k()/2+i),d+=p)},v;p<=a.length;)if(v=m(),v)return v.v;return[]}function gJ(e,t,n,r,i){var a=(r||[]).slice(),l=a.length;if(l===0)return[];for(var{start:u,end:d}=t,p=1;p<=l;p++){for(var h=(l-1)%p,m=u,v=!0,x=function(){var O=r[S];if(O==null)return 0;var P=S,A,_=()=>(A===void 0&&(A=n(O,P)),A),D=O.coordinate,$=S===h||sc(e,D,_,m,d);if(!$)return v=!1,1;$&&(m=D+e*(_()/2+i))},w,S=h;S<l&&(w=x(),!(w!==0&&w===1));S+=p);if(v){for(var j=[],k=h;k<l;k+=p){var C=r[k];C!=null&&j.push(C)}return j}}return[]}function VC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ln(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VC(Object(n),!0).forEach(function(r){vJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vJ(e,t,n){return(t=xJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xJ(e){var t=yJ(e,"string");return typeof t=="symbol"?t:t+""}function yJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bJ(e,t,n,r,i){for(var a=(r||[]).slice(),l=a.length,{start:u}=t,{end:d}=t,p=function(v){var x=a[v];if(x==null)return 1;var w=x,S,j=()=>(S===void 0&&(S=n(x,v)),S);if(v===l-1){var k=e*(w.coordinate+e*j()/2-d);a[v]=w=ln(ln({},w),{},{tickCoord:k>0?w.coordinate-k*e:w.coordinate})}else a[v]=w=ln(ln({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var C=sc(e,w.tickCoord,j,u,d);C&&(d=w.tickCoord-e*(j()/2+i),a[v]=ln(ln({},w),{},{isShow:!0}))}},h=l-1;h>=0;h--)p(h);return a}function wJ(e,t,n,r,i,a){var l=(r||[]).slice(),u=l.length,{start:d,end:p}=t;if(a){var h=r[u-1];if(h!=null){var m=n(h,u-1),v=e*(h.coordinate+e*m/2-p);if(l[u-1]=h=ln(ln({},h),{},{tickCoord:v>0?h.coordinate-v*e:h.coordinate}),h.tickCoord!=null){var x=sc(e,h.tickCoord,()=>m,d,p);x&&(p=h.tickCoord-e*(m/2+i),l[u-1]=ln(ln({},h),{},{isShow:!0}))}}}for(var w=a?u-1:u,S=function(C){var E=l[C];if(E==null)return 1;var O=E,P,A=()=>(P===void 0&&(P=n(E,C)),P);if(C===0){var _=e*(O.coordinate-e*A()/2-d);l[C]=O=ln(ln({},O),{},{tickCoord:_<0?O.coordinate-_*e:O.coordinate})}else l[C]=O=ln(ln({},O),{},{tickCoord:O.coordinate});if(O.tickCoord!=null){var D=sc(e,O.tickCoord,A,d,p);D&&(d=O.tickCoord+e*(A()/2+i),l[C]=ln(ln({},O),{},{isShow:!0}))}},j=0;j<w;j++)S(j);return l}function jJ(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:l,orientation:u,interval:d,tickFormatter:p,unit:h,angle:m}=e;if(!i||!i.length||!r)return[];if(Ne(d)||Qf.isSsr){var v;return(v=hJ(i,Ne(d)?d:0))!==null&&v!==void 0?v:[]}var x=[],w=u==="top"||u==="bottom"?"width":"height",S=h&&w==="width"?Ll(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(P,A)=>{var _=typeof p=="function"?p(P.value,A):P.value;return w==="width"?fJ(Ll(_,{fontSize:t,letterSpacing:n}),S,m):Ll(_,{fontSize:t,letterSpacing:n})[w]},k=i[0],C=i[1],E=i.length>=2&&k!=null&&C!=null?Fn(C.coordinate-k.coordinate):1,O=pJ(a,E,w);return d==="equidistantPreserveStart"?mJ(E,O,j,i,l):d==="equidistantPreserveEnd"?gJ(E,O,j,i,l):(d==="preserveStart"||d==="preserveStartEnd"?x=wJ(E,O,j,i,l,d==="preserveStartEnd"):x=bJ(E,O,j,i,l),x.filter(P=>P.isShow))}var SJ=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,l=0;if(t){Array.from(t).forEach(h=>{if(h){var m=h.getBoundingClientRect();m.width>l&&(l=m.width)}});var u=n?n.getBoundingClientRect().width:0,d=i+a,p=l+d+u+(n?r:0);return Math.round(p)}return 0},NJ=["axisLine","width","height","className","hide","ticks","axisType"];function kJ(e,t){if(e==null)return{};var n,r,i=PJ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function PJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function sa(){return sa=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},sa.apply(null,arguments)}function UC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UC(Object(n),!0).forEach(function(r){CJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CJ(e,t,n){return(t=OJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OJ(e){var t=AJ(e,"string");return typeof t=="symbol"?t:t+""}function AJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Js={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:En.axis};function EJ(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:l,axisLine:u,otherSvgProps:d}=e;if(!u)return null;var p=xt(xt(xt({},d),hs(u)),{},{fill:"none"});if(a==="top"||a==="bottom"){var h=+(a==="top"&&!l||a==="bottom"&&l);p=xt(xt({},p),{},{x1:t,y1:n+h*i,x2:t+r,y2:n+h*i})}else{var m=+(a==="left"&&!l||a==="right"&&l);p=xt(xt({},p),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return b.createElement("line",sa({},p,{className:st("recharts-cartesian-axis-line",oo(u,"className"))}))}function TJ(e,t,n,r,i,a,l,u,d){var p,h,m,v,x,w,S=u?-1:1,j=e.tickSize||l,k=Ne(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":p=h=e.coordinate,v=n+ +!u*i,m=v-S*j,w=m-S*d,x=k;break;case"left":m=v=e.coordinate,h=t+ +!u*r,p=h-S*j,x=p-S*d,w=k;break;case"right":m=v=e.coordinate,h=t+ +u*r,p=h+S*j,x=p+S*d,w=k;break;default:p=h=e.coordinate,v=n+ +u*i,m=v+S*j,w=m+S*d,x=k;break}return{line:{x1:p,y1:m,x2:h,y2:v},tick:{x,y:w}}}function _J(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function MJ(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function IJ(e){var{option:t,tickProps:n,value:r}=e,i,a=st(n.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))i=b.cloneElement(t,xt(xt({},n),{},{className:a}));else if(typeof t=="function")i=t(xt(xt({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=st(l,QX(t))),i=b.createElement(Iy,sa({},n,{className:l}),r)}return i}var DJ=b.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:l,unit:u,padding:d,tickTextProps:p,orientation:h,mirror:m,x:v,y:x,width:w,height:S,tickSize:j,tickMargin:k,fontSize:C,letterSpacing:E,getTicksConfig:O,events:P,axisType:A}=e,_=jJ(xt(xt({},O),{},{ticks:n}),C,E),D=_J(h,m),$=MJ(h,m),q=hs(O),X=fx(r),L={};typeof i=="object"&&(L=i);var Z=xt(xt({},q),{},{fill:"none"},L),J=_.map(B=>xt({entry:B},TJ(B,v,x,w,S,h,j,m,k))),ne=J.map(B=>{var{entry:F,line:G}=B;return b.createElement(yi,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(F.value,"-").concat(F.coordinate,"-").concat(F.tickCoord)},i&&b.createElement("line",sa({},Z,G,{className:st("recharts-cartesian-axis-tick-line",oo(i,"className"))})))}),re=J.map((B,F)=>{var G,W,{entry:M,tick:V}=B,ie=xt(xt(xt(xt({verticalAnchor:$},q),{},{textAnchor:D,stroke:"none",fill:a},V),{},{index:F,payload:M,visibleTicksCount:_.length,tickFormatter:l,padding:d},p),{},{angle:(G=(W=p==null?void 0:p.angle)!==null&&W!==void 0?W:q.angle)!==null&&G!==void 0?G:0}),fe=xt(xt({},ie),X);return b.createElement(yi,sa({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(M.value,"-").concat(M.coordinate,"-").concat(M.tickCoord)},yx(P,M,F)),r&&b.createElement(IJ,{option:r,tickProps:fe,value:"".concat(typeof l=="function"?l(M.value,F):M.value).concat(u||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},re.length>0&&b.createElement(bs,{zIndex:En.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},re)),ne.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},ne))}),RJ=b.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:l,ticks:u,axisType:d}=e,p=kJ(e,NJ),[h,m]=b.useState(""),[v,x]=b.useState(""),w=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var j;return SJ({ticks:w.current,label:(j=e.labelRef)===null||j===void 0?void 0:j.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var S=b.useCallback(j=>{if(j){var k=j.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=k;var C=k[0];if(C){var E=window.getComputedStyle(C),O=E.fontSize,P=E.letterSpacing;(O!==h||P!==v)&&(m(O),x(P))}}},[h,v]);return l||r!=null&&r<=0||i!=null&&i<=0?null:b.createElement(bs,{zIndex:e.zIndex},b.createElement(yi,{className:st("recharts-cartesian-axis",a)},b.createElement(EJ,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:hs(e)}),b.createElement(DJ,{ref:S,axisType:d,events:p,fontSize:h,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y}),b.createElement(NX,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(IX,{label:e.label,labelRef:e.labelRef}),e.children)))}),Ry=b.forwardRef((e,t)=>{var n=ur(e,Js);return b.createElement(RJ,sa({},n,{ref:t}))});Ry.displayName="CartesianAxis";var LJ={},__=_n({name:"errorBars",initialState:LJ,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:Wte,replaceErrorBar:qte,removeErrorBar:Kte}=__.actions,$J=__.reducer,zJ=["children"];function FJ(e,t){if(e==null)return{};var n,r,i=BJ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function BJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var VJ={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},UJ=b.createContext(VJ);function WJ(e){var{children:t}=e,n=FJ(e,zJ);return b.createElement(UJ.Provider,{value:n},t)}function M_(e,t){var n,r,i=Ae(p=>Ti(p,e)),a=Ae(p=>_i(p,t)),l=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:Ft.allowDataOverflow,u=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:Bt.allowDataOverflow,d=l||u;return{needClip:d,needClipX:l,needClipY:u}}function qJ(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=O_(),{needClipX:a,needClipY:l,needClip:u}=M_(t,n);if(!u||!i)return null;var{x:d,y:p,width:h,height:m}=i;return b.createElement("clipPath",{id:"clipPath-".concat(r)},b.createElement("rect",{x:a?d:d-h/2,y:l?p:p-m/2,width:a?h:h*2,height:l?m:m*2}))}var Z0={exports:{}},eg={};/**
344
+ * @license React
345
+ * use-sync-external-store-with-selector.production.js
346
+ *
347
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
348
+ *
349
+ * This source code is licensed under the MIT license found in the
350
+ * LICENSE file in the root directory of this source tree.
351
+ */var WC;function KJ(){if(WC)return eg;WC=1;var e=vo();function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,l=e.useMemo,u=e.useDebugValue;return eg.useSyncExternalStoreWithSelector=function(d,p,h,m,v){var x=i(null);if(x.current===null){var w={hasValue:!1,value:null};x.current=w}else w=x.current;x=l(function(){function j(P){if(!k){if(k=!0,C=P,P=m(P),v!==void 0&&w.hasValue){var A=w.value;if(v(A,P))return E=A}return E=P}if(A=E,n(C,P))return A;var _=m(P);return v!==void 0&&v(A,_)?(C=P,A):(C=P,E=_)}var k=!1,C,E,O=h===void 0?null:h;return[function(){return j(p())},O===null?void 0:function(){return j(O())}]},[p,h,m,v]);var S=r(d,x[0],x[1]);return a(function(){w.hasValue=!0,w.value=S},[S]),u(S),S},eg}var qC;function HJ(){return qC||(qC=1,Z0.exports=KJ()),Z0.exports}HJ();function GJ(e){e()}function YJ(){let e=null,t=null;return{clear(){e=null,t=null},notify(){GJ(()=>{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 i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var KC={notify(){},get:()=>[]};function XJ(e,t){let n,r=KC,i=0,a=!1;function l(S){h();const j=r.subscribe(S);let k=!1;return()=>{k||(k=!0,j(),m())}}function u(){r.notify()}function d(){w.onStateChange&&w.onStateChange()}function p(){return a}function h(){i++,n||(n=e.subscribe(d),r=YJ())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=KC)}function v(){a||(a=!0,h())}function x(){a&&(a=!1,m())}const w={addNestedSub:l,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:p,trySubscribe:v,tryUnsubscribe:x,getListeners:()=>r};return w}var QJ=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",JJ=QJ(),ZJ=()=>typeof navigator<"u"&&navigator.product==="ReactNative",eZ=ZJ(),tZ=()=>JJ||eZ?b.useLayoutEffect:b.useEffect,nZ=tZ();function HC(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function rZ(e,t){if(HC(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 i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!HC(e[n[i]],t[n[i]]))return!1;return!0}var tg=Symbol.for("react-redux-context"),ng=typeof globalThis<"u"?globalThis:{};function iZ(){if(!b.createContext)return{};const e=ng[tg]??(ng[tg]=new Map);let t=e.get(b.createContext);return t||(t=b.createContext(null),e.set(b.createContext,t)),t}var sZ=iZ();function aZ(e){const{children:t,context:n,serverState:r,store:i}=e,a=b.useMemo(()=>{const d=XJ(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),l=b.useMemo(()=>i.getState(),[i]);nZ(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),l!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,l]);const u=n||sZ;return b.createElement(u.Provider,{value:a},t)}var oZ=aZ,lZ=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function cZ(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Ly(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(lZ.has(r)){if(e[r]==null&&t[r]==null)continue;if(!rZ(e[r],t[r]))return!1}else if(!cZ(e[r],t[r]))return!1;return!0}function ca(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:P_}function ua(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:P_}var uZ="Invariant failed";function dZ(e,t){throw new Error(uZ)}function mv(){return mv=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},mv.apply(null,arguments)}function xf(e){return b.createElement(bQ,mv({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var fZ=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Ne(t))return t;var a=Ne(r)||Ut(r);return a?t(r,i):(a||dZ(),n)}},pZ=(e,t,n)=>n,hZ=(e,t)=>t,Ac=Q([my,hZ],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),mZ=Q([Ac],e=>e==null?void 0:e.maxBarSize),gZ=(e,t,n,r)=>r,vZ=Q([nt,my,ca,ua,pZ],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),xZ=(e,t,n)=>{var r=nt(e),i=ca(e,t),a=ua(e,t);if(!(i==null||a==null))return r==="horizontal"?cv(e,"yAxis",a,n):cv(e,"xAxis",i,n)},yZ=(e,t)=>{var n=nt(e),r=ca(e,t),i=ua(e,t);if(!(r==null||i==null))return n==="horizontal"?FP(e,"xAxis",r):FP(e,"yAxis",i)},bZ=Q([vZ,vK,yZ],YQ),wZ=(e,t,n)=>{var r,i,a=Ac(e,t);if(a==null)return 0;var l=ca(e,t),u=ua(e,t);if(l==null||u==null)return 0;var d=nt(e),p=zT(e),{maxBarSize:h}=a,m=Ut(h)?p:h,v,x;return d==="horizontal"?(v=mo(e,"xAxis",l,n),x=ho(e,"xAxis",l,n)):(v=mo(e,"yAxis",u,n),x=ho(e,"yAxis",u,n)),(r=(i=Wd(v,x,!0))!==null&&i!==void 0?i:m)!==null&&r!==void 0?r:0},I_=(e,t,n)=>{var r=nt(e),i=ca(e,t),a=ua(e,t);if(!(i==null||a==null)){var l,u;return r==="horizontal"?(l=mo(e,"xAxis",i,n),u=ho(e,"xAxis",i,n)):(l=mo(e,"yAxis",a,n),u=ho(e,"yAxis",a,n)),Wd(l,u)}},jZ=Q([bZ,zT,gK,FT,wZ,I_,mZ],eJ),SZ=(e,t,n)=>{var r=ca(e,t);if(r!=null)return mo(e,"xAxis",r,n)},NZ=(e,t,n)=>{var r=ua(e,t);if(r!=null)return mo(e,"yAxis",r,n)},kZ=(e,t,n)=>{var r=ca(e,t);if(r!=null)return ho(e,"xAxis",r,n)},PZ=(e,t,n)=>{var r=ua(e,t);if(r!=null)return ho(e,"yAxis",r,n)},CZ=Q([jZ,Ac],nJ),OZ=Q([xZ,Ac],tJ),AZ=Q([Wt,Ax,SZ,NZ,kZ,PZ,CZ,nt,lK,I_,OZ,Ac,gZ],(e,t,n,r,i,a,l,u,d,p,h,m,v)=>{var{chartData:x,dataStartIndex:w,dataEndIndex:S}=d;if(!(m==null||l==null||t==null||u!=="horizontal"&&u!=="vertical"||n==null||r==null||i==null||a==null||p==null)){var{data:j}=m,k;if(j!=null&&j.length>0?k=j:k=x==null?void 0:x.slice(w,S+1),k!=null)return ree({layout:u,barSettings:m,pos:l,parentViewBox:t,bandSize:p,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:h,displayedData:k,offset:e,cells:v,dataStartIndex:w})}}),EZ=["index"];function gv(){return gv=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},gv.apply(null,arguments)}function TZ(e,t){if(e==null)return{};var n,r,i=_Z(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _Z(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var D_=b.createContext(void 0),MZ=e=>{var t=b.useContext(D_);if(t!=null)return t.stackId;if(e!=null)return oV(e)},IZ=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),DZ=e=>{var t=b.useContext(D_);if(t!=null){var{stackId:n}=t;return"url(#".concat(IZ(n,e),")")}},R_=e=>{var{index:t}=e,n=TZ(e,EZ),r=DZ(t);return b.createElement(yi,gv({className:"recharts-bar-stack-layer",clipPath:r},n))},RZ=["onMouseEnter","onMouseLeave","onClick"],LZ=["value","background","tooltipPosition"],$Z=["id"],zZ=["onMouseEnter","onClick","onMouseLeave"];function Pi(){return Pi=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},Pi.apply(null,arguments)}function GC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GC(Object(n),!0).forEach(function(r){FZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FZ(e,t,n){return(t=BZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BZ(e){var t=VZ(e,"string");return typeof t=="symbol"?t:t+""}function VZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yf(e,t){if(e==null)return{};var n,r,i=UZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function UZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var WZ=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:jE(n,t),payload:e}]},qZ=b.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:l,unit:u,tooltipType:d,id:p}=e,h={dataDefinedOnItem:void 0,getPosition:jo,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:jE(a,t),hide:l,type:d,color:i,unit:u,graphicalItemId:p}};return b.createElement(wQ,{tooltipEntrySettings:h})});function KZ(e){var t=Ae(go),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:l,onMouseLeave:u,onClick:d}=a,p=yf(a,RZ),h=j_(l,r,a.id),m=S_(u),v=N_(d,r,a.id);if(!i||n==null)return null;var x=fx(i);return b.createElement(bs,{zIndex:rJ(i,En.barBackground)},n.map((w,S)=>{var{value:j,background:k,tooltipPosition:C}=w,E=yf(w,LZ);if(!k)return null;var O=h(w,S),P=m(w,S),A=v(w,S),_=mn(mn(mn(mn(mn({option:i,isActive:String(S)===t},E),{},{fill:"#eee"},k),x),yx(p,w,S)),{},{onMouseEnter:O,onMouseLeave:P,onClick:A,dataKey:r,index:S,className:"recharts-bar-background-rectangle"});return b.createElement(xf,Pi({key:"background-bar-".concat(S)},_))}))}function HZ(e){var{showLabels:t,children:n,rects:r}=e,i=r==null?void 0:r.map(a=>{var l={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return mn(mn({},l),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:l,fill:a.fill})});return b.createElement(qX,{value:t?i:void 0},n)}function GZ(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:l}=e,u=Ae(go),d=Ae(Q5),p=n&&String(a)===u&&(d==null||l===d),h=p?n:t;return p?b.createElement(bs,{zIndex:En.activeBar},b.createElement(R_,{index:a},b.createElement(xf,Pi({},r,{name:String(r.name)},i,{isActive:p,option:h,index:a,dataKey:l})))):b.createElement(xf,Pi({},r,{name:String(r.name)},i,{isActive:p,option:h,index:a,dataKey:l}))}function YZ(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return b.createElement(xf,Pi({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function XZ(e){var t,{data:n,props:r}=e,i=(t=hs(r))!==null&&t!==void 0?t:{},{id:a}=i,l=yf(i,$Z),{shape:u,dataKey:d,activeBar:p}=r,{onMouseEnter:h,onClick:m,onMouseLeave:v}=r,x=yf(r,zZ),w=j_(h,d,a),S=S_(v),j=N_(m,d,a);return n?b.createElement(b.Fragment,null,n.map((k,C)=>b.createElement(R_,Pi({index:C,key:"rectangle-".concat(k==null?void 0:k.x,"-").concat(k==null?void 0:k.y,"-").concat(k==null?void 0:k.value,"-").concat(C),className:"recharts-bar-rectangle"},yx(x,k,C),{onMouseEnter:w(k,C),onMouseLeave:S(k,C),onClick:j(k,C)}),p?b.createElement(GZ,{shape:u,activeBar:p,baseProps:l,entry:k,index:C,dataKey:d}):b.createElement(YZ,{shape:u,baseProps:l,entry:k,index:C,dataKey:d})))):null}function QZ(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationEnd:p,onAnimationStart:h}=t,m=n.current,v=Dx(t,"recharts-bar-"),[x,w]=b.useState(!1),S=!x,j=b.useCallback(()=>{typeof p=="function"&&p(),w(!1)},[p]),k=b.useCallback(()=>{typeof h=="function"&&h(),w(!0)},[h]);return b.createElement(HZ,{showLabels:S,rects:r},b.createElement(Ix,{animationId:v,begin:l,duration:u,isActive:a,easing:d,onAnimationEnd:j,onAnimationStart:k,key:v},C=>{var E=C===1?r:r==null?void 0:r.map((O,P)=>{var A=m&&m[P];if(A)return mn(mn({},O),{},{x:Zt(A.x,O.x,C),y:Zt(A.y,O.y,C),width:Zt(A.width,O.width,C),height:Zt(A.height,O.height,C)});if(i==="horizontal"){var _=Zt(0,O.height,C),D=Zt(O.stackedBarStart,O.y,C);return mn(mn({},O),{},{y:D,height:_})}var $=Zt(0,O.width,C),q=Zt(O.stackedBarStart,O.x,C);return mn(mn({},O),{},{width:$,x:q})});return C>0&&(n.current=E??null),E==null?null:b.createElement(yi,null,b.createElement(XZ,{props:t,data:E}))}),b.createElement(GX,{label:t.label}),t.children)}function JZ(e){var t=b.useRef(null);return b.createElement(QZ,{previousRectanglesRef:t,props:e})}var L_=0,ZZ=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:tn(e,t)}};class eee extends b.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:l,needClip:u,background:d,id:p}=this.props;if(t||n==null)return null;var h=st("recharts-bar",i),m=p;return b.createElement(yi,{className:h,id:p},u&&b.createElement("defs",null,b.createElement(qJ,{clipPathId:m,xAxisId:a,yAxisId:l})),b.createElement(yi,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(m,")"):void 0},b.createElement(KZ,{data:n,dataKey:r,background:d,allOtherBarProps:this.props}),b.createElement(JZ,this.props)))}}var tee={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:L_,xAxisId:0,yAxisId:0,zIndex:En.bar};function nee(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:u,animationDuration:d,animationEasing:p,isAnimationActive:h}=e,{needClip:m}=M_(t,n),v=So(),x=Kn(),w=tQ(e.children,o_),S=Ae(C=>AZ(C,e.id,x,w));if(v!=="vertical"&&v!=="horizontal")return null;var j,k=S==null?void 0:S[0];return k==null||k.height==null||k.width==null?j=0:j=v==="vertical"?k.height/2:k.width/2,b.createElement(WJ,{xAxisId:t,yAxisId:n,data:S,dataPointFormatter:ZZ,errorBarOffset:j},b.createElement(eee,Pi({},e,{layout:v,needClip:m,data:S,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:u,animationDuration:d,animationEasing:p,isAnimationActive:h})))}function ree(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r},pos:i,bandSize:a,xAxis:l,yAxis:u,xAxisTicks:d,yAxisTicks:p,stackedData:h,displayedData:m,offset:v,cells:x,parentViewBox:w,dataStartIndex:S}=e,j=t==="horizontal"?u:l,k=h?j.scale.domain():null,C=lV({numericAxis:j}),E=j.scale.map(C);return m.map((O,P)=>{var A,_,D,$,q,X;if(h){var L=h[P+S];if(L==null)return null;A=nV(L,k)}else A=tn(O,n),Array.isArray(A)||(A=[C,A]);var Z=fZ(r,L_)(A[1],P);if(t==="horizontal"){var J,ne=u.scale.map(A[0]),re=u.scale.map(A[1]);if(ne==null||re==null)return null;_=FN({axis:l,ticks:d,bandSize:a,offset:i.offset,entry:O,index:P}),D=(J=re??ne)!==null&&J!==void 0?J:void 0,$=i.size;var B=ne-re;if(q=Gr(B)?0:B,X={x:_,y:v.top,width:$,height:v.height},Math.abs(Z)>0&&Math.abs(q)<Math.abs(Z)){var F=Fn(q||Z)*(Math.abs(Z)-Math.abs(q));D-=F,q+=F}}else{var G=l.scale.map(A[0]),W=l.scale.map(A[1]);if(G==null||W==null)return null;if(_=G,D=FN({axis:u,ticks:p,bandSize:a,offset:i.offset,entry:O,index:P}),$=W-G,q=i.size,X={x:v.left,y:D,width:v.width,height:q},Math.abs(Z)>0&&Math.abs($)<Math.abs(Z)){var M=Fn($||Z)*(Math.abs(Z)-Math.abs($));$+=M}}if(_==null||D==null||$==null||q==null)return null;var V=mn(mn({},O),{},{stackedBarStart:E,x:_,y:D,width:$,height:q,value:h?A:A[1],payload:O,background:X,tooltipPosition:{x:_+$/2,y:D+q/2},parentViewBox:w},x&&x[P]&&x[P].props);return V}).filter(Boolean)}function iee(e){var t=ur(e,tee),n=MZ(t.stackId),r=Kn();return b.createElement(CQ,{id:t.id,type:"bar"},i=>b.createElement(b.Fragment,null,b.createElement(jQ,{legendPayload:WZ(t)}),b.createElement(qZ,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),b.createElement(IQ,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r}),b.createElement(bs,{zIndex:t.zIndex},b.createElement(nee,Pi({},t,{id:i})))))}var $_=b.memo(iee,Ly);$_.displayName="Bar";var see=["domain","range"],aee=["domain","range"];function YC(e,t){if(e==null)return{};var n,r,i=oee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function oee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function XC(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function z_(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=YC(e,see),{domain:a,range:l}=t,u=YC(t,aee);return!XC(n,a)||!XC(r,l)?!1:Ly(i,u)}var lee=["type"],cee=["dangerouslySetInnerHTML","ticks","scale"],uee=["id","scale"];function vv(){return vv=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},vv.apply(null,arguments)}function QC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function JC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QC(Object(n),!0).forEach(function(r){dee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dee(e,t,n){return(t=fee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fee(e){var t=pee(e,"string");return typeof t=="symbol"?t:t+""}function pee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xv(e,t){if(e==null)return{};var n,r,i=hee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function mee(e){var t=Nt(),n=b.useRef(null),r=CE(),{type:i}=e,a=xv(e,lee),l=ap(r,"xAxis",i),u=b.useMemo(()=>{if(l!=null)return JC(JC({},a),{},{type:l})},[a,l]);return b.useLayoutEffect(()=>{u!=null&&(n.current===null?t(zQ(u)):n.current!==u&&t(FQ({prev:n.current,next:u})),n.current=u)},[u,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(BQ(n.current)),n.current=null)},[t]),null}var gee=e=>{var{xAxisId:t,className:n}=e,r=Ae(Ax),i=Kn(),a="xAxis",l=Ae(k=>E5(k,a,t,i)),u=Ae(k=>P5(k,t)),d=Ae(k=>xH(k,t)),p=Ae(k=>YT(k,t));if(u==null||d==null||p==null)return null;var{dangerouslySetInnerHTML:h,ticks:m,scale:v}=e,x=xv(e,cee),{id:w,scale:S}=p,j=xv(p,uee);return b.createElement(Ry,vv({},x,j,{x:d.x,y:d.y,width:u.width,height:u.height,className:st("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:l,axisType:a}))},vee={allowDataOverflow:Ft.allowDataOverflow,allowDecimals:Ft.allowDecimals,allowDuplicatedCategory:Ft.allowDuplicatedCategory,angle:Ft.angle,axisLine:Js.axisLine,height:Ft.height,hide:!1,includeHidden:Ft.includeHidden,interval:Ft.interval,label:!1,minTickGap:Ft.minTickGap,mirror:Ft.mirror,orientation:Ft.orientation,padding:Ft.padding,reversed:Ft.reversed,scale:Ft.scale,tick:Ft.tick,tickCount:Ft.tickCount,tickLine:Js.tickLine,tickSize:Js.tickSize,type:Ft.type,xAxisId:0},xee=e=>{var t=ur(e,vee);return b.createElement(b.Fragment,null,b.createElement(mee,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit}),b.createElement(gee,t))},F_=b.memo(xee,z_);F_.displayName="XAxis";var yee=["type"],bee=["dangerouslySetInnerHTML","ticks","scale"],wee=["id","scale"];function yv(){return yv=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},yv.apply(null,arguments)}function ZC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function e2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZC(Object(n),!0).forEach(function(r){jee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jee(e,t,n){return(t=See(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function See(e){var t=Nee(e,"string");return typeof t=="symbol"?t:t+""}function Nee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bv(e,t){if(e==null)return{};var n,r,i=kee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Pee(e){var t=Nt(),n=b.useRef(null),r=CE(),{type:i}=e,a=bv(e,yee),l=ap(r,"yAxis",i),u=b.useMemo(()=>{if(l!=null)return e2(e2({},a),{},{type:l})},[l,a]);return b.useLayoutEffect(()=>{u!=null&&(n.current===null?t(VQ(u)):n.current!==u&&t(UQ({prev:n.current,next:u})),n.current=u)},[u,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(WQ(n.current)),n.current=null)},[t]),null}function Cee(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=b.useRef(null),l=b.useRef(null),u=Ae(Ax),d=Kn(),p=Nt(),h="yAxis",m=Ae(A=>C5(A,t)),v=Ae(A=>bH(A,t)),x=Ae(A=>E5(A,h,t,d)),w=Ae(A=>XT(A,t));if(b.useLayoutEffect(()=>{if(!(r!=="auto"||!m||Dy(i)||b.isValidElement(i)||w==null)){var A=a.current;if(A){var _=A.getCalculatedWidth();Math.round(m.width)!==Math.round(_)&&p(qQ({id:t,width:_}))}}},[x,m,p,i,t,r,w]),m==null||v==null||w==null)return null;var{dangerouslySetInnerHTML:S,ticks:j,scale:k}=e,C=bv(e,bee),{id:E,scale:O}=w,P=bv(w,wee);return b.createElement(Ry,yv({},C,P,{ref:a,labelRef:l,x:v.x,y:v.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:st("recharts-".concat(h," ").concat(h),n),viewBox:u,ticks:x,axisType:h}))}var Oee={allowDataOverflow:Bt.allowDataOverflow,allowDecimals:Bt.allowDecimals,allowDuplicatedCategory:Bt.allowDuplicatedCategory,angle:Bt.angle,axisLine:Js.axisLine,hide:!1,includeHidden:Bt.includeHidden,interval:Bt.interval,label:!1,minTickGap:Bt.minTickGap,mirror:Bt.mirror,orientation:Bt.orientation,padding:Bt.padding,reversed:Bt.reversed,scale:Bt.scale,tick:Bt.tick,tickCount:Bt.tickCount,tickLine:Js.tickLine,tickSize:Js.tickSize,type:Bt.type,width:Bt.width,yAxisId:0},Aee=e=>{var t=ur(e,Oee);return b.createElement(b.Fragment,null,b.createElement(Pee,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter}),b.createElement(Cee,t))},B_=b.memo(Aee,z_);B_.displayName="YAxis";var Eee=(e,t)=>t,$y=Q([Eee,nt,HT,Ht,H5,Mi,IG,Wt],BG),zy=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,r=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/r)}},V_=lr("mouseClick"),U_=mc();U_.startListening({actionCreator:V_,effect:(e,t)=>{var n=e.payload,r=$y(t.getState(),zy(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(IH({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var wv=lr("mouseMove"),W_=mc(),sd=null;W_.startListening({actionCreator:wv,effect:(e,t)=>{var n=e.payload;sd!==null&&cancelAnimationFrame(sd);var r=zy(n);sd=requestAnimationFrame(()=>{var i=t.getState(),a=Ny(i,i.tooltip.settings.shared);if(a==="axis"){var l=$y(i,r);(l==null?void 0:l.activeIndex)!=null?t.dispatch($5({activeIndex:l.activeIndex,activeDataKey:void 0,activeCoordinate:l.activeCoordinate})):t.dispatch(L5())}sd=null})}});function Tee(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var t2={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},q_=_n({name:"rootProps",initialState:t2,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:t2.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),_ee=q_.reducer,{updateOptions:Mee}=q_.actions,Iee=null,Dee={updatePolarOptions:(e,t)=>t.payload},K_=_n({name:"polarOptions",initialState:Iee,reducers:Dee}),{updatePolarOptions:Hte}=K_.actions,Ree=K_.reducer,H_=lr("keyDown"),G_=lr("focus"),Fy=mc();Fy.startListening({actionCreator:H_,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var l=ky(i,_o(n),kc(n),Cc(n)),u=l==null?-1:Number(l);if(!(!Number.isFinite(u)||u<0)){var d=Mi(n);if(a==="Enter"){var p=hf(n,"axis","hover",String(i.index));t.dispatch(dv({active:!i.active,activeIndex:i.index,activeCoordinate:p}));return}var h=NH(n),m=h==="left-to-right"?1:-1,v=a==="ArrowRight"?1:-1,x=u+v*m;if(!(d==null||x>=d.length||x<0)){var w=hf(n,"axis","hover",String(x));t.dispatch(dv({active:!0,activeIndex:x.toString(),activeCoordinate:w}))}}}}}});Fy.startListening({actionCreator:G_,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",l=hf(n,"axis","hover",String(a));t.dispatch(dv({active:!0,activeIndex:a,activeCoordinate:l}))}}}});var nr=lr("externalEvent"),Y_=mc(),rg=new Map;Y_.startListening({actionCreator:nr,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){r.persist();var i=r.type,a=rg.get(i);a!==void 0&&cancelAnimationFrame(a);var l=requestAnimationFrame(()=>{try{var u=t.getState(),d={activeCoordinate:yG(u),activeDataKey:Q5(u),activeIndex:go(u),activeLabel:X5(u),activeTooltipIndex:go(u),isTooltipActive:bG(u)};n(d,r)}finally{rg.delete(i)}});rg.set(i,l)}}});var Lee=Q([Eo],e=>e.tooltipItemPayloads),$ee=Q([Lee,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),X_=lr("touchMove"),Q_=mc();Q_.startListening({actionCreator:X_,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var r=t.getState(),i=Ny(r,r.tooltip.settings.shared);if(i==="axis"){var a=n.touches[0];if(a==null)return;var l=$y(r,zy({clientX:a.clientX,clientY:a.clientY,currentTarget:n.currentTarget}));(l==null?void 0:l.activeIndex)!=null&&t.dispatch($5({activeIndex:l.activeIndex,activeDataKey:void 0,activeCoordinate:l.activeCoordinate}))}else if(i==="item"){var u,d=n.touches[0];if(document.elementFromPoint==null||d==null)return;var p=document.elementFromPoint(d.clientX,d.clientY);if(!p||!p.getAttribute)return;var h=p.getAttribute(mV),m=(u=p.getAttribute(gV))!==null&&u!==void 0?u:void 0,v=To(r).find(S=>S.id===m);if(h==null||v==null||m==null)return;var{dataKey:x}=v,w=$ee(r,h,m);t.dispatch(R5({activeDataKey:x,activeIndex:h,activeCoordinate:w,activeGraphicalItemId:m}))}}}});var zee=HA({brush:sJ,cartesianAxis:KQ,chartData:yY,errorBars:$J,graphicalItems:_Q,layout:Q8,legend:dU,options:hY,polarAxis:XX,polarOptions:Ree,referenceElements:cJ,rootProps:_ee,tooltip:DH,zIndex:tY}),Fee=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return j8({reducer:zee,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([U_.middleware,W_.middleware,Fy.middleware,Y_.middleware,Q_.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(lE({type:"raf"}))},devTools:{serialize:{replacer:Tee},name:"recharts-".concat(n)}})};function Bee(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Kn(),a=b.useRef(null);if(i)return n;a.current==null&&(a.current=Fee(t,r));var l=jx;return b.createElement(oZ,{context:l,store:a.current},n)}function Vee(e){var{layout:t,margin:n}=e,r=Nt(),i=Kn();return b.useEffect(()=>{i||(r(G8(t)),r(H8(n)))},[r,i,t,n]),null}var Uee=b.memo(Vee,Ly);function Wee(e){var t=Nt();return b.useEffect(()=>{t(Mee(e))},[t,e]),null}function n2(e){var{zIndex:t,isPanorama:n}=e,r=b.useRef(null),i=Nt();return b.useLayoutEffect(()=>(r.current&&i(ZG({zIndex:t,element:r.current,isPanorama:n})),()=>{i(eY({zIndex:t,isPanorama:n}))}),[i,t,n]),b.createElement("g",{tabIndex:-1,ref:r})}function r2(e){var{children:t,isPanorama:n}=e,r=Ae(UG);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),a=r.filter(l=>l>0);return b.createElement(b.Fragment,null,i.map(l=>b.createElement(n2,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>b.createElement(n2,{key:l,zIndex:l,isPanorama:n})))}var qee=["children"];function Kee(e,t){if(e==null)return{};var n,r,i=Hee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Hee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function bf(){return bf=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},bf.apply(null,arguments)}var Gee={width:"100%",height:"100%",display:"block"},Yee=b.forwardRef((e,t)=>{var n=HV(),r=GV(),i=RE();if(!ms(n)||!ms(r))return null;var{children:a,otherAttributes:l,title:u,desc:d}=e,p,h;return l!=null&&(typeof l.tabIndex=="number"?p=l.tabIndex:p=i?0:void 0,typeof l.role=="string"?h=l.role:h=i?"application":void 0),b.createElement(dA,bf({},l,{title:u,desc:d,role:h,tabIndex:p,width:n,height:r,style:Gee,ref:t}),a)}),Xee=e=>{var{children:t}=e,n=Ae(Kf);if(!n)return null;var{width:r,height:i,y:a,x:l}=n;return b.createElement(dA,{width:r,height:i,x:l,y:a},t)},i2=b.forwardRef((e,t)=>{var{children:n}=e,r=Kee(e,qee),i=Kn();return i?b.createElement(Xee,null,b.createElement(r2,{isPanorama:!0},n)):b.createElement(Yee,bf({ref:t},r),b.createElement(r2,{isPanorama:!1},n))});function Qee(){var e=Nt(),[t,n]=b.useState(null),r=Ae(hV);return b.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Ke(a)&&a!==r&&e(X8(a))}},[t,e,r]),n}function s2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s2(Object(n),!0).forEach(function(r){Zee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zee(e,t,n){return(t=ete(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ete(e){var t=tte(e,"string");return typeof t=="symbol"?t:t+""}function tte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function us(){return us=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},us.apply(null,arguments)}var nte=()=>(OY(),null);function wf(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var rte=b.forwardRef((e,t)=>{var n,r,i=b.useRef(null),[a,l]=b.useState({containerWidth:wf((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:wf((r=e.style)===null||r===void 0?void 0:r.height)}),u=b.useCallback((p,h)=>{l(m=>{var v=Math.round(p),x=Math.round(h);return m.containerWidth===v&&m.containerHeight===x?m:{containerWidth:v,containerHeight:x}})},[]),d=b.useCallback(p=>{if(typeof t=="function"&&t(p),p!=null&&typeof ResizeObserver<"u"){var{width:h,height:m}=p.getBoundingClientRect();u(h,m);var v=w=>{var S=w[0];if(S!=null){var{width:j,height:k}=S.contentRect;u(j,k)}},x=new ResizeObserver(v);x.observe(p),i.current=x}},[t,u]);return b.useEffect(()=>()=>{var p=i.current;p!=null&&p.disconnect()},[u]),b.createElement(b.Fragment,null,b.createElement(vc,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",us({ref:d},e)))}),ite=b.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=b.useState({containerWidth:wf(n),containerHeight:wf(r)}),l=b.useCallback((d,p)=>{a(h=>{var m=Math.round(d),v=Math.round(p);return h.containerWidth===m&&h.containerHeight===v?h:{containerWidth:m,containerHeight:v}})},[]),u=b.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:p,height:h}=d.getBoundingClientRect();l(p,h)}},[t,l]);return b.createElement(b.Fragment,null,b.createElement(vc,{width:i.containerWidth,height:i.containerHeight}),b.createElement("div",us({ref:u},e)))}),ste=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return b.createElement(b.Fragment,null,b.createElement(vc,{width:n,height:r}),b.createElement("div",us({ref:t},e)))}),ate=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?b.createElement(ite,us({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?b.createElement(ste,us({},e,{width:n,height:r,ref:t})):b.createElement(b.Fragment,null,b.createElement(vc,{width:n,height:r}),b.createElement("div",us({ref:t},e)))});function ote(e){return e?rte:ate}var lte=b.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:l,onDoubleClick:u,onMouseDown:d,onMouseEnter:p,onMouseLeave:h,onMouseMove:m,onMouseUp:v,onTouchEnd:x,onTouchMove:w,onTouchStart:S,style:j,width:k,responsive:C,dispatchTouchEvents:E=!0}=e,O=b.useRef(null),P=Nt(),[A,_]=b.useState(null),[D,$]=b.useState(null),q=Qee(),X=Ex(),L=(X==null?void 0:X.width)>0?X.width:k,Z=(X==null?void 0:X.height)>0?X.height:i,J=b.useCallback(H=>{q(H),typeof t=="function"&&t(H),_(H),$(H),H!=null&&(O.current=H)},[q,t,_,$]),ne=b.useCallback(H=>{P(V_(H)),P(nr({handler:a,reactEvent:H}))},[P,a]),re=b.useCallback(H=>{P(wv(H)),P(nr({handler:p,reactEvent:H}))},[P,p]),B=b.useCallback(H=>{P(L5()),P(nr({handler:h,reactEvent:H}))},[P,h]),F=b.useCallback(H=>{P(wv(H)),P(nr({handler:m,reactEvent:H}))},[P,m]),G=b.useCallback(()=>{P(G_())},[P]),W=b.useCallback(H=>{P(H_(H.key))},[P]),M=b.useCallback(H=>{P(nr({handler:l,reactEvent:H}))},[P,l]),V=b.useCallback(H=>{P(nr({handler:u,reactEvent:H}))},[P,u]),ie=b.useCallback(H=>{P(nr({handler:d,reactEvent:H}))},[P,d]),fe=b.useCallback(H=>{P(nr({handler:v,reactEvent:H}))},[P,v]),te=b.useCallback(H=>{P(nr({handler:S,reactEvent:H}))},[P,S]),le=b.useCallback(H=>{E&&P(X_(H)),P(nr({handler:w,reactEvent:H}))},[P,E,w]),pe=b.useCallback(H=>{P(nr({handler:x,reactEvent:H}))},[P,x]),Se=ote(C);return b.createElement(i_.Provider,{value:A},b.createElement(eB.Provider,{value:D},b.createElement(Se,{width:L??(j==null?void 0:j.width),height:Z??(j==null?void 0:j.height),className:st("recharts-wrapper",r),style:Jee({position:"relative",cursor:"default",width:L,height:Z},j),onClick:ne,onContextMenu:M,onDoubleClick:V,onFocus:G,onKeyDown:W,onMouseDown:ie,onMouseEnter:re,onMouseLeave:B,onMouseMove:F,onMouseUp:fe,onTouchEnd:pe,onTouchMove:le,onTouchStart:te,ref:J},b.createElement(nte,null),n)))}),cte=["width","height","responsive","children","className","style","compact","title","desc"];function ute(e,t){if(e==null)return{};var n,r,i=dte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var fte=b.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:l,style:u,compact:d,title:p,desc:h}=e,m=ute(e,cte),v=hs(m);return d?b.createElement(b.Fragment,null,b.createElement(vc,{width:n,height:r}),b.createElement(i2,{otherAttributes:v,title:p,desc:h},a)):b.createElement(lte,{className:l,style:u,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},b.createElement(i2,{otherAttributes:v,title:p,desc:h,ref:t},b.createElement(dJ,null,a)))});function jv(){return jv=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},jv.apply(null,arguments)}var pte={top:5,right:5,bottom:5,left:5},hte={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:pte,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},mte=b.forwardRef(function(t,n){var r,i=ur(t.categoricalChartProps,hte),{chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:p}=t,h={chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return b.createElement(Bee,{preloadedState:{options:h},reduxStoreName:(r=p.id)!==null&&r!==void 0?r:a},b.createElement(iJ,{chartData:p.data}),b.createElement(Uee,{layout:i.layout,margin:i.margin}),b.createElement(Wee,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),b.createElement(fte,jv({},i,{ref:n})))}),gte=["axis","item"],vte=b.forwardRef((e,t)=>b.createElement(mte,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:gte,tooltipPayloadSearcher:fY,categoricalChartProps:e,ref:t}));const xte=[{label:"Today",value:"today"},{label:"7 days",value:7},{label:"30 days",value:30},{label:"90 days",value:90}];function a2(e){return e===0?"$0.00":e<.01?"< $0.01":`$${e.toFixed(2)}`}function o2(e){return e===0?"$0.0000":`$${e.toFixed(4)}`}function ad(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function l2(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Sv(e){return e.replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function yte(e,t){if(e===t)return"Documentation";const n=`${t}-`;return e.startsWith(n)?Sv(e.slice(n.length)):Sv(e)}function bte({onClose:e}){const[t,n]=b.useState("today"),[r,i]=b.useState(""),[a,l]=b.useState(""),[u,d]=b.useState(null),[p,h]=b.useState(!0),[m,v]=b.useState({}),[x,w]=b.useState(!1);b.useEffect(()=>{Tn().then(A=>{var D,$;const _=(D=A==null?void 0:A.apiKeys)==null?void 0:D.openai;w((_==null?void 0:_.authMode)==="oauth"&&(($=_==null?void 0:_.oauth)==null?void 0:$.connected)===!0)}).catch(()=>{})},[]),b.useEffect(()=>{h(!0),d(null);let A;if(t==="today"){const _=new Date().toISOString().split("T")[0];A={from:_,to:_}}else if(t==="custom"){if(!r||!a){h(!1);return}A={from:r,to:a}}else A=parseInt(t,10);hD(A).then(_=>{d(_),h(!1);const D={};(_.ceremonies||[]).forEach($=>{$.stages&&$.stages.length>0&&(D[$.name]=!0)}),v(D)}).catch(()=>{d({daily:[],ceremonies:[]}),h(!1)})},[t,r,a]),b.useEffect(()=>{const A=_=>{_.key==="Escape"&&e()};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[e]);const S=A=>v(_=>({..._,[A]:!_[A]})),j=(u==null?void 0:u.ceremonies.reduce((A,_)=>A+_.cost,0))??0,k=(u==null?void 0:u.ceremonies.reduce((A,_)=>A+_.tokens,0))??0,C=(u==null?void 0:u.ceremonies.reduce((A,_)=>A+_.calls,0))??0,E=(u==null?void 0:u.ceremonies.reduce((A,_)=>A+(_.saved??0),0))??0,O=(u==null?void 0:u.ceremonies.reduce((A,_)=>A+(_.cached??0),0))??0,P=u&&(u.daily.length>0||u.ceremonies.length>0);return c.jsxs("div",{className:"fixed inset-0 z-[65] flex items-center justify-center p-4",children:[c.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e,"aria-hidden":"true"}),c.jsxs("div",{className:"relative bg-white rounded-xl shadow-2xl w-full max-w-2xl flex flex-col",style:{height:"90vh",maxHeight:"900px"},onClick:A=>A.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-200 flex-shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(h2,{className:"w-5 h-5 text-slate-500"}),c.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"LLM Cost Tracker"})]}),c.jsx("button",{onClick:e,className:"text-slate-400 hover:text-slate-600 transition-colors","aria-label":"Close",children:c.jsx(xn,{className:"w-5 h-5"})})]}),c.jsxs("div",{className:"overflow-y-auto flex-1 px-6 py-4 flex flex-col gap-5",children:[c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[xte.map(A=>c.jsx("button",{onClick:()=>n(String(A.value)),className:`px-3 py-1 rounded text-sm font-medium transition-colors ${t===String(A.value)?"bg-blue-600 text-white":"bg-slate-100 text-slate-600 hover:bg-slate-200"}`,children:A.label},A.value)),c.jsx("button",{onClick:()=>n("custom"),className:`px-3 py-1 rounded text-sm font-medium transition-colors ${t==="custom"?"bg-blue-600 text-white":"bg-slate-100 text-slate-600 hover:bg-slate-200"}`,children:"Custom"})]}),c.jsxs("div",{className:`flex items-center gap-2 ${t!=="custom"?"invisible":""}`,children:[c.jsx("input",{type:"date",value:r,onChange:A=>i(A.target.value),className:"text-sm border border-slate-300 rounded px-2 py-0.5 text-slate-700"}),c.jsx("span",{className:"text-slate-400 text-sm",children:"to"}),c.jsx("input",{type:"date",value:a,onChange:A=>l(A.target.value),className:"text-sm border border-slate-300 rounded px-2 py-0.5 text-slate-700"})]})]}),x&&c.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg px-4 py-3 text-xs text-blue-700 flex items-start gap-2",children:[c.jsx("span",{className:"flex-shrink-0 mt-0.5",children:"ℹ️"}),c.jsxs("span",{children:[c.jsx("strong",{children:"OpenAI OAuth active"})," — API calls made via OAuth (ChatGPT subscription) are not billed per token. No cost is recorded for OpenAI usage in this mode; token counts are still tracked for informational purposes."]})]}),p&&c.jsx("div",{className:"flex-1 flex items-center justify-center",children:c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}),!p&&!P&&c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-slate-400 gap-3",children:[c.jsx(p2,{className:"w-10 h-10"}),c.jsx("p",{className:"text-sm",children:"No usage data for this period."}),c.jsx("p",{className:"text-xs text-slate-300",children:"Run a ceremony to start tracking costs."})]}),!p&&P&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`grid gap-3 ${E>0?"grid-cols-2":"grid-cols-3"}`,children:[c.jsxs("div",{className:"bg-slate-50 rounded-lg p-3",children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Total Cost"}),c.jsx("p",{className:"text-xl font-bold text-slate-900",children:a2(j)}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"this period"})]}),c.jsxs("div",{className:"bg-slate-50 rounded-lg p-3",children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Total Tokens"}),c.jsx("p",{className:"text-xl font-bold text-slate-900",children:ad(k)}),O>0&&c.jsxs("p",{className:"text-xs text-blue-500 mt-0.5",children:[ad(O)," cached"]})]}),c.jsxs("div",{className:"bg-slate-50 rounded-lg p-3",children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"API Calls"}),c.jsx("p",{className:"text-xl font-bold text-slate-900",children:C.toLocaleString()}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"this period"})]}),E>0&&c.jsxs("div",{className:"bg-green-50 rounded-lg p-3",children:[c.jsx("p",{className:"text-xs text-green-600 mb-1",children:"Cache Saved"}),c.jsx("p",{className:"text-xl font-bold text-green-700",children:a2(E)}),c.jsx("p",{className:"text-xs text-green-500 mt-0.5",children:"vs. no cache"})]})]}),u.daily.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2 uppercase tracking-wide",children:"Daily Cost"}),c.jsx(WV,{width:"100%",height:180,children:c.jsxs(vte,{data:u.daily,margin:{top:0,right:0,bottom:0,left:0},children:[c.jsx(F_,{dataKey:"date",tickFormatter:l2,tick:{fontSize:11,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),c.jsx(B_,{tickFormatter:A=>`$${A.toFixed(2)}`,tick:{fontSize:11,fill:"#94a3b8"},width:56,axisLine:!1,tickLine:!1}),c.jsx(RY,{formatter:A=>[`$${A.toFixed(4)}`,"Cost"],labelFormatter:A=>l2(A),contentStyle:{fontSize:12}}),c.jsx($_,{dataKey:"cost",fill:"#3b82f6",radius:[3,3,0,0]})]})})]}),u.ceremonies.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2 uppercase tracking-wide",children:"By Ceremony"}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-left text-xs text-slate-400 border-b border-slate-100",children:[c.jsx("th",{className:"pb-2 font-medium",children:"Ceremony / Stage"}),c.jsx("th",{className:"pb-2 font-medium text-right",children:"Calls"}),c.jsx("th",{className:"pb-2 font-medium text-right",children:"Tokens"}),c.jsx("th",{className:"pb-2 font-medium text-right",children:"Cost"}),c.jsx("th",{className:"pb-2 font-medium pl-4",children:"Share"})]})}),c.jsx("tbody",{children:u.ceremonies.map(A=>{const _=j>0?A.cost/j*100:0,D=A.stages&&A.stages.length>0,$=m[A.name];return[c.jsxs("tr",{className:`border-b border-slate-100 ${D?"cursor-pointer hover:bg-slate-50":""}`,onClick:D?()=>S(A.name):void 0,children:[c.jsx("td",{className:"py-2 text-slate-800 font-semibold",children:c.jsxs("div",{className:"flex items-center gap-1.5",children:[D?$?c.jsx(Hr,{className:"w-3.5 h-3.5 text-slate-400 flex-shrink-0"}):c.jsx(sr,{className:"w-3.5 h-3.5 text-slate-400 flex-shrink-0"}):c.jsx("span",{className:"w-3.5 flex-shrink-0"}),Sv(A.name)]})}),c.jsx("td",{className:"py-2 text-right text-slate-500",children:A.calls}),c.jsx("td",{className:"py-2 text-right text-slate-500",children:ad(A.tokens)}),c.jsx("td",{className:"py-2 text-right text-slate-800 font-semibold",children:o2(A.cost)}),c.jsx("td",{className:"py-2 pl-4",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-20 bg-slate-100 rounded-full h-1.5 flex-shrink-0",children:c.jsx("div",{className:"bg-blue-500 h-1.5 rounded-full",style:{width:`${_}%`}})}),c.jsxs("span",{className:"text-xs text-slate-400",children:[Math.round(_),"%"]})]})})]},A.name),...$&&D?A.stages.map(q=>{const X=A.cost>0?q.cost/A.cost*100:0;return c.jsxs("tr",{className:"border-b border-slate-50 bg-slate-50/50",children:[c.jsx("td",{className:"py-1.5 text-slate-500 pl-7",children:yte(q.name,A.name)}),c.jsx("td",{className:"py-1.5 text-right text-slate-400 text-xs",children:q.calls}),c.jsx("td",{className:"py-1.5 text-right text-slate-400 text-xs",children:ad(q.tokens)}),c.jsx("td",{className:"py-1.5 text-right text-slate-500 text-xs",children:o2(q.cost)}),c.jsx("td",{className:"py-1.5 pl-4",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-20 bg-slate-100 rounded-full h-1 flex-shrink-0",children:c.jsx("div",{className:"bg-blue-300 h-1 rounded-full",style:{width:`${X}%`}})}),c.jsxs("span",{className:"text-[10px] text-slate-300",children:[Math.round(X),"%"]})]})})]},`${A.name}/${q.name}`)}):[]]})})]})})]})]})]})]})]})}function wte(){const[e,t]=b.useState(null),[n,r]=b.useState(null),[i,a]=b.useState(!1),[l,u]=b.useState("AVC Kanban Board"),[d,p]=b.useState("http://localhost:4173"),[h,m]=b.useState(!1),[v,x]=b.useState(""),w=b.useRef(null),[S,j]=b.useState(!1),[k,C]=b.useState(null),[E,O]=b.useState([]),[P,A]=b.useState(null),[_,D]=b.useState(!1),[$,q]=b.useState(null),[X,L]=b.useState(null),[Z,J]=b.useState(null),[ne,re]=b.useState(null),[B,F]=b.useState(null),[G,W]=b.useState({docExists:!1}),[M,V]=b.useState(!1),[ie,fe]=b.useState(null),{workItems:te,loadWorkItems:le,loading:pe,error:Se,setCeremonyActive:H}=jf(),{typeFilters:me,searchQuery:Oe}=Sf(),{isOpen:se,openWizard:$e,resetWizard:De,ceremonyStatus:Je,setCeremonyStatus:et,setCeremonyResult:Mt,setCeremonyError:Mn,appendProgress:bn,appendMissionProgress:wn,setProgressLog:jn,setWizardStep:he,setPaused:ke,setProcessId:Me}=ar(),{isOpen:Ze,openModal:Ct,closeModal:It,reopenModal:Dt,setStep:un,setStatus:Ge,appendProgress:Rt,setProgressLog:In,setResult:da,setError:fa,status:ws,setPaused:Jr,setProcessId:Tr,setDecomposedHierarchy:fr}=xo(),{handleProcessMessage:Ii}=w2(),pr=b.useMemo(()=>{let ee=te.filter(Re=>me[Re.type]);if(Oe.trim()){const Re=Oe.toLowerCase();ee=ee.filter(Ye=>Ye.name.toLowerCase().includes(Re)||Ye.id.toLowerCase().includes(Re)||Ye.description&&Ye.description.toLowerCase().includes(Re)||Ye.epicName&&Ye.epicName.toLowerCase().includes(Re))}return ee},[te,me,Oe]),{wsStatus:dn}=bD({onMessage:ee=>{var Re,Ye,fn,Ri;if(ee.type==="refresh"||ee.type==="work-item-update")le();else if(ee.type==="ceremony:progress")bn({type:"progress",message:ee.message});else if(ee.type==="ceremony:substep")bn({type:"substep",substep:ee.substep,meta:ee.meta});else if(ee.type==="ceremony:detail")bn({type:"detail",detail:ee.detail});else if(ee.type==="ceremony:complete")q(null),L(null),et("complete"),Mt(ee.result),he(7),le(),T1().then(W).catch(()=>{});else if(ee.type==="ceremony:error")et("error"),Mn(ee.error);else if(ee.type==="mission:progress")wn({step:ee.step,message:ee.message});else if(ee.type==="ceremony:cost-limit")q({cost:ee.cost,threshold:ee.threshold,runningType:ee.runningType});else if(ee.type==="ceremony:quota-limit")L({provider:ee.provider,model:ee.model,errMsg:ee.errMsg,validatorName:ee.validatorName,runningType:ee.runningType});else if(ee.type==="cost:update")rm().then(A).catch(()=>{});else if(ee.type==="sprint-planning:progress")Rt({type:"progress",message:ee.message});else if(ee.type==="sprint-planning:substep")Rt({type:"substep",substep:ee.substep,meta:ee.meta});else if(ee.type==="sprint-planning:detail")Rt({type:"detail",detail:ee.detail});else if(ee.type==="sprint-planning:decomposition-complete")fr(ee.hierarchy),Ge("awaiting-selection"),un(3);else if(ee.type==="sprint-planning:complete")q(null),L(null),Ge("complete"),da(ee.result),fr(null),un(4),H(!1),le();else if(ee.type==="sprint-planning:error")Ge("error"),fa(ee.error),H(!1);else if(ee.type==="sprint-planning:paused")Jr(!0);else if(ee.type==="sprint-planning:resumed")Jr(!1);else if(ee.type==="sprint-planning:cancelled")q(null),L(null),Ge("idle"),un(1),Jr(!1),fr(null),H(!1);else if(ee.type==="ceremony:paused")ke(!0);else if(ee.type==="ceremony:resumed")ke(!1);else if(ee.type==="ceremony:cancelled")q(null),L(null),et("idle"),he(1),ke(!1);else if((Re=ee.type)!=null&&Re.startsWith("seed:")||(Ye=ee.type)!=null&&Ye.startsWith("run-task:"))window.dispatchEvent(new CustomEvent("avc-ws-message",{detail:ee})),(ee.type.endsWith(":complete")||ee.type.endsWith(":error"))&&le();else if(ee.type==="refresh")le();else if(ee.type==="refine:progress")J({itemId:ee.itemId,jobId:ee.jobId,message:ee.message});else if(ee.type==="refine:complete")J(null),re({itemId:ee.itemId,jobId:ee.jobId,result:ee.result});else if(ee.type==="refine:error")J(null),F({itemId:ee.itemId,jobId:ee.jobId,error:ee.error});else if(ee.type==="process:started")Ii(ee),ee.processType==="sprint-planning"?(Tr(ee.processId),H(!0)):ee.processType==="sponsor-call"&&Me(ee.processId);else if(ee.type==="process:list"||ee.type==="process:status")Ii(ee);else if(ee.type==="ceremony:sync"){const Fe=ee.ceremonyStatus;((Fe==null?void 0:Fe.status)==="running"||(Fe==null?void 0:Fe.status)==="cost-limit-pending"||(Fe==null?void 0:Fe.status)==="quota-limit-pending"||(Fe==null?void 0:Fe.status)==="awaiting-selection")&&(Fe.runningType==="sprint-planning"?(H(!0),Fe.status==="awaiting-selection"?(Ge("awaiting-selection"),fr(Fe.decomposedHierarchy||null),un(3)):Ge("running"),Fe.processId&&Tr(Fe.processId),(fn=Fe.progress)!=null&&fn.length&&In(Fe.progress)):Fe.runningType==="sponsor-call"&&(et("running"),Fe.processId&&Me(Fe.processId),(Ri=Fe.progress)!=null&&Ri.length&&jn(Fe.progress)),Fe.status==="cost-limit-pending"&&Fe.costLimitInfo&&q({...Fe.costLimitInfo,runningType:Fe.runningType}),Fe.status==="quota-limit-pending"&&Fe.quotaLimitInfo&&L({...Fe.quotaLimitInfo,runningType:Fe.runningType}))}}});b.useEffect(()=>{(async()=>{var Re,Ye;try{const[fn,Ri,Fe,gp,Be]=await Promise.all([N3(),E1(),E3(),T1(),L3().catch(()=>null)]);t(fn),u(Ri),p(Fe),W(gp),((Be==null?void 0:Be.status)==="running"||(Be==null?void 0:Be.status)==="cost-limit-pending"||(Be==null?void 0:Be.status)==="quota-limit-pending"||(Be==null?void 0:Be.status)==="awaiting-selection")&&(Be.runningType==="sprint-planning"?(Be.status==="awaiting-selection"?(Ge("awaiting-selection"),fr(Be.decomposedHierarchy||null),un(3)):Ge("running"),Be.processId&&Tr(Be.processId),(Re=Be.progress)!=null&&Re.length&&In(Be.progress)):Be.runningType==="sponsor-call"&&(et("running"),Be.processId&&Me(Be.processId),(Ye=Be.progress)!=null&&Ye.length&&jn(Be.progress)),Be.status==="cost-limit-pending"&&Be.costLimitInfo&&q({...Be.costLimitInfo,runningType:Be.runningType}),Be.status==="quota-limit-pending"&&Be.quotaLimitInfo&&L({...Be.quotaLimitInfo,runningType:Be.runningType})),V(!0),await le()}catch(fn){console.error("Initialization error:",fn)}})()},[le]),b.useEffect(()=>{var ee,Re;h&&((ee=w.current)==null||ee.focus(),(Re=w.current)==null||Re.select())},[h]),b.useEffect(()=>{rm().then(A).catch(()=>{});const ee=setInterval(()=>rm().then(A).catch(()=>{}),6e4);return()=>clearInterval(ee)},[]);const hr=()=>{x(l),m(!0)},Zr=()=>{m(!1),x("")},Di=async()=>{const ee=v.trim();if(!ee||ee===l){Zr();return}try{await T3(ee),u(ee)}catch(Re){console.error("Failed to save title:",Re)}m(!1),x("")},pa=ee=>{ee.key==="Enter"&&Di(),ee.key==="Escape"&&Zr()},[ha,js]=b.useState("api-keys"),ei=async(ee="api-keys")=>{try{const[Re,Ye]=await Promise.all([Tn(),ds()]);C(Re),O(Ye),js(ee),j(!0)}catch(Re){console.error("Failed to load settings:",Re)}},Ss=async()=>{try{const ee=await Tn();C(ee);const Re=await E1();u(Re),document.dispatchEvent(new CustomEvent("avc:settings-saved"))}catch(ee){console.error("Failed to refresh settings:",ee)}},mr=ee=>{r(ee),a(!0)},de=ee=>{if(!n||pr.length===0)return;const Re=pr.findIndex(fn=>fn.id===n.id);if(Re===-1)return;let Ye;ee==="prev"?Ye=Re>0?Re-1:pr.length-1:Ye=Re<pr.length-1?Re+1:0,r(pr[Ye])},_e=()=>{a(!1),setTimeout(()=>r(null),200)};return pe&&!e?c.jsx("div",{className:"flex items-center justify-center min-h-screen bg-slate-50",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),c.jsxs("p",{className:"text-slate-600",children:["Loading ",l,"..."]})]})}):Se&&!e?c.jsx("div",{className:"flex items-center justify-center min-h-screen bg-slate-50",children:c.jsxs("div",{className:"text-center max-w-md p-6 bg-white rounded-lg shadow-md",children:[c.jsx("div",{className:"text-red-600 text-5xl mb-4",children:"⚠️"}),c.jsx("h2",{className:"text-xl font-semibold text-slate-900 mb-2",children:"Connection Error"}),c.jsx("p",{className:"text-slate-600 mb-4",children:Se}),c.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors",children:"Retry"})]})}):c.jsxs("div",{className:"min-h-screen bg-slate-50 flex flex-col",children:[c.jsx("header",{className:"bg-white border-b border-slate-200 shadow-sm flex-shrink-0",children:c.jsx("div",{className:"max-w-full px-4 sm:px-6 lg:px-8 py-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[h?c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:w,value:v,onChange:ee=>x(ee.target.value),onKeyDown:pa,className:"text-2xl font-bold text-slate-900 bg-transparent border-b-2 border-blue-500 outline-none min-w-0 w-72"}),c.jsx("button",{onClick:Di,className:"text-green-600 hover:text-green-700 transition-colors",title:"Save",children:c.jsx($l,{className:"w-5 h-5"})}),c.jsx("button",{onClick:Zr,className:"text-slate-400 hover:text-slate-600 transition-colors",title:"Cancel",children:c.jsx(xn,{className:"w-5 h-5"})})]}):c.jsxs("button",{onClick:hr,className:"group flex items-center gap-2 text-left",title:"Click to edit board title",children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900 group-hover:text-slate-700 transition-colors",children:l}),c.jsx(ac,{className:"w-4 h-4 text-slate-300 group-hover:text-slate-500 transition-colors flex-shrink-0"})]}),c.jsx("p",{className:"text-sm text-slate-600 mt-1",children:(e==null?void 0:e.projectRoot)||"Loading..."})]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:`w-2 h-2 rounded-full ${dn==="connected"?"bg-green-500 animate-pulse":dn==="connecting"?"bg-amber-400 animate-pulse":"bg-slate-400"}`}),c.jsx("span",{className:"text-sm text-slate-500",children:dn==="connected"?"Live updates":dn==="connecting"?"Connecting...":"No live updates"})]}),P!=null&&c.jsxs("button",{onClick:()=>D(!0),className:"flex items-center gap-1 text-xs text-slate-500 hover:text-slate-700 border border-slate-200 rounded px-2 py-0.5 hover:border-slate-300 transition-colors",title:"LLM cost this month — click for details",children:[c.jsx(h2,{className:"w-3 h-3"}),P.totalCost<.01&&P.totalCost>0?"< 0.01":P.totalCost.toFixed(2),c.jsx("span",{className:"text-slate-400",children:"/mo"})]}),c.jsxs("button",{onClick:()=>ei(),className:"flex items-center gap-1.5 text-sm text-slate-500 hover:text-slate-800 transition-colors",title:"Project settings",children:[c.jsx(to,{className:"w-4 h-4"}),"Settings"]}),c.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-sm text-slate-500 hover:text-slate-800 transition-colors",title:"Open project documentation",children:[c.jsx(f2,{className:"w-4 h-4"}),"Project Documentation"]})]})]})})}),c.jsx(q6,{}),c.jsx(H6,{}),c.jsx("main",{className:"flex-1 overflow-hidden",children:c.jsx("div",{className:"h-full px-4 sm:px-6 lg:px-8 py-6",children:c.jsx(B6,{onCardClick:mr,projectFilesReady:G.docExists,onStartProject:M&&!G.docExists&&Je!=="running"?()=>{De(),$e()}:void 0,onEditProjectDoc:()=>fe("doc"),onStartSprintPlanning:M&&G.docExists&&ws!=="running"&&ws!=="awaiting-selection"&&Je!=="running"?Ct:void 0,onOpenSprintPlanningSelection:ws==="awaiting-selection"?Dt:void 0,sponsorCallRunning:Je==="running"})})}),c.jsx("footer",{className:"bg-white border-t border-slate-200 py-4 text-center text-sm text-slate-500 flex-shrink-0",children:"Agile Vibe Coding"}),c.jsx(cz,{workItem:n,open:i,onOpenChange:_e,onNavigate:de,onItemClick:mr,allItems:te,refineProgress:Z,refineResult:ne,refineError:B,onClearRefine:()=>{re(null),F(null),J(null)}}),se&&c.jsx(uF,{onOpenSettings:ei,costLimitPending:($==null?void 0:$.runningType)==="sponsor-call"?$:null,onContinuePastCostLimit:async()=>{try{await I1(),q(null)}catch{}},onCancelFromCostLimit:async()=>{try{await Qa(),q(null)}catch{}}}),Ze&&c.jsx(bF,{onClose:It,costLimitPending:($==null?void 0:$.runningType)==="sprint-planning"?$:null,onContinuePastCostLimit:async()=>{try{await I1(),q(null)}catch{}},onCancelFromCostLimit:async()=>{try{await Qa(),q(null)}catch{}},quotaLimitPending:(X==null?void 0:X.runningType)==="sprint-planning"?X:null,onContinueAfterQuota:async(ee,Re)=>{try{await W3(ee,Re),L(null)}catch{}},onCancelFromQuota:async()=>{try{await Qa(),L(null)}catch{}}}),c.jsx(jF,{}),S&&k&&c.jsx(WF,{settings:k,models:E,onClose:()=>j(!1),onSaved:Ss,initialTab:ha}),_&&c.jsx(bte,{onClose:()=>D(!1)}),ie&&c.jsx(U6,{fileType:ie,onClose:()=>fe(null)})]})}e3.createRoot(document.getElementById("root")).render(c.jsx(Va.StrictMode,{children:c.jsx(wte,{})}));