siclaw 0.1.0 → 0.1.2

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 (270) hide show
  1. package/README.md +75 -114
  2. package/dist/agentbox/gateway-client.d.ts +2 -1
  3. package/dist/agentbox/gateway-client.js +6 -2
  4. package/dist/agentbox/gateway-client.js.map +1 -1
  5. package/dist/agentbox/http-server.js +184 -19
  6. package/dist/agentbox/http-server.js.map +1 -1
  7. package/dist/agentbox/resource-handlers.d.ts +1 -0
  8. package/dist/agentbox/resource-handlers.js +23 -23
  9. package/dist/agentbox/resource-handlers.js.map +1 -1
  10. package/dist/agentbox/session.js +85 -5
  11. package/dist/agentbox/session.js.map +1 -1
  12. package/dist/agentbox-main.d.ts +2 -1
  13. package/dist/agentbox-main.js +65 -18
  14. package/dist/agentbox-main.js.map +1 -1
  15. package/dist/cli-credentials.d.ts +1 -0
  16. package/dist/cli-credentials.js +109 -0
  17. package/dist/cli-credentials.js.map +1 -0
  18. package/dist/cli-first-run.d.ts +11 -0
  19. package/dist/cli-first-run.js +99 -0
  20. package/dist/cli-first-run.js.map +1 -0
  21. package/dist/cli-main.js +33 -11
  22. package/dist/cli-main.js.map +1 -1
  23. package/dist/cli-setup.d.ts +5 -11
  24. package/dist/cli-setup.js +12 -225
  25. package/dist/cli-setup.js.map +1 -1
  26. package/dist/core/agent-factory.d.ts +4 -0
  27. package/dist/core/agent-factory.js +102 -151
  28. package/dist/core/agent-factory.js.map +1 -1
  29. package/dist/core/config.d.ts +10 -3
  30. package/dist/core/config.js +11 -95
  31. package/dist/core/config.js.map +1 -1
  32. package/dist/core/extensions/deep-investigation.d.ts +2 -1
  33. package/dist/core/extensions/deep-investigation.js +144 -24
  34. package/dist/core/extensions/deep-investigation.js.map +1 -1
  35. package/dist/core/extensions/setup.d.ts +8 -0
  36. package/dist/core/extensions/setup.js +669 -0
  37. package/dist/core/extensions/setup.js.map +1 -0
  38. package/dist/core/llm-proxy.js +7 -3
  39. package/dist/core/llm-proxy.js.map +1 -1
  40. package/dist/core/mcp-client.d.ts +0 -10
  41. package/dist/core/mcp-client.js +0 -65
  42. package/dist/core/mcp-client.js.map +1 -1
  43. package/dist/core/prompt.d.ts +1 -1
  44. package/dist/core/prompt.js +42 -5
  45. package/dist/core/prompt.js.map +1 -1
  46. package/dist/core/provider-presets.d.ts +14 -0
  47. package/dist/core/provider-presets.js +81 -0
  48. package/dist/core/provider-presets.js.map +1 -0
  49. package/dist/cron/cron-coordinator.d.ts +2 -0
  50. package/dist/cron/cron-coordinator.js +46 -14
  51. package/dist/cron/cron-coordinator.js.map +1 -1
  52. package/dist/cron/cron-executor.js +33 -8
  53. package/dist/cron/cron-executor.js.map +1 -1
  54. package/dist/cron/cron-scheduler.d.ts +1 -1
  55. package/dist/cron/gateway-client.d.ts +5 -0
  56. package/dist/cron/gateway-client.js +43 -8
  57. package/dist/cron/gateway-client.js.map +1 -1
  58. package/dist/cron-main.js +39 -9
  59. package/dist/cron-main.js.map +1 -1
  60. package/dist/gateway/agentbox/client.d.ts +11 -0
  61. package/dist/gateway/agentbox/client.js +18 -0
  62. package/dist/gateway/agentbox/client.js.map +1 -1
  63. package/dist/gateway/agentbox/k8s-spawner.d.ts +11 -2
  64. package/dist/gateway/agentbox/k8s-spawner.js +95 -52
  65. package/dist/gateway/agentbox/k8s-spawner.js.map +1 -1
  66. package/dist/gateway/agentbox/local-spawner.d.ts +1 -1
  67. package/dist/gateway/agentbox/local-spawner.js +4 -2
  68. package/dist/gateway/agentbox/local-spawner.js.map +1 -1
  69. package/dist/gateway/agentbox/manager.d.ts +0 -10
  70. package/dist/gateway/agentbox/manager.js +11 -30
  71. package/dist/gateway/agentbox/manager.js.map +1 -1
  72. package/dist/gateway/agentbox/types.d.ts +6 -4
  73. package/dist/gateway/cron/cron-service.d.ts +49 -0
  74. package/dist/gateway/cron/cron-service.js +259 -0
  75. package/dist/gateway/cron/cron-service.js.map +1 -0
  76. package/dist/gateway/db/init-schema.js +44 -0
  77. package/dist/gateway/db/init-schema.js.map +1 -1
  78. package/dist/gateway/db/migrate-sqlite.js +73 -4
  79. package/dist/gateway/db/migrate-sqlite.js.map +1 -1
  80. package/dist/gateway/db/repositories/chat-repo.d.ts +56 -2
  81. package/dist/gateway/db/repositories/chat-repo.js +132 -2
  82. package/dist/gateway/db/repositories/chat-repo.js.map +1 -1
  83. package/dist/gateway/db/repositories/config-repo.d.ts +31 -2
  84. package/dist/gateway/db/repositories/config-repo.js +57 -7
  85. package/dist/gateway/db/repositories/config-repo.js.map +1 -1
  86. package/dist/gateway/db/repositories/env-repo.d.ts +14 -0
  87. package/dist/gateway/db/repositories/env-repo.js +15 -2
  88. package/dist/gateway/db/repositories/env-repo.js.map +1 -1
  89. package/dist/gateway/db/repositories/model-config-repo.d.ts +1 -1
  90. package/dist/gateway/db/repositories/model-config-repo.js +26 -12
  91. package/dist/gateway/db/repositories/model-config-repo.js.map +1 -1
  92. package/dist/gateway/db/repositories/skill-repo.d.ts +0 -5
  93. package/dist/gateway/db/repositories/skill-review-repo.d.ts +1 -0
  94. package/dist/gateway/db/repositories/skill-review-repo.js +4 -1
  95. package/dist/gateway/db/repositories/skill-review-repo.js.map +1 -1
  96. package/dist/gateway/db/repositories/skill-version-repo.js +0 -1
  97. package/dist/gateway/db/repositories/skill-version-repo.js.map +1 -1
  98. package/dist/gateway/db/repositories/system-config-repo.d.ts +1 -1
  99. package/dist/gateway/db/repositories/system-config-repo.js +2 -1
  100. package/dist/gateway/db/repositories/system-config-repo.js.map +1 -1
  101. package/dist/gateway/db/repositories/user-env-config-repo.d.ts +13 -0
  102. package/dist/gateway/db/repositories/user-env-config-repo.js +11 -0
  103. package/dist/gateway/db/repositories/user-env-config-repo.js.map +1 -1
  104. package/dist/gateway/db/repositories/workspace-repo.d.ts +3 -2
  105. package/dist/gateway/db/repositories/workspace-repo.js +6 -2
  106. package/dist/gateway/db/repositories/workspace-repo.js.map +1 -1
  107. package/dist/gateway/db/schema-mysql.d.ts +473 -51
  108. package/dist/gateway/db/schema-mysql.js +35 -4
  109. package/dist/gateway/db/schema-mysql.js.map +1 -1
  110. package/dist/gateway/db/schema-sqlite.d.ts +522 -57
  111. package/dist/gateway/db/schema-sqlite.js +38 -6
  112. package/dist/gateway/db/schema-sqlite.js.map +1 -1
  113. package/dist/gateway/db/schema.d.ts +471 -51
  114. package/dist/gateway/db/schema.js +1 -1
  115. package/dist/gateway/db/schema.js.map +1 -1
  116. package/dist/gateway/metrics-aggregator.d.ts +65 -0
  117. package/dist/gateway/metrics-aggregator.js +244 -0
  118. package/dist/gateway/metrics-aggregator.js.map +1 -0
  119. package/dist/gateway/plugins/channel-bridge.d.ts +4 -1
  120. package/dist/gateway/plugins/channel-bridge.js +78 -86
  121. package/dist/gateway/plugins/channel-bridge.js.map +1 -1
  122. package/dist/gateway/rpc-methods.d.ts +4 -2
  123. package/dist/gateway/rpc-methods.js +962 -163
  124. package/dist/gateway/rpc-methods.js.map +1 -1
  125. package/dist/gateway/security/cert-manager.d.ts +2 -2
  126. package/dist/gateway/security/cert-manager.js +4 -2
  127. package/dist/gateway/security/cert-manager.js.map +1 -1
  128. package/dist/gateway/server.d.ts +4 -8
  129. package/dist/gateway/server.js +297 -261
  130. package/dist/gateway/server.js.map +1 -1
  131. package/dist/gateway/skills/file-writer.js +17 -11
  132. package/dist/gateway/skills/file-writer.js.map +1 -1
  133. package/dist/gateway/skills/script-evaluator.js +12 -9
  134. package/dist/gateway/skills/script-evaluator.js.map +1 -1
  135. package/dist/gateway/web/dist/assets/index-0p17ZeTP.js +740 -0
  136. package/dist/gateway/web/dist/assets/index-9eP6nPUq.js +741 -0
  137. package/dist/gateway/web/dist/assets/index-9eP6nPUq.js.map +1 -0
  138. package/dist/gateway/web/dist/assets/index-CAmSY91d.js +675 -0
  139. package/dist/gateway/web/dist/assets/index-DMFEh8Pp.css +1 -0
  140. package/dist/gateway/web/dist/assets/index-DyowBCEj.css +1 -0
  141. package/dist/gateway/web/dist/assets/index-PDK5JJDO.css +1 -0
  142. package/dist/gateway/web/dist/index.html +2 -2
  143. package/dist/gateway-main.js +27 -10
  144. package/dist/gateway-main.js.map +1 -1
  145. package/dist/memory/embeddings.js +5 -4
  146. package/dist/memory/embeddings.js.map +1 -1
  147. package/dist/memory/indexer.d.ts +23 -3
  148. package/dist/memory/indexer.js +235 -23
  149. package/dist/memory/indexer.js.map +1 -1
  150. package/dist/memory/schema.js +15 -1
  151. package/dist/memory/schema.js.map +1 -1
  152. package/dist/memory/types.d.ts +18 -0
  153. package/dist/memory/types.js +6 -1
  154. package/dist/memory/types.js.map +1 -1
  155. package/dist/shared/detect-language.d.ts +12 -0
  156. package/dist/shared/detect-language.js +78 -0
  157. package/dist/shared/detect-language.js.map +1 -0
  158. package/dist/shared/diagnostic-events.d.ts +70 -0
  159. package/dist/shared/diagnostic-events.js +38 -0
  160. package/dist/shared/diagnostic-events.js.map +1 -0
  161. package/dist/shared/local-collector.d.ts +56 -0
  162. package/dist/shared/local-collector.js +284 -0
  163. package/dist/shared/local-collector.js.map +1 -0
  164. package/dist/shared/metrics-types.d.ts +64 -0
  165. package/dist/shared/metrics-types.js +25 -0
  166. package/dist/shared/metrics-types.js.map +1 -0
  167. package/dist/shared/metrics.d.ts +19 -0
  168. package/dist/shared/metrics.js +185 -0
  169. package/dist/shared/metrics.js.map +1 -0
  170. package/dist/shared/path-utils.d.ts +15 -0
  171. package/dist/shared/path-utils.js +23 -0
  172. package/dist/shared/path-utils.js.map +1 -0
  173. package/dist/shared/retry.d.ts +35 -0
  174. package/dist/shared/retry.js +61 -0
  175. package/dist/shared/retry.js.map +1 -0
  176. package/dist/tools/command-sets.d.ts +18 -2
  177. package/dist/tools/command-sets.js +207 -32
  178. package/dist/tools/command-sets.js.map +1 -1
  179. package/dist/tools/command-validator.d.ts +56 -0
  180. package/dist/tools/command-validator.js +357 -0
  181. package/dist/tools/command-validator.js.map +1 -0
  182. package/dist/tools/create-skill.js +26 -1
  183. package/dist/tools/create-skill.js.map +1 -1
  184. package/dist/tools/credential-list.js +1 -23
  185. package/dist/tools/credential-list.js.map +1 -1
  186. package/dist/tools/credential-manager.d.ts +98 -0
  187. package/dist/tools/credential-manager.js +313 -0
  188. package/dist/tools/credential-manager.js.map +1 -0
  189. package/dist/tools/deep-search/engine.js +184 -127
  190. package/dist/tools/deep-search/engine.js.map +1 -1
  191. package/dist/tools/deep-search/prompts.d.ts +10 -2
  192. package/dist/tools/deep-search/prompts.js +37 -36
  193. package/dist/tools/deep-search/prompts.js.map +1 -1
  194. package/dist/tools/deep-search/schemas.d.ts +87 -0
  195. package/dist/tools/deep-search/schemas.js +85 -0
  196. package/dist/tools/deep-search/schemas.js.map +1 -0
  197. package/dist/tools/deep-search/sub-agent.d.ts +21 -0
  198. package/dist/tools/deep-search/sub-agent.js +153 -4
  199. package/dist/tools/deep-search/sub-agent.js.map +1 -1
  200. package/dist/tools/deep-search/tool.js +1 -0
  201. package/dist/tools/deep-search/tool.js.map +1 -1
  202. package/dist/tools/deep-search/types.d.ts +2 -0
  203. package/dist/tools/deep-search/types.js.map +1 -1
  204. package/dist/tools/dp-tools.js +29 -5
  205. package/dist/tools/dp-tools.js.map +1 -1
  206. package/dist/tools/exec-utils.d.ts +85 -0
  207. package/dist/tools/exec-utils.js +294 -0
  208. package/dist/tools/exec-utils.js.map +1 -0
  209. package/dist/tools/fork-skill.js +14 -2
  210. package/dist/tools/fork-skill.js.map +1 -1
  211. package/dist/tools/investigation-feedback.d.ts +3 -0
  212. package/dist/tools/investigation-feedback.js +71 -0
  213. package/dist/tools/investigation-feedback.js.map +1 -0
  214. package/dist/tools/manage-schedule.js +16 -6
  215. package/dist/tools/manage-schedule.js.map +1 -1
  216. package/dist/tools/netns-script.js +27 -281
  217. package/dist/tools/netns-script.js.map +1 -1
  218. package/dist/tools/node-exec.d.ts +2 -14
  219. package/dist/tools/node-exec.js +18 -225
  220. package/dist/tools/node-exec.js.map +1 -1
  221. package/dist/tools/node-script.js +14 -168
  222. package/dist/tools/node-script.js.map +1 -1
  223. package/dist/tools/pod-exec.d.ts +1 -1
  224. package/dist/tools/pod-exec.js +10 -26
  225. package/dist/tools/pod-exec.js.map +1 -1
  226. package/dist/tools/pod-nsenter-exec.js +21 -225
  227. package/dist/tools/pod-nsenter-exec.js.map +1 -1
  228. package/dist/tools/pod-script.js +10 -19
  229. package/dist/tools/pod-script.js.map +1 -1
  230. package/dist/tools/restricted-bash.d.ts +1 -17
  231. package/dist/tools/restricted-bash.js +38 -252
  232. package/dist/tools/restricted-bash.js.map +1 -1
  233. package/dist/tools/run-skill.d.ts +3 -1
  234. package/dist/tools/run-skill.js +21 -1
  235. package/dist/tools/run-skill.js.map +1 -1
  236. package/dist/tools/script-resolver.d.ts +3 -1
  237. package/dist/tools/script-resolver.js +74 -30
  238. package/dist/tools/script-resolver.js.map +1 -1
  239. package/dist/tools/update-skill.js +17 -6
  240. package/dist/tools/update-skill.js.map +1 -1
  241. package/package.json +8 -6
  242. package/siclaw.mjs +10 -1
  243. package/skills/core/cluster-events/SKILL.md +1 -1
  244. package/skills/core/deep-investigation/SKILL.md +11 -0
  245. package/skills/core/deployment-rollout-debug/SKILL.md +1 -1
  246. package/skills/core/dns-debug/SKILL.md +1 -0
  247. package/skills/core/meta.json +12 -1
  248. package/skills/core/networkpolicy-debug/SKILL.md +332 -0
  249. package/skills/core/node-logs/scripts/get-node-logs.sh +19 -9
  250. package/skills/core/pod-pending-debug/SKILL.md +1 -0
  251. package/skills/core/quota-debug/SKILL.md +203 -0
  252. package/skills/core/service-debug/SKILL.md +1 -0
  253. package/skills/core/statefulset-debug/SKILL.md +280 -0
  254. package/skills/core/volcano-diagnose-pod/SKILL.md +196 -0
  255. package/skills/core/volcano-diagnose-pod/scripts/diagnose-pod.sh +175 -0
  256. package/skills/core/volcano-gang-scheduling/SKILL.md +299 -0
  257. package/skills/core/volcano-job-diagnose/SKILL.md +319 -0
  258. package/skills/core/volcano-job-diagnose/scripts/diagnose-job.sh +253 -0
  259. package/skills/core/volcano-node-resources/SKILL.md +334 -0
  260. package/skills/core/volcano-node-resources/scripts/get-node-resources.sh +281 -0
  261. package/skills/core/volcano-queue-diagnose/SKILL.md +294 -0
  262. package/skills/core/volcano-queue-diagnose/scripts/diagnose-queue.sh +283 -0
  263. package/skills/core/volcano-resource-insufficient/SKILL.md +315 -0
  264. package/skills/core/volcano-scheduler-config/SKILL.md +371 -0
  265. package/skills/core/volcano-scheduler-config/scripts/get-scheduler-config.sh +297 -0
  266. package/skills/core/volcano-scheduler-logs/SKILL.md +241 -0
  267. package/skills/core/volcano-scheduler-logs/scripts/get-scheduler-logs.sh +159 -0
  268. package/skills/platform/create-skill/SKILL.md +35 -3
  269. package/skills/platform/manage-skill/SKILL.md +9 -2
  270. package/skills/platform/update-skill/SKILL.md +17 -6
@@ -0,0 +1,740 @@
1
+ var A6=Object.defineProperty;var T6=(e,t,n)=>t in e?A6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Rg=(e,t,n)=>T6(e,typeof t!="symbol"?t+"":t,n);function dA(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 s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).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)}})();var Mn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fA={exports:{}},im={},hA={exports:{}},Ge={};/**
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 pd=Symbol.for("react.element"),O6=Symbol.for("react.portal"),_6=Symbol.for("react.fragment"),M6=Symbol.for("react.strict_mode"),D6=Symbol.for("react.profiler"),I6=Symbol.for("react.provider"),L6=Symbol.for("react.context"),R6=Symbol.for("react.forward_ref"),F6=Symbol.for("react.suspense"),z6=Symbol.for("react.memo"),$6=Symbol.for("react.lazy"),fk=Symbol.iterator;function B6(e){return e===null||typeof e!="object"?null:(e=fk&&e[fk]||e["@@iterator"],typeof e=="function"?e:null)}var pA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},mA=Object.assign,gA={};function ql(e,t,n){this.props=e,this.context=t,this.refs=gA,this.updater=n||pA}ql.prototype.isReactComponent={};ql.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};ql.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function yA(){}yA.prototype=ql.prototype;function nb(e,t,n){this.props=e,this.context=t,this.refs=gA,this.updater=n||pA}var rb=nb.prototype=new yA;rb.constructor=nb;mA(rb,ql.prototype);rb.isPureReactComponent=!0;var hk=Array.isArray,xA=Object.prototype.hasOwnProperty,ib={current:null},vA={key:!0,ref:!0,__self:!0,__source:!0};function bA(e,t,n){var r,i={},a=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(a=""+t.key),t)xA.call(t,r)&&!vA.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:pd,type:e,key:a,ref:s,props:i,_owner:ib.current}}function U6(e,t){return{$$typeof:pd,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ab(e){return typeof e=="object"&&e!==null&&e.$$typeof===pd}function V6(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var pk=/\/+/g;function Fg(e,t){return typeof e=="object"&&e!==null&&e.key!=null?V6(""+e.key):t.toString(36)}function Zf(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case pd:case O6:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+Fg(s,0):r,hk(i)?(n="",e!=null&&(n=e.replace(pk,"$&/")+"/"),Zf(i,t,n,"",function(u){return u})):i!=null&&(ab(i)&&(i=U6(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(pk,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",hk(e))for(var o=0;o<e.length;o++){a=e[o];var c=r+Fg(a,o);s+=Zf(a,t,n,c,i)}else if(c=B6(e),typeof c=="function")for(e=c.call(e),o=0;!(a=e.next()).done;)a=a.value,c=r+Fg(a,o++),s+=Zf(a,t,n,c,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function tf(e,t,n){if(e==null)return e;var r=[],i=0;return Zf(e,r,"","",function(a){return t.call(n,a,i++)}),r}function W6(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Gn={current:null},Qf={transition:null},H6={ReactCurrentDispatcher:Gn,ReactCurrentBatchConfig:Qf,ReactCurrentOwner:ib};function wA(){throw Error("act(...) is not supported in production builds of React.")}Ge.Children={map:tf,forEach:function(e,t,n){tf(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return tf(e,function(){t++}),t},toArray:function(e){return tf(e,function(t){return t})||[]},only:function(e){if(!ab(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ge.Component=ql;Ge.Fragment=_6;Ge.Profiler=D6;Ge.PureComponent=nb;Ge.StrictMode=M6;Ge.Suspense=F6;Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H6;Ge.act=wA;Ge.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=mA({},e.props),i=e.key,a=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,s=ib.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)xA.call(t,c)&&!vA.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:pd,type:e.type,key:i,ref:a,props:r,_owner:s}};Ge.createContext=function(e){return e={$$typeof:L6,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:I6,_context:e},e.Consumer=e};Ge.createElement=bA;Ge.createFactory=function(e){var t=bA.bind(null,e);return t.type=e,t};Ge.createRef=function(){return{current:null}};Ge.forwardRef=function(e){return{$$typeof:R6,render:e}};Ge.isValidElement=ab;Ge.lazy=function(e){return{$$typeof:$6,_payload:{_status:-1,_result:e},_init:W6}};Ge.memo=function(e,t){return{$$typeof:z6,type:e,compare:t===void 0?null:t}};Ge.startTransition=function(e){var t=Qf.transition;Qf.transition={};try{e()}finally{Qf.transition=t}};Ge.unstable_act=wA;Ge.useCallback=function(e,t){return Gn.current.useCallback(e,t)};Ge.useContext=function(e){return Gn.current.useContext(e)};Ge.useDebugValue=function(){};Ge.useDeferredValue=function(e){return Gn.current.useDeferredValue(e)};Ge.useEffect=function(e,t){return Gn.current.useEffect(e,t)};Ge.useId=function(){return Gn.current.useId()};Ge.useImperativeHandle=function(e,t,n){return Gn.current.useImperativeHandle(e,t,n)};Ge.useInsertionEffect=function(e,t){return Gn.current.useInsertionEffect(e,t)};Ge.useLayoutEffect=function(e,t){return Gn.current.useLayoutEffect(e,t)};Ge.useMemo=function(e,t){return Gn.current.useMemo(e,t)};Ge.useReducer=function(e,t,n){return Gn.current.useReducer(e,t,n)};Ge.useRef=function(e){return Gn.current.useRef(e)};Ge.useState=function(e){return Gn.current.useState(e)};Ge.useSyncExternalStore=function(e,t,n){return Gn.current.useSyncExternalStore(e,t,n)};Ge.useTransition=function(){return Gn.current.useTransition()};Ge.version="18.3.1";hA.exports=Ge;var m=hA.exports;const K6=hi(m),SA=dA({__proto__:null,default:K6},[m]);/**
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 G6=m,q6=Symbol.for("react.element"),Y6=Symbol.for("react.fragment"),X6=Object.prototype.hasOwnProperty,Z6=G6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Q6={key:!0,ref:!0,__self:!0,__source:!0};function kA(e,t,n){var r,i={},a=null,s=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)X6.call(t,r)&&!Q6.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:q6,type:e,key:a,ref:s,props:i,_owner:Z6.current}}im.Fragment=Y6;im.jsx=kA;im.jsxs=kA;fA.exports=im;var l=fA.exports,Ny={},jA={exports:{}},Cr={},NA={exports:{}},CA={};/**
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
+ */(function(e){function t(D,K){var T=D.length;D.push(K);e:for(;0<T;){var ie=T-1>>>1,J=D[ie];if(0<i(J,K))D[ie]=K,D[T]=J,T=ie;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var K=D[0],T=D.pop();if(T!==K){D[0]=T;e:for(var ie=0,J=D.length,_=J>>>1;ie<_;){var H=2*(ie+1)-1,ee=D[H],be=H+1,te=D[be];if(0>i(ee,T))be<J&&0>i(te,ee)?(D[ie]=te,D[be]=T,ie=be):(D[ie]=ee,D[H]=T,ie=H);else if(be<J&&0>i(te,T))D[ie]=te,D[be]=T,ie=be;else break e}}return K}function i(D,K){var T=D.sortIndex-K.sortIndex;return T!==0?T:D.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var c=[],u=[],d=1,f=null,h=3,p=!1,g=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(D){for(var K=n(u);K!==null;){if(K.callback===null)r(u);else if(K.startTime<=D)r(u),K.sortIndex=K.expirationTime,t(c,K);else break;K=n(u)}}function k(D){if(y=!1,w(D),!g)if(n(c)!==null)g=!0,se(S);else{var K=n(u);K!==null&&Q(k,K.startTime-D)}}function S(D,K){g=!1,y&&(y=!1,b(P),P=-1),p=!0;var T=h;try{for(w(K),f=n(c);f!==null&&(!(f.expirationTime>K)||D&&!O());){var ie=f.callback;if(typeof ie=="function"){f.callback=null,h=f.priorityLevel;var J=ie(f.expirationTime<=K);K=e.unstable_now(),typeof J=="function"?f.callback=J:f===n(c)&&r(c),w(K)}else r(c);f=n(c)}if(f!==null)var _=!0;else{var H=n(u);H!==null&&Q(k,H.startTime-K),_=!1}return _}finally{f=null,h=T,p=!1}}var j=!1,N=null,P=-1,A=5,E=-1;function O(){return!(e.unstable_now()-E<A)}function C(){if(N!==null){var D=e.unstable_now();E=D;var K=!0;try{K=N(!0,D)}finally{K?M():(j=!1,N=null)}}else j=!1}var M;if(typeof v=="function")M=function(){v(C)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,B=I.port2;I.port1.onmessage=C,M=function(){B.postMessage(null)}}else M=function(){x(C,0)};function se(D){N=D,j||(j=!0,M())}function Q(D,K){P=x(function(){D(e.unstable_now())},K)}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(D){D.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,se(S))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(D){switch(h){case 1:case 2:case 3:var K=3;break;default:K=h}var T=h;h=K;try{return D()}finally{h=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,K){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var T=h;h=D;try{return K()}finally{h=T}},e.unstable_scheduleCallback=function(D,K,T){var ie=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?ie+T:ie):T=ie,D){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=T+J,D={id:d++,callback:K,priorityLevel:D,startTime:T,expirationTime:J,sortIndex:-1},T>ie?(D.sortIndex=T,t(u,D),n(c)===null&&D===n(u)&&(y?(b(P),P=-1):y=!0,Q(k,T-ie))):(D.sortIndex=J,t(c,D),g||p||(g=!0,se(S))),D},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(D){var K=h;return function(){var T=h;h=K;try{return D.apply(this,arguments)}finally{h=T}}}})(CA);NA.exports=CA;var J6=NA.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 eF=m,wr=J6;function he(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var PA=new Set,bu={};function jo(e,t){Nl(e,t),Nl(e+"Capture",t)}function Nl(e,t){for(bu[e]=t,e=0;e<t.length;e++)PA.add(t[e])}var sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cy=Object.prototype.hasOwnProperty,tF=/^[: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]*$/,mk={},gk={};function nF(e){return Cy.call(gk,e)?!0:Cy.call(mk,e)?!1:tF.test(e)?gk[e]=!0:(mk[e]=!0,!1)}function rF(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function iF(e,t,n,r){if(t===null||typeof t>"u"||rF(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function qn(e,t,n,r,i,a,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=s}var Sn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Sn[e]=new qn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Sn[t]=new qn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Sn[e]=new qn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Sn[e]=new qn(e,2,!1,e,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(e){Sn[e]=new qn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Sn[e]=new qn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Sn[e]=new qn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Sn[e]=new qn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Sn[e]=new qn(e,5,!1,e.toLowerCase(),null,!1,!1)});var sb=/[\-:]([a-z])/g;function ob(e){return e[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(e){var t=e.replace(sb,ob);Sn[t]=new qn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(sb,ob);Sn[t]=new qn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(sb,ob);Sn[t]=new qn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Sn[e]=new qn(e,1,!1,e.toLowerCase(),null,!1,!1)});Sn.xlinkHref=new qn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Sn[e]=new qn(e,1,!1,e.toLowerCase(),null,!0,!0)});function lb(e,t,n,r){var i=Sn.hasOwnProperty(t)?Sn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(iF(t,n,i,r)&&(n=null),r||i===null?nF(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ya=eF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,nf=Symbol.for("react.element"),qo=Symbol.for("react.portal"),Yo=Symbol.for("react.fragment"),cb=Symbol.for("react.strict_mode"),Py=Symbol.for("react.profiler"),EA=Symbol.for("react.provider"),AA=Symbol.for("react.context"),ub=Symbol.for("react.forward_ref"),Ey=Symbol.for("react.suspense"),Ay=Symbol.for("react.suspense_list"),db=Symbol.for("react.memo"),La=Symbol.for("react.lazy"),TA=Symbol.for("react.offscreen"),yk=Symbol.iterator;function yc(e){return e===null||typeof e!="object"?null:(e=yk&&e[yk]||e["@@iterator"],typeof e=="function"?e:null)}var Dt=Object.assign,zg;function Kc(e){if(zg===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zg=t&&t[1]||""}return`
34
+ `+zg+e}var $g=!1;function Bg(e,t){if(!e||$g)return"";$g=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
35
+ `),a=r.stack.split(`
36
+ `),s=i.length-1,o=a.length-1;1<=s&&0<=o&&i[s]!==a[o];)o--;for(;1<=s&&0<=o;s--,o--)if(i[s]!==a[o]){if(s!==1||o!==1)do if(s--,o--,0>o||i[s]!==a[o]){var c=`
37
+ `+i[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=o);break}}}finally{$g=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Kc(e):""}function aF(e){switch(e.tag){case 5:return Kc(e.type);case 16:return Kc("Lazy");case 13:return Kc("Suspense");case 19:return Kc("SuspenseList");case 0:case 2:case 15:return e=Bg(e.type,!1),e;case 11:return e=Bg(e.type.render,!1),e;case 1:return e=Bg(e.type,!0),e;default:return""}}function Ty(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Yo:return"Fragment";case qo:return"Portal";case Py:return"Profiler";case cb:return"StrictMode";case Ey:return"Suspense";case Ay:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case AA:return(e.displayName||"Context")+".Consumer";case EA:return(e._context.displayName||"Context")+".Provider";case ub:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case db:return t=e.displayName||null,t!==null?t:Ty(e.type)||"Memo";case La:t=e._payload,e=e._init;try{return Ty(e(t))}catch{}}return null}function sF(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ty(t);case 8:return t===cb?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function as(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function OA(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oF(e){var t=OA(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,a.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rf(e){e._valueTracker||(e._valueTracker=oF(e))}function _A(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=OA(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function jh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Oy(e,t){var n=t.checked;return Dt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xk(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=as(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function MA(e,t){t=t.checked,t!=null&&lb(e,"checked",t,!1)}function _y(e,t){MA(e,t);var n=as(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?My(e,t.type,n):t.hasOwnProperty("defaultValue")&&My(e,t.type,as(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vk(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function My(e,t,n){(t!=="number"||jh(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Gc=Array.isArray;function pl(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+as(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Dy(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(he(91));return Dt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function bk(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(he(92));if(Gc(n)){if(1<n.length)throw Error(he(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:as(n)}}function DA(e,t){var n=as(t.value),r=as(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function wk(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function IA(e){switch(e){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 Iy(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?IA(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var af,LA=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(af=af||document.createElement("div"),af.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=af.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function wu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ru={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},lF=["Webkit","ms","Moz","O"];Object.keys(ru).forEach(function(e){lF.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ru[t]=ru[e]})});function RA(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ru.hasOwnProperty(e)&&ru[e]?(""+t).trim():t+"px"}function FA(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=RA(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var cF=Dt({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 Ly(e,t){if(t){if(cF[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(he(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(he(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(he(61))}if(t.style!=null&&typeof t.style!="object")throw Error(he(62))}}function Ry(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fy=null;function fb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zy=null,ml=null,gl=null;function Sk(e){if(e=yd(e)){if(typeof zy!="function")throw Error(he(280));var t=e.stateNode;t&&(t=cm(t),zy(e.stateNode,e.type,t))}}function zA(e){ml?gl?gl.push(e):gl=[e]:ml=e}function $A(){if(ml){var e=ml,t=gl;if(gl=ml=null,Sk(e),t)for(e=0;e<t.length;e++)Sk(t[e])}}function BA(e,t){return e(t)}function UA(){}var Ug=!1;function VA(e,t,n){if(Ug)return e(t,n);Ug=!0;try{return BA(e,t,n)}finally{Ug=!1,(ml!==null||gl!==null)&&(UA(),$A())}}function Su(e,t){var n=e.stateNode;if(n===null)return null;var r=cm(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(he(231,t,typeof n));return n}var $y=!1;if(sa)try{var xc={};Object.defineProperty(xc,"passive",{get:function(){$y=!0}}),window.addEventListener("test",xc,xc),window.removeEventListener("test",xc,xc)}catch{$y=!1}function uF(e,t,n,r,i,a,s,o,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var iu=!1,Nh=null,Ch=!1,By=null,dF={onError:function(e){iu=!0,Nh=e}};function fF(e,t,n,r,i,a,s,o,c){iu=!1,Nh=null,uF.apply(dF,arguments)}function hF(e,t,n,r,i,a,s,o,c){if(fF.apply(this,arguments),iu){if(iu){var u=Nh;iu=!1,Nh=null}else throw Error(he(198));Ch||(Ch=!0,By=u)}}function No(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function WA(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function kk(e){if(No(e)!==e)throw Error(he(188))}function pF(e){var t=e.alternate;if(!t){if(t=No(e),t===null)throw Error(he(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return kk(i),e;if(a===r)return kk(i),t;a=a.sibling}throw Error(he(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,o=i.child;o;){if(o===n){s=!0,n=i,r=a;break}if(o===r){s=!0,r=i,n=a;break}o=o.sibling}if(!s){for(o=a.child;o;){if(o===n){s=!0,n=a,r=i;break}if(o===r){s=!0,r=a,n=i;break}o=o.sibling}if(!s)throw Error(he(189))}}if(n.alternate!==r)throw Error(he(190))}if(n.tag!==3)throw Error(he(188));return n.stateNode.current===n?e:t}function HA(e){return e=pF(e),e!==null?KA(e):null}function KA(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=KA(e);if(t!==null)return t;e=e.sibling}return null}var GA=wr.unstable_scheduleCallback,jk=wr.unstable_cancelCallback,mF=wr.unstable_shouldYield,gF=wr.unstable_requestPaint,Vt=wr.unstable_now,yF=wr.unstable_getCurrentPriorityLevel,hb=wr.unstable_ImmediatePriority,qA=wr.unstable_UserBlockingPriority,Ph=wr.unstable_NormalPriority,xF=wr.unstable_LowPriority,YA=wr.unstable_IdlePriority,am=null,Pi=null;function vF(e){if(Pi&&typeof Pi.onCommitFiberRoot=="function")try{Pi.onCommitFiberRoot(am,e,void 0,(e.current.flags&128)===128)}catch{}}var ii=Math.clz32?Math.clz32:SF,bF=Math.log,wF=Math.LN2;function SF(e){return e>>>=0,e===0?32:31-(bF(e)/wF|0)|0}var sf=64,of=4194304;function qc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Eh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,s=n&268435455;if(s!==0){var o=s&~i;o!==0?r=qc(o):(a&=s,a!==0&&(r=qc(a)))}else s=n&~i,s!==0?r=qc(s):a!==0&&(r=qc(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ii(t),i=1<<n,r|=e[n],t&=~i;return r}function kF(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 jF(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var s=31-ii(a),o=1<<s,c=i[s];c===-1?(!(o&n)||o&r)&&(i[s]=kF(o,t)):c<=t&&(e.expiredLanes|=o),a&=~o}}function Uy(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function XA(){var e=sf;return sf<<=1,!(sf&4194240)&&(sf=64),e}function Vg(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function md(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ii(t),e[t]=n}function NF(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-ii(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function pb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ii(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var st=0;function ZA(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var QA,mb,JA,eT,tT,Vy=!1,lf=[],qa=null,Ya=null,Xa=null,ku=new Map,ju=new Map,$a=[],CF="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 Nk(e,t){switch(e){case"focusin":case"focusout":qa=null;break;case"dragenter":case"dragleave":Ya=null;break;case"mouseover":case"mouseout":Xa=null;break;case"pointerover":case"pointerout":ku.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ju.delete(t.pointerId)}}function vc(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=yd(t),t!==null&&mb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function PF(e,t,n,r,i){switch(t){case"focusin":return qa=vc(qa,e,t,n,r,i),!0;case"dragenter":return Ya=vc(Ya,e,t,n,r,i),!0;case"mouseover":return Xa=vc(Xa,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return ku.set(a,vc(ku.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,ju.set(a,vc(ju.get(a)||null,e,t,n,r,i)),!0}return!1}function nT(e){var t=Vs(e.target);if(t!==null){var n=No(t);if(n!==null){if(t=n.tag,t===13){if(t=WA(n),t!==null){e.blockedOn=t,tT(e.priority,function(){JA(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Jf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Wy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Fy=r,n.target.dispatchEvent(r),Fy=null}else return t=yd(n),t!==null&&mb(t),e.blockedOn=n,!1;t.shift()}return!0}function Ck(e,t,n){Jf(e)&&n.delete(t)}function EF(){Vy=!1,qa!==null&&Jf(qa)&&(qa=null),Ya!==null&&Jf(Ya)&&(Ya=null),Xa!==null&&Jf(Xa)&&(Xa=null),ku.forEach(Ck),ju.forEach(Ck)}function bc(e,t){e.blockedOn===t&&(e.blockedOn=null,Vy||(Vy=!0,wr.unstable_scheduleCallback(wr.unstable_NormalPriority,EF)))}function Nu(e){function t(i){return bc(i,e)}if(0<lf.length){bc(lf[0],e);for(var n=1;n<lf.length;n++){var r=lf[n];r.blockedOn===e&&(r.blockedOn=null)}}for(qa!==null&&bc(qa,e),Ya!==null&&bc(Ya,e),Xa!==null&&bc(Xa,e),ku.forEach(t),ju.forEach(t),n=0;n<$a.length;n++)r=$a[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<$a.length&&(n=$a[0],n.blockedOn===null);)nT(n),n.blockedOn===null&&$a.shift()}var yl=ya.ReactCurrentBatchConfig,Ah=!0;function AF(e,t,n,r){var i=st,a=yl.transition;yl.transition=null;try{st=1,gb(e,t,n,r)}finally{st=i,yl.transition=a}}function TF(e,t,n,r){var i=st,a=yl.transition;yl.transition=null;try{st=4,gb(e,t,n,r)}finally{st=i,yl.transition=a}}function gb(e,t,n,r){if(Ah){var i=Wy(e,t,n,r);if(i===null)Jg(e,t,r,Th,n),Nk(e,r);else if(PF(i,e,t,n,r))r.stopPropagation();else if(Nk(e,r),t&4&&-1<CF.indexOf(e)){for(;i!==null;){var a=yd(i);if(a!==null&&QA(a),a=Wy(e,t,n,r),a===null&&Jg(e,t,r,Th,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Jg(e,t,r,null,n)}}var Th=null;function Wy(e,t,n,r){if(Th=null,e=fb(r),e=Vs(e),e!==null)if(t=No(e),t===null)e=null;else if(n=t.tag,n===13){if(e=WA(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Th=e,null}function rT(e){switch(e){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(yF()){case hb:return 1;case qA:return 4;case Ph:case xF:return 16;case YA:return 536870912;default:return 16}default:return 16}}var Va=null,yb=null,eh=null;function iT(){if(eh)return eh;var e,t=yb,n=t.length,r,i="value"in Va?Va.value:Va.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[a-r];r++);return eh=i.slice(e,1<r?1-r:void 0)}function th(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function cf(){return!0}function Pk(){return!1}function Pr(e){function t(n,r,i,a,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?cf:Pk,this.isPropagationStopped=Pk,this}return Dt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=cf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=cf)},persist:function(){},isPersistent:cf}),t}var Yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xb=Pr(Yl),gd=Dt({},Yl,{view:0,detail:0}),OF=Pr(gd),Wg,Hg,wc,sm=Dt({},gd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vb,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==wc&&(wc&&e.type==="mousemove"?(Wg=e.screenX-wc.screenX,Hg=e.screenY-wc.screenY):Hg=Wg=0,wc=e),Wg)},movementY:function(e){return"movementY"in e?e.movementY:Hg}}),Ek=Pr(sm),_F=Dt({},sm,{dataTransfer:0}),MF=Pr(_F),DF=Dt({},gd,{relatedTarget:0}),Kg=Pr(DF),IF=Dt({},Yl,{animationName:0,elapsedTime:0,pseudoElement:0}),LF=Pr(IF),RF=Dt({},Yl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),FF=Pr(RF),zF=Dt({},Yl,{data:0}),Ak=Pr(zF),$F={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BF={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"},UF={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function VF(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=UF[e])?!!t[e]:!1}function vb(){return VF}var WF=Dt({},gd,{key:function(e){if(e.key){var t=$F[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=th(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?BF[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vb,charCode:function(e){return e.type==="keypress"?th(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?th(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),HF=Pr(WF),KF=Dt({},sm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tk=Pr(KF),GF=Dt({},gd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vb}),qF=Pr(GF),YF=Dt({},Yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),XF=Pr(YF),ZF=Dt({},sm,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),QF=Pr(ZF),JF=[9,13,27,32],bb=sa&&"CompositionEvent"in window,au=null;sa&&"documentMode"in document&&(au=document.documentMode);var ez=sa&&"TextEvent"in window&&!au,aT=sa&&(!bb||au&&8<au&&11>=au),Ok=" ",_k=!1;function sT(e,t){switch(e){case"keyup":return JF.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oT(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xo=!1;function tz(e,t){switch(e){case"compositionend":return oT(t);case"keypress":return t.which!==32?null:(_k=!0,Ok);case"textInput":return e=t.data,e===Ok&&_k?null:e;default:return null}}function nz(e,t){if(Xo)return e==="compositionend"||!bb&&sT(e,t)?(e=iT(),eh=yb=Va=null,Xo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return aT&&t.locale!=="ko"?null:t.data;default:return null}}var rz={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 Mk(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rz[e.type]:t==="textarea"}function lT(e,t,n,r){zA(r),t=Oh(t,"onChange"),0<t.length&&(n=new xb("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var su=null,Cu=null;function iz(e){vT(e,0)}function om(e){var t=Jo(e);if(_A(t))return e}function az(e,t){if(e==="change")return t}var cT=!1;if(sa){var Gg;if(sa){var qg="oninput"in document;if(!qg){var Dk=document.createElement("div");Dk.setAttribute("oninput","return;"),qg=typeof Dk.oninput=="function"}Gg=qg}else Gg=!1;cT=Gg&&(!document.documentMode||9<document.documentMode)}function Ik(){su&&(su.detachEvent("onpropertychange",uT),Cu=su=null)}function uT(e){if(e.propertyName==="value"&&om(Cu)){var t=[];lT(t,Cu,e,fb(e)),VA(iz,t)}}function sz(e,t,n){e==="focusin"?(Ik(),su=t,Cu=n,su.attachEvent("onpropertychange",uT)):e==="focusout"&&Ik()}function oz(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return om(Cu)}function lz(e,t){if(e==="click")return om(t)}function cz(e,t){if(e==="input"||e==="change")return om(t)}function uz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ci=typeof Object.is=="function"?Object.is:uz;function Pu(e,t){if(ci(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Cy.call(t,i)||!ci(e[i],t[i]))return!1}return!0}function Lk(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rk(e,t){var n=Lk(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Lk(n)}}function dT(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?dT(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fT(){for(var e=window,t=jh();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=jh(e.document)}return t}function wb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function dz(e){var t=fT(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dT(n.ownerDocument.documentElement,n)){if(r!==null&&wb(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Rk(n,a);var s=Rk(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var fz=sa&&"documentMode"in document&&11>=document.documentMode,Zo=null,Hy=null,ou=null,Ky=!1;function Fk(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ky||Zo==null||Zo!==jh(r)||(r=Zo,"selectionStart"in r&&wb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ou&&Pu(ou,r)||(ou=r,r=Oh(Hy,"onSelect"),0<r.length&&(t=new xb("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zo)))}function uf(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Qo={animationend:uf("Animation","AnimationEnd"),animationiteration:uf("Animation","AnimationIteration"),animationstart:uf("Animation","AnimationStart"),transitionend:uf("Transition","TransitionEnd")},Yg={},hT={};sa&&(hT=document.createElement("div").style,"AnimationEvent"in window||(delete Qo.animationend.animation,delete Qo.animationiteration.animation,delete Qo.animationstart.animation),"TransitionEvent"in window||delete Qo.transitionend.transition);function lm(e){if(Yg[e])return Yg[e];if(!Qo[e])return e;var t=Qo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in hT)return Yg[e]=t[n];return e}var pT=lm("animationend"),mT=lm("animationiteration"),gT=lm("animationstart"),yT=lm("transitionend"),xT=new Map,zk="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 fs(e,t){xT.set(e,t),jo(t,[e])}for(var Xg=0;Xg<zk.length;Xg++){var Zg=zk[Xg],hz=Zg.toLowerCase(),pz=Zg[0].toUpperCase()+Zg.slice(1);fs(hz,"on"+pz)}fs(pT,"onAnimationEnd");fs(mT,"onAnimationIteration");fs(gT,"onAnimationStart");fs("dblclick","onDoubleClick");fs("focusin","onFocus");fs("focusout","onBlur");fs(yT,"onTransitionEnd");Nl("onMouseEnter",["mouseout","mouseover"]);Nl("onMouseLeave",["mouseout","mouseover"]);Nl("onPointerEnter",["pointerout","pointerover"]);Nl("onPointerLeave",["pointerout","pointerover"]);jo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));jo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));jo("onBeforeInput",["compositionend","keypress","textInput","paste"]);jo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));jo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));jo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yc="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(" "),mz=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yc));function $k(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,hF(r,t,void 0,e),e.currentTarget=null}function vT(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var s=r.length-1;0<=s;s--){var o=r[s],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==a&&i.isPropagationStopped())break e;$k(i,o,u),a=c}else for(s=0;s<r.length;s++){if(o=r[s],c=o.instance,u=o.currentTarget,o=o.listener,c!==a&&i.isPropagationStopped())break e;$k(i,o,u),a=c}}}if(Ch)throw e=By,Ch=!1,By=null,e}function bt(e,t){var n=t[Zy];n===void 0&&(n=t[Zy]=new Set);var r=e+"__bubble";n.has(r)||(bT(t,e,2,!1),n.add(r))}function Qg(e,t,n){var r=0;t&&(r|=4),bT(n,e,r,t)}var df="_reactListening"+Math.random().toString(36).slice(2);function Eu(e){if(!e[df]){e[df]=!0,PA.forEach(function(n){n!=="selectionchange"&&(mz.has(n)||Qg(n,!1,e),Qg(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[df]||(t[df]=!0,Qg("selectionchange",!1,t))}}function bT(e,t,n,r){switch(rT(t)){case 1:var i=AF;break;case 4:i=TF;break;default:i=gb}n=i.bind(null,t,n,e),i=void 0,!$y||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Jg(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;s=s.return}for(;o!==null;){if(s=Vs(o),s===null)return;if(c=s.tag,c===5||c===6){r=a=s;continue e}o=o.parentNode}}r=r.return}VA(function(){var u=a,d=fb(n),f=[];e:{var h=xT.get(e);if(h!==void 0){var p=xb,g=e;switch(e){case"keypress":if(th(n)===0)break e;case"keydown":case"keyup":p=HF;break;case"focusin":g="focus",p=Kg;break;case"focusout":g="blur",p=Kg;break;case"beforeblur":case"afterblur":p=Kg;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Ek;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=MF;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=qF;break;case pT:case mT:case gT:p=LF;break;case yT:p=XF;break;case"scroll":p=OF;break;case"wheel":p=QF;break;case"copy":case"cut":case"paste":p=FF;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Tk}var y=(t&4)!==0,x=!y&&e==="scroll",b=y?h!==null?h+"Capture":null:h;y=[];for(var v=u,w;v!==null;){w=v;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,b!==null&&(k=Su(v,b),k!=null&&y.push(Au(v,k,w)))),x)break;v=v.return}0<y.length&&(h=new p(h,g,null,n,d),f.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Fy&&(g=n.relatedTarget||n.fromElement)&&(Vs(g)||g[oa]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=u,g=g?Vs(g):null,g!==null&&(x=No(g),g!==x||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(y=Ek,k="onMouseLeave",b="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(y=Tk,k="onPointerLeave",b="onPointerEnter",v="pointer"),x=p==null?h:Jo(p),w=g==null?h:Jo(g),h=new y(k,v+"leave",p,n,d),h.target=x,h.relatedTarget=w,k=null,Vs(d)===u&&(y=new y(b,v+"enter",g,n,d),y.target=w,y.relatedTarget=x,k=y),x=k,p&&g)t:{for(y=p,b=g,v=0,w=y;w;w=Io(w))v++;for(w=0,k=b;k;k=Io(k))w++;for(;0<v-w;)y=Io(y),v--;for(;0<w-v;)b=Io(b),w--;for(;v--;){if(y===b||b!==null&&y===b.alternate)break t;y=Io(y),b=Io(b)}y=null}else y=null;p!==null&&Bk(f,h,p,y,!1),g!==null&&x!==null&&Bk(f,x,g,y,!0)}}e:{if(h=u?Jo(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=az;else if(Mk(h))if(cT)S=cz;else{S=oz;var j=sz}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=lz);if(S&&(S=S(e,u))){lT(f,S,n,d);break e}j&&j(e,h,u),e==="focusout"&&(j=h._wrapperState)&&j.controlled&&h.type==="number"&&My(h,"number",h.value)}switch(j=u?Jo(u):window,e){case"focusin":(Mk(j)||j.contentEditable==="true")&&(Zo=j,Hy=u,ou=null);break;case"focusout":ou=Hy=Zo=null;break;case"mousedown":Ky=!0;break;case"contextmenu":case"mouseup":case"dragend":Ky=!1,Fk(f,n,d);break;case"selectionchange":if(fz)break;case"keydown":case"keyup":Fk(f,n,d)}var N;if(bb)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Xo?sT(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(aT&&n.locale!=="ko"&&(Xo||P!=="onCompositionStart"?P==="onCompositionEnd"&&Xo&&(N=iT()):(Va=d,yb="value"in Va?Va.value:Va.textContent,Xo=!0)),j=Oh(u,P),0<j.length&&(P=new Ak(P,e,null,n,d),f.push({event:P,listeners:j}),N?P.data=N:(N=oT(n),N!==null&&(P.data=N)))),(N=ez?tz(e,n):nz(e,n))&&(u=Oh(u,"onBeforeInput"),0<u.length&&(d=new Ak("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=N))}vT(f,t)})}function Au(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Oh(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Su(e,n),a!=null&&r.unshift(Au(e,a,i)),a=Su(e,t),a!=null&&r.push(Au(e,a,i))),e=e.return}return r}function Io(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Bk(e,t,n,r,i){for(var a=t._reactName,s=[];n!==null&&n!==r;){var o=n,c=o.alternate,u=o.stateNode;if(c!==null&&c===r)break;o.tag===5&&u!==null&&(o=u,i?(c=Su(n,a),c!=null&&s.unshift(Au(n,c,o))):i||(c=Su(n,a),c!=null&&s.push(Au(n,c,o)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var gz=/\r\n?/g,yz=/\u0000|\uFFFD/g;function Uk(e){return(typeof e=="string"?e:""+e).replace(gz,`
38
+ `).replace(yz,"")}function ff(e,t,n){if(t=Uk(t),Uk(e)!==t&&n)throw Error(he(425))}function _h(){}var Gy=null,qy=null;function Yy(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xy=typeof setTimeout=="function"?setTimeout:void 0,xz=typeof clearTimeout=="function"?clearTimeout:void 0,Vk=typeof Promise=="function"?Promise:void 0,vz=typeof queueMicrotask=="function"?queueMicrotask:typeof Vk<"u"?function(e){return Vk.resolve(null).then(e).catch(bz)}:Xy;function bz(e){setTimeout(function(){throw e})}function e0(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Nu(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Nu(t)}function Za(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Wk(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Xl=Math.random().toString(36).slice(2),ji="__reactFiber$"+Xl,Tu="__reactProps$"+Xl,oa="__reactContainer$"+Xl,Zy="__reactEvents$"+Xl,wz="__reactListeners$"+Xl,Sz="__reactHandles$"+Xl;function Vs(e){var t=e[ji];if(t)return t;for(var n=e.parentNode;n;){if(t=n[oa]||n[ji]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Wk(e);e!==null;){if(n=e[ji])return n;e=Wk(e)}return t}e=n,n=e.parentNode}return null}function yd(e){return e=e[ji]||e[oa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Jo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(he(33))}function cm(e){return e[Tu]||null}var Qy=[],el=-1;function hs(e){return{current:e}}function kt(e){0>el||(e.current=Qy[el],Qy[el]=null,el--)}function yt(e,t){el++,Qy[el]=e.current,e.current=t}var ss={},Dn=hs(ss),rr=hs(!1),oo=ss;function Cl(e,t){var n=e.type.contextTypes;if(!n)return ss;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ir(e){return e=e.childContextTypes,e!=null}function Mh(){kt(rr),kt(Dn)}function Hk(e,t,n){if(Dn.current!==ss)throw Error(he(168));yt(Dn,t),yt(rr,n)}function wT(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(he(108,sF(e)||"Unknown",i));return Dt({},n,r)}function Dh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ss,oo=Dn.current,yt(Dn,e),yt(rr,rr.current),!0}function Kk(e,t,n){var r=e.stateNode;if(!r)throw Error(he(169));n?(e=wT(e,t,oo),r.__reactInternalMemoizedMergedChildContext=e,kt(rr),kt(Dn),yt(Dn,e)):kt(rr),yt(rr,n)}var Hi=null,um=!1,t0=!1;function ST(e){Hi===null?Hi=[e]:Hi.push(e)}function kz(e){um=!0,ST(e)}function ps(){if(!t0&&Hi!==null){t0=!0;var e=0,t=st;try{var n=Hi;for(st=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Hi=null,um=!1}catch(i){throw Hi!==null&&(Hi=Hi.slice(e+1)),GA(hb,ps),i}finally{st=t,t0=!1}}return null}var tl=[],nl=0,Ih=null,Lh=0,Ir=[],Lr=0,lo=null,qi=1,Yi="";function Ms(e,t){tl[nl++]=Lh,tl[nl++]=Ih,Ih=e,Lh=t}function kT(e,t,n){Ir[Lr++]=qi,Ir[Lr++]=Yi,Ir[Lr++]=lo,lo=e;var r=qi;e=Yi;var i=32-ii(r)-1;r&=~(1<<i),n+=1;var a=32-ii(t)+i;if(30<a){var s=i-i%5;a=(r&(1<<s)-1).toString(32),r>>=s,i-=s,qi=1<<32-ii(t)+i|n<<i|r,Yi=a+e}else qi=1<<a|n<<i|r,Yi=e}function Sb(e){e.return!==null&&(Ms(e,1),kT(e,1,0))}function kb(e){for(;e===Ih;)Ih=tl[--nl],tl[nl]=null,Lh=tl[--nl],tl[nl]=null;for(;e===lo;)lo=Ir[--Lr],Ir[Lr]=null,Yi=Ir[--Lr],Ir[Lr]=null,qi=Ir[--Lr],Ir[Lr]=null}var yr=null,mr=null,Et=!1,ei=null;function jT(e,t){var n=Fr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Gk(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,yr=e,mr=Za(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,yr=e,mr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=lo!==null?{id:qi,overflow:Yi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Fr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,yr=e,mr=null,!0):!1;default:return!1}}function Jy(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ex(e){if(Et){var t=mr;if(t){var n=t;if(!Gk(e,t)){if(Jy(e))throw Error(he(418));t=Za(n.nextSibling);var r=yr;t&&Gk(e,t)?jT(r,n):(e.flags=e.flags&-4097|2,Et=!1,yr=e)}}else{if(Jy(e))throw Error(he(418));e.flags=e.flags&-4097|2,Et=!1,yr=e}}}function qk(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;yr=e}function hf(e){if(e!==yr)return!1;if(!Et)return qk(e),Et=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Yy(e.type,e.memoizedProps)),t&&(t=mr)){if(Jy(e))throw NT(),Error(he(418));for(;t;)jT(e,t),t=Za(t.nextSibling)}if(qk(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(he(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){mr=Za(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}mr=null}}else mr=yr?Za(e.stateNode.nextSibling):null;return!0}function NT(){for(var e=mr;e;)e=Za(e.nextSibling)}function Pl(){mr=yr=null,Et=!1}function jb(e){ei===null?ei=[e]:ei.push(e)}var jz=ya.ReactCurrentBatchConfig;function Sc(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(he(309));var r=n.stateNode}if(!r)throw Error(he(147,e));var i=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(s){var o=i.refs;s===null?delete o[a]:o[a]=s},t._stringRef=a,t)}if(typeof e!="string")throw Error(he(284));if(!n._owner)throw Error(he(290,e))}return e}function pf(e,t){throw e=Object.prototype.toString.call(t),Error(he(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yk(e){var t=e._init;return t(e._payload)}function CT(e){function t(b,v){if(e){var w=b.deletions;w===null?(b.deletions=[v],b.flags|=16):w.push(v)}}function n(b,v){if(!e)return null;for(;v!==null;)t(b,v),v=v.sibling;return null}function r(b,v){for(b=new Map;v!==null;)v.key!==null?b.set(v.key,v):b.set(v.index,v),v=v.sibling;return b}function i(b,v){return b=ts(b,v),b.index=0,b.sibling=null,b}function a(b,v,w){return b.index=w,e?(w=b.alternate,w!==null?(w=w.index,w<v?(b.flags|=2,v):w):(b.flags|=2,v)):(b.flags|=1048576,v)}function s(b){return e&&b.alternate===null&&(b.flags|=2),b}function o(b,v,w,k){return v===null||v.tag!==6?(v=l0(w,b.mode,k),v.return=b,v):(v=i(v,w),v.return=b,v)}function c(b,v,w,k){var S=w.type;return S===Yo?d(b,v,w.props.children,k,w.key):v!==null&&(v.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===La&&Yk(S)===v.type)?(k=i(v,w.props),k.ref=Sc(b,v,w),k.return=b,k):(k=lh(w.type,w.key,w.props,null,b.mode,k),k.ref=Sc(b,v,w),k.return=b,k)}function u(b,v,w,k){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=c0(w,b.mode,k),v.return=b,v):(v=i(v,w.children||[]),v.return=b,v)}function d(b,v,w,k,S){return v===null||v.tag!==7?(v=eo(w,b.mode,k,S),v.return=b,v):(v=i(v,w),v.return=b,v)}function f(b,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=l0(""+v,b.mode,w),v.return=b,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case nf:return w=lh(v.type,v.key,v.props,null,b.mode,w),w.ref=Sc(b,null,v),w.return=b,w;case qo:return v=c0(v,b.mode,w),v.return=b,v;case La:var k=v._init;return f(b,k(v._payload),w)}if(Gc(v)||yc(v))return v=eo(v,b.mode,w,null),v.return=b,v;pf(b,v)}return null}function h(b,v,w,k){var S=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:o(b,v,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case nf:return w.key===S?c(b,v,w,k):null;case qo:return w.key===S?u(b,v,w,k):null;case La:return S=w._init,h(b,v,S(w._payload),k)}if(Gc(w)||yc(w))return S!==null?null:d(b,v,w,k,null);pf(b,w)}return null}function p(b,v,w,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return b=b.get(w)||null,o(v,b,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case nf:return b=b.get(k.key===null?w:k.key)||null,c(v,b,k,S);case qo:return b=b.get(k.key===null?w:k.key)||null,u(v,b,k,S);case La:var j=k._init;return p(b,v,w,j(k._payload),S)}if(Gc(k)||yc(k))return b=b.get(w)||null,d(v,b,k,S,null);pf(v,k)}return null}function g(b,v,w,k){for(var S=null,j=null,N=v,P=v=0,A=null;N!==null&&P<w.length;P++){N.index>P?(A=N,N=null):A=N.sibling;var E=h(b,N,w[P],k);if(E===null){N===null&&(N=A);break}e&&N&&E.alternate===null&&t(b,N),v=a(E,v,P),j===null?S=E:j.sibling=E,j=E,N=A}if(P===w.length)return n(b,N),Et&&Ms(b,P),S;if(N===null){for(;P<w.length;P++)N=f(b,w[P],k),N!==null&&(v=a(N,v,P),j===null?S=N:j.sibling=N,j=N);return Et&&Ms(b,P),S}for(N=r(b,N);P<w.length;P++)A=p(N,b,P,w[P],k),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?P:A.key),v=a(A,v,P),j===null?S=A:j.sibling=A,j=A);return e&&N.forEach(function(O){return t(b,O)}),Et&&Ms(b,P),S}function y(b,v,w,k){var S=yc(w);if(typeof S!="function")throw Error(he(150));if(w=S.call(w),w==null)throw Error(he(151));for(var j=S=null,N=v,P=v=0,A=null,E=w.next();N!==null&&!E.done;P++,E=w.next()){N.index>P?(A=N,N=null):A=N.sibling;var O=h(b,N,E.value,k);if(O===null){N===null&&(N=A);break}e&&N&&O.alternate===null&&t(b,N),v=a(O,v,P),j===null?S=O:j.sibling=O,j=O,N=A}if(E.done)return n(b,N),Et&&Ms(b,P),S;if(N===null){for(;!E.done;P++,E=w.next())E=f(b,E.value,k),E!==null&&(v=a(E,v,P),j===null?S=E:j.sibling=E,j=E);return Et&&Ms(b,P),S}for(N=r(b,N);!E.done;P++,E=w.next())E=p(N,b,P,E.value,k),E!==null&&(e&&E.alternate!==null&&N.delete(E.key===null?P:E.key),v=a(E,v,P),j===null?S=E:j.sibling=E,j=E);return e&&N.forEach(function(C){return t(b,C)}),Et&&Ms(b,P),S}function x(b,v,w,k){if(typeof w=="object"&&w!==null&&w.type===Yo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case nf:e:{for(var S=w.key,j=v;j!==null;){if(j.key===S){if(S=w.type,S===Yo){if(j.tag===7){n(b,j.sibling),v=i(j,w.props.children),v.return=b,b=v;break e}}else if(j.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===La&&Yk(S)===j.type){n(b,j.sibling),v=i(j,w.props),v.ref=Sc(b,j,w),v.return=b,b=v;break e}n(b,j);break}else t(b,j);j=j.sibling}w.type===Yo?(v=eo(w.props.children,b.mode,k,w.key),v.return=b,b=v):(k=lh(w.type,w.key,w.props,null,b.mode,k),k.ref=Sc(b,v,w),k.return=b,b=k)}return s(b);case qo:e:{for(j=w.key;v!==null;){if(v.key===j)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(b,v.sibling),v=i(v,w.children||[]),v.return=b,b=v;break e}else{n(b,v);break}else t(b,v);v=v.sibling}v=c0(w,b.mode,k),v.return=b,b=v}return s(b);case La:return j=w._init,x(b,v,j(w._payload),k)}if(Gc(w))return g(b,v,w,k);if(yc(w))return y(b,v,w,k);pf(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(b,v.sibling),v=i(v,w),v.return=b,b=v):(n(b,v),v=l0(w,b.mode,k),v.return=b,b=v),s(b)):n(b,v)}return x}var El=CT(!0),PT=CT(!1),Rh=hs(null),Fh=null,rl=null,Nb=null;function Cb(){Nb=rl=Fh=null}function Pb(e){var t=Rh.current;kt(Rh),e._currentValue=t}function tx(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function xl(e,t){Fh=e,Nb=rl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(er=!0),e.firstContext=null)}function Vr(e){var t=e._currentValue;if(Nb!==e)if(e={context:e,memoizedValue:t,next:null},rl===null){if(Fh===null)throw Error(he(308));rl=e,Fh.dependencies={lanes:0,firstContext:e}}else rl=rl.next=e;return t}var Ws=null;function Eb(e){Ws===null?Ws=[e]:Ws.push(e)}function ET(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Eb(t)):(n.next=i.next,i.next=n),t.interleaved=n,la(e,r)}function la(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ra=!1;function Ab(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function AT(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Qe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,la(e,n)}return i=r.interleaved,i===null?(t.next=t,Eb(r)):(t.next=i.next,i.next=t),r.interleaved=t,la(e,n)}function nh(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pb(e,n)}}function Xk(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function zh(e,t,n,r){var i=e.updateQueue;Ra=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var c=o,u=c.next;c.next=null,s===null?a=u:s.next=u,s=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==s&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=c))}if(a!==null){var f=i.baseState;s=0,d=u=c=null,o=a;do{var h=o.lane,p=o.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var g=e,y=o;switch(h=t,p=n,y.tag){case 1:if(g=y.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=Dt({},f,h);break e;case 2:Ra=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[o]:h.push(o))}else p={eventTime:p,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,s|=h;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;h=o,o=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);uo|=s,e.lanes=s,e.memoizedState=f}}function Zk(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(he(191,i));i.call(r)}}}var xd={},Ei=hs(xd),Ou=hs(xd),_u=hs(xd);function Hs(e){if(e===xd)throw Error(he(174));return e}function Tb(e,t){switch(yt(_u,t),yt(Ou,e),yt(Ei,xd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Iy(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Iy(t,e)}kt(Ei),yt(Ei,t)}function Al(){kt(Ei),kt(Ou),kt(_u)}function TT(e){Hs(_u.current);var t=Hs(Ei.current),n=Iy(t,e.type);t!==n&&(yt(Ou,e),yt(Ei,n))}function Ob(e){Ou.current===e&&(kt(Ei),kt(Ou))}var Ot=hs(0);function $h(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var n0=[];function _b(){for(var e=0;e<n0.length;e++)n0[e]._workInProgressVersionPrimary=null;n0.length=0}var rh=ya.ReactCurrentDispatcher,r0=ya.ReactCurrentBatchConfig,co=0,Mt=null,Jt=null,on=null,Bh=!1,lu=!1,Mu=0,Nz=0;function Nn(){throw Error(he(321))}function Mb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ci(e[n],t[n]))return!1;return!0}function Db(e,t,n,r,i,a){if(co=a,Mt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rh.current=e===null||e.memoizedState===null?Az:Tz,e=n(r,i),lu){a=0;do{if(lu=!1,Mu=0,25<=a)throw Error(he(301));a+=1,on=Jt=null,t.updateQueue=null,rh.current=Oz,e=n(r,i)}while(lu)}if(rh.current=Uh,t=Jt!==null&&Jt.next!==null,co=0,on=Jt=Mt=null,Bh=!1,t)throw Error(he(300));return e}function Ib(){var e=Mu!==0;return Mu=0,e}function bi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Mt.memoizedState=on=e:on=on.next=e,on}function Wr(){if(Jt===null){var e=Mt.alternate;e=e!==null?e.memoizedState:null}else e=Jt.next;var t=on===null?Mt.memoizedState:on.next;if(t!==null)on=t,Jt=e;else{if(e===null)throw Error(he(310));Jt=e,e={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},on===null?Mt.memoizedState=on=e:on=on.next=e}return on}function Du(e,t){return typeof t=="function"?t(e):t}function i0(e){var t=Wr(),n=t.queue;if(n===null)throw Error(he(311));n.lastRenderedReducer=e;var r=Jt,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var o=s=null,c=null,u=a;do{var d=u.lane;if((co&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(o=c=f,s=r):c=c.next=f,Mt.lanes|=d,uo|=d}u=u.next}while(u!==null&&u!==a);c===null?s=r:c.next=o,ci(r,t.memoizedState)||(er=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do a=i.lane,Mt.lanes|=a,uo|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function a0(e){var t=Wr(),n=t.queue;if(n===null)throw Error(he(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);ci(a,t.memoizedState)||(er=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function OT(){}function _T(e,t){var n=Mt,r=Wr(),i=t(),a=!ci(r.memoizedState,i);if(a&&(r.memoizedState=i,er=!0),r=r.queue,Lb(IT.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||on!==null&&on.memoizedState.tag&1){if(n.flags|=2048,Iu(9,DT.bind(null,n,r,i,t),void 0,null),ln===null)throw Error(he(349));co&30||MT(n,t,i)}return i}function MT(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Mt.updateQueue,t===null?(t={lastEffect:null,stores:null},Mt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function DT(e,t,n,r){t.value=n,t.getSnapshot=r,LT(t)&&RT(e)}function IT(e,t,n){return n(function(){LT(t)&&RT(e)})}function LT(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ci(e,n)}catch{return!0}}function RT(e){var t=la(e,1);t!==null&&ai(t,e,1,-1)}function Qk(e){var t=bi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Du,lastRenderedState:e},t.queue=e,e=e.dispatch=Ez.bind(null,Mt,e),[t.memoizedState,e]}function Iu(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Mt.updateQueue,t===null?(t={lastEffect:null,stores:null},Mt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function FT(){return Wr().memoizedState}function ih(e,t,n,r){var i=bi();Mt.flags|=e,i.memoizedState=Iu(1|t,n,void 0,r===void 0?null:r)}function dm(e,t,n,r){var i=Wr();r=r===void 0?null:r;var a=void 0;if(Jt!==null){var s=Jt.memoizedState;if(a=s.destroy,r!==null&&Mb(r,s.deps)){i.memoizedState=Iu(t,n,a,r);return}}Mt.flags|=e,i.memoizedState=Iu(1|t,n,a,r)}function Jk(e,t){return ih(8390656,8,e,t)}function Lb(e,t){return dm(2048,8,e,t)}function zT(e,t){return dm(4,2,e,t)}function $T(e,t){return dm(4,4,e,t)}function BT(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function UT(e,t,n){return n=n!=null?n.concat([e]):null,dm(4,4,BT.bind(null,t,e),n)}function Rb(){}function VT(e,t){var n=Wr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mb(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function WT(e,t){var n=Wr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mb(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function HT(e,t,n){return co&21?(ci(n,t)||(n=XA(),Mt.lanes|=n,uo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,er=!0),e.memoizedState=n)}function Cz(e,t){var n=st;st=n!==0&&4>n?n:4,e(!0);var r=r0.transition;r0.transition={};try{e(!1),t()}finally{st=n,r0.transition=r}}function KT(){return Wr().memoizedState}function Pz(e,t,n){var r=es(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},GT(e))qT(t,n);else if(n=ET(e,t,n,r),n!==null){var i=Vn();ai(n,e,r,i),YT(n,t,r)}}function Ez(e,t,n){var r=es(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(GT(e))qT(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var s=t.lastRenderedState,o=a(s,n);if(i.hasEagerState=!0,i.eagerState=o,ci(o,s)){var c=t.interleaved;c===null?(i.next=i,Eb(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=ET(e,t,i,r),n!==null&&(i=Vn(),ai(n,e,r,i),YT(n,t,r))}}function GT(e){var t=e.alternate;return e===Mt||t!==null&&t===Mt}function qT(e,t){lu=Bh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function YT(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pb(e,n)}}var Uh={readContext:Vr,useCallback:Nn,useContext:Nn,useEffect:Nn,useImperativeHandle:Nn,useInsertionEffect:Nn,useLayoutEffect:Nn,useMemo:Nn,useReducer:Nn,useRef:Nn,useState:Nn,useDebugValue:Nn,useDeferredValue:Nn,useTransition:Nn,useMutableSource:Nn,useSyncExternalStore:Nn,useId:Nn,unstable_isNewReconciler:!1},Az={readContext:Vr,useCallback:function(e,t){return bi().memoizedState=[e,t===void 0?null:t],e},useContext:Vr,useEffect:Jk,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ih(4194308,4,BT.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ih(4194308,4,e,t)},useInsertionEffect:function(e,t){return ih(4,2,e,t)},useMemo:function(e,t){var n=bi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=bi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Pz.bind(null,Mt,e),[r.memoizedState,e]},useRef:function(e){var t=bi();return e={current:e},t.memoizedState=e},useState:Qk,useDebugValue:Rb,useDeferredValue:function(e){return bi().memoizedState=e},useTransition:function(){var e=Qk(!1),t=e[0];return e=Cz.bind(null,e[1]),bi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Mt,i=bi();if(Et){if(n===void 0)throw Error(he(407));n=n()}else{if(n=t(),ln===null)throw Error(he(349));co&30||MT(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Jk(IT.bind(null,r,a,e),[e]),r.flags|=2048,Iu(9,DT.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=bi(),t=ln.identifierPrefix;if(Et){var n=Yi,r=qi;n=(r&~(1<<32-ii(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Mu++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Nz++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Tz={readContext:Vr,useCallback:VT,useContext:Vr,useEffect:Lb,useImperativeHandle:UT,useInsertionEffect:zT,useLayoutEffect:$T,useMemo:WT,useReducer:i0,useRef:FT,useState:function(){return i0(Du)},useDebugValue:Rb,useDeferredValue:function(e){var t=Wr();return HT(t,Jt.memoizedState,e)},useTransition:function(){var e=i0(Du)[0],t=Wr().memoizedState;return[e,t]},useMutableSource:OT,useSyncExternalStore:_T,useId:KT,unstable_isNewReconciler:!1},Oz={readContext:Vr,useCallback:VT,useContext:Vr,useEffect:Lb,useImperativeHandle:UT,useInsertionEffect:zT,useLayoutEffect:$T,useMemo:WT,useReducer:a0,useRef:FT,useState:function(){return a0(Du)},useDebugValue:Rb,useDeferredValue:function(e){var t=Wr();return Jt===null?t.memoizedState=e:HT(t,Jt.memoizedState,e)},useTransition:function(){var e=a0(Du)[0],t=Wr().memoizedState;return[e,t]},useMutableSource:OT,useSyncExternalStore:_T,useId:KT,unstable_isNewReconciler:!1};function Zr(e,t){if(e&&e.defaultProps){t=Dt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function nx(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Dt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var fm={isMounted:function(e){return(e=e._reactInternals)?No(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Vn(),i=es(e),a=Qi(r,i);a.payload=t,n!=null&&(a.callback=n),t=Qa(e,a,i),t!==null&&(ai(t,e,i,r),nh(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Vn(),i=es(e),a=Qi(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Qa(e,a,i),t!==null&&(ai(t,e,i,r),nh(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vn(),r=es(e),i=Qi(n,r);i.tag=2,t!=null&&(i.callback=t),t=Qa(e,i,r),t!==null&&(ai(t,e,r,n),nh(t,e,r))}};function ej(e,t,n,r,i,a,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,s):t.prototype&&t.prototype.isPureReactComponent?!Pu(n,r)||!Pu(i,a):!0}function XT(e,t,n){var r=!1,i=ss,a=t.contextType;return typeof a=="object"&&a!==null?a=Vr(a):(i=ir(t)?oo:Dn.current,r=t.contextTypes,a=(r=r!=null)?Cl(e,i):ss),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=fm,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function tj(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&fm.enqueueReplaceState(t,t.state,null)}function rx(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Ab(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Vr(a):(a=ir(t)?oo:Dn.current,i.context=Cl(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(nx(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&fm.enqueueReplaceState(i,i.state,null),zh(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Tl(e,t){try{var n="",r=t;do n+=aF(r),r=r.return;while(r);var i=n}catch(a){i=`
39
+ Error generating stack: `+a.message+`
40
+ `+a.stack}return{value:e,source:t,stack:i,digest:null}}function s0(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ix(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var _z=typeof WeakMap=="function"?WeakMap:Map;function ZT(e,t,n){n=Qi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Wh||(Wh=!0,px=r),ix(e,t)},n}function QT(e,t,n){n=Qi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ix(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){ix(e,t),typeof r!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function nj(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new _z;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Kz.bind(null,e,t,n),t.then(e,e))}function rj(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ij(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Qi(-1,1),t.tag=2,Qa(n,t,1))),n.lanes|=1),e)}var Mz=ya.ReactCurrentOwner,er=!1;function Fn(e,t,n,r){t.child=e===null?PT(t,null,n,r):El(t,e.child,n,r)}function aj(e,t,n,r,i){n=n.render;var a=t.ref;return xl(t,i),r=Db(e,t,n,r,a,i),n=Ib(),e!==null&&!er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ca(e,t,i)):(Et&&n&&Sb(t),t.flags|=1,Fn(e,t,r,i),t.child)}function sj(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!Hb(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,JT(e,t,a,r,i)):(e=lh(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:Pu,n(s,r)&&e.ref===t.ref)return ca(e,t,i)}return t.flags|=1,e=ts(a,r),e.ref=t.ref,e.return=t,t.child=e}function JT(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Pu(a,r)&&e.ref===t.ref)if(er=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(er=!0);else return t.lanes=e.lanes,ca(e,t,i)}return ax(e,t,n,r,i)}function eO(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},yt(al,fr),fr|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,yt(al,fr),fr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,yt(al,fr),fr|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,yt(al,fr),fr|=r;return Fn(e,t,i,n),t.child}function tO(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ax(e,t,n,r,i){var a=ir(n)?oo:Dn.current;return a=Cl(t,a),xl(t,i),n=Db(e,t,n,r,a,i),r=Ib(),e!==null&&!er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ca(e,t,i)):(Et&&r&&Sb(t),t.flags|=1,Fn(e,t,n,i),t.child)}function oj(e,t,n,r,i){if(ir(n)){var a=!0;Dh(t)}else a=!1;if(xl(t,i),t.stateNode===null)ah(e,t),XT(t,n,r),rx(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,o=t.memoizedProps;s.props=o;var c=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Vr(u):(u=ir(n)?oo:Dn.current,u=Cl(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==r||c!==u)&&tj(t,s,r,u),Ra=!1;var h=t.memoizedState;s.state=h,zh(t,r,s,i),c=t.memoizedState,o!==r||h!==c||rr.current||Ra?(typeof d=="function"&&(nx(t,n,d,r),c=t.memoizedState),(o=Ra||ej(t,n,o,r,h,c,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=o):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,AT(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:Zr(t.type,o),s.props=u,f=t.pendingProps,h=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=Vr(c):(c=ir(n)?oo:Dn.current,c=Cl(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==f||h!==c)&&tj(t,s,r,c),Ra=!1,h=t.memoizedState,s.state=h,zh(t,r,s,i);var g=t.memoizedState;o!==f||h!==g||rr.current||Ra?(typeof p=="function"&&(nx(t,n,p,r),g=t.memoizedState),(u=Ra||ej(t,n,u,r,h,g,c)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),s.props=r,s.state=g,s.context=c,r=u):(typeof s.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return sx(e,t,n,r,a,i)}function sx(e,t,n,r,i,a){tO(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&Kk(t,n,!1),ca(e,t,a);r=t.stateNode,Mz.current=t;var o=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=El(t,e.child,null,a),t.child=El(t,null,o,a)):Fn(e,t,o,a),t.memoizedState=r.state,i&&Kk(t,n,!0),t.child}function nO(e){var t=e.stateNode;t.pendingContext?Hk(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Hk(e,t.context,!1),Tb(e,t.containerInfo)}function lj(e,t,n,r,i){return Pl(),jb(i),t.flags|=256,Fn(e,t,n,r),t.child}var ox={dehydrated:null,treeContext:null,retryLane:0};function lx(e){return{baseLanes:e,cachePool:null,transitions:null}}function rO(e,t,n){var r=t.pendingProps,i=Ot.current,a=!1,s=(t.flags&128)!==0,o;if((o=s)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),yt(Ot,i&1),e===null)return ex(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,a?(r=t.mode,a=t.child,s={mode:"hidden",children:s},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=s):a=mm(s,r,0,null),e=eo(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=lx(n),t.memoizedState=ox,e):Fb(t,s));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return Dz(e,t,s,r,o,i,n);if(a){a=r.fallback,s=t.mode,i=e.child,o=i.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=ts(i,c),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?a=ts(o,a):(a=eo(a,s,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,s=e.child.memoizedState,s=s===null?lx(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~n,t.memoizedState=ox,r}return a=e.child,e=a.sibling,r=ts(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Fb(e,t){return t=mm({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function mf(e,t,n,r){return r!==null&&jb(r),El(t,e.child,null,n),e=Fb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dz(e,t,n,r,i,a,s){if(n)return t.flags&256?(t.flags&=-257,r=s0(Error(he(422))),mf(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=mm({mode:"visible",children:r.children},i,0,null),a=eo(a,i,s,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&El(t,e.child,null,s),t.child.memoizedState=lx(s),t.memoizedState=ox,a);if(!(t.mode&1))return mf(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,a=Error(he(419)),r=s0(a,r,void 0),mf(e,t,s,r)}if(o=(s&e.childLanes)!==0,er||o){if(r=ln,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,la(e,i),ai(r,e,i,-1))}return Wb(),r=s0(Error(he(421))),mf(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Gz.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,mr=Za(i.nextSibling),yr=t,Et=!0,ei=null,e!==null&&(Ir[Lr++]=qi,Ir[Lr++]=Yi,Ir[Lr++]=lo,qi=e.id,Yi=e.overflow,lo=t),t=Fb(t,r.children),t.flags|=4096,t)}function cj(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),tx(e.return,t,n)}function o0(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function iO(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Fn(e,t,r.children,n),r=Ot.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cj(e,n,t);else if(e.tag===19)cj(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(yt(Ot,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&$h(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),o0(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&$h(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}o0(t,!0,n,null,a);break;case"together":o0(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ah(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ca(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),uo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(he(153));if(t.child!==null){for(e=t.child,n=ts(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ts(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Iz(e,t,n){switch(t.tag){case 3:nO(t),Pl();break;case 5:TT(t);break;case 1:ir(t.type)&&Dh(t);break;case 4:Tb(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;yt(Rh,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(yt(Ot,Ot.current&1),t.flags|=128,null):n&t.child.childLanes?rO(e,t,n):(yt(Ot,Ot.current&1),e=ca(e,t,n),e!==null?e.sibling:null);yt(Ot,Ot.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return iO(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),yt(Ot,Ot.current),r)break;return null;case 22:case 23:return t.lanes=0,eO(e,t,n)}return ca(e,t,n)}var aO,cx,sO,oO;aO=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};cx=function(){};sO=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Hs(Ei.current);var a=null;switch(n){case"input":i=Oy(e,i),r=Oy(e,r),a=[];break;case"select":i=Dt({},i,{value:void 0}),r=Dt({},r,{value:void 0}),a=[];break;case"textarea":i=Dy(e,i),r=Dy(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=_h)}Ly(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(s in o)o.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(bu.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(o=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(s in o)!o.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&o[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(bu.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&bt("scroll",e),a||o===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};oO=function(e,t,n,r){n!==r&&(t.flags|=4)};function kc(e,t){if(!Et)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Cn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lz(e,t,n){var r=t.pendingProps;switch(kb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cn(t),null;case 1:return ir(t.type)&&Mh(),Cn(t),null;case 3:return r=t.stateNode,Al(),kt(rr),kt(Dn),_b(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(hf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ei!==null&&(yx(ei),ei=null))),cx(e,t),Cn(t),null;case 5:Ob(t);var i=Hs(_u.current);if(n=t.type,e!==null&&t.stateNode!=null)sO(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(he(166));return Cn(t),null}if(e=Hs(Ei.current),hf(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[ji]=t,r[Tu]=a,e=(t.mode&1)!==0,n){case"dialog":bt("cancel",r),bt("close",r);break;case"iframe":case"object":case"embed":bt("load",r);break;case"video":case"audio":for(i=0;i<Yc.length;i++)bt(Yc[i],r);break;case"source":bt("error",r);break;case"img":case"image":case"link":bt("error",r),bt("load",r);break;case"details":bt("toggle",r);break;case"input":xk(r,a),bt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},bt("invalid",r);break;case"textarea":bk(r,a),bt("invalid",r)}Ly(n,a),i=null;for(var s in a)if(a.hasOwnProperty(s)){var o=a[s];s==="children"?typeof o=="string"?r.textContent!==o&&(a.suppressHydrationWarning!==!0&&ff(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(a.suppressHydrationWarning!==!0&&ff(r.textContent,o,e),i=["children",""+o]):bu.hasOwnProperty(s)&&o!=null&&s==="onScroll"&&bt("scroll",r)}switch(n){case"input":rf(r),vk(r,a,!0);break;case"textarea":rf(r),wk(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=_h)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=IA(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[ji]=t,e[Tu]=r,aO(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ry(n,r),n){case"dialog":bt("cancel",e),bt("close",e),i=r;break;case"iframe":case"object":case"embed":bt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Yc.length;i++)bt(Yc[i],e);i=r;break;case"source":bt("error",e),i=r;break;case"img":case"image":case"link":bt("error",e),bt("load",e),i=r;break;case"details":bt("toggle",e),i=r;break;case"input":xk(e,r),i=Oy(e,r),bt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Dt({},r,{value:void 0}),bt("invalid",e);break;case"textarea":bk(e,r),i=Dy(e,r),bt("invalid",e);break;default:i=r}Ly(n,i),o=i;for(a in o)if(o.hasOwnProperty(a)){var c=o[a];a==="style"?FA(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&LA(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&wu(e,c):typeof c=="number"&&wu(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(bu.hasOwnProperty(a)?c!=null&&a==="onScroll"&&bt("scroll",e):c!=null&&lb(e,a,c,s))}switch(n){case"input":rf(e),vk(e,r,!1);break;case"textarea":rf(e),wk(e);break;case"option":r.value!=null&&e.setAttribute("value",""+as(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?pl(e,!!r.multiple,a,!1):r.defaultValue!=null&&pl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=_h)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Cn(t),null;case 6:if(e&&t.stateNode!=null)oO(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(he(166));if(n=Hs(_u.current),Hs(Ei.current),hf(t)){if(r=t.stateNode,n=t.memoizedProps,r[ji]=t,(a=r.nodeValue!==n)&&(e=yr,e!==null))switch(e.tag){case 3:ff(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ff(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ji]=t,t.stateNode=r}return Cn(t),null;case 13:if(kt(Ot),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Et&&mr!==null&&t.mode&1&&!(t.flags&128))NT(),Pl(),t.flags|=98560,a=!1;else if(a=hf(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(he(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(he(317));a[ji]=t}else Pl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cn(t),a=!1}else ei!==null&&(yx(ei),ei=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ot.current&1?tn===0&&(tn=3):Wb())),t.updateQueue!==null&&(t.flags|=4),Cn(t),null);case 4:return Al(),cx(e,t),e===null&&Eu(t.stateNode.containerInfo),Cn(t),null;case 10:return Pb(t.type._context),Cn(t),null;case 17:return ir(t.type)&&Mh(),Cn(t),null;case 19:if(kt(Ot),a=t.memoizedState,a===null)return Cn(t),null;if(r=(t.flags&128)!==0,s=a.rendering,s===null)if(r)kc(a,!1);else{if(tn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=$h(e),s!==null){for(t.flags|=128,kc(a,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,s=a.alternate,s===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=s.childLanes,a.lanes=s.lanes,a.child=s.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=s.memoizedProps,a.memoizedState=s.memoizedState,a.updateQueue=s.updateQueue,a.type=s.type,e=s.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return yt(Ot,Ot.current&1|2),t.child}e=e.sibling}a.tail!==null&&Vt()>Ol&&(t.flags|=128,r=!0,kc(a,!1),t.lanes=4194304)}else{if(!r)if(e=$h(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kc(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Et)return Cn(t),null}else 2*Vt()-a.renderingStartTime>Ol&&n!==1073741824&&(t.flags|=128,r=!0,kc(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(n=a.last,n!==null?n.sibling=s:t.child=s,a.last=s)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Vt(),t.sibling=null,n=Ot.current,yt(Ot,r?n&1|2:n&1),t):(Cn(t),null);case 22:case 23:return Vb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?fr&1073741824&&(Cn(t),t.subtreeFlags&6&&(t.flags|=8192)):Cn(t),null;case 24:return null;case 25:return null}throw Error(he(156,t.tag))}function Rz(e,t){switch(kb(t),t.tag){case 1:return ir(t.type)&&Mh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Al(),kt(rr),kt(Dn),_b(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ob(t),null;case 13:if(kt(Ot),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(he(340));Pl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return kt(Ot),null;case 4:return Al(),null;case 10:return Pb(t.type._context),null;case 22:case 23:return Vb(),null;case 24:return null;default:return null}}var gf=!1,An=!1,Fz=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function il(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){zt(e,t,r)}else n.current=null}function ux(e,t,n){try{n()}catch(r){zt(e,t,r)}}var uj=!1;function zz(e,t){if(Gy=Ah,e=fT(),wb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,o=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(o=s+i),f!==a||r!==0&&f.nodeType!==3||(c=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===i&&(o=s),h===a&&++d===r&&(c=s),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(qy={focusedElem:e,selectionRange:n},Ah=!1,Ne=t;Ne!==null;)if(t=Ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ne=e;else for(;Ne!==null;){t=Ne;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,x=g.memoizedState,b=t.stateNode,v=b.getSnapshotBeforeUpdate(t.elementType===t.type?y:Zr(t.type,y),x);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(he(163))}}catch(k){zt(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return g=uj,uj=!1,g}function cu(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&ux(t,n,a)}i=i.next}while(i!==r)}}function hm(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function dx(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function lO(e){var t=e.alternate;t!==null&&(e.alternate=null,lO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ji],delete t[Tu],delete t[Zy],delete t[wz],delete t[Sz])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function cO(e){return e.tag===5||e.tag===3||e.tag===4}function dj(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cO(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fx(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=_h));else if(r!==4&&(e=e.child,e!==null))for(fx(e,t,n),e=e.sibling;e!==null;)fx(e,t,n),e=e.sibling}function hx(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hx(e,t,n),e=e.sibling;e!==null;)hx(e,t,n),e=e.sibling}var mn=null,Qr=!1;function Ea(e,t,n){for(n=n.child;n!==null;)uO(e,t,n),n=n.sibling}function uO(e,t,n){if(Pi&&typeof Pi.onCommitFiberUnmount=="function")try{Pi.onCommitFiberUnmount(am,n)}catch{}switch(n.tag){case 5:An||il(n,t);case 6:var r=mn,i=Qr;mn=null,Ea(e,t,n),mn=r,Qr=i,mn!==null&&(Qr?(e=mn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):mn.removeChild(n.stateNode));break;case 18:mn!==null&&(Qr?(e=mn,n=n.stateNode,e.nodeType===8?e0(e.parentNode,n):e.nodeType===1&&e0(e,n),Nu(e)):e0(mn,n.stateNode));break;case 4:r=mn,i=Qr,mn=n.stateNode.containerInfo,Qr=!0,Ea(e,t,n),mn=r,Qr=i;break;case 0:case 11:case 14:case 15:if(!An&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&ux(n,t,s),i=i.next}while(i!==r)}Ea(e,t,n);break;case 1:if(!An&&(il(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){zt(n,t,o)}Ea(e,t,n);break;case 21:Ea(e,t,n);break;case 22:n.mode&1?(An=(r=An)||n.memoizedState!==null,Ea(e,t,n),An=r):Ea(e,t,n);break;default:Ea(e,t,n)}}function fj(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Fz),t.forEach(function(r){var i=qz.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Yr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,s=t,o=s;e:for(;o!==null;){switch(o.tag){case 5:mn=o.stateNode,Qr=!1;break e;case 3:mn=o.stateNode.containerInfo,Qr=!0;break e;case 4:mn=o.stateNode.containerInfo,Qr=!0;break e}o=o.return}if(mn===null)throw Error(he(160));uO(a,s,i),mn=null,Qr=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){zt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)dO(t,e),t=t.sibling}function dO(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Yr(t,e),gi(e),r&4){try{cu(3,e,e.return),hm(3,e)}catch(y){zt(e,e.return,y)}try{cu(5,e,e.return)}catch(y){zt(e,e.return,y)}}break;case 1:Yr(t,e),gi(e),r&512&&n!==null&&il(n,n.return);break;case 5:if(Yr(t,e),gi(e),r&512&&n!==null&&il(n,n.return),e.flags&32){var i=e.stateNode;try{wu(i,"")}catch(y){zt(e,e.return,y)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,s=n!==null?n.memoizedProps:a,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&a.type==="radio"&&a.name!=null&&MA(i,a),Ry(o,s);var u=Ry(o,a);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];d==="style"?FA(i,f):d==="dangerouslySetInnerHTML"?LA(i,f):d==="children"?wu(i,f):lb(i,d,f,u)}switch(o){case"input":_y(i,a);break;case"textarea":DA(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?pl(i,!!a.multiple,p,!1):h!==!!a.multiple&&(a.defaultValue!=null?pl(i,!!a.multiple,a.defaultValue,!0):pl(i,!!a.multiple,a.multiple?[]:"",!1))}i[Tu]=a}catch(y){zt(e,e.return,y)}}break;case 6:if(Yr(t,e),gi(e),r&4){if(e.stateNode===null)throw Error(he(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(y){zt(e,e.return,y)}}break;case 3:if(Yr(t,e),gi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Nu(t.containerInfo)}catch(y){zt(e,e.return,y)}break;case 4:Yr(t,e),gi(e);break;case 13:Yr(t,e),gi(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(Bb=Vt())),r&4&&fj(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(An=(u=An)||d,Yr(t,e),An=u):Yr(t,e),gi(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Ne=e,d=e.child;d!==null;){for(f=Ne=d;Ne!==null;){switch(h=Ne,p=h.child,h.tag){case 0:case 11:case 14:case 15:cu(4,h,h.return);break;case 1:il(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(y){zt(r,n,y)}}break;case 5:il(h,h.return);break;case 22:if(h.memoizedState!==null){pj(f);continue}}p!==null?(p.return=h,Ne=p):pj(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(o=f.stateNode,c=f.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=RA("display",s))}catch(y){zt(e,e.return,y)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(y){zt(e,e.return,y)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Yr(t,e),gi(e),r&4&&fj(e);break;case 21:break;default:Yr(t,e),gi(e)}}function gi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(cO(n)){var r=n;break e}n=n.return}throw Error(he(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(wu(i,""),r.flags&=-33);var a=dj(e);hx(e,a,i);break;case 3:case 4:var s=r.stateNode.containerInfo,o=dj(e);fx(e,o,s);break;default:throw Error(he(161))}}catch(c){zt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $z(e,t,n){Ne=e,fO(e)}function fO(e,t,n){for(var r=(e.mode&1)!==0;Ne!==null;){var i=Ne,a=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||gf;if(!s){var o=i.alternate,c=o!==null&&o.memoizedState!==null||An;o=gf;var u=An;if(gf=s,(An=c)&&!u)for(Ne=i;Ne!==null;)s=Ne,c=s.child,s.tag===22&&s.memoizedState!==null?mj(i):c!==null?(c.return=s,Ne=c):mj(i);for(;a!==null;)Ne=a,fO(a),a=a.sibling;Ne=i,gf=o,An=u}hj(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Ne=a):hj(e)}}function hj(e){for(;Ne!==null;){var t=Ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:An||hm(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!An)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Zr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Zk(t,a,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Zk(t,s,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Nu(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(he(163))}An||t.flags&512&&dx(t)}catch(h){zt(t,t.return,h)}}if(t===e){Ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,Ne=n;break}Ne=t.return}}function pj(e){for(;Ne!==null;){var t=Ne;if(t===e){Ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Ne=n;break}Ne=t.return}}function mj(e){for(;Ne!==null;){var t=Ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{hm(4,t)}catch(c){zt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){zt(t,i,c)}}var a=t.return;try{dx(t)}catch(c){zt(t,a,c)}break;case 5:var s=t.return;try{dx(t)}catch(c){zt(t,s,c)}}}catch(c){zt(t,t.return,c)}if(t===e){Ne=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Ne=o;break}Ne=t.return}}var Bz=Math.ceil,Vh=ya.ReactCurrentDispatcher,zb=ya.ReactCurrentOwner,Ur=ya.ReactCurrentBatchConfig,Qe=0,ln=null,qt=null,bn=0,fr=0,al=hs(0),tn=0,Lu=null,uo=0,pm=0,$b=0,uu=null,Jn=null,Bb=0,Ol=1/0,Wi=null,Wh=!1,px=null,Ja=null,yf=!1,Wa=null,Hh=0,du=0,mx=null,sh=-1,oh=0;function Vn(){return Qe&6?Vt():sh!==-1?sh:sh=Vt()}function es(e){return e.mode&1?Qe&2&&bn!==0?bn&-bn:jz.transition!==null?(oh===0&&(oh=XA()),oh):(e=st,e!==0||(e=window.event,e=e===void 0?16:rT(e.type)),e):1}function ai(e,t,n,r){if(50<du)throw du=0,mx=null,Error(he(185));md(e,n,r),(!(Qe&2)||e!==ln)&&(e===ln&&(!(Qe&2)&&(pm|=n),tn===4&&Ba(e,bn)),ar(e,r),n===1&&Qe===0&&!(t.mode&1)&&(Ol=Vt()+500,um&&ps()))}function ar(e,t){var n=e.callbackNode;jF(e,t);var r=Eh(e,e===ln?bn:0);if(r===0)n!==null&&jk(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&jk(n),t===1)e.tag===0?kz(gj.bind(null,e)):ST(gj.bind(null,e)),vz(function(){!(Qe&6)&&ps()}),n=null;else{switch(ZA(r)){case 1:n=hb;break;case 4:n=qA;break;case 16:n=Ph;break;case 536870912:n=YA;break;default:n=Ph}n=bO(n,hO.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function hO(e,t){if(sh=-1,oh=0,Qe&6)throw Error(he(327));var n=e.callbackNode;if(vl()&&e.callbackNode!==n)return null;var r=Eh(e,e===ln?bn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Kh(e,r);else{t=r;var i=Qe;Qe|=2;var a=mO();(ln!==e||bn!==t)&&(Wi=null,Ol=Vt()+500,Js(e,t));do try{Wz();break}catch(o){pO(e,o)}while(!0);Cb(),Vh.current=a,Qe=i,qt!==null?t=0:(ln=null,bn=0,t=tn)}if(t!==0){if(t===2&&(i=Uy(e),i!==0&&(r=i,t=gx(e,i))),t===1)throw n=Lu,Js(e,0),Ba(e,r),ar(e,Vt()),n;if(t===6)Ba(e,r);else{if(i=e.current.alternate,!(r&30)&&!Uz(i)&&(t=Kh(e,r),t===2&&(a=Uy(e),a!==0&&(r=a,t=gx(e,a))),t===1))throw n=Lu,Js(e,0),Ba(e,r),ar(e,Vt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(he(345));case 2:Ds(e,Jn,Wi);break;case 3:if(Ba(e,r),(r&130023424)===r&&(t=Bb+500-Vt(),10<t)){if(Eh(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Vn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Xy(Ds.bind(null,e,Jn,Wi),t);break}Ds(e,Jn,Wi);break;case 4:if(Ba(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-ii(r);a=1<<s,s=t[s],s>i&&(i=s),r&=~a}if(r=i,r=Vt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Bz(r/1960))-r,10<r){e.timeoutHandle=Xy(Ds.bind(null,e,Jn,Wi),r);break}Ds(e,Jn,Wi);break;case 5:Ds(e,Jn,Wi);break;default:throw Error(he(329))}}}return ar(e,Vt()),e.callbackNode===n?hO.bind(null,e):null}function gx(e,t){var n=uu;return e.current.memoizedState.isDehydrated&&(Js(e,t).flags|=256),e=Kh(e,t),e!==2&&(t=Jn,Jn=n,t!==null&&yx(t)),e}function yx(e){Jn===null?Jn=e:Jn.push.apply(Jn,e)}function Uz(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!ci(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ba(e,t){for(t&=~$b,t&=~pm,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ii(t),r=1<<n;e[n]=-1,t&=~r}}function gj(e){if(Qe&6)throw Error(he(327));vl();var t=Eh(e,0);if(!(t&1))return ar(e,Vt()),null;var n=Kh(e,t);if(e.tag!==0&&n===2){var r=Uy(e);r!==0&&(t=r,n=gx(e,r))}if(n===1)throw n=Lu,Js(e,0),Ba(e,t),ar(e,Vt()),n;if(n===6)throw Error(he(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ds(e,Jn,Wi),ar(e,Vt()),null}function Ub(e,t){var n=Qe;Qe|=1;try{return e(t)}finally{Qe=n,Qe===0&&(Ol=Vt()+500,um&&ps())}}function fo(e){Wa!==null&&Wa.tag===0&&!(Qe&6)&&vl();var t=Qe;Qe|=1;var n=Ur.transition,r=st;try{if(Ur.transition=null,st=1,e)return e()}finally{st=r,Ur.transition=n,Qe=t,!(Qe&6)&&ps()}}function Vb(){fr=al.current,kt(al)}function Js(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,xz(n)),qt!==null)for(n=qt.return;n!==null;){var r=n;switch(kb(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Mh();break;case 3:Al(),kt(rr),kt(Dn),_b();break;case 5:Ob(r);break;case 4:Al();break;case 13:kt(Ot);break;case 19:kt(Ot);break;case 10:Pb(r.type._context);break;case 22:case 23:Vb()}n=n.return}if(ln=e,qt=e=ts(e.current,null),bn=fr=t,tn=0,Lu=null,$b=pm=uo=0,Jn=uu=null,Ws!==null){for(t=0;t<Ws.length;t++)if(n=Ws[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var s=a.next;a.next=i,r.next=s}n.pending=r}Ws=null}return e}function pO(e,t){do{var n=qt;try{if(Cb(),rh.current=Uh,Bh){for(var r=Mt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Bh=!1}if(co=0,on=Jt=Mt=null,lu=!1,Mu=0,zb.current=null,n===null||n.return===null){tn=1,Lu=t,qt=null;break}e:{var a=e,s=n.return,o=n,c=t;if(t=bn,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=o,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=rj(s);if(p!==null){p.flags&=-257,ij(p,s,o,a,t),p.mode&1&&nj(a,u,t),t=p,c=u;var g=t.updateQueue;if(g===null){var y=new Set;y.add(c),t.updateQueue=y}else g.add(c);break e}else{if(!(t&1)){nj(a,u,t),Wb();break e}c=Error(he(426))}}else if(Et&&o.mode&1){var x=rj(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),ij(x,s,o,a,t),jb(Tl(c,o));break e}}a=c=Tl(c,o),tn!==4&&(tn=2),uu===null?uu=[a]:uu.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var b=ZT(a,c,t);Xk(a,b);break e;case 1:o=c;var v=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ja===null||!Ja.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var k=QT(a,o,t);Xk(a,k);break e}}a=a.return}while(a!==null)}yO(n)}catch(S){t=S,qt===n&&n!==null&&(qt=n=n.return);continue}break}while(!0)}function mO(){var e=Vh.current;return Vh.current=Uh,e===null?Uh:e}function Wb(){(tn===0||tn===3||tn===2)&&(tn=4),ln===null||!(uo&268435455)&&!(pm&268435455)||Ba(ln,bn)}function Kh(e,t){var n=Qe;Qe|=2;var r=mO();(ln!==e||bn!==t)&&(Wi=null,Js(e,t));do try{Vz();break}catch(i){pO(e,i)}while(!0);if(Cb(),Qe=n,Vh.current=r,qt!==null)throw Error(he(261));return ln=null,bn=0,tn}function Vz(){for(;qt!==null;)gO(qt)}function Wz(){for(;qt!==null&&!mF();)gO(qt)}function gO(e){var t=vO(e.alternate,e,fr);e.memoizedProps=e.pendingProps,t===null?yO(e):qt=t,zb.current=null}function yO(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Rz(n,t),n!==null){n.flags&=32767,qt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{tn=6,qt=null;return}}else if(n=Lz(n,t,fr),n!==null){qt=n;return}if(t=t.sibling,t!==null){qt=t;return}qt=t=e}while(t!==null);tn===0&&(tn=5)}function Ds(e,t,n){var r=st,i=Ur.transition;try{Ur.transition=null,st=1,Hz(e,t,n,r)}finally{Ur.transition=i,st=r}return null}function Hz(e,t,n,r){do vl();while(Wa!==null);if(Qe&6)throw Error(he(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(he(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(NF(e,a),e===ln&&(qt=ln=null,bn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||yf||(yf=!0,bO(Ph,function(){return vl(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Ur.transition,Ur.transition=null;var s=st;st=1;var o=Qe;Qe|=4,zb.current=null,zz(e,n),dO(n,e),dz(qy),Ah=!!Gy,qy=Gy=null,e.current=n,$z(n),gF(),Qe=o,st=s,Ur.transition=a}else e.current=n;if(yf&&(yf=!1,Wa=e,Hh=i),a=e.pendingLanes,a===0&&(Ja=null),vF(n.stateNode),ar(e,Vt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Wh)throw Wh=!1,e=px,px=null,e;return Hh&1&&e.tag!==0&&vl(),a=e.pendingLanes,a&1?e===mx?du++:(du=0,mx=e):du=0,ps(),null}function vl(){if(Wa!==null){var e=ZA(Hh),t=Ur.transition,n=st;try{if(Ur.transition=null,st=16>e?16:e,Wa===null)var r=!1;else{if(e=Wa,Wa=null,Hh=0,Qe&6)throw Error(he(331));var i=Qe;for(Qe|=4,Ne=e.current;Ne!==null;){var a=Ne,s=a.child;if(Ne.flags&16){var o=a.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(Ne=u;Ne!==null;){var d=Ne;switch(d.tag){case 0:case 11:case 15:cu(8,d,a)}var f=d.child;if(f!==null)f.return=d,Ne=f;else for(;Ne!==null;){d=Ne;var h=d.sibling,p=d.return;if(lO(d),d===u){Ne=null;break}if(h!==null){h.return=p,Ne=h;break}Ne=p}}}var g=a.alternate;if(g!==null){var y=g.child;if(y!==null){g.child=null;do{var x=y.sibling;y.sibling=null,y=x}while(y!==null)}}Ne=a}}if(a.subtreeFlags&2064&&s!==null)s.return=a,Ne=s;else e:for(;Ne!==null;){if(a=Ne,a.flags&2048)switch(a.tag){case 0:case 11:case 15:cu(9,a,a.return)}var b=a.sibling;if(b!==null){b.return=a.return,Ne=b;break e}Ne=a.return}}var v=e.current;for(Ne=v;Ne!==null;){s=Ne;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,Ne=w;else e:for(s=v;Ne!==null;){if(o=Ne,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:hm(9,o)}}catch(S){zt(o,o.return,S)}if(o===s){Ne=null;break e}var k=o.sibling;if(k!==null){k.return=o.return,Ne=k;break e}Ne=o.return}}if(Qe=i,ps(),Pi&&typeof Pi.onPostCommitFiberRoot=="function")try{Pi.onPostCommitFiberRoot(am,e)}catch{}r=!0}return r}finally{st=n,Ur.transition=t}}return!1}function yj(e,t,n){t=Tl(n,t),t=ZT(e,t,1),e=Qa(e,t,1),t=Vn(),e!==null&&(md(e,1,t),ar(e,t))}function zt(e,t,n){if(e.tag===3)yj(e,e,n);else for(;t!==null;){if(t.tag===3){yj(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ja===null||!Ja.has(r))){e=Tl(n,e),e=QT(t,e,1),t=Qa(t,e,1),e=Vn(),t!==null&&(md(t,1,e),ar(t,e));break}}t=t.return}}function Kz(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Vn(),e.pingedLanes|=e.suspendedLanes&n,ln===e&&(bn&n)===n&&(tn===4||tn===3&&(bn&130023424)===bn&&500>Vt()-Bb?Js(e,0):$b|=n),ar(e,t)}function xO(e,t){t===0&&(e.mode&1?(t=of,of<<=1,!(of&130023424)&&(of=4194304)):t=1);var n=Vn();e=la(e,t),e!==null&&(md(e,t,n),ar(e,n))}function Gz(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xO(e,n)}function qz(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(he(314))}r!==null&&r.delete(t),xO(e,n)}var vO;vO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rr.current)er=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return er=!1,Iz(e,t,n);er=!!(e.flags&131072)}else er=!1,Et&&t.flags&1048576&&kT(t,Lh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ah(e,t),e=t.pendingProps;var i=Cl(t,Dn.current);xl(t,n),i=Db(null,t,r,e,i,n);var a=Ib();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ir(r)?(a=!0,Dh(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ab(t),i.updater=fm,t.stateNode=i,i._reactInternals=t,rx(t,r,e,n),t=sx(null,t,r,!0,a,n)):(t.tag=0,Et&&a&&Sb(t),Fn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ah(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Xz(r),e=Zr(r,e),i){case 0:t=ax(null,t,r,e,n);break e;case 1:t=oj(null,t,r,e,n);break e;case 11:t=aj(null,t,r,e,n);break e;case 14:t=sj(null,t,r,Zr(r.type,e),n);break e}throw Error(he(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zr(r,i),ax(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zr(r,i),oj(e,t,r,i,n);case 3:e:{if(nO(t),e===null)throw Error(he(387));r=t.pendingProps,a=t.memoizedState,i=a.element,AT(e,t),zh(t,r,null,n);var s=t.memoizedState;if(r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Tl(Error(he(423)),t),t=lj(e,t,r,n,i);break e}else if(r!==i){i=Tl(Error(he(424)),t),t=lj(e,t,r,n,i);break e}else for(mr=Za(t.stateNode.containerInfo.firstChild),yr=t,Et=!0,ei=null,n=PT(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Pl(),r===i){t=ca(e,t,n);break e}Fn(e,t,r,n)}t=t.child}return t;case 5:return TT(t),e===null&&ex(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,s=i.children,Yy(r,i)?s=null:a!==null&&Yy(r,a)&&(t.flags|=32),tO(e,t),Fn(e,t,s,n),t.child;case 6:return e===null&&ex(t),null;case 13:return rO(e,t,n);case 4:return Tb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=El(t,null,r,n):Fn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zr(r,i),aj(e,t,r,i,n);case 7:return Fn(e,t,t.pendingProps,n),t.child;case 8:return Fn(e,t,t.pendingProps.children,n),t.child;case 12:return Fn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value,yt(Rh,r._currentValue),r._currentValue=s,a!==null)if(ci(a.value,s)){if(a.children===i.children&&!rr.current){t=ca(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var o=a.dependencies;if(o!==null){s=a.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=Qi(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),tx(a.return,n,t),o.lanes|=n;break}c=c.next}}else if(a.tag===10)s=a.type===t.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(he(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),tx(s,n,t),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}Fn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,xl(t,n),i=Vr(i),r=r(i),t.flags|=1,Fn(e,t,r,n),t.child;case 14:return r=t.type,i=Zr(r,t.pendingProps),i=Zr(r.type,i),sj(e,t,r,i,n);case 15:return JT(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zr(r,i),ah(e,t),t.tag=1,ir(r)?(e=!0,Dh(t)):e=!1,xl(t,n),XT(t,r,i),rx(t,r,i,n),sx(null,t,r,!0,e,n);case 19:return iO(e,t,n);case 22:return eO(e,t,n)}throw Error(he(156,t.tag))};function bO(e,t){return GA(e,t)}function Yz(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fr(e,t,n,r){return new Yz(e,t,n,r)}function Hb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xz(e){if(typeof e=="function")return Hb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ub)return 11;if(e===db)return 14}return 2}function ts(e,t){var n=e.alternate;return n===null?(n=Fr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function lh(e,t,n,r,i,a){var s=2;if(r=e,typeof e=="function")Hb(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Yo:return eo(n.children,i,a,t);case cb:s=8,i|=8;break;case Py:return e=Fr(12,n,t,i|2),e.elementType=Py,e.lanes=a,e;case Ey:return e=Fr(13,n,t,i),e.elementType=Ey,e.lanes=a,e;case Ay:return e=Fr(19,n,t,i),e.elementType=Ay,e.lanes=a,e;case TA:return mm(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case EA:s=10;break e;case AA:s=9;break e;case ub:s=11;break e;case db:s=14;break e;case La:s=16,r=null;break e}throw Error(he(130,e==null?e:typeof e,""))}return t=Fr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function eo(e,t,n,r){return e=Fr(7,e,r,t),e.lanes=n,e}function mm(e,t,n,r){return e=Fr(22,e,r,t),e.elementType=TA,e.lanes=n,e.stateNode={isHidden:!1},e}function l0(e,t,n){return e=Fr(6,e,null,t),e.lanes=n,e}function c0(e,t,n){return t=Fr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Zz(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vg(0),this.expirationTimes=Vg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vg(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Kb(e,t,n,r,i,a,s,o,c){return e=new Zz(e,t,n,o,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Fr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ab(a),e}function Qz(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function wO(e){if(!e)return ss;e=e._reactInternals;e:{if(No(e)!==e||e.tag!==1)throw Error(he(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ir(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(he(171))}if(e.tag===1){var n=e.type;if(ir(n))return wT(e,n,t)}return t}function SO(e,t,n,r,i,a,s,o,c){return e=Kb(n,r,!0,e,i,a,s,o,c),e.context=wO(null),n=e.current,r=Vn(),i=es(n),a=Qi(r,i),a.callback=t??null,Qa(n,a,i),e.current.lanes=i,md(e,i,r),ar(e,r),e}function gm(e,t,n,r){var i=t.current,a=Vn(),s=es(i);return n=wO(n),t.context===null?t.context=n:t.pendingContext=n,t=Qi(a,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Qa(i,t,s),e!==null&&(ai(e,i,s,a),nh(e,i,s)),s}function Gh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function xj(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Gb(e,t){xj(e,t),(e=e.alternate)&&xj(e,t)}function Jz(){return null}var kO=typeof reportError=="function"?reportError:function(e){console.error(e)};function qb(e){this._internalRoot=e}ym.prototype.render=qb.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(he(409));gm(e,t,null,null)};ym.prototype.unmount=qb.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fo(function(){gm(null,e,null,null)}),t[oa]=null}};function ym(e){this._internalRoot=e}ym.prototype.unstable_scheduleHydration=function(e){if(e){var t=eT();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$a.length&&t!==0&&t<$a[n].priority;n++);$a.splice(n,0,e),n===0&&nT(e)}};function Yb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function xm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function vj(){}function e$(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=Gh(s);a.call(u)}}var s=SO(t,r,e,0,null,!1,!1,"",vj);return e._reactRootContainer=s,e[oa]=s.current,Eu(e.nodeType===8?e.parentNode:e),fo(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var u=Gh(c);o.call(u)}}var c=Kb(e,0,!1,null,null,!1,!1,"",vj);return e._reactRootContainer=c,e[oa]=c.current,Eu(e.nodeType===8?e.parentNode:e),fo(function(){gm(t,c,n,r)}),c}function vm(e,t,n,r,i){var a=n._reactRootContainer;if(a){var s=a;if(typeof i=="function"){var o=i;i=function(){var c=Gh(s);o.call(c)}}gm(t,s,e,i)}else s=e$(n,t,e,i,r);return Gh(s)}QA=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=qc(t.pendingLanes);n!==0&&(pb(t,n|1),ar(t,Vt()),!(Qe&6)&&(Ol=Vt()+500,ps()))}break;case 13:fo(function(){var r=la(e,1);if(r!==null){var i=Vn();ai(r,e,1,i)}}),Gb(e,1)}};mb=function(e){if(e.tag===13){var t=la(e,134217728);if(t!==null){var n=Vn();ai(t,e,134217728,n)}Gb(e,134217728)}};JA=function(e){if(e.tag===13){var t=es(e),n=la(e,t);if(n!==null){var r=Vn();ai(n,e,t,r)}Gb(e,t)}};eT=function(){return st};tT=function(e,t){var n=st;try{return st=e,t()}finally{st=n}};zy=function(e,t,n){switch(t){case"input":if(_y(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=cm(r);if(!i)throw Error(he(90));_A(r),_y(r,i)}}}break;case"textarea":DA(e,n);break;case"select":t=n.value,t!=null&&pl(e,!!n.multiple,t,!1)}};BA=Ub;UA=fo;var t$={usingClientEntryPoint:!1,Events:[yd,Jo,cm,zA,$A,Ub]},jc={findFiberByHostInstance:Vs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},n$={bundleType:jc.bundleType,version:jc.version,rendererPackageName:jc.rendererPackageName,rendererConfig:jc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ya.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=HA(e),e===null?null:e.stateNode},findFiberByHostInstance:jc.findFiberByHostInstance||Jz,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 xf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xf.isDisabled&&xf.supportsFiber)try{am=xf.inject(n$),Pi=xf}catch{}}Cr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t$;Cr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yb(t))throw Error(he(200));return Qz(e,t,null,n)};Cr.createRoot=function(e,t){if(!Yb(e))throw Error(he(299));var n=!1,r="",i=kO;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Kb(e,1,!1,null,null,n,!1,r,i),e[oa]=t.current,Eu(e.nodeType===8?e.parentNode:e),new qb(t)};Cr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(he(188)):(e=Object.keys(e).join(","),Error(he(268,e)));return e=HA(t),e=e===null?null:e.stateNode,e};Cr.flushSync=function(e){return fo(e)};Cr.hydrate=function(e,t,n){if(!xm(t))throw Error(he(200));return vm(null,e,t,!0,n)};Cr.hydrateRoot=function(e,t,n){if(!Yb(e))throw Error(he(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",s=kO;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=SO(t,null,e,1,n??null,i,!1,a,s),e[oa]=t.current,Eu(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new ym(t)};Cr.render=function(e,t,n){if(!xm(t))throw Error(he(200));return vm(null,e,t,!1,n)};Cr.unmountComponentAtNode=function(e){if(!xm(e))throw Error(he(40));return e._reactRootContainer?(fo(function(){vm(null,null,e,!1,function(){e._reactRootContainer=null,e[oa]=null})}),!0):!1};Cr.unstable_batchedUpdates=Ub;Cr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!xm(n))throw Error(he(200));if(e==null||e._reactInternals===void 0)throw Error(he(38));return vm(e,t,n,!1,r)};Cr.version="18.3.1-next-f1338f8080-20240426";function jO(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jO)}catch(e){console.error(e)}}jO(),jA.exports=Cr;var Co=jA.exports;const r$=hi(Co),i$=dA({__proto__:null,default:r$},[Co]);var bj=Co;Ny.createRoot=bj.createRoot,Ny.hydrateRoot=bj.hydrateRoot;/**
41
+ * @remix-run/router v1.23.2
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */function Pt(){return Pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pt.apply(this,arguments)}var Gt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Gt||(Gt={}));const wj="popstate";function a$(e){e===void 0&&(e={});function t(r,i){let{pathname:a,search:s,hash:o}=r.location;return Ru("",{pathname:a,search:s,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:po(i)}return o$(t,n,null,e)}function Ve(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ho(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function s$(){return Math.random().toString(36).substr(2,8)}function Sj(e,t){return{usr:e.state,key:e.key,idx:t}}function Ru(e,t,n,r){return n===void 0&&(n=null),Pt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ms(t):t,{state:n,key:t&&t.key||r||s$()})}function po(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ms(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function o$(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,o=Gt.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(Pt({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){o=Gt.Pop;let x=d(),b=x==null?null:x-u;u=x,c&&c({action:o,location:y.location,delta:b})}function h(x,b){o=Gt.Push;let v=Ru(y.location,x,b);u=d()+1;let w=Sj(v,u),k=y.createHref(v);try{s.pushState(w,"",k)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(k)}a&&c&&c({action:o,location:y.location,delta:1})}function p(x,b){o=Gt.Replace;let v=Ru(y.location,x,b);u=d();let w=Sj(v,u),k=y.createHref(v);s.replaceState(w,"",k),a&&c&&c({action:o,location:y.location,delta:0})}function g(x){let b=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof x=="string"?x:po(x);return v=v.replace(/ $/,"%20"),Ve(b,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,b)}let y={get action(){return o},get location(){return e(i,s)},listen(x){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(wj,f),c=x,()=>{i.removeEventListener(wj,f),c=null}},createHref(x){return t(i,x)},createURL:g,encodeLocation(x){let b=g(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:p,go(x){return s.go(x)}};return y}var at;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(at||(at={}));const l$=new Set(["lazy","caseSensitive","path","id","index","children"]);function c$(e){return e.index===!0}function qh(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,a)=>{let s=[...n,String(a)],o=typeof i.id=="string"?i.id:s.join("-");if(Ve(i.index!==!0||!i.children,"Cannot specify children on an index route"),Ve(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),c$(i)){let c=Pt({},i,t(i),{id:o});return r[o]=c,c}else{let c=Pt({},i,t(i),{id:o,children:void 0});return r[o]=c,i.children&&(c.children=qh(i.children,t,s,r)),c}})}function $s(e,t,n){return n===void 0&&(n="/"),ch(e,t,n,!1)}function ch(e,t,n,r){let i=typeof t=="string"?ms(t):t,a=ui(i.pathname||"/",n);if(a==null)return null;let s=NO(e);d$(s);let o=null;for(let c=0;o==null&&c<s.length;++c){let u=S$(a);o=b$(s[c],u,r)}return o}function u$(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function NO(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(a,s,o)=>{let c={relativePath:o===void 0?a.path||"":o,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};c.relativePath.startsWith("/")&&(Ve(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Ji([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(Ve(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),NO(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:x$(u,a.index),routesMeta:d})};return e.forEach((a,s)=>{var o;if(a.path===""||!((o=a.path)!=null&&o.includes("?")))i(a,s);else for(let c of CO(a.path))i(a,s,c)}),t}function CO(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let s=CO(r.join("/")),o=[];return o.push(...s.map(c=>c===""?a:[a,c].join("/"))),i&&o.push(...s),o.map(c=>e.startsWith("/")&&c===""?"/":c)}function d$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:v$(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const f$=/^:[\w-]+$/,h$=3,p$=2,m$=1,g$=10,y$=-2,kj=e=>e==="*";function x$(e,t){let n=e.split("/"),r=n.length;return n.some(kj)&&(r+=y$),t&&(r+=p$),n.filter(i=>!kj(i)).reduce((i,a)=>i+(f$.test(a)?h$:a===""?m$:g$),r)}function v$(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function b$(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a="/",s=[];for(let o=0;o<r.length;++o){let c=r[o],u=o===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",f=Yh({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=Yh({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;Object.assign(i,f.params),s.push({params:i,pathname:Ji([a,f.pathname]),pathnameBase:C$(Ji([a,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(a=Ji([a,f.pathnameBase]))}return s}function Yh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=w$(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],s=a.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let y=o[f]||"";s=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const g=o[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:e}}function w$(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ho(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,c)=>(r.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function S$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ho(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ui(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const k$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,j$=e=>k$.test(e);function N$(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?ms(e):e,a;if(n)if(j$(n))a=n;else{if(n.includes("//")){let s=n;n=n.replace(/\/\/+/g,"/"),ho(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?a=jj(n.substring(1),"/"):a=jj(n,t)}else a=t;return{pathname:a,search:P$(r),hash:E$(i)}}function jj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function u0(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function PO(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function bm(e,t){let n=PO(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function wm(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=ms(e):(i=Pt({},e),Ve(!i.pathname||!i.pathname.includes("?"),u0("?","pathname","search",i)),Ve(!i.pathname||!i.pathname.includes("#"),u0("#","pathname","hash",i)),Ve(!i.search||!i.search.includes("#"),u0("#","search","hash",i)));let a=e===""||i.pathname==="",s=a?"/":i.pathname,o;if(s==null)o=n;else{let f=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}o=f>=0?t[f]:"/"}let c=N$(i,o),u=s&&s!=="/"&&s.endsWith("/"),d=(a||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Ji=e=>e.join("/").replace(/\/\/+/g,"/"),C$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),P$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,E$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Xh{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Fu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const EO=["post","put","patch","delete"],A$=new Set(EO),T$=["get",...EO],O$=new Set(T$),_$=new Set([301,302,303,307,308]),M$=new Set([307,308]),d0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},D$={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ho={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Xb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,I$=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),AO="remix-router-transitions";function L$(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Ve(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let z=e.detectErrorBoundary;i=V=>({hasErrorBoundary:z(V)})}else i=I$;let a={},s=qh(e.routes,i,void 0,a),o,c=e.basename||"/",u=e.dataStrategy||$$,d=e.patchRoutesOnNavigation,f=Pt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,p=new Set,g=null,y=null,x=null,b=e.hydrationData!=null,v=$s(s,e.history.location,c),w=!1,k=null;if(v==null&&!d){let z=Qn(404,{pathname:e.history.location.pathname}),{matches:V,route:Y}=Ij(s);v=V,k={[Y.id]:z}}v&&!e.hydrationData&&qr(v,s,e.history.location.pathname).active&&(v=null);let S;if(v)if(v.some(z=>z.route.lazy))S=!1;else if(!v.some(z=>z.route.loader))S=!0;else if(f.v7_partialHydration){let z=e.hydrationData?e.hydrationData.loaderData:null,V=e.hydrationData?e.hydrationData.errors:null;if(V){let Y=v.findIndex(ce=>V[ce.route.id]!==void 0);S=v.slice(0,Y+1).every(ce=>!vx(ce.route,z,V))}else S=v.every(Y=>!vx(Y.route,z,V))}else S=e.hydrationData!=null;else if(S=!1,v=[],f.v7_partialHydration){let z=qr(null,s,e.history.location.pathname);z.active&&z.matches&&(w=!0,v=z.matches)}let j,N={historyAction:e.history.action,location:e.history.location,matches:v,initialized:S,navigation:d0,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||k,fetchers:new Map,blockers:new Map},P=Gt.Pop,A=!1,E,O=!1,C=new Map,M=null,I=!1,B=!1,se=[],Q=new Set,D=new Map,K=0,T=-1,ie=new Map,J=new Set,_=new Map,H=new Map,ee=new Set,be=new Map,te=new Map,ye;function Z(){if(h=e.history.listen(z=>{let{action:V,location:Y,delta:ce}=z;if(ye){ye(),ye=void 0;return}ho(te.size===0||ce!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let $=Me({currentLocation:N.location,nextLocation:Y,historyAction:V});if($&&ce!=null){let G=new Promise(re=>{ye=re});e.history.go(ce*-1),ae($,{state:"blocked",location:Y,proceed(){ae($,{state:"proceeding",proceed:void 0,reset:void 0,location:Y}),G.then(()=>e.history.go(ce))},reset(){let re=new Map(N.blockers);re.set($,Ho),L({blockers:re})}});return}return oe(V,Y)}),n){e7(t,C);let z=()=>t7(t,C);t.addEventListener("pagehide",z),M=()=>t.removeEventListener("pagehide",z)}return N.initialized||oe(Gt.Pop,N.location,{initialHydration:!0}),j}function ne(){h&&h(),M&&M(),p.clear(),E&&E.abort(),N.fetchers.forEach((z,V)=>me(V)),N.blockers.forEach((z,V)=>Ct(V))}function ve(z){return p.add(z),()=>p.delete(z)}function L(z,V){V===void 0&&(V={}),N=Pt({},N,z);let Y=[],ce=[];f.v7_fetcherPersist&&N.fetchers.forEach(($,G)=>{$.state==="idle"&&(ee.has(G)?ce.push(G):Y.push(G))}),ee.forEach($=>{!N.fetchers.has($)&&!D.has($)&&ce.push($)}),[...p].forEach($=>$(N,{deletedFetchers:ce,viewTransitionOpts:V.viewTransitionOpts,flushSync:V.flushSync===!0})),f.v7_fetcherPersist?(Y.forEach($=>N.fetchers.delete($)),ce.forEach($=>me($))):ce.forEach($=>ee.delete($))}function W(z,V,Y){var ce,$;let{flushSync:G}=Y===void 0?{}:Y,re=N.actionData!=null&&N.navigation.formMethod!=null&&Jr(N.navigation.formMethod)&&N.navigation.state==="loading"&&((ce=z.state)==null?void 0:ce._isRedirect)!==!0,xe;V.actionData?Object.keys(V.actionData).length>0?xe=V.actionData:xe=null:re?xe=N.actionData:xe=null;let we=V.loaderData?Mj(N.loaderData,V.loaderData,V.matches||[],V.errors):N.loaderData,ke=N.blockers;ke.size>0&&(ke=new Map(ke),ke.forEach((Se,Te)=>ke.set(Te,Ho)));let je=A===!0||N.navigation.formMethod!=null&&Jr(N.navigation.formMethod)&&(($=z.state)==null?void 0:$._isRedirect)!==!0;o&&(s=o,o=void 0),I||P===Gt.Pop||(P===Gt.Push?e.history.push(z,z.state):P===Gt.Replace&&e.history.replace(z,z.state));let ue;if(P===Gt.Pop){let Se=C.get(N.location.pathname);Se&&Se.has(z.pathname)?ue={currentLocation:N.location,nextLocation:z}:C.has(z.pathname)&&(ue={currentLocation:z,nextLocation:N.location})}else if(O){let Se=C.get(N.location.pathname);Se?Se.add(z.pathname):(Se=new Set([z.pathname]),C.set(N.location.pathname,Se)),ue={currentLocation:N.location,nextLocation:z}}L(Pt({},V,{actionData:xe,loaderData:we,historyAction:P,location:z,initialized:!0,navigation:d0,revalidation:"idle",restoreScrollPosition:ks(z,V.matches||N.matches),preventScrollReset:je,blockers:ke}),{viewTransitionOpts:ue,flushSync:G===!0}),P=Gt.Pop,A=!1,O=!1,I=!1,B=!1,se=[]}async function F(z,V){if(typeof z=="number"){e.history.go(z);return}let Y=xx(N.location,N.matches,c,f.v7_prependBasename,z,f.v7_relativeSplatPath,V==null?void 0:V.fromRouteId,V==null?void 0:V.relative),{path:ce,submission:$,error:G}=Nj(f.v7_normalizeFormMethod,!1,Y,V),re=N.location,xe=Ru(N.location,ce,V&&V.state);xe=Pt({},xe,e.history.encodeLocation(xe));let we=V&&V.replace!=null?V.replace:void 0,ke=Gt.Push;we===!0?ke=Gt.Replace:we===!1||$!=null&&Jr($.formMethod)&&$.formAction===N.location.pathname+N.location.search&&(ke=Gt.Replace);let je=V&&"preventScrollReset"in V?V.preventScrollReset===!0:void 0,ue=(V&&V.flushSync)===!0,Se=Me({currentLocation:re,nextLocation:xe,historyAction:ke});if(Se){ae(Se,{state:"blocked",location:xe,proceed(){ae(Se,{state:"proceeding",proceed:void 0,reset:void 0,location:xe}),F(z,V)},reset(){let Te=new Map(N.blockers);Te.set(Se,Ho),L({blockers:Te})}});return}return await oe(ke,xe,{submission:$,pendingError:G,preventScrollReset:je,replace:V&&V.replace,enableViewTransition:V&&V.viewTransition,flushSync:ue})}function le(){if(de(),L({revalidation:"loading"}),N.navigation.state!=="submitting"){if(N.navigation.state==="idle"){oe(N.historyAction,N.location,{startUninterruptedRevalidation:!0});return}oe(P||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:O===!0})}}async function oe(z,V,Y){E&&E.abort(),E=null,P=z,I=(Y&&Y.startUninterruptedRevalidation)===!0,mc(N.location,N.matches),A=(Y&&Y.preventScrollReset)===!0,O=(Y&&Y.enableViewTransition)===!0;let ce=o||s,$=Y&&Y.overrideNavigation,G=Y!=null&&Y.initialHydration&&N.matches&&N.matches.length>0&&!w?N.matches:$s(ce,V,c),re=(Y&&Y.flushSync)===!0;if(G&&N.initialized&&!B&&K$(N.location,V)&&!(Y&&Y.submission&&Jr(Y.submission.formMethod))){W(V,{matches:G},{flushSync:re});return}let xe=qr(G,ce,V.pathname);if(xe.active&&xe.matches&&(G=xe.matches),!G){let{error:Ue,notFoundMatches:_e,route:Fe}=He(V.pathname);W(V,{matches:_e,loaderData:{},errors:{[Fe.id]:Ue}},{flushSync:re});return}E=new AbortController;let we=Lo(e.history,V,E.signal,Y&&Y.submission),ke;if(Y&&Y.pendingError)ke=[Bs(G).route.id,{type:at.error,error:Y.pendingError}];else if(Y&&Y.submission&&Jr(Y.submission.formMethod)){let Ue=await Re(we,V,Y.submission,G,xe.active,{replace:Y.replace,flushSync:re});if(Ue.shortCircuited)return;if(Ue.pendingActionResult){let[_e,Fe]=Ue.pendingActionResult;if(hr(Fe)&&Fu(Fe.error)&&Fe.error.status===404){E=null,W(V,{matches:Ue.matches,loaderData:{},errors:{[_e]:Fe.error}});return}}G=Ue.matches||G,ke=Ue.pendingActionResult,$=f0(V,Y.submission),re=!1,xe.active=!1,we=Lo(e.history,we.url,we.signal)}let{shortCircuited:je,matches:ue,loaderData:Se,errors:Te}=await We(we,V,G,xe.active,$,Y&&Y.submission,Y&&Y.fetcherSubmission,Y&&Y.replace,Y&&Y.initialHydration===!0,re,ke);je||(E=null,W(V,Pt({matches:ue||G},Dj(ke),{loaderData:Se,errors:Te})))}async function Re(z,V,Y,ce,$,G){G===void 0&&(G={}),de();let re=Q$(V,Y);if(L({navigation:re},{flushSync:G.flushSync===!0}),$){let ke=await mi(ce,V.pathname,z.signal);if(ke.type==="aborted")return{shortCircuited:!0};if(ke.type==="error"){let je=Bs(ke.partialMatches).route.id;return{matches:ke.partialMatches,pendingActionResult:[je,{type:at.error,error:ke.error}]}}else if(ke.matches)ce=ke.matches;else{let{notFoundMatches:je,error:ue,route:Se}=He(V.pathname);return{matches:je,pendingActionResult:[Se.id,{type:at.error,error:ue}]}}}let xe,we=Xc(ce,V);if(!we.route.action&&!we.route.lazy)xe={type:at.error,error:Qn(405,{method:z.method,pathname:V.pathname,routeId:we.route.id})};else if(xe=(await it("action",N,z,[we],ce,null))[we.route.id],z.signal.aborted)return{shortCircuited:!0};if(Ks(xe)){let ke;return G&&G.replace!=null?ke=G.replace:ke=Tj(xe.response.headers.get("Location"),new URL(z.url),c,e.history)===N.location.pathname+N.location.search,await rt(z,xe,!0,{submission:Y,replace:ke}),{shortCircuited:!0}}if(Ha(xe))throw Qn(400,{type:"defer-action"});if(hr(xe)){let ke=Bs(ce,we.route.id);return(G&&G.replace)!==!0&&(P=Gt.Push),{matches:ce,pendingActionResult:[ke.route.id,xe]}}return{matches:ce,pendingActionResult:[we.route.id,xe]}}async function We(z,V,Y,ce,$,G,re,xe,we,ke,je){let ue=$||f0(V,G),Se=G||re||Rj(ue),Te=!I&&(!f.v7_partialHydration||!we);if(ce){if(Te){let Lt=nt(je);L(Pt({navigation:ue},Lt!==void 0?{actionData:Lt}:{}),{flushSync:ke})}let et=await mi(Y,V.pathname,z.signal);if(et.type==="aborted")return{shortCircuited:!0};if(et.type==="error"){let Lt=Bs(et.partialMatches).route.id;return{matches:et.partialMatches,loaderData:{},errors:{[Lt]:et.error}}}else if(et.matches)Y=et.matches;else{let{error:Lt,notFoundMatches:Mo,route:gc}=He(V.pathname);return{matches:Mo,loaderData:{},errors:{[gc.id]:Lt}}}}let Ue=o||s,[_e,Fe]=Pj(e.history,N,Y,Se,V,f.v7_partialHydration&&we===!0,f.v7_skipActionErrorRevalidation,B,se,Q,ee,_,J,Ue,c,je);if(lt(et=>!(Y&&Y.some(Lt=>Lt.route.id===et))||_e&&_e.some(Lt=>Lt.route.id===et)),T=++K,_e.length===0&&Fe.length===0){let et=Je();return W(V,Pt({matches:Y,loaderData:{},errors:je&&hr(je[1])?{[je[0]]:je[1].error}:null},Dj(je),et?{fetchers:new Map(N.fetchers)}:{}),{flushSync:ke}),{shortCircuited:!0}}if(Te){let et={};if(!ce){et.navigation=ue;let Lt=nt(je);Lt!==void 0&&(et.actionData=Lt)}Fe.length>0&&(et.fetchers=Nt(Fe)),L(et,{flushSync:ke})}Fe.forEach(et=>{ze(et.key),et.controller&&D.set(et.key,et.controller)});let It=()=>Fe.forEach(et=>ze(et.key));E&&E.signal.addEventListener("abort",It);let{loaderResults:Xn,fetcherResults:ur}=await X(N,Y,_e,Fe,z);if(z.signal.aborted)return{shortCircuited:!0};E&&E.signal.removeEventListener("abort",It),Fe.forEach(et=>D.delete(et.key));let ct=vf(Xn);if(ct)return await rt(z,ct.result,!0,{replace:xe}),{shortCircuited:!0};if(ct=vf(ur),ct)return J.add(ct.key),await rt(z,ct.result,!0,{replace:xe}),{shortCircuited:!0};let{loaderData:js,errors:Ns}=_j(N,Y,Xn,je,Fe,ur,be);be.forEach((et,Lt)=>{et.subscribe(Mo=>{(Mo||et.done)&&be.delete(Lt)})}),f.v7_partialHydration&&we&&N.errors&&(Ns=Pt({},N.errors,Ns));let Cs=Je(),Jd=pt(T),ef=Cs||Jd||Fe.length>0;return Pt({matches:Y,loaderData:js,errors:Ns},ef?{fetchers:new Map(N.fetchers)}:{})}function nt(z){if(z&&!hr(z[1]))return{[z[0]]:z[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function Nt(z){return z.forEach(V=>{let Y=N.fetchers.get(V.key),ce=Nc(void 0,Y?Y.data:void 0);N.fetchers.set(V.key,ce)}),new Map(N.fetchers)}function hn(z,V,Y,ce){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ze(z);let $=(ce&&ce.flushSync)===!0,G=o||s,re=xx(N.location,N.matches,c,f.v7_prependBasename,Y,f.v7_relativeSplatPath,V,ce==null?void 0:ce.relative),xe=$s(G,re,c),we=qr(xe,G,re);if(we.active&&we.matches&&(xe=we.matches),!xe){fe(z,V,Qn(404,{pathname:re}),{flushSync:$});return}let{path:ke,submission:je,error:ue}=Nj(f.v7_normalizeFormMethod,!0,re,ce);if(ue){fe(z,V,ue,{flushSync:$});return}let Se=Xc(xe,ke),Te=(ce&&ce.preventScrollReset)===!0;if(je&&Jr(je.formMethod)){Xt(z,V,ke,Se,xe,we.active,$,Te,je);return}_.set(z,{routeId:V,path:ke}),xt(z,V,ke,Se,xe,we.active,$,Te,je)}async function Xt(z,V,Y,ce,$,G,re,xe,we){de(),_.delete(z);function ke(Ht){if(!Ht.route.action&&!Ht.route.lazy){let Do=Qn(405,{method:we.formMethod,pathname:Y,routeId:V});return fe(z,V,Do,{flushSync:re}),!0}return!1}if(!G&&ke(ce))return;let je=N.fetchers.get(z);Ee(z,J$(we,je),{flushSync:re});let ue=new AbortController,Se=Lo(e.history,Y,ue.signal,we);if(G){let Ht=await mi($,new URL(Se.url).pathname,Se.signal,z);if(Ht.type==="aborted")return;if(Ht.type==="error"){fe(z,V,Ht.error,{flushSync:re});return}else if(Ht.matches){if($=Ht.matches,ce=Xc($,Y),ke(ce))return}else{fe(z,V,Qn(404,{pathname:Y}),{flushSync:re});return}}D.set(z,ue);let Te=K,_e=(await it("action",N,Se,[ce],$,z))[ce.route.id];if(Se.signal.aborted){D.get(z)===ue&&D.delete(z);return}if(f.v7_fetcherPersist&&ee.has(z)){if(Ks(_e)||hr(_e)){Ee(z,Da(void 0));return}}else{if(Ks(_e))if(D.delete(z),T>Te){Ee(z,Da(void 0));return}else return J.add(z),Ee(z,Nc(we)),rt(Se,_e,!1,{fetcherSubmission:we,preventScrollReset:xe});if(hr(_e)){fe(z,V,_e.error);return}}if(Ha(_e))throw Qn(400,{type:"defer-action"});let Fe=N.navigation.location||N.location,It=Lo(e.history,Fe,ue.signal),Xn=o||s,ur=N.navigation.state!=="idle"?$s(Xn,N.navigation.location,c):N.matches;Ve(ur,"Didn't find any matches after fetcher action");let ct=++K;ie.set(z,ct);let js=Nc(we,_e.data);N.fetchers.set(z,js);let[Ns,Cs]=Pj(e.history,N,ur,we,Fe,!1,f.v7_skipActionErrorRevalidation,B,se,Q,ee,_,J,Xn,c,[ce.route.id,_e]);Cs.filter(Ht=>Ht.key!==z).forEach(Ht=>{let Do=Ht.key,dk=N.fetchers.get(Do),E6=Nc(void 0,dk?dk.data:void 0);N.fetchers.set(Do,E6),ze(Do),Ht.controller&&D.set(Do,Ht.controller)}),L({fetchers:new Map(N.fetchers)});let Jd=()=>Cs.forEach(Ht=>ze(Ht.key));ue.signal.addEventListener("abort",Jd);let{loaderResults:ef,fetcherResults:et}=await X(N,ur,Ns,Cs,It);if(ue.signal.aborted)return;ue.signal.removeEventListener("abort",Jd),ie.delete(z),D.delete(z),Cs.forEach(Ht=>D.delete(Ht.key));let Lt=vf(ef);if(Lt)return rt(It,Lt.result,!1,{preventScrollReset:xe});if(Lt=vf(et),Lt)return J.add(Lt.key),rt(It,Lt.result,!1,{preventScrollReset:xe});let{loaderData:Mo,errors:gc}=_j(N,ur,ef,void 0,Cs,et,be);if(N.fetchers.has(z)){let Ht=Da(_e.data);N.fetchers.set(z,Ht)}pt(ct),N.navigation.state==="loading"&&ct>T?(Ve(P,"Expected pending action"),E&&E.abort(),W(N.navigation.location,{matches:ur,loaderData:Mo,errors:gc,fetchers:new Map(N.fetchers)})):(L({errors:gc,loaderData:Mj(N.loaderData,Mo,ur,gc),fetchers:new Map(N.fetchers)}),B=!1)}async function xt(z,V,Y,ce,$,G,re,xe,we){let ke=N.fetchers.get(z);Ee(z,Nc(we,ke?ke.data:void 0),{flushSync:re});let je=new AbortController,ue=Lo(e.history,Y,je.signal);if(G){let _e=await mi($,new URL(ue.url).pathname,ue.signal,z);if(_e.type==="aborted")return;if(_e.type==="error"){fe(z,V,_e.error,{flushSync:re});return}else if(_e.matches)$=_e.matches,ce=Xc($,Y);else{fe(z,V,Qn(404,{pathname:Y}),{flushSync:re});return}}D.set(z,je);let Se=K,Ue=(await it("loader",N,ue,[ce],$,z))[ce.route.id];if(Ha(Ue)&&(Ue=await Zb(Ue,ue.signal,!0)||Ue),D.get(z)===je&&D.delete(z),!ue.signal.aborted){if(ee.has(z)){Ee(z,Da(void 0));return}if(Ks(Ue))if(T>Se){Ee(z,Da(void 0));return}else{J.add(z),await rt(ue,Ue,!1,{preventScrollReset:xe});return}if(hr(Ue)){fe(z,V,Ue.error);return}Ve(!Ha(Ue),"Unhandled fetcher deferred data"),Ee(z,Da(Ue.data))}}async function rt(z,V,Y,ce){let{submission:$,fetcherSubmission:G,preventScrollReset:re,replace:xe}=ce===void 0?{}:ce;V.response.headers.has("X-Remix-Revalidate")&&(B=!0);let we=V.response.headers.get("Location");Ve(we,"Expected a Location header on the redirect Response"),we=Tj(we,new URL(z.url),c,e.history);let ke=Ru(N.location,we,{_isRedirect:!0});if(n){let _e=!1;if(V.response.headers.has("X-Remix-Reload-Document"))_e=!0;else if(Xb.test(we)){const Fe=e.history.createURL(we);_e=Fe.origin!==t.location.origin||ui(Fe.pathname,c)==null}if(_e){xe?t.location.replace(we):t.location.assign(we);return}}E=null;let je=xe===!0||V.response.headers.has("X-Remix-Replace")?Gt.Replace:Gt.Push,{formMethod:ue,formAction:Se,formEncType:Te}=N.navigation;!$&&!G&&ue&&Se&&Te&&($=Rj(N.navigation));let Ue=$||G;if(M$.has(V.response.status)&&Ue&&Jr(Ue.formMethod))await oe(je,ke,{submission:Pt({},Ue,{formAction:we}),preventScrollReset:re||A,enableViewTransition:Y?O:void 0});else{let _e=f0(ke,$);await oe(je,ke,{overrideNavigation:_e,fetcherSubmission:G,preventScrollReset:re||A,enableViewTransition:Y?O:void 0})}}async function it(z,V,Y,ce,$,G){let re,xe={};try{re=await B$(u,z,V,Y,ce,$,G,a,i)}catch(we){return ce.forEach(ke=>{xe[ke.route.id]={type:at.error,error:we}}),xe}for(let[we,ke]of Object.entries(re))if(G$(ke)){let je=ke.result;xe[we]={type:at.redirect,response:W$(je,Y,we,$,c,f.v7_relativeSplatPath)}}else xe[we]=await V$(ke);return xe}async function X(z,V,Y,ce,$){let G=z.matches,re=it("loader",z,$,Y,V,null),xe=Promise.all(ce.map(async je=>{if(je.matches&&je.match&&je.controller){let Se=(await it("loader",z,Lo(e.history,je.path,je.controller.signal),[je.match],je.matches,je.key))[je.match.route.id];return{[je.key]:Se}}else return Promise.resolve({[je.key]:{type:at.error,error:Qn(404,{pathname:je.path})}})})),we=await re,ke=(await xe).reduce((je,ue)=>Object.assign(je,ue),{});return await Promise.all([X$(V,we,$.signal,G,z.loaderData),Z$(V,ke,ce)]),{loaderResults:we,fetcherResults:ke}}function de(){B=!0,se.push(...lt()),_.forEach((z,V)=>{D.has(V)&&Q.add(V),ze(V)})}function Ee(z,V,Y){Y===void 0&&(Y={}),N.fetchers.set(z,V),L({fetchers:new Map(N.fetchers)},{flushSync:(Y&&Y.flushSync)===!0})}function fe(z,V,Y,ce){ce===void 0&&(ce={});let $=Bs(N.matches,V);me(z),L({errors:{[$.route.id]:Y},fetchers:new Map(N.fetchers)},{flushSync:(ce&&ce.flushSync)===!0})}function R(z){return H.set(z,(H.get(z)||0)+1),ee.has(z)&&ee.delete(z),N.fetchers.get(z)||D$}function me(z){let V=N.fetchers.get(z);D.has(z)&&!(V&&V.state==="loading"&&ie.has(z))&&ze(z),_.delete(z),ie.delete(z),J.delete(z),f.v7_fetcherPersist&&ee.delete(z),Q.delete(z),N.fetchers.delete(z)}function Ae(z){let V=(H.get(z)||0)-1;V<=0?(H.delete(z),ee.add(z),f.v7_fetcherPersist||me(z)):H.set(z,V),L({fetchers:new Map(N.fetchers)})}function ze(z){let V=D.get(z);V&&(V.abort(),D.delete(z))}function ht(z){for(let V of z){let Y=R(V),ce=Da(Y.data);N.fetchers.set(V,ce)}}function Je(){let z=[],V=!1;for(let Y of J){let ce=N.fetchers.get(Y);Ve(ce,"Expected fetcher: "+Y),ce.state==="loading"&&(J.delete(Y),z.push(Y),V=!0)}return ht(z),V}function pt(z){let V=[];for(let[Y,ce]of ie)if(ce<z){let $=N.fetchers.get(Y);Ve($,"Expected fetcher: "+Y),$.state==="loading"&&(ze(Y),ie.delete(Y),V.push(Y))}return ht(V),V.length>0}function Wt(z,V){let Y=N.blockers.get(z)||Ho;return te.get(z)!==V&&te.set(z,V),Y}function Ct(z){N.blockers.delete(z),te.delete(z)}function ae(z,V){let Y=N.blockers.get(z)||Ho;Ve(Y.state==="unblocked"&&V.state==="blocked"||Y.state==="blocked"&&V.state==="blocked"||Y.state==="blocked"&&V.state==="proceeding"||Y.state==="blocked"&&V.state==="unblocked"||Y.state==="proceeding"&&V.state==="unblocked","Invalid blocker state transition: "+Y.state+" -> "+V.state);let ce=new Map(N.blockers);ce.set(z,V),L({blockers:ce})}function Me(z){let{currentLocation:V,nextLocation:Y,historyAction:ce}=z;if(te.size===0)return;te.size>1&&ho(!1,"A router only supports one blocker at a time");let $=Array.from(te.entries()),[G,re]=$[$.length-1],xe=N.blockers.get(G);if(!(xe&&xe.state==="proceeding")&&re({currentLocation:V,nextLocation:Y,historyAction:ce}))return G}function He(z){let V=Qn(404,{pathname:z}),Y=o||s,{matches:ce,route:$}=Ij(Y);return lt(),{notFoundMatches:ce,route:$,error:V}}function lt(z){let V=[];return be.forEach((Y,ce)=>{(!z||z(ce))&&(Y.cancel(),V.push(ce),be.delete(ce))}),V}function Ss(z,V,Y){if(g=z,x=V,y=Y||null,!b&&N.navigation===d0){b=!0;let ce=ks(N.location,N.matches);ce!=null&&L({restoreScrollPosition:ce})}return()=>{g=null,x=null,y=null}}function _o(z,V){return y&&y(z,V.map(ce=>u$(ce,N.loaderData)))||z.key}function mc(z,V){if(g&&x){let Y=_o(z,V);g[Y]=x()}}function ks(z,V){if(g){let Y=_o(z,V),ce=g[Y];if(typeof ce=="number")return ce}return null}function qr(z,V,Y){if(d)if(z){if(Object.keys(z[0].params).length>0)return{active:!0,matches:ch(V,Y,c,!0)}}else return{active:!0,matches:ch(V,Y,c,!0)||[]};return{active:!1,matches:null}}async function mi(z,V,Y,ce){if(!d)return{type:"success",matches:z};let $=z;for(;;){let G=o==null,re=o||s,xe=a;try{await d({signal:Y,path:V,matches:$,fetcherKey:ce,patch:(je,ue)=>{Y.aborted||Aj(je,ue,re,xe,i)}})}catch(je){return{type:"error",error:je,partialMatches:$}}finally{G&&!Y.aborted&&(s=[...s])}if(Y.aborted)return{type:"aborted"};let we=$s(re,V,c);if(we)return{type:"success",matches:we};let ke=ch(re,V,c,!0);if(!ke||$.length===ke.length&&$.every((je,ue)=>je.route.id===ke[ue].route.id))return{type:"success",matches:null};$=ke}}function Ig(z){a={},o=qh(z,i,void 0,a)}function Lg(z,V){let Y=o==null;Aj(z,V,o||s,a,i),Y&&(s=[...s],L({}))}return j={get basename(){return c},get future(){return f},get state(){return N},get routes(){return s},get window(){return t},initialize:Z,subscribe:ve,enableScrollRestoration:Ss,navigate:F,fetch:hn,revalidate:le,createHref:z=>e.history.createHref(z),encodeLocation:z=>e.history.encodeLocation(z),getFetcher:R,deleteFetcher:Ae,dispose:ne,getBlocker:Wt,deleteBlocker:Ct,patchRoutes:Lg,_internalFetchControllers:D,_internalActiveDeferreds:be,_internalSetRoutes:Ig},j}function R$(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function xx(e,t,n,r,i,a,s,o){let c,u;if(s){c=[];for(let f of t)if(c.push(f),f.route.id===s){u=f;break}}else c=t,u=t[t.length-1];let d=wm(i||".",bm(c,a),ui(e.pathname,n)||e.pathname,o==="path");if(i==null&&(d.search=e.search,d.hash=e.hash),(i==null||i===""||i===".")&&u){let f=Qb(d.search);if(u.route.index&&!f)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&f){let h=new URLSearchParams(d.search),p=h.getAll("index");h.delete("index"),p.filter(y=>y).forEach(y=>h.append("index",y));let g=h.toString();d.search=g?"?"+g:""}}return r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Ji([n,d.pathname])),po(d)}function Nj(e,t,n,r){if(!r||!R$(r))return{path:n};if(r.formMethod&&!Y$(r.formMethod))return{path:n,error:Qn(405,{method:r.formMethod})};let i=()=>({path:n,error:Qn(400,{type:"invalid-body"})}),a=r.formMethod||"get",s=e?a.toUpperCase():a.toLowerCase(),o=_O(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Jr(s))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,g)=>{let[y,x]=g;return""+p+y+"="+x+`
50
+ `},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Jr(s))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:o,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}Ve(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=bx(r.formData),u=r.formData;else if(r.body instanceof FormData)c=bx(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=Oj(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=Oj(c)}catch{return i()}let d={formMethod:s,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Jr(d.formMethod))return{path:n,submission:d};let f=ms(n);return t&&f.search&&Qb(f.search)&&c.append("index",""),f.search="?"+c,{path:po(f),submission:d}}function Cj(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function Pj(e,t,n,r,i,a,s,o,c,u,d,f,h,p,g,y){let x=y?hr(y[1])?y[1].error:y[1].data:void 0,b=e.createURL(t.location),v=e.createURL(i),w=n;a&&t.errors?w=Cj(n,Object.keys(t.errors)[0],!0):y&&hr(y[1])&&(w=Cj(n,y[0]));let k=y?y[1].statusCode:void 0,S=s&&k&&k>=400,j=w.filter((P,A)=>{let{route:E}=P;if(E.lazy)return!0;if(E.loader==null)return!1;if(a)return vx(E,t.loaderData,t.errors);if(F$(t.loaderData,t.matches[A],P)||c.some(M=>M===P.route.id))return!0;let O=t.matches[A],C=P;return Ej(P,Pt({currentUrl:b,currentParams:O.params,nextUrl:v,nextParams:C.params},r,{actionResult:x,actionStatus:k,defaultShouldRevalidate:S?!1:o||b.pathname+b.search===v.pathname+v.search||b.search!==v.search||TO(O,C)}))}),N=[];return f.forEach((P,A)=>{if(a||!n.some(I=>I.route.id===P.routeId)||d.has(A))return;let E=$s(p,P.path,g);if(!E){N.push({key:A,routeId:P.routeId,path:P.path,matches:null,match:null,controller:null});return}let O=t.fetchers.get(A),C=Xc(E,P.path),M=!1;h.has(A)?M=!1:u.has(A)?(u.delete(A),M=!0):O&&O.state!=="idle"&&O.data===void 0?M=o:M=Ej(C,Pt({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:x,actionStatus:k,defaultShouldRevalidate:S?!1:o})),M&&N.push({key:A,routeId:P.routeId,path:P.path,matches:E,match:C,controller:new AbortController})}),[j,N]}function vx(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function F$(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function TO(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ej(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Aj(e,t,n,r,i){var a;let s;if(e){let u=r[e];Ve(u,"No route found to patch children into: routeId = "+e),u.children||(u.children=[]),s=u.children}else s=n;let o=t.filter(u=>!s.some(d=>OO(u,d))),c=qh(o,i,[e||"_","patch",String(((a=s)==null?void 0:a.length)||"0")],r);s.push(...c)}function OO(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(a=>OO(n,a))}):!1}async function z$(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];Ve(i,"No route found in manifest");let a={};for(let s in r){let c=i[s]!==void 0&&s!=="hasErrorBoundary";ho(!c,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!c&&!l$.has(s)&&(a[s]=r[s])}Object.assign(i,a),Object.assign(i,Pt({},t(i),{lazy:void 0}))}async function $$(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,a,s)=>Object.assign(i,{[n[s].route.id]:a}),{})}async function B$(e,t,n,r,i,a,s,o,c,u){let d=a.map(p=>p.route.lazy?z$(p.route,c,o):void 0),f=a.map((p,g)=>{let y=d[g],x=i.some(v=>v.route.id===p.route.id);return Pt({},p,{shouldLoad:x,resolve:async v=>(v&&r.method==="GET"&&(p.route.lazy||p.route.loader)&&(x=!0),x?U$(t,r,p,y,v,u):Promise.resolve({type:at.data,result:void 0}))})}),h=await e({matches:f,request:r,params:a[0].params,fetcherKey:s,context:u});try{await Promise.all(d)}catch{}return h}async function U$(e,t,n,r,i,a){let s,o,c=u=>{let d,f=new Promise((g,y)=>d=y);o=()=>d(),t.signal.addEventListener("abort",o);let h=g=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:a},...g!==void 0?[g]:[]),p=(async()=>{try{return{type:"data",result:await(i?i(y=>h(y)):h())}}catch(g){return{type:"error",result:g}}})();return Promise.race([p,f])};try{let u=n.route[e];if(r)if(u){let d,[f]=await Promise.all([c(u).catch(h=>{d=h}),r]);if(d!==void 0)throw d;s=f}else if(await r,u=n.route[e],u)s=await c(u);else if(e==="action"){let d=new URL(t.url),f=d.pathname+d.search;throw Qn(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:at.data,result:void 0};else if(u)s=await c(u);else{let d=new URL(t.url),f=d.pathname+d.search;throw Qn(404,{pathname:f})}Ve(s.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:at.error,result:u}}finally{o&&t.signal.removeEventListener("abort",o)}return s}async function V$(e){let{result:t,type:n}=e;if(MO(t)){let f;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?f=null:f=await t.json():f=await t.text()}catch(h){return{type:at.error,error:h}}return n===at.error?{type:at.error,error:new Xh(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:at.data,data:f,statusCode:t.status,headers:t.headers}}if(n===at.error){if(Lj(t)){var r,i;if(t.data instanceof Error){var a,s;return{type:at.error,error:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}}return{type:at.error,error:new Xh(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:Fu(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:at.error,error:t,statusCode:Fu(t)?t.status:void 0}}if(q$(t)){var o,c;return{type:at.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((c=t.init)==null?void 0:c.headers)&&new Headers(t.init.headers)}}if(Lj(t)){var u,d;return{type:at.data,data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(d=t.init)!=null&&d.headers?new Headers(t.init.headers):void 0}}return{type:at.data,data:t}}function W$(e,t,n,r,i,a){let s=e.headers.get("Location");if(Ve(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Xb.test(s)){let o=r.slice(0,r.findIndex(c=>c.route.id===n)+1);s=xx(new URL(t.url),o,i,!0,s,a),e.headers.set("Location",s)}return e}function Tj(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Xb.test(e)){let a=e,s=a.startsWith("//")?new URL(t.protocol+a):new URL(a);if(i.includes(s.protocol))throw new Error("Invalid redirect location");let o=ui(s.pathname,n)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}try{let a=r.createURL(e);if(i.includes(a.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Lo(e,t,n,r){let i=e.createURL(_O(t)).toString(),a={signal:n};if(r&&Jr(r.formMethod)){let{formMethod:s,formEncType:o}=r;a.method=s.toUpperCase(),o==="application/json"?(a.headers=new Headers({"Content-Type":o}),a.body=JSON.stringify(r.json)):o==="text/plain"?a.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?a.body=bx(r.formData):a.body=r.formData}return new Request(i,a)}function bx(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Oj(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function H$(e,t,n,r,i){let a={},s=null,o,c=!1,u={},d=n&&hr(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let h=f.route.id,p=t[h];if(Ve(!Ks(p),"Cannot handle redirect results in processLoaderData"),hr(p)){let g=p.error;d!==void 0&&(g=d,d=void 0),s=s||{};{let y=Bs(e,h);s[y.route.id]==null&&(s[y.route.id]=g)}a[h]=void 0,c||(c=!0,o=Fu(p.error)?p.error.status:500),p.headers&&(u[h]=p.headers)}else Ha(p)?(r.set(h,p.deferredData),a[h]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!c&&(o=p.statusCode),p.headers&&(u[h]=p.headers)):(a[h]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(o=p.statusCode),p.headers&&(u[h]=p.headers))}),d!==void 0&&n&&(s={[n[0]]:d},a[n[0]]=void 0),{loaderData:a,errors:s,statusCode:o||200,loaderHeaders:u}}function _j(e,t,n,r,i,a,s){let{loaderData:o,errors:c}=H$(t,n,r,s);return i.forEach(u=>{let{key:d,match:f,controller:h}=u,p=a[d];if(Ve(p,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(hr(p)){let g=Bs(e.matches,f==null?void 0:f.route.id);c&&c[g.route.id]||(c=Pt({},c,{[g.route.id]:p.error})),e.fetchers.delete(d)}else if(Ks(p))Ve(!1,"Unhandled fetcher revalidation redirect");else if(Ha(p))Ve(!1,"Unhandled fetcher deferred data");else{let g=Da(p.data);e.fetchers.set(d,g)}}),{loaderData:o,errors:c}}function Mj(e,t,n,r){let i=Pt({},t);for(let a of n){let s=a.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(i[s]=t[s]):e[s]!==void 0&&a.route.loader&&(i[s]=e[s]),r&&r.hasOwnProperty(s))break}return i}function Dj(e){return e?hr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Bs(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Ij(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Qn(e,t){let{pathname:n,routeId:r,method:i,type:a,message:s}=t===void 0?{}:t,o="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?c="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":a==="defer-action"?c="defer() is not supported in actions":a==="invalid-body"&&(c="Unable to encode submission body")):e===403?(o="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",c='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?c="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(c='Invalid request method "'+i.toUpperCase()+'"')),new Xh(e||500,o,new Error(c),!0)}function vf(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Ks(i))return{key:r,result:i}}}function _O(e){let t=typeof e=="string"?ms(e):e;return po(Pt({},t,{hash:""}))}function K$(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function G$(e){return MO(e.result)&&_$.has(e.result.status)}function Ha(e){return e.type===at.deferred}function hr(e){return e.type===at.error}function Ks(e){return(e&&e.type)===at.redirect}function Lj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function q$(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function MO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Y$(e){return O$.has(e.toLowerCase())}function Jr(e){return A$.has(e.toLowerCase())}async function X$(e,t,n,r,i){let a=Object.entries(t);for(let s=0;s<a.length;s++){let[o,c]=a[s],u=e.find(h=>(h==null?void 0:h.route.id)===o);if(!u)continue;let d=r.find(h=>h.route.id===u.route.id),f=d!=null&&!TO(d,u)&&(i&&i[u.route.id])!==void 0;Ha(c)&&f&&await Zb(c,n,!1).then(h=>{h&&(t[o]=h)})}}async function Z$(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:a,controller:s}=n[r],o=t[i];e.find(u=>(u==null?void 0:u.route.id)===a)&&Ha(o)&&(Ve(s,"Expected an AbortController for revalidating fetcher deferred result"),await Zb(o,s.signal,!0).then(u=>{u&&(t[i]=u)}))}}async function Zb(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:at.data,data:e.deferredData.unwrappedData}}catch(i){return{type:at.error,error:i}}return{type:at.data,data:e.deferredData.data}}}function Qb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Xc(e,t){let n=typeof t=="string"?ms(t).search:t.search;if(e[e.length-1].route.index&&Qb(n||""))return e[e.length-1];let r=PO(e);return r[r.length-1]}function Rj(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:s}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function f0(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Q$(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Nc(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function J$(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Da(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function e7(e,t){try{let n=e.sessionStorage.getItem(AO);if(n){let r=JSON.parse(n);for(let[i,a]of Object.entries(r||{}))a&&Array.isArray(a)&&t.set(i,new Set(a||[]))}}catch{}}function t7(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(AO,JSON.stringify(n))}catch(r){ho(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
51
+ * React Router v6.30.3
52
+ *
53
+ * Copyright (c) Remix Software Inc.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE.md file in the root directory of this source tree.
57
+ *
58
+ * @license MIT
59
+ */function _l(){return _l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_l.apply(this,arguments)}const vd=m.createContext(null),Jb=m.createContext(null),xa=m.createContext(null),ew=m.createContext(null),zi=m.createContext({outlet:null,matches:[],isDataRoute:!1}),DO=m.createContext(null);function n7(e,t){let{relative:n}=t===void 0?{}:t;Zl()||Ve(!1);let{basename:r,navigator:i}=m.useContext(xa),{hash:a,pathname:s,search:o}=Sm(e,{relative:n}),c=s;return r!=="/"&&(c=s==="/"?r:Ji([r,s])),i.createHref({pathname:c,search:o,hash:a})}function Zl(){return m.useContext(ew)!=null}function gs(){return Zl()||Ve(!1),m.useContext(ew).location}function IO(e){m.useContext(xa).static||m.useLayoutEffect(e)}function $i(){let{isDataRoute:e}=m.useContext(zi);return e?y7():r7()}function r7(){Zl()||Ve(!1);let e=m.useContext(vd),{basename:t,future:n,navigator:r}=m.useContext(xa),{matches:i}=m.useContext(zi),{pathname:a}=gs(),s=JSON.stringify(bm(i,n.v7_relativeSplatPath)),o=m.useRef(!1);return IO(()=>{o.current=!0}),m.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let f=wm(u,JSON.parse(s),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ji([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,s,a,e])}const i7=m.createContext(null);function a7(e){let t=m.useContext(zi).outlet;return t&&m.createElement(i7.Provider,{value:e},t)}function s7(){let{matches:e}=m.useContext(zi),t=e[e.length-1];return t?t.params:{}}function Sm(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(xa),{matches:i}=m.useContext(zi),{pathname:a}=gs(),s=JSON.stringify(bm(i,r.v7_relativeSplatPath));return m.useMemo(()=>wm(e,JSON.parse(s),a,n==="path"),[e,s,a,n])}function o7(e,t,n,r){Zl()||Ve(!1);let{navigator:i}=m.useContext(xa),{matches:a}=m.useContext(zi),s=a[a.length-1],o=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=gs(),d;d=u;let f=d.pathname||"/",h=f;if(c!=="/"){let y=c.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let p=$s(e,{pathname:h});return f7(p&&p.map(y=>Object.assign({},y,{params:Object.assign({},o,y.params),pathname:Ji([c,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:Ji([c,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r)}function l7(){let e=p7(),t=Fu(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:i},n):null,null)}const c7=m.createElement(l7,null);class u7 extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(zi.Provider,{value:this.props.routeContext},m.createElement(DO.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function d7(e){let{routeContext:t,match:n,children:r}=e,i=m.useContext(vd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(zi.Provider,{value:t},r)}function f7(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let d=s.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);d>=0||Ve(!1),s=s.slice(0,Math.min(s.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<s.length;d++){let f=s[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:p}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,f,h)=>{let p,g=!1,y=null,x=null;n&&(p=o&&f.route.id?o[f.route.id]:void 0,y=f.route.errorElement||c7,c&&(u<0&&h===0?(x7("route-fallback"),g=!0,x=null):u===h&&(g=!0,x=f.route.hydrateFallbackElement||null)));let b=t.concat(s.slice(0,h+1)),v=()=>{let w;return p?w=y:g?w=x:f.route.Component?w=m.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,m.createElement(d7,{match:f,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?m.createElement(u7,{location:n.location,revalidation:n.revalidation,component:y,error:p,children:v(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):v()},null)}var tw=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(tw||{}),LO=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(LO||{});function RO(e){let t=m.useContext(vd);return t||Ve(!1),t}function FO(e){let t=m.useContext(Jb);return t||Ve(!1),t}function h7(e){let t=m.useContext(zi);return t||Ve(!1),t}function zO(e){let t=h7(),n=t.matches[t.matches.length-1];return n.route.id||Ve(!1),n.route.id}function p7(){var e;let t=m.useContext(DO),n=FO(LO.UseRouteError),r=zO();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}let m7=0;function g7(e){let{router:t,basename:n}=RO(tw.UseBlocker),r=FO(),[i,a]=m.useState(""),s=m.useCallback(o=>{if(typeof e!="function")return!!e;if(n==="/")return e(o);let{currentLocation:c,nextLocation:u,historyAction:d}=o;return e({currentLocation:_l({},c,{pathname:ui(c.pathname,n)||c.pathname}),nextLocation:_l({},u,{pathname:ui(u.pathname,n)||u.pathname}),historyAction:d})},[n,e]);return m.useEffect(()=>{let o=String(++m7);return a(o),()=>t.deleteBlocker(o)},[t]),m.useEffect(()=>{i!==""&&t.getBlocker(i,s)},[t,i,s]),i&&r.blockers.has(i)?r.blockers.get(i):Ho}function y7(){let{router:e}=RO(tw.UseNavigateStable),t=zO(),n=m.useRef(!1);return IO(()=>{n.current=!0}),m.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,_l({fromRouteId:t},a)))},[e,t])}const Fj={};function x7(e,t,n){Fj[e]||(Fj[e]=!0)}function v7(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function uh(e){let{to:t,replace:n,state:r,relative:i}=e;Zl()||Ve(!1);let{future:a,static:s}=m.useContext(xa),{matches:o}=m.useContext(zi),{pathname:c}=gs(),u=$i(),d=wm(t,bm(o,a.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return m.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function nw(e){return a7(e.context)}function b7(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Gt.Pop,navigator:a,static:s=!1,future:o}=e;Zl()&&Ve(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:a,static:s,future:_l({v7_relativeSplatPath:!1},o)}),[c,o,a,s]);typeof r=="string"&&(r=ms(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,y=m.useMemo(()=>{let x=ui(d,c);return x==null?null:{location:{pathname:x,search:f,hash:h,state:p,key:g},navigationType:i}},[c,d,f,h,p,g,i]);return y==null?null:m.createElement(xa.Provider,{value:u},m.createElement(ew.Provider,{children:n,value:y}))}new Promise(()=>{});function w7(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:m.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:m.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:m.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
60
+ * React Router DOM v6.30.3
61
+ *
62
+ * Copyright (c) Remix Software Inc.
63
+ *
64
+ * This source code is licensed under the MIT license found in the
65
+ * LICENSE.md file in the root directory of this source tree.
66
+ *
67
+ * @license MIT
68
+ */function Ml(){return Ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ml.apply(this,arguments)}function $O(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function S7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function k7(e,t){return e.button===0&&(!t||t==="_self")&&!S7(e)}function wx(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function j7(e,t){let n=wx(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const N7=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],C7=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],P7="6";try{window.__reactRouterVersion=P7}catch{}function E7(e,t){return L$({basename:void 0,future:Ml({},void 0,{v7_prependBasename:!0}),history:a$({window:void 0}),hydrationData:A7(),routes:e,mapRouteProperties:w7,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function A7(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Ml({},t,{errors:T7(t.errors)})),t}function T7(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Xh(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let a=window[i.__subType];if(typeof a=="function")try{let s=new a(i.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let a=new Error(i.message);a.stack="",n[r]=a}}else n[r]=i;return n}const BO=m.createContext({isTransitioning:!1}),O7=m.createContext(new Map),_7="startTransition",zj=SA[_7],M7="flushSync",$j=i$[M7];function D7(e){zj?zj(e):e()}function Cc(e){$j?$j(e):e()}class I7{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function L7(e){let{fallbackElement:t,router:n,future:r}=e,[i,a]=m.useState(n.state),[s,o]=m.useState(),[c,u]=m.useState({isTransitioning:!1}),[d,f]=m.useState(),[h,p]=m.useState(),[g,y]=m.useState(),x=m.useRef(new Map),{v7_startTransition:b}=r||{},v=m.useCallback(P=>{b?D7(P):P()},[b]),w=m.useCallback((P,A)=>{let{deletedFetchers:E,flushSync:O,viewTransitionOpts:C}=A;P.fetchers.forEach((I,B)=>{I.data!==void 0&&x.current.set(B,I.data)}),E.forEach(I=>x.current.delete(I));let M=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!C||M){O?Cc(()=>a(P)):v(()=>a(P));return}if(O){Cc(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:C.currentLocation,nextLocation:C.nextLocation})});let I=n.window.document.startViewTransition(()=>{Cc(()=>a(P))});I.finished.finally(()=>{Cc(()=>{f(void 0),p(void 0),o(void 0),u({isTransitioning:!1})})}),Cc(()=>p(I));return}h?(d&&d.resolve(),h.skipTransition(),y({state:P,currentLocation:C.currentLocation,nextLocation:C.nextLocation})):(o(P),u({isTransitioning:!0,flushSync:!1,currentLocation:C.currentLocation,nextLocation:C.nextLocation}))},[n.window,h,d,x,v]);m.useLayoutEffect(()=>n.subscribe(w),[n,w]),m.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new I7)},[c]),m.useEffect(()=>{if(d&&s&&n.window){let P=s,A=d.promise,E=n.window.document.startViewTransition(async()=>{v(()=>a(P)),await A});E.finished.finally(()=>{f(void 0),p(void 0),o(void 0),u({isTransitioning:!1})}),p(E)}},[v,s,d,n.window]),m.useEffect(()=>{d&&s&&i.location.key===s.location.key&&d.resolve()},[d,h,i.location,s]),m.useEffect(()=>{!c.isTransitioning&&g&&(o(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),y(void 0))},[c.isTransitioning,g]),m.useEffect(()=>{},[]);let k=m.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:P=>n.navigate(P),push:(P,A,E)=>n.navigate(P,{state:A,preventScrollReset:E==null?void 0:E.preventScrollReset}),replace:(P,A,E)=>n.navigate(P,{replace:!0,state:A,preventScrollReset:E==null?void 0:E.preventScrollReset})}),[n]),S=n.basename||"/",j=m.useMemo(()=>({router:n,navigator:k,static:!1,basename:S}),[n,k,S]),N=m.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return m.useEffect(()=>v7(r,n.future),[r,n.future]),m.createElement(m.Fragment,null,m.createElement(vd.Provider,{value:j},m.createElement(Jb.Provider,{value:i},m.createElement(O7.Provider,{value:x.current},m.createElement(BO.Provider,{value:c},m.createElement(b7,{basename:S,location:i.location,navigationType:i.historyAction,navigator:k,future:N},i.initialized||n.future.v7_partialHydration?m.createElement(R7,{routes:n.routes,future:n.future,state:i}):t))))),null)}const R7=m.memo(F7);function F7(e){let{routes:t,future:n,state:r}=e;return o7(t,void 0,r,n)}const z7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,UO=m.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:s,state:o,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=$O(t,N7),{basename:p}=m.useContext(xa),g,y=!1;if(typeof u=="string"&&$7.test(u)&&(g=u,z7))try{let w=new URL(window.location.href),k=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=ui(k.pathname,p);k.origin===w.origin&&S!=null?u=S+k.search+k.hash:y=!0}catch{}let x=n7(u,{relative:i}),b=U7(u,{replace:s,state:o,target:c,preventScrollReset:d,relative:i,viewTransition:f});function v(w){r&&r(w),w.defaultPrevented||b(w)}return m.createElement("a",Ml({},h,{href:g||x,onClick:y||a?r:v,ref:n,target:c}))}),h0=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:s=!1,style:o,to:c,viewTransition:u,children:d}=t,f=$O(t,C7),h=Sm(c,{relative:f.relative}),p=gs(),g=m.useContext(Jb),{navigator:y,basename:x}=m.useContext(xa),b=g!=null&&V7(h)&&u===!0,v=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,w=p.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(w=w.toLowerCase(),k=k?k.toLowerCase():null,v=v.toLowerCase()),k&&x&&(k=ui(k,x)||k);const S=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let j=w===v||!s&&w.startsWith(v)&&w.charAt(S)==="/",N=k!=null&&(k===v||!s&&k.startsWith(v)&&k.charAt(v.length)==="/"),P={isActive:j,isPending:N,isTransitioning:b},A=j?r:void 0,E;typeof a=="function"?E=a(P):E=[a,j?"active":null,N?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let O=typeof o=="function"?o(P):o;return m.createElement(UO,Ml({},f,{"aria-current":A,className:E,ref:n,style:O,to:c,viewTransition:u}),typeof d=="function"?d(P):d)});var Sx;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Sx||(Sx={}));var Bj;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Bj||(Bj={}));function B7(e){let t=m.useContext(vd);return t||Ve(!1),t}function U7(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,viewTransition:o}=t===void 0?{}:t,c=$i(),u=gs(),d=Sm(e,{relative:s});return m.useCallback(f=>{if(k7(f,n)){f.preventDefault();let h=r!==void 0?r:po(u)===po(d);c(e,{replace:h,state:i,preventScrollReset:a,relative:s,viewTransition:o})}},[u,c,d,r,i,n,e,a,s,o])}function bd(e){let t=m.useRef(wx(e)),n=m.useRef(!1),r=gs(),i=m.useMemo(()=>j7(r.search,n.current?null:t.current),[r.search]),a=$i(),s=m.useCallback((o,c)=>{const u=wx(typeof o=="function"?o(i):o);n.current=!0,a("?"+u,c)},[a,i]);return[i,s]}function V7(e,t){t===void 0&&(t={});let n=m.useContext(BO);n==null&&Ve(!1);let{basename:r}=B7(Sx.useViewTransitionState),i=Sm(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=ui(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=ui(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Yh(i.pathname,s)!=null||Yh(i.pathname,a)!=null}/**
69
+ * @license lucide-react v0.395.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */const W7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),VO=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
74
+ * @license lucide-react v0.395.0 - ISC
75
+ *
76
+ * This source code is licensed under the ISC license.
77
+ * See the LICENSE file in the root directory of this source tree.
78
+ */var H7={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"};/**
79
+ * @license lucide-react v0.395.0 - ISC
80
+ *
81
+ * This source code is licensed under the ISC license.
82
+ * See the LICENSE file in the root directory of this source tree.
83
+ */const K7=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:s,...o},c)=>m.createElement("svg",{ref:c,...H7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:VO("lucide",i),...o},[...s.map(([u,d])=>m.createElement(u,d)),...Array.isArray(a)?a:[a]]));/**
84
+ * @license lucide-react v0.395.0 - ISC
85
+ *
86
+ * This source code is licensed under the ISC license.
87
+ * See the LICENSE file in the root directory of this source tree.
88
+ */const pe=(e,t)=>{const n=m.forwardRef(({className:r,...i},a)=>m.createElement(K7,{ref:a,iconNode:t,className:VO(`lucide-${W7(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
89
+ * @license lucide-react v0.395.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ */const G7=pe("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"}]]);/**
94
+ * @license lucide-react v0.395.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */const q7=pe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
99
+ * @license lucide-react v0.395.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */const WO=pe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
104
+ * @license lucide-react v0.395.0 - ISC
105
+ *
106
+ * This source code is licensed under the ISC license.
107
+ * See the LICENSE file in the root directory of this source tree.
108
+ */const Uj=pe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
109
+ * @license lucide-react v0.395.0 - ISC
110
+ *
111
+ * This source code is licensed under the ISC license.
112
+ * See the LICENSE file in the root directory of this source tree.
113
+ */const HO=pe("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
114
+ * @license lucide-react v0.395.0 - ISC
115
+ *
116
+ * This source code is licensed under the ISC license.
117
+ * See the LICENSE file in the root directory of this source tree.
118
+ */const rw=pe("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
119
+ * @license lucide-react v0.395.0 - ISC
120
+ *
121
+ * This source code is licensed under the ISC license.
122
+ * See the LICENSE file in the root directory of this source tree.
123
+ */const iw=pe("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
124
+ * @license lucide-react v0.395.0 - ISC
125
+ *
126
+ * This source code is licensed under the ISC license.
127
+ * See the LICENSE file in the root directory of this source tree.
128
+ */const Dl=pe("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
129
+ * @license lucide-react v0.395.0 - ISC
130
+ *
131
+ * This source code is licensed under the ISC license.
132
+ * See the LICENSE file in the root directory of this source tree.
133
+ */const Y7=pe("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"}]]);/**
134
+ * @license lucide-react v0.395.0 - ISC
135
+ *
136
+ * This source code is licensed under the ISC license.
137
+ * See the LICENSE file in the root directory of this source tree.
138
+ */const aw=pe("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
139
+ * @license lucide-react v0.395.0 - ISC
140
+ *
141
+ * This source code is licensed under the ISC license.
142
+ * See the LICENSE file in the root directory of this source tree.
143
+ */const $n=pe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
144
+ * @license lucide-react v0.395.0 - ISC
145
+ *
146
+ * This source code is licensed under the ISC license.
147
+ * See the LICENSE file in the root directory of this source tree.
148
+ */const ea=pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
149
+ * @license lucide-react v0.395.0 - ISC
150
+ *
151
+ * This source code is licensed under the ISC license.
152
+ * See the LICENSE file in the root directory of this source tree.
153
+ */const ua=pe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
154
+ * @license lucide-react v0.395.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */const dh=pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
159
+ * @license lucide-react v0.395.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */const zu=pe("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"}]]);/**
164
+ * @license lucide-react v0.395.0 - ISC
165
+ *
166
+ * This source code is licensed under the ISC license.
167
+ * See the LICENSE file in the root directory of this source tree.
168
+ */const X7=pe("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
169
+ * @license lucide-react v0.395.0 - ISC
170
+ *
171
+ * This source code is licensed under the ISC license.
172
+ * See the LICENSE file in the root directory of this source tree.
173
+ */const Hr=pe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
174
+ * @license lucide-react v0.395.0 - ISC
175
+ *
176
+ * This source code is licensed under the ISC license.
177
+ * See the LICENSE file in the root directory of this source tree.
178
+ */const Z7=pe("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
179
+ * @license lucide-react v0.395.0 - ISC
180
+ *
181
+ * This source code is licensed under the ISC license.
182
+ * See the LICENSE file in the root directory of this source tree.
183
+ */const ys=pe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
184
+ * @license lucide-react v0.395.0 - ISC
185
+ *
186
+ * This source code is licensed under the ISC license.
187
+ * See the LICENSE file in the root directory of this source tree.
188
+ */const KO=pe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
189
+ * @license lucide-react v0.395.0 - ISC
190
+ *
191
+ * This source code is licensed under the ISC license.
192
+ * See the LICENSE file in the root directory of this source tree.
193
+ */const Vj=pe("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/**
194
+ * @license lucide-react v0.395.0 - ISC
195
+ *
196
+ * This source code is licensed under the ISC license.
197
+ * See the LICENSE file in the root directory of this source tree.
198
+ */const os=pe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
199
+ * @license lucide-react v0.395.0 - ISC
200
+ *
201
+ * This source code is licensed under the ISC license.
202
+ * See the LICENSE file in the root directory of this source tree.
203
+ */const Q7=pe("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
204
+ * @license lucide-react v0.395.0 - ISC
205
+ *
206
+ * This source code is licensed under the ISC license.
207
+ * See the LICENSE file in the root directory of this source tree.
208
+ */const Gs=pe("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
209
+ * @license lucide-react v0.395.0 - ISC
210
+ *
211
+ * This source code is licensed under the ISC license.
212
+ * See the LICENSE file in the root directory of this source tree.
213
+ */const GO=pe("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
214
+ * @license lucide-react v0.395.0 - ISC
215
+ *
216
+ * This source code is licensed under the ISC license.
217
+ * See the LICENSE file in the root directory of this source tree.
218
+ */const J7=pe("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
219
+ * @license lucide-react v0.395.0 - ISC
220
+ *
221
+ * This source code is licensed under the ISC license.
222
+ * See the LICENSE file in the root directory of this source tree.
223
+ */const kx=pe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
224
+ * @license lucide-react v0.395.0 - ISC
225
+ *
226
+ * This source code is licensed under the ISC license.
227
+ * See the LICENSE file in the root directory of this source tree.
228
+ */const mo=pe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
229
+ * @license lucide-react v0.395.0 - ISC
230
+ *
231
+ * This source code is licensed under the ISC license.
232
+ * See the LICENSE file in the root directory of this source tree.
233
+ */const qO=pe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
234
+ * @license lucide-react v0.395.0 - ISC
235
+ *
236
+ * This source code is licensed under the ISC license.
237
+ * See the LICENSE file in the root directory of this source tree.
238
+ */const eB=pe("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"}]]);/**
239
+ * @license lucide-react v0.395.0 - ISC
240
+ *
241
+ * This source code is licensed under the ISC license.
242
+ * See the LICENSE file in the root directory of this source tree.
243
+ */const wd=pe("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
244
+ * @license lucide-react v0.395.0 - ISC
245
+ *
246
+ * This source code is licensed under the ISC license.
247
+ * See the LICENSE file in the root directory of this source tree.
248
+ */const Ka=pe("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
249
+ * @license lucide-react v0.395.0 - ISC
250
+ *
251
+ * This source code is licensed under the ISC license.
252
+ * See the LICENSE file in the root directory of this source tree.
253
+ */const tB=pe("FilePlus2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}],["path",{d:"M6 12v6",key:"1u72j0"}]]);/**
254
+ * @license lucide-react v0.395.0 - ISC
255
+ *
256
+ * This source code is licensed under the ISC license.
257
+ * See the LICENSE file in the root directory of this source tree.
258
+ */const YO=pe("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"}]]);/**
259
+ * @license lucide-react v0.395.0 - ISC
260
+ *
261
+ * This source code is licensed under the ISC license.
262
+ * See the LICENSE file in the root directory of this source tree.
263
+ */const nB=pe("FileUp",[["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:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
264
+ * @license lucide-react v0.395.0 - ISC
265
+ *
266
+ * This source code is licensed under the ISC license.
267
+ * See the LICENSE file in the root directory of this source tree.
268
+ */const XO=pe("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/**
269
+ * @license lucide-react v0.395.0 - ISC
270
+ *
271
+ * This source code is licensed under the ISC license.
272
+ * See the LICENSE file in the root directory of this source tree.
273
+ */const sw=pe("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
274
+ * @license lucide-react v0.395.0 - ISC
275
+ *
276
+ * This source code is licensed under the ISC license.
277
+ * See the LICENSE file in the root directory of this source tree.
278
+ */const Il=pe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
279
+ * @license lucide-react v0.395.0 - ISC
280
+ *
281
+ * This source code is licensed under the ISC license.
282
+ * See the LICENSE file in the root directory of this source tree.
283
+ */const ZO=pe("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
284
+ * @license lucide-react v0.395.0 - ISC
285
+ *
286
+ * This source code is licensed under the ISC license.
287
+ * See the LICENSE file in the root directory of this source tree.
288
+ */const ow=pe("History",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
289
+ * @license lucide-react v0.395.0 - ISC
290
+ *
291
+ * This source code is licensed under the ISC license.
292
+ * See the LICENSE file in the root directory of this source tree.
293
+ */const km=pe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
294
+ * @license lucide-react v0.395.0 - ISC
295
+ *
296
+ * This source code is licensed under the ISC license.
297
+ * See the LICENSE file in the root directory of this source tree.
298
+ */const Ql=pe("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
299
+ * @license lucide-react v0.395.0 - ISC
300
+ *
301
+ * This source code is licensed under the ISC license.
302
+ * See the LICENSE file in the root directory of this source tree.
303
+ */const rB=pe("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
304
+ * @license lucide-react v0.395.0 - ISC
305
+ *
306
+ * This source code is licensed under the ISC license.
307
+ * See the LICENSE file in the root directory of this source tree.
308
+ */const lw=pe("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
309
+ * @license lucide-react v0.395.0 - ISC
310
+ *
311
+ * This source code is licensed under the ISC license.
312
+ * See the LICENSE file in the root directory of this source tree.
313
+ */const cw=pe("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"}]]);/**
314
+ * @license lucide-react v0.395.0 - ISC
315
+ *
316
+ * This source code is licensed under the ISC license.
317
+ * See the LICENSE file in the root directory of this source tree.
318
+ */const iB=pe("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
319
+ * @license lucide-react v0.395.0 - ISC
320
+ *
321
+ * This source code is licensed under the ISC license.
322
+ * See the LICENSE file in the root directory of this source tree.
323
+ */const Le=pe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
324
+ * @license lucide-react v0.395.0 - ISC
325
+ *
326
+ * This source code is licensed under the ISC license.
327
+ * See the LICENSE file in the root directory of this source tree.
328
+ */const Zh=pe("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"}]]);/**
329
+ * @license lucide-react v0.395.0 - ISC
330
+ *
331
+ * This source code is licensed under the ISC license.
332
+ * See the LICENSE file in the root directory of this source tree.
333
+ */const aB=pe("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
334
+ * @license lucide-react v0.395.0 - ISC
335
+ *
336
+ * This source code is licensed under the ISC license.
337
+ * See the LICENSE file in the root directory of this source tree.
338
+ */const sB=pe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
339
+ * @license lucide-react v0.395.0 - ISC
340
+ *
341
+ * This source code is licensed under the ISC license.
342
+ * See the LICENSE file in the root directory of this source tree.
343
+ */const oB=pe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
344
+ * @license lucide-react v0.395.0 - ISC
345
+ *
346
+ * This source code is licensed under the ISC license.
347
+ * See the LICENSE file in the root directory of this source tree.
348
+ */const jm=pe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
349
+ * @license lucide-react v0.395.0 - ISC
350
+ *
351
+ * This source code is licensed under the ISC license.
352
+ * See the LICENSE file in the root directory of this source tree.
353
+ */const uw=pe("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
354
+ * @license lucide-react v0.395.0 - ISC
355
+ *
356
+ * This source code is licensed under the ISC license.
357
+ * See the LICENSE file in the root directory of this source tree.
358
+ */const Sd=pe("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"}]]);/**
359
+ * @license lucide-react v0.395.0 - ISC
360
+ *
361
+ * This source code is licensed under the ISC license.
362
+ * See the LICENSE file in the root directory of this source tree.
363
+ */const lB=pe("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
364
+ * @license lucide-react v0.395.0 - ISC
365
+ *
366
+ * This source code is licensed under the ISC license.
367
+ * See the LICENSE file in the root directory of this source tree.
368
+ */const Nm=pe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
369
+ * @license lucide-react v0.395.0 - ISC
370
+ *
371
+ * This source code is licensed under the ISC license.
372
+ * See the LICENSE file in the root directory of this source tree.
373
+ */const jx=pe("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
374
+ * @license lucide-react v0.395.0 - ISC
375
+ *
376
+ * This source code is licensed under the ISC license.
377
+ * See the LICENSE file in the root directory of this source tree.
378
+ */const In=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
379
+ * @license lucide-react v0.395.0 - ISC
380
+ *
381
+ * This source code is licensed under the ISC license.
382
+ * See the LICENSE file in the root directory of this source tree.
383
+ */const cB=pe("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
384
+ * @license lucide-react v0.395.0 - ISC
385
+ *
386
+ * This source code is licensed under the ISC license.
387
+ * See the LICENSE file in the root directory of this source tree.
388
+ */const uB=pe("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"}]]);/**
389
+ * @license lucide-react v0.395.0 - ISC
390
+ *
391
+ * This source code is licensed under the ISC license.
392
+ * See the LICENSE file in the root directory of this source tree.
393
+ */const QO=pe("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"}]]);/**
394
+ * @license lucide-react v0.395.0 - ISC
395
+ *
396
+ * This source code is licensed under the ISC license.
397
+ * See the LICENSE file in the root directory of this source tree.
398
+ */const Wn=pe("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"}]]);/**
399
+ * @license lucide-react v0.395.0 - ISC
400
+ *
401
+ * This source code is licensed under the ISC license.
402
+ * See the LICENSE file in the root directory of this source tree.
403
+ */const $u=pe("SearchCode",[["path",{d:"m13 13.5 2-2.5-2-2.5",key:"1rvxrh"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}],["path",{d:"M9 8.5 7 11l2 2.5",key:"6ffwbx"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);/**
404
+ * @license lucide-react v0.395.0 - ISC
405
+ *
406
+ * This source code is licensed under the ISC license.
407
+ * See the LICENSE file in the root directory of this source tree.
408
+ */const Hn=pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
409
+ * @license lucide-react v0.395.0 - ISC
410
+ *
411
+ * This source code is licensed under the ISC license.
412
+ * See the LICENSE file in the root directory of this source tree.
413
+ */const dB=pe("SendHorizontal",[["path",{d:"m3 3 3 9-3 9 19-9Z",key:"1aobqy"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
414
+ * @license lucide-react v0.395.0 - ISC
415
+ *
416
+ * This source code is licensed under the ISC license.
417
+ * See the LICENSE file in the root directory of this source tree.
418
+ */const fB=pe("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
419
+ * @license lucide-react v0.395.0 - ISC
420
+ *
421
+ * This source code is licensed under the ISC license.
422
+ * See the LICENSE file in the root directory of this source tree.
423
+ */const hB=pe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
424
+ * @license lucide-react v0.395.0 - ISC
425
+ *
426
+ * This source code is licensed under the ISC license.
427
+ * See the LICENSE file in the root directory of this source tree.
428
+ */const Cm=pe("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"}]]);/**
429
+ * @license lucide-react v0.395.0 - ISC
430
+ *
431
+ * This source code is licensed under the ISC license.
432
+ * See the LICENSE file in the root directory of this source tree.
433
+ */const pB=pe("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
434
+ * @license lucide-react v0.395.0 - ISC
435
+ *
436
+ * This source code is licensed under the ISC license.
437
+ * See the LICENSE file in the root directory of this source tree.
438
+ */const Bu=pe("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
439
+ * @license lucide-react v0.395.0 - ISC
440
+ *
441
+ * This source code is licensed under the ISC license.
442
+ * See the LICENSE file in the root directory of this source tree.
443
+ */const dw=pe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
444
+ * @license lucide-react v0.395.0 - ISC
445
+ *
446
+ * This source code is licensed under the ISC license.
447
+ * See the LICENSE file in the root directory of this source tree.
448
+ */const JO=pe("ShieldX",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);/**
449
+ * @license lucide-react v0.395.0 - ISC
450
+ *
451
+ * This source code is licensed under the ISC license.
452
+ * See the LICENSE file in the root directory of this source tree.
453
+ */const fw=pe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
454
+ * @license lucide-react v0.395.0 - ISC
455
+ *
456
+ * This source code is licensed under the ISC license.
457
+ * See the LICENSE file in the root directory of this source tree.
458
+ */const hw=pe("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
459
+ * @license lucide-react v0.395.0 - ISC
460
+ *
461
+ * This source code is licensed under the ISC license.
462
+ * See the LICENSE file in the root directory of this source tree.
463
+ */const mB=pe("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"}]]);/**
464
+ * @license lucide-react v0.395.0 - ISC
465
+ *
466
+ * This source code is licensed under the ISC license.
467
+ * See the LICENSE file in the root directory of this source tree.
468
+ */const gB=pe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
469
+ * @license lucide-react v0.395.0 - ISC
470
+ *
471
+ * This source code is licensed under the ISC license.
472
+ * See the LICENSE file in the root directory of this source tree.
473
+ */const yB=pe("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
474
+ * @license lucide-react v0.395.0 - ISC
475
+ *
476
+ * This source code is licensed under the ISC license.
477
+ * See the LICENSE file in the root directory of this source tree.
478
+ */const pw=pe("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
479
+ * @license lucide-react v0.395.0 - ISC
480
+ *
481
+ * This source code is licensed under the ISC license.
482
+ * See the LICENSE file in the root directory of this source tree.
483
+ */const si=pe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
484
+ * @license lucide-react v0.395.0 - ISC
485
+ *
486
+ * This source code is licensed under the ISC license.
487
+ * See the LICENSE file in the root directory of this source tree.
488
+ */const e_=pe("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
489
+ * @license lucide-react v0.395.0 - ISC
490
+ *
491
+ * This source code is licensed under the ISC license.
492
+ * See the LICENSE file in the root directory of this source tree.
493
+ */const t_=pe("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
494
+ * @license lucide-react v0.395.0 - ISC
495
+ *
496
+ * This source code is licensed under the ISC license.
497
+ * See the LICENSE file in the root directory of this source tree.
498
+ */const Uu=pe("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
499
+ * @license lucide-react v0.395.0 - ISC
500
+ *
501
+ * This source code is licensed under the ISC license.
502
+ * See the LICENSE file in the root directory of this source tree.
503
+ */const sr=pe("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"}]]);/**
504
+ * @license lucide-react v0.395.0 - ISC
505
+ *
506
+ * This source code is licensed under the ISC license.
507
+ * See the LICENSE file in the root directory of this source tree.
508
+ */const Ai=pe("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"}]]);/**
509
+ * @license lucide-react v0.395.0 - ISC
510
+ *
511
+ * This source code is licensed under the ISC license.
512
+ * See the LICENSE file in the root directory of this source tree.
513
+ */const Nx=pe("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
514
+ * @license lucide-react v0.395.0 - ISC
515
+ *
516
+ * This source code is licensed under the ISC license.
517
+ * See the LICENSE file in the root directory of this source tree.
518
+ */const n_=pe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
519
+ * @license lucide-react v0.395.0 - ISC
520
+ *
521
+ * This source code is licensed under the ISC license.
522
+ * See the LICENSE file in the root directory of this source tree.
523
+ */const Vu=pe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
524
+ * @license lucide-react v0.395.0 - ISC
525
+ *
526
+ * This source code is licensed under the ISC license.
527
+ * See the LICENSE file in the root directory of this source tree.
528
+ */const ta=pe("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"}]]);/**
529
+ * @license lucide-react v0.395.0 - ISC
530
+ *
531
+ * This source code is licensed under the ISC license.
532
+ * See the LICENSE file in the root directory of this source tree.
533
+ */const xB=pe("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
534
+ * @license lucide-react v0.395.0 - ISC
535
+ *
536
+ * This source code is licensed under the ISC license.
537
+ * See the LICENSE file in the root directory of this source tree.
538
+ */const mw=pe("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
539
+ * @license lucide-react v0.395.0 - ISC
540
+ *
541
+ * This source code is licensed under the ISC license.
542
+ * See the LICENSE file in the root directory of this source tree.
543
+ */const r_=pe("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
544
+ * @license lucide-react v0.395.0 - ISC
545
+ *
546
+ * This source code is licensed under the ISC license.
547
+ * See the LICENSE file in the root directory of this source tree.
548
+ */const Ze=pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
549
+ * @license lucide-react v0.395.0 - ISC
550
+ *
551
+ * This source code is licensed under the ISC license.
552
+ * See the LICENSE file in the root directory of this source tree.
553
+ */const kd=pe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function i_(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=i_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ot(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=i_(e))&&(r&&(r+=" "),r+=t);return r}const gw="-",vB=e=>{const t=wB(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const o=s.split(gw);return o[0]===""&&o.length!==1&&o.shift(),a_(o,t)||bB(s)},getConflictingClassGroupIds:(s,o)=>{const c=n[s]||[];return o&&r[s]?[...c,...r[s]]:c}}},a_=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?a_(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(gw);return(s=t.validators.find(({validator:o})=>o(a)))==null?void 0:s.classGroupId},Wj=/^\[(.+)\]$/,bB=e=>{if(Wj.test(e)){const t=Wj.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},wB=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return kB(Object.entries(e.classGroups),n).forEach(([a,s])=>{Cx(s,r,a,t)}),r},Cx=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:Hj(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(SB(i)){Cx(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,s])=>{Cx(s,Hj(t,a),n,r)})})},Hj=(e,t)=>{let n=e;return t.split(gw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},SB=e=>e.isThemeGetter,kB=(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(([s,o])=>[t+s,o])):a);return[n,i]}):e,jB=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,s)=>{n.set(a,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=r.get(a))!==void 0)return i(a,s),s},set(a,s){n.has(a)?n.set(a,s):i(a,s)}}},s_="!",NB=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,s=o=>{const c=[];let u=0,d=0,f;for(let x=0;x<o.length;x++){let b=o[x];if(u===0){if(b===i&&(r||o.slice(x,x+a)===t)){c.push(o.slice(d,x)),d=x+a;continue}if(b==="/"){f=x;continue}}b==="["?u++:b==="]"&&u--}const h=c.length===0?o:o.substring(d),p=h.startsWith(s_),g=p?h.substring(1):h,y=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:y}};return n?o=>n({className:o,parseClassName:s}):s},CB=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},PB=e=>({cache:jB(e.cacheSize),parseClassName:NB(e),...vB(e)}),EB=/\s+/,AB=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],s=e.trim().split(EB);let o="";for(let c=s.length-1;c>=0;c-=1){const u=s[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let g=!!p,y=r(g?h.substring(0,p):h);if(!y){if(!g){o=u+(o.length>0?" "+o:o);continue}if(y=r(h),!y){o=u+(o.length>0?" "+o:o);continue}g=!1}const x=CB(d).join(":"),b=f?x+s_:x,v=b+y;if(a.includes(v))continue;a.push(v);const w=i(y,g);for(let k=0;k<w.length;++k){const S=w[k];a.push(b+S)}o=u+(o.length>0?" "+o:o)}return o};function TB(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=o_(t))&&(r&&(r+=" "),r+=n);return r}const o_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=o_(e[r]))&&(n&&(n+=" "),n+=t);return n};function OB(e,...t){let n,r,i,a=s;function s(c){const u=t.reduce((d,f)=>f(d),e());return n=PB(u),r=n.cache.get,i=n.cache.set,a=o,o(c)}function o(c){const u=r(c);if(u)return u;const d=AB(c,n);return i(c,d),d}return function(){return a(TB.apply(null,arguments))}}const vt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},l_=/^\[(?:([a-z-]+):)?(.+)\]$/i,_B=/^\d+\/\d+$/,MB=new Set(["px","full","screen"]),DB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IB=/\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$/,LB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,RB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vi=e=>bl(e)||MB.has(e)||_B.test(e),Aa=e=>Jl(e,"length",KB),bl=e=>!!e&&!Number.isNaN(Number(e)),p0=e=>Jl(e,"number",bl),Pc=e=>!!e&&Number.isInteger(Number(e)),zB=e=>e.endsWith("%")&&bl(e.slice(0,-1)),$e=e=>l_.test(e),Ta=e=>DB.test(e),$B=new Set(["length","size","percentage"]),BB=e=>Jl(e,$B,c_),UB=e=>Jl(e,"position",c_),VB=new Set(["image","url"]),WB=e=>Jl(e,VB,qB),HB=e=>Jl(e,"",GB),Ec=()=>!0,Jl=(e,t,n)=>{const r=l_.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},KB=e=>IB.test(e)&&!LB.test(e),c_=()=>!1,GB=e=>RB.test(e),qB=e=>FB.test(e),YB=()=>{const e=vt("colors"),t=vt("spacing"),n=vt("blur"),r=vt("brightness"),i=vt("borderColor"),a=vt("borderRadius"),s=vt("borderSpacing"),o=vt("borderWidth"),c=vt("contrast"),u=vt("grayscale"),d=vt("hueRotate"),f=vt("invert"),h=vt("gap"),p=vt("gradientColorStops"),g=vt("gradientColorStopPositions"),y=vt("inset"),x=vt("margin"),b=vt("opacity"),v=vt("padding"),w=vt("saturate"),k=vt("scale"),S=vt("sepia"),j=vt("skew"),N=vt("space"),P=vt("translate"),A=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",$e,t],C=()=>[$e,t],M=()=>["",Vi,Aa],I=()=>["auto",bl,$e],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],se=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",$e],T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ie=()=>[bl,$e];return{cacheSize:500,separator:":",theme:{colors:[Ec],spacing:[Vi,Aa],blur:["none","",Ta,$e],brightness:ie(),borderColor:[e],borderRadius:["none","","full",Ta,$e],borderSpacing:C(),borderWidth:M(),contrast:ie(),grayscale:K(),hueRotate:ie(),invert:K(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[zB,Aa],inset:O(),margin:O(),opacity:ie(),padding:C(),saturate:ie(),scale:ie(),sepia:K(),skew:ie(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[Ta]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:[...B(),$e]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pc,$e]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",Pc,$e]}],"grid-cols":[{"grid-cols":[Ec]}],"col-start-end":[{col:["auto",{span:["full",Pc,$e]},$e]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Ec]}],"row-start-end":[{row:["auto",{span:[Pc,$e]},$e]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[Ta]},Ta]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ta,Aa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",p0]}],"font-family":[{font:[Ec]}],"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",$e]}],"line-clamp":[{"line-clamp":["none",bl,p0]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Vi,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Vi,Aa]}],"underline-offset":[{"underline-offset":["auto",Vi,$e]}],"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:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],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",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),UB]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",BB]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},WB]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...se(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:se()}],"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:["",...se()]}],"outline-offset":[{"outline-offset":[Vi,$e]}],"outline-w":[{outline:[Vi,Aa]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Vi,Aa]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ta,HB]}],"shadow-color":[{shadow:[Ec]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ta,$e]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$e]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Pc,$e]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],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",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Vi,Aa,p0]}],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"]}}},XB=OB(YB);function U(...e){return XB(ot(e))}const Wu="siclaw_auth",Pm=()=>{try{const e=localStorage.getItem(Wu);if(e)return JSON.parse(e)}catch{localStorage.removeItem(Wu)}return{isAuthenticated:!1}},ZB=e=>{localStorage.setItem(Wu,JSON.stringify(e))},QB=async e=>{try{const n=await(await fetch("/api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json();if(n.ok&&n.token){const r={isAuthenticated:!0,token:n.token,user:n.user};return ZB(r),{ok:!0,token:n.token,user:n.user}}return{ok:!1,error:n.error||"Login failed"}}catch{return{ok:!1,error:"Network error"}}},u_=()=>{localStorage.removeItem(Wu),window.location.href="/login"},JB=()=>Pm().token,ls=()=>Pm().user;function e8(e){try{return JSON.parse(atob(e.split(".")[1])).exp*1e3<Date.now()-6e4}catch{return!0}}const m0=()=>{const e=Pm();return!e.isAuthenticated||!e.token?!1:e8(e.token)?(localStorage.removeItem(Wu),window.location.href="/login",!1):!0},t8=()=>{const e=JB(),n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;return e?`${n}?token=${encodeURIComponent(e)}`:n};var cA,uA;let d_={name:((cA=ls())==null?void 0:cA.username)||"User",role:"",initials:yw(((uA=ls())==null?void 0:uA.username)||"User"),avatarBg:"bg-primary-100"};function yw(e){const t=e.split(" ");return t.length>=2?`${t[0][0]}${t[1][0]}`.toUpperCase():e.substring(0,2).toUpperCase()}const Ll=()=>{const e=localStorage.getItem("siclaw_user_profile");return e?JSON.parse(e):d_},Qh=e=>{const n={...Ll(),...e};return e.name&&(n.initials=yw(e.name)),d_=n,localStorage.setItem("siclaw_user_profile",JSON.stringify(n)),window.dispatchEvent(new Event("user-profile-updated")),n};async function n8(e){try{const t=await e("profile.get");if(!t.profile)return null;const n=t.profile,r=n.name||"User";return{name:r,role:n.role||"",initials:yw(r),avatarBg:n.avatarBg||"bg-primary-100"}}catch{return null}}async function r8(e,t){await e("profile.update",t),Qh(t)}async function i8(e){const t=ls(),n=await n8(e);if(n)Qh(n);else if(t){const r=Ll();(r.name==="User"||r.name==="SRE Admin")&&Qh({name:t.username})}}const f_=m.createContext(null),Kj=[300,600,1200,2500,5e3];function a8({children:e}){const[t,n]=m.useState("disconnected"),r=m.useRef(null),i=m.useRef(0),a=m.useRef(new Map),s=m.useRef(new Set),o=m.useRef(0),c=m.useRef(),u=m.useRef(!1),d=m.useRef(),f=m.useRef("disconnected"),h=m.useCallback(w=>{f.current=w,n(w)},[]),p=m.useCallback(()=>{if(u.current||!m0())return;const w=Kj[Math.min(o.current,Kj.length-1)];o.current++,console.log(`[ws] Reconnecting in ${w}ms (attempt ${o.current})`),c.current=setTimeout(()=>{g()},w)},[]),g=m.useCallback(()=>{if(r.current&&(r.current.onopen=null,r.current.onclose=null,r.current.onerror=null,r.current.onmessage=null,(r.current.readyState===WebSocket.OPEN||r.current.readyState===WebSocket.CONNECTING)&&r.current.close(),r.current=null),d.current&&clearTimeout(d.current),!m0()){console.warn("[ws] Not authenticated, skipping connect");return}h("connecting");const w=t8();console.log(`[ws] Connecting to: ${w} (attempt ${o.current})`);const k=new WebSocket(w);r.current=k,d.current=setTimeout(()=>{k.readyState!==WebSocket.OPEN&&(console.warn(`[ws] Connection timeout (3s), readyState=${k.readyState}, retrying...`),k.onclose=null,k.close(),r.current=null,h("disconnected"),p())},3e3),k.onopen=()=>{clearTimeout(d.current),console.log("[ws] Connected"),o.current=0,h("connected")},k.onmessage=S=>{try{const j=JSON.parse(S.data);if(j.type==="res"&&j.id){const N=a.current.get(j.id);if(N){const P=j.error?{code:j.error.code,message:j.error.message??"Unknown error"}:void 0;N(j.payload??j.result,P),a.current.delete(j.id)}}for(const N of Array.from(s.current))N(j)}catch(j){console.error("[ws] Failed to parse message:",j)}},k.onclose=S=>{clearTimeout(d.current),console.log(`[ws] Closed: code=${S.code} reason=${S.reason}`),r.current=null,h("disconnected"),p()},k.onerror=S=>{console.error("[ws] Error:",S)}},[h,p]),y=m.useCallback(()=>{var w;u.current=!0,c.current&&(clearTimeout(c.current),c.current=void 0),(w=r.current)==null||w.close(),r.current=null,h("disconnected")},[h]),x=m.useCallback((w,k)=>new Promise((S,j)=>{if(!r.current||r.current.readyState!==WebSocket.OPEN){j(new Error("WebSocket not connected"));return}const N=String(++i.current);a.current.set(N,(P,A)=>{var E;if(A){if((E=A.message)!=null&&E.includes("Unauthorized")){u_();return}j(new Error(A.message))}else S(P)}),r.current.send(JSON.stringify({type:"req",id:N,method:w,params:k??{}}))}),[]),b=m.useCallback(w=>(s.current.add(w),()=>{s.current.delete(w)}),[]);m.useEffect(()=>(m0()&&(u.current=!1,g()),()=>{y()}),[g,y]);const v={status:t,isConnected:t==="connected",sendRpc:x,connect:g,disconnect:y,subscribe:b};return l.jsx(f_.Provider,{value:v,children:e})}function $t(e={}){const t=m.useContext(f_);if(!t)throw new Error("useWebSocket must be used within WebSocketProvider");const n=m.useRef(e.onMessage);n.current=e.onMessage,m.useEffect(()=>{if(!n.current)return;const i=a=>{var s;return(s=n.current)==null?void 0:s.call(n,a)};return t.subscribe(i)},[t.subscribe]);const r=m.useRef(e.onStatusChange);return r.current=e.onStatusChange,m.useEffect(()=>{var i;(i=r.current)==null||i.call(r,t.status)},[t.status]),{status:t.status,connect:t.connect,disconnect:t.disconnect,sendRpc:t.sendRpc,isConnected:t.isConnected}}const s8=new Set(["cron_success","cron_failure","cron_result"]);function o8(e){const t=new Map,n=[];for(const r of e)if(s8.has(r.type)&&r.relatedId){const i=t.get(r.relatedId);i?i.push(r):t.set(r.relatedId,[r])}else n.push({key:r.id,type:r.type,title:r.title,relatedId:r.relatedId,notifications:[r],latestAt:r.createdAt,unreadCount:r.isRead?0:1});for(const[r,i]of t){const a=i[0].type;n.push({key:`cron:${r}`,type:a,title:i[0].title,relatedId:r,notifications:i,latestAt:i[0].createdAt,unreadCount:i.filter(s=>!s.isRead).length})}return n.sort((r,i)=>{const a=r.latestAt?new Date(r.latestAt).getTime():0;return(i.latestAt?new Date(i.latestAt).getTime():0)-a}),n}function l8(e){const[t,n]=m.useState([]),[r,i]=m.useState(0),a=m.useCallback(async()=>{try{const[f,h]=await Promise.all([e("notification.list"),e("notification.unreadCount")]);n(f.notifications??[]),i(h.count??0)}catch(f){console.error("[useNotifications] Failed to load:",f)}},[e]),s=m.useCallback(async f=>{try{await e("notification.markRead",{id:f}),n(h=>h.map(p=>p.id===f?{...p,isRead:!0}:p)),i(h=>Math.max(0,h-1))}catch(h){console.error("[useNotifications] markRead failed:",h)}},[e]),o=m.useCallback(async()=>{try{await e("notification.markRead",{id:"all"}),n(f=>f.map(h=>({...h,isRead:!0}))),i(0)}catch(f){console.error("[useNotifications] markAllRead failed:",f)}},[e]),c=m.useCallback(async f=>{try{await e("notification.dismiss",{id:f}),n(h=>{const p=h.find(g=>g.id===f);return p&&!p.isRead&&i(g=>Math.max(0,g-1)),h.filter(g=>g.id!==f)})}catch(h){console.error("[useNotifications] dismissOne failed:",h)}},[e]),u=m.useCallback(async()=>{try{await e("notification.dismissAll"),n([]),i(0)}catch(f){console.error("[useNotifications] dismissAll failed:",f)}},[e]),d=m.useCallback(f=>{if(f.type==="event"&&f.event==="notification"&&f.payload){const h=f.payload;n(p=>[h,...p]),i(p=>p+1)}},[]);return{notifications:t,unreadCount:r,loadNotifications:a,markRead:s,markAllRead:o,dismissOne:c,dismissAll:u,handleWsEvent:d}}function c8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const u8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f8={};function Gj(e,t){return(f8.jsx?d8:u8).test(e)}const h8=/[ \t\n\f\r]/g;function p8(e){return typeof e=="object"?e.type==="text"?qj(e.value):!1:qj(e)}function qj(e){return e.replace(h8,"")===""}class jd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}jd.prototype.normal={};jd.prototype.property={};jd.prototype.space=void 0;function h_(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new jd(n,r,t)}function Px(e){return e.toLowerCase()}class or{constructor(t,n){this.attribute=n,this.property=t}}or.prototype.attribute="";or.prototype.booleanish=!1;or.prototype.boolean=!1;or.prototype.commaOrSpaceSeparated=!1;or.prototype.commaSeparated=!1;or.prototype.defined=!1;or.prototype.mustUseProperty=!1;or.prototype.number=!1;or.prototype.overloadedBoolean=!1;or.prototype.property="";or.prototype.spaceSeparated=!1;or.prototype.space=void 0;let m8=0;const Be=Po(),Kt=Po(),Ex=Po(),ge=Po(),mt=Po(),wl=Po(),dr=Po();function Po(){return 2**++m8}const Ax=Object.freeze(Object.defineProperty({__proto__:null,boolean:Be,booleanish:Kt,commaOrSpaceSeparated:dr,commaSeparated:wl,number:ge,overloadedBoolean:Ex,spaceSeparated:mt},Symbol.toStringTag,{value:"Module"})),g0=Object.keys(Ax);class xw extends or{constructor(t,n,r,i){let a=-1;if(super(t,n),Yj(this,"space",i),typeof r=="number")for(;++a<g0.length;){const s=g0[a];Yj(this,g0[a],(r&Ax[s])===Ax[s])}}}xw.prototype.defined=!0;function Yj(e,t,n){n&&(e[t]=n)}function ec(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new xw(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Px(r)]=r,n[Px(a.attribute)]=r}return new jd(t,n,e.space)}const p_=ec({properties:{ariaActiveDescendant:null,ariaAtomic:Kt,ariaAutoComplete:null,ariaBusy:Kt,ariaChecked:Kt,ariaColCount:ge,ariaColIndex:ge,ariaColSpan:ge,ariaControls:mt,ariaCurrent:null,ariaDescribedBy:mt,ariaDetails:null,ariaDisabled:Kt,ariaDropEffect:mt,ariaErrorMessage:null,ariaExpanded:Kt,ariaFlowTo:mt,ariaGrabbed:Kt,ariaHasPopup:null,ariaHidden:Kt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:mt,ariaLevel:ge,ariaLive:null,ariaModal:Kt,ariaMultiLine:Kt,ariaMultiSelectable:Kt,ariaOrientation:null,ariaOwns:mt,ariaPlaceholder:null,ariaPosInSet:ge,ariaPressed:Kt,ariaReadOnly:Kt,ariaRelevant:null,ariaRequired:Kt,ariaRoleDescription:mt,ariaRowCount:ge,ariaRowIndex:ge,ariaRowSpan:ge,ariaSelected:Kt,ariaSetSize:ge,ariaSort:null,ariaValueMax:ge,ariaValueMin:ge,ariaValueNow:ge,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function m_(e,t){return t in e?e[t]:t}function g_(e,t){return m_(e,t.toLowerCase())}const g8=ec({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:wl,acceptCharset:mt,accessKey:mt,action:null,allow:null,allowFullScreen:Be,allowPaymentRequest:Be,allowUserMedia:Be,alt:null,as:null,async:Be,autoCapitalize:null,autoComplete:mt,autoFocus:Be,autoPlay:Be,blocking:mt,capture:null,charSet:null,checked:Be,cite:null,className:mt,cols:ge,colSpan:null,content:null,contentEditable:Kt,controls:Be,controlsList:mt,coords:ge|wl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Be,defer:Be,dir:null,dirName:null,disabled:Be,download:Ex,draggable:Kt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Be,formTarget:null,headers:mt,height:ge,hidden:Ex,high:ge,href:null,hrefLang:null,htmlFor:mt,httpEquiv:mt,id:null,imageSizes:null,imageSrcSet:null,inert:Be,inputMode:null,integrity:null,is:null,isMap:Be,itemId:null,itemProp:mt,itemRef:mt,itemScope:Be,itemType:mt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Be,low:ge,manifest:null,max:null,maxLength:ge,media:null,method:null,min:null,minLength:ge,multiple:Be,muted:Be,name:null,nonce:null,noModule:Be,noValidate:Be,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Be,optimum:ge,pattern:null,ping:mt,placeholder:null,playsInline:Be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Be,referrerPolicy:null,rel:mt,required:Be,reversed:Be,rows:ge,rowSpan:ge,sandbox:mt,scope:null,scoped:Be,seamless:Be,selected:Be,shadowRootClonable:Be,shadowRootDelegatesFocus:Be,shadowRootMode:null,shape:null,size:ge,sizes:null,slot:null,span:ge,spellCheck:Kt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ge,step:null,style:null,tabIndex:ge,target:null,title:null,translate:null,type:null,typeMustMatch:Be,useMap:null,value:Kt,width:ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:mt,axis:null,background:null,bgColor:null,border:ge,borderColor:null,bottomMargin:ge,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Be,declare:Be,event:null,face:null,frame:null,frameBorder:null,hSpace:ge,leftMargin:ge,link:null,longDesc:null,lowSrc:null,marginHeight:ge,marginWidth:ge,noResize:Be,noHref:Be,noShade:Be,noWrap:Be,object:null,profile:null,prompt:null,rev:null,rightMargin:ge,rules:null,scheme:null,scrolling:Kt,standby:null,summary:null,text:null,topMargin:ge,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ge,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Be,disableRemotePlayback:Be,prefix:null,property:null,results:ge,security:null,unselectable:null},space:"html",transform:g_}),y8=ec({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:dr,accentHeight:ge,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ge,amplitude:ge,arabicForm:null,ascent:ge,attributeName:null,attributeType:null,azimuth:ge,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ge,by:null,calcMode:null,capHeight:ge,className:mt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ge,diffuseConstant:ge,direction:null,display:null,dur:null,divisor:ge,dominantBaseline:null,download:Be,dx:null,dy:null,edgeMode:null,editable:null,elevation:ge,enableBackground:null,end:null,event:null,exponent:ge,externalResourcesRequired:null,fill:null,fillOpacity:ge,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:wl,g2:wl,glyphName:wl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ge,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ge,horizOriginX:ge,horizOriginY:ge,id:null,ideographic:ge,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ge,k:ge,k1:ge,k2:ge,k3:ge,k4:ge,kernelMatrix:dr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ge,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ge,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ge,overlineThickness:ge,paintOrder:null,panose1:null,path:null,pathLength:ge,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:mt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ge,pointsAtY:ge,pointsAtZ:ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:dr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:dr,rev:dr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:dr,requiredFeatures:dr,requiredFonts:dr,requiredFormats:dr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ge,specularExponent:ge,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ge,strikethroughThickness:ge,string:null,stroke:null,strokeDashArray:dr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ge,strokeOpacity:ge,strokeWidth:null,style:null,surfaceScale:ge,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:dr,tabIndex:ge,tableValues:null,target:null,targetX:ge,targetY:ge,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:dr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ge,underlineThickness:ge,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ge,values:null,vAlphabetic:ge,vMathematical:ge,vectorEffect:null,vHanging:ge,vIdeographic:ge,version:null,vertAdvY:ge,vertOriginX:ge,vertOriginY:ge,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ge,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:m_}),y_=ec({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),x_=ec({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:g_}),v_=ec({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),x8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},v8=/[A-Z]/g,Xj=/-[a-z]/g,b8=/^data[-\w.:]+$/i;function w8(e,t){const n=Px(t);let r=t,i=or;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&b8.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Xj,k8);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Xj.test(a)){let s=a.replace(v8,S8);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=xw}return new i(r,t)}function S8(e){return"-"+e.toLowerCase()}function k8(e){return e.charAt(1).toUpperCase()}const j8=h_([p_,g8,y_,x_,v_],"html"),vw=h_([p_,y8,y_,x_,v_],"svg");function N8(e){return e.join(" ").trim()}var bw={},Zj=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,C8=/\n/g,P8=/^\s*/,E8=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,A8=/^:\s*/,T8=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,O8=/^[;\s]*/,_8=/^\s+|\s+$/g,M8=`
554
+ `,Qj="/",Jj="*",Us="",D8="comment",I8="declaration";function L8(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var y=g.match(C8);y&&(n+=y.length);var x=g.lastIndexOf(M8);r=~x?g.length-x:r+g.length}function a(){var g={line:n,column:r};return function(y){return y.position=new s(g),u(),y}}function s(g){this.start=g,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function o(g){var y=new Error(t.source+":"+n+":"+r+": "+g);if(y.reason=g,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function c(g){var y=g.exec(e);if(y){var x=y[0];return i(x),e=e.slice(x.length),y}}function u(){c(P8)}function d(g){var y;for(g=g||[];y=f();)y!==!1&&g.push(y);return g}function f(){var g=a();if(!(Qj!=e.charAt(0)||Jj!=e.charAt(1))){for(var y=2;Us!=e.charAt(y)&&(Jj!=e.charAt(y)||Qj!=e.charAt(y+1));)++y;if(y+=2,Us===e.charAt(y-1))return o("End of comment missing");var x=e.slice(2,y-2);return r+=2,i(x),e=e.slice(y),r+=2,g({type:D8,comment:x})}}function h(){var g=a(),y=c(E8);if(y){if(f(),!c(A8))return o("property missing ':'");var x=c(T8),b=g({type:I8,property:eN(y[0].replace(Zj,Us)),value:x?eN(x[0].replace(Zj,Us)):Us});return c(O8),b}}function p(){var g=[];d(g);for(var y;y=h();)y!==!1&&(g.push(y),d(g));return g}return u(),p()}function eN(e){return e?e.replace(_8,Us):Us}var R8=L8,F8=Mn&&Mn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bw,"__esModule",{value:!0});bw.default=$8;const z8=F8(R8);function $8(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,z8.default)(e),i=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:s,value:o}=a;i?t(s,o,a):o&&(n=n||{},n[s]=o)}),n}var Em={};Object.defineProperty(Em,"__esModule",{value:!0});Em.camelCase=void 0;var B8=/^--[a-zA-Z0-9_-]+$/,U8=/-([a-z])/g,V8=/^[^-]+$/,W8=/^-(webkit|moz|ms|o|khtml)-/,H8=/^-(ms)-/,K8=function(e){return!e||V8.test(e)||B8.test(e)},G8=function(e,t){return t.toUpperCase()},tN=function(e,t){return"".concat(t,"-")},q8=function(e,t){return t===void 0&&(t={}),K8(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(H8,tN):e=e.replace(W8,tN),e.replace(U8,G8))};Em.camelCase=q8;var Y8=Mn&&Mn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},X8=Y8(bw),Z8=Em;function Tx(e,t){var n={};return!e||typeof e!="string"||(0,X8.default)(e,function(r,i){r&&i&&(n[(0,Z8.camelCase)(r,t)]=i)}),n}Tx.default=Tx;var Q8=Tx;const J8=hi(Q8),b_=w_("end"),ww=w_("start");function w_(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function e9(e){const t=ww(e),n=b_(e);if(t&&n)return{start:t,end:n}}function fu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nN(e.position):"start"in e||"end"in e?nN(e):"line"in e||"column"in e?Ox(e):""}function Ox(e){return rN(e&&e.line)+":"+rN(e&&e.column)}function nN(e){return Ox(e&&e.start)+"-"+Ox(e&&e.end)}function rN(e){return e&&typeof e=="number"?e:1}class Ln extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(s=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=fu(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ln.prototype.file="";Ln.prototype.name="";Ln.prototype.reason="";Ln.prototype.message="";Ln.prototype.stack="";Ln.prototype.column=void 0;Ln.prototype.line=void 0;Ln.prototype.ancestors=void 0;Ln.prototype.cause=void 0;Ln.prototype.fatal=void 0;Ln.prototype.place=void 0;Ln.prototype.ruleId=void 0;Ln.prototype.source=void 0;const Sw={}.hasOwnProperty,t9=new Map,n9=/[A-Z]/g,r9=new Set(["table","tbody","thead","tfoot","tr"]),i9=new Set(["td","th"]),S_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function a9(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=h9(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=f9(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?vw:j8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=k_(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function k_(e,t,n){if(t.type==="element")return s9(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return o9(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return c9(e,t,n);if(t.type==="mdxjsEsm")return l9(e,t);if(t.type==="root")return u9(e,t,n);if(t.type==="text")return d9(e,t)}function s9(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=vw,e.schema=i),e.ancestors.push(t);const a=N_(e,t.tagName,!1),s=p9(e,t);let o=jw(e,t);return r9.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!p8(c):!0})),j_(e,s,a,t),kw(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function o9(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Hu(e,t.position)}function l9(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Hu(e,t.position)}function c9(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=vw,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:N_(e,t.name,!0),s=m9(e,t),o=jw(e,t);return j_(e,s,a,t),kw(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function u9(e,t,n){const r={};return kw(r,jw(e,t)),e.create(t,e.Fragment,r,n)}function d9(e,t){return t.value}function j_(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function kw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function f9(e,t,n){return r;function r(i,a,s,o){const u=Array.isArray(s.children)?n:t;return o?u(a,s,o):u(a,s)}}function h9(e,t){return n;function n(r,i,a,s){const o=Array.isArray(a.children),c=ww(r);return t(i,a,s,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function p9(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Sw.call(t.properties,i)){const a=g9(e,i,t.properties[i]);if(a){const[s,o]=a;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&i9.has(t.tagName)?r=o:n[s]=o}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function m9(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Hu(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else Hu(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function jw(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:t9;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=i.get(c)||0;s=c+"-"+u,i.set(c,u+1)}}const o=k_(e,a,s);o!==void 0&&n.push(o)}return n}function g9(e,t,n){const r=w8(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?c8(n):N8(n)),r.property==="style"){let i=typeof n=="object"?n:y9(e,String(n));return e.stylePropertyNameCase==="css"&&(i=x9(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?x8[r.property]||r.property:r.attribute,n]}}function y9(e,t){try{return J8(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ln("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=S_+"#cannot-parse-style-attribute",i}}function N_(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const o=Gj(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}r=s}else r=Gj(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Sw.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Hu(e)}function Hu(e,t){const n=new Ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=S_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function x9(e){const t={};let n;for(n in e)Sw.call(e,n)&&(t[v9(n)]=e[n]);return t}function v9(e){let t=e.replace(n9,b9);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function b9(e){return"-"+e.toLowerCase()}const y0={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},w9={};function Nw(e,t){const n=w9,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return C_(e,r,i)}function C_(e,t,n){if(S9(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return iN(e.children,t,n)}return Array.isArray(e)?iN(e,t,n):""}function iN(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=C_(e[i],t,n);return r.join("")}function S9(e){return!!(e&&typeof e=="object")}const aN=document.createElement("i");function Cw(e){const t="&"+e+";";aN.innerHTML=t;const n=aN.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function xr(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function Rr(e,t){return e.length>0?(xr(e,e.length,0,t),e):t}const sN={}.hasOwnProperty;function P_(e){const t={};let n=-1;for(;++n<e.length;)k9(t,e[n]);return t}function k9(e,t){let n;for(n in t){const i=(sN.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){sN.call(i,s)||(i[s]=[]);const o=a[s];j9(i[s],Array.isArray(o)?o:o?[o]:[])}}}function j9(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);xr(e,0,0,r)}function E_(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function oi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const zn=xs(/[A-Za-z]/),On=xs(/[\dA-Za-z]/),N9=xs(/[#-'*+\--9=?A-Z^-~]/);function Jh(e){return e!==null&&(e<32||e===127)}const _x=xs(/\d/),C9=xs(/[\dA-Fa-f]/),P9=xs(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const Am=xs(new RegExp("\\p{P}|\\p{S}","u")),go=xs(/\s/);function xs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tc(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&On(e.charCodeAt(n+1))&&On(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=e.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Xe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(c){return Ke(c)?(e.enter(n),o(c)):t(c)}function o(c){return Ke(c)&&a++<i?(e.consume(c),o):(e.exit(n),t(c))}}const E9={tokenize:A9};function A9(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Xe(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),a(o)}function a(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return De(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),s)}}const T9={tokenize:O9},oN={tokenize:_9};function O9(e){const t=this,n=[];let r=0,i,a,s;return o;function o(w){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const k=t.events.length;let S=k,j;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){j=t.events[S][1].end;break}b(r);let N=k;for(;N<t.events.length;)t.events[N][1].end={...j},N++;return xr(t.events,S+1,0,t.events.slice(k)),t.events.length=N,u(w)}return o(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(oN,d,f)(w)}function d(w){return i&&v(),b(r),h(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(w)}function h(w){return t.containerState={},e.attempt(oN,p,g)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function g(w){if(w===null){i&&v(),b(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),y(w)}function y(w){if(w===null){x(e.exit("chunkFlow"),!0),b(0),e.consume(w);return}return De(w)?(e.consume(w),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(w),y)}function x(w,k){const S=t.sliceStream(w);if(k&&S.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(S),t.parser.lazy[w.start.line]){let j=i.events.length;for(;j--;)if(i.events[j][1].start.offset<s&&(!i.events[j][1].end||i.events[j][1].end.offset>s))return;const N=t.events.length;let P=N,A,E;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(A){E=t.events[P][1].end;break}A=!0}for(b(r),j=N;j<t.events.length;)t.events[j][1].end={...E},j++;xr(t.events,P+1,0,t.events.slice(N)),t.events.length=j}}function b(w){let k=n.length;for(;k-- >w;){const S=n[k];t.containerState=S[1],S[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function _9(e,t,n){return Xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Rl(e){if(e===null||ft(e)||go(e))return 1;if(Am(e))return 2}function Tm(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Mx={name:"attention",resolveAll:M9,tokenize:D9};function M9(e,t){let n=-1,r,i,a,s,o,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};lN(f,-c),lN(h,c),s={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},e[r][1].end={...s.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Rr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Rr(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),u=Rr(u,Tm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Rr(u,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Rr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,xr(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function D9(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Rl(r);let a;return s;function s(c){return a=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===a)return e.consume(c),o;const u=e.exit("attentionSequence"),d=Rl(c),f=!d||d===2&&i||n.includes(c),h=!i||i===2&&d||n.includes(r);return u._open=!!(a===42?f:f&&(i||!h)),u._close=!!(a===42?h:h&&(d||!f)),t(c)}}function lN(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const I9={name:"autolink",tokenize:L9};function L9(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return zn(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||On(p)?(r=1,o(p)):u(p)}function o(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||On(p))&&r++<32?(e.consume(p),o):(r=0,u(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Jh(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):N9(p)?(e.consume(p),u):n(p)}function d(p){return On(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||On(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const Nd={partial:!0,tokenize:R9};function R9(e,t,n){return r;function r(a){return Ke(a)?Xe(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||De(a)?t(a):n(a)}}const A_={continuation:{tokenize:z9},exit:$9,name:"blockQuote",tokenize:F9};function F9(e,t,n){const r=this;return i;function i(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return Ke(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function z9(e,t,n){const r=this;return i;function i(s){return Ke(s)?Xe(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(A_,t,n)(s)}}function $9(e){e.exit("blockQuote")}const T_={name:"characterEscape",tokenize:B9};function B9(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return P9(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const O_={name:"characterReference",tokenize:U9};function U9(e,t,n){const r=this;let i=0,a,s;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,s=On,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=C9,d):(e.enter("characterReferenceValue"),a=7,s=_x,d(f))}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return s===On&&!Cw(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<a?(e.consume(f),d):n(f)}}const cN={partial:!0,tokenize:W9},uN={concrete:!0,name:"codeFenced",tokenize:V9};function V9(e,t,n){const r=this,i={partial:!0,tokenize:S};let a=0,s=0,o;return c;function c(j){return u(j)}function u(j){const N=r.events[r.events.length-1];return a=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,o=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(j)}function d(j){return j===o?(s++,e.consume(j),d):s<3?n(j):(e.exit("codeFencedFenceSequence"),Ke(j)?Xe(e,f,"whitespace")(j):f(j))}function f(j){return j===null||De(j)?(e.exit("codeFencedFence"),r.interrupt?t(j):e.check(cN,y,k)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(j))}function h(j){return j===null||De(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(j)):Ke(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xe(e,p,"whitespace")(j)):j===96&&j===o?n(j):(e.consume(j),h)}function p(j){return j===null||De(j)?f(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(j))}function g(j){return j===null||De(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(j)):j===96&&j===o?n(j):(e.consume(j),g)}function y(j){return e.attempt(i,k,x)(j)}function x(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),b}function b(j){return a>0&&Ke(j)?Xe(e,v,"linePrefix",a+1)(j):v(j)}function v(j){return j===null||De(j)?e.check(cN,y,k)(j):(e.enter("codeFlowValue"),w(j))}function w(j){return j===null||De(j)?(e.exit("codeFlowValue"),v(j)):(e.consume(j),w)}function k(j){return e.exit("codeFenced"),t(j)}function S(j,N,P){let A=0;return E;function E(B){return j.enter("lineEnding"),j.consume(B),j.exit("lineEnding"),O}function O(B){return j.enter("codeFencedFence"),Ke(B)?Xe(j,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):C(B)}function C(B){return B===o?(j.enter("codeFencedFenceSequence"),M(B)):P(B)}function M(B){return B===o?(A++,j.consume(B),M):A>=s?(j.exit("codeFencedFenceSequence"),Ke(B)?Xe(j,I,"whitespace")(B):I(B)):P(B)}function I(B){return B===null||De(B)?(j.exit("codeFencedFence"),N(B)):P(B)}}}function W9(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const x0={name:"codeIndented",tokenize:K9},H9={partial:!0,tokenize:G9};function K9(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Xe(e,a,"linePrefix",5)(u)}function a(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?c(u):De(u)?e.attempt(H9,s,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||De(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),t(u)}}function G9(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):De(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Xe(e,a,"linePrefix",5)(s)}function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):De(s)?i(s):n(s)}}const q9={name:"codeText",previous:X9,resolve:Y9,tokenize:Z9};function Y9(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function X9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Z9(e,t,n){let r=0,i,a;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(a=e.enter("codeTextSequence"),i=0,d(f)):De(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||De(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",u(f))}}class Q9{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ac(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ac(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ac(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ac(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ac(this.left,n.reverse())}}}function Ac(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function __(e){const t={};let n=-1,r,i,a,s,o,c,u;const d=new Q9(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,J9(d,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=d.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return xr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function J9(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,c=[],u={};let d,f,h=-1,p=n,g=0,y=0;const x=[y];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(y=h+1,x.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),h=x.length;h--;){const b=o.slice(x[h],x[h+1]),v=a.pop();c.push([v,v+b.length-1]),e.splice(v,2,b)}for(c.reverse(),h=-1;++h<c.length;)u[g+c[h][0]]=g+c[h][1],g+=c[h][1]-c[h][0]-1;return u}const eU={resolve:nU,tokenize:rU},tU={partial:!0,tokenize:iU};function nU(e){return __(e),e}function rU(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):De(o)?e.check(tU,s,a)(o):(e.consume(o),i)}function a(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function iU(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Xe(e,a,"linePrefix")}function a(s){if(s===null||De(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function M_(e,t,n,r,i,a,s,o,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(b){return b===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(b),e.exit(a),h):b===null||b===32||b===41||Jh(b)?n(b):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(b))}function h(b){return b===62?(e.enter(a),e.consume(b),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(e.exit("chunkString"),e.exit(o),h(b)):b===null||b===60||De(b)?n(b):(e.consume(b),b===92?g:p)}function g(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function y(b){return!d&&(b===null||b===41||ft(b))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(b)):d<u&&b===40?(e.consume(b),d++,y):b===41?(e.consume(b),d--,y):b===null||b===32||b===40||Jh(b)?n(b):(e.consume(b),b===92?x:y)}function x(b){return b===40||b===41||b===92?(e.consume(b),y):y(b)}}function D_(e,t,n,r,i,a){const s=this;let o=0,c;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(a),d}function d(p){return o>999||p===null||p===91||p===93&&!c||p===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):De(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||De(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!Ke(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),o++,f):f(p)}}function I_(e,t,n,r,i,a){let s;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,c):n(h)}function c(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(a),u(h))}function u(h){return h===s?(e.exit(a),c(s)):h===null?n(h):De(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Xe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===s||h===null||De(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===s||h===92?(e.consume(h),d):d(h)}}function hu(e,t){let n;return r;function r(i){return De(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ke(i)?Xe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const aU={name:"definition",tokenize:oU},sU={partial:!0,tokenize:lU};function oU(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),s(p)}function s(p){return D_.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=oi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return ft(p)?hu(e,u)(p):u(p)}function u(p){return M_(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(sU,f,f)(p)}function f(p){return Ke(p)?Xe(e,h,"whitespace")(p):h(p)}function h(p){return p===null||De(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function lU(e,t,n){return r;function r(o){return ft(o)?hu(e,i)(o):n(o)}function i(o){return I_(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return Ke(o)?Xe(e,s,"whitespace")(o):s(o)}function s(o){return o===null||De(o)?t(o):n(o)}}const cU={name:"hardBreakEscape",tokenize:uU};function uU(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return De(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const dU={name:"headingAtx",resolve:fU,tokenize:hU};function fU(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},xr(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function hU(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||ft(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||De(d)?(e.exit("atxHeading"),t(d)):Ke(d)?Xe(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||ft(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const pU=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],dN=["pre","script","style","textarea"],mU={concrete:!0,name:"htmlFlow",resolveTo:xU,tokenize:vU},gU={partial:!0,tokenize:wU},yU={partial:!0,tokenize:bU};function xU(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function vU(e,t,n){const r=this;let i,a,s,o,c;return u;function u(_){return d(_)}function d(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),f}function f(_){return _===33?(e.consume(_),h):_===47?(e.consume(_),a=!0,y):_===63?(e.consume(_),i=3,r.interrupt?t:T):zn(_)?(e.consume(_),s=String.fromCharCode(_),x):n(_)}function h(_){return _===45?(e.consume(_),i=2,p):_===91?(e.consume(_),i=5,o=0,g):zn(_)?(e.consume(_),i=4,r.interrupt?t:T):n(_)}function p(_){return _===45?(e.consume(_),r.interrupt?t:T):n(_)}function g(_){const H="CDATA[";return _===H.charCodeAt(o++)?(e.consume(_),o===H.length?r.interrupt?t:C:g):n(_)}function y(_){return zn(_)?(e.consume(_),s=String.fromCharCode(_),x):n(_)}function x(_){if(_===null||_===47||_===62||ft(_)){const H=_===47,ee=s.toLowerCase();return!H&&!a&&dN.includes(ee)?(i=1,r.interrupt?t(_):C(_)):pU.includes(s.toLowerCase())?(i=6,H?(e.consume(_),b):r.interrupt?t(_):C(_)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):a?v(_):w(_))}return _===45||On(_)?(e.consume(_),s+=String.fromCharCode(_),x):n(_)}function b(_){return _===62?(e.consume(_),r.interrupt?t:C):n(_)}function v(_){return Ke(_)?(e.consume(_),v):E(_)}function w(_){return _===47?(e.consume(_),E):_===58||_===95||zn(_)?(e.consume(_),k):Ke(_)?(e.consume(_),w):E(_)}function k(_){return _===45||_===46||_===58||_===95||On(_)?(e.consume(_),k):S(_)}function S(_){return _===61?(e.consume(_),j):Ke(_)?(e.consume(_),S):w(_)}function j(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),c=_,N):Ke(_)?(e.consume(_),j):P(_)}function N(_){return _===c?(e.consume(_),c=null,A):_===null||De(_)?n(_):(e.consume(_),N)}function P(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||ft(_)?S(_):(e.consume(_),P)}function A(_){return _===47||_===62||Ke(_)?w(_):n(_)}function E(_){return _===62?(e.consume(_),O):n(_)}function O(_){return _===null||De(_)?C(_):Ke(_)?(e.consume(_),O):n(_)}function C(_){return _===45&&i===2?(e.consume(_),se):_===60&&i===1?(e.consume(_),Q):_===62&&i===4?(e.consume(_),ie):_===63&&i===3?(e.consume(_),T):_===93&&i===5?(e.consume(_),K):De(_)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(gU,J,M)(_)):_===null||De(_)?(e.exit("htmlFlowData"),M(_)):(e.consume(_),C)}function M(_){return e.check(yU,I,J)(_)}function I(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),B}function B(_){return _===null||De(_)?M(_):(e.enter("htmlFlowData"),C(_))}function se(_){return _===45?(e.consume(_),T):C(_)}function Q(_){return _===47?(e.consume(_),s="",D):C(_)}function D(_){if(_===62){const H=s.toLowerCase();return dN.includes(H)?(e.consume(_),ie):C(_)}return zn(_)&&s.length<8?(e.consume(_),s+=String.fromCharCode(_),D):C(_)}function K(_){return _===93?(e.consume(_),T):C(_)}function T(_){return _===62?(e.consume(_),ie):_===45&&i===2?(e.consume(_),T):C(_)}function ie(_){return _===null||De(_)?(e.exit("htmlFlowData"),J(_)):(e.consume(_),ie)}function J(_){return e.exit("htmlFlow"),t(_)}}function bU(e,t,n){const r=this;return i;function i(s){return De(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function wU(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Nd,t,n)}}const SU={name:"htmlText",tokenize:kU};function kU(e,t,n){const r=this;let i,a,s;return o;function o(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),c}function c(T){return T===33?(e.consume(T),u):T===47?(e.consume(T),S):T===63?(e.consume(T),w):zn(T)?(e.consume(T),P):n(T)}function u(T){return T===45?(e.consume(T),d):T===91?(e.consume(T),a=0,g):zn(T)?(e.consume(T),v):n(T)}function d(T){return T===45?(e.consume(T),p):n(T)}function f(T){return T===null?n(T):T===45?(e.consume(T),h):De(T)?(s=f,Q(T)):(e.consume(T),f)}function h(T){return T===45?(e.consume(T),p):f(T)}function p(T){return T===62?se(T):T===45?h(T):f(T)}function g(T){const ie="CDATA[";return T===ie.charCodeAt(a++)?(e.consume(T),a===ie.length?y:g):n(T)}function y(T){return T===null?n(T):T===93?(e.consume(T),x):De(T)?(s=y,Q(T)):(e.consume(T),y)}function x(T){return T===93?(e.consume(T),b):y(T)}function b(T){return T===62?se(T):T===93?(e.consume(T),b):y(T)}function v(T){return T===null||T===62?se(T):De(T)?(s=v,Q(T)):(e.consume(T),v)}function w(T){return T===null?n(T):T===63?(e.consume(T),k):De(T)?(s=w,Q(T)):(e.consume(T),w)}function k(T){return T===62?se(T):w(T)}function S(T){return zn(T)?(e.consume(T),j):n(T)}function j(T){return T===45||On(T)?(e.consume(T),j):N(T)}function N(T){return De(T)?(s=N,Q(T)):Ke(T)?(e.consume(T),N):se(T)}function P(T){return T===45||On(T)?(e.consume(T),P):T===47||T===62||ft(T)?A(T):n(T)}function A(T){return T===47?(e.consume(T),se):T===58||T===95||zn(T)?(e.consume(T),E):De(T)?(s=A,Q(T)):Ke(T)?(e.consume(T),A):se(T)}function E(T){return T===45||T===46||T===58||T===95||On(T)?(e.consume(T),E):O(T)}function O(T){return T===61?(e.consume(T),C):De(T)?(s=O,Q(T)):Ke(T)?(e.consume(T),O):A(T)}function C(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),i=T,M):De(T)?(s=C,Q(T)):Ke(T)?(e.consume(T),C):(e.consume(T),I)}function M(T){return T===i?(e.consume(T),i=void 0,B):T===null?n(T):De(T)?(s=M,Q(T)):(e.consume(T),M)}function I(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||ft(T)?A(T):(e.consume(T),I)}function B(T){return T===47||T===62||ft(T)?A(T):n(T)}function se(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function Q(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),D}function D(T){return Ke(T)?Xe(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):K(T)}function K(T){return e.enter("htmlTextData"),s(T)}}const Pw={name:"labelEnd",resolveAll:PU,resolveTo:EU,tokenize:AU},jU={tokenize:TU},NU={tokenize:OU},CU={tokenize:_U};function PU(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&xr(e,0,e.length,n),e}function EU(e,t){let n=e.length,r=0,i,a,s,o;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[s-2][1].start}};return o=[["enter",c,t],["enter",u,t]],o=Rr(o,e.slice(a+1,a+r+3)),o=Rr(o,[["enter",d,t]]),o=Rr(o,Tm(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),o=Rr(o,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),o=Rr(o,e.slice(s+1)),o=Rr(o,[["exit",c,t]]),xr(e,a,e.length,o),e}function AU(e,t,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return o;function o(h){return a?a._inactive?f(h):(s=r.parser.defined.includes(oi(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(jU,d,s?d:f)(h):h===91?e.attempt(NU,d,s?u:f)(h):s?d(h):f(h)}function u(h){return e.attempt(CU,d,f)(h)}function d(h){return t(h)}function f(h){return a._balanced=!0,n(h)}}function TU(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return ft(f)?hu(e,a)(f):a(f)}function a(f){return f===41?d(f):M_(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ft(f)?hu(e,c)(f):d(f)}function o(f){return n(f)}function c(f){return f===34||f===39||f===40?I_(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return ft(f)?hu(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function OU(e,t,n){const r=this;return i;function i(o){return D_.call(r,e,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return r.parser.defined.includes(oi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function _U(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const MU={name:"labelStartImage",resolveAll:Pw.resolveAll,tokenize:DU};function DU(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),a}function a(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const IU={name:"labelStartLink",resolveAll:Pw.resolveAll,tokenize:LU};function LU(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const v0={name:"lineEnding",tokenize:RU};function RU(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Xe(e,t,"linePrefix")}}const fh={name:"thematicBreak",tokenize:FU};function FU(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||De(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Ke(u)?Xe(e,o,"whitespace")(u):o(u))}}const Zn={continuation:{tokenize:UU},exit:WU,name:"list",tokenize:BU},zU={partial:!0,tokenize:HU},$U={partial:!0,tokenize:VU};function BU(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:_x(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(fh,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return _x(p)&&++s<10?(e.consume(p),c):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Nd,r.interrupt?n:d,e.attempt(zU,h,f))}function d(p){return r.containerState.initialBlankLine=!0,a++,h(p)}function f(p){return Ke(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function UU(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Nd,i,a);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xe(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!Ke(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($U,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xe(e,e.attempt(Zn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function VU(e,t,n){const r=this;return Xe(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function WU(e){e.exit(this.containerState.type)}function HU(e,t,n){const r=this;return Xe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!Ke(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const fN={name:"setextUnderline",resolveTo:KU,tokenize:GU};function KU(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",s,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function GU(e,t,n){const r=this;let i;return a;function a(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),Ke(u)?Xe(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||De(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const qU={tokenize:YU};function YU(e){const t=this,n=e.attempt(Nd,r,e.attempt(this.parser.constructs.flowInitial,i,Xe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(eU,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const XU={resolveAll:R_()},ZU=L_("string"),QU=L_("text");function L_(e){return{resolveAll:R_(e==="text"?JU:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,o);return s;function s(d){return u(d)?a(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),a(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=i[d];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function R_(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function JU(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,s=-1,o=0,c;for(;a--;){const u=i[a];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(u===-2)c=!0,o++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const eV={42:Zn,43:Zn,45:Zn,48:Zn,49:Zn,50:Zn,51:Zn,52:Zn,53:Zn,54:Zn,55:Zn,56:Zn,57:Zn,62:A_},tV={91:aU},nV={[-2]:x0,[-1]:x0,32:x0},rV={35:dU,42:fh,45:[fN,fh],60:mU,61:fN,95:fh,96:uN,126:uN},iV={38:O_,92:T_},aV={[-5]:v0,[-4]:v0,[-3]:v0,33:MU,38:O_,42:Mx,60:[I9,SU],91:IU,92:[cU,T_],93:Pw,95:Mx,96:q9},sV={null:[Mx,XU]},oV={null:[42,95]},lV={null:[]},cV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:oV,contentInitial:tV,disable:lV,document:eV,flow:rV,flowInitial:nV,insideSpan:sV,string:iV,text:aV},Symbol.toStringTag,{value:"Module"}));function uV(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let s=[],o=[];const c={attempt:N(S),check:N(j),consume:v,enter:w,exit:k,interrupt:N(j,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function f(O){return s=Rr(s,O),x(),s[s.length-1]!==null?[]:(P(t,0),u.events=Tm(a,u.events,u),u.events)}function h(O,C){return fV(p(O),C)}function p(O){return dV(s,O)}function g(){const{_bufferIndex:O,_index:C,line:M,column:I,offset:B}=r;return{_bufferIndex:O,_index:C,line:M,column:I,offset:B}}function y(O){i[O.line]=O.column,E()}function x(){let O;for(;r._index<s.length;){const C=s[r._index];if(typeof C=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<C.length;)b(C.charCodeAt(r._bufferIndex));else b(C)}}function b(O){d=d(O)}function v(O){De(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,E()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,C){const M=C||{};return M.type=O,M.start=g(),u.events.push(["enter",M,u]),o.push(M),M}function k(O){const C=o.pop();return C.end=g(),u.events.push(["exit",C,u]),C}function S(O,C){P(O,C.from)}function j(O,C){C.restore()}function N(O,C){return M;function M(I,B,se){let Q,D,K,T;return Array.isArray(I)?J(I):"tokenize"in I?J([I]):ie(I);function ie(be){return te;function te(ye){const Z=ye!==null&&be[ye],ne=ye!==null&&be.null,ve=[...Array.isArray(Z)?Z:Z?[Z]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return J(ve)(ye)}}function J(be){return Q=be,D=0,be.length===0?se:_(be[D])}function _(be){return te;function te(ye){return T=A(),K=be,be.partial||(u.currentConstruct=be),be.name&&u.parser.constructs.disable.null.includes(be.name)?ee():be.tokenize.call(C?Object.assign(Object.create(u),C):u,c,H,ee)(ye)}}function H(be){return O(K,T),B}function ee(be){return T.restore(),++D<Q.length?_(Q[D]):se}}}function P(O,C){O.resolveAll&&!a.includes(O)&&a.push(O),O.resolve&&xr(u.events,C,u.events.length-C,O.resolve(u.events.slice(C),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function A(){const O=g(),C=u.previous,M=u.currentConstruct,I=u.events.length,B=Array.from(o);return{from:I,restore:se};function se(){r=O,u.previous=C,u.currentConstruct=M,u.events.length=I,o=B,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function dV(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function fV(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
555
+ `;break}case-3:{s=`\r
556
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function hV(e){const r={constructs:P_([cV,...(e||{}).extensions||[]]),content:i(E9),defined:[],document:i(T9),flow:i(qU),lazy:{},string:i(ZU),text:i(QU)};return r;function i(a){return s;function s(o){return uV(r,a,o)}}}function pV(e){for(;!__(e););return e}const hN=/[\0\t\n\r]/g;function mV(){let e=1,t="",n=!0,r;return i;function i(a,s,o){const c=[];let u,d,f,h,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(hN.lastIndex=f,u=hN.exec(a),h=u&&u.index!==void 0?u.index:a.length,p=a.charCodeAt(h),!u){t=a.slice(f);break}if(p===10&&f===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),f<h&&(c.push(a.slice(f,h)),e+=h-f),p){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const gV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yV(e){return e.replace(gV,xV)}function xV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return E_(n.slice(a?2:1),a?16:10)}return Cw(n)||e}const F_={}.hasOwnProperty;function vV(e,t,n){return typeof t!="string"&&(n=t,t=void 0),bV(n)(pV(hV(n).document().write(mV()(e,t,!0))))}function bV(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(nt),autolinkProtocol:A,autolinkEmail:A,atxHeading:a(le),blockQuote:a(ne),characterEscape:A,characterReference:A,codeFenced:a(ve),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(ve,s),codeText:a(L,s),codeTextData:A,data:A,codeFlowValue:A,definition:a(W),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(F),hardBreakEscape:a(oe),hardBreakTrailing:a(oe),htmlFlow:a(Re,s),htmlFlowData:A,htmlText:a(Re,s),htmlTextData:A,image:a(We),label:s,link:a(nt),listItem:a(hn),listItemValue:h,listOrdered:a(Nt,f),listUnordered:a(Nt),paragraph:a(Xt),reference:_,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(le),strong:a(xt),thematicBreak:a(it)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:Z,autolinkProtocol:ye,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:be,characterReference:te,codeFenced:c(x),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:E,codeIndented:c(b),codeText:c(B),codeTextData:E,data:E,definition:c(),definitionDestinationString:k,definitionLabelString:v,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(C),hardBreakTrailing:c(C),htmlFlow:c(M),htmlFlowData:E,htmlText:c(I),htmlTextData:E,image:c(Q),label:K,labelText:D,lineEnding:O,link:c(se),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:H,resourceDestinationString:T,resourceTitleString:ie,resource:J,setextHeading:c(P),setextHeadingLineSequence:N,setextHeadingText:j,strong:c(),thematicBreak:c()}};z_(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(X){let de={type:"root",children:[]};const Ee={stack:[de],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:d,data:n},fe=[];let R=-1;for(;++R<X.length;)if(X[R][1].type==="listOrdered"||X[R][1].type==="listUnordered")if(X[R][0]==="enter")fe.push(R);else{const me=fe.pop();R=i(X,me,R)}for(R=-1;++R<X.length;){const me=t[X[R][0]];F_.call(me,X[R][1].type)&&me[X[R][1].type].call(Object.assign({sliceSerialize:X[R][2].sliceSerialize},Ee),X[R][1])}if(Ee.tokenStack.length>0){const me=Ee.tokenStack[Ee.tokenStack.length-1];(me[1]||pN).call(Ee,void 0,me[0])}for(de.position={start:Oa(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:Oa(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},R=-1;++R<t.transforms.length;)de=t.transforms[R](de)||de;return de}function i(X,de,Ee){let fe=de-1,R=-1,me=!1,Ae,ze,ht,Je;for(;++fe<=Ee;){const pt=X[fe];switch(pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pt[0]==="enter"?R++:R--,Je=void 0;break}case"lineEndingBlank":{pt[0]==="enter"&&(Ae&&!Je&&!R&&!ht&&(ht=fe),Je=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Je=void 0}if(!R&&pt[0]==="enter"&&pt[1].type==="listItemPrefix"||R===-1&&pt[0]==="exit"&&(pt[1].type==="listUnordered"||pt[1].type==="listOrdered")){if(Ae){let Wt=fe;for(ze=void 0;Wt--;){const Ct=X[Wt];if(Ct[1].type==="lineEnding"||Ct[1].type==="lineEndingBlank"){if(Ct[0]==="exit")continue;ze&&(X[ze][1].type="lineEndingBlank",me=!0),Ct[1].type="lineEnding",ze=Wt}else if(!(Ct[1].type==="linePrefix"||Ct[1].type==="blockQuotePrefix"||Ct[1].type==="blockQuotePrefixWhitespace"||Ct[1].type==="blockQuoteMarker"||Ct[1].type==="listItemIndent"))break}ht&&(!ze||ht<ze)&&(Ae._spread=!0),Ae.end=Object.assign({},ze?X[ze][1].start:pt[1].end),X.splice(ze||fe,0,["exit",Ae,pt[2]]),fe++,Ee++}if(pt[1].type==="listItemPrefix"){const Wt={type:"listItem",_spread:!1,start:Object.assign({},pt[1].start),end:void 0};Ae=Wt,X.splice(fe,0,["enter",Wt,pt[2]]),fe++,Ee++,ht=void 0,Je=!0}}}return X[de][1]._spread=me,Ee}function a(X,de){return Ee;function Ee(fe){o.call(this,X(fe),fe),de&&de.call(this,fe)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(X,de,Ee){this.stack[this.stack.length-1].children.push(X),this.stack.push(X),this.tokenStack.push([de,Ee||void 0]),X.position={start:Oa(de.start),end:void 0}}function c(X){return de;function de(Ee){X&&X.call(this,Ee),u.call(this,Ee)}}function u(X,de){const Ee=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==X.type&&(de?de.call(this,X,fe[0]):(fe[1]||pN).call(this,X,fe[0]));else throw new Error("Cannot close `"+X.type+"` ("+fu({start:X.start,end:X.end})+"): it’s not open");Ee.position.end=Oa(X.end)}function d(){return Nw(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(X){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(X),10),this.data.expectingFirstListItemValue=void 0}}function p(){const X=this.resume(),de=this.stack[this.stack.length-1];de.lang=X}function g(){const X=this.resume(),de=this.stack[this.stack.length-1];de.meta=X}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const X=this.resume(),de=this.stack[this.stack.length-1];de.value=X.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const X=this.resume(),de=this.stack[this.stack.length-1];de.value=X.replace(/(\r?\n|\r)$/g,"")}function v(X){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=de,Ee.identifier=oi(this.sliceSerialize(X)).toLowerCase()}function w(){const X=this.resume(),de=this.stack[this.stack.length-1];de.title=X}function k(){const X=this.resume(),de=this.stack[this.stack.length-1];de.url=X}function S(X){const de=this.stack[this.stack.length-1];if(!de.depth){const Ee=this.sliceSerialize(X).length;de.depth=Ee}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function N(X){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(X).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function A(X){const Ee=this.stack[this.stack.length-1].children;let fe=Ee[Ee.length-1];(!fe||fe.type!=="text")&&(fe=rt(),fe.position={start:Oa(X.start),end:void 0},Ee.push(fe)),this.stack.push(fe)}function E(X){const de=this.stack.pop();de.value+=this.sliceSerialize(X),de.position.end=Oa(X.end)}function O(X){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=de.children[de.children.length-1];Ee.position.end=Oa(X.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(A.call(this,X),E.call(this,X))}function C(){this.data.atHardBreak=!0}function M(){const X=this.resume(),de=this.stack[this.stack.length-1];de.value=X}function I(){const X=this.resume(),de=this.stack[this.stack.length-1];de.value=X}function B(){const X=this.resume(),de=this.stack[this.stack.length-1];de.value=X}function se(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=de,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function Q(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=de,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function D(X){const de=this.sliceSerialize(X),Ee=this.stack[this.stack.length-2];Ee.label=yV(de),Ee.identifier=oi(de).toLowerCase()}function K(){const X=this.stack[this.stack.length-1],de=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const fe=X.children;Ee.children=fe}else Ee.alt=de}function T(){const X=this.resume(),de=this.stack[this.stack.length-1];de.url=X}function ie(){const X=this.resume(),de=this.stack[this.stack.length-1];de.title=X}function J(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function H(X){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=de,Ee.identifier=oi(this.sliceSerialize(X)).toLowerCase(),this.data.referenceType="full"}function ee(X){this.data.characterReferenceType=X.type}function be(X){const de=this.sliceSerialize(X),Ee=this.data.characterReferenceType;let fe;Ee?(fe=E_(de,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=Cw(de);const R=this.stack[this.stack.length-1];R.value+=fe}function te(X){const de=this.stack.pop();de.position.end=Oa(X.end)}function ye(X){E.call(this,X);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(X)}function Z(X){E.call(this,X);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(X)}function ne(){return{type:"blockquote",children:[]}}function ve(){return{type:"code",lang:null,meta:null,value:""}}function L(){return{type:"inlineCode",value:""}}function W(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function F(){return{type:"emphasis",children:[]}}function le(){return{type:"heading",depth:0,children:[]}}function oe(){return{type:"break"}}function Re(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function nt(){return{type:"link",title:null,url:"",children:[]}}function Nt(X){return{type:"list",ordered:X.type==="listOrdered",start:null,spread:X._spread,children:[]}}function hn(X){return{type:"listItem",spread:X._spread,checked:null,children:[]}}function Xt(){return{type:"paragraph",children:[]}}function xt(){return{type:"strong",children:[]}}function rt(){return{type:"text",value:""}}function it(){return{type:"thematicBreak"}}}function Oa(e){return{line:e.line,column:e.column,offset:e.offset}}function z_(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?z_(e,r):wV(e,r)}}function wV(e,t){let n;for(n in t)if(F_.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function pN(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+fu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+fu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+fu({start:t.start,end:t.end})+") is still open")}function SV(e){const t=this;t.parser=n;function n(r){return vV(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function kV(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function jV(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
557
+ `}]}function NV(e,t){const n=t.value?t.value+`
558
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function CV(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PV(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EV(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=tc(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let s,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=a+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function AV(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TV(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function $_(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function OV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $_(e,t);const i={src:tc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function _V(e,t){const n={src:tc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function MV(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function DV(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $_(e,t);const i={href:tc(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function IV(e,t){const n={href:tc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function LV(e,t,n){const r=e.all(t),i=n?RV(n):B_(t),a={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
559
+ `}),d.type==="element"&&d.tagName==="p"&&!i?s.push(...d.children):s.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
560
+ `});const u={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,u),e.applyData(t,u)}function RV(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=B_(n[r])}return t}function B_(e){const t=e.spread;return t??e.children.length>1}function FV(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function zV(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $V(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function BV(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UV(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=ww(t.children[1]),c=b_(t.children[t.children.length-1]);o&&c&&(s.position={start:o,end:c}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function VV(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,o=s?s.length:t.children.length;let c=-1;const u=[];for(;++c<o;){const f=t.children[c],h={},p=s?s[c]:void 0;p&&(h.align=p);let g={type:"element",tagName:a,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),u.push(g)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function WV(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const mN=9,gN=32;function HV(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(yN(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(yN(t.slice(i),i>0,!1)),a.join("")}function yN(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===mN||a===gN;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===mN||a===gN;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function KV(e,t){const n={type:"text",value:HV(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function GV(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const qV={blockquote:kV,break:jV,code:NV,delete:CV,emphasis:PV,footnoteReference:EV,heading:AV,html:TV,imageReference:OV,image:_V,inlineCode:MV,linkReference:DV,link:IV,listItem:LV,list:FV,paragraph:zV,root:$V,strong:BV,table:UV,tableCell:WV,tableRow:VV,text:KV,thematicBreak:GV,toml:bf,yaml:bf,definition:bf,footnoteDefinition:bf};function bf(){}const U_=-1,Om=0,pu=1,ep=2,Ew=3,Aw=4,Tw=5,Ow=6,V_=7,W_=8,xN=typeof self=="object"?self:globalThis,YV=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case Om:case U_:return n(s,i);case pu:{const o=n([],i);for(const c of s)o.push(r(c));return o}case ep:{const o=n({},i);for(const[c,u]of s)o[r(c)]=r(u);return o}case Ew:return n(new Date(s),i);case Aw:{const{source:o,flags:c}=s;return n(new RegExp(o,c),i)}case Tw:{const o=n(new Map,i);for(const[c,u]of s)o.set(r(c),r(u));return o}case Ow:{const o=n(new Set,i);for(const c of s)o.add(r(c));return o}case V_:{const{name:o,message:c}=s;return n(new xN[o](c),i)}case W_:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return n(new DataView(o),s)}}return n(new xN[a](s),i)};return r},vN=e=>YV(new Map,e)(0),Ro="",{toString:XV}={},{keys:ZV}=Object,Tc=e=>{const t=typeof e;if(t!=="object"||!e)return[Om,t];const n=XV.call(e).slice(8,-1);switch(n){case"Array":return[pu,Ro];case"Object":return[ep,Ro];case"Date":return[Ew,Ro];case"RegExp":return[Aw,Ro];case"Map":return[Tw,Ro];case"Set":return[Ow,Ro];case"DataView":return[pu,n]}return n.includes("Array")?[pu,n]:n.includes("Error")?[V_,n]:[ep,n]},wf=([e,t])=>e===Om&&(t==="function"||t==="symbol"),QV=(e,t,n,r)=>{const i=(s,o)=>{const c=r.push(s)-1;return n.set(o,c),c},a=s=>{if(n.has(s))return n.get(s);let[o,c]=Tc(s);switch(o){case Om:{let d=s;switch(c){case"bigint":o=W_,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([U_],s)}return i([o,d],s)}case pu:{if(c){let h=s;return c==="DataView"?h=new Uint8Array(s.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(s)),i([c,[...h]],s)}const d=[],f=i([o,d],s);for(const h of s)d.push(a(h));return f}case ep:{if(c)switch(c){case"BigInt":return i([c,s.toString()],s);case"Boolean":case"Number":case"String":return i([c,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const d=[],f=i([o,d],s);for(const h of ZV(s))(e||!wf(Tc(s[h])))&&d.push([a(h),a(s[h])]);return f}case Ew:return i([o,s.toISOString()],s);case Aw:{const{source:d,flags:f}=s;return i([o,{source:d,flags:f}],s)}case Tw:{const d=[],f=i([o,d],s);for(const[h,p]of s)(e||!(wf(Tc(h))||wf(Tc(p))))&&d.push([a(h),a(p)]);return f}case Ow:{const d=[],f=i([o,d],s);for(const h of s)(e||!wf(Tc(h)))&&d.push(a(h));return f}}const{message:u}=s;return i([o,{name:c,message:u}],s)};return a},bN=(e,{json:t,lossy:n}={})=>{const r=[];return QV(!(t||n),!!t,new Map,r)(e),r},tp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?vN(bN(e,t)):structuredClone(e):(e,t)=>vN(bN(e,t));function JV(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function eW(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function tW(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||JV,r=e.options.footnoteBackLabel||eW,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),f=String(u.identifier).toUpperCase(),h=tc(f.toLowerCase());let p=0;const g=[],y=e.footnoteCounts.get(f);for(;y!==void 0&&++p<=y;){g.length>0&&g.push({type:"text",value:" "});let v=typeof n=="string"?n:n(c,p);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const v=x.children[x.children.length-1];v&&v.type==="text"?v.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else d.push(...g);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...tp(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
561
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
562
+ `}]}}const _m=function(e){if(e==null)return aW;if(typeof e=="function")return Mm(e);if(typeof e=="object")return Array.isArray(e)?nW(e):rW(e);if(typeof e=="string")return iW(e);throw new Error("Expected function, string, or object as test")};function nW(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=_m(e[n]);return Mm(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function rW(e){const t=e;return Mm(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function iW(e){return Mm(t);function t(n){return n&&n.type===e}}function Mm(e){return t;function t(n,r,i){return!!(sW(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function aW(){return!0}function sW(e){return e!==null&&typeof e=="object"&&"type"in e}const H_=[],oW=!0,Dx=!1,lW="skip";function K_(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=_m(i),s=r?-1:1;o(e,void 0,[])();function o(c,u,d){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=H_,g,y,x;if((!t||a(c,u,d[d.length-1]||void 0))&&(p=cW(n(c,d)),p[0]===Dx))return p;if("children"in c&&c.children){const b=c;if(b.children&&p[0]!==lW)for(y=(r?b.children.length:-1)+s,x=d.concat(b);y>-1&&y<b.children.length;){const v=b.children[y];if(g=o(v,y,x)(),g[0]===Dx)return g;y=typeof g[1]=="number"?g[1]:y+s}}return p}}}function cW(e){return Array.isArray(e)?e:typeof e=="number"?[oW,e]:e==null?H_:[e]}function _w(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),K_(e,a,o,i);function o(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return s(c,f,d)}}const Ix={}.hasOwnProperty,uW={};function dW(e,t){const n=t||uW,r=new Map,i=new Map,a=new Map,s={...qV,...n.handlers},o={all:u,applyData:hW,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:c,options:n,patch:fW,wrap:mW};return _w(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),o;function c(d,f){const h=d.type,p=o.handlers[h];if(Ix.call(o.handlers,h)&&p)return p(o,d,f);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in d){const{children:y,...x}=d,b=tp(x);return b.children=o.all(d),b}return tp(d)}return(o.options.unknownHandler||pW)(o,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const g=o.one(h[p],d);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=wN(g.value)),!Array.isArray(g)&&g.type==="element")){const y=g.children[0];y&&y.type==="text"&&(y.value=wN(y.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function fW(e,t){e.position&&(t.position=e9(e))}function hW(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,tp(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function pW(e,t){const n=t.data||{},r="value"in t&&!(Ix.call(n,"hProperties")||Ix.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mW(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
563
+ `});++r<e.length;)r&&n.push({type:"text",value:`
564
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
565
+ `}),n}function wN(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function SN(e,t){const n=dW(e,t),r=n.one(e,void 0),i=tW(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
566
+ `},i),a}function gW(e,t){return e&&"run"in e?async function(n,r){const i=SN(n,{file:r,...t});await e.run(i,r)}:function(n,r){return SN(n,{file:r,...e||t})}}function kN(e){if(e)throw e}var hh=Object.prototype.hasOwnProperty,G_=Object.prototype.toString,jN=Object.defineProperty,NN=Object.getOwnPropertyDescriptor,CN=function(t){return typeof Array.isArray=="function"?Array.isArray(t):G_.call(t)==="[object Array]"},PN=function(t){if(!t||G_.call(t)!=="[object Object]")return!1;var n=hh.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&hh.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||hh.call(t,i)},EN=function(t,n){jN&&n.name==="__proto__"?jN(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},AN=function(t,n){if(n==="__proto__")if(hh.call(t,n)){if(NN)return NN(t,n).value}else return;return t[n]},yW=function e(){var t,n,r,i,a,s,o=arguments[0],c=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},c=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=AN(o,n),i=AN(t,n),o!==i&&(d&&i&&(PN(i)||(a=CN(i)))?(a?(a=!1,s=r&&CN(r)?r:[]):s=r&&PN(r)?r:{},EN(o,{name:n,newValue:e(d,s,i)})):typeof i<"u"&&EN(o,{name:n,newValue:i}));return o};const b0=hi(yW);function Lx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function xW(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...i);function o(c,...u){const d=e[++a];let f=-1;if(c){s(c);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,d?vW(d,o)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function vW(e,t){let n;return r;function r(...s){const o=e.length>s.length;let c;o&&s.push(i);try{c=e.apply(this,s)}catch(u){const d=u;if(o&&n)throw d;return i(d)}o||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(s,...o){n||(n=!0,t(s,...o))}function a(s){i(null,s)}}const wi={basename:bW,dirname:wW,extname:SW,join:kW,sep:"/"};function bW(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Cd(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function wW(e){if(Cd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function SW(e){Cd(e);let t=e.length,n=-1,r=0,i=-1,a=0,s;for(;t--;){const o=e.codePointAt(t);if(o===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),o===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function kW(...e){let t=-1,n;for(;++t<e.length;)Cd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":jW(n)}function jW(e){Cd(e);const t=e.codePointAt(0)===47;let n=NW(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function NW(e,t){let n="",r=0,i=-1,a=0,s=-1,o,c;for(;++s<=e.length;){if(s<e.length)o=e.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return n}function Cd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const CW={cwd:PW};function PW(){return"/"}function Rx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function EW(e){if(typeof e=="string")e=new URL(e);else if(!Rx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return AW(e)}function AW(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const w0=["history","path","basename","stem","extname","dirname"];class q_{constructor(t){let n;t?Rx(t)?n={path:t}:typeof t=="string"||TW(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":CW.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<w0.length;){const a=w0[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)w0.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?wi.basename(this.path):void 0}set basename(t){k0(t,"basename"),S0(t,"basename"),this.path=wi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?wi.dirname(this.path):void 0}set dirname(t){TN(this.basename,"dirname"),this.path=wi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?wi.extname(this.path):void 0}set extname(t){if(S0(t,"extname"),TN(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=wi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Rx(t)&&(t=EW(t)),k0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?wi.basename(this.path,this.extname):void 0}set stem(t){k0(t,"stem"),S0(t,"stem"),this.path=wi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Ln(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function S0(e,t){if(e&&e.includes(wi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wi.sep+"`")}function k0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function TN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function TW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const OW=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},_W={}.hasOwnProperty;class Mw extends OW{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=xW()}copy(){const t=new Mw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(b0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(C0("data",this.frozen),this.namespace[t]=n,this):_W.call(this.namespace,t)&&this.namespace[t]||void 0:t?(C0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Sf(t),r=this.parser||this.Parser;return j0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),j0("process",this.parser||this.Parser),N0("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const o=Sf(t),c=r.parse(o);r.run(c,o,function(d,f,h){if(d||!f||!h)return u(d);const p=f,g=r.stringify(p,h);IW(g)?h.value=g:h.result=g,u(d,h)});function u(d,f){d||!f?s(d):a?a(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),j0("processSync",this.parser||this.Parser),N0("processSync",this.compiler||this.Compiler),this.process(t,i),_N("processSync","process",n),r;function i(a,s){n=!0,kN(a),r=s}}run(t,n,r){ON(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,o){const c=Sf(n);i.run(t,c,u);function u(d,f,h){const p=f||t;d?o(d):s?s(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),_N("runSync","run",r),i;function a(s,o){kN(s),i=o,r=!0}}stringify(t,n){this.freeze();const r=Sf(n),i=this.compiler||this.Compiler;return N0("stringify",i),ON(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(C0("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;c(d,f)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=b0(!0,i.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];a(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...d]);else if(d.length>0){let[p,...g]=d;const y=r[h][1];Lx(y)&&Lx(p)&&(p=b0(!0,y,p)),r[h]=[u,p,...g]}}}}const MW=new Mw().freeze();function j0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function N0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function C0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ON(e){if(!Lx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function _N(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Sf(e){return DW(e)?e:new q_(e)}function DW(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function IW(e){return typeof e=="string"||LW(e)}function LW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const RW="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",MN=[],DN={allowDangerousHtml:!0},FW=/^(https?|ircs?|mailto|xmpp)$/i,zW=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function $W(e){const t=BW(e),n=UW(e);return VW(t.runSync(t.parse(n),n),e)}function BW(e){const t=e.rehypePlugins||MN,n=e.remarkPlugins||MN,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...DN}:DN;return MW().use(SV).use(n).use(gW,r).use(t)}function UW(e){const t=e.children||"",n=new q_;return typeof t=="string"&&(n.value=t),n}function VW(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||WW;for(const d of zW)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+RW+d.id,void 0);return _w(e,u),a9(e,{Fragment:l.Fragment,components:i,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return s?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in y0)if(Object.hasOwn(y0,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],y=y0[p];(y===null||y.includes(d.tagName))&&(d.properties[p]=c(String(g||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(d,f,h)),p&&h&&typeof f=="number")return o&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function WW(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||FW.test(e.slice(0,t))?e:""}function IN(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function HW(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function KW(e,t,n){const i=_m((n||{}).ignore||[]),a=GW(t);let s=-1;for(;++s<a.length;)K_(e,"text",o);function o(u,d){let f=-1,h;for(;++f<d.length;){const p=d[f],g=h?h.children:void 0;if(i(p,g?g.indexOf(p):void 0,h))return;h=p}if(h)return c(u,d)}function c(u,d){const f=d[d.length-1],h=a[s][0],p=a[s][1];let g=0;const x=f.children.indexOf(u);let b=!1,v=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const k=w.index,S={index:w.index,input:w.input,stack:[...d,u]};let j=p(...w,S);if(typeof j=="string"&&(j=j.length>0?{type:"text",value:j}:void 0),j===!1?h.lastIndex=k+1:(g!==k&&v.push({type:"text",value:u.value.slice(g,k)}),Array.isArray(j)?v.push(...j):j&&v.push(j),g=k+w[0].length,b=!0),!h.global)break;w=h.exec(u.value)}return b?(g<u.value.length&&v.push({type:"text",value:u.value.slice(g)}),f.children.splice(x,1,...v)):v=[u],x+v.length}}function GW(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([qW(i[0]),YW(i[1])])}return t}function qW(e){return typeof e=="string"?new RegExp(HW(e),"g"):e}function YW(e){return typeof e=="function"?e:function(){return e}}const P0="phrasing",E0=["autolink","link","image","label"];function XW(){return{transforms:[rH],enter:{literalAutolink:QW,literalAutolinkEmail:A0,literalAutolinkHttp:A0,literalAutolinkWww:A0},exit:{literalAutolink:nH,literalAutolinkEmail:tH,literalAutolinkHttp:JW,literalAutolinkWww:eH}}}function ZW(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:P0,notInConstruct:E0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:P0,notInConstruct:E0},{character:":",before:"[ps]",after:"\\/",inConstruct:P0,notInConstruct:E0}]}}function QW(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function A0(e){this.config.enter.autolinkProtocol.call(this,e)}function JW(e){this.config.exit.autolinkProtocol.call(this,e)}function eH(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function tH(e){this.config.exit.autolinkEmail.call(this,e)}function nH(e){this.exit(e)}function rH(e){KW(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,iH],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),aH]],{ignore:["link","linkReference"]})}function iH(e,t,n,r,i){let a="";if(!Y_(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!sH(n)))return!1;const s=oH(n+r);if(!s[0])return!1;const o={type:"link",title:null,url:a+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function aH(e,t,n,r){return!Y_(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function sH(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function oH(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=IN(e,"(");let a=IN(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function Y_(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||go(n)||Am(n))&&(!t||n!==47)}X_.peek=gH;function lH(){this.buffer()}function cH(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function uH(){this.buffer()}function dH(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function fH(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=oi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hH(e){this.exit(e)}function pH(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=oi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function mH(e){this.exit(e)}function gH(){return"["}function X_(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteReference"),o=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),o(),s(),a+=i.move("]"),a}function yH(){return{enter:{gfmFootnoteCallString:lH,gfmFootnoteCall:cH,gfmFootnoteDefinitionLabelString:uH,gfmFootnoteDefinition:dH},exit:{gfmFootnoteCallString:fH,gfmFootnoteCall:hH,gfmFootnoteDefinitionLabelString:pH,gfmFootnoteDefinition:mH}}}function xH(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:X_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,s){const o=a.createTracker(s);let c=o.move("[^");const u=a.enter("footnoteDefinition"),d=a.enter("label");return c+=o.move(a.safe(a.associationId(r),{before:c,after:"]"})),d(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?`
567
+ `:" ")+a.indentLines(a.containerFlow(r,o.current()),t?Z_:vH))),u(),c}}function vH(e,t,n){return t===0?e:Z_(e,t,n)}function Z_(e,t,n){return(n?"":" ")+e}const bH=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Q_.peek=NH;function wH(){return{canContainEols:["delete"],enter:{strikethrough:kH},exit:{strikethrough:jH}}}function SH(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:bH}],handlers:{delete:Q_}}}function kH(e){this.enter({type:"delete",children:[]},e)}function jH(e){this.exit(e)}function Q_(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function NH(){return"~"}function CH(e){return e.length}function PH(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||CH,a=[],s=[],o=[],c=[];let u=0,d=-1;for(;++d<e.length;){const y=[],x=[];let b=-1;for(e[d].length>u&&(u=e[d].length);++b<e[d].length;){const v=EH(e[d][b]);if(n.alignDelimiters!==!1){const w=i(v);x[b]=w,(c[b]===void 0||w>c[b])&&(c[b]=w)}y.push(v)}s[d]=y,o[d]=x}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)a[f]=LN(r[f]);else{const y=LN(r);for(;++f<u;)a[f]=y}f=-1;const h=[],p=[];for(;++f<u;){const y=a[f];let x="",b="";y===99?(x=":",b=":"):y===108?x=":":y===114&&(b=":");let v=n.alignDelimiters===!1?1:Math.max(1,c[f]-x.length-b.length);const w=x+"-".repeat(v)+b;n.alignDelimiters!==!1&&(v=x.length+v+b.length,v>c[f]&&(c[f]=v),p[f]=v),h[f]=w}s.splice(1,0,h),o.splice(1,0,p),d=-1;const g=[];for(;++d<s.length;){const y=s[d],x=o[d];f=-1;const b=[];for(;++f<u;){const v=y[f]||"";let w="",k="";if(n.alignDelimiters!==!1){const S=c[f]-(x[f]||0),j=a[f];j===114?w=" ".repeat(S):j===99?S%2?(w=" ".repeat(S/2+.5),k=" ".repeat(S/2-.5)):(w=" ".repeat(S/2),k=w):k=" ".repeat(S)}n.delimiterStart!==!1&&!f&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||f)&&b.push(" "),n.alignDelimiters!==!1&&b.push(w),b.push(v),n.alignDelimiters!==!1&&b.push(k),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&b.push("|")}g.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return g.join(`
568
+ `)}function EH(e){return e==null?"":String(e)}function LN(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function AH(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const s=n.indentLines(n.containerFlow(e,a.current()),TH);return i(),s}function TH(e,t,n){return">"+(n?"":" ")+e}function OH(e,t){return RN(e,t.inConstruct,!0)&&!RN(e,t.notInConstruct,!1)}function RN(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function FN(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
569
+ `&&OH(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
570
+ `}function _H(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>s&&(s=a):a=1,i=r+t.length,r=n.indexOf(t,i);return s}function MH(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function DH(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function IH(e,t,n,r){const i=DH(n),a=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(MH(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(a,LH);return f(),h}const o=n.createTracker(r),c=i.repeat(Math.max(_H(a,i)+1,3)),u=n.enter("codeFenced");let d=o.move(c);if(e.lang){const f=n.enter(`codeFencedLang${s}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${s}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:`
571
+ `,encode:["`"],...o.current()})),f()}return d+=o.move(`
572
+ `),a&&(d+=o.move(a+`
573
+ `)),d+=o.move(c),u(),d}function LH(e,t,n){return(n?"":" ")+e}function Dw(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function RH(e,t,n,r){const i=Dw(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
574
+ `,...c.current()}))),o(),e.title&&(o=n.enter(`title${a}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),o()),s(),u}function FH(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ku(e){return"&#x"+e.toString(16).toUpperCase()+";"}function np(e,t,n){const r=Rl(e),i=Rl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}J_.peek=zH;function J_(e,t,n,r){const i=FH(n),a=n.enter("emphasis"),s=n.createTracker(r),o=s.move(i);let c=s.move(n.containerPhrasing(e,{after:i,before:o,...s.current()}));const u=c.charCodeAt(0),d=np(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=Ku(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=np(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+Ku(f));const p=s.move(i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+p}function zH(e,t,n){return n.options.emphasis||"*"}function $H(e,t){let n=!1;return _w(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Dx}),!!((!e.depth||e.depth<3)&&Nw(e)&&(t.options.setext||n))}function BH(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if($H(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...a.current(),before:`
575
+ `,after:`
576
+ `});return f(),d(),h+`
577
+ `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
578
+ `))+1))}const s="#".repeat(i),o=n.enter("headingAtx"),c=n.enter("phrasing");a.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
579
+ `,...a.current()});return/^[\t ]/.test(u)&&(u=Ku(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),c(),o(),u}eM.peek=UH;function eM(e){return e.value||""}function UH(){return"<"}tM.peek=VH;function tM(e,t,n,r){const i=Dw(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${a}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),o()),u+=c.move(")"),s(),u}function VH(){return"!"}nM.peek=WH;function nM(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let s=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const u=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return s(),n.stack=d,a(),i==="full"||!u||u!==f?c+=o.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function WH(){return"!"}rM.peek=HH;function rM(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const s=n.unsafe[a],o=n.compilePattern(s);let c;if(s.atBreak)for(;c=o.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return i+r+i}function HH(){return"`"}function iM(e,t){const n=Nw(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}aM.peek=KH;function aM(e,t,n,r){const i=Dw(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let o,c;if(iM(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),o(),n.stack=d,f}o=n.enter("link"),c=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(c=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),c(),e.title&&(c=n.enter(`title${a}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),c()),u+=s.move(")"),o(),u}function KH(e,t,n){return iM(e,n)?"<":"["}sM.peek=GH;function sM(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let s=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return s(),n.stack=d,a(),i==="full"||!u||u!==f?c+=o.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function GH(){return"["}function Iw(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function qH(e){const t=Iw(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function YH(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function oM(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function XH(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let s=e.ordered?YH(n):Iw(n);const o=e.ordered?s==="."?")":".":qH(n);let c=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),oM(n)===s&&d){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(s=o),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=a,i(),u}function ZH(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function QH(e,t,n,r){const i=ZH(n);let a=n.bulletCurrent||Iw(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const o=n.createTracker(r);o.move(a+" ".repeat(s-a.length)),o.shift(s);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return c(),u;function d(f,h,p){return h?(p?"":" ".repeat(s))+f:(p?a:a+" ".repeat(s-a.length))+f}}function JH(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(e,r);return a(),i(),s}const eK=_m(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function tK(e,t,n,r){return(e.children.some(function(s){return eK(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function nK(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}lM.peek=rK;function lM(e,t,n,r){const i=nK(n),a=n.enter("strong"),s=n.createTracker(r),o=s.move(i+i);let c=s.move(n.containerPhrasing(e,{after:i,before:o,...s.current()}));const u=c.charCodeAt(0),d=np(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=Ku(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=np(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+Ku(f));const p=s.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+p}function rK(e,t,n){return n.options.strong||"*"}function iK(e,t,n,r){return n.safe(e.value,r)}function aK(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function sK(e,t,n){const r=(oM(n)+(n.options.ruleSpaces?" ":"")).repeat(aK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const cM={blockquote:AH,break:FN,code:IH,definition:RH,emphasis:J_,hardBreak:FN,heading:BH,html:eM,image:tM,imageReference:nM,inlineCode:rM,link:aM,linkReference:sM,list:XH,listItem:QH,paragraph:JH,root:tK,strong:lM,text:iK,thematicBreak:sK};function oK(){return{enter:{table:lK,tableData:zN,tableHeader:zN,tableRow:uK},exit:{codeText:dK,table:cK,tableData:T0,tableHeader:T0,tableRow:T0}}}function lK(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function cK(e){this.exit(e),this.data.inTable=void 0}function uK(e){this.enter({type:"tableRow",children:[]},e)}function T0(e){this.exit(e)}function zN(e){this.enter({type:"tableCell",children:[]},e)}function dK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,fK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function fK(e,t){return t==="|"?t:e}function hK(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
580
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:c,tableRow:o}};function s(p,g,y,x){return u(d(p,y,x),p.align)}function o(p,g,y,x){const b=f(p,y,x),v=u([b]);return v.slice(0,v.indexOf(`
581
+ `))}function c(p,g,y,x){const b=y.enter("tableCell"),v=y.enter("phrasing"),w=y.containerPhrasing(p,{...x,before:a,after:a});return v(),b(),w}function u(p,g){return PH(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(p,g,y){const x=p.children;let b=-1;const v=[],w=g.enter("table");for(;++b<x.length;)v[b]=f(x[b],g,y);return w(),v}function f(p,g,y){const x=p.children;let b=-1;const v=[],w=g.enter("tableRow");for(;++b<x.length;)v[b]=c(x[b],p,g,y);return w(),v}function h(p,g,y){let x=cM.inlineCode(p,g,y);return y.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function pK(){return{exit:{taskListCheckValueChecked:$N,taskListCheckValueUnchecked:$N,paragraph:gK}}}function mK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:yK}}}function $N(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function gK(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,s;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){s=o;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function yK(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let c=cM.listItem(e,t,n,{...r,...o.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+s}}function xK(){return[XW(),yH(),wH(),oK(),pK()]}function vK(e){return{extensions:[ZW(),xH(e),SH(),hK(e),mK()]}}const bK={tokenize:CK,partial:!0},uM={tokenize:PK,partial:!0},dM={tokenize:EK,partial:!0},fM={tokenize:AK,partial:!0},wK={tokenize:TK,partial:!0},hM={name:"wwwAutolink",tokenize:jK,previous:mM},pM={name:"protocolAutolink",tokenize:NK,previous:gM},va={name:"emailAutolink",tokenize:kK,previous:yM},Bi={};function SK(){return{text:Bi}}let Ps=48;for(;Ps<123;)Bi[Ps]=va,Ps++,Ps===58?Ps=65:Ps===91&&(Ps=97);Bi[43]=va;Bi[45]=va;Bi[46]=va;Bi[95]=va;Bi[72]=[va,pM];Bi[104]=[va,pM];Bi[87]=[va,hM];Bi[119]=[va,hM];function kK(e,t,n){const r=this;let i,a;return s;function s(f){return!Fx(f)||!yM.call(r,r.previous)||Lw(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Fx(f)?(e.consume(f),o):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(wK,d,u)(f):f===45||f===95||On(f)?(a=!0,e.consume(f),c):d(f)}function u(f){return e.consume(f),i=!0,c}function d(f){return a&&i&&zn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function jK(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!mM.call(r,r.previous)||Lw(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(bK,e.attempt(uM,e.attempt(dM,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function NK(e,t,n){const r=this;let i="",a=!1;return s;function s(f){return(f===72||f===104)&&gM.call(r,r.previous)&&!Lw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(zn(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),a?u:(a=!0,c)):n(f)}function u(f){return f===null||Jh(f)||ft(f)||go(f)||Am(f)?n(f):e.attempt(uM,e.attempt(dM,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function CK(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),a):n(s)}function a(s){return s===null?n(s):t(s)}}function PK(e,t,n){let r,i,a;return s;function s(u){return u===46||u===95?e.check(fM,c,o)(u):u===null||ft(u)||go(u)||u!==45&&Am(u)?c(u):(a=!0,e.consume(u),s)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function c(u){return i||r||!a?n(u):t(u)}}function EK(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(fM,t,a)(s):s===null||ft(s)||go(s)?t(s):(e.consume(s),i)}function a(s){return s===41&&r++,e.consume(s),i}}function AK(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||ft(o)||go(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||ft(o)||go(o)?t(o):r(o)}function a(o){return zn(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):zn(o)?(e.consume(o),s):n(o)}}function TK(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return On(a)?n(a):t(a)}}function mM(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ft(e)}function gM(e){return!zn(e)}function yM(e){return!(e===47||Fx(e))}function Fx(e){return e===43||e===45||e===46||e===95||On(e)}function Lw(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const OK={tokenize:zK,partial:!0};function _K(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:LK,continuation:{tokenize:RK},exit:FK}},text:{91:{name:"gfmFootnoteCall",tokenize:IK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:MK,resolveTo:DK}}}}function MK(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){s=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!s||!s._balanced)return n(c);const u=oi(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function DK(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function IK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(a>999||f===93&&!s||f===null||f===91||ft(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(oi(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ft(f)||(s=!0),a++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),a++,u):u(f)}}function LK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,o;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(s>999||g===93&&!o||g===null||g===91||ft(g))return n(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return a=oi(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ft(g)||(o=!0),s++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),s++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(a)||i.push(a),Xe(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function RK(e,t,n){return e.check(Nd,t,e.attempt(OK,t,n))}function FK(e){e.exit("gfmFootnoteDefinition")}function zK(e,t,n){const r=this;return Xe(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):n(a)}}function $K(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,o){let c=-1;for(;++c<s.length;)if(s[c][0]==="enter"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._close){let u=c;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[c][1].end.offset-s[c][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[c][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[c][1].end)},f={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[c][1].start)},h=[["enter",d,o],["enter",s[u][1],o],["exit",s[u][1],o],["enter",f,o]],p=o.parser.constructs.insideSpan.null;p&&xr(h,h.length,0,Tm(p,s.slice(u+1,c),o)),xr(h,h.length,0,[["exit",f,o],["enter",s[c][1],o],["exit",s[c][1],o],["exit",d,o]]),xr(s,u-1,c-u+3,h),c=u+h.length-2;break}}for(c=-1;++c<s.length;)s[c][1].type==="strikethroughSequenceTemporary"&&(s[c][1].type="data");return s}function a(s,o,c){const u=this.previous,d=this.events;let f=0;return h;function h(g){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const y=Rl(u);if(g===126)return f>1?c(g):(s.consume(g),f++,p);if(f<2&&!n)return c(g);const x=s.exit("strikethroughSequenceTemporary"),b=Rl(g);return x._open=!b||b===2&&!!y,x._close=!y||y===2&&!!b,o(g)}}}class BK{constructor(){this.map=[]}add(t,n,r){UK(this,t,n,r)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function UK(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function VK(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function WK(){return{flow:{null:{name:"table",tokenize:HK,resolveAll:KK}}}}function HK(e,t,n){const r=this;let i=0,a=0,s;return o;function o(E){let O=r.events.length-1;for(;O>-1;){const I=r.events[O][1].type;if(I==="lineEnding"||I==="linePrefix")O--;else break}const C=O>-1?r.events[O][1].type:null,M=C==="tableHead"||C==="tableRow"?j:c;return M===j&&r.parser.lazy[r.now().line]?n(E):M(E)}function c(E){return e.enter("tableHead"),e.enter("tableRow"),u(E)}function u(E){return E===124||(s=!0,a+=1),d(E)}function d(E){return E===null?n(E):De(E)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),p):n(E):Ke(E)?Xe(e,d,"whitespace")(E):(a+=1,s&&(s=!1,i+=1),E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),f(E)))}function f(E){return E===null||E===124||ft(E)?(e.exit("data"),d(E)):(e.consume(E),E===92?h:f)}function h(E){return E===92||E===124?(e.consume(E),f):f(E)}function p(E){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(E):(e.enter("tableDelimiterRow"),s=!1,Ke(E)?Xe(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):g(E))}function g(E){return E===45||E===58?x(E):E===124?(s=!0,e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),y):S(E)}function y(E){return Ke(E)?Xe(e,x,"whitespace")(E):x(E)}function x(E){return E===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),b):E===45?(a+=1,b(E)):E===null||De(E)?k(E):S(E)}function b(E){return E===45?(e.enter("tableDelimiterFiller"),v(E)):S(E)}function v(E){return E===45?(e.consume(E),v):E===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(E))}function w(E){return Ke(E)?Xe(e,k,"whitespace")(E):k(E)}function k(E){return E===124?g(E):E===null||De(E)?!s||i!==a?S(E):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(E)):S(E)}function S(E){return n(E)}function j(E){return e.enter("tableRow"),N(E)}function N(E){return E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),N):E===null||De(E)?(e.exit("tableRow"),t(E)):Ke(E)?Xe(e,N,"whitespace")(E):(e.enter("data"),P(E))}function P(E){return E===null||E===124||ft(E)?(e.exit("data"),N(E)):(e.consume(E),E===92?A:P)}function A(E){return E===92||E===124?(e.consume(E),P):P(E)}}function KK(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,c=0,u,d,f;const h=new BK;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(o=!1,c!==0&&(BN(h,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",d,t]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=kf(h,t,a,i,void 0,f),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=kf(h,t,a,i,void 0,f)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(o=!0,c=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=n,a[1]!==0?(s[0]=s[1],f=kf(h,t,a,i,n,f)):s[1]!==0&&(f=kf(h,t,s,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(c!==0&&BN(h,t,c,u,d),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=VK(t.events,n))}return e}function kf(e,t,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},Ko(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Ko(t.events,n[1]);if(a={type:s,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const u=Ko(t.events,n[2]),d=Ko(t.events,n[3]),f={type:o,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,y=n[3]-n[2]-1;e.add(g,y,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(a.end=Object.assign({},Ko(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function BN(e,t,n,r,i){const a=[],s=Ko(t.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function Ko(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const GK={name:"tasklistCheck",tokenize:YK};function qK(){return{text:{91:GK}}}function YK(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return ft(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),s):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),s):n(c)}function s(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return De(c)?t(c):Ke(c)?e.check({tokenize:XK},t,n)(c):n(c)}}function XK(e,t,n){return Xe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ZK(e){return P_([SK(),_K(),$K(e),WK(),qK()])}const QK={};function JK(e){const t=this,n=e||QK,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ZK(n)),a.push(xK()),s.push(vK(n))}function eG(e){return e.split(/(```[\s\S]*?```|`[^`]+`)/g).map((n,r)=>r%2===1?n:n.replace(new RegExp("(?<=\\w)_(?=\\w)","g"),"\\_")).join("")}function Pd({children:e}){return l.jsx($W,{remarkPlugins:[JK],components:{pre({children:t}){return l.jsx("pre",{className:"bg-slate-900 text-slate-100 rounded-lg p-4 overflow-x-auto my-3 text-sm leading-relaxed",children:t})},code({className:t,children:n,...r}){return t?l.jsx("code",{className:`font-mono text-[13px] ${t??""}`,...r,children:n}):l.jsx("code",{className:"bg-gray-100 text-pink-600 px-1.5 py-0.5 rounded text-[13px] font-mono",...r,children:n})},p({children:t}){return l.jsx("p",{className:"mb-2 last:mb-0",children:t})},ul({children:t}){return l.jsx("ul",{className:"list-disc pl-5 mb-2 space-y-1",children:t})},ol({children:t}){return l.jsx("ol",{className:"list-decimal pl-5 mb-2 space-y-1",children:t})},li({children:t}){return l.jsx("li",{className:"leading-relaxed",children:t})},h1({children:t}){return l.jsx("h1",{className:"text-xl font-bold mb-2 mt-3 first:mt-0",children:t})},h2({children:t}){return l.jsx("h2",{className:"text-lg font-bold mb-2 mt-3 first:mt-0",children:t})},h3({children:t}){return l.jsx("h3",{className:"text-base font-bold mb-1.5 mt-2 first:mt-0",children:t})},a({href:t,children:n}){return l.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:n})},blockquote({children:t}){return l.jsx("blockquote",{className:"border-l-4 border-gray-300 pl-4 my-2 text-gray-600 italic",children:t})},table({children:t}){return l.jsx("div",{className:"overflow-x-auto my-2",children:l.jsx("table",{className:"min-w-full text-sm border border-gray-200 rounded",children:t})})},th({children:t}){return l.jsx("th",{className:"border-b border-gray-200 bg-gray-50 px-3 py-2 text-left font-semibold",children:t})},td({children:t}){return l.jsx("td",{className:"border-b border-gray-100 px-3 py-2",children:t})},hr(){return l.jsx("hr",{className:"my-3 border-gray-200"})},strong({children:t}){return l.jsx("strong",{className:"font-semibold",children:t})}},children:eG(e)})}const tG={cron_success:{icon:Hr,chipLabel:"Scheduled Task",bgClass:"bg-green-100",textClass:"text-green-600",chipBg:"bg-green-50",chipText:"text-green-700"},cron_failure:{icon:Ai,chipLabel:"Scheduled Task",bgClass:"bg-red-100",textClass:"text-red-600",chipBg:"bg-red-50",chipText:"text-red-700"},cron_result:{icon:Uu,chipLabel:"Scheduled Task",bgClass:"bg-blue-100",textClass:"text-blue-600",chipBg:"bg-blue-50",chipText:"text-blue-700"},vote_up:{icon:t_,chipLabel:"Vote",bgClass:"bg-green-100",textClass:"text-green-600",chipBg:"bg-green-50",chipText:"text-green-700"},vote_down:{icon:e_,chipLabel:"Vote",bgClass:"bg-red-100",textClass:"text-red-600",chipBg:"bg-red-50",chipText:"text-red-700"},skill_reverted:{icon:Nx,chipLabel:"Skill Reverted",bgClass:"bg-orange-100",textClass:"text-orange-600",chipBg:"bg-orange-50",chipText:"text-orange-700"},skill_approved:{icon:dw,chipLabel:"Approved",bgClass:"bg-green-100",textClass:"text-green-600",chipBg:"bg-green-50",chipText:"text-green-700"},skill_rejected:{icon:JO,chipLabel:"Rejected",bgClass:"bg-red-100",textClass:"text-red-600",chipBg:"bg-red-50",chipText:"text-red-700"},contribution_rejected:{icon:ys,chipLabel:"Rejected",bgClass:"bg-red-100",textClass:"text-red-600",chipBg:"bg-red-50",chipText:"text-red-700"},skill_review_requested:{icon:Bu,chipLabel:"Publish Review",bgClass:"bg-amber-100",textClass:"text-amber-600",chipBg:"bg-amber-50",chipText:"text-amber-700"},contribution_review_requested:{icon:ta,chipLabel:"Team Review",bgClass:"bg-blue-100",textClass:"text-blue-600",chipBg:"bg-blue-50",chipText:"text-blue-700"}},nG={icon:iw,chipLabel:"Notification",bgClass:"bg-gray-100",textClass:"text-gray-600",chipBg:"bg-gray-50",chipText:"text-gray-700"};function Rw(e){return tG[e]??nG}const xM=new Set(["cron_success","cron_failure","cron_result"]);function Fw(e){if(!e)return"";const t=new Date(e),r=new Date().getTime()-t.getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const a=Math.floor(i/60);return a<24?`${a}h ago`:t.toLocaleDateString()}function rG(e){for(const t of e.split(`
582
+ `)){const n=t.replace(/^#{1,6}\s+/,"").replace(/[*_`~]/g,"").trim();if(n)return n.length>80?n.slice(0,77)+"...":n}return e.slice(0,80)}function iG({notif:e,onClose:t}){const n=Rw(e.type);return l.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center",onClick:t,children:[l.jsx("div",{className:"absolute inset-0 bg-black/40"}),l.jsxs("div",{className:"relative bg-white rounded-xl shadow-2xl w-[42rem] max-w-[90vw] max-h-[80vh] flex flex-col",onClick:r=>r.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-3.5 border-b border-gray-100 flex-shrink-0",children:[l.jsx("div",{className:U("w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0",n.bgClass),children:l.jsx(n.icon,{className:U("w-3.5 h-3.5",n.textClass)})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-semibold text-gray-900 truncate",children:e.title}),l.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[l.jsx("span",{className:U("text-[10px] font-medium",n.chipBg,n.chipText,"px-1.5 py-0.5 rounded"),children:n.chipLabel}),l.jsx("span",{className:U("text-[10px] font-medium",e.type==="cron_success"?"text-green-600":e.type==="cron_failure"?"text-red-600":"text-gray-500"),children:e.type==="cron_success"?"Success":e.type==="cron_failure"?"Failed":""}),l.jsx("span",{className:"text-[10px] text-gray-400",children:Fw(e.createdAt)})]})]}),l.jsx("button",{onClick:t,className:"p-1.5 rounded-md hover:bg-gray-100 text-gray-400 hover:text-gray-600 flex-shrink-0",children:l.jsx(Ze,{className:"w-4 h-4"})})]}),l.jsx("div",{className:"px-5 py-4 overflow-y-auto flex-1",children:l.jsx("div",{className:"prose prose-sm prose-gray max-w-none",children:l.jsx(Pd,{children:e.message??""})})})]})]})}const UN=new Set(["skill_approved","skill_rejected","contribution_rejected","skill_reverted"]),O0=new Set(["skill_review_requested","contribution_review_requested"]),aG=300;function VN({notif:e,onMarkRead:t,onDelete:n,onClose:r,onShowDetail:i,nested:a}){var y;const[s,o]=m.useState(!0),c=$i(),u=Rw(e.type),d=u.icon,f=(((y=e.message)==null?void 0:y.length)??0)>aG,h=xM.has(e.type),p=(UN.has(e.type)||O0.has(e.type))&&e.relatedId,g=()=>{e.isRead||t(e.id),O0.has(e.type)&&e.relatedId?(r==null||r(),c("/skills?tab=approvals")):UN.has(e.type)&&e.relatedId?(r==null||r(),c(`/skills/${e.relatedId}`)):h&&e.message&&i&&i(e)};return l.jsx(l.Fragment,{children:l.jsx("div",{onClick:g,className:U("group relative px-3 py-2.5 border-b border-gray-50 hover:bg-gray-50/80 transition-colors cursor-pointer",!e.isRead&&"bg-blue-50/40",a&&"pl-10 border-b-0 py-2"),children:l.jsxs("div",{className:"flex items-start gap-2.5",children:[!a&&l.jsxs("div",{className:"relative flex-shrink-0 mt-0.5",children:[l.jsx("div",{className:U("w-7 h-7 rounded-full flex items-center justify-center",u.bgClass),children:l.jsx(d,{className:U("w-3.5 h-3.5",u.textClass)})}),!e.isRead&&l.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 rounded-full bg-blue-500 border-2 border-white"})]}),a&&h&&l.jsx("div",{className:U("w-2 h-2 rounded-full mt-1.5 flex-shrink-0",e.type==="cron_success"?"bg-green-500":e.type==="cron_failure"?"bg-red-500":"bg-blue-500")}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center justify-between gap-1.5 mb-0.5",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[!a&&l.jsx("span",{className:U("inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium flex-shrink-0",u.chipBg,u.chipText),children:u.chipLabel}),h&&l.jsx("span",{className:U("text-[10px] font-medium",e.type==="cron_success"?"text-green-600":e.type==="cron_failure"?"text-red-600":"text-gray-500"),children:e.type==="cron_success"?"Success":e.type==="cron_failure"?"Failed":""}),l.jsx("span",{className:"text-[10px] text-gray-400",children:Fw(e.createdAt)})]}),l.jsx("button",{onClick:x=>{x.stopPropagation(),n(e.id)},className:"flex-shrink-0 p-1 rounded hover:bg-gray-200 text-gray-300 opacity-0 group-hover:opacity-100 transition-opacity",title:"Delete",children:l.jsx(Ze,{className:"w-3 h-3"})})]}),l.jsx("p",{className:"text-sm text-gray-900 leading-snug break-words",children:e.title}),e.message&&(h?l.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[l.jsx("p",{className:"text-xs text-gray-500 truncate flex-1 min-w-0",children:rG(e.message)}),l.jsxs("button",{onClick:x=>{x.stopPropagation(),e.isRead||t(e.id),i==null||i(e)},className:"flex items-center gap-0.5 text-[10px] text-primary-600 hover:text-primary-700 font-medium flex-shrink-0",children:[l.jsx(YO,{className:"w-3 h-3"}),"Details"]})]}):l.jsxs("div",{className:"mt-1",children:[l.jsx("p",{className:U("text-xs text-gray-500 leading-relaxed break-words whitespace-pre-wrap",s&&f&&"line-clamp-5"),children:e.message}),f&&l.jsx("button",{onClick:x=>{x.stopPropagation(),o(!s)},className:"text-[10px] text-primary-600 hover:text-primary-700 font-medium mt-0.5",children:s?"Show more":"Show less"})]})),p&&!e.isRead&&l.jsxs("button",{onClick:x=>{x.stopPropagation(),g()},className:"mt-1 text-[11px] text-primary-600 hover:text-primary-700 font-medium hover:underline",children:[O0.has(e.type)?"Go to Approvals":"View Skill Details"," →"]})]})]})})})}function sG({group:e,onMarkRead:t,onDelete:n,onClose:r,onShowDetail:i}){const[a,s]=m.useState(!1);if(e.notifications.length===1)return l.jsx(VN,{notif:e.notifications[0],onMarkRead:t,onDelete:n,onClose:r,onShowDetail:i});const o=Rw(e.type),c=o.icon,u=xM.has(e.type),d=u?e.notifications.filter(h=>h.type==="cron_success").length:0,f=u?e.notifications.filter(h=>h.type==="cron_failure").length:0;return l.jsxs("div",{className:"border-b border-gray-50",children:[l.jsxs("button",{onClick:()=>s(!a),className:U("w-full text-left px-3 py-2.5 hover:bg-gray-50/80 transition-colors flex items-start gap-2.5",e.unreadCount>0&&"bg-blue-50/40"),children:[l.jsxs("div",{className:"relative flex-shrink-0 mt-0.5",children:[l.jsx("div",{className:U("w-7 h-7 rounded-full flex items-center justify-center",o.bgClass),children:l.jsx(c,{className:U("w-3.5 h-3.5",o.textClass)})}),e.unreadCount>0&&l.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 rounded-full bg-blue-500 border-2 border-white"})]}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[l.jsx("span",{className:U("inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium flex-shrink-0",o.chipBg,o.chipText),children:o.chipLabel}),l.jsx("span",{className:"text-[10px] text-gray-400",children:Fw(e.latestAt)})]}),l.jsx("p",{className:"text-sm text-gray-900 leading-snug break-words",children:e.title}),l.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[l.jsxs("span",{className:"text-[10px] text-gray-400",children:[e.notifications.length," runs"]}),u&&d>0&&l.jsxs("span",{className:"text-[10px] text-green-600 font-medium",children:[d," passed"]}),u&&f>0&&l.jsxs("span",{className:"text-[10px] text-red-600 font-medium",children:[f," failed"]}),e.unreadCount>0&&l.jsxs("span",{className:"text-[10px] text-blue-500 font-medium",children:[e.unreadCount," unread"]})]})]}),l.jsx(ua,{className:U("w-4 h-4 text-gray-400 flex-shrink-0 mt-1 transition-transform duration-200",a&&"rotate-90")})]}),a&&l.jsx("div",{className:"bg-gray-50/50",children:e.notifications.map(h=>l.jsx(VN,{notif:h,onMarkRead:t,onDelete:n,onClose:r,onShowDetail:i,nested:!0},h.id))})]})}function oG(){const{sendRpc:e,isConnected:t}=$t({onMessage:b=>u(b)}),{notifications:n,unreadCount:r,loadNotifications:i,markRead:a,markAllRead:s,dismissOne:o,dismissAll:c,handleWsEvent:u}=l8(e),[d,f]=m.useState(!1),[h,p]=m.useState(null),g=m.useRef(null),y=m.useCallback(b=>{f(!1),p(b)},[]),x=m.useMemo(()=>o8(n),[n]);return m.useEffect(()=>{t&&i()},[t,i]),m.useEffect(()=>{if(!d)return;const b=v=>{g.current&&!g.current.contains(v.target)&&f(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[d]),l.jsxs("div",{className:"relative",ref:g,children:[l.jsxs("button",{onClick:()=>f(!d),className:"relative p-1.5 rounded-md text-gray-400 hover:text-gray-900 hover:bg-gray-100 transition-colors",children:[l.jsx(iw,{className:"w-4.5 h-4.5"}),r>0&&l.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-bold text-white",children:r>99?"99+":r})]}),d&&l.jsxs("div",{className:"absolute top-full left-0 mt-2 w-[28rem] bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden z-[60]",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-gray-100 flex items-center justify-between",children:[l.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:"Notifications"}),l.jsxs("div",{className:"flex items-center gap-2",children:[r>0&&l.jsxs("button",{onClick:s,className:"flex items-center gap-1 text-xs text-primary-600 hover:text-primary-700 font-medium",children:[l.jsx($n,{className:"w-3 h-3"}),"Mark all read"]}),n.length>0&&l.jsxs("button",{onClick:c,className:"flex items-center gap-1 text-xs text-red-500 hover:text-red-600 font-medium",title:"Clear all notifications",children:[l.jsx(sr,{className:"w-3 h-3"}),"Clear all"]})]})]}),l.jsx("div",{className:"max-h-[480px] overflow-y-auto",children:x.length===0?l.jsx("div",{className:"py-8 text-center text-sm text-gray-400",children:"No notifications"}):x.map(b=>l.jsx(sG,{group:b,onMarkRead:a,onDelete:o,onClose:()=>f(!1),onShowDetail:y},b.key))})]}),h&&l.jsx(iG,{notif:h,onClose:()=>p(null)})]})}const vM=m.createContext(null),WN="siclaw_workspace_id";function lG({children:e}){const{sendRpc:t,isConnected:n}=$t(),[r,i]=m.useState([]),[a,s]=m.useState(null),o=m.useRef(!1),c=m.useCallback(async()=>{if(n)try{const f=(await t("workspace.list")).workspaces??[];i(f);const h=localStorage.getItem(WN),p=h?f.find(y=>y.id===h):null,g=f.find(y=>y.isDefault)??f[0]??null;s(p??g)}catch(d){console.error("Failed to load workspaces:",d)}},[n,t]),u=m.useCallback(d=>{s(d),localStorage.setItem(WN,d.id)},[]);return m.useEffect(()=>{n&&!o.current&&(o.current=!0,c())},[n,c]),l.jsx(vM.Provider,{value:{workspaces:r,currentWorkspace:a,setCurrentWorkspace:u,reload:c},children:e})}function Ed(){const e=m.useContext(vM);if(!e)throw new Error("useWorkspace must be used within a WorkspaceProvider");return e}const cG=[{icon:J7,label:"Pilot",to:"/pilot"},{icon:aw,label:"Workspace",to:"/workspace"},{icon:Uu,label:"Cron Jobs",to:"/cron"},{icon:kd,label:"Triggers",to:"/triggers"}],_0=[{icon:mB,label:"Agent",key:"agent",items:[{icon:cw,label:"Skills",to:"/skills"},{icon:jx,label:"MCP",to:"/mcp"}]},{icon:Cm,label:"Settings",key:"settings",items:[{icon:pB,label:"Channels",to:"/channels",adminOnly:!0},{icon:mo,label:"Models",to:"/models",adminOnly:!0},{icon:Ql,label:"Credentials",to:"/credentials"},{icon:fw,label:"Permissions",to:"/permissions",adminOnly:!0},{icon:r_,label:"System",to:"/settings/system",adminOnly:!0}]}];function HN(e,t){const n=`sidebar-${e}-expanded`,[r,i]=m.useState(()=>{if(t)return!0;const s=localStorage.getItem(n);return s===null?!0:s==="true"});return m.useEffect(()=>{t&&!r&&(i(!0),localStorage.setItem(n,"true"))},[t]),{expanded:r,toggle:()=>{const s=!r;i(s),localStorage.setItem(n,String(s))}}}const KN={indigo:"bg-indigo-500",blue:"bg-blue-500",green:"bg-green-500",amber:"bg-amber-500",rose:"bg-rose-500",purple:"bg-purple-500",teal:"bg-teal-500",gray:"bg-gray-400"};function uG(){var x;const e=$i(),t=gs(),[n,r]=m.useState(Ll()),i=ls(),a=(i==null?void 0:i.username)==="admin",{workspaces:s,currentWorkspace:o,setCurrentWorkspace:c}=Ed(),[u,d]=m.useState(!1),f=m.useRef(null);m.useEffect(()=>{const b=v=>{f.current&&!f.current.contains(v.target)&&d(!1)};return u&&document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[u]);const h=b=>b.items.filter(v=>!v.adminOnly||a).some(v=>t.pathname.startsWith(v.to)),p=HN("agent",h(_0[0])),g=HN("settings",h(_0[1])),y=[p,g];return m.useEffect(()=>{const b=()=>r(Ll());return window.addEventListener("user-profile-updated",b),()=>window.removeEventListener("user-profile-updated",b)},[]),l.jsxs("aside",{className:"w-64 h-screen bg-gray-50 border-r border-gray-200 flex flex-col shrink-0",children:[l.jsxs("div",{className:"h-14 flex items-center justify-between px-4 border-b border-gray-200 bg-white",children:[l.jsxs("div",{className:"flex items-center gap-2.5 text-primary-600",children:[l.jsx("div",{className:"p-1 bg-primary-50 rounded-md",children:l.jsx(GO,{className:"w-5 h-5"})}),l.jsx("span",{className:"font-bold text-gray-900 tracking-tight",children:"Siclaw"})]}),l.jsx(oG,{})]}),s.length>0&&l.jsx("div",{className:"px-3 py-2 border-b border-gray-200",ref:f,children:l.jsxs("div",{className:"relative",children:[l.jsxs("button",{onClick:()=>d(!u),className:"w-full flex items-center gap-2 px-3 py-2 rounded-lg bg-white border border-gray-200 hover:border-gray-300 text-sm font-medium text-gray-900 shadow-sm transition-colors",children:[l.jsx("span",{className:U("w-2 h-2 rounded-full shrink-0",KN[((x=o==null?void 0:o.configJson)==null?void 0:x.color)??"indigo"]??"bg-indigo-500")}),l.jsx("span",{className:"flex-1 text-left truncate",children:(o==null?void 0:o.name)??"Default"}),l.jsx(ea,{className:U("w-4 h-4 text-gray-400 transition-transform",u&&"rotate-180")})]}),u&&l.jsxs("div",{className:"absolute top-full left-0 right-0 mt-1 bg-white border border-gray-200 rounded-lg shadow-lg z-50 py-1 max-h-48 overflow-y-auto",children:[s.map(b=>{var v;return l.jsxs("button",{onClick:()=>{c(b),d(!1)},className:U("w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-gray-50 transition-colors",(o==null?void 0:o.id)===b.id&&"bg-indigo-50 text-indigo-700"),children:[l.jsx("span",{className:U("w-2 h-2 rounded-full shrink-0",KN[((v=b.configJson)==null?void 0:v.color)??"indigo"]??"bg-indigo-500")}),l.jsx("span",{className:"truncate",children:b.name}),b.envType==="test"&&l.jsx("span",{className:"text-xs px-1 py-0.5 rounded bg-amber-50 text-amber-600 ml-1",children:"TEST"}),b.isDefault&&l.jsx("span",{className:"text-xs text-gray-400 ml-auto",children:"default"})]},b.id)}),l.jsx("div",{className:"border-t border-gray-100 mt-1 pt-1",children:l.jsx("button",{onClick:()=>{d(!1),e("/workspace")},className:"w-full px-3 py-2 text-sm text-indigo-600 text-left hover:bg-gray-50 transition-colors",children:"Manage Workspaces"})})]})]})}),l.jsxs("div",{className:"flex-1 py-4 px-3 space-y-1 overflow-y-auto",children:[cG.map(b=>l.jsxs(h0,{to:b.to,className:({isActive:v})=>U("flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-normal transition-all",v?"bg-primary-50 text-primary-700":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:[l.jsx(b.icon,{className:"w-[18px] h-[18px] stroke-[1.25]"}),b.label]},b.to)),_0.map((b,v)=>{const w=b.items.filter(N=>!N.adminOnly||a);if(w.length===0)return null;const{expanded:k,toggle:S}=y[v],j=h(b);return l.jsxs("div",{className:"pt-2",children:[l.jsxs("button",{onClick:S,className:U("flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-normal transition-all w-full text-left",j?"text-gray-900":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:[l.jsx(b.icon,{className:"w-[18px] h-[18px] stroke-[1.25]"}),l.jsx("span",{className:"flex-1",children:b.label}),l.jsx(ua,{className:U("w-3.5 h-3.5 stroke-[1.5] text-gray-400 transition-transform",k&&"rotate-90")})]}),k&&w.map(N=>l.jsxs(h0,{to:N.to,className:({isActive:P})=>U("flex items-center gap-3 pl-9 pr-3 py-2 rounded-lg text-sm font-normal transition-all",P?"bg-primary-50 text-primary-700":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:[l.jsx(N.icon,{className:"w-[18px] h-[18px] stroke-[1.25]"}),N.label]},N.to))]},b.key)})]}),l.jsx("div",{className:"px-3 pb-2",children:l.jsxs(h0,{to:"/metrics",className:({isActive:b})=>U("flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-normal transition-all",b?"bg-primary-50 text-primary-700":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:[l.jsx(rw,{className:"w-[18px] h-[18px] stroke-[1.25]"}),"Dashboard"]})}),l.jsx("div",{className:"p-3 border-t border-gray-200 bg-white",children:l.jsxs("button",{onClick:()=>e("/settings"),className:"flex items-center gap-3 w-full p-2 rounded-md hover:bg-gray-50 transition-colors text-left group",children:[l.jsx("div",{className:U("w-8 h-8 rounded-full flex items-center justify-center text-primary-700 font-semibold text-xs ring-2 ring-white shadow-sm",n.avatarBg),children:n.initials}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-gray-900 group-hover:text-primary-600 transition-colors truncate",children:n.name}),l.jsxs("div",{className:"text-xs text-gray-500 truncate",children:["@",(i==null?void 0:i.username)??"user"]})]}),l.jsx(Cm,{className:"w-4 h-4 text-gray-400 group-hover:text-gray-600"})]})})]})}function dG(){const{sendRpc:e,isConnected:t}=$t(),n=m.useRef(!1);return m.useEffect(()=>{t&&!n.current&&(n.current=!0,i8(e))},[t,e]),l.jsxs("div",{className:"flex h-screen bg-white overflow-hidden",children:[l.jsx(uG,{}),l.jsx("main",{className:"flex-1 flex flex-col relative overflow-hidden bg-white",children:l.jsx(nw,{})})]})}function fG(){return l.jsx(a8,{children:l.jsx(lG,{children:l.jsx(dG,{})})})}const hG=()=>{const{isAuthenticated:e}=Pm();return e?l.jsx(nw,{}):l.jsx(uh,{to:"/login",replace:!0})};function pG(){const e=$i(),[t]=bd(),[n,r]=m.useState(""),[i,a]=m.useState(""),[s,o]=m.useState(""),[c,u]=m.useState(!1),[d,f]=m.useState(!1);m.useEffect(()=>{const g=t.get("error");g&&o(decodeURIComponent(g)),fetch("/api/sso/config").then(y=>y.json()).then(y=>f(y.enabled)).catch(()=>{})},[t]);const h=async g=>{g.preventDefault(),o(""),u(!0);try{const y=await QB({username:n,password:i});y.ok?e("/"):o(y.error||"Login failed")}catch{o("Network error")}finally{u(!1)}},p=()=>{window.location.href="/auth/sso"};return l.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col items-center justify-center p-4",children:[l.jsxs("div",{className:"w-full max-w-sm bg-white rounded-2xl shadow-xl border border-gray-100 overflow-hidden",children:[l.jsxs("div",{className:"p-8 pb-6 flex flex-col items-center text-center",children:[l.jsx("div",{className:"w-16 h-16 bg-primary-50 rounded-2xl flex items-center justify-center mb-6 text-primary-600",children:l.jsx(GO,{className:"w-8 h-8"})}),l.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Welcome Back"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Sign in to access your Siclaw workspace"})]}),l.jsxs("form",{onSubmit:h,className:"p-8 pt-0 space-y-4",children:[s&&l.jsxs("div",{className:"flex items-center gap-2 p-3 bg-red-50 border border-red-100 rounded-lg text-red-600 text-sm",children:[l.jsx(zu,{className:"w-4 h-4 flex-shrink-0"}),l.jsx("span",{children:s})]}),d&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",onClick:p,className:"w-full flex items-center justify-center gap-3 px-4 py-3 bg-primary-600 text-white rounded-xl hover:bg-primary-700 transition-all font-medium shadow-lg shadow-primary-100",children:[l.jsx(eB,{className:"w-5 h-5"}),l.jsx("span",{children:"Sign in with SSO"})]}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("span",{className:"w-full border-t border-gray-100"})}),l.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:l.jsx("span",{className:"bg-white px-2 text-gray-400",children:"or sign in with password"})})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700",children:"Username"}),l.jsx("input",{id:"username",type:"text",value:n,onChange:g=>r(g.target.value),className:"w-full px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent transition-all",placeholder:"Enter your username",required:!0,autoFocus:!d,disabled:c})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700",children:"Password"}),l.jsx("input",{id:"password",type:"password",value:i,onChange:g=>a(g.target.value),className:"w-full px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent transition-all",placeholder:"Enter your password",required:!0,disabled:c})]}),l.jsxs("button",{type:"submit",disabled:c||!n||!i,className:"w-full flex items-center justify-center gap-3 px-4 py-3 bg-gray-900 text-white rounded-xl hover:bg-gray-800 transition-all font-medium shadow-lg shadow-gray-200 disabled:opacity-50 disabled:cursor-not-allowed",children:[c?l.jsx(Le,{className:"w-5 h-5 animate-spin"}):l.jsx(aB,{className:"w-5 h-5"}),l.jsx("span",{children:c?"Signing in...":"Sign In"})]}),!d&&l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("span",{className:"w-full border-t border-gray-100"})}),l.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:l.jsx("span",{className:"bg-white px-2 text-gray-400",children:"Restricted Access"})})]})]})]}),l.jsx("div",{className:"mt-8 text-center text-xs text-gray-400",children:"© 2025 Siclaw. All rights reserved."})]})}function mG(){const e=$i(),[t]=bd();return m.useEffect(()=>{const n=t.get("token"),r=t.get("userId"),i=t.get("username");if(n&&r&&i){const a={isAuthenticated:!0,token:n,user:{id:r,username:i}};localStorage.setItem("siclaw_auth",JSON.stringify(a)),e("/",{replace:!0})}else e("/login?error=sso_callback_failed",{replace:!0})},[t,e]),l.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col items-center justify-center",children:[l.jsx(Le,{className:"w-8 h-8 animate-spin text-gray-400 mb-4"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Completing sign in..."})]})}function gG({sessions:e,currentSessionKey:t,onSelectSession:n,onNewSession:r,onDeleteSession:i}){const[a,s]=m.useState(""),o=a?e.filter(u=>(u.title||"").toLowerCase().includes(a.toLowerCase())||(u.preview||"").toLowerCase().includes(a.toLowerCase())):e,c=u=>{if(!u)return"";try{const d=new Date(u),h=new Date().getTime()-d.getTime(),p=Math.floor(h/(1e3*60*60*24));return p===0?d.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):p===1?"Yesterday":p<7?d.toLocaleDateString([],{weekday:"short"}):d.toLocaleDateString([],{month:"short",day:"numeric"})}catch{return""}};return l.jsxs("div",{className:"h-full flex flex-col bg-gray-50/50",children:[l.jsxs("div",{className:"p-4 border-b border-gray-200 bg-white",children:[l.jsxs("div",{className:"relative group",children:[l.jsx(Hn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 group-focus-within:text-primary-500 transition-colors"}),l.jsx("input",{type:"text",placeholder:"Search...",value:a,onChange:u=>s(u.target.value),className:"w-full pl-9 pr-3 py-2 bg-gray-50 border border-gray-200 rounded-lg text-sm text-gray-900 focus:outline-none focus:border-primary-500 focus:bg-white transition-all placeholder:text-gray-400"})]}),l.jsxs("button",{onClick:r,className:"w-full mt-3 flex items-center justify-center gap-2 py-2 bg-white border border-gray-200 rounded-lg text-sm font-medium text-gray-700 hover:border-primary-200 hover:text-primary-600 transition-all shadow-sm",children:[l.jsx(In,{className:"w-4 h-4"}),"New Session"]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-1",children:[l.jsx("div",{className:"px-2 pb-2 text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Recent"}),o.length===0&&l.jsx("div",{className:"px-2 py-8 text-center text-sm text-gray-400",children:a?"No matching sessions":"No sessions yet"}),o.map(u=>{const d=u.key===t;return l.jsxs("div",{onClick:()=>n(u.key),className:U("p-3 rounded-lg cursor-pointer transition-all border group relative",d?"bg-white border-primary-200 shadow-sm ring-1 ring-primary-50 text-gray-900":"bg-transparent border-transparent hover:bg-white hover:border-gray-200 hover:shadow-sm text-gray-600"),children:[l.jsxs("div",{className:"flex justify-between items-start mb-1",children:[l.jsx("h3",{className:U("font-semibold text-sm truncate pr-2",d?"text-primary-700":"text-gray-900"),children:u.title||"Untitled Session"}),l.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[l.jsx("span",{className:"text-[10px] text-gray-400 pt-0.5",children:c(u.lastActiveAt||u.createdAt)}),i&&l.jsx("button",{onClick:f=>{f.stopPropagation(),i(u.key)},className:"p-1 text-gray-300 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-all",children:l.jsx(sr,{className:"w-3 h-3"})})]})]}),l.jsx("p",{className:"text-xs text-gray-500 truncate",children:u.preview||" "})]},u.key)})]})]})}function GN(e){return e<1e3?String(e):e<1e4||e<1e5?(e/1e3).toFixed(1)+"k":Math.round(e/1e3)+"k"}function yG(e){return e<.01?"$"+e.toFixed(3):"$"+e.toFixed(2)}function xG({onSend:e,onAbort:t,disabled:n,isLoading:r,contextUsage:i,isCompacting:a,editingSkill:s,onClearEditSkill:o,skills:c,onEditSkill:u,pendingMessages:d,onRemovePending:f,dpFocus:h,dpActive:p,onSetDpActive:g}){const[y,x]=m.useState(""),[b,v]=m.useState(!1),w=m.useRef(!1),k=p??!1,S=g??(()=>{}),[j,N]=m.useState(!1),[P,A]=m.useState(""),E=m.useRef(null),O=m.useCallback(async()=>{const I=y.trim();if(!I||n)return;let B="";k&&(B+=`[Deep Investigation]
583
+ `),s&&(B+=`[Skill: ${s.name}]
584
+ `),B+=I,e(B.trim()),x("")},[y,n,e,s,k]),C=m.useCallback(I=>{I.key==="Enter"&&!I.shiftKey&&!w.current&&!I.nativeEvent.isComposing&&(I.preventDefault(),O())},[O]),M=y.trim();return l.jsx(l.Fragment,{children:l.jsx("div",{className:"w-full px-4 pb-2 z-20 bg-gradient-to-t from-gray-50 via-gray-50 to-transparent pt-10",children:l.jsxs("div",{className:"max-w-5xl mx-auto",children:[l.jsxs("div",{className:U("relative bg-white rounded-[24px] shadow-lg border transition-all duration-200",b?"border-gray-300 shadow-xl":"border-gray-200",n&&"opacity-60"),children:[l.jsxs("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 min-w-0",children:[c&&c.length>0&&u&&l.jsxs("div",{className:"relative",children:[l.jsx("button",{type:"button",onClick:()=>{N(!j),A("")},disabled:n,className:U("p-1.5 rounded-lg transition-colors disabled:opacity-50",j?"text-indigo-600 bg-indigo-50":"text-gray-400 hover:text-gray-600 hover:bg-gray-100"),title:"Select skill to edit",children:l.jsx(Dl,{className:"w-4 h-4"})}),j&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>N(!1)}),l.jsxs("div",{className:"absolute bottom-full left-0 mb-1 bg-white rounded-xl shadow-xl border border-gray-200 z-20 w-[280px] max-h-[360px] flex flex-col",children:[l.jsx("div",{className:"px-3 pt-3 pb-2",children:l.jsxs("div",{className:"relative",children:[l.jsx(Hn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400"}),l.jsx("input",{ref:E,type:"text",value:P,onChange:I=>A(I.target.value),placeholder:"Search skills...",className:"w-full pl-8 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-1 focus:ring-indigo-300 focus:border-indigo-300",autoFocus:!0})]})}),l.jsx("div",{className:"overflow-y-auto flex-1 pb-2",children:(()=>{const I=P.toLowerCase(),B=c.filter(D=>D.name.toLowerCase().includes(I)||D.description.toLowerCase().includes(I)),se=[{label:"Personal",scope:"personal"},{label:"Team Skills",scope:"team"},{label:"System Skills",scope:"builtin"}];return B.length>0?se.map(({label:D,scope:K})=>{const T=B.filter(ie=>ie.scope===K);return T.length===0?null:l.jsxs("div",{children:[l.jsx("div",{className:"px-3 pt-2 pb-1",children:l.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:D})}),T.map(ie=>{const J=(s==null?void 0:s.id)===String(ie.id);return l.jsxs("button",{type:"button",className:U("flex flex-col w-full px-3 py-1.5 text-left transition-colors",J?"bg-indigo-50 border-l-2 border-indigo-500":"hover:bg-gray-50 border-l-2 border-transparent"),onClick:()=>{u(String(ie.id),ie.name),N(!1)},children:[l.jsx("span",{className:U("text-sm font-medium truncate",J?"text-indigo-700":"text-gray-700"),children:ie.name}),ie.description&&l.jsx("span",{className:"text-xs text-gray-400 truncate",children:ie.description})]},ie.id)})]},K)}):l.jsx("div",{className:"px-3 py-4 text-center text-sm text-gray-400",children:"No skills found"})})()})]})]})]}),l.jsx("button",{type:"button",onClick:()=>S(!k),disabled:n,className:U("p-1.5 rounded-lg transition-colors disabled:opacity-50",k?"text-blue-600 bg-blue-50":"text-gray-400 hover:text-gray-600 hover:bg-gray-100"),title:k?"Deep Investigation enabled — click to disable":"Enable Deep Investigation",children:l.jsx($u,{className:"w-4 h-4"})}),l.jsx("div",{className:"ml-auto flex items-center gap-3 shrink-0"})]}),(k||s)&&l.jsx("div",{className:"flex flex-wrap gap-2 px-4 pb-1",children:k&&l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg border text-xs font-medium bg-blue-50 border-blue-200 text-blue-700",children:[l.jsx($u,{className:"w-3.5 h-3.5 text-blue-500"}),l.jsx("span",{children:"Deep Investigation"}),h&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-blue-100 text-blue-600 text-[10px] font-semibold uppercase",children:h.replace(/_/g," ")}),l.jsx("button",{type:"button",className:"ml-0.5 p-0.5 rounded hover:bg-blue-200 transition-colors",onClick:()=>S(!1),children:l.jsx(Ze,{className:"w-3 h-3"})})]})}),s&&l.jsx("div",{className:"flex flex-wrap gap-2 px-4 pb-1",children:l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg border text-xs font-medium bg-indigo-50 border-indigo-200 text-indigo-700",children:[l.jsx(Dl,{className:"w-3.5 h-3.5 text-indigo-500"}),l.jsx("span",{children:s.name}),l.jsx("button",{type:"button",className:"ml-0.5 p-0.5 rounded hover:bg-indigo-200 transition-colors",onClick:()=>o==null?void 0:o(),children:l.jsx(Ze,{className:"w-3 h-3"})})]})}),d&&d.length>0&&l.jsx("div",{className:"flex flex-col gap-1 px-4 pb-1",children:d.map((I,B)=>l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-amber-50 border border-amber-200 text-xs text-amber-800",children:[l.jsx("span",{className:"flex-1 truncate",children:I}),l.jsx("button",{type:"button",className:"p-0.5 rounded hover:bg-amber-200 transition-colors shrink-0",onClick:()=>f==null?void 0:f(B),title:"Remove this instruction",children:l.jsx(Ze,{className:"w-3 h-3"})})]},B))}),l.jsx("textarea",{value:y,onFocus:()=>v(!0),onBlur:()=>v(!1),onChange:I=>x(I.target.value),onKeyDown:C,onCompositionStart:()=>{w.current=!0},onCompositionEnd:()=>{w.current=!1},placeholder:n?"Connecting...":"Reply...",disabled:n,className:"w-full bg-transparent border-none outline-none px-6 py-3 pr-14 text-[15px] text-gray-900 placeholder:text-gray-400 focus:ring-0 focus:outline-none resize-none min-h-[48px] max-h-[200px] disabled:cursor-not-allowed",rows:1,style:{height:"auto"}}),r&&y.trim()?l.jsx("button",{onClick:O,className:"absolute right-3 bottom-3 p-2 rounded-lg bg-primary-600 text-white shadow-md hover:bg-primary-700 transition-all",title:"Send steer instruction",children:l.jsx(Uj,{className:"w-5 h-5"})}):r?l.jsx("button",{onClick:t,className:"absolute right-3 bottom-3 p-2 rounded-lg bg-red-500 text-white shadow-md hover:bg-red-600 transition-all",title:"Stop generating",children:l.jsx(gB,{className:"w-5 h-5"})}):l.jsx("button",{onClick:O,disabled:!M||n,className:U("absolute right-3 bottom-3 p-2 rounded-lg transition-all",M&&!n?"bg-primary-600 text-white shadow-md hover:bg-primary-700":"bg-gray-100 text-gray-300 cursor-not-allowed"),children:l.jsx(Uj,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"mt-4 flex items-center justify-between px-1",children:[l.jsx("p",{className:"text-xs text-gray-400",children:"AI may make mistakes. Please verify important information."}),a?l.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-amber-500",children:[l.jsx(Le,{className:"w-3 h-3 animate-spin"}),l.jsx("span",{children:"Compacting..."})]}):i&&i.percent>0?l.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-400 font-mono cursor-default",children:[l.jsxs("span",{title:`Input: ${i.inputTokens.toLocaleString()} tokens`,children:["↑ ",GN(i.inputTokens)]}),l.jsxs("span",{title:`Output: ${i.outputTokens.toLocaleString()} tokens`,children:["↓ ",GN(i.outputTokens)]}),i.cost>0&&l.jsx("span",{title:"API cost this session",children:yG(i.cost)}),l.jsxs("span",{className:"flex items-center gap-1",title:`Context: ${i.tokens.toLocaleString()} / ${i.contextWindow.toLocaleString()} tokens`,children:[Math.round(i.percent),"%",l.jsx("span",{className:U("inline-block w-1.5 h-1.5 rounded-full",i.percent>75?"bg-red-400":i.percent>50?"bg-yellow-400":"bg-green-400")})]})]}):null]})]})})})}function vG({message:e,status:t,onOpenPanel:n}){let r=null;try{r=JSON.parse(e.content)}catch{}if(!(r!=null&&r.skill))return null;const{skill:i}=r,a=e.toolName==="update_skill";return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:U("inline-flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors",t==="saved"&&"border-green-200 bg-green-50/50",t==="dismissed"&&"border-gray-200 bg-gray-50/50 opacity-60",t==="superseded"&&"border-gray-200 bg-gray-50/50 opacity-40",t==="pending"&&"border-indigo-200 bg-indigo-50/50"),children:[l.jsx(Dl,{className:U("w-4 h-4 shrink-0",t==="saved"?"text-green-500":t==="dismissed"?"text-gray-400":t==="superseded"?"text-gray-300":"text-indigo-500")}),l.jsx("span",{className:U("text-sm font-medium",t==="superseded"?"text-gray-400":"text-gray-800"),children:i.name}),t==="saved"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-green-100 text-green-700",children:[l.jsx($n,{className:"w-2.5 h-2.5"}),a?"Updated":"Saved"]}),t==="dismissed"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 text-gray-500",children:[l.jsx(Ze,{className:"w-2.5 h-2.5"}),"Dismissed"]}),t==="superseded"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 text-gray-400",children:[l.jsx(lw,{className:"w-2.5 h-2.5"}),"Superseded"]}),t==="pending"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-indigo-100 text-indigo-600",children:[l.jsx(os,{className:"w-2.5 h-2.5"}),"Pending"]}),t!=="superseded"&&n&&l.jsxs("button",{onClick:()=>n(e),className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium text-gray-500 hover:text-indigo-600 hover:bg-indigo-50 transition-colors",children:[l.jsx(wd,{className:"w-3 h-3"}),"View"]})]})})}async function jf(e,t,n){if(!t)return null;try{const r={};n&&(r.workspaceId=n);const i=await e("cron.list",r),a=t.toLowerCase();return i.jobs.find(s=>s.name===t)??i.jobs.find(s=>s.name.toLowerCase()===a)??i.jobs.find(s=>s.name.toLowerCase().includes(a)||a.includes(s.name.toLowerCase()))??null}catch{return null}}function bG({message:e,status:t,onOpenPanel:n,sendRpc:r,updateMessageMeta:i,selectedWorkspaceId:a}){var w;const[s,o]=m.useState("idle"),[c,u]=m.useState(""),d=m.useRef(!1);let f=null;try{f=JSON.parse(e.content)}catch{}m.useEffect(()=>{!f||f.error||!r||!i||d.current||t==="saved"||t==="dismissed"||t==="superseded"||(d.current=!0,h())},[t]);const h=async()=>{var k;if(!(!f||!r||!i)){if(!a){o("error"),u("Please select a workspace first");return}o("executing");try{const S=f.action;if(S==="create"&&f.schedule)await r("cron.save",{name:f.schedule.name,description:f.schedule.description,schedule:f.schedule.schedule,status:f.schedule.status||"active",workspaceId:a??null});else if(S==="update"&&f.schedule){const j=f.name??((k=f.schedule)==null?void 0:k.name)??f.id,N=await jf(r,j,a);if(!N)throw new Error("Schedule not found");await r("cron.save",{id:N.id,name:f.schedule.name,description:f.schedule.description,schedule:f.schedule.schedule,status:f.schedule.status||"active",workspaceId:a??null})}else if(S==="delete"){const j=await jf(r,f.name??f.id,a);if(!j)throw new Error("Schedule not found");await r("cron.delete",{id:j.id})}else if(S==="pause"||S==="resume"){const j=await jf(r,f.name??f.id,a);if(!j)throw new Error("Schedule not found");await r("cron.setStatus",{id:j.id,status:S==="pause"?"paused":"active"})}else if(S==="rename"){const j=await jf(r,f.name??f.id,a);if(!j)throw new Error("Schedule not found");await r("cron.rename",{id:j.id,newName:f.newName})}o("done"),await i(e.id,{scheduleCard:"saved"})}catch(S){o("error"),u((S==null?void 0:S.message)||"Operation failed")}}};if(!f||f.error)return null;const p=f.action,g=p==="rename",y=p==="delete",x=g?`${f.name||f.id} → ${f.newName}`:((w=f.schedule)==null?void 0:w.name)||f.name||f.id||"...",b=()=>{switch(p){case"delete":return"Deleted";case"pause":return"Paused";case"resume":return"Resumed";case"rename":return"Renamed";case"update":return"Updated";default:return"Saved"}},v=s==="done"?"saved":t;return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:U("inline-flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors",v==="saved"&&"border-green-200 bg-green-50/50",v==="dismissed"&&"border-gray-200 bg-gray-50/50 opacity-60",v==="superseded"&&"border-gray-200 bg-gray-50/50 opacity-40",v==="pending"&&(y?"border-red-200 bg-red-50/50":"border-amber-200 bg-amber-50/50"),s==="error"&&"border-red-200 bg-red-50/50"),children:[l.jsx(os,{className:U("w-4 h-4 shrink-0",v==="saved"?"text-green-500":v==="dismissed"?"text-gray-400":v==="superseded"?"text-gray-300":s==="error"||y?"text-red-500":"text-amber-500")}),l.jsx("span",{className:U("text-sm font-medium",v==="superseded"?"text-gray-400":"text-gray-800"),children:x}),f.schedule&&l.jsx("span",{className:"font-mono text-xs text-gray-500 bg-gray-100 px-1.5 py-0.5 rounded",children:f.schedule.schedule}),s==="executing"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-100 text-amber-600",children:[l.jsx(Le,{className:"w-2.5 h-2.5 animate-spin"}),"Processing"]}),s==="error"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-100 text-red-600",children:[l.jsx(zu,{className:"w-2.5 h-2.5"}),c]}),s!=="executing"&&s!=="error"&&v==="saved"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-green-100 text-green-700",children:[l.jsx($n,{className:"w-2.5 h-2.5"}),b()]}),v==="dismissed"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 text-gray-500",children:[l.jsx(Ze,{className:"w-2.5 h-2.5"}),"Dismissed"]}),v==="superseded"&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 text-gray-400",children:[l.jsx(lw,{className:"w-2.5 h-2.5"}),"Superseded"]}),v!=="superseded"&&n&&s!=="executing"&&l.jsxs("button",{onClick:()=>n(e),className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium text-gray-500 hover:text-amber-600 hover:bg-amber-50 transition-colors",children:[l.jsx(wd,{className:"w-3 h-3"}),"View"]})]})})}const wG={VALIDATED:"validated",INVALIDATED:"invalidated",INCONCLUSIVE:"inconclusive",PENDING:"pending",SKIPPED:"skipped"};function SG(e){var u,d;if(!e||!e.includes("Deep Search Summary"))return null;const t=e.match(/### Conclusion\n([\s\S]*?)(?=\n### )/),n=((u=t==null?void 0:t[1])==null?void 0:u.trim())??"",r=[],i=e.match(/### Hypothesis Verdicts\n([\s\S]*?)(?=\n### )/);if(i){const f=i[1],h=/^- (?:✅|❌|⚠️|⏳|⏭️)\s+(\w+)\s+\*\*(\w+)\*\*:\s+(.+?)\s+—\s+(\d+)%/gm;let p;for(;(p=h.exec(f))!==null;){const g=p[1],y=p[2],x=p[3],b=parseInt(p[4],10);r.push({id:y,text:x,status:wG[g]??"pending",confidence:b})}if(r.length===0){const g=f.split(`
585
+ `);let y=null;for(const x of g){const b=x.match(/^- .+?\*\*(\w+)\*\*:\s+(.+?)\s+—\s+(\d+)%/);if(b){let v="pending";x.includes("VALIDATED")&&!x.includes("INVALIDATED")?v="validated":x.includes("INVALIDATED")?v="invalidated":x.includes("INCONCLUSIVE")?v="inconclusive":x.includes("SKIPPED")?v="skipped":x.includes("PENDING")&&(v="pending"),y&&r.push(y),y={id:b[1],text:b[2],status:v,confidence:parseInt(b[3],10)}}else x.trim()&&y&&x.startsWith(" ")&&(y.reasoning=x.trim())}y&&r.push(y)}else{const g=f.split(`
586
+ `);let y=-1;for(const x of g)x.startsWith("- ")?y++:x.startsWith(" ")&&x.trim()&&y>=0&&y<r.length&&(r[y].reasoning=x.trim())}}const a=e.match(/Tool calls:\s*(\d+)\s*\|\s*Duration:\s*([^\s|]+)\s*\|\s*Hypotheses:\s*(.+)/),s={toolCalls:a?parseInt(a[1],10):0,duration:(a==null?void 0:a[2])??"",hypothesesSummary:((d=a==null?void 0:a[3])==null?void 0:d.trim())??""},o=e.match(/Full report:\s*`([^`]+)`/),c=o==null?void 0:o[1];return{conclusion:n,hypotheses:r,stats:s,reportPath:c}}function kG(e){const t=e.hypotheses;return!t||!Array.isArray(t)?null:t.map(n=>{var r;return{id:n.id,text:n.text,status:n.status??"pending",confidence:n.confidence??0,reasoning:n.reasoning,toolCallsUsed:n.toolCallsUsed,evidence:(r=n.evidence)==null?void 0:r.filter(i=>i.command||i.outputPreview)}})}function M0({status:e,className:t}){const n=U("w-4 h-4 shrink-0",t);switch(e){case"validated":return l.jsx(Hr,{className:U(n,"text-green-500")});case"invalidated":return l.jsx(ys,{className:U(n,"text-red-400")});case"inconclusive":return l.jsx(Ai,{className:U(n,"text-amber-500")});case"skipped":return l.jsx(hw,{className:U(n,"text-gray-400")});case"validating":return l.jsx(Le,{className:U(n,"text-blue-500 animate-spin")});case"pending":default:return l.jsx(os,{className:U(n,"text-gray-400")})}}const D0={validated:"VALIDATED",invalidated:"INVALIDATED",inconclusive:"INCONCLUSIVE",pending:"PENDING",skipped:"SKIPPED",validating:"VALIDATING"},jG={validated:"text-green-600",invalidated:"text-red-500",inconclusive:"text-amber-600",pending:"text-gray-500",skipped:"text-gray-400",validating:"text-blue-500"};function NG(){const e=m.useRef(Date.now()),[t,n]=m.useState(0);m.useEffect(()=>{const a=setInterval(()=>{n(Math.floor((Date.now()-e.current)/1e3))},1e3);return()=>clearInterval(a)},[]);const r=Math.floor(t/60),i=t%60;return l.jsxs("span",{className:"text-xs text-gray-400 font-mono tabular-nums",children:[r,":",i.toString().padStart(2,"0")]})}function CG({message:e,progress:t}){var g;const[n,r]=m.useState(!1),i=e.toolStatus==="running",a=e.toolStatus==="error",s=i?null:SG(e.content),o=e.toolDetails?kG(e.toolDetails):null,c=((g=e.toolDetails)==null?void 0:g.reportPath)??(s==null?void 0:s.reportPath),u=e.toolInput||"",f=(o??(s==null?void 0:s.hypotheses)??[]).slice().sort((y,x)=>y.status==="validated"&&x.status!=="validated"?-1:x.status==="validated"&&y.status!=="validated"?1:x.confidence-y.confidence);if(i){const y=t&&t.hypotheses.length>0;return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:"rounded-lg border border-blue-200 bg-blue-50/50 px-4 py-3 max-w-2xl",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Hn,{className:"w-4 h-4 text-blue-500 shrink-0"}),l.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Deep Investigation"}),(t==null?void 0:t.phase)&&l.jsx("span",{className:"text-xs font-medium px-1.5 py-0.5 rounded bg-blue-100 text-blue-700",children:t.phase}),l.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[l.jsx(NG,{}),l.jsx(Le,{className:"w-4 h-4 animate-spin text-blue-500"})]})]}),u&&l.jsxs("p",{className:"text-sm text-gray-600 mb-3 line-clamp-2",children:["“",u,"”"]}),y?l.jsx("div",{className:"space-y-1 mb-3",children:t.hypotheses.map(x=>l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(M0,{status:x.status,className:"mt-0.5"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("span",{className:"text-sm text-gray-700",children:[l.jsx("span",{className:"font-medium",children:x.id})," ",l.jsx("span",{className:"text-gray-600",children:x.text})]}),l.jsx("span",{className:U("text-xs font-medium ml-1.5",jG[x.status]||"text-gray-500"),children:x.status==="validating"&&x.lastAction?l.jsx("span",{className:"text-blue-500 font-mono",children:x.lastAction}):x.status==="validated"||x.status==="invalidated"||x.status==="inconclusive"?`${D0[x.status]||x.status} (${x.confidence}%)`:D0[x.status]||x.status})]})]},x.id))}):null,l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-blue-100/60 rounded-md",children:[l.jsx(Le,{className:"w-3.5 h-3.5 animate-spin text-blue-500 shrink-0"}),l.jsx("span",{className:"text-xs text-blue-700 font-mono truncate",children:(t==null?void 0:t.currentAction)||"Investigating hypotheses..."})]})]})})}if(a||!s)return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:"rounded-lg border border-red-200 bg-red-50/50 px-4 py-3 max-w-2xl",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Hn,{className:"w-4 h-4 text-red-500 shrink-0"}),l.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Deep Investigation"}),l.jsx(ys,{className:"w-4 h-4 text-red-500 ml-auto shrink-0"})]}),u&&l.jsxs("p",{className:"text-sm text-gray-600 mb-2",children:["“",u,"”"]}),l.jsx("pre",{className:"text-xs text-red-600 whitespace-pre-wrap bg-red-100/60 rounded-md px-3 py-2",children:e.content||"Investigation failed."})]})});const h=f.length>0,p=f.some(y=>y.evidence&&y.evidence.length>0);return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:U("rounded-lg border px-4 py-3 max-w-2xl transition-colors",h?"border-green-200 bg-green-50/50":"border-gray-200 bg-gray-50/50"),children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Hn,{className:U("w-4 h-4 shrink-0",h?"text-green-500":"text-gray-500")}),l.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Deep Investigation"}),l.jsxs("span",{className:U("ml-auto text-xs font-medium px-1.5 py-0.5 rounded flex items-center gap-1","bg-green-100 text-green-700"),children:[l.jsx(Hr,{className:"w-3 h-3"}),"Done"]})]}),(s==null?void 0:s.conclusion)&&l.jsx("div",{className:"mb-3 text-sm text-gray-700 leading-relaxed [&_p]:mb-1.5 [&_p:last-child]:mb-0 [&_strong]:text-gray-800 [&_ul]:list-disc [&_ul]:pl-4 [&_ol]:list-decimal [&_ol]:pl-4 [&_li]:mb-0.5",children:l.jsx(Pd,{children:s.conclusion})}),f.length>0&&l.jsx("div",{className:"space-y-1.5 mb-3",children:f.map(y=>{const x=y.status==="skipped"||y.status==="pending";return l.jsx("div",{children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(M0,{status:y.status,className:"mt-0.5"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-baseline gap-1.5",children:[l.jsx("span",{className:"text-sm font-medium text-gray-800 shrink-0",children:y.id}),l.jsx("span",{className:"text-sm text-gray-700 truncate",children:y.text}),l.jsxs("span",{className:U("text-xs font-semibold px-1.5 py-0.5 rounded shrink-0 ml-auto",y.status==="validated"?"bg-green-100 text-green-700":y.status==="invalidated"?"bg-red-100 text-red-600":y.status==="inconclusive"?"bg-amber-100 text-amber-700":"bg-gray-100 text-gray-500"),children:[y.confidence,"%"]})]}),!x&&y.reasoning&&l.jsx("p",{className:"text-xs text-gray-500 mt-0.5 leading-relaxed line-clamp-2",children:y.reasoning})]})]})},y.id)})}),n&&f.length>0&&l.jsx("div",{className:"border-t border-green-200 pt-3 mb-3 space-y-3",children:f.filter(y=>y.evidence&&y.evidence.length>0||y.toolCallsUsed).map(y=>l.jsxs("div",{className:"bg-white/70 rounded-md px-3 py-2 border border-gray-100",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(M0,{status:y.status}),l.jsxs("span",{className:"text-sm font-medium text-gray-800",children:[y.id,": ",y.text]}),l.jsxs("span",{className:U("ml-auto text-xs font-semibold px-1.5 py-0.5 rounded shrink-0",y.status==="validated"?"bg-green-100 text-green-700":y.status==="invalidated"?"bg-red-100 text-red-600":y.status==="inconclusive"?"bg-amber-100 text-amber-700":"bg-gray-100 text-gray-600"),children:[D0[y.status]," (",y.confidence,"%)"]})]}),y.evidence&&y.evidence.length>0&&l.jsxs("div",{className:"mt-2 space-y-1.5",children:[l.jsx("span",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-wider",children:"Evidence"}),y.evidence.map((x,b)=>l.jsxs("div",{className:"bg-gray-50 rounded px-2.5 py-1.5 border border-gray-100",children:[l.jsxs("div",{className:"font-mono text-[11px] text-gray-700 truncate",children:[l.jsxs("span",{className:"text-gray-400",children:[x.tool,":"]})," ",x.command]}),x.outputPreview&&l.jsx("pre",{className:"text-[11px] text-gray-500 mt-1 whitespace-pre-wrap line-clamp-3 leading-relaxed",children:x.outputPreview})]},b))]}),y.toolCallsUsed!=null&&l.jsxs("p",{className:"text-[11px] text-gray-400 mt-1.5",children:[y.toolCallsUsed," tool calls"]})]},y.id))}),l.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[(()=>{var x;const y=(s==null?void 0:s.stats.toolCalls)??((x=e.toolDetails)==null?void 0:x.totalToolCalls)??0;return y>0?l.jsxs("span",{children:[y," calls"]}):null})(),(()=>{var x;if(s!=null&&s.stats.duration)return l.jsx("span",{children:s.stats.duration});const y=(x=e.toolDetails)==null?void 0:x.durationMs;return y?l.jsxs("span",{children:[(y/1e3).toFixed(1),"s"]}):null})(),(s==null?void 0:s.stats.hypothesesSummary)&&l.jsx("span",{children:s.stats.hypothesesSummary})]}),p&&l.jsx("button",{type:"button",className:"flex items-center gap-1 text-xs text-gray-500 hover:text-gray-700 transition-colors cursor-pointer",onClick:()=>r(!n),children:n?l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"Collapse"}),l.jsx(dh,{className:"w-3.5 h-3.5"})]}):l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"Evidence"}),l.jsx(ea,{className:"w-3.5 h-3.5"})]})})]}),n&&c&&l.jsxs("div",{className:"mt-2 pt-2 border-t border-green-200",children:[l.jsx("span",{className:"text-xs text-gray-400",children:"Full report: "}),l.jsx("code",{className:"text-xs text-gray-500 bg-gray-100 px-1.5 py-0.5 rounded",children:c})]})]})})}function PG(e){if(!e)return[];const t=e.split(/\n---\s*\n/).filter(a=>a.trim());if(t.length>=2)return t.map((a,s)=>Nf(a.trim(),s+1));const n=e.split(/\n(?=#{2,3}\s*(?:Hypothesis|H)\s*\d)/i).filter(a=>a.trim());if(n.length>=2)return n.map((a,s)=>Nf(a.trim(),s+1));const r=e.split(/\n(?=#{2,3}\s*\d+[.)]\s)/).filter(a=>a.trim());if(r.length>=2){const a=o=>/^#{2,3}\s*\d+[.)]\s/m.test(o),s=r.filter(a);if(s.length>=2)return s.map((o,c)=>Nf(o.trim(),c+1))}const i=e.split(/\n(?=\*{2}(?:Hypothesis|H)\s*\d)/i).filter(a=>a.trim());if(i.length>=2){const a=o=>/\*{2}(?:Hypothesis|H)\s*\d/i.test(o),s=i.filter(a);if(s.length>=2)return s.map((o,c)=>Nf(o.trim(),c+1))}return EG(e)}function Nf(e,t){const n=e.split(`
587
+ `).map(o=>o.trim()).filter(Boolean);let r,i="",a="";const s=[];for(const o of n){const c=o.match(/^\*{2}(?:Hypothesis|H)\s*\d+[:\s]*(.*?)\*{2}\s*$/i);if(c){const g=c[1],y=g.match(/[(\uff08](?:confidence|置信度)[:\s:]*(\d+)\s*%[)\uff09]/i);y&&(r=parseInt(y[1],10)),i=Si(g.replace(/[(\uff08](?:confidence|置信度)[:\s:]*\d+\s*%[)\uff09]/i,"").trim());continue}const u=o.match(/^#{2,3}\s*(?:Hypothesis|H)\s*\d+[:\s]*(.*)/i);if(u){const g=u[1],y=g.match(/[(\uff08](?:confidence|置信度)[:\s:]*(\d+)\s*%[)\uff09]/i);y&&(r=parseInt(y[1],10)),i=Si(g.replace(/[(\uff08](?:confidence|置信度)[:\s:]*\d+\s*%[)\uff09]/i,"").trim());continue}const d=o.match(/^#{2,3}\s*\d+[.)]\s*(.*)/);if(d){const g=d[1],y=g.match(/[(\uff08](?:confidence|置信度)[:\s:]*(\d+)\s*%[)\uff09]/i);y&&(r=parseInt(y[1],10)),i=Si(g.replace(/[(\uff08](?:confidence|置信度)[:\s:]*\d+\s*%[)\uff09]/i,"").trim());continue}const f=o.match(/^\*{0,2}(?:confidence|置信度)\*{0,2}[:\s:]*(\d+)\s*%/i);if(f){r=parseInt(f[1],10);continue}if(o.match(/^\*{0,2}(?:validation tools?|verification tools?)\*{0,2}[:\s]/i))continue;if(o.match(/`(node_exec|pod_exec|bash|run_skill|node_script)[:\s]/)){s.push(Si(o));continue}const h=o.replace(/^[-*]\s+/,""),p=h.match(/^\*{0,2}(?:description|描述)\*{0,2}[:\s:]*(.*)/i);if(p&&p[1]){const g=Si(p[1]);i?a?s.push(g):a=g:i=g;continue}if(h.match(/^(?:\*{0,2})(?:validation method|validation|expected result|验证方法|验证|预期结果)(?:\*{0,2})[:\s:]/i)){s.push(Si(h));continue}if(!i&&h.length>10&&!h.startsWith("**Validation")&&!h.startsWith("**Confidence")&&!h.startsWith("**验证")&&!h.startsWith("**置信度")){i=Si(h);continue}if(i){const g=Si(h);g.length>5&&(a?s.push(g):a=g)}}if(r==null){const o=e.match(/(\d+)\s*%/);o&&(r=parseInt(o[1],10))}return{index:t,title:i||`Hypothesis ${t}`,confidence:r,description:a||void 0,detailLines:s}}function EG(e){const t=[],n=e.split(`
588
+ `);let r=null;for(const i of n){const a=i.trim();if(!a)continue;const s=a.match(/^(\d+)[.)]\s+(.+)/);if(s){r&&t.push(r);const o=Si(s[2]),c=o.match(/(\d+)\s*%/);r={index:parseInt(s[1],10),title:o.replace(/\(\d+%\)/,"").trim(),confidence:c?parseInt(c[1],10):void 0,detailLines:[]}}else if(r&&(a.startsWith("-")||a.startsWith("*")||/^\s/.test(i))){const o=Si(a.replace(/^[-*]\s+/,""));o.length>5&&r.detailLines.push(o)}}return r&&t.push(r),t}function Si(e){return e.replace(/\*{1,2}([^*]+)\*{1,2}/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/^[#\s]+/,"").trim()}function AG({message:e,sendMessage:t,abortResponse:n,onHypothesesConfirmed:r,superseded:i}){var P,A;const[a,s]=m.useState(!1),[o,c]=m.useState(""),[u,d]=m.useState(null),[f,h]=m.useState(!1),p=e.toolStatus==="running",g=e.toolStatus==="success"||!e.toolStatus&&!e.isStreaming,y=((P=e.toolDetails)==null?void 0:P.hypotheses)||e.toolInput||"",x=PG(y);if(i)return l.jsx("div",{className:"pl-12",children:l.jsx("div",{className:"rounded-lg border border-gray-200 bg-gray-50/50 px-4 py-2 max-w-2xl opacity-50",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Hn,{className:"w-4 h-4 text-gray-400 shrink-0"}),l.jsx("span",{className:"text-sm text-gray-500",children:"Hypotheses"}),l.jsxs("span",{className:"text-xs text-gray-400",children:[x.length," items"]}),l.jsx("span",{className:"ml-auto text-xs text-gray-400",children:"Superseded"})]})})});const b=g&&((A=e.toolDetails)==null?void 0:A.autoConfirmed)===!0,v=g&&!p&&!a&&!b&&!f,w=()=>{r&&x.length>0&&r(x.map(E=>({id:`H${E.index}`,text:E.title,confidence:E.confidence??0})))},k=()=>{t&&(t("The user has confirmed hypotheses. Please call deep_search to validate them."),h(!0),w())},S=()=>{o.trim()&&t&&(t(`User feedback: ${o.trim()}. Please revise the hypotheses based on this feedback, then call propose_hypotheses again to present the updated hypotheses and wait for user confirmation before calling deep_search.`),s(!1),c(""),h(!0))},j=()=>{n&&n()},N=E=>{d(u===E?null:E)};return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:U("rounded-lg border px-4 py-3 max-w-2xl transition-colors",g?"border-indigo-200 bg-indigo-50/50":"border-blue-200 bg-blue-50/50"),children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(Hn,{className:"w-4 h-4 text-indigo-500 shrink-0"}),l.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Deep Investigation"}),l.jsx("span",{className:"text-xs text-gray-500",children:"Hypothesis Review"}),g&&(b||f)&&l.jsxs("span",{className:"ml-auto text-xs font-medium px-1.5 py-0.5 rounded flex items-center gap-1 bg-indigo-100 text-indigo-700",children:[l.jsx(Hr,{className:"w-3 h-3"}),"Confirmed"]}),g&&!b&&!f&&!a&&l.jsx("span",{className:"ml-auto text-xs text-amber-600 font-medium px-1.5 py-0.5 rounded bg-amber-50",children:"Awaiting review"})]}),x.length>0?l.jsx("div",{className:"space-y-1 mb-3",children:x.map(E=>{const O=u===E.index,C=E.detailLines.length>0||E.description;return l.jsxs("div",{children:[l.jsxs("button",{type:"button",className:U("flex items-center gap-2 w-full text-left px-2 py-1.5 rounded-md transition-colors",C?"hover:bg-indigo-100/60 cursor-pointer":"cursor-default",O&&"bg-indigo-100/60"),onClick:()=>C&&N(E.index),children:[C?l.jsx(ua,{className:U("w-3 h-3 text-gray-400 shrink-0 transition-transform",O&&"rotate-90")}):l.jsx("span",{className:"w-3 shrink-0"}),l.jsx("span",{className:"text-xs font-semibold text-indigo-500 bg-indigo-100 rounded-full w-5 h-5 flex items-center justify-center shrink-0",children:E.index}),l.jsx("span",{className:"flex-1 text-sm text-gray-700 min-w-0 truncate",children:E.title}),E.confidence!=null&&l.jsxs("span",{className:U("text-xs font-semibold px-1.5 py-0.5 rounded shrink-0",E.confidence>=70?"bg-indigo-100 text-indigo-700":E.confidence>=40?"bg-blue-100 text-blue-600":"bg-gray-100 text-gray-500"),children:[E.confidence,"%"]})]}),O&&C&&l.jsxs("div",{className:"ml-10 pl-2 border-l-2 border-indigo-200 mt-1 mb-2 space-y-1",children:[E.description&&l.jsx("p",{className:"text-xs text-gray-600 leading-relaxed",children:E.description}),E.detailLines.map((M,I)=>l.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:M},I))]})]},E.index)})}):l.jsx("div",{className:"mb-3 text-sm text-gray-600",children:l.jsx(Pd,{children:y})}),a&&l.jsxs("div",{className:"mb-3 flex gap-2",children:[l.jsx("input",{type:"text",value:o,onChange:E=>c(E.target.value),onKeyDown:E=>E.key==="Enter"&&S(),placeholder:"Add/modify hypotheses...",className:"flex-1 text-sm border border-indigo-200 rounded-md px-3 py-1.5 focus:outline-none focus:ring-1 focus:ring-indigo-400",autoFocus:!0}),l.jsxs("button",{type:"button",onClick:S,disabled:!o.trim(),className:"text-xs font-medium px-3 py-1.5 rounded-md bg-indigo-600 text-white hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center gap-1 cursor-pointer",children:[l.jsx(fB,{className:"w-3 h-3"}),"Send"]}),l.jsx("button",{type:"button",onClick:()=>{s(!1),c("")},className:"text-xs font-medium px-2 py-1.5 rounded-md text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors cursor-pointer",children:l.jsx(Ze,{className:"w-3.5 h-3.5"})})]}),v&&l.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-indigo-100",children:[l.jsxs("button",{type:"button",onClick:k,className:"flex items-center gap-1 text-xs font-medium px-3 py-1.5 rounded-md bg-indigo-600 text-white hover:bg-indigo-700 transition-colors cursor-pointer",children:[l.jsx(Nm,{className:"w-3 h-3"}),"Confirm & Run"]}),l.jsxs("button",{type:"button",onClick:()=>s(!0),className:"flex items-center gap-1 text-xs font-medium px-2.5 py-1.5 rounded-md text-indigo-600 hover:bg-indigo-100 transition-colors cursor-pointer",children:[l.jsx(jm,{className:"w-3 h-3"}),"Modify"]}),l.jsxs("button",{type:"button",onClick:j,className:"flex items-center gap-1 text-xs font-medium px-2.5 py-1.5 rounded-md text-gray-500 hover:bg-gray-100 hover:text-red-600 transition-colors cursor-pointer",children:[l.jsx(Ze,{className:"w-3 h-3"}),"Cancel"]})]})]})})}function TG({status:e}){return e==="done"?l.jsx(Hr,{className:"w-4 h-4 text-green-500 shrink-0 mt-0.5"}):e==="in_progress"?l.jsx(Le,{className:"w-4 h-4 text-blue-500 animate-spin shrink-0 mt-0.5"}):e==="skipped"?l.jsx(hw,{className:"w-3.5 h-3.5 text-gray-400 shrink-0 mt-0.5"}):e==="error"?l.jsx(ys,{className:"w-4 h-4 text-red-500 shrink-0 mt-0.5"}):l.jsx(KO,{className:"w-4 h-4 text-gray-300 shrink-0 mt-0.5"})}function OG({status:e}){const t="w-3.5 h-3.5 shrink-0";switch(e){case"validated":return l.jsx(Hr,{className:U(t,"text-green-500")});case"invalidated":return l.jsx(ys,{className:U(t,"text-red-400")});case"inconclusive":return l.jsx(Ai,{className:U(t,"text-amber-500")});case"validating":return l.jsx(Le,{className:U(t,"text-blue-500 animate-spin")});case"skipped":return l.jsx(hw,{className:U(t,"text-gray-400")});default:return l.jsx(os,{className:U(t,"text-gray-300")})}}function _G({used:e,max:t}){const n=t>0?Math.min(100,Math.round(e/t*100)):0;return l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("div",{className:"flex-1 h-1 bg-gray-200 rounded-full overflow-hidden max-w-[80px]",children:l.jsx("div",{className:"h-full bg-blue-400 rounded-full transition-all",style:{width:`${n}%`}})}),l.jsxs("span",{className:"text-[10px] text-gray-400 font-mono tabular-nums",children:[e,"/",t]})]})}const qN={validated:"text-green-600",invalidated:"text-red-500",inconclusive:"text-amber-600",validating:"text-blue-500",pending:"text-gray-400",skipped:"text-gray-400"},MG={validated:"VALIDATED",invalidated:"INVALIDATED",inconclusive:"INCONCLUSIVE",validating:"validating...",pending:"pending",skipped:"SKIPPED"};function DG({h:e}){const t=e.status==="validated"||e.status==="invalidated"||e.status==="inconclusive"||e.status==="skipped",n=e.status==="validating";return l.jsxs("div",{className:U("flex items-start gap-1.5 py-0.5",t&&"opacity-70"),children:[l.jsx(OG,{status:e.status}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-baseline gap-1",children:[l.jsx("span",{className:U("text-xs font-medium shrink-0",n?"text-blue-700":t?"text-gray-500":"text-gray-600"),children:e.id}),l.jsx("span",{className:U("text-xs truncate",t?"text-gray-400":"text-gray-600"),children:e.text}),e.confidence>0&&l.jsxs("span",{className:U("text-[10px] font-semibold shrink-0 ml-auto",qN[e.status]||"text-gray-400"),children:[e.confidence,"%"]})]}),n&&l.jsxs("div",{className:"mt-0.5 space-y-0.5",children:[e.maxCalls>0&&l.jsx(_G,{used:e.callsUsed,max:e.maxCalls}),e.lastAction&&l.jsx("p",{className:"text-[10px] text-blue-500 font-mono truncate",children:e.lastAction})]}),t&&l.jsxs("span",{className:U("text-[10px] font-medium",qN[e.status]),children:[MG[e.status],e.callsUsed>0&&` · ${e.callsUsed} calls`]})]})]})}function IG({items:e,investigationProgress:t,onDismiss:n}){const r=e.filter(f=>f.status==="done"||f.status==="skipped").length,i=e.length,a=r===i,s=e.some(f=>f.status==="error"),o=e.find(f=>f.status==="in_progress")||e.find(f=>f.status==="pending"),c=e.find(f=>f.id==="deep_search"),u=(t==null?void 0:t.hypotheses)??[],d=((c==null?void 0:c.status)==="in_progress"||(c==null?void 0:c.status)==="done")&&u.length>0;return l.jsx("div",{className:"pl-12",children:l.jsxs("div",{className:U("rounded-lg border px-4 py-3 transition-colors max-w-lg",s?"border-red-200 bg-red-50/50":a?"border-green-200 bg-green-50/50":"border-indigo-200 bg-indigo-50/50"),children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx($u,{className:U("w-4 h-4 shrink-0",s?"text-red-500":a?"text-green-500":"text-indigo-500")}),l.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Deep Investigation"}),o&&!a&&o.status==="in_progress"&&l.jsx("span",{className:"text-xs text-gray-500",children:o.label}),l.jsxs("span",{className:U("ml-auto text-xs font-medium px-1.5 py-0.5 rounded",s?"bg-red-100 text-red-700":a?"bg-green-100 text-green-700":"bg-indigo-100 text-indigo-700"),children:[r,"/",i]}),n&&!a&&l.jsx("button",{onClick:()=>{window.confirm("Exit investigation? Current progress will be summarized.")&&n()},className:"ml-1 p-0.5 rounded hover:bg-gray-200 text-gray-400 hover:text-gray-600",title:"Exit investigation",children:l.jsx(Ze,{className:"w-3.5 h-3.5"})})]}),l.jsx("div",{className:"space-y-1.5",children:e.map(f=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(TG,{status:f.status}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("span",{className:U("text-sm leading-relaxed",f.status==="done"?"text-gray-400 line-through":f.status==="skipped"?"text-gray-400":f.status==="error"?"text-red-600 font-medium":f.status==="in_progress"?"text-gray-800 font-medium":"text-gray-600"),children:f.label}),f.summary&&(f.status==="done"||f.status==="skipped"||f.status==="error")&&l.jsx("p",{className:U("text-xs mt-0.5",f.status==="error"?"text-red-500":"text-gray-500"),style:{textDecoration:"none"},children:f.summary})]})]}),f.id==="deep_search"&&d&&l.jsxs("div",{className:"ml-6 mt-1.5 mb-1 pl-2 border-l-2 border-indigo-200 space-y-0.5",children:[u.map(h=>l.jsx(DG,{h},h.id)),(t==null?void 0:t.currentAction)&&l.jsxs("div",{className:"flex items-center gap-1.5 mt-1 px-2 py-1 bg-blue-50 rounded",children:[l.jsx(Le,{className:"w-3 h-3 animate-spin text-blue-400 shrink-0"}),l.jsx("span",{className:"text-[10px] text-blue-600 font-mono truncate",children:t.currentAction})]})]})]},f.id))})]})})}const LG=[{icon:Dl,title:"Skills",description:"Reusable diagnostic scripts for common SRE tasks"},{icon:$u,title:"Deep Investigation",description:"Hypothesis-driven root cause analysis with evidence"},{icon:mo,title:"Memory",description:"Remembers findings and context across sessions"},{icon:Uu,title:"Scheduled Jobs",description:"Automated health checks on a cron schedule"}],RG=["Check my cluster health","List available skills","What happened since my last session?"],YN="Introduce yourself and help me get started",FG={kubeconfig:"Kubeconfig",ssh_password:"SSH",ssh_key:"SSH Key",api_token:"API Token",api_basic_auth:"API Auth"};function zG({systemStatus:e,onSendPrompt:t,onNavigateModels:n,onNavigateCredentials:r}){const i=(e==null?void 0:e.hasProfile)===!1,a=(e==null?void 0:e.hasModels)??!1,s=(e==null?void 0:e.credentials)??{},o=Object.keys(s).length>0,c=(e==null?void 0:e.sessionCount)??0,u=a&&o&&c>0,d=f=>{if(!a){n();return}t(f)};return l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 max-w-2xl mx-auto space-y-8",children:[i&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-center space-y-2",children:[l.jsx("h1",{className:"text-2xl font-semibold text-gray-800",children:"Welcome to Siclaw"}),l.jsx("p",{className:"text-gray-500 text-sm",children:"Your personal SRE assistant that learns, remembers, and grows with you"})]}),e&&!u&&l.jsxs("div",{className:"w-full bg-white border border-gray-200 rounded-2xl shadow-sm p-5 space-y-3",children:[l.jsx("h2",{className:"text-sm font-semibold text-gray-700",children:"Getting Started"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(I0,{step:1,done:a,label:"Configure AI Model",subtitle:"Add a model provider to start chatting",onClick:n}),l.jsx(I0,{step:2,done:o,label:"Add Credentials",subtitle:"Connect to your clusters and servers via SSH or Kubeconfig",onClick:r}),l.jsx(I0,{step:3,done:c>0,label:"Start your first conversation",subtitle:"Ask Siclaw to diagnose an issue or run a skill"})]})]}),l.jsx("div",{className:"w-full grid grid-cols-2 gap-3",children:LG.map(f=>l.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-sm p-4 space-y-1.5",children:[l.jsx(f.icon,{className:"w-5 h-5 text-gray-400"}),l.jsx("p",{className:"text-sm font-medium text-gray-700",children:f.title}),l.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:f.description})]},f.title))}),u&&o&&l.jsx(XN,{credentials:s})]}),!i&&o&&l.jsx(XN,{credentials:s}),e&&l.jsxs("div",{className:"w-full space-y-3",children:[l.jsx("p",{className:"text-xs text-center text-gray-400",children:"Try asking"}),l.jsxs("div",{className:"flex flex-wrap gap-2 justify-center",children:[i&&l.jsx("button",{onClick:()=>d(YN),className:"rounded-full px-4 py-2 bg-blue-50 hover:bg-blue-100 border border-blue-200 text-sm text-blue-700 transition-colors",children:YN}),RG.map(f=>l.jsx("button",{onClick:()=>d(f),className:"rounded-full px-4 py-2 bg-gray-50 hover:bg-gray-100 border border-gray-200 text-sm text-gray-700 transition-colors",children:f},f))]}),!a&&l.jsx("p",{className:"text-xs text-center text-amber-600",children:"Configure a model first to start chatting"})]})]})}function I0({step:e,done:t,label:n,subtitle:r,onClick:i}){const a=l.jsxs("div",{className:"flex items-start gap-3",children:[t?l.jsx(Hr,{className:"w-5 h-5 text-green-500 mt-0.5 shrink-0"}):l.jsx(KO,{className:"w-5 h-5 text-gray-300 mt-0.5 shrink-0"}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("p",{className:`text-sm font-medium ${t?"text-gray-400":"text-gray-800"}`,children:[e,". ",n]}),l.jsx("p",{className:`text-xs mt-0.5 ${t?"text-gray-300":"text-gray-500"}`,children:r})]}),!t&&i&&l.jsx(WO,{className:"w-4 h-4 text-gray-400 mt-0.5 ml-auto shrink-0"})]});return i?l.jsx("button",{onClick:i,className:"w-full text-left px-3 py-2.5 rounded-xl hover:bg-gray-50 transition-colors",children:a}):l.jsx("div",{className:"px-3 py-2.5",children:a})}function XN({credentials:e}){const t=Object.entries(e);return t.length===0?null:l.jsxs("div",{className:"w-full bg-white border border-gray-200 rounded-2xl shadow-sm p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(Ql,{className:"w-4 h-4 text-gray-400"}),l.jsx("span",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Credentials"})]}),l.jsx("div",{className:"flex flex-wrap gap-2",children:t.map(([n,r])=>l.jsxs("span",{className:"inline-flex items-center text-xs bg-gray-50 text-gray-600 border border-gray-200 rounded-full px-2.5 py-1",children:[FG[n]||n," ×",r]},n))})]})}function $G(e){const t=new Map,n=new Map;for(const r of e){if(r.role!=="tool"||r.toolName!=="create_skill"&&r.toolName!=="update_skill")continue;let i=null;try{i=JSON.parse(r.content)}catch{continue}if(!(i!=null&&i.skill))continue;const a=i.skillId||i.skill.name;n.has(a)||n.set(a,[]),n.get(a).push(r.id);const s=r.metadata;(s==null?void 0:s.skillCard)==="saved"?t.set(r.id,"saved"):(s==null?void 0:s.skillCard)==="dismissed"?t.set(r.id,"dismissed"):t.set(r.id,"pending")}for(const[,r]of n){let i=-1;for(let a=r.length-1;a>=0;a--)if(t.get(r[a])==="pending"){i=a;break}for(let a=0;a<r.length;a++)t.get(r[a])==="pending"&&a!==i&&t.set(r[a],"superseded")}return t}function BG(e){var r;const t=new Map,n=new Map;for(const i of e){if(i.role!=="tool"||i.toolName!=="manage_schedule")continue;let a=null;try{a=JSON.parse(i.content)}catch{continue}if(!a)continue;const s=((r=a.schedule)==null?void 0:r.name)||a.id||i.id;n.has(s)||n.set(s,[]),n.get(s).push(i.id);const o=i.metadata;(o==null?void 0:o.scheduleCard)==="saved"?t.set(i.id,"saved"):(o==null?void 0:o.scheduleCard)==="dismissed"?t.set(i.id,"dismissed"):t.set(i.id,"pending")}for(const[,i]of n){let a=-1;for(let s=i.length-1;s>=0;s--)if(t.get(i[s])==="pending"){a=s;break}for(let s=0;s<i.length;s++)t.get(i[s])==="pending"&&s!==a&&t.set(i[s],"superseded")}return t}function UG({messages:e,isLoading:t,isLoadingHistory:n,wsStatus:r,isConnected:i,hasMore:a,isLoadingMore:s,sendMessage:o,abortResponse:c,loadMoreHistory:u,sendRpc:d,contextUsage:f,isCompacting:h,skills:p,editingSkill:g,onEditSkill:y,onClearEditSkill:x,onSkillSaved:b,onOpenSkillPanel:v,onOpenSchedulePanel:w,panelMessage:k,updateMessageMeta:S,pendingMessages:j,onRemovePending:N,investigationProgress:P,dpActive:A,onSetDpActive:E,dpFocus:O,dpChecklist:C,onHypothesesConfirmed:M,onExitDp:I,systemStatus:B,onNavigateModels:se,onNavigateCredentials:Q,sessionKey:D,selectedWorkspaceId:K}){const T=m.useRef(null),ie=m.useRef(null),J=m.useRef(0),_=m.useRef(0),H=m.useRef(!1),ee=m.useRef(!1),be=m.useRef(!1),te=m.useRef(null),ye=m.useRef(D);m.useEffect(()=>{ye.current!==D&&(ye.current=D,H.current=!1,_.current=0,ee.current=!0,be.current=!0,te.current&&(clearTimeout(te.current),te.current=null))},[D]),m.useEffect(()=>()=>{te.current&&clearTimeout(te.current)},[]);const Z=m.useCallback((F=!0)=>{requestAnimationFrame(()=>{var le;(le=T.current)==null||le.scrollIntoView(F?{behavior:"smooth"}:void 0)})},[]),ne=m.useMemo(()=>$G(e),[e]),ve=m.useMemo(()=>BG(e),[e]),L=m.useMemo(()=>{for(let F=e.length-1;F>=0;F--)if(e[F].toolName==="propose_hypotheses"&&!e[F].isStreaming)return e[F].id;return null},[e]);m.useEffect(()=>{const F=ie.current;if(F){if(J.current){const le=F.scrollHeight-J.current;le>0&&(F.scrollTop+=le),J.current=0}else if(ee.current&&e.length>0)ee.current=!1,H.current=!1,Z(!1);else if(_.current===0&&e.length>0)H.current=!1,Z(!1);else if(e.length>_.current){const le=e[e.length-1];(le==null?void 0:le.role)==="user"?(H.current=!1,Z(!1)):H.current||Z(!0)}else H.current||Z(!0);_.current=e.length}},[e,Z]),m.useEffect(()=>{if(be.current){if(H.current){be.current=!1,te.current&&(clearTimeout(te.current),te.current=null);return}e.length!==0&&(Z(!1),te.current&&clearTimeout(te.current),te.current=setTimeout(()=>{be.current=!1,te.current=null},180))}},[e.length,C==null?void 0:C.length,P==null?void 0:P.phase,P==null?void 0:P.hypotheses.length,P==null?void 0:P.currentAction,n,Z]);const W=m.useCallback(()=>{const F=ie.current;if(!F)return;const{scrollTop:le,scrollHeight:oe,clientHeight:Re}=F,We=oe-le-Re;H.current=We>300,H.current&&(be.current=!1,te.current&&(clearTimeout(te.current),te.current=null)),!(!a||s||!u)&&F.scrollTop<80&&(J.current=F.scrollHeight,u())},[a,s,u]);return l.jsxs("div",{className:"flex-1 flex flex-col h-full bg-white",children:[l.jsx("div",{className:"absolute top-4 right-16 z-30",children:l.jsxs("div",{className:U("flex items-center gap-1.5 px-2 py-1 rounded-full text-xs font-medium transition-colors",i?"bg-green-50 text-green-600":r==="connecting"?"bg-yellow-50 text-yellow-600":"bg-red-50 text-red-600"),children:[i?l.jsx(mw,{className:"w-3 h-3"}):r==="connecting"?l.jsx(Le,{className:"w-3 h-3 animate-spin"}):l.jsx(xB,{className:"w-3 h-3"}),l.jsx("span",{children:i?"Connected":r==="connecting"?"Connecting...":"Disconnected"})]})}),l.jsx("div",{ref:ie,className:"flex-1 overflow-y-auto px-4 lg:px-8 py-8",onScroll:W,children:l.jsxs("div",{className:"max-w-5xl mx-auto space-y-8",children:[n?l.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-gray-400",children:[l.jsx(Le,{className:"w-8 h-8 animate-spin text-gray-300 mb-4"}),l.jsx("p",{className:"text-sm",children:"Loading messages..."})]}):e.length===0?l.jsx(zG,{systemStatus:B??null,onSendPrompt:o,onNavigateModels:se??(()=>{}),onNavigateCredentials:Q??(()=>{})}):l.jsxs(l.Fragment,{children:[s&&l.jsx("div",{className:"flex justify-center py-2",children:l.jsx(Le,{className:"w-4 h-4 animate-spin text-gray-400"})}),!a&&e.length>0&&l.jsx("div",{className:"flex justify-center",children:l.jsx("span",{className:"text-xs font-semibold text-gray-400 bg-gray-100 px-3 py-1 rounded-full",children:"Start of conversation"})}),e.filter(F=>!F.hidden).map(F=>l.jsx(KG,{message:F,sendRpc:d,skills:p,editingSkill:g,onEditSkill:y,onSkillSaved:b,skillStatus:ne.get(F.id),scheduleStatus:ve.get(F.id),onOpenSkillPanel:v,onOpenSchedulePanel:w,updateMessageMeta:S,isInPanel:(k==null?void 0:k.id)===F.id,investigationProgress:P,sendMessage:o,abortResponse:c,dpFocus:O,onHypothesesConfirmed:M,hypothesesSuperseded:L!=null&&F.toolName==="propose_hypotheses"&&F.id!==L,selectedWorkspaceId:K},F.id)),C&&C.length>0&&l.jsx(IG,{items:C,investigationProgress:P,onDismiss:I}),t&&l.jsxs("div",{className:"flex gap-4",children:[l.jsx("div",{className:"w-8 h-8 rounded-full bg-white border border-gray-200 flex items-center justify-center text-primary-600 shadow-sm",children:l.jsx(mo,{className:"w-5 h-5"})}),l.jsxs("div",{className:"flex items-center gap-2 text-gray-400",children:[l.jsx(Le,{className:"w-4 h-4 animate-spin"}),l.jsx("span",{className:"text-sm",children:"Thinking..."})]})]})]}),l.jsx("div",{ref:T})]})}),l.jsx(xG,{onSend:o,onAbort:c,disabled:!i,isLoading:t,contextUsage:f,isCompacting:h,editingSkill:g,onClearEditSkill:x,skills:p,onEditSkill:y,pendingMessages:j,onRemovePending:N,dpFocus:O,dpActive:A,onSetDpActive:E})]})}function VG(e){const t=[],n=/\[User Script: ([^\s]+) \((\w+)\)\]\n*/g,r=e.replace(n,(i,a,s)=>(t.push({name:a,lang:s}),"")).trim();return{scripts:t,text:r}}function WG(e){const t=e.match(/\[Skill: ([^\]]+)\]\n*/);if(t)return{skillName:t[1],text:e.replace(t[0],"").trim()};const n=e.match(/\[Editing Skill: ([^\]]+)\]\n(?:.*\n)*?---\n*/);return n?{skillName:n[1],text:e.replace(n[0],"").trim()}:{skillName:null,text:e}}function HG(e){const t=e.match(/\[Deep Investigation\]\n*/);return t?{isDeepInvestigation:!0,text:e.replace(t[0],"").trim()}:{isDeepInvestigation:!1,text:e}}function KG({message:e,skills:t,onEditSkill:n,skillStatus:r,scheduleStatus:i,onOpenSkillPanel:a,onOpenSchedulePanel:s,sendRpc:o,updateMessageMeta:c,investigationProgress:u,sendMessage:d,abortResponse:f,dpFocus:h,onHypothesesConfirmed:p,hypothesesSuperseded:g,selectedWorkspaceId:y}){const x=e.role==="user";if(e.role==="tool")return(e.toolName==="create_skill"||e.toolName==="update_skill")&&!e.isStreaming?l.jsx(vG,{message:e,status:r??"pending",onOpenPanel:a}):e.toolName==="manage_schedule"&&!e.isStreaming?l.jsx(bG,{message:e,status:i??"pending",onOpenPanel:s,sendRpc:o,updateMessageMeta:c,selectedWorkspaceId:y}):e.toolName==="deep_search"?e.isStreaming&&h?null:l.jsx(CG,{message:e,progress:e.isStreaming?u:void 0}):e.toolName==="propose_hypotheses"&&!e.isStreaming?l.jsx(AG,{message:e,sendMessage:d,abortResponse:f,onHypothesesConfirmed:p,superseded:g}):l.jsx(GG,{message:e,skills:t,onEditSkill:n});const{isDeepInvestigation:v,text:w}=x?HG(e.content):{isDeepInvestigation:!1,text:e.content},{scripts:k,text:S}=x?VG(w):{scripts:[],text:w},{skillName:j,text:N}=x?WG(S):{skillName:null,text:S};return l.jsxs("div",{className:U("flex gap-4 group",x?"flex-row-reverse":"flex-row"),children:[l.jsx("div",{className:U("w-8 h-8 rounded-full flex items-center justify-center shrink-0 shadow-sm border",x?"bg-primary-600 border-primary-600 text-white":"bg-white border-gray-200 text-primary-600"),children:x?l.jsx(Vu,{className:"w-4 h-4"}):l.jsx(mo,{className:"w-5 h-5"})}),l.jsxs("div",{className:U("flex flex-col min-w-0",x?"items-end":"items-start"),children:[l.jsxs("div",{className:"flex items-baseline gap-2 mb-1",children:[l.jsx("span",{className:"text-sm font-semibold text-gray-900",children:x?"You":"Siclaw"}),l.jsx("span",{className:"text-xs text-gray-400",children:e.timestamp}),e.isStreaming&&!x&&l.jsx(Le,{className:"w-3 h-3 animate-spin text-gray-400"})]}),(v||j||k.length>0)&&l.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-1.5",children:[v&&l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-xs font-medium text-blue-700",children:[l.jsx($u,{className:"w-3.5 h-3.5 text-blue-500"}),l.jsx("span",{children:"Deep Investigation"}),h&&l.jsx("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-blue-100 text-blue-600 text-[10px] font-semibold uppercase",children:h})]}),j&&l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-indigo-50 border border-indigo-200 text-xs font-medium text-indigo-700",children:[l.jsx(Dl,{className:"w-3.5 h-3.5 text-indigo-500"}),l.jsx("span",{children:j})]}),k.map((P,A)=>l.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-primary-50 border border-primary-200 text-xs font-medium text-primary-800",children:[P.lang==="python"?l.jsx(Ka,{className:"w-3.5 h-3.5 text-blue-600"}):l.jsx(si,{className:"w-3.5 h-3.5 text-green-600"}),l.jsx("span",{children:P.name})]},A))]}),N&&l.jsx("div",{className:U("px-5 py-3.5 rounded-2xl text-[15px] leading-relaxed shadow-sm max-w-3xl min-w-0 overflow-hidden",x?"bg-primary-600 text-white rounded-tr-sm [&_pre]:bg-black/20 [&_pre]:text-white [&_code]:bg-white/15 [&_code]:text-white [&_a]:text-blue-200":"bg-white border border-gray-200 text-gray-800 rounded-tl-sm"),children:l.jsx(Pd,{children:N})})]})]})}function GG({message:e,skills:t,onEditSkill:n}){const[r,i]=m.useState(!1),a=e.isStreaming||r,s=(()=>{if(e.toolName!=="run_skill"||!t||!n)return null;const o=e.toolInput;return o?t.find(c=>c.scope==="personal"&&(c.name===o||c.dirName===o))??null:null})();return l.jsx("div",{className:"pl-12 min-w-0",children:l.jsxs("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm overflow-hidden",children:[l.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-4 py-2 bg-gray-50 border-b border-gray-200 hover:bg-gray-100 transition-colors cursor-pointer text-left min-w-0",onClick:()=>i(!r),children:[l.jsx(ua,{className:U("w-3.5 h-3.5 text-gray-400 transition-transform shrink-0",a&&"rotate-90")}),l.jsx(si,{className:"w-4 h-4 text-gray-500 shrink-0"}),l.jsx("span",{className:"font-mono text-xs font-semibold text-gray-700 shrink-0",children:e.toolName}),e.toolInput&&l.jsx("span",{className:"font-mono text-xs text-gray-500 truncate min-w-0",children:e.toolInput}),e.toolStatus==="running"&&l.jsx(Le,{className:"w-3 h-3 animate-spin text-blue-400 ml-auto shrink-0"}),e.toolStatus==="success"&&l.jsx(Hr,{className:"w-3.5 h-3.5 text-green-500 ml-auto shrink-0"}),e.toolStatus==="error"&&l.jsx(ys,{className:"w-3.5 h-3.5 text-red-500 ml-auto shrink-0"}),e.toolStatus==="aborted"&&l.jsx(HO,{className:"w-3.5 h-3.5 text-amber-500 ml-auto shrink-0"}),s&&!e.isStreaming&&l.jsx("span",{className:"ml-auto shrink-0 p-1 rounded hover:bg-indigo-100 text-gray-400 hover:text-indigo-600 transition-colors",title:"Edit this skill",onClick:o=>{o.stopPropagation(),n(String(s.id),s.name)},children:l.jsx(Sd,{className:"w-3.5 h-3.5"})})]}),a&&l.jsxs("div",{className:"overflow-x-auto bg-slate-50 max-h-80 overflow-y-auto",children:[e.toolInput&&l.jsx("div",{className:"px-4 pt-3 pb-2 border-b border-slate-200",children:l.jsx("pre",{className:"text-xs font-mono leading-relaxed text-slate-800 whitespace-pre-wrap break-all",children:e.toolInput})}),l.jsx("div",{className:"p-4",children:l.jsx("pre",{className:"text-xs font-mono leading-relaxed text-slate-600 whitespace-pre-wrap",children:e.content||(e.toolStatus==="aborted"?"Aborted.":"Running...")})})]})]})})}class qG{diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const a=this.castInput(t,r),s=this.castInput(n,r),o=this.removeEmpty(this.tokenize(a,r)),c=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(o,c,r,i)}diffWithOptionsObj(t,n,r,i){var a;const s=v=>{if(v=this.postProcess(v,r),i){setTimeout(function(){i(v)},0);return}else return v},o=n.length,c=t.length;let u=1,d=o+c;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));const f=(a=r.timeout)!==null&&a!==void 0?a:1/0,h=Date.now()+f,p=[{oldPos:-1,lastComponent:void 0}];let g=this.extractCommon(p[0],n,t,0,r);if(p[0].oldPos+1>=c&&g+1>=o)return s(this.buildValues(p[0].lastComponent,n,t));let y=-1/0,x=1/0;const b=()=>{for(let v=Math.max(y,-u);v<=Math.min(x,u);v+=2){let w;const k=p[v-1],S=p[v+1];k&&(p[v-1]=void 0);let j=!1;if(S){const P=S.oldPos-v;j=S&&0<=P&&P<o}const N=k&&k.oldPos+1<c;if(!j&&!N){p[v]=void 0;continue}if(!N||j&&k.oldPos<S.oldPos?w=this.addToPath(S,!0,!1,0,r):w=this.addToPath(k,!1,!0,1,r),g=this.extractCommon(w,n,t,v,r),w.oldPos+1>=c&&g+1>=o)return s(this.buildValues(w.lastComponent,n,t))||!0;p[v]=w,w.oldPos+1>=c&&(x=Math.min(x,v-1)),g+1>=o&&(y=Math.max(y,v+1))}u++};if(i)(function v(){setTimeout(function(){if(u>d||Date.now()>h)return i(void 0);b()||v()},0)})();else for(;u<=d&&Date.now()<=h;){const v=b();if(v)return v}}addToPath(t,n,r,i,a){const s=t.lastComponent;return s&&!a.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(t,n,r,i,a){const s=n.length,o=r.length;let c=t.oldPos,u=c-i,d=0;for(;u+1<s&&c+1<o&&this.equals(r[c+1],n[u+1],a);)u++,c++,d++,a.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!a.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const i=[];let a;for(;t;)i.push(t),a=t.previousComponent,delete t.previousComponent,t=a;i.reverse();const s=i.length;let o=0,c=0,u=0;for(;o<s;o++){const d=i[o];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=n.slice(c,c+d.count);f=f.map(function(h,p){const g=r[u+p];return g.length>h.length?g:h}),d.value=this.join(f)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}}class YG extends qG{constructor(){super(...arguments),this.tokenize=ZG}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
589
+ `))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
590
+ `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
591
+ `)&&(t=t.slice(0,-1)),n.endsWith(`
592
+ `)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const XG=new YG;function zx(e,t,n){return XG.diff(e,t,n)}function ZG(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
593
+ `));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i<r.length;i++){const a=r[i];i%2&&!t.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n}function QG({message:e,sendRpc:t,skills:n,onSave:r,onDismiss:i,onClose:a,updateMessageMeta:s}){const o=e.metadata,c=o==null?void 0:o.skillCard,u=o==null?void 0:o.reviewStatus,d=c==="saved"||c==="dismissed"?"saved":"idle",[f,h]=m.useState(d),[p,g]=m.useState(""),[y,x]=m.useState(d==="saved"?"Saved":""),[b,v]=m.useState(u),[w,k]=m.useState(null),[S,j]=m.useState(!1),[N,P]=m.useState(new Set),[A,E]=m.useState(!0);let O=null;try{O=JSON.parse(e.content)}catch{}const C=O==null?void 0:O.skill,M=e.toolName==="update_skill",I=e.toolName==="fork_skill"||!!(O!=null&&O.fork),B=C?n.find(te=>te.name===C.name&&te.scope==="personal")??n.find(te=>te.name===C.name)??(O!=null&&O.skillId?n.find(te=>te.name===O.skillId&&te.scope==="personal")??n.find(te=>te.name===O.skillId):void 0):void 0,se=I?n.find(te=>te.name===((O==null?void 0:O.sourceSkillName)??(C==null?void 0:C.name))&&te.scope!=="personal")??n.find(te=>te.name===((O==null?void 0:O.sourceSkillName)??(C==null?void 0:C.name))):void 0,Q=B?String(B.id):(O==null?void 0:O.skillId)||void 0,D=!M&&!I?B:void 0,K=!!D;m.useEffect(()=>{(c==="saved"||c==="dismissed")&&(h("saved"),x(c==="saved"?"Saved":"Dismissed"))},[c]),m.useEffect(()=>{const te=M?Q:I&&se?String(se.id):void 0;!te||!t||(j(!0),t("skill.get",{id:te}).then(ye=>{k(ye.files??null)}).catch(()=>k(null)).finally(()=>j(!1)))},[M,I,Q,se,t]);const T=M||I&&!!w,ie=m.useMemo(()=>{if(!T||!(C!=null&&C.specs)||!(w!=null&&w.specs))return null;const te=zx(w.specs??"",C.specs??"");return te.every(ye=>!ye.added&&!ye.removed)?null:te},[T,C==null?void 0:C.specs,w==null?void 0:w.specs]),J=m.useMemo(()=>{if(!T||!(C!=null&&C.scripts))return null;const te=new Map(((w==null?void 0:w.scripts)??[]).map(Z=>[Z.name,Z.content])),ye=[];for(const Z of C.scripts){const ne=te.get(Z.name);if(!ne)ye.push({name:Z.name,status:"new"});else{const ve=zx(ne??"",Z.content??""),L=ve.some(W=>W.added||W.removed);ye.push({name:Z.name,status:L?"changed":"unchanged",changes:L?ve:void 0})}}return ye},[M,C==null?void 0:C.scripts,w==null?void 0:w.scripts]),_=M&&ie===null&&(J==null?void 0:J.every(te=>te.status==="unchanged")),H=()=>{if(!C)return"";let te=2,ye=`${C.name}-${te}`;for(;n.some(Z=>Z.name===ye);)te++,ye=`${C.name}-${te}`;return ye},ee=async te=>{var ye;if(C){h("saving"),g(""),x("");try{const Z=(ye=C.scripts)==null?void 0:ye.map(ve=>({name:ve.name,content:ve.content}));let ne;if(I&&te!=="create-new-name"){const ve=se?String(se.id):void 0;if(!ve)throw new Error(`Source skill "${(O==null?void 0:O.sourceSkillName)??C.name}" not found`);ne=(await t("skill.fork",{sourceId:ve,name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:Z})).reviewStatus,x("Forked to Personal")}else if(te==="update")B&&B.scope!=="personal"?(ne=(await t("skill.fork",{sourceId:String(B.id),name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:Z})).reviewStatus,x("Saved to Personal")):(ne=(await t("skill.update",{id:Q,name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:Z})).reviewStatus,x("Updated"));else if(te==="update-existing"&&D)D.scope==="personal"?(ne=(await t("skill.update",{id:String(D.id),name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:Z})).reviewStatus,x("Updated")):(ne=(await t("skill.fork",{sourceId:String(D.id),name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:Z})).reviewStatus,x("Saved to Personal"));else if(te==="create-new-name"){const ve=H();ne=(await t("skill.create",{name:ve,description:C.description,type:C.type,specs:C.specs,scripts:Z})).reviewStatus,x(`Saved as "${ve}"`)}else ne=(await t("skill.create",{name:C.name,description:C.description,type:C.type,specs:C.specs,scripts:Z})).reviewStatus,x("Saved");v(ne),h("saved"),await s(e.id,{skillCard:"saved",reviewStatus:ne}),r(e)}catch(Z){h("error"),g((Z==null?void 0:Z.message)||"Failed to save skill")}}},be=async()=>{await s(e.id,{skillCard:"dismissed"}),i(e)};return C?l.jsxs("div",{className:"w-[480px] border-l border-gray-200 bg-white flex flex-col shrink-0 h-full",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 bg-gradient-to-r from-indigo-50 to-purple-50 flex items-center justify-between shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(Dl,{className:"w-4 h-4 text-indigo-600 shrink-0"}),l.jsx("span",{className:"font-semibold text-sm text-gray-900 truncate",children:C.name}),C.type&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium bg-indigo-100 text-indigo-700 shrink-0",children:[l.jsx(pw,{className:"w-2.5 h-2.5"}),C.type]})]}),l.jsx("button",{onClick:a,className:"p-1 rounded hover:bg-white/60 transition-colors shrink-0",children:l.jsx(Ze,{className:"w-4 h-4 text-gray-500"})})]}),C.description&&l.jsx("div",{className:"px-4 py-2 border-b border-gray-100 text-xs text-gray-600",children:C.description}),l.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:S?l.jsxs("div",{className:"flex items-center justify-center py-12 text-gray-400",children:[l.jsx(Le,{className:"w-5 h-5 animate-spin mr-2"}),l.jsx("span",{className:"text-sm",children:"Loading current version..."})]}):_?l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-gray-400",children:[l.jsx($n,{className:"w-8 h-8 mb-2 text-green-400"}),l.jsx("span",{className:"text-sm font-medium text-green-600",children:"Already up to date"}),l.jsx("span",{className:"text-xs text-gray-400 mt-1",children:"No changes detected"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"border-b border-gray-100",children:[l.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-4 py-2.5 hover:bg-gray-50 transition-colors text-left",onClick:()=>E(!A),children:[l.jsx(ua,{className:U("w-3.5 h-3.5 text-gray-400 transition-transform",A&&"rotate-90")}),l.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider",children:"SKILL.md"}),M&&ie&&l.jsx("span",{className:"ml-auto text-[10px] font-medium text-amber-600 bg-amber-50 px-1.5 py-0.5 rounded",children:"changed"})]}),A&&l.jsx("div",{className:"px-4 pb-3 max-h-96 overflow-y-auto",children:M&&ie?l.jsx(ZN,{changes:ie}):l.jsx("pre",{className:"text-xs font-mono leading-relaxed text-gray-600 whitespace-pre-wrap",children:C.specs})})]}),C.scripts&&C.scripts.length>0&&l.jsxs("div",{className:"border-b border-gray-100",children:[l.jsx("div",{className:"px-4 py-2.5",children:l.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Scripts"})}),C.scripts.map((te,ye)=>{const Z=J==null?void 0:J[ye],ne=N.has(te.name);return l.jsxs("div",{className:"border-t border-gray-50",children:[l.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-4 py-2 hover:bg-gray-50 transition-colors text-left",onClick:()=>P(ve=>{const L=new Set(ve);return L.has(te.name)?L.delete(te.name):L.add(te.name),L}),children:[l.jsx(ua,{className:U("w-3 h-3 text-gray-400 transition-transform",ne&&"rotate-90")}),te.name.endsWith(".py")?l.jsx(Ka,{className:"w-3.5 h-3.5 text-blue-500"}):l.jsx(si,{className:"w-3.5 h-3.5 text-green-500"}),l.jsx("span",{className:"text-xs font-mono text-gray-700",children:te.name}),Z&&l.jsx("span",{className:U("ml-auto text-[10px] font-medium px-1.5 py-0.5 rounded",Z.status==="new"?"text-green-600 bg-green-50":Z.status==="changed"?"text-amber-600 bg-amber-50":"text-gray-400 bg-gray-50"),children:Z.status})]}),ne&&l.jsx("div",{className:"px-4 pb-3 max-h-64 overflow-y-auto",children:Z!=null&&Z.changes?l.jsx(ZN,{changes:Z.changes}):l.jsx("pre",{className:"text-xs font-mono leading-relaxed text-gray-600 whitespace-pre-wrap",children:te.content})})]},te.name)})]})]})}),f==="idle"&&K&&l.jsxs("div",{className:"px-4 py-2 bg-amber-50 border-t border-amber-200 flex items-start gap-2 shrink-0",children:[l.jsx(Ai,{className:"w-3.5 h-3.5 text-amber-500 shrink-0 mt-0.5"}),l.jsxs("span",{className:"text-xs text-amber-800",children:["A ",D.scope," skill named ",l.jsxs("strong",{children:['"',C.name,'"']})," already exists."]})]}),f==="saved"&&b==="draft"&&l.jsxs("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-200 flex items-start gap-2 shrink-0",children:[l.jsx(km,{className:"w-3.5 h-3.5 text-gray-400 shrink-0 mt-0.5"}),l.jsx("span",{className:"text-xs text-gray-600",children:"Saved as draft. Available in test environments. Request publish to use in production."})]}),l.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 bg-gray-50/80 flex items-center justify-between shrink-0",children:[l.jsx("button",{onClick:be,disabled:f==="saving",className:"px-3 py-1.5 rounded-lg text-xs font-medium text-gray-600 hover:bg-gray-200 transition-colors",children:"Dismiss"}),l.jsxs("div",{className:"flex items-center gap-2",children:[f==="idle"&&!_&&(()=>{if(I&&se){const te=n.some(ye=>ye.name===C.name&&ye.scope==="personal");return l.jsxs("button",{onClick:()=>ee(te?"create-new-name":"create"),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-purple-600 text-white hover:bg-purple-700 transition-colors shadow-sm",children:[l.jsx(sw,{className:"w-3.5 h-3.5"}),"Fork to Personal"]})}if(M&&Q){const te=B&&B.scope!=="personal";return l.jsx("button",{onClick:()=>ee("update"),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-indigo-600 text-white hover:bg-indigo-700 transition-colors shadow-sm",children:te?l.jsxs(l.Fragment,{children:[l.jsx(kx,{className:"w-3.5 h-3.5"})," Save to Personal"]}):l.jsxs(l.Fragment,{children:[l.jsx(Wn,{className:"w-3.5 h-3.5"})," Update Skill"]})})}return K?l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>ee("update-existing"),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-amber-600 text-white hover:bg-amber-700 transition-colors shadow-sm",children:D.scope==="personal"?l.jsxs(l.Fragment,{children:[l.jsx(Wn,{className:"w-3.5 h-3.5"})," Update Existing"]}):l.jsxs(l.Fragment,{children:[l.jsx(kx,{className:"w-3.5 h-3.5"})," Save to Personal"]})}),l.jsx("button",{onClick:()=>ee("create-new-name"),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-gray-700 hover:bg-gray-100 border border-gray-300 transition-colors",children:"Save as New"})]}):l.jsxs("button",{onClick:()=>ee("create"),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-indigo-600 text-white hover:bg-indigo-700 transition-colors shadow-sm",children:[l.jsx(Wn,{className:"w-3.5 h-3.5"}),"Save Skill"]})})(),f==="idle"&&_&&l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-green-600",children:[l.jsx($n,{className:"w-3.5 h-3.5"}),"Up to date"]}),f==="saving"&&l.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-indigo-600",children:[l.jsx(Le,{className:"w-3.5 h-3.5 animate-spin"}),"Saving..."]}),f==="saved"&&l.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-green-600",children:[l.jsx($n,{className:"w-3.5 h-3.5"}),y||"Saved"]}),f==="error"&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-red-600",children:[l.jsx(zu,{className:"w-3.5 h-3.5"}),p]}),l.jsx("button",{onClick:()=>{h("idle"),g("")},className:"px-2.5 py-1 rounded-lg text-xs font-medium text-red-600 hover:bg-red-50 border border-red-200 transition-colors",children:"Retry"})]})]})]})]}):l.jsx("div",{className:"w-[480px] border-l border-gray-200 bg-white flex flex-col shrink-0",children:l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Invalid skill data"}),l.jsx("button",{onClick:a,className:"p-1 rounded hover:bg-gray-100",children:l.jsx(Ze,{className:"w-4 h-4 text-gray-400"})})]})})}function ZN({changes:e}){return l.jsx("pre",{className:"text-xs font-mono leading-relaxed whitespace-pre-wrap",children:e.map((t,n)=>l.jsx("span",{className:U(t.added&&"bg-green-100 text-green-800",t.removed&&"bg-red-100 text-red-800 line-through",!t.added&&!t.removed&&"text-gray-500"),children:t.value},n))})}async function Oc(e,t,n){try{const r=await e("cron.list");if(t)return r.jobs.find(i=>i.id===t)??null;if(n){const i=n.toLowerCase(),a=r.jobs.find(c=>c.name===n);if(a)return a;const s=r.jobs.find(c=>c.name.toLowerCase()===i);if(s)return s;const o=r.jobs.find(c=>c.name.toLowerCase().includes(i)||i.includes(c.name.toLowerCase()));if(o)return o}return r.jobs.length===1?r.jobs[0]:null}catch{return null}}function JG({message:e,sendRpc:t,onSave:n,onDismiss:r,onClose:i,updateMessageMeta:a,selectedWorkspaceId:s}){var H;const o=(H=e.metadata)==null?void 0:H.scheduleCard,c=o==="saved"||o==="dismissed"?"saved":"idle",[u,d]=m.useState(c),[f,h]=m.useState(""),[p,g]=m.useState(null),[y,x]=m.useState(!1),[b,v]=m.useState(!0),[w,k]=m.useState(!0);let S=null;try{S=JSON.parse(e.content)}catch{}const j=S==null?void 0:S.action,N=S==null?void 0:S.schedule,P=j==="create",A=j==="update",E=j==="delete",O=j==="pause",C=j==="resume",M=j==="rename",I=M?(S==null?void 0:S.name)||(S==null?void 0:S.id)||"...":(N==null?void 0:N.name)||(S==null?void 0:S.name)||(S==null?void 0:S.id)||"...";m.useEffect(()=>{(o==="saved"||o==="dismissed")&&d("saved")},[o]);const B=m.useRef(!1);m.useEffect(()=>{if(B.current||u!=="idle")return;const ee=e.metadata;ee!=null&&ee.scheduleCard||(O||C)&&(B.current=!0,T())},[O,C,u]),m.useEffect(()=>{!A||!t||(x(!0),Oc(t,S==null?void 0:S.id,(S==null?void 0:S.name)??(N==null?void 0:N.name)).then(ee=>g(ee)).catch(()=>g(null)).finally(()=>x(!1)))},[A,S==null?void 0:S.id,S==null?void 0:S.name,N==null?void 0:N.name,t]);const se=A&&p&&N&&p.schedule!==N.schedule,Q=A&&p&&N&&p.status!==N.status,D=m.useMemo(()=>{if(!A||!p||!N)return null;const ee=p.description??"",be=N.description??"";if(ee===be)return null;const te=zx(ee,be);return te.every(ye=>!ye.added&&!ye.removed)?null:te},[A,p,N]),K=A&&p&&!se&&!Q&&!D,T=async()=>{if(S){if(!s){d("error"),h("Please select a workspace first");return}d("saving"),h("");try{if(P&&N)await t("cron.save",{name:N.name,description:N.description,schedule:N.schedule,status:N.status||"active",workspaceId:s??null});else if(A&&N){const ee=await Oc(t,S.id,S.name);if(!ee)throw new Error("Schedule not found");await t("cron.save",{id:ee.id,name:N.name,description:N.description,schedule:N.schedule,status:N.status||"active",workspaceId:s??null})}else if(E){const ee=await Oc(t,S.id,S.name);if(!ee)throw new Error("Schedule not found");await t("cron.delete",{id:ee.id})}else if(O||C){const ee=await Oc(t,S.id,S.name);if(!ee)throw new Error("Schedule not found");await t("cron.setStatus",{id:ee.id,status:O?"paused":"active"})}else if(M){const ee=await Oc(t,S.id,S.name);if(!ee)throw new Error("Schedule not found");await t("cron.rename",{id:ee.id,newName:S.newName})}d("saved"),await a(e.id,{scheduleCard:"saved"}),n(e)}catch(ee){d("error"),h((ee==null?void 0:ee.message)||"Operation failed")}}},ie=async()=>{await a(e.id,{scheduleCard:"dismissed"}),r(e)};if(!S||S.error)return l.jsx("div",{className:"w-[480px] border-l border-gray-200 bg-white flex flex-col shrink-0",children:l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Invalid schedule data"}),l.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-gray-100",children:l.jsx(Ze,{className:"w-4 h-4 text-gray-400"})})]})});const J=eq(j);return O||C?l.jsxs("div",{className:"w-[320px] border-l border-gray-200 bg-white flex flex-col shrink-0",children:[l.jsxs("div",{className:U("px-4 py-3 border-b border-gray-200 bg-gradient-to-r flex items-center justify-between shrink-0",J.gradient),children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(os,{className:U("w-4 h-4 shrink-0",J.iconColor)}),l.jsx("span",{className:"font-semibold text-sm text-gray-900 truncate",children:I})]}),l.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-white/60 transition-colors shrink-0",children:l.jsx(Ze,{className:"w-4 h-4 text-gray-500"})})]}),l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 px-4",children:[u==="saving"&&l.jsxs(l.Fragment,{children:[l.jsx(Le,{className:U("w-8 h-8 mb-3 animate-spin",J.iconColor)}),l.jsx("span",{className:"text-sm text-gray-600",children:O?"Pausing...":"Resuming..."})]}),u==="saved"&&l.jsxs(l.Fragment,{children:[l.jsx($n,{className:"w-8 h-8 mb-3 text-green-500"}),l.jsx("span",{className:"text-sm font-medium text-green-600",children:O?"Schedule paused":"Schedule resumed"})]}),u==="error"&&l.jsxs(l.Fragment,{children:[l.jsx(zu,{className:"w-8 h-8 mb-3 text-red-500"}),l.jsx("span",{className:"text-sm font-medium text-red-600",children:f}),l.jsx("button",{onClick:()=>{d("idle"),h(""),B.current=!1},className:"mt-3 px-3 py-1.5 rounded-lg text-xs font-medium text-red-600 hover:bg-red-50 border border-red-200",children:"Retry"})]}),u==="idle"&&l.jsxs(l.Fragment,{children:[l.jsx(Le,{className:U("w-8 h-8 mb-3 animate-spin",J.iconColor)}),l.jsx("span",{className:"text-sm text-gray-500",children:"Preparing..."})]})]})]}):l.jsxs("div",{className:"w-[480px] border-l border-gray-200 bg-white flex flex-col shrink-0 h-full",children:[l.jsxs("div",{className:U("px-4 py-3 border-b border-gray-200 bg-gradient-to-r flex items-center justify-between shrink-0",J.gradient),children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(os,{className:U("w-4 h-4 shrink-0",J.iconColor)}),l.jsx("span",{className:"font-semibold text-sm text-gray-900 truncate",children:I}),l.jsxs("span",{className:U("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium shrink-0",J.badgeColor),children:[l.jsx(pw,{className:"w-2.5 h-2.5"}),J.badge]})]}),l.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-white/60 transition-colors shrink-0",children:l.jsx(Ze,{className:"w-4 h-4 text-gray-500"})})]}),S.summary&&l.jsx("div",{className:"px-4 py-2 border-b border-gray-100 text-xs text-gray-600",children:S.summary}),l.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:y?l.jsxs("div",{className:"flex items-center justify-center py-12 text-gray-400",children:[l.jsx(Le,{className:"w-5 h-5 animate-spin mr-2"}),l.jsx("span",{className:"text-sm",children:"Loading current version..."})]}):K?l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-gray-400",children:[l.jsx($n,{className:"w-8 h-8 mb-2 text-green-400"}),l.jsx("span",{className:"text-sm font-medium text-green-600",children:"Already up to date"}),l.jsx("span",{className:"text-xs text-gray-400 mt-1",children:"No changes detected"})]}):l.jsxs(l.Fragment,{children:[(N||M)&&l.jsxs("div",{className:"border-b border-gray-100",children:[l.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-4 py-2.5 hover:bg-gray-50 transition-colors text-left",onClick:()=>v(!b),children:[l.jsx(ua,{className:U("w-3.5 h-3.5 text-gray-400 transition-transform",b&&"rotate-90")}),l.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Schedule"}),A&&(se||Q)&&l.jsx("span",{className:"ml-auto text-[10px] font-medium text-amber-600 bg-amber-50 px-1.5 py-0.5 rounded",children:"changed"})]}),b&&l.jsxs("div",{className:"px-4 pb-3 space-y-3",children:[N&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-medium text-gray-400 uppercase tracking-wider",children:"Cron Expression"}),A&&se&&p?l.jsxs("div",{className:"mt-1 space-y-1",children:[l.jsx("div",{className:"font-mono text-xs bg-red-50 text-red-700 px-2 py-1 rounded line-through",children:p.schedule}),l.jsx("div",{className:"font-mono text-xs bg-green-50 text-green-700 px-2 py-1 rounded",children:N.schedule})]}):l.jsx("div",{className:"font-mono text-xs text-gray-700 bg-gray-50 px-2 py-1 rounded mt-1",children:N.schedule})]}),N&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-medium text-gray-400 uppercase tracking-wider",children:"Status"}),A&&Q&&p?l.jsxs("div",{className:"mt-1 space-y-1",children:[l.jsx("div",{className:"text-xs bg-red-50 text-red-700 px-2 py-1 rounded line-through",children:p.status}),l.jsx("div",{className:"text-xs bg-green-50 text-green-700 px-2 py-1 rounded",children:N.status})]}):l.jsx("div",{className:"text-xs text-gray-700 bg-gray-50 px-2 py-1 rounded mt-1",children:N.status||"active"})]}),M&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-medium text-gray-400 uppercase tracking-wider",children:"Name"}),l.jsxs("div",{className:"mt-1 space-y-1",children:[l.jsx("div",{className:"text-xs bg-red-50 text-red-700 px-2 py-1 rounded line-through",children:(S==null?void 0:S.name)||(S==null?void 0:S.id)}),l.jsx("div",{className:"text-xs bg-green-50 text-green-700 px-2 py-1 rounded",children:S==null?void 0:S.newName})]})]})]})]}),((N==null?void 0:N.description)||A&&(p==null?void 0:p.description))&&l.jsxs("div",{className:"border-b border-gray-100",children:[l.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-4 py-2.5 hover:bg-gray-50 transition-colors text-left",onClick:()=>k(!w),children:[l.jsx(ua,{className:U("w-3.5 h-3.5 text-gray-400 transition-transform",w&&"rotate-90")}),l.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Description"}),D&&l.jsx("span",{className:"ml-auto text-[10px] font-medium text-amber-600 bg-amber-50 px-1.5 py-0.5 rounded",children:"changed"})]}),w&&l.jsx("div",{className:"px-4 pb-3",children:D?l.jsx(tq,{changes:D}):l.jsx("pre",{className:"text-xs font-mono leading-relaxed text-gray-600 whitespace-pre-wrap",children:(N==null?void 0:N.description)||(p==null?void 0:p.description)||""})})]}),E&&!N&&l.jsxs("div",{className:"px-4 py-6 flex flex-col items-center text-center",children:[l.jsx(J.Icon,{className:U("w-8 h-8 mb-3",J.iconColor)}),l.jsx("span",{className:"text-sm text-gray-600",children:"This will permanently delete the schedule."})]})]})}),l.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 bg-gray-50/80 flex items-center justify-between shrink-0",children:[l.jsx("button",{onClick:ie,disabled:u==="saving",className:"px-3 py-1.5 rounded-lg text-xs font-medium text-gray-600 hover:bg-gray-200 transition-colors",children:"Dismiss"}),l.jsxs("div",{className:"flex items-center gap-2",children:[u==="idle"&&!K&&l.jsxs("button",{onClick:T,className:U("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-white transition-colors shadow-sm",J.btnClass),children:[l.jsx(J.Icon,{className:"w-3.5 h-3.5"}),J.label]}),u==="idle"&&K&&l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-green-600",children:[l.jsx($n,{className:"w-3.5 h-3.5"}),"Up to date"]}),u==="saving"&&l.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-amber-600",children:[l.jsx(Le,{className:"w-3.5 h-3.5 animate-spin"}),"Processing..."]}),u==="saved"&&l.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-green-600",children:[l.jsx($n,{className:"w-3.5 h-3.5"}),"Done"]}),u==="error"&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-red-600",children:[l.jsx(zu,{className:"w-3.5 h-3.5"}),f]}),l.jsx("button",{onClick:()=>{d("idle"),h("")},className:"px-2.5 py-1 rounded-lg text-xs font-medium text-red-600 hover:bg-red-50 border border-red-200 transition-colors",children:"Retry"})]})]})]})]})}function eq(e){switch(e){case"delete":return{label:"Delete Schedule",Icon:sr,btnClass:"bg-red-600 hover:bg-red-700",gradient:"from-red-50 to-orange-50",badge:"Delete",badgeColor:"bg-red-100 text-red-700",iconColor:"text-red-500"};case"pause":return{label:"Pause Schedule",Icon:uw,btnClass:"bg-amber-600 hover:bg-amber-700",gradient:"from-amber-50 to-orange-50",badge:"Pause",badgeColor:"bg-amber-100 text-amber-700",iconColor:"text-amber-500"};case"resume":return{label:"Resume Schedule",Icon:Nm,btnClass:"bg-green-600 hover:bg-green-700",gradient:"from-green-50 to-emerald-50",badge:"Resume",badgeColor:"bg-green-100 text-green-700",iconColor:"text-green-500"};case"rename":return{label:"Rename Schedule",Icon:Sd,btnClass:"bg-blue-600 hover:bg-blue-700",gradient:"from-blue-50 to-indigo-50",badge:"Rename",badgeColor:"bg-blue-100 text-blue-700",iconColor:"text-blue-500"};case"update":return{label:"Update Schedule",Icon:Wn,btnClass:"bg-amber-600 hover:bg-amber-700",gradient:"from-amber-50 to-orange-50",badge:"Update",badgeColor:"bg-amber-100 text-amber-700",iconColor:"text-amber-500"};default:return{label:"Save Schedule",Icon:Wn,btnClass:"bg-amber-600 hover:bg-amber-700",gradient:"from-amber-50 to-yellow-50",badge:"Create",badgeColor:"bg-amber-100 text-amber-700",iconColor:"text-amber-500"}}}function tq({changes:e}){return l.jsx("pre",{className:"text-xs font-mono leading-relaxed whitespace-pre-wrap",children:e.map((t,n)=>l.jsx("span",{className:U(t.added&&"bg-green-100 text-green-800",t.removed&&"bg-red-100 text-red-800 line-through",!t.added&&!t.removed&&"text-gray-500"),children:t.value},n))})}const zw=m.createContext({});function $w(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const Dm=m.createContext(null),Bw=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class nq extends m.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 rq({children:e,isPresent:t}){const n=m.useId(),r=m.useRef(null),i=m.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=m.useContext(Bw);return m.useInsertionEffect(()=>{const{width:s,height:o,top:c,left:u}=i.current;if(t||!r.current||!s||!o)return;r.current.dataset.motionPopId=n;const d=document.createElement("style");return a&&(d.nonce=a),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
594
+ [data-motion-pop-id="${n}"] {
595
+ position: absolute !important;
596
+ width: ${s}px !important;
597
+ height: ${o}px !important;
598
+ top: ${c}px !important;
599
+ left: ${u}px !important;
600
+ }
601
+ `),()=>{document.head.removeChild(d)}},[t]),l.jsx(nq,{isPresent:t,childRef:r,sizeRef:i,children:m.cloneElement(e,{ref:r})})}const iq=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:s})=>{const o=$w(aq),c=m.useId(),u=m.useCallback(f=>{o.set(f,!0);for(const h of o.values())if(!h)return;r&&r()},[o,r]),d=m.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:u,register:f=>(o.set(f,!1),()=>o.delete(f))}),a?[Math.random(),u]:[n,u]);return m.useMemo(()=>{o.forEach((f,h)=>o.set(h,!1))},[n]),m.useEffect(()=>{!n&&!o.size&&r&&r()},[n]),s==="popLayout"&&(e=l.jsx(rq,{isPresent:n,children:e})),l.jsx(Dm.Provider,{value:d,children:e})};function aq(){return new Map}function bM(e=!0){const t=m.useContext(Dm);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,a=m.useId();m.useEffect(()=>{e&&i(a)},[e]);const s=m.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,s]:[!0]}const Cf=e=>e.key||"";function QN(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const Uw=typeof window<"u",wM=Uw?m.useLayoutEffect:m.useEffect,li=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a="sync",propagate:s=!1})=>{const[o,c]=bM(s),u=m.useMemo(()=>QN(e),[e]),d=s&&!o?[]:u.map(Cf),f=m.useRef(!0),h=m.useRef(u),p=$w(()=>new Map),[g,y]=m.useState(u),[x,b]=m.useState(u);wM(()=>{f.current=!1,h.current=u;for(let k=0;k<x.length;k++){const S=Cf(x[k]);d.includes(S)?p.delete(S):p.get(S)!==!0&&p.set(S,!1)}},[x,d.length,d.join("-")]);const v=[];if(u!==g){let k=[...u];for(let S=0;S<x.length;S++){const j=x[S],N=Cf(j);d.includes(N)||(k.splice(S,0,j),v.push(j))}a==="wait"&&v.length&&(k=v),b(QN(k)),y(u);return}const{forceRender:w}=m.useContext(zw);return l.jsx(l.Fragment,{children:x.map(k=>{const S=Cf(k),j=s&&!o?!1:u===x||d.includes(S),N=()=>{if(p.has(S))p.set(S,!0);else return;let P=!0;p.forEach(A=>{A||(P=!1)}),P&&(w==null||w(),b(h.current),s&&(c==null||c()),r&&r())};return l.jsx(iq,{isPresent:j,initial:!f.current||n?void 0:!1,custom:j?void 0:t,presenceAffectsLayout:i,mode:a,onExitComplete:j?void 0:N,children:k},S)})})},vr=e=>e;let SM=vr;function Vw(e){let t;return()=>(t===void 0&&(t=e()),t)}const Fl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},na=e=>e*1e3,ra=e=>e/1e3,sq={useManualTiming:!1};function oq(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function o(u){a.has(u)&&(c.schedule(u),e()),u(s)}const c={schedule:(u,d=!1,f=!1)=>{const p=f&&r?t:n;return d&&a.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(s=u,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(o),t.clear(),r=!1,i&&(i=!1,c.process(u))}};return c}const Pf=["read","resolveKeyframes","update","preRender","render","postRender"],lq=40;function kM(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,s=Pf.reduce((b,v)=>(b[v]=oq(a),b),{}),{read:o,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=s,p=()=>{const b=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(b-i.timestamp,lq),1),i.timestamp=b,i.isProcessing=!0,o.process(i),c.process(i),u.process(i),d.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},g=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Pf.reduce((b,v)=>{const w=s[v];return b[v]=(k,S=!1,j=!1)=>(n||g(),w.schedule(k,S,j)),b},{}),cancel:b=>{for(let v=0;v<Pf.length;v++)s[Pf[v]].cancel(b)},state:i,steps:s}}const{schedule:jt,cancel:cs,state:gn,steps:L0}=kM(typeof requestAnimationFrame<"u"?requestAnimationFrame:vr,!0),jM=m.createContext({strict:!1}),JN={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"]},zl={};for(const e in JN)zl[e]={isEnabled:t=>JN[e].some(n=>!!t[n])};function cq(e){for(const t in e)zl[t]={...zl[t],...e[t]}}const uq=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 rp(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||uq.has(e)}let NM=e=>!rp(e);function dq(e){e&&(NM=t=>t.startsWith("on")?!rp(t):e(t))}try{dq(require("@emotion/is-prop-valid").default)}catch{}function fq(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(NM(i)||n===!0&&rp(i)||!t&&!rp(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function hq(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 Im=m.createContext({});function Gu(e){return typeof e=="string"||Array.isArray(e)}function Lm(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Ww=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Hw=["initial",...Ww];function Rm(e){return Lm(e.animate)||Hw.some(t=>Gu(e[t]))}function CM(e){return!!(Rm(e)||e.variants)}function pq(e,t){if(Rm(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Gu(n)?n:void 0,animate:Gu(r)?r:void 0}}return e.inherit!==!1?t:{}}function mq(e){const{initial:t,animate:n}=pq(e,m.useContext(Im));return m.useMemo(()=>({initial:t,animate:n}),[e2(t),e2(n)])}function e2(e){return Array.isArray(e)?e.join(" "):e}const gq=Symbol.for("motionComponentSymbol");function sl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function yq(e,t,n){return m.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):sl(n)&&(n.current=r))},[t])}const Kw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),xq="framerAppearId",PM="data-"+Kw(xq),{schedule:Gw}=kM(queueMicrotask,!1),EM=m.createContext({});function vq(e,t,n,r,i){var a,s;const{visualElement:o}=m.useContext(Im),c=m.useContext(jM),u=m.useContext(Dm),d=m.useContext(Bw).reducedMotion,f=m.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=m.useContext(EM);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&bq(f.current,n,i,p);const g=m.useRef(!1);m.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const y=n[PM],x=m.useRef(!!y&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,y))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,y)));return wM(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Gw.render(h.render),x.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!x.current&&h.animationState&&h.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),x.current=!1))}),h}function bq(e,t,n,r){const{layoutId:i,layout:a,drag:s,dragConstraints:o,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:AM(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!s||o&&sl(o),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:u})}function AM(e){if(e)return e.options.allowProjection!==!1?e.projection:AM(e.parent)}function wq({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var a,s;e&&cq(e);function o(u,d){let f;const h={...m.useContext(Bw),...u,layoutId:Sq(u)},{isStatic:p}=h,g=mq(u),y=r(u,p);if(!p&&Uw){kq();const x=jq(h);f=x.MeasureLayout,g.visualElement=vq(i,y,h,t,x.ProjectionNode)}return l.jsxs(Im.Provider,{value:g,children:[f&&g.visualElement?l.jsx(f,{visualElement:g.visualElement,...h}):null,n(i,u,yq(y,g.visualElement,d),y,p,g.visualElement)]})}o.displayName=`motion.${typeof i=="string"?i:`create(${(s=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&s!==void 0?s:""})`}`;const c=m.forwardRef(o);return c[gq]=i,c}function Sq({layoutId:e}){const t=m.useContext(zw).id;return t&&e!==void 0?t+"-"+e:e}function kq(e,t){m.useContext(jM).strict}function jq(e){const{drag:t,layout:n}=zl;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 Nq=["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 qw(e){return typeof e!="string"||e.includes("-")?!1:!!(Nq.indexOf(e)>-1||/[A-Z]/u.test(e))}function t2(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Yw(e,t,n,r){if(typeof t=="function"){const[i,a]=t2(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]=t2(r);t=t(n!==void 0?n:e.custom,i,a)}return t}const $x=e=>Array.isArray(e),Cq=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),Pq=e=>$x(e)?e[e.length-1]||0:e,_n=e=>!!(e&&e.getVelocity);function ph(e){const t=_n(e)?e.get():e;return Cq(t)?t.toValue():t}function Eq({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,a){const s={latestValues:Aq(r,i,a,e),renderState:t()};return n&&(s.onMount=o=>n({props:r,current:o,...s}),s.onUpdate=o=>n(o)),s}const TM=e=>(t,n)=>{const r=m.useContext(Im),i=m.useContext(Dm),a=()=>Eq(e,t,r,i);return n?a():$w(a)};function Aq(e,t,n,r){const i={},a=r(e,{});for(const h in a)i[h]=ph(a[h]);let{initial:s,animate:o}=e;const c=Rm(e),u=CM(e);t&&u&&!c&&e.inherit!==!1&&(s===void 0&&(s=t.initial),o===void 0&&(o=t.animate));let d=n?n.initial===!1:!1;d=d||s===!1;const f=d?o:s;if(f&&typeof f!="boolean"&&!Lm(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const g=Yw(e,h[p]);if(g){const{transitionEnd:y,transition:x,...b}=g;for(const v in b){let w=b[v];if(Array.isArray(w)){const k=d?w.length-1:0;w=w[k]}w!==null&&(i[v]=w)}for(const v in y)i[v]=y[v]}}}return i}const nc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Eo=new Set(nc),OM=e=>t=>typeof t=="string"&&t.startsWith(e),_M=OM("--"),Tq=OM("var(--"),Xw=e=>Tq(e)?Oq.test(e.split("/*")[0].trim()):!1,Oq=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,MM=(e,t)=>t&&typeof e=="number"?t.transform(e):e,da=(e,t,n)=>n>t?t:n<e?e:n,rc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},qu={...rc,transform:e=>da(0,1,e)},Ef={...rc,default:1},Ad=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ia=Ad("deg"),Ti=Ad("%"),Ie=Ad("px"),_q=Ad("vh"),Mq=Ad("vw"),n2={...Ti,parse:e=>Ti.parse(e)/100,transform:e=>Ti.transform(e*100)},Dq={borderWidth:Ie,borderTopWidth:Ie,borderRightWidth:Ie,borderBottomWidth:Ie,borderLeftWidth:Ie,borderRadius:Ie,radius:Ie,borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomRightRadius:Ie,borderBottomLeftRadius:Ie,width:Ie,maxWidth:Ie,height:Ie,maxHeight:Ie,top:Ie,right:Ie,bottom:Ie,left:Ie,padding:Ie,paddingTop:Ie,paddingRight:Ie,paddingBottom:Ie,paddingLeft:Ie,margin:Ie,marginTop:Ie,marginRight:Ie,marginBottom:Ie,marginLeft:Ie,backgroundPositionX:Ie,backgroundPositionY:Ie},Iq={rotate:Ia,rotateX:Ia,rotateY:Ia,rotateZ:Ia,scale:Ef,scaleX:Ef,scaleY:Ef,scaleZ:Ef,skew:Ia,skewX:Ia,skewY:Ia,distance:Ie,translateX:Ie,translateY:Ie,translateZ:Ie,x:Ie,y:Ie,z:Ie,perspective:Ie,transformPerspective:Ie,opacity:qu,originX:n2,originY:n2,originZ:Ie},r2={...rc,transform:Math.round},Zw={...Dq,...Iq,zIndex:r2,size:Ie,fillOpacity:qu,strokeOpacity:qu,numOctaves:r2},Lq={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Rq=nc.length;function Fq(e,t,n){let r="",i=!0;for(let a=0;a<Rq;a++){const s=nc[a],o=e[s];if(o===void 0)continue;let c=!0;if(typeof o=="number"?c=o===(s.startsWith("scale")?1:0):c=parseFloat(o)===0,!c||n){const u=MM(o,Zw[s]);if(!c){i=!1;const d=Lq[s]||s;r+=`${d}(${u}) `}n&&(t[s]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Qw(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let s=!1,o=!1;for(const c in t){const u=t[c];if(Eo.has(c)){s=!0;continue}else if(_M(c)){i[c]=u;continue}else{const d=MM(u,Zw[c]);c.startsWith("origin")?(o=!0,a[c]=d):r[c]=d}}if(t.transform||(s||n?r.transform=Fq(t,e.transform,n):r.transform&&(r.transform="none")),o){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;r.transformOrigin=`${c} ${u} ${d}`}}const zq={offset:"stroke-dashoffset",array:"stroke-dasharray"},$q={offset:"strokeDashoffset",array:"strokeDasharray"};function Bq(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?zq:$q;e[a.offset]=Ie.transform(-r);const s=Ie.transform(t),o=Ie.transform(n);e[a.array]=`${s} ${o}`}function i2(e,t,n){return typeof e=="string"?e:Ie.transform(t+n*e)}function Uq(e,t,n){const r=i2(t,e.x,e.width),i=i2(n,e.y,e.height);return`${r} ${i}`}function Jw(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:s,pathSpacing:o=1,pathOffset:c=0,...u},d,f){if(Qw(e,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:g}=e;h.transform&&(g&&(p.transform=h.transform),delete h.transform),g&&(i!==void 0||a!==void 0||p.transform)&&(p.transformOrigin=Uq(g,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&Bq(h,s,o,c,!1)}const e1=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),DM=()=>({...e1(),attrs:{}}),t1=e=>typeof e=="string"&&e.toLowerCase()==="svg";function IM(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 LM=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 RM(e,t,n,r){IM(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(LM.has(i)?i:Kw(i),t.attrs[i])}const ip={};function Vq(e){Object.assign(ip,e)}function FM(e,{layout:t,layoutId:n}){return Eo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ip[e]||e==="opacity")}function n1(e,t,n){var r;const{style:i}=e,a={};for(const s in i)(_n(i[s])||t.style&&_n(t.style[s])||FM(s,e)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[s]=i[s]);return a}function zM(e,t,n){const r=n1(e,t,n);for(const i in e)if(_n(e[i])||_n(t[i])){const a=nc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}function Wq(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 a2=["x","y","width","height","cx","cy","r"],Hq={useVisualState:TM({scrapeMotionValuesFromProps:zM,createRenderState:DM,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let a=!!e.drag;if(!a){for(const o in i)if(Eo.has(o)){a=!0;break}}if(!a)return;let s=!t;if(t)for(let o=0;o<a2.length;o++){const c=a2[o];e[c]!==t[c]&&(s=!0)}s&&jt.read(()=>{Wq(n,r),jt.render(()=>{Jw(r,i,t1(n.tagName),e.transformTemplate),RM(n,r)})})}})},Kq={useVisualState:TM({scrapeMotionValuesFromProps:n1,createRenderState:e1})};function $M(e,t,n){for(const r in t)!_n(t[r])&&!FM(r,n)&&(e[r]=t[r])}function Gq({transformTemplate:e},t){return m.useMemo(()=>{const n=e1();return Qw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function qq(e,t){const n=e.style||{},r={};return $M(r,n,e),Object.assign(r,Gq(e,t)),r}function Yq(e,t){const n={},r=qq(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 Xq(e,t,n,r){const i=m.useMemo(()=>{const a=DM();return Jw(a,t,t1(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};$M(a,e.style,e),i.style={...a,...i.style}}return i}function Zq(e=!1){return(n,r,i,{latestValues:a},s)=>{const c=(qw(n)?Xq:Yq)(r,a,s,n),u=fq(r,typeof n=="string",e),d=n!==m.Fragment?{...u,...c,ref:i}:{},{children:f}=r,h=m.useMemo(()=>_n(f)?f.get():f,[f]);return m.createElement(n,{...d,children:h})}}function Qq(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...qw(r)?Hq:Kq,preloadedFeatures:e,useRender:Zq(i),createVisualElement:t,Component:r};return wq(s)}}function BM(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 Fm(e,t,n){const r=e.getProps();return Yw(r,t,n!==void 0?n:r.custom,e)}const Jq=Vw(()=>window.ScrollTimeline!==void 0);class eY{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(Jq()&&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 tY extends eY{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function r1(e,t){return e?e[t]||e.default||e:void 0}const Bx=2e4;function UM(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Bx;)t+=n,r=e.next(t);return t>=Bx?1/0:t}function i1(e){return typeof e=="function"}function s2(e,t){e.timeline=t,e.onfinish=null}const a1=e=>Array.isArray(e)&&typeof e[0]=="number",nY={linearEasing:void 0};function rY(e,t){const n=Vw(e);return()=>{var r;return(r=nY[t])!==null&&r!==void 0?r:n()}}const ap=rY(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),VM=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=e(Fl(0,i-1,a))+", ";return`linear(${r.substring(0,r.length-2)})`};function WM(e){return!!(typeof e=="function"&&ap()||!e||typeof e=="string"&&(e in Ux||ap())||a1(e)||Array.isArray(e)&&e.every(WM))}const Zc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Ux={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zc([0,.65,.55,1]),circOut:Zc([.55,0,1,.45]),backIn:Zc([.31,.01,.66,-.59]),backOut:Zc([.33,1.53,.69,.99])};function HM(e,t){if(e)return typeof e=="function"&&ap()?VM(e,t):a1(e)?Zc(e):Array.isArray(e)?e.map(n=>HM(n,t)||Ux.easeOut):Ux[e]}const Xr={x:!1,y:!1};function KM(){return Xr.x||Xr.y}function iY(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 GM(e,t){const n=iY(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function o2(e){return t=>{t.pointerType==="touch"||KM()||e(t)}}function aY(e,t,n={}){const[r,i,a]=GM(e,n),s=o2(o=>{const{target:c}=o,u=t(o);if(typeof u!="function"||!c)return;const d=o2(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,i)});return r.forEach(o=>{o.addEventListener("pointerenter",s,i)}),a}const qM=(e,t)=>t?e===t?!0:qM(e,t.parentElement):!1,s1=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,sY=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function oY(e){return sY.has(e.tagName)||e.tabIndex!==-1}const Qc=new WeakSet;function l2(e){return t=>{t.key==="Enter"&&e(t)}}function R0(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const lY=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=l2(()=>{if(Qc.has(n))return;R0(n,"down");const i=l2(()=>{R0(n,"up")}),a=()=>R0(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 c2(e){return s1(e)&&!KM()}function cY(e,t,n={}){const[r,i,a]=GM(e,n),s=o=>{const c=o.currentTarget;if(!c2(o)||Qc.has(c))return;Qc.add(c);const u=t(o),d=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!c2(p)||!Qc.has(c))&&(Qc.delete(c),typeof u=="function"&&u(p,{success:g}))},f=p=>{d(p,n.useGlobalTarget||qM(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return r.forEach(o=>{!oY(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(n.useGlobalTarget?window:o).addEventListener("pointerdown",s,i),o.addEventListener("focus",u=>lY(u,i),i)}),a}function uY(e){return e==="x"||e==="y"?Xr[e]?null:(Xr[e]=!0,()=>{Xr[e]=!1}):Xr.x||Xr.y?null:(Xr.x=Xr.y=!0,()=>{Xr.x=Xr.y=!1})}const YM=new Set(["width","height","top","left","right","bottom",...nc]);let mh;function dY(){mh=void 0}const Oi={now:()=>(mh===void 0&&Oi.set(gn.isProcessing||sq.useManualTiming?gn.timestamp:performance.now()),mh),set:e=>{mh=e,queueMicrotask(dY)}};function o1(e,t){e.indexOf(t)===-1&&e.push(t)}function l1(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class c1{constructor(){this.subscriptions=[]}add(t){return o1(this.subscriptions,t),()=>l1(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 s=this.subscriptions[a];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function XM(e,t){return t?e*(1e3/t):0}const u2=30,fY=e=>!isNaN(parseFloat(e));class hY{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=Oi.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=Oi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=fY(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 c1);const r=this.events[t].add(n);return t==="change"?()=>{r(),jt.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=Oi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>u2)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,u2);return XM(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 Yu(e,t){return new hY(e,t)}function pY(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Yu(n))}function mY(e,t){const n=Fm(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const s in a){const o=Pq(a[s]);pY(e,s,o)}}function gY(e){return!!(_n(e)&&e.add)}function Vx(e,t){const n=e.getValue("willChange");if(gY(n))return n.add(t)}function ZM(e){return e.props[PM]}const QM=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,yY=1e-7,xY=12;function vY(e,t,n,r,i){let a,s,o=0;do s=t+(n-t)/2,a=QM(s,r,i)-e,a>0?n=s:t=s;while(Math.abs(a)>yY&&++o<xY);return s}function Td(e,t,n,r){if(e===t&&n===r)return vr;const i=a=>vY(a,0,1,e,n);return a=>a===0||a===1?a:QM(i(a),t,r)}const JM=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,e4=e=>t=>1-e(1-t),t4=Td(.33,1.53,.69,.99),u1=e4(t4),n4=JM(u1),r4=e=>(e*=2)<1?.5*u1(e):.5*(2-Math.pow(2,-10*(e-1))),d1=e=>1-Math.sin(Math.acos(e)),i4=e4(d1),a4=JM(d1),s4=e=>/^0[^.\s]+$/u.test(e);function bY(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||s4(e):!0}const mu=e=>Math.round(e*1e5)/1e5,f1=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wY(e){return e==null}const SY=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,h1=(e,t)=>n=>!!(typeof n=="string"&&SY.test(n)&&n.startsWith(e)||t&&!wY(n)&&Object.prototype.hasOwnProperty.call(n,t)),o4=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,s,o]=r.match(f1);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(s),alpha:o!==void 0?parseFloat(o):1}},kY=e=>da(0,255,e),F0={...rc,transform:e=>Math.round(kY(e))},qs={test:h1("rgb","red"),parse:o4("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+F0.transform(e)+", "+F0.transform(t)+", "+F0.transform(n)+", "+mu(qu.transform(r))+")"};function jY(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 Wx={test:h1("#"),parse:jY,transform:qs.transform},ol={test:h1("hsl","hue"),parse:o4("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ti.transform(mu(t))+", "+Ti.transform(mu(n))+", "+mu(qu.transform(r))+")"},Pn={test:e=>qs.test(e)||Wx.test(e)||ol.test(e),parse:e=>qs.test(e)?qs.parse(e):ol.test(e)?ol.parse(e):Wx.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?qs.transform(e):ol.transform(e)},NY=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function CY(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(f1))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(NY))===null||n===void 0?void 0:n.length)||0)>0}const l4="number",c4="color",PY="var",EY="var(",d2="${}",AY=/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 Xu(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const o=t.replace(AY,c=>(Pn.test(c)?(r.color.push(a),i.push(c4),n.push(Pn.parse(c))):c.startsWith(EY)?(r.var.push(a),i.push(PY),n.push(c)):(r.number.push(a),i.push(l4),n.push(parseFloat(c))),++a,d2)).split(d2);return{values:n,split:o,indexes:r,types:i}}function u4(e){return Xu(e).values}function d4(e){const{split:t,types:n}=Xu(e),r=t.length;return i=>{let a="";for(let s=0;s<r;s++)if(a+=t[s],i[s]!==void 0){const o=n[s];o===l4?a+=mu(i[s]):o===c4?a+=Pn.transform(i[s]):a+=i[s]}return a}}const TY=e=>typeof e=="number"?0:e;function OY(e){const t=u4(e);return d4(e)(t.map(TY))}const us={test:CY,parse:u4,createTransformer:d4,getAnimatableNone:OY},_Y=new Set(["brightness","contrast","saturate","opacity"]);function MY(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(f1)||[];if(!r)return e;const i=n.replace(r,"");let a=_Y.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const DY=/\b([a-z-]*)\(.*?\)/gu,Hx={...us,getAnimatableNone:e=>{const t=e.match(DY);return t?t.map(MY).join(" "):e}},IY={...Zw,color:Pn,backgroundColor:Pn,outlineColor:Pn,fill:Pn,stroke:Pn,borderColor:Pn,borderTopColor:Pn,borderRightColor:Pn,borderBottomColor:Pn,borderLeftColor:Pn,filter:Hx,WebkitFilter:Hx},p1=e=>IY[e];function f4(e,t){let n=p1(e);return n!==Hx&&(n=us),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const LY=new Set(["auto","none","0"]);function RY(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!LY.has(a)&&Xu(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=f4(n,i)}const f2=e=>e===rc||e===Ie,h2=(e,t)=>parseFloat(e.split(", ")[t]),p2=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return h2(i[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?h2(a[1],e):0}},FY=new Set(["x","y","z"]),zY=nc.filter(e=>!FY.has(e));function $Y(e){const t=[];return zY.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const $l={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:p2(4,13),y:p2(5,14)};$l.translateX=$l.x;$l.translateY=$l.y;const to=new Set;let Kx=!1,Gx=!1;function h4(){if(Gx){const e=Array.from(to).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=$Y(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,s])=>{var o;(o=r.getValue(a))===null||o===void 0||o.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Gx=!1,Kx=!1,to.forEach(e=>e.complete()),to.clear()}function p4(){to.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Gx=!0)})}function BY(){p4(),h4()}class m1{constructor(t,n,r,i,a,s=!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=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(to.add(this),Kx||(Kx=!0,jt.read(p4),jt.resolveKeyframes(h4))):(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 s=i==null?void 0:i.get(),o=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const c=r.readValue(n,o);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=o),i&&s===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),to.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,to.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const m4=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),UY=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function VY(e){const t=UY.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function g4(e,t,n=1){const[r,i]=VY(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const s=a.trim();return m4(s)?parseFloat(s):s}return Xw(i)?g4(i,t,n+1):i}const y4=e=>t=>t.test(e),WY={test:e=>e==="auto",parse:e=>e},x4=[rc,Ie,Ti,Ia,Mq,_q,WY],m2=e=>x4.find(y4(e));class v4 extends m1{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 c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),Xw(u))){const d=g4(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!YM.has(r)||t.length!==2)return;const[i,a]=t,s=m2(i),o=m2(a);if(s!==o)if(f2(s)&&f2(o))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)bY(t[i])&&r.push(i);r.length&&RY(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=$l[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 s=i.length-1,o=i[s];i[s]=$l[r](n.measureViewportBox(),window.getComputedStyle(n.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,u])=>{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const g2=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(us.test(e)||e==="0")&&!e.startsWith("url("));function HY(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 KY(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],s=g2(i,t),o=g2(a,t);return!s||!o?!1:HY(e)||(n==="spring"||i1(n))&&r}const GY=e=>e!==null;function zm(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(GY),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const qY=40;class b4{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:s="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Oi.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:s,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>qY?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&BY(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Oi.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:s,onComplete:o,onUpdate:c,isGenerator:u}=this.options;if(!u&&!KY(t,r,i,a))if(s)this.options.duration=0;else{c&&c(zm(t,this.options,n)),o&&o(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},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 _t=(e,t,n)=>e+(t-e)*n;function z0(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 YY({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,s=0;if(!t)i=a=s=n;else{const o=n<.5?n*(1+t):n+t-n*t,c=2*n-o;i=z0(c,o,e+1/3),a=z0(c,o,e),s=z0(c,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(s*255),alpha:r}}function sp(e,t){return n=>n>0?t:e}const $0=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},XY=[Wx,qs,ol],ZY=e=>XY.find(t=>t.test(e));function y2(e){const t=ZY(e);if(!t)return!1;let n=t.parse(e);return t===ol&&(n=YY(n)),n}const x2=(e,t)=>{const n=y2(e),r=y2(t);if(!n||!r)return sp(e,t);const i={...n};return a=>(i.red=$0(n.red,r.red,a),i.green=$0(n.green,r.green,a),i.blue=$0(n.blue,r.blue,a),i.alpha=_t(n.alpha,r.alpha,a),qs.transform(i))},QY=(e,t)=>n=>t(e(n)),Od=(...e)=>e.reduce(QY),qx=new Set(["none","hidden"]);function JY(e,t){return qx.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function eX(e,t){return n=>_t(e,t,n)}function g1(e){return typeof e=="number"?eX:typeof e=="string"?Xw(e)?sp:Pn.test(e)?x2:rX:Array.isArray(e)?w4:typeof e=="object"?Pn.test(e)?x2:tX:sp}function w4(e,t){const n=[...e],r=n.length,i=e.map((a,s)=>g1(a)(a,t[s]));return a=>{for(let s=0;s<r;s++)n[s]=i[s](a);return n}}function tX(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=g1(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function nX(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const s=t.types[a],o=e.indexes[s][i[s]],c=(n=e.values[o])!==null&&n!==void 0?n:0;r[a]=c,i[s]++}return r}const rX=(e,t)=>{const n=us.createTransformer(t),r=Xu(e),i=Xu(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?qx.has(e)&&!i.values.length||qx.has(t)&&!r.values.length?JY(e,t):Od(w4(nX(r,i),i.values),n):sp(e,t)};function S4(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?_t(e,t,n):g1(e)(e,t)}const iX=5;function k4(e,t,n){const r=Math.max(t-iX,0);return XM(n-e(r),t-r)}const Ft={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},B0=.001;function aX({duration:e=Ft.duration,bounce:t=Ft.bounce,velocity:n=Ft.velocity,mass:r=Ft.mass}){let i,a,s=1-t;s=da(Ft.minDamping,Ft.maxDamping,s),e=da(Ft.minDuration,Ft.maxDuration,ra(e)),s<1?(i=u=>{const d=u*s,f=d*e,h=d-n,p=Yx(u,s),g=Math.exp(-f);return B0-h/p*g},a=u=>{const f=u*s*e,h=f*n+n,p=Math.pow(s,2)*Math.pow(u,2)*e,g=Math.exp(-f),y=Yx(Math.pow(u,2),s);return(-i(u)+B0>0?-1:1)*((h-p)*g)/y}):(i=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-B0+d*f},a=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const o=5/e,c=oX(i,a,o);if(e=na(e),isNaN(c))return{stiffness:Ft.stiffness,damping:Ft.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}const sX=12;function oX(e,t,n){let r=n;for(let i=1;i<sX;i++)r=r-e(r)/t(r);return r}function Yx(e,t){return e*Math.sqrt(1-t*t)}const lX=["duration","bounce"],cX=["stiffness","damping","mass"];function v2(e,t){return t.some(n=>e[n]!==void 0)}function uX(e){let t={velocity:Ft.velocity,stiffness:Ft.stiffness,damping:Ft.damping,mass:Ft.mass,isResolvedFromDuration:!1,...e};if(!v2(e,cX)&&v2(e,lX))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*da(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Ft.mass,stiffness:i,damping:a}}else{const n=aX(e);t={...t,...n,mass:Ft.mass},t.isResolvedFromDuration=!0}return t}function j4(e=Ft.visualDuration,t=Ft.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],s=n.keyframes[n.keyframes.length-1],o={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=uX({...n,velocity:-ra(n.velocity||0)}),g=h||0,y=u/(2*Math.sqrt(c*d)),x=s-a,b=ra(Math.sqrt(c/d)),v=Math.abs(x)<5;r||(r=v?Ft.restSpeed.granular:Ft.restSpeed.default),i||(i=v?Ft.restDelta.granular:Ft.restDelta.default);let w;if(y<1){const S=Yx(b,y);w=j=>{const N=Math.exp(-y*b*j);return s-N*((g+y*b*x)/S*Math.sin(S*j)+x*Math.cos(S*j))}}else if(y===1)w=S=>s-Math.exp(-b*S)*(x+(g+b*x)*S);else{const S=b*Math.sqrt(y*y-1);w=j=>{const N=Math.exp(-y*b*j),P=Math.min(S*j,300);return s-N*((g+y*b*x)*Math.sinh(P)+S*x*Math.cosh(P))/S}}const k={calculatedDuration:p&&f||null,next:S=>{const j=w(S);if(p)o.done=S>=f;else{let N=0;y<1&&(N=S===0?na(g):k4(w,S,j));const P=Math.abs(N)<=r,A=Math.abs(s-j)<=i;o.done=P&&A}return o.value=o.done?s:j,o},toString:()=>{const S=Math.min(UM(k),Bx),j=VM(N=>k.next(S*N).value,S,30);return S+"ms "+j}};return k}function b2({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:s,min:o,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=P=>o!==void 0&&P<o||c!==void 0&&P>c,g=P=>o===void 0?c:c===void 0||Math.abs(o-P)<Math.abs(c-P)?o:c;let y=n*t;const x=f+y,b=s===void 0?x:s(x);b!==x&&(y=b-f);const v=P=>-y*Math.exp(-P/r),w=P=>b+v(P),k=P=>{const A=v(P),E=w(P);h.done=Math.abs(A)<=u,h.value=h.done?b:E};let S,j;const N=P=>{p(h.value)&&(S=P,j=j4({keyframes:[h.value,g(h.value)],velocity:k4(w,P,h.value),damping:i,stiffness:a,restDelta:u,restSpeed:d}))};return N(0),{calculatedDuration:null,next:P=>{let A=!1;return!j&&S===void 0&&(A=!0,k(P),N(P)),S!==void 0&&P>=S?j.next(P-S):(!A&&k(P),h)}}}const dX=Td(.42,0,1,1),fX=Td(0,0,.58,1),N4=Td(.42,0,.58,1),hX=e=>Array.isArray(e)&&typeof e[0]!="number",pX={linear:vr,easeIn:dX,easeInOut:N4,easeOut:fX,circIn:d1,circInOut:a4,circOut:i4,backIn:u1,backInOut:n4,backOut:t4,anticipate:r4},w2=e=>{if(a1(e)){SM(e.length===4);const[t,n,r,i]=e;return Td(t,n,r,i)}else if(typeof e=="string")return pX[e];return e};function mX(e,t,n){const r=[],i=n||S4,a=e.length-1;for(let s=0;s<a;s++){let o=i(e[s],e[s+1]);if(t){const c=Array.isArray(t)?t[s]||vr:t;o=Od(c,o)}r.push(o)}return r}function gX(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(SM(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=mX(t,r,i),c=o.length,u=d=>{if(s&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const h=Fl(e[f],e[f+1],d);return o[f](h)};return n?d=>u(da(e[0],e[a-1],d)):u}function yX(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Fl(0,t,r);e.push(_t(n,1,i))}}function xX(e){const t=[0];return yX(t,e.length-1),t}function vX(e,t){return e.map(n=>n*t)}function bX(e,t){return e.map(()=>t||N4).splice(0,e.length-1)}function op({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=hX(r)?r.map(w2):w2(r),a={done:!1,value:t[0]},s=vX(n&&n.length===t.length?n:xX(t),e),o=gX(s,t,{ease:Array.isArray(i)?i:bX(t,i)});return{calculatedDuration:e,next:c=>(a.value=o(c),a.done=c>=e,a)}}const wX=e=>{const t=({timestamp:n})=>e(n);return{start:()=>jt.update(t,!0),stop:()=>cs(t),now:()=>gn.isProcessing?gn.timestamp:Oi.now()}},SX={decay:b2,inertia:b2,tween:op,keyframes:op,spring:j4},kX=e=>e/100;class y1 extends b4{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:c}=this.options;c&&c()};const{name:n,motionValue:r,element:i,keyframes:a}=this.options,s=(i==null?void 0:i.KeyframeResolver)||m1,o=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new s(a,o,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:s=0}=this.options,o=i1(n)?n:SX[n]||op;let c,u;o!==op&&typeof t[0]!="number"&&(c=Od(kX,S4(t[0],t[1])),t=[0,100]);const d=o({...this.options,keyframes:t});a==="mirror"&&(u=o({...this.options,keyframes:[...t].reverse(),velocity:-s})),d.calculatedDuration===null&&(d.calculatedDuration=UM(d));const{calculatedDuration:f}=d,h=f+i,p=h*(r+1)-i;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}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:P}=this.options;return{done:!0,value:P[P.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:s,mapPercentToKeyframes:o,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return a.next(0);const{delay:h,repeat:p,repeatType:g,repeatDelay:y,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/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 b=this.currentTime-h*(this.speed>=0?1:-1),v=this.speed>=0?b<0:b>d;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let w=this.currentTime,k=a;if(p){const P=Math.min(this.currentTime,d)/f;let A=Math.floor(P),E=P%1;!E&&P>=1&&(E=1),E===1&&A--,A=Math.min(A,p+1),!!(A%2)&&(g==="reverse"?(E=1-E,y&&(E-=y/f)):g==="mirror"&&(k=s)),w=da(0,1,E)*f}const S=v?{done:!1,value:c[0]}:k.next(w);o&&(S.value=o(S.value));let{done:j}=S;!v&&u!==null&&(j=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&j);return N&&i!==void 0&&(S.value=zm(c,this.options,i)),x&&x(S.value),N&&this.finish(),S}get duration(){const{resolved:t}=this;return t?ra(t.calculatedDuration):0}get time(){return ra(this.currentTime)}set time(t){t=na(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=ra(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=wX,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 jX=new Set(["opacity","clipPath","filter","transform"]);function NX(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=HM(o,i);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:s==="reverse"?"alternate":"normal"})}const CX=Vw(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),lp=10,PX=2e4;function EX(e){return i1(e.type)||e.type==="spring"||!WM(e.ease)}function AX(e,t){const n=new y1({...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<PX;)r=n.sample(a),i.push(r.value),a+=lp;return{times:void 0,keyframes:i,duration:a-lp,ease:"linear"}}const C4={anticipate:r4,backInOut:n4,circInOut:a4};function TX(e){return e in C4}class S2 extends b4{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:a}=this.options;this.resolver=new v4(a,(s,o)=>this.onKeyframesResolved(s,o),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:a,type:s,motionValue:o,name:c,startTime:u}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof a=="string"&&ap()&&TX(a)&&(a=C4[a]),EX(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:g,...y}=this.options,x=AX(t,y);t=x.keyframes,t.length===1&&(t[1]=t[0]),r=x.duration,i=x.times,a=x.ease,s="keyframes"}const d=NX(o.owner.current,c,t,{...this.options,duration:r,times:i,ease:a});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(s2(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;o.set(zm(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:i,type:s,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ra(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ra(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=na(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 vr;const{animation:r}=n;s2(r,t)}return vr}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:s,times:o}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...p}=this.options,g=new y1({...p,keyframes:r,duration:i,type:a,ease:s,times:o,isGenerator:!0}),y=na(this.time);u.setWithVelocity(g.sample(y-lp).value,g.sample(y).value,lp)}const{onStop:c}=this.options;c&&c(),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:s,type:o}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return CX()&&r&&jX.has(r)&&!c&&!u&&!i&&a!=="mirror"&&s!==0&&o!=="inertia"}}const OX={type:"spring",stiffness:500,damping:25,restSpeed:10},_X=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),MX={type:"keyframes",duration:.8},DX={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},IX=(e,{keyframes:t})=>t.length>2?MX:Eo.has(e)?e.startsWith("scale")?_X(t[1]):OX:DX;function LX({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:s,repeatDelay:o,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const x1=(e,t,n,r={},i,a)=>s=>{const o=r1(r,e)||{},c=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-na(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-u,onUpdate:h=>{t.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:a?void 0:i};LX(o)||(d={...d,...IX(e,d)}),d.duration&&(d.duration=na(d.duration)),d.repeatDelay&&(d.repeatDelay=na(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!a&&t.get()!==void 0){const h=zm(d.keyframes,o);if(h!==void 0)return jt.update(()=>{d.onUpdate(h),d.onComplete()}),new tY([])}return!a&&S2.supports(d)?new S2(d):new y1(d)};function RX({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function P4(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:s=e.getDefaultTransition(),transitionEnd:o,...c}=t;r&&(s=r);const u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const f in c){const h=e.getValue(f,(a=e.latestValues[f])!==null&&a!==void 0?a:null),p=c[f];if(p===void 0||d&&RX(d,f))continue;const g={delay:n,...r1(s||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=ZM(e);if(b){const v=window.MotionHandoffAnimation(b,f,jt);v!==null&&(g.startTime=v,y=!0)}}Vx(e,f),h.start(x1(f,h,p,e.shouldReduceMotion&&YM.has(f)?{type:!1}:g,e,y));const x=h.animation;x&&u.push(x)}return o&&Promise.all(u).then(()=>{jt.update(()=>{o&&mY(e,o)})}),u}function Xx(e,t,n={}){var r;const i=Fm(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 s=i?()=>Promise.all(P4(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=a;return FX(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[u,d]=c==="beforeChildren"?[s,o]:[o,s];return u().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function FX(e,t,n=0,r=0,i=1,a){const s=[],o=(e.variantChildren.size-1)*r,c=i===1?(u=0)=>u*r:(u=0)=>o-u*r;return Array.from(e.variantChildren).sort(zX).forEach((u,d)=>{u.notify("AnimationStart",t),s.push(Xx(u,t,{...a,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function zX(e,t){return e.sortNodePosition(t)}function $X(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>Xx(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=Xx(e,t,n);else{const i=typeof t=="function"?Fm(e,t,n.custom):t;r=Promise.all(P4(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const BX=Hw.length;function E4(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?E4(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<BX;n++){const r=Hw[n],i=e.props[r];(Gu(i)||i===!1)&&(t[r]=i)}return t}const UX=[...Ww].reverse(),VX=Ww.length;function WX(e){return t=>Promise.all(t.map(({animation:n,options:r})=>$X(e,n,r)))}function HX(e){let t=WX(e),n=k2(),r=!0;const i=c=>(u,d)=>{var f;const h=Fm(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:g,...y}=h;u={...u,...y,...g}}return u};function a(c){t=c(e)}function s(c){const{props:u}=e,d=E4(e.parent)||{},f=[],h=new Set;let p={},g=1/0;for(let x=0;x<VX;x++){const b=UX[x],v=n[b],w=u[b]!==void 0?u[b]:d[b],k=Gu(w),S=b===c?v.isActive:null;S===!1&&(g=x);let j=w===d[b]&&w!==u[b]&&k;if(j&&r&&e.manuallyAnimateOnMount&&(j=!1),v.protectedKeys={...p},!v.isActive&&S===null||!w&&!v.prevProp||Lm(w)||typeof w=="boolean")continue;const N=KX(v.prevProp,w);let P=N||b===c&&v.isActive&&!j&&k||x>g&&k,A=!1;const E=Array.isArray(w)?w:[w];let O=E.reduce(i(b),{});S===!1&&(O={});const{prevResolvedValues:C={}}=v,M={...C,...O},I=Q=>{P=!0,h.has(Q)&&(A=!0,h.delete(Q)),v.needsAnimating[Q]=!0;const D=e.getValue(Q);D&&(D.liveStyle=!1)};for(const Q in M){const D=O[Q],K=C[Q];if(p.hasOwnProperty(Q))continue;let T=!1;$x(D)&&$x(K)?T=!BM(D,K):T=D!==K,T?D!=null?I(Q):h.add(Q):D!==void 0&&h.has(Q)?I(Q):v.protectedKeys[Q]=!0}v.prevProp=w,v.prevResolvedValues=O,v.isActive&&(p={...p,...O}),r&&e.blockInitialAnimation&&(P=!1),P&&(!(j&&N)||A)&&f.push(...E.map(Q=>({animation:Q,options:{type:b}})))}if(h.size){const x={};h.forEach(b=>{const v=e.getBaseTarget(b),w=e.getValue(b);w&&(w.liveStyle=!0),x[b]=v??null}),f.push({animation:x})}let y=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function o(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(c,u)}),n[c].isActive=u;const f=s(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:s,setActive:o,setAnimateFunction:a,getState:()=>n,reset:()=>{n=k2(),r=!0}}}function KX(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!BM(t,e):!1}function Es(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function k2(){return{animate:Es(!0),whileInView:Es(),whileHover:Es(),whileTap:Es(),whileDrag:Es(),whileFocus:Es(),exit:Es()}}class vs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class GX extends vs{constructor(t){super(t),t.animationState||(t.animationState=HX(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Lm(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 qX=0;class YX extends vs{constructor(){super(...arguments),this.id=qX++}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 XX={animation:{Feature:GX},exit:{Feature:YX}};function Zu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function _d(e){return{point:{x:e.pageX,y:e.pageY}}}const ZX=e=>t=>s1(t)&&e(t,_d(t));function gu(e,t,n,r){return Zu(e,t,ZX(n),r)}const j2=(e,t)=>Math.abs(e-t);function QX(e,t){const n=j2(e.x,t.x),r=j2(e.y,t.y);return Math.sqrt(n**2+r**2)}class A4{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 f=V0(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=QX(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:g}=f,{timestamp:y}=gn;this.history.push({...g,timestamp:y});const{onStart:x,onMove:b}=this.handlers;h||(x&&x(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=U0(h,this.transformPagePoint),jt.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=V0(f.type==="pointercancel"?this.lastMoveEventInfo:U0(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,x),g&&g(f,x)},!s1(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=_d(t),o=U0(s,this.transformPagePoint),{point:c}=o,{timestamp:u}=gn;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,V0(o,this.history)),this.removeListeners=Od(gu(this.contextWindow,"pointermove",this.handlePointerMove),gu(this.contextWindow,"pointerup",this.handlePointerUp),gu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),cs(this.updatePoint)}}function U0(e,t){return t?{point:t(e.point)}:e}function N2(e,t){return{x:e.x-t.x,y:e.y-t.y}}function V0({point:e},t){return{point:e,delta:N2(e,T4(t)),offset:N2(e,JX(t)),velocity:eZ(t,.1)}}function JX(e){return e[0]}function T4(e){return e[e.length-1]}function eZ(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=T4(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>na(t)));)n--;if(!r)return{x:0,y:0};const a=ra(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const s={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}const O4=1e-4,tZ=1-O4,nZ=1+O4,_4=.01,rZ=0-_4,iZ=0+_4;function Sr(e){return e.max-e.min}function aZ(e,t,n){return Math.abs(e-t)<=n}function C2(e,t,n,r=.5){e.origin=r,e.originPoint=_t(t.min,t.max,e.origin),e.scale=Sr(n)/Sr(t),e.translate=_t(n.min,n.max,e.origin)-e.originPoint,(e.scale>=tZ&&e.scale<=nZ||isNaN(e.scale))&&(e.scale=1),(e.translate>=rZ&&e.translate<=iZ||isNaN(e.translate))&&(e.translate=0)}function yu(e,t,n,r){C2(e.x,t.x,n.x,r?r.originX:void 0),C2(e.y,t.y,n.y,r?r.originY:void 0)}function P2(e,t,n){e.min=n.min+t.min,e.max=e.min+Sr(t)}function sZ(e,t,n){P2(e.x,t.x,n.x),P2(e.y,t.y,n.y)}function E2(e,t,n){e.min=t.min-n.min,e.max=e.min+Sr(t)}function xu(e,t,n){E2(e.x,t.x,n.x),E2(e.y,t.y,n.y)}function oZ(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?_t(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?_t(n,e,r.max):Math.min(e,n)),e}function A2(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 lZ(e,{top:t,left:n,bottom:r,right:i}){return{x:A2(e.x,n,i),y:A2(e.y,t,r)}}function T2(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function cZ(e,t){return{x:T2(e.x,t.x),y:T2(e.y,t.y)}}function uZ(e,t){let n=.5;const r=Sr(e),i=Sr(t);return i>r?n=Fl(t.min,t.max-r,e.min):r>i&&(n=Fl(e.min,e.max-i,t.min)),da(0,1,n)}function dZ(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 Zx=.35;function fZ(e=Zx){return e===!1?e=0:e===!0&&(e=Zx),{x:O2(e,"left","right"),y:O2(e,"top","bottom")}}function O2(e,t,n){return{min:_2(e,t),max:_2(e,n)}}function _2(e,t){return typeof e=="number"?e:e[t]||0}const M2=()=>({translate:0,scale:1,origin:0,originPoint:0}),ll=()=>({x:M2(),y:M2()}),D2=()=>({min:0,max:0}),Ut=()=>({x:D2(),y:D2()});function Mr(e){return[e("x"),e("y")]}function M4({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function hZ({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function pZ(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 W0(e){return e===void 0||e===1}function Qx({scale:e,scaleX:t,scaleY:n}){return!W0(e)||!W0(t)||!W0(n)}function Is(e){return Qx(e)||D4(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function D4(e){return I2(e.x)||I2(e.y)}function I2(e){return e&&e!=="0%"}function cp(e,t,n){const r=e-n,i=t*r;return n+i}function L2(e,t,n,r,i){return i!==void 0&&(e=cp(e,i,r)),cp(e,n,r)+t}function Jx(e,t=0,n=1,r,i){e.min=L2(e.min,t,n,r,i),e.max=L2(e.max,t,n,r,i)}function I4(e,{x:t,y:n}){Jx(e.x,t.translate,t.scale,t.originPoint),Jx(e.y,n.translate,n.scale,n.originPoint)}const R2=.999999999999,F2=1.0000000000001;function mZ(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,s;for(let o=0;o<i;o++){a=n[o],s=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&ul(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,I4(e,s)),r&&Is(a.latestValues)&&ul(e,a.latestValues))}t.x<F2&&t.x>R2&&(t.x=1),t.y<F2&&t.y>R2&&(t.y=1)}function cl(e,t){e.min=e.min+t,e.max=e.max+t}function z2(e,t,n,r,i=.5){const a=_t(e.min,e.max,i);Jx(e,t,n,a,r)}function ul(e,t){z2(e.x,t.x,t.scaleX,t.scale,t.originX),z2(e.y,t.y,t.scaleY,t.scale,t.originY)}function L4(e,t){return M4(pZ(e.getBoundingClientRect(),t))}function gZ(e,t,n){const r=L4(e,n),{scroll:i}=t;return i&&(cl(r.x,i.offset.x),cl(r.y,i.offset.y)),r}const R4=({current:e})=>e?e.ownerDocument.defaultView:null,yZ=new WeakMap;class xZ{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=Ut(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(_d(d).point)},a=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=uY(h),!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),Mr(x=>{let b=this.getAxisMotionValue(x).get()||0;if(Ti.test(b)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[x];w&&(b=Sr(w)*(parseFloat(b)/100))}}this.originPoint[x]=b}),g&&jt.postRender(()=>g(d,f)),Vx(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},s=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:g,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:x}=f;if(p&&this.currentDirection===null){this.currentDirection=vZ(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,x),this.updateAxis("y",f.point,x),this.visualElement.render(),y&&y(d,f)},o=(d,f)=>this.stop(d,f),c=()=>Mr(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new A4(t,{onSessionStart:i,onStart:a,onMove:s,onSessionEnd:o,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:R4(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&&jt.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||!Af(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=oZ(s,this.constraints[t],this.elastic[t])),a.set(s)}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&&sl(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=lZ(i.layoutBox,n):this.constraints=!1,this.elastic=fZ(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Mr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=dZ(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!sl(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=gZ(r,i.root,this.visualElement.getTransformPagePoint());let s=cZ(i.layout.layoutBox,a);if(n){const o=n(hZ(s));this.hasMutatedConstraints=!!o,o&&(s=M4(o))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),c=this.constraints||{},u=Mr(d=>{if(!Af(d,n,this.currentDirection))return;let f=c&&c[d]||{};s&&(f={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Vx(this.visualElement,t),r.start(x1(t,r,0,n,this.visualElement,!1))}stopAnimation(){Mr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Mr(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){Mr(n=>{const{drag:r}=this.getProps();if(!Af(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:o}=i.layout.layoutBox[n];a.set(t[n]-_t(s,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!sl(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Mr(s=>{const o=this.getAxisMotionValue(s);if(o&&this.constraints!==!1){const c=o.get();i[s]=uZ({min:c,max:c},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Mr(s=>{if(!Af(s,t,null))return;const o=this.getAxisMotionValue(s),{min:c,max:u}=this.constraints[s];o.set(_t(c,u,i[s]))})}addListeners(){if(!this.visualElement.current)return;yZ.set(this.visualElement,this);const t=this.visualElement.current,n=gu(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();sl(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),jt.read(r);const s=Zu(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Mr(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{s(),n(),a(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:s=Zx,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:s,dragMomentum:o}}}function Af(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function vZ(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class bZ extends vs{constructor(t){super(t),this.removeGroupControls=vr,this.removeListeners=vr,this.controls=new xZ(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vr}unmount(){this.removeGroupControls(),this.removeListeners()}}const $2=e=>(t,n)=>{e&&jt.postRender(()=>e(t,n))};class wZ extends vs{constructor(){super(...arguments),this.removePointerDownListener=vr}onPointerDown(t){this.session=new A4(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:R4(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:$2(t),onStart:$2(n),onMove:r,onEnd:(a,s)=>{delete this.session,i&&jt.postRender(()=>i(a,s))}}}mount(){this.removePointerDownListener=gu(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 gh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function B2(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const _c={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ie.test(e))e=parseFloat(e);else return e;const n=B2(e,t.target.x),r=B2(e,t.target.y);return`${n}% ${r}%`}},SZ={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=us.parse(e);if(i.length>5)return r;const a=us.createTransformer(e),s=typeof i[0]!="number"?1:0,o=n.x.scale*t.x,c=n.y.scale*t.y;i[0+s]/=o,i[1+s]/=c;const u=_t(o,c,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),a(i)}};class kZ extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;Vq(jZ),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()})),gh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,s=r.projection;return s&&(s.isPresent=a,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?s.promote():s.relegate()||jt.postRender(()=>{const o=s.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Gw.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 F4(e){const[t,n]=bM(),r=m.useContext(zw);return l.jsx(kZ,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(EM),isPresent:t,safeToRemove:n})}const jZ={borderRadius:{..._c,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_c,borderTopRightRadius:_c,borderBottomLeftRadius:_c,borderBottomRightRadius:_c,boxShadow:SZ};function NZ(e,t,n){const r=_n(e)?e:Yu(e);return r.start(x1("",r,t,n)),r.animation}function CZ(e){return e instanceof SVGElement&&e.tagName!=="svg"}const PZ=(e,t)=>e.depth-t.depth;class EZ{constructor(){this.children=[],this.isDirty=!1}add(t){o1(this.children,t),this.isDirty=!0}remove(t){l1(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(PZ),this.isDirty=!1,this.children.forEach(t)}}function AZ(e,t){const n=Oi.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(cs(r),e(a-t))};return jt.read(r,!0),()=>cs(r)}const z4=["TopLeft","TopRight","BottomLeft","BottomRight"],TZ=z4.length,U2=e=>typeof e=="string"?parseFloat(e):e,V2=e=>typeof e=="number"||Ie.test(e);function OZ(e,t,n,r,i,a){i?(e.opacity=_t(0,n.opacity!==void 0?n.opacity:1,_Z(r)),e.opacityExit=_t(t.opacity!==void 0?t.opacity:1,0,MZ(r))):a&&(e.opacity=_t(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<TZ;s++){const o=`border${z4[s]}Radius`;let c=W2(t,o),u=W2(n,o);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||V2(c)===V2(u)?(e[o]=Math.max(_t(U2(c),U2(u),r),0),(Ti.test(u)||Ti.test(c))&&(e[o]+="%")):e[o]=u}(t.rotate||n.rotate)&&(e.rotate=_t(t.rotate||0,n.rotate||0,r))}function W2(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const _Z=$4(0,.5,i4),MZ=$4(.5,.95,vr);function $4(e,t,n){return r=>r<e?0:r>t?1:n(Fl(e,t,r))}function H2(e,t){e.min=t.min,e.max=t.max}function Er(e,t){H2(e.x,t.x),H2(e.y,t.y)}function K2(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function G2(e,t,n,r,i){return e-=t,e=cp(e,1/n,r),i!==void 0&&(e=cp(e,1/i,r)),e}function DZ(e,t=0,n=1,r=.5,i,a=e,s=e){if(Ti.test(t)&&(t=parseFloat(t),t=_t(s.min,s.max,t/100)-s.min),typeof t!="number")return;let o=_t(a.min,a.max,r);e===a&&(o-=t),e.min=G2(e.min,t,n,o,i),e.max=G2(e.max,t,n,o,i)}function q2(e,t,[n,r,i],a,s){DZ(e,t[n],t[r],t[i],t.scale,a,s)}const IZ=["x","scaleX","originX"],LZ=["y","scaleY","originY"];function Y2(e,t,n,r){q2(e.x,t,IZ,n?n.x:void 0,r?r.x:void 0),q2(e.y,t,LZ,n?n.y:void 0,r?r.y:void 0)}function X2(e){return e.translate===0&&e.scale===1}function B4(e){return X2(e.x)&&X2(e.y)}function Z2(e,t){return e.min===t.min&&e.max===t.max}function RZ(e,t){return Z2(e.x,t.x)&&Z2(e.y,t.y)}function Q2(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function U4(e,t){return Q2(e.x,t.x)&&Q2(e.y,t.y)}function J2(e){return Sr(e.x)/Sr(e.y)}function eC(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class FZ{constructor(){this.members=[]}add(t){o1(this.members,t),t.scheduleRender()}remove(t){if(l1(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 zZ(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||a||s)&&(r=`translate3d(${i}px, ${a}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}deg) `)}const o=e.x.scale*t.x,c=e.y.scale*t.y;return(o!==1||c!==1)&&(r+=`scale(${o}, ${c})`),r||"none"}const Ls={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Jc=typeof window<"u"&&window.MotionDebug!==void 0,H0=["","X","Y","Z"],$Z={visibility:"hidden"},tC=1e3;let BZ=0;function K0(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function V4(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ZM(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",jt,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&V4(r)}function W4({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},o=t==null?void 0:t()){this.id=BZ++,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,Jc&&(Ls.totalNodes=Ls.resolvedTargetDeltas=Ls.recalculatedProjection=0),this.nodes.forEach(WZ),this.nodes.forEach(YZ),this.nodes.forEach(XZ),this.nodes.forEach(HZ),Jc&&window.MotionDebug.record(Ls)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new EZ)}addEventListener(s,o){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new c1),this.eventHandlers.get(s).add(o)}notifyListeners(s,...o){const c=this.eventHandlers.get(s);c&&c.notify(...o)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,o=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=CZ(s),this.instance=s;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),o&&(u||c)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=AZ(h,250),gh.hasAnimatedSinceResize&&(gh.hasAnimatedSinceResize=!1,this.nodes.forEach(rC))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||tQ,{onLayoutAnimationStart:x,onLayoutAnimationComplete:b}=d.getProps(),v=!this.targetLayout||!U4(this.targetLayout,g)||p,w=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const k={...r1(y,"layout"),onPlay:x,onComplete:b};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else h||rC(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cs(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(ZZ),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&V4(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:o,layout:c}=this.options;if(o===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(nC);return}this.isUpdating||this.nodes.forEach(GZ),this.isUpdating=!1,this.nodes.forEach(qZ),this.nodes.forEach(UZ),this.nodes.forEach(VZ),this.clearAllSnapshots();const o=Oi.now();gn.delta=da(0,1e3/60,o-gn.timestamp),gn.timestamp=o,gn.isProcessing=!0,L0.update.process(gn),L0.preRender.process(gn),L0.render.process(gn),gn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Gw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(KZ),this.sharedNodes.forEach(QZ)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,jt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){jt.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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ut(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(o=!1),o){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!B4(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;s&&(o||Is(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const o=this.measurePageBox();let c=this.removeElementScroll(o);return s&&(c=this.removeTransform(c)),nQ(c),{animationId:this.root.animationId,measuredBox:o,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var s;const{visualElement:o}=this.options;if(!o)return Ut();const c=o.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(rQ))){const{scroll:d}=this.root;d&&(cl(c.x,d.offset.x),cl(c.y,d.offset.y))}return c}removeElementScroll(s){var o;const c=Ut();if(Er(c,s),!((o=this.scroll)===null||o===void 0)&&o.wasRoot)return c;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Er(c,s),cl(c.x,f.offset.x),cl(c.y,f.offset.y))}return c}applyTransform(s,o=!1){const c=Ut();Er(c,s);for(let u=0;u<this.path.length;u++){const d=this.path[u];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&ul(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Is(d.latestValues)&&ul(c,d.latestValues)}return Is(this.latestValues)&&ul(c,this.latestValues),c}removeTransform(s){const o=Ut();Er(o,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Is(u.latestValues))continue;Qx(u.latestValues)&&u.updateSnapshot();const d=Ut(),f=u.measurePageBox();Er(d,f),Y2(o,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Is(this.latestValues)&&Y2(o,this.latestValues),o}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==gn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var o;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=gn.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ut(),this.relativeTargetOrigin=Ut(),xu(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Er(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Ut(),this.targetWithTransforms=Ut()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),sZ(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Er(this.target,this.layout.layoutBox),I4(this.target,this.targetDelta)):Er(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ut(),this.relativeTargetOrigin=Ut(),xu(this.relativeTargetOrigin,this.target,p.target),Er(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Jc&&Ls.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Qx(this.parent.latestValues)||D4(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 s;const o=this.getLead(),c=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===gn.timestamp&&(u=!1),u)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;Er(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;mZ(this.layoutCorrected,this.treeScale,this.path,c),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Ut());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(K2(this.prevProjectionDelta.x,this.projectionDelta.x),K2(this.prevProjectionDelta.y,this.projectionDelta.y)),yu(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!eC(this.projectionDelta.x,this.prevProjectionDelta.x)||!eC(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g)),Jc&&Ls.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var o;if((o=this.options.visualElement)===null||o===void 0||o.scheduleRender(),s){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ll(),this.projectionDelta=ll(),this.projectionDeltaWithTransform=ll()}setAnimationOrigin(s,o=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=ll();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const h=Ut(),p=c?c.source:void 0,g=this.layout?this.layout.source:void 0,y=p!==g,x=this.getStack(),b=!x||x.members.length<=1,v=!!(y&&!b&&this.options.crossfade===!0&&!this.path.some(eQ));this.animationProgress=0;let w;this.mixTargetDelta=k=>{const S=k/1e3;iC(f.x,s.x,S),iC(f.y,s.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xu(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),JZ(this.relativeTarget,this.relativeTargetOrigin,h,S),w&&RZ(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Ut()),Er(w,this.relativeTarget)),y&&(this.animationValues=d,OZ(d,u,this.latestValues,S,v,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=jt.update(()=>{gh.hasAnimatedSinceResize=!0,this.currentAnimation=NZ(0,tC,{...s,onUpdate:o=>{this.mixTargetDelta(o),s.onUpdate&&s.onUpdate(o)},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(tC),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:o,target:c,layout:u,latestValues:d}=s;if(!(!o||!c||!u)){if(this!==s&&this.layout&&u&&H4(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Ut();const f=Sr(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+f;const h=Sr(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+h}Er(o,c),ul(o,d),yu(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(s,o){this.sharedNodes.has(s)||this.sharedNodes.set(s,new FZ),this.sharedNodes.get(s).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:o}=this.options;return o?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:o}=this.options;return o?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:o,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let o=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(o=!0),!o)return;const u={};c.z&&K0("z",s,u,this.animationValues);for(let d=0;d<H0.length;d++)K0(`rotate${H0[d]}`,s,u,this.animationValues),K0(`skew${H0[d]}`,s,u,this.animationValues);s.render();for(const d in u)s.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);s.scheduleRender()}getProjectionStyles(s){var o,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return $Z;const u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=ph(s==null?void 0:s.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=ph(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!Is(this.latestValues)&&(y.transform=d?d({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=zZ(this.projectionDeltaWithTransform,this.treeScale,h),d&&(u.transform=d(h,u.transform));const{x:p,y:g}=this.projectionDelta;u.transformOrigin=`${p.origin*100}% ${g.origin*100}% 0`,f.animationValues?u.opacity=f===this?(c=(o=h.opacity)!==null&&o!==void 0?o:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:u.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in ip){if(h[y]===void 0)continue;const{correct:x,applyTo:b}=ip[y],v=u.transform==="none"?h[y]:x(h[y],f);if(b){const w=b.length;for(let k=0;k<w;k++)u[b[k]]=v}else u[y]=v}return this.options.layoutId&&(u.pointerEvents=f===this?ph(s==null?void 0:s.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var o;return(o=s.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(nC),this.root.sharedNodes.clear()}}}function UZ(e){e.updateLayout()}function VZ(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,s=n.source!==e.layout.source;a==="size"?Mr(f=>{const h=s?n.measuredBox[f]:n.layoutBox[f],p=Sr(h);h.min=r[f].min,h.max=h.min+p}):H4(a,n.layoutBox,r)&&Mr(f=>{const h=s?n.measuredBox[f]:n.layoutBox[f],p=Sr(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const o=ll();yu(o,r,n.layoutBox);const c=ll();s?yu(c,e.applyTransform(i,!0),n.measuredBox):yu(c,r,n.layoutBox);const u=!B4(o);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const g=Ut();xu(g,n.layoutBox,h.layoutBox);const y=Ut();xu(y,r,p.layoutBox),U4(g,y)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:o,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function WZ(e){Jc&&Ls.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 HZ(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function KZ(e){e.clearSnapshot()}function nC(e){e.clearMeasurements()}function GZ(e){e.isLayoutDirty=!1}function qZ(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function rC(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function YZ(e){e.resolveTargetDelta()}function XZ(e){e.calcProjection()}function ZZ(e){e.resetSkewAndRotation()}function QZ(e){e.removeLeadSnapshot()}function iC(e,t,n){e.translate=_t(t.translate,0,n),e.scale=_t(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function aC(e,t,n,r){e.min=_t(t.min,n.min,r),e.max=_t(t.max,n.max,r)}function JZ(e,t,n,r){aC(e.x,t.x,n.x,r),aC(e.y,t.y,n.y,r)}function eQ(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const tQ={duration:.45,ease:[.4,0,.1,1]},sC=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),oC=sC("applewebkit/")&&!sC("chrome/")?Math.round:vr;function lC(e){e.min=oC(e.min),e.max=oC(e.max)}function nQ(e){lC(e.x),lC(e.y)}function H4(e,t,n){return e==="position"||e==="preserve-aspect"&&!aZ(J2(t),J2(n),.2)}function rQ(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const iQ=W4({attachResizeListener:(e,t)=>Zu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),G0={current:void 0},K4=W4({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!G0.current){const e=new iQ({});e.mount(window),e.setOptions({layoutScroll:!0}),G0.current=e}return G0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),aQ={pan:{Feature:wZ},drag:{Feature:bZ,ProjectionNode:K4,MeasureLayout:F4}};function cC(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&&jt.postRender(()=>a(t,_d(t)))}class sQ extends vs{mount(){const{current:t}=this.node;t&&(this.unmount=aY(t,n=>(cC(this.node,n,"Start"),r=>cC(this.node,r,"End"))))}unmount(){}}class oQ extends vs{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=Od(Zu(this.node.current,"focus",()=>this.onFocus()),Zu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function uC(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&&jt.postRender(()=>a(t,_d(t)))}class lQ extends vs{mount(){const{current:t}=this.node;t&&(this.unmount=cY(t,n=>(uC(this.node,n,"Start"),(r,{success:i})=>uC(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ev=new WeakMap,q0=new WeakMap,cQ=e=>{const t=ev.get(e.target);t&&t(e)},uQ=e=>{e.forEach(cQ)};function dQ({root:e,...t}){const n=e||document;q0.has(n)||q0.set(n,{});const r=q0.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(uQ,{root:e,...t})),r[i]}function fQ(e,t,n){const r=dQ(t);return ev.set(e,n),r.observe(e),()=>{ev.delete(e),r.unobserve(e)}}const hQ={some:0,all:1};class pQ extends vs{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,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:hQ[i]},o=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return fQ(this.node.current,s,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(mQ(t,n))&&this.startObserver()}unmount(){}}function mQ({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const gQ={inView:{Feature:pQ},tap:{Feature:lQ},focus:{Feature:oQ},hover:{Feature:sQ}},yQ={layout:{ProjectionNode:K4,MeasureLayout:F4}},tv={current:null},G4={current:!1};function xQ(){if(G4.current=!0,!!Uw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>tv.current=e.matches;e.addListener(t),t()}else tv.current=!1}const vQ=[...x4,Pn,us],bQ=e=>vQ.find(y4(e)),dC=new WeakMap;function wQ(e,t,n){for(const r in t){const i=t[r],a=n[r];if(_n(i))e.addValue(r,i);else if(_n(a))e.addValue(r,Yu(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,Yu(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const fC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class SQ{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=m1,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 p=Oi.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,jt.render(this.render,!1,!0))};const{latestValues:c,renderState:u,onUpdate:d}=s;this.onUpdate=d,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.blockInitialAnimation=!!a,this.isControllingVariants=Rm(n),this.isVariantNode=CM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const g=h[p];c[p]!==void 0&&_n(g)&&g.set(c[p],!1)}}mount(t){this.current=t,dC.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)),G4.current||xQ(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:tv.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){dC.delete(this.current),this.projection&&this.projection.unmount(),cs(this.notifyUpdate),cs(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=Eo.has(t),i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&jt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),s&&s(),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 zl){const n=zl[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):Ut()}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<fC.length;r++){const i=fC[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,s=t[a];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=wQ(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=Yu(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"&&(m4(i)||s4(i))?i=parseFloat(i):!bQ(i)&&us.test(n)&&(i=f4(t,n)),this.setBaseTarget(t,_n(i)?i.get():i)),_n(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 s=Yw(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[t])}if(r&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!_n(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 c1),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class q4 extends SQ{constructor(){super(...arguments),this.KeyframeResolver=v4}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;_n(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function kQ(e){return window.getComputedStyle(e)}class jQ extends q4{constructor(){super(...arguments),this.type="html",this.renderInstance=IM}readValueFromInstance(t,n){if(Eo.has(n)){const r=p1(n);return r&&r.default||0}else{const r=kQ(t),i=(_M(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return L4(t,n)}build(t,n,r){Qw(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return n1(t,n,r)}}class NQ extends q4{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ut}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Eo.has(n)){const r=p1(n);return r&&r.default||0}return n=LM.has(n)?n:Kw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return zM(t,n,r)}build(t,n,r){Jw(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){RM(t,n,r,i)}mount(t){this.isSVGTag=t1(t.tagName),super.mount(t)}}const CQ=(e,t)=>qw(e)?new NQ(t):new jQ(t,{allowProjection:e!==m.Fragment}),PQ=Qq({...XX,...gQ,...aQ,...yQ},CQ),cn=hq(PQ),EQ={Core:mo,Network:Il,Security:si,Database:qO,Utility:Gs,Custom:Gs,Monitoring:mo,Automation:si},Y4=e=>EQ[e]||Gs;async function nv(e,t){const n=await e("skill.list",t);return{skills:(n.skills??[]).map(i=>({...i,icon:Y4(i.type||"Custom"),version:`v${i.version||1}`,enabled:i.enabled??!0})),hasMore:n.hasMore??!1}}async function rv(e,t){var r,i,a;const n=await e("skill.get",{id:t});return n?{...n,icon:Y4(n.type||"Custom"),version:`v${n.version||1}`,enabled:n.enabled??!0,specs:(r=n.files)==null?void 0:r.specs,scripts:(a=(i=n.files)==null?void 0:i.scripts)==null?void 0:a.map((s,o)=>({id:`s-${o}`,info:s.name.endsWith(".py")?"python":"shell",name:s.name,content:s.content})),publishedFiles:n.publishedFiles??null,stagingVersion:n.stagingVersion}:null}async function AQ(e,t,n){var i;const r=(i=t.scripts)==null?void 0:i.map(a=>({name:a.name,content:a.content}));n?await e("skill.create",{name:t.name,description:t.description,type:t.type,specs:t.specs,scripts:r,labels:t.labels}):await e("skill.update",{id:String(t.id),name:t.name,description:t.description,type:t.type,specs:t.specs,scripts:r})}async function TQ(e,t){await e("skill.delete",{id:t})}async function OQ(e,t,n){return e("skill.vote",{id:t,vote:n})}async function _Q(e,t,n){return e("skill.revert",{id:t,reason:n})}async function MQ(e,t,n,r,i){return e("skill.review",{id:t,decision:n,reason:r,stagingVersion:i})}async function DQ(e,t,n){return e("skill.submit",{id:t,contributeToTeam:n})}async function IQ(e,t){return e("skill.withdraw",{id:t})}async function hC(e,t){return e("skill.getReview",{id:t})}async function LQ(e,t){return e("skill.history",{id:t})}async function RQ(e,t,n){return e("skill.diff",{id:t,teamDiff:n})}async function X4(e,t,n){return e("skill.rollback",{id:t,version:n})}async function FQ(e){return(await e("label.list")).labels??[]}async function pC(e,t,n){return e("skill.updateLabels",{id:t,labels:n})}async function zQ(e,t,n){return e("skill.fork",{sourceId:t,...n})}async function Z4(e,t){return zQ(e,String(t))}function mC(e,t){const n={...e,hypotheses:[...e.hypotheses]};switch(t.type){case"phase":n.phase=t.phase,t.detail&&(n.currentAction=t.detail);break;case"hypothesis":{const r=t.id,i=n.hypotheses.findIndex(s=>s.id===r),a={id:r,text:t.text||(i>=0?n.hypotheses[i].text:""),status:t.status,confidence:t.confidence,callsUsed:i>=0?n.hypotheses[i].callsUsed:0,maxCalls:i>=0?n.hypotheses[i].maxCalls:10};i>=0?n.hypotheses[i]={...n.hypotheses[i],...a}:n.hypotheses.push(a);break}case"tool_exec":{const r=t.hypothesisId,i=t.callsUsed,a=t.maxCalls,s=t.tool,o=t.command,c=o.length>60?o.slice(0,57)+"...":o;if(n.currentAction=`${r?r+" ":""}[${i}/${a}] ${s}: ${c}`,r){const u=n.hypotheses.findIndex(d=>d.id===r);u>=0&&(n.hypotheses[u]={...n.hypotheses[u],callsUsed:i,maxCalls:a,lastAction:`[${i}/${a}] ${s}: ${c}`,status:n.hypotheses[u].status==="pending"?"validating":n.hypotheses[u].status})}break}case"budget_exhausted":{const r=t.hypothesisId;if(r){const i=n.hypotheses.findIndex(a=>a.id===r);i>=0&&(n.hypotheses[i]={...n.hypotheses[i],callsUsed:t.callsUsed})}break}}return n}const Y0="siclaw_current_session",X0="siclaw_session_workspace",gC="siclaw_selected_brain";function Z0(){return[{id:"triage",label:"Quick triage",status:"pending"},{id:"hypotheses",label:"Propose hypotheses",status:"pending"},{id:"deep_search",label:"Deep search validation",status:"pending"},{id:"conclusion",label:"Present findings",status:"pending"}]}function $Q(e,t){try{const n=JSON.parse(t);return Q4(e,n)}catch{return t}}function Q4(e,t){if(!t)return"";const n=e.toLowerCase();if(n==="bash"||n==="shell"||n==="command")return t.command||t.cmd||"";if(n==="node_exec"){const i=t.node||"",a=t.command||"";return i&&a?`${i} $ ${a}`:i||a}if(n==="node_script"){const i=t.node||"",a=t.skill||"",s=t.script||"",o=t.args||"",c=[a,s].filter(Boolean).join("/"),u=o?`${c} ${o}`:c;return i&&u?`${i} $ ${u}`:i||u}if(n==="pod_exec"){const i=t.pod||"",a=t.namespace||"",s=t.command||"",o=a?`${i} -n ${a}`:i;return o&&s?`${o} $ ${s}`:o||s}if(n==="pod_script"){const i=t.pod||"",a=t.namespace||"",s=t.skill||"",o=t.script||"",c=t.args||"",u=a?`${i} -n ${a}`:i,d=[s,o].filter(Boolean).join("/"),f=c?`${d} ${c}`:d;return u&&f?`${u} $ ${f}`:u||f}if(n==="pod_nsenter_exec"){const i=t.pod||"",a=t.namespace||"",s=t.command||"",o=a?`${i} -n ${a}`:i;return o&&s?`${o} $ ${s}`:o||s}if(n==="read"||n==="readfile"||n==="write"||n==="writefile"||n==="edit")return t.file_path||t.path||"";if(n==="grep"||n==="search"){const i=t.pattern||"",a=t.path||"";return a?`${i} in ${a}`:i}if(n==="glob")return t.pattern||"";if(n==="create_skill")return t.name||"";if(n==="run_skill"){const i=t.skill||"",a=t.script||"",s=t.args||"",o=[i,a].filter(Boolean).join("/");return s?`${o} ${s}`:o}if(n==="task_plan")return t.title||"";if(n==="deep_search")return t.question||"";if(n==="update_plan"){const i=t.step,a=t.status||"";return i!=null?`Step ${i}: ${a}`:a}return Object.values(t).filter(i=>typeof i=="string"&&i.length>0)[0]||JSON.stringify(t)}function BQ(){const{currentWorkspace:e}=Ed(),t=e==null?void 0:e.id,n=m.useRef(t),[r,i]=m.useState([]),[a,s]=m.useState(null),[o,c]=m.useState(null),[u,d]=m.useState(null),f="siclaw_dp_active",[h,p]=m.useState(()=>localStorage.getItem(f)==="true"),[g,y]=m.useState([]),[x,b]=m.useState(()=>{const $=sessionStorage.getItem(Y0);return!$||sessionStorage.getItem(X0)!==(t??"")?null:$}),[v,w]=m.useState(!1),[k,S]=m.useState([]),[j,N]=m.useState(!1),[P,A]=m.useState(!1),[E,O]=m.useState(!1),[C,M]=m.useState(null),[I,B]=m.useState(!1),se=m.useRef(!1),[Q,D]=m.useState([]),[K,T]=m.useState(null),[ie,J]=m.useState(null),[_,H]=m.useState([]),[ee,be]=m.useState(null),[te,ye]=m.useState(null),[Z,ne]=m.useState(()=>localStorage.getItem(gC)||"pi-agent"),[ve,L]=m.useState(null),W=m.useRef(()=>{}),F=m.useRef(()=>{}),le=m.useRef(()=>{}),oe=m.useRef(()=>{}),Re=m.useRef(0),We=m.useRef(),nt=m.useRef(x);m.useEffect(()=>{nt.current=x},[x]);const Nt=m.useRef(0),hn=m.useRef(async()=>{}),Xt=m.useRef(new Set),xt=($,G)=>{const re=setTimeout(()=>{Xt.current.delete(re),$()},G);Xt.current.add(re)},rt=()=>{for(const $ of Xt.current)clearTimeout($);Xt.current.clear()},it=()=>{d(null),c(null),s(null)};m.useEffect(()=>{x?(sessionStorage.setItem(Y0,x),sessionStorage.setItem(X0,t??"")):(sessionStorage.removeItem(Y0),sessionStorage.removeItem(X0))},[x,t]),m.useEffect(()=>{localStorage.setItem(f,String(h))},[h]),m.useEffect(()=>{localStorage.setItem(gC,Z)},[Z]);const X=m.useCallback($=>{ne($)},[]),de=m.useCallback($=>{var G,re,xe;if($.type==="event"&&$.payload){const we=$.payload,ke=we.sessionId;if(ke&&ke!==nt.current)return;switch(Re.current=Date.now(),we.type){case"message_update":{const ue=we.assistantMessageEvent;(ue==null?void 0:ue.type)==="text_delta"&&ue.delta&&i(Se=>{const Te=Se[Se.length-1];return Te!=null&&Te.isStreaming&&Te.role==="assistant"?[...Se.slice(0,-1),{...Te,content:Te.content+ue.delta}]:[...Se,{id:`msg-${Date.now()}`,role:"assistant",content:ue.delta,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),isStreaming:!0}]});break}case"tool_execution_start":{const ue=we.toolName,Se=we.args,Te=Q4(ue??"",Se),Ue=ue==="update_plan"||ue==="manage_checklist"||ue==="end_investigation";if(ue==="deep_search"&&s(_e=>_e??{hypotheses:[]}),ue==="manage_checklist"){const _e=(Se==null?void 0:Se.updates)||[];d(Fe=>{const It=Fe?Fe.map(ct=>({...ct})):Z0();for(const ct of _e){const js=It.find(Ns=>Ns.id===ct.id);js&&(ct.status&&(ct.status==="done"||ct.status==="skipped"||ct.status==="in_progress"||ct.status==="pending")&&(js.status=ct.status),ct.summary&&(js.summary=ct.summary))}const Xn=It.find(ct=>ct.status==="in_progress");return c(Xn?Xn.id:null),It.every(ct=>ct.status==="done"||ct.status==="skipped")&&xt(()=>it(),3e3),It})}ue==="end_investigation"&&it(),i(_e=>[..._e,{id:`tool-${Date.now()}`,role:"tool",content:"",toolName:ue??"tool",toolInput:Te,toolStatus:"running",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),isStreaming:!0,hidden:Ue}]);break}case"tool_execution_end":{const ue=we.result,Se=((G=ue==null?void 0:ue.content)==null?void 0:G.filter(Fe=>Fe.type==="text").map(Fe=>Fe.text??"").join(""))??"",Te=ue==null?void 0:ue.details,Ue=we.isError,_e=we.dbMessageId;i(Fe=>{const It=Fe[Fe.length-1];return(It==null?void 0:It.role)==="tool"&&It.isStreaming?(It.toolName==="deep_search"&&xt(()=>{s(Xn=>Xn&&Xn.hypotheses.every(ur=>ur.status!=="validating"&&ur.status!=="pending")?null:Xn)},5e3),[...Fe.slice(0,-1),{...It,content:Se,toolStatus:Ue?"error":"success",isStreaming:!1,...Te?{toolDetails:Te}:{},..._e?{id:_e}:{}}]):Fe});break}case"tool_progress":{const ue=we.progress;we.toolName==="deep_search"&&ue&&s(Se=>mC(Se??{hypotheses:[]},ue));break}case"message_start":{const ue=we.message;if((ue==null?void 0:ue.customType)==="dp-checklist-sync"&&((re=ue.details)!=null&&re.items)){const Se=ue.details.items;d(Te=>{if(!Te)return Te;const Ue=Te.map(Fe=>({...Fe}));for(const Fe of Se){const It=Ue.find(Xn=>Xn.id===Fe.id);It&&(It.status=Fe.status,Fe.summary&&(It.summary=Fe.summary))}return Ue.every(Fe=>Fe.status==="done"||Fe.status==="skipped")&&xt(()=>it(),3e3),Ue});break}if((ue==null?void 0:ue.role)==="user"){const Se=((xe=ue.content)==null?void 0:xe.filter(Te=>Te.type==="text").map(Te=>Te.text??"").join(""))??"";Se&&S(Te=>{const Ue=Te.indexOf(Se);return Ue<0?Te:(i(_e=>[..._e,{id:`msg-${Date.now()}`,role:"user",content:Se,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}]),[...Te.slice(0,Ue),...Te.slice(Ue+1)])})}break}case"message_end":i(ue=>ue.map(Se=>Se.isStreaming&&Se.role==="assistant"?{...Se,isStreaming:!1}:Se));break;case"auto_compaction_start":B(!0);break;case"auto_compaction_end":B(!1),F.current();break;case"turn_end":i(ue=>ue.map(Se=>Se.isStreaming?{...Se,isStreaming:!1}:Se)),S(ue=>ue.length>0?ue.slice(1):ue);break;case"prompt_done":i(ue=>ue.map(Se=>Se.isStreaming?{...Se,isStreaming:!1}:Se)),se.current||w(!1),S([]),W.current(),F.current(),le.current(),oe.current(),d(ue=>{if(!ue)return ue;const Se=ue.find(_e=>_e.id==="deep_search");if(!Se||Se.status!=="done"||!ue.some(_e=>_e.status==="pending"||_e.status==="in_progress"))return ue;const Ue=ue.map(_e=>_e.status==="pending"||_e.status==="in_progress"?{..._e,status:"done",summary:_e.summary||"Auto-completed"}:_e);return xt(()=>it(),3e3),Ue});break}}},[]),{status:Ee,sendRpc:fe,isConnected:R}=$t({onMessage:de}),me=m.useCallback(async()=>{if(R)try{const $=await nv(fe);D($.skills)}catch($){console.error("Failed to load skills:",$)}},[R,fe]),Ae=m.useCallback(async()=>{if(R)try{const $=await fe("model.list"),G=$.models??[];if(H(G),be($.default??null),G.length>0)if($.default){const re=G.find(xe=>xe.provider===$.default.provider&&xe.id===$.default.modelId);ye(re||(xe=>xe??G[0]))}else ye(re=>re??G[0])}catch($){console.error("Failed to load models:",$)}},[R,fe]),ze=m.useCallback(async()=>{if(R)try{const $=await fe("system.status");T($)}catch{}},[R,fe]),ht=m.useCallback(async()=>{if(!(!R||!x||te))try{const $=await fe("model.get",{sessionId:x});$.model&&ye($.model),$.brainType&&L($.brainType)}catch{}},[R,x,te,fe]),Je=m.useCallback(($,G)=>{J({id:$,name:G})},[]),pt=m.useCallback(()=>{J(null)},[]),Wt=m.useCallback(async()=>{if(R)try{const $={};t&&($.workspaceId=t);const G=await fe("session.list",$);y(G.sessions??[])}catch($){console.error("Failed to load sessions:",$)}},[R,fe,t]);W.current=Wt,le.current=Ae,oe.current=ht;const Ct=m.useCallback(async()=>{if(!(!R||!x))try{const $=await fe("chat.context",{sessionId:x});$&&M({tokens:$.tokens,contextWindow:$.contextWindow,percent:$.percent,inputTokens:$.inputTokens,outputTokens:$.outputTokens,cacheReadTokens:$.cacheReadTokens,cacheWriteTokens:$.cacheWriteTokens,cost:$.cost})}catch{}},[R,x,fe]);F.current=Ct;const ae=$=>$.map(G=>({...G,toolInput:G.role==="tool"&&G.toolInput?$Q(G.toolName??"",G.toolInput):void 0,isoTimestamp:G.timestamp,timestamp:G.timestamp?new Date(G.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"",hidden:G.hidden||G.role==="tool"&&(G.toolName==="update_plan"||G.toolName==="manage_checklist")})),Me=m.useCallback(async $=>{if(!R)return;const G=++Nt.current;b($),i([]),A(!1),N(!0),w(!1),S([]),rt(),it();try{const re=await fe("chat.history",{sessionId:$});if(Nt.current!==G)return;i(ae(re.messages??[])),A(re.hasMore??!1)}catch(re){Nt.current===G&&console.error("Failed to load history:",re)}finally{Nt.current===G&&N(!1)}try{const re=await fe("model.get",{sessionId:$});if(Nt.current!==G)return;re.model&&ye(re.model),re.brainType&&L(re.brainType)}catch{}Nt.current===G&&await hn.current($)},[R,fe]),He=m.useCallback(async()=>{if(!R||!x||!P||E)return;const $=r[0];if($){O(!0);try{const G=await fe("chat.history",{sessionId:x,before:$.isoTimestamp}),re=ae(G.messages??[]);i(xe=>[...re,...xe]),A(G.hasMore??!1)}catch(G){console.error("Failed to load more history:",G)}finally{O(!1)}}},[R,x,P,E,r,fe]),lt=m.useCallback(async $=>{if(!R||!$.trim())return;if(v){try{await fe("chat.steer",{text:$,sessionId:nt.current}),S(re=>[...re,$])}catch(re){console.error("Failed to steer:",re)}return}$.startsWith("[Deep Investigation]")&&(d(Z0().map(re=>re.id==="triage"?{...re,status:"in_progress"}:re)),c("triage"));const G={id:`user-${Date.now()}`,role:"user",content:$,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};i(re=>[...re,G]),w(!0);try{const re=await fe("chat.send",{sessionId:x,message:$,modelProvider:te==null?void 0:te.provider,modelId:te==null?void 0:te.id,brainType:Z,workspaceId:t});re.brainType&&L(re.brainType),re.sessionId&&re.sessionId!==x&&(b(re.sessionId),W.current())}catch(re){console.error("Failed to send message:",re),w(!1)}},[R,v,x,te,Z,fe]),Ss=m.useCallback(async()=>{if(R){se.current=!0,S([]),rt(),it(),i($=>$.map(G=>G.isStreaming?{...G,isStreaming:!1,...G.role==="tool"?{toolStatus:"aborted"}:{}}:G));try{await fe("chat.abort",{sessionId:nt.current})}catch($){console.error("Failed to abort:",$)}se.current=!1,w(!1)}},[R,fe]),_o=m.useCallback(async()=>{if(S([]),!!R)try{await fe("chat.clearQueue",{sessionId:nt.current})}catch($){console.error("Failed to clear queue:",$)}},[R,fe]),mc=m.useCallback(async $=>{if(S(G=>{const re=[...G];return re.splice($,1),re}),!!R)try{await fe("chat.clearQueue",{sessionId:nt.current}),S(G=>{for(const re of G)fe("chat.steer",{text:re,sessionId:nt.current}).catch(()=>{});return G})}catch(G){console.error("Failed to remove pending message:",G)}},[R,fe]),ks=m.useCallback(async($,G)=>{if(i(re=>re.map(xe=>xe.id===$?{...xe,metadata:{...xe.metadata,...G}}:xe)),R)try{await fe("message.updateMeta",{id:$,metadata:G})}catch(re){console.error("Failed to persist message metadata:",re)}},[R,fe]),qr=m.useCallback(()=>{rt(),it()},[]),mi=m.useCallback(()=>{qr(),lt(`[DP_EXIT]
602
+ Please briefly summarize the current investigation progress and findings.`)},[qr,lt]),Ig=m.useCallback($=>{d(G=>G&&G.map(re=>re.id==="triage"&&re.status!=="done"?{...re,status:"done",summary:re.summary||"Done"}:re.id==="hypotheses"&&re.status!=="done"?{...re,status:"done",summary:re.summary||"Confirmed"}:re.id==="deep_search"?{...re,status:"in_progress"}:re)),c("deep_search"),s({hypotheses:$.map(G=>({id:G.id,text:G.text,status:"pending",confidence:G.confidence,callsUsed:0,maxCalls:10}))}),fe("chat.confirmHypotheses",{sessionId:nt.current}).catch(()=>{})},[fe]),Lg=m.useCallback(()=>{b(null),i([]),M(null),B(!1),w(!1),S([]);const $=ee?_.find(G=>G.provider===ee.provider&&G.id===ee.modelId):null;ye($??_[0]??null),L(null),rt(),it(),ze()},[_,ee,ze]),z=m.useCallback(async $=>{if(R)try{await fe("session.delete",{sessionId:$}),x===$&&(b(null),i([])),Wt()}catch(G){console.error("Failed to delete session:",G)}},[R,fe,x,Wt]),V=m.useRef();m.useEffect(()=>(!R&&v&&(V.current=setTimeout(()=>{w(!1),se.current=!1,S([]),i($=>$.map(G=>G.isStreaming?{...G,isStreaming:!1,...G.role==="tool"?{toolStatus:"error"}:{}}:G)),rt(),d($=>$?$.map(G=>G.status==="in_progress"||G.status==="pending"?{...G,status:"error",summary:"Connection lost"}:G):null),c(null),s(null),xt(()=>it(),1e4)},15e3)),()=>{V.current&&(clearTimeout(V.current),V.current=void 0)}),[R,v]);const Y=u?45e3:12e4;m.useEffect(()=>{if(v)return Re.current=Date.now(),We.current=setInterval(()=>{Date.now()-Re.current>Y&&(console.warn("[usePilot] Stale loading detected — resetting UI"),w(!1),se.current=!1,S([]),i($=>$.map(G=>G.isStreaming?{...G,isStreaming:!1,...G.role==="tool"?{toolStatus:"error"}:{}}:G)),rt(),d($=>$?$.map(G=>G.status==="in_progress"||G.status==="pending"?{...G,status:"error",summary:"Response timeout"}:G):null),c(null),s(null),xt(()=>it(),1e4))},15e3),()=>clearInterval(We.current);We.current&&(clearInterval(We.current),We.current=void 0)},[v,Y]);const ce=m.useCallback(async $=>{var re;if(!R)return;const G=$??nt.current;if(G)try{const xe=await fe("chat.dpProgress",{sessionId:G});if(xe.promptActive&&w(!0),!xe.promptActive||!xe.events||xe.events.length===0)return;let we={hypotheses:[]};for(const Te of xe.events)we=mC(we,Te);s(we);const ke=we.phase,je=Z0(),ue=ke?parseInt(((re=ke.match(/(\d+)/))==null?void 0:re[1])??"0"):0;if(ue>=1)for(let Te=0;Te<je.length;Te++)Te<ue-1?je[Te].status="done":Te===ue-1&&(je[Te].status="in_progress");else we.hypotheses.length>0&&(je[0].status="done",je[1].status="done",je[2].status="in_progress");d(je);const Se=je.find(Te=>Te.status==="in_progress");c(Se?Se.id:null)}catch{}},[R,fe]);return hn.current=ce,m.useEffect(()=>{n.current!==t&&n.current!==void 0&&(++Nt.current,b(null),i([]),M(null),B(!1),L(null),rt(),it(),R&&(async()=>{try{const $={};t&&($.workspaceId=t);const re=(await fe("session.list",$)).sessions??[];y(re),re.length>0&&Me(re[0].key)}catch($){console.error("Failed to load sessions:",$)}})()),n.current=t},[t]),m.useEffect(()=>{R&&((async()=>{try{const $={};t&&($.workspaceId=t);const re=(await fe("session.list",$)).sessions??[];y(re),x?Me(x):re.length>0&&Me(re[0].key)}catch($){console.error("Failed to load sessions:",$)}})(),me(),Ae(),ze())},[R]),m.useEffect(()=>{const $=new BroadcastChannel("siclaw-model-config");return $.onmessage=()=>{le.current()},()=>$.close()},[]),{messages:r,investigationProgress:a,dpActive:h,setDpActive:p,dpFocus:o,dpChecklist:u,sessions:g,currentSessionKey:x,isLoading:v,isLoadingHistory:j,hasMore:P,isLoadingMore:E,contextUsage:C,isCompacting:I,skills:Q,systemStatus:K,editingSkill:ie,pendingMessages:k,wsStatus:Ee,isConnected:R,sendMessage:lt,abortResponse:Ss,loadHistory:Me,loadMoreHistory:He,createSession:Lg,deleteSession:z,loadSessions:Wt,setCurrentSessionKey:b,sendRpc:fe,startEditSkill:Je,clearEditSkill:pt,loadSkills:me,updateMessageMeta:ks,clearPendingMessages:_o,removePendingMessage:mc,confirmHypotheses:Ig,dismissDpChecklist:qr,exitDpMode:mi,models:_,selectedModel:te,selectedBrain:Z,selectBrain:X,sessionBrainType:ve}}function UQ(){const[e,t]=m.useState(!1),[n,r]=m.useState(null),i=$i(),a=BQ(),{currentWorkspace:s}=Ed(),o=m.useRef(new Set),c=m.useCallback(()=>{a.clearEditSkill(),a.loadSkills()},[a]),u=m.useCallback(async h=>{(h.toolName==="create_skill"||h.toolName==="update_skill")&&await a.loadSkills(),r(null)},[a]),d=m.useCallback(h=>{r(null)},[]),f=m.useCallback(h=>{r(h)},[]);return m.useEffect(()=>{if(!n)return;const h=n.id;if(!h.startsWith("tool-")&&!h.startsWith("msg-"))return;const p=a.messages.find(g=>g.content===n.content&&g.toolName===n.toolName);p&&p.id!==n.id&&r(p)},[a.messages,n]),m.useEffect(()=>{const h=a.messages;if(h.length!==0)for(let p=h.length-1;p>=0;p--){const g=h[p];if(g.role!=="tool"||g.isStreaming||!g.content||g.isoTimestamp||g.toolName!=="create_skill"&&g.toolName!=="update_skill")continue;const y=`${g.toolName}:${g.content.slice(0,200)}`;if(o.current.has(y))continue;try{const b=JSON.parse(g.content);if(!(b!=null&&b.skill))continue}catch{continue}const x=g.metadata;if(!((x==null?void 0:x.skillCard)==="saved"||(x==null?void 0:x.skillCard)==="dismissed")){o.current.add(y),r(g);break}}},[a.messages]),l.jsxs("div",{className:"flex h-full relative bg-white overflow-hidden font-sans",children:[l.jsx(li,{children:e&&l.jsxs(l.Fragment,{children:[l.jsx(cn.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>t(!1),className:"absolute inset-0 bg-stone-200/40 backdrop-blur-[2px] z-40 transition-all"}),l.jsxs(cn.div,{initial:{x:-320},animate:{x:0},exit:{x:-320},transition:{type:"spring",stiffness:350,damping:35},className:"absolute top-0 bottom-0 left-0 w-[300px] bg-[#F7F6F3] border-r border-[#E5E5E5] z-50 shadow-2xl flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-[#E5E5E5]",children:[l.jsx("span",{className:"text-sm font-medium text-[#444]",children:"Recent Sessions"}),l.jsx("button",{onClick:()=>t(!1),className:"text-[#999] hover:text-[#333]",children:l.jsx(Ze,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex-1 overflow-hidden",children:l.jsx(gG,{sessions:a.sessions,currentSessionKey:a.currentSessionKey,onSelectSession:h=>{a.loadHistory(h),t(!1)},onNewSession:()=>{a.createSession(),t(!1)},onDeleteSession:a.deleteSession})})]})]})}),l.jsxs("div",{className:"flex-1 relative flex flex-col bg-white min-w-0",children:[l.jsxs("header",{className:"absolute top-0 left-0 right-0 h-16 flex items-center justify-between px-4 z-30",children:[l.jsx("div",{className:"flex items-center",children:!e&&l.jsx("button",{onClick:()=>t(!0),className:"p-2 rounded-lg text-gray-400 hover:text-gray-800 hover:bg-gray-100 transition-all",title:"View History",children:l.jsx(ow,{className:"w-5 h-5"})})}),l.jsx("div",{className:"flex items-center",children:l.jsx("button",{onClick:()=>a.createSession(),className:"p-2 rounded-lg text-gray-400 hover:text-gray-800 hover:bg-gray-100 transition-all",title:"New Session",children:l.jsx(In,{className:"w-5 h-5"})})})]}),l.jsx("div",{className:"flex-1 pt-16 flex flex-col min-h-0",children:l.jsx(UG,{messages:a.messages,isLoading:a.isLoading,isLoadingHistory:a.isLoadingHistory,wsStatus:a.wsStatus,isConnected:a.isConnected,hasMore:a.hasMore,isLoadingMore:a.isLoadingMore,sendMessage:a.sendMessage,abortResponse:a.abortResponse,loadMoreHistory:a.loadMoreHistory,sendRpc:a.sendRpc,contextUsage:a.contextUsage,isCompacting:a.isCompacting,skills:a.skills,editingSkill:a.editingSkill,onEditSkill:a.startEditSkill,onClearEditSkill:a.clearEditSkill,onSkillSaved:c,onOpenSkillPanel:f,onOpenSchedulePanel:f,selectedWorkspaceId:(s==null?void 0:s.id)??null,panelMessage:n,updateMessageMeta:a.updateMessageMeta,pendingMessages:a.pendingMessages,onRemovePending:a.removePendingMessage,investigationProgress:a.investigationProgress,dpActive:a.dpActive,onSetDpActive:a.setDpActive,dpFocus:a.dpFocus,dpChecklist:a.dpChecklist,onHypothesesConfirmed:a.confirmHypotheses,onExitDp:a.exitDpMode,systemStatus:a.systemStatus,onNavigateModels:()=>i("/models"),onNavigateCredentials:()=>i("/credentials"),sessionKey:a.currentSessionKey})})]}),n&&(n.toolName==="create_skill"||n.toolName==="update_skill"?l.jsx(QG,{message:n,sendRpc:a.sendRpc,skills:a.skills,onSave:u,onDismiss:d,onClose:()=>r(null),updateMessageMeta:a.updateMessageMeta}):n.toolName==="manage_schedule"?l.jsx(JG,{message:n,sendRpc:a.sendRpc,onSave:u,onDismiss:d,onClose:()=>r(null),updateMessageMeta:a.updateMessageMeta,selectedWorkspaceId:(s==null?void 0:s.id)??null}):null)]})}const ut=({content:e,children:t,position:n="top",delay:r=.2})=>{const[i,a]=m.useState(!1),s=m.useRef(null),[o,c]=m.useState({top:0,left:0}),u=m.useCallback(()=>{if(s.current){const d=s.current.getBoundingClientRect();let f=0,h=0;const p=8;switch(n){case"top":f=d.top-p,h=d.left+d.width/2;break;case"bottom":f=d.bottom+p,h=d.left+d.width/2;break;case"left":f=d.top+d.height/2,h=d.left-p;break;case"right":f=d.top+d.height/2,h=d.right+p;break}c({top:f,left:h})}a(!0)},[n]);return l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:s,className:"relative flex items-center",onMouseEnter:u,onMouseLeave:()=>a(!1),children:t}),Co.createPortal(l.jsx(li,{children:i&&l.jsx(cn.div,{initial:{opacity:0,scale:.96,y:n==="top"?4:n==="bottom"?-4:0,x:n==="left"?4:n==="right"?-4:0,top:o.top,left:o.left},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.96},transition:{duration:.15,delay:r,ease:"easeOut"},style:{position:"fixed",top:0,left:0,pointerEvents:"none"},className:"z-[9999]",children:l.jsx("div",{className:`
603
+ relative px-3 py-1.5 text-xs font-semibold text-gray-700 bg-white
604
+ border border-gray-100 rounded-lg shadow-[0_4px_12px_-2px_rgba(0,0,0,0.08)]
605
+ whitespace-nowrap select-none
606
+ ${n==="top"?"-translate-x-1/2 -translate-y-full":""}
607
+ ${n==="bottom"?"-translate-x-1/2":""}
608
+ ${n==="left"?"-translate-x-full -translate-y-1/2":""}
609
+ ${n==="right"?"-translate-y-1/2":""}
610
+ `,children:e})})}),document.body)]})};function no({isOpen:e,onClose:t,onConfirm:n,title:r,description:i,confirmText:a="Confirm",cancelText:s="Cancel",variant:o="primary"}){if(!e)return null;const u={primary:{icon:Z7,iconColor:"text-primary-600",iconBg:"bg-primary-50",button:"bg-primary-600 hover:bg-primary-700 focus:ring-primary-100"},danger:{icon:Ai,iconColor:"text-red-600",iconBg:"bg-red-50",button:"bg-red-600 hover:bg-red-700 focus:ring-red-100"},warning:{icon:Hr,iconColor:"text-orange-600",iconBg:"bg-orange-50",button:"bg-orange-600 hover:bg-orange-700 focus:ring-orange-100"}}[o],d=u.icon;return l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[l.jsx("div",{className:"absolute inset-0 bg-gray-900/40 backdrop-blur-sm transition-opacity",onClick:t}),l.jsx("div",{className:"relative w-full max-w-md bg-white rounded-2xl shadow-xl border border-gray-100 overflow-hidden text-left transform transition-all animate-in fade-in zoom-in-95 duration-200",children:l.jsxs("div",{className:"p-6",children:[l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:U("p-3 rounded-xl flex-shrink-0",u.iconBg),children:l.jsx(d,{className:U("w-6 h-6",u.iconColor)})}),l.jsxs("div",{className:"flex-1 pt-1",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 leading-none mb-2",children:r}),l.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:i})]}),l.jsx("button",{onClick:t,className:"p-1 text-gray-400 hover:text-gray-500 hover:bg-gray-100 rounded-lg transition-colors",children:l.jsx(Ze,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"mt-8 flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-100 transition-colors",children:s}),l.jsx("button",{onClick:()=>{n(),t()},className:U("px-4 py-2 text-sm font-medium text-white rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 transition-all",u.button),children:a})]})]})})]})}const yC=30;function VQ(e){const[t,n]=m.useState([]),[r,i]=m.useState(!0),[a,s]=m.useState(!1),[o,c]=m.useState(!1),[u,d]=m.useState("all"),[f,h]=m.useState(""),p=m.useCallback(async(O,C)=>{const M=O??u,I=C??f;d(M),h(I),i(!0);try{const B=await nv(e,{limit:yC,offset:0,scope:M==="all"||M==="approvals"?void 0:M,search:I||void 0,pendingOnly:M==="approvals"?!0:void 0});n(B.skills),c(B.hasMore)}catch(B){console.error("[useSkills] Failed to load:",B)}finally{i(!1)}},[e,u,f]),g=m.useCallback(async()=>{if(!(a||!o)){s(!0);try{const O=await nv(e,{limit:yC,offset:t.length,scope:u==="all"||u==="approvals"?void 0:u,search:f||void 0,pendingOnly:u==="approvals"?!0:void 0});n(C=>[...C,...O.skills]),c(O.hasMore)}catch(O){console.error("[useSkills] Failed to load more:",O)}finally{s(!1)}}},[e,t.length,u,f,a,o]),y=m.useCallback(async O=>{const C=!O.enabled;try{await e("skill.setEnabled",{name:O.name,enabled:C}),n(M=>M.map(I=>I.name===O.name?{...I,enabled:C}:I))}catch(M){console.error("[useSkills] toggleEnabled failed:",M)}},[e]),x=m.useCallback(async(O,C)=>{await e("skill.submit",{id:String(O.id),contributeToTeam:C}),await p()},[e,p]),b=m.useCallback(async O=>{await DQ(e,String(O.id)),await p()},[e,p]),v=m.useCallback(async O=>{try{await e("skill.review",{id:String(O.id),decision:"approve"}),await p()}catch(C){console.error("[useSkills] approveSkill failed:",C)}},[e,p]),w=m.useCallback(async(O,C)=>{try{await e("skill.review",{id:String(O.id),decision:"reject",reason:C}),await p()}catch(M){console.error("[useSkills] rejectSkill failed:",M)}},[e,p]),k=m.useCallback(async O=>{try{await e("skill.delete",{id:String(O.id)}),n(C=>C.filter(M=>M.id!==O.id))}catch(C){console.error("[useSkills] deleteSkill failed:",C)}},[e]),S=m.useCallback(async O=>{try{await Z4(e,String(O.id)),await p()}catch(C){console.error("[useSkills] copyToPersonal failed:",C)}},[e,p]),j=m.useCallback(async(O,C)=>{try{const M=await OQ(e,String(O.id),C);n(I=>I.map(B=>B.id===O.id?{...B,upvotes:M.upvotes,downvotes:M.downvotes,userVote:M.userVote}:B))}catch(M){console.error("[useSkills] voteSkill failed:",M)}},[e]),N=m.useCallback(async(O,C)=>{try{await _Q(e,String(O.id),C),await p()}catch(M){console.error("[useSkills] revertSkill failed:",M)}},[e,p]),P=m.useCallback(async(O,C,M,I)=>{await MQ(e,String(O.id),C,M,I),await p()},[e,p]),A=m.useCallback(async(O,C)=>{try{await X4(e,String(O.id),C),await p()}catch(M){console.error("[useSkills] rollbackSkill failed:",M)}},[e,p]),E=m.useCallback(async O=>{try{(await IQ(e,String(O.id))).wasNew?n(M=>M.filter(I=>I.id!==O.id)):await p()}catch(C){console.error("[useSkills] withdrawSkill failed:",C)}},[e,p]);return{skills:t,isLoading:r,isLoadingMore:a,hasMore:o,loadSkills:p,loadMore:g,toggleEnabled:y,publishSkill:x,requestPublish:b,approveSkill:v,rejectSkill:w,deleteSkill:k,copyToPersonal:S,voteSkill:j,revertSkill:N,reviewSkill:P,withdrawSkill:E,rollbackSkill:A}}function ic(e,t){const[n,r]=m.useState({isAdmin:!1,permissions:[],isReviewer:!1,testOnly:!1,loaded:!1});return m.useEffect(()=>{t&&e("permission.mine").then(i=>{const a=i.isAdmin,s=i.permissions;r({isAdmin:a,permissions:s,isReviewer:a||s.includes("skill_reviewer"),testOnly:i.testOnly??!1,loaded:!0})}).catch(i=>{console.warn("[usePermissions] Failed to fetch permissions:",i),r(a=>({...a,loaded:!0}))})},[t,e]),n}function WQ(){var fe;const e=$i(),[t,n]=bd(),{sendRpc:r,isConnected:i}=$t(),{skills:a,isLoading:s,isLoadingMore:o,hasMore:c,loadSkills:u,loadMore:d,toggleEnabled:f,requestPublish:h,publishSkill:p,copyToPersonal:g,approveSkill:y,rejectSkill:x,deleteSkill:b,voteSkill:v,revertSkill:w,reviewSkill:k,withdrawSkill:S}=VQ(r),j=ls(),N=(j==null?void 0:j.username)==="admin",{isReviewer:P}=ic(r,i),A=t.get("tab"),E=sessionStorage.getItem("skills_tab"),[O,C]=m.useState(A||E||"all"),[M,I]=m.useState(""),[B,se]=m.useState(new Set),[Q,D]=m.useState(!1),[K,T]=m.useState([]),ie=m.useRef(null),J=m.useRef(),_=m.useRef(null),H={kubernetes:"bg-blue-50 text-blue-700 border-blue-200","bare-metal":"bg-blue-50 text-blue-700 border-blue-200",switch:"bg-blue-50 text-blue-700 border-blue-200",network:"bg-purple-50 text-purple-700 border-purple-200",rdma:"bg-purple-50 text-purple-700 border-purple-200",scheduling:"bg-purple-50 text-purple-700 border-purple-200",storage:"bg-purple-50 text-purple-700 border-purple-200",compute:"bg-purple-50 text-purple-700 border-purple-200",general:"bg-purple-50 text-purple-700 border-purple-200",diagnostic:"bg-green-50 text-green-700 border-green-200",monitoring:"bg-green-50 text-green-700 border-green-200",performance:"bg-green-50 text-green-700 border-green-200",configuration:"bg-green-50 text-green-700 border-green-200",sre:"bg-orange-50 text-orange-700 border-orange-200",developer:"bg-orange-50 text-orange-700 border-orange-200"},ee={Environment:["kubernetes","bare-metal","switch"],Domain:["network","rdma","scheduling","storage","compute","general"],Operation:["diagnostic","monitoring","performance","configuration"],...N?{Role:["sre","developer"]}:{}},be=m.useMemo(()=>{const R=new Set(K.map(Je=>Je.label)),me=new Map(K.map(Je=>[Je.label,Je.count])),Ae=[],ze=new Set;for(const[Je,pt]of Object.entries(ee)){const Wt=pt.filter(Ct=>R.has(Ct)).map(Ct=>({label:Ct,count:me.get(Ct)??0}));Wt.length>0&&(Ae.push({group:Je,labels:Wt}),Wt.forEach(Ct=>ze.add(Ct.label)))}const ht=K.filter(Je=>!ze.has(Je.label)).map(Je=>({label:Je.label,count:Je.count}));return ht.length>0&&Ae.push({group:"Other",labels:ht}),Ae},[K,N]),te=R=>{se(me=>{const Ae=new Set(me);return Ae.has(R)?Ae.delete(R):Ae.add(R),Ae})};m.useEffect(()=>{if(!Q)return;const R=me=>{ie.current&&!ie.current.contains(me.target)&&D(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[Q]);const ye=R=>{const me=R.target.value;I(me),clearTimeout(J.current),J.current=setTimeout(()=>{u(O,me)},300)},Z=R=>{C(R),sessionStorage.setItem("skills_tab",R),n(R==="all"?{}:{tab:R}),u(R,M)},ne=m.useCallback(()=>{const R=_.current;!R||o||!c||R.scrollHeight-R.scrollTop-R.clientHeight<200&&d()},[o,c,d]),[ve,L]=m.useState({isOpen:!1,skill:null,reason:""}),[W,F]=m.useState({isOpen:!1,title:"",description:"",variant:"primary",confirmText:"Confirm",onConfirm:()=>{}}),le=()=>F(R=>({...R,isOpen:!1})),oe=m.useRef(!1);m.useEffect(()=>{i&&!oe.current&&(oe.current=!0,u(O,""),FQ(r).then(T).catch(()=>{}))},[i]),m.useEffect(()=>{const R=t.get("tab");if(!R)return;const me=R;me!==O&&(C(me),sessionStorage.setItem("skills_tab",me),u(me,M))},[t]);const Re=B.size===0?a:a.filter(R=>{const me=R.labels??[];return[...B].every(Ae=>me.includes(Ae))}),We=()=>e("/skills/new"),nt=(R,me)=>{R.stopPropagation(),f(me)},Nt=R=>{F({isOpen:!0,title:"Error",description:R,variant:"warning",confirmText:"OK",onConfirm:()=>{}})},hn=(R,me)=>{R.stopPropagation(),F({isOpen:!0,title:"Publish Skill",description:`Are you sure you want to publish "${me.name}"? It will be reviewed by an admin before becoming available in production.`,variant:"primary",confirmText:"Request Publish",onConfirm:()=>{h(me).catch(Ae=>Nt((Ae==null?void 0:Ae.message)||String(Ae)))}})},Xt=(R,me)=>{R.stopPropagation(),F({isOpen:!0,title:"Contribute to Team",description:`Contribute "${me.name}" to the team? An admin will review before it becomes a shared team skill.`,variant:"primary",confirmText:"Contribute",onConfirm:()=>{p(me,!0).catch(Ae=>Nt((Ae==null?void 0:Ae.message)||String(Ae)))}})},xt=(R,me)=>{R.stopPropagation(),F({isOpen:!0,title:"Fork to Personal",description:`This will fork "${me.name}" into your personal skills. You can edit and customize the fork, and optionally contribute changes back to the team.`,variant:"primary",confirmText:"Fork Skill",onConfirm:()=>{g(me)}})},rt=(R,me,Ae)=>{R.stopPropagation(),v(me,Ae)},it=(R,me)=>{R.stopPropagation(),L({isOpen:!0,skill:me,reason:""})},X=()=>{ve.skill&&w(ve.skill,ve.reason||void 0),L({isOpen:!1,skill:null,reason:""})},de=(R,me)=>{R.stopPropagation(),F({isOpen:!0,title:"Withdraw Publish Request",description:`Withdraw the publish request for "${me.name}"? The skill will revert to its previous state.`,variant:"warning",confirmText:"Withdraw",onConfirm:()=>{S(me)}})},Ee=(R,me)=>{R.stopPropagation(),F({isOpen:!0,title:"Delete Skill",description:`Are you sure you want to permanently delete "${me.name}"? This action cannot be undone.`,variant:"danger",confirmText:"Delete",onConfirm:()=>{b(me)}})};return l.jsxs("div",{className:"h-full bg-white flex flex-col relative",children:[l.jsx(no,{isOpen:W.isOpen,onClose:le,onConfirm:W.onConfirm,title:W.title,description:W.description,variant:W.variant,confirmText:W.confirmText}),ve.isOpen&&l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[l.jsx("div",{className:"absolute inset-0 bg-gray-900/40 backdrop-blur-sm",onClick:()=>L({isOpen:!1,skill:null,reason:""})}),l.jsx("div",{className:"relative w-full max-w-md bg-white rounded-2xl shadow-xl border border-gray-100 overflow-hidden animate-in fade-in zoom-in-95 duration-200",children:l.jsxs("div",{className:"p-6",children:[l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"p-3 rounded-xl bg-orange-50 flex-shrink-0",children:l.jsx(Nx,{className:"w-6 h-6 text-orange-600"})}),l.jsxs("div",{className:"flex-1 pt-1",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Revert to Personal"}),l.jsxs("p",{className:"text-sm text-gray-500 mb-4",children:['This will move "',(fe=ve.skill)==null?void 0:fe.name,`" back to the author's personal library.`]}),l.jsx("textarea",{value:ve.reason,onChange:R=>L(me=>({...me,reason:R.target.value})),placeholder:"Reason for revert (optional)",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-orange-200 resize-none",rows:3})]})]}),l.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:()=>L({isOpen:!1,skill:null,reason:""}),className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors",children:"Cancel"}),l.jsx("button",{onClick:X,className:"px-4 py-2 text-sm font-medium text-white bg-orange-600 hover:bg-orange-700 rounded-lg shadow-sm transition-all",children:"Revert"})]})]})})]}),l.jsxs("header",{className:"h-16 flex items-center justify-between px-6 bg-white sticky top-0 z-10",children:[l.jsxs("div",{className:"flex gap-2",children:[[{id:"all",label:"All Skills",icon:cw},{id:"builtin",label:"System Skills",icon:fw},{id:"team",label:"Team Skills",icon:ta},{id:"personal",label:"My Skills",icon:Vu}].map(R=>l.jsx("button",{onClick:()=>Z(R.id),className:U("flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-all border",O===R.id?"bg-gray-900 text-white border-gray-900 shadow-sm":"bg-white text-gray-500 border-transparent hover:bg-gray-50 hover:text-gray-700"),children:R.label},R.id)),P&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"w-px h-6 bg-gray-200 self-center mx-1"}),l.jsxs("button",{onClick:()=>Z("approvals"),className:U("flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-all border",O==="approvals"?"bg-orange-50 text-orange-700 border-orange-200 shadow-sm":"bg-white text-gray-500 border-transparent hover:bg-orange-50 hover:text-orange-600"),children:[l.jsx(Vj,{className:"w-3.5 h-3.5"}),"Approvals",a.filter(R=>R.contributionStatus==="pending"||R.reviewStatus==="pending").length>0&&l.jsx("span",{className:"flex h-4 w-4 items-center justify-center rounded-full bg-orange-500 text-[10px] text-white",children:a.filter(R=>R.contributionStatus==="pending"||R.reviewStatus==="pending").length})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"relative group",children:[l.jsx(Hn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 group-focus-within:text-primary-500 transition-colors"}),l.jsx("input",{type:"text",placeholder:"Search skills...",value:M,onChange:ye,className:"pl-9 pr-3 py-1.5 bg-gray-50 border-none rounded-md text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-200 w-48 transition-all"})]}),O==="personal"&&l.jsx(ut,{content:"Create Skill",children:l.jsx("button",{onClick:We,className:"p-2 rounded-lg text-gray-400 hover:text-gray-900 hover:bg-gray-100 transition-all",children:l.jsx(In,{className:"w-5 h-5"})})})]})]}),K.length>0&&O!=="approvals"&&l.jsxs("div",{className:"px-6 py-2 border-b border-gray-100 bg-gray-50/50 flex items-center gap-2 flex-wrap",children:[l.jsxs("div",{ref:ie,className:"relative",children:[l.jsxs("button",{onClick:()=>D(R=>!R),className:U("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border transition-all",Q?"bg-gray-100 text-gray-700 border-gray-300":"bg-white text-gray-500 border-gray-200 hover:border-gray-300 hover:text-gray-700"),children:[l.jsx(pw,{className:"w-3 h-3"}),"Labels",B.size>0&&l.jsx("span",{className:"flex h-4 min-w-[16px] items-center justify-center rounded-full bg-gray-700 text-[10px] text-white px-1",children:B.size}),l.jsx(ea,{className:U("w-3 h-3 transition-transform",Q&&"rotate-180")})]}),Q&&l.jsx("div",{className:"absolute left-0 top-full mt-1 w-64 bg-white rounded-lg shadow-lg border border-gray-200 z-30 py-1 max-h-80 overflow-y-auto",children:be.map(({group:R,labels:me})=>l.jsxs("div",{children:[l.jsx("div",{className:"px-3 py-1.5 text-[10px] font-bold uppercase tracking-wider text-gray-400",children:R}),me.map(({label:Ae,count:ze})=>l.jsxs("button",{onClick:()=>te(Ae),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs hover:bg-gray-50 transition-colors",children:[l.jsx("span",{className:U("w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0",B.has(Ae)?"bg-gray-700 border-gray-700 text-white":"border-gray-300"),children:B.has(Ae)&&l.jsx($n,{className:"w-2.5 h-2.5"})}),l.jsx("span",{className:U("px-1.5 py-0.5 rounded text-[10px] font-medium border",H[Ae]||"bg-gray-50 text-gray-600 border-gray-200"),children:Ae}),l.jsx("span",{className:"ml-auto text-gray-400 text-[10px]",children:ze})]},Ae))]},R))})]}),[...B].map(R=>l.jsxs("span",{className:U("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",H[R]||"bg-gray-100 text-gray-700 border-gray-300"),children:[R,l.jsx("button",{onClick:()=>te(R),className:"hover:opacity-70",children:l.jsx(Ze,{className:"w-3 h-3"})})]},R)),B.size>0&&l.jsx("button",{onClick:()=>se(new Set),className:"px-2 py-0.5 rounded-full text-xs text-gray-400 hover:text-gray-600 flex items-center gap-0.5",children:"Clear all"})]}),l.jsxs("div",{ref:_,onScroll:ne,className:"flex-1 overflow-y-auto p-8",children:[s?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Le,{className:"w-6 h-6 animate-spin text-gray-400"})}):O==="approvals"?l.jsxs("div",{className:"max-w-4xl mx-auto space-y-4",children:[Re.map(R=>{const me=R.reviewStatus==="pending",Ae=R.contributionStatus==="pending";return l.jsx(KQ,{skill:R,isScriptReview:me,isContributionReview:Ae,isAdmin:P,sendRpc:r,onApproveContribution:async()=>{await y(R)},onRejectContribution:async ze=>{await x(R,ze)},onReviewDecision:async(ze,ht,Je)=>{await k(R,ze,ht,Je)},onNavigate:()=>e(`/skills/${R.id}`)},R.id)}),Re.length===0&&l.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-gray-400 text-sm",children:[l.jsx(Vj,{className:"w-8 h-8 mb-3 opacity-20"}),"No pending approvals"]})]}):l.jsx("div",{className:"max-w-6xl mx-auto",children:Re.length===0&&!s&&O!=="personal"?l.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-gray-400 text-sm",children:[l.jsx(ta,{className:"w-8 h-8 mb-3 opacity-20"}),O==="team"?"No team skills yet. Team skills are promoted from personal skills through the approval process.":"No skills found."]}):l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[Re.map(R=>l.jsxs("div",{className:U("group rounded-xl border p-6 hover:shadow-md transition-all duration-200 flex flex-col relative overflow-hidden",R.reviewStatus==="pending"?"bg-amber-50/30 border-amber-100":R.reviewStatus==="draft"?"bg-gray-50/50 border-gray-200":R.enabled?"bg-white border-gray-200":"bg-gray-50/80 border-gray-100"),children:[l.jsxs("div",{className:"flex justify-between items-start mb-4",children:[l.jsx("div",{className:U("w-8 h-8 rounded-lg border flex items-center justify-center transition-colors",R.enabled?"bg-gray-50 border-gray-100 group-hover:border-gray-200 group-hover:bg-gray-100":"bg-gray-100 border-gray-100"),children:l.jsx(R.icon,{className:U("w-4 h-4",R.enabled?"text-gray-700":"text-gray-400")})}),l.jsx(GQ,{enabled:R.enabled,onToggle:me=>nt(me,R),disabled:R.reviewStatus==="pending"})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("h3",{className:U("font-bold mb-1",R.enabled?"text-gray-900":"text-gray-400"),children:R.name}),l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap mb-2",children:[R.contributionStatus==="pending"&&l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-orange-50 text-orange-600 text-[10px] font-bold border border-orange-100 whitespace-nowrap",children:[l.jsx(ta,{className:"w-2.5 h-2.5"}),"Team Pending"]}),R.reviewStatus==="draft"&&l.jsx("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-gray-50 text-gray-500 text-[10px] font-bold border border-gray-200 whitespace-nowrap",children:"Draft"}),R.reviewStatus==="pending"&&l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-amber-50 text-amber-700 text-[10px] font-bold border border-amber-200 whitespace-nowrap",children:[l.jsx(Bu,{className:"w-2.5 h-2.5"}),"Pending Publish"]}),R.reviewStatus==="approved"&&(R.scope==="personal"||R.scope==="team")&&(()=>{const me=Number(String(R.version).replace(/^v/,""));return R.publishedVersion!=null&&me>R.publishedVersion?l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-blue-50 text-blue-600 text-[10px] font-bold border border-blue-200 whitespace-nowrap",children:[l.jsx(Ka,{className:"w-2.5 h-2.5"}),"Modified"]}):l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-green-50 text-green-600 text-[10px] font-bold border border-green-200 whitespace-nowrap",children:[l.jsx($n,{className:"w-2.5 h-2.5"}),"Approved"]})})(),R.scope==="builtin"&&l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-gray-100 text-gray-600 text-[10px] font-bold border border-gray-200 whitespace-nowrap",children:[l.jsx(Zh,{className:"w-2.5 h-2.5"}),"System"]})]}),l.jsx("p",{className:U("text-sm leading-relaxed line-clamp-2",R.enabled?"text-gray-500":"text-gray-400"),children:R.description}),R.labels&&R.labels.length>0&&(()=>{const Ae=R.labels.slice(0,3),ze=R.labels.length-3;return l.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[Ae.map(ht=>l.jsx("span",{onClick:Je=>{Je.stopPropagation(),te(ht)},className:U("px-1.5 py-0.5 rounded text-[10px] font-medium border cursor-pointer hover:opacity-80 transition-opacity",H[ht]||"bg-gray-50 text-gray-600 border-gray-200"),children:ht},ht)),ze>0&&l.jsx(ut,{content:R.labels.slice(3).join(", "),position:"bottom",children:l.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-100 text-gray-500 border border-gray-200",children:["+",ze]})})]})})()]}),R.scope==="team"&&l.jsxs("div",{className:"mt-auto pt-3 border-t border-gray-50 flex items-center gap-3",children:[l.jsxs("button",{onClick:me=>rt(me,R,1),className:U("flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-colors",R.userVote===1?"bg-green-100 text-green-700 border border-green-200":"text-gray-400 hover:text-green-600 hover:bg-green-50"),children:[l.jsx(t_,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:R.upvotes||0})]}),l.jsxs("button",{onClick:me=>rt(me,R,-1),className:U("flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-colors",R.userVote===-1?"bg-red-100 text-red-700 border border-red-200":"text-gray-400 hover:text-red-600 hover:bg-red-50"),children:[l.jsx(e_,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:R.downvotes||0})]})]}),l.jsxs("div",{className:U("pt-4 border-t border-gray-50 flex items-center justify-between",R.scope!=="team"&&"mt-auto"),children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-gray-400",children:[l.jsxs("span",{className:U("px-2 py-0.5 rounded flex items-center gap-1",R.scope==="builtin"?"bg-gray-100 text-gray-700":R.scope==="team"?"bg-blue-50 text-blue-700":"bg-purple-50 text-purple-700"),children:[R.scope==="builtin"&&l.jsx(Zh,{className:"w-3 h-3"}),R.scope==="builtin"?"System":R.scope==="team"?"Team":"Personal"]}),(R.scope==="team"||R.scope==="personal")&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-gray-50 text-gray-500 text-[10px] font-medium border border-gray-100",children:R.version})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[R.scope==="personal"&&R.reviewStatus==="pending"&&l.jsx(ut,{content:"Withdraw",children:l.jsx("button",{onClick:me=>de(me,R),className:"p-1.5 text-gray-400 hover:text-orange-600 hover:bg-orange-50 rounded-lg transition-colors",children:l.jsx(QO,{className:"w-4 h-4"})})}),R.scope==="personal"&&R.reviewStatus!=="pending"&&l.jsx(ut,{content:"Request Publish",children:l.jsx("button",{onClick:me=>hn(me,R),className:"p-1.5 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",children:l.jsx(dB,{className:"w-4 h-4"})})}),R.scope==="personal"&&R.reviewStatus==="approved"&&R.contributionStatus!=="pending"&&l.jsx(ut,{content:"Contribute to Team",children:l.jsx("button",{onClick:me=>Xt(me,R),className:"p-1.5 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",children:l.jsx(n_,{className:"w-4 h-4"})})}),R.scope!=="personal"&&l.jsx(ut,{content:"Fork to Personal",children:l.jsx("button",{onClick:me=>xt(me,R),className:"p-1.5 text-gray-400 hover:text-purple-600 hover:bg-purple-50 rounded-lg transition-colors",children:l.jsx(sw,{className:"w-4 h-4"})})}),N&&R.scope==="team"&&l.jsx(ut,{content:"Revert to Personal",children:l.jsx("button",{onClick:me=>it(me,R),className:"p-1.5 text-gray-400 hover:text-orange-600 hover:bg-orange-50 rounded-lg transition-colors",children:l.jsx(Nx,{className:"w-4 h-4"})})}),(R.scope==="personal"||N&&R.scope==="team")&&l.jsx(ut,{content:"Version History",children:l.jsx("button",{onClick:me=>{me.stopPropagation(),e(`/skills/${R.id}?history=true`)},className:"p-1.5 text-gray-400 hover:text-indigo-600 hover:bg-indigo-50 rounded-lg transition-colors",children:l.jsx(XO,{className:"w-4 h-4"})})}),l.jsx(ut,{content:R.scope==="personal"?"Configure Skill":"View Details",children:l.jsx("button",{onClick:()=>e(`/skills/${R.id}`),className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-colors",children:R.scope==="personal"?l.jsx(Cm,{className:"w-4 h-4"}):l.jsx(wd,{className:"w-4 h-4"})})}),(R.scope==="personal"||N&&R.scope==="team")&&l.jsx(ut,{content:"Delete Skill",children:l.jsx("button",{onClick:me=>Ee(me,R),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors",children:l.jsx(sr,{className:"w-4 h-4"})})})]})]})]},R.id)),O==="personal"&&l.jsxs("button",{onClick:We,className:"border-2 border-dashed border-gray-200 rounded-xl p-6 flex flex-col items-center justify-center text-gray-400 hover:border-primary-300 hover:text-primary-600 hover:bg-primary-50/50 transition-all gap-3 min-h-[200px]",children:[l.jsx("div",{className:"p-3 rounded-full bg-gray-50 group-hover:bg-white",children:l.jsx(In,{className:"w-6 h-6"})}),l.jsx("span",{className:"font-semibold text-sm",children:"Create Custom Skill"})]})]})}),o&&l.jsx("div",{className:"flex items-center justify-center py-6",children:l.jsx(Le,{className:"w-5 h-5 animate-spin text-gray-400"})})]})]})}const Tf={low:"bg-green-50 text-green-700 border-green-200",medium:"bg-yellow-50 text-yellow-700 border-yellow-200",high:"bg-orange-50 text-orange-700 border-orange-200",critical:"bg-red-50 text-red-700 border-red-200"},HQ={critical:Ai,high:Ai,medium:Ai,low:km};function KQ({skill:e,isScriptReview:t,isContributionReview:n,isAdmin:r,sendRpc:i,onApproveContribution:a,onRejectContribution:s,onReviewDecision:o,onNavigate:c}){const[u,d]=m.useState(!1),[f,h]=m.useState([]),[p,g]=m.useState(null),[y,x]=m.useState(!1),[b,v]=m.useState(""),[w,k]=m.useState(!1),[S,j]=m.useState(new Set),[N,P]=m.useState(null),[A,E]=m.useState(!1),[O,C]=m.useState(!1),[M,I]=m.useState({isOpen:!1,title:"",description:"",variant:"primary",confirmText:"",onConfirm:()=>{}}),[B,se]=m.useState({isOpen:!1,message:""}),Q=async()=>{if(u){d(!1);return}d(!0),x(!0);try{const H=[rv(i,String(e.id)),hC(i,String(e.id))],ee=await Promise.all(H);g(ee[0]),ee[1]&&h(ee[1].reviews)}catch(H){console.error("[Approvals] Failed to load review data:",H)}finally{x(!1)}},D=async()=>{if(N!==null){C(!O);return}E(!0),C(!0);try{const H=await RQ(i,String(e.id),n);P(H.diff||"No changes detected.")}catch(H){console.error("[Approvals] Failed to load diff:",H),P("Failed to load diff.")}finally{E(!1)}},K=async H=>{k(!0);try{t?await o(H,b||void 0,p==null?void 0:p.stagingVersion):n&&(H==="approve"?await a():await s(b||void 0))}catch(ee){const be=(ee==null?void 0:ee.message)||String(ee);be.includes("STAGING_VERSION_CONFLICT")?se({isOpen:!0,message:"Content has changed since you reviewed it. Please reload and review again."}):se({isOpen:!0,message:be})}finally{k(!1)}},T=H=>{I(H==="approve"?{isOpen:!0,title:"Approve Skill",description:`Are you sure you want to approve "${e.name}"? It will become active in production.`,variant:"primary",confirmText:n?"Approve & Publish to Team":"Approve",onConfirm:()=>K("approve")}:{isOpen:!0,title:"Reject Skill",description:`Are you sure you want to reject "${e.name}"?${b?"":" You can add a reason above before confirming."}`,variant:"danger",confirmText:"Reject",onConfirm:()=>K("reject")})},ie=H=>{j(ee=>{const be=new Set(ee);return be.has(H)?be.delete(H):be.add(H),be})},J=f.find(H=>H.reviewerType==="ai");m.useEffect(()=>{if(!u||J||!e.id)return;const H=setInterval(async()=>{try{const ee=await hC(i,String(e.id));ee!=null&&ee.reviews&&ee.reviews.find(te=>te.reviewerType==="ai")&&(h(ee.reviews),clearInterval(H))}catch{}},3e3);return()=>clearInterval(H)},[u,J,e.id,i]);const _={builtin:{label:"System Skills",cls:"bg-gray-100 text-gray-700",icon:Zh},team:{label:"Team Skills",cls:"bg-blue-50 text-blue-700 border-blue-100",icon:ta},personal:{label:"Personal",cls:"bg-purple-50 text-purple-700 border-purple-100",icon:Vu}}[e.scope]||{label:e.scope,cls:"bg-gray-100 text-gray-600",icon:Vu};return l.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 hover:shadow-sm transition-shadow",children:[l.jsx(no,{isOpen:M.isOpen,onClose:()=>I(H=>({...H,isOpen:!1})),onConfirm:M.onConfirm,title:M.title,description:M.description,variant:M.variant,confirmText:M.confirmText}),l.jsx(no,{isOpen:B.isOpen,onClose:()=>se({isOpen:!1,message:""}),onConfirm:()=>{},title:"Operation Failed",description:B.message,variant:"danger",confirmText:"OK"}),l.jsxs("div",{className:"p-4 flex items-center justify-between cursor-pointer",onClick:Q,children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:U("w-10 h-10 rounded-lg border flex items-center justify-center",t?"bg-amber-50 border-amber-100 text-amber-600":n?"bg-blue-50 border-blue-100 text-blue-600":"bg-orange-50 border-orange-100 text-orange-600"),children:t?l.jsx(Bu,{className:"w-5 h-5"}):n?l.jsx(ta,{className:"w-5 h-5"}):l.jsx(e.icon,{className:"w-5 h-5"})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("h3",{className:"font-bold text-gray-900",children:e.name}),l.jsxs("span",{className:U("inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium border",_.cls),children:[l.jsx(_.icon,{className:"w-2.5 h-2.5"}),_.label]}),t&&l.jsxs("span",{className:U("inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-[10px] font-bold border","bg-amber-50 text-amber-700 border-amber-200"),children:[l.jsx(tB,{className:"w-2.5 h-2.5"})," Publish Request"]}),n&&l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full bg-blue-50 text-blue-700 text-[10px] font-bold border border-blue-200",children:[l.jsx(ta,{className:"w-2.5 h-2.5"}),"Team Promotion"]}),J&&l.jsx("span",{className:U("px-1.5 py-0.5 rounded-full text-[10px] font-bold border uppercase",Tf[J.riskLevel]||Tf.low),children:J.riskLevel}),l.jsx("span",{className:"px-2 py-0.5 rounded-full bg-purple-50 text-purple-700 text-[10px] font-medium border border-purple-100",children:e.author||"Unknown"})]}),l.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:e.description})]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx(ut,{content:"View in Editor",children:l.jsx("button",{onClick:H=>{H.stopPropagation(),c()},className:"p-2 text-gray-400 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors",children:l.jsx(wd,{className:"w-4 h-4"})})}),l.jsx("button",{className:"p-2 text-gray-400 hover:text-gray-700 transition-colors",children:u?l.jsx(dh,{className:"w-4 h-4"}):l.jsx(ea,{className:"w-4 h-4"})})]})]}),u&&l.jsx("div",{className:"border-t border-gray-100 p-6 space-y-4 bg-gray-50/30",children:y?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(Le,{className:"w-5 h-5 animate-spin text-gray-400"})}):l.jsxs(l.Fragment,{children:[J&&l.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[l.jsx("h4",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider mb-3",children:"AI Review Summary"}),l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx("span",{className:"text-sm text-gray-600",children:"Risk Level:"}),l.jsx("span",{className:U("px-2 py-0.5 rounded-full text-xs font-bold border uppercase",Tf[J.riskLevel]||Tf.low),children:J.riskLevel})]}),l.jsx("p",{className:"text-sm text-gray-600 mb-3",children:J.summary}),J.findings&&J.findings.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("span",{className:"text-xs font-medium text-gray-500",children:[J.findings.length," finding(s):"]}),J.findings.map((H,ee)=>{const be=HQ[H.severity]||km;return l.jsxs("div",{className:U("flex items-start gap-2 p-2 rounded-md text-sm border",H.severity==="critical"?"bg-red-50/50 border-red-100":H.severity==="high"?"bg-orange-50/50 border-orange-100":H.severity==="medium"?"bg-yellow-50/50 border-yellow-100":"bg-gray-50 border-gray-100"),children:[l.jsx(be,{className:U("w-4 h-4 mt-0.5 shrink-0",H.severity==="critical"?"text-red-500":H.severity==="high"?"text-orange-500":H.severity==="medium"?"text-yellow-500":"text-gray-400")}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("span",{className:"text-gray-700",children:H.description}),H.lineRef&&l.jsxs("span",{className:"text-gray-400 text-xs ml-2",children:["(",H.lineRef,")"]}),H.snippet&&l.jsx("pre",{className:"mt-1 text-xs bg-gray-100 rounded px-2 py-1 overflow-x-auto text-gray-600",children:H.snippet})]})]},ee)})]})]}),!J&&l.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4 text-center text-sm text-gray-400",children:[l.jsx(Le,{className:"w-4 h-4 animate-spin inline mr-2"}),"AI review in progress..."]}),(t||n)&&l.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden",children:[l.jsxs("button",{onClick:D,className:"w-full flex items-center gap-2 px-4 py-3 text-sm text-left hover:bg-gray-50 transition-colors",children:[l.jsx(XO,{className:"w-4 h-4 text-indigo-500"}),l.jsx("span",{className:"font-bold text-xs text-gray-400 uppercase tracking-wider flex-1",children:"Changes (Diff)"}),A?l.jsx(Le,{className:"w-3.5 h-3.5 animate-spin text-gray-400"}):O?l.jsx(dh,{className:"w-3.5 h-3.5 text-gray-400"}):l.jsx(ea,{className:"w-3.5 h-3.5 text-gray-400"})]}),O&&N!==null&&l.jsx("div",{className:"border-t border-gray-100",children:l.jsx("pre",{className:"p-3 bg-[#1e1e1e] text-xs font-mono overflow-x-auto max-h-80 overflow-y-auto",children:N.split(`
611
+ `).map((H,ee)=>l.jsx("div",{className:U(H.startsWith("+")&&!H.startsWith("+++")?"text-green-400 bg-green-950/30":H.startsWith("-")&&!H.startsWith("---")?"text-red-400 bg-red-950/30":H.startsWith("@@")?"text-cyan-400":"text-[#d4d4d4]"),children:H},ee))})})]}),(()=>{const H=p==null?void 0:p.scripts;return H&&H.length>0?l.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[l.jsx("h4",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider mb-3",children:"Scripts"}),l.jsx("div",{className:"space-y-2",children:H.map(ee=>l.jsxs("div",{className:"border border-gray-100 rounded-lg overflow-hidden",children:[l.jsxs("button",{onClick:()=>ie(ee.name),className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-gray-50 transition-colors",children:[l.jsx("div",{className:U("w-6 h-6 rounded flex items-center justify-center shrink-0",ee.info==="python"?"bg-blue-50 text-blue-600":"bg-green-50 text-green-600"),children:ee.info==="python"?l.jsx(Ka,{className:"w-3 h-3"}):l.jsx(si,{className:"w-3 h-3"})}),l.jsx("span",{className:"font-medium text-gray-700 flex-1",children:ee.name}),S.has(ee.name)?l.jsx(dh,{className:"w-3.5 h-3.5 text-gray-400"}):l.jsx(ea,{className:"w-3.5 h-3.5 text-gray-400"})]}),S.has(ee.name)&&l.jsx("pre",{className:"p-3 bg-[#1e1e1e] text-[#d4d4d4] text-xs font-mono overflow-x-auto max-h-64 overflow-y-auto",children:ee.content})]},ee.id))})]}):null})(),(p==null?void 0:p.specs)&&l.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[l.jsx("h4",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider mb-3",children:"SKILL.md (Specs)"}),l.jsx("pre",{className:"text-xs text-gray-600 bg-gray-50 rounded-lg p-3 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:p.specs})]}),r&&(t||n)&&l.jsxs("div",{className:"space-y-3 pt-2",children:[l.jsx("textarea",{value:b,onChange:H=>v(H.target.value),placeholder:"Reason for rejection (optional, visible to the author)",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-amber-200 resize-none",rows:2}),l.jsxs("div",{className:"flex items-center justify-end gap-3",children:[l.jsxs("button",{onClick:()=>T("reject"),disabled:w,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-red-700 bg-red-50 border border-red-200 hover:bg-red-100 rounded-lg transition-all disabled:opacity-50",children:[l.jsx(Ze,{className:"w-4 h-4"}),"Reject"]}),l.jsxs("button",{onClick:()=>T("approve"),disabled:w,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-green-700 bg-green-50 border border-green-200 hover:bg-green-100 rounded-lg transition-all disabled:opacity-50",children:[l.jsx($n,{className:"w-4 h-4"}),n?"Approve & Publish to Team":"Approve"]})]})]})]})})]})}function GQ({enabled:e,onToggle:t,disabled:n}){return l.jsx(ut,{content:n?"Under review":e?"Disable Skill":"Enable Skill",children:l.jsx("button",{role:"switch","aria-checked":e,onClick:n?void 0:t,disabled:n,className:U("relative inline-flex h-5 w-9 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",n?"bg-gray-200 opacity-50 cursor-not-allowed":e?"bg-green-500 focus-visible:ring-green-500 cursor-pointer":"bg-gray-200 focus-visible:ring-gray-400 cursor-pointer"),children:l.jsx("span",{className:U("pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200 ease-in-out",e&&!n?"translate-x-4":"translate-x-0")})})})}var J4={},an=Mn&&Mn.__assign||function(){return an=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},an.apply(this,arguments)},qQ=Mn&&Mn.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),YQ=Mn&&Mn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),XQ=Mn&&Mn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&qQ(t,e,n);return YQ(t,e),t},ZQ=Mn&&Mn.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(J4,"__esModule",{value:!0});var Ar=XQ(m),QQ=89,Of=90,JQ=77,xC=57,vC=219,bC=222,wC=192,SC=100,eJ=3e3,tJ=typeof window<"u"&&"navigator"in window&&/Win/i.test(navigator.platform),Q0=typeof window<"u"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),yh="npm__react-simple-code-editor__textarea",nJ=`
612
+ /**
613
+ * Reset the text fill color so that placeholder is visible
614
+ */
615
+ .`.concat(yh,`:empty {
616
+ -webkit-text-fill-color: inherit !important;
617
+ }
618
+
619
+ /**
620
+ * Hack to apply on some CSS on IE10 and IE11
621
+ */
622
+ @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
623
+ /**
624
+ * IE doesn't support '-webkit-text-fill-color'
625
+ * So we use 'color: transparent' to make the text transparent on IE
626
+ * Unlike other browsers, it doesn't affect caret color in IE
627
+ */
628
+ .`).concat(yh,` {
629
+ color: transparent !important;
630
+ }
631
+
632
+ .`).concat(yh,`::selection {
633
+ background-color: #accef7 !important;
634
+ color: transparent !important;
635
+ }
636
+ }
637
+ `),rJ=Ar.forwardRef(function(t,n){var r=t.autoFocus,i=t.disabled,a=t.form,s=t.highlight,o=t.ignoreTabKey,c=o===void 0?!1:o,u=t.insertSpaces,d=u===void 0?!0:u,f=t.maxLength,h=t.minLength,p=t.name,g=t.onBlur,y=t.onClick,x=t.onFocus,b=t.onKeyDown,v=t.onKeyUp,w=t.onValueChange,k=t.padding,S=k===void 0?0:k,j=t.placeholder,N=t.preClassName,P=t.readOnly,A=t.required,E=t.style,O=t.tabSize,C=O===void 0?2:O,M=t.textareaClassName,I=t.textareaId,B=t.value,se=ZQ(t,["autoFocus","disabled","form","highlight","ignoreTabKey","insertSpaces","maxLength","minLength","name","onBlur","onClick","onFocus","onKeyDown","onKeyUp","onValueChange","padding","placeholder","preClassName","readOnly","required","style","tabSize","textareaClassName","textareaId","value"]),Q=Ar.useRef({stack:[],offset:-1}),D=Ar.useRef(null),K=Ar.useState(!0),T=K[0],ie=K[1],J={paddingTop:typeof S=="object"?S.top:S,paddingRight:typeof S=="object"?S.right:S,paddingBottom:typeof S=="object"?S.bottom:S,paddingLeft:typeof S=="object"?S.left:S},_=s(B),H=function(W,F){return W.substring(0,F).split(`
638
+ `)},ee=Ar.useCallback(function(W,F){var le,oe,Re;F===void 0&&(F=!1);var We=Q.current,nt=We.stack,Nt=We.offset;if(nt.length&&Nt>-1){Q.current.stack=nt.slice(0,Nt+1);var hn=Q.current.stack.length;if(hn>SC){var Xt=hn-SC;Q.current.stack=nt.slice(Xt,hn),Q.current.offset=Math.max(Q.current.offset-Xt,0)}}var xt=Date.now();if(F){var rt=Q.current.stack[Q.current.offset];if(rt&&xt-rt.timestamp<eJ){var it=/[^a-z0-9]([a-z0-9]+)$/i,X=(le=H(rt.value,rt.selectionStart).pop())===null||le===void 0?void 0:le.match(it),de=(oe=H(W.value,W.selectionStart).pop())===null||oe===void 0?void 0:oe.match(it);if(X!=null&&X[1]&&(!((Re=de==null?void 0:de[1])===null||Re===void 0)&&Re.startsWith(X[1]))){Q.current.stack[Q.current.offset]=an(an({},W),{timestamp:xt});return}}}Q.current.stack.push(an(an({},W),{timestamp:xt})),Q.current.offset++},[]),be=Ar.useCallback(function(){var W=D.current;if(W){var F=W.value,le=W.selectionStart,oe=W.selectionEnd;ee({value:F,selectionStart:le,selectionEnd:oe})}},[ee]),te=function(W){var F=D.current;F&&(F.value=W.value,F.selectionStart=W.selectionStart,F.selectionEnd=W.selectionEnd,w==null||w(W.value))},ye=function(W){var F=D.current,le=Q.current.stack[Q.current.offset];le&&F&&(Q.current.stack[Q.current.offset]=an(an({},le),{selectionStart:F.selectionStart,selectionEnd:F.selectionEnd})),ee(W),te(W)},Z=function(){var W=Q.current,F=W.stack,le=W.offset,oe=F[le-1];oe&&(te(oe),Q.current.offset=Math.max(le-1,0))},ne=function(){var W=Q.current,F=W.stack,le=W.offset,oe=F[le+1];oe&&(te(oe),Q.current.offset=Math.min(le+1,F.length-1))},ve=function(W){if(!(b&&(b(W),W.defaultPrevented))){W.key==="Escape"&&W.currentTarget.blur();var F=W.currentTarget,le=F.value,oe=F.selectionStart,Re=F.selectionEnd,We=(d?" ":" ").repeat(C);if(W.key==="Tab"&&!c&&T)if(W.preventDefault(),W.shiftKey){var nt=H(le,oe),Nt=nt.length-1,hn=H(le,Re).length-1,Xt=le.split(`
639
+ `).map(function(ze,ht){return ht>=Nt&&ht<=hn&&ze.startsWith(We)?ze.substring(We.length):ze}).join(`
640
+ `);if(le!==Xt){var xt=nt[Nt];ye({value:Xt,selectionStart:xt!=null&&xt.startsWith(We)?oe-We.length:oe,selectionEnd:Re-(le.length-Xt.length)})}}else if(oe!==Re){var nt=H(le,oe),rt=nt.length-1,it=H(le,Re).length-1,xt=nt[rt];ye({value:le.split(`
641
+ `).map(function(Je,pt){return pt>=rt&&pt<=it?We+Je:Je}).join(`
642
+ `),selectionStart:xt&&/\S/.test(xt)?oe+We.length:oe,selectionEnd:Re+We.length*(it-rt+1)})}else{var X=oe+We.length;ye({value:le.substring(0,oe)+We+le.substring(Re),selectionStart:X,selectionEnd:X})}else if(W.key==="Backspace"){var de=oe!==Re,Ee=le.substring(0,oe);if(Ee.endsWith(We)&&!de){W.preventDefault();var X=oe-We.length;ye({value:le.substring(0,oe-We.length)+le.substring(Re),selectionStart:X,selectionEnd:X})}}else if(W.key==="Enter"){if(oe===Re){var fe=H(le,oe).pop(),R=fe==null?void 0:fe.match(/^\s+/);if(R!=null&&R[0]){W.preventDefault();var me=`
643
+ `+R[0],X=oe+me.length;ye({value:le.substring(0,oe)+me+le.substring(Re),selectionStart:X,selectionEnd:X})}}}else if(W.keyCode===xC||W.keyCode===vC||W.keyCode===bC||W.keyCode===wC){var Ae=void 0;W.keyCode===xC&&W.shiftKey?Ae=["(",")"]:W.keyCode===vC?W.shiftKey?Ae=["{","}"]:Ae=["[","]"]:W.keyCode===bC?W.shiftKey?Ae=['"','"']:Ae=["'","'"]:W.keyCode===wC&&!W.shiftKey&&(Ae=["`","`"]),oe!==Re&&Ae&&(W.preventDefault(),ye({value:le.substring(0,oe)+Ae[0]+le.substring(oe,Re)+Ae[1]+le.substring(Re),selectionStart:oe,selectionEnd:Re+2}))}else(Q0?W.metaKey&&W.keyCode===Of:W.ctrlKey&&W.keyCode===Of)&&!W.shiftKey&&!W.altKey?(W.preventDefault(),Z()):(Q0?W.metaKey&&W.keyCode===Of&&W.shiftKey:tJ?W.ctrlKey&&W.keyCode===QQ:W.ctrlKey&&W.keyCode===Of&&W.shiftKey)&&!W.altKey?(W.preventDefault(),ne()):W.keyCode===JQ&&W.ctrlKey&&(!Q0||W.shiftKey)&&(W.preventDefault(),ie(function(ze){return!ze}))}},L=function(W){var F=W.currentTarget,le=F.value,oe=F.selectionStart,Re=F.selectionEnd;ee({value:le,selectionStart:oe,selectionEnd:Re},!0),w(le)};return Ar.useEffect(function(){be()},[be]),Ar.useImperativeHandle(n,function(){return{get session(){return{history:Q.current}},set session(W){Q.current=W.history}}},[]),Ar.createElement("div",an({},se,{style:an(an({},Mc.container),E)}),Ar.createElement("pre",an({className:N,"aria-hidden":"true",style:an(an(an({},Mc.editor),Mc.highlight),J)},typeof _=="string"?{dangerouslySetInnerHTML:{__html:_+"<br />"}}:{children:_})),Ar.createElement("textarea",{ref:function(W){return D.current=W},style:an(an(an({},Mc.editor),Mc.textarea),J),className:yh+(M?" ".concat(M):""),id:I,value:B,onChange:L,onKeyDown:ve,onClick:y,onKeyUp:v,onFocus:x,onBlur:g,disabled:i,form:a,maxLength:f,minLength:h,name:p,placeholder:j,readOnly:P,required:A,autoFocus:r,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),Ar.createElement("style",{dangerouslySetInnerHTML:{__html:nJ}}))}),Mc={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}},iJ=J4.default=rJ,eD={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
644
+ * Prism: Lightweight, robust, elegant syntax highlighting
645
+ *
646
+ * @license MIT <https://opensource.org/licenses/MIT>
647
+ * @author Lea Verou <https://lea.verou.me>
648
+ * @namespace
649
+ * @public
650
+ */var n=function(r){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,a=0,s={},o={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function v(w){return w instanceof c?new c(w.type,v(w.content),w.alias):Array.isArray(w)?w.map(v):w.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(v){return Object.prototype.toString.call(v).slice(8,-1)},objId:function(v){return v.__id||Object.defineProperty(v,"__id",{value:++a}),v.__id},clone:function v(w,k){k=k||{};var S,j;switch(o.util.type(w)){case"Object":if(j=o.util.objId(w),k[j])return k[j];S={},k[j]=S;for(var N in w)w.hasOwnProperty(N)&&(S[N]=v(w[N],k));return S;case"Array":return j=o.util.objId(w),k[j]?k[j]:(S=[],k[j]=S,w.forEach(function(P,A){S[A]=v(P,k)}),S);default:return w}},getLanguage:function(v){for(;v;){var w=i.exec(v.className);if(w)return w[1].toLowerCase();v=v.parentElement}return"none"},setLanguage:function(v,w){v.className=v.className.replace(RegExp(i,"gi"),""),v.classList.add("language-"+w)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(S){var v=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(S.stack)||[])[1];if(v){var w=document.getElementsByTagName("script");for(var k in w)if(w[k].src==v)return w[k]}return null}},isActive:function(v,w,k){for(var S="no-"+w;v;){var j=v.classList;if(j.contains(w))return!0;if(j.contains(S))return!1;v=v.parentElement}return!!k}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(v,w){var k=o.util.clone(o.languages[v]);for(var S in w)k[S]=w[S];return k},insertBefore:function(v,w,k,S){S=S||o.languages;var j=S[v],N={};for(var P in j)if(j.hasOwnProperty(P)){if(P==w)for(var A in k)k.hasOwnProperty(A)&&(N[A]=k[A]);k.hasOwnProperty(P)||(N[P]=j[P])}var E=S[v];return S[v]=N,o.languages.DFS(o.languages,function(O,C){C===E&&O!=v&&(this[O]=N)}),N},DFS:function v(w,k,S,j){j=j||{};var N=o.util.objId;for(var P in w)if(w.hasOwnProperty(P)){k.call(w,P,w[P],S||P);var A=w[P],E=o.util.type(A);E==="Object"&&!j[N(A)]?(j[N(A)]=!0,v(A,k,null,j)):E==="Array"&&!j[N(A)]&&(j[N(A)]=!0,v(A,k,P,j))}}},plugins:{},highlightAll:function(v,w){o.highlightAllUnder(document,v,w)},highlightAllUnder:function(v,w,k){var S={callback:k,container:v,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",S),S.elements=Array.prototype.slice.apply(S.container.querySelectorAll(S.selector)),o.hooks.run("before-all-elements-highlight",S);for(var j=0,N;N=S.elements[j++];)o.highlightElement(N,w===!0,S.callback)},highlightElement:function(v,w,k){var S=o.util.getLanguage(v),j=o.languages[S];o.util.setLanguage(v,S);var N=v.parentElement;N&&N.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(N,S);var P=v.textContent,A={element:v,language:S,grammar:j,code:P};function E(C){A.highlightedCode=C,o.hooks.run("before-insert",A),A.element.innerHTML=A.highlightedCode,o.hooks.run("after-highlight",A),o.hooks.run("complete",A),k&&k.call(A.element)}if(o.hooks.run("before-sanity-check",A),N=A.element.parentElement,N&&N.nodeName.toLowerCase()==="pre"&&!N.hasAttribute("tabindex")&&N.setAttribute("tabindex","0"),!A.code){o.hooks.run("complete",A),k&&k.call(A.element);return}if(o.hooks.run("before-highlight",A),!A.grammar){E(o.util.encode(A.code));return}if(w&&r.Worker){var O=new Worker(o.filename);O.onmessage=function(C){E(C.data)},O.postMessage(JSON.stringify({language:A.language,code:A.code,immediateClose:!0}))}else E(o.highlight(A.code,A.grammar,A.language))},highlight:function(v,w,k){var S={code:v,grammar:w,language:k};if(o.hooks.run("before-tokenize",S),!S.grammar)throw new Error('The language "'+S.language+'" has no grammar.');return S.tokens=o.tokenize(S.code,S.grammar),o.hooks.run("after-tokenize",S),c.stringify(o.util.encode(S.tokens),S.language)},tokenize:function(v,w){var k=w.rest;if(k){for(var S in k)w[S]=k[S];delete w.rest}var j=new f;return h(j,j.head,v),d(v,j,w,j.head,0),g(j)},hooks:{all:{},add:function(v,w){var k=o.hooks.all;k[v]=k[v]||[],k[v].push(w)},run:function(v,w){var k=o.hooks.all[v];if(!(!k||!k.length))for(var S=0,j;j=k[S++];)j(w)}},Token:c};r.Prism=o;function c(v,w,k,S){this.type=v,this.content=w,this.alias=k,this.length=(S||"").length|0}c.stringify=function v(w,k){if(typeof w=="string")return w;if(Array.isArray(w)){var S="";return w.forEach(function(E){S+=v(E,k)}),S}var j={type:w.type,content:v(w.content,k),tag:"span",classes:["token",w.type],attributes:{},language:k},N=w.alias;N&&(Array.isArray(N)?Array.prototype.push.apply(j.classes,N):j.classes.push(N)),o.hooks.run("wrap",j);var P="";for(var A in j.attributes)P+=" "+A+'="'+(j.attributes[A]||"").replace(/"/g,"&quot;")+'"';return"<"+j.tag+' class="'+j.classes.join(" ")+'"'+P+">"+j.content+"</"+j.tag+">"};function u(v,w,k,S){v.lastIndex=w;var j=v.exec(k);if(j&&S&&j[1]){var N=j[1].length;j.index+=N,j[0]=j[0].slice(N)}return j}function d(v,w,k,S,j,N){for(var P in k)if(!(!k.hasOwnProperty(P)||!k[P])){var A=k[P];A=Array.isArray(A)?A:[A];for(var E=0;E<A.length;++E){if(N&&N.cause==P+","+E)return;var O=A[E],C=O.inside,M=!!O.lookbehind,I=!!O.greedy,B=O.alias;if(I&&!O.pattern.global){var se=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,se+"g")}for(var Q=O.pattern||O,D=S.next,K=j;D!==w.tail&&!(N&&K>=N.reach);K+=D.value.length,D=D.next){var T=D.value;if(w.length>v.length)return;if(!(T instanceof c)){var ie=1,J;if(I){if(J=u(Q,K,v,M),!J||J.index>=v.length)break;var be=J.index,_=J.index+J[0].length,H=K;for(H+=D.value.length;be>=H;)D=D.next,H+=D.value.length;if(H-=D.value.length,K=H,D.value instanceof c)continue;for(var ee=D;ee!==w.tail&&(H<_||typeof ee.value=="string");ee=ee.next)ie++,H+=ee.value.length;ie--,T=v.slice(K,H),J.index-=K}else if(J=u(Q,0,T,M),!J)continue;var be=J.index,te=J[0],ye=T.slice(0,be),Z=T.slice(be+te.length),ne=K+T.length;N&&ne>N.reach&&(N.reach=ne);var ve=D.prev;ye&&(ve=h(w,ve,ye),K+=ye.length),p(w,ve,ie);var L=new c(P,C?o.tokenize(te,C):te,B,te);if(D=h(w,ve,L),Z&&h(w,D,Z),ie>1){var W={cause:P+","+E,reach:ne};d(v,w,k,D.prev,K,W),N&&W.reach>N.reach&&(N.reach=W.reach)}}}}}}function f(){var v={value:null,prev:null,next:null},w={value:null,prev:v,next:null};v.next=w,this.head=v,this.tail=w,this.length=0}function h(v,w,k){var S=w.next,j={value:k,prev:w,next:S};return w.next=j,S.prev=j,v.length++,j}function p(v,w,k){for(var S=w.next,j=0;j<k&&S!==v.tail;j++)S=S.next;w.next=S,S.prev=w,v.length-=j}function g(v){for(var w=[],k=v.head.next;k!==v.tail;)w.push(k.value),k=k.next;return w}if(!r.document)return r.addEventListener&&(o.disableWorkerMessageHandler||r.addEventListener("message",function(v){var w=JSON.parse(v.data),k=w.language,S=w.code,j=w.immediateClose;r.postMessage(o.highlight(S,o.languages[k],k)),j&&r.close()},!1)),o;var y=o.util.currentScript();y&&(o.filename=y.src,y.hasAttribute("data-manual")&&(o.manual=!0));function x(){o.manual||o.highlightAll()}if(!o.manual){var b=document.readyState;b==="loading"||b==="interactive"&&y&&y.defer?document.addEventListener("DOMContentLoaded",x):window.requestAnimationFrame?window.requestAnimationFrame(x):window.setTimeout(x,16)}return o}(t);e.exports&&(e.exports=n),typeof Mn<"u"&&(Mn.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(i,a){var s={};s["language-"+a]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[a]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};o["language-"+a]={pattern:/[\s\S]+/,inside:n.languages[a]};var c={};c[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:o},n.languages.insertBefore("markup","cdata",c)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,i){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[i,"language-"+i],inside:n.languages[i]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(r){var i=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+i.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+i.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:i,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var a=r.languages.markup;a&&(a.tag.addInlined("style","css"),a.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",i=function(y,x){return"✖ Error "+y+" while fetching file: "+x},a="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},o="data-src-status",c="loading",u="loaded",d="failed",f="pre[data-src]:not(["+o+'="'+u+'"]):not(['+o+'="'+c+'"])';function h(y,x,b){var v=new XMLHttpRequest;v.open("GET",y,!0),v.onreadystatechange=function(){v.readyState==4&&(v.status<400&&v.responseText?x(v.responseText):v.status>=400?b(i(v.status,v.statusText)):b(a))},v.send(null)}function p(y){var x=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(y||"");if(x){var b=Number(x[1]),v=x[2],w=x[3];return v?w?[b,Number(w)]:[b,void 0]:[b,b]}}n.hooks.add("before-highlightall",function(y){y.selector+=", "+f}),n.hooks.add("before-sanity-check",function(y){var x=y.element;if(x.matches(f)){y.code="",x.setAttribute(o,c);var b=x.appendChild(document.createElement("CODE"));b.textContent=r;var v=x.getAttribute("data-src"),w=y.language;if(w==="none"){var k=(/\.(\w+)$/.exec(v)||[,"none"])[1];w=s[k]||k}n.util.setLanguage(b,w),n.util.setLanguage(x,w);var S=n.plugins.autoloader;S&&S.loadLanguages(w),h(v,function(j){x.setAttribute(o,u);var N=p(x.getAttribute("data-range"));if(N){var P=j.split(/\r\n?|\n/g),A=N[0],E=N[1]==null?P.length:N[1];A<0&&(A+=P.length),A=Math.max(0,Math.min(A-1,P.length)),E<0&&(E+=P.length),E=Math.max(0,Math.min(E,P.length)),j=P.slice(A,E).join(`
651
+ `),x.hasAttribute("data-start")||x.setAttribute("data-start",String(A+1))}b.textContent=j,n.highlightElement(b)},function(j){x.setAttribute(o,d),b.textContent=j})}}),n.plugins.fileHighlight={highlight:function(x){for(var b=(x||document).querySelectorAll(f),v=0,w;w=b[v++];)n.highlightElement(w)}};var g=!1;n.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(eD);var aJ=eD.exports;const _f=hi(aJ);Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/};Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python;Prism.languages.py=Prism.languages.python;(function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=r.variable[1].inside,s=0;s<i.length;s++)a[i[s]]=e.languages.bash[i[s]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(Prism);const J0=`inputs:
652
+ - name: target
653
+ description: The target resource to analyze
654
+ required: true
655
+
656
+ outputs:
657
+ - name: analysis_report
658
+ description: Markdown formatted analysis result
659
+
660
+ troubleshooting:
661
+ - "Ensure network connectivity to the target"
662
+
663
+ examples:
664
+ - "run analysis --target=payment-service"`,iv=document.createElement("style");iv.textContent=`
665
+ code[class*="language-"], pre[class*="language-"] {
666
+ text-shadow: none !important;
667
+ font-family: "JetBrains Mono", "Fira Code", monospace !important;
668
+ }
669
+ .token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6a9955; }
670
+ .token.punctuation { color: #d4d4d4; }
671
+ .token.namespace { opacity: .7; }
672
+ .token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #b5cea8; }
673
+ .token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #ce9178; }
674
+ .token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #d4d4d4; }
675
+ .token.atrule, .token.attr-value, .token.keyword { color: #c586c0; }
676
+ .token.function, .token.class-name { color: #dcdcaa; }
677
+ .token.regex, .token.important, .token.variable { color: #d16969; }
678
+ `;document.head.querySelector("style[data-prism-custom]")||(iv.setAttribute("data-prism-custom","true"),document.head.appendChild(iv));const sJ=["Custom","Database","Security","Network","Core","Utility","Monitoring","Automation"],v1="siclaw_skill_draft:";function oJ(e,t){const n={name:t.name,description:t.description,type:t.type,version:t.version,specs:t.specs||"",scripts:(t.scripts||[]).map(r=>({id:r.id,info:r.info,name:r.name,content:r.content})),savedAt:Date.now()};try{localStorage.setItem(v1+e,JSON.stringify(n))}catch{}}function lJ(e){try{const t=localStorage.getItem(v1+e);return t?JSON.parse(t):null}catch{return null}}function Dc(e){localStorage.removeItem(v1+e)}function kC(e,t){return!e||!t?!1:e.name!==t.name||e.description!==t.description||e.specs!==t.specs||e.type!==t.type||e.version!==t.version||JSON.stringify((e.scripts||[]).map(n=>({id:n.id,info:n.info,name:n.name,content:n.content})))!==JSON.stringify((t.scripts||[]).map(n=>({id:n.id,info:n.info,name:n.name,content:n.content})))}function cJ(e){const t=Math.floor((Date.now()-e)/1e3);return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function uJ(){var it,X,de,Ee,fe,R,me,Ae,ze,ht,Je,pt,Wt,Ct;const{id:e}=s7(),t=$i(),[n]=bd(),{sendRpc:r,isConnected:i}=$t(),[a,s]=m.useState(!1),[o,c]=m.useState(null),[u,d]=m.useState(null),[f,h]=m.useState(!1),[p,g]=m.useState(!1),[y,x]=m.useState(!1),b=m.useRef(null),v=m.useRef(null),[w,k]=m.useState(!1),[S,j]=m.useState(!1),[N,P]=m.useState(!1),[A,E]=m.useState([]),[O,C]=m.useState(!1),[M,I]=m.useState(null),[B,se]=m.useState(null),[Q,D]=m.useState(null),K=e==="new",T=!!o&&o.scope!=="personal",ie=ls(),J=(ie==null?void 0:ie.username)==="admin",_=(o==null?void 0:o.authorId)===(ie==null?void 0:ie.id),H=async()=>{if(!(!o||!e))try{k(!0);const ae=await Z4(r,String(o.id));t(`/skills/${ae.id}`)}catch(ae){console.error("[SkillEditor] Fork failed:",ae)}finally{k(!1)}},ee=async()=>{if(!(!e||K)){if(N){P(!1);return}C(!0);try{const ae=await LQ(r,e);E(ae.versions),P(!0)}catch(ae){console.error("[SkillEditor] Failed to load history:",ae)}finally{C(!1)}}},be=async ae=>{if(!(!e||K))try{await X4(r,e,ae);const Me=await rv(r,e);if(Me){const He={...Me,specs:Me.specs||J0,scripts:Me.scripts||[]};c(He),se(He),Dc(e)}P(!1),I(null)}catch(Me){console.error("[SkillEditor] Rollback failed:",Me)}},te=(o==null?void 0:o.scope)==="personal"&&_||(o==null?void 0:o.scope)==="team"&&J;m.useEffect(()=>{if(g(!1),x(!1),D(null),!e)return;const ae=He=>{se(He);const lt=lJ(e);lt&&lt.savedAt>0?(c({...He,name:lt.name,description:lt.description,type:lt.type,version:lt.version,specs:lt.specs,scripts:lt.scripts}),D({savedAt:lt.savedAt})):c(He)};if(e==="new"){v.current=null;const He={id:`new-${Date.now()}`,name:"New Custom Skill",description:"Describe what this skill does...",type:"Custom",icon:Gs,status:"not_installed",version:"0.0.1",specs:J0,scripts:[],scope:"personal",author:"Current User",contributionStatus:"none",enabled:!0};ae(He),s(!1),d(null);return}if(!i||v.current===e)return;v.current=e;let Me=!1;return rv(r,e).then(He=>{if(!Me)if(He){const lt={...He,specs:He.specs||J0,scripts:He.scripts||[]};ae(lt)}else t("/skills")}),()=>{Me=!0}},[e,t,i,r]),m.useEffect(()=>{n.get("history")==="true"&&!N&&!K&&ee()},[n]);const ye=m.useMemo(()=>kC(o,B),[o,B]);m.useEffect(()=>{if(!e||!o||!B||T)return;const ae=setTimeout(()=>{kC(o,B)?oJ(e,o):Dc(e)},1e3);return()=>clearTimeout(ae)},[e,o,B,T]),m.useEffect(()=>{const ae=Me=>{ye&&Me.preventDefault()};return window.addEventListener("beforeunload",ae),()=>window.removeEventListener("beforeunload",ae)},[ye]);const Z=m.useRef(!1),ne=g7(()=>ye&&!Z.current),ve=m.useCallback(()=>{e&&B&&(Dc(e),c(B),D(null))},[e,B]),L=m.useCallback(()=>{D(null)},[]),W=async()=>{if(o)try{h(!0),await AQ(r,o,K),e&&Dc(e),se(o),Z.current=!0,t("/skills")}catch(ae){console.error("[SkillEditor] Save failed:",ae)}finally{h(!1)}},F=()=>{o&&j(!0)},le=async()=>{if(o)try{await TQ(r,String(o.id)),e&&Dc(e),Z.current=!0,t("/skills")}catch(ae){console.error("[SkillEditor] Delete failed:",ae)}},[oe,Re]=m.useState(null),[We,nt]=m.useState(""),Nt=ae=>{Re(ae),nt(ae==="python"?"script.py":"script.sh"),g(!1)},hn=()=>{if(!oe||!We.trim())return;const ae={id:`new-${Date.now()}`,info:oe,name:We.trim(),content:oe==="python"?'print("New Python Script")':`#!/bin/bash
679
+
680
+ echo "New Shell Script"`};c(Me=>Me?{...Me,scripts:[...Me.scripts||[],ae]}:null),d(ae.id),Re(null),nt("")},Xt=(ae,Me)=>{if(ae.stopPropagation(),!(o!=null&&o.scripts))return;const He=o.scripts.filter(lt=>lt.id!==Me);c({...o,scripts:He}),u===Me&&He.length>0?d(He[0].id):u===Me&&He.length===0&&d(null)},xt=ae=>{var lt;const Me=(lt=ae.target.files)==null?void 0:lt[0];if(!Me)return;const He=new FileReader;He.onload=Ss=>{var qr;const _o=(qr=Ss.target)==null?void 0:qr.result,mc=Me.name.endsWith(".py"),ks={id:`upload-${Date.now()}`,info:mc?"python":"shell",name:Me.name,content:_o};c(mi=>mi?{...mi,scripts:[...mi.scripts||[],ks]}:null),d(ks.id)},He.readAsText(Me),ae.target.value=""},rt=ae=>{o&&c({...o,name:ae.target.value})};return o?l.jsxs("div",{className:"h-full bg-white flex flex-col relative",children:[l.jsx(li,{children:oe&&l.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4 bg-black/20 backdrop-blur-[1px]",children:l.jsxs(cn.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-xl shadow-2xl border border-gray-100 p-5 w-80 space-y-4",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-bold text-gray-900",children:["New ",oe==="python"?"Python":"Shell"," Script"]}),l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Enter a filename for your script."})]}),l.jsx("input",{autoFocus:!0,type:"text",value:We,onChange:ae=>nt(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&hn(),className:"w-full px-3 py-2 bg-gray-50 border border-gray-200 rounded-lg text-sm text-gray-900 focus:outline-none focus:ring-2 focus:ring-primary-500/50",placeholder:oe==="python"?"script.py":"script.sh"}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{onClick:()=>Re(null),className:"px-3 py-1.5 text-xs font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:"Cancel"}),l.jsx("button",{onClick:hn,disabled:!We.trim(),className:"px-3 py-1.5 text-xs font-medium bg-primary-600 text-white hover:bg-primary-700 rounded-lg shadow-sm disabled:opacity-50 transition-all",children:"Create Script"})]})]})})}),l.jsxs("header",{className:"flex items-center justify-between px-6 py-3 border-b border-gray-100 bg-white shrink-0 h-14",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(ut,{content:"Back to Skills",children:l.jsx("button",{onClick:()=>t("/skills"),className:"p-2 -ml-2 text-gray-400 hover:text-gray-700 rounded-lg hover:bg-gray-100 transition-colors",children:l.jsx(q7,{className:"w-5 h-5"})})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[T?l.jsx("span",{className:"text-base font-bold text-gray-900 px-1 -ml-1 h-6 flex items-center",children:o.name}):l.jsx("input",{type:"text",value:o.name,onChange:rt,className:"text-base font-bold text-gray-900 bg-transparent border-none focus:ring-0 p-0 hover:bg-gray-50 rounded px-1 -ml-1 transition-colors w-64 h-6"}),ye&&l.jsx("span",{className:"text-amber-500 text-lg leading-none",title:"Unsaved changes",children:"●"})]}),o.scope&&o.scope!=="personal"&&l.jsxs("span",{className:U("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium",o.scope==="builtin"?"bg-gray-100 text-gray-700":"bg-blue-50 text-blue-700"),children:[o.scope==="builtin"?l.jsx(Zh,{className:"w-2.5 h-2.5"}):l.jsx(ta,{className:"w-2.5 h-2.5"}),o.scope==="builtin"?"System Skills":"Team Skills",l.jsx("span",{className:"text-gray-400 ml-0.5",children:"· Read-only"})]})]})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{content:a?"Hide Scripts":"Show Scripts",children:l.jsx("button",{onClick:()=>s(!a),className:U("p-2 rounded-lg text-gray-400 transition-all border border-transparent hover:border-gray-200 hover:bg-gray-50",a?"text-primary-600 bg-primary-50 hover:bg-primary-100 hover:border-primary-200":""),children:l.jsx(iB,{className:"w-5 h-5"})})}),!K&&l.jsx(ut,{content:N?"Hide History":"Version History",children:l.jsx("button",{onClick:ee,disabled:O,className:U("p-2 rounded-lg text-gray-400 transition-all border border-transparent hover:border-gray-200 hover:bg-gray-50",N?"text-indigo-600 bg-indigo-50 hover:bg-indigo-100 hover:border-indigo-200":""),children:O?l.jsx(Le,{className:"w-5 h-5 animate-spin"}):l.jsx(ow,{className:"w-5 h-5"})})}),l.jsx("div",{className:"h-5 w-px bg-gray-200 mx-1"}),T?l.jsx(ut,{content:"Fork to Personal",children:l.jsx("button",{onClick:H,disabled:w,className:"p-2 text-purple-600 hover:bg-purple-50 rounded-lg transition-colors disabled:opacity-50",children:w?l.jsx(Le,{className:"w-5 h-5 animate-spin"}):l.jsx(sw,{className:"w-5 h-5"})})}):l.jsxs(l.Fragment,{children:[l.jsx(ut,{content:f?"Saving...":"Save Changes",children:l.jsx("button",{onClick:W,disabled:f,className:"p-2 text-primary-600 hover:bg-primary-50 rounded-lg transition-colors disabled:opacity-50",children:f?l.jsx(Le,{className:"w-5 h-5 animate-spin"}):l.jsx(Wn,{className:"w-5 h-5"})})}),l.jsx(ut,{content:"Delete Skill",children:l.jsx("button",{onClick:F,className:"p-2 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors",children:l.jsx(sr,{className:"w-5 h-5"})})})]})]})]}),Q&&l.jsxs("div",{className:"px-6 py-2.5 bg-amber-50 border-b border-amber-200 flex items-center gap-2 shrink-0",children:[l.jsxs("span",{className:"text-sm text-amber-800",children:["Unsaved draft found (",cJ(Q.savedAt),")"]}),l.jsx("div",{className:"flex-1"}),l.jsx("button",{onClick:L,className:"px-3 py-1 text-xs font-medium text-amber-700 hover:bg-amber-100 rounded-md transition-colors",children:"Keep Draft"}),l.jsx("button",{onClick:ve,className:"px-3 py-1 text-xs font-medium text-amber-700 hover:bg-amber-100 rounded-md transition-colors",children:"Discard"})]}),o.reviewStatus==="pending"&&l.jsxs("div",{className:"px-6 py-2.5 bg-amber-50 border-b border-amber-200 flex items-center gap-2 shrink-0",children:[l.jsx(Bu,{className:"w-4 h-4 text-amber-600"}),l.jsx("span",{className:"text-sm text-amber-800 font-medium",children:"This skill is pending publish review. Test environment has the latest version."})]}),o.reviewStatus==="approved"&&o.scope==="personal"&&o.publishedVersion!=null&&Number(String(o.version).replace(/^v/,""))>o.publishedVersion&&l.jsxs("div",{className:"px-6 py-2.5 bg-blue-50 border-b border-blue-200 flex items-center gap-2 shrink-0",children:[l.jsx(Ka,{className:"w-4 h-4 text-blue-500"}),l.jsxs("span",{className:"text-sm text-blue-800 font-medium",children:["Modified since published v",o.publishedVersion,". Submit for review to publish changes to production."]})]}),o.reviewStatus==="draft"&&o.scope==="personal"&&l.jsxs("div",{className:"px-6 py-2.5 bg-gray-50 border-b border-gray-200 flex items-center gap-2 shrink-0",children:[l.jsx(Bu,{className:"w-4 h-4 text-gray-400"}),l.jsx("span",{className:"text-sm text-gray-600 font-medium",children:"Draft — available in test environments only. Request publish to use in production."})]}),l.jsxs("div",{className:"flex flex-1 overflow-hidden min-h-0 bg-gray-50/50",children:[l.jsx("div",{className:U("flex flex-col transition-all duration-300 relative bg-white border-r border-gray-200",a?"w-[70%] max-w-[70%]":"w-full"),children:l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 flex flex-col gap-6",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider mb-2 block",children:"Description"}),l.jsx("textarea",{value:o.description,onChange:ae=>!T&&c({...o,description:ae.target.value}),readOnly:T,className:U("w-full px-3 py-2 border border-gray-200 rounded-lg text-sm text-gray-700 outline-none resize-none transition-all placeholder:text-gray-400",T?"bg-gray-50 cursor-default":"bg-gray-50/50 focus:ring-1 focus:ring-primary-500/50 focus:bg-white focus:border-primary-500"),rows:2,placeholder:"Enter a description..."})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider mb-2 block",children:"Category"}),l.jsxs("div",{className:"relative group/cat",children:[l.jsx("input",{type:"text",value:o.type,onChange:ae=>!T&&c({...o,type:ae.target.value}),onFocus:()=>!T&&x(!0),readOnly:T,className:U("w-full px-3 py-2 border border-gray-200 rounded-lg text-sm text-gray-700 outline-none transition-all placeholder:text-gray-400",T?"bg-gray-50 cursor-default":"bg-gray-50/50 focus:ring-1 focus:ring-primary-500/50 focus:bg-white focus:border-primary-500"),placeholder:"Select or type..."}),!T&&l.jsx("button",{onClick:()=>x(!y),className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 p-1",children:l.jsx(ea,{className:"w-4 h-4"})}),y&&!T&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>x(!1)}),l.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-white border border-gray-200 rounded-lg shadow-lg z-20 py-1 max-h-48 overflow-y-auto",children:sJ.map(ae=>l.jsx("button",{className:"w-full text-left px-3 py-2 text-sm hover:bg-gray-50 text-gray-700 hover:text-primary-600 transition-colors",onClick:()=>{c({...o,type:ae}),x(!1)},children:ae},ae))})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider mb-2 block",children:"Version"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",value:o.version,readOnly:!0,className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm text-gray-700 outline-none bg-gray-50 cursor-default",placeholder:"e.g. v1"}),o.publishedVersion!=null&&String(o.publishedVersion)!==((it=o.version)==null?void 0:it.replace(/^v/,""))&&l.jsxs("span",{className:"text-xs text-green-600 whitespace-nowrap",children:["(published: v",o.publishedVersion,")"]})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider mb-2 block",children:"Labels"}),l.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[(o.labels??[]).map(ae=>l.jsxs("span",{className:U("px-1.5 py-0.5 rounded text-[10px] font-medium border bg-gray-50 text-gray-600 border-gray-200 inline-flex items-center gap-1",!T&&"pr-0.5"),children:[ae,!T&&l.jsx("button",{onClick:()=>{const Me=(o.labels??[]).filter(He=>He!==ae);c({...o,labels:Me}),K||pC(r,String(o.id),Me).catch(()=>{})},className:"ml-0.5 p-0.5 rounded hover:bg-gray-200 text-gray-400 hover:text-gray-600 transition-colors",children:l.jsx(Ze,{className:"w-2.5 h-2.5"})})]},ae)),!T&&l.jsx("input",{type:"text",placeholder:"+ Add label",className:"text-[11px] px-1.5 py-0.5 border border-transparent rounded bg-transparent text-gray-500 outline-none w-20 focus:border-gray-200 focus:bg-white placeholder:text-gray-300",onKeyDown:ae=>{if(ae.key==="Enter"||ae.key===","){ae.preventDefault();const Me=ae.target.value.trim();if(Me&&!(o.labels??[]).includes(Me)){const He=[...o.labels??[],Me];c({...o,labels:He}),K||pC(r,String(o.id),He).catch(()=>{})}ae.target.value=""}}})]})]}),l.jsxs("div",{className:"flex-1 flex flex-col min-h-[400px]",children:[l.jsxs("label",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider mb-2 flex justify-between group px-1",children:["Skill Specification (YAML)",l.jsx("span",{className:"text-[10px] text-gray-400 font-medium normal-case group-hover:text-primary-600 cursor-pointer transition-colors opacity-0 group-hover:opacity-100",children:"Reset Template"})]}),l.jsx("div",{className:"relative flex-1 group/editor",children:l.jsx("textarea",{value:o.specs,onChange:ae=>!T&&c({...o,specs:ae.target.value}),readOnly:T,className:U("w-full h-full px-4 py-3 border border-gray-200 rounded-lg text-xs font-mono text-gray-700 outline-none resize-none leading-relaxed transition-all",T?"bg-gray-50 cursor-default":"bg-gray-50/50 focus:ring-1 focus:ring-primary-500/50 focus:bg-white focus:border-primary-500"),spellCheck:!1})})]})]})}),a&&l.jsxs("div",{className:"flex-1 flex flex-col bg-white",children:[l.jsxs("div",{className:"px-6 py-4 flex items-center justify-between border-b border-gray-100 bg-white",children:[l.jsxs("h3",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:["Scripts (",((X=o.scripts)==null?void 0:X.length)||0,")"]}),!T&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ut,{content:"Upload Script",children:l.jsx("button",{onClick:()=>{var ae;return(ae=b.current)==null?void 0:ae.click()},className:"p-1.5 text-gray-400 hover:text-gray-700 hover:bg-gray-100 rounded-lg transition-colors",children:l.jsx(nB,{className:"w-4 h-4"})})}),l.jsxs("div",{className:"relative",children:[l.jsx(ut,{content:"New Script",children:l.jsx("button",{onClick:()=>g(!p),className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-colors",children:l.jsx(In,{className:"w-4 h-4"})})}),p&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>g(!1)}),l.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 bg-white border border-gray-100 rounded-lg shadow-xl z-20 py-1 flex flex-col overflow-hidden",children:[l.jsxs("button",{onClick:()=>Nt("shell"),className:"px-3 py-2.5 text-left text-xs text-gray-700 hover:bg-gray-50 flex items-center gap-2",children:[l.jsx(si,{className:"w-3.5 h-3.5 text-green-600"}),"Shell Script"]}),l.jsxs("button",{onClick:()=>Nt("python"),className:"px-3 py-2.5 text-left text-xs text-gray-700 hover:bg-gray-50 flex items-center gap-2",children:[l.jsx(Ka,{className:"w-3.5 h-3.5 text-blue-600"}),"Python Script"]})]})]})]}),l.jsx("input",{type:"file",ref:b,className:"hidden",accept:".sh,.py,.txt",onChange:xt})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6 pt-2",children:!o.scripts||o.scripts.length===0?l.jsxs("div",{className:"h-40 flex flex-col items-center justify-center border-2 border-dashed border-gray-200 rounded-xl bg-gray-50/50",children:[l.jsx("div",{className:"p-3 bg-white rounded-full shadow-sm mb-3",children:l.jsx(Gs,{className:"w-6 h-6 text-gray-300"})}),l.jsx("p",{className:"text-sm text-gray-500 font-medium",children:"No scripts yet"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Add or upload a script to get started"})]}):l.jsx("div",{className:"flex flex-col gap-2",children:o.scripts.map(ae=>l.jsxs("div",{onClick:()=>d(ae.id),className:"group flex items-center justify-between p-3 bg-white border border-gray-200 hover:border-primary-500/50 hover:shadow-sm rounded-lg cursor-pointer transition-all duration-200",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:U("w-8 h-8 rounded-md flex items-center justify-center shrink-0",ae.info==="python"?"bg-blue-50 text-blue-600":"bg-green-50 text-green-600"),children:ae.info==="python"?l.jsx(Ka,{className:"w-4 h-4"}):l.jsx(si,{className:"w-4 h-4"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-900 group-hover:text-primary-600 transition-colors",children:ae.name}),l.jsxs("span",{className:"text-[10px] text-gray-400 font-mono",children:[ae.info==="python"?"Python":"Bash"," · ",ae.content.length,"B"]})]})]}),l.jsxs("div",{className:"flex items-center gap-1 opacity-100 sm:opacity-0 group-hover:opacity-100 transition-opacity pl-4",children:[l.jsx(ut,{content:T?"View Script":"Edit Script",children:l.jsx("button",{onClick:Me=>{Me.stopPropagation(),d(ae.id)},className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-md transition-colors",children:T?l.jsx(wd,{className:"w-4 h-4"}):l.jsx(Gs,{className:"w-4 h-4"})})}),!T&&l.jsx(ut,{content:"Delete Script",children:l.jsx("button",{onClick:Me=>Xt(Me,ae.id),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-md transition-colors",children:l.jsx(sr,{className:"w-4 h-4"})})})]})]},ae.id))})})]}),l.jsx(li,{children:N&&l.jsxs(cn.div,{initial:{width:0,opacity:0},animate:{width:320,opacity:1},exit:{width:0,opacity:0},transition:{duration:.2},className:"border-l border-gray-200 bg-white flex flex-col overflow-hidden shrink-0",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-gray-100 flex items-center justify-between",children:[l.jsx("h3",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"Version History"}),l.jsx("button",{onClick:()=>P(!1),className:"p-1 text-gray-400 hover:text-gray-700 rounded",children:l.jsx(Ze,{className:"w-4 h-4"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:A.length===0?l.jsx("p",{className:"text-sm text-gray-400 text-center py-8",children:"No published versions yet"}):A.map(ae=>l.jsxs("div",{className:"p-3 rounded-lg border border-gray-100 hover:border-gray-200 transition-colors",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsxs("span",{className:"text-sm font-bold text-gray-900",children:["v",ae.version]}),te&&l.jsx(ut,{content:"Rollback to this version",children:l.jsx("button",{onClick:()=>I(ae.version),className:"p-1 text-gray-400 hover:text-orange-600 hover:bg-orange-50 rounded transition-colors",children:l.jsx(QO,{className:"w-3.5 h-3.5"})})})]}),l.jsx("p",{className:"text-xs text-gray-500 truncate",children:ae.message}),l.jsxs("div",{className:"flex items-center gap-2 mt-1.5 text-[10px] text-gray-400",children:[l.jsx("span",{children:ae.author}),ae.date&&l.jsx("span",{children:new Date(ae.date).toLocaleDateString()})]})]},ae.hash))})]})}),l.jsx(li,{children:u&&l.jsxs(cn.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.15},className:"absolute inset-0 z-50 bg-[#1e1e1e] flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-[#252526] border-b border-[#1e1e1e]",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:U("w-8 h-8 rounded flex items-center justify-center",((Ee=(de=o.scripts)==null?void 0:de.find(ae=>ae.id===u))==null?void 0:Ee.info)==="python"?"bg-[#37373d] text-yellow-400":"bg-[#37373d] text-green-400"),children:((R=(fe=o.scripts)==null?void 0:fe.find(ae=>ae.id===u))==null?void 0:R.info)==="python"?l.jsx(Ka,{className:"w-4 h-4"}):l.jsx(si,{className:"w-4 h-4"})}),l.jsx("span",{className:"text-sm font-medium text-gray-200 font-mono",children:(Ae=(me=o.scripts)==null?void 0:me.find(ae=>ae.id===u))==null?void 0:Ae.name})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[!T&&l.jsx(ut,{content:"Save Script",children:l.jsx("button",{onClick:W,className:"p-1.5 text-gray-400 hover:text-white hover:bg-[#333] rounded transition-colors",children:l.jsx(Wn,{className:"w-5 h-5"})})}),l.jsx(ut,{content:"Close Editor",children:l.jsx("button",{onClick:()=>d(null),className:"p-1.5 text-gray-400 hover:text-white hover:bg-[#333] rounded transition-colors",children:l.jsx(Ze,{className:"w-5 h-5"})})})]})]}),l.jsx("div",{className:"flex-1 relative font-mono text-sm overflow-y-auto custom-scrollbar",children:l.jsx(iJ,{value:((ht=(ze=o.scripts)==null?void 0:ze.find(ae=>ae.id===u))==null?void 0:ht.content)||"",onValueChange:ae=>{var Me;T||c({...o,scripts:(Me=o.scripts)==null?void 0:Me.map(He=>He.id===u?{...He,content:ae}:He)})},highlight:ae=>{var lt;const Me=(lt=o.scripts)==null?void 0:lt.find(Ss=>Ss.id===u),He=(Me==null?void 0:Me.info)==="python"?_f.languages.python:_f.languages.bash;return _f.highlight(ae,He||_f.languages.js,(Me==null?void 0:Me.info)||"javascript")},padding:24,style:{fontFamily:'"JetBrains Mono", "Fira Code", monospace',fontSize:14,backgroundColor:"#1e1e1e",color:"#d4d4d4",minHeight:"100%"},className:"min-h-full",textareaClassName:"focus:outline-none"})}),l.jsxs("div",{className:"h-6 bg-[#007acc] text-white flex items-center px-4 text-[11px] font-medium gap-6 select-none border-t border-[#007acc]",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Gs,{className:"w-3 h-3 opacity-70"}),l.jsx("span",{children:((pt=(Je=o.scripts)==null?void 0:Je.find(ae=>ae.id===u))==null?void 0:pt.info)==="python"?"Python 3.10":"Bash 5.0"})]}),l.jsx("span",{className:"flex-1"}),l.jsx("span",{children:"UTF-8"}),l.jsxs("span",{children:["Ln ",(Ct=(Wt=o.scripts)==null?void 0:Wt.find(ae=>ae.id===u))==null?void 0:Ct.content.split(`
681
+ `).length,", Col 1"]})]})]})})]}),l.jsx(no,{isOpen:S,onClose:()=>j(!1),onConfirm:le,title:"Delete Skill",description:"Are you sure you want to delete this skill? This action cannot be undone.",confirmText:"Delete",variant:"danger"}),l.jsx(no,{isOpen:M!==null,onClose:()=>I(null),onConfirm:()=>M!==null&&be(M),title:"Rollback Version",description:`Are you sure you want to rollback to v${M}? This will overwrite the current working copy and published snapshot.`,confirmText:"Rollback",variant:"warning"}),l.jsx(no,{isOpen:ne.state==="blocked",onClose:()=>{var ae;return ne.state==="blocked"&&((ae=ne.reset)==null?void 0:ae.call(ne))},onConfirm:()=>{var ae;return ne.state==="blocked"&&((ae=ne.proceed)==null?void 0:ae.call(ne))},title:"Unsaved Changes",description:"You have unsaved changes. Your draft has been auto-saved and can be restored next time you open this skill.",confirmText:"Leave",cancelText:"Keep Editing",variant:"warning"})]}):l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Le,{className:"animate-spin text-gray-400"})})}function dJ(e){const[t,n]=m.useState([]),[r,i]=m.useState(!0),a=m.useCallback(async()=>{try{const o=await e("channels.list");n(o.channels)}catch(o){console.error("[useChannels] Failed to load:",o)}finally{i(!1)}},[e]),s=m.useCallback(async(o,c,u)=>{await e("channels.save",{id:o,enabled:c,config:u}),await a()},[e,a]);return{channels:t,loading:r,loadChannels:a,saveChannel:s}}const fJ=[{id:"slack",name:"Slack",description:"Slack workspace bot with rich message formatting and threads.",icon:ZO},{id:"discord",name:"Discord",description:"Discord server bot with slash commands and channel messaging.",icon:si},{id:"telegram",name:"Telegram",description:"Bot integration for Telegram groups and direct messages.",icon:jm},{id:"lark",name:"Lark",description:"Enterprise bot for Lark with interactive cards and approval flows.",icon:oB},{id:"whatsapp",name:"WhatsApp",description:"WhatsApp Business API integration for customer messaging.",icon:lB,comingSoon:!0}];function hJ(e){return fJ.map(t=>{const n=e.find(r=>r.id===t.id);return{...t,status:(n==null?void 0:n.status)??"disconnected",error:n==null?void 0:n.error,config:(n==null?void 0:n.config)??{},enabled:(n==null?void 0:n.enabled)??!1}})}function pJ({channel:e,isOpen:t,onClose:n,onSave:r}){const[i,a]=m.useState({}),[s,o]=m.useState(!1),[c,u]=m.useState(!1);m.useEffect(()=>{e&&(a({...e.config}),o(e.enabled))},[e]);const d=async()=>{if(!(!e||c)){u(!0);try{await r(e.id,s,i)}finally{u(!1)}}};return e?l.jsx(li,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(cn.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(cn.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[480px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-white",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-2 bg-gray-50 rounded-lg border border-gray-100",children:l.jsx(e.icon,{className:"w-5 h-5 text-gray-700"})}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900",children:e.name}),l.jsx("p",{className:"text-xs text-gray-400",children:"Configuration"})]})]}),l.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:l.jsx(Ze,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50/50 rounded-xl border border-gray-100",children:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("span",{className:"text-sm font-medium text-gray-900",children:"Enable Integration"}),l.jsx("span",{className:"text-xs text-gray-500",children:"Allow Siclaw to use this channel"})]}),l.jsx("button",{onClick:()=>o(!s),className:U("w-11 h-6 rounded-full transition-colors relative",s?"bg-primary-600":"bg-gray-200"),children:l.jsx("span",{className:U("w-4 h-4 rounded-full bg-white shadow-sm absolute top-1 transition-all",s?"left-6":"left-1")})})]}),l.jsx("div",{className:"h-px bg-gray-100 w-full"}),l.jsxs("div",{className:"space-y-4",children:[e.id==="lark"&&l.jsxs(l.Fragment,{children:[l.jsx(_a,{label:"App ID",value:i.appId||"",onChange:f=>a({...i,appId:f}),placeholder:"cli_...",required:!0}),l.jsx(_a,{label:"App Secret",value:i.appSecret||"",onChange:f=>a({...i,appSecret:f}),placeholder:"Your app secret...",type:"password",required:!0})]}),e.id==="telegram"&&l.jsx(_a,{label:"Bot Token",value:i.botToken||"",onChange:f=>a({...i,botToken:f}),placeholder:"123456:ABC-DEF...",type:"password",required:!0}),e.id==="slack"&&l.jsxs(l.Fragment,{children:[l.jsx(_a,{label:"Bot Token",value:i.botToken||"",onChange:f=>a({...i,botToken:f}),placeholder:"xoxb-...",type:"password",required:!0}),l.jsx(_a,{label:"App Token",value:i.appToken||"",onChange:f=>a({...i,appToken:f}),placeholder:"xapp-...",type:"password",required:!0})]}),e.id==="discord"&&l.jsx(_a,{label:"Bot Token",value:i.token||"",onChange:f=>a({...i,token:f}),placeholder:"Your bot token...",type:"password",required:!0}),e.id==="whatsapp"&&l.jsxs(l.Fragment,{children:[l.jsx(_a,{label:"Access Token",value:i.accessToken||"",onChange:f=>a({...i,accessToken:f}),placeholder:"Your access token...",type:"password",required:!0}),l.jsx(_a,{label:"Phone Number ID",value:i.phoneNumberId||"",onChange:f=>a({...i,phoneNumberId:f}),placeholder:"Phone number ID...",required:!0})]})]}),e.status==="error"&&e.error&&l.jsxs("div",{className:"p-3 bg-red-50 border border-red-100 rounded-lg",children:[l.jsx("p",{className:"text-sm text-red-700 font-medium",children:"Connection Error"}),l.jsx("p",{className:"text-xs text-red-600 mt-1",children:e.error})]})]})}),l.jsxs("div",{className:"p-6 border-t border-gray-100 bg-gray-50/50 flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-400",children:e.status==="connected"?"Currently Connected":e.status==="error"?"Connection Error":"Not Connected"}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded-lg transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:d,disabled:c,className:"px-4 py-2 text-sm font-medium bg-primary-600 text-white hover:bg-primary-700 rounded-lg shadow-sm flex items-center gap-2 disabled:opacity-50",children:[l.jsx(Wn,{className:"w-4 h-4"}),c?"Saving...":"Save Configuration"]})]})]})]})]})}):null}function _a({label:e,value:t,onChange:n,placeholder:r,type:i="text",required:a}){return l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700 flex items-center gap-1",children:[e,a&&l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:i,value:t,onChange:s=>n(s.target.value),placeholder:r,className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 transition-all font-mono"})]})}function mJ(){const{sendRpc:e,isConnected:t}=$t(),{channels:n,loading:r,loadChannels:i,saveChannel:a}=dJ(e),[s,o]=m.useState(null),[c,u]=m.useState(!1),d=m.useRef(!1);m.useEffect(()=>{t&&!d.current&&(d.current=!0,i())},[t,i]);const f=hJ(n),h=g=>{g.comingSoon||(o(g),u(!0))},p=async(g,y,x)=>{await a(g,y,x),u(!1)};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsx("header",{className:"h-16 flex items-center justify-end px-6 bg-white sticky top-0 z-10",children:l.jsx("div",{className:"flex items-center gap-2"})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:l.jsx("div",{className:"max-w-5xl mx-auto space-y-6",children:r?l.jsx("div",{className:"text-center text-gray-400 py-12",children:"Loading channels..."}):l.jsx("div",{className:"grid grid-cols-1 gap-4",children:f.map(g=>l.jsxs("div",{className:U("group bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between transition-all",g.comingSoon?"opacity-60":"hover:border-primary-200 hover:shadow-sm"),children:[l.jsxs("div",{className:"flex items-center gap-5",children:[l.jsx("div",{className:U("w-8 h-8 rounded-lg flex items-center justify-center border transition-colors",g.status==="connected"?"bg-white border-gray-200":"bg-gray-50 border-gray-200 grayscale"),children:l.jsx(g.icon,{className:U("w-4 h-4",g.status==="connected"?"text-gray-900":"text-gray-400")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[l.jsx("h3",{className:"font-bold text-gray-900",children:g.name}),g.comingSoon&&l.jsx("span",{className:"px-2 py-0.5 rounded-full bg-gray-100 text-gray-500 text-[10px] font-bold uppercase tracking-wide border border-gray-200",children:"Coming Soon"}),!g.comingSoon&&g.status==="connected"&&l.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-50 text-green-700 text-[10px] font-bold uppercase tracking-wide border border-green-100",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse"}),"Active"]}),!g.comingSoon&&g.status==="error"&&l.jsx("span",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-50 text-red-700 text-[10px] font-bold uppercase tracking-wide border border-red-100",children:"Error"})]}),l.jsx("p",{className:"text-sm text-gray-500 max-w-xl",children:g.description}),g.status==="error"&&g.error&&l.jsx("p",{className:"text-xs text-red-500 mt-1 max-w-xl truncate",children:g.error})]})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-right hidden sm:block min-w-[100px]",children:[l.jsx("div",{className:"text-xs font-medium text-gray-400",children:"Status"}),l.jsx("div",{className:U("text-sm font-medium",g.status==="connected"?"text-green-600":g.status==="error"?"text-red-500":"text-gray-400"),children:g.comingSoon?"Coming Soon":g.status==="connected"?"Operational":g.status==="error"?"Error":"Not Configured"})]}),l.jsx("div",{className:"h-8 w-px bg-gray-100 hidden sm:block"}),l.jsx("button",{onClick:()=>h(g),disabled:g.comingSoon,className:U("px-4 py-2 rounded-lg font-medium text-sm transition-colors shadow-sm border min-w-[100px]",g.comingSoon?"bg-gray-100 border-gray-200 text-gray-400 cursor-not-allowed":g.status==="connected"?"bg-white border-gray-200 text-gray-700 hover:bg-gray-50":"bg-primary-600 border-primary-600 text-white hover:bg-primary-700"),children:g.comingSoon?"Coming Soon":g.status==="connected"?"Configure":"Connect"})]})]},g.id))})})}),l.jsx(pJ,{channel:s,isOpen:c,onClose:()=>u(!1),onSave:p})]})}function gJ(e){const[t,n]=m.useState([]),[r,i]=m.useState(!0),a=m.useCallback(async()=>{try{const c=await e("trigger.list");n((c.triggers??[]).map(u=>{var d,f;return{...u,icon:((d=u.configJson)==null?void 0:d.icon)||"zap",description:((f=u.configJson)==null?void 0:f.description)||u.name}}))}catch(c){console.error("[useTriggers] Failed to load:",c)}finally{i(!1)}},[e]),s=m.useCallback(async c=>{const u=await e("trigger.save",{id:c.id,name:c.name,type:c.type,status:c.status,config:{description:c.description,icon:c.icon}});return await a(),u},[e,a]),o=m.useCallback(async c=>{await e("trigger.delete",{id:c}),await a()},[e,a]);return{triggers:t,loading:r,loadTriggers:a,saveTrigger:s,deleteTrigger:o}}const tD=[{id:"zap",icon:kd,label:"Zap"},{id:"wifi",icon:mw,label:"WiFi"},{id:"activity",icon:G7,label:"Activity"},{id:"server",icon:hB,label:"Server"},{id:"database",icon:qO,label:"Database"},{id:"cloud",icon:Q7,label:"Cloud"},{id:"box",icon:Y7,label:"Box"},{id:"terminal",icon:si,label:"Terminal"},{id:"cpu",icon:mo,label:"CPU"},{id:"globe",icon:Il,label:"Globe"},{id:"message",icon:jm,label:"Message"},{id:"bell",icon:iw,label:"Bell"}],yJ=e=>{var t;return((t=tD.find(n=>n.id===e))==null?void 0:t.icon)||kd};function xJ({trigger:e,isOpen:t,onClose:n,onSave:r}){const[i,a]=m.useState(""),[s,o]=m.useState(""),[c,u]=m.useState("webhook"),[d,f]=m.useState("zap"),[h,p]=m.useState(!1),[g,y]=m.useState(!1);m.useEffect(()=>{t&&(e?(a(e.name),o(e.description),u(e.type),f(e.icon||"zap")):(a(""),o(""),u("webhook"),f("zap")))},[t,e]);const x=async()=>{if(!(!i.trim()||g)){y(!0);try{await r({id:e==null?void 0:e.id,name:i,description:s,type:c,status:(e==null?void 0:e.status)||"active",icon:d})}finally{y(!1)}}},b=v=>{navigator.clipboard.writeText(v),p(!0),setTimeout(()=>p(!1),2e3)};return l.jsx(li,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(cn.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(cn.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[480px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-white",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900",children:e?"Endpoint Details":"New Endpoint"}),l.jsx("p",{className:"text-xs text-gray-400",children:"Configure inbound integration"})]}),l.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:l.jsx(Ze,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Endpoint Type"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("button",{onClick:()=>u("webhook"),disabled:!!e,className:U("p-3 rounded-lg border text-left transition-all relative overflow-hidden",c==="webhook"?"border-primary-500 bg-primary-50/50 text-primary-700 ring-1 ring-primary-500":"border-gray-200 hover:border-gray-300 hover:bg-gray-50",!!e&&c!=="webhook"&&"opacity-50 cursor-not-allowed"),children:[l.jsx("div",{className:"font-semibold text-sm mb-0.5",children:"Webhook"}),l.jsx("div",{className:"text-[10px] opacity-70",children:"HTTP POST payloads"})]}),l.jsxs("button",{onClick:()=>u("websocket"),disabled:!!e,className:U("p-3 rounded-lg border text-left transition-all relative overflow-hidden",c==="websocket"?"border-primary-500 bg-primary-50/50 text-primary-700 ring-1 ring-primary-500":"border-gray-200 hover:border-gray-300 hover:bg-gray-50",!!e&&c!=="websocket"&&"opacity-50 cursor-not-allowed"),children:[l.jsx("div",{className:"font-semibold text-sm mb-0.5",children:"WebSocket"}),l.jsx("div",{className:"text-[10px] opacity-70",children:"Coming Soon"})]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Display Icon"}),l.jsx("div",{className:"grid grid-cols-6 gap-2",children:tD.map(v=>l.jsx("button",{onClick:()=>f(v.id),className:U("aspect-square flex flex-col items-center justify-center rounded-lg border transition-all hover:bg-gray-50",d===v.id?"border-primary-500 bg-primary-50 text-primary-600 ring-1 ring-primary-500":"border-gray-200 text-gray-500"),title:v.label,children:l.jsx(v.icon,{className:"w-5 h-5"})},v.id))})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Name ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:i,onChange:v=>a(v.target.value),placeholder:"e.g. Grafana Production",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Description"}),l.jsx("textarea",{value:s,onChange:v=>o(v.target.value),placeholder:"Optional description...",rows:3,className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 resize-none"})]})]}),e&&e.endpointUrl&&l.jsxs("div",{className:"mt-6 space-y-4 pt-6 border-t border-gray-100",children:[l.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:"Connection Details"}),l.jsxs("div",{className:"bg-gray-50 rounded-lg border border-gray-200 p-4 space-y-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l.jsx("label",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:c==="webhook"?"Endpoint URL":"Stream URL"}),l.jsxs("button",{onClick:()=>b(e.endpointUrl),className:"text-primary-600 hover:text-primary-700 text-xs font-medium flex items-center gap-1",children:[h?l.jsx($n,{className:"w-3 h-3"}):l.jsx(kx,{className:"w-3 h-3"}),h?"Copied":"Copy"]})]}),l.jsx("div",{className:"font-mono text-xs text-gray-700 bg-white border border-gray-200 rounded p-2 break-all select-all",children:e.endpointUrl})]}),e.secret&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1.5",children:"Authentication Header"}),l.jsx("div",{className:"bg-white border border-gray-200 rounded p-3",children:l.jsxs("div",{className:"flex gap-2 font-mono text-xs text-blue-600",children:[l.jsx("span",{className:"shrink-0 selection:bg-blue-100",children:"Authorization: Bearer"}),l.jsx("span",{className:"text-gray-600 break-all select-all",children:e.secret})]})})]})]}),l.jsxs("div",{className:"flex gap-3 p-3 bg-blue-50 text-blue-700 rounded-lg text-xs leading-relaxed",children:[l.jsx(km,{className:"w-4 h-4 shrink-0 mt-0.5"}),"Use the URL and Secret above to configure your third-party service provider. Incoming events will be processed by the Rules Engine."]})]})]}),l.jsxs("div",{className:"p-6 border-t border-gray-100 bg-white flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 rounded-lg transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:x,disabled:!i.trim()||g,className:"px-4 py-2 text-sm font-medium bg-primary-600 text-white hover:bg-primary-700 rounded-lg shadow-sm flex items-center gap-2 disabled:opacity-50",children:[l.jsx(Wn,{className:"w-4 h-4"}),g?"Saving...":e?"Save Changes":"Create Endpoint"]})]})]})]})})}function vJ(){const{sendRpc:e,isConnected:t}=$t(),{triggers:n,loading:r,loadTriggers:i,saveTrigger:a,deleteTrigger:s}=gJ(e),[o,c]=m.useState(!1),[u,d]=m.useState(null),f=m.useRef(!1);m.useEffect(()=>{t&&!f.current&&(f.current=!0,i())},[t,i]);const h=()=>{d(null),c(!0)},p=b=>{d(b),c(!0)},g=async b=>{await a(b),c(!1)},y=async(b,v)=>{b.stopPropagation();const w=v.status==="active"?"inactive":"active";await a({...v,status:w})},x=async(b,v)=>{b.stopPropagation(),await s(v)};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsx("header",{className:"h-16 flex items-center justify-end px-6 bg-white sticky top-0 z-10",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"relative group",children:[l.jsx(Hn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 group-focus-within:text-primary-500 transition-colors"}),l.jsx("input",{type:"text",placeholder:"Search endpoints...",className:"pl-9 pr-3 py-1.5 bg-gray-50 border-none rounded-md text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-200 w-48 transition-all"})]}),l.jsx(ut,{content:"New Endpoint",children:l.jsx("button",{onClick:h,className:"p-2 rounded-lg text-gray-400 hover:text-gray-900 hover:bg-gray-100 transition-all",children:l.jsx(In,{className:"w-5 h-5"})})})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8 bg-white",children:r?l.jsx("div",{className:"flex items-center justify-center h-40 text-gray-400 text-sm",children:"Loading..."}):l.jsxs("div",{className:"max-w-6xl mx-auto grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[n.map(b=>l.jsxs("div",{onClick:()=>p(b),className:"group bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-primary-200 transition-all cursor-pointer relative overflow-hidden",children:[l.jsxs("div",{className:"flex justify-between items-start mb-4",children:[l.jsx("div",{className:U("w-8 h-8 flex items-center justify-center rounded-lg border",b.type==="webhook"?"bg-purple-50 border-purple-100 text-purple-600":"bg-emerald-50 border-emerald-100 text-emerald-600"),children:(()=>{const v=yJ(b.icon);return l.jsx(v,{className:"w-4 h-4"})})()}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{onClick:v=>y(v,b),className:U("p-2 rounded-lg transition-colors border",b.status==="active"?"bg-white border-gray-200 text-gray-400 hover:text-orange-500 hover:border-orange-200":"bg-green-50 border-green-200 text-green-600"),title:b.status==="active"?"Deactivate Endpoint":"Activate Endpoint",children:b.status==="active"?l.jsx(uw,{className:"w-4 h-4"}):l.jsx(Nm,{className:"w-4 h-4"})}),l.jsx("button",{onClick:v=>x(v,b.id),className:"p-2 rounded-lg transition-colors border bg-white border-gray-200 text-gray-400 hover:text-red-500 hover:border-red-200",title:"Delete Endpoint",children:l.jsx(sr,{className:"w-4 h-4"})})]})]}),l.jsxs("h3",{className:"font-bold text-gray-900 mb-1 group-hover:text-primary-600 transition-colors flex items-center gap-2",children:[b.name,l.jsx(WO,{className:"w-3 h-3 opacity-0 group-hover:opacity-100 -translate-x-2 group-hover:translate-x-0 transition-all text-primary-400"})]}),l.jsx("p",{className:"text-sm text-gray-500 mb-4 line-clamp-2 min-h-[40px]",children:b.description||"No description provided."}),l.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-gray-50 text-xs text-gray-400",children:[l.jsxs("span",{className:"font-mono bg-gray-50 px-1.5 py-0.5 rounded text-gray-500",children:["ID: ",b.id.split("_")[1]||b.id]}),l.jsxs("div",{children:["Last active: ",l.jsx("span",{className:"text-gray-600 font-medium",children:b.lastActive||"Never"})]})]})]},b.id)),l.jsxs("button",{onClick:h,className:"flex flex-col items-center justify-center p-6 rounded-xl border-2 border-dashed border-gray-200 text-gray-400 hover:border-primary-300 hover:text-primary-600 hover:bg-primary-50/50 transition-all gap-3 min-h-[200px]",children:[l.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-50 flex items-center justify-center group-hover:bg-white transition-colors",children:l.jsx(In,{className:"w-6 h-6"})}),l.jsx("span",{className:"font-medium",children:"Create New Endpoint"})]})]})}),l.jsx(xJ,{isOpen:o,onClose:()=>c(!1),trigger:u,onSave:g})]})}function bJ(e){const[t,n]=m.useState([]),[r,i]=m.useState(!0),[a,s]=m.useState(null),o=m.useCallback(async()=>{s(null);try{const d=await e("cron.list");n(d.jobs??[])}catch(d){const f=d instanceof Error?d.message:String(d);console.error("[useCronJobs] Failed to load:",f),s(f)}finally{i(!1)}},[e]),c=m.useCallback(async d=>{const f=await e("cron.save",{id:d.id,name:d.name,description:d.description,schedule:d.schedule,skillId:d.skillId,status:d.status,workspaceId:d.workspaceId??null});return await o(),f},[e,o]),u=m.useCallback(async d=>{await e("cron.delete",{id:d}),await o()},[e,o]);return{jobs:t,loading:r,error:a,loadJobs:o,saveJob:c,deleteJob:u}}function wJ({job:e,isOpen:t,onClose:n,onSave:r}){const[i,a]=m.useState(""),[s,o]=m.useState(""),[c,u]=m.useState(""),[d,f]=m.useState(!1);m.useEffect(()=>{t&&(e?(a(e.name),o(e.description),u(e.schedule)):(a(""),o(""),u("0 9 * * 1-5")),f(!1))},[t,e]);const h=async()=>{if(!(!i.trim()||!c.trim()||d)){f(!0);try{await r({id:e==null?void 0:e.id,name:i,description:s,schedule:c,status:(e==null?void 0:e.status)||"active"})}catch(p){console.error("[CronDrawer] Save failed:",p)}finally{f(!1)}}};return l.jsx(li,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(cn.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(cn.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[480px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-white",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900",children:e?"Edit Schedule":"New Schedule"}),l.jsx("p",{className:"text-xs text-gray-400",children:"Automate skills with cron jobs"})]}),l.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:l.jsx(Ze,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[l.jsx(os,{className:"w-4 h-4 text-primary-500"}),"Cron Schedule ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:"text",value:c,onChange:p=>u(p.target.value),placeholder:"* * * * *",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-lg text-sm font-mono text-gray-900 focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 transition-all"}),l.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-gray-400",children:"UTC"})]}),l.jsxs("p",{className:"text-xs text-gray-500",children:["Format: ",l.jsx("code",{children:"min hour day month weekday"}),". ",l.jsx("a",{href:"https://crontab.guru",target:"_blank",className:"text-primary-600 hover:underline",children:"Help?"})]})]}),l.jsx("div",{className:"h-px bg-gray-100 w-full"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Job Name ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:i,onChange:p=>a(p.target.value),placeholder:"e.g. Weekly Report",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Description"}),l.jsx("textarea",{value:s,onChange:p=>o(p.target.value),placeholder:"Describe what this scheduled job does (Natural Language).",rows:4,className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 resize-none"})]})]})]}),l.jsxs("div",{className:"p-6 border-t border-gray-100 bg-white flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded-lg transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:h,disabled:!i.trim()||!c.trim()||d,className:"px-4 py-2 text-sm font-medium bg-primary-600 text-white hover:bg-primary-700 rounded-lg shadow-sm flex items-center gap-2 disabled:opacity-50",children:[d?l.jsx(Le,{className:"w-4 h-4 animate-spin"}):l.jsx(Wn,{className:"w-4 h-4"}),d?"Saving...":e?"Save Job":"Create Schedule"]})]})]})]})})}function jC(e){if(!e)return"";const t=new Date(e),r=new Date().getTime()-t.getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const a=Math.floor(i/60);return a<24?`${a}h ago`:t.toLocaleString()}function NC(e){if(!e)return"";if(e<1e3)return`${e}ms`;const t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function SJ({job:e,isOpen:t,onClose:n,sendRpc:r}){const[i,a]=m.useState([]),[s,o]=m.useState(!1),[c,u]=m.useState(null);m.useEffect(()=>{t&&(u(null),d())},[t,e.id]);const d=async()=>{o(!0);try{const f=await r("cron.runs",{jobId:e.id});a(f.runs??[])}catch(f){console.error("[CronRunHistory] Failed to load:",f)}finally{o(!1)}};return l.jsx(li,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(cn.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(cn.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[560px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900 truncate",children:e.name}),l.jsx("p",{className:"text-xs text-gray-400",children:"Execution History"})]}),l.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors flex-shrink-0",children:l.jsx(Ze,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:s?l.jsxs("div",{className:"flex items-center justify-center h-40 text-gray-400 text-sm gap-2",children:[l.jsx(Le,{className:"w-4 h-4 animate-spin"}),"Loading..."]}):i.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-gray-400 text-sm",children:[l.jsx(os,{className:"w-8 h-8 mb-2 text-gray-200"}),"No executions yet"]}):c?l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsx("button",{onClick:()=>u(null),className:"px-6 py-2 text-xs text-primary-600 hover:text-primary-700 font-medium text-left border-b border-gray-100 hover:bg-gray-50",children:"← Back to list"}),l.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 border-b border-gray-50",children:[c.status==="success"?l.jsx(Hr,{className:"w-4 h-4 text-green-500 flex-shrink-0"}):l.jsx(Ai,{className:"w-4 h-4 text-red-500 flex-shrink-0"}),l.jsx("span",{className:U("text-sm font-medium",c.status==="success"?"text-green-700":"text-red-700"),children:c.status==="success"?"Success":"Failed"}),l.jsx("span",{className:"text-xs text-gray-400",children:jC(c.createdAt)}),c.durationMs!=null&&l.jsx("span",{className:"text-xs text-gray-400 ml-auto",children:NC(c.durationMs)})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[c.error?l.jsx("div",{className:"text-sm text-red-600 bg-red-50 rounded-lg p-3 mb-3",children:c.error}):null,c.resultText?l.jsx("div",{className:"prose prose-sm prose-gray max-w-none",children:l.jsx(Pd,{children:c.resultText})}):l.jsx("p",{className:"text-sm text-gray-400 italic",children:"No output captured"})]})]}):l.jsx("div",{children:i.map(f=>l.jsxs("button",{onClick:()=>u(f),className:"w-full text-left px-6 py-3 border-b border-gray-50 hover:bg-gray-50/80 transition-colors flex items-center gap-3 group",children:[f.status==="success"?l.jsx(Hr,{className:"w-4 h-4 text-green-500 flex-shrink-0"}):l.jsx(Ai,{className:"w-4 h-4 text-red-500 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:U("text-sm font-medium",f.status==="success"?"text-green-700":"text-red-700"),children:f.status==="success"?"Success":"Failed"}),l.jsx("span",{className:"text-xs text-gray-400",children:jC(f.createdAt)}),f.durationMs!=null&&l.jsx("span",{className:"text-xs text-gray-300",children:NC(f.durationMs)})]}),f.error&&l.jsx("p",{className:"text-xs text-red-500 truncate mt-0.5",children:f.error}),!f.error&&f.resultText&&l.jsx("p",{className:"text-xs text-gray-400 truncate mt-0.5",children:f.resultText.replace(/[#*_`~\n]/g," ").slice(0,80)})]}),l.jsx(YO,{className:"w-3.5 h-3.5 text-gray-300 group-hover:text-primary-500 flex-shrink-0 transition-colors"})]},f.id))})})]})]})})}function kJ(){const{sendRpc:e,isConnected:t}=$t(),{jobs:n,loading:r,error:i,loadJobs:a,saveJob:s,deleteJob:o}=bJ(e),{currentWorkspace:c}=Ed(),[u,d]=m.useState(!1),[f,h]=m.useState(null),[p,g]=m.useState(null),[y,x]=m.useState(null),b=m.useRef(!1);m.useEffect(()=>{t&&!b.current&&(b.current=!0,a())},[t,a]);const v=()=>{h(null),d(!0)},w=P=>{h(P),d(!0)},k=async P=>{try{await s({...P,workspaceId:P.workspaceId??(c==null?void 0:c.id)??null}),d(!1)}catch(A){console.error("[CronPage] Save failed:",A),alert(A instanceof Error?A.message:"Failed to save schedule")}},S=async(P,A)=>{P.stopPropagation();const E=A.status==="active"?"paused":"active";try{await s({...A,status:E})}catch(O){console.error("[CronPage] Toggle failed:",O)}},j=(P,A)=>{P.stopPropagation(),g(A)},N=async()=>{if(p)try{await o(p)}catch(P){console.error("[CronPage] Delete failed:",P)}finally{g(null)}};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsx("header",{className:"h-16 flex items-center justify-end px-6 bg-white sticky top-0 z-10",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"relative group",children:[l.jsx(Hn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 group-focus-within:text-primary-500 transition-colors"}),l.jsx("input",{type:"text",placeholder:"Search schedules...",className:"pl-9 pr-3 py-1.5 bg-gray-50 border-none rounded-md text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-200 w-48 transition-all"})]}),l.jsx(ut,{content:"Add Schedule",children:l.jsx("button",{onClick:v,className:"p-2 rounded-lg text-gray-400 hover:text-gray-900 hover:bg-gray-100 transition-all",children:l.jsx(In,{className:"w-5 h-5"})})})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8 bg-white",children:r?l.jsx("div",{className:"flex items-center justify-center h-40 text-gray-400 text-sm",children:"Loading..."}):i?l.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-red-400 text-sm gap-2",children:[l.jsxs("p",{children:["Failed to load schedules: ",i]}),l.jsx("button",{onClick:a,className:"px-3 py-1 rounded bg-gray-100 text-gray-600 hover:bg-gray-200 text-xs",children:"Retry"})]}):l.jsxs("div",{className:"max-w-6xl mx-auto space-y-4",children:[n.map(P=>l.jsxs("div",{onClick:()=>w(P),className:"group bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-primary-200 transition-all cursor-pointer relative overflow-hidden flex items-center gap-6",children:[l.jsx("div",{className:U("w-1 h-12 rounded-full shrink-0",P.status==="active"?"bg-green-500":"bg-gray-300")}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("h3",{className:"font-bold text-gray-900 mb-1 group-hover:text-primary-600 transition-colors truncate",children:P.name}),l.jsx("p",{className:"text-sm text-gray-500 truncate mb-2",children:P.description}),l.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-gray-600 font-mono bg-gray-50 px-2 py-0.5 rounded",children:[l.jsx(Uu,{className:"w-3 h-3 text-gray-400"}),P.schedule]}),P.workspaceName&&l.jsxs("div",{className:"flex items-center gap-1.5 text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded font-medium",children:[l.jsx(aw,{className:"w-3 h-3"}),P.workspaceName]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx("button",{onClick:A=>{A.stopPropagation(),x(P)},className:"p-2 rounded-lg text-gray-400 hover:text-primary-600 hover:bg-primary-50 border border-transparent hover:border-primary-200 transition-all",title:"Execution History",children:l.jsx(ow,{className:"w-4 h-4"})}),l.jsx("button",{onClick:A=>S(A,P),className:U("p-2 rounded-lg transition-colors border",P.status==="active"?"bg-white border-gray-200 text-gray-400 hover:text-orange-500 hover:border-orange-200":"bg-green-50 border-green-200 text-green-600"),title:P.status==="active"?"Pause Job":"Resume Job",children:P.status==="active"?l.jsx(uw,{className:"w-4 h-4"}):l.jsx(Nm,{className:"w-4 h-4"})}),l.jsx("button",{onClick:A=>j(A,P.id),className:"p-2 rounded-lg text-gray-400 hover:text-red-600 hover:bg-red-50 hover:border-red-200 border border-transparent transition-all",title:"Delete Job",children:l.jsx(sr,{className:"w-4 h-4"})})]})]},P.id)),n.length===0&&l.jsxs("div",{className:"text-center py-20 text-gray-400",children:[l.jsx(Uu,{className:"w-12 h-12 mx-auto mb-4 text-gray-200"}),l.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"No Scheduled Jobs"}),l.jsx("p",{className:"mb-6 max-w-sm mx-auto",children:"Create a cron job to automate your skills periodically."}),l.jsx("button",{onClick:v,className:"px-4 py-2 bg-primary-600 text-white rounded-lg font-medium hover:bg-primary-700 transition-colors",children:"+ Create First Schedule"})]})]})}),l.jsx(wJ,{isOpen:u,onClose:()=>d(!1),job:f,onSave:k}),y&&l.jsx(SJ,{job:y,isOpen:!!y,onClose:()=>x(null),sendRpc:e}),l.jsx(no,{isOpen:p!==null,onClose:()=>g(null),onConfirm:N,title:"Delete Schedule",description:"Are you sure you want to delete this scheduled job? This action cannot be undone.",confirmText:"Delete",variant:"danger"})]})}function jJ({isOpen:e,onClose:t,user:n,onSave:r}){const[i,a]=m.useState(n);if(m.useEffect(()=>{a(n)},[n,e]),!e)return null;const s=o=>{o.preventDefault(),r(i),t()};return l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[l.jsx("div",{className:"absolute inset-0 bg-gray-900/40 backdrop-blur-sm transition-opacity",onClick:t}),l.jsxs("div",{className:"relative w-full max-w-md bg-white rounded-xl shadow-xl border border-gray-100 overflow-hidden animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-100",children:[l.jsx("h3",{className:"font-semibold text-gray-900",children:"Edit Profile"}),l.jsx("button",{onClick:t,className:"p-1 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",children:l.jsx(Ze,{className:"w-5 h-5"})})]}),l.jsxs("form",{onSubmit:s,className:"p-6 space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Full Name"}),l.jsx("input",{type:"text",value:i.name,onChange:o=>a({...i,name:o.target.value}),className:"w-full px-3 py-2 bg-gray-50 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-100 focus:border-primary-400 transition-all text-sm"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Role / Job Title"}),l.jsx("input",{type:"text",value:i.role,onChange:o=>a({...i,role:o.target.value}),className:"w-full px-3 py-2 bg-gray-50 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-100 focus:border-primary-400 transition-all text-sm"})]}),l.jsxs("div",{className:"pt-4 flex justify-end gap-3",children:[l.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-100",children:"Cancel"}),l.jsx("button",{type:"submit",className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg shadow-sm hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",children:"Save Changes"})]})]})]})]})}function NJ(){const[e,t]=m.useState(Ll()),[n,r]=m.useState(!1),{sendRpc:i,isConnected:a}=$t(),s=ls(),[o,c]=m.useState(!0),u=m.useRef(!1);m.useEffect(()=>{!a||u.current||(u.current=!0,i("permission.mine").then(f=>c(f.ssoUser??!1)).catch(()=>{}))},[a,i]),m.useEffect(()=>{const f=()=>{const h=Ll();t(h)};return window.addEventListener("user-profile-updated",f),()=>window.removeEventListener("user-profile-updated",f)},[]);const d=async f=>{Qh(f);try{await r8(i,f)}catch{}};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsx(jJ,{isOpen:n,onClose:()=>r(!1),user:e,onSave:d}),l.jsx("header",{className:"h-16 flex items-center justify-end px-6 bg-white sticky top-0 z-10",children:l.jsxs("div",{className:"relative group",children:[l.jsx(Hn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 group-focus-within:text-primary-500 transition-colors"}),l.jsx("input",{type:"text",placeholder:"Search settings...",className:"pl-9 pr-3 py-1.5 bg-gray-50 border-none rounded-md text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-200 w-48 transition-all"})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto bg-white p-8",children:l.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[l.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6 flex items-center gap-6 shadow-sm",children:[l.jsx("div",{className:"w-20 h-20 rounded-full bg-gray-100 flex items-center justify-center border border-gray-200",children:l.jsx(Vu,{className:"w-10 h-10 text-gray-400"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsx("h2",{className:"text-xl font-bold text-gray-900",children:e.name})}),l.jsx("p",{className:"text-gray-500 text-sm mt-1",children:e.role}),s&&l.jsxs("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-gray-400",children:[l.jsx(ZO,{className:"w-3.5 h-3.5"}),l.jsx("span",{className:"font-mono",children:s.id})]})]}),l.jsx("button",{onClick:()=>r(!0),className:"px-4 py-2 bg-white border border-gray-200 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50 hover:border-gray-300 transition-all shadow-sm",children:"Edit Profile"})]}),!o&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider px-1",children:"Security"}),l.jsx(CJ,{sendRpc:i})]}),l.jsx("div",{className:"pt-6",children:l.jsxs("button",{onClick:u_,className:"w-full p-3 rounded-lg border border-red-100 bg-red-50 text-red-600 text-sm font-medium hover:bg-red-100 transition-colors flex items-center justify-center gap-2",children:[l.jsx(sB,{className:"w-4 h-4"}),"Sign Out"]})}),l.jsx("div",{className:"text-center text-xs text-gray-400 pb-8",children:"Siclaw v0.1.0"})]})})]})}function CJ({sendRpc:e}){const[t,n]=m.useState(""),[r,i]=m.useState(""),[a,s]=m.useState(""),[o,c]=m.useState(!1),[u,d]=m.useState(""),[f,h]=m.useState(!1),p=async g=>{if(g.preventDefault(),d(""),h(!1),r!==a){d("New passwords do not match");return}if(r.length<4){d("Password must be at least 4 characters");return}c(!0);try{await e("user.changePassword",{oldPassword:t,newPassword:r}),h(!0),n(""),i(""),s("")}catch(y){d((y==null?void 0:y.message)||"Failed to change password")}finally{c(!1)}};return l.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm p-5",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.jsx(Ql,{className:"w-5 h-5 text-gray-400"}),l.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Change Password"})]}),l.jsxs("form",{onSubmit:p,className:"space-y-3",children:[l.jsx("input",{type:"password",value:t,onChange:g=>n(g.target.value),placeholder:"Current password",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",required:!0}),l.jsx("input",{type:"password",value:r,onChange:g=>i(g.target.value),placeholder:"New password",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",required:!0}),l.jsx("input",{type:"password",value:a,onChange:g=>s(g.target.value),placeholder:"Confirm new password",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",required:!0}),u&&l.jsx("p",{className:"text-xs text-red-600",children:u}),f&&l.jsx("p",{className:"text-xs text-green-600",children:"Password changed successfully."}),l.jsx("div",{className:"flex justify-end",children:l.jsxs("button",{type:"submit",disabled:o,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50 inline-flex items-center gap-2",children:[o&&l.jsx(Le,{className:"w-4 h-4 animate-spin"}),"Change Password"]})})]})]})}function PJ(){return l.jsx(nw,{})}const Mf=[{key:"jwt",title:"JWT Secret",icon:Ql,fields:[{key:"secret",label:"Secret",type:"password",placeholder:"Enter new JWT secret (leave empty to keep current)",writeOnly:!0}]},{key:"sso",title:"SSO Configuration",icon:dw,fields:[{key:"enabled",label:"Enable SSO",type:"toggle"},{key:"issuer",label:"Issuer URL",type:"text",placeholder:"https://dex.example.com"},{key:"clientId",label:"Client ID",type:"text"},{key:"clientSecret",label:"Client Secret",type:"password"},{key:"redirectUri",label:"Redirect URI",type:"text",placeholder:"https://your-domain/auth/callback"}]},{key:"system",title:"System Settings",icon:Il,fields:[{key:"grafanaUrl",label:"Grafana URL",type:"text",placeholder:"https://grafana.example.com/d/siclaw/overview?kiosk"}]},{key:"metrics",title:"Metrics & Monitoring",icon:rw,fields:[{key:"port",label:"Metrics Port (AgentBox only)",type:"text",placeholder:"9090"},{key:"token",label:"Bearer Token",type:"password",writeOnly:!0},{key:"includeUserId",label:"Include User ID in Metrics",type:"toggle"}]}];function EJ(){const{sendRpc:e,isConnected:t}=$t(),{isAdmin:n,loaded:r}=ic(e,t),[i,a]=m.useState({}),[s,o]=m.useState({}),[c,u]=m.useState(null),[d,f]=m.useState(null),h=m.useRef(!1),p=new Set(Mf.flatMap(k=>k.fields.filter(S=>S.writeOnly).map(S=>`${k.key}.${S.key}`))),[g,y]=m.useState(new Set),x=m.useCallback(async()=>{try{const S=(await e("system.getConfig")).config??{},j=new Set,N={};for(const[P,A]of Object.entries(S))p.has(P)?A&&j.add(P):N[P]=A;y(j),a(N),o(N)}catch(k){console.warn("[SystemSettings] Failed to load config:",k)}},[e]);m.useEffect(()=>{!t||!n||h.current||(h.current=!0,x())},[t,n,x]);const b=(k,S)=>{a(j=>({...j,[k]:S})),f(null)},v=k=>{const S=Mf.find(j=>j.key===k);return S?S.fields.some(j=>{const N=`${k}.${j.key}`;return j.writeOnly?!!i[N]:(i[N]??"")!==(s[N]??"")}):!1},w=async k=>{u(k),f(null);try{const S=Mf.find(N=>N.key===k),j={};for(const N of S.fields){const P=`${k}.${N.key}`,A=i[P]??"";A&&!A.includes("****")?j[N.key]=A:A||(j[N.key]="")}await e("system.saveSection",{section:k,values:j}),await x()}catch(S){f((S==null?void 0:S.message)||"Save failed")}finally{u(null)}};return r?n?l.jsxs("div",{className:"h-full overflow-y-auto p-6 space-y-6",children:[d&&l.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:d}),Mf.map(k=>{const S=k.icon,j=v(k.key),N=c===k.key;return l.jsxs("div",{className:"bg-white border border-gray-200 rounded-lg",children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-gray-100",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(S,{className:"w-4 h-4 text-gray-500"}),l.jsx("h3",{className:"text-sm font-semibold text-gray-800",children:k.title})]}),l.jsxs("button",{onClick:()=>w(k.key),disabled:!j||N,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors "+(j&&!N?"bg-primary-600 text-white hover:bg-primary-700":"bg-gray-100 text-gray-400 cursor-not-allowed"),children:[N?l.jsx(Le,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(Wn,{className:"w-3.5 h-3.5"}),"Save"]})]}),l.jsx("div",{className:"p-5 space-y-4",children:k.fields.map(P=>{const A=`${k.key}.${P.key}`;if(P.type==="toggle"){const I=i[A]==="true";return l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs font-medium text-gray-600",children:P.label}),l.jsx("button",{type:"button",role:"switch","aria-checked":I,onClick:()=>b(A,I?"false":"true"),className:"relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 "+(I?"bg-primary-600":"bg-gray-200"),children:l.jsx("span",{className:"pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out "+(I?"translate-x-4":"translate-x-0")})})]},A)}const E=k.fields.find(I=>I.type==="toggle"),O=E?i[`${k.key}.${E.key}`]!=="true":!1,M=P.writeOnly&&g.has(A);return l.jsxs("div",{className:O?"opacity-50":"",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("label",{className:"block text-xs font-medium text-gray-600",children:P.label}),M&&!i[A]&&l.jsx("span",{className:"text-xs text-green-600 font-medium",children:"Configured"})]}),l.jsx("input",{type:P.type,value:i[A]??"",onChange:I=>b(A,I.target.value),placeholder:P.placeholder,disabled:O,className:"w-full px-3 py-2 border border-gray-200 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"+(O?" bg-gray-50 cursor-not-allowed":"")})]},A)})})]},k.key)})]}):l.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-400",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-lg font-medium text-gray-500 mb-1",children:"System Settings"}),l.jsx("div",{className:"text-sm",children:"Admin access required"})]})}):l.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-400",children:l.jsx(Le,{className:"w-5 h-5 animate-spin"})})}function AJ(){const{sendRpc:e,isConnected:t}=$t(),n=ls(),r=(n==null?void 0:n.username)==="admin",[i,a]=m.useState([]),[s,o]=m.useState(!0),[c,u]=m.useState(null),[d,f]=m.useState(!1),[h,p]=m.useState(null),g=async()=>{try{const v=await e("permission.listUsers");a(v.users)}catch(v){console.error("[Permissions] Failed to load users:",v)}finally{o(!1)}},y=m.useRef(!1);m.useEffect(()=>{t&&r&&!y.current&&(y.current=!0,g())},[t]);const x=async(v,w)=>{const k=v.permissions.includes(w);u(v.id);try{k?await e("permission.revoke",{userId:v.id,permission:w}):await e("permission.grant",{userId:v.id,permission:w}),await g()}catch(S){console.error("[Permissions] Toggle failed:",S)}finally{u(null)}},b=async v=>{u(v.id);try{await e("user.setTestOnly",{userId:v.id,testOnly:!v.testOnly}),await g()}catch(w){console.error("[Permissions] Toggle testOnly failed:",w)}finally{u(null)}};return r?l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsxs("header",{className:"h-16 flex items-center justify-between px-6 bg-white sticky top-0 z-10 border-b border-gray-100",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-2 bg-primary-50 rounded-lg",children:l.jsx(fw,{className:"w-5 h-5 text-primary-600"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-gray-900",children:"Permissions"}),l.jsx("p",{className:"text-xs text-gray-500",children:"Manage user permissions and access control"})]})]}),l.jsxs("button",{onClick:()=>f(!0),className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors",children:[l.jsx(In,{className:"w-4 h-4"}),"Create Intern"]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:l.jsx("div",{className:"max-w-4xl mx-auto",children:s?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(Le,{className:"w-6 h-6 animate-spin text-gray-400"})}):l.jsx("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-100 bg-gray-50/50",children:[l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"User"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Username"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"SSO"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Test Only"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Skill Reviewer"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),l.jsx("tbody",{children:i.map(v=>l.jsxs("tr",{className:"border-b border-gray-50 last:border-0 hover:bg-gray-50/50 transition-colors",children:[l.jsx("td",{className:"px-6 py-4",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:U("w-8 h-8 rounded-full flex items-center justify-center text-xs font-semibold",v.isAdmin?"bg-primary-100 text-primary-700":"bg-gray-100 text-gray-600"),children:(v.name||v.username).charAt(0).toUpperCase()}),l.jsx("span",{className:"text-sm font-medium text-gray-900",children:v.name||v.username})]})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-sm text-gray-500",children:v.username})}),l.jsx("td",{className:"px-6 py-4 text-center",children:v.ssoUser?l.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full bg-blue-50 text-blue-700 text-xs font-medium",children:"SSO"}):l.jsx("span",{className:"text-xs text-gray-300",children:"-"})}),l.jsx("td",{className:"px-6 py-4 text-center",children:v.isAdmin?l.jsx("span",{className:"text-xs text-gray-300",children:"-"}):l.jsx("button",{onClick:()=>b(v),disabled:c===v.id,className:"inline-flex items-center justify-center",children:c===v.id?l.jsx(Le,{className:"w-4 h-4 animate-spin text-gray-400"}):l.jsx("div",{className:U("relative inline-flex h-5 w-9 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out cursor-pointer",v.testOnly?"bg-amber-500":"bg-gray-200"),children:l.jsx("span",{className:U("pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200 ease-in-out",v.testOnly?"translate-x-4":"translate-x-0")})})})}),l.jsx("td",{className:"px-6 py-4 text-center",children:v.isAdmin?l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full bg-primary-50 text-primary-700 text-xs font-medium",children:[l.jsx(dw,{className:"w-3 h-3"}),"Always"]}):l.jsx("button",{onClick:()=>x(v,"skill_reviewer"),disabled:c===v.id,className:"inline-flex items-center justify-center",children:c===v.id?l.jsx(Le,{className:"w-4 h-4 animate-spin text-gray-400"}):l.jsx("div",{className:U("relative inline-flex h-5 w-9 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out cursor-pointer",v.permissions.includes("skill_reviewer")?"bg-green-500":"bg-gray-200"),children:l.jsx("span",{className:U("pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200 ease-in-out",v.permissions.includes("skill_reviewer")?"translate-x-4":"translate-x-0")})})})}),l.jsx("td",{className:"px-6 py-4 text-center",children:!v.isAdmin&&!v.ssoUser&&l.jsxs("button",{onClick:()=>p(v.id),className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-gray-600 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors",title:"Reset Password",children:[l.jsx(Ql,{className:"w-3 h-3"}),"Reset Pwd"]})})]},v.id))})]})})})}),d&&l.jsx(TJ,{sendRpc:e,onClose:()=>f(!1),onCreated:g}),h&&l.jsx(OJ,{userId:h,sendRpc:e,onClose:()=>p(null)})]}):l.jsx("div",{className:"h-full flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx(JO,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),l.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-1",children:"Admin access required"}),l.jsx("p",{className:"text-sm text-gray-500",children:"Only administrators can manage permissions."})]})})}function TJ({sendRpc:e,onClose:t,onCreated:n}){const[r,i]=m.useState(""),[a,s]=m.useState(""),[o,c]=m.useState(!1),[u,d]=m.useState(""),f=async h=>{if(h.preventDefault(),!(!r||!a)){c(!0),d("");try{await e("user.create",{username:r,password:a,testOnly:!0}),n(),t()}catch(p){d((p==null?void 0:p.message)||"Failed to create user")}finally{c(!1)}}};return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30",onClick:t,children:l.jsxs("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-sm p-6",onClick:h=>h.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Create Intern Account"}),l.jsx("button",{onClick:t,className:"p-1 text-gray-400 hover:text-gray-600 rounded",children:l.jsx(Ze,{className:"w-4 h-4"})})]}),l.jsxs("form",{onSubmit:f,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Username"}),l.jsx("input",{type:"text",value:r,onChange:h=>i(h.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",placeholder:"intern_username",required:!0})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Password"}),l.jsx("input",{type:"password",value:a,onChange:h=>s(h.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",placeholder:"Password",required:!0})]}),l.jsxs("p",{className:"text-xs text-gray-500",children:["This account will be created with ",l.jsx("span",{className:"font-medium text-amber-600",children:"Test Only"})," access."]}),u&&l.jsx("p",{className:"text-xs text-red-600",children:u}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors",children:"Cancel"}),l.jsx("button",{type:"submit",disabled:o,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50",children:o?l.jsx(Le,{className:"w-4 h-4 animate-spin"}):"Create"})]})]})]})})}function OJ({userId:e,sendRpc:t,onClose:n}){const[r,i]=m.useState(""),[a,s]=m.useState(!1),[o,c]=m.useState(""),[u,d]=m.useState(!1),f=async h=>{if(h.preventDefault(),!!r){s(!0),c("");try{await t("user.resetPassword",{userId:e,password:r}),d(!0),setTimeout(n,1500)}catch(p){c((p==null?void 0:p.message)||"Failed to reset password")}finally{s(!1)}}};return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30",onClick:n,children:l.jsxs("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-sm p-6",onClick:h=>h.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Reset Password"}),l.jsx("button",{onClick:n,className:"p-1 text-gray-400 hover:text-gray-600 rounded",children:l.jsx(Ze,{className:"w-4 h-4"})})]}),u?l.jsx("p",{className:"text-sm text-green-600 font-medium",children:"Password reset successfully."}):l.jsxs("form",{onSubmit:f,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"New Password"}),l.jsx("input",{type:"password",value:r,onChange:h=>i(h.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",placeholder:"New password",required:!0})]}),o&&l.jsx("p",{className:"text-xs text-red-600",children:o}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors",children:"Cancel"}),l.jsx("button",{type:"submit",disabled:a,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors disabled:opacity-50",children:a?l.jsx(Le,{className:"w-4 h-4 animate-spin"}):"Reset"})]})]})]})})}function _J({provider:e,models:t,isAdmin:n,onClose:r,onAdd:i,onRemove:a}){const[s,o]=m.useState("llm"),[c,u]=m.useState(!1),[d,f]=m.useState(""),[h,p]=m.useState(""),[g,y]=m.useState(128e3),[x,b]=m.useState(65536),[v,w]=m.useState(!1),[k,S]=m.useState(1024),[j,N]=m.useState(!1),[P,A]=m.useState(null),E=t.filter(D=>D.category!=="embedding"),O=t.filter(D=>D.category==="embedding"),C=s==="llm"?E:O,M=()=>{f(""),p(""),y(128e3),b(65536),w(!1),S(1024),u(!1)},I=async()=>{if(!(!d.trim()||!h.trim())){N(!0);try{await i({id:d.trim(),name:h.trim(),contextWindow:s==="embedding"?0:g,maxTokens:s==="embedding"?0:x,reasoning:s==="embedding"?!1:v,category:s==="embedding"?"embedding":"llm"}),M()}catch(D){console.error("Failed to add model:",D)}finally{N(!1)}}},B=async D=>{A(D);try{await a(D)}catch(K){console.error("Failed to remove model:",K)}finally{A(null)}},se=D=>{o(D),M()},Q=[{id:"llm",label:"Chat Models"},{id:"embedding",label:"Embedding Models"}];return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:l.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-lg mx-4 max-h-[80vh] flex flex-col",children:[l.jsxs("div",{className:"px-6 py-4 border-b border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsxs("h2",{className:"text-lg font-semibold text-gray-900",children:["Models — ",e]}),l.jsx("button",{onClick:r,className:"p-1 rounded-lg hover:bg-gray-100 text-gray-400 hover:text-gray-600",children:l.jsx(Ze,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex items-center gap-2",children:Q.map(D=>l.jsx("button",{onClick:()=>se(D.id),className:["px-3 py-1 rounded-full text-xs font-medium transition-all border",s===D.id?"bg-gray-900 text-white border-gray-900":"bg-white text-gray-500 border-gray-200 hover:bg-gray-50 hover:text-gray-700"].join(" "),children:D.label},D.id))})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[C.length===0?l.jsxs("p",{className:"text-sm text-gray-400 text-center py-8",children:["No ",s==="embedding"?"embedding":"chat"," models configured"]}):l.jsx("div",{className:"space-y-2",children:C.map(D=>l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 rounded-xl border border-gray-100 bg-gray-50/50",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"text-sm font-medium text-gray-900 truncate",children:D.name}),l.jsx("div",{className:"text-xs text-gray-400 truncate",children:D.id}),l.jsx("div",{className:"flex gap-3 mt-1 text-xs text-gray-400",children:s==="embedding"?l.jsxs("span",{children:["Dimensions: ",D.dimensions??"—"]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{children:["Context: ",(D.contextWindow/1e3).toFixed(0),"k"]}),l.jsxs("span",{children:["Max: ",(D.maxTokens/1e3).toFixed(0),"k"]}),D.reasoning&&l.jsx("span",{className:"text-indigo-500",children:"Reasoning"})]})})]}),n&&l.jsx("button",{onClick:()=>B(D.id),disabled:P===D.id,className:"ml-3 p-1.5 rounded-lg text-gray-400 hover:text-red-500 hover:bg-red-50 disabled:opacity-50",title:"Remove model",children:l.jsx(sr,{className:"w-4 h-4"})})]},D.id))}),n&&c&&l.jsxs("div",{className:"mt-4 p-4 rounded-xl border border-indigo-100 bg-indigo-50/30 space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Model ID"}),l.jsx("input",{type:"text",value:d,onChange:D=>f(D.target.value),className:"w-full px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300",placeholder:s==="embedding"?"e.g. BAAI/bge-m3":"e.g. openai/gpt-4o"})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Display Name"}),l.jsx("input",{type:"text",value:h,onChange:D=>p(D.target.value),className:"w-full px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300",placeholder:s==="embedding"?"e.g. BGE-M3":"e.g. GPT-4o"})]}),s==="embedding"?l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Dimensions"}),l.jsx("input",{type:"number",value:k,onChange:D=>S(Number(D.target.value)),className:"w-full px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Context Window"}),l.jsx("input",{type:"number",value:g,onChange:D=>y(Number(D.target.value)),className:"w-full px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Max Tokens"}),l.jsx("input",{type:"number",value:x,onChange:D=>b(Number(D.target.value)),className:"w-full px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300"})]})]})]}),s==="llm"&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"checkbox",id:"reasoning",checked:v,onChange:D=>w(D.target.checked),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-300"}),l.jsx("label",{htmlFor:"reasoning",className:"text-sm text-gray-600",children:"Reasoning model"})]}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{onClick:()=>u(!1),className:"px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-100 rounded-lg",children:"Cancel"}),l.jsx("button",{onClick:I,disabled:j||!d.trim()||!h.trim(),className:"px-3 py-1.5 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 disabled:opacity-50",children:j?"Adding...":"Add"})]})]})]}),l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-gray-100",children:[n&&!c?l.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-indigo-600 hover:bg-indigo-50 rounded-lg",children:[l.jsx(In,{className:"w-4 h-4"}),"Add ",s==="embedding"?"Embedding":"Chat"," Model"]}):l.jsx("div",{}),l.jsx("button",{onClick:r,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 rounded-lg hover:bg-gray-100",children:"Close"})]})]})})}const av=[{name:"openai",displayName:"OpenAI",baseUrl:"https://api.openai.com/v1",api:"openai-completions",models:[{id:"gpt-5.4",name:"GPT-5.4",reasoning:!1,contextWindow:2e5,maxTokens:32768,category:"llm"},{id:"gpt-4o",name:"GPT-4o",reasoning:!1,contextWindow:128e3,maxTokens:16384,category:"llm"},{id:"gpt-4o-mini",name:"GPT-4o Mini",reasoning:!1,contextWindow:128e3,maxTokens:16384,category:"llm"},{id:"o3",name:"o3",reasoning:!0,contextWindow:2e5,maxTokens:1e5,category:"llm"},{id:"o3-mini",name:"o3-mini",reasoning:!0,contextWindow:2e5,maxTokens:1e5,category:"llm"},{id:"o4-mini",name:"o4-mini",reasoning:!0,contextWindow:2e5,maxTokens:1e5,category:"llm"},{id:"text-embedding-3-small",name:"Text Embedding 3 Small",reasoning:!1,contextWindow:8191,maxTokens:0,category:"embedding",dimensions:1536},{id:"text-embedding-3-large",name:"Text Embedding 3 Large",reasoning:!1,contextWindow:8191,maxTokens:0,category:"embedding",dimensions:3072}]},{name:"anthropic",displayName:"Anthropic",baseUrl:"https://api.anthropic.com",api:"anthropic",authHeader:!0,models:[{id:"claude-opus-4-6",name:"Claude Opus 4.6",reasoning:!0,contextWindow:2e5,maxTokens:32e3,category:"llm"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",reasoning:!1,contextWindow:2e5,maxTokens:16384,category:"llm"},{id:"claude-haiku-4-5-20251001",name:"Claude Haiku 4.5",reasoning:!1,contextWindow:2e5,maxTokens:8192,category:"llm"}]},{name:"google",displayName:"Google Gemini",baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai",api:"openai-completions",models:[{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro",reasoning:!0,contextWindow:1048576,maxTokens:65536,category:"llm"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",reasoning:!0,contextWindow:1048576,maxTokens:65536,category:"llm"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash",reasoning:!0,contextWindow:1048576,maxTokens:65536,category:"llm"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash",reasoning:!1,contextWindow:1048576,maxTokens:8192,category:"llm"}]},{name:"zhipu",displayName:"Zhipu",baseUrl:"https://open.bigmodel.cn/api/paas/v4",api:"openai-completions",models:[{id:"glm-5",name:"GLM-5",reasoning:!0,contextWindow:203e3,maxTokens:8192,category:"llm"},{id:"glm-4-plus",name:"GLM-4 Plus",reasoning:!1,contextWindow:128e3,maxTokens:4096,category:"llm"},{id:"glm-4-long",name:"GLM-4 Long",reasoning:!1,contextWindow:1e6,maxTokens:4096,category:"llm"},{id:"glm-4-air",name:"GLM-4 Air",reasoning:!1,contextWindow:128e3,maxTokens:4096,category:"llm"},{id:"glm-4-airx",name:"GLM-4 AirX",reasoning:!1,contextWindow:128e3,maxTokens:4096,category:"llm"},{id:"glm-4-flash",name:"GLM-4 Flash",reasoning:!1,contextWindow:128e3,maxTokens:4096,category:"llm"},{id:"glm-4-flashx",name:"GLM-4 FlashX",reasoning:!1,contextWindow:128e3,maxTokens:4096,category:"llm"},{id:"embedding-3",name:"Embedding 3",reasoning:!1,contextWindow:8192,maxTokens:0,category:"embedding",dimensions:2048}]},{name:"moonshot",displayName:"Moonshot",baseUrl:"https://api.moonshot.cn/v1",api:"openai-completions",models:[{id:"kimi-k2.5",name:"Kimi K2.5",reasoning:!1,contextWindow:256e3,maxTokens:8192,category:"llm"},{id:"kimi-k2",name:"Kimi K2",reasoning:!1,contextWindow:128e3,maxTokens:8192,category:"llm"},{id:"moonshot-v1-128k",name:"Moonshot v1 128K",reasoning:!1,contextWindow:128e3,maxTokens:4096,category:"llm"},{id:"moonshot-v1-32k",name:"Moonshot v1 32K",reasoning:!1,contextWindow:32e3,maxTokens:4096,category:"llm"}]}];function nD({baseUrl:e,apiKey:t,api:n,disabled:r}){const{sendRpc:i}=$t(),[a,s]=m.useState("idle"),[o,c]=m.useState(""),u=async()=>{if(!(!e||!t)){s("testing"),c("");try{const p=await i("provider.testConnection",{baseUrl:e,apiKey:t,api:n});s(p.ok?"success":"error"),c(p.message)}catch(p){s("error"),c(p instanceof Error?p.message:"Test failed")}}},d={idle:l.jsx(mw,{className:"w-4 h-4"}),testing:l.jsx(Le,{className:"w-4 h-4 animate-spin"}),success:l.jsx(Hr,{className:"w-4 h-4"}),error:l.jsx(ys,{className:"w-4 h-4"})},f={idle:"text-gray-600 border-gray-200 hover:bg-gray-50",testing:"text-indigo-600 border-indigo-200 bg-indigo-50",success:"text-green-600 border-green-200 bg-green-50",error:"text-red-600 border-red-200 bg-red-50"},h=!r&&!!e&&!!t&&a!=="testing";return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs("button",{type:"button",onClick:u,disabled:!h,className:`flex items-center gap-1.5 px-3 py-2 text-sm font-medium border rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${f[a]}`,children:[d[a],a==="testing"?"Testing...":"Test Connection"]}),o&&l.jsx("p",{className:`text-xs ${a==="success"?"text-green-600":"text-red-500"}`,children:o})]})}function MJ({isOpen:e,provider:t,onClose:n,onSave:r}){const i=!!t,[a,s]=m.useState(null),[o,c]=m.useState(""),[u,d]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState("openai-completions"),[y,x]=m.useState(!1),[b,v]=m.useState(!1),[w,k]=m.useState("");m.useEffect(()=>{if(e)if(k(""),v(!1),h(""),t){c(t.name),d(t.baseUrl),g(t.api),x(t.authHeader??!1);const P=av.find(A=>A.name===t.name);s(P??null)}else s(null),c(""),d(""),g("openai-completions"),x(!1)},[e,t]);const S=P=>{i||(s(P),c(P.name),d(P.baseUrl),g(P.api),x(P.authHeader??!1))},j=()=>{i||(s(null),c(""),d(""),g("openai-completions"),x(!1))},N=async()=>{if(!o.trim()){k("Provider name is required");return}v(!0),k("");try{await r({name:o.trim(),baseUrl:u.trim(),apiKey:f,api:p,authHeader:y}),n()}catch(P){k(P instanceof Error?P.message:"Failed to save")}finally{v(!1)}};return l.jsx(li,{children:e&&l.jsxs(l.Fragment,{children:[l.jsx(cn.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(cn.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[480px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900",children:i?"Edit Provider":"Add Provider"}),l.jsx("p",{className:"text-xs text-gray-400",children:i?t.name:"Configure a new model provider"})]}),l.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:l.jsx(Ze,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[!i&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Provider Template"}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[av.map(P=>l.jsx("button",{onClick:()=>S(P),className:`px-3 py-1.5 text-xs font-medium rounded-lg border transition-colors ${(a==null?void 0:a.name)===P.name?"border-indigo-500 bg-indigo-100 text-indigo-700":"border-gray-200 bg-white text-gray-600 hover:border-gray-300"}`,children:P.displayName},P.name)),l.jsx("button",{onClick:j,className:`px-3 py-1.5 text-xs font-medium rounded-lg border transition-colors ${a?"border-gray-200 bg-white text-gray-600 hover:border-gray-300":"border-indigo-500 bg-indigo-100 text-indigo-700"}`,children:"Custom"})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Provider Name ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:o,onChange:P=>c(P.target.value),disabled:i,className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300 disabled:opacity-60 disabled:bg-gray-50",placeholder:"e.g. openai, deepseek"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"API Type"}),a?l.jsx("div",{className:"px-3 py-2 border border-gray-100 rounded-lg text-sm bg-gray-50 text-gray-500",children:p==="anthropic"?"Anthropic":"OpenAI Compatible"}):l.jsxs("select",{value:p,onChange:P=>{const A=P.target.value;g(A),x(A==="anthropic")},className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",children:[l.jsx("option",{value:"openai-completions",children:"OpenAI Compatible"}),l.jsx("option",{value:"anthropic",children:"Anthropic"})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Base URL"}),l.jsx("input",{type:"text",value:u,onChange:P=>d(P.target.value),className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:"https://api.example.com/v1"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["API Key ",i&&t.apiKeySet&&l.jsx("span",{className:"text-gray-400 font-normal",children:"(currently set)"})]}),l.jsx("input",{type:"password",value:f,onChange:P=>h(P.target.value),className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:i&&t.apiKeySet?"Leave blank to keep current key":"sk-..."})]}),l.jsx(nD,{baseUrl:u,apiKey:i&&!f&&t.apiKeySet?"***":f,api:p,disabled:!u||!f&&!(i&&t.apiKeySet)}),w&&l.jsx("p",{className:"text-xs text-red-500",children:w})]}),l.jsxs("div",{className:"p-6 border-t border-gray-100 bg-white flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 rounded-lg transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:N,disabled:b||!o.trim(),className:"px-4 py-2 text-sm font-medium bg-indigo-600 text-white hover:bg-indigo-700 rounded-lg shadow-sm flex items-center gap-2 disabled:opacity-50",children:[l.jsx(Wn,{className:"w-4 h-4"}),b?"Saving...":i?"Save Changes":"Create Provider"]})]})]})]})})}function DJ({onComplete:e}){const{sendRpc:t}=$t(),[n,r]=m.useState(null),[i,a]=m.useState(!1),[s,o]=m.useState(""),[c,u]=m.useState(""),[d,f]=m.useState(""),[h,p]=m.useState("openai-completions"),[g,y]=m.useState(null),[x,b]=m.useState(""),[v,w]=m.useState(""),[k,S]=m.useState(!1),[j,N]=m.useState(""),P=M=>{r(M),a(!1),o(M.name),u(M.baseUrl),p(M.api),y(null),N("");const I=M.models.find(B=>B.category==="llm");I&&y(I)},A=()=>{r(null),a(!0),o(""),u(""),p("openai-completions"),y(null),b(""),w(""),N("")},E=async()=>{const M=s.trim();if(!M){N("Provider name is required");return}if(!d){N("API Key is required");return}const I=i?x.trim():g==null?void 0:g.id,B=i?v.trim()||x.trim():g==null?void 0:g.name;if(!I){N("Please select or enter a model");return}S(!0),N("");try{await t("provider.quickSetup",{provider:M,baseUrl:c.trim(),apiKey:d,api:h,authHeader:(n==null?void 0:n.authHeader)??!1,model:{id:I,name:B,reasoning:(g==null?void 0:g.reasoning)??!1,contextWindow:(g==null?void 0:g.contextWindow)??128e3,maxTokens:(g==null?void 0:g.maxTokens)??65536,category:(g==null?void 0:g.category)??"llm"},setAsDefault:!0}),e()}catch(se){N(se instanceof Error?se.message:"Failed to save")}finally{S(!1)}},O=n||i,C=(n==null?void 0:n.models.filter(M=>M.category==="llm"))??[];return l.jsxs("div",{className:"rounded-2xl border-2 border-dashed border-indigo-200 bg-indigo-50/30 p-8",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(kd,{className:"w-5 h-5 text-indigo-500"}),l.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Quick Setup"})]}),l.jsx("p",{className:"text-sm text-gray-500 mb-6",children:"Select a provider to get started. You can add more providers later."}),l.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[av.map(M=>l.jsx("button",{onClick:()=>P(M),className:`px-4 py-2 text-sm font-medium rounded-lg border transition-colors ${(n==null?void 0:n.name)===M.name?"border-indigo-500 bg-indigo-100 text-indigo-700":"border-gray-200 bg-white text-gray-700 hover:border-gray-300 hover:bg-gray-50"}`,children:M.displayName},M.name)),l.jsx("button",{onClick:A,className:`px-4 py-2 text-sm font-medium rounded-lg border transition-colors ${i?"border-indigo-500 bg-indigo-100 text-indigo-700":"border-gray-200 bg-white text-gray-700 hover:border-gray-300 hover:bg-gray-50"}`,children:"Custom"})]}),O&&l.jsxs("div",{className:"space-y-4 max-w-xl",children:[i&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Provider Name"}),l.jsx("input",{type:"text",value:s,onChange:M=>o(M.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:"e.g. my-provider"})]}),n&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API Type"}),l.jsx("div",{className:"px-3 py-2 border border-gray-100 rounded-lg text-sm bg-gray-50 text-gray-500",children:n.api==="anthropic"?"Anthropic":"OpenAI Compatible"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Base URL"}),l.jsx("input",{type:"text",value:c,onChange:M=>u(M.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:"https://api.example.com/v1"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API Key"}),l.jsx("input",{type:"password",value:d,onChange:M=>f(M.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:"sk-..."})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Model"}),i?l.jsxs("div",{className:"space-y-2",children:[l.jsx("input",{type:"text",value:x,onChange:M=>b(M.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:"Model ID (e.g. gpt-4o)"}),l.jsx("input",{type:"text",value:v,onChange:M=>w(M.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",placeholder:"Display name (optional)"})]}):l.jsxs("div",{className:"relative",children:[l.jsxs("select",{value:(g==null?void 0:g.id)??"",onChange:M=>{const I=C.find(B=>B.id===M.target.value);I&&y(I)},className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300 appearance-none pr-8",children:[l.jsx("option",{value:"",children:"Select a model"}),C.map(M=>l.jsxs("option",{value:M.id,children:[M.name," ",M.reasoning?"(reasoning)":""]},M.id))]}),l.jsx(ea,{className:"w-4 h-4 text-gray-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]}),j&&l.jsx("p",{className:"text-sm text-red-500",children:j}),l.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[l.jsx(nD,{baseUrl:c,apiKey:d,api:h}),l.jsx("button",{onClick:E,disabled:k||!d,className:"flex items-center gap-2 px-5 py-2 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:k?"Saving...":"Save & Activate"})]})]})]})}function IJ(){const{sendRpc:e,isConnected:t}=$t(),{isAdmin:n}=ic(e,t),[r,i]=m.useState([]),[a,s]=m.useState([]),[o,c]=m.useState(""),[u,d]=m.useState(""),[f,h]=m.useState(!1),[p,g]=m.useState(""),[y,x]=m.useState(1024),[b,v]=m.useState(null),[w,k]=m.useState(!1),[S,j]=m.useState(!1),[N,P]=m.useState(null),[A,E]=m.useState(null),O=m.useRef(!1),C=m.useCallback(async()=>{try{const L=await e("provider.list");i(L.providers??[])}catch(L){console.error("Failed to load providers:",L)}},[e]),M=m.useCallback(async()=>{try{const L=await e("model.list");if(s(L.models??[]),L.default){const W=`${L.default.provider}::${L.default.modelId}`;c(W),d(W)}}catch(L){console.error("Failed to load models:",L)}},[e]),I=m.useCallback(async()=>{try{const L=await e("embedding.getConfig");L.config&&(g(`${L.config.provider}::${L.config.model}`),x(L.config.dimensions),v(L.config))}catch(L){console.error("Failed to load embedding config:",L)}},[e]);m.useEffect(()=>{t&&!O.current&&(O.current=!0,C(),M(),I())},[t,C,M,I]);const B=L=>{const W=L.indexOf("::");return W<0?{provider:"",modelId:""}:{provider:L.slice(0,W),modelId:L.slice(W+2)}},se=async()=>{const{provider:L,modelId:W}=B(o);if(!(!L||!W)){h(!0);try{await e("config.setDefaultModel",{provider:L,modelId:W}),d(o);try{new BroadcastChannel("siclaw-model-config").postMessage("default-changed")}catch{}}catch(F){console.error("Failed to save default model:",F)}finally{h(!1)}}},Q=async()=>{const{provider:L,modelId:W}=B(p);if(!(!L||!W||!y)){k(!0);try{await e("embedding.setConfig",{provider:L,model:W,dimensions:y}),v({provider:L,model:W,dimensions:y})}catch(F){console.error("Failed to save embedding config:",F)}finally{k(!1)}}},D=async L=>{const W={provider:L.name,baseUrl:L.baseUrl,api:L.api,authHeader:L.authHeader};L.apiKey&&(W.apiKey=L.apiKey),await e("provider.save",W),await C()},K=async(L,W)=>{await e("provider.addModel",{provider:L,model:W}),await Promise.all([C(),M()])},T=async(L,W)=>{await e("provider.removeModel",{provider:L,modelId:W}),await Promise.all([C(),M()])},ie=async L=>{if(window.confirm(`Delete provider "${L}" and all its models?`))try{await e("provider.delete",{provider:L}),await Promise.all([C(),M()])}catch(W){console.error("Failed to delete provider:",W)}},J=()=>{C(),M()},_=()=>{P(null),j(!0)},H=L=>{P(L),j(!0)},ee=a.filter(L=>L.category!=="embedding"),be=a.filter(L=>L.category==="embedding"),te=L=>{var F;const W={};for(const le of L)(W[F=le.provider]??(W[F]=[])).push(le);return W},ye=te(ee),Z=te(be),ne=o!==u,ve=b?p!==`${b.provider}::${b.model}`||y!==b.dimensions:!!p;return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-8 max-w-5xl mx-auto w-full",children:[l.jsxs("section",{className:"mb-10",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Providers"}),n&&r.length>0&&l.jsxs("button",{onClick:_,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 transition-colors",children:[l.jsx(In,{className:"w-4 h-4"}),"Add Provider"]})]}),r.length===0?n?l.jsx(DJ,{onComplete:J}):l.jsx("p",{className:"text-sm text-gray-400 text-center py-12",children:"No providers configured"}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:r.map(L=>l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5 hover:shadow-md transition-shadow",children:[l.jsxs("div",{className:"flex items-start justify-between mb-3",children:[l.jsx("h3",{className:"text-base font-semibold text-gray-900",children:L.name}),l.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-gray-100 text-gray-500",children:L.api})]}),l.jsxs("div",{className:"space-y-2 mb-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[l.jsx(Il,{className:"w-3.5 h-3.5 text-gray-400"}),l.jsx("span",{className:"truncate",children:L.baseUrl||"Not set"})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[l.jsx(rB,{className:"w-3.5 h-3.5 text-gray-400"}),l.jsx("span",{children:L.apiKeySet?L.apiKey:"Not set"})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[l.jsx(lw,{className:"w-3.5 h-3.5 text-gray-400"}),l.jsxs("span",{children:[L.modelCount," model",L.modelCount!==1?"s":""]})]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>E(L.name),className:"flex-1 px-3 py-1.5 text-sm font-medium text-indigo-600 bg-indigo-50 hover:bg-indigo-100 rounded-lg transition-colors",children:"Models"}),n&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{onClick:()=>H(L),className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors",children:[l.jsx(Cm,{className:"w-3.5 h-3.5"}),"Settings"]}),l.jsx("button",{onClick:()=>ie(L.name),className:"flex items-center px-2 py-1.5 text-sm text-red-500 bg-red-50 hover:bg-red-100 rounded-lg transition-colors",title:"Delete provider",children:l.jsx(sr,{className:"w-3.5 h-3.5"})})]})]})]},L.name))})]}),r.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"mb-10",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Default Chat Model"}),l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-gray-50/50 p-6",children:[l.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"The default model for new chat sessions."}),l.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[l.jsxs("div",{className:"flex-1 min-w-[300px]",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Model"}),l.jsxs("select",{value:o,onChange:L=>c(L.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300",children:[l.jsx("option",{value:"",children:"Select model"}),Object.entries(ye).map(([L,W])=>l.jsx("optgroup",{label:L,children:W.map(F=>l.jsx("option",{value:`${L}::${F.id}`,children:F.name},`${L}::${F.id}`))},L))]})]}),n&&l.jsxs("button",{onClick:se,disabled:f||!ne||!o,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed",children:[l.jsx(Wn,{className:"w-4 h-4"}),f?"Saving...":"Save"]})]})]})]}),l.jsxs("section",{className:"mb-10",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Default Embedding Model"}),l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-gray-50/50 p-6",children:[l.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"Configure the embedding model used for memory search and semantic retrieval."}),l.jsx("div",{className:"space-y-4",children:l.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[l.jsxs("div",{className:"flex-1 min-w-[300px]",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Model"}),l.jsxs("select",{value:p,onChange:L=>g(L.target.value),disabled:!n,className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300 disabled:opacity-50",children:[l.jsx("option",{value:"",children:"Select model"}),Object.entries(Z).map(([L,W])=>l.jsx("optgroup",{label:L,children:W.map(F=>l.jsx("option",{value:`${L}::${F.id}`,children:F.name},`${L}::${F.id}`))},L))]})]}),l.jsxs("div",{className:"w-[120px]",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Dimensions"}),l.jsx("input",{type:"number",value:y,onChange:L=>x(Number(L.target.value)||0),disabled:!n,placeholder:"1024",className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300 focus:border-indigo-300 disabled:opacity-50"})]}),n&&l.jsxs("button",{onClick:Q,disabled:w||!ve||!p||!y,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed",children:[l.jsx(Wn,{className:"w-4 h-4"}),w?"Saving...":"Save"]})]})})]})]})]})]}),l.jsx(MJ,{isOpen:S,provider:N,onClose:()=>j(!1),onSave:D}),A&&l.jsx(_J,{provider:A,models:a.filter(L=>L.provider===A),isAdmin:n,onClose:()=>E(null),onAdd:L=>K(A,L),onRemove:L=>T(A,L)})]})}const LJ=[{name:"indigo",class:"bg-indigo-500"},{name:"blue",class:"bg-blue-500"},{name:"green",class:"bg-green-500"},{name:"amber",class:"bg-amber-500"},{name:"rose",class:"bg-rose-500"},{name:"purple",class:"bg-purple-500"},{name:"teal",class:"bg-teal-500"},{name:"gray",class:"bg-gray-400"}];function CC({total:e,selected:t,onSelectAll:n,onDeselectAll:r}){return e===0?null:l.jsxs("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-gray-100",children:[l.jsxs("span",{className:"text-xs text-gray-400",children:[t," / ",e," selected"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:n,disabled:t===e,className:"text-xs text-indigo-600 hover:text-indigo-800 disabled:text-gray-300",children:"Select All"}),l.jsx("button",{onClick:r,disabled:t===0,className:"text-xs text-gray-500 hover:text-gray-700 disabled:text-gray-300",children:"Deselect All"})]})]})}function RJ({workspace:e,onClose:t,onSaved:n,sendRpc:r}){var L,W;const i=!e,a=(e==null?void 0:e.isDefault)??!1,[s,o]=m.useState("general"),[c,u]=m.useState((e==null?void 0:e.name)??""),[d,f]=m.useState(((L=e==null?void 0:e.configJson)==null?void 0:L.color)??"indigo"),[h,p]=m.useState(((W=e==null?void 0:e.configJson)==null?void 0:W.systemPrompt)??""),[g,y]=m.useState(!1),[x,b]=m.useState((e==null?void 0:e.envType)??"prod"),[v,w]=m.useState(new Set),[k,S]=m.useState([]),[j,N]=m.useState(""),[P,A]=m.useState(null),[E,O]=m.useState(new Set),[C,M]=m.useState(new Set),[I,B]=m.useState(new Set),[se,Q]=m.useState([]),[D,K]=m.useState([]),[T,ie]=m.useState([]);m.useEffect(()=>{r("skill.list",{limit:500}).then(F=>Q(F.skills??[])).catch(()=>{}),r("workspace.availableTools").then(F=>K(F.tools??[])).catch(()=>{}),r("credential.list").then(F=>ie(F.credentials??[])).catch(()=>{}),r("environment.list").then(F=>S(F.environments??[])).catch(()=>{}),e&&!e.isDefault&&r("workspace.getConfig",{id:e.id}).then(F=>{O(new Set(F.skills??[])),M(new Set(F.tools??[])),B(new Set(F.credentials??[])),w(new Set(F.environments??[]))}).catch(()=>{})},[r,e]);const J=m.useMemo(()=>{const F=new Set;for(const le of se)le.labels&&le.labels.forEach(oe=>F.add(oe));return[...F].sort()},[se]),_=m.useMemo(()=>{let F=se;if(P&&(F=F.filter(le=>{var oe;return(oe=le.labels)==null?void 0:oe.includes(P)})),j.trim()){const le=j.toLowerCase();F=F.filter(oe=>oe.name.toLowerCase().includes(le))}return F},[se,j,P]),H=m.useMemo(()=>x==="test"?k.filter(F=>F.isTest):k,[k,x]),ee=m.useCallback(F=>{O(le=>{const oe=new Set(le);return oe.has(F)?oe.delete(F):oe.add(F),oe})},[]),be=m.useCallback(F=>{M(le=>{const oe=new Set(le);return oe.has(F)?oe.delete(F):oe.add(F),oe})},[]),te=m.useCallback(F=>{B(le=>{const oe=new Set(le);return oe.has(F)?oe.delete(F):oe.add(F),oe})},[]),ye=m.useCallback(F=>{w(le=>{const oe=new Set(le);return oe.has(F)?oe.delete(F):oe.add(F),oe})},[]),Z=async()=>{if(c.trim()){y(!0);try{if(i){const le=(await r("workspace.create",{name:c.trim(),envType:x,config:{color:d,systemPrompt:h||void 0}})).workspace.id;await Promise.all([r("workspace.setSkills",{workspaceId:le,skills:[...E]}),r("workspace.setTools",{workspaceId:le,tools:[...C]}),r("workspace.setCredentials",{workspaceId:le,credentialIds:[...I]}),r("workspace.setEnvironments",{workspaceId:le,envIds:[...v]})])}else a||(await r("workspace.update",{id:e.id,name:c.trim(),envType:x,config:{...e.configJson,color:d,systemPrompt:h||void 0}}),await Promise.all([r("workspace.setSkills",{workspaceId:e.id,skills:[...E]}),r("workspace.setTools",{workspaceId:e.id,tools:[...C]}),r("workspace.setCredentials",{workspaceId:e.id,credentialIds:[...I]}),r("workspace.setEnvironments",{workspaceId:e.id,envIds:[...v]})]));n()}catch(F){console.error("Failed to save workspace:",F)}finally{y(!1)}}},ne=I.size+v.size,ve=[{key:"general",label:"General"},...a?[]:[{key:"skills",label:`Skills (${E.size})`},{key:"tools",label:`Tools (${C.size})`},{key:"access",label:`Access (${ne})`}]];return l.jsx("div",{className:"fixed inset-0 bg-black/40 flex items-center justify-center z-50",onClick:t,children:l.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg max-h-[85vh] flex flex-col",onClick:F=>F.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:i?"Create Workspace":a?"Default Workspace":`Edit: ${e.name}`}),l.jsx("button",{onClick:t,className:"p-1.5 text-gray-400 hover:text-gray-600 rounded-md",children:l.jsx(Ze,{className:"w-5 h-5"})})]}),!a&&l.jsx("div",{className:"px-6 pt-3",children:l.jsx("input",{type:"text",value:c,onChange:F=>u(F.target.value),placeholder:"Workspace name",className:`w-full px-3 py-2 border rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 ${c.trim()?"border-gray-200":"border-red-300 bg-red-50/30"}`})}),l.jsx("div",{className:"flex gap-1 px-6 pt-3 border-b border-gray-100",children:ve.map(F=>l.jsx("button",{onClick:()=>o(F.key),className:`px-3 py-2 text-sm font-medium rounded-t-md transition-colors ${s===F.key?"text-indigo-600 border-b-2 border-indigo-600":"text-gray-500 hover:text-gray-700"}`,children:F.label},F.key))}),l.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-4",children:[s==="general"&&l.jsxs("div",{className:"space-y-4",children:[!a&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Environment Type"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>b("prod"),className:`px-4 py-2 rounded-lg text-sm font-medium border ${x==="prod"?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-200 text-gray-600 hover:border-gray-300"}`,children:"Production"}),l.jsx("button",{onClick:()=>{b("test"),w(new Set)},className:`px-4 py-2 rounded-lg text-sm font-medium border ${x==="test"?"border-amber-500 bg-amber-50 text-amber-700":"border-gray-200 text-gray-600 hover:border-gray-300"}`,children:"Testing"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Color"}),l.jsx("div",{className:"flex gap-2",children:LJ.map(F=>l.jsx("button",{onClick:()=>!a&&f(F.name),disabled:a,className:`w-7 h-7 rounded-full ${F.class} flex items-center justify-center transition-transform ${d===F.name?"ring-2 ring-offset-2 ring-indigo-400 scale-110":"hover:scale-105"} disabled:opacity-50`,children:d===F.name&&l.jsx($n,{className:"w-3.5 h-3.5 text-white"})},F.name))})]}),!a&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"System Prompt"}),l.jsx("textarea",{value:h,onChange:F=>p(F.target.value),placeholder:"Optional: custom instructions for this workspace...",rows:4,className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 resize-none"})]}),a&&l.jsx("p",{className:"text-sm text-gray-400 italic",children:"The default workspace includes all skills, tools, and credentials. It cannot be modified."})]}),s==="skills"&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"relative",children:[l.jsx(Hn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),l.jsx("input",{type:"text",value:j,onChange:F=>N(F.target.value),placeholder:"Search skills...",className:"w-full pl-9 pr-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300"})]}),J.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-1",children:[l.jsx("button",{onClick:()=>A(null),className:`px-2 py-0.5 rounded-full text-xs font-medium transition-colors ${P?"bg-gray-100 text-gray-500 hover:bg-gray-200":"bg-indigo-100 text-indigo-700"}`,children:"All"}),J.map(F=>l.jsx("button",{onClick:()=>A(P===F?null:F),className:`px-2 py-0.5 rounded-full text-xs font-medium transition-colors ${P===F?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-500 hover:bg-gray-200"}`,children:F},F))]}),l.jsx(CC,{total:_.length,selected:_.filter(F=>E.has(F.name)).length,onSelectAll:()=>O(F=>{const le=new Set(F);return _.forEach(oe=>le.add(oe.name)),le}),onDeselectAll:()=>O(F=>{const le=new Set(F);return _.forEach(oe=>le.delete(oe.name)),le})}),_.length===0?l.jsx("p",{className:"text-sm text-gray-400 py-4 text-center",children:"No skills match"}):l.jsx("div",{className:"space-y-0.5",children:_.map(F=>l.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-gray-50 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:E.has(F.name),onChange:()=>ee(F.name),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),l.jsx("span",{className:"text-sm text-gray-900 flex-1 truncate",children:F.name}),F.labels&&F.labels.length>0&&l.jsx("span",{className:"text-xs text-gray-400 truncate max-w-[120px]",children:F.labels.join(", ")}),l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-gray-100 text-gray-500 shrink-0",children:F.scope})]},F.name))})]}),s==="tools"&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(CC,{total:D.length,selected:C.size,onSelectAll:()=>M(new Set(D)),onDeselectAll:()=>M(new Set)}),D.length===0?l.jsx("p",{className:"text-sm text-gray-400 py-4 text-center",children:"No tools available"}):l.jsx("div",{className:"space-y-0.5",children:D.map(F=>l.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-gray-50 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:C.has(F),onChange:()=>be(F),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),l.jsx("span",{className:"text-sm text-gray-900 font-mono",children:F})]},F))})]}),s==="access"&&l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"K8s Environments"}),H.length===0?l.jsx("p",{className:"text-sm text-gray-400 py-2 text-center",children:"No environments available"}):l.jsx("div",{className:"space-y-0.5",children:H.map(F=>l.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-gray-50 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:v.has(F.id),onChange:()=>ye(F.id),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),l.jsx("span",{className:"text-sm text-gray-900 flex-1",children:F.name}),l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${F.isTest?"bg-amber-50 text-amber-600":"bg-blue-50 text-blue-600"}`,children:F.isTest?"test":"prod"}),l.jsx("span",{className:"text-xs text-gray-400 font-mono",children:F.apiServer})]},F.id))})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Credentials (SSH / API)"}),T.length===0?l.jsx("p",{className:"text-sm text-gray-400 py-2 text-center",children:"No credentials available"}):l.jsx("div",{className:"space-y-0.5",children:T.map(F=>l.jsxs("label",{className:"flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-gray-50 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:I.has(F.id),onChange:()=>te(F.id),className:"rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),l.jsx("span",{className:"text-sm text-gray-900 flex-1",children:F.name}),l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-gray-100 text-gray-500",children:F.type})]},F.id))})]})]})]}),!a&&l.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-gray-200",children:[l.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded-lg",children:"Cancel"}),l.jsx("button",{onClick:Z,disabled:g||!c.trim(),className:"px-4 py-2 text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg disabled:opacity-50",children:g?"Saving...":i?"Create":"Save"})]})]})})}const FJ={indigo:"bg-indigo-500",blue:"bg-blue-500",green:"bg-green-500",amber:"bg-amber-500",rose:"bg-rose-500",purple:"bg-purple-500",teal:"bg-teal-500",gray:"bg-gray-400"};function zJ(e){return FJ[e??""]??"bg-indigo-500"}function $J(){const{sendRpc:e,isConnected:t}=$t(),{reload:n}=Ed(),[r,i]=m.useState([]),[a,s]=m.useState(null),[o,c]=m.useState(!1),[u,d]=m.useState({}),[f,h]=m.useState({}),[p,g]=m.useState({}),y=m.useRef(!1),x=m.useCallback(async()=>{if(t)try{const k=(await e("workspace.list")).workspaces??[];i(k);for(const S of k)S.isDefault||e("workspace.getConfig",{id:S.id}).then(j=>{d(N=>{var P;return{...N,[S.id]:((P=j.skills)==null?void 0:P.length)??0}}),h(N=>{var P;return{...N,[S.id]:((P=j.tools)==null?void 0:P.length)??0}}),g(N=>{var P;return{...N,[S.id]:((P=j.environments)==null?void 0:P.length)??0}})}).catch(()=>{})}catch(w){console.error("Failed to load workspaces:",w)}},[t,e]);m.useEffect(()=>{t&&!y.current&&(y.current=!0,x())},[t,x]);const b=async w=>{if(!w.isDefault&&window.confirm(`Delete workspace "${w.name}"? Sessions in this workspace will no longer be scoped.`))try{await e("workspace.delete",{id:w.id}),await x(),n()}catch(k){console.error("Failed to delete workspace:",k)}},v=()=>{s(null),c(!1),x(),n()};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-8 max-w-5xl mx-auto w-full",children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Workspaces"}),l.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Isolated contexts with scoped skills, tools, and environments."})]}),l.jsxs("button",{onClick:()=>c(!0),className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-lg hover:bg-indigo-700",children:[l.jsx(In,{className:"w-4 h-4"}),"New Workspace"]})]}),r.length===0?l.jsx("p",{className:"text-sm text-gray-400 text-center py-12",children:"No workspaces configured"}):l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[r.map(w=>{var k;return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5 hover:shadow-md transition-shadow",children:[l.jsxs("div",{className:"flex items-start justify-between mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:`w-3 h-3 rounded-full ${zJ((k=w.configJson)==null?void 0:k.color)}`}),l.jsx("h3",{className:"text-base font-semibold text-gray-900",children:w.name}),w.envType==="test"&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-amber-50 text-amber-600 font-medium",children:"TEST"}),w.envType==="prod"&&!w.isDefault&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-blue-50 text-blue-600 font-medium",children:"PROD"})]}),w.isDefault&&l.jsxs("span",{className:"flex items-center gap-1 text-xs px-2 py-0.5 rounded-full bg-amber-50 text-amber-600",children:[l.jsx(yB,{className:"w-3 h-3"}),"Default"]})]}),l.jsx("div",{className:"space-y-1.5 mb-4 text-sm text-gray-500",children:w.isDefault?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(aw,{className:"w-3.5 h-3.5 text-gray-400"}),l.jsx("span",{children:"All skills, tools & environments"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-3.5 text-center text-xs font-mono text-gray-400",children:"S"}),l.jsxs("span",{children:[u[w.id]??0," skills"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-3.5 text-center text-xs font-mono text-gray-400",children:"T"}),l.jsxs("span",{children:[f[w.id]??0," tools"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-3.5 text-center text-xs font-mono text-gray-400",children:"E"}),l.jsxs("span",{children:[p[w.id]??0," environments"]})]})]})}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("button",{onClick:()=>s(w),className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 text-sm font-medium text-indigo-600 bg-indigo-50 hover:bg-indigo-100 rounded-lg transition-colors",children:[l.jsx(Sd,{className:"w-3.5 h-3.5"}),w.isDefault?"View":"Edit"]}),!w.isDefault&&l.jsx("button",{onClick:()=>b(w),className:"flex items-center px-2 py-1.5 text-sm text-red-500 bg-red-50 hover:bg-red-100 rounded-lg transition-colors",title:"Delete workspace",children:l.jsx(sr,{className:"w-3.5 h-3.5"})})]})]},w.id)}),l.jsxs("button",{onClick:()=>c(!0),className:"rounded-2xl border-2 border-dashed border-gray-200 p-5 flex flex-col items-center justify-center gap-2 text-gray-400 hover:border-indigo-300 hover:text-indigo-500 transition-colors min-h-[160px]",children:[l.jsx(In,{className:"w-6 h-6"}),l.jsx("span",{className:"text-sm font-medium",children:"Create Workspace"})]})]})]}),(a||o)&&l.jsx(RJ,{workspace:a,onClose:()=>{s(null),c(!1)},onSaved:v,sendRpc:e})]})}function BJ(e){const[t,n]=m.useState([]),[r,i]=m.useState(!0),a=m.useCallback(async()=>{try{const d=await e("mcp.list");n(d.servers??[])}catch(d){console.error("[useMcpServers] Failed to load:",d)}finally{i(!1)}},[e]),s=m.useCallback(async d=>{const f=await e("mcp.create",d);return await a(),f},[e,a]),o=m.useCallback(async(d,f)=>{await e("mcp.update",{id:d,...f}),await a()},[e,a]),c=m.useCallback(async d=>{await e("mcp.toggle",{id:d}),await a()},[e,a]),u=m.useCallback(async d=>{await e("mcp.delete",{id:d}),await a()},[e,a]);return{servers:t,loading:r,loadServers:a,createServer:s,updateServer:o,toggleServer:c,deleteServer:u}}const UJ={stdio:"Stdio",sse:"SSE","streamable-http":"Streamable HTTP"},rD=[{value:"streamable-http",label:"Streamable HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"Stdio"}];function PC(e){const t=e.filter(r=>r.key.trim());if(t.length===0)return;const n={};for(const r of t)n[r.key.trim()]=r.value;return n}function EC(e){return!e||Object.keys(e).length===0?[{key:"",value:""}]:[...Object.entries(e).map(([t,n])=>({key:t,value:n})),{key:"",value:""}]}function AC({label:e,pairs:t,onChange:n}){const r=(s,o,c)=>{const u=t.map((d,f)=>f===s?{...d,[o]:c}:d);n(u)},i=s=>{const o=t.filter((c,u)=>u!==s);o.length===0&&o.push({key:"",value:""}),n(o)},a=()=>{n([...t,{key:"",value:""}])};return l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:e}),l.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1 px-2 py-0.5 text-xs font-medium text-primary-600 hover:text-primary-700 hover:bg-primary-50 rounded-md transition-colors",children:[l.jsx(In,{className:"w-3.5 h-3.5"}),"Add"]})]}),l.jsx("div",{className:"space-y-2",children:t.map((s,o)=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",value:s.key,onChange:c=>r(o,"key",c.target.value),placeholder:"Key",className:"flex-1 px-2.5 py-1.5 bg-white border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"}),l.jsx("input",{type:"text",value:s.value,onChange:c=>r(o,"value",c.target.value),placeholder:"Value",className:"flex-1 px-2.5 py-1.5 bg-white border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"}),t.length>1&&l.jsx("button",{type:"button",onClick:()=>i(o),className:"p-1 text-gray-400 hover:text-red-500 transition-colors",children:l.jsx(sr,{className:"w-3.5 h-3.5"})})]},o))})]})}function VJ({server:e,isOpen:t,onClose:n,onSave:r,onUpdate:i}){const a=!!e,[s,o]=m.useState("streamable-http"),[c,u]=m.useState(""),[d,f]=m.useState(""),[h,p]=m.useState(""),[g,y]=m.useState(""),[x,b]=m.useState(""),[v,w]=m.useState([{key:"",value:""}]),[k,S]=m.useState([{key:"",value:""}]),[j,N]=m.useState(""),[P,A]=m.useState(!1);m.useEffect(()=>{var I;t&&(N(""),A(!1),e?(o(e.transport),u(e.name),f(e.description??""),p(e.url??""),y(e.command??""),b(((I=e.argsJson)==null?void 0:I.join(" "))??""),w(EC(e.envJson)),S(EC(e.headersJson))):(o("streamable-http"),u(""),f(""),p(""),y(""),b(""),w([{key:"",value:""}]),S([{key:"",value:""}])))},[t,e]);const E=()=>c.trim()?s==="stdio"?!!g.trim():!!h.trim():!1,O=async()=>{if(!P){A(!0),N("");try{const I={name:c,transport:s,description:d||void 0};s==="stdio"?(I.command=g,x.trim()&&(I.argsJson=x.split(/\s+/).filter(Boolean)),I.envJson=PC(v)):(I.url=h,I.headersJson=PC(k)),a?await i(e.id,I):await r(I),n()}catch(I){N((I==null?void 0:I.message)||"Failed to save")}finally{A(!1)}}},C=a?"Edit MCP Server":"New MCP Server",M=a?e.name:"Register a new MCP server";return l.jsx(li,{children:t&&l.jsxs(l.Fragment,{children:[l.jsx(cn.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/20 backdrop-blur-sm z-40"}),l.jsxs(cn.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed right-0 top-0 bottom-0 w-[480px] bg-white shadow-2xl z-50 flex flex-col border-l border-gray-100",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-white",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900",children:C}),l.jsx("p",{className:"text-xs text-gray-400",children:M})]}),l.jsx("button",{onClick:n,className:"p-2 text-gray-400 hover:text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:l.jsx(Ze,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Transport ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("div",{className:"grid grid-cols-3 gap-2",children:rD.map(I=>{const B=s===I.value;return l.jsx("button",{type:"button",disabled:a,onClick:()=>o(I.value),className:U("px-3 py-2 rounded-lg border text-sm font-medium transition-colors text-center",B?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-200 text-gray-600 hover:border-gray-300 hover:bg-gray-50",a&&"opacity-60 cursor-not-allowed"),children:I.label},I.value)})})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Name ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:c,onChange:I=>u(I.target.value),placeholder:"e.g. tools-server, filesystem",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Description"}),l.jsx("input",{type:"text",value:d,onChange:I=>f(I.target.value),placeholder:"Optional description",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),s==="stdio"?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Command ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:g,onChange:I=>y(I.target.value),placeholder:"e.g. npx, node, python",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-sm font-medium text-gray-700",children:"Arguments"}),l.jsx("input",{type:"text",value:x,onChange:I=>b(I.target.value),placeholder:"e.g. -y @modelcontextprotocol/server-filesystem /workspace",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"}),l.jsx("p",{className:"text-xs text-gray-400",children:"Space-separated arguments"})]}),l.jsx(AC,{label:"Environment Variables",pairs:v,onChange:w})]}):l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["URL ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("input",{type:"text",value:h,onChange:I=>p(I.target.value),placeholder:"http://localhost:8000/mcp",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsx(AC,{label:"Headers",pairs:k,onChange:S})]}),j&&l.jsx("p",{className:"text-xs text-red-500",children:j})]}),l.jsxs("div",{className:"p-6 border-t border-gray-100 bg-white flex items-center justify-end gap-3",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 rounded-lg transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:O,disabled:!E()||P,className:"px-4 py-2 text-sm font-medium bg-primary-600 text-white hover:bg-primary-700 rounded-lg shadow-sm flex items-center gap-2 disabled:opacity-50",children:[l.jsx(Wn,{className:"w-4 h-4"}),P?"Saving...":a?"Save Changes":"Create Server"]})]})]})]})})}const WJ={"streamable-http":"bg-blue-50 text-blue-700",sse:"bg-purple-50 text-purple-700",stdio:"bg-emerald-50 text-emerald-700"},HJ={seed:"bg-gray-50 text-gray-500",db:"bg-indigo-50 text-indigo-600",file:"bg-amber-50 text-amber-600"};function KJ(){const{sendRpc:e,isConnected:t}=$t(),{isAdmin:n}=ic(e,t),{servers:r,loading:i,loadServers:a,createServer:s,updateServer:o,toggleServer:c,deleteServer:u}=BJ(e),[d,f]=m.useState(""),[h,p]=m.useState(""),[g,y]=m.useState(!1),[x,b]=m.useState(null),[v,w]=m.useState(null),[k,S]=m.useState(null),j=m.useRef(!1);m.useEffect(()=>{t&&!j.current&&(j.current=!0,a())},[t]);const N=m.useMemo(()=>{let C=r;if(h&&(C=C.filter(M=>M.transport===h)),d.trim()){const M=d.toLowerCase();C=C.filter(I=>I.name.toLowerCase().includes(M)||(I.description??"").toLowerCase().includes(M)||(I.url??"").toLowerCase().includes(M)||(I.command??"").toLowerCase().includes(M))}return C},[r,d,h]),P=()=>{b(null),y(!0)},A=C=>{b(C),y(!0)},E=async(C,M)=>{if(C.stopPropagation(),!k){S(M);try{await c(M)}catch(I){console.error("[McpServers] Toggle failed:",I)}finally{S(null)}}},O=async(C,M,I)=>{if(C.stopPropagation(),!v&&window.confirm(`Delete MCP server "${I}"?`)){w(M);try{await u(M)}catch(B){console.error("[McpServers] Delete failed:",B),alert(`Delete failed: ${(B==null?void 0:B.message)||"Unknown error"}`)}finally{w(null)}}};return l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsxs("header",{className:"h-16 flex items-center justify-between px-6 bg-white sticky top-0 z-10 border-b border-gray-100",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-2 bg-primary-50 rounded-lg",children:l.jsx(jx,{className:"w-5 h-5 text-primary-600"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-gray-900",children:"MCP Servers"}),l.jsx("p",{className:"text-xs text-gray-500",children:"Manage Model Context Protocol server connections"})]})]}),n&&l.jsxs("button",{onClick:P,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors",children:[l.jsx(In,{className:"w-4 h-4"}),"New Server"]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:l.jsxs("div",{className:"max-w-5xl mx-auto",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsxs("div",{className:"relative flex-1 max-w-xs",children:[l.jsx(Hn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),l.jsx("input",{type:"text",value:d,onChange:C=>f(C.target.value),placeholder:"Search servers...",className:"w-full pl-9 pr-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("select",{value:h,onChange:C=>p(C.target.value),className:"px-3 py-2 border border-gray-200 rounded-lg text-sm text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 bg-white",children:[l.jsx("option",{value:"",children:"All Transports"}),rD.map(C=>l.jsx("option",{value:C.value,children:C.label},C.value))]})]}),i?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(Le,{className:"w-6 h-6 animate-spin text-gray-400"})}):N.length===0?l.jsxs("div",{className:"text-center py-20",children:[l.jsx(jx,{className:"w-12 h-12 text-gray-200 mx-auto mb-4"}),l.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-1",children:r.length===0?"No MCP servers yet":"No matching servers"}),l.jsx("p",{className:"text-xs text-gray-500",children:r.length===0?"Register your first MCP server to get started.":"Try adjusting your search or filter."})]}):l.jsx("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-100 bg-gray-50/50",children:[l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Name"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Transport"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Endpoint"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Status"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Source"}),n&&l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),l.jsx("tbody",{children:N.map(C=>l.jsxs("tr",{onClick:n?()=>A(C):void 0,className:U("border-b border-gray-50 last:border-0 hover:bg-gray-50/50 transition-colors",n&&"cursor-pointer"),children:[l.jsx("td",{className:"px-6 py-4",children:l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-gray-900",children:C.name}),C.description&&l.jsx("p",{className:"text-xs text-gray-400 mt-0.5 truncate max-w-[200px]",children:C.description})]})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:U("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",WJ[C.transport]??"bg-gray-50 text-gray-600"),children:UJ[C.transport]??C.transport})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-xs text-gray-500 font-mono truncate block max-w-[240px]",children:C.url||C.command||"-"})}),l.jsx("td",{className:"px-6 py-4 text-center",children:l.jsxs("span",{className:U("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium",C.enabled?"bg-green-50 text-green-700":"bg-gray-100 text-gray-500"),children:[l.jsx("span",{className:U("w-1.5 h-1.5 rounded-full",C.enabled?"bg-green-500":"bg-gray-400")}),C.enabled?"Enabled":"Disabled"]})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:U("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",HJ[C.source??"db"]??"bg-gray-50 text-gray-500"),children:C.source??"db"})}),n&&l.jsx("td",{className:"px-6 py-4 text-center",children:l.jsxs("div",{className:"inline-flex items-center gap-1",children:[l.jsx("button",{onClick:M=>E(M,C.id),disabled:k===C.id,className:U("p-1.5 rounded-lg transition-colors",C.enabled?"text-green-600 hover:text-orange-600 hover:bg-orange-50":"text-gray-400 hover:text-green-600 hover:bg-green-50","disabled:opacity-50"),title:C.enabled?"Disable":"Enable",children:k===C.id?l.jsx(Le,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(cB,{className:"w-3.5 h-3.5"})}),l.jsx("button",{onClick:M=>{M.stopPropagation(),A(C)},className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-colors",title:"Edit",children:l.jsx(Sd,{className:"w-3.5 h-3.5"})}),l.jsx("button",{onClick:M=>O(M,C.id,C.name),disabled:v===C.id,className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors disabled:opacity-50",title:"Delete",children:v===C.id?l.jsx(Le,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(sr,{className:"w-3.5 h-3.5"})})]})})]},C.id))})]})})]})}),n&&l.jsx(VJ,{server:x,isOpen:g,onClose:()=>y(!1),onSave:async C=>{await s(C)},onUpdate:async(C,M)=>{await o(C,M)}})]})}const GJ={name:"",isTest:!1,apiServer:"",allowedServers:"",defaultKubeconfig:""};function qJ({environment:e,onClose:t,onSaved:n,sendRpc:r}){const i=!e,[a,s]=m.useState(()=>e?{name:e.name,isTest:e.isTest,apiServer:e.apiServer,allowedServers:e.allowedServers.join(", "),defaultKubeconfig:""}:{...GJ}),[o,c]=m.useState(!1),u=(f,h)=>{s(p=>({...p,[f]:h}))},d=async()=>{if(!(!a.name.trim()||!a.apiServer.trim())){c(!0);try{const f=a.allowedServers.trim()?a.allowedServers.split(",").map(p=>p.trim()).filter(Boolean):void 0,h=a.isTest&&a.defaultKubeconfig.trim()?a.defaultKubeconfig.trim():void 0;i?await r("environment.create",{name:a.name.trim(),isTest:a.isTest,apiServer:a.apiServer.trim(),allowedServers:f,defaultKubeconfig:h}):await r("environment.update",{id:e.id,name:a.name.trim(),isTest:a.isTest,apiServer:a.apiServer.trim(),allowedServers:f,defaultKubeconfig:h}),n()}catch(f){console.error("[Environments] Save failed:",f)}finally{c(!1)}}};return l.jsx("div",{className:"fixed inset-0 bg-black/40 flex items-center justify-center z-50",onClick:t,children:l.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg max-h-[85vh] flex flex-col",onClick:f=>f.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:i?"Create Environment":`Edit: ${e.name}`}),l.jsx("button",{onClick:t,className:"p-1.5 text-gray-400 hover:text-gray-600 rounded-md",children:l.jsx(Ze,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Name ",l.jsx("span",{className:"text-red-400",children:"*"})]}),l.jsx("input",{type:"text",value:a.name,onChange:f=>u("name",f.target.value),placeholder:"production-us-east",className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Type"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{type:"button",onClick:()=>u("isTest",!1),className:U("flex-1 px-3 py-2 text-sm font-medium rounded-lg border transition-colors",a.isTest?"bg-white text-gray-500 border-gray-200 hover:bg-gray-50":"bg-blue-50 text-blue-700 border-blue-200"),children:"Production"}),l.jsx("button",{type:"button",onClick:()=>u("isTest",!0),className:U("flex-1 px-3 py-2 text-sm font-medium rounded-lg border transition-colors",a.isTest?"bg-amber-50 text-amber-700 border-amber-200":"bg-white text-gray-500 border-gray-200 hover:bg-gray-50"),children:"Testing"})]})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["API Server ",l.jsx("span",{className:"text-red-400",children:"*"})]}),l.jsx("input",{type:"text",value:a.apiServer,onChange:f=>u("apiServer",f.target.value),placeholder:"https://10.0.1.100:6443",className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Allowed Servers"}),l.jsx("input",{type:"text",value:a.allowedServers,onChange:f=>u("allowedServers",f.target.value),placeholder:"server1, server2, server3",className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Comma-separated list of allowed server addresses"})]}),a.isTest&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Default Kubeconfig"}),l.jsx("textarea",{value:a.defaultKubeconfig,onChange:f=>u("defaultKubeconfig",f.target.value),placeholder:"Paste kubeconfig YAML here...",rows:6,className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 resize-none"}),!i&&e.hasDefaultKubeconfig&&!a.defaultKubeconfig.trim()&&l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"A kubeconfig is already configured. Leave empty to keep the existing one."})]})]}),l.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-gray-200",children:[l.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded-lg",children:"Cancel"}),l.jsx("button",{onClick:d,disabled:o||!a.name.trim()||!a.apiServer.trim(),className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg disabled:opacity-50",children:o?"Saving...":i?"Create":"Save"})]})]})})}function YJ({environments:e,initialEnvId:t,onClose:n,onUploaded:r,sendRpc:i}){const[a,s]=m.useState(t??""),[o,c]=m.useState(""),[u,d]=m.useState(!1),f=e.find(p=>p.id===a),h=async()=>{if(!(!a||!o.trim())){d(!0);try{await i("userEnvConfig.set",{envId:a,kubeconfig:o}),r()}catch(p){alert((p==null?void 0:p.message)||"Failed to upload kubeconfig")}finally{d(!1)}}};return l.jsx("div",{className:"fixed inset-0 bg-black/40 flex items-center justify-center z-50",onClick:n,children:l.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg p-6",onClick:p=>p.stopPropagation(),children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Upload Kubeconfig"}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Environment"}),l.jsxs("select",{value:a,onChange:p=>s(p.target.value),className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-300 bg-white",children:[l.jsx("option",{value:"",children:"Select an environment..."}),e.map(p=>l.jsxs("option",{value:p.id,children:[p.name," (",p.apiServer,") ",p.hasUserKubeconfig?"— replace":""]},p.id))]})]}),f&&l.jsxs("p",{className:"text-xs text-gray-400 mb-3",children:["API Server: ",l.jsx("span",{className:"font-mono",children:f.apiServer}),f.hasUserKubeconfig&&" — existing kubeconfig will be replaced"]}),l.jsx("textarea",{value:o,onChange:p=>c(p.target.value),placeholder:"Paste kubeconfig YAML content...",rows:12,className:"w-full px-3 py-2 border border-gray-200 rounded-lg text-xs font-mono focus:outline-none focus:ring-2 focus:ring-indigo-300 resize-none mb-4"}),l.jsxs("div",{className:"flex justify-end gap-3",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded-lg",children:"Cancel"}),l.jsx("button",{onClick:h,disabled:!a||!o.trim()||u,className:"px-4 py-2 text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg disabled:opacity-50",children:u?"Uploading...":"Upload"})]})]})})}const TC={production:"bg-blue-50 text-blue-700",testing:"bg-amber-50 text-amber-700"};function XJ(){const{sendRpc:e,isConnected:t}=$t(),{isAdmin:n,loaded:r}=ic(e,t),[i,a]=bd(),s=i.get("tab"),o=s==="ssh"?"ssh":s==="api"?"api":s==="credentials"?"ssh":"environments",c=_=>{a(_==="environments"?{}:{tab:_})},[u,d]=m.useState([]),[f,h]=m.useState(!1),[p,g]=m.useState(!0),[y,x]=m.useState(""),[b,v]=m.useState(!1),[w,k]=m.useState(null),[S,j]=m.useState(null),[N,P]=m.useState(!1),[A,E]=m.useState(),O=m.useRef(!1),C=m.useCallback(async()=>{g(!0);try{const _=await e("environment.list");d(_.environments??[]),h(_.isAdmin??!1)}catch(_){console.error("[Environments] Failed to load:",_)}finally{g(!1)}},[e]);m.useEffect(()=>{t&&r&&!O.current&&(O.current=!0,C())},[t,r,C]);const M=m.useMemo(()=>{if(!y.trim())return u;const _=y.toLowerCase();return u.filter(H=>H.name.toLowerCase().includes(_)||H.apiServer.toLowerCase().includes(_)||H.allowedServers.some(ee=>ee.toLowerCase().includes(_)))},[u,y]),I=()=>{k(null),v(!0)},B=_=>{k(_),v(!0)},se=async(_,H)=>{if(_.stopPropagation(),!S&&window.confirm(`Delete environment "${H.name}"? This action cannot be undone.`)){j(H.id);try{await e("environment.delete",{id:H.id}),await C()}catch(ee){console.error("[Environments] Delete failed:",ee)}finally{j(null)}}},Q=()=>{v(!1),k(null),C()},D=_=>{E(_),P(!0)},K=()=>{P(!1),E(void 0),C()},T=async _=>{if(window.confirm("Remove your kubeconfig for this environment?"))try{await e("userEnvConfig.remove",{envId:_}),await C()}catch(H){console.error("Failed to remove env config:",H)}},ie=n||f,J=_=>_.hasUserKubeconfig?l.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700",children:"Configured"}):_.hasDefaultKubeconfig&&_.isTest?l.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-teal-50 text-teal-700",children:"Default"}):l.jsx("span",{className:"text-xs text-gray-400",children:"—"});return r?l.jsxs("div",{className:"h-full bg-white flex flex-col",children:[l.jsx("header",{className:"h-16 flex items-center justify-between px-6 bg-white sticky top-0 z-10 border-b border-gray-100",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-2 bg-primary-50 rounded-lg",children:l.jsx(Ql,{className:"w-5 h-5 text-primary-600"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-lg font-bold text-gray-900",children:"Credentials"}),l.jsx("p",{className:"text-xs text-gray-500",children:"Manage Kubernetes environments, SSH and API credentials"})]})]})}),l.jsx("div",{className:"border-b border-gray-200 bg-white px-6",children:l.jsx("nav",{className:"flex gap-6 -mb-px",children:[{key:"environments",label:"Kubernetes"},{key:"ssh",label:"SSH"},{key:"api",label:"API"}].map(_=>l.jsx("button",{onClick:()=>c(_.key),className:U("py-3 text-sm font-medium border-b-2 transition-colors",o===_.key?"border-primary-600 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),children:_.label},_.key))})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:l.jsx("div",{className:"max-w-5xl mx-auto",children:o!=="environments"?l.jsxs("div",{className:"text-center py-20",children:[l.jsx(Il,{className:"w-12 h-12 text-gray-200 mx-auto mb-4"}),l.jsx("div",{className:"text-lg font-medium text-gray-500 mb-1",children:o==="ssh"?"SSH Credentials":"API Credentials"}),l.jsx("div",{className:"text-sm text-gray-400",children:"Coming soon"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsxs("div",{className:"relative flex-1 max-w-xs",children:[l.jsx(Hn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),l.jsx("input",{type:"text",value:y,onChange:_=>x(_.target.value),placeholder:"Search environments...",className:"w-full pl-9 pr-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]}),l.jsx("div",{className:"flex-1"}),ie&&l.jsxs("button",{onClick:I,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors",children:[l.jsx(In,{className:"w-4 h-4"}),"New Kubernetes"]})]}),p?l.jsx("div",{className:"flex items-center justify-center py-20",children:l.jsx(Le,{className:"w-6 h-6 animate-spin text-gray-400"})}):M.length===0?l.jsxs("div",{className:"text-center py-20",children:[l.jsx(Il,{className:"w-12 h-12 text-gray-200 mx-auto mb-4"}),l.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-1",children:u.length===0?"No environments yet":"No matching environments"}),l.jsx("p",{className:"text-xs text-gray-500",children:u.length===0?ie?"Create your first environment to get started.":"No environments have been configured yet.":"Try adjusting your search."})]}):l.jsx("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-100 bg-gray-50/50",children:[l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Name"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Type"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"API Server"}),l.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Status"}),l.jsx("th",{className:"text-center px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),l.jsx("tbody",{children:M.map(_=>l.jsxs("tr",{className:U("border-b border-gray-50 last:border-0 hover:bg-gray-50/50 transition-colors",ie&&"cursor-pointer"),onClick:()=>ie&&B(_),children:[l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-sm font-medium text-gray-900",children:_.name})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:U("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",_.isTest?TC.testing:TC.production),children:_.isTest?"Testing":"Production"})}),l.jsx("td",{className:"px-6 py-4",children:l.jsx("span",{className:"text-sm text-gray-500 font-mono text-xs",children:_.apiServer})}),l.jsx("td",{className:"px-6 py-4",children:J(_)}),l.jsx("td",{className:"px-6 py-4 text-center",children:l.jsxs("div",{className:"inline-flex items-center gap-1",children:[_.hasUserKubeconfig?l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:H=>{H.stopPropagation(),D(_.id)},className:"px-2 py-1 text-xs font-medium text-indigo-600 bg-indigo-50 hover:bg-indigo-100 rounded transition-colors",title:"Replace kubeconfig",children:"Replace"}),l.jsx("button",{onClick:H=>{H.stopPropagation(),T(_.id)},className:"px-2 py-1 text-xs font-medium text-red-600 bg-red-50 hover:bg-red-100 rounded transition-colors",title:"Remove kubeconfig",children:"Remove"})]}):l.jsxs("button",{onClick:H=>{H.stopPropagation(),D(_.id)},className:"px-2 py-1 text-xs font-medium text-indigo-600 bg-indigo-50 hover:bg-indigo-100 rounded transition-colors",title:"Upload kubeconfig",children:[l.jsx(n_,{className:"w-3 h-3 inline mr-1"}),"Upload"]}),ie&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-px h-4 bg-gray-200 mx-1"}),l.jsx("button",{onClick:H=>{H.stopPropagation(),B(_)},className:"p-1.5 text-gray-400 hover:text-primary-600 hover:bg-primary-50 rounded-lg transition-colors",title:"Edit environment",children:l.jsx(Sd,{className:"w-3.5 h-3.5"})}),l.jsx("button",{onClick:H=>se(H,_),disabled:S===_.id,className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors disabled:opacity-50",title:"Delete environment",children:S===_.id?l.jsx(Le,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(sr,{className:"w-3.5 h-3.5"})})]})]})})]},_.id))})]})})]})})}),b&&ie&&l.jsx(qJ,{environment:w,onClose:()=>{v(!1),k(null)},onSaved:Q,sendRpc:e}),N&&l.jsx(YJ,{environments:u.map(_=>({id:_.id,name:_.name,apiServer:_.apiServer,hasUserKubeconfig:_.hasUserKubeconfig})),initialEnvId:A,onClose:()=>{P(!1),E(void 0)},onUploaded:K,sendRpc:e})]}):l.jsx("div",{className:"h-full flex items-center justify-center text-gray-400",children:l.jsx(Le,{className:"w-5 h-5 animate-spin"})})}function ZJ(e){const{sendRpc:t,isConnected:n}=$t(),[r,i]=m.useState(null),[a,s]=m.useState(!0),o=m.useCallback(async()=>{if(n)try{const c=await t("metrics.timeseries",{range:e});i(c)}catch(c){console.warn("[useMetrics] fetch error:",c)}finally{s(!1)}},[t,n,e]);return m.useEffect(()=>{s(!0),o()},[o]),m.useEffect(()=>{const c=setInterval(o,3e4);return()=>clearInterval(c)},[o]),{data:r,loading:a,refresh:o}}function QJ(e){const{sendRpc:t,isConnected:n}=$t(),[r,i]=m.useState(null),[a,s]=m.useState(!0),o=m.useCallback(async()=>{if(n)try{const c=await t("metrics.summary",{period:e});i(c)}catch(c){console.warn("[useSummary] fetch error:",c)}finally{s(!1)}},[t,n,e]);return m.useEffect(()=>{s(!0),o()},[o]),{data:r,loading:a,refresh:o}}function OC(e){return e===0?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function _C(e,t){if(e.length<4)return{label:"Not enough data",color:"text-gray-400"};const n=Math.floor(e.length/2),r=e.slice(0,n).reduce((s,o)=>s+t(o),0),i=e.slice(n).reduce((s,o)=>s+t(o),0);if(r===0&&i===0)return null;if(r===0)return{label:"New",color:"text-green-600"};const a=(i-r)/r*100;return a>=0?{label:`+${a.toFixed(1)}%`,color:"text-green-600"}:{label:`${a.toFixed(1)}%`,color:"text-red-500"}}function JJ({buckets:e,snapshot:t,range:n}){const r=e.reduce((g,y)=>g+y.tokensInput+y.tokensOutput,0),i=_C(e,g=>g.tokensInput+g.tokensOutput),a=e.reduce((g,y)=>g+y.promptCount+y.promptErrors,0),s=e.reduce((g,y)=>g+y.promptErrors,0),o=a>0?(s/a*100).toFixed(1):"0",c=e.reduce((g,y)=>g+y.toolCalls+y.toolErrors,0),u=e.reduce((g,y)=>g+y.toolErrors,0),d=_C(e,g=>g.toolCalls+g.toolErrors),f=e.reduce((g,y)=>g+y.skillSuccesses+y.skillErrors,0),h=e.reduce((g,y)=>g+y.skillErrors,0),p=f>0?(h/f*100).toFixed(1):"0";return l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:[l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Total Tokens"}),l.jsx("div",{className:"w-8 h-8 rounded-lg bg-indigo-50 flex items-center justify-center",children:l.jsx(kd,{className:"w-4 h-4 text-indigo-600"})})]}),l.jsx("div",{className:"text-2xl font-bold text-gray-900",children:OC(r)}),i&&l.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[l.jsx("span",{className:`text-xs font-medium ${i.color}`,children:i.label}),!i.label.includes("Not enough")&&!i.label.includes("New")&&l.jsxs("span",{className:"text-xs text-gray-400 ml-1",children:["vs prev ",n]})]})]}),l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Prompts"}),l.jsx("div",{className:"w-8 h-8 rounded-lg bg-amber-50 flex items-center justify-center",children:l.jsx(jm,{className:"w-4 h-4 text-amber-600"})})]}),l.jsx("div",{className:"text-2xl font-bold text-gray-900",children:a}),l.jsx("div",{className:"flex items-center gap-1 mt-1",children:s>0?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-xs text-red-500 font-medium",children:[s," errors"]}),l.jsxs("span",{className:"text-xs text-gray-400 ml-1",children:["(",o,"% error rate)"]})]}):l.jsx("span",{className:"text-xs text-green-600 font-medium",children:"No errors"})})]}),l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Tool Calls"}),l.jsx("div",{className:"w-8 h-8 rounded-lg bg-emerald-50 flex items-center justify-center",children:l.jsx(r_,{className:"w-4 h-4 text-emerald-600"})})]}),l.jsx("div",{className:"text-2xl font-bold text-gray-900",children:OC(c)}),l.jsx("div",{className:"flex items-center gap-1 mt-1",children:u>0?l.jsxs("span",{className:"text-xs text-red-500 font-medium",children:[u," errors"]}):d?l.jsx("span",{className:`text-xs font-medium ${d.color}`,children:d.label}):l.jsx("span",{className:"text-xs text-gray-400",children:"No data"})})]}),l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Skill Calls"}),l.jsx("div",{className:"w-8 h-8 rounded-lg bg-purple-50 flex items-center justify-center",children:l.jsx(cw,{className:"w-4 h-4 text-purple-600"})})]}),l.jsx("div",{className:"text-2xl font-bold text-gray-900",children:f}),l.jsx("div",{className:"flex items-center gap-1 mt-1",children:h>0?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-xs text-red-500 font-medium",children:[h," errors"]}),l.jsxs("span",{className:"text-xs text-gray-400 ml-1",children:["(",p,"%)"]})]}):f>0?l.jsx("span",{className:"text-xs text-green-600 font-medium",children:"No errors"}):l.jsx("span",{className:"text-xs text-gray-400",children:"No data"})})]}),l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-sm text-gray-500",children:"Active Sessions"}),l.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-50 flex items-center justify-center",children:l.jsx(ta,{className:"w-4 h-4 text-blue-600"})})]}),l.jsx("div",{className:"text-2xl font-bold text-gray-900",children:t.activeSessions}),l.jsx("div",{className:"flex items-center gap-1 mt-1",children:l.jsxs("span",{className:"text-xs text-gray-500",children:[t.wsConnections," WebSocket connections"]})})]})]})}var eee=["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 b1(e){if(typeof e!="string")return!1;var t=eee;return t.includes(e)}var tee=["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"],nee=new Set(tee);function iD(e){return typeof e!="string"?!1:nee.has(e)}function aD(e){return typeof e=="string"&&e.startsWith("data-")}function di(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(iD(n)||aD(n))&&(t[n]=e[n]);return t}function $m(e){if(e==null)return null;if(m.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return di(t)}return typeof e=="object"&&!Array.isArray(e)?di(e):null}function kr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(iD(n)||aD(n)||b1(n))&&(t[n]=e[n]);return t}function ree(e){return e==null?null:m.isValidElement(e)?kr(e.props):typeof e=="object"&&!Array.isArray(e)?kr(e):null}var iee=["children","width","height","viewBox","className","style","title","desc"];function sv(){return sv=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},sv.apply(null,arguments)}function aee(e,t){if(e==null)return{};var n,r,i=see(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 see(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 w1=m.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:s,style:o,title:c,desc:u}=e,d=aee(e,iee),f=a||{width:r,height:i,x:0,y:0},h=ot("recharts-surface",s);return m.createElement("svg",sv({},kr(d),{className:h,width:r,height:i,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),m.createElement("title",null,c),m.createElement("desc",null,u),n)}),oee=["children","className"];function ov(){return ov=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},ov.apply(null,arguments)}function lee(e,t){if(e==null)return{};var n,r,i=cee(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 cee(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 Di=m.forwardRef((e,t)=>{var{children:n,className:r}=e,i=lee(e,oee),a=ot("recharts-layer",r);return m.createElement("g",ov({className:a},kr(i),{ref:t}),n)}),sD=m.createContext(null),uee=()=>m.useContext(sD);function gt(e){return function(){return e}}const oD=Math.cos,up=Math.sin,pi=Math.sqrt,dp=Math.PI,Bm=2*dp,lv=Math.PI,cv=2*lv,Rs=1e-6,dee=cv-Rs;function lD(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function fee(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return lD;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 hee{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?lD:fee(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,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}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 s=this._x1,o=this._y1,c=r-t,u=i-n,d=s-t,f=o-n,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Rs)if(!(Math.abs(f*c-u*d)>Rs)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-s,g=i-o,y=c*c+u*u,x=p*p+g*g,b=Math.sqrt(y),v=Math.sqrt(h),w=a*Math.tan((lv-Math.acos((y+h-x)/(2*b*v)))/2),k=w/v,S=w/b;Math.abs(k-1)>Rs&&this._append`L${t+k*d},${n+k*f}`,this._append`A${a},${a},0,0,${+(f*p>d*g)},${this._x1=t+S*c},${this._y1=n+S*u}`}}arc(t,n,r,i,a,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),c=r*Math.sin(i),u=t+o,d=n+c,f=1^s,h=s?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Rs||Math.abs(this._y1-d)>Rs)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%cv+cv),h>dee?this._append`A${r},${r},0,1,${f},${t-o},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:h>Rs&&this._append`A${r},${r},0,${+(h>=lv)},${f},${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 S1(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 hee(t)}function k1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function cD(e){this._context=e}cD.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 Um(e){return new cD(e)}function uD(e){return e[0]}function dD(e){return e[1]}function fD(e,t){var n=gt(!0),r=null,i=Um,a=null,s=S1(o);e=typeof e=="function"?e:e===void 0?uD:gt(e),t=typeof t=="function"?t:t===void 0?dD:gt(t);function o(c){var u,d=(c=k1(c)).length,f,h=!1,p;for(r==null&&(a=i(p=s())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,u,c),+t(f,u,c));if(p)return a=null,p+""||null}return o.x=function(c){return arguments.length?(e=typeof c=="function"?c:gt(+c),o):e},o.y=function(c){return arguments.length?(t=typeof c=="function"?c:gt(+c),o):t},o.defined=function(c){return arguments.length?(n=typeof c=="function"?c:gt(!!c),o):n},o.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),o):i},o.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),o):r},o}function Df(e,t,n){var r=null,i=gt(!0),a=null,s=Um,o=null,c=S1(u);e=typeof e=="function"?e:e===void 0?uD:gt(+e),t=typeof t=="function"?t:gt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?dD:gt(+n);function u(f){var h,p,g,y=(f=k1(f)).length,x,b=!1,v,w=new Array(y),k=new Array(y);for(a==null&&(o=s(v=c())),h=0;h<=y;++h){if(!(h<y&&i(x=f[h],h,f))===b)if(b=!b)p=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),g=h-1;g>=p;--g)o.point(w[g],k[g]);o.lineEnd(),o.areaEnd()}b&&(w[h]=+e(x,h,f),k[h]=+t(x,h,f),o.point(r?+r(x,h,f):w[h],n?+n(x,h,f):k[h]))}if(v)return o=null,v+""||null}function d(){return fD().defined(i).curve(s).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:gt(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:gt(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:gt(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:gt(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:gt(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:gt(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:gt(!!f),u):i},u.curve=function(f){return arguments.length?(s=f,a!=null&&(o=s(a)),u):s},u.context=function(f){return arguments.length?(f==null?a=o=null:o=s(a=f),u):a},u}class hD{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 pee(e){return new hD(e,!0)}function mee(e){return new hD(e,!1)}const j1={draw(e,t){const n=pi(t/dp);e.moveTo(n,0),e.arc(0,0,n,0,Bm)}},gee={draw(e,t){const n=pi(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()}},pD=pi(1/3),yee=pD*2,xee={draw(e,t){const n=pi(t/yee),r=n*pD;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},vee={draw(e,t){const n=pi(t),r=-n/2;e.rect(r,r,n,n)}},bee=.8908130915292852,mD=up(dp/10)/up(7*dp/10),wee=up(Bm/10)*mD,See=-oD(Bm/10)*mD,kee={draw(e,t){const n=pi(t*bee),r=wee*n,i=See*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const s=Bm*a/5,o=oD(s),c=up(s);e.lineTo(c*n,-o*n),e.lineTo(o*r-c*i,c*r+o*i)}e.closePath()}},ey=pi(3),jee={draw(e,t){const n=-pi(t/(ey*3));e.moveTo(0,n*2),e.lineTo(-ey*n,-n),e.lineTo(ey*n,-n),e.closePath()}},Tr=-.5,Or=pi(3)/2,uv=1/pi(12),Nee=(uv/2+1)*3,Cee={draw(e,t){const n=pi(t/Nee),r=n/2,i=n*uv,a=r,s=n*uv+n,o=-a,c=s;e.moveTo(r,i),e.lineTo(a,s),e.lineTo(o,c),e.lineTo(Tr*r-Or*i,Or*r+Tr*i),e.lineTo(Tr*a-Or*s,Or*a+Tr*s),e.lineTo(Tr*o-Or*c,Or*o+Tr*c),e.lineTo(Tr*r+Or*i,Tr*i-Or*r),e.lineTo(Tr*a+Or*s,Tr*s-Or*a),e.lineTo(Tr*o+Or*c,Tr*c-Or*o),e.closePath()}};function Pee(e,t){let n=null,r=S1(i);e=typeof e=="function"?e:gt(e||j1),t=typeof t=="function"?t:gt(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:gt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:gt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function fp(){}function hp(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 gD(e){this._context=e}gD.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:hp(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:hp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Eee(e){return new gD(e)}function yD(e){this._context=e}yD.prototype={areaStart:fp,areaEnd:fp,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:hp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Aee(e){return new yD(e)}function xD(e){this._context=e}xD.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:hp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Tee(e){return new xD(e)}function vD(e){this._context=e}vD.prototype={areaStart:fp,areaEnd:fp,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 Oee(e){return new vD(e)}function MC(e){return e<0?-1:1}function DC(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),o=(a*i+s*r)/(r+i);return(MC(a)+MC(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function IC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ty(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,o=(a-r)/3;e._context.bezierCurveTo(r+o,i+o*t,a-o,s-o*n,a,s)}function pp(e){this._context=e}pp.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:ty(this,this._t0,IC(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,ty(this,IC(this,n=DC(this,e,t)),n);break;default:ty(this,this._t0,n=DC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function bD(e){this._context=new wD(e)}(bD.prototype=Object.create(pp.prototype)).point=function(e,t){pp.prototype.point.call(this,t,e)};function wD(e){this._context=e}wD.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 _ee(e){return new pp(e)}function Mee(e){return new bD(e)}function SD(e){this._context=e}SD.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=LC(e),i=LC(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(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 LC(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[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 Dee(e){return new SD(e)}function Vm(e,t){this._context=e,this._t=t}Vm.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 Iee(e){return new Vm(e,.5)}function Lee(e){return new Vm(e,0)}function Ree(e){return new Vm(e,1)}function yo(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,o=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<o;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function dv(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Fee(e,t){return e[t]}function zee(e){const t=[];return t.key=e,t}function $ee(){var e=gt([]),t=dv,n=yo,r=Fee;function i(a){var s=Array.from(e.apply(this,arguments),zee),o,c=s.length,u=-1,d;for(const f of a)for(o=0,++u;o<c;++o)(s[o][u]=[0,+r(f,s[o].key,u,a)]).data=f;for(o=0,d=k1(t(s));o<c;++o)s[d[o]].index=o;return n(s,d),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:gt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:gt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?dv:typeof a=="function"?a:gt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??yo,i):n},i}function Bee(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,s;i<a;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}yo(e,t)}}function Uee(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var s=0,o=0;s<i;++s)o+=e[s][n][1]||0;r[n][1]+=r[n][0]=-o/2}yo(e,t)}}function Vee(e,t){if(!(!((s=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,s;r<a;++r){for(var o=0,c=0,u=0;o<s;++o){for(var d=e[t[o]],f=d[r][1]||0,h=d[r-1][1]||0,p=(f-h)/2,g=0;g<o;++g){var y=e[t[g]],x=y[r][1]||0,b=y[r-1][1]||0;p+=x-b}c+=f,u+=p*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,yo(e,t)}}var Wm={},kD={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(kD);var N1={};(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})(N1);var Hm={};(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})(Hm);var Km={},jD={};(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})(jD);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jD,n=Hm;function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],s=i.length;if(s===0)return a;let o=0,c="",u="",d=!1;for(i.charCodeAt(0)===46&&(a.push(""),o++);o<s;){const f=i[o];u?f==="\\"&&o+1<s?(o++,c+=i[o]):f===u?u="":c+=f:d?f==='"'||f==="'"?u=f:f==="]"?(d=!1,a.push(c),c=""):c+=f:f==="["?(d=!0,c&&(a.push(c),c="")):f==="."?c&&(a.push(c),c=""):c+=f,o++}return c&&a.push(c),a}e.toPath=r})(Km);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kD,n=N1,r=Hm,i=Km;function a(o,c,u){if(o==null)return u;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return u;const d=o[c];return d===void 0?n.isDeepKey(c)?a(o,i.toPath(c),u):u:d}case"number":case"symbol":{typeof c=="number"&&(c=r.toKey(c));const d=o[c];return d===void 0?u:d}default:{if(Array.isArray(c))return s(o,c,u);if(Object.is(c==null?void 0:c.valueOf(),-0)?c="-0":c=String(c),t.isUnsafeProperty(c))return u;const d=o[c];return d===void 0?u:d}}}function s(o,c,u){if(c.length===0)return u;let d=o;for(let f=0;f<c.length;f++){if(d==null||t.isUnsafeProperty(c[f]))return u;d=d[c[f]]}return d===void 0?u:d}e.get=a})(Wm);var Wee=Wm.get;const Gm=hi(Wee);var Hee=4;function Ga(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hee,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function yn(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,s)=>{var o=n[s-1];return typeof o=="string"?i+o+a:o!==void 0?i+Ga(o)+a:i+a},"")}var zr=e=>e===0?0:e>0?1:-1,Ii=e=>typeof e=="number"&&e!=+e,xo=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Pe=e=>(typeof e=="number"||e instanceof Number)&&!Ii(e),Li=e=>Pe(e)||typeof e=="string",Kee=0,Qu=e=>{var t=++Kee;return"".concat(e||"").concat(t)},ds=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(!Pe(t)&&typeof t!="string")return r;var a;if(xo(t)){if(n==null)return r;var s=t.indexOf("%");a=n*parseFloat(t.slice(0,s))/100}else a=+t;return Ii(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},ND=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 ki(e,t,n){return Pe(e)&&Pe(t)?Ga(e+n*(t-e)):t}function CD(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Gm(r,t))===n)}var kn=e=>e===null||typeof e>"u",Md=e=>kn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function tr(e){return e!=null}function Ao(){}var Gee=["type","size","sizeType"];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 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 FC(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){qee(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 qee(e,t,n){return(t=Yee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yee(e){var t=Xee(e,"string");return typeof t=="symbol"?t:t+""}function Xee(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 Zee(e,t){if(e==null)return{};var n,r,i=Qee(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 Qee(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 PD={symbolCircle:j1,symbolCross:gee,symbolDiamond:xee,symbolSquare:vee,symbolStar:kee,symbolTriangle:jee,symbolWye:Cee},Jee=Math.PI/180,ete=e=>{var t="symbol".concat(Md(e));return PD[t]||j1},tte=(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*Jee;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}},nte=(e,t)=>{PD["symbol".concat(Md(e))]=t},ED=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Zee(e,Gee),a=FC(FC({},i),{},{type:t,size:n,sizeType:r}),s="circle";typeof t=="string"&&(s=t);var o=()=>{var h=ete(s),p=Pee().type(h).size(tte(n,r,s)),g=p();if(g!==null)return g},{className:c,cx:u,cy:d}=a,f=kr(a);return Pe(u)&&Pe(d)&&Pe(n)?m.createElement("path",fv({},f,{className:ot("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:o()})):null};ED.registerSymbol=nte;var AD=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,C1=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(m.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{b1(i)&&typeof n[i]=="function"&&(r[i]=a=>n[i](n,a))}),r},rte=(e,t,n)=>r=>(e(t,n,r),null),TD=(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];b1(i)&&typeof a=="function"&&(r||(r={}),r[i]=rte(a,t,n))}),r};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 ite(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){ate(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 ate(e,t,n){return(t=ste(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ste(e){var t=ote(e,"string");return typeof t=="symbol"?t:t+""}function ote(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 lr(e,t){var n=ite({},e),r=t,i=Object.keys(t),a=i.reduce((s,o)=>(s[o]===void 0&&r[o]!==void 0&&(s[o]=r[o]),s),n);return a}function mp(){return mp=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},mp.apply(null,arguments)}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 OD(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){lte(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 lte(e,t,n){return(t=cte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cte(e){var t=ute(e,"string");return typeof t=="symbol"?t:t+""}function ute(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 Dr=32,dte={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function fte(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function hte(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Dr/2,a=Dr/6,s=Dr/3,o=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return m.createElement("line",{strokeWidth:4,fill:"none",stroke:o,strokeDasharray:fte(t.payload),x1:0,y1:i,x2:Dr,y2:i,className:"recharts-legend-icon"});if(c==="line")return m.createElement("path",{strokeWidth:4,fill:"none",stroke:o,d:"M0,".concat(i,"h").concat(s,`
682
+ A`).concat(a,",").concat(a,",0,1,1,").concat(2*s,",").concat(i,`
683
+ H`).concat(Dr,"M").concat(2*s,",").concat(i,`
684
+ A`).concat(a,",").concat(a,",0,1,1,").concat(s,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return m.createElement("path",{stroke:"none",fill:o,d:"M0,".concat(Dr/8,"h").concat(Dr,"v").concat(Dr*3/4,"h").concat(-Dr,"z"),className:"recharts-legend-icon"});if(m.isValidElement(t.legendIcon)){var u=OD({},t);return delete u.legendIcon,m.cloneElement(t.legendIcon,u)}return m.createElement(ED,{fill:o,cx:i,cy:i,size:Dr,sizeType:"diameter",type:c})}function pte(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:s,labelStyle:o}=e,c={x:0,y:0,width:Dr,height:Dr},u={display:r==="horizontal"?"inline-block":"block",marginRight:10},d={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((f,h)=>{var p=f.formatter||i,g=ot({"recharts-legend-item":!0,["legend-item-".concat(h)]:!0,inactive:f.inactive});if(f.type==="none")return null;var y=typeof o=="object"?OD({},o):{};y.color=f.inactive?a:y.color||f.color;var x=p?p(f.value,f,h):f.value;return m.createElement("li",mp({className:g,style:u,key:"legend-item-".concat(h)},TD(e,f,h)),m.createElement(w1,{width:n,height:n,viewBox:c,style:d,"aria-label":"".concat(x," legend icon")},m.createElement(hte,{data:f,iconType:s,inactiveColor:a})),m.createElement("span",{className:"recharts-legend-item-text",style:y},x))})}var mte=e=>{var t=lr(e,dte),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return m.createElement("ul",{className:"recharts-default-legend",style:a},m.createElement(pte,mp({},t,{payload:n})))},_D={},MD={};(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 s=n[a],o=r(s,a,n);i.has(o)||i.set(o,s)}return Array.from(i.values())}e.uniqBy=t})(MD);var DD={};(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})(DD);var P1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(P1);var ID={},E1={},LD={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(LD);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LD;function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(E1);var RD={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(RD);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=E1,n=RD;function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(ID);var FD={},zD={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wm;function n(r){return function(i){return t.get(i,r)}}e.property=n})(zD);var $D={},A1={},BD={},T1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(T1);var O1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(O1);var _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})(_1);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=T1,n=O1,r=_1;function i(d,f,h){return typeof h!="function"?i(d,f,()=>{}):a(d,f,function p(g,y,x,b,v,w){const k=h(g,y,x,b,v,w);return k!==void 0?!!k:a(g,y,p,w)},new Map)}function a(d,f,h,p){if(f===d)return!0;switch(typeof f){case"object":return s(d,f,h,p);case"function":return Object.keys(f).length>0?a(d,{...f},h,p):r.isEqualsSameValueZero(d,f);default:return t.isObject(d)?typeof f=="string"?f==="":!0:r.isEqualsSameValueZero(d,f)}}function s(d,f,h,p){if(f==null)return!0;if(Array.isArray(f))return c(d,f,h,p);if(f instanceof Map)return o(d,f,h,p);if(f instanceof Set)return u(d,f,h,p);const g=Object.keys(f);if(d==null||n.isPrimitive(d))return g.length===0;if(g.length===0)return!0;if(p!=null&&p.has(f))return p.get(f)===d;p==null||p.set(f,d);try{for(let y=0;y<g.length;y++){const x=g[y];if(!n.isPrimitive(d)&&!(x in d)||f[x]===void 0&&d[x]!==void 0||f[x]===null&&d[x]!==null||!h(d[x],f[x],x,d,f,p))return!1}return!0}finally{p==null||p.delete(f)}}function o(d,f,h,p){if(f.size===0)return!0;if(!(d instanceof Map))return!1;for(const[g,y]of f.entries()){const x=d.get(g);if(h(x,y,g,d,f,p)===!1)return!1}return!0}function c(d,f,h,p){if(f.length===0)return!0;if(!Array.isArray(d))return!1;const g=new Set;for(let y=0;y<f.length;y++){const x=f[y];let b=!1;for(let v=0;v<d.length;v++){if(g.has(v))continue;const w=d[v];let k=!1;if(h(w,x,y,d,f,p)&&(k=!0),k){g.add(v),b=!0;break}}if(!b)return!1}return!0}function u(d,f,h,p){return f.size===0?!0:d instanceof Set?c([...d],[...f],h,p):!1}e.isMatchWith=i,e.isSetMatch=u})(BD);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=BD;function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(A1);var UD={},M1={},VD={};(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})(VD);var qm={};(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})(qm);var D1={};(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]",s="[object Symbol]",o="[object Date]",c="[object Map]",u="[object Set]",d="[object Array]",f="[object Function]",h="[object ArrayBuffer]",p="[object Object]",g="[object Error]",y="[object DataView]",x="[object Uint8Array]",b="[object Uint8ClampedArray]",v="[object Uint16Array]",w="[object Uint32Array]",k="[object BigUint64Array]",S="[object Int8Array]",j="[object Int16Array]",N="[object Int32Array]",P="[object BigInt64Array]",A="[object Float32Array]",E="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=h,e.arrayTag=d,e.bigInt64ArrayTag=P,e.bigUint64ArrayTag=k,e.booleanTag=i,e.dataViewTag=y,e.dateTag=o,e.errorTag=g,e.float32ArrayTag=A,e.float64ArrayTag=E,e.functionTag=f,e.int16ArrayTag=j,e.int32ArrayTag=N,e.int8ArrayTag=S,e.mapTag=c,e.numberTag=r,e.objectTag=p,e.regexpTag=t,e.setTag=u,e.stringTag=n,e.symbolTag=s,e.uint16ArrayTag=v,e.uint32ArrayTag=w,e.uint8ArrayTag=x,e.uint8ClampedArrayTag=b})(D1);var WD={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(WD);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VD,n=qm,r=D1,i=O1,a=WD;function s(d,f){return o(d,void 0,d,new Map,f)}function o(d,f,h,p=new Map,g=void 0){const y=g==null?void 0:g(d,f,h,p);if(y!==void 0)return y;if(i.isPrimitive(d))return d;if(p.has(d))return p.get(d);if(Array.isArray(d)){const x=new Array(d.length);p.set(d,x);for(let b=0;b<d.length;b++)x[b]=o(d[b],b,h,p,g);return Object.hasOwn(d,"index")&&(x.index=d.index),Object.hasOwn(d,"input")&&(x.input=d.input),x}if(d instanceof Date)return new Date(d.getTime());if(d instanceof RegExp){const x=new RegExp(d.source,d.flags);return x.lastIndex=d.lastIndex,x}if(d instanceof Map){const x=new Map;p.set(d,x);for(const[b,v]of d)x.set(b,o(v,b,h,p,g));return x}if(d instanceof Set){const x=new Set;p.set(d,x);for(const b of d)x.add(o(b,void 0,h,p,g));return x}if(typeof Buffer<"u"&&Buffer.isBuffer(d))return d.subarray();if(a.isTypedArray(d)){const x=new(Object.getPrototypeOf(d)).constructor(d.length);p.set(d,x);for(let b=0;b<d.length;b++)x[b]=o(d[b],b,h,p,g);return x}if(d instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&d instanceof SharedArrayBuffer)return d.slice(0);if(d instanceof DataView){const x=new DataView(d.buffer.slice(0),d.byteOffset,d.byteLength);return p.set(d,x),c(x,d,h,p,g),x}if(typeof File<"u"&&d instanceof File){const x=new File([d],d.name,{type:d.type});return p.set(d,x),c(x,d,h,p,g),x}if(typeof Blob<"u"&&d instanceof Blob){const x=new Blob([d],{type:d.type});return p.set(d,x),c(x,d,h,p,g),x}if(d instanceof Error){const x=structuredClone(d);return p.set(d,x),x.message=d.message,x.name=d.name,x.stack=d.stack,x.cause=d.cause,x.constructor=d.constructor,c(x,d,h,p,g),x}if(d instanceof Boolean){const x=new Boolean(d.valueOf());return p.set(d,x),c(x,d,h,p,g),x}if(d instanceof Number){const x=new Number(d.valueOf());return p.set(d,x),c(x,d,h,p,g),x}if(d instanceof String){const x=new String(d.valueOf());return p.set(d,x),c(x,d,h,p,g),x}if(typeof d=="object"&&u(d)){const x=Object.create(Object.getPrototypeOf(d));return p.set(d,x),c(x,d,h,p,g),x}return d}function c(d,f,h=d,p,g){const y=[...Object.keys(f),...t.getSymbols(f)];for(let x=0;x<y.length;x++){const b=y[x],v=Object.getOwnPropertyDescriptor(d,b);(v==null||v.writable)&&(d[b]=o(f[b],b,h,p,g))}}function u(d){switch(n.getTag(d)){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=s,e.cloneDeepWithImpl=o,e.copyProperties=c})(M1);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M1;function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(UD);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=A1,n=UD;function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})($D);var HD={},KD={},GD={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M1,n=qm,r=D1;function i(a,s){return t.cloneDeepWith(a,(o,c,u,d)=>{const f=s==null?void 0:s(o,c,u,d);if(f!==void 0)return f;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const h={};return d.set(a,h),t.copyProperties(h,a,u,d),h}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const h=new a.constructor(a==null?void 0:a.valueOf());return t.copyProperties(h,a),h}case r.argumentsTag:{const h={};return t.copyProperties(h,a),h.length=a.length,h[Symbol.iterator]=a[Symbol.iterator],h}default:return}}})}e.cloneDeepWith=i})(GD);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=GD;function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(KD);var qD={},I1={};(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})(I1);var YD={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qm;function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(YD);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=N1,n=I1,r=YD,i=Km;function a(s,o){let c;if(Array.isArray(o)?c=o:typeof o=="string"&&t.isDeepKey(o)&&(s==null?void 0:s[o])==null?c=i.toPath(o):c=[o],c.length===0)return!1;let u=s;for(let d=0;d<c.length;d++){const f=c[d];if((u==null||!Object.hasOwn(u,f))&&!((Array.isArray(u)||r.isArguments(u))&&n.isIndex(f)&&f<u.length))return!1;u=u[f]}return!0}e.has=a})(qD);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=A1,n=Hm,r=KD,i=Wm,a=qD;function s(o,c){switch(typeof o){case"object":{Object.is(o==null?void 0:o.valueOf(),-0)&&(o="-0");break}case"number":{o=n.toKey(o);break}}return c=r.cloneDeep(c),function(u){const d=i.get(u,o);return d===void 0?a.has(u,o):c===void 0?d===void 0:t.isMatch(d,c)}}e.matchesProperty=s})(HD);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=P1,n=zD,r=$D,i=HD;function a(s){if(s==null)return t.identity;switch(typeof s){case"function":return s;case"object":return Array.isArray(s)&&s.length===2?i.matchesProperty(s[0],s[1]):r.matches(s);case"string":case"symbol":case"number":return n.property(s)}}e.iteratee=a})(FD);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=MD,n=DD,r=P1,i=ID,a=FD;function s(o,c=r.identity){return i.isArrayLikeObject(o)?t.uniqBy(Array.from(o),n.ary(a.iteratee(c),1)):[]}e.uniqBy=s})(_D);var gte=_D.uniqBy;const BC=hi(gte);function XD(e,t,n){return t===!0?BC(e,n):typeof t=="function"?BC(e,t):e}var ZD={exports:{}},QD={},JD={exports:{}},eI={};/**
685
+ * @license React
686
+ * use-sync-external-store-shim.production.js
687
+ *
688
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
689
+ *
690
+ * This source code is licensed under the MIT license found in the
691
+ * LICENSE file in the root directory of this source tree.
692
+ */var Bl=m;function yte(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xte=typeof Object.is=="function"?Object.is:yte,vte=Bl.useState,bte=Bl.useEffect,wte=Bl.useLayoutEffect,Ste=Bl.useDebugValue;function kte(e,t){var n=t(),r=vte({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return wte(function(){i.value=n,i.getSnapshot=t,ny(i)&&a({inst:i})},[e,n,t]),bte(function(){return ny(i)&&a({inst:i}),e(function(){ny(i)&&a({inst:i})})},[e]),Ste(n),n}function ny(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xte(e,n)}catch{return!0}}function jte(e,t){return t()}var Nte=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?jte:kte;eI.useSyncExternalStore=Bl.useSyncExternalStore!==void 0?Bl.useSyncExternalStore:Nte;JD.exports=eI;var Cte=JD.exports;/**
693
+ * @license React
694
+ * use-sync-external-store-shim/with-selector.production.js
695
+ *
696
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
697
+ *
698
+ * This source code is licensed under the MIT license found in the
699
+ * LICENSE file in the root directory of this source tree.
700
+ */var Ym=m,Pte=Cte;function Ete(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ate=typeof Object.is=="function"?Object.is:Ete,Tte=Pte.useSyncExternalStore,Ote=Ym.useRef,_te=Ym.useEffect,Mte=Ym.useMemo,Dte=Ym.useDebugValue;QD.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=Ote(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=Mte(function(){function c(p){if(!u){if(u=!0,d=p,p=r(p),i!==void 0&&s.hasValue){var g=s.value;if(i(g,p))return f=g}return f=p}if(g=f,Ate(d,p))return g;var y=r(p);return i!==void 0&&i(g,y)?(d=p,g):(d=p,f=y)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,i]);var o=Tte(e,a[0],a[1]);return _te(function(){s.hasValue=!0,s.value=o},[o]),Dte(o),o};ZD.exports=QD;var Ite=ZD.exports,L1=m.createContext(null),Lte=e=>e,Bt=()=>{var e=m.useContext(L1);return e?e.store.dispatch:Lte},xh=()=>{},Rte=()=>xh,Fte=(e,t)=>e===t;function Oe(e){var t=m.useContext(L1),n=m.useMemo(()=>t?r=>{if(r!=null)return e(r)}:xh,[t,e]);return Ite.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Rte,t?t.store.getState:xh,t?t.store.getState:xh,n,Fte)}function zte(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function $te(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Bte(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 UC=e=>Array.isArray(e)?e:[e];function Ute(e){const t=Array.isArray(e[0])?e[0]:e;return Bte(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Vte(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Wte=class{constructor(e){this.value=e}deref(){return this.value}},Hte=typeof WeakRef<"u"?WeakRef:Wte,Kte=0,VC=1;function If(){return{s:Kte,v:void 0,o:null,p:null}}function tI(e,t={}){let n=If();const{resultEqualityCheck:r}=t;let i,a=0;function s(){var f;let o=n;const{length:c}=arguments;for(let h=0,p=c;h<p;h++){const g=arguments[h];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=o.o;y===null&&(o.o=y=new WeakMap);const x=y.get(g);x===void 0?(o=If(),y.set(g,o)):o=x}else{let y=o.p;y===null&&(o.p=y=new Map);const x=y.get(g);x===void 0?(o=If(),y.set(g,o)):o=x}}const u=o;let d;if(o.s===VC)d=o.v;else if(d=e.apply(null,arguments),a++,r){const h=((f=i==null?void 0:i.deref)==null?void 0:f.call(i))??i;h!=null&&r(h,d)&&(d=h,a!==0&&a--),i=typeof d=="object"&&d!==null||typeof d=="function"?new Hte(d):d}return u.s=VC,u.v=d,d}return s.clearCache=()=>{n=If(),s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}function Gte(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,s=0,o,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),zte(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const d={...n,...c},{memoize:f,memoizeOptions:h=[],argsMemoize:p=tI,argsMemoizeOptions:g=[]}=d,y=UC(h),x=UC(g),b=Ute(i),v=f(function(){return a++,u.apply(null,arguments)},...y),w=p(function(){s++;const S=Vte(b,arguments);return o=v.apply(null,S),o},...x);return Object.assign(w,{resultFunc:u,memoizedResultFunc:v,dependencies:b,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>o,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var q=Gte(tI),qte=Object.assign((e,t=q)=>{$te(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((s,o,c)=>(s[n[c]]=o,s),{}))},{withTypes:()=>qte}),nI={},rI={},iI={};(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 s=t(r),o=t(i);if(s===o&&s===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?o-s:s-o}return 0};e.compareValues=n})(iI);var aI={},R1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(R1);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=R1,n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,s){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))||s!=null&&Object.hasOwn(s,a)}e.isKey=i})(aI);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=iI,n=aI,r=Km;function i(a,s,o,c){if(a==null)return[];o=c?void 0:o,Array.isArray(a)||(a=Object.values(a)),Array.isArray(s)||(s=s==null?[null]:[s]),s.length===0&&(s=[null]),Array.isArray(o)||(o=o==null?[]:[o]),o=o.map(p=>String(p));const u=(p,g)=>{let y=p;for(let x=0;x<g.length&&y!=null;++x)y=y[g[x]];return y},d=(p,g)=>g==null||p==null?g:typeof p=="object"&&"key"in p?Object.hasOwn(g,p.key)?g[p.key]:u(g,p.path):typeof p=="function"?p(g):Array.isArray(p)?u(g,p):typeof g=="object"?g[p]:g,f=s.map(p=>(Array.isArray(p)&&p.length===1&&(p=p[0]),p==null||typeof p=="function"||Array.isArray(p)||n.isKey(p)?p:{key:p,path:r.toPath(p)}));return a.map(p=>({original:p,criteria:f.map(g=>d(g,p))})).slice().sort((p,g)=>{for(let y=0;y<f.length;y++){const x=t.compareValues(p.criteria[y],g.criteria[y],o[y]);if(x!==0)return x}return 0}).map(p=>p.original)}e.orderBy=i})(rI);var sI={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),s=(o,c)=>{for(let u=0;u<o.length;u++){const d=o[u];Array.isArray(d)&&c<a?s(d,c+1):i.push(d)}};return s(n,0),i}e.flatten=t})(sI);var F1={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=I1,n=E1,r=T1,i=_1;function a(s,o,c){return r.isObject(c)&&(typeof o=="number"&&n.isArrayLike(c)&&t.isIndex(o)&&o<c.length||typeof o=="string"&&o in c)?i.isEqualsSameValueZero(c[o],s):!1}e.isIterateeCall=a})(F1);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rI,n=sI,r=F1;function i(a,...s){const o=s.length;return o>1&&r.isIterateeCall(a,s[0],s[1])?s=[]:o>2&&r.isIterateeCall(s[0],s[1],s[2])&&(s=[s[0]]),t.orderBy(a,n.flatten(s),["asc"])}e.sortBy=i})(nI);var Yte=nI.sortBy;const Xm=hi(Yte);var oI=e=>e.legend.settings,Xte=e=>e.legend.size,Zte=e=>e.legend.payload,Qte=q([Zte,oI],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?Xm(r,n):r});function Jte(){return Oe(Qte)}var Lf=1;function lI(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=m.useState({height:0,left:0,top:0,width:0}),r=m.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),s={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(s.height-t.height)>Lf||Math.abs(s.left-t.left)>Lf||Math.abs(s.top-t.top)>Lf||Math.abs(s.width-t.width)>Lf)&&n({height:s.height,left:s.left,top:s.top,width:s.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function pn(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 ene=typeof Symbol=="function"&&Symbol.observable||"@@observable",WC=ene,ry=()=>Math.random().toString(36).substring(7).split("").join("."),tne={INIT:`@@redux/INIT${ry()}`,REPLACE:`@@redux/REPLACE${ry()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ry()}`},gp=tne;function z1(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 cI(e,t,n){if(typeof e!="function")throw new Error(pn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(pn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(pn(1));return n(cI)(e,t)}let r=e,i=t,a=new Map,s=a,o=0,c=!1;function u(){s===a&&(s=new Map,a.forEach((x,b)=>{s.set(b,x)}))}function d(){if(c)throw new Error(pn(3));return i}function f(x){if(typeof x!="function")throw new Error(pn(4));if(c)throw new Error(pn(5));let b=!0;u();const v=o++;return s.set(v,x),function(){if(b){if(c)throw new Error(pn(6));b=!1,u(),s.delete(v),a=null}}}function h(x){if(!z1(x))throw new Error(pn(7));if(typeof x.type>"u")throw new Error(pn(8));if(typeof x.type!="string")throw new Error(pn(17));if(c)throw new Error(pn(9));try{c=!0,i=r(i,x)}finally{c=!1}return(a=s).forEach(v=>{v()}),x}function p(x){if(typeof x!="function")throw new Error(pn(10));r=x,h({type:gp.REPLACE})}function g(){const x=f;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(pn(11));function v(){const k=b;k.next&&k.next(d())}return v(),{unsubscribe:x(v)}},[WC](){return this}}}return h({type:gp.INIT}),{dispatch:h,subscribe:f,getState:d,replaceReducer:p,[WC]:g}}function nne(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:gp.INIT})>"u")throw new Error(pn(12));if(typeof n(void 0,{type:gp.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(pn(13))})}function uI(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const s=t[a];typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let i;try{nne(n)}catch(a){i=a}return function(s={},o){if(i)throw i;let c=!1;const u={};for(let d=0;d<r.length;d++){const f=r[d],h=n[f],p=s[f],g=h(p,o);if(typeof g>"u")throw o&&o.type,new Error(pn(14));u[f]=g,c=c||g!==p}return c=c||r.length!==Object.keys(s).length,c?u:s}}function yp(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function rne(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(pn(15))};const s={getState:i.getState,dispatch:(c,...u)=>a(c,...u)},o=e.map(c=>c(s));return a=yp(...o)(i.dispatch),{...i,dispatch:a}}}function dI(e){return z1(e)&&"type"in e&&typeof e.type=="string"}var fI=Symbol.for("immer-nothing"),HC=Symbol.for("immer-draftable"),Kn=Symbol.for("immer-state");function ti(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var gr=Object,Ul=gr.getPrototypeOf,xp="constructor",Zm="prototype",hv="configurable",vp="enumerable",vh="writable",Ju="value",fa=e=>!!e&&!!e[Kn];function fi(e){var t;return e?hI(e)||Jm(e)||!!e[HC]||!!((t=e[xp])!=null&&t[HC])||eg(e)||tg(e):!1}var ine=gr[Zm][xp].toString(),KC=new WeakMap;function hI(e){if(!e||!$1(e))return!1;const t=Ul(e);if(t===null||t===gr[Zm])return!0;const n=gr.hasOwnProperty.call(t,xp)&&t[xp];if(n===Object)return!0;if(!Go(n))return!1;let r=KC.get(n);return r===void 0&&(r=Function.toString.call(n),KC.set(n,r)),r===ine}function Qm(e,t,n=!0){Dd(e)===0?(n?Reflect.ownKeys(e):gr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Dd(e){const t=e[Kn];return t?t.type_:Jm(e)?1:eg(e)?2:tg(e)?3:0}var GC=(e,t,n=Dd(e))=>n===2?e.has(t):gr[Zm].hasOwnProperty.call(e,t),pv=(e,t,n=Dd(e))=>n===2?e.get(t):e[t],bp=(e,t,n,r=Dd(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function ane(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Jm=Array.isArray,eg=e=>e instanceof Map,tg=e=>e instanceof Set,$1=e=>typeof e=="object",Go=e=>typeof e=="function",iy=e=>typeof e=="boolean";function sne(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Ki=e=>e.copy_||e.base_,B1=e=>e.modified_?e.copy_:e.base_;function mv(e,t){if(eg(e))return new Map(e);if(tg(e))return new Set(e);if(Jm(e))return Array[Zm].slice.call(e);const n=hI(e);if(t===!0||t==="class_only"&&!n){const r=gr.getOwnPropertyDescriptors(e);delete r[Kn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const s=i[a],o=r[s];o[vh]===!1&&(o[vh]=!0,o[hv]=!0),(o.get||o.set)&&(r[s]={[hv]:!0,[vh]:!0,[vp]:o[vp],[Ju]:e[s]})}return gr.create(Ul(e),r)}else{const r=Ul(e);if(r!==null&&n)return{...e};const i=gr.create(r);return gr.assign(i,e)}}function U1(e,t=!1){return ng(e)||fa(e)||!fi(e)||(Dd(e)>1&&gr.defineProperties(e,{set:Rf,add:Rf,clear:Rf,delete:Rf}),gr.freeze(e),t&&Qm(e,(n,r)=>{U1(r,!0)},!1)),e}function one(){ti(2)}var Rf={[Ju]:one};function ng(e){return e===null||!$1(e)?!0:gr.isFrozen(e)}var wp="MapSet",gv="Patches",qC="ArrayMethods",pI={};function vo(e){const t=pI[e];return t||ti(0,e),t}var YC=e=>!!pI[e],ed,mI=()=>ed,lne=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:YC(wp)?vo(wp):void 0,arrayMethodsPlugin_:YC(qC)?vo(qC):void 0});function XC(e,t){t&&(e.patchPlugin_=vo(gv),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function yv(e){xv(e),e.drafts_.forEach(cne),e.drafts_=null}function xv(e){e===ed&&(ed=e.parent_)}var ZC=e=>ed=lne(ed,e);function cne(e){const t=e[Kn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function QC(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Kn].modified_&&(yv(t),ti(4)),fi(e)&&(e=JC(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Kn].base_,e,t)}else e=JC(t,n);return une(t,e,!0),yv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fI?e:void 0}function JC(e,t){if(ng(t))return t;const n=t[Kn];if(!n)return Sp(t,e.handledSet_,e);if(!rg(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);xI(n,e)}return n.copy_}function une(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&U1(t,n)}function gI(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var rg=(e,t)=>e.scope_===t,dne=[];function yI(e,t,n,r){const i=Ki(e),a=e.type_;if(r!==void 0&&pv(i,r,a)===t){bp(i,r,n,a);return}if(!e.draftLocations_){const o=e.draftLocations_=new Map;Qm(i,(c,u)=>{if(fa(u)){const d=o.get(u)||[];d.push(c),o.set(u,d)}})}const s=e.draftLocations_.get(t)??dne;for(const o of s)bp(i,o,n,a)}function fne(e,t,n){e.callbacks_.push(function(i){var o;const a=t;if(!a||!rg(a,i))return;(o=i.mapSetPlugin_)==null||o.fixSetContents(a);const s=B1(a);yI(e,a.draft_??a,s,n),xI(a,i)})}function xI(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)}gI(e)}}function hne(e,t,n){const{scope_:r}=e;if(fa(n)){const i=n[Kn];rg(i,r)&&i.callbacks_.push(function(){bh(e);const s=B1(i);yI(e,n,s,t)})}else fi(n)&&e.callbacks_.push(function(){const a=Ki(e);e.type_===3?a.has(n)&&Sp(n,r.handledSet_,r):pv(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Sp(pv(e.copy_,t,e.type_),r.handledSet_,r)})}function Sp(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||fa(e)||t.has(e)||!fi(e)||ng(e)||(t.add(e),Qm(e,(r,i)=>{if(fa(i)){const a=i[Kn];if(rg(a,n)){const s=B1(a);bp(e,r,s,e.type_),gI(a)}}else fi(i)&&Sp(i,t,n)})),e}function pne(e,t){const n=Jm(e),r={type_:n?1:0,scope_:t?t.scope_:mI(),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=kp;n&&(i=[r],a=td);const{revoke:s,proxy:o}=Proxy.revocable(i,a);return r.draft_=o,r.revoke_=s,[o,r]}var kp={get(e,t){if(t===Kn)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=Ki(e);if(!GC(i,t,e.type_))return mne(e,i,t);const a=i[t];if(e.finalized_||!fi(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&sne(t))return a;if(a===ay(e.base_,t)){bh(e);const s=e.type_===1?+t:t,o=bv(e.scope_,a,e,s);return e.copy_[s]=o}return a},has(e,t){return t in Ki(e)},ownKeys(e){return Reflect.ownKeys(Ki(e))},set(e,t,n){const r=vI(Ki(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=ay(Ki(e),t),a=i==null?void 0:i[Kn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(ane(n,i)&&(n!==void 0||GC(e.base_,t,e.type_)))return!0;bh(e),vv(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),hne(e,t,n)),!0},deleteProperty(e,t){return bh(e),ay(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),vv(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ki(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[vh]:!0,[hv]:e.type_!==1||t!=="length",[vp]:r[vp],[Ju]:n[t]}},defineProperty(){ti(11)},getPrototypeOf(e){return Ul(e.base_)},setPrototypeOf(){ti(12)}},td={};for(let e in kp){let t=kp[e];td[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}td.deleteProperty=function(e,t){return td.set.call(this,e,t,void 0)};td.set=function(e,t,n){return kp.set.call(this,e[0],t,n,e[0])};function ay(e,t){const n=e[Kn];return(n?Ki(n):e)[t]}function mne(e,t,n){var i;const r=vI(t,n);return r?Ju in r?r[Ju]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function vI(e,t){if(!(t in e))return;let n=Ul(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ul(n)}}function vv(e){e.modified_||(e.modified_=!0,e.parent_&&vv(e.parent_))}function bh(e){e.copy_||(e.assigned_=new Map,e.copy_=mv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var gne=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Go(n)&&!Go(r)){const s=r;r=n;const o=this;return function(u=s,...d){return o.produce(u,f=>r.call(this,f,...d))}}Go(r)||ti(6),i!==void 0&&!Go(i)&&ti(7);let a;if(fi(n)){const s=ZC(this),o=bv(s,n,void 0);let c=!0;try{a=r(o),c=!1}finally{c?yv(s):xv(s)}return XC(s,i),QC(a,s)}else if(!n||!$1(n)){if(a=r(n),a===void 0&&(a=n),a===fI&&(a=void 0),this.autoFreeze_&&U1(a,!0),i){const s=[],o=[];vo(gv).generateReplacementPatches_(n,a,{patches_:s,inversePatches_:o}),i(s,o)}return a}else ti(1,n)},this.produceWithPatches=(n,r)=>{if(Go(n))return(o,...c)=>this.produceWithPatches(o,u=>n(u,...c));let i,a;return[this.produce(n,r,(o,c)=>{i=o,a=c}),i,a]},iy(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),iy(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),iy(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){fi(t)||ti(8),fa(t)&&(t=$r(t));const n=ZC(this),r=bv(n,t,void 0);return r[Kn].isManual_=!0,xv(n),r}finishDraft(t,n){const r=t&&t[Kn];(!r||!r.isManual_)&&ti(9);const{scope_:i}=r;return XC(i,n),QC(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=vo(gv).applyPatches_;return fa(t)?i(t,n):this.produce(t,a=>i(a,n))}};function bv(e,t,n,r){const[i,a]=eg(t)?vo(wp).proxyMap_(t,n):tg(t)?vo(wp).proxySet_(t,n):pne(t,n);return((n==null?void 0:n.scope_)??mI()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?fne(n,a,r):a.callbacks_.push(function(c){var d;(d=c.mapSetPlugin_)==null||d.fixSetContents(a);const{patchPlugin_:u}=c;a.modified_&&u&&u.generatePatches_(a,[],c)}),i}function $r(e){return fa(e)||ti(10,e),bI(e)}function bI(e){if(!fi(e)||ng(e))return e;const t=e[Kn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=mv(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=mv(e,!0);return Qm(n,(i,a)=>{bp(n,i,bI(a))},r),t&&(t.finalized_=!1),n}var yne=new gne,wI=yne.produce;function SI(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var xne=SI(),vne=SI,bne=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?yp:yp.apply(null,arguments)};function jr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(br(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=>dI(r)&&r.type===e,n}var kI=class eu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,eu.prototype)}static get[Symbol.species](){return eu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new eu(...t[0].concat(this)):new eu(...t.concat(this))}};function eP(e){return fi(e)?wI(e,()=>{}):e}function Ff(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function wne(e){return typeof e=="boolean"}var Sne=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let s=new kI;return n&&(wne(n)?s.push(xne):s.push(vne(n.extraArgument))),s},jI="RTK_autoBatch",wt=()=>e=>({payload:e,meta:{[jI]:!0}}),tP=e=>t=>{setTimeout(t,e)},NI=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,s=!1;const o=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:tP(10):e.type==="callback"?e.queueNotification:tP(e.timeout),u=()=>{s=!1,a&&(a=!1,o.forEach(d=>d()))};return Object.assign({},r,{subscribe(d){const f=()=>i&&d(),h=r.subscribe(f);return o.add(d),()=>{h(),o.delete(d)}},dispatch(d){var f;try{return i=!((f=d==null?void 0:d.meta)!=null&&f[jI]),a=!i,a&&(s||(s=!0,c(u))),r.dispatch(d)}finally{i=!0}}})},kne=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new kI(e);return r&&i.push(NI(typeof r=="object"?r:void 0)),i};function jne(e){const t=Sne(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{};let o;if(typeof n=="function")o=n;else if(z1(n))o=uI(n);else throw new Error(br(1));let c;typeof r=="function"?c=r(t):c=t();let u=yp;i&&(u=bne({trace:!1,...typeof i=="object"&&i}));const d=rne(...c),f=kne(d);let h=typeof s=="function"?s(f):f();const p=u(...h);return cI(o,a,p)}function CI(e){const t={},n=[];let r;const i={addCase(a,s){const o=typeof a=="string"?a:a.type;if(!o)throw new Error(br(28));if(o in t)throw new Error(br(29));return t[o]=s,i},addAsyncThunk(a,s){return s.pending&&(t[a.pending.type]=s.pending),s.rejected&&(t[a.rejected.type]=s.rejected),s.fulfilled&&(t[a.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:a.settled,reducer:s.settled}),i},addMatcher(a,s){return n.push({matcher:a,reducer:s}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function Nne(e){return typeof e=="function"}function Cne(e,t){let[n,r,i]=CI(t),a;if(Nne(e))a=()=>eP(e());else{const o=eP(e);a=()=>o}function s(o=a(),c){let u=[n[c.type],...r.filter(({matcher:d})=>d(c)).map(({reducer:d})=>d)];return u.filter(d=>!!d).length===0&&(u=[i]),u.reduce((d,f)=>{if(f)if(fa(d)){const p=f(d,c);return p===void 0?d:p}else{if(fi(d))return wI(d,h=>f(h,c));{const h=f(d,c);if(h===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return d},o)}return s.getInitialState=a,s}var Pne="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ene=(e=21)=>{let t="",n=e;for(;n--;)t+=Pne[Math.random()*64|0];return t},Ane=Symbol.for("rtk-slice-createasyncthunk");function Tne(e,t){return`${e}/${t}`}function One({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[Ane];return function(i){const{name:a,reducerPath:s=a}=i;if(!a)throw new Error(br(11));const o=(typeof i.reducers=="function"?i.reducers(Mne()):i.reducers)||{},c=Object.keys(o),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(k,S){const j=typeof k=="string"?k:k.type;if(!j)throw new Error(br(12));if(j in u.sliceCaseReducersByType)throw new Error(br(13));return u.sliceCaseReducersByType[j]=S,d},addMatcher(k,S){return u.sliceMatchers.push({matcher:k,reducer:S}),d},exposeAction(k,S){return u.actionCreators[k]=S,d},exposeCaseReducer(k,S){return u.sliceCaseReducersByName[k]=S,d}};c.forEach(k=>{const S=o[k],j={reducerName:k,type:Tne(a,k),createNotation:typeof i.reducers=="function"};Ine(S)?Rne(j,S,d,t):Dne(j,S,d)});function f(){const[k={},S=[],j=void 0]=typeof i.extraReducers=="function"?CI(i.extraReducers):[i.extraReducers],N={...k,...u.sliceCaseReducersByType};return Cne(i.initialState,P=>{for(let A in N)P.addCase(A,N[A]);for(let A of u.sliceMatchers)P.addMatcher(A.matcher,A.reducer);for(let A of S)P.addMatcher(A.matcher,A.reducer);j&&P.addDefaultCase(j)})}const h=k=>k,p=new Map,g=new WeakMap;let y;function x(k,S){return y||(y=f()),y(k,S)}function b(){return y||(y=f()),y.getInitialState()}function v(k,S=!1){function j(P){let A=P[k];return typeof A>"u"&&S&&(A=Ff(g,j,b)),A}function N(P=h){const A=Ff(p,S,()=>new WeakMap);return Ff(A,P,()=>{const E={};for(const[O,C]of Object.entries(i.selectors??{}))E[O]=_ne(C,P,()=>Ff(g,P,b),S);return E})}return{reducerPath:k,getSelectors:N,get selectors(){return N(j)},selectSlice:j}}const w={name:a,reducer:x,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:b,...v(s),injectInto(k,{reducerPath:S,...j}={}){const N=S??s;return k.inject({reducerPath:N,reducer:x},j),{...w,...v(N,!0)}}};return w}}function _ne(e,t,n,r){function i(a,...s){let o=t(a);return typeof o>"u"&&r&&(o=n()),e(o,...s)}return i.unwrapped=e,i}var Rn=One();function Mne(){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 Dne({type:e,reducerName:t,createNotation:n},r,i){let a,s;if("reducer"in r){if(n&&!Lne(r))throw new Error(br(17));a=r.reducer,s=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?jr(e,s):jr(e))}function Ine(e){return e._reducerDefinitionType==="asyncThunk"}function Lne(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Rne({type:e,reducerName:t},n,r,i){if(!i)throw new Error(br(18));const{payloadCreator:a,fulfilled:s,pending:o,rejected:c,settled:u,options:d}=n,f=i(e,a,d);r.exposeAction(t,f),s&&r.addCase(f.fulfilled,s),o&&r.addCase(f.pending,o),c&&r.addCase(f.rejected,c),u&&r.addMatcher(f.settled,u),r.exposeCaseReducer(t,{fulfilled:s||zf,pending:o||zf,rejected:c||zf,settled:u||zf})}function zf(){}var Fne="task",PI="listener",EI="completed",V1="cancelled",zne=`task-${V1}`,$ne=`task-${EI}`,wv=`${PI}-${V1}`,Bne=`${PI}-${EI}`,ig=class{constructor(e){Rg(this,"name","TaskAbortError");Rg(this,"message");this.code=e,this.message=`${Fne} ${V1} (reason: ${e})`}},W1=(e,t)=>{if(typeof e!="function")throw new TypeError(br(32))},jp=()=>{},AI=(e,t=jp)=>(e.catch(t),e),TI=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ro=e=>{if(e.aborted)throw new ig(e.reason)};function OI(e,t){let n=jp;return new Promise((r,i)=>{const a=()=>i(new ig(e.reason));if(e.aborted){a();return}n=TI(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=jp})}var Une=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof ig?"cancelled":"rejected",error:n}}finally{t==null||t()}},Np=e=>t=>AI(OI(e,t).then(n=>(ro(e),n))),_I=e=>{const t=Np(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Sl}=Object,nP={},ag="listenerMiddleware",Vne=(e,t)=>{const n=r=>TI(e,()=>r.abort(e.reason));return(r,i)=>{W1(r);const a=new AbortController;n(a);const s=Une(async()=>{ro(e),ro(a.signal);const o=await r({pause:Np(a.signal),delay:_I(a.signal),signal:a.signal});return ro(a.signal),o},()=>a.abort($ne));return i!=null&&i.autoJoin&&t.push(s.catch(jp)),{result:Np(e)(s),cancel(){a.abort(zne)}}}},Wne=(e,t)=>{const n=async(r,i)=>{ro(t);let a=()=>{};const o=[new Promise((c,u)=>{let d=e({predicate:r,effect:(f,h)=>{h.unsubscribe(),c([f,h.getState(),h.getOriginalState()])}});a=()=>{d(),u()}})];i!=null&&o.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await OI(t,Promise.race(o));return ro(t),c}finally{a()}};return(r,i)=>AI(n(r,i))},MI=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=jr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(br(21));return W1(a),{predicate:i,type:t,effect:a}},DI=Sl(e=>{const{type:t,predicate:n,effect:r}=MI(e);return{id:Ene(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(br(22))}}},{withTypes:()=>DI}),rP=(e,t)=>{const{type:n,effect:r,predicate:i}=MI(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},Sv=e=>{e.pending.forEach(t=>{t.abort(wv)})},Hne=(e,t)=>()=>{for(const n of t.keys())Sv(n);e.clear()},iP=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},II=Sl(jr(`${ag}/add`),{withTypes:()=>II}),Kne=jr(`${ag}/removeAll`),LI=Sl(jr(`${ag}/remove`),{withTypes:()=>LI}),Gne=(...e)=>{console.error(`${ag}/error`,...e)},Id=(e={})=>{const t=new Map,n=new Map,r=p=>{const g=n.get(p)??0;n.set(p,g+1)},i=p=>{const g=n.get(p)??1;g===1?n.delete(p):n.set(p,g-1)},{extra:a,onError:s=Gne}=e;W1(s);const o=p=>(p.unsubscribe=()=>t.delete(p.id),t.set(p.id,p),g=>{p.unsubscribe(),g!=null&&g.cancelActive&&Sv(p)}),c=p=>{const g=rP(t,p)??DI(p);return o(g)};Sl(c,{withTypes:()=>c});const u=p=>{const g=rP(t,p);return g&&(g.unsubscribe(),p.cancelActive&&Sv(g)),!!g};Sl(u,{withTypes:()=>u});const d=async(p,g,y,x)=>{const b=new AbortController,v=Wne(c,b.signal),w=[];try{p.pending.add(b),r(p),await Promise.resolve(p.effect(g,Sl({},y,{getOriginalState:x,condition:(k,S)=>v(k,S).then(Boolean),take:v,delay:_I(b.signal),pause:Np(b.signal),extra:a,signal:b.signal,fork:Vne(b.signal,w),unsubscribe:p.unsubscribe,subscribe:()=>{t.set(p.id,p)},cancelActiveListeners:()=>{p.pending.forEach((k,S,j)=>{k!==b&&(k.abort(wv),j.delete(k))})},cancel:()=>{b.abort(wv),p.pending.delete(b)},throwIfCancelled:()=>{ro(b.signal)}})))}catch(k){k instanceof ig||iP(s,k,{raisedBy:"effect"})}finally{await Promise.all(w),b.abort(Bne),i(p),p.pending.delete(b)}},f=Hne(t,n);return{middleware:p=>g=>y=>{if(!dI(y))return g(y);if(II.match(y))return c(y.payload);if(Kne.match(y)){f();return}if(LI.match(y))return u(y.payload);let x=p.getState();const b=()=>{if(x===nP)throw new Error(br(23));return x};let v;try{if(v=g(y),t.size>0){const w=p.getState(),k=Array.from(t.values());for(const S of k){let j=!1;try{j=S.predicate(y,w,x)}catch(N){j=!1,iP(s,N,{raisedBy:"predicate"})}j&&d(S,y,p,b)}}}finally{x=nP}return v},startListening:c,stopListening:u,clearListeners:f}};function br(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 qne={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},RI=Rn({name:"chartLayout",initialState:qne,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:Yne,setLayout:Xne,setChartSize:Zne,setScale:Qne}=RI.actions,Jne=RI.reducer;function FI(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function qe(e){return Number.isFinite(e)}function Ri(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function aP(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 dl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aP(Object(n),!0).forEach(function(r){ere(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ere(e,t,n){return(t=tre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tre(e){var t=nre(e,"string");return typeof t=="symbol"?t:t+""}function nre(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 wn(e,t,n){return kn(e)||kn(t)?n:Li(t)?Gm(e,t,n):typeof t=="function"?t(e):n}var rre=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:s,layout:o}=t;if((o==="vertical"||o==="horizontal"&&s==="middle")&&a!=="center"&&Pe(e[a]))return dl(dl({},e),{},{[a]:e[a]+(r||0)});if((o==="horizontal"||o==="vertical"&&a==="center")&&s!=="middle"&&Pe(e[s]))return dl(dl({},e),{},{[s]:e[s]+(i||0)})}return e},Ui=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",zI=(e,t,n,r)=>{if(r)return e.map(o=>o.coordinate);var i,a,s=e.map(o=>(o.coordinate===t&&(i=!0),o.coordinate===n&&(a=!0),o.coordinate));return i||s.push(t),a||s.push(n),s},$I=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:s,realScaleType:o,isCategorical:c,categoricalDomain:u,tickCount:d,ticks:f,niceTicks:h,axisType:p}=e;if(!s)return null;var g=o==="scaleBand"&&s.bandwidth?s.bandwidth()/2:2,y=i==="category"&&s.bandwidth?s.bandwidth()/g:0;if(y=p==="angleAxis"&&a&&a.length>=2?zr(a[0]-a[1])*2*y:y,f||h){var x=(f||h||[]).map((b,v)=>{var w=r?r.indexOf(b):b,k=s.map(w);return qe(k)?{coordinate:k+y,value:b,offset:y,index:v}:null}).filter(tr);return x}return c&&u?u.map((b,v)=>{var w=s.map(b);return qe(w)?{coordinate:w+y,value:b,index:v,offset:y}:null}).filter(tr):s.ticks&&d!=null?s.ticks(d).map((b,v)=>{var w=s.map(b);return qe(w)?{coordinate:w+y,value:b,index:v,offset:y}:null}).filter(tr):s.domain().map((b,v)=>{var w=s.map(b);return qe(w)?{coordinate:w+y,value:r?r[b]:b,index:v,offset:y}:null}).filter(tr)},ire=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,s=0,o=0;o<n;++o){var c=e[o],u=c==null?void 0:c[i];if(u!=null){var d=u[1],f=u[0],h=Ii(d)?f:d;h>=0?(u[0]=a,a+=h,u[1]=a):(u[0]=s,s+=h,u[1]=s)}}}},are=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,s=0;s<n;++s){var o=e[s],c=o==null?void 0:o[i];if(c!=null){var u=Ii(c[1])?c[0]:c[1];u>=0?(c[0]=a,a+=u,c[1]=a):(c[0]=0,c[1]=0)}}}},sre={sign:ire,expand:Bee,none:yo,silhouette:Uee,wiggle:Vee,positive:are},ore=(e,t,n)=>{var r,i=(r=sre[n])!==null&&r!==void 0?r:yo,a=$ee().keys(t).value((o,c)=>Number(wn(o,c,0))).order(dv).offset(i),s=a(e);return s.forEach((o,c)=>{o.forEach((u,d)=>{var f=wn(e[d],t[c],0);Array.isArray(f)&&f.length===2&&Pe(f[0])&&Pe(f[1])&&(u[0]=f[0],u[1]=f[1])})}),s};function lre(e){return e==null?void 0:String(e)}function sP(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:s}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!kn(i[t.dataKey])){var o=CD(n,"value",i[t.dataKey]);if(o)return o.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=wn(i,kn(s)?t.dataKey:s),u=t.scale.map(c);return Pe(u)?u:null}var cre=e=>{var t=e.flat(2).filter(Pe);return[Math.min(...t),Math.max(...t)]},ure=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],dre=(e,t,n)=>{if(e!=null)return ure(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:s}=a,o=s.reduce((c,u)=>{var d=FI(u,t,n),f=cre(d);return!qe(f[0])||!qe(f[1])?c:[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]))},oP=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,lP=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Cp=(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=Xm(t,d=>d.coordinate),a=1/0,s=1,o=i.length;s<o;s++){var c=i[s],u=i[s-1];a=Math.min(((c==null?void 0:c.coordinate)||0)-((u==null?void 0:u.coordinate)||0),a)}return a===1/0?0:a}return n?void 0:0};function cP(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return dl(dl({},t),{},{dataKey:n,payload:r,value:i,name:a})}function BI(e,t){if(e)return String(e);if(typeof t=="string")return t}var fre=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},hre=(e,t)=>t==="centric"?e.angle:e.radius,ba=e=>e.layout.width,wa=e=>e.layout.height,pre=e=>e.layout.scale,UI=e=>e.layout.margin,sg=q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),og=q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),mre="data-recharts-item-index",gre="data-recharts-item-id",Ld=60;function uP(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 $f(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uP(Object(n),!0).forEach(function(r){yre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yre(e,t,n){return(t=xre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xre(e){var t=vre(e,"string");return typeof t=="symbol"?t:t+""}function vre(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 bre=e=>e.brush.height;function wre(e){var t=og(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Ld;return n+i}return n},0)}function Sre(e){var t=og(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Ld;return n+i}return n},0)}function kre(e){var t=sg(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function jre(e){var t=sg(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var jn=q([ba,wa,UI,bre,wre,Sre,kre,jre,oI,Xte],(e,t,n,r,i,a,s,o,c,u)=>{var d={left:(n.left||0)+i,right:(n.right||0)+a},f={top:(n.top||0)+s,bottom:(n.bottom||0)+o},h=$f($f({},f),d),p=h.bottom;h.bottom+=r,h=rre(h,c,u);var g=e-h.left-h.right,y=t-h.top-h.bottom;return $f($f({brushBottom:p},h),{},{width:Math.max(g,0),height:Math.max(y,0)})}),Nre=q(jn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),VI=q(ba,wa,(e,t)=>({x:0,y:0,width:e,height:t})),Cre=m.createContext(null),cr=()=>m.useContext(Cre)!=null,lg=e=>e.brush,cg=q([lg,jn,UI],(e,t,n)=>({height:e.height,x:Pe(e.x)?e.x:t.left,y:Pe(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Pe(e.width)?e.width:t.width})),WI={},HI={},KI={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let s,o=null;const c=a!=null&&a.includes("leading"),u=a==null||a.includes("trailing"),d=()=>{o!==null&&(n.apply(s,o),s=void 0,o=null)},f=()=>{u&&d(),y()};let h=null;const p=()=>{h!=null&&clearTimeout(h),h=setTimeout(()=>{h=null,f()},r)},g=()=>{h!==null&&(clearTimeout(h),h=null)},y=()=>{g(),s=void 0,o=null},x=()=>{d()},b=function(...v){if(i!=null&&i.aborted)return;s=this,o=v;const w=h==null;p(),c&&w&&d()};return b.schedule=p,b.cancel=y,b.flush=x,i==null||i.addEventListener("abort",y,{once:!0}),b}e.debounce=t})(KI);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KI;function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:s=!1,trailing:o=!0,maxWait:c}=a,u=Array(2);s&&(u[0]="leading"),o&&(u[1]="trailing");let d,f=null;const h=t.debounce(function(...y){d=r.apply(this,y),f=null},i,{edges:u}),p=function(...y){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(d=r.apply(this,y),f=Date.now(),h.cancel(),h.schedule(),d):(h.apply(this,y),d)},g=()=>(h.flush(),d);return p.cancel=h.cancel,p.flush=g,p}e.debounce=n})(HI);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=HI;function n(r,i=0,a={}){const{leading:s=!0,trailing:o=!0}=a;return t.debounce(r,i,{leading:s,maxWait:i,trailing:o})}e.throttle=n})(WI);var Pre=WI.throttle;const Ere=hi(Pre);var Pp=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 s=0;console.warn(n.replace(/%s/g,()=>i[s++]))}},Ni={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},GI=(e,t,n)=>{var{width:r=Ni.width,height:i=Ni.height,aspect:a,maxHeight:s}=n,o=xo(r)?e:Number(r),c=xo(i)?t:Number(i);return a&&a>0&&(o?c=o/a:c&&(o=c*a),s&&c!=null&&c>s&&(c=s)),{calculatedWidth:o,calculatedHeight:c}},Are={width:0,height:0,overflow:"visible"},Tre={width:0,overflowX:"visible"},Ore={height:0,overflowY:"visible"},_re={},Mre=e=>{var{width:t,height:n}=e,r=xo(t),i=xo(n);return r&&i?Are:r?Tre:i?Ore:_re};function Dre(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Ni.width,a=Ni.height):i===void 0?i=r&&r>0?void 0:Ni.width:a===void 0&&(a=r&&r>0?void 0:Ni.height),{width:i,height:a}}function kv(){return kv=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},kv.apply(null,arguments)}function dP(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 fP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dP(Object(n),!0).forEach(function(r){Ire(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ire(e,t,n){return(t=Lre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lre(e){var t=Rre(e,"string");return typeof t=="symbol"?t:t+""}function Rre(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 qI=m.createContext(Ni.initialDimension);function Fre(e){return Ri(e.width)&&Ri(e.height)}function YI(e){var{children:t,width:n,height:r}=e,i=m.useMemo(()=>({width:n,height:r}),[n,r]);return Fre(i)?m.createElement(qI.Provider,{value:i},t):null}var H1=()=>m.useContext(qI),zre=m.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Ni.initialDimension,width:i,height:a,minWidth:s=Ni.minWidth,minHeight:o,maxHeight:c,children:u,debounce:d=Ni.debounce,id:f,className:h,onResize:p,style:g={}}=e,y=m.useRef(null),x=m.useRef();x.current=p,m.useImperativeHandle(t,()=>y.current);var[b,v]=m.useState({containerWidth:r.width,containerHeight:r.height}),w=m.useCallback((P,A)=>{v(E=>{var O=Math.round(P),C=Math.round(A);return E.containerWidth===O&&E.containerHeight===C?E:{containerWidth:O,containerHeight:C}})},[]);m.useEffect(()=>{if(y.current==null||typeof ResizeObserver>"u")return Ao;var P=C=>{var M,I=C[0];if(I!=null){var{width:B,height:se}=I.contentRect;w(B,se),(M=x.current)===null||M===void 0||M.call(x,B,se)}};d>0&&(P=Ere(P,d,{trailing:!0,leading:!1}));var A=new ResizeObserver(P),{width:E,height:O}=y.current.getBoundingClientRect();return w(E,O),A.observe(y.current),()=>{A.disconnect()}},[w,d]);var{containerWidth:k,containerHeight:S}=b;Pp(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:j,calculatedHeight:N}=GI(k,S,{width:i,height:a,aspect:n,maxHeight:c});return Pp(j!=null&&j>0||N!=null&&N>0,`The width(%s) and height(%s) of chart should be greater than 0,
701
+ please check the style of container, or the props width(%s) and height(%s),
702
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
703
+ height and width.`,j,N,i,a,s,o,n),m.createElement("div",{id:f?"".concat(f):void 0,className:ot("recharts-responsive-container",h),style:fP(fP({},g),{},{width:i,height:a,minWidth:s,minHeight:o,maxHeight:c}),ref:y},m.createElement("div",{style:Mre({width:i,height:a})},m.createElement(YI,{width:j,height:N},u)))}),K1=m.forwardRef((e,t)=>{var n=H1();if(Ri(n.width)&&Ri(n.height))return e.children;var{width:r,height:i}=Dre({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:s}=GI(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Pe(a)&&Pe(s)?m.createElement(YI,{width:a,height:s},e.children):m.createElement(zre,kv({},e,{width:r,height:i,ref:t}))});function G1(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 ug=()=>{var e,t=cr(),n=Oe(Nre),r=Oe(cg),i=(e=Oe(lg))===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}},$re={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},XI=()=>{var e;return(e=Oe(jn))!==null&&e!==void 0?e:$re},q1=()=>Oe(ba),Y1=()=>Oe(wa),Bre=()=>Oe(e=>e.layout.margin),Tt=e=>e.layout.layoutType,ac=()=>Oe(Tt),X1=()=>{var e=ac();if(e==="horizontal"||e==="vertical")return e},ZI=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Ure=()=>{var e=ac();return e!==void 0},Rd=e=>{var t=Bt(),n=cr(),{width:r,height:i}=e,a=H1(),s=r,o=i;return a&&(s=a.width>0?a.width:r,o=a.height>0?a.height:i),m.useEffect(()=>{!n&&Ri(s)&&Ri(o)&&t(Zne({width:s,height:o}))},[t,n,s,o]),null},QI=Symbol.for("immer-nothing"),hP=Symbol.for("immer-draftable"),Nr=Symbol.for("immer-state");function ni(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var nd=Object.getPrototypeOf;function Vl(e){return!!e&&!!e[Nr]}function bo(e){var t;return e?JI(e)||Array.isArray(e)||!!e[hP]||!!((t=e.constructor)!=null&&t[hP])||Fd(e)||fg(e):!1}var Vre=Object.prototype.constructor.toString(),pP=new WeakMap;function JI(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=pP.get(n);return r===void 0&&(r=Function.toString.call(n),pP.set(n,r)),r===Vre}function Ep(e,t,n=!0){dg(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 dg(e){const t=e[Nr];return t?t.type_:Array.isArray(e)?1:Fd(e)?2:fg(e)?3:0}function jv(e,t){return dg(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function e3(e,t,n){const r=dg(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Wre(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Fd(e){return e instanceof Map}function fg(e){return e instanceof Set}function Fs(e){return e.copy_||e.base_}function Nv(e,t){if(Fd(e))return new Map(e);if(fg(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=JI(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Nr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const s=i[a],o=r[s];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[s]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[s]})}return Object.create(nd(e),r)}else{const r=nd(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Z1(e,t=!1){return hg(e)||Vl(e)||!bo(e)||(dg(e)>1&&Object.defineProperties(e,{set:Bf,add:Bf,clear:Bf,delete:Bf}),Object.freeze(e),t&&Object.values(e).forEach(n=>Z1(n,!0))),e}function Hre(){ni(2)}var Bf={value:Hre};function hg(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Kre={};function wo(e){const t=Kre[e];return t||ni(0,e),t}var rd;function t3(){return rd}function Gre(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function mP(e,t){t&&(wo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Cv(e){Pv(e),e.drafts_.forEach(qre),e.drafts_=null}function Pv(e){e===rd&&(rd=e.parent_)}function gP(e){return rd=Gre(rd,e)}function qre(e){const t=e[Nr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function yP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Nr].modified_&&(Cv(t),ni(4)),bo(e)&&(e=Ap(t,e),t.parent_||Tp(t,e)),t.patches_&&wo("Patches").generateReplacementPatches_(n[Nr].base_,e,t.patches_,t.inversePatches_)):e=Ap(t,n,[]),Cv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==QI?e:void 0}function Ap(e,t,n){if(hg(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Nr];if(!i)return Ep(t,(a,s)=>xP(e,i,t,a,s,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Tp(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let s=a,o=!1;i.type_===3&&(s=new Set(a),a.clear(),o=!0),Ep(s,(c,u)=>xP(e,i,a,c,u,n,o),r),Tp(e,a,!1),n&&e.patches_&&wo("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function xP(e,t,n,r,i,a,s){if(i==null||typeof i!="object"&&!s)return;const o=hg(i);if(!(o&&!s)){if(Vl(i)){const c=a&&t&&t.type_!==3&&!jv(t.assigned_,r)?a.concat(r):void 0,u=Ap(e,i,c);if(e3(n,r,u),Vl(u))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(bo(i)&&!o){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&o)return;Ap(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Fd(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Tp(e,i)}}}function Tp(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Z1(t,n)}function Yre(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:t3(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=Q1;n&&(i=[r],a=id);const{revoke:s,proxy:o}=Proxy.revocable(i,a);return r.draft_=o,r.revoke_=s,o}var Q1={get(e,t){if(t===Nr)return e;const n=Fs(e);if(!jv(n,t))return Xre(e,n,t);const r=n[t];return e.finalized_||!bo(r)?r:r===sy(e.base_,t)?(oy(e),e.copy_[t]=Av(r,e)):r},has(e,t){return t in Fs(e)},ownKeys(e){return Reflect.ownKeys(Fs(e))},set(e,t,n){const r=n3(Fs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=sy(Fs(e),t),a=i==null?void 0:i[Nr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Wre(n,i)&&(n!==void 0||jv(e.base_,t)))return!0;oy(e),Ev(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 sy(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,oy(e),Ev(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Fs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ni(11)},getPrototypeOf(e){return nd(e.base_)},setPrototypeOf(){ni(12)}},id={};Ep(Q1,(e,t)=>{id[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});id.deleteProperty=function(e,t){return id.set.call(this,e,t,void 0)};id.set=function(e,t,n){return Q1.set.call(this,e[0],t,n,e[0])};function sy(e,t){const n=e[Nr];return(n?Fs(n):e)[t]}function Xre(e,t,n){var i;const r=n3(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function n3(e,t){if(!(t in e))return;let n=nd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=nd(n)}}function Ev(e){e.modified_||(e.modified_=!0,e.parent_&&Ev(e.parent_))}function oy(e){e.copy_||(e.copy_=Nv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Zre=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 s=this;return function(c=a,...u){return s.produce(c,d=>n.call(this,d,...u))}}typeof n!="function"&&ni(6),r!==void 0&&typeof r!="function"&&ni(7);let i;if(bo(t)){const a=gP(this),s=Av(t,void 0);let o=!0;try{i=n(s),o=!1}finally{o?Cv(a):Pv(a)}return mP(a,r),yP(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===QI&&(i=void 0),this.autoFreeze_&&Z1(i,!0),r){const a=[],s=[];wo("Patches").generateReplacementPatches_(t,i,a,s),r(a,s)}return i}else ni(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...o)=>this.produceWithPatches(s,c=>t(c,...o));let r,i;return[this.produce(t,n,(s,o)=>{r=s,i=o}),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){bo(e)||ni(8),Vl(e)&&(e=Qre(e));const t=gP(this),n=Av(e,void 0);return n[Nr].isManual_=!0,Pv(t),n}finishDraft(e,t){const n=e&&e[Nr];(!n||!n.isManual_)&&ni(9);const{scope_:r}=n;return mP(r,t),yP(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=wo("Patches").applyPatches_;return Vl(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Av(e,t){const n=Fd(e)?wo("MapSet").proxyMap_(e,t):fg(e)?wo("MapSet").proxySet_(e,t):Yre(e,t);return(t?t.scope_:t3()).drafts_.push(n),n}function Qre(e){return Vl(e)||ni(10,e),r3(e)}function r3(e){if(!bo(e)||hg(e))return e;const t=e[Nr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Nv(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Nv(e,!0);return Ep(n,(i,a)=>{e3(n,i,r3(a))},r),t&&(t.finalized_=!1),n}var Jre=new Zre;Jre.produce;var eie={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},i3=Rn({name:"legend",initialState:eie,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:wt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=$r(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:wt()},removeLegendPayload:{reducer(e,t){var n=$r(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:wt()}}}),{setLegendSize:vP,setLegendSettings:tie,addLegendPayload:nie,replaceLegendPayload:rie,removeLegendPayload:iie}=i3.actions,aie=i3.reducer,sie={};/**
704
+ * @license React
705
+ * use-sync-external-store-with-selector.production.js
706
+ *
707
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
708
+ *
709
+ * This source code is licensed under the MIT license found in the
710
+ * LICENSE file in the root directory of this source tree.
711
+ */var zd=m;function oie(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lie=typeof Object.is=="function"?Object.is:oie,cie=zd.useSyncExternalStore,uie=zd.useRef,die=zd.useEffect,fie=zd.useMemo,hie=zd.useDebugValue;sie.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=uie(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=fie(function(){function c(p){if(!u){if(u=!0,d=p,p=r(p),i!==void 0&&s.hasValue){var g=s.value;if(i(g,p))return f=g}return f=p}if(g=f,lie(d,p))return g;var y=r(p);return i!==void 0&&i(g,y)?(d=p,g):(d=p,f=y)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,i]);var o=cie(e,a[0],a[1]);return die(function(){s.hasValue=!0,s.value=o},[o]),hie(o),o};function pie(e){e()}function mie(){let e=null,t=null;return{clear(){e=null,t=null},notify(){pie(()=>{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 bP={notify(){},get:()=>[]};function gie(e,t){let n,r=bP,i=0,a=!1;function s(y){d();const x=r.subscribe(y);let b=!1;return()=>{b||(b=!0,x(),f())}}function o(){r.notify()}function c(){g.onStateChange&&g.onStateChange()}function u(){return a}function d(){i++,n||(n=e.subscribe(c),r=mie())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=bP)}function h(){a||(a=!0,d())}function p(){a&&(a=!1,f())}const g={addNestedSub:s,notifyNestedSubs:o,handleChangeWrapper:c,isSubscribed:u,trySubscribe:h,tryUnsubscribe:p,getListeners:()=>r};return g}var yie=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xie=yie(),vie=()=>typeof navigator<"u"&&navigator.product==="ReactNative",bie=vie(),wie=()=>xie||bie?m.useLayoutEffect:m.useEffect,Sie=wie();function wP(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function kie(e,t){if(wP(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])||!wP(e[n[i]],t[n[i]]))return!1;return!0}var ly=Symbol.for("react-redux-context"),cy=typeof globalThis<"u"?globalThis:{};function jie(){if(!m.createContext)return{};const e=cy[ly]??(cy[ly]=new Map);let t=e.get(m.createContext);return t||(t=m.createContext(null),e.set(m.createContext,t)),t}var Nie=jie();function Cie(e){const{children:t,context:n,serverState:r,store:i}=e,a=m.useMemo(()=>{const c=gie(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),s=m.useMemo(()=>i.getState(),[i]);Sie(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),s!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,s]);const o=n||Nie;return m.createElement(o.Provider,{value:a},t)}var Pie=Cie,Eie=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Aie(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function $d(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Eie.has(r)){if(e[r]==null&&t[r]==null)continue;if(!kie(e[r],t[r]))return!1}else if(!Aie(e[r],t[r]))return!1;return!0}var Tie=["contextPayload"];function Tv(){return Tv=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},Tv.apply(null,arguments)}function SP(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 Wl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SP(Object(n),!0).forEach(function(r){Oie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oie(e,t,n){return(t=_ie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ie(e){var t=Mie(e,"string");return typeof t=="symbol"?t:t+""}function Mie(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 Die(e,t){if(e==null)return{};var n,r,i=Iie(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 Iie(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 Lie(e){return e.value}function Rie(e){var{contextPayload:t}=e,n=Die(e,Tie),r=XD(t,e.payloadUniqBy,Lie),i=Wl(Wl({},n),{},{payload:r});return m.isValidElement(e.content)?m.cloneElement(e.content,i):typeof e.content=="function"?m.createElement(e.content,i):m.createElement(mte,i)}function Fie(e,t,n,r,i,a){var{layout:s,align:o,verticalAlign:c}=t,u,d;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(o==="center"&&s==="vertical"?u={left:((r||0)-a.width)/2}:u=o==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(c==="middle"?d={top:((i||0)-a.height)/2}:d=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Wl(Wl({},u),d)}function zie(e){var t=Bt();return m.useEffect(()=>{t(tie(e))},[t,e]),null}function $ie(e){var t=Bt();return m.useEffect(()=>(t(vP(e)),()=>{t(vP({width:0,height:0}))}),[t,e]),null}function Bie(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Uie={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Vie(e){var t=lr(e,Uie),n=Jte(),r=uee(),i=Bre(),{width:a,height:s,wrapperStyle:o,portal:c}=t,[u,d]=lI([n]),f=q1(),h=Y1();if(f==null||h==null)return null;var p=f-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),g=Bie(t.layout,s,a,p),y=c?o:Wl(Wl({position:"absolute",width:(g==null?void 0:g.width)||a||"auto",height:(g==null?void 0:g.height)||s||"auto"},Fie(o,t,i,f,h,u)),o),x=c??r;if(x==null||n==null)return null;var b=m.createElement("div",{className:"recharts-legend-wrapper",style:y,ref:d},m.createElement(zie,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&m.createElement($ie,{width:u.width,height:u.height}),m.createElement(Rie,Tv({},t,g,{margin:i,chartWidth:f,chartHeight:h,contextPayload:n})));return Co.createPortal(b,x)}var pg=m.memo(Vie,$d);pg.displayName="Legend";function Ov(){return Ov=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},Ov.apply(null,arguments)}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 Ic(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){Wie(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 Wie(e,t,n){return(t=Hie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hie(e){var t=Kie(e,"string");return typeof t=="symbol"?t:t+""}function Kie(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 Gie(e){return Array.isArray(e)&&Li(e[0])&&Li(e[1])?e.join(" ~ "):e}var Fo={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};function qie(e,t){return t==null?e:Xm(e,t)}var Yie=e=>{var{separator:t=Fo.separator,contentStyle:n,itemStyle:r,labelStyle:i=Fo.labelStyle,payload:a,formatter:s,itemSorter:o,wrapperClassName:c,labelClassName:u,label:d,labelFormatter:f,accessibilityLayer:h=Fo.accessibilityLayer}=e,p=()=>{if(a&&a.length){var S={padding:0,margin:0},j=qie(a,o),N=j.map((P,A)=>{if(P.type==="none")return null;var E=P.formatter||s||Gie,{value:O,name:C}=P,M=O,I=C;if(E){var B=E(O,C,P,A,a);if(Array.isArray(B))[M,I]=B;else if(B!=null)M=B;else return null}var se=Ic(Ic({},Fo.itemStyle),{},{color:P.color||Fo.itemStyle.color},r);return m.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(A),style:se},Li(I)?m.createElement("span",{className:"recharts-tooltip-item-name"},I):null,Li(I)?m.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,m.createElement("span",{className:"recharts-tooltip-item-value"},M),m.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return m.createElement("ul",{className:"recharts-tooltip-item-list",style:S},N)}return null},g=Ic(Ic({},Fo.contentStyle),n),y=Ic({margin:0},i),x=!kn(d),b=x?d:"",v=ot("recharts-default-tooltip",c),w=ot("recharts-tooltip-label",u);x&&f&&a!==void 0&&a!==null&&(b=f(d,a));var k=h?{role:"status","aria-live":"assertive"}:{};return m.createElement("div",Ov({className:v,style:g},k),m.createElement("p",{className:w,style:y},m.isValidElement(b)?b:"".concat(b)),p())},Lc="recharts-tooltip-wrapper",Xie={visibility:"hidden"};function Zie(e){var{coordinate:t,translateX:n,translateY:r}=e;return ot(Lc,{["".concat(Lc,"-right")]:Pe(n)&&t&&Pe(t.x)&&n>=t.x,["".concat(Lc,"-left")]:Pe(n)&&t&&Pe(t.x)&&n<t.x,["".concat(Lc,"-bottom")]:Pe(r)&&t&&Pe(t.y)&&r>=t.y,["".concat(Lc,"-top")]:Pe(r)&&t&&Pe(t.y)&&r<t.y})}function jP(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:s,tooltipDimension:o,viewBox:c,viewBoxDimension:u}=e;if(a&&Pe(a[r]))return a[r];var d=n[r]-o-(i>0?i:0),f=n[r]+i;if(t[r])return s[r]?d:f;var h=c[r];if(h==null)return 0;if(s[r]){var p=d,g=h;return p<g?Math.max(f,h):Math.max(d,h)}if(u==null)return 0;var y=f+o,x=h+u;return y>x?Math.max(d,h):Math.max(f,h)}function Qie(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 Jie(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:s,tooltipBox:o,useTranslate3d:c,viewBox:u}=e,d,f,h;return o.height>0&&o.width>0&&n?(f=jP({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:s,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),h=jP({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:s,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),d=Qie({translateX:f,translateY:h,useTranslate3d:c})):d=Xie,{cssProperties:d,cssClasses:Zie({translateX:f,translateY:h,coordinate:n})}}var eae=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Bd={isSsr:eae()};function a3(){var[e,t]=m.useState(()=>Bd.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return m.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function NP(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 zo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NP(Object(n),!0).forEach(function(r){tae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tae(e,t,n){return(t=nae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nae(e){var t=rae(e,"string");return typeof t=="symbol"?t:t+""}function rae(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 iae(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function aae(e){var t,n,r,i,a,s,o=a3(),[c,u]=m.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));m.useEffect(()=>{var g=y=>{if(y.key==="Escape"){var x,b,v,w;u({dismissed:!0,dismissedAtCoordinate:{x:(x=(b=e.coordinate)===null||b===void 0?void 0:b.x)!==null&&x!==void 0?x:0,y:(v=(w=e.coordinate)===null||w===void 0?void 0:w.y)!==null&&v!==void 0?v:0}})}};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),c.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==c.dismissedAtCoordinate.x||((a=(s=e.coordinate)===null||s===void 0?void 0:s.y)!==null&&a!==void 0?a:0)!==c.dismissedAtCoordinate.y)&&u(zo(zo({},c),{},{dismissed:!1}));var{cssClasses:d,cssProperties:f}=Jie({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),h=e.hasPortalFromProps?{}:zo(zo({transition:iae({prefersReducedMotion:o,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},f),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),p=zo(zo({},h),{},{visibility:!c.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return m.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:d,style:p,ref:e.innerRef},e.children)}var sae=m.memo(aae),s3=()=>{var e;return(e=Oe(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function _v(){return _v=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},_v.apply(null,arguments)}function CP(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 PP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CP(Object(n),!0).forEach(function(r){oae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oae(e,t,n){return(t=lae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lae(e){var t=cae(e,"string");return typeof t=="symbol"?t:t+""}function cae(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 EP={curveBasisClosed:Aee,curveBasisOpen:Tee,curveBasis:Eee,curveBumpX:pee,curveBumpY:mee,curveLinearClosed:Oee,curveLinear:Um,curveMonotoneX:_ee,curveMonotoneY:Mee,curveNatural:Dee,curveStep:Iee,curveStepAfter:Ree,curveStepBefore:Lee},Op=e=>qe(e.x)&&qe(e.y),AP=e=>e.base!=null&&Op(e.base)&&Op(e),Rc=e=>e.x,Fc=e=>e.y,uae=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Md(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=EP["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return EP[n]||Um},TP={connectNulls:!1,type:"linear"},dae=e=>{var{type:t=TP.type,points:n=[],baseLine:r,layout:i,connectNulls:a=TP.connectNulls}=e,s=uae(t,i),o=a?n.filter(Op):n;if(Array.isArray(r)){var c,u=n.map((g,y)=>PP(PP({},g),{},{base:r[y]}));i==="vertical"?c=Df().y(Fc).x1(Rc).x0(g=>g.base.x):c=Df().x(Rc).y1(Fc).y0(g=>g.base.y);var d=c.defined(AP).curve(s),f=a?u.filter(AP):u;return d(f)}var h;i==="vertical"&&Pe(r)?h=Df().y(Fc).x1(Rc).x0(r):Pe(r)?h=Df().x(Rc).y1(Fc).y0(r):h=fD().x(Rc).y(Fc);var p=h.defined(Op).curve(s);return p(o)},wh=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=ac();if((!n||!n.length)&&!r)return null;var s={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},o=n&&n.length?dae(s):r;return m.createElement("path",_v({},di(e),C1(e),{className:ot("recharts-curve",t),d:o===null?void 0:o,ref:i}))},fae=["x","y","top","left","width","height","className"];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 OP(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 hae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OP(Object(n),!0).forEach(function(r){pae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pae(e,t,n){return(t=mae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mae(e){var t=gae(e,"string");return typeof t=="symbol"?t:t+""}function gae(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 yae(e,t){if(e==null)return{};var n,r,i=xae(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 xae(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 vae=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),bae=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:s=0,className:o}=e,c=yae(e,fae),u=hae({x:t,y:n,top:r,left:i,width:a,height:s},c);return!Pe(t)||!Pe(n)||!Pe(a)||!Pe(s)||!Pe(r)||!Pe(i)?null:m.createElement("path",Mv({},kr(u),{className:ot("recharts-cross",o),d:vae(t,n,a,s,r,i)}))};function wae(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 _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 MP(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){Sae(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 Sae(e,t,n){return(t=kae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kae(e){var t=jae(e,"string");return typeof t=="symbol"?t:t+""}function jae(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 Nae=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Cae=(e,t,n)=>e.map(r=>"".concat(Nae(r)," ").concat(t,"ms ").concat(n)).join(","),Pae=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),ad=(e,t)=>Object.keys(t).reduce((n,r)=>MP(MP({},n),{},{[r]:e(r,t[r])}),{});function DP(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 en(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DP(Object(n),!0).forEach(function(r){Eae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eae(e,t,n){return(t=Aae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aae(e){var t=Tae(e,"string");return typeof t=="symbol"?t:t+""}function Tae(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=(e,t,n)=>e+(t-e)*n,Dv=e=>{var{from:t,to:n}=e;return t!==n},o3=(e,t,n)=>{var r=ad((i,a)=>{if(Dv(a)){var[s,o]=e(a.from,a.to,a.velocity);return en(en({},a),{},{from:s,velocity:o})}return a},t);return n<1?ad((i,a)=>Dv(a)&&r[i]!=null?en(en({},a),{},{velocity:_p(a.velocity,r[i].velocity,n),from:_p(a.from,r[i].from,n)}):a,t):o3(e,r,n-1)};function Oae(e,t,n,r,i,a){var s,o=r.reduce((h,p)=>en(en({},h),{},{[p]:{from:e[p],velocity:0,to:t[p]}}),{}),c=()=>ad((h,p)=>p.from,o),u=()=>!Object.values(o).filter(Dv).length,d=null,f=h=>{s||(s=h);var p=h-s,g=p/n.dt;o=o3(n,o,g),i(en(en(en({},e),t),c())),s=h,u()||(d=a.setTimeout(f))};return()=>(d=a.setTimeout(f),()=>{var h;(h=d)===null||h===void 0||h()})}function _ae(e,t,n,r,i,a,s){var o=null,c=i.reduce((f,h)=>{var p=e[h],g=t[h];return p==null||g==null?f:en(en({},f),{},{[h]:[p,g]})},{}),u,d=f=>{u||(u=f);var h=(f-u)/r,p=ad((y,x)=>_p(...x,n(h)),c);if(a(en(en(en({},e),t),p)),h<1)o=s.setTimeout(d);else{var g=ad((y,x)=>_p(...x,n(1)),c);a(en(en(en({},e),t),g))}};return()=>(o=s.setTimeout(d),()=>{var f;(f=o)===null||f===void 0||f()})}const Mae=(e,t,n,r,i,a)=>{var s=Pae(e,t);return n==null?()=>(i(en(en({},e),t)),()=>{}):n.isStepper===!0?Oae(e,t,n,s,i,a):_ae(e,t,n,r,s,i,a)};var Mp=1e-4,l3=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],c3=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),IP=(e,t)=>n=>{var r=l3(e,t);return c3(r,n)},Dae=(e,t)=>n=>{var r=l3(e,t),i=[...r.map((a,s)=>a*s).slice(1),0];return c3(i,n)},Iae=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]]},Lae=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=Iae(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Rae=(e,t,n,r)=>{var i=IP(e,n),a=IP(t,r),s=Dae(e,n),o=u=>u>1?1:u<0?0:u,c=u=>{for(var d=u>1?1:u,f=d,h=0;h<8;++h){var p=i(f)-d,g=s(f);if(Math.abs(p-d)<Mp||g<Mp)return a(f);f=o(f-p/g)}return a(f)};return c.isStepper=!1,c},LP=function(){return Rae(...Lae(...arguments))},Fae=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(s,o,c)=>{var u=-(s-o)*n,d=c*r,f=c+(u-d)*i/1e3,h=c*i/1e3+s;return Math.abs(h-o)<Mp&&Math.abs(f)<Mp?[o,0]:[h,f]};return a.isStepper=!0,a.dt=i,a},zae=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return LP(e);case"spring":return Fae();default:if(e.split("(")[0]==="cubic-bezier")return LP(e)}return typeof e=="function"?e:null};function $ae(e){var t,n=()=>null,r=!1,i=null,a=s=>{if(!r){if(Array.isArray(s)){if(!s.length)return;var o=s,[c,...u]=o;if(typeof c=="number"){i=e.setTimeout(a.bind(null,u),c);return}a(c),i=e.setTimeout(a.bind(null,u));return}typeof s=="string"&&(t=s,n(t)),typeof s=="object"&&(t=s,n(t)),typeof s=="function"&&s()}};return{stop:()=>{r=!0},start:s=>{r=!1,i&&(i(),i=null),a(s)},subscribe:s=>(n=s,()=>{n=()=>null}),getTimeoutController:()=>e}}class Bae{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=s=>{s-r>=n?t(s):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function Uae(){return $ae(new Bae)}var Vae=m.createContext(Uae);function Wae(e,t){var n=m.useContext(Vae);return m.useMemo(()=>t??n(e),[e,t,n])}var Hae={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},RP={t:0},uy={t:1};function u3(e){var t=lr(e,Hae),{isActive:n,canBegin:r,duration:i,easing:a,begin:s,onAnimationEnd:o,onAnimationStart:c,children:u}=t,d=a3(),f=n==="auto"?!Bd.isSsr&&!d:n,h=Wae(t.animationId,t.animationManager),[p,g]=m.useState(f?RP:uy),y=m.useRef(null);return m.useEffect(()=>{f||g(uy)},[f]),m.useEffect(()=>{if(!f||!r)return Ao;var x=Mae(RP,uy,zae(a),i,g,h.getTimeoutController()),b=()=>{y.current=x()};return h.start([c,s,b,i,o]),()=>{h.stop(),y.current&&y.current(),o()}},[f,r,i,a,s,c,o,h]),u(p.t)}function d3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=m.useRef(Qu(t)),r=m.useRef(e);return r.current!==e&&(n.current=Qu(t),r.current=e),n.current}var Kae=["radius"],Gae=["radius"],FP,zP,$P,BP,UP,VP,WP,HP,KP,GP;function qP(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 YP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qP(Object(n),!0).forEach(function(r){qae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qae(e,t,n){return(t=Yae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yae(e){var t=Xae(e,"string");return typeof t=="symbol"?t:t+""}function Xae(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 Dp(){return Dp=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},Dp.apply(null,arguments)}function XP(e,t){if(e==null)return{};var n,r,i=Zae(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 Zae(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 yi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ZP=(e,t,n,r,i)=>{var a=Ga(n),s=Ga(r),o=Math.min(Math.abs(a)/2,Math.abs(s)/2),c=s>=0?1:-1,u=a>=0?1:-1,d=s>=0&&a>=0||s<0&&a<0?1:0,f;if(o>0&&Array.isArray(i)){for(var h=[0,0,0,0],p=0,g=4;p<g;p++){var y,x=(y=i[p])!==null&&y!==void 0?y:0;h[p]=x>o?o:x}f=yn(FP||(FP=yi(["M",",",""])),e,t+c*h[0]),h[0]>0&&(f+=yn(zP||(zP=yi(["A ",",",",0,0,",",",",",""])),h[0],h[0],d,e+u*h[0],t)),f+=yn($P||($P=yi(["L ",",",""])),e+n-u*h[1],t),h[1]>0&&(f+=yn(BP||(BP=yi(["A ",",",",0,0,",`,
712
+ `,",",""])),h[1],h[1],d,e+n,t+c*h[1])),f+=yn(UP||(UP=yi(["L ",",",""])),e+n,t+r-c*h[2]),h[2]>0&&(f+=yn(VP||(VP=yi(["A ",",",",0,0,",`,
713
+ `,",",""])),h[2],h[2],d,e+n-u*h[2],t+r)),f+=yn(WP||(WP=yi(["L ",",",""])),e+u*h[3],t+r),h[3]>0&&(f+=yn(HP||(HP=yi(["A ",",",",0,0,",`,
714
+ `,",",""])),h[3],h[3],d,e,t+r-c*h[3])),f+="Z"}else if(o>0&&i===+i&&i>0){var b=Math.min(o,i);f=yn(KP||(KP=yi(["M ",",",`
715
+ A `,",",",0,0,",",",",",`
716
+ L `,",",`
717
+ A `,",",",0,0,",",",",",`
718
+ L `,",",`
719
+ A `,",",",0,0,",",",",",`
720
+ L `,",",`
721
+ A `,",",",0,0,",",",","," Z"])),e,t+c*b,b,b,d,e+u*b,t,e+n-u*b,t,b,b,d,e+n,t+c*b,e+n,t+r-c*b,b,b,d,e+n-u*b,t+r,e+u*b,t+r,b,b,d,e,t+r-c*b)}else f=yn(GP||(GP=yi(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return f},QP={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Qae=e=>{var t=lr(e,QP),n=m.useRef(null),[r,i]=m.useState(-1);m.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var Q=n.current.getTotalLength();Q&&i(Q)}catch{}},[]);var{x:a,y:s,width:o,height:c,radius:u,className:d}=t,{animationEasing:f,animationDuration:h,animationBegin:p,isAnimationActive:g,isUpdateAnimationActive:y}=t,x=m.useRef(o),b=m.useRef(c),v=m.useRef(a),w=m.useRef(s),k=m.useMemo(()=>({x:a,y:s,width:o,height:c,radius:u}),[a,s,o,c,u]),S=d3(k,"rectangle-");if(a!==+a||s!==+s||o!==+o||c!==+c||o===0||c===0)return null;var j=ot("recharts-rectangle",d);if(!y){var N=kr(t),{radius:P}=N,A=XP(N,Kae);return m.createElement("path",Dp({},A,{x:Ga(a),y:Ga(s),width:Ga(o),height:Ga(c),radius:typeof u=="number"?u:void 0,className:j,d:ZP(a,s,o,c,u)}))}var E=x.current,O=b.current,C=v.current,M=w.current,I="0px ".concat(r===-1?1:r,"px"),B="".concat(r,"px ").concat(r,"px"),se=Cae(["strokeDasharray"],h,typeof f=="string"?f:QP.animationEasing);return m.createElement(u3,{animationId:S,key:S,canBegin:r>0,duration:h,easing:f,isActive:y,begin:p},Q=>{var D=ki(E,o,Q),K=ki(O,c,Q),T=ki(C,a,Q),ie=ki(M,s,Q);n.current&&(x.current=D,b.current=K,v.current=T,w.current=ie);var J;g?Q>0?J={transition:se,strokeDasharray:B}:J={strokeDasharray:I}:J={strokeDasharray:B};var _=kr(t),{radius:H}=_,ee=XP(_,Gae);return m.createElement("path",Dp({},ee,{radius:typeof u=="number"?u:void 0,className:j,d:ZP(T,ie,D,K,u),ref:n,style:YP(YP({},J),t.style)}))})};function JP(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 eE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JP(Object(n),!0).forEach(function(r){Jae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jae(e,t,n){return(t=ese(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ese(e){var t=tse(e,"string");return typeof t=="symbol"?t:t+""}function tse(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=Math.PI/180,nse=e=>e*180/Math.PI,vn=(e,t,n,r)=>({x:e+Math.cos(-Ip*r)*n,y:t+Math.sin(-Ip*r)*n}),rse=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},ise=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},ase=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,s=ise({x:n,y:r},{x:i,y:a});if(s<=0)return{radius:s,angle:0};var o=(n-i)/s,c=Math.acos(o);return r>a&&(c=2*Math.PI-c),{radius:s,angle:nse(c),angleInRadian:c}},sse=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}},ose=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),s=Math.min(i,a);return e+s*360},lse=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=ase({x:n,y:r},t),{innerRadius:s,outerRadius:o}=t;if(i<s||i>o||i===0)return null;var{startAngle:c,endAngle:u}=sse(t),d=a,f;if(c<=u){for(;d>u;)d-=360;for(;d<c;)d+=360;f=d>=c&&d<=u}else{for(;d>c;)d-=360;for(;d<u;)d+=360;f=d>=u&&d<=c}return f?eE(eE({},t),{},{radius:i,angle:ose(d,t)}):null};function f3(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,s=vn(t,n,r,i),o=vn(t,n,r,a);return{points:[s,o],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var tE,nE,rE,iE,aE,sE,oE;function Iv(){return Iv=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},Iv.apply(null,arguments)}function Ys(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var cse=(e,t)=>{var n=zr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Uf=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:s,cornerRadius:o,cornerIsExternal:c}=e,u=o*(s?1:-1)+r,d=Math.asin(o/u)/Ip,f=c?i:i+a*d,h=vn(t,n,u,f),p=vn(t,n,r,f),g=c?i-a*d:i,y=vn(t,n,u*Math.cos(d*Ip),g);return{center:h,circleTangency:p,lineTangency:y,theta:d}},h3=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:s}=e,o=cse(a,s),c=a+o,u=vn(t,n,i,a),d=vn(t,n,i,c),f=yn(tE||(tE=Ys(["M ",",",`
722
+ A `,",",`,0,
723
+ `,",",`,
724
+ `,",",`
725
+ `])),u.x,u.y,i,i,+(Math.abs(o)>180),+(a>c),d.x,d.y);if(r>0){var h=vn(t,n,r,a),p=vn(t,n,r,c);f+=yn(nE||(nE=Ys(["L ",",",`
726
+ A `,",",`,0,
727
+ `,",",`,
728
+ `,","," Z"])),p.x,p.y,r,r,+(Math.abs(o)>180),+(a<=c),h.x,h.y)}else f+=yn(rE||(rE=Ys(["L ",","," Z"])),t,n);return f},use=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:s,cornerIsExternal:o,startAngle:c,endAngle:u}=e,d=zr(u-c),{circleTangency:f,lineTangency:h,theta:p}=Uf({cx:t,cy:n,radius:i,angle:c,sign:d,cornerRadius:a,cornerIsExternal:o}),{circleTangency:g,lineTangency:y,theta:x}=Uf({cx:t,cy:n,radius:i,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:o}),b=o?Math.abs(c-u):Math.abs(c-u)-p-x;if(b<0)return s?yn(iE||(iE=Ys(["M ",",",`
729
+ a`,",",",0,0,1,",`,0
730
+ a`,",",",0,0,1,",`,0
731
+ `])),h.x,h.y,a,a,a*2,a,a,-a*2):h3({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var v=yn(aE||(aE=Ys(["M ",",",`
732
+ A`,",",",0,0,",",",",",`
733
+ A`,",",",0,",",",",",",",`
734
+ A`,",",",0,0,",",",",",`
735
+ `])),h.x,h.y,a,a,+(d<0),f.x,f.y,i,i,+(b>180),+(d<0),g.x,g.y,a,a,+(d<0),y.x,y.y);if(r>0){var{circleTangency:w,lineTangency:k,theta:S}=Uf({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:o}),{circleTangency:j,lineTangency:N,theta:P}=Uf({cx:t,cy:n,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:o}),A=o?Math.abs(c-u):Math.abs(c-u)-S-P;if(A<0&&a===0)return"".concat(v,"L").concat(t,",").concat(n,"Z");v+=yn(sE||(sE=Ys(["L",",",`
736
+ A`,",",",0,0,",",",",",`
737
+ A`,",",",0,",",",",",",",`
738
+ A`,",",",0,0,",",",",","Z"])),N.x,N.y,a,a,+(d<0),j.x,j.y,r,r,+(A>180),+(d>0),w.x,w.y,a,a,+(d<0),k.x,k.y)}else v+=yn(oE||(oE=Ys(["L",",","Z"])),t,n);return v},dse={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},fse=e=>{var t=lr(e,dse),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:s,forceCornerRadius:o,cornerIsExternal:c,startAngle:u,endAngle:d,className:f}=t;if(a<i||u===d)return null;var h=ot("recharts-sector",f),p=a-i,g=ds(s,p,0,!0),y;return g>0&&Math.abs(u-d)<360?y=use({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,p/2),forceCornerRadius:o,cornerIsExternal:c,startAngle:u,endAngle:d}):y=h3({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d}),m.createElement("path",Iv({},kr(t),{className:h,d:y}))};function hse(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(AD(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:s,angle:o}=t,c=vn(r,i,a,o),u=vn(r,i,s,o);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return f3(t)}}var p3={},m3={},g3={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=R1;function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(g3);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=g3;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})(m3);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F1,n=m3;function r(i,a,s){s&&typeof s!="number"&&t.isIterateeCall(i,a,s)&&(a=s=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),s=s===void 0?i<a?1:-1:n.toFinite(s);const o=Math.max(Math.ceil((a-i)/(s||1)),0),c=new Array(o);for(let u=0;u<o;u++)c[u]=i,i+=s;return c}e.range=r})(p3);var pse=p3.range;const y3=hi(pse);var Sa=e=>e.chartData,x3=q([Sa],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),v3=(e,t,n,r)=>r?x3(e):Sa(e),mse=(e,t,n)=>n?x3(e):Sa(e);function _i(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(qe(t)&&qe(n))return!0}return!1}function lE(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function b3(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(qe(n))i=n;else if(typeof n=="function")return;if(qe(r))a=r;else if(typeof r=="function")return;var s=[i,a];if(_i(s))return s}}function gse(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(_i(r))return lE(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,s,o;if(i==="auto")t!=null&&(s=Math.min(...t));else if(Pe(i))s=i;else if(typeof i=="function")try{t!=null&&(s=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&oP.test(i)){var c=oP.exec(i);if(c==null||c[1]==null||t==null)s=void 0;else{var u=+c[1];s=t[0]-u}}else s=t==null?void 0:t[0];if(a==="auto")t!=null&&(o=Math.max(...t));else if(Pe(a))o=a;else if(typeof a=="function")try{t!=null&&(o=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&lP.test(a)){var d=lP.exec(a);if(d==null||d[1]==null||t==null)o=void 0;else{var f=+d[1];o=t[1]+f}}else o=t==null?void 0:t[1];var h=[s,o];if(_i(h))return t==null?h:lE(h,t,n)}}}var sc=1e9,yse={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},eS,At=!0,Kr="[DecimalError] ",io=Kr+"Invalid argument: ",J1=Kr+"Exponent out of range: ",oc=Math.floor,zs=Math.pow,xse=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,pr,sn=1e7,St=7,w3=9007199254740991,Lp=oc(w3/St),Ce={};Ce.absoluteValue=Ce.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ce.comparedTo=Ce.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};Ce.decimalPlaces=Ce.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*St;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ce.dividedBy=Ce.div=function(e){return ia(this,new this.constructor(e))};Ce.dividedToIntegerBy=Ce.idiv=function(e){var t=this,n=t.constructor;return dt(ia(t,new n(e),0,1),n.precision)};Ce.equals=Ce.eq=function(e){return!this.cmp(e)};Ce.exponent=function(){return Yt(this)};Ce.greaterThan=Ce.gt=function(e){return this.cmp(e)>0};Ce.greaterThanOrEqualTo=Ce.gte=function(e){return this.cmp(e)>=0};Ce.isInteger=Ce.isint=function(){return this.e>this.d.length-2};Ce.isNegative=Ce.isneg=function(){return this.s<0};Ce.isPositive=Ce.ispos=function(){return this.s>0};Ce.isZero=function(){return this.s===0};Ce.lessThan=Ce.lt=function(e){return this.cmp(e)<0};Ce.lessThanOrEqualTo=Ce.lte=function(e){return this.cmp(e)<1};Ce.logarithm=Ce.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(pr))throw Error(Kr+"NaN");if(n.s<1)throw Error(Kr+(n.s?"NaN":"-Infinity"));return n.eq(pr)?new r(0):(At=!1,t=ia(sd(n,a),sd(e,a),a),At=!0,dt(t,i))};Ce.minus=Ce.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?j3(t,e):S3(t,(e.s=-e.s,e))};Ce.modulo=Ce.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Kr+"NaN");return n.s?(At=!1,t=ia(n,e,0,1).times(e),At=!0,n.minus(t)):dt(new r(n),i)};Ce.naturalExponential=Ce.exp=function(){return k3(this)};Ce.naturalLogarithm=Ce.ln=function(){return sd(this)};Ce.negated=Ce.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ce.plus=Ce.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?S3(t,e):j3(t,(e.s=-e.s,e))};Ce.precision=Ce.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(io+e);if(t=Yt(i)+1,r=i.d.length-1,n=r*St+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};Ce.squareRoot=Ce.sqrt=function(){var e,t,n,r,i,a,s,o=this,c=o.constructor;if(o.s<1){if(!o.s)return new c(0);throw Error(Kr+"NaN")}for(e=Yt(o),At=!1,i=Math.sqrt(+o),i==0||i==1/0?(t=Ci(o.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=oc((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 c(t)):r=new c(i.toString()),n=c.precision,i=s=n+3;;)if(a=r,r=a.plus(ia(o,a,s+2)).times(.5),Ci(a.d).slice(0,s)===(t=Ci(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(dt(a,n+1,0),a.times(a).eq(o)){r=a;break}}else if(t!="9999")break;s+=4}return At=!0,dt(r,n)};Ce.times=Ce.mul=function(e){var t,n,r,i,a,s,o,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=h.length,u=p.length,c<u&&(a=h,h=p,p=a,s=c,c=u,u=s),a=[],s=c+u,r=s;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)o=a[i]+p[r]*h[i-r-1]+t,a[i--]=o%sn|0,t=o/sn|0;a[i]=(a[i]+t)%sn|0}for(;!a[--s];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,At?dt(e,f.precision):e};Ce.toDecimalPlaces=Ce.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Fi(e,0,sc),t===void 0?t=r.rounding:Fi(t,0,8),dt(n,e+Yt(n)+1,t))};Ce.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=So(r,!0):(Fi(e,0,sc),t===void 0?t=i.rounding:Fi(t,0,8),r=dt(new i(r),e+1,t),n=So(r,!0,e+1)),n};Ce.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?So(i):(Fi(e,0,sc),t===void 0?t=a.rounding:Fi(t,0,8),r=dt(new a(i),e+Yt(i)+1,t),n=So(r.abs(),!1,e+Yt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ce.toInteger=Ce.toint=function(){var e=this,t=e.constructor;return dt(new t(e),Yt(e)+1,t.rounding)};Ce.toNumber=function(){return+this};Ce.toPower=Ce.pow=function(e){var t,n,r,i,a,s,o=this,c=o.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(pr);if(o=new c(o),!o.s){if(e.s<1)throw Error(Kr+"Infinity");return o}if(o.eq(pr))return o;if(r=c.precision,e.eq(pr))return dt(o,r);if(t=e.e,n=e.d.length-1,s=t>=n,a=o.s,s){if((n=d<0?-d:d)<=w3){for(i=new c(pr),t=Math.ceil(r/St+4),At=!1;n%2&&(i=i.times(o),uE(i.d,t)),n=oc(n/2),n!==0;)o=o.times(o),uE(o.d,t);return At=!0,e.s<0?new c(pr).div(i):dt(i,r)}}else if(a<0)throw Error(Kr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,o.s=1,At=!1,i=e.times(sd(o,r+u)),At=!0,i=k3(i),i.s=a,i};Ce.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Yt(i),r=So(i,n<=a.toExpNeg||n>=a.toExpPos)):(Fi(e,1,sc),t===void 0?t=a.rounding:Fi(t,0,8),i=dt(new a(i),e,t),n=Yt(i),r=So(i,e<=n||n<=a.toExpNeg,e)),r};Ce.toSignificantDigits=Ce.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Fi(e,1,sc),t===void 0?t=r.rounding:Fi(t,0,8)),dt(new r(n),e,t)};Ce.toString=Ce.valueOf=Ce.val=Ce.toJSON=Ce[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Yt(e),n=e.constructor;return So(e,t<=n.toExpNeg||t>=n.toExpPos)};function S3(e,t){var n,r,i,a,s,o,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),At?dt(t,f):t;if(c=e.d,u=t.d,s=e.e,i=t.e,c=c.slice(),a=s-i,a){for(a<0?(r=c,a=-a,o=u.length):(r=u,i=s,o=c.length),s=Math.ceil(f/St),o=s>o?s+1:o+1,a>o&&(a=o,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(o=c.length,a=u.length,o-a<0&&(a=o,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/sn|0,c[a]%=sn;for(n&&(c.unshift(n),++i),o=c.length;c[--o]==0;)c.pop();return t.d=c,t.e=i,At?dt(t,f):t}function Fi(e,t,n){if(e!==~~e||e<t||e>n)throw Error(io+e)}function Ci(e){var t,n,r,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,t=1;t<i;t++)r=e[t]+"",n=St-r.length,n&&(a+=Fa(n)),a+=r;s=e[t],r=s+"",n=St-r.length,n&&(a+=Fa(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var ia=function(){function e(r,i){var a,s=0,o=r.length;for(r=r.slice();o--;)a=r[o]*i+s,r[o]=a%sn|0,s=a/sn|0;return s&&r.unshift(s),r}function t(r,i,a,s){var o,c;if(a!=s)c=a>s?1:-1;else for(o=c=0;o<a;o++)if(r[o]!=i[o]){c=r[o]>i[o]?1:-1;break}return c}function n(r,i,a){for(var s=0;a--;)r[a]-=s,s=r[a]<i[a]?1:0,r[a]=s*sn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,s){var o,c,u,d,f,h,p,g,y,x,b,v,w,k,S,j,N,P,A=r.constructor,E=r.s==i.s?1:-1,O=r.d,C=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(Kr+"Division by zero");for(c=r.e-i.e,N=C.length,S=O.length,p=new A(E),g=p.d=[],u=0;C[u]==(O[u]||0);)++u;if(C[u]>(O[u]||0)&&--c,a==null?v=a=A.precision:s?v=a+(Yt(r)-Yt(i))+1:v=a,v<0)return new A(0);if(v=v/St+2|0,u=0,N==1)for(d=0,C=C[0],v++;(u<S||d)&&v--;u++)w=d*sn+(O[u]||0),g[u]=w/C|0,d=w%C|0;else{for(d=sn/(C[0]+1)|0,d>1&&(C=e(C,d),O=e(O,d),N=C.length,S=O.length),k=N,y=O.slice(0,N),x=y.length;x<N;)y[x++]=0;P=C.slice(),P.unshift(0),j=C[0],C[1]>=sn/2&&++j;do d=0,o=t(C,y,N,x),o<0?(b=y[0],N!=x&&(b=b*sn+(y[1]||0)),d=b/j|0,d>1?(d>=sn&&(d=sn-1),f=e(C,d),h=f.length,x=y.length,o=t(f,y,h,x),o==1&&(d--,n(f,N<h?P:C,h))):(d==0&&(o=d=1),f=C.slice()),h=f.length,h<x&&f.unshift(0),n(y,f,x),o==-1&&(x=y.length,o=t(C,y,N,x),o<1&&(d++,n(y,N<x?P:C,x))),x=y.length):o===0&&(d++,y=[0]),g[u++]=d,o&&y[0]?y[x++]=O[k]||0:(y=[O[k]],x=1);while((k++<S||y[0]!==void 0)&&v--)}return g[0]||g.shift(),p.e=c,dt(p,s?a+Yt(p)+1:a)}}();function k3(e,t){var n,r,i,a,s,o,c=0,u=0,d=e.constructor,f=d.precision;if(Yt(e)>16)throw Error(J1+Yt(e));if(!e.s)return new d(pr);for(At=!1,o=f,s=new d(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(r=Math.log(zs(2,u))/Math.LN10*2+5|0,o+=r,n=i=a=new d(pr),d.precision=o;;){if(i=dt(i.times(e),o),n=n.times(++c),s=a.plus(ia(i,n,o)),Ci(s.d).slice(0,o)===Ci(a.d).slice(0,o)){for(;u--;)a=dt(a.times(a),o);return d.precision=f,t==null?(At=!0,dt(a,f)):a}a=s}}function Yt(e){for(var t=e.e*St,n=e.d[0];n>=10;n/=10)t++;return t}function dy(e,t,n){if(t>e.LN10.sd())throw At=!0,n&&(e.precision=n),Error(Kr+"LN10 precision limit exceeded");return dt(new e(e.LN10),t)}function Fa(e){for(var t="";e--;)t+="0";return t}function sd(e,t){var n,r,i,a,s,o,c,u,d,f=1,h=10,p=e,g=p.d,y=p.constructor,x=y.precision;if(p.s<1)throw Error(Kr+(p.s?"NaN":"-Infinity"));if(p.eq(pr))return new y(0);if(t==null?(At=!1,u=x):u=t,p.eq(10))return t==null&&(At=!0),dy(y,u);if(u+=h,y.precision=u,n=Ci(g),r=n.charAt(0),a=Yt(p),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=Ci(p.d),r=n.charAt(0),f++;a=Yt(p),r>1?(p=new y("0."+n),a++):p=new y(r+"."+n.slice(1))}else return c=dy(y,u+2,x).times(a+""),p=sd(new y(r+"."+n.slice(1)),u-h).plus(c),y.precision=x,t==null?(At=!0,dt(p,x)):p;for(o=s=p=ia(p.minus(pr),p.plus(pr),u),d=dt(p.times(p),u),i=3;;){if(s=dt(s.times(d),u),c=o.plus(ia(s,new y(i),u)),Ci(c.d).slice(0,u)===Ci(o.d).slice(0,u))return o=o.times(2),a!==0&&(o=o.plus(dy(y,u+2,x).times(a+""))),o=ia(o,new y(f),u),y.precision=x,t==null?(At=!0,dt(o,x)):o;o=c,i+=2}}function cE(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=oc(n/St),e.d=[],r=(n+1)%St,n<0&&(r+=St),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=St;r<i;)e.d.push(+t.slice(r,r+=St));t=t.slice(r),r=St-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),At&&(e.e>Lp||e.e<-Lp))throw Error(J1+n)}else e.s=0,e.e=0,e.d=[0];return e}function dt(e,t,n){var r,i,a,s,o,c,u,d,f=e.d;for(s=1,a=f[0];a>=10;a/=10)s++;if(r=t-s,r<0)r+=St,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/St),a=f.length,d>=a)return e;for(u=a=f[d],s=1;a>=10;a/=10)s++;r%=St,i=r-St+s}if(n!==void 0&&(a=zs(10,s-i-1),o=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=n<4?(o||c)&&(n==0||n==(e.s<0?3:2)):o>5||o==5&&(n==4||c||n==6&&(r>0?i>0?u/zs(10,s-i):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=Yt(e),f.length=1,t=t-a-1,f[0]=zs(10,(St-t%St)%St),e.e=oc(-t/St)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,a=1,d--):(f.length=d+1,a=zs(10,St-r),f[d]=i>0?(u/zs(10,s-i)%zs(10,i)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==sn&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=sn)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(At&&(e.e>Lp||e.e<-Lp))throw Error(J1+Yt(e));return e}function j3(e,t){var n,r,i,a,s,o,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),At?dt(t,p):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),s=u-r,s){for(d=s<0,d?(n=c,s=-s,o=f.length):(n=f,r=u,o=c.length),i=Math.max(Math.ceil(p/St),o)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=c.length,o=f.length,d=i<o,d&&(o=i),i=0;i<o;i++)if(c[i]!=f[i]){d=c[i]<f[i];break}s=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),o=c.length,i=f.length-o;i>0;--i)c[o++]=0;for(i=f.length;i>s;){if(c[--i]<f[i]){for(a=i;a&&c[--a]===0;)c[a]=sn-1;--c[a],c[i]+=sn}c[i]-=f[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,At?dt(t,p):t):new h(0)}function So(e,t,n){var r,i=Yt(e),a=Ci(e.d),s=a.length;return t?(n&&(r=n-s)>0?a=a.charAt(0)+"."+a.slice(1)+Fa(r):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Fa(-i-1)+a,n&&(r=n-s)>0&&(a+=Fa(r))):i>=s?(a+=Fa(i+1-s),n&&(r=n-i-1)>0&&(a=a+"."+Fa(r))):((r=i+1)<s&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(a+="."),a+=Fa(r))),e.s<0?"-"+a:a}function uE(e,t){if(e.length>t)return e.length=t,!0}function N3(e){var t,n,r;function i(a){var s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,a instanceof i){s.s=a.s,s.e=a.e,s.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(io+a);if(a>0)s.s=1;else if(a<0)a=-a,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(a===~~a&&a<1e7){s.e=0,s.d=[a];return}return cE(s,a.toString())}else if(typeof a!="string")throw Error(io+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,xse.test(a))cE(s,a);else throw Error(io+a)}if(i.prototype=Ce,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=N3,i.config=i.set=vse,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 vse(e){if(!e||typeof e!="object")throw Error(Kr+"Object expected");var t,n,r,i=["precision",1,sc,"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(oc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(io+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(io+n+": "+r);return this}var eS=N3(yse);pr=new eS(1);const Ye=eS;function C3(e){var t;return e===0?t=1:t=Math.floor(new Ye(e).abs().log(10).toNumber())+1,t}function P3(e,t,n){for(var r=new Ye(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var E3=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},tS=(e,t,n)=>{if(e.lte(0))return new Ye(0);var r=C3(e.toNumber()),i=new Ye(10).pow(r),a=e.div(i),s=r!==1?.05:.1,o=new Ye(Math.ceil(a.div(s).toNumber())).add(n).mul(s),c=o.mul(i);return t?new Ye(c.toNumber()):new Ye(Math.ceil(c.toNumber()))},A3=(e,t,n)=>{var r;if(e.lte(0))return new Ye(0);var i=[1,2,2.5,5],a=e.toNumber(),s=Math.floor(new Ye(a).abs().log(10).toNumber()),o=new Ye(10).pow(s),c=e.div(o).toNumber(),u=i.findIndex(p=>p>=c-1e-10);if(u===-1&&(o=o.mul(10),u=0),u+=n,u>=i.length){var d=Math.floor(u/i.length);u%=i.length,o=o.mul(new Ye(10).pow(d))}var f=(r=i[u])!==null&&r!==void 0?r:1,h=new Ye(f).mul(o);return t?h:new Ye(Math.ceil(h.toNumber()))},bse=(e,t,n)=>{var r=new Ye(1),i=new Ye(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Ye(10).pow(C3(e)-1),i=new Ye(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Ye(Math.floor(e)))}else e===0?i=new Ye(Math.floor((t-1)/2)):n||(i=new Ye(Math.floor(e)));for(var s=Math.floor((t-1)/2),o=[],c=0;c<t;c++)o.push(i.add(new Ye(c-s).mul(r)).toNumber());return o},T3=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:tS;if(!Number.isFinite((n-t)/(r-1)))return{step:new Ye(0),tickMin:new Ye(0),tickMax:new Ye(0)};var o=s(new Ye(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new Ye(0):(c=new Ye(t).add(n).div(2),c=c.sub(new Ye(c).mod(o)));var u=Math.ceil(c.sub(t).div(o).toNumber()),d=Math.ceil(new Ye(n).sub(c).div(o).toNumber()),f=u+d+1;return f>r?T3(t,n,r,i,a+1,s):(f<r&&(d=n>0?d+(r-f):d,u=n>0?u:u+(r-f)),{step:o,tickMin:c.sub(new Ye(u).mul(o)),tickMax:c.add(new Ye(d).mul(o))})},dE=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,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",o=Math.max(i,2),[c,u]=E3([n,r]);if(c===-1/0||u===1/0){var d=u===1/0?[c,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),u];return n>r?d.reverse():d}if(c===u)return bse(c,i,a);var f=s==="snap125"?A3:tS,{step:h,tickMin:p,tickMax:g}=T3(c,u,o,a,0,f),y=P3(p,g.add(new Ye(.1).mul(h)),h);return n>r?y.reverse():y},fE=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[o,c]=E3([r,i]);if(o===-1/0||c===1/0)return[r,i];if(o===c)return[o];var u=s==="snap125"?A3:tS,d=Math.max(n,2),f=u(new Ye(c).sub(o).div(d-1),a,0),h=[...P3(new Ye(o),new Ye(c),f),c];return a===!1&&(h=h.map(p=>Math.round(p))),r>i?h.reverse():h},wse=e=>e.rootProps.barCategoryGap,mg=e=>e.rootProps.stackOffset,O3=e=>e.rootProps.reverseStackOrder,nS=e=>e.options.chartName,rS=e=>e.rootProps.syncId,_3=e=>e.rootProps.syncMethod,iS=e=>e.options.eventEmitter,Sse=e=>e.rootProps.baseValue,Bn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},As={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},xi={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},gg=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function yg(e,t,n){if(n!=="auto")return n;if(e!=null)return Ui(e,t)?"category":"number"}function hE(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 Rp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hE(Object(n),!0).forEach(function(r){kse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kse(e,t,n){return(t=jse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jse(e){var t=Nse(e,"string");return typeof t=="symbol"?t:t+""}function Nse(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 pE={allowDataOverflow:As.allowDataOverflow,allowDecimals:As.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:As.angleAxisId,includeHidden:!1,name:void 0,reversed:As.reversed,scale:As.scale,tick:As.tick,tickCount:void 0,ticks:void 0,type:As.type,unit:void 0,niceTicks:"auto"},mE={allowDataOverflow:xi.allowDataOverflow,allowDecimals:xi.allowDecimals,allowDuplicatedCategory:xi.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:xi.radiusAxisId,includeHidden:xi.includeHidden,name:void 0,reversed:xi.reversed,scale:xi.scale,tick:xi.tick,tickCount:xi.tickCount,ticks:void 0,type:xi.type,unit:void 0,niceTicks:"auto"},Cse=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},aS=q([Cse,ZI],(e,t)=>{var n;if(e!=null)return e;var r=(n=yg(t,"angleAxis",pE.type))!==null&&n!==void 0?n:"category";return Rp(Rp({},pE),{},{type:r})}),Pse=(e,t)=>e.polarAxis.radiusAxis[t],sS=q([Pse,ZI],(e,t)=>{var n;if(e!=null)return e;var r=(n=yg(t,"radiusAxis",mE.type))!==null&&n!==void 0?n:"category";return Rp(Rp({},mE),{},{type:r})}),xg=e=>e.polarOptions,oS=q([ba,wa,jn],rse),M3=q([xg,oS],(e,t)=>{if(e!=null)return ds(e.innerRadius,t,0)}),D3=q([xg,oS],(e,t)=>{if(e!=null)return ds(e.outerRadius,t,t*.8)}),Ese=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},I3=q([xg],Ese);q([aS,I3],gg);var L3=q([oS,M3,D3],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});q([sS,L3],gg);var R3=q([Tt,xg,M3,D3,ba,wa],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:s,cy:o,startAngle:c,endAngle:u}=t;return{cx:ds(s,i,i/2),cy:ds(o,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),un=(e,t)=>t,vg=(e,t,n)=>n;function lS(e){return e==null?void 0:e.id}function F3(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,s=new Map;return e.forEach(o=>{var c,u=(c=o.data)!==null&&c!==void 0?c:r;if(!(u==null||u.length===0)){var d=lS(o);u.forEach((f,h)=>{var p=a==null||i?h:String(wn(f,a,null)),g=wn(f,o.dataKey,0),y;s.has(p)?y=s.get(p):y={},Object.assign(y,{[d]:g}),s.set(p,y)})}}),Array.from(s.values())}function cS(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var bg=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function wg(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Ase(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 dn=e=>{var t=Tt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},lc=e=>e.tooltip.settings.axisId;function uS(e){if(e!=null){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 s(){return a.apply(this,arguments)}return s.toString=function(){return a.toString()},s}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var s=i[0],o=i[1];return s<=o?a>=s&&a<=o:a>=o&&a<=s},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,s)=>{var o=e(a);if(o!=null){if(e.bandwidth&&s!==null&&s!==void 0&&s.position){var c=e.bandwidth();switch(s.position){case"middle":o+=c/2;break;case"end":o+=c;break}}return o}}}}}var Tse=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!_i(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];qe(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 ns(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ose(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function dS(e){let t,n,r;e.length!==2?(t=ns,n=(o,c)=>ns(e(o),c),r=(o,c)=>e(o)-c):(t=e===ns||e===Ose?e:_se,n=e,r=e);function i(o,c,u=0,d=o.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(o[f],c)<0?u=f+1:d=f}while(u<d)}return u}function a(o,c,u=0,d=o.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(o[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function s(o,c,u=0,d=o.length){const f=i(o,c,u,d-1);return f>u&&r(o[f-1],c)>-r(o[f],c)?f-1:f}return{left:i,center:s,right:a}}function _se(){return 0}function z3(e){return e===null?NaN:+e}function*Mse(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Dse=dS(ns),Ud=Dse.right;dS(z3).center;class gE extends Map{constructor(t,n=Rse){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(yE(this,t))}has(t){return super.has(yE(this,t))}set(t,n){return super.set(Ise(this,t),n)}delete(t){return super.delete(Lse(this,t))}}function yE({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Ise({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Lse({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Rse(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Fse(e=ns){if(e===ns)return $3;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 $3(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const zse=Math.sqrt(50),$se=Math.sqrt(10),Bse=Math.sqrt(2);function Fp(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=zse?10:a>=$se?5:a>=Bse?2:1;let o,c,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(e*u),c=Math.round(t*u),o/u<e&&++o,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*s,o=Math.round(e/u),c=Math.round(t/u),o*u<e&&++o,c*u>t&&--c),c<o&&.5<=n&&n<2?Fp(e,t,n*2):[o,c,u]}function Lv(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,s]=r?Fp(t,e,n):Fp(e,t,n);if(!(a>=i))return[];const o=a-i+1,c=new Array(o);if(r)if(s<0)for(let u=0;u<o;++u)c[u]=(a-u)/-s;else for(let u=0;u<o;++u)c[u]=(a-u)*s;else if(s<0)for(let u=0;u<o;++u)c[u]=(i+u)/-s;else for(let u=0;u<o;++u)c[u]=(i+u)*s;return c}function Rv(e,t,n){return t=+t,e=+e,n=+n,Fp(e,t,n)[2]}function Fv(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Rv(t,e,n):Rv(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function xE(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function vE(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function B3(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?$3:Fse(i);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(n,Math.floor(t-u*f/c+h)),g=Math.min(r,Math.floor(t+(c-u)*f/c+h));B3(e,t,p,g,i)}const a=e[t];let s=n,o=r;for(zc(e,n,t),i(e[r],a)>0&&zc(e,n,r);s<o;){for(zc(e,s,o),++s,--o;i(e[s],a)<0;)++s;for(;i(e[o],a)>0;)--o}i(e[n],a)===0?zc(e,n,o):(++o,zc(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function zc(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Use(e,t,n){if(e=Float64Array.from(Mse(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return vE(e);if(t>=1)return xE(e);var r,i=(r-1)*t,a=Math.floor(i),s=xE(B3(e,a).subarray(0,a+1)),o=vE(e.subarray(a+1));return s+(o-s)*(i-a)}}function Vse(e,t,n=z3){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),s=+n(e[a],a,e),o=+n(e[a+1],a+1,e);return s+(o-s)*(i-a)}}function Wse(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 Gr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ka(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 zv=Symbol("implicit");function fS(){var e=new gE,t=[],n=[],r=zv;function i(a){let s=e.get(a);if(s===void 0){if(r!==zv)return r;e.set(a,s=t.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new gE;for(const s of a)e.has(s)||e.set(s,t.push(s)-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 fS(t,n).unknown(r)},Gr.apply(i,arguments),i}function hS(){var e=fS().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,s,o=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=i<r,g=p?i:r,y=p?r:i;a=(y-g)/Math.max(1,h-c+u*2),o&&(a=Math.floor(a)),g+=(y-g-a*(h-c))*d,s=a*(1-c),o&&(g=Math.round(g),s=Math.round(s));var x=Wse(h).map(function(b){return g+a*b});return n(p?x.reverse():x)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,f()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(h){return arguments.length?(o=!!h,f()):o},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return hS(t(),[r,i]).round(o).paddingInner(c).paddingOuter(u).align(d)},Gr.apply(f(),arguments)}function U3(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return U3(t())},e}function Hse(){return U3(hS.apply(null,arguments).paddingInner(1))}function pS(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function V3(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Vd(){}var od=.7,zp=1/od,kl="\\s*([+-]?\\d+)\\s*",ld="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Kse=/^#([0-9a-f]{3,8})$/,Gse=new RegExp(`^rgb\\(${kl},${kl},${kl}\\)$`),qse=new RegExp(`^rgb\\(${Mi},${Mi},${Mi}\\)$`),Yse=new RegExp(`^rgba\\(${kl},${kl},${kl},${ld}\\)$`),Xse=new RegExp(`^rgba\\(${Mi},${Mi},${Mi},${ld}\\)$`),Zse=new RegExp(`^hsl\\(${ld},${Mi},${Mi}\\)$`),Qse=new RegExp(`^hsla\\(${ld},${Mi},${Mi},${ld}\\)$`),bE={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};pS(Vd,cd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wE,formatHex:wE,formatHex8:Jse,formatHsl:eoe,formatRgb:SE,toString:SE});function wE(){return this.rgb().formatHex()}function Jse(){return this.rgb().formatHex8()}function eoe(){return W3(this).formatHsl()}function SE(){return this.rgb().formatRgb()}function cd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Kse.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?kE(t):n===3?new nr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Vf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Vf(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=Gse.exec(e))?new nr(t[1],t[2],t[3],1):(t=qse.exec(e))?new nr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Yse.exec(e))?Vf(t[1],t[2],t[3],t[4]):(t=Xse.exec(e))?Vf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Zse.exec(e))?CE(t[1],t[2]/100,t[3]/100,1):(t=Qse.exec(e))?CE(t[1],t[2]/100,t[3]/100,t[4]):bE.hasOwnProperty(e)?kE(bE[e]):e==="transparent"?new nr(NaN,NaN,NaN,0):null}function kE(e){return new nr(e>>16&255,e>>8&255,e&255,1)}function Vf(e,t,n,r){return r<=0&&(e=t=n=NaN),new nr(e,t,n,r)}function toe(e){return e instanceof Vd||(e=cd(e)),e?(e=e.rgb(),new nr(e.r,e.g,e.b,e.opacity)):new nr}function $v(e,t,n,r){return arguments.length===1?toe(e):new nr(e,t,n,r??1)}function nr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}pS(nr,$v,V3(Vd,{brighter(e){return e=e==null?zp:Math.pow(zp,e),new nr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?od:Math.pow(od,e),new nr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nr(ao(this.r),ao(this.g),ao(this.b),$p(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:jE,formatHex:jE,formatHex8:noe,formatRgb:NE,toString:NE}));function jE(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}`}function noe(){return`#${Xs(this.r)}${Xs(this.g)}${Xs(this.b)}${Xs((isNaN(this.opacity)?1:this.opacity)*255)}`}function NE(){const e=$p(this.opacity);return`${e===1?"rgb(":"rgba("}${ao(this.r)}, ${ao(this.g)}, ${ao(this.b)}${e===1?")":`, ${e})`}`}function $p(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ao(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xs(e){return e=ao(e),(e<16?"0":"")+e.toString(16)}function CE(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ri(e,t,n,r)}function W3(e){if(e instanceof ri)return new ri(e.h,e.s,e.l,e.opacity);if(e instanceof Vd||(e=cd(e)),!e)return new ri;if(e instanceof ri)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),s=NaN,o=a-i,c=(a+i)/2;return o?(t===a?s=(n-r)/o+(n<r)*6:n===a?s=(r-t)/o+2:s=(t-n)/o+4,o/=c<.5?a+i:2-a-i,s*=60):o=c>0&&c<1?0:s,new ri(s,o,c,e.opacity)}function roe(e,t,n,r){return arguments.length===1?W3(e):new ri(e,t,n,r??1)}function ri(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}pS(ri,roe,V3(Vd,{brighter(e){return e=e==null?zp:Math.pow(zp,e),new ri(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?od:Math.pow(od,e),new ri(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 nr(fy(e>=240?e-240:e+120,i,r),fy(e,i,r),fy(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ri(PE(this.h),Wf(this.s),Wf(this.l),$p(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=$p(this.opacity);return`${e===1?"hsl(":"hsla("}${PE(this.h)}, ${Wf(this.s)*100}%, ${Wf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function PE(e){return e=(e||0)%360,e<0?e+360:e}function Wf(e){return Math.max(0,Math.min(1,e||0))}function fy(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 mS=e=>()=>e;function ioe(e,t){return function(n){return e+n*t}}function aoe(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 soe(e){return(e=+e)==1?H3:function(t,n){return n-t?aoe(t,n,e):mS(isNaN(t)?n:t)}}function H3(e,t){var n=t-e;return n?ioe(e,n):mS(isNaN(e)?t:e)}const EE=function e(t){var n=soe(t);function r(i,a){var s=n((i=$v(i)).r,(a=$v(a)).r),o=n(i.g,a.g),c=n(i.b,a.b),u=H3(i.opacity,a.opacity);return function(d){return i.r=s(d),i.g=o(d),i.b=c(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function ooe(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 loe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function coe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=cc(e[s],t[s]);for(;s<n;++s)a[s]=t[s];return function(o){for(s=0;s<r;++s)a[s]=i[s](o);return a}}function uoe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Bp(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function doe(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]=cc(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Bv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hy=new RegExp(Bv.source,"g");function foe(e){return function(){return e}}function hoe(e){return function(t){return e(t)+""}}function poe(e,t){var n=Bv.lastIndex=hy.lastIndex=0,r,i,a,s=-1,o=[],c=[];for(e=e+"",t=t+"";(r=Bv.exec(e))&&(i=hy.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(r=r[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,c.push({i:s,x:Bp(r,i)})),n=hy.lastIndex;return n<t.length&&(a=t.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?c[0]?hoe(c[0].x):foe(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)o[(f=c[d]).i]=f.x(u);return o.join("")})}function cc(e,t){var n=typeof t,r;return t==null||n==="boolean"?mS(t):(n==="number"?Bp:n==="string"?(r=cd(t))?(t=r,EE):poe:t instanceof cd?EE:t instanceof Date?uoe:loe(t)?ooe:Array.isArray(t)?coe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?doe:Bp)(e,t)}function gS(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function moe(e,t){t===void 0&&(t=e,e=cc);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(s){var o=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return a[o](s-o)}}function goe(e){return function(){return e}}function Up(e){return+e}var AE=[0,1];function Un(e){return e}function Uv(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:goe(isNaN(t)?NaN:.5)}function yoe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function xoe(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=Uv(i,r),a=n(s,a)):(r=Uv(r,i),a=n(a,s)),function(o){return a(r(o))}}function voe(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=Uv(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(o){var c=Ud(e,o,1,r)-1;return a[c](i[c](o))}}function Wd(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Sg(){var e=AE,t=AE,n=cc,r,i,a,s=Un,o,c,u;function d(){var h=Math.min(e.length,t.length);return s!==Un&&(s=yoe(e[0],e[h-1])),o=h>2?voe:xoe,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=o(e.map(r),t,n)))(r(s(h)))}return f.invert=function(h){return s(i((u||(u=o(t,e.map(r),Bp)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Up),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=gS,d()},f.clamp=function(h){return arguments.length?(s=h?!0:Un,d()):s!==Un},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return r=h,i=p,d()}}function yS(){return Sg()(Un,Un)}function boe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Vp(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 Hl(e){return e=Vp(Math.abs(e)),e?e[1]:NaN}function woe(e,t){return function(n,r){for(var i=n.length,a=[],s=0,o=e[0],c=0;i>0&&o>0&&(c+o+1>r&&(o=Math.max(1,r-c)),a.push(n.substring(i-=o,i+o)),!((c+=o+1)>r));)o=e[s=(s+1)%e.length];return a.reverse().join(t)}}function Soe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var koe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ud(e){if(!(t=koe.exec(e)))throw new Error("invalid format: "+e);var t;return new xS({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]})}ud.prototype=xS.prototype;function xS(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+""}xS.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 joe(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 Wp;function Noe(e,t){var n=Vp(e,t);if(!n)return Wp=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Wp=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Vp(e,Math.max(0,t+a-1))[0]}function TE(e,t){var n=Vp(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 OE={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:boe,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)=>TE(e*100,t),r:TE,s:Noe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function _E(e){return e}var ME=Array.prototype.map,DE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Coe(e){var t=e.grouping===void 0||e.thousands===void 0?_E:woe(ME.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?_E:Soe(ME.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=ud(f);var p=f.fill,g=f.align,y=f.sign,x=f.symbol,b=f.zero,v=f.width,w=f.comma,k=f.precision,S=f.trim,j=f.type;j==="n"?(w=!0,j="g"):OE[j]||(k===void 0&&(k=12),S=!0,j="g"),(b||p==="0"&&g==="=")&&(b=!0,p="0",g="=");var N=(h&&h.prefix!==void 0?h.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():""),P=(x==="$"?r:/[%p]/.test(j)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),A=OE[j],E=/[defgprs%]/.test(j);k=k===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function O(C){var M=N,I=P,B,se,Q;if(j==="c")I=A(C)+I,C="";else{C=+C;var D=C<0||1/C<0;if(C=isNaN(C)?c:A(Math.abs(C),k),S&&(C=joe(C)),D&&+C==0&&y!=="+"&&(D=!1),M=(D?y==="("?y:o:y==="-"||y==="("?"":y)+M,I=(j==="s"&&!isNaN(C)&&Wp!==void 0?DE[8+Wp/3]:"")+I+(D&&y==="("?")":""),E){for(B=-1,se=C.length;++B<se;)if(Q=C.charCodeAt(B),48>Q||Q>57){I=(Q===46?i+C.slice(B+1):C.slice(B))+I,C=C.slice(0,B);break}}}w&&!b&&(C=t(C,1/0));var K=M.length+C.length+I.length,T=K<v?new Array(v-K+1).join(p):"";switch(w&&b&&(C=t(T+C,T.length?v-I.length:1/0),T=""),g){case"<":C=M+C+I+T;break;case"=":C=M+T+C+I;break;case"^":C=T.slice(0,K=T.length>>1)+M+C+I+T.slice(K);break;default:C=T+M+C+I;break}return a(C)}return O.toString=function(){return f+""},O}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(Hl(h)/3)))*3,g=Math.pow(10,-p),y=u((f=ud(f),f.type="f",f),{suffix:DE[8+p/3]});return function(x){return y(g*x)}}return{format:u,formatPrefix:d}}var Hf,vS,K3;Poe({thousands:",",grouping:[3],currency:["$",""]});function Poe(e){return Hf=Coe(e),vS=Hf.format,K3=Hf.formatPrefix,Hf}function Eoe(e){return Math.max(0,-Hl(Math.abs(e)))}function Aoe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Hl(t)/3)))*3-Hl(Math.abs(e)))}function Toe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Hl(t)-Hl(e))+1}function G3(e,t,n,r){var i=Fv(e,t,n),a;switch(r=ud(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Aoe(i,s))&&(r.precision=a),K3(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Toe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Eoe(i))&&(r.precision=a-(r.type==="%")*2);break}}return vS(r)}function bs(e){var t=e.domain;return e.ticks=function(n){var r=t();return Lv(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return G3(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,s=r[i],o=r[a],c,u,d=10;for(o<s&&(u=s,s=o,o=u,u=i,i=a,a=u);d-- >0;){if(u=Rv(s,o,n),u===c)return r[i]=s,r[a]=o,t(r);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;c=u}return e},e}function q3(){var e=yS();return e.copy=function(){return Wd(e,q3())},Gr.apply(e,arguments),bs(e)}function Y3(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,Up),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Y3(e).unknown(t)},e=arguments.length?Array.from(e,Up):[0,1],bs(n)}function X3(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),e[n]=t.floor(i),e[r]=t.ceil(a),e}function IE(e){return Math.log(e)}function LE(e){return Math.exp(e)}function Ooe(e){return-Math.log(-e)}function _oe(e){return-Math.exp(-e)}function Moe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Doe(e){return e===10?Moe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Ioe(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 RE(e){return(t,n)=>-e(-t,n)}function bS(e){const t=e(IE,LE),n=t.domain;let r=10,i,a;function s(){return i=Ioe(r),a=Doe(r),n()[0]<0?(i=RE(i),a=RE(a),e(Ooe,_oe)):e(IE,LE),t}return t.base=function(o){return arguments.length?(r=+o,s()):r},t.domain=function(o){return arguments.length?(n(o),s()):n()},t.ticks=o=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=i(u),p=i(d),g,y;const x=o==null?10:+o;let b=[];if(!(r%1)&&p-h<x){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(g=1;g<r;++g)if(y=h<0?g/a(-h):g*a(h),!(y<u)){if(y>d)break;b.push(y)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(y=h>0?g/a(-h):g*a(h),!(y<u)){if(y>d)break;b.push(y)}b.length*2<x&&(b=Lv(u,d,x))}else b=Lv(h,p,Math.min(p-h,x)).map(a);return f?b.reverse():b},t.tickFormat=(o,c)=>{if(o==null&&(o=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=ud(c)).precision==null&&(c.trim=!0),c=vS(c)),o===1/0)return c;const u=Math.max(1,r*o/t.ticks().length);return d=>{let f=d/a(Math.round(i(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(X3(n(),{floor:o=>a(Math.floor(i(o))),ceil:o=>a(Math.ceil(i(o)))})),t}function Z3(){const e=bS(Sg()).domain([1,10]);return e.copy=()=>Wd(e,Z3()).base(e.base()),Gr.apply(e,arguments),e}function FE(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function zE(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function wS(e){var t=1,n=e(FE(t),zE(t));return n.constant=function(r){return arguments.length?e(FE(t=+r),zE(t)):t},bs(n)}function Q3(){var e=wS(Sg());return e.copy=function(){return Wd(e,Q3()).constant(e.constant())},Gr.apply(e,arguments)}function $E(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Loe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Roe(e){return e<0?-e*e:e*e}function SS(e){var t=e(Un,Un),n=1;function r(){return n===1?e(Un,Un):n===.5?e(Loe,Roe):e($E(n),$E(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},bs(t)}function kS(){var e=SS(Sg());return e.copy=function(){return Wd(e,kS()).exponent(e.exponent())},Gr.apply(e,arguments),e}function Foe(){return kS.apply(null,arguments).exponent(.5)}function BE(e){return Math.sign(e)*e*e}function zoe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function J3(){var e=yS(),t=[0,1],n=!1,r;function i(a){var s=zoe(e(a));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(a){return e.invert(BE(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,Up)).map(BE)),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 J3(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Gr.apply(i,arguments),bs(i)}function eL(){var e=[],t=[],n=[],r;function i(){var s=0,o=Math.max(1,t.length);for(n=new Array(o-1);++s<o;)n[s-1]=Vse(e,s/o);return a}function a(s){return s==null||isNaN(s=+s)?r:t[Ud(n,s)]}return a.invertExtent=function(s){var o=t.indexOf(s);return o<0?[NaN,NaN]:[o>0?n[o-1]:e[0],o<n.length?n[o]:e[e.length-1]]},a.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let o of s)o!=null&&!isNaN(o=+o)&&e.push(o);return e.sort(ns),i()},a.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return eL().domain(e).range(t).unknown(r)},Gr.apply(a,arguments)}function tL(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function s(c){return c!=null&&c<=c?i[Ud(r,c,0,n)]:a}function o(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,o()):[e,t]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,o()):i.slice()},s.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},s.unknown=function(c){return arguments.length&&(a=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return tL().domain([e,t]).range(i).unknown(a)},Gr.apply(bs(s),arguments)}function nL(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Ud(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 s=t.indexOf(a);return[e[s-1],e[s]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return nL().domain(e).range(t).unknown(n)},Gr.apply(i,arguments)}const py=new Date,my=new Date;function nn(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 s=i(a),o=i.ceil(a);return a-s<o-a?s:o},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const c=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a<s)||!(o>0))return c;let u;do c.push(u=new Date(+a)),t(a,o),e(a);while(u<a&&a<s);return c},i.filter=a=>nn(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;t(s,-1),!a(s););else for(;--o>=0;)for(;t(s,1),!a(s););}),n&&(i.count=(a,s)=>(py.setTime(+a),my.setTime(+s),e(py),e(my),Math.floor(n(py,my))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Hp=nn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Hp.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?nn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Hp);Hp.range;const Xi=1e3,Br=Xi*60,Zi=Br*60,ha=Zi*24,jS=ha*7,UE=ha*30,gy=ha*365,Zs=nn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Xi)},(e,t)=>(t-e)/Xi,e=>e.getUTCSeconds());Zs.range;const NS=nn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xi)},(e,t)=>{e.setTime(+e+t*Br)},(e,t)=>(t-e)/Br,e=>e.getMinutes());NS.range;const CS=nn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Br)},(e,t)=>(t-e)/Br,e=>e.getUTCMinutes());CS.range;const PS=nn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xi-e.getMinutes()*Br)},(e,t)=>{e.setTime(+e+t*Zi)},(e,t)=>(t-e)/Zi,e=>e.getHours());PS.range;const ES=nn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Zi)},(e,t)=>(t-e)/Zi,e=>e.getUTCHours());ES.range;const Hd=nn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Br)/ha,e=>e.getDate()-1);Hd.range;const kg=nn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ha,e=>e.getUTCDate()-1);kg.range;const rL=nn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ha,e=>Math.floor(e/ha));rL.range;function To(e){return nn(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())*Br)/jS)}const jg=To(0),Kp=To(1),$oe=To(2),Boe=To(3),Kl=To(4),Uoe=To(5),Voe=To(6);jg.range;Kp.range;$oe.range;Boe.range;Kl.range;Uoe.range;Voe.range;function Oo(e){return nn(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)/jS)}const Ng=Oo(0),Gp=Oo(1),Woe=Oo(2),Hoe=Oo(3),Gl=Oo(4),Koe=Oo(5),Goe=Oo(6);Ng.range;Gp.range;Woe.range;Hoe.range;Gl.range;Koe.range;Goe.range;const AS=nn(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());AS.range;const TS=nn(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());TS.range;const pa=nn(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());pa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nn(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)});pa.range;const ma=nn(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());ma.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nn(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)});ma.range;function iL(e,t,n,r,i,a){const s=[[Zs,1,Xi],[Zs,5,5*Xi],[Zs,15,15*Xi],[Zs,30,30*Xi],[a,1,Br],[a,5,5*Br],[a,15,15*Br],[a,30,30*Br],[i,1,Zi],[i,3,3*Zi],[i,6,6*Zi],[i,12,12*Zi],[r,1,ha],[r,2,2*ha],[n,1,jS],[t,1,UE],[t,3,3*UE],[e,1,gy]];function o(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const p=f&&typeof f.range=="function"?f:c(u,d,f),g=p?p.range(u,+d+1):[];return h?g.reverse():g}function c(u,d,f){const h=Math.abs(d-u)/f,p=dS(([,,x])=>x).right(s,h);if(p===s.length)return e.every(Fv(u/gy,d/gy,f));if(p===0)return Hp.every(Math.max(Fv(u,d,f),1));const[g,y]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return g.every(y)}return[o,c]}const[qoe,Yoe]=iL(ma,TS,Ng,rL,ES,CS),[Xoe,Zoe]=iL(pa,AS,jg,Hd,PS,NS);function yy(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 xy(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 $c(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Qoe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,o=e.months,c=e.shortMonths,u=Bc(i),d=Uc(i),f=Bc(a),h=Uc(a),p=Bc(s),g=Uc(s),y=Bc(o),x=Uc(o),b=Bc(c),v=Uc(c),w={a:Q,A:D,b:K,B:T,c:null,d:qE,e:qE,f:wle,g:Ole,G:Mle,H:xle,I:vle,j:ble,L:aL,m:Sle,M:kle,p:ie,q:J,Q:ZE,s:QE,S:jle,u:Nle,U:Cle,V:Ple,w:Ele,W:Ale,x:null,X:null,y:Tle,Y:_le,Z:Dle,"%":XE},k={a:_,A:H,b:ee,B:be,c:null,d:YE,e:YE,f:Fle,g:qle,G:Xle,H:Ile,I:Lle,j:Rle,L:oL,m:zle,M:$le,p:te,q:ye,Q:ZE,s:QE,S:Ble,u:Ule,U:Vle,V:Wle,w:Hle,W:Kle,x:null,X:null,y:Gle,Y:Yle,Z:Zle,"%":XE},S={a:E,A:O,b:C,B:M,c:I,d:KE,e:KE,f:ple,g:HE,G:WE,H:GE,I:GE,j:ule,L:hle,m:cle,M:dle,p:A,q:lle,Q:gle,s:yle,S:fle,u:rle,U:ile,V:ale,w:nle,W:sle,x:B,X:se,y:HE,Y:WE,Z:ole,"%":mle};w.x=j(n,w),w.X=j(r,w),w.c=j(t,w),k.x=j(n,k),k.X=j(r,k),k.c=j(t,k);function j(Z,ne){return function(ve){var L=[],W=-1,F=0,le=Z.length,oe,Re,We;for(ve instanceof Date||(ve=new Date(+ve));++W<le;)Z.charCodeAt(W)===37&&(L.push(Z.slice(F,W)),(Re=VE[oe=Z.charAt(++W)])!=null?oe=Z.charAt(++W):Re=oe==="e"?" ":"0",(We=ne[oe])&&(oe=We(ve,Re)),L.push(oe),F=W+1);return L.push(Z.slice(F,W)),L.join("")}}function N(Z,ne){return function(ve){var L=$c(1900,void 0,1),W=P(L,Z,ve+="",0),F,le;if(W!=ve.length)return null;if("Q"in L)return new Date(L.Q);if("s"in L)return new Date(L.s*1e3+("L"in L?L.L:0));if(ne&&!("Z"in L)&&(L.Z=0),"p"in L&&(L.H=L.H%12+L.p*12),L.m===void 0&&(L.m="q"in L?L.q:0),"V"in L){if(L.V<1||L.V>53)return null;"w"in L||(L.w=1),"Z"in L?(F=xy($c(L.y,0,1)),le=F.getUTCDay(),F=le>4||le===0?Gp.ceil(F):Gp(F),F=kg.offset(F,(L.V-1)*7),L.y=F.getUTCFullYear(),L.m=F.getUTCMonth(),L.d=F.getUTCDate()+(L.w+6)%7):(F=yy($c(L.y,0,1)),le=F.getDay(),F=le>4||le===0?Kp.ceil(F):Kp(F),F=Hd.offset(F,(L.V-1)*7),L.y=F.getFullYear(),L.m=F.getMonth(),L.d=F.getDate()+(L.w+6)%7)}else("W"in L||"U"in L)&&("w"in L||(L.w="u"in L?L.u%7:"W"in L?1:0),le="Z"in L?xy($c(L.y,0,1)).getUTCDay():yy($c(L.y,0,1)).getDay(),L.m=0,L.d="W"in L?(L.w+6)%7+L.W*7-(le+5)%7:L.w+L.U*7-(le+6)%7);return"Z"in L?(L.H+=L.Z/100|0,L.M+=L.Z%100,xy(L)):yy(L)}}function P(Z,ne,ve,L){for(var W=0,F=ne.length,le=ve.length,oe,Re;W<F;){if(L>=le)return-1;if(oe=ne.charCodeAt(W++),oe===37){if(oe=ne.charAt(W++),Re=S[oe in VE?ne.charAt(W++):oe],!Re||(L=Re(Z,ve,L))<0)return-1}else if(oe!=ve.charCodeAt(L++))return-1}return L}function A(Z,ne,ve){var L=u.exec(ne.slice(ve));return L?(Z.p=d.get(L[0].toLowerCase()),ve+L[0].length):-1}function E(Z,ne,ve){var L=p.exec(ne.slice(ve));return L?(Z.w=g.get(L[0].toLowerCase()),ve+L[0].length):-1}function O(Z,ne,ve){var L=f.exec(ne.slice(ve));return L?(Z.w=h.get(L[0].toLowerCase()),ve+L[0].length):-1}function C(Z,ne,ve){var L=b.exec(ne.slice(ve));return L?(Z.m=v.get(L[0].toLowerCase()),ve+L[0].length):-1}function M(Z,ne,ve){var L=y.exec(ne.slice(ve));return L?(Z.m=x.get(L[0].toLowerCase()),ve+L[0].length):-1}function I(Z,ne,ve){return P(Z,t,ne,ve)}function B(Z,ne,ve){return P(Z,n,ne,ve)}function se(Z,ne,ve){return P(Z,r,ne,ve)}function Q(Z){return s[Z.getDay()]}function D(Z){return a[Z.getDay()]}function K(Z){return c[Z.getMonth()]}function T(Z){return o[Z.getMonth()]}function ie(Z){return i[+(Z.getHours()>=12)]}function J(Z){return 1+~~(Z.getMonth()/3)}function _(Z){return s[Z.getUTCDay()]}function H(Z){return a[Z.getUTCDay()]}function ee(Z){return c[Z.getUTCMonth()]}function be(Z){return o[Z.getUTCMonth()]}function te(Z){return i[+(Z.getUTCHours()>=12)]}function ye(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var ne=j(Z+="",w);return ne.toString=function(){return Z},ne},parse:function(Z){var ne=N(Z+="",!1);return ne.toString=function(){return Z},ne},utcFormat:function(Z){var ne=j(Z+="",k);return ne.toString=function(){return Z},ne},utcParse:function(Z){var ne=N(Z+="",!0);return ne.toString=function(){return Z},ne}}}var VE={"-":"",_:" ",0:"0"},fn=/^\s*\d+/,Joe=/^%/,ele=/[\\^$*+?|[\]().{}]/g;function tt(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 tle(e){return e.replace(ele,"\\$&")}function Bc(e){return new RegExp("^(?:"+e.map(tle).join("|")+")","i")}function Uc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function nle(e,t,n){var r=fn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function rle(e,t,n){var r=fn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function ile(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ale(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function sle(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function WE(e,t,n){var r=fn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function HE(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ole(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 lle(e,t,n){var r=fn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function cle(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function KE(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function ule(e,t,n){var r=fn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function GE(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function dle(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function fle(e,t,n){var r=fn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function hle(e,t,n){var r=fn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ple(e,t,n){var r=fn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function mle(e,t,n){var r=Joe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function gle(e,t,n){var r=fn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function yle(e,t,n){var r=fn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function qE(e,t){return tt(e.getDate(),t,2)}function xle(e,t){return tt(e.getHours(),t,2)}function vle(e,t){return tt(e.getHours()%12||12,t,2)}function ble(e,t){return tt(1+Hd.count(pa(e),e),t,3)}function aL(e,t){return tt(e.getMilliseconds(),t,3)}function wle(e,t){return aL(e,t)+"000"}function Sle(e,t){return tt(e.getMonth()+1,t,2)}function kle(e,t){return tt(e.getMinutes(),t,2)}function jle(e,t){return tt(e.getSeconds(),t,2)}function Nle(e){var t=e.getDay();return t===0?7:t}function Cle(e,t){return tt(jg.count(pa(e)-1,e),t,2)}function sL(e){var t=e.getDay();return t>=4||t===0?Kl(e):Kl.ceil(e)}function Ple(e,t){return e=sL(e),tt(Kl.count(pa(e),e)+(pa(e).getDay()===4),t,2)}function Ele(e){return e.getDay()}function Ale(e,t){return tt(Kp.count(pa(e)-1,e),t,2)}function Tle(e,t){return tt(e.getFullYear()%100,t,2)}function Ole(e,t){return e=sL(e),tt(e.getFullYear()%100,t,2)}function _le(e,t){return tt(e.getFullYear()%1e4,t,4)}function Mle(e,t){var n=e.getDay();return e=n>=4||n===0?Kl(e):Kl.ceil(e),tt(e.getFullYear()%1e4,t,4)}function Dle(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+tt(t/60|0,"0",2)+tt(t%60,"0",2)}function YE(e,t){return tt(e.getUTCDate(),t,2)}function Ile(e,t){return tt(e.getUTCHours(),t,2)}function Lle(e,t){return tt(e.getUTCHours()%12||12,t,2)}function Rle(e,t){return tt(1+kg.count(ma(e),e),t,3)}function oL(e,t){return tt(e.getUTCMilliseconds(),t,3)}function Fle(e,t){return oL(e,t)+"000"}function zle(e,t){return tt(e.getUTCMonth()+1,t,2)}function $le(e,t){return tt(e.getUTCMinutes(),t,2)}function Ble(e,t){return tt(e.getUTCSeconds(),t,2)}function Ule(e){var t=e.getUTCDay();return t===0?7:t}function Vle(e,t){return tt(Ng.count(ma(e)-1,e),t,2)}function lL(e){var t=e.getUTCDay();return t>=4||t===0?Gl(e):Gl.ceil(e)}function Wle(e,t){return e=lL(e),tt(Gl.count(ma(e),e)+(ma(e).getUTCDay()===4),t,2)}function Hle(e){return e.getUTCDay()}function Kle(e,t){return tt(Gp.count(ma(e)-1,e),t,2)}function Gle(e,t){return tt(e.getUTCFullYear()%100,t,2)}function qle(e,t){return e=lL(e),tt(e.getUTCFullYear()%100,t,2)}function Yle(e,t){return tt(e.getUTCFullYear()%1e4,t,4)}function Xle(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Gl(e):Gl.ceil(e),tt(e.getUTCFullYear()%1e4,t,4)}function Zle(){return"+0000"}function XE(){return"%"}function ZE(e){return+e}function QE(e){return Math.floor(+e/1e3)}var $o,cL,uL;Qle({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 Qle(e){return $o=Qoe(e),cL=$o.format,$o.parse,uL=$o.utcFormat,$o.utcParse,$o}function Jle(e){return new Date(e)}function ece(e){return e instanceof Date?+e:+new Date(+e)}function OS(e,t,n,r,i,a,s,o,c,u){var d=yS(),f=d.invert,h=d.domain,p=u(".%L"),g=u(":%S"),y=u("%I:%M"),x=u("%I %p"),b=u("%a %d"),v=u("%b %d"),w=u("%B"),k=u("%Y");function S(j){return(c(j)<j?p:o(j)<j?g:s(j)<j?y:a(j)<j?x:r(j)<j?i(j)<j?b:v:n(j)<j?w:k)(j)}return d.invert=function(j){return new Date(f(j))},d.domain=function(j){return arguments.length?h(Array.from(j,ece)):h().map(Jle)},d.ticks=function(j){var N=h();return e(N[0],N[N.length-1],j??10)},d.tickFormat=function(j,N){return N==null?S:u(N)},d.nice=function(j){var N=h();return(!j||typeof j.range!="function")&&(j=t(N[0],N[N.length-1],j??10)),j?h(X3(N,j)):d},d.copy=function(){return Wd(d,OS(e,t,n,r,i,a,s,o,c,u))},d}function tce(){return Gr.apply(OS(Xoe,Zoe,pa,AS,jg,Hd,PS,NS,Zs,cL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function nce(){return Gr.apply(OS(qoe,Yoe,ma,TS,Ng,kg,ES,CS,Zs,uL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Cg(){var e=0,t=1,n,r,i,a,s=Un,o=!1,c;function u(f){return f==null||isNaN(f=+f)?c:s(i===0?.5:(f=(a(f)-n)*i,o?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(o=!!f,u):o},u.interpolator=function(f){return arguments.length?(s=f,u):s};function d(f){return function(h){var p,g;return arguments.length?([p,g]=h,s=f(p,g),u):[s(0),s(1)]}}return u.range=d(cc),u.rangeRound=d(gS),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),u}}function ws(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function dL(){var e=bs(Cg()(Un));return e.copy=function(){return ws(e,dL())},ka.apply(e,arguments)}function fL(){var e=bS(Cg()).domain([1,10]);return e.copy=function(){return ws(e,fL()).base(e.base())},ka.apply(e,arguments)}function hL(){var e=wS(Cg());return e.copy=function(){return ws(e,hL()).constant(e.constant())},ka.apply(e,arguments)}function _S(){var e=SS(Cg());return e.copy=function(){return ws(e,_S()).exponent(e.exponent())},ka.apply(e,arguments)}function rce(){return _S.apply(null,arguments).exponent(.5)}function pL(){var e=[],t=Un;function n(r){if(r!=null&&!isNaN(r=+r))return t((Ud(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(ns),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)=>Use(e,a/r))},n.copy=function(){return pL(t).domain(e)},ka.apply(n,arguments)}function Pg(){var e=0,t=.5,n=1,r=1,i,a,s,o,c,u=Un,d,f=!1,h;function p(y){return isNaN(y=+y)?h:(y=.5+((y=+d(y))-a)*(r*y<r*a?o:c),u(f?Math.max(0,Math.min(1,y)):y))}p.domain=function(y){return arguments.length?([e,t,n]=y,i=d(e=+e),a=d(t=+t),s=d(n=+n),o=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(y){return arguments.length?(f=!!y,p):f},p.interpolator=function(y){return arguments.length?(u=y,p):u};function g(y){return function(x){var b,v,w;return arguments.length?([b,v,w]=x,u=moe(y,[b,v,w]),p):[u(0),u(.5),u(1)]}}return p.range=g(cc),p.rangeRound=g(gS),p.unknown=function(y){return arguments.length?(h=y,p):h},function(y){return d=y,i=y(e),a=y(t),s=y(n),o=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,p}}function mL(){var e=bs(Pg()(Un));return e.copy=function(){return ws(e,mL())},ka.apply(e,arguments)}function gL(){var e=bS(Pg()).domain([.1,1,10]);return e.copy=function(){return ws(e,gL()).base(e.base())},ka.apply(e,arguments)}function yL(){var e=wS(Pg());return e.copy=function(){return ws(e,yL()).constant(e.constant())},ka.apply(e,arguments)}function MS(){var e=SS(Pg());return e.copy=function(){return ws(e,MS()).exponent(e.exponent())},ka.apply(e,arguments)}function ice(){return MS.apply(null,arguments).exponent(.5)}const tu=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:hS,scaleDiverging:mL,scaleDivergingLog:gL,scaleDivergingPow:MS,scaleDivergingSqrt:ice,scaleDivergingSymlog:yL,scaleIdentity:Y3,scaleImplicit:zv,scaleLinear:q3,scaleLog:Z3,scaleOrdinal:fS,scalePoint:Hse,scalePow:kS,scaleQuantile:eL,scaleQuantize:tL,scaleRadial:J3,scaleSequential:dL,scaleSequentialLog:fL,scaleSequentialPow:_S,scaleSequentialQuantile:pL,scaleSequentialSqrt:rce,scaleSequentialSymlog:hL,scaleSqrt:Foe,scaleSymlog:Q3,scaleThreshold:nL,scaleTime:tce,scaleUtc:nce,tickFormat:G3},Symbol.toStringTag,{value:"Module"}));function ace(e){if(e in tu)return tu[e]();var t="scale".concat(Md(e));if(t in tu)return tu[t]()}function JE(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=ace(e);if(r!=null)return r.domain(t).range(n),r}}function DS(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?JE(e.scale,n,r):JE(t,n,r)}function sce(e){return"scale".concat(Md(e))}function oce(e){return sce(e)in tu}var xL=(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")return oce(r)?r:"point"}};function lce(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function vL(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var s;return(s=e(a))!==null&&s!==void 0?s:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var s,o,c=lce(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var u=(s=r[c-1])!==null&&s!==void 0?s:0,d=(o=r[c])!==null&&o!==void 0?o:0;return Math.abs(a-u)<=Math.abs(a-d)?n[c-1]:n[c]}}}function cce(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):vL(e,void 0)}function e5(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?e5(Object(n),!0).forEach(function(r){uce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uce(e,t,n){return(t=dce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dce(e){var t=fce(e,"string");return typeof t=="symbol"?t:t+""}function fce(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 Vv=[0,"auto"],Zt={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,niceTicks:"auto"},bL=(e,t)=>e.cartesianAxis.xAxis[t],ja=(e,t)=>{var n=bL(e,t);return n??Zt},Qt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Vv,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,niceTicks:"auto",width:Ld},wL=(e,t)=>e.cartesianAxis.yAxis[t],Na=(e,t)=>{var n=wL(e,t);return n??Qt},hce={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:""},IS=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??hce},Yn=(e,t,n)=>{switch(t){case"xAxis":return ja(e,n);case"yAxis":return Na(e,n);case"zAxis":return IS(e,n);case"angleAxis":return aS(e,n);case"radiusAxis":return sS(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},pce=(e,t,n)=>{switch(t){case"xAxis":return ja(e,n);case"yAxis":return Na(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Kd=(e,t,n)=>{switch(t){case"xAxis":return ja(e,n);case"yAxis":return Na(e,n);case"angleAxis":return aS(e,n);case"radiusAxis":return sS(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},SL=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function kL(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 jL=e=>e.graphicalItems.cartesianItems,mce=q([un,vg],kL),NL=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Gd=q([jL,Yn,mce],NL,{memoizeOptions:{resultEqualityCheck:wg}}),CL=q([Gd],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(cS)),PL=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),gce=q([Gd],PL),EL=e=>e.map(t=>t.data).filter(Boolean).flat(1),yce=q([Gd],EL,{memoizeOptions:{resultEqualityCheck:wg}}),AL=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},LS=q([yce,v3],AL),TL=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:wn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:wn(i,r)}))):e.map(r=>({value:r})),qd=q([LS,Yn,Gd],TL);function jl(e){if(Li(e)||e instanceof Date){var t=Number(e);if(qe(t))return t}}function t5(e){if(Array.isArray(e)){var t=[jl(e[0]),jl(e[1])];return _i(t)?t:void 0}var n=jl(e);if(n!=null)return[n,n]}function ga(e){return e.map(jl).filter(tr)}function xce(e,t){var n=jl(e),r=jl(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var vce=q([qd],e=>e==null?void 0:e.map(t=>t.value).sort(xce));function OL(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function bce(e,t,n){return!n||typeof t!="number"||Ii(t)?[]:n.length?ga(n.flatMap(r=>{var i=wn(e,r.dataKey),a,s;if(Array.isArray(i)?[a,s]=i:a=s=i,!(!qe(a)||!qe(s)))return[t-a,t+s]})):[]}var rn=e=>{var t=dn(e),n=lc(e);return Kd(e,t,n)},Yd=q([rn],e=>e==null?void 0:e.dataKey),wce=q([CL,v3,rn],F3),_L=(e,t,n,r)=>{var i={},a=t.reduce((s,o)=>{if(o.stackId==null)return s;var c=s[o.stackId];return c==null&&(c=[]),c.push(o),s[o.stackId]=c,s},i);return Object.fromEntries(Object.entries(a).map(s=>{var[o,c]=s,u=r?[...c].reverse():c,d=u.map(lS);return[o,{stackedData:ore(e,d,n),graphicalItems:u}]}))},ML=q([wce,CL,mg,O3],_L),DL=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var s=dre(e,i,a);if(!(s!=null&&s[0]===0&&s[1]===0))return s}},Sce=q([Yn],e=>e.allowDataOverflow),RS=e=>{var t;if(e==null||!("domain"in e))return Vv;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=ga(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:Vv},IL=q([Yn],RS),LL=q([IL,Sce],b3),kce=q([ML,Sa,un,LL],DL,{memoizeOptions:{resultEqualityCheck:bg}}),FS=e=>e.errorBars,jce=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>OL(n,r)),Yp=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(),s=Math.min(...a),o=Math.max(...a);return[s,o]}},RL=(e,t,n,r,i)=>{var a,s;if(n.length>0&&e.forEach(o=>{n.forEach(c=>{var u,d,f=(u=r[c.id])===null||u===void 0?void 0:u.filter(b=>OL(i,b)),h=wn(o,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),p=bce(o,h,f);if(p.length>=2){var g=Math.min(...p),y=Math.max(...p);(a==null||g<a)&&(a=g),(s==null||y>s)&&(s=y)}var x=t5(h);x!=null&&(a=a==null?x[0]:Math.min(a,x[0]),s=s==null?x[1]:Math.max(s,x[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(o=>{var c=t5(wn(o,t.dataKey));c!=null&&(a=a==null?c[0]:Math.min(a,c[0]),s=s==null?c[1]:Math.max(s,c[1]))}),qe(a)&&qe(s))return[a,s]},Nce=q([LS,Yn,gce,FS,un],RL,{memoizeOptions:{resultEqualityCheck:bg}});function Cce(e){var{value:t}=e;if(Li(t)||t instanceof Date)return t}var Pce=(e,t,n)=>{var r=e.map(Cce).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&ND(r))?y3(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},FL=e=>e.referenceElements.dots,uc=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Ece=q([FL,un,vg],uc),zL=e=>e.referenceElements.areas,Ace=q([zL,un,vg],uc),$L=e=>e.referenceElements.lines,Tce=q([$L,un,vg],uc),BL=(e,t)=>{if(e!=null){var n=ga(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Oce=q(Ece,un,BL),UL=(e,t)=>{if(e!=null){var n=ga(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)]}},_ce=q([Ace,un],UL);function Mce(e){var t;if(e.x!=null)return ga([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:ga(n)}function Dce(e){var t;if(e.y!=null)return ga([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:ga(n)}var VL=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Mce(r):Dce(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Ice=q([Tce,un],VL),Lce=q(Oce,Ice,_ce,(e,t,n)=>Yp(e,n,t)),WL=(e,t,n,r,i,a,s,o)=>{if(n!=null)return n;var c=s==="vertical"&&o==="xAxis"||s==="horizontal"&&o==="yAxis",u=c?Yp(r,a,i):Yp(a,i);return gse(t,u,e.allowDataOverflow)},Rce=q([Yn,IL,LL,kce,Nce,Lce,Tt,un],WL,{memoizeOptions:{resultEqualityCheck:bg}}),Fce=[0,1],HL=(e,t,n,r,i,a,s)=>{if(!((e==null||n==null||n.length===0)&&s===void 0)){var{dataKey:o,type:c}=e,u=Ui(t,a);if(u&&o==null){var d;return y3(0,(d=n==null?void 0:n.length)!==null&&d!==void 0?d:0)}return c==="category"?Pce(r,e,u):i==="expand"?Fce:s}},zS=q([Yn,Tt,LS,qd,mg,un,Rce],HL),dc=q([Yn,SL,nS],xL),KL=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=RS(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&_i(e)){if(a)return dE(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return fE(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&_i(e))return dE(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&_i(e))return fE(e,t.tickCount,t.allowDecimals,"adaptive")}}},$S=q([zS,Kd,dc],KL),GL=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&_i(t)&&Array.isArray(n)&&n.length>0){var i,a,s=t[0],o=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],u=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(s,o),Math.max(c,u)]}return t},zce=q([Yn,zS,$S,un],GL),$ce=q(qd,Yn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(ga(e.map(f=>f.value))).sort((f,h)=>f-h),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var s=a-i;if(s===0)return 1/0;for(var o=0;o<r.length-1;o++){var c=r[o],u=r[o+1];if(!(c==null||u==null)){var d=u-c;n=Math.min(n,d)}}return n/s}}),qL=q($ce,Tt,wse,jn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!qe(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var s=ds(n,e*a),o=e*a/2;return o-s-(o-s)/a*s}return 0}),Bce=(e,t,n)=>{var r=ja(e,t);return r==null||typeof r.padding!="string"?0:qL(e,"xAxis",t,n,r.padding)},Uce=(e,t,n)=>{var r=Na(e,t);return r==null||typeof r.padding!="string"?0:qL(e,"yAxis",t,n,r.padding)},Vce=q(ja,Bce,(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}}),Wce=q(Na,Uce,(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}}),Hce=q([jn,Vce,cg,lg,(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]}),Kce=q([jn,Tt,Wce,cg,lg,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:s}=i;return a?[r.height-s.bottom,s.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Xd=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Hce(e,n,r);case"yAxis":return Kce(e,n,r);case"zAxis":return(i=IS(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return I3(e);case"radiusAxis":return L3(e,n);default:return}},YL=q([Yn,Xd],gg),Gce=q([dc,zce],Tse),BS=q([Yn,dc,Gce,YL],DS),XL=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,s=Ui(e,r);if(s&&(i==="number"||a!=="auto"))return t.map(o=>o.value)}},US=q([Tt,qd,Kd,un],XL),Eg=q([BS],uS);q([BS],cce);q([BS,vce],vL);q([Gd,FS,un],jce);function ZL(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Ag=(e,t)=>t,Tg=(e,t,n)=>n,qce=q(sg,Ag,Tg,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(ZL)),Yce=q(og,Ag,Tg,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(ZL)),QL=(e,t)=>({width:e.width,height:t.height}),Xce=(e,t)=>{var n=typeof t.width=="number"?t.width:Ld;return{width:n,height:e.height}},Zce=q(jn,ja,QL),Qce=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Jce=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},eue=q(wa,jn,qce,Ag,Tg,(e,t,n,r,i)=>{var a={},s;return n.forEach(o=>{var c=QL(t,o);s==null&&(s=Qce(t,r,e));var u=r==="top"&&!i||r==="bottom"&&i;a[o.id]=s-Number(u)*c.height,s+=(u?-1:1)*c.height}),a}),tue=q(ba,jn,Yce,Ag,Tg,(e,t,n,r,i)=>{var a={},s;return n.forEach(o=>{var c=Xce(t,o);s==null&&(s=Jce(t,r,e));var u=r==="left"&&!i||r==="right"&&i;a[o.id]=s-Number(u)*c.width,s+=(u?-1:1)*c.width}),a}),nue=(e,t)=>{var n=ja(e,t);if(n!=null)return eue(e,n.orientation,n.mirror)},rue=q([jn,ja,nue,(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}}}),iue=(e,t)=>{var n=Na(e,t);if(n!=null)return tue(e,n.orientation,n.mirror)},aue=q([jn,Na,iue,(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}}}),sue=q(jn,Na,(e,t)=>{var n=typeof t.width=="number"?t.width:Ld;return{width:n,height:e.height}}),JL=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:s}=n,o=Ui(e,r),c=t.map(u=>u.value);if(s&&o&&a==="category"&&i&&ND(c))return c}},VS=q([Tt,qd,Yn,un],JL),n5=q([Tt,pce,dc,Eg,VS,US,Xd,$S,un],(e,t,n,r,i,a,s,o,c)=>{if(t!=null){var u=Ui(e,c);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:c,categoricalDomain:a,duplicateDomain:i,isCategorical:u,niceTicks:o,range:s,realScaleType:n,scale:r}}}),oue=(e,t,n,r,i,a,s,o,c)=>{if(!(t==null||r==null)){var u=Ui(e,c),{type:d,ticks:f,tickCount:h}=t,p=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,g=d==="category"&&r.bandwidth?r.bandwidth()/p:0;g=c==="angleAxis"&&a!=null&&a.length>=2?zr(a[0]-a[1])*2*g:g;var y=f||i;return y?y.map((x,b)=>{var v=s?s.indexOf(x):x,w=r.map(v);return qe(w)?{index:b,coordinate:w+g,value:x,offset:g}:null}).filter(tr):u&&o?o.map((x,b)=>{var v=r.map(x);return qe(v)?{coordinate:v+g,value:x,index:b,offset:g}:null}).filter(tr):r.ticks?r.ticks(h).map((x,b)=>{var v=r.map(x);return qe(v)?{coordinate:v+g,value:x,index:b,offset:g}:null}).filter(tr):r.domain().map((x,b)=>{var v=r.map(x);return qe(v)?{coordinate:v+g,value:s?s[x]:x,index:b,offset:g}:null}).filter(tr)}},eR=q([Tt,Kd,dc,Eg,$S,Xd,VS,US,un],oue),lue=(e,t,n,r,i,a,s)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var o=Ui(e,s),{tickCount:c}=t,u=0;return u=s==="angleAxis"&&(r==null?void 0:r.length)>=2?zr(r[0]-r[1])*2*u:u,o&&a?a.map((d,f)=>{var h=n.map(d);return qe(h)?{coordinate:h+u,value:d,index:f,offset:u}:null}).filter(tr):n.ticks?n.ticks(c).map((d,f)=>{var h=n.map(d);return qe(h)?{coordinate:h+u,value:d,index:f,offset:u}:null}).filter(tr):n.domain().map((d,f)=>{var h=n.map(d);return qe(h)?{coordinate:h+u,value:i?i[d]:d,index:f,offset:u}:null}).filter(tr)}},tR=q([Tt,Kd,Eg,Xd,VS,US,un],lue),nR=q(Yn,Eg,(e,t)=>{if(!(e==null||t==null))return qp(qp({},e),{},{scale:t})}),cue=q([Yn,dc,zS,YL],DS),uue=q([cue],uS);q((e,t,n)=>IS(e,n),uue,(e,t)=>{if(!(e==null||t==null))return qp(qp({},e),{},{scale:t})});var due=q([Tt,sg,og],(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}}),fue=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};q([fue],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var s=Math.abs(a.coordinate-t);s<r&&(r=s,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var rR=e=>e.options.defaultTooltipEventType,iR=e=>e.options.validateTooltipEventTypes;function aR(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function WS(e,t){var n=rR(e),r=iR(e);return aR(t,n,r)}function hue(e){return Oe(t=>WS(t,e))}var sR=(e,t)=>{var n,r=Number(t);if(!(Ii(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},pue=e=>e.tooltip.settings,Ua={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},mue={itemInteraction:{click:Ua,hover:Ua},axisInteraction:{click:Ua,hover:Ua},keyboardInteraction:Ua,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}},oR=Rn({name:"tooltip",initialState:mue,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:wt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=$r(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:wt()},removeTooltipEntrySettings:{reducer(e,t){var n=$r(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:wt()},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:gue,replaceTooltipEntrySettings:yue,removeTooltipEntrySettings:xue,setTooltipSettingsState:vue,setActiveMouseOverItemIndex:bue,mouseLeaveItem:X0e,mouseLeaveChart:lR,setActiveClickItemIndex:Z0e,setMouseOverAxisIndex:cR,setMouseClickAxisIndex:wue,setSyncInteraction:Wv,setKeyboardInteraction:Xp}=oR.actions,Sue=oR.reducer;function r5(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 Kf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r5(Object(n),!0).forEach(function(r){kue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kue(e,t,n){return(t=jue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jue(e){var t=Nue(e,"string");return typeof t=="symbol"?t:t+""}function Nue(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 Cue(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Pue(e){return e.index!=null}var uR=(e,t,n,r)=>{if(t==null)return Ua;var i=Cue(e,t,n);if(i==null)return Ua;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(Pue(i)){if(a)return Kf(Kf({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Kf(Kf({},Ua),{},{coordinate:i.coordinate})};function Eue(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 Aue(e,t){var n=Eue(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),s=Math.max(r,i);return n>=a&&n<=s}function Tue(e,t,n){if(n==null||t==null)return!0;var r=wn(e,t);return r==null||!_i(n)?!0:Aue(r,n)}var HS=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!qe(a))return i;var s=0,o=1/0;t.length>0&&(o=t.length-1);var c=Math.max(s,Math.min(a,o)),u=t[c];return u==null||Tue(u,n,r)?String(c):null},dR=(e,t,n,r,i,a,s)=>{if(a!=null){var o=s[0],c=o==null?void 0:o.getPosition(a);if(c!=null)return c;var u=i==null?void 0:i[Number(a)];if(u)switch(n){case"horizontal":return{x:u.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:u.coordinate}}}},fR=(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,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&r!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(s=>{var o;return((o=s.settings)===null||o===void 0?void 0:o.graphicalItemId)===i})},hR=e=>e.options.tooltipPayloadSearcher,fc=e=>e.tooltip;function i5(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 a5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i5(Object(n),!0).forEach(function(r){Oue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oue(e,t,n){return(t=_ue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ue(e){var t=Mue(e,"string");return typeof t=="symbol"?t:t+""}function Mue(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 Due(e){if(typeof e=="string"||typeof e=="number")return e}function Iue(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Lue(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function s5(e){if(typeof e=="string")return e}function Rue(e){if(!(e==null||typeof e!="object")){var t="name"in e?Due(e.name):void 0,n="unit"in e?Iue(e.unit):void 0,r="dataKey"in e?Lue(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?s5(e.color):void 0,s="fill"in e?s5(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:s}}}function Fue(e,t){return e??t}var pR=(e,t,n,r,i,a,s)=>{if(!(t==null||a==null)){var{chartData:o,computedData:c,dataStartIndex:u,dataEndIndex:d}=n,f=[];return e.reduce((h,p)=>{var g,{dataDefinedOnItem:y,settings:x}=p,b=Fue(y,o),v=Array.isArray(b)?FI(b,u,d):b,w=(g=x==null?void 0:x.dataKey)!==null&&g!==void 0?g:r,k=x==null?void 0:x.nameKey,S;if(r&&Array.isArray(v)&&!Array.isArray(v[0])&&s==="axis"?S=CD(v,r,i):S=a(v,t,c,k),Array.isArray(S))S.forEach(N=>{var P,A,E=Rue(N),O=E==null?void 0:E.name,C=E==null?void 0:E.dataKey,M=E==null?void 0:E.payload,I=a5(a5({},x),{},{name:O,unit:E==null?void 0:E.unit,color:(P=E==null?void 0:E.color)!==null&&P!==void 0?P:x==null?void 0:x.color,fill:(A=E==null?void 0:E.fill)!==null&&A!==void 0?A:x==null?void 0:x.fill});h.push(cP({tooltipEntrySettings:I,dataKey:C,payload:M,value:wn(M,C),name:O==null?void 0:String(O)}))});else{var j;h.push(cP({tooltipEntrySettings:x,dataKey:w,payload:S,value:wn(S,w),name:(j=wn(S,k))!==null&&j!==void 0?j:x==null?void 0:x.name}))}return h},f)}},KS=q([rn,SL,nS],xL),zue=q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),$ue=q([dn,lc],kL),hc=q([zue,rn,$ue],NL,{memoizeOptions:{resultEqualityCheck:wg}}),Bue=q([hc],e=>e.filter(cS)),Uue=q([hc],EL,{memoizeOptions:{resultEqualityCheck:wg}}),pc=q([Uue,Sa],AL),Vue=q([Bue,Sa,rn],F3),GS=q([pc,rn,hc],TL),mR=q([rn],RS),Wue=q([rn],e=>e.allowDataOverflow),gR=q([mR,Wue],b3),Hue=q([hc],e=>e.filter(cS)),Kue=q([Vue,Hue,mg,O3],_L),Gue=q([Kue,Sa,dn,gR],DL),que=q([hc],PL),Yue=q([pc,rn,que,FS,dn],RL,{memoizeOptions:{resultEqualityCheck:bg}}),Xue=q([FL,dn,lc],uc),Zue=q([Xue,dn],BL),Que=q([zL,dn,lc],uc),Jue=q([Que,dn],UL),ede=q([$L,dn,lc],uc),tde=q([ede,dn],VL),nde=q([Zue,tde,Jue],Yp),rde=q([rn,mR,gR,Gue,Yue,nde,Tt,dn],WL),Zd=q([rn,Tt,pc,GS,mg,dn,rde],HL),ide=q([Zd,rn,KS],KL),ade=q([rn,Zd,ide,dn],GL),yR=e=>{var t=dn(e),n=lc(e),r=!1;return Xd(e,t,n,r)},xR=q([rn,yR],gg),sde=q([rn,KS,ade,xR],DS),vR=q([sde],uS),ode=q([Tt,GS,rn,dn],JL),lde=q([Tt,GS,rn,dn],XL),cde=(e,t,n,r,i,a,s,o)=>{if(t){var{type:c}=t,u=Ui(e,o);if(r){var d=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,f=c==="category"&&r.bandwidth?r.bandwidth()/d:0;return f=o==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?zr(i[0]-i[1])*2*f:f,u&&s?s.map((h,p)=>{var g=r.map(h);return qe(g)?{coordinate:g+f,value:h,index:p,offset:f}:null}).filter(tr):r.domain().map((h,p)=>{var g=r.map(h);return qe(g)?{coordinate:g+f,value:a?a[h]:h,index:p,offset:f}:null}).filter(tr)}}},Ca=q([Tt,rn,KS,vR,yR,ode,lde,dn],cde),qS=q([rR,iR,pue],(e,t,n)=>aR(n.shared,e,t)),bR=e=>e.tooltip.settings.trigger,YS=e=>e.tooltip.settings.defaultIndex,Qd=q([fc,qS,bR,YS],uR),dd=q([Qd,pc,Yd,Zd],HS),wR=q([Ca,dd],sR),ude=q([Qd],e=>{if(e)return e.dataKey}),dde=q([Qd],e=>{if(e)return e.graphicalItemId}),SR=q([fc,qS,bR,YS],fR),fde=q([ba,wa,Tt,jn,Ca,YS,SR],dR),hde=q([Qd,fde],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),pde=q([Qd],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),mde=q([SR,dd,Sa,Yd,wR,hR,qS],pR),gde=q([mde],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function o5(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 l5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o5(Object(n),!0).forEach(function(r){yde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yde(e,t,n){return(t=xde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xde(e){var t=vde(e,"string");return typeof t=="symbol"?t:t+""}function vde(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 bde=()=>Oe(rn),wde=()=>{var e=bde(),t=Oe(Ca),n=Oe(vR);return Cp(!e||!n?void 0:l5(l5({},e),{},{scale:n}),t)};function c5(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 Bo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c5(Object(n),!0).forEach(function(r){Sde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sde(e,t,n){return(t=kde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kde(e){var t=jde(e,"string");return typeof t=="symbol"?t:t+""}function jde(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 Nde=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},Cde=(e,t,n,r)=>{var i=t.find(u=>u&&u.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:s}=r;return Bo(Bo(Bo({},r),vn(r.cx,r.cy,s,a)),{},{angle:a,radius:s})}var o=i.coordinate,{angle:c}=r;return Bo(Bo(Bo({},r),vn(r.cx,r.cy,o,c)),{},{angle:c,radius:o})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Pde(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var kR=(e,t,n,r,i)=>{var a,s=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(s<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=0;o<s;o++){var c,u,d,f,h,p=o>0?(c=n[o-1])===null||c===void 0?void 0:c.coordinate:(u=n[s-1])===null||u===void 0?void 0:u.coordinate,g=(d=n[o])===null||d===void 0?void 0:d.coordinate,y=o>=s-1?(f=n[0])===null||f===void 0?void 0:f.coordinate:(h=n[o+1])===null||h===void 0?void 0:h.coordinate,x=void 0;if(!(p==null||g==null||y==null))if(zr(g-p)!==zr(y-g)){var b=[];if(zr(y-g)===zr(i[1]-i[0])){x=y;var v=g+i[1]-i[0];b[0]=Math.min(v,(v+p)/2),b[1]=Math.max(v,(v+p)/2)}else{x=p;var w=y+i[1]-i[0];b[0]=Math.min(g,(w+g)/2),b[1]=Math.max(g,(w+g)/2)}var k=[Math.min(g,(x+g)/2),Math.max(g,(x+g)/2)];if(e>k[0]&&e<=k[1]||e>=b[0]&&e<=b[1]){var S;return(S=n[o])===null||S===void 0?void 0:S.index}}else{var j=Math.min(p,y),N=Math.max(p,y);if(e>(j+g)/2&&e<=(N+g)/2){var P;return(P=n[o])===null||P===void 0?void 0:P.index}}}else if(t)for(var A=0;A<s;A++){var E=t[A];if(E!=null){var O=t[A+1],C=t[A-1];if(A===0&&O!=null&&e<=(E.coordinate+O.coordinate)/2||A===s-1&&C!=null&&e>(E.coordinate+C.coordinate)/2||A>0&&A<s-1&&C!=null&&O!=null&&e>(E.coordinate+C.coordinate)/2&&e<=(E.coordinate+O.coordinate)/2)return E.index}}return-1},jR=()=>Oe(nS),XS=(e,t)=>t,NR=(e,t,n)=>n,ZS=(e,t,n,r)=>r,Ede=q(Ca,e=>Xm(e,t=>t.coordinate)),QS=q([fc,XS,NR,ZS],uR),JS=q([QS,pc,Yd,Zd],HS),Ade=(e,t,n)=>{if(t!=null){var r=fc(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},CR=q([fc,XS,NR,ZS],fR),Zp=q([ba,wa,Tt,jn,Ca,ZS,CR],dR),Tde=q([QS,Zp],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),PR=q([Ca,JS],sR),Ode=q([CR,JS,Sa,Yd,PR,hR,XS],pR),_de=q([QS,JS],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Mde=(e,t,n,r,i,a,s)=>{if(!(!e||!n||!r||!i)&&Pde(e,s)){var o=fre(e,t),c=kR(o,a,i,n,r),u=Nde(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},Dde=(e,t,n,r,i,a,s)=>{if(!(!e||!r||!i||!a||!n)){var o=lse(e,n);if(o){var c=hre(o,t),u=kR(c,s,a,r,i),d=Cde(t,a,u,o);return{activeIndex:String(u),activeCoordinate:d}}}},Ide=(e,t,n,r,i,a,s,o)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?Mde(e,t,r,i,a,s,o):Dde(e,t,n,r,i,a,s)},Lde=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}}),Rde=q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Bn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Ase}});function u5(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 d5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u5(Object(n),!0).forEach(function(r){Fde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fde(e,t,n){return(t=zde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zde(e){var t=$de(e,"string");return typeof t=="symbol"?t:t+""}function $de(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 Bde={},Ude={zIndexMap:Object.values(Bn).reduce((e,t)=>d5(d5({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Bde)},Vde=new Set(Object.values(Bn));function Wde(e){return Vde.has(e)}var ER=Rn({name:"zIndex",initialState:Ude,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:wt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Wde(n)&&delete e.zIndexMap[n])},prepare:wt()},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:wt()},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:wt()}}}),{registerZIndexPortal:Hde,unregisterZIndexPortal:Kde,registerZIndexPortalElement:Gde,unregisterZIndexPortalElement:qde}=ER.actions,Yde=ER.reducer;function Pa(e){var{zIndex:t,children:n}=e,r=Ure(),i=r&&t!==void 0&&t!==0,a=cr(),s=Bt();m.useLayoutEffect(()=>i?(s(Hde({zIndex:t})),()=>{s(Kde({zIndex:t}))}):Ao,[s,t,i]);var o=Oe(c=>Lde(c,t,a));return i?o?Co.createPortal(n,o):null:n}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 f5(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 Gf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f5(Object(n),!0).forEach(function(r){Xde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xde(e,t,n){return(t=Zde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zde(e){var t=Qde(e,"string");return typeof t=="symbol"?t:t+""}function Qde(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 Jde(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return m.isValidElement(t)?m.cloneElement(t,r):m.createElement(n,r)}function efe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:s,layout:o,cursor:c,tooltipEventType:u,chartName:d}=e,f=n,h=r,p=i;if(!c||!f||d!=="ScatterChart"&&u!=="axis")return null;var g,y,x;if(d==="ScatterChart")g=f,y=bae,x=Bn.cursorLine;else if(d==="BarChart")g=wae(o,f,a,s),y=Qae,x=Bn.cursorRectangle;else if(o==="radial"&&AD(f)){var{cx:b,cy:v,radius:w,startAngle:k,endAngle:S}=f3(f);g={cx:b,cy:v,startAngle:k,endAngle:S,innerRadius:w,outerRadius:w},y=fse,x=Bn.cursorLine}else g={points:hse(o,f,a)},y=wh,x=Bn.cursorLine;var j=typeof c=="object"&&"className"in c?c.className:void 0,N=Gf(Gf(Gf(Gf({stroke:"#ccc",pointerEvents:"none"},a),g),$m(c)),{},{payload:h,payloadIndex:p,className:ot("recharts-tooltip-cursor",j)});return m.createElement(Pa,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:x},m.createElement(Jde,{cursor:c,cursorComp:y,cursorProps:N}))}function tfe(e){var t=wde(),n=XI(),r=ac(),i=jR();return t==null||n==null||r==null||i==null?null:m.createElement(efe,Hv({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var AR=m.createContext(null),nfe=()=>m.useContext(AR),TR={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new i(d,f||c,h),g=n?n+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],p]:c._events[g].push(p):(c._events[g]=p,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},o.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,g=new Array(p);h<p;h++)g[h]=f[h].fn;return g},o.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},o.prototype.emit=function(u,d,f,h,p,g){var y=n?n+u:u;if(!this._events[y])return!1;var x=this._events[y],b=arguments.length,v,w;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),b){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,d),!0;case 3:return x.fn.call(x.context,d,f),!0;case 4:return x.fn.call(x.context,d,f,h),!0;case 5:return x.fn.call(x.context,d,f,h,p),!0;case 6:return x.fn.call(x.context,d,f,h,p,g),!0}for(w=1,v=new Array(b-1);w<b;w++)v[w-1]=arguments[w];x.fn.apply(x.context,v)}else{var k=x.length,S;for(w=0;w<k;w++)switch(x[w].once&&this.removeListener(u,x[w].fn,void 0,!0),b){case 1:x[w].fn.call(x[w].context);break;case 2:x[w].fn.call(x[w].context,d);break;case 3:x[w].fn.call(x[w].context,d,f);break;case 4:x[w].fn.call(x[w].context,d,f,h);break;default:if(!v)for(S=1,v=new Array(b-1);S<b;S++)v[S-1]=arguments[S];x[w].fn.apply(x[w].context,v)}}return!0},o.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},o.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},o.prototype.removeListener=function(u,d,f,h){var p=n?n+u:u;if(!this._events[p])return this;if(!d)return s(this,p),this;var g=this._events[p];if(g.fn)g.fn===d&&(!h||g.once)&&(!f||g.context===f)&&s(this,p);else{for(var y=0,x=[],b=g.length;y<b;y++)(g[y].fn!==d||h&&!g[y].once||f&&g[y].context!==f)&&x.push(g[y]);x.length?this._events[p]=x.length===1?x[0]:x:s(this,p)}return this},o.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&s(this,d)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o})(TR);var rfe=TR.exports;const ife=hi(rfe);var fd=new ife,Kv="recharts.syncEvent.tooltip",h5="recharts.syncEvent.brush",afe=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Ii(n))return e[n]}},sfe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},OR=Rn({name:"options",initialState:sfe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),ofe=OR.reducer,{createEventEmitter:lfe}=OR.actions;function cfe(e){return e.tooltip.syncInteraction}var ufe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},_R=Rn({name:"chartData",initialState:ufe,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:p5,setDataStartEndIndexes:dfe,setComputedData:Q0e}=_R.actions,ffe=_R.reducer,hfe=["x","y"];function m5(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 Uo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m5(Object(n),!0).forEach(function(r){pfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pfe(e,t,n){return(t=mfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mfe(e){var t=gfe(e,"string");return typeof t=="symbol"?t:t+""}function gfe(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 yfe(e,t){if(e==null)return{};var n,r,i=xfe(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 xfe(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 vfe(){var e=Oe(rS),t=Oe(iS),n=Bt(),r=Oe(_3),i=Oe(Ca),a=ac(),s=ug(),o=Oe(c=>c.rootProps.className);m.useEffect(()=>{if(e==null)return Ao;var c=(u,d,f)=>{if(t!==f&&e===u){if(r==="index"){var h;if(s&&d!==null&&d!==void 0&&(h=d.payload)!==null&&h!==void 0&&h.coordinate&&d.payload.sourceViewBox){var p=d.payload.coordinate,{x:g,y}=p,x=yfe(p,hfe),{x:b,y:v,width:w,height:k}=d.payload.sourceViewBox,S=Uo(Uo({},x),{},{x:s.x+(w?(g-b)/w:0)*s.width,y:s.y+(k?(y-v)/k:0)*s.height});n(Uo(Uo({},d),{},{payload:Uo(Uo({},d.payload),{},{coordinate:S})}))}else n(d);return}if(i!=null){var j;if(typeof r=="function"){var N={activeTooltipIndex:d.payload.index==null?void 0:Number(d.payload.index),isTooltipActive:d.payload.active,activeIndex:d.payload.index==null?void 0:Number(d.payload.index),activeLabel:d.payload.label,activeDataKey:d.payload.dataKey,activeCoordinate:d.payload.coordinate},P=r(i,N);j=i[P]}else r==="value"&&(j=i.find(se=>String(se.value)===d.payload.label));var{coordinate:A}=d.payload;if(j==null||d.payload.active===!1||A==null||s==null){n(Wv({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:E,y:O}=A,C=Math.min(E,s.x+s.width),M=Math.min(O,s.y+s.height),I={x:a==="horizontal"?j.coordinate:C,y:a==="horizontal"?M:j.coordinate},B=Wv({active:d.payload.active,coordinate:I,dataKey:d.payload.dataKey,index:String(j.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n(B)}}};return fd.on(Kv,c),()=>{fd.off(Kv,c)}},[o,n,t,e,r,i,a,s])}function bfe(){var e=Oe(rS),t=Oe(iS),n=Bt();m.useEffect(()=>{if(e==null)return Ao;var r=(i,a,s)=>{t!==s&&e===i&&n(dfe(a))};return fd.on(h5,r),()=>{fd.off(h5,r)}},[n,t,e])}function wfe(){var e=Bt();m.useEffect(()=>{e(lfe())},[e]),vfe(),bfe()}function Sfe(e,t,n,r,i,a){var s=Oe(g=>Ade(g,e,t)),o=Oe(dde),c=Oe(iS),u=Oe(rS),d=Oe(_3),f=Oe(cfe),h=f==null?void 0:f.active,p=ug();m.useEffect(()=>{if(!h&&u!=null&&c!=null){var g=Wv({active:a,coordinate:n,dataKey:s,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:p,graphicalItemId:o});fd.emit(Kv,u,g,c)}},[h,n,s,o,i,r,c,u,d,a,p])}function g5(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 y5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g5(Object(n),!0).forEach(function(r){kfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kfe(e,t,n){return(t=jfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jfe(e){var t=Nfe(e,"string");return typeof t=="symbol"?t:t+""}function Nfe(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 Cfe(e){return e.dataKey}function Pfe(e,t){return m.isValidElement(e)?m.cloneElement(e,t):typeof e=="function"?m.createElement(e,t):m.createElement(Yie,t)}var x5=[],Efe={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 ek(e){var t,n,r=lr(e,Efe),{active:i,allowEscapeViewBox:a,animationDuration:s,animationEasing:o,content:c,filterNull:u,isAnimationActive:d,offset:f,payloadUniqBy:h,position:p,reverseDirection:g,useTranslate3d:y,wrapperStyle:x,cursor:b,shared:v,trigger:w,defaultIndex:k,portal:S,axisId:j}=r,N=Bt(),P=typeof k=="number"?String(k):k;m.useEffect(()=>{N(vue({shared:v,trigger:w,axisId:j,active:i,defaultIndex:P}))},[N,v,w,j,i,P]);var A=ug(),E=s3(),O=hue(v),{activeIndex:C,isActive:M}=(t=Oe(ye=>_de(ye,O,w,P)))!==null&&t!==void 0?t:{},I=Oe(ye=>Ode(ye,O,w,P)),B=Oe(ye=>PR(ye,O,w,P)),se=Oe(ye=>Tde(ye,O,w,P)),Q=I,D=nfe(),K=(n=i??M)!==null&&n!==void 0?n:!1,[T,ie]=lI([Q,K]),J=O==="axis"?B:void 0;Sfe(O,w,se,J,C,K);var _=S??D;if(_==null||A==null||O==null)return null;var H=Q??x5;K||(H=x5),u&&H.length&&(H=XD(H.filter(ye=>ye.value!=null&&(ye.hide!==!0||r.includeHidden)),h,Cfe));var ee=H.length>0,be=y5(y5({},r),{},{payload:H,label:J,active:K,activeIndex:C,coordinate:se,accessibilityLayer:E}),te=m.createElement(sae,{allowEscapeViewBox:a,animationDuration:s,animationEasing:o,isAnimationActive:d,active:K,coordinate:se,hasPayload:ee,offset:f,position:p,reverseDirection:g,useTranslate3d:y,viewBox:A,wrapperStyle:x,lastBoundingBox:T,innerRef:ie,hasPortalFromProps:!!S},Pfe(c,be));return m.createElement(m.Fragment,null,Co.createPortal(te,_),K&&m.createElement(tfe,{cursor:b,tooltipEventType:O,coordinate:se,payload:H,index:C}))}function Afe(e,t,n){return(t=Tfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tfe(e){var t=Ofe(e,"string");return typeof t=="symbol"?t:t+""}function Ofe(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 _fe{constructor(t){Afe(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 v5(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 Mfe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v5(Object(n),!0).forEach(function(r){Dfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dfe(e,t,n){return(t=Ife(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ife(e){var t=Lfe(e,"string");return typeof t=="symbol"?t:t+""}function Lfe(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 Rfe={cacheSize:2e3,enableCache:!0},MR=Mfe({},Rfe),b5=new _fe(MR.cacheSize),Ffe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},w5="recharts_measurement_span";function zfe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",s=t.letterSpacing||"",o=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(s,"|").concat(o)}var S5=(e,t)=>{try{var n=document.getElementById(w5);n||(n=document.createElement("span"),n.setAttribute("id",w5),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Ffe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},vu=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Bd.isSsr)return{width:0,height:0};if(!MR.enableCache)return S5(t,n);var r=zfe(t,n),i=b5.get(r);if(i)return i;var a=S5(t,n);return b5.set(r,a),a},DR;function $fe(e,t,n){return(t=Bfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bfe(e){var t=Ufe(e,"string");return typeof t=="symbol"?t:t+""}function Ufe(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 k5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,j5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Vfe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Wfe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Hfe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Kfe=["cm","mm","pt","pc","in","Q","px"];function Gfe(e){return Kfe.includes(e)}var fl="NaN";function qfe(e,t){return e*Hfe[t]}class xn{static parse(t){var n,[,r,i]=(n=Wfe.exec(t))!==null&&n!==void 0?n:[];return r==null?xn.NaN:new xn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Ii(t)&&(this.unit=""),n!==""&&!Vfe.test(n)&&(this.num=NaN,this.unit=""),Gfe(n)&&(this.num=qfe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new xn(NaN,""):new xn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new xn(NaN,""):new xn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new xn(NaN,""):new xn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new xn(NaN,""):new xn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Ii(this.num)}}DR=xn;$fe(xn,"NaN",new DR(NaN,""));function IR(e){if(e==null||e.includes(fl))return fl;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=k5.exec(t))!==null&&n!==void 0?n:[],s=xn.parse(r??""),o=xn.parse(a??""),c=i==="*"?s.multiply(o):s.divide(o);if(c.isNaN())return fl;t=t.replace(k5,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,h]=(u=j5.exec(t))!==null&&u!==void 0?u:[],p=xn.parse(d??""),g=xn.parse(h??""),y=f==="+"?p.add(g):p.subtract(g);if(y.isNaN())return fl;t=t.replace(j5,y.toString())}return t}var N5=/\(([^()]*)\)/;function Yfe(e){for(var t=e,n;(n=N5.exec(t))!=null;){var[,r]=n;t=t.replace(N5,IR(r))}return t}function Xfe(e){var t=e.replace(/\s+/g,"");return t=Yfe(t),t=IR(t),t}function Zfe(e){try{return Xfe(e)}catch{return fl}}function vy(e){var t=Zfe(e.slice(5,-1));return t===fl?"":t}var Qfe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Jfe=["dx","dy","angle","className","breakAll"];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 C5(e,t){if(e==null)return{};var n,r,i=ehe(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 ehe(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 LR=/[ \f\n\r\t\v\u2028\u2029]+/,RR=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];kn(t)||(n?i=t.toString().split(""):i=t.toString().split(LR));var a=i.map(o=>({word:o,width:vu(o,r).width})),s=n?0:vu(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch{return null}};function FR(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function the(e){return kn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var zR=(e,t,n,r)=>e.reduce((i,a)=>{var{word:s,width:o}=a,c=i[i.length-1];if(c&&o!=null&&(t==null||r||c.width+o+n<Number(t)))c.words.push(s),c.width+=o+n;else{var u={words:[s],width:o};i.push(u)}return i},[]),$R=e=>e.reduce((t,n)=>t.width>n.width?t:n),nhe="…",P5=(e,t,n,r,i,a,s,o)=>{var c=e.slice(0,t),u=RR({breakAll:n,style:r,children:c+nhe});if(!u)return[!1,[]];var d=zR(u.wordsWithComputedWidth,a,s,o),f=d.length>i||$R(d).width>Number(a);return[f,d]},rhe=(e,t,n,r,i)=>{var{maxLines:a,children:s,style:o,breakAll:c}=e,u=Pe(a),d=String(s),f=zR(t,r,n,i);if(!u||i)return f;var h=f.length>a||$R(f).width>Number(r);if(!h)return f;for(var p=0,g=d.length-1,y=0,x;p<=g&&y<=d.length-1;){var b=Math.floor((p+g)/2),v=b-1,[w,k]=P5(d,v,c,o,a,r,n,i),[S]=P5(d,b,c,o,a,r,n,i);if(!w&&!S&&(p=b+1),w&&S&&(g=b-1),!w&&S){x=k;break}y++}return x||f},E5=e=>{var t=kn(e)?[]:e.toString().split(LR);return[{words:t,width:void 0}]},ihe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:s}=e;if((t||n)&&!Bd.isSsr){var o,c,u=RR({breakAll:a,children:r,style:i});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;o=d,c=f}else return E5(r);return rhe({breakAll:a,children:r,maxLines:s,style:i},o,c,t,!!n)}return E5(r)},BR="#808080",ahe={angle:0,breakAll:!1,capHeight:"0.71em",fill:BR,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},tk=m.forwardRef((e,t)=>{var n=lr(e,ahe),{x:r,y:i,lineHeight:a,capHeight:s,fill:o,scaleToFit:c,textAnchor:u,verticalAnchor:d}=n,f=C5(n,Qfe),h=m.useMemo(()=>ihe({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:p,dy:g,angle:y,className:x,breakAll:b}=f,v=C5(f,Jfe);if(!Li(r)||!Li(i)||h.length===0)return null;var w=Number(r)+(Pe(p)?p:0),k=Number(i)+(Pe(g)?g:0);if(!qe(w)||!qe(k))return null;var S;switch(d){case"start":S=vy("calc(".concat(s,")"));break;case"middle":S=vy("calc(".concat((h.length-1)/2," * -").concat(a," + (").concat(s," / 2))"));break;default:S=vy("calc(".concat(h.length-1," * -").concat(a,")"));break}var j=[],N=h[0];if(c&&N!=null){var P=N.width,{width:A}=f;j.push("scale(".concat(Pe(A)&&Pe(P)?A/P:1,")"))}return y&&j.push("rotate(".concat(y,", ").concat(w,", ").concat(k,")")),j.length&&(v.transform=j.join(" ")),m.createElement("text",Gv({},kr(v),{ref:t,x:w,y:k,className:ot("recharts-text",x),textAnchor:u,fill:o.includes("url")?BR:o}),h.map((E,O)=>{var C=E.words.join(b?"":" ");return m.createElement("tspan",{x:w,dy:O===0?S:a,key:"".concat(C,"-").concat(O)},C)}))});tk.displayName="Text";function A5(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 vi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A5(Object(n),!0).forEach(function(r){she(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function she(e,t,n){return(t=ohe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ohe(e){var t=lhe(e,"string");return typeof t=="symbol"?t:t+""}function lhe(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 che=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:s,height:o,upperWidth:c,lowerWidth:u}=G1(t),d=a,f=a+(c-u)/2,h=(d+f)/2,p=(c+u)/2,g=d+c/2,y=o>=0?1:-1,x=y*r,b=y>0?"end":"start",v=y>0?"start":"end",w=c>=0?1:-1,k=w*r,S=w>0?"end":"start",j=w>0?"start":"end",N=i;if(n==="top"){var P={x:d+c/2,y:s-x,horizontalAnchor:"middle",verticalAnchor:b};return N&&(P.height=Math.max(s-N.y,0),P.width=c),P}if(n==="bottom"){var A={x:f+u/2,y:s+o+x,horizontalAnchor:"middle",verticalAnchor:v};return N&&(A.height=Math.max(N.y+N.height-(s+o),0),A.width=u),A}if(n==="left"){var E={x:h-k,y:s+o/2,horizontalAnchor:S,verticalAnchor:"middle"};return N&&(E.width=Math.max(E.x-N.x,0),E.height=o),E}if(n==="right"){var O={x:h+p+k,y:s+o/2,horizontalAnchor:j,verticalAnchor:"middle"};return N&&(O.width=Math.max(N.x+N.width-O.x,0),O.height=o),O}var C=N?{width:p,height:o}:{};return n==="insideLeft"?vi({x:h+k,y:s+o/2,horizontalAnchor:j,verticalAnchor:"middle"},C):n==="insideRight"?vi({x:h+p-k,y:s+o/2,horizontalAnchor:S,verticalAnchor:"middle"},C):n==="insideTop"?vi({x:d+c/2,y:s+x,horizontalAnchor:"middle",verticalAnchor:v},C):n==="insideBottom"?vi({x:f+u/2,y:s+o-x,horizontalAnchor:"middle",verticalAnchor:b},C):n==="insideTopLeft"?vi({x:d+k,y:s+x,horizontalAnchor:j,verticalAnchor:v},C):n==="insideTopRight"?vi({x:d+c-k,y:s+x,horizontalAnchor:S,verticalAnchor:v},C):n==="insideBottomLeft"?vi({x:f+k,y:s+o-x,horizontalAnchor:j,verticalAnchor:b},C):n==="insideBottomRight"?vi({x:f+u-k,y:s+o-x,horizontalAnchor:S,verticalAnchor:b},C):n&&typeof n=="object"&&(Pe(n.x)||xo(n.x))&&(Pe(n.y)||xo(n.y))?vi({x:a+ds(n.x,p),y:s+ds(n.y,o),horizontalAnchor:"end",verticalAnchor:"end"},C):vi({x:g,y:s+o/2,horizontalAnchor:"middle",verticalAnchor:"middle"},C)},uhe=["labelRef"],dhe=["content"];function T5(e,t){if(e==null)return{};var n,r,i=fhe(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 fhe(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 O5(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 nu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O5(Object(n),!0).forEach(function(r){hhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hhe(e,t,n){return(t=phe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function phe(e){var t=mhe(e,"string");return typeof t=="symbol"?t:t+""}function mhe(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 Gi(){return Gi=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},Gi.apply(null,arguments)}var UR=m.createContext(null),ghe=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:s,children:o}=e,c=m.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:s}),[t,n,r,i,a,s]);return m.createElement(UR.Provider,{value:c},o)},VR=()=>{var e=m.useContext(UR),t=ug();return e||(t?G1(t):void 0)},yhe=m.createContext(null),xhe=()=>{var e=m.useContext(yhe),t=Oe(R3);return e||t},vhe=e=>{var{value:t,formatter:n}=e,r=kn(e.children)?t:e.children;return typeof n=="function"?n(r):r},nk=e=>e!=null&&typeof e=="function",bhe=(e,t)=>{var n=zr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},whe=(e,t,n,r,i)=>{var{offset:a,className:s}=e,{cx:o,cy:c,innerRadius:u,outerRadius:d,startAngle:f,endAngle:h,clockWise:p}=i,g=(u+d)/2,y=bhe(f,h),x=y>=0?1:-1,b,v;switch(t){case"insideStart":b=f+x*a,v=p;break;case"insideEnd":b=h-x*a,v=!p;break;case"end":b=h+x*a,v=p;break;default:throw new Error("Unsupported position ".concat(t))}v=y<=0?v:!v;var w=vn(o,c,g,b),k=vn(o,c,g,b+(v?1:-1)*359),S="M".concat(w.x,",").concat(w.y,`
739
+ A`).concat(g,",").concat(g,",0,1,").concat(v?0:1,`,
740
+ `).concat(k.x,",").concat(k.y),j=kn(e.id)?Qu("recharts-radial-line-"):e.id;return m.createElement("text",Gi({},r,{dominantBaseline:"central",className:ot("recharts-radial-bar-label",s)}),m.createElement("defs",null,m.createElement("path",{id:j,d:S})),m.createElement("textPath",{xlinkHref:"#".concat(j)},n))},She=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:s,startAngle:o,endAngle:c}=e,u=(o+c)/2;if(n==="outside"){var{x:d,y:f}=vn(r,i,s+t,u);return{x:d,y:f,textAnchor:d>=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 h=(a+s)/2,{x:p,y:g}=vn(r,i,h,u);return{x:p,y:g,textAnchor:"middle",verticalAnchor:"middle"}},Sh=e=>e!=null&&"cx"in e&&Pe(e.cx),khe={angle:0,offset:5,zIndex:Bn.label,position:"middle",textBreakAll:!1};function jhe(e){if(!Sh(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 za(e){var t=lr(e,khe),{viewBox:n,parentViewBox:r,position:i,value:a,children:s,content:o,className:c="",textBreakAll:u,labelRef:d}=t,f=xhe(),h=VR(),p=i==="center"?h:f??h,g,y,x;n==null?g=p:Sh(n)?g=n:g=G1(n);var b=jhe(g);if(!g||kn(a)&&kn(s)&&!m.isValidElement(o)&&typeof o!="function")return null;var v=nu(nu({},t),{},{viewBox:g});if(m.isValidElement(o)){var{labelRef:w}=v,k=T5(v,uhe);return m.cloneElement(o,k)}if(typeof o=="function"){var{content:S}=v,j=T5(v,dhe);if(y=m.createElement(o,j),m.isValidElement(y))return y}else y=vhe(t);var N=kr(t);if(Sh(g)){if(i==="insideStart"||i==="insideEnd"||i==="end")return whe(t,i,y,N,g);x=She(g,t.offset,t.position)}else{if(!b)return null;var P=che({viewBox:b,position:i,offset:t.offset,parentViewBox:Sh(r)?void 0:r});x=nu(nu({x:P.x,y:P.y,textAnchor:P.horizontalAnchor,verticalAnchor:P.verticalAnchor},P.width!==void 0?{width:P.width}:{}),P.height!==void 0?{height:P.height}:{})}return m.createElement(Pa,{zIndex:t.zIndex},m.createElement(tk,Gi({ref:d,className:ot("recharts-label",c)},N,x,{textAnchor:FR(N.textAnchor)?N.textAnchor:x.textAnchor,breakAll:u}),y))}za.displayName="Label";var Nhe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?m.createElement(za,Gi({key:"label-implicit"},r)):Li(e)?m.createElement(za,Gi({key:"label-implicit",value:e},r)):m.isValidElement(e)?e.type===za?m.cloneElement(e,nu({key:"label-implicit"},r)):m.createElement(za,Gi({key:"label-implicit",content:e},r)):nk(e)?m.createElement(za,Gi({key:"label-implicit",content:e},r)):e&&typeof e=="object"?m.createElement(za,Gi({},e,{key:"label-implicit"},r)):null};function Che(e){var{label:t,labelRef:n}=e,r=VR();return Nhe(t,r,n)||null}var Phe=["valueAccessor"],Ehe=["dataKey","clockWise","id","textBreakAll","zIndex"];function Qp(){return Qp=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},Qp.apply(null,arguments)}function _5(e,t){if(e==null)return{};var n,r,i=Ahe(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 Ahe(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 The=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(the(t))return t},WR=m.createContext(void 0),Ohe=WR.Provider,HR=m.createContext(void 0);HR.Provider;function _he(){return m.useContext(WR)}function Mhe(){return m.useContext(HR)}function kh(e){var{valueAccessor:t=The}=e,n=_5(e,Phe),{dataKey:r,clockWise:i,id:a,textBreakAll:s,zIndex:o}=n,c=_5(n,Ehe),u=_he(),d=Mhe(),f=u||d;return!f||!f.length?null:m.createElement(Pa,{zIndex:o??Bn.label},m.createElement(Di,{className:"recharts-label-list"},f.map((h,p)=>{var g,y=kn(r)?t(h,p):wn(h.payload,r),x=kn(a)?{}:{id:"".concat(a,"-").concat(p)};return m.createElement(za,Qp({key:"label-".concat(p)},kr(h),c,x,{fill:(g=n.fill)!==null&&g!==void 0?g:h.fill,parentViewBox:h.parentViewBox,value:y,textBreakAll:s,viewBox:h.viewBox,index:p,zIndex:0}))})))}kh.displayName="LabelList";function Dhe(e){var{label:t}=e;return t?t===!0?m.createElement(kh,{key:"labelList-implicit"}):m.isValidElement(t)||nk(t)?m.createElement(kh,{key:"labelList-implicit",content:t}):typeof t=="object"?m.createElement(kh,Qp({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function qv(){return qv=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},qv.apply(null,arguments)}var KR=e=>{var{cx:t,cy:n,r,className:i}=e,a=ot("recharts-dot",i);return Pe(t)&&Pe(n)&&Pe(r)?m.createElement("circle",qv({},di(e),C1(e),{className:a,cx:t,cy:n,r})):null},Ihe={radiusAxis:{},angleAxis:{}},GR=Rn({name:"polarAxis",initialState:Ihe,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:J0e,removeRadiusAxis:eye,addAngleAxis:tye,removeAngleAxis:nye}=GR.actions,Lhe=GR.reducer;function Rhe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var qR=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function Fhe(e){var{tooltipEntrySettings:t}=e,n=Bt(),r=cr(),i=m.useRef(null);return m.useLayoutEffect(()=>{r||(i.current===null?n(gue(t)):i.current!==t&&n(yue({prev:i.current,next:t})),i.current=t)},[t,n,r]),m.useLayoutEffect(()=>()=>{i.current&&(n(xue(i.current)),i.current=null)},[n]),null}function zhe(e){var{legendPayload:t}=e,n=Bt(),r=cr(),i=m.useRef(null);return m.useLayoutEffect(()=>{r||(i.current===null?n(nie(t)):i.current!==t&&n(rie({prev:i.current,next:t})),i.current=t)},[n,r,t]),m.useLayoutEffect(()=>()=>{i.current&&(n(iie(i.current)),i.current=null)},[n]),null}var by,$he=()=>{var[e]=m.useState(()=>Qu("uid-"));return e},Bhe=(by=SA.useId)!==null&&by!==void 0?by:$he;function Uhe(e,t){var n=Bhe();return t||(e?"".concat(e,"-").concat(n):n)}var Vhe=m.createContext(void 0),Whe=e=>{var{id:t,type:n,children:r}=e,i=Uhe("recharts-".concat(n),t);return m.createElement(Vhe.Provider,{value:i},r(i))},Hhe={cartesianItems:[],polarItems:[]},YR=Rn({name:"graphicalItems",initialState:Hhe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:wt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=$r(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:wt()},removeCartesianGraphicalItem:{reducer(e,t){var n=$r(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:wt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:wt()},removePolarGraphicalItem:{reducer(e,t){var n=$r(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:wt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=$r(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:wt()}}}),{addCartesianGraphicalItem:Khe,replaceCartesianGraphicalItem:Ghe,removeCartesianGraphicalItem:qhe,addPolarGraphicalItem:rye,removePolarGraphicalItem:iye,replacePolarGraphicalItem:aye}=YR.actions,Yhe=YR.reducer,Xhe=e=>{var t=Bt(),n=m.useRef(null);return m.useLayoutEffect(()=>{n.current===null?t(Khe(e)):n.current!==e&&t(Ghe({prev:n.current,next:e})),n.current=e},[t,e]),m.useLayoutEffect(()=>()=>{n.current&&(t(qhe(n.current)),n.current=null)},[t]),null},Zhe=m.memo(Xhe),Qhe=["points"];function M5(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 wy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M5(Object(n),!0).forEach(function(r){Jhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jhe(e,t,n){return(t=epe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function epe(e){var t=tpe(e,"string");return typeof t=="symbol"?t:t+""}function tpe(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 Jp(){return Jp=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},Jp.apply(null,arguments)}function npe(e,t){if(e==null)return{};var n,r,i=rpe(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 rpe(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 ipe(e){var{option:t,dotProps:n,className:r}=e;if(m.isValidElement(t))return m.cloneElement(t,n);if(typeof t=="function")return t(n);var i=ot(r,typeof t!="boolean"?t.className:""),a=n??{},{points:s}=a,o=npe(a,Qhe);return m.createElement(KR,Jp({},o,{className:i}))}function ape(e,t){return e==null?!1:t?!0:e.length===1}function spe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:s,needClip:o,clipPathId:c,zIndex:u=Bn.scatter}=e;if(!ape(t,n))return null;var d=qR(n),f=ree(n),h=t.map((g,y)=>{var x,b,v=wy(wy(wy({r:3},s),f),{},{index:y,cx:(x=g.x)!==null&&x!==void 0?x:void 0,cy:(b=g.y)!==null&&b!==void 0?b:void 0,dataKey:a,value:g.value,payload:g.payload,points:t});return m.createElement(ipe,{key:"dot-".concat(y),option:n,dotProps:v,className:i})}),p={};return o&&c!=null&&(p.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),m.createElement(Pa,{zIndex:u},m.createElement(Di,Jp({className:r},p),h))}function D5(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 I5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D5(Object(n),!0).forEach(function(r){ope(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ope(e,t,n){return(t=lpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lpe(e){var t=cpe(e,"string");return typeof t=="symbol"?t:t+""}function cpe(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 XR=0,upe={xAxis:{},yAxis:{},zAxis:{}},ZR=Rn({name:"cartesianAxis",initialState:upe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:wt()},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:wt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:wt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:wt()},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:wt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:wt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:wt()},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:wt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:wt()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,s=i.widthHistory||[];if(s.length===3&&s[0]===s[2]&&r===s[1]&&r!==i.width&&Math.abs(r-((a=s[0])!==null&&a!==void 0?a:0))<=1)return;var o=[...s,r].slice(-3);e.yAxis[n]=I5(I5({},i),{},{width:r,widthHistory:o})}}}}),{addXAxis:dpe,replaceXAxis:fpe,removeXAxis:hpe,addYAxis:ppe,replaceYAxis:mpe,removeYAxis:gpe,addZAxis:sye,replaceZAxis:oye,removeZAxis:lye,updateYAxisWidth:ype}=ZR.actions,xpe=ZR.reducer,vpe=q([jn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),bpe=q([vpe,ba,wa],(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)}}),rk=()=>Oe(bpe),wpe=()=>Oe(gde);function L5(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 Sy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L5(Object(n),!0).forEach(function(r){Spe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Spe(e,t,n){return(t=kpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kpe(e){var t=jpe(e,"string");return typeof t=="symbol"?t:t+""}function jpe(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 Npe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:s}=e;if(i===!1||t.x==null||t.y==null)return null;var o={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=Sy(Sy(Sy({},o),$m(i)),C1(i)),u;return m.isValidElement(i)?u=m.cloneElement(i,c):typeof i=="function"?u=i(c):u=m.createElement(KR,c),m.createElement(Di,{className:"recharts-active-dot",clipPath:s},u)};function R5(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:s=Bn.activeDot}=e,o=Oe(dd),c=wpe();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return kn(u)?null:m.createElement(Pa,{zIndex:s},m.createElement(Npe,{point:u,childIndex:Number(o),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var Cpe=e=>{var{chartData:t}=e,n=Bt(),r=cr();return m.useEffect(()=>r?()=>{}:(n(p5(t)),()=>{n(p5(void 0))}),[t,n,r]),null},F5={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},QR=Rn({name:"brush",initialState:F5,reducers:{setBrushSettings(e,t){return t.payload==null?F5:t.payload}}}),{setBrushSettings:cye}=QR.actions,Ppe=QR.reducer;function Epe(e){return(e%180+180)%180}var Ape=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Epe(i),s=a*Math.PI/180,o=Math.atan(r/n),c=s>o&&s<Math.PI-o?r/Math.sin(s):n/Math.cos(s);return Math.abs(c)},Tpe={dots:[],areas:[],lines:[]},JR=Rn({name:"referenceElements",initialState:Tpe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=$r(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=$r(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=$r(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:uye,removeDot:dye,addArea:fye,removeArea:hye,addLine:pye,removeLine:mye}=JR.actions,Ope=JR.reducer,_pe=m.createContext(void 0),Mpe=e=>{var{children:t}=e,[n]=m.useState("".concat(Qu("recharts"),"-clip")),r=rk();if(r==null)return null;var{x:i,y:a,width:s,height:o}=r;return m.createElement(_pe.Provider,{value:n},m.createElement("defs",null,m.createElement("clipPath",{id:n},m.createElement("rect",{x:i,y:a,height:o,width:s}))),t)};function e6(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 Dpe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Ape(r,n)}function Ipe(e,t,n){var r=n==="width",{x:i,y:a,width:s,height:o}=e;return t===1?{start:r?i:a,end:r?i+s:a+o}:{start:r?i+s:a+o,end:r?i:a}}function hd(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 Lpe(e,t){return e6(e,t+1)}function Rpe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:s,end:o}=t,c=0,u=1,d=s,f=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:e6(r,u)};var y=c,x,b=()=>(x===void 0&&(x=n(g,y)),x),v=g.coordinate,w=c===0||hd(e,v,b,d,o);w||(c=0,d=s,u+=1),w&&(d=v+e*(b()/2+i),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function Fpe(e,t,n,r,i){var a=(r||[]).slice(),s=a.length;if(s===0)return[];for(var{start:o,end:c}=t,u=1;u<=s;u++){for(var d=(s-1)%u,f=o,h=!0,p=function(){var k=r[y];if(k==null)return 0;var S=y,j,N=()=>(j===void 0&&(j=n(k,S)),j),P=k.coordinate,A=y===d||hd(e,P,N,f,c);if(!A)return h=!1,1;A&&(f=P+e*(N()/2+i))},g,y=d;y<s&&(g=p(),!(g!==0&&g===1));y+=u);if(h){for(var x=[],b=d;b<s;b+=u){var v=r[b];v!=null&&x.push(v)}return x}}return[]}function z5(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 En(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z5(Object(n),!0).forEach(function(r){zpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zpe(e,t,n){return(t=$pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $pe(e){var t=Bpe(e,"string");return typeof t=="symbol"?t:t+""}function Bpe(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 Upe(e,t,n,r,i){for(var a=(r||[]).slice(),s=a.length,{start:o}=t,{end:c}=t,u=function(h){var p=a[h];if(p==null)return 1;var g=p,y,x=()=>(y===void 0&&(y=n(p,h)),y);if(h===s-1){var b=e*(g.coordinate+e*x()/2-c);a[h]=g=En(En({},g),{},{tickCoord:b>0?g.coordinate-b*e:g.coordinate})}else a[h]=g=En(En({},g),{},{tickCoord:g.coordinate});if(g.tickCoord!=null){var v=hd(e,g.tickCoord,x,o,c);v&&(c=g.tickCoord-e*(x()/2+i),a[h]=En(En({},g),{},{isShow:!0}))}},d=s-1;d>=0;d--)u(d);return a}function Vpe(e,t,n,r,i,a){var s=(r||[]).slice(),o=s.length,{start:c,end:u}=t;if(a){var d=r[o-1];if(d!=null){var f=n(d,o-1),h=e*(d.coordinate+e*f/2-u);if(s[o-1]=d=En(En({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=hd(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+i),s[o-1]=En(En({},d),{},{isShow:!0}))}}}for(var g=a?o-1:o,y=function(v){var w=s[v];if(w==null)return 1;var k=w,S,j=()=>(S===void 0&&(S=n(w,v)),S);if(v===0){var N=e*(k.coordinate-e*j()/2-c);s[v]=k=En(En({},k),{},{tickCoord:N<0?k.coordinate-N*e:k.coordinate})}else s[v]=k=En(En({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var P=hd(e,k.tickCoord,j,c,u);P&&(c=k.tickCoord+e*(j()/2+i),s[v]=En(En({},k),{},{isShow:!0}))}},x=0;x<g;x++)y(x);return s}function ik(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:s,orientation:o,interval:c,tickFormatter:u,unit:d,angle:f}=e;if(!i||!i.length||!r)return[];if(Pe(c)||Bd.isSsr){var h;return(h=Lpe(i,Pe(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],g=o==="top"||o==="bottom"?"width":"height",y=d&&g==="width"?vu(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},x=(S,j)=>{var N=typeof u=="function"?u(S.value,j):S.value;return g==="width"?Dpe(vu(N,{fontSize:t,letterSpacing:n}),y,f):vu(N,{fontSize:t,letterSpacing:n})[g]},b=i[0],v=i[1],w=i.length>=2&&b!=null&&v!=null?zr(v.coordinate-b.coordinate):1,k=Ipe(a,w,g);return c==="equidistantPreserveStart"?Rpe(w,k,x,i,s):c==="equidistantPreserveEnd"?Fpe(w,k,x,i,s):(c==="preserveStart"||c==="preserveStartEnd"?p=Vpe(w,k,x,i,s,c==="preserveStartEnd"):p=Upe(w,k,x,i,s),p.filter(S=>S.isShow))}var Wpe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,s=0;if(t){Array.from(t).forEach(d=>{if(d){var f=d.getBoundingClientRect();f.width>s&&(s=f.width)}});var o=n?n.getBoundingClientRect().width:0,c=i+a,u=s+c+o+(n?r:0);return Math.round(u)}return 0},Hpe={xAxis:{},yAxis:{}},t6=Rn({name:"renderedTicks",initialState:Hpe,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:Kpe,removeRenderedTicks:Gpe}=t6.actions,qpe=t6.reducer,Ype=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Xpe(e,t){if(e==null)return{};var n,r,i=Zpe(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 Zpe(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 ko(){return ko=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},ko.apply(null,arguments)}function $5(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 Rt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$5(Object(n),!0).forEach(function(r){Qpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qpe(e,t,n){return(t=Jpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jpe(e){var t=eme(e,"string");return typeof t=="symbol"?t:t+""}function eme(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 aa={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:Bn.axis};function tme(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:s,axisLine:o,otherSvgProps:c}=e;if(!o)return null;var u=Rt(Rt(Rt({},c),di(o)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!s||a==="bottom"&&s);u=Rt(Rt({},u),{},{x1:t,y1:n+d*i,x2:t+r,y2:n+d*i})}else{var f=+(a==="left"&&!s||a==="right"&&s);u=Rt(Rt({},u),{},{x1:t+f*r,y1:n,x2:t+f*r,y2:n+i})}return m.createElement("line",ko({},u,{className:ot("recharts-cartesian-axis-line",Gm(o,"className"))}))}function nme(e,t,n,r,i,a,s,o,c){var u,d,f,h,p,g,y=o?-1:1,x=e.tickSize||s,b=Pe(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,h=n+ +!o*i,f=h-y*x,g=f-y*c,p=b;break;case"left":f=h=e.coordinate,d=t+ +!o*r,u=d-y*x,p=u-y*c,g=b;break;case"right":f=h=e.coordinate,d=t+ +o*r,u=d+y*x,p=u+y*c,g=b;break;default:u=d=e.coordinate,h=n+ +o*i,f=h+y*x,g=f+y*c,p=b;break}return{line:{x1:u,y1:f,x2:d,y2:h},tick:{x:p,y:g}}}function rme(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function ime(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function ame(e){var{option:t,tickProps:n,value:r}=e,i,a=ot(n.className,"recharts-cartesian-axis-tick-value");if(m.isValidElement(t))i=m.cloneElement(t,Rt(Rt({},n),{},{className:a}));else if(typeof t=="function")i=t(Rt(Rt({},n),{},{className:a}));else{var s="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(s=ot(s,Rhe(t))),i=m.createElement(tk,ko({},n,{className:s}),r)}return i}function sme(e){var{ticks:t,axisType:n,axisId:r}=e,i=Bt();return m.useEffect(()=>{if(r==null||n==null)return Ao;var a=t.map(s=>({value:s.value,coordinate:s.coordinate,offset:s.offset,index:s.index}));return i(Kpe({ticks:a,axisId:r,axisType:n})),()=>{i(Gpe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var ome=m.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:s,unit:o,padding:c,tickTextProps:u,orientation:d,mirror:f,x:h,y:p,width:g,height:y,tickSize:x,tickMargin:b,fontSize:v,letterSpacing:w,getTicksConfig:k,events:S,axisType:j,axisId:N}=e,P=ik(Rt(Rt({},k),{},{ticks:n}),v,w),A=di(k),E=$m(r),O=FR(A.textAnchor)?A.textAnchor:rme(d,f),C=ime(d,f),M={};typeof i=="object"&&(M=i);var I=Rt(Rt({},A),{},{fill:"none"},M),B=P.map(D=>Rt({entry:D},nme(D,h,p,g,y,d,x,f,b))),se=B.map(D=>{var{entry:K,line:T}=D;return m.createElement(Di,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(K.value,"-").concat(K.coordinate,"-").concat(K.tickCoord)},i&&m.createElement("line",ko({},I,T,{className:ot("recharts-cartesian-axis-tick-line",Gm(i,"className"))})))}),Q=B.map((D,K)=>{var T,ie,{entry:J,tick:_}=D,H=Rt(Rt(Rt(Rt({verticalAnchor:C},A),{},{textAnchor:O,stroke:"none",fill:a},_),{},{index:K,payload:J,visibleTicksCount:P.length,tickFormatter:s,padding:c},u),{},{angle:(T=(ie=u==null?void 0:u.angle)!==null&&ie!==void 0?ie:A.angle)!==null&&T!==void 0?T:0}),ee=Rt(Rt({},H),E);return m.createElement(Di,ko({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(J.value,"-").concat(J.coordinate,"-").concat(J.tickCoord)},TD(S,J,K)),r&&m.createElement(ame,{option:r,tickProps:ee,value:"".concat(typeof s=="function"?s(J.value,K):J.value).concat(o||"")}))});return m.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(j,"-ticks")},m.createElement(sme,{ticks:P,axisId:N,axisType:j}),Q.length>0&&m.createElement(Pa,{zIndex:Bn.label},m.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(j,"-tick-labels"),ref:t},Q)),se.length>0&&m.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(j,"-tick-lines")},se))}),lme=m.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:s,ticks:o,axisType:c,axisId:u}=e,d=Xpe(e,Ype),[f,h]=m.useState(""),[p,g]=m.useState(""),y=m.useRef(null);m.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var b;return Wpe({ticks:y.current,label:(b=e.labelRef)===null||b===void 0?void 0:b.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var x=m.useCallback(b=>{if(b){var v=b.getElementsByClassName("recharts-cartesian-axis-tick-value");y.current=v;var w=v[0];if(w){var k=window.getComputedStyle(w),S=k.fontSize,j=k.letterSpacing;(S!==f||j!==p)&&(h(S),g(j))}}},[f,p]);return s||r!=null&&r<=0||i!=null&&i<=0?null:m.createElement(Pa,{zIndex:e.zIndex},m.createElement(Di,{className:ot("recharts-cartesian-axis",a)},m.createElement(tme,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:di(e)}),m.createElement(ome,{ref:x,axisType:c,events:d,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:p,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:o,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),m.createElement(ghe,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},m.createElement(Che,{label:e.label,labelRef:e.labelRef}),e.children)))}),ak=m.forwardRef((e,t)=>{var n=lr(e,aa);return m.createElement(lme,ko({},n,{ref:t}))});ak.displayName="CartesianAxis";var cme=["x1","y1","x2","y2","key"],ume=["offset"],dme=["xAxisId","yAxisId"],fme=["xAxisId","yAxisId"];function B5(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 Tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?B5(Object(n),!0).forEach(function(r){hme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hme(e,t,n){return(t=pme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pme(e){var t=mme(e,"string");return typeof t=="symbol"?t:t+""}function mme(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 Qs(){return Qs=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},Qs.apply(null,arguments)}function em(e,t){if(e==null)return{};var n,r,i=gme(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 gme(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 yme=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:s,ry:o}=e;return m.createElement("rect",{x:r,y:i,ry:o,width:a,height:s,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function n6(e){var{option:t,lineItemProps:n}=e,r;if(m.isValidElement(t))r=m.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:s,x2:o,y2:c,key:u}=n,d=em(n,cme),f=(i=di(d))!==null&&i!==void 0?i:{},{offset:h}=f,p=em(f,ume);r=m.createElement("line",Qs({},p,{x1:a,y1:s,x2:o,y2:c,fill:"none",key:u}))}return r}function xme(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:s}=e,o=em(e,dme),c=i.map((u,d)=>{var f=Tn(Tn({},o),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return m.createElement(n6,{key:"line-".concat(d),option:r,lineItemProps:f})});return m.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function vme(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:s}=e,o=em(e,fme),c=i.map((u,d)=>{var f=Tn(Tn({},o),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return m.createElement(n6,{option:r,lineItemProps:f,key:"line-".concat(d)})});return m.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function bme(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:s,horizontalPoints:o,horizontal:c=!0}=e;if(!c||!t||!t.length||o==null)return null;var u=o.map(f=>Math.round(f+i-i)).sort((f,h)=>f-h);i!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],g=p==null,y=g?i+s-f:p-f;if(y<=0)return null;var x=h%t.length;return m.createElement("rect",{key:"react-".concat(h),y:f,x:r,height:y,width:a,stroke:"none",fill:t[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return m.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function wme(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:s,height:o,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var u=c.map(f=>Math.round(f+i-i)).sort((f,h)=>f-h);i!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],g=p==null,y=g?i+s-f:p-f;if(y<=0)return null;var x=h%n.length;return m.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:y,height:o,stroke:"none",fill:n[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return m.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var Sme=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return zI(ik(Tn(Tn(Tn({},aa),n),{},{ticks:$I(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},kme=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return zI(ik(Tn(Tn(Tn({},aa),n),{},{ticks:$I(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},jme={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Bn.grid};function Og(e){var t=q1(),n=Y1(),r=XI(),i=Tn(Tn({},lr(e,jme)),{},{x:Pe(e.x)?e.x:r.left,y:Pe(e.y)?e.y:r.top,width:Pe(e.width)?e.width:r.width,height:Pe(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:s,x:o,y:c,width:u,height:d,syncWithTicks:f,horizontalValues:h,verticalValues:p}=i,g=cr(),y=Oe(A=>n5(A,"xAxis",a,g)),x=Oe(A=>n5(A,"yAxis",s,g));if(!Ri(u)||!Ri(d)||!Pe(o)||!Pe(c))return null;var b=i.verticalCoordinatesGenerator||Sme,v=i.horizontalCoordinatesGenerator||kme,{horizontalPoints:w,verticalPoints:k}=i;if((!w||!w.length)&&typeof v=="function"){var S=h&&h.length,j=v({yAxis:x?Tn(Tn({},x),{},{ticks:S?h:x.ticks}):void 0,width:t??u,height:n??d,offset:r},S?!0:f);Pp(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(w=j)}if((!k||!k.length)&&typeof b=="function"){var N=p&&p.length,P=b({xAxis:y?Tn(Tn({},y),{},{ticks:N?p:y.ticks}):void 0,width:t??u,height:n??d,offset:r},N?!0:f);Pp(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(k=P)}return m.createElement(Pa,{zIndex:i.zIndex},m.createElement("g",{className:"recharts-cartesian-grid"},m.createElement(yme,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),m.createElement(bme,Qs({},i,{horizontalPoints:w})),m.createElement(wme,Qs({},i,{verticalPoints:k})),m.createElement(xme,Qs({},i,{offset:r,horizontalPoints:w,xAxis:y,yAxis:x})),m.createElement(vme,Qs({},i,{offset:r,verticalPoints:k,xAxis:y,yAxis:x}))))}Og.displayName="CartesianGrid";var Nme={},r6=Rn({name:"errorBars",initialState:Nme,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:gye,replaceErrorBar:yye,removeErrorBar:xye}=r6.actions,Cme=r6.reducer;function i6(e,t){var n,r,i=Oe(u=>ja(u,e)),a=Oe(u=>Na(u,t)),s=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:Zt.allowDataOverflow,o=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:Qt.allowDataOverflow,c=s||o;return{needClip:c,needClipX:s,needClipY:o}}function Pme(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=rk(),{needClipX:a,needClipY:s,needClip:o}=i6(t,n);if(!o||!i)return null;var{x:c,y:u,width:d,height:f}=i;return m.createElement("clipPath",{id:"clipPath-".concat(r)},m.createElement("rect",{x:a?c:c-d/2,y:s?u:u-f/2,width:a?d:d*2,height:s?f:f*2}))}function Eme(e){var t=$m(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,s=Number(i),o=Number(a);return(Number.isNaN(s)||s<0)&&(s=n),(Number.isNaN(o)||o<0)&&(o=r),{r:s,strokeWidth:o}}return{r:n,strokeWidth:r}}function sk(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:XR}function ok(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:XR}var a6=(e,t,n)=>nR(e,"xAxis",sk(e,t),n),s6=(e,t,n)=>tR(e,"xAxis",sk(e,t),n),o6=(e,t,n)=>nR(e,"yAxis",ok(e,t),n),l6=(e,t,n)=>tR(e,"yAxis",ok(e,t),n),Ame=q([Tt,a6,o6,s6,l6],(e,t,n,r,i)=>Ui(e,"xAxis")?Cp(t,r,!1):Cp(n,i,!1)),Tme=(e,t)=>t,c6=q([jL,Tme],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),u6=e=>{var t=Tt(e),n=Ui(t,"xAxis");return n?"yAxis":"xAxis"},Ome=(e,t)=>{var n=u6(e);return n==="yAxis"?ok(e,t):sk(e,t)},_me=(e,t,n)=>ML(e,u6(e),Ome(e,t),n),Mme=q([c6,_me],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=lS(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,s=a==null?void 0:a.find(o=>o.key===i);if(s!=null)return s.map(o=>[o[0],o[1]])}}}),Dme=q([Tt,a6,o6,s6,l6,Mme,mse,Ame,c6,Sse],(e,t,n,r,i,a,s,o,c,u)=>{var{chartData:d,dataStartIndex:f,dataEndIndex:h}=s;if(!(c==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null)){var{data:p}=c,g;if(p&&p.length>0?g=p:g=d==null?void 0:d.slice(f,h+1),g!=null)return ege({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:g,chartBaseValue:u,bandSize:o})}}),Ime=["id"],Lme=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function so(){return so=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},so.apply(null,arguments)}function d6(e,t){if(e==null)return{};var n,r,i=Rme(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 Rme(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 U5(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 hl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U5(Object(n),!0).forEach(function(r){Fme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fme(e,t,n){return(t=zme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zme(e){var t=$me(e,"string");return typeof t=="symbol"?t:t+""}function $me(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 tm(e,t){return e&&e!=="none"?e:t}var Bme=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:s}=e;return[{inactive:s,dataKey:t,type:a,color:tm(r,i),value:BI(n,t),payload:e}]},Ume=m.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:s,hide:o,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:n,getPosition:Ao,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:BI(s,t),hide:o,type:u,color:tm(r,a),unit:c,graphicalItemId:d}};return m.createElement(Fhe,{tooltipEntrySettings:f})});function Vme(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:s}=r,o=di(r);return m.createElement(spe,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:s,baseProps:o,needClip:i,clipPathId:t})}function Wme(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var s,o,c={x:(s=a.x)!==null&&s!==void 0?s:0,y:(o=a.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return hl(hl({},c),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return m.createElement(Ohe,{value:t?i:void 0},n)}function V5(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:s,type:o,stroke:c,connectNulls:u,isRange:d}=a,{id:f}=a,h=d6(a,Ime),p=di(h),g=kr(h);return m.createElement(m.Fragment,null,(t==null?void 0:t.length)>1&&m.createElement(Di,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},m.createElement(wh,so({},g,{id:f,points:t,connectNulls:u,type:o,baseLine:n,layout:s,stroke:"none",className:"recharts-area-area"})),c!=="none"&&m.createElement(wh,so({},p,{className:"recharts-area-curve",layout:s,type:o,connectNulls:u,fill:"none",points:t})),c!=="none"&&d&&Array.isArray(n)&&m.createElement(wh,so({},p,{className:"recharts-area-curve",layout:s,type:o,connectNulls:u,fill:"none",points:n}))),m.createElement(Vme,{points:t,props:h,clipPathId:i}))}function Hme(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:s}=e,o=(t=a[0])===null||t===void 0?void 0:t.y,c=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!qe(o)||!qe(c))return null;var u=r*Math.abs(o-c),d=Math.max(...a.map(f=>f.x||0));return Pe(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.x||0),d)),Pe(d)?m.createElement("rect",{x:0,y:o<c?o:o-u,width:d+(s?parseInt("".concat(s),10):1),height:Math.floor(u)}):null}function Kme(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:s}=e,o=(t=a[0])===null||t===void 0?void 0:t.x,c=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!qe(o)||!qe(c))return null;var u=r*Math.abs(o-c),d=Math.max(...a.map(f=>f.y||0));return Pe(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.y||0),d)),Pe(d)?m.createElement("rect",{x:o<c?o:o-u,y:0,width:u,height:Math.floor(d+(s?parseInt("".concat(s),10):1))}):null}function Gme(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?m.createElement(Hme,{alpha:t,points:r,baseLine:i,strokeWidth:a}):m.createElement(Kme,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function qme(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:s,baseLine:o,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:f,onAnimationStart:h,onAnimationEnd:p}=r,g=m.useMemo(()=>({points:s,baseLine:o}),[s,o]),y=d3(g,"recharts-area-"),x=X1(),[b,v]=m.useState(!1),w=!b,k=m.useCallback(()=>{typeof p=="function"&&p(),v(!1)},[p]),S=m.useCallback(()=>{typeof h=="function"&&h(),v(!0)},[h]);if(x==null)return null;var j=i.current,N=a.current;return m.createElement(Wme,{showLabels:w,points:s},r.children,m.createElement(u3,{animationId:y,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:k,onAnimationStart:S,key:y},P=>{if(j){var A=j.length/s.length,E=P===1?s:s.map((C,M)=>{var I=Math.floor(M*A);if(j[I]){var B=j[I];return hl(hl({},C),{},{x:ki(B.x,C.x,P),y:ki(B.y,C.y,P)})}return C}),O;return Pe(o)?O=ki(N,o,P):kn(o)||Ii(o)?O=ki(N,0,P):O=o.map((C,M)=>{var I=Math.floor(M*A);if(Array.isArray(N)&&N[I]){var B=N[I];return hl(hl({},C),{},{x:ki(B.x,C.x,P),y:ki(B.y,C.y,P)})}return C}),P>0&&(i.current=E,a.current=O),m.createElement(V5,{points:E,baseLine:O,needClip:t,clipPathId:n,props:r})}return P>0&&(i.current=s,a.current=o),m.createElement(Di,null,c&&m.createElement("defs",null,m.createElement("clipPath",{id:"animationClipPath-".concat(n)},m.createElement(Gme,{alpha:P,points:s,baseLine:o,layout:x,strokeWidth:r.strokeWidth}))),m.createElement(Di,{clipPath:"url(#animationClipPath-".concat(n,")")},m.createElement(V5,{points:s,baseLine:o,needClip:t,clipPathId:n,props:r})))}),m.createElement(Dhe,{label:r.label}))}function Yme(e){var{needClip:t,clipPathId:n,props:r}=e,i=m.useRef(null),a=m.useRef();return m.createElement(qme,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class Xme extends m.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:s,needClip:o,xAxisId:c,yAxisId:u,width:d,height:f,id:h,baseLine:p,zIndex:g}=this.props;if(t)return null;var y=ot("recharts-area",i),x=h,{r:b,strokeWidth:v}=Eme(n),w=qR(n),k=b*2+v,S=o?"url(#clipPath-".concat(w?"":"dots-").concat(x,")"):void 0;return m.createElement(Pa,{zIndex:g},m.createElement(Di,{className:y},o&&m.createElement("defs",null,m.createElement(Pme,{clipPathId:x,xAxisId:c,yAxisId:u}),!w&&m.createElement("clipPath",{id:"clipPath-dots-".concat(x)},m.createElement("rect",{x:s-k/2,y:a-k/2,width:d+k,height:f+k}))),m.createElement(Yme,{needClip:o,clipPathId:x,props:this.props})),m.createElement(R5,{points:r,mainColor:tm(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}),this.props.isRange&&Array.isArray(p)&&m.createElement(R5,{points:p,mainColor:tm(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}))}}var Zme={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Bn.area};function Qme(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:s,dot:o,fill:c,fillOpacity:u,hide:d,isAnimationActive:f,legendType:h,stroke:p,xAxisId:g,yAxisId:y}=e,x=d6(e,Lme),b=ac(),v=jR(),{needClip:w}=i6(g,y),k=cr(),{points:S,isRange:j,baseLine:N}=(t=Oe(M=>Dme(M,e.id,k)))!==null&&t!==void 0?t:{},P=rk();if(b!=="horizontal"&&b!=="vertical"||P==null||v!=="AreaChart"&&v!=="ComposedChart")return null;var{height:A,width:E,x:O,y:C}=P;return!S||!S.length?null:m.createElement(Xme,so({},x,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:N,connectNulls:s,dot:o,fill:c,fillOpacity:u,height:A,hide:d,layout:b,isAnimationActive:f,isRange:j,legendType:h,needClip:w,points:S,stroke:p,width:E,left:O,top:C,xAxisId:g,yAxisId:y}))}var Jme=(e,t,n,r,i)=>{var a=n??t;if(Pe(a))return a;var s=e==="horizontal"?i:r,o=s.scale.domain();if(s.type==="number"){var c=Math.max(o[0],o[1]),u=Math.min(o[0],o[1]);return a==="dataMin"?u:a==="dataMax"||c<0?c:Math.max(Math.min(o[0],o[1]),0)}return a==="dataMin"?o[0]:a==="dataMax"?o[1]:o[0]};function ege(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:s,xAxis:o,yAxis:c,displayedData:u,dataStartIndex:d,xAxisTicks:f,yAxisTicks:h,bandSize:p}=e,g=i&&i.length,y=Jme(a,s,n,o,c),x=a==="horizontal",b=!1,v=u.map((k,S)=>{var j,N,P,A;if(g)A=i[d+S];else{var E=wn(k,r);Array.isArray(E)?(A=E,b=!0):A=[y,E]}var O=(j=(N=A)===null||N===void 0?void 0:N[1])!==null&&j!==void 0?j:null,C=O==null||g&&!t&&wn(k,r)==null;if(x){var M;return{x:sP({axis:o,ticks:f,bandSize:p,entry:k,index:S}),y:C?null:(M=c.scale.map(O))!==null&&M!==void 0?M:null,value:A,payload:k}}return{x:C?null:(P=o.scale.map(O))!==null&&P!==void 0?P:null,y:sP({axis:c,ticks:h,bandSize:p,entry:k,index:S}),value:A,payload:k}}),w;return g||b?w=v.map(k=>{var S,j=Array.isArray(k.value)?k.value[0]:null;if(x){var N;return{x:k.x,y:j!=null&&k.y!=null&&(N=c.scale.map(j))!==null&&N!==void 0?N:null,payload:k.payload}}return{x:j!=null&&(S=o.scale.map(j))!==null&&S!==void 0?S:null,y:k.y,payload:k.payload}}):w=x?c.scale.map(y):o.scale.map(y),{points:v,baseLine:w??0,isRange:b}}function tge(e){var t=lr(e,Zme),n=cr();return m.createElement(Whe,{id:t.id,type:"area"},r=>m.createElement(m.Fragment,null,m.createElement(zhe,{legendPayload:Bme(t)}),m.createElement(Ume,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),m.createElement(Zhe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:lre(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),m.createElement(Qme,so({},t,{id:r}))))}var rs=m.memo(tge,$d);rs.displayName="Area";var nge=["domain","range"],rge=["domain","range"];function W5(e,t){if(e==null)return{};var n,r,i=ige(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 ige(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 H5(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 f6(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=W5(e,nge),{domain:a,range:s}=t,o=W5(t,rge);return!H5(n,a)||!H5(r,s)?!1:$d(i,o)}var age=["type"],sge=["dangerouslySetInnerHTML","ticks","scale"],oge=["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 K5(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 G5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K5(Object(n),!0).forEach(function(r){lge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lge(e,t,n){return(t=cge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cge(e){var t=uge(e,"string");return typeof t=="symbol"?t:t+""}function uge(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=dge(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 dge(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 fge(e){var t=Bt(),n=m.useRef(null),r=X1(),{type:i}=e,a=Xv(e,age),s=yg(r,"xAxis",i),o=m.useMemo(()=>{if(s!=null)return G5(G5({},a),{},{type:s})},[a,s]);return m.useLayoutEffect(()=>{o!=null&&(n.current===null?t(dpe(o)):n.current!==o&&t(fpe({prev:n.current,next:o})),n.current=o)},[o,t]),m.useLayoutEffect(()=>()=>{n.current&&(t(hpe(n.current)),n.current=null)},[t]),null}var hge=e=>{var{xAxisId:t,className:n}=e,r=Oe(VI),i=cr(),a="xAxis",s=Oe(b=>eR(b,a,t,i)),o=Oe(b=>Zce(b,t)),c=Oe(b=>rue(b,t)),u=Oe(b=>bL(b,t));if(o==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Xv(e,sge),{id:g,scale:y}=u,x=Xv(u,oge);return m.createElement(ak,Yv({},p,x,{x:c.x,y:c.y,width:o.width,height:o.height,className:ot("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:s,axisType:a,axisId:t}))},pge={allowDataOverflow:Zt.allowDataOverflow,allowDecimals:Zt.allowDecimals,allowDuplicatedCategory:Zt.allowDuplicatedCategory,angle:Zt.angle,axisLine:aa.axisLine,height:Zt.height,hide:!1,includeHidden:Zt.includeHidden,interval:Zt.interval,label:!1,minTickGap:Zt.minTickGap,mirror:Zt.mirror,orientation:Zt.orientation,padding:Zt.padding,reversed:Zt.reversed,scale:Zt.scale,tick:Zt.tick,tickCount:Zt.tickCount,tickLine:aa.tickLine,tickSize:aa.tickSize,type:Zt.type,niceTicks:Zt.niceTicks,xAxisId:0},mge=e=>{var t=lr(e,pge);return m.createElement(m.Fragment,null,m.createElement(fge,{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,niceTicks:t.niceTicks}),m.createElement(hge,t))},_g=m.memo(mge,f6);_g.displayName="XAxis";var gge=["type"],yge=["dangerouslySetInnerHTML","ticks","scale"],xge=["id","scale"];function Zv(){return Zv=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},Zv.apply(null,arguments)}function q5(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 Y5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q5(Object(n),!0).forEach(function(r){vge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vge(e,t,n){return(t=bge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bge(e){var t=wge(e,"string");return typeof t=="symbol"?t:t+""}function wge(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 Qv(e,t){if(e==null)return{};var n,r,i=Sge(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 Sge(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 kge(e){var t=Bt(),n=m.useRef(null),r=X1(),{type:i}=e,a=Qv(e,gge),s=yg(r,"yAxis",i),o=m.useMemo(()=>{if(s!=null)return Y5(Y5({},a),{},{type:s})},[s,a]);return m.useLayoutEffect(()=>{o!=null&&(n.current===null?t(ppe(o)):n.current!==o&&t(mpe({prev:n.current,next:o})),n.current=o)},[o,t]),m.useLayoutEffect(()=>()=>{n.current&&(t(gpe(n.current)),n.current=null)},[t]),null}function jge(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=m.useRef(null),s=m.useRef(null),o=Oe(VI),c=cr(),u=Bt(),d="yAxis",f=Oe(j=>sue(j,t)),h=Oe(j=>aue(j,t)),p=Oe(j=>eR(j,d,t,c)),g=Oe(j=>wL(j,t));if(m.useLayoutEffect(()=>{if(!(r!=="auto"||!f||nk(i)||m.isValidElement(i)||g==null)){var j=a.current;if(j){var N=j.getCalculatedWidth();Math.round(f.width)!==Math.round(N)&&u(ype({id:t,width:N}))}}},[p,f,u,i,t,r,g]),f==null||h==null||g==null)return null;var{dangerouslySetInnerHTML:y,ticks:x,scale:b}=e,v=Qv(e,yge),{id:w,scale:k}=g,S=Qv(g,xge);return m.createElement(ak,Zv({},v,S,{ref:a,labelRef:s,x:h.x,y:h.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:f.width,height:f.height,className:ot("recharts-".concat(d," ").concat(d),n),viewBox:o,ticks:p,axisType:d,axisId:t}))}var Nge={allowDataOverflow:Qt.allowDataOverflow,allowDecimals:Qt.allowDecimals,allowDuplicatedCategory:Qt.allowDuplicatedCategory,angle:Qt.angle,axisLine:aa.axisLine,hide:!1,includeHidden:Qt.includeHidden,interval:Qt.interval,label:!1,minTickGap:Qt.minTickGap,mirror:Qt.mirror,orientation:Qt.orientation,padding:Qt.padding,reversed:Qt.reversed,scale:Qt.scale,tick:Qt.tick,tickCount:Qt.tickCount,tickLine:aa.tickLine,tickSize:aa.tickSize,type:Qt.type,niceTicks:Qt.niceTicks,width:Qt.width,yAxisId:0},Cge=e=>{var t=lr(e,Nge);return m.createElement(m.Fragment,null,m.createElement(kge,{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,niceTicks:t.niceTicks}),m.createElement(jge,t))},Mg=m.memo(Cge,f6);Mg.displayName="YAxis";var Pge=(e,t)=>t,lk=q([Pge,Tt,R3,dn,xR,Ca,Ede,jn],Ide);function Ege(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function ck(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Ege(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var s=(o,c)=>({relativeX:Math.round((o-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(o=>s(o.clientX,o.clientY)):s(e.clientX,e.clientY)}var h6=jr("mouseClick"),p6=Id();p6.startListening({actionCreator:h6,effect:(e,t)=>{var n=e.payload,r=lk(t.getState(),ck(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(wue({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Jv=jr("mouseMove"),m6=Id(),Vo=null,Ts=null,ky=null;m6.startListening({actionCreator:Jv,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,s=a==="all"||(a==null?void 0:a.includes("mousemove"));Vo!==null&&(cancelAnimationFrame(Vo),Vo=null),Ts!==null&&(typeof i!="number"||!s)&&(clearTimeout(Ts),Ts=null),ky=ck(n);var o=()=>{var c=t.getState(),u=WS(c,c.tooltip.settings.shared);if(!ky){Vo=null,Ts=null;return}if(u==="axis"){var d=lk(c,ky);(d==null?void 0:d.activeIndex)!=null?t.dispatch(cR({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(lR())}Vo=null,Ts=null};if(!s){o();return}i==="raf"?Vo=requestAnimationFrame(o):typeof i=="number"&&Ts===null&&(Ts=setTimeout(o,i))}});function Age(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 X5={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},g6=Rn({name:"rootProps",initialState:X5,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:X5.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}}}),Tge=g6.reducer,{updateOptions:Oge}=g6.actions,_ge=null,Mge={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},y6=Rn({name:"polarOptions",initialState:_ge,reducers:Mge}),{updatePolarOptions:vye}=y6.actions,Dge=y6.reducer,x6=jr("keyDown"),v6=jr("focus"),b6=jr("blur"),Dg=Id(),Wo=null,Os=null,qf=null;Dg.startListening({actionCreator:x6,effect:(e,t)=>{qf=e.payload,Wo!==null&&(cancelAnimationFrame(Wo),Wo=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Os!==null&&(typeof r!="number"||!a)&&(clearTimeout(Os),Os=null);var s=()=>{try{var o=t.getState(),c=o.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=o.tooltip,d=qf;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=HS(u,pc(o),Yd(o),Zd(o)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=Ca(o);if(d==="Enter"){var g=Zp(o,"axis","hover",String(u.index));t.dispatch(Xp({active:!u.active,activeIndex:u.index,activeCoordinate:g}));return}var y=due(o),x=y==="left-to-right"?1:-1,b=d==="ArrowRight"?1:-1,v=h+b*x;if(p==null||v>=p.length||v<0)return;var w=Zp(o,"axis","hover",String(v));t.dispatch(Xp({active:!0,activeIndex:v.toString(),activeCoordinate:w}))}finally{Wo=null,Os=null}};if(!a){s();return}r==="raf"?Wo=requestAnimationFrame(s):typeof r=="number"&&Os===null&&(s(),qf=null,Os=setTimeout(()=>{qf?s():(Os=null,Wo=null)},r))}});Dg.startListening({actionCreator:v6,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",s=Zp(n,"axis","hover",String(a));t.dispatch(Xp({active:!0,activeIndex:a,activeCoordinate:s}))}}}});Dg.startListening({actionCreator:b6,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Xp({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function w6(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var _r=jr("externalEvent"),S6=Id(),Yf=new Map,Vc=new Map,jy=new Map;S6.startListening({actionCreator:_r,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=w6(r);jy.set(i,{handler:n,reactEvent:a});var s=Yf.get(i);s!==void 0&&(cancelAnimationFrame(s),Yf.delete(i));var o=t.getState(),{throttleDelay:c,throttledEvents:u}=o.eventSettings,d=u,f=d==="all"||(d==null?void 0:d.includes(i)),h=Vc.get(i);h!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(h),Vc.delete(i));var p=()=>{var x=jy.get(i);try{if(!x)return;var{handler:b,reactEvent:v}=x,w=t.getState(),k={activeCoordinate:hde(w),activeDataKey:ude(w),activeIndex:dd(w),activeLabel:wR(w),activeTooltipIndex:dd(w),isTooltipActive:pde(w)};b&&b(k,v)}finally{Yf.delete(i),Vc.delete(i),jy.delete(i)}};if(!f){p();return}if(c==="raf"){var g=requestAnimationFrame(p);Yf.set(i,g)}else if(typeof c=="number"){if(!Vc.has(i)){p();var y=setTimeout(p,c);Vc.set(i,y)}}else p()}}});var Ige=q([fc],e=>e.tooltipItemPayloads),Lge=q([Ige,(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)}}}),k6=jr("touchMove"),j6=Id(),_s=null,Ma=null,Z5=null,Wc=null;j6.startListening({actionCreator:k6,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Wc=w6(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,s=a==="all"||a.includes("touchmove");_s!==null&&(cancelAnimationFrame(_s),_s=null),Ma!==null&&(typeof i!="number"||!s)&&(clearTimeout(Ma),Ma=null),Z5=Array.from(n.touches).map(c=>ck({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var o=()=>{if(Wc!=null){var c=t.getState(),u=WS(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=Z5)===null||d===void 0?void 0:d[0];if(f==null){_s=null,Ma=null;return}var h=lk(c,f);(h==null?void 0:h.activeIndex)!=null&&t.dispatch(cR({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var p,g=Wc.touches[0];if(document.elementFromPoint==null||g==null)return;var y=document.elementFromPoint(g.clientX,g.clientY);if(!y||!y.getAttribute)return;var x=y.getAttribute(mre),b=(p=y.getAttribute(gre))!==null&&p!==void 0?p:void 0,v=hc(c).find(S=>S.id===b);if(x==null||v==null||b==null)return;var{dataKey:w}=v,k=Lge(c,x,b);t.dispatch(bue({activeDataKey:w,activeIndex:x,activeCoordinate:k,activeGraphicalItemId:b}))}_s=null,Ma=null}};if(!s){o();return}i==="raf"?_s=requestAnimationFrame(o):typeof i=="number"&&Ma===null&&(o(),Wc=null,Ma=setTimeout(()=>{Wc?o():(Ma=null,_s=null)},i))}}});var N6={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},C6=Rn({name:"eventSettings",initialState:N6,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Rge}=C6.actions,Fge=C6.reducer,zge=uI({brush:Ppe,cartesianAxis:xpe,chartData:ffe,errorBars:Cme,eventSettings:Fge,graphicalItems:Yhe,layout:Jne,legend:aie,options:ofe,polarAxis:Lhe,polarOptions:Dge,referenceElements:Ope,renderedTicks:qpe,rootProps:Tge,tooltip:Sue,zIndex:Yde}),$ge=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return jne({reducer:zge,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([p6.middleware,m6.middleware,Dg.middleware,S6.middleware,j6.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(NI({type:"raf"}))},devTools:{serialize:{replacer:Age},name:"recharts-".concat(n)}})};function Bge(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=cr(),a=m.useRef(null);if(i)return n;a.current==null&&(a.current=$ge(t,r));var s=L1;return m.createElement(Pie,{context:s,store:a.current},n)}function Uge(e){var{layout:t,margin:n}=e,r=Bt(),i=cr();return m.useEffect(()=>{i||(r(Xne(t)),r(Yne(n)))},[r,i,t,n]),null}var Vge=m.memo(Uge,$d);function Wge(e){var t=Bt();return m.useEffect(()=>{t(Oge(e))},[t,e]),null}var Hge=e=>{var t=Bt();return m.useEffect(()=>{t(Rge(e))},[t,e]),null},Kge=m.memo(Hge,$d);function Q5(e){var{zIndex:t,isPanorama:n}=e,r=m.useRef(null),i=Bt();return m.useLayoutEffect(()=>(r.current&&i(Gde({zIndex:t,element:r.current,isPanorama:n})),()=>{i(qde({zIndex:t,isPanorama:n}))}),[i,t,n]),m.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function J5(e){var{children:t,isPanorama:n}=e,r=Oe(Rde);if(!r||r.length===0)return t;var i=r.filter(s=>s<0),a=r.filter(s=>s>0);return m.createElement(m.Fragment,null,i.map(s=>m.createElement(Q5,{key:s,zIndex:s,isPanorama:n})),t,a.map(s=>m.createElement(Q5,{key:s,zIndex:s,isPanorama:n})))}var Gge=["children"];function qge(e,t){if(e==null)return{};var n,r,i=Yge(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 Yge(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 nm(){return nm=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},nm.apply(null,arguments)}var Xge={width:"100%",height:"100%",display:"block"},Zge=m.forwardRef((e,t)=>{var n=q1(),r=Y1(),i=s3();if(!Ri(n)||!Ri(r))return null;var{children:a,otherAttributes:s,title:o,desc:c}=e,u,d;return s!=null&&(typeof s.tabIndex=="number"?u=s.tabIndex:u=i?0:void 0,typeof s.role=="string"?d=s.role:d=i?"application":void 0),m.createElement(w1,nm({},s,{title:o,desc:c,role:d,tabIndex:u,width:n,height:r,style:Xge,ref:t}),a)}),Qge=e=>{var{children:t}=e,n=Oe(cg);if(!n)return null;var{width:r,height:i,y:a,x:s}=n;return m.createElement(w1,{width:r,height:i,x:s,y:a},t)},eA=m.forwardRef((e,t)=>{var{children:n}=e,r=qge(e,Gge),i=cr();return i?m.createElement(Qge,null,m.createElement(J5,{isPanorama:!0},n)):m.createElement(Zge,nm({ref:t},r),m.createElement(J5,{isPanorama:!1},n))});function Jge(){var e=Bt(),[t,n]=m.useState(null),r=Oe(pre);return m.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;qe(a)&&a!==r&&e(Qne(a))}},[t,e,r]),n}function tA(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 e0e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tA(Object(n),!0).forEach(function(r){t0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t0e(e,t,n){return(t=n0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n0e(e){var t=r0e(e,"string");return typeof t=="symbol"?t:t+""}function r0e(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 is(){return is=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},is.apply(null,arguments)}var i0e=()=>(wfe(),null);function rm(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var a0e=m.forwardRef((e,t)=>{var n,r,i=m.useRef(null),[a,s]=m.useState({containerWidth:rm((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:rm((r=e.style)===null||r===void 0?void 0:r.height)}),o=m.useCallback((u,d)=>{s(f=>{var h=Math.round(u),p=Math.round(d);return f.containerWidth===h&&f.containerHeight===p?f:{containerWidth:h,containerHeight:p}})},[]),c=m.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=u.getBoundingClientRect();o(d,f);var h=g=>{var y=g[0];if(y!=null){var{width:x,height:b}=y.contentRect;o(x,b)}},p=new ResizeObserver(h);p.observe(u),i.current=p}},[t,o]);return m.useEffect(()=>()=>{var u=i.current;u!=null&&u.disconnect()},[o]),m.createElement(m.Fragment,null,m.createElement(Rd,{width:a.containerWidth,height:a.containerHeight}),m.createElement("div",is({ref:c},e)))}),s0e=m.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=m.useState({containerWidth:rm(n),containerHeight:rm(r)}),s=m.useCallback((c,u)=>{a(d=>{var f=Math.round(c),h=Math.round(u);return d.containerWidth===f&&d.containerHeight===h?d:{containerWidth:f,containerHeight:h}})},[]),o=m.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();s(u,d)}},[t,s]);return m.createElement(m.Fragment,null,m.createElement(Rd,{width:i.containerWidth,height:i.containerHeight}),m.createElement("div",is({ref:o},e)))}),o0e=m.forwardRef((e,t)=>{var{width:n,height:r}=e;return m.createElement(m.Fragment,null,m.createElement(Rd,{width:n,height:r}),m.createElement("div",is({ref:t},e)))}),l0e=m.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?m.createElement(s0e,is({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?m.createElement(o0e,is({},e,{width:n,height:r,ref:t})):m.createElement(m.Fragment,null,m.createElement(Rd,{width:n,height:r}),m.createElement("div",is({ref:t},e)))});function c0e(e){return e?a0e:l0e}var u0e=m.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:s,onDoubleClick:o,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:h,onTouchEnd:p,onTouchMove:g,onTouchStart:y,style:x,width:b,responsive:v,dispatchTouchEvents:w=!0}=e,k=m.useRef(null),S=Bt(),[j,N]=m.useState(null),[P,A]=m.useState(null),E=Jge(),O=H1(),C=(O==null?void 0:O.width)>0?O.width:b,M=(O==null?void 0:O.height)>0?O.height:i,I=m.useCallback(ne=>{E(ne),typeof t=="function"&&t(ne),N(ne),A(ne),ne!=null&&(k.current=ne)},[E,t,N,A]),B=m.useCallback(ne=>{S(h6(ne)),S(_r({handler:a,reactEvent:ne}))},[S,a]),se=m.useCallback(ne=>{S(Jv(ne)),S(_r({handler:u,reactEvent:ne}))},[S,u]),Q=m.useCallback(ne=>{S(lR()),S(_r({handler:d,reactEvent:ne}))},[S,d]),D=m.useCallback(ne=>{S(Jv(ne)),S(_r({handler:f,reactEvent:ne}))},[S,f]),K=m.useCallback(()=>{S(v6())},[S]),T=m.useCallback(()=>{S(b6())},[S]),ie=m.useCallback(ne=>{S(x6(ne.key))},[S]),J=m.useCallback(ne=>{S(_r({handler:s,reactEvent:ne}))},[S,s]),_=m.useCallback(ne=>{S(_r({handler:o,reactEvent:ne}))},[S,o]),H=m.useCallback(ne=>{S(_r({handler:c,reactEvent:ne}))},[S,c]),ee=m.useCallback(ne=>{S(_r({handler:h,reactEvent:ne}))},[S,h]),be=m.useCallback(ne=>{S(_r({handler:y,reactEvent:ne}))},[S,y]),te=m.useCallback(ne=>{w&&S(k6(ne)),S(_r({handler:g,reactEvent:ne}))},[S,w,g]),ye=m.useCallback(ne=>{S(_r({handler:p,reactEvent:ne}))},[S,p]),Z=c0e(v);return m.createElement(AR.Provider,{value:j},m.createElement(sD.Provider,{value:P},m.createElement(Z,{width:C??(x==null?void 0:x.width),height:M??(x==null?void 0:x.height),className:ot("recharts-wrapper",r),style:e0e({position:"relative",cursor:"default",width:C,height:M},x),onClick:B,onContextMenu:J,onDoubleClick:_,onFocus:K,onBlur:T,onKeyDown:ie,onMouseDown:H,onMouseEnter:se,onMouseLeave:Q,onMouseMove:D,onMouseUp:ee,onTouchEnd:ye,onTouchMove:te,onTouchStart:be,ref:I},m.createElement(i0e,null),n)))}),d0e=["width","height","responsive","children","className","style","compact","title","desc"];function f0e(e,t){if(e==null)return{};var n,r,i=h0e(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 h0e(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 p0e=m.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:s,style:o,compact:c,title:u,desc:d}=e,f=f0e(e,d0e),h=di(f);return c?m.createElement(m.Fragment,null,m.createElement(Rd,{width:n,height:r}),m.createElement(eA,{otherAttributes:h,title:u,desc:d},a)):m.createElement(u0e,{className:s,style:o,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},m.createElement(eA,{otherAttributes:h,title:u,desc:d,ref:t},m.createElement(Mpe,null,a)))});function eb(){return eb=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},eb.apply(null,arguments)}function nA(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 m0e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nA(Object(n),!0).forEach(function(r){g0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g0e(e,t,n){return(t=y0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y0e(e){var t=x0e(e,"string");return typeof t=="symbol"?t:t+""}function x0e(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 v0e={top:5,right:5,bottom:5,left:5},b0e=m0e({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:v0e,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},N6),w0e=m.forwardRef(function(t,n){var r,i=lr(t.categoricalChartProps,b0e),{chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:o,tooltipPayloadSearcher:c,categoricalChartProps:u}=t,d={chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:o,tooltipPayloadSearcher:c,eventEmitter:void 0};return m.createElement(Bge,{preloadedState:{options:d},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},m.createElement(Cpe,{chartData:u.data}),m.createElement(Vge,{layout:i.layout,margin:i.margin}),m.createElement(Kge,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),m.createElement(Wge,{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}),m.createElement(p0e,eb({},i,{ref:n})))}),S0e=["axis"],uk=m.forwardRef((e,t)=>m.createElement(w0e,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:S0e,tooltipPayloadSearcher:afe,categoricalChartProps:e,ref:t}));function rA(e){return e===0?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function iA(e){const t=new Date(e);return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function k0e({buckets:e}){const t=e.map(n=>({time:n.timestamp,input:n.tokensInput,output:n.tokensOutput,cache:n.tokensCacheRead+n.tokensCacheWrite}));return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-4",children:"Token Usage"}),l.jsx("div",{className:"h-[200px]",children:l.jsx(K1,{width:"100%",height:"100%",children:l.jsxs(uk,{data:t,children:[l.jsx(Og,{strokeDasharray:"3 3",stroke:"#f1f5f9",vertical:!1}),l.jsx(_g,{dataKey:"time",tickFormatter:iA,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),l.jsx(Mg,{tickFormatter:rA,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1,width:50}),l.jsx(ek,{labelFormatter:n=>iA(Number(n)),formatter:(n,r)=>[rA(Number(n)),r]}),l.jsx(pg,{verticalAlign:"top",align:"right",iconType:"circle",iconSize:8}),l.jsx(rs,{type:"monotone",dataKey:"input",name:"Input",stroke:"#6366f1",fill:"#6366f1",fillOpacity:.1,strokeWidth:2}),l.jsx(rs,{type:"monotone",dataKey:"output",name:"Output",stroke:"#a78bfa",fill:"#a78bfa",fillOpacity:.1,strokeWidth:2}),l.jsx(rs,{type:"monotone",dataKey:"cache",name:"Cache",stroke:"#cbd5e1",fill:"#cbd5e1",fillOpacity:.1,strokeWidth:2,strokeDasharray:"4 4"})]})})})]})}function aA(e){const t=new Date(e);return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function Hc(e){return e===0?"0s":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function j0e({buckets:e}){const t=e.map(o=>({time:o.timestamp,avg:o.promptDurationAvg,max:o.promptDurationMax})),n=e.filter(o=>o.promptDurationAvg>0),r=n.length>0?n.reduce((o,c)=>o+c.promptDurationAvg,0)/n.length:0,i=e.reduce((o,c)=>Math.max(o,c.promptDurationMax),0),a=n.map(o=>o.promptDurationMax).sort((o,c)=>o-c),s=a.length>0?a[Math.floor(a.length*.95)]:0;return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-4",children:"Prompt Latency"}),l.jsx("div",{className:"h-[200px]",children:l.jsx(K1,{width:"100%",height:"100%",children:l.jsxs(uk,{data:t,children:[l.jsx(Og,{strokeDasharray:"3 3",stroke:"#f1f5f9",vertical:!1}),l.jsx(_g,{dataKey:"time",tickFormatter:aA,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),l.jsx(Mg,{tickFormatter:Hc,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1,width:50}),l.jsx(ek,{labelFormatter:o=>aA(Number(o)),formatter:(o,c)=>[Hc(Number(o)),c]}),l.jsx(pg,{verticalAlign:"top",align:"right",iconType:"circle",iconSize:8}),l.jsx(rs,{type:"monotone",dataKey:"avg",name:"Avg",stroke:"#6366f1",fill:"#6366f1",fillOpacity:.1,strokeWidth:2}),l.jsx(rs,{type:"monotone",dataKey:"max",name:"Max",stroke:"#fb7185",fill:"none",fillOpacity:0,strokeWidth:2})]})})}),l.jsxs("div",{className:"flex items-center gap-6 mt-3 pt-3 border-t border-gray-100",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-xs text-gray-400",children:"Avg"}),l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:Hc(r)})]}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-xs text-gray-400",children:"P95"}),l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:Hc(s)})]}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-xs text-gray-400",children:"Max"}),l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:Hc(i)})]})]})]})}function sA(e){const t=new Date(e);return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function N0e({buckets:e}){const t=e.map(i=>({time:i.timestamp,sessions:i.activeSessions,ws:i.wsConnections})),n=e.reduce((i,a)=>Math.max(i,a.activeSessions),0),r=e.reduce((i,a)=>Math.max(i,a.wsConnections),0);return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-4",children:"Sessions & Connections"}),l.jsx("div",{className:"h-[200px]",children:l.jsx(K1,{width:"100%",height:"100%",children:l.jsxs(uk,{data:t,children:[l.jsx(Og,{strokeDasharray:"3 3",stroke:"#f1f5f9",vertical:!1}),l.jsx(_g,{dataKey:"time",tickFormatter:sA,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),l.jsx(Mg,{allowDecimals:!1,tick:{fontSize:12,fill:"#94a3b8"},axisLine:!1,tickLine:!1,width:30}),l.jsx(ek,{labelFormatter:i=>sA(Number(i)),formatter:(i,a)=>[Number(i),a]}),l.jsx(pg,{verticalAlign:"top",align:"right",iconType:"circle",iconSize:8}),l.jsx(rs,{type:"stepAfter",dataKey:"sessions",name:"Sessions",stroke:"#3b82f6",fill:"#3b82f6",fillOpacity:.1,strokeWidth:2}),l.jsx(rs,{type:"stepAfter",dataKey:"ws",name:"WebSocket",stroke:"#22d3ee",fill:"none",fillOpacity:0,strokeWidth:2})]})})}),l.jsxs("div",{className:"flex items-center gap-6 mt-3 pt-3 border-t border-gray-100",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-xs text-gray-400",children:"Peak Sessions"}),l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:n})]}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-xs text-gray-400",children:"Peak WS"}),l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:r})]}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-xs text-gray-400",children:"Stuck"}),l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:"0"})]})]})]})}function C0e({topTools:e}){const t=e.reduce((r,i)=>r+i.total,0),n=e.length>0?e[0].total:0;return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:"Tool Calls Top 10"}),l.jsxs("div",{className:"text-xs text-gray-400",children:[t," total · Since start"]})]}),l.jsxs("div",{className:"space-y-2",children:[e.length===0&&l.jsx("div",{className:"text-sm text-gray-400 text-center py-8",children:"No tool calls yet"}),e.map(r=>{const i=n>0?r.total/n*100:0;return l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-32 truncate font-mono text-xs text-gray-600",title:r.toolName,children:r.toolName}),l.jsxs("div",{className:"flex-1 bg-gray-100 rounded-md h-6 relative overflow-hidden",children:[l.jsx("div",{className:"absolute inset-y-0 left-0 bg-indigo-100 rounded-md",style:{width:`${i}%`}}),l.jsxs("div",{className:"absolute inset-0 flex items-center justify-between px-2",children:[l.jsx("span",{className:"text-xs font-medium text-gray-700",children:r.total}),r.error>0&&l.jsxs("span",{className:"text-xs font-medium text-red-500",children:[r.error," err"]})]})]})]},r.toolName)})]})]})}const P0e={builtin:"bg-blue-100 text-blue-800",team:"bg-amber-100 text-amber-800",personal:"bg-purple-100 text-purple-800"},E0e={builtin:"core",team:"team",personal:"personal"};function A0e({scope:e}){return l.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium ${P0e[e]??"bg-gray-100 text-gray-600"}`,children:E0e[e]??e})}function T0e({topSkills:e}){const t=e.reduce((i,a)=>i+a.total,0),n=e.length>0?e[0].total:0,r={builtin:0,team:0,personal:0};for(const i of e)i.scope in r&&(r[i.scope]+=i.total);return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:"Skill Calls Top 10"}),l.jsxs("div",{className:"text-xs text-gray-400",children:[t," total"]})]}),e.length===0?l.jsx("div",{className:"text-sm text-gray-400 text-center py-8",children:"No skill calls yet"}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"space-y-2",children:e.map(i=>{const a=n>0?i.total/n*100:0;return l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-32 truncate font-mono text-xs text-gray-600",title:i.skillName,children:i.skillName}),l.jsxs("div",{className:"flex-1 bg-gray-100 rounded-md h-6 relative overflow-hidden",children:[l.jsx("div",{className:"absolute inset-y-0 left-0 bg-purple-100 rounded-md",style:{width:`${a}%`}}),l.jsxs("div",{className:"absolute inset-0 flex items-center px-2",children:[l.jsx("span",{className:"text-xs font-medium text-purple-700",children:i.total}),i.error>0&&l.jsxs("span",{className:"text-xs text-red-400 ml-1",children:[i.error," err"]}),l.jsx("span",{className:"ml-auto",children:l.jsx(A0e,{scope:i.scope})})]})]})]},i.skillName)})}),l.jsxs("div",{className:"mt-4 pt-3 border-t border-gray-100",children:[l.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[l.jsx("span",{className:"text-gray-400",children:"By scope:"}),r.builtin>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-300"}),"core ",l.jsx("span",{className:"font-medium text-gray-700",children:r.builtin})]}),r.team>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-300"}),"team ",l.jsx("span",{className:"font-medium text-gray-700",children:r.team})]}),r.personal>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2 h-2 rounded-full bg-purple-300"}),"personal ",l.jsx("span",{className:"font-medium text-gray-700",children:r.personal})]})]}),t>0&&l.jsxs("div",{className:"flex h-1.5 mt-2 rounded-full overflow-hidden bg-gray-100",children:[r.builtin>0&&l.jsx("div",{className:"bg-blue-300",style:{width:`${r.builtin/t*100}%`}}),r.team>0&&l.jsx("div",{className:"bg-amber-300",style:{width:`${r.team/t*100}%`}}),r.personal>0&&l.jsx("div",{className:"bg-purple-300",style:{width:`${r.personal/t*100}%`}})]})]})]})]})}const oA=["bg-indigo-500","bg-violet-400","bg-emerald-400","bg-amber-400"];function tb(e){return e===0?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function Xf({label:e,value:t,total:n}){const r=n>0?t/n*100:0;return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs",children:[l.jsx("span",{className:"text-gray-600 font-medium",children:e}),l.jsxs("span",{className:"text-gray-400",children:[tb(t)," (",r.toFixed(1),"%)"]})]}),l.jsx("div",{className:"h-2 bg-gray-100 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full bg-indigo-400",style:{width:`${Math.min(r,100)}%`}})})]})}function O0e(){var o;const[e,t]=m.useState("today"),{data:n,loading:r}=QJ(e),i=["today","7d","30d"],a=(n==null?void 0:n.tokenBreakdown)??{input:0,output:0,cacheRead:0,cacheWrite:0},s=a.input+a.output+a.cacheRead+a.cacheWrite;return l.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("div",{className:"text-sm font-semibold text-gray-900",children:"Cumulative Statistics"}),l.jsx("div",{className:"flex rounded-lg overflow-hidden border border-gray-200",children:i.map(c=>l.jsx("button",{onClick:()=>t(c),className:U("px-2.5 py-1 text-xs font-medium transition",e===c?"bg-primary-600 text-white":"bg-gray-50 text-gray-600 hover:bg-gray-200"),children:c==="today"?"Today":c},c))})]}),r&&!n?l.jsx("div",{className:"text-sm text-gray-400 text-center py-8",children:"Loading..."}):l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[l.jsxs("div",{className:"rounded-xl bg-gray-50 p-3 text-center",children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Tokens"}),l.jsx("div",{className:"text-lg font-bold text-gray-900",children:tb((n==null?void 0:n.totalTokens)??0)})]}),l.jsxs("div",{className:"rounded-xl bg-gray-50 p-3 text-center",children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Sessions"}),l.jsx("div",{className:"text-lg font-bold text-gray-900",children:(n==null?void 0:n.totalSessions)??0})]}),l.jsxs("div",{className:"rounded-xl bg-gray-50 p-3 text-center",children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Prompts"}),l.jsx("div",{className:"text-lg font-bold text-gray-900",children:(n==null?void 0:n.totalPrompts)??0})]})]}),l.jsx("div",{className:"text-xs text-gray-400 mb-2",children:"Token Breakdown"}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx(Xf,{label:"Input",value:a.input,total:s}),l.jsx(Xf,{label:"Output",value:a.output,total:s}),l.jsx(Xf,{label:"Cache Read",value:a.cacheRead,total:s}),l.jsx(Xf,{label:"Cache Write",value:a.cacheWrite,total:s})]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-gray-400 mb-2",children:"Model Distribution"}),l.jsxs("div",{className:"space-y-3",children:[(!(n!=null&&n.byModel)||n.byModel.length===0)&&l.jsx("div",{className:"text-sm text-gray-400 text-center py-4",children:"No data"}),(o=n==null?void 0:n.byModel)==null?void 0:o.map((c,u)=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsxs("span",{className:"text-xs font-medium text-gray-700 truncate",children:[c.provider,"/",c.model]}),l.jsxs("span",{className:"text-xs text-gray-400 ml-2 shrink-0",children:[tb(c.tokens)," · ",c.sessions," sessions · ",c.percentage.toFixed(1),"%"]})]}),l.jsx("div",{className:"h-2 bg-gray-100 rounded-full overflow-hidden",children:l.jsx("div",{className:U("h-full rounded-full",oA[Math.min(u,oA.length-1)]),style:{width:`${c.percentage}%`}})})]},`${c.provider}-${c.model}`))]})]})]})]})}function _0e({data:e,range:t,loading:n}){if(n&&!e)return l.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-400",children:l.jsx("div",{className:"text-sm",children:"Loading metrics..."})});const r=(e==null?void 0:e.buckets)??[],i=(e==null?void 0:e.snapshot)??{activeSessions:0,wsConnections:0},a=(e==null?void 0:e.topTools)??[],s=(e==null?void 0:e.topSkills)??[];return l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsxs("div",{className:"px-6 py-6 max-w-[1400px] mx-auto w-full space-y-6",children:[l.jsx(JJ,{buckets:r,snapshot:i,range:t}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(k0e,{buckets:r}),l.jsx(j0e,{buckets:r})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(C0e,{topTools:a}),l.jsx(T0e,{topSkills:s})]}),l.jsx(N0e,{buckets:r}),l.jsx(O0e,{})]})})}const lA=[{label:"Last 1h",value:"1h",ms:36e5},{label:"Last 6h",value:"6h",ms:216e5},{label:"Last 24h",value:"24h",ms:864e5},{label:"Last 7d",value:"7d",ms:6048e5},{label:"Last 30d",value:"30d",ms:2592e6}],M0e=["All","bash","restricted_bash","run_skill","node_exec","pod_exec","kubectl"],D0e=["All","success","error","blocked"];function I0e(e,t){if(!t)return"—";try{const n=JSON.parse(t);switch(e){case"bash":case"restricted_bash":return n.command??t;case"run_skill":return[n.skill,n.script].filter(Boolean).join("/");case"node_exec":case"pod_exec":return n.command??t;default:return t.length>100?t.slice(0,100)+"...":t}}catch{return t.length>100?t.slice(0,100)+"...":t}}function P6(e){return e==null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function L0e(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function R0e(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"})}function F0e({outcome:e}){switch(e){case"success":return l.jsx(X7,{className:"w-4 h-4 text-green-500"});case"error":return l.jsx(ys,{className:"w-4 h-4 text-red-500"});case"blocked":return l.jsx(HO,{className:"w-4 h-4 text-amber-500"});default:return l.jsx("span",{className:"text-gray-400 text-xs",children:"—"})}}function z0e(){const{sendRpc:e,isConnected:t}=$t(),{isAdmin:n}=ic(e,t),[r,i]=m.useState(""),[a,s]=m.useState("All"),[o,c]=m.useState("All"),[u,d]=m.useState("24h"),[f,h]=m.useState([]),[p,g]=m.useState(!1),[y,x]=m.useState(!1),[b,v]=m.useState(!1),[w,k]=m.useState(null),[S,j]=m.useState({}),[N,P]=m.useState(!1),A=m.useCallback(async C=>{var M;x(!0);try{const I=((M=lA.find(T=>T.value===u))==null?void 0:M.ms)??864e5,B=new Date,se=new Date(B.getTime()-I).toISOString(),Q=B.toISOString(),D={startDate:se,endDate:Q,limit:50};n&&r&&(D.userName=r),a!=="All"&&(D.toolName=a),o!=="All"&&(D.outcome=o),C&&(D.cursorTs=C.ts,D.cursorId=C.id);const K=await e("audit.list",D);h(C?T=>[...T,...K.logs]:K.logs),g(K.hasMore),v(!0)}catch(I){console.error("[AuditTab] search failed:",I)}finally{x(!1)}},[e,n,r,a,o,u]);m.useEffect(()=>{t&&!b&&A()},[t,b,A]);const E=m.useCallback(()=>{if(f.length===0)return;const C=f[f.length-1],M=Math.floor(new Date(C.timestamp).getTime()/1e3);A({ts:M,id:C.id})},[f,A]),O=m.useCallback(async C=>{if(w===C){k(null);return}if(k(C),!S[C]){P(!0);try{const M=await e("audit.detail",{messageId:C});j(I=>{const B=Object.entries(I);return{...B.length>=50?Object.fromEntries(B.slice(-49)):I,[C]:M}})}catch(M){console.error("[AuditTab] detail load failed:",M)}finally{P(!1)}}},[w,S,e]);return l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l.jsxs("div",{className:"px-6 py-4 border-b border-gray-200 flex flex-wrap items-center gap-3",children:[n&&l.jsx("input",{type:"text",placeholder:"Username",value:r,onChange:C=>i(C.target.value),onKeyDown:C=>{C.key==="Enter"&&A()},className:"h-8 px-3 text-sm border border-gray-200 rounded-lg bg-white focus:outline-none focus:ring-1 focus:ring-primary-500 w-36"}),l.jsx("select",{value:a,onChange:C=>s(C.target.value),className:"h-8 px-2 text-sm border border-gray-200 rounded-lg bg-white focus:outline-none focus:ring-1 focus:ring-primary-500",children:M0e.map(C=>l.jsx("option",{value:C,children:C==="All"?"All Tools":C},C))}),l.jsx("select",{value:o,onChange:C=>c(C.target.value),className:"h-8 px-2 text-sm border border-gray-200 rounded-lg bg-white focus:outline-none focus:ring-1 focus:ring-primary-500",children:D0e.map(C=>l.jsx("option",{value:C,children:C==="All"?"All Status":C},C))}),l.jsx("select",{value:u,onChange:C=>d(C.target.value),className:"h-8 px-2 text-sm border border-gray-200 rounded-lg bg-white focus:outline-none focus:ring-1 focus:ring-primary-500",children:lA.map(C=>l.jsx("option",{value:C.value,children:C.label},C.value))}),l.jsxs("button",{onClick:()=>A(),disabled:y,className:"h-8 px-4 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 disabled:opacity-50 flex items-center gap-1.5",children:[l.jsx(Hn,{className:"w-3.5 h-3.5"}),"Search"]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:b?f.length===0?l.jsx("div",{className:"flex items-center justify-center h-full text-gray-400 text-sm",children:"No audit logs found"}):l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"sticky top-0 bg-gray-50 border-b border-gray-200",children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left px-6 py-2.5 font-medium text-gray-500 w-10"}),l.jsx("th",{className:"text-left px-3 py-2.5 font-medium text-gray-500",children:"Time"}),l.jsx("th",{className:"text-left px-3 py-2.5 font-medium text-gray-500",children:"User"}),l.jsx("th",{className:"text-left px-3 py-2.5 font-medium text-gray-500",children:"Tool"}),l.jsx("th",{className:"text-left px-3 py-2.5 font-medium text-gray-500",children:"Command"}),l.jsx("th",{className:"text-center px-3 py-2.5 font-medium text-gray-500 w-16",children:"Status"}),l.jsx("th",{className:"text-right px-6 py-2.5 font-medium text-gray-500 w-20",children:"Duration"})]})}),l.jsx("tbody",{children:f.map(C=>l.jsx($0e,{log:C,expanded:w===C.id,detail:S[C.id],detailLoading:N&&w===C.id,onToggle:()=>O(C.id)},C.id))})]}):l.jsx("div",{className:"flex items-center justify-center h-full text-gray-400 text-sm",children:"Click Search to load audit logs"})}),p&&l.jsx("div",{className:"px-6 py-3 border-t border-gray-200 flex justify-center",children:l.jsxs("button",{onClick:E,disabled:y,className:"px-4 py-1.5 text-sm text-primary-600 hover:bg-primary-50 rounded-lg disabled:opacity-50 flex items-center gap-1.5",children:[y&&l.jsx(Le,{className:"w-3.5 h-3.5 animate-spin"}),"Load More"]})})]})}function $0e({log:e,expanded:t,detail:n,detailLoading:r,onToggle:i}){const a=I0e(e.toolName,e.toolInput);return l.jsxs(l.Fragment,{children:[l.jsxs("tr",{onClick:i,className:U("cursor-pointer hover:bg-gray-50 border-b border-gray-100",t&&"bg-gray-50"),children:[l.jsx("td",{className:"px-6 py-2.5 text-gray-400",children:t?l.jsx(ea,{className:"w-4 h-4"}):l.jsx(ua,{className:"w-4 h-4"})}),l.jsxs("td",{className:"px-3 py-2.5 text-gray-600 whitespace-nowrap",children:[l.jsx("span",{className:"text-gray-400 text-xs mr-1",children:R0e(e.timestamp)}),L0e(e.timestamp)]}),l.jsx("td",{className:"px-3 py-2.5 text-gray-700 font-medium",children:e.userName??e.userId??"—"}),l.jsx("td",{className:"px-3 py-2.5",children:l.jsx("span",{className:"inline-block px-1.5 py-0.5 text-xs font-mono bg-gray-100 text-gray-600 rounded",children:e.toolName??"—"})}),l.jsx("td",{className:"px-3 py-2.5 text-gray-600 max-w-xs truncate font-mono text-xs",title:a,children:a}),l.jsx("td",{className:"px-3 py-2.5 text-center",children:l.jsx(F0e,{outcome:e.outcome})}),l.jsx("td",{className:"px-6 py-2.5 text-right text-gray-500 tabular-nums",children:P6(e.durationMs)})]}),t&&l.jsx("tr",{className:"bg-gray-50",children:l.jsx("td",{colSpan:7,className:"px-6 py-4",children:r?l.jsxs("div",{className:"flex items-center gap-2 text-gray-400 text-sm",children:[l.jsx(Le,{className:"w-4 h-4 animate-spin"}),"Loading..."]}):n?l.jsx(B0e,{detail:n}):l.jsx("div",{className:"text-gray-400 text-sm",children:"Failed to load details"})})})]})}function B0e({detail:e}){const[t,n]=m.useState(!1),r=e.content||"",i=r.length>500;let a=null;try{e.toolInput&&(a=JSON.parse(e.toolInput))}catch{}return l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm",children:[l.jsx("span",{className:"text-gray-400",children:"Tool"}),l.jsx("span",{className:"font-mono text-gray-700",children:e.toolName}),a&&e.toolName==="run_skill"&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-gray-400",children:"Skill"}),l.jsx("span",{className:"font-mono text-gray-700",children:a.skill}),l.jsx("span",{className:"text-gray-400",children:"Script"}),l.jsx("span",{className:"font-mono text-gray-700",children:a.script}),a.args&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-gray-400",children:"Args"}),l.jsx("span",{className:"font-mono text-gray-700",children:a.args})]})]}),l.jsx("span",{className:"text-gray-400",children:"Outcome"}),l.jsx("span",{className:U("font-medium",e.outcome==="success"&&"text-green-600",e.outcome==="error"&&"text-red-600",e.outcome==="blocked"&&"text-amber-600"),children:e.outcome??"—"}),l.jsx("span",{className:"text-gray-400",children:"Duration"}),l.jsx("span",{className:"text-gray-700",children:P6(e.durationMs)})]}),e.toolInput&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Command"}),l.jsx("pre",{className:"p-3 bg-gray-900 text-gray-100 rounded-lg text-xs font-mono overflow-auto max-h-64",children:e.toolInput})]}),r&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Output"}),l.jsx("pre",{className:U("p-3 bg-gray-900 text-gray-100 rounded-lg text-xs font-mono overflow-auto",!t&&i&&"max-h-48"),children:t||!i?r:r.slice(0,500)+"..."}),i&&l.jsx("button",{onClick:()=>n(s=>!s),className:"mt-1 text-xs text-primary-600 hover:text-primary-700",children:t?"Show less":"Show full output"})]})]})}function U0e({grafanaUrl:e}){return e?l.jsx("iframe",{src:e,className:"flex-1 w-full border-0",allow:"fullscreen",title:"Grafana Dashboard"}):l.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-400",children:l.jsxs("div",{className:"text-center",children:[l.jsx(rw,{className:"w-12 h-12 mx-auto mb-3 text-gray-300"}),l.jsx("div",{className:"text-lg font-medium text-gray-500 mb-1",children:"Grafana"}),l.jsxs("div",{className:"text-sm",children:["Configure Grafana URL in"," ",l.jsx(UO,{to:"/settings/system",className:"text-primary-600 hover:underline",children:"System Settings"})," ","to enable."]})]})})}function V0e(){const[e,t]=m.useState("dashboard"),[n,r]=m.useState("1h"),[i,a]=m.useState(null),{sendRpc:s,isConnected:o}=$t(),{data:c,loading:u,refresh:d}=ZJ(n);m.useEffect(()=>{o&&s("system.getConfig").then(y=>{var x;a(((x=y.config)==null?void 0:x["system.grafanaUrl"])||null)}).catch(()=>{})},[s,o]);const[f,h]=m.useState(!1),p=m.useCallback(()=>{h(!0),d(),setTimeout(()=>h(!1),600)},[d]),g=["1h","6h","24h"];return l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden bg-white",children:[l.jsxs("div",{className:"h-14 flex items-center justify-between px-6 border-b border-gray-200 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Dashboard"}),l.jsxs("div",{className:"flex gap-4 ml-4",children:[l.jsx("button",{onClick:()=>t("dashboard"),className:U("pb-[13px] pt-[14px] text-sm px-1 transition border-b-2",e==="dashboard"?"border-primary-600 text-primary-600 font-semibold":"border-transparent text-gray-500 hover:text-gray-700"),children:"Metrics"}),l.jsx("button",{onClick:()=>t("audit"),className:U("pb-[13px] pt-[14px] text-sm px-1 transition border-b-2",e==="audit"?"border-primary-600 text-primary-600 font-semibold":"border-transparent text-gray-500 hover:text-gray-700"),children:"Audit"}),i&&l.jsx("button",{onClick:()=>t("grafana"),className:U("pb-[13px] pt-[14px] text-sm px-1 transition border-b-2",e==="grafana"?"border-primary-600 text-primary-600 font-semibold":"border-transparent text-gray-500 hover:text-gray-700"),children:"Grafana"})]})]}),e==="dashboard"&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex rounded-lg overflow-hidden border border-gray-200",children:g.map(y=>l.jsx("button",{onClick:()=>r(y),className:U("px-3 py-1.5 text-xs font-medium transition",n===y?"bg-primary-600 text-white":"bg-gray-50 text-gray-600 hover:bg-gray-200"),children:y},y))}),l.jsx("button",{onClick:p,className:"p-2 rounded-lg hover:bg-gray-100 text-gray-400 hover:text-gray-600 transition",children:l.jsx(uB,{className:U("w-4 h-4 transition-transform duration-500",f&&"animate-spin")})})]})]}),e==="dashboard"?l.jsx(_0e,{data:c,range:n,loading:u}):e==="audit"?l.jsx(z0e,{}):l.jsx(U0e,{grafanaUrl:i})]})}function W0e({title:e}){return l.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-400",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-lg font-medium text-gray-500 mb-1",children:e}),l.jsx("div",{className:"text-sm",children:"Coming soon"})]})})}const H0e=E7([{path:"/login",element:l.jsx(pG,{})},{path:"/login/sso-callback",element:l.jsx(mG,{})},{element:l.jsx(hG,{}),children:[{path:"/",element:l.jsx(fG,{}),children:[{index:!0,element:l.jsx(uh,{to:"/pilot",replace:!0})},{path:"pilot",element:l.jsx(UQ,{})},{path:"skills",children:[{index:!0,element:l.jsx(WQ,{})},{path:":id",element:l.jsx(uJ,{})}]},{path:"channels",element:l.jsx(mJ,{})},{path:"triggers",element:l.jsx(vJ,{})},{path:"cron",element:l.jsx(kJ,{})},{path:"permissions",element:l.jsx(AJ,{})},{path:"settings",element:l.jsx(PJ,{}),children:[{index:!0,element:l.jsx(NJ,{})},{path:"system",element:l.jsx(EJ,{})}]},{path:"credentials",element:l.jsx(XJ,{})},{path:"sessions",element:l.jsx(W0e,{title:"Sessions"})},{path:"workspace",element:l.jsx($J,{})},{path:"mcp",element:l.jsx(KJ,{})},{path:"environments",element:l.jsx(uh,{to:"/credentials",replace:!0})},{path:"models",element:l.jsx(IJ,{})},{path:"metrics",element:l.jsx(V0e,{})}]}]},{path:"*",element:l.jsx(uh,{to:"/login",replace:!0})}]);function K0e(){return l.jsx(L7,{router:H0e})}Ny.createRoot(document.getElementById("root")).render(l.jsx(K0e,{}));