agent-nuvira 3.3.7 โ†’ 3.3.9

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 (257) hide show
  1. package/README.md +57 -50
  2. package/dist/agents/agents/planner.d.ts.map +1 -1
  3. package/dist/agents/agents/planner.js +41 -0
  4. package/dist/agents/agents/planner.js.map +1 -1
  5. package/dist/agents/agents/reasoner.d.ts.map +1 -1
  6. package/dist/agents/agents/reasoner.js +6 -0
  7. package/dist/agents/agents/reasoner.js.map +1 -1
  8. package/dist/agents/agents/runner.d.ts +6 -0
  9. package/dist/agents/agents/runner.d.ts.map +1 -1
  10. package/dist/agents/agents/runner.js +82 -5
  11. package/dist/agents/agents/runner.js.map +1 -1
  12. package/dist/agents/agents/writer-tool-calling.d.ts.map +1 -1
  13. package/dist/agents/agents/writer-tool-calling.js +5 -2
  14. package/dist/agents/agents/writer-tool-calling.js.map +1 -1
  15. package/dist/agents/agents/writer.d.ts.map +1 -1
  16. package/dist/agents/agents/writer.js +8 -4
  17. package/dist/agents/agents/writer.js.map +1 -1
  18. package/dist/agents/fanout-scheduler.d.ts +72 -0
  19. package/dist/agents/fanout-scheduler.d.ts.map +1 -0
  20. package/dist/agents/fanout-scheduler.js +100 -0
  21. package/dist/agents/fanout-scheduler.js.map +1 -0
  22. package/dist/agents/orchestrator.d.ts.map +1 -1
  23. package/dist/agents/orchestrator.js +30 -1
  24. package/dist/agents/orchestrator.js.map +1 -1
  25. package/dist/agents/plan-quality.d.ts +58 -0
  26. package/dist/agents/plan-quality.d.ts.map +1 -0
  27. package/dist/agents/plan-quality.js +152 -0
  28. package/dist/agents/plan-quality.js.map +1 -0
  29. package/dist/agents/prompt-assembly.d.ts +8 -0
  30. package/dist/agents/prompt-assembly.d.ts.map +1 -1
  31. package/dist/agents/prompt-assembly.js +18 -0
  32. package/dist/agents/prompt-assembly.js.map +1 -1
  33. package/dist/agents/step-handoff.d.ts +12 -2
  34. package/dist/agents/step-handoff.d.ts.map +1 -1
  35. package/dist/agents/step-handoff.js +65 -8
  36. package/dist/agents/step-handoff.js.map +1 -1
  37. package/dist/agents/tool-calling-agent.d.ts.map +1 -1
  38. package/dist/agents/tool-calling-agent.js +18 -0
  39. package/dist/agents/tool-calling-agent.js.map +1 -1
  40. package/dist/cli/cache.d.ts.map +1 -1
  41. package/dist/cli/cache.js +34 -4
  42. package/dist/cli/cache.js.map +1 -1
  43. package/dist/cli/chat.d.ts +6 -0
  44. package/dist/cli/chat.d.ts.map +1 -1
  45. package/dist/cli/chat.js +79 -18
  46. package/dist/cli/chat.js.map +1 -1
  47. package/dist/cli/cli-program.d.ts.map +1 -1
  48. package/dist/cli/cli-program.js +6 -0
  49. package/dist/cli/cli-program.js.map +1 -1
  50. package/dist/cli/config.d.ts +10 -0
  51. package/dist/cli/config.d.ts.map +1 -1
  52. package/dist/cli/config.js +179 -1
  53. package/dist/cli/config.js.map +1 -1
  54. package/dist/cli/continuity.d.ts +61 -0
  55. package/dist/cli/continuity.d.ts.map +1 -0
  56. package/dist/cli/continuity.js +112 -0
  57. package/dist/cli/continuity.js.map +1 -0
  58. package/dist/cli/dashboard.d.ts +3 -1
  59. package/dist/cli/dashboard.d.ts.map +1 -1
  60. package/dist/cli/dashboard.js +5 -16
  61. package/dist/cli/dashboard.js.map +1 -1
  62. package/dist/cli/doctor.d.ts.map +1 -1
  63. package/dist/cli/doctor.js +48 -1
  64. package/dist/cli/doctor.js.map +1 -1
  65. package/dist/cli/execute.d.ts +8 -0
  66. package/dist/cli/execute.d.ts.map +1 -1
  67. package/dist/cli/execute.js +34 -1
  68. package/dist/cli/execute.js.map +1 -1
  69. package/dist/cli/loop-executor.d.ts +24 -0
  70. package/dist/cli/loop-executor.d.ts.map +1 -1
  71. package/dist/cli/loop-executor.js +134 -13
  72. package/dist/cli/loop-executor.js.map +1 -1
  73. package/dist/cli/website.d.ts +25 -0
  74. package/dist/cli/website.d.ts.map +1 -0
  75. package/dist/cli/website.js +58 -0
  76. package/dist/cli/website.js.map +1 -0
  77. package/dist/config/manager.d.ts.map +1 -1
  78. package/dist/config/manager.js +35 -0
  79. package/dist/config/manager.js.map +1 -1
  80. package/dist/config/process-env.d.ts.map +1 -1
  81. package/dist/config/process-env.js +20 -0
  82. package/dist/config/process-env.js.map +1 -1
  83. package/dist/config/provider-env.d.ts +2 -1
  84. package/dist/config/provider-env.d.ts.map +1 -1
  85. package/dist/config/provider-env.js +19 -2
  86. package/dist/config/provider-env.js.map +1 -1
  87. package/dist/config/service-catalog.d.ts +81 -0
  88. package/dist/config/service-catalog.d.ts.map +1 -0
  89. package/dist/config/service-catalog.js +286 -0
  90. package/dist/config/service-catalog.js.map +1 -0
  91. package/dist/config/service-probe.d.ts +27 -0
  92. package/dist/config/service-probe.d.ts.map +1 -0
  93. package/dist/config/service-probe.js +104 -0
  94. package/dist/config/service-probe.js.map +1 -0
  95. package/dist/config/types.d.ts +63 -0
  96. package/dist/config/types.d.ts.map +1 -1
  97. package/dist/context/cache.d.ts +46 -2
  98. package/dist/context/cache.d.ts.map +1 -1
  99. package/dist/context/cache.js +85 -7
  100. package/dist/context/cache.js.map +1 -1
  101. package/dist/findings/verdicts.d.ts +59 -0
  102. package/dist/findings/verdicts.d.ts.map +1 -1
  103. package/dist/findings/verdicts.js +117 -0
  104. package/dist/findings/verdicts.js.map +1 -1
  105. package/dist/forwarded.d.ts +2 -0
  106. package/dist/forwarded.d.ts.map +1 -0
  107. package/dist/forwarded.js +2 -0
  108. package/dist/forwarded.js.map +1 -0
  109. package/dist/gateway/registry.d.ts.map +1 -1
  110. package/dist/gateway/registry.js +9 -0
  111. package/dist/gateway/registry.js.map +1 -1
  112. package/dist/learning/auto-router.d.ts +30 -0
  113. package/dist/learning/auto-router.d.ts.map +1 -1
  114. package/dist/learning/auto-router.js +69 -12
  115. package/dist/learning/auto-router.js.map +1 -1
  116. package/dist/learning/context-assembly.d.ts +37 -0
  117. package/dist/learning/context-assembly.d.ts.map +1 -0
  118. package/dist/learning/context-assembly.js +63 -0
  119. package/dist/learning/context-assembly.js.map +1 -0
  120. package/dist/learning/reasoning-trace.d.ts +26 -5
  121. package/dist/learning/reasoning-trace.d.ts.map +1 -1
  122. package/dist/learning/reasoning-trace.js +21 -1
  123. package/dist/learning/reasoning-trace.js.map +1 -1
  124. package/dist/learning/session-digest.d.ts +78 -0
  125. package/dist/learning/session-digest.d.ts.map +1 -0
  126. package/dist/learning/session-digest.js +185 -0
  127. package/dist/learning/session-digest.js.map +1 -0
  128. package/dist/learning/session-recall.d.ts +135 -0
  129. package/dist/learning/session-recall.d.ts.map +1 -0
  130. package/dist/learning/session-recall.js +305 -0
  131. package/dist/learning/session-recall.js.map +1 -0
  132. package/dist/learning/session-store.d.ts +172 -0
  133. package/dist/learning/session-store.d.ts.map +1 -0
  134. package/dist/learning/session-store.js +424 -0
  135. package/dist/learning/session-store.js.map +1 -0
  136. package/dist/learning/step-checkpoint.d.ts +28 -0
  137. package/dist/learning/step-checkpoint.d.ts.map +1 -1
  138. package/dist/learning/step-checkpoint.js +90 -6
  139. package/dist/learning/step-checkpoint.js.map +1 -1
  140. package/dist/learning/working-state.d.ts +19 -0
  141. package/dist/learning/working-state.d.ts.map +1 -1
  142. package/dist/learning/working-state.js +34 -1
  143. package/dist/learning/working-state.js.map +1 -1
  144. package/dist/parity/drivers.d.ts.map +1 -1
  145. package/dist/parity/drivers.js +29 -0
  146. package/dist/parity/drivers.js.map +1 -1
  147. package/dist/parity/wire-fixtures.d.ts +88 -0
  148. package/dist/parity/wire-fixtures.d.ts.map +1 -0
  149. package/dist/parity/wire-fixtures.js +405 -0
  150. package/dist/parity/wire-fixtures.js.map +1 -0
  151. package/dist/tools/artifact-append.d.ts +23 -0
  152. package/dist/tools/artifact-append.d.ts.map +1 -1
  153. package/dist/tools/artifact-append.js +28 -0
  154. package/dist/tools/artifact-append.js.map +1 -1
  155. package/dist/tools/ask-user.d.ts +5 -0
  156. package/dist/tools/ask-user.d.ts.map +1 -1
  157. package/dist/tools/ask-user.js +51 -5
  158. package/dist/tools/ask-user.js.map +1 -1
  159. package/dist/tools/child-agent-entry.js +1 -0
  160. package/dist/tools/child-agent-entry.js.map +1 -1
  161. package/dist/tools/child-agent-runtime.d.ts +7 -0
  162. package/dist/tools/child-agent-runtime.d.ts.map +1 -1
  163. package/dist/tools/child-agent-runtime.js +116 -6
  164. package/dist/tools/child-agent-runtime.js.map +1 -1
  165. package/dist/tools/child-agent-worker.d.ts +15 -0
  166. package/dist/tools/child-agent-worker.d.ts.map +1 -0
  167. package/dist/tools/child-agent-worker.js.map +1 -0
  168. package/dist/tools/coding-tools.d.ts.map +1 -1
  169. package/dist/tools/coding-tools.js +11 -0
  170. package/dist/tools/coding-tools.js.map +1 -1
  171. package/dist/tools/finding-tool.d.ts +6 -1
  172. package/dist/tools/finding-tool.d.ts.map +1 -1
  173. package/dist/tools/finding-tool.js +15 -2
  174. package/dist/tools/finding-tool.js.map +1 -1
  175. package/dist/tools/followup-utils.d.ts +35 -0
  176. package/dist/tools/followup-utils.d.ts.map +1 -1
  177. package/dist/tools/followup-utils.js +36 -0
  178. package/dist/tools/followup-utils.js.map +1 -1
  179. package/dist/tools/loop-project-context.d.ts +4 -1
  180. package/dist/tools/loop-project-context.d.ts.map +1 -1
  181. package/dist/tools/loop-project-context.js +48 -1
  182. package/dist/tools/loop-project-context.js.map +1 -1
  183. package/dist/tools/loop-skill-hint.d.ts.map +1 -1
  184. package/dist/tools/loop-skill-hint.js +7 -0
  185. package/dist/tools/loop-skill-hint.js.map +1 -1
  186. package/dist/tools/modality/image-gen.d.ts +25 -6
  187. package/dist/tools/modality/image-gen.d.ts.map +1 -1
  188. package/dist/tools/modality/image-gen.js +46 -27
  189. package/dist/tools/modality/image-gen.js.map +1 -1
  190. package/dist/tools/modality/image-providers.d.ts +71 -0
  191. package/dist/tools/modality/image-providers.d.ts.map +1 -0
  192. package/dist/tools/modality/image-providers.js +277 -0
  193. package/dist/tools/modality/image-providers.js.map +1 -0
  194. package/dist/tools/registry.d.ts +10 -1
  195. package/dist/tools/registry.d.ts.map +1 -1
  196. package/dist/tools/registry.js +35 -8
  197. package/dist/tools/registry.js.map +1 -1
  198. package/dist/tools/run-cli.d.ts.map +1 -1
  199. package/dist/tools/run-cli.js +39 -1
  200. package/dist/tools/run-cli.js.map +1 -1
  201. package/dist/tools/run-terminal.d.ts.map +1 -1
  202. package/dist/tools/run-terminal.js +50 -6
  203. package/dist/tools/run-terminal.js.map +1 -1
  204. package/dist/tools/subagent-spawner.d.ts +8 -0
  205. package/dist/tools/subagent-spawner.d.ts.map +1 -1
  206. package/dist/tools/subagent-spawner.js +3 -0
  207. package/dist/tools/subagent-spawner.js.map +1 -1
  208. package/dist/tools/tool-loop.d.ts +55 -0
  209. package/dist/tools/tool-loop.d.ts.map +1 -1
  210. package/dist/tools/tool-loop.js +136 -0
  211. package/dist/tools/tool-loop.js.map +1 -1
  212. package/dist/tools/untrusted-content.d.ts +29 -0
  213. package/dist/tools/untrusted-content.d.ts.map +1 -0
  214. package/dist/tools/untrusted-content.js +53 -0
  215. package/dist/tools/untrusted-content.js.map +1 -0
  216. package/dist/tools/web-research.d.ts +76 -14
  217. package/dist/tools/web-research.d.ts.map +1 -1
  218. package/dist/tools/web-research.js +280 -35
  219. package/dist/tools/web-research.js.map +1 -1
  220. package/dist/utils/effect-verification.d.ts +115 -0
  221. package/dist/utils/effect-verification.d.ts.map +1 -0
  222. package/dist/utils/effect-verification.js +337 -0
  223. package/dist/utils/effect-verification.js.map +1 -0
  224. package/dist/utils/open-url.d.ts +16 -0
  225. package/dist/utils/open-url.d.ts.map +1 -0
  226. package/dist/utils/open-url.js +32 -0
  227. package/dist/utils/open-url.js.map +1 -0
  228. package/dist/utils/project-env.d.ts +146 -0
  229. package/dist/utils/project-env.d.ts.map +1 -0
  230. package/dist/utils/project-env.js +584 -0
  231. package/dist/utils/project-env.js.map +1 -0
  232. package/dist/utils/shell.d.ts +7 -0
  233. package/dist/utils/shell.d.ts.map +1 -1
  234. package/dist/utils/shell.js +2 -0
  235. package/dist/utils/shell.js.map +1 -1
  236. package/dist/web-dashboard/chat-console.d.ts +2 -0
  237. package/dist/web-dashboard/chat-console.d.ts.map +1 -1
  238. package/dist/web-dashboard/chat-console.js +7 -0
  239. package/dist/web-dashboard/chat-console.js.map +1 -1
  240. package/dist/web-dashboard/server.d.ts +3 -1
  241. package/dist/web-dashboard/server.d.ts.map +1 -1
  242. package/dist/web-dashboard/server.js +534 -8
  243. package/dist/web-dashboard/server.js.map +1 -1
  244. package/dist/web-dashboard/src/types.d.ts +150 -1
  245. package/dist/web-dashboard/src/types.d.ts.map +1 -1
  246. package/dist/web-dashboard/workspace-guard.d.ts +40 -0
  247. package/dist/web-dashboard/workspace-guard.d.ts.map +1 -0
  248. package/dist/web-dashboard/workspace-guard.js +92 -0
  249. package/dist/web-dashboard/workspace-guard.js.map +1 -0
  250. package/package.json +4 -1
  251. package/src/web-dashboard/public/assets/index-Beportyl.js +207 -0
  252. package/src/web-dashboard/public/assets/index-Beportyl.js.map +1 -0
  253. package/src/web-dashboard/public/assets/index-gtQyg9nm.css +1 -0
  254. package/src/web-dashboard/public/index.html +2 -2
  255. package/src/web-dashboard/public/assets/index-D1YFCcIZ.js +0 -207
  256. package/src/web-dashboard/public/assets/index-D1YFCcIZ.js.map +0 -1
  257. package/src/web-dashboard/public/assets/index-jkW5qcf-.css +0 -1
@@ -1,207 +0,0 @@
1
- var ZI=Object.defineProperty;var QI=(e,t,n)=>t in e?ZI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Vr=(e,t,n)=>QI(e,typeof t!="symbol"?t+"":t,n);function JI(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();var Ja=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z_={exports:{}},Vh={},F_={exports:{}},Fe={};/**
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 Pu=Symbol.for("react.element"),e$=Symbol.for("react.portal"),t$=Symbol.for("react.fragment"),n$=Symbol.for("react.strict_mode"),r$=Symbol.for("react.profiler"),a$=Symbol.for("react.provider"),i$=Symbol.for("react.context"),s$=Symbol.for("react.forward_ref"),o$=Symbol.for("react.suspense"),l$=Symbol.for("react.memo"),c$=Symbol.for("react.lazy"),kw=Symbol.iterator;function u$(e){return e===null||typeof e!="object"?null:(e=kw&&e[kw]||e["@@iterator"],typeof e=="function"?e:null)}var U_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},W_=Object.assign,H_={};function il(e,t,n){this.props=e,this.context=t,this.refs=H_,this.updater=n||U_}il.prototype.isReactComponent={};il.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")};il.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function G_(){}G_.prototype=il.prototype;function Rb(e,t,n){this.props=e,this.context=t,this.refs=H_,this.updater=n||U_}var Mb=Rb.prototype=new G_;Mb.constructor=Rb;W_(Mb,il.prototype);Mb.isPureReactComponent=!0;var Nw=Array.isArray,q_=Object.prototype.hasOwnProperty,Ib={current:null},K_={key:!0,ref:!0,__self:!0,__source:!0};function V_(e,t,n){var r,a={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)q_.call(t,r)&&!K_.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(l===1)a.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)a[r]===void 0&&(a[r]=l[r]);return{$$typeof:Pu,type:e,key:s,ref:o,props:a,_owner:Ib.current}}function d$(e,t){return{$$typeof:Pu,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function $b(e){return typeof e=="object"&&e!==null&&e.$$typeof===Pu}function f$(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ew=/\/+/g;function vm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?f$(""+e.key):t.toString(36)}function Zd(e,t,n,r,a){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Pu:case e$:o=!0}}if(o)return o=e,a=a(o),e=r===""?"."+vm(o,0):r,Nw(a)?(n="",e!=null&&(n=e.replace(Ew,"$&/")+"/"),Zd(a,t,n,"",function(u){return u})):a!=null&&($b(a)&&(a=d$(a,n+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(Ew,"$&/")+"/")+e)),t.push(a)),1;if(o=0,r=r===""?".":r+":",Nw(e))for(var l=0;l<e.length;l++){s=e[l];var c=r+vm(s,l);o+=Zd(s,t,n,c,a)}else if(c=u$(e),typeof c=="function")for(e=c.call(e),l=0;!(s=e.next()).done;)s=s.value,c=r+vm(s,l++),o+=Zd(s,t,n,c,a);else if(s==="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 o}function id(e,t,n){if(e==null)return e;var r=[],a=0;return Zd(e,r,"","",function(s){return t.call(n,s,a++)}),r}function h$(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 On={current:null},Qd={transition:null},p$={ReactCurrentDispatcher:On,ReactCurrentBatchConfig:Qd,ReactCurrentOwner:Ib};function Y_(){throw Error("act(...) is not supported in production builds of React.")}Fe.Children={map:id,forEach:function(e,t,n){id(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return id(e,function(){t++}),t},toArray:function(e){return id(e,function(t){return t})||[]},only:function(e){if(!$b(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Fe.Component=il;Fe.Fragment=t$;Fe.Profiler=r$;Fe.PureComponent=Rb;Fe.StrictMode=n$;Fe.Suspense=o$;Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=p$;Fe.act=Y_;Fe.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=W_({},e.props),a=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Ib.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)q_.call(t,c)&&!K_.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Pu,type:e.type,key:a,ref:s,props:r,_owner:o}};Fe.createContext=function(e){return e={$$typeof:i$,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:a$,_context:e},e.Consumer=e};Fe.createElement=V_;Fe.createFactory=function(e){var t=V_.bind(null,e);return t.type=e,t};Fe.createRef=function(){return{current:null}};Fe.forwardRef=function(e){return{$$typeof:s$,render:e}};Fe.isValidElement=$b;Fe.lazy=function(e){return{$$typeof:c$,_payload:{_status:-1,_result:e},_init:h$}};Fe.memo=function(e,t){return{$$typeof:l$,type:e,compare:t===void 0?null:t}};Fe.startTransition=function(e){var t=Qd.transition;Qd.transition={};try{e()}finally{Qd.transition=t}};Fe.unstable_act=Y_;Fe.useCallback=function(e,t){return On.current.useCallback(e,t)};Fe.useContext=function(e){return On.current.useContext(e)};Fe.useDebugValue=function(){};Fe.useDeferredValue=function(e){return On.current.useDeferredValue(e)};Fe.useEffect=function(e,t){return On.current.useEffect(e,t)};Fe.useId=function(){return On.current.useId()};Fe.useImperativeHandle=function(e,t,n){return On.current.useImperativeHandle(e,t,n)};Fe.useInsertionEffect=function(e,t){return On.current.useInsertionEffect(e,t)};Fe.useLayoutEffect=function(e,t){return On.current.useLayoutEffect(e,t)};Fe.useMemo=function(e,t){return On.current.useMemo(e,t)};Fe.useReducer=function(e,t,n){return On.current.useReducer(e,t,n)};Fe.useRef=function(e){return On.current.useRef(e)};Fe.useState=function(e){return On.current.useState(e)};Fe.useSyncExternalStore=function(e,t,n){return On.current.useSyncExternalStore(e,t,n)};Fe.useTransition=function(){return On.current.useTransition()};Fe.version="18.3.1";F_.exports=Fe;var k=F_.exports;const H=Qe(k),m$=JI({__proto__:null,default:H},[k]);/**
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 g$=k,v$=Symbol.for("react.element"),y$=Symbol.for("react.fragment"),b$=Object.prototype.hasOwnProperty,x$=g$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w$={key:!0,ref:!0,__self:!0,__source:!0};function X_(e,t,n){var r,a={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)b$.call(t,r)&&!w$.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:v$,type:e,key:s,ref:o,props:a,_owner:x$.current}}Vh.Fragment=y$;Vh.jsx=X_;Vh.jsxs=X_;z_.exports=Vh;var i=z_.exports,Z_={exports:{}},sr={},Q_={exports:{}},J_={};/**
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(O,U){var A=O.length;O.push(U);e:for(;0<A;){var Z=A-1>>>1,D=O[Z];if(0<a(D,U))O[Z]=U,O[A]=D,A=Z;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var U=O[0],A=O.pop();if(A!==U){O[0]=A;e:for(var Z=0,D=O.length,P=D>>>1;Z<P;){var oe=2*(Z+1)-1,be=O[oe],pe=oe+1,Ce=O[pe];if(0>a(be,A))pe<D&&0>a(Ce,be)?(O[Z]=Ce,O[pe]=A,Z=pe):(O[Z]=be,O[oe]=A,Z=oe);else if(pe<D&&0>a(Ce,A))O[Z]=Ce,O[pe]=A,Z=pe;else break e}}return U}function a(O,U){var A=O.sortIndex-U.sortIndex;return A!==0?A:O.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,g=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=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(O){for(var U=n(u);U!==null;){if(U.callback===null)r(u);else if(U.startTime<=O)r(u),U.sortIndex=U.expirationTime,t(c,U);else break;U=n(u)}}function N(O){if(m=!1,w(O),!g)if(n(c)!==null)g=!0,z(S);else{var U=n(u);U!==null&&M(N,U.startTime-O)}}function S(O,U){g=!1,m&&(m=!1,v(j),j=-1),p=!0;var A=h;try{for(w(U),f=n(c);f!==null&&(!(f.expirationTime>U)||O&&!$());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,h=f.priorityLevel;var D=Z(f.expirationTime<=U);U=e.unstable_now(),typeof D=="function"?f.callback=D:f===n(c)&&r(c),w(U)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var oe=n(u);oe!==null&&M(N,oe.startTime-U),P=!1}return P}finally{f=null,h=A,p=!1}}var x=!1,E=null,j=-1,C=5,T=-1;function $(){return!(e.unstable_now()-T<C)}function R(){if(E!==null){var O=e.unstable_now();T=O;var U=!0;try{U=E(!0,O)}finally{U?I():(x=!1,E=null)}}else x=!1}var I;if(typeof b=="function")I=function(){b(R)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,F=L.port2;L.port1.onmessage=R,I=function(){F.postMessage(null)}}else I=function(){y(R,0)};function z(O){E=O,x||(x=!0,I())}function M(O,U){j=y(function(){O(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,z(S))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(O){switch(h){case 1:case 2:case 3:var U=3;break;default:U=h}var A=h;h=U;try{return O()}finally{h=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,U){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var A=h;h=O;try{return U()}finally{h=A}},e.unstable_scheduleCallback=function(O,U,A){var Z=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?Z+A:Z):A=Z,O){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=A+D,O={id:d++,callback:U,priorityLevel:O,startTime:A,expirationTime:D,sortIndex:-1},A>Z?(O.sortIndex=A,t(u,O),n(c)===null&&O===n(u)&&(m?(v(j),j=-1):m=!0,M(N,A-Z))):(O.sortIndex=D,t(c,O),g||p||(g=!0,z(S))),O},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(O){var U=h;return function(){var A=h;h=U;try{return O.apply(this,arguments)}finally{h=A}}}})(J_);Q_.exports=J_;var S$=Q_.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 k$=k,ar=S$;function se(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 eA=new Set,_c={};function ws(e,t){Ao(e,t),Ao(e+"Capture",t)}function Ao(e,t){for(_c[e]=t,e=0;e<t.length;e++)eA.add(t[e])}var Ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zg=Object.prototype.hasOwnProperty,N$=/^[: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]*$/,jw={},_w={};function E$(e){return Zg.call(_w,e)?!0:Zg.call(jw,e)?!1:N$.test(e)?_w[e]=!0:(jw[e]=!0,!1)}function j$(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 _$(e,t,n,r){if(t===null||typeof t>"u"||j$(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 Pn(e,t,n,r,a,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var cn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){cn[e]=new Pn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];cn[t]=new Pn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){cn[e]=new Pn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){cn[e]=new Pn(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){cn[e]=new Pn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){cn[e]=new Pn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){cn[e]=new Pn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){cn[e]=new Pn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){cn[e]=new Pn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Lb=/[\-:]([a-z])/g;function Db(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(Lb,Db);cn[t]=new Pn(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(Lb,Db);cn[t]=new Pn(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(Lb,Db);cn[t]=new Pn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){cn[e]=new Pn(e,1,!1,e.toLowerCase(),null,!1,!1)});cn.xlinkHref=new Pn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){cn[e]=new Pn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Bb(e,t,n,r){var a=cn.hasOwnProperty(t)?cn[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(_$(t,n,a,r)&&(n=null),r||a===null?E$(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var $a=k$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,sd=Symbol.for("react.element"),Js=Symbol.for("react.portal"),eo=Symbol.for("react.fragment"),zb=Symbol.for("react.strict_mode"),Qg=Symbol.for("react.profiler"),tA=Symbol.for("react.provider"),nA=Symbol.for("react.context"),Fb=Symbol.for("react.forward_ref"),Jg=Symbol.for("react.suspense"),ev=Symbol.for("react.suspense_list"),Ub=Symbol.for("react.memo"),qa=Symbol.for("react.lazy"),rA=Symbol.for("react.offscreen"),Aw=Symbol.iterator;function Il(e){return e===null||typeof e!="object"?null:(e=Aw&&e[Aw]||e["@@iterator"],typeof e=="function"?e:null)}var St=Object.assign,ym;function ac(e){if(ym===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ym=t&&t[1]||""}return`
34
- `+ym+e}var bm=!1;function xm(e,t){if(!e||bm)return"";bm=!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 a=u.stack.split(`
35
- `),s=r.stack.split(`
36
- `),o=a.length-1,l=s.length-1;1<=o&&0<=l&&a[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==s[l]){var c=`
37
- `+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{bm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ac(e):""}function A$(e){switch(e.tag){case 5:return ac(e.type);case 16:return ac("Lazy");case 13:return ac("Suspense");case 19:return ac("SuspenseList");case 0:case 2:case 15:return e=xm(e.type,!1),e;case 11:return e=xm(e.type.render,!1),e;case 1:return e=xm(e.type,!0),e;default:return""}}function tv(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 eo:return"Fragment";case Js:return"Portal";case Qg:return"Profiler";case zb:return"StrictMode";case Jg:return"Suspense";case ev:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case nA:return(e.displayName||"Context")+".Consumer";case tA:return(e._context.displayName||"Context")+".Provider";case Fb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ub:return t=e.displayName||null,t!==null?t:tv(e.type)||"Memo";case qa:t=e._payload,e=e._init;try{return tv(e(t))}catch{}}return null}function C$(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 tv(t);case 8:return t===zb?"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 gi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function aA(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function T$(e){var t=aA(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 a=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function od(e){e._valueTracker||(e._valueTracker=T$(e))}function iA(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=aA(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function hf(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 nv(e,t){var n=t.checked;return St({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Cw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=gi(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 sA(e,t){t=t.checked,t!=null&&Bb(e,"checked",t,!1)}function rv(e,t){sA(e,t);var n=gi(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")?av(e,t.type,n):t.hasOwnProperty("defaultValue")&&av(e,t.type,gi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Tw(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 av(e,t,n){(t!=="number"||hf(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ic=Array.isArray;function vo(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+gi(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function iv(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(se(91));return St({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ow(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(se(92));if(ic(n)){if(1<n.length)throw Error(se(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:gi(n)}}function oA(e,t){var n=gi(t.value),r=gi(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 Pw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function lA(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 sv(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?lA(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ld,cA=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ld=ld||document.createElement("div"),ld.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ld.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ac(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var uc={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},O$=["Webkit","ms","Moz","O"];Object.keys(uc).forEach(function(e){O$.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),uc[t]=uc[e]})});function uA(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||uc.hasOwnProperty(e)&&uc[e]?(""+t).trim():t+"px"}function dA(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=uA(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var P$=St({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 ov(e,t){if(t){if(P$[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(se(62))}}function lv(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 cv=null;function Wb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var uv=null,yo=null,bo=null;function Rw(e){if(e=Iu(e)){if(typeof uv!="function")throw Error(se(280));var t=e.stateNode;t&&(t=Jh(t),uv(e.stateNode,e.type,t))}}function fA(e){yo?bo?bo.push(e):bo=[e]:yo=e}function hA(){if(yo){var e=yo,t=bo;if(bo=yo=null,Rw(e),t)for(e=0;e<t.length;e++)Rw(t[e])}}function pA(e,t){return e(t)}function mA(){}var wm=!1;function gA(e,t,n){if(wm)return e(t,n);wm=!0;try{return pA(e,t,n)}finally{wm=!1,(yo!==null||bo!==null)&&(mA(),hA())}}function Cc(e,t){var n=e.stateNode;if(n===null)return null;var r=Jh(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(se(231,t,typeof n));return n}var dv=!1;if(Ca)try{var $l={};Object.defineProperty($l,"passive",{get:function(){dv=!0}}),window.addEventListener("test",$l,$l),window.removeEventListener("test",$l,$l)}catch{dv=!1}function R$(e,t,n,r,a,s,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var dc=!1,pf=null,mf=!1,fv=null,M$={onError:function(e){dc=!0,pf=e}};function I$(e,t,n,r,a,s,o,l,c){dc=!1,pf=null,R$.apply(M$,arguments)}function $$(e,t,n,r,a,s,o,l,c){if(I$.apply(this,arguments),dc){if(dc){var u=pf;dc=!1,pf=null}else throw Error(se(198));mf||(mf=!0,fv=u)}}function Ss(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 vA(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 Mw(e){if(Ss(e)!==e)throw Error(se(188))}function L$(e){var t=e.alternate;if(!t){if(t=Ss(e),t===null)throw Error(se(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return Mw(a),e;if(s===r)return Mw(a),t;s=s.sibling}throw Error(se(188))}if(n.return!==r.return)n=a,r=s;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,r=s;break}if(l===r){o=!0,r=a,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=a;break}if(l===r){o=!0,r=s,n=a;break}l=l.sibling}if(!o)throw Error(se(189))}}if(n.alternate!==r)throw Error(se(190))}if(n.tag!==3)throw Error(se(188));return n.stateNode.current===n?e:t}function yA(e){return e=L$(e),e!==null?bA(e):null}function bA(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=bA(e);if(t!==null)return t;e=e.sibling}return null}var xA=ar.unstable_scheduleCallback,Iw=ar.unstable_cancelCallback,D$=ar.unstable_shouldYield,B$=ar.unstable_requestPaint,Tt=ar.unstable_now,z$=ar.unstable_getCurrentPriorityLevel,Hb=ar.unstable_ImmediatePriority,wA=ar.unstable_UserBlockingPriority,gf=ar.unstable_NormalPriority,F$=ar.unstable_LowPriority,SA=ar.unstable_IdlePriority,Yh=null,ra=null;function U$(e){if(ra&&typeof ra.onCommitFiberRoot=="function")try{ra.onCommitFiberRoot(Yh,e,void 0,(e.current.flags&128)===128)}catch{}}var Lr=Math.clz32?Math.clz32:G$,W$=Math.log,H$=Math.LN2;function G$(e){return e>>>=0,e===0?32:31-(W$(e)/H$|0)|0}var cd=64,ud=4194304;function sc(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 vf(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~a;l!==0?r=sc(l):(s&=o,s!==0&&(r=sc(s)))}else o=n&~a,o!==0?r=sc(o):s!==0&&(r=sc(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,s=t&-t,a>=s||a===16&&(s&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-Lr(t),a=1<<n,r|=e[n],t&=~a;return r}function q$(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 K$(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Lr(s),l=1<<o,c=a[o];c===-1?(!(l&n)||l&r)&&(a[o]=q$(l,t)):c<=t&&(e.expiredLanes|=l),s&=~l}}function hv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function kA(){var e=cd;return cd<<=1,!(cd&4194240)&&(cd=64),e}function Sm(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ru(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lr(t),e[t]=n}function V$(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 a=31-Lr(n),s=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~s}}function Gb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Lr(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var Je=0;function NA(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var EA,qb,jA,_A,AA,pv=!1,dd=[],ii=null,si=null,oi=null,Tc=new Map,Oc=new Map,Ya=[],Y$="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 $w(e,t){switch(e){case"focusin":case"focusout":ii=null;break;case"dragenter":case"dragleave":si=null;break;case"mouseover":case"mouseout":oi=null;break;case"pointerover":case"pointerout":Tc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oc.delete(t.pointerId)}}function Ll(e,t,n,r,a,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[a]},t!==null&&(t=Iu(t),t!==null&&qb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function X$(e,t,n,r,a){switch(t){case"focusin":return ii=Ll(ii,e,t,n,r,a),!0;case"dragenter":return si=Ll(si,e,t,n,r,a),!0;case"mouseover":return oi=Ll(oi,e,t,n,r,a),!0;case"pointerover":var s=a.pointerId;return Tc.set(s,Ll(Tc.get(s)||null,e,t,n,r,a)),!0;case"gotpointercapture":return s=a.pointerId,Oc.set(s,Ll(Oc.get(s)||null,e,t,n,r,a)),!0}return!1}function CA(e){var t=Vi(e.target);if(t!==null){var n=Ss(t);if(n!==null){if(t=n.tag,t===13){if(t=vA(n),t!==null){e.blockedOn=t,AA(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 Jd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=mv(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cv=r,n.target.dispatchEvent(r),cv=null}else return t=Iu(n),t!==null&&qb(t),e.blockedOn=n,!1;t.shift()}return!0}function Lw(e,t,n){Jd(e)&&n.delete(t)}function Z$(){pv=!1,ii!==null&&Jd(ii)&&(ii=null),si!==null&&Jd(si)&&(si=null),oi!==null&&Jd(oi)&&(oi=null),Tc.forEach(Lw),Oc.forEach(Lw)}function Dl(e,t){e.blockedOn===t&&(e.blockedOn=null,pv||(pv=!0,ar.unstable_scheduleCallback(ar.unstable_NormalPriority,Z$)))}function Pc(e){function t(a){return Dl(a,e)}if(0<dd.length){Dl(dd[0],e);for(var n=1;n<dd.length;n++){var r=dd[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ii!==null&&Dl(ii,e),si!==null&&Dl(si,e),oi!==null&&Dl(oi,e),Tc.forEach(t),Oc.forEach(t),n=0;n<Ya.length;n++)r=Ya[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ya.length&&(n=Ya[0],n.blockedOn===null);)CA(n),n.blockedOn===null&&Ya.shift()}var xo=$a.ReactCurrentBatchConfig,yf=!0;function Q$(e,t,n,r){var a=Je,s=xo.transition;xo.transition=null;try{Je=1,Kb(e,t,n,r)}finally{Je=a,xo.transition=s}}function J$(e,t,n,r){var a=Je,s=xo.transition;xo.transition=null;try{Je=4,Kb(e,t,n,r)}finally{Je=a,xo.transition=s}}function Kb(e,t,n,r){if(yf){var a=mv(e,t,n,r);if(a===null)Pm(e,t,r,bf,n),$w(e,r);else if(X$(a,e,t,n,r))r.stopPropagation();else if($w(e,r),t&4&&-1<Y$.indexOf(e)){for(;a!==null;){var s=Iu(a);if(s!==null&&EA(s),s=mv(e,t,n,r),s===null&&Pm(e,t,r,bf,n),s===a)break;a=s}a!==null&&r.stopPropagation()}else Pm(e,t,r,null,n)}}var bf=null;function mv(e,t,n,r){if(bf=null,e=Wb(r),e=Vi(e),e!==null)if(t=Ss(e),t===null)e=null;else if(n=t.tag,n===13){if(e=vA(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 bf=e,null}function TA(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(z$()){case Hb:return 1;case wA:return 4;case gf:case F$:return 16;case SA:return 536870912;default:return 16}default:return 16}}var ei=null,Vb=null,ef=null;function OA(){if(ef)return ef;var e,t=Vb,n=t.length,r,a="value"in ei?ei.value:ei.textContent,s=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===a[s-r];r++);return ef=a.slice(e,1<r?1-r:void 0)}function tf(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 fd(){return!0}function Dw(){return!1}function or(e){function t(n,r,a,s,o){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?fd:Dw,this.isPropagationStopped=Dw,this}return St(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=fd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=fd)},persist:function(){},isPersistent:fd}),t}var sl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yb=or(sl),Mu=St({},sl,{view:0,detail:0}),eL=or(Mu),km,Nm,Bl,Xh=St({},Mu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xb,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!==Bl&&(Bl&&e.type==="mousemove"?(km=e.screenX-Bl.screenX,Nm=e.screenY-Bl.screenY):Nm=km=0,Bl=e),km)},movementY:function(e){return"movementY"in e?e.movementY:Nm}}),Bw=or(Xh),tL=St({},Xh,{dataTransfer:0}),nL=or(tL),rL=St({},Mu,{relatedTarget:0}),Em=or(rL),aL=St({},sl,{animationName:0,elapsedTime:0,pseudoElement:0}),iL=or(aL),sL=St({},sl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),oL=or(sL),lL=St({},sl,{data:0}),zw=or(lL),cL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uL={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"},dL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fL(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=dL[e])?!!t[e]:!1}function Xb(){return fL}var hL=St({},Mu,{key:function(e){if(e.key){var t=cL[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=tf(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?uL[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xb,charCode:function(e){return e.type==="keypress"?tf(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?tf(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pL=or(hL),mL=St({},Xh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fw=or(mL),gL=St({},Mu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xb}),vL=or(gL),yL=St({},sl,{propertyName:0,elapsedTime:0,pseudoElement:0}),bL=or(yL),xL=St({},Xh,{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}),wL=or(xL),SL=[9,13,27,32],Zb=Ca&&"CompositionEvent"in window,fc=null;Ca&&"documentMode"in document&&(fc=document.documentMode);var kL=Ca&&"TextEvent"in window&&!fc,PA=Ca&&(!Zb||fc&&8<fc&&11>=fc),Uw=" ",Ww=!1;function RA(e,t){switch(e){case"keyup":return SL.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function MA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var to=!1;function NL(e,t){switch(e){case"compositionend":return MA(t);case"keypress":return t.which!==32?null:(Ww=!0,Uw);case"textInput":return e=t.data,e===Uw&&Ww?null:e;default:return null}}function EL(e,t){if(to)return e==="compositionend"||!Zb&&RA(e,t)?(e=OA(),ef=Vb=ei=null,to=!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 PA&&t.locale!=="ko"?null:t.data;default:return null}}var jL={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 Hw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!jL[e.type]:t==="textarea"}function IA(e,t,n,r){fA(r),t=xf(t,"onChange"),0<t.length&&(n=new Yb("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var hc=null,Rc=null;function _L(e){qA(e,0)}function Zh(e){var t=ao(e);if(iA(t))return e}function AL(e,t){if(e==="change")return t}var $A=!1;if(Ca){var jm;if(Ca){var _m="oninput"in document;if(!_m){var Gw=document.createElement("div");Gw.setAttribute("oninput","return;"),_m=typeof Gw.oninput=="function"}jm=_m}else jm=!1;$A=jm&&(!document.documentMode||9<document.documentMode)}function qw(){hc&&(hc.detachEvent("onpropertychange",LA),Rc=hc=null)}function LA(e){if(e.propertyName==="value"&&Zh(Rc)){var t=[];IA(t,Rc,e,Wb(e)),gA(_L,t)}}function CL(e,t,n){e==="focusin"?(qw(),hc=t,Rc=n,hc.attachEvent("onpropertychange",LA)):e==="focusout"&&qw()}function TL(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zh(Rc)}function OL(e,t){if(e==="click")return Zh(t)}function PL(e,t){if(e==="input"||e==="change")return Zh(t)}function RL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ur=typeof Object.is=="function"?Object.is:RL;function Mc(e,t){if(Ur(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 a=n[r];if(!Zg.call(t,a)||!Ur(e[a],t[a]))return!1}return!0}function Kw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vw(e,t){var n=Kw(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=Kw(n)}}function DA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?DA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function BA(){for(var e=window,t=hf();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=hf(e.document)}return t}function Qb(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 ML(e){var t=BA(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&DA(n.ownerDocument.documentElement,n)){if(r!==null&&Qb(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 a=n.textContent.length,s=Math.min(r.start,a);r=r.end===void 0?s:Math.min(r.end,a),!e.extend&&s>r&&(a=r,r=s,s=a),a=Vw(n,s);var o=Vw(n,r);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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 IL=Ca&&"documentMode"in document&&11>=document.documentMode,no=null,gv=null,pc=null,vv=!1;function Yw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vv||no==null||no!==hf(r)||(r=no,"selectionStart"in r&&Qb(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}),pc&&Mc(pc,r)||(pc=r,r=xf(gv,"onSelect"),0<r.length&&(t=new Yb("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=no)))}function hd(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ro={animationend:hd("Animation","AnimationEnd"),animationiteration:hd("Animation","AnimationIteration"),animationstart:hd("Animation","AnimationStart"),transitionend:hd("Transition","TransitionEnd")},Am={},zA={};Ca&&(zA=document.createElement("div").style,"AnimationEvent"in window||(delete ro.animationend.animation,delete ro.animationiteration.animation,delete ro.animationstart.animation),"TransitionEvent"in window||delete ro.transitionend.transition);function Qh(e){if(Am[e])return Am[e];if(!ro[e])return e;var t=ro[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zA)return Am[e]=t[n];return e}var FA=Qh("animationend"),UA=Qh("animationiteration"),WA=Qh("animationstart"),HA=Qh("transitionend"),GA=new Map,Xw="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 bi(e,t){GA.set(e,t),ws(t,[e])}for(var Cm=0;Cm<Xw.length;Cm++){var Tm=Xw[Cm],$L=Tm.toLowerCase(),LL=Tm[0].toUpperCase()+Tm.slice(1);bi($L,"on"+LL)}bi(FA,"onAnimationEnd");bi(UA,"onAnimationIteration");bi(WA,"onAnimationStart");bi("dblclick","onDoubleClick");bi("focusin","onFocus");bi("focusout","onBlur");bi(HA,"onTransitionEnd");Ao("onMouseEnter",["mouseout","mouseover"]);Ao("onMouseLeave",["mouseout","mouseover"]);Ao("onPointerEnter",["pointerout","pointerover"]);Ao("onPointerLeave",["pointerout","pointerover"]);ws("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ws("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ws("onBeforeInput",["compositionend","keypress","textInput","paste"]);ws("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ws("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ws("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var oc="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(" "),DL=new Set("cancel close invalid load scroll toggle".split(" ").concat(oc));function Zw(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,$$(r,t,void 0,e),e.currentTarget=null}function qA(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==s&&a.isPropagationStopped())break e;Zw(a,l,u),s=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==s&&a.isPropagationStopped())break e;Zw(a,l,u),s=c}}}if(mf)throw e=fv,mf=!1,fv=null,e}function ft(e,t){var n=t[Sv];n===void 0&&(n=t[Sv]=new Set);var r=e+"__bubble";n.has(r)||(KA(t,e,2,!1),n.add(r))}function Om(e,t,n){var r=0;t&&(r|=4),KA(n,e,r,t)}var pd="_reactListening"+Math.random().toString(36).slice(2);function Ic(e){if(!e[pd]){e[pd]=!0,eA.forEach(function(n){n!=="selectionchange"&&(DL.has(n)||Om(n,!1,e),Om(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pd]||(t[pd]=!0,Om("selectionchange",!1,t))}}function KA(e,t,n,r){switch(TA(t)){case 1:var a=Q$;break;case 4:a=J$;break;default:a=Kb}n=a.bind(null,t,n,e),a=void 0,!dv||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Pm(e,t,n,r,a){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=Vi(l),o===null)return;if(c=o.tag,c===5||c===6){r=s=o;continue e}l=l.parentNode}}r=r.return}gA(function(){var u=s,d=Wb(n),f=[];e:{var h=GA.get(e);if(h!==void 0){var p=Yb,g=e;switch(e){case"keypress":if(tf(n)===0)break e;case"keydown":case"keyup":p=pL;break;case"focusin":g="focus",p=Em;break;case"focusout":g="blur",p=Em;break;case"beforeblur":case"afterblur":p=Em;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=Bw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=nL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=vL;break;case FA:case UA:case WA:p=iL;break;case HA:p=bL;break;case"scroll":p=eL;break;case"wheel":p=wL;break;case"copy":case"cut":case"paste":p=oL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Fw}var m=(t&4)!==0,y=!m&&e==="scroll",v=m?h!==null?h+"Capture":null:h;m=[];for(var b=u,w;b!==null;){w=b;var N=w.stateNode;if(w.tag===5&&N!==null&&(w=N,v!==null&&(N=Cc(b,v),N!=null&&m.push($c(b,N,w)))),y)break;b=b.return}0<m.length&&(h=new p(h,g,null,n,d),f.push({event:h,listeners:m}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==cv&&(g=n.relatedTarget||n.fromElement)&&(Vi(g)||g[Ta]))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?Vi(g):null,g!==null&&(y=Ss(g),g!==y||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(m=Bw,N="onMouseLeave",v="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(m=Fw,N="onPointerLeave",v="onPointerEnter",b="pointer"),y=p==null?h:ao(p),w=g==null?h:ao(g),h=new m(N,b+"leave",p,n,d),h.target=y,h.relatedTarget=w,N=null,Vi(d)===u&&(m=new m(v,b+"enter",g,n,d),m.target=w,m.relatedTarget=y,N=m),y=N,p&&g)t:{for(m=p,v=g,b=0,w=m;w;w=Fs(w))b++;for(w=0,N=v;N;N=Fs(N))w++;for(;0<b-w;)m=Fs(m),b--;for(;0<w-b;)v=Fs(v),w--;for(;b--;){if(m===v||v!==null&&m===v.alternate)break t;m=Fs(m),v=Fs(v)}m=null}else m=null;p!==null&&Qw(f,h,p,m,!1),g!==null&&y!==null&&Qw(f,y,g,m,!0)}}e:{if(h=u?ao(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=AL;else if(Hw(h))if($A)S=PL;else{S=TL;var x=CL}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=OL);if(S&&(S=S(e,u))){IA(f,S,n,d);break e}x&&x(e,h,u),e==="focusout"&&(x=h._wrapperState)&&x.controlled&&h.type==="number"&&av(h,"number",h.value)}switch(x=u?ao(u):window,e){case"focusin":(Hw(x)||x.contentEditable==="true")&&(no=x,gv=u,pc=null);break;case"focusout":pc=gv=no=null;break;case"mousedown":vv=!0;break;case"contextmenu":case"mouseup":case"dragend":vv=!1,Yw(f,n,d);break;case"selectionchange":if(IL)break;case"keydown":case"keyup":Yw(f,n,d)}var E;if(Zb)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else to?RA(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(PA&&n.locale!=="ko"&&(to||j!=="onCompositionStart"?j==="onCompositionEnd"&&to&&(E=OA()):(ei=d,Vb="value"in ei?ei.value:ei.textContent,to=!0)),x=xf(u,j),0<x.length&&(j=new zw(j,e,null,n,d),f.push({event:j,listeners:x}),E?j.data=E:(E=MA(n),E!==null&&(j.data=E)))),(E=kL?NL(e,n):EL(e,n))&&(u=xf(u,"onBeforeInput"),0<u.length&&(d=new zw("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=E))}qA(f,t)})}function $c(e,t,n){return{instance:e,listener:t,currentTarget:n}}function xf(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,s=a.stateNode;a.tag===5&&s!==null&&(a=s,s=Cc(e,n),s!=null&&r.unshift($c(e,s,a)),s=Cc(e,t),s!=null&&r.push($c(e,s,a))),e=e.return}return r}function Fs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Qw(e,t,n,r,a){for(var s=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,a?(c=Cc(n,s),c!=null&&o.unshift($c(n,c,l))):a||(c=Cc(n,s),c!=null&&o.push($c(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var BL=/\r\n?/g,zL=/\u0000|\uFFFD/g;function Jw(e){return(typeof e=="string"?e:""+e).replace(BL,`
38
- `).replace(zL,"")}function md(e,t,n){if(t=Jw(t),Jw(e)!==t&&n)throw Error(se(425))}function wf(){}var yv=null,bv=null;function xv(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 wv=typeof setTimeout=="function"?setTimeout:void 0,FL=typeof clearTimeout=="function"?clearTimeout:void 0,eS=typeof Promise=="function"?Promise:void 0,UL=typeof queueMicrotask=="function"?queueMicrotask:typeof eS<"u"?function(e){return eS.resolve(null).then(e).catch(WL)}:wv;function WL(e){setTimeout(function(){throw e})}function Rm(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),Pc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);Pc(t)}function li(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 tS(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 ol=Math.random().toString(36).slice(2),Jr="__reactFiber$"+ol,Lc="__reactProps$"+ol,Ta="__reactContainer$"+ol,Sv="__reactEvents$"+ol,HL="__reactListeners$"+ol,GL="__reactHandles$"+ol;function Vi(e){var t=e[Jr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ta]||n[Jr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=tS(e);e!==null;){if(n=e[Jr])return n;e=tS(e)}return t}e=n,n=e.parentNode}return null}function Iu(e){return e=e[Jr]||e[Ta],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ao(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(se(33))}function Jh(e){return e[Lc]||null}var kv=[],io=-1;function xi(e){return{current:e}}function gt(e){0>io||(e.current=kv[io],kv[io]=null,io--)}function dt(e,t){io++,kv[io]=e.current,e.current=t}var vi={},wn=xi(vi),Bn=xi(!1),us=vi;function Co(e,t){var n=e.type.contextTypes;if(!n)return vi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},s;for(s in n)a[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function zn(e){return e=e.childContextTypes,e!=null}function Sf(){gt(Bn),gt(wn)}function nS(e,t,n){if(wn.current!==vi)throw Error(se(168));dt(wn,t),dt(Bn,n)}function VA(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(se(108,C$(e)||"Unknown",a));return St({},n,r)}function kf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vi,us=wn.current,dt(wn,e),dt(Bn,Bn.current),!0}function rS(e,t,n){var r=e.stateNode;if(!r)throw Error(se(169));n?(e=VA(e,t,us),r.__reactInternalMemoizedMergedChildContext=e,gt(Bn),gt(wn),dt(wn,e)):gt(Bn),dt(Bn,n)}var ba=null,ep=!1,Mm=!1;function YA(e){ba===null?ba=[e]:ba.push(e)}function qL(e){ep=!0,YA(e)}function wi(){if(!Mm&&ba!==null){Mm=!0;var e=0,t=Je;try{var n=ba;for(Je=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ba=null,ep=!1}catch(a){throw ba!==null&&(ba=ba.slice(e+1)),xA(Hb,wi),a}finally{Je=t,Mm=!1}}return null}var so=[],oo=0,Nf=null,Ef=0,pr=[],mr=0,ds=null,xa=1,wa="";function Bi(e,t){so[oo++]=Ef,so[oo++]=Nf,Nf=e,Ef=t}function XA(e,t,n){pr[mr++]=xa,pr[mr++]=wa,pr[mr++]=ds,ds=e;var r=xa;e=wa;var a=32-Lr(r)-1;r&=~(1<<a),n+=1;var s=32-Lr(t)+a;if(30<s){var o=a-a%5;s=(r&(1<<o)-1).toString(32),r>>=o,a-=o,xa=1<<32-Lr(t)+a|n<<a|r,wa=s+e}else xa=1<<s|n<<a|r,wa=e}function Jb(e){e.return!==null&&(Bi(e,1),XA(e,1,0))}function ex(e){for(;e===Nf;)Nf=so[--oo],so[oo]=null,Ef=so[--oo],so[oo]=null;for(;e===ds;)ds=pr[--mr],pr[mr]=null,wa=pr[--mr],pr[mr]=null,xa=pr[--mr],pr[mr]=null}var nr=null,tr=null,vt=!1,Mr=null;function ZA(e,t){var n=vr(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 aS(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,nr=e,tr=li(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,nr=e,tr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ds!==null?{id:xa,overflow:wa}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=vr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,nr=e,tr=null,!0):!1;default:return!1}}function Nv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ev(e){if(vt){var t=tr;if(t){var n=t;if(!aS(e,t)){if(Nv(e))throw Error(se(418));t=li(n.nextSibling);var r=nr;t&&aS(e,t)?ZA(r,n):(e.flags=e.flags&-4097|2,vt=!1,nr=e)}}else{if(Nv(e))throw Error(se(418));e.flags=e.flags&-4097|2,vt=!1,nr=e}}}function iS(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;nr=e}function gd(e){if(e!==nr)return!1;if(!vt)return iS(e),vt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!xv(e.type,e.memoizedProps)),t&&(t=tr)){if(Nv(e))throw QA(),Error(se(418));for(;t;)ZA(e,t),t=li(t.nextSibling)}if(iS(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(se(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){tr=li(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}tr=null}}else tr=nr?li(e.stateNode.nextSibling):null;return!0}function QA(){for(var e=tr;e;)e=li(e.nextSibling)}function To(){tr=nr=null,vt=!1}function tx(e){Mr===null?Mr=[e]:Mr.push(e)}var KL=$a.ReactCurrentBatchConfig;function zl(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(se(309));var r=n.stateNode}if(!r)throw Error(se(147,e));var a=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var l=a.refs;o===null?delete l[s]:l[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(se(284));if(!n._owner)throw Error(se(290,e))}return e}function vd(e,t){throw e=Object.prototype.toString.call(t),Error(se(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function sS(e){var t=e._init;return t(e._payload)}function JA(e){function t(v,b){if(e){var w=v.deletions;w===null?(v.deletions=[b],v.flags|=16):w.push(b)}}function n(v,b){if(!e)return null;for(;b!==null;)t(v,b),b=b.sibling;return null}function r(v,b){for(v=new Map;b!==null;)b.key!==null?v.set(b.key,b):v.set(b.index,b),b=b.sibling;return v}function a(v,b){return v=fi(v,b),v.index=0,v.sibling=null,v}function s(v,b,w){return v.index=w,e?(w=v.alternate,w!==null?(w=w.index,w<b?(v.flags|=2,b):w):(v.flags|=2,b)):(v.flags|=1048576,b)}function o(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,b,w,N){return b===null||b.tag!==6?(b=Fm(w,v.mode,N),b.return=v,b):(b=a(b,w),b.return=v,b)}function c(v,b,w,N){var S=w.type;return S===eo?d(v,b,w.props.children,N,w.key):b!==null&&(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===qa&&sS(S)===b.type)?(N=a(b,w.props),N.ref=zl(v,b,w),N.return=v,N):(N=cf(w.type,w.key,w.props,null,v.mode,N),N.ref=zl(v,b,w),N.return=v,N)}function u(v,b,w,N){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=Um(w,v.mode,N),b.return=v,b):(b=a(b,w.children||[]),b.return=v,b)}function d(v,b,w,N,S){return b===null||b.tag!==7?(b=rs(w,v.mode,N,S),b.return=v,b):(b=a(b,w),b.return=v,b)}function f(v,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=Fm(""+b,v.mode,w),b.return=v,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case sd:return w=cf(b.type,b.key,b.props,null,v.mode,w),w.ref=zl(v,null,b),w.return=v,w;case Js:return b=Um(b,v.mode,w),b.return=v,b;case qa:var N=b._init;return f(v,N(b._payload),w)}if(ic(b)||Il(b))return b=rs(b,v.mode,w,null),b.return=v,b;vd(v,b)}return null}function h(v,b,w,N){var S=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:l(v,b,""+w,N);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case sd:return w.key===S?c(v,b,w,N):null;case Js:return w.key===S?u(v,b,w,N):null;case qa:return S=w._init,h(v,b,S(w._payload),N)}if(ic(w)||Il(w))return S!==null?null:d(v,b,w,N,null);vd(v,w)}return null}function p(v,b,w,N,S){if(typeof N=="string"&&N!==""||typeof N=="number")return v=v.get(w)||null,l(b,v,""+N,S);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case sd:return v=v.get(N.key===null?w:N.key)||null,c(b,v,N,S);case Js:return v=v.get(N.key===null?w:N.key)||null,u(b,v,N,S);case qa:var x=N._init;return p(v,b,w,x(N._payload),S)}if(ic(N)||Il(N))return v=v.get(w)||null,d(b,v,N,S,null);vd(b,N)}return null}function g(v,b,w,N){for(var S=null,x=null,E=b,j=b=0,C=null;E!==null&&j<w.length;j++){E.index>j?(C=E,E=null):C=E.sibling;var T=h(v,E,w[j],N);if(T===null){E===null&&(E=C);break}e&&E&&T.alternate===null&&t(v,E),b=s(T,b,j),x===null?S=T:x.sibling=T,x=T,E=C}if(j===w.length)return n(v,E),vt&&Bi(v,j),S;if(E===null){for(;j<w.length;j++)E=f(v,w[j],N),E!==null&&(b=s(E,b,j),x===null?S=E:x.sibling=E,x=E);return vt&&Bi(v,j),S}for(E=r(v,E);j<w.length;j++)C=p(E,v,j,w[j],N),C!==null&&(e&&C.alternate!==null&&E.delete(C.key===null?j:C.key),b=s(C,b,j),x===null?S=C:x.sibling=C,x=C);return e&&E.forEach(function($){return t(v,$)}),vt&&Bi(v,j),S}function m(v,b,w,N){var S=Il(w);if(typeof S!="function")throw Error(se(150));if(w=S.call(w),w==null)throw Error(se(151));for(var x=S=null,E=b,j=b=0,C=null,T=w.next();E!==null&&!T.done;j++,T=w.next()){E.index>j?(C=E,E=null):C=E.sibling;var $=h(v,E,T.value,N);if($===null){E===null&&(E=C);break}e&&E&&$.alternate===null&&t(v,E),b=s($,b,j),x===null?S=$:x.sibling=$,x=$,E=C}if(T.done)return n(v,E),vt&&Bi(v,j),S;if(E===null){for(;!T.done;j++,T=w.next())T=f(v,T.value,N),T!==null&&(b=s(T,b,j),x===null?S=T:x.sibling=T,x=T);return vt&&Bi(v,j),S}for(E=r(v,E);!T.done;j++,T=w.next())T=p(E,v,j,T.value,N),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?j:T.key),b=s(T,b,j),x===null?S=T:x.sibling=T,x=T);return e&&E.forEach(function(R){return t(v,R)}),vt&&Bi(v,j),S}function y(v,b,w,N){if(typeof w=="object"&&w!==null&&w.type===eo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case sd:e:{for(var S=w.key,x=b;x!==null;){if(x.key===S){if(S=w.type,S===eo){if(x.tag===7){n(v,x.sibling),b=a(x,w.props.children),b.return=v,v=b;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===qa&&sS(S)===x.type){n(v,x.sibling),b=a(x,w.props),b.ref=zl(v,x,w),b.return=v,v=b;break e}n(v,x);break}else t(v,x);x=x.sibling}w.type===eo?(b=rs(w.props.children,v.mode,N,w.key),b.return=v,v=b):(N=cf(w.type,w.key,w.props,null,v.mode,N),N.ref=zl(v,b,w),N.return=v,v=N)}return o(v);case Js:e:{for(x=w.key;b!==null;){if(b.key===x)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(v,b.sibling),b=a(b,w.children||[]),b.return=v,v=b;break e}else{n(v,b);break}else t(v,b);b=b.sibling}b=Um(w,v.mode,N),b.return=v,v=b}return o(v);case qa:return x=w._init,y(v,b,x(w._payload),N)}if(ic(w))return g(v,b,w,N);if(Il(w))return m(v,b,w,N);vd(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(v,b.sibling),b=a(b,w),b.return=v,v=b):(n(v,b),b=Fm(w,v.mode,N),b.return=v,v=b),o(v)):n(v,b)}return y}var Oo=JA(!0),eC=JA(!1),jf=xi(null),_f=null,lo=null,nx=null;function rx(){nx=lo=_f=null}function ax(e){var t=jf.current;gt(jf),e._currentValue=t}function jv(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 wo(e,t){_f=e,nx=lo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ln=!0),e.firstContext=null)}function wr(e){var t=e._currentValue;if(nx!==e)if(e={context:e,memoizedValue:t,next:null},lo===null){if(_f===null)throw Error(se(308));lo=e,_f.dependencies={lanes:0,firstContext:e}}else lo=lo.next=e;return t}var Yi=null;function ix(e){Yi===null?Yi=[e]:Yi.push(e)}function tC(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,ix(t)):(n.next=a.next,a.next=n),t.interleaved=n,Oa(e,r)}function Oa(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 Ka=!1;function sx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nC(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 Ea(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ci(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,He&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Oa(e,n)}return a=r.interleaved,a===null?(t.next=t,ix(r)):(t.next=a.next,a.next=t),r.interleaved=t,Oa(e,n)}function nf(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,Gb(e,n)}}function oS(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?a=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?a=s=t:s=s.next=t}else a=s=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:s,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 Af(e,t,n,r){var a=e.updateQueue;Ka=!1;var s=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=a.baseState;o=0,d=u=c=null,l=s;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,m=l;switch(h=t,p=n,m.tag){case 1:if(g=m.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=m.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=St({},f,h);break e;case 2:Ka=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,o|=h;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;h=l,l=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);if(d===null&&(c=f),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else s===null&&(a.shared.lanes=0);hs|=o,e.lanes=o,e.memoizedState=f}}function lS(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(se(191,a));a.call(r)}}}var $u={},aa=xi($u),Dc=xi($u),Bc=xi($u);function Xi(e){if(e===$u)throw Error(se(174));return e}function ox(e,t){switch(dt(Bc,t),dt(Dc,e),dt(aa,$u),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:sv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=sv(t,e)}gt(aa),dt(aa,t)}function Po(){gt(aa),gt(Dc),gt(Bc)}function rC(e){Xi(Bc.current);var t=Xi(aa.current),n=sv(t,e.type);t!==n&&(dt(Dc,e),dt(aa,n))}function lx(e){Dc.current===e&&(gt(aa),gt(Dc))}var bt=xi(0);function Cf(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 Im=[];function cx(){for(var e=0;e<Im.length;e++)Im[e]._workInProgressVersionPrimary=null;Im.length=0}var rf=$a.ReactCurrentDispatcher,$m=$a.ReactCurrentBatchConfig,fs=0,xt=null,Ht=null,Xt=null,Tf=!1,mc=!1,zc=0,VL=0;function fn(){throw Error(se(321))}function ux(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ur(e[n],t[n]))return!1;return!0}function dx(e,t,n,r,a,s){if(fs=s,xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rf.current=e===null||e.memoizedState===null?QL:JL,e=n(r,a),mc){s=0;do{if(mc=!1,zc=0,25<=s)throw Error(se(301));s+=1,Xt=Ht=null,t.updateQueue=null,rf.current=eD,e=n(r,a)}while(mc)}if(rf.current=Of,t=Ht!==null&&Ht.next!==null,fs=0,Xt=Ht=xt=null,Tf=!1,t)throw Error(se(300));return e}function fx(){var e=zc!==0;return zc=0,e}function Zr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?xt.memoizedState=Xt=e:Xt=Xt.next=e,Xt}function Sr(){if(Ht===null){var e=xt.alternate;e=e!==null?e.memoizedState:null}else e=Ht.next;var t=Xt===null?xt.memoizedState:Xt.next;if(t!==null)Xt=t,Ht=e;else{if(e===null)throw Error(se(310));Ht=e,e={memoizedState:Ht.memoizedState,baseState:Ht.baseState,baseQueue:Ht.baseQueue,queue:Ht.queue,next:null},Xt===null?xt.memoizedState=Xt=e:Xt=Xt.next=e}return Xt}function Fc(e,t){return typeof t=="function"?t(e):t}function Lm(e){var t=Sr(),n=t.queue;if(n===null)throw Error(se(311));n.lastRenderedReducer=e;var r=Ht,a=r.baseQueue,s=n.pending;if(s!==null){if(a!==null){var o=a.next;a.next=s.next,s.next=o}r.baseQueue=a=s,n.pending=null}if(a!==null){s=a.next,r=r.baseState;var l=o=null,c=null,u=s;do{var d=u.lane;if((fs&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?(l=c=f,o=r):c=c.next=f,xt.lanes|=d,hs|=d}u=u.next}while(u!==null&&u!==s);c===null?o=r:c.next=l,Ur(r,t.memoizedState)||(Ln=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do s=a.lane,xt.lanes|=s,hs|=s,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Dm(e){var t=Sr(),n=t.queue;if(n===null)throw Error(se(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,s=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do s=e(s,o.action),o=o.next;while(o!==a);Ur(s,t.memoizedState)||(Ln=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function aC(){}function iC(e,t){var n=xt,r=Sr(),a=t(),s=!Ur(r.memoizedState,a);if(s&&(r.memoizedState=a,Ln=!0),r=r.queue,hx(lC.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Xt!==null&&Xt.memoizedState.tag&1){if(n.flags|=2048,Uc(9,oC.bind(null,n,r,a,t),void 0,null),Qt===null)throw Error(se(349));fs&30||sC(n,t,a)}return a}function sC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function oC(e,t,n,r){t.value=n,t.getSnapshot=r,cC(t)&&uC(e)}function lC(e,t,n){return n(function(){cC(t)&&uC(e)})}function cC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ur(e,n)}catch{return!0}}function uC(e){var t=Oa(e,1);t!==null&&Dr(t,e,1,-1)}function cS(e){var t=Zr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fc,lastRenderedState:e},t.queue=e,e=e.dispatch=ZL.bind(null,xt,e),[t.memoizedState,e]}function Uc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.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 dC(){return Sr().memoizedState}function af(e,t,n,r){var a=Zr();xt.flags|=e,a.memoizedState=Uc(1|t,n,void 0,r===void 0?null:r)}function tp(e,t,n,r){var a=Sr();r=r===void 0?null:r;var s=void 0;if(Ht!==null){var o=Ht.memoizedState;if(s=o.destroy,r!==null&&ux(r,o.deps)){a.memoizedState=Uc(t,n,s,r);return}}xt.flags|=e,a.memoizedState=Uc(1|t,n,s,r)}function uS(e,t){return af(8390656,8,e,t)}function hx(e,t){return tp(2048,8,e,t)}function fC(e,t){return tp(4,2,e,t)}function hC(e,t){return tp(4,4,e,t)}function pC(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 mC(e,t,n){return n=n!=null?n.concat([e]):null,tp(4,4,pC.bind(null,t,e),n)}function px(){}function gC(e,t){var n=Sr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ux(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vC(e,t){var n=Sr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ux(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function yC(e,t,n){return fs&21?(Ur(n,t)||(n=kA(),xt.lanes|=n,hs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ln=!0),e.memoizedState=n)}function YL(e,t){var n=Je;Je=n!==0&&4>n?n:4,e(!0);var r=$m.transition;$m.transition={};try{e(!1),t()}finally{Je=n,$m.transition=r}}function bC(){return Sr().memoizedState}function XL(e,t,n){var r=di(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xC(e))wC(t,n);else if(n=tC(e,t,n,r),n!==null){var a=Tn();Dr(n,e,r,a),SC(n,t,r)}}function ZL(e,t,n){var r=di(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xC(e))wC(t,a);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(a.hasEagerState=!0,a.eagerState=l,Ur(l,o)){var c=t.interleaved;c===null?(a.next=a,ix(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=tC(e,t,a,r),n!==null&&(a=Tn(),Dr(n,e,r,a),SC(n,t,r))}}function xC(e){var t=e.alternate;return e===xt||t!==null&&t===xt}function wC(e,t){mc=Tf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function SC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Gb(e,n)}}var Of={readContext:wr,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useInsertionEffect:fn,useLayoutEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useMutableSource:fn,useSyncExternalStore:fn,useId:fn,unstable_isNewReconciler:!1},QL={readContext:wr,useCallback:function(e,t){return Zr().memoizedState=[e,t===void 0?null:t],e},useContext:wr,useEffect:uS,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,af(4194308,4,pC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return af(4194308,4,e,t)},useInsertionEffect:function(e,t){return af(4,2,e,t)},useMemo:function(e,t){var n=Zr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Zr();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=XL.bind(null,xt,e),[r.memoizedState,e]},useRef:function(e){var t=Zr();return e={current:e},t.memoizedState=e},useState:cS,useDebugValue:px,useDeferredValue:function(e){return Zr().memoizedState=e},useTransition:function(){var e=cS(!1),t=e[0];return e=YL.bind(null,e[1]),Zr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=xt,a=Zr();if(vt){if(n===void 0)throw Error(se(407));n=n()}else{if(n=t(),Qt===null)throw Error(se(349));fs&30||sC(r,t,n)}a.memoizedState=n;var s={value:n,getSnapshot:t};return a.queue=s,uS(lC.bind(null,r,s,e),[e]),r.flags|=2048,Uc(9,oC.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Zr(),t=Qt.identifierPrefix;if(vt){var n=wa,r=xa;n=(r&~(1<<32-Lr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=zc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=VL++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},JL={readContext:wr,useCallback:gC,useContext:wr,useEffect:hx,useImperativeHandle:mC,useInsertionEffect:fC,useLayoutEffect:hC,useMemo:vC,useReducer:Lm,useRef:dC,useState:function(){return Lm(Fc)},useDebugValue:px,useDeferredValue:function(e){var t=Sr();return yC(t,Ht.memoizedState,e)},useTransition:function(){var e=Lm(Fc)[0],t=Sr().memoizedState;return[e,t]},useMutableSource:aC,useSyncExternalStore:iC,useId:bC,unstable_isNewReconciler:!1},eD={readContext:wr,useCallback:gC,useContext:wr,useEffect:hx,useImperativeHandle:mC,useInsertionEffect:fC,useLayoutEffect:hC,useMemo:vC,useReducer:Dm,useRef:dC,useState:function(){return Dm(Fc)},useDebugValue:px,useDeferredValue:function(e){var t=Sr();return Ht===null?t.memoizedState=e:yC(t,Ht.memoizedState,e)},useTransition:function(){var e=Dm(Fc)[0],t=Sr().memoizedState;return[e,t]},useMutableSource:aC,useSyncExternalStore:iC,useId:bC,unstable_isNewReconciler:!1};function Tr(e,t){if(e&&e.defaultProps){t=St({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function _v(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:St({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var np={isMounted:function(e){return(e=e._reactInternals)?Ss(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Tn(),a=di(e),s=Ea(r,a);s.payload=t,n!=null&&(s.callback=n),t=ci(e,s,a),t!==null&&(Dr(t,e,a,r),nf(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Tn(),a=di(e),s=Ea(r,a);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=ci(e,s,a),t!==null&&(Dr(t,e,a,r),nf(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tn(),r=di(e),a=Ea(n,r);a.tag=2,t!=null&&(a.callback=t),t=ci(e,a,r),t!==null&&(Dr(t,e,r,n),nf(t,e,r))}};function dS(e,t,n,r,a,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Mc(n,r)||!Mc(a,s):!0}function kC(e,t,n){var r=!1,a=vi,s=t.contextType;return typeof s=="object"&&s!==null?s=wr(s):(a=zn(t)?us:wn.current,r=t.contextTypes,s=(r=r!=null)?Co(e,a):vi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=np,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=s),t}function fS(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&&np.enqueueReplaceState(t,t.state,null)}function Av(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},sx(e);var s=t.contextType;typeof s=="object"&&s!==null?a.context=wr(s):(s=zn(t)?us:wn.current,a.context=Co(e,s)),a.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(_v(e,t,s,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&np.enqueueReplaceState(a,a.state,null),Af(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Ro(e,t){try{var n="",r=t;do n+=A$(r),r=r.return;while(r);var a=n}catch(s){a=`
39
- Error generating stack: `+s.message+`
40
- `+s.stack}return{value:e,source:t,stack:a,digest:null}}function Bm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Cv(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var tD=typeof WeakMap=="function"?WeakMap:Map;function NC(e,t,n){n=Ea(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Rf||(Rf=!0,Bv=r),Cv(e,t)},n}function EC(e,t,n){n=Ea(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){Cv(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Cv(e,t),typeof r!="function"&&(ui===null?ui=new Set([this]):ui.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function hS(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new tD;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=mD.bind(null,e,t,n),t.then(e,e))}function pS(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 mS(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,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=Ea(-1,1),t.tag=2,ci(n,t,1))),n.lanes|=1),e)}var nD=$a.ReactCurrentOwner,Ln=!1;function _n(e,t,n,r){t.child=e===null?eC(t,null,n,r):Oo(t,e.child,n,r)}function gS(e,t,n,r,a){n=n.render;var s=t.ref;return wo(t,a),r=dx(e,t,n,r,s,a),n=fx(),e!==null&&!Ln?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Pa(e,t,a)):(vt&&n&&Jb(t),t.flags|=1,_n(e,t,r,a),t.child)}function vS(e,t,n,r,a){if(e===null){var s=n.type;return typeof s=="function"&&!Sx(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,jC(e,t,s,r,a)):(e=cf(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&a)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Mc,n(o,r)&&e.ref===t.ref)return Pa(e,t,a)}return t.flags|=1,e=fi(s,r),e.ref=t.ref,e.return=t,t.child=e}function jC(e,t,n,r,a){if(e!==null){var s=e.memoizedProps;if(Mc(s,r)&&e.ref===t.ref)if(Ln=!1,t.pendingProps=r=s,(e.lanes&a)!==0)e.flags&131072&&(Ln=!0);else return t.lanes=e.lanes,Pa(e,t,a)}return Tv(e,t,n,r,a)}function _C(e,t,n){var r=t.pendingProps,a=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},dt(uo,Qn),Qn|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,dt(uo,Qn),Qn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,dt(uo,Qn),Qn|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,dt(uo,Qn),Qn|=r;return _n(e,t,a,n),t.child}function AC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Tv(e,t,n,r,a){var s=zn(n)?us:wn.current;return s=Co(t,s),wo(t,a),n=dx(e,t,n,r,s,a),r=fx(),e!==null&&!Ln?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Pa(e,t,a)):(vt&&r&&Jb(t),t.flags|=1,_n(e,t,n,a),t.child)}function yS(e,t,n,r,a){if(zn(n)){var s=!0;kf(t)}else s=!1;if(wo(t,a),t.stateNode===null)sf(e,t),kC(t,n,r),Av(t,n,r,a),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=wr(u):(u=zn(n)?us:wn.current,u=Co(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==u)&&fS(t,o,r,u),Ka=!1;var h=t.memoizedState;o.state=h,Af(t,r,o,a),c=t.memoizedState,l!==r||h!==c||Bn.current||Ka?(typeof d=="function"&&(_v(t,n,d,r),c=t.memoizedState),(l=Ka||dS(t,n,l,r,h,c,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,nC(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Tr(t.type,l),o.props=u,f=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=wr(c):(c=zn(n)?us:wn.current,c=Co(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||h!==c)&&fS(t,o,r,c),Ka=!1,h=t.memoizedState,o.state=h,Af(t,r,o,a);var g=t.memoizedState;l!==f||h!==g||Bn.current||Ka?(typeof p=="function"&&(_v(t,n,p,r),g=t.memoizedState),(u=Ka||dS(t,n,u,r,h,g,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),o.props=r,o.state=g,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Ov(e,t,n,r,s,a)}function Ov(e,t,n,r,a,s){AC(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return a&&rS(t,n,!1),Pa(e,t,s);r=t.stateNode,nD.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Oo(t,e.child,null,s),t.child=Oo(t,null,l,s)):_n(e,t,l,s),t.memoizedState=r.state,a&&rS(t,n,!0),t.child}function CC(e){var t=e.stateNode;t.pendingContext?nS(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nS(e,t.context,!1),ox(e,t.containerInfo)}function bS(e,t,n,r,a){return To(),tx(a),t.flags|=256,_n(e,t,n,r),t.child}var Pv={dehydrated:null,treeContext:null,retryLane:0};function Rv(e){return{baseLanes:e,cachePool:null,transitions:null}}function TC(e,t,n){var r=t.pendingProps,a=bt.current,s=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),dt(bt,a&1),e===null)return Ev(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):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=ip(o,r,0,null),e=rs(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Rv(n),t.memoizedState=Pv,e):mx(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return rD(e,t,o,r,l,a,n);if(s){s=r.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=fi(a,c),r.subtreeFlags=a.subtreeFlags&14680064),l!==null?s=fi(l,s):(s=rs(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Rv(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Pv,r}return s=e.child,e=s.sibling,r=fi(s,{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 mx(e,t){return t=ip({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function yd(e,t,n,r){return r!==null&&tx(r),Oo(t,e.child,null,n),e=mx(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rD(e,t,n,r,a,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Bm(Error(se(422))),yd(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,a=t.mode,r=ip({mode:"visible",children:r.children},a,0,null),s=rs(s,a,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Oo(t,e.child,null,o),t.child.memoizedState=Rv(o),t.memoizedState=Pv,s);if(!(t.mode&1))return yd(e,t,o,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(se(419)),r=Bm(s,r,void 0),yd(e,t,o,r)}if(l=(o&e.childLanes)!==0,Ln||l){if(r=Qt,r!==null){switch(o&-o){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|o)?0:a,a!==0&&a!==s.retryLane&&(s.retryLane=a,Oa(e,a),Dr(r,e,a,-1))}return wx(),r=Bm(Error(se(421))),yd(e,t,o,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=gD.bind(null,e),a._reactRetry=t,null):(e=s.treeContext,tr=li(a.nextSibling),nr=t,vt=!0,Mr=null,e!==null&&(pr[mr++]=xa,pr[mr++]=wa,pr[mr++]=ds,xa=e.id,wa=e.overflow,ds=t),t=mx(t,r.children),t.flags|=4096,t)}function xS(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),jv(e.return,t,n)}function zm(e,t,n,r,a){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=a)}function OC(e,t,n){var r=t.pendingProps,a=r.revealOrder,s=r.tail;if(_n(e,t,r.children,n),r=bt.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&&xS(e,n,t);else if(e.tag===19)xS(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(dt(bt,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Cf(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),zm(t,!1,a,n,s);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Cf(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}zm(t,!0,n,null,s);break;case"together":zm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sf(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),hs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(se(153));if(t.child!==null){for(e=t.child,n=fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function aD(e,t,n){switch(t.tag){case 3:CC(t),To();break;case 5:rC(t);break;case 1:zn(t.type)&&kf(t);break;case 4:ox(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;dt(jf,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(dt(bt,bt.current&1),t.flags|=128,null):n&t.child.childLanes?TC(e,t,n):(dt(bt,bt.current&1),e=Pa(e,t,n),e!==null?e.sibling:null);dt(bt,bt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return OC(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),dt(bt,bt.current),r)break;return null;case 22:case 23:return t.lanes=0,_C(e,t,n)}return Pa(e,t,n)}var PC,Mv,RC,MC;PC=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}};Mv=function(){};RC=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Xi(aa.current);var s=null;switch(n){case"input":a=nv(e,a),r=nv(e,r),s=[];break;case"select":a=St({},a,{value:void 0}),r=St({},r,{value:void 0}),s=[];break;case"textarea":a=iv(e,a),r=iv(e,r),s=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=wf)}ov(n,r);var o;n=null;for(u in a)if(!r.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(_c.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(l=a!=null?a[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(s=s||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(_c.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ft("scroll",e),s||l===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};MC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fl(e,t){if(!vt)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 hn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function iD(e,t,n){var r=t.pendingProps;switch(ex(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hn(t),null;case 1:return zn(t.type)&&Sf(),hn(t),null;case 3:return r=t.stateNode,Po(),gt(Bn),gt(wn),cx(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(gd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Mr!==null&&(Uv(Mr),Mr=null))),Mv(e,t),hn(t),null;case 5:lx(t);var a=Xi(Bc.current);if(n=t.type,e!==null&&t.stateNode!=null)RC(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(se(166));return hn(t),null}if(e=Xi(aa.current),gd(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Jr]=t,r[Lc]=s,e=(t.mode&1)!==0,n){case"dialog":ft("cancel",r),ft("close",r);break;case"iframe":case"object":case"embed":ft("load",r);break;case"video":case"audio":for(a=0;a<oc.length;a++)ft(oc[a],r);break;case"source":ft("error",r);break;case"img":case"image":case"link":ft("error",r),ft("load",r);break;case"details":ft("toggle",r);break;case"input":Cw(r,s),ft("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ft("invalid",r);break;case"textarea":Ow(r,s),ft("invalid",r)}ov(n,s),a=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&md(r.textContent,l,e),a=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&md(r.textContent,l,e),a=["children",""+l]):_c.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ft("scroll",r)}switch(n){case"input":od(r),Tw(r,s,!0);break;case"textarea":od(r),Pw(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=wf)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=lA(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Jr]=t,e[Lc]=r,PC(e,t,!1,!1),t.stateNode=e;e:{switch(o=lv(n,r),n){case"dialog":ft("cancel",e),ft("close",e),a=r;break;case"iframe":case"object":case"embed":ft("load",e),a=r;break;case"video":case"audio":for(a=0;a<oc.length;a++)ft(oc[a],e);a=r;break;case"source":ft("error",e),a=r;break;case"img":case"image":case"link":ft("error",e),ft("load",e),a=r;break;case"details":ft("toggle",e),a=r;break;case"input":Cw(e,r),a=nv(e,r),ft("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=St({},r,{value:void 0}),ft("invalid",e);break;case"textarea":Ow(e,r),a=iv(e,r),ft("invalid",e);break;default:a=r}ov(n,a),l=a;for(s in l)if(l.hasOwnProperty(s)){var c=l[s];s==="style"?dA(e,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&cA(e,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ac(e,c):typeof c=="number"&&Ac(e,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(_c.hasOwnProperty(s)?c!=null&&s==="onScroll"&&ft("scroll",e):c!=null&&Bb(e,s,c,o))}switch(n){case"input":od(e),Tw(e,r,!1);break;case"textarea":od(e),Pw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+gi(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?vo(e,!!r.multiple,s,!1):r.defaultValue!=null&&vo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=wf)}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 hn(t),null;case 6:if(e&&t.stateNode!=null)MC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(se(166));if(n=Xi(Bc.current),Xi(aa.current),gd(t)){if(r=t.stateNode,n=t.memoizedProps,r[Jr]=t,(s=r.nodeValue!==n)&&(e=nr,e!==null))switch(e.tag){case 3:md(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&md(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Jr]=t,t.stateNode=r}return hn(t),null;case 13:if(gt(bt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(vt&&tr!==null&&t.mode&1&&!(t.flags&128))QA(),To(),t.flags|=98560,s=!1;else if(s=gd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(se(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(se(317));s[Jr]=t}else To(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hn(t),s=!1}else Mr!==null&&(Uv(Mr),Mr=null),s=!0;if(!s)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||bt.current&1?Gt===0&&(Gt=3):wx())),t.updateQueue!==null&&(t.flags|=4),hn(t),null);case 4:return Po(),Mv(e,t),e===null&&Ic(t.stateNode.containerInfo),hn(t),null;case 10:return ax(t.type._context),hn(t),null;case 17:return zn(t.type)&&Sf(),hn(t),null;case 19:if(gt(bt),s=t.memoizedState,s===null)return hn(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Fl(s,!1);else{if(Gt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Cf(e),o!==null){for(t.flags|=128,Fl(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return dt(bt,bt.current&1|2),t.child}e=e.sibling}s.tail!==null&&Tt()>Mo&&(t.flags|=128,r=!0,Fl(s,!1),t.lanes=4194304)}else{if(!r)if(e=Cf(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fl(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!vt)return hn(t),null}else 2*Tt()-s.renderingStartTime>Mo&&n!==1073741824&&(t.flags|=128,r=!0,Fl(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Tt(),t.sibling=null,n=bt.current,dt(bt,r?n&1|2:n&1),t):(hn(t),null);case 22:case 23:return xx(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Qn&1073741824&&(hn(t),t.subtreeFlags&6&&(t.flags|=8192)):hn(t),null;case 24:return null;case 25:return null}throw Error(se(156,t.tag))}function sD(e,t){switch(ex(t),t.tag){case 1:return zn(t.type)&&Sf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Po(),gt(Bn),gt(wn),cx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return lx(t),null;case 13:if(gt(bt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(se(340));To()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return gt(bt),null;case 4:return Po(),null;case 10:return ax(t.type._context),null;case 22:case 23:return xx(),null;case 24:return null;default:return null}}var bd=!1,vn=!1,oD=typeof WeakSet=="function"?WeakSet:Set,ve=null;function co(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){_t(e,t,r)}else n.current=null}function Iv(e,t,n){try{n()}catch(r){_t(e,t,r)}}var wS=!1;function lD(e,t){if(yv=yf,e=BA(),Qb(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 a=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||a!==0&&f.nodeType!==3||(l=o+a),f!==s||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===a&&(l=o),h===s&&++d===r&&(c=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(bv={focusedElem:e,selectionRange:n},yf=!1,ve=t;ve!==null;)if(t=ve,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ve=e;else for(;ve!==null;){t=ve;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 m=g.memoizedProps,y=g.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:Tr(t.type,m),y);v.__reactInternalSnapshotBeforeUpdate=b}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(se(163))}}catch(N){_t(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,ve=e;break}ve=t.return}return g=wS,wS=!1,g}function gc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var s=a.destroy;a.destroy=void 0,s!==void 0&&Iv(t,n,s)}a=a.next}while(a!==r)}}function rp(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 $v(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 IC(e){var t=e.alternate;t!==null&&(e.alternate=null,IC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jr],delete t[Lc],delete t[Sv],delete t[HL],delete t[GL])),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 $C(e){return e.tag===5||e.tag===3||e.tag===4}function SS(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$C(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 Lv(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=wf));else if(r!==4&&(e=e.child,e!==null))for(Lv(e,t,n),e=e.sibling;e!==null;)Lv(e,t,n),e=e.sibling}function Dv(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(Dv(e,t,n),e=e.sibling;e!==null;)Dv(e,t,n),e=e.sibling}var sn=null,Pr=!1;function Wa(e,t,n){for(n=n.child;n!==null;)LC(e,t,n),n=n.sibling}function LC(e,t,n){if(ra&&typeof ra.onCommitFiberUnmount=="function")try{ra.onCommitFiberUnmount(Yh,n)}catch{}switch(n.tag){case 5:vn||co(n,t);case 6:var r=sn,a=Pr;sn=null,Wa(e,t,n),sn=r,Pr=a,sn!==null&&(Pr?(e=sn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):sn.removeChild(n.stateNode));break;case 18:sn!==null&&(Pr?(e=sn,n=n.stateNode,e.nodeType===8?Rm(e.parentNode,n):e.nodeType===1&&Rm(e,n),Pc(e)):Rm(sn,n.stateNode));break;case 4:r=sn,a=Pr,sn=n.stateNode.containerInfo,Pr=!0,Wa(e,t,n),sn=r,Pr=a;break;case 0:case 11:case 14:case 15:if(!vn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var s=a,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Iv(n,t,o),a=a.next}while(a!==r)}Wa(e,t,n);break;case 1:if(!vn&&(co(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){_t(n,t,l)}Wa(e,t,n);break;case 21:Wa(e,t,n);break;case 22:n.mode&1?(vn=(r=vn)||n.memoizedState!==null,Wa(e,t,n),vn=r):Wa(e,t,n);break;default:Wa(e,t,n)}}function kS(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new oD),t.forEach(function(r){var a=vD.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Ar(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var s=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:sn=l.stateNode,Pr=!1;break e;case 3:sn=l.stateNode.containerInfo,Pr=!0;break e;case 4:sn=l.stateNode.containerInfo,Pr=!0;break e}l=l.return}if(sn===null)throw Error(se(160));LC(s,o,a),sn=null,Pr=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){_t(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)DC(t,e),t=t.sibling}function DC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ar(t,e),Yr(e),r&4){try{gc(3,e,e.return),rp(3,e)}catch(m){_t(e,e.return,m)}try{gc(5,e,e.return)}catch(m){_t(e,e.return,m)}}break;case 1:Ar(t,e),Yr(e),r&512&&n!==null&&co(n,n.return);break;case 5:if(Ar(t,e),Yr(e),r&512&&n!==null&&co(n,n.return),e.flags&32){var a=e.stateNode;try{Ac(a,"")}catch(m){_t(e,e.return,m)}}if(r&4&&(a=e.stateNode,a!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&sA(a,s),lv(l,o);var u=lv(l,s);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?dA(a,f):d==="dangerouslySetInnerHTML"?cA(a,f):d==="children"?Ac(a,f):Bb(a,d,f,u)}switch(l){case"input":rv(a,s);break;case"textarea":oA(a,s);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?vo(a,!!s.multiple,p,!1):h!==!!s.multiple&&(s.defaultValue!=null?vo(a,!!s.multiple,s.defaultValue,!0):vo(a,!!s.multiple,s.multiple?[]:"",!1))}a[Lc]=s}catch(m){_t(e,e.return,m)}}break;case 6:if(Ar(t,e),Yr(e),r&4){if(e.stateNode===null)throw Error(se(162));a=e.stateNode,s=e.memoizedProps;try{a.nodeValue=s}catch(m){_t(e,e.return,m)}}break;case 3:if(Ar(t,e),Yr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Pc(t.containerInfo)}catch(m){_t(e,e.return,m)}break;case 4:Ar(t,e),Yr(e);break;case 13:Ar(t,e),Yr(e),a=e.child,a.flags&8192&&(s=a.memoizedState!==null,a.stateNode.isHidden=s,!s||a.alternate!==null&&a.alternate.memoizedState!==null||(yx=Tt())),r&4&&kS(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(vn=(u=vn)||d,Ar(t,e),vn=u):Ar(t,e),Yr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ve=e,d=e.child;d!==null;){for(f=ve=d;ve!==null;){switch(h=ve,p=h.child,h.tag){case 0:case 11:case 14:case 15:gc(4,h,h.return);break;case 1:co(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(m){_t(r,n,m)}}break;case 5:co(h,h.return);break;case 22:if(h.memoizedState!==null){ES(f);continue}}p!==null?(p.return=h,ve=p):ES(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(s=a.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=uA("display",o))}catch(m){_t(e,e.return,m)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){_t(e,e.return,m)}}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:Ar(t,e),Yr(e),r&4&&kS(e);break;case 21:break;default:Ar(t,e),Yr(e)}}function Yr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if($C(n)){var r=n;break e}n=n.return}throw Error(se(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(Ac(a,""),r.flags&=-33);var s=SS(e);Dv(e,s,a);break;case 3:case 4:var o=r.stateNode.containerInfo,l=SS(e);Lv(e,l,o);break;default:throw Error(se(161))}}catch(c){_t(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function cD(e,t,n){ve=e,BC(e)}function BC(e,t,n){for(var r=(e.mode&1)!==0;ve!==null;){var a=ve,s=a.child;if(a.tag===22&&r){var o=a.memoizedState!==null||bd;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||vn;l=bd;var u=vn;if(bd=o,(vn=c)&&!u)for(ve=a;ve!==null;)o=ve,c=o.child,o.tag===22&&o.memoizedState!==null?jS(a):c!==null?(c.return=o,ve=c):jS(a);for(;s!==null;)ve=s,BC(s),s=s.sibling;ve=a,bd=l,vn=u}NS(e)}else a.subtreeFlags&8772&&s!==null?(s.return=a,ve=s):NS(e)}}function NS(e){for(;ve!==null;){var t=ve;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:vn||rp(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!vn)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Tr(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&lS(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}lS(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;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&&Pc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(se(163))}vn||t.flags&512&&$v(t)}catch(h){_t(t,t.return,h)}}if(t===e){ve=null;break}if(n=t.sibling,n!==null){n.return=t.return,ve=n;break}ve=t.return}}function ES(e){for(;ve!==null;){var t=ve;if(t===e){ve=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ve=n;break}ve=t.return}}function jS(e){for(;ve!==null;){var t=ve;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{rp(4,t)}catch(c){_t(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){_t(t,a,c)}}var s=t.return;try{$v(t)}catch(c){_t(t,s,c)}break;case 5:var o=t.return;try{$v(t)}catch(c){_t(t,o,c)}}}catch(c){_t(t,t.return,c)}if(t===e){ve=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ve=l;break}ve=t.return}}var uD=Math.ceil,Pf=$a.ReactCurrentDispatcher,gx=$a.ReactCurrentOwner,br=$a.ReactCurrentBatchConfig,He=0,Qt=null,Mt=null,ln=0,Qn=0,uo=xi(0),Gt=0,Wc=null,hs=0,ap=0,vx=0,vc=null,$n=null,yx=0,Mo=1/0,ya=null,Rf=!1,Bv=null,ui=null,xd=!1,ti=null,Mf=0,yc=0,zv=null,of=-1,lf=0;function Tn(){return He&6?Tt():of!==-1?of:of=Tt()}function di(e){return e.mode&1?He&2&&ln!==0?ln&-ln:KL.transition!==null?(lf===0&&(lf=kA()),lf):(e=Je,e!==0||(e=window.event,e=e===void 0?16:TA(e.type)),e):1}function Dr(e,t,n,r){if(50<yc)throw yc=0,zv=null,Error(se(185));Ru(e,n,r),(!(He&2)||e!==Qt)&&(e===Qt&&(!(He&2)&&(ap|=n),Gt===4&&Xa(e,ln)),Fn(e,r),n===1&&He===0&&!(t.mode&1)&&(Mo=Tt()+500,ep&&wi()))}function Fn(e,t){var n=e.callbackNode;K$(e,t);var r=vf(e,e===Qt?ln:0);if(r===0)n!==null&&Iw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Iw(n),t===1)e.tag===0?qL(_S.bind(null,e)):YA(_S.bind(null,e)),UL(function(){!(He&6)&&wi()}),n=null;else{switch(NA(r)){case 1:n=Hb;break;case 4:n=wA;break;case 16:n=gf;break;case 536870912:n=SA;break;default:n=gf}n=KC(n,zC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function zC(e,t){if(of=-1,lf=0,He&6)throw Error(se(327));var n=e.callbackNode;if(So()&&e.callbackNode!==n)return null;var r=vf(e,e===Qt?ln:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=If(e,r);else{t=r;var a=He;He|=2;var s=UC();(Qt!==e||ln!==t)&&(ya=null,Mo=Tt()+500,ns(e,t));do try{hD();break}catch(l){FC(e,l)}while(!0);rx(),Pf.current=s,He=a,Mt!==null?t=0:(Qt=null,ln=0,t=Gt)}if(t!==0){if(t===2&&(a=hv(e),a!==0&&(r=a,t=Fv(e,a))),t===1)throw n=Wc,ns(e,0),Xa(e,r),Fn(e,Tt()),n;if(t===6)Xa(e,r);else{if(a=e.current.alternate,!(r&30)&&!dD(a)&&(t=If(e,r),t===2&&(s=hv(e),s!==0&&(r=s,t=Fv(e,s))),t===1))throw n=Wc,ns(e,0),Xa(e,r),Fn(e,Tt()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(se(345));case 2:zi(e,$n,ya);break;case 3:if(Xa(e,r),(r&130023424)===r&&(t=yx+500-Tt(),10<t)){if(vf(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){Tn(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=wv(zi.bind(null,e,$n,ya),t);break}zi(e,$n,ya);break;case 4:if(Xa(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var o=31-Lr(r);s=1<<o,o=t[o],o>a&&(a=o),r&=~s}if(r=a,r=Tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*uD(r/1960))-r,10<r){e.timeoutHandle=wv(zi.bind(null,e,$n,ya),r);break}zi(e,$n,ya);break;case 5:zi(e,$n,ya);break;default:throw Error(se(329))}}}return Fn(e,Tt()),e.callbackNode===n?zC.bind(null,e):null}function Fv(e,t){var n=vc;return e.current.memoizedState.isDehydrated&&(ns(e,t).flags|=256),e=If(e,t),e!==2&&(t=$n,$n=n,t!==null&&Uv(t)),e}function Uv(e){$n===null?$n=e:$n.push.apply($n,e)}function dD(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 a=n[r],s=a.getSnapshot;a=a.value;try{if(!Ur(s(),a))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 Xa(e,t){for(t&=~vx,t&=~ap,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Lr(t),r=1<<n;e[n]=-1,t&=~r}}function _S(e){if(He&6)throw Error(se(327));So();var t=vf(e,0);if(!(t&1))return Fn(e,Tt()),null;var n=If(e,t);if(e.tag!==0&&n===2){var r=hv(e);r!==0&&(t=r,n=Fv(e,r))}if(n===1)throw n=Wc,ns(e,0),Xa(e,t),Fn(e,Tt()),n;if(n===6)throw Error(se(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,zi(e,$n,ya),Fn(e,Tt()),null}function bx(e,t){var n=He;He|=1;try{return e(t)}finally{He=n,He===0&&(Mo=Tt()+500,ep&&wi())}}function ps(e){ti!==null&&ti.tag===0&&!(He&6)&&So();var t=He;He|=1;var n=br.transition,r=Je;try{if(br.transition=null,Je=1,e)return e()}finally{Je=r,br.transition=n,He=t,!(He&6)&&wi()}}function xx(){Qn=uo.current,gt(uo)}function ns(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,FL(n)),Mt!==null)for(n=Mt.return;n!==null;){var r=n;switch(ex(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Sf();break;case 3:Po(),gt(Bn),gt(wn),cx();break;case 5:lx(r);break;case 4:Po();break;case 13:gt(bt);break;case 19:gt(bt);break;case 10:ax(r.type._context);break;case 22:case 23:xx()}n=n.return}if(Qt=e,Mt=e=fi(e.current,null),ln=Qn=t,Gt=0,Wc=null,vx=ap=hs=0,$n=vc=null,Yi!==null){for(t=0;t<Yi.length;t++)if(n=Yi[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=a,r.next=o}n.pending=r}Yi=null}return e}function FC(e,t){do{var n=Mt;try{if(rx(),rf.current=Of,Tf){for(var r=xt.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Tf=!1}if(fs=0,Xt=Ht=xt=null,mc=!1,zc=0,gx.current=null,n===null||n.return===null){Gt=1,Wc=t,Mt=null;break}e:{var s=e,o=n.return,l=n,c=t;if(t=ln,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,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=pS(o);if(p!==null){p.flags&=-257,mS(p,o,l,s,t),p.mode&1&&hS(s,u,t),t=p,c=u;var g=t.updateQueue;if(g===null){var m=new Set;m.add(c),t.updateQueue=m}else g.add(c);break e}else{if(!(t&1)){hS(s,u,t),wx();break e}c=Error(se(426))}}else if(vt&&l.mode&1){var y=pS(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),mS(y,o,l,s,t),tx(Ro(c,l));break e}}s=c=Ro(c,l),Gt!==4&&(Gt=2),vc===null?vc=[s]:vc.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var v=NC(s,c,t);oS(s,v);break e;case 1:l=c;var b=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ui===null||!ui.has(w)))){s.flags|=65536,t&=-t,s.lanes|=t;var N=EC(s,l,t);oS(s,N);break e}}s=s.return}while(s!==null)}HC(n)}catch(S){t=S,Mt===n&&n!==null&&(Mt=n=n.return);continue}break}while(!0)}function UC(){var e=Pf.current;return Pf.current=Of,e===null?Of:e}function wx(){(Gt===0||Gt===3||Gt===2)&&(Gt=4),Qt===null||!(hs&268435455)&&!(ap&268435455)||Xa(Qt,ln)}function If(e,t){var n=He;He|=2;var r=UC();(Qt!==e||ln!==t)&&(ya=null,ns(e,t));do try{fD();break}catch(a){FC(e,a)}while(!0);if(rx(),He=n,Pf.current=r,Mt!==null)throw Error(se(261));return Qt=null,ln=0,Gt}function fD(){for(;Mt!==null;)WC(Mt)}function hD(){for(;Mt!==null&&!D$();)WC(Mt)}function WC(e){var t=qC(e.alternate,e,Qn);e.memoizedProps=e.pendingProps,t===null?HC(e):Mt=t,gx.current=null}function HC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=sD(n,t),n!==null){n.flags&=32767,Mt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Gt=6,Mt=null;return}}else if(n=iD(n,t,Qn),n!==null){Mt=n;return}if(t=t.sibling,t!==null){Mt=t;return}Mt=t=e}while(t!==null);Gt===0&&(Gt=5)}function zi(e,t,n){var r=Je,a=br.transition;try{br.transition=null,Je=1,pD(e,t,n,r)}finally{br.transition=a,Je=r}return null}function pD(e,t,n,r){do So();while(ti!==null);if(He&6)throw Error(se(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(se(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(V$(e,s),e===Qt&&(Mt=Qt=null,ln=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||xd||(xd=!0,KC(gf,function(){return So(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=br.transition,br.transition=null;var o=Je;Je=1;var l=He;He|=4,gx.current=null,lD(e,n),DC(n,e),ML(bv),yf=!!yv,bv=yv=null,e.current=n,cD(n),B$(),He=l,Je=o,br.transition=s}else e.current=n;if(xd&&(xd=!1,ti=e,Mf=a),s=e.pendingLanes,s===0&&(ui=null),U$(n.stateNode),Fn(e,Tt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Rf)throw Rf=!1,e=Bv,Bv=null,e;return Mf&1&&e.tag!==0&&So(),s=e.pendingLanes,s&1?e===zv?yc++:(yc=0,zv=e):yc=0,wi(),null}function So(){if(ti!==null){var e=NA(Mf),t=br.transition,n=Je;try{if(br.transition=null,Je=16>e?16:e,ti===null)var r=!1;else{if(e=ti,ti=null,Mf=0,He&6)throw Error(se(331));var a=He;for(He|=4,ve=e.current;ve!==null;){var s=ve,o=s.child;if(ve.flags&16){var l=s.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ve=u;ve!==null;){var d=ve;switch(d.tag){case 0:case 11:case 15:gc(8,d,s)}var f=d.child;if(f!==null)f.return=d,ve=f;else for(;ve!==null;){d=ve;var h=d.sibling,p=d.return;if(IC(d),d===u){ve=null;break}if(h!==null){h.return=p,ve=h;break}ve=p}}}var g=s.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(m!==null)}}ve=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ve=o;else e:for(;ve!==null;){if(s=ve,s.flags&2048)switch(s.tag){case 0:case 11:case 15:gc(9,s,s.return)}var v=s.sibling;if(v!==null){v.return=s.return,ve=v;break e}ve=s.return}}var b=e.current;for(ve=b;ve!==null;){o=ve;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,ve=w;else e:for(o=b;ve!==null;){if(l=ve,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:rp(9,l)}}catch(S){_t(l,l.return,S)}if(l===o){ve=null;break e}var N=l.sibling;if(N!==null){N.return=l.return,ve=N;break e}ve=l.return}}if(He=a,wi(),ra&&typeof ra.onPostCommitFiberRoot=="function")try{ra.onPostCommitFiberRoot(Yh,e)}catch{}r=!0}return r}finally{Je=n,br.transition=t}}return!1}function AS(e,t,n){t=Ro(n,t),t=NC(e,t,1),e=ci(e,t,1),t=Tn(),e!==null&&(Ru(e,1,t),Fn(e,t))}function _t(e,t,n){if(e.tag===3)AS(e,e,n);else for(;t!==null;){if(t.tag===3){AS(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ui===null||!ui.has(r))){e=Ro(n,e),e=EC(t,e,1),t=ci(t,e,1),e=Tn(),t!==null&&(Ru(t,1,e),Fn(t,e));break}}t=t.return}}function mD(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Tn(),e.pingedLanes|=e.suspendedLanes&n,Qt===e&&(ln&n)===n&&(Gt===4||Gt===3&&(ln&130023424)===ln&&500>Tt()-yx?ns(e,0):vx|=n),Fn(e,t)}function GC(e,t){t===0&&(e.mode&1?(t=ud,ud<<=1,!(ud&130023424)&&(ud=4194304)):t=1);var n=Tn();e=Oa(e,t),e!==null&&(Ru(e,t,n),Fn(e,n))}function gD(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),GC(e,n)}function vD(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(se(314))}r!==null&&r.delete(t),GC(e,n)}var qC;qC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Bn.current)Ln=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ln=!1,aD(e,t,n);Ln=!!(e.flags&131072)}else Ln=!1,vt&&t.flags&1048576&&XA(t,Ef,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;sf(e,t),e=t.pendingProps;var a=Co(t,wn.current);wo(t,n),a=dx(null,t,r,e,a,n);var s=fx();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,zn(r)?(s=!0,kf(t)):s=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,sx(t),a.updater=np,t.stateNode=a,a._reactInternals=t,Av(t,r,e,n),t=Ov(null,t,r,!0,s,n)):(t.tag=0,vt&&s&&Jb(t),_n(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(sf(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=bD(r),e=Tr(r,e),a){case 0:t=Tv(null,t,r,e,n);break e;case 1:t=yS(null,t,r,e,n);break e;case 11:t=gS(null,t,r,e,n);break e;case 14:t=vS(null,t,r,Tr(r.type,e),n);break e}throw Error(se(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Tr(r,a),Tv(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Tr(r,a),yS(e,t,r,a,n);case 3:e:{if(CC(t),e===null)throw Error(se(387));r=t.pendingProps,s=t.memoizedState,a=s.element,nC(e,t),Af(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){a=Ro(Error(se(423)),t),t=bS(e,t,r,n,a);break e}else if(r!==a){a=Ro(Error(se(424)),t),t=bS(e,t,r,n,a);break e}else for(tr=li(t.stateNode.containerInfo.firstChild),nr=t,vt=!0,Mr=null,n=eC(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(To(),r===a){t=Pa(e,t,n);break e}_n(e,t,r,n)}t=t.child}return t;case 5:return rC(t),e===null&&Ev(t),r=t.type,a=t.pendingProps,s=e!==null?e.memoizedProps:null,o=a.children,xv(r,a)?o=null:s!==null&&xv(r,s)&&(t.flags|=32),AC(e,t),_n(e,t,o,n),t.child;case 6:return e===null&&Ev(t),null;case 13:return TC(e,t,n);case 4:return ox(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Oo(t,null,r,n):_n(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Tr(r,a),gS(e,t,r,a,n);case 7:return _n(e,t,t.pendingProps,n),t.child;case 8:return _n(e,t,t.pendingProps.children,n),t.child;case 12:return _n(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,s=t.memoizedProps,o=a.value,dt(jf,r._currentValue),r._currentValue=o,s!==null)if(Ur(s.value,o)){if(s.children===a.children&&!Bn.current){t=Pa(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=Ea(-1,n&-n),c.tag=2;var u=s.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}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),jv(s.return,n,t),l.lanes|=n;break}c=c.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(se(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),jv(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}_n(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,wo(t,n),a=wr(a),r=r(a),t.flags|=1,_n(e,t,r,n),t.child;case 14:return r=t.type,a=Tr(r,t.pendingProps),a=Tr(r.type,a),vS(e,t,r,a,n);case 15:return jC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Tr(r,a),sf(e,t),t.tag=1,zn(r)?(e=!0,kf(t)):e=!1,wo(t,n),kC(t,r,a),Av(t,r,a,n),Ov(null,t,r,!0,e,n);case 19:return OC(e,t,n);case 22:return _C(e,t,n)}throw Error(se(156,t.tag))};function KC(e,t){return xA(e,t)}function yD(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 vr(e,t,n,r){return new yD(e,t,n,r)}function Sx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function bD(e){if(typeof e=="function")return Sx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Fb)return 11;if(e===Ub)return 14}return 2}function fi(e,t){var n=e.alternate;return n===null?(n=vr(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 cf(e,t,n,r,a,s){var o=2;if(r=e,typeof e=="function")Sx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case eo:return rs(n.children,a,s,t);case zb:o=8,a|=8;break;case Qg:return e=vr(12,n,t,a|2),e.elementType=Qg,e.lanes=s,e;case Jg:return e=vr(13,n,t,a),e.elementType=Jg,e.lanes=s,e;case ev:return e=vr(19,n,t,a),e.elementType=ev,e.lanes=s,e;case rA:return ip(n,a,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case tA:o=10;break e;case nA:o=9;break e;case Fb:o=11;break e;case Ub:o=14;break e;case qa:o=16,r=null;break e}throw Error(se(130,e==null?e:typeof e,""))}return t=vr(o,n,t,a),t.elementType=e,t.type=r,t.lanes=s,t}function rs(e,t,n,r){return e=vr(7,e,r,t),e.lanes=n,e}function ip(e,t,n,r){return e=vr(22,e,r,t),e.elementType=rA,e.lanes=n,e.stateNode={isHidden:!1},e}function Fm(e,t,n){return e=vr(6,e,null,t),e.lanes=n,e}function Um(e,t,n){return t=vr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xD(e,t,n,r,a){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=Sm(0),this.expirationTimes=Sm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sm(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function kx(e,t,n,r,a,s,o,l,c){return e=new xD(e,t,n,l,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=vr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},sx(s),e}function wD(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Js,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function VC(e){if(!e)return vi;e=e._reactInternals;e:{if(Ss(e)!==e||e.tag!==1)throw Error(se(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(zn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(se(171))}if(e.tag===1){var n=e.type;if(zn(n))return VA(e,n,t)}return t}function YC(e,t,n,r,a,s,o,l,c){return e=kx(n,r,!0,e,a,s,o,l,c),e.context=VC(null),n=e.current,r=Tn(),a=di(n),s=Ea(r,a),s.callback=t??null,ci(n,s,a),e.current.lanes=a,Ru(e,a,r),Fn(e,r),e}function sp(e,t,n,r){var a=t.current,s=Tn(),o=di(a);return n=VC(n),t.context===null?t.context=n:t.pendingContext=n,t=Ea(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ci(a,t,o),e!==null&&(Dr(e,a,o,s),nf(e,a,o)),o}function $f(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 CS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Nx(e,t){CS(e,t),(e=e.alternate)&&CS(e,t)}function SD(){return null}var XC=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ex(e){this._internalRoot=e}op.prototype.render=Ex.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(se(409));sp(e,t,null,null)};op.prototype.unmount=Ex.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ps(function(){sp(null,e,null,null)}),t[Ta]=null}};function op(e){this._internalRoot=e}op.prototype.unstable_scheduleHydration=function(e){if(e){var t=_A();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ya.length&&t!==0&&t<Ya[n].priority;n++);Ya.splice(n,0,e),n===0&&CA(e)}};function jx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function lp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function TS(){}function kD(e,t,n,r,a){if(a){if(typeof r=="function"){var s=r;r=function(){var u=$f(o);s.call(u)}}var o=YC(t,r,e,0,null,!1,!1,"",TS);return e._reactRootContainer=o,e[Ta]=o.current,Ic(e.nodeType===8?e.parentNode:e),ps(),o}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var l=r;r=function(){var u=$f(c);l.call(u)}}var c=kx(e,0,!1,null,null,!1,!1,"",TS);return e._reactRootContainer=c,e[Ta]=c.current,Ic(e.nodeType===8?e.parentNode:e),ps(function(){sp(t,c,n,r)}),c}function cp(e,t,n,r,a){var s=n._reactRootContainer;if(s){var o=s;if(typeof a=="function"){var l=a;a=function(){var c=$f(o);l.call(c)}}sp(t,o,e,a)}else o=kD(n,t,e,a,r);return $f(o)}EA=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=sc(t.pendingLanes);n!==0&&(Gb(t,n|1),Fn(t,Tt()),!(He&6)&&(Mo=Tt()+500,wi()))}break;case 13:ps(function(){var r=Oa(e,1);if(r!==null){var a=Tn();Dr(r,e,1,a)}}),Nx(e,1)}};qb=function(e){if(e.tag===13){var t=Oa(e,134217728);if(t!==null){var n=Tn();Dr(t,e,134217728,n)}Nx(e,134217728)}};jA=function(e){if(e.tag===13){var t=di(e),n=Oa(e,t);if(n!==null){var r=Tn();Dr(n,e,t,r)}Nx(e,t)}};_A=function(){return Je};AA=function(e,t){var n=Je;try{return Je=e,t()}finally{Je=n}};uv=function(e,t,n){switch(t){case"input":if(rv(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 a=Jh(r);if(!a)throw Error(se(90));iA(r),rv(r,a)}}}break;case"textarea":oA(e,n);break;case"select":t=n.value,t!=null&&vo(e,!!n.multiple,t,!1)}};pA=bx;mA=ps;var ND={usingClientEntryPoint:!1,Events:[Iu,ao,Jh,fA,hA,bx]},Ul={findFiberByHostInstance:Vi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ED={bundleType:Ul.bundleType,version:Ul.version,rendererPackageName:Ul.rendererPackageName,rendererConfig:Ul.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$a.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=yA(e),e===null?null:e.stateNode},findFiberByHostInstance:Ul.findFiberByHostInstance||SD,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 wd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wd.isDisabled&&wd.supportsFiber)try{Yh=wd.inject(ED),ra=wd}catch{}}sr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ND;sr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!jx(t))throw Error(se(200));return wD(e,t,null,n)};sr.createRoot=function(e,t){if(!jx(e))throw Error(se(299));var n=!1,r="",a=XC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=kx(e,1,!1,null,null,n,!1,r,a),e[Ta]=t.current,Ic(e.nodeType===8?e.parentNode:e),new Ex(t)};sr.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(se(188)):(e=Object.keys(e).join(","),Error(se(268,e)));return e=yA(t),e=e===null?null:e.stateNode,e};sr.flushSync=function(e){return ps(e)};sr.hydrate=function(e,t,n){if(!lp(t))throw Error(se(200));return cp(null,e,t,!0,n)};sr.hydrateRoot=function(e,t,n){if(!jx(e))throw Error(se(405));var r=n!=null&&n.hydratedSources||null,a=!1,s="",o=XC;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=YC(t,null,e,1,n??null,a,!1,s,o),e[Ta]=t.current,Ic(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new op(t)};sr.render=function(e,t,n){if(!lp(t))throw Error(se(200));return cp(null,e,t,!1,n)};sr.unmountComponentAtNode=function(e){if(!lp(e))throw Error(se(40));return e._reactRootContainer?(ps(function(){cp(null,null,e,!1,function(){e._reactRootContainer=null,e[Ta]=null})}),!0):!1};sr.unstable_batchedUpdates=bx;sr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!lp(n))throw Error(se(200));if(e==null||e._reactInternals===void 0)throw Error(se(38));return cp(e,t,n,!1,r)};sr.version="18.3.1-next-f1338f8080-20240426";function ZC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ZC)}catch(e){console.error(e)}}ZC(),Z_.exports=sr;var jD=Z_.exports,QC,OS=jD;QC=OS.createRoot,OS.hydrateRoot;/**
41
- * @remix-run/router v1.23.3
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 Hc(){return Hc=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},Hc.apply(null,arguments)}var ni;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ni||(ni={}));const PS="popstate";function _D(e){e===void 0&&(e={});function t(r,a){let{pathname:s,search:o,hash:l}=r.location;return Wv("",{pathname:s,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Lf(a)}return CD(t,n,null,e)}function wt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _x(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function AD(){return Math.random().toString(36).substr(2,8)}function RS(e,t){return{usr:e.state,key:e.key,idx:t}}function Wv(e,t,n,r){return n===void 0&&(n=null),Hc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ll(t):t,{state:n,key:t&&t.key||r||AD()})}function Lf(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 ll(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 CD(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:s=!1}=r,o=a.history,l=ni.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Hc({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=ni.Pop;let y=d(),v=y==null?null:y-u;u=y,c&&c({action:l,location:m.location,delta:v})}function h(y,v){l=ni.Push;let b=Wv(m.location,y,v);u=d()+1;let w=RS(b,u),N=m.createHref(b);try{o.pushState(w,"",N)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;a.location.assign(N)}s&&c&&c({action:l,location:m.location,delta:1})}function p(y,v){l=ni.Replace;let b=Wv(m.location,y,v);u=d();let w=RS(b,u),N=m.createHref(b);o.replaceState(w,"",N),s&&c&&c({action:l,location:m.location,delta:0})}function g(y){let v=a.location.origin!=="null"?a.location.origin:a.location.href,b=typeof y=="string"?y:Lf(y);return b=b.replace(/ $/,"%20"),wt(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let m={get action(){return l},get location(){return e(a,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(PS,f),c=y,()=>{a.removeEventListener(PS,f),c=null}},createHref(y){return t(a,y)},createURL:g,encodeLocation(y){let v=g(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:p,go(y){return o.go(y)}};return m}var MS;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(MS||(MS={}));function TD(e,t,n){return n===void 0&&(n="/"),OD(e,t,n)}function OD(e,t,n,r){let a=typeof t=="string"?ll(t):t,s=Io(a.pathname||"/",n);if(s==null)return null;let o=JC(e);PD(o);let l=null,c=WD(s);for(let u=0;l==null&&u<o.length;++u)l=FD(o[u],c);return l}function JC(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(s,o,l)=>{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(wt(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=hi([r,c.relativePath]),d=n.concat(c);s.children&&s.children.length>0&&(wt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),JC(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:BD(u,s.index),routesMeta:d})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))a(s,o);else for(let c of eT(s.path))a(s,o,c)}),t}function eT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return a?[s,""]:[s];let o=eT(r.join("/")),l=[];return l.push(...o.map(c=>c===""?s:[s,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function PD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:zD(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const RD=/^:[\w-]+$/,MD=3,ID=2,$D=1,LD=10,DD=-2,IS=e=>e==="*";function BD(e,t){let n=e.split("/"),r=n.length;return n.some(IS)&&(r+=DD),t&&(r+=ID),n.filter(a=>!IS(a)).reduce((a,s)=>a+(RD.test(s)?MD:s===""?$D:LD),r)}function zD(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function FD(e,t,n){let{routesMeta:r}=e,a={},s="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",f=Hv({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f)return null;Object.assign(a,f.params),o.push({params:a,pathname:hi([s,f.pathname]),pathnameBase:VD(hi([s,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(s=hi([s,f.pathnameBase]))}return o}function Hv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=UD(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let s=a[0],o=s.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=l[f]||"";o=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const g=l[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function UD(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),_x(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function WD(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _x(!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 Io(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 HD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,GD=e=>HD.test(e);function qD(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?ll(e):e,s;if(n)if(GD(n))s=n;else{if(n.includes("//")){let o=n;n=tT(n),_x(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?s=$S(n.substring(1),"/"):s=$S(n,t)}else s=t;return{pathname:s,search:YD(r),hash:XD(a)}}function $S(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Wm(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 KD(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ax(e,t){let n=KD(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Cx(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=ll(e):(a=Hc({},e),wt(!a.pathname||!a.pathname.includes("?"),Wm("?","pathname","search",a)),wt(!a.pathname||!a.pathname.includes("#"),Wm("#","pathname","hash",a)),wt(!a.search||!a.search.includes("#"),Wm("#","search","hash",a)));let s=e===""||a.pathname==="",o=s?"/":a.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;a.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=qD(a,l),u=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const tT=e=>e.replace(/\/\/+/g,"/"),hi=e=>tT(e.join("/")),VD=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),YD=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,XD=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function ZD(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const nT=["post","put","patch","delete"];new Set(nT);const QD=["get",...nT];new Set(QD);/**
50
- * React Router v6.30.4
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */function Gc(){return Gc=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},Gc.apply(null,arguments)}const up=k.createContext(null),rT=k.createContext(null),La=k.createContext(null),dp=k.createContext(null),Si=k.createContext({outlet:null,matches:[],isDataRoute:!1}),aT=k.createContext(null);function JD(e,t){let{relative:n}=t===void 0?{}:t;cl()||wt(!1);let{basename:r,navigator:a}=k.useContext(La),{hash:s,pathname:o,search:l}=fp(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:hi([r,o])),a.createHref({pathname:c,search:l,hash:s})}function cl(){return k.useContext(dp)!=null}function ks(){return cl()||wt(!1),k.useContext(dp).location}function iT(e){k.useContext(La).static||k.useLayoutEffect(e)}function Tx(){let{isDataRoute:e}=k.useContext(Si);return e?f2():e2()}function e2(){cl()||wt(!1);let e=k.useContext(up),{basename:t,future:n,navigator:r}=k.useContext(La),{matches:a}=k.useContext(Si),{pathname:s}=ks(),o=JSON.stringify(Ax(a,n.v7_relativeSplatPath)),l=k.useRef(!1);return iT(()=>{l.current=!0}),k.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=Cx(u,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:hi([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,s,e])}function fp(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=k.useContext(La),{matches:a}=k.useContext(Si),{pathname:s}=ks(),o=JSON.stringify(Ax(a,r.v7_relativeSplatPath));return k.useMemo(()=>Cx(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function t2(e,t){return n2(e,t)}function n2(e,t,n,r){cl()||wt(!1);let{navigator:a}=k.useContext(La),{matches:s}=k.useContext(Si),o=s[s.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=ks(),d;if(t){var f;let y=typeof t=="string"?ll(t):t;c==="/"||(f=y.pathname)!=null&&f.startsWith(c)||wt(!1),d=y}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let y=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=TD(e,{pathname:p}),m=o2(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:hi([c,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:hi([c,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r);return t&&m?k.createElement(dp.Provider,{value:{location:Gc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ni.Pop}},m):m}function r2(){let e=d2(),t=ZD(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),n?k.createElement("pre",{style:a},n):null,null)}const a2=k.createElement(r2,null);class i2 extends k.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?k.createElement(Si.Provider,{value:this.props.routeContext},k.createElement(aT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function s2(e){let{routeContext:t,match:n,children:r}=e,a=k.useContext(up);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),k.createElement(Si.Provider,{value:t},r)}function o2(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(a=n)==null?void 0:a.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||wt(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[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?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,g=!1,m=null,y=null;n&&(p=l&&f.route.id?l[f.route.id]:void 0,m=f.route.errorElement||a2,c&&(u<0&&h===0?(h2("route-fallback"),g=!0,y=null):u===h&&(g=!0,y=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,h+1)),b=()=>{let w;return p?w=m:g?w=y:f.route.Component?w=k.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,k.createElement(s2,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?k.createElement(i2,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var sT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(sT||{}),oT=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}(oT||{});function l2(e){let t=k.useContext(up);return t||wt(!1),t}function c2(e){let t=k.useContext(rT);return t||wt(!1),t}function u2(e){let t=k.useContext(Si);return t||wt(!1),t}function lT(e){let t=u2(),n=t.matches[t.matches.length-1];return n.route.id||wt(!1),n.route.id}function d2(){var e;let t=k.useContext(aT),n=c2(),r=lT();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function f2(){let{router:e}=l2(sT.UseNavigateStable),t=lT(oT.UseNavigateStable),n=k.useRef(!1);return iT(()=>{n.current=!0}),k.useCallback(function(a,s){s===void 0&&(s={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Gc({fromRouteId:t},s)))},[e,t])}const LS={};function h2(e,t,n){LS[e]||(LS[e]=!0)}function p2(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function DS(e){let{to:t,replace:n,state:r,relative:a}=e;cl()||wt(!1);let{future:s,static:o}=k.useContext(La),{matches:l}=k.useContext(Si),{pathname:c}=ks(),u=Tx(),d=Cx(t,Ax(l,s.v7_relativeSplatPath),c,a==="path"),f=JSON.stringify(d);return k.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:a}),[u,f,a,n,r]),null}function nt(e){wt(!1)}function m2(e){let{basename:t="/",children:n=null,location:r,navigationType:a=ni.Pop,navigator:s,static:o=!1,future:l}=e;cl()&&wt(!1);let c=t.replace(/^\/*/,"/"),u=k.useMemo(()=>({basename:c,navigator:s,static:o,future:Gc({v7_relativeSplatPath:!1},l)}),[c,l,s,o]);typeof r=="string"&&(r=ll(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,m=k.useMemo(()=>{let y=Io(d,c);return y==null?null:{location:{pathname:y,search:f,hash:h,state:p,key:g},navigationType:a}},[c,d,f,h,p,g,a]);return m==null?null:k.createElement(La.Provider,{value:u},k.createElement(dp.Provider,{children:n,value:m}))}function g2(e){let{children:t,location:n}=e;return t2(Gv(t),n)}new Promise(()=>{});function Gv(e,t){t===void 0&&(t=[]);let n=[];return k.Children.forEach(e,(r,a)=>{if(!k.isValidElement(r))return;let s=[...t,a];if(r.type===k.Fragment){n.push.apply(n,Gv(r.props.children,s));return}r.type!==nt&&wt(!1),!r.props.index||!r.props.children||wt(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Gv(r.props.children,s)),n.push(o)}),n}/**
59
- * React Router DOM v6.30.4
60
- *
61
- * Copyright (c) Remix Software Inc.
62
- *
63
- * This source code is licensed under the MIT license found in the
64
- * LICENSE.md file in the root directory of this source tree.
65
- *
66
- * @license MIT
67
- */function Df(){return Df=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},Df.apply(null,arguments)}function cT(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 v2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function y2(e,t){return e.button===0&&(!t||t==="_self")&&!v2(e)}const b2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],x2=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],w2="6";try{window.__reactRouterVersion=w2}catch{}const S2=k.createContext({isTransitioning:!1}),k2="startTransition",BS=m$[k2];function N2(e){let{basename:t,children:n,future:r,window:a}=e,s=k.useRef();s.current==null&&(s.current=_D({window:a,v5Compat:!0}));let o=s.current,[l,c]=k.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=k.useCallback(f=>{u&&BS?BS(()=>c(f)):c(f)},[c,u]);return k.useLayoutEffect(()=>o.listen(d),[o,d]),k.useEffect(()=>p2(r),[r]),k.createElement(m2,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const E2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",j2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Or=k.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:s,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=cT(t,b2),{basename:p}=k.useContext(La),g,m=!1;if(typeof u=="string"&&j2.test(u)&&(g=u,E2))try{let w=new URL(window.location.href),N=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=Io(N.pathname,p);N.origin===w.origin&&S!=null?u=S+N.search+N.hash:m=!0}catch{}let y=JD(u,{relative:a}),v=A2(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:a,viewTransition:f});function b(w){r&&r(w),w.defaultPrevented||v(w)}return k.createElement("a",Df({},h,{href:g||y,onClick:m||s?r:b,ref:n,target:c}))}),zS=k.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:s="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,f=cT(t,x2),h=fp(c,{relative:f.relative}),p=ks(),g=k.useContext(rT),{navigator:m,basename:y}=k.useContext(La),v=g!=null&&C2(h)&&u===!0,b=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,w=p.pathname,N=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(w=w.toLowerCase(),N=N?N.toLowerCase():null,b=b.toLowerCase()),N&&y&&(N=Io(N,y)||N);const S=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let x=w===b||!o&&w.startsWith(b)&&w.charAt(S)==="/",E=N!=null&&(N===b||!o&&N.startsWith(b)&&N.charAt(b.length)==="/"),j={isActive:x,isPending:E,isTransitioning:v},C=x?r:void 0,T;typeof s=="function"?T=s(j):T=[s,x?"active":null,E?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let $=typeof l=="function"?l(j):l;return k.createElement(Or,Df({},f,{"aria-current":C,className:T,ref:n,style:$,to:c,viewTransition:u}),typeof d=="function"?d(j):d)});var qv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(qv||(qv={}));var FS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(FS||(FS={}));function _2(e){let t=k.useContext(up);return t||wt(!1),t}function A2(e,t){let{target:n,replace:r,state:a,preventScrollReset:s,relative:o,viewTransition:l}=t===void 0?{}:t,c=Tx(),u=ks(),d=fp(e,{relative:o});return k.useCallback(f=>{if(y2(f,n)){f.preventDefault();let h=r!==void 0?r:Lf(u)===Lf(d);c(e,{replace:h,state:a,preventScrollReset:s,relative:o,viewTransition:l})}},[u,c,d,r,a,n,e,s,o,l])}function C2(e,t){t===void 0&&(t={});let n=k.useContext(S2);n==null&&wt(!1);let{basename:r}=_2(qv.useViewTransitionState),a=fp(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Io(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Io(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Hv(a.pathname,o)!=null||Hv(a.pathname,s)!=null}async function fr(e){if(!e.ok)return null;const t=e.headers.get("content-type")||"";if(!t.includes("application/json")&&!t.includes("text/json"))return t.includes("text/html")&&console.warn(`[dashboard] GET ${e.url||"/api/*"} returned HTML (${e.status}) instead of JSON โ€” the dashboard server may be an older version. Stop it and start it again (agent-nuvira dashboard stop, or Ctrl+C in its terminal).`),null;try{return await e.json()}catch{return null}}const fo="buff-dashboard-admin-token";function uT(){try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{}return null}function T2(e){if(!e||typeof e!="object")return!1;const t=e,n=t.diff;return typeof t.dir=="string"&&typeof t.base=="string"&&typeof t.removed=="boolean"&&!!n&&typeof n=="object"&&Array.isArray(n.files)&&n.files.every(r=>typeof r=="string")&&typeof n.summary=="string"&&!!n.payload&&typeof n.payload=="object"&&typeof n.payload.summary=="string"&&Array.isArray(n.payload.files)&&n.payload.files.every(r=>!!r&&typeof r.path=="string"&&typeof r.body=="string")}function O2(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.replayed=="number"&&typeof t.modelCalls=="number"&&typeof t.saved=="boolean"&&typeof t.notice=="string"}const Kv=new Map;function P2(){const e=uT();if(e)try{const t=e.getItem(fo);if(t)return t}catch{}return Kv.get(fo)??null}function R2(e){const t=uT();if(t)try{e?t.setItem(fo,e):t.removeItem(fo);return}catch{}e?Kv.set(fo,e):Kv.delete(fo)}function rn(){return P2()}function Hm(e){R2(e)}function En(){const e=rn();return e?{Authorization:`Bearer ${e}`}:{}}class M2{constructor(t=""){Vr(this,"sse",null);Vr(this,"listeners",new Set);Vr(this,"connectionListeners",new Set);Vr(this,"dagListeners",new Set);Vr(this,"typingListeners",new Set);Vr(this,"chatRetryListeners",new Set);Vr(this,"reconnectTimer",null);Vr(this,"baseUrl");Vr(this,"lastData",null);this.baseUrl=t}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}onConnectionChange(t){return this.connectionListeners.add(t),()=>this.connectionListeners.delete(t)}onDAGEvent(t){return this.dagListeners.add(t),()=>this.dagListeners.delete(t)}onTypingEvent(t){return this.typingListeners.add(t),()=>this.typingListeners.delete(t)}onChatRetryEvent(t){return this.chatRetryListeners.add(t),()=>this.chatRetryListeners.delete(t)}connect(){this.sse||(this.sse=new EventSource(`${this.baseUrl}/api/sse`),this.sse.addEventListener("init",t=>{try{const n=JSON.parse(t.data);this.lastData=n,this.notify(n),this.notifyConnection(!0)}catch(n){console.error("Failed to parse SSE init data:",n)}}),this.sse.addEventListener("refresh",t=>{try{const n=JSON.parse(t.data);this.lastData=n,this.notify(n),this.notifyConnection(!0)}catch(n){console.error("Failed to parse SSE refresh data:",n)}}),this.sse.addEventListener("dag",t=>{try{const n=JSON.parse(t.data);if(this.notifyDAG(n),this.lastData){const r={...this.lastData,dag:n};this.lastData=r,this.notify(r)}}catch(n){console.error("Failed to parse SSE dag event:",n)}}),this.sse.addEventListener("quota",t=>{try{const n=JSON.parse(t.data);if(this.lastData&&n.quota){const r={...this.lastData,routing:{...this.lastData.routing||{},quota:n.quota},serverTime:n.serverTime||this.lastData.serverTime};this.lastData=r,this.notify(r)}}catch(n){console.error("Failed to parse SSE quota event:",n)}}),this.sse.addEventListener("conversation",t=>{try{const n=JSON.parse(t.data);if(this.lastData&&n.conversations){const r={...this.lastData,conversations:{total:n.total??n.conversations.length,recent:n.conversations},serverTime:n.serverTime||this.lastData.serverTime};this.lastData=r,this.notify(r)}}catch(n){console.error("Failed to parse SSE conversation event:",n)}}),this.sse.addEventListener("typing",t=>{try{const n=JSON.parse(t.data);for(const r of this.typingListeners)try{r(n)}catch{}}catch(n){console.error("Failed to parse SSE typing event:",n)}}),this.sse.addEventListener("chat-retry",t=>{try{const n=JSON.parse(t.data);if(!n||typeof n.sessionId!="string"||typeof n.content!="string")return;for(const r of this.chatRetryListeners)try{r(n)}catch{}}catch(n){console.error("Failed to parse SSE chat-retry event:",n)}}),this.sse.onerror=()=>{this.notifyConnection(!1),this.disconnect(),this.reconnect()},this.sse.onopen=()=>{this.notifyConnection(!0)})}disconnect(){this.sse&&(this.sse.close(),this.sse=null),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}reconnect(){this.reconnectTimer=setTimeout(()=>{this.connect()},3e3)}notify(t){this.listeners.forEach(n=>n(t))}notifyDAG(t){this.dagListeners.forEach(n=>n(t))}notifyConnection(t){this.connectionListeners.forEach(n=>n(t))}async fetchAll(){try{const t=await fetch(`${this.baseUrl}/api/all`),n=await fr(t);return n?(this.lastData=n,n):null}catch{return null}}async fetchExecutionAudit(t){try{const n=new URLSearchParams;t!=null&&t.skillName&&n.set("skillName",t.skillName),t!=null&&t.status&&n.set("status",t.status),t!=null&&t.limit&&n.set("limit",String(t.limit));const r=n.toString(),a=await fetch(`${this.baseUrl}/api/executions${r?`?${r}`:""}`,{signal:AbortSignal.timeout(8e3)}),s=await fr(a);return(s==null?void 0:s.entries)??[]}catch{return[]}}async fetchTraces(){try{const t=await fetch(`${this.baseUrl}/api/traces`,{signal:AbortSignal.timeout(8e3)}),n=await fr(t);return n!=null&&n.traces?n.traces:null}catch{return null}}async fetchAdminChecks(){try{const t=await fetch(`${this.baseUrl}/api/admin/checks`,{signal:AbortSignal.timeout(15e3)}),n=await fr(t);return!n||!Array.isArray(n.system)||!Array.isArray(n.enterprise)||!Array.isArray(n.providers)?null:n}catch{return null}}async fetchHub(){var t;try{const n=await fetch(`${this.baseUrl}/api/hub`,{signal:AbortSignal.timeout(8e3)}),r=await fr(n);return!r||!Array.isArray((t=r.toolsets)==null?void 0:t.toolsets)?null:r}catch{return null}}async fetchTraceDetail(t){try{const n=await fetch(`${this.baseUrl}/api/traces/${encodeURIComponent(t)}`,{signal:AbortSignal.timeout(8e3)}),r=await fr(n);return r&&Array.isArray(r.steps)?r:null}catch{return null}}async sendAdminRequest(t,n,r){try{const a=rn(),s=await fetch(`${this.baseUrl}${t}`,{method:n,headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{}},body:r!==void 0?JSON.stringify(r):void 0,signal:AbortSignal.timeout(15e3)}),o=s.headers.get("content-type")||"";let l=null;if(o.includes("application/json")||o.includes("text/json"))try{l=await s.json()}catch{l=null}return{status:s.status,data:l}}catch{return null}}async fetchAdminAuthStatus(){const t=await this.sendAdminRequest("/api/admin/auth-status","GET");if(!t||typeof t.data!="object"||t.data===null)return null;const n=t.data;return typeof n.configured!="boolean"||typeof n.authenticated!="boolean"?null:{configured:n.configured,authenticated:n.authenticated,user:typeof n.user=="string"?n.user:null,role:typeof n.role=="string"?n.role:null,mustChangePassword:n.mustChangePassword===!0}}async changeAdminPassword(t,n){const r=await this.sendAdminRequest("/api/admin/change-password","POST",{currentPassword:t,newPassword:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Could not change the password."}}async fetchAdminUsers(){const t=await this.sendAdminRequest("/api/admin/users","GET");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok&&Array.isArray(n.users)?n:{ok:!1,error:n.error||"Failed to load users.",forbidden:t.status===403,unauthorized:t.status===401}}async addAdminUser(t,n,r){const a=await this.sendAdminRequest("/api/admin/users","POST",{user:t,password:n,role:r});if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const s=a.data??{};return a.status===200&&s.ok?s:{ok:!1,error:s.error||"Failed to add user.",forbidden:a.status===403,unauthorized:a.status===401}}async removeAdminUser(t){const n=await this.sendAdminRequest(`/api/admin/users/${encodeURIComponent(t)}`,"DELETE");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Failed to remove user.",forbidden:n.status===403,unauthorized:n.status===401}}async fetchAdminCatalog(){const t=await this.sendAdminRequest("/api/admin/catalog","GET"),n=t==null?void 0:t.data;return!n||!Array.isArray(n.providers)?null:n.providers}async adminSetup(t,n){const r=await this.sendAdminRequest("/api/admin/setup","POST",{user:t,password:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&typeof a.token=="string"?(Hm(a.token),{ok:!0,user:a.user,token:a.token}):{ok:!1,error:a.error||"Setup failed.",unauthorized:r.status===401}}async adminLogin(t,n){const r=await this.sendAdminRequest("/api/admin/login","POST",{user:t,password:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&typeof a.token=="string"?(Hm(a.token),{ok:!0,user:a.user,token:a.token}):{ok:!1,error:a.error||"Login failed.",unauthorized:r.status===401}}async adminLogout(){await this.sendAdminRequest("/api/admin/logout","POST"),Hm(null)}async shutdown(t){const n=await this.sendAdminRequest("/api/admin/shutdown","POST",{target:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Shutdown failed.",unauthorized:n.status===401,forbidden:n.status===403}}async saveProvider(t,n){const r=await this.sendAdminRequest(`/api/admin/providers/${encodeURIComponent(t)}`,"PUT",n);if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Save failed.",unauthorized:r.status===401}}async deleteProvider(t){const n=await this.sendAdminRequest(`/api/admin/providers/${encodeURIComponent(t)}`,"DELETE");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Remove failed.",unauthorized:n.status===401}}async testProvider(t){const n=await this.sendAdminRequest(`/api/admin/providers/${encodeURIComponent(t)}/test`,"POST");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200?r:{ok:!1,error:r.error||"Test failed.",unauthorized:n.status===401}}async fetchAdminQuota(){const t=await this.sendAdminRequest("/api/admin/quota","GET");if(!t)return null;const n=t.data;return!n||!n.ok||typeof n.quota!="object"?null:n}async setToolsetEnabled(t,n){const r=await this.sendAdminRequest(`/api/admin/hub/toolsets/${encodeURIComponent(t)}`,"PUT",{enabled:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Toggle failed.",unauthorized:r.status===401,forbidden:r.status===403}}async setSkillEnabled(t,n){const r=await this.sendAdminRequest(`/api/admin/hub/skills/${encodeURIComponent(t)}`,"PUT",{enabled:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Toggle failed.",unauthorized:r.status===401,forbidden:r.status===403}}async marketplaceSearch(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/marketplace?q=${encodeURIComponent(t)}`,{headers:En()})).json();return Array.isArray(r.results)?r.results:[]}catch{return[]}}async marketplaceInstall(t){try{const n=await fetch(`${this.baseUrl}/api/skills/marketplace/install`,{method:"POST",headers:{"Content-Type":"application/json",...En()},body:JSON.stringify({name:t})}),r=await n.json();return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Install failed.",quarantined:r.quarantined===!0}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async marketplaceUninstall(t){try{const n=await fetch(`${this.baseUrl}/api/skills/marketplace/uninstall`,{method:"POST",headers:{"Content-Type":"application/json",...En()},body:JSON.stringify({name:t})}),r=await n.json();return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Uninstall failed."}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async sendChannelMessage(t,n){const r=await this.sendAdminRequest("/api/admin/hub/channels/send","POST",{target:t,text:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Send failed.",unauthorized:r.status===401,forbidden:r.status===403}}async gatewayPolicies(){const t=await this.sendAdminRequest("/api/admin/gateway/policies","GET");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?{ok:!0,policies:n.policies,statusRecipients:n.statusRecipients,contacts:n.contacts,askUserWait:n.askUserWait,askUserTimeoutMs:n.askUserTimeoutMs}:{ok:!1,error:n.error||"Failed to read policies.",unauthorized:t.status===401,forbidden:t.status===403}}async saveGatewayPolicies(t,n,r,a){const s={policies:t};Array.isArray(n)&&(s.statusRecipients=n),Array.isArray(r)&&(s.contacts=r),a&&(s.askUserWait=a.wait,typeof a.timeoutMs=="number"&&(s.askUserTimeoutMs=a.timeoutMs));const o=await this.sendAdminRequest("/api/admin/gateway/policies","PUT",s);if(!o)return{ok:!1,error:"Could not reach the dashboard server."};const l=o.data??{};return o.status===200&&l.ok?l:{ok:!1,error:l.error||"Failed to save policies.",unauthorized:o.status===401,forbidden:o.status===403}}async fetchGatewayConversations(t={}){const n=new URLSearchParams;t.offset&&n.set("offset",String(t.offset)),t.limit&&n.set("limit",String(t.limit)),t.q&&n.set("q",t.q);const r=n.toString(),a=await this.sendAdminRequest(`/api/admin/gateway/conversations${r?`?${r}`:""}`,"GET");if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const s=a.data??{};return a.status===200&&s.ok?{ok:!0,conversations:s.conversations,total:s.total,hasMore:s.hasMore}:{ok:!1,error:s.error||"Failed to load conversations.",unauthorized:a.status===401,forbidden:a.status===403}}async clearGatewayConversation(t){const n=await this.sendAdminRequest("/api/admin/gateway/conversations","DELETE",{key:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Failed to clear conversation.",unauthorized:n.status===401,forbidden:n.status===403}}async addConversationTag(t,n){const r=await this.sendAdminRequest("/api/admin/gateway/conversations/tags","PUT",{action:"add",key:t,tag:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Failed to add tag.",unauthorized:r.status===401,forbidden:r.status===403}}async removeConversationTag(t,n){const r=await this.sendAdminRequest("/api/admin/gateway/conversations/tags","PUT",{action:"remove",key:t,tag:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Failed to remove tag.",unauthorized:r.status===401,forbidden:r.status===403}}async getAllConversationTags(){const t=await this.sendAdminRequest("/api/admin/gateway/conversations/tags","PUT",{action:"getAllTags"});if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?{ok:!0,tags:n.tags}:{ok:!1,error:n.error||"Failed to load tags.",unauthorized:t.status===401,forbidden:t.status===403}}async exportGatewayConversations(t){var n,r,a;try{const s=rn(),o=await fetch(`${this.baseUrl}/api/admin/gateway/conversations/export`,{method:"POST",headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{}},body:JSON.stringify({keys:t}),signal:AbortSignal.timeout(3e4)});if(o.status===200&&((n=o.headers.get("content-type"))!=null&&n.includes("application/zip"))){const c=await o.blob(),u=URL.createObjectURL(c),d=document.createElement("a");return d.href=u,d.download=((a=(r=o.headers.get("content-disposition"))==null?void 0:r.match(/filename="(.+)"/))==null?void 0:a[1])||"conversations.zip",document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(u),{ok:!0}}return{ok:!1,error:(await o.json().catch(()=>({}))).error||"Export failed."}}catch(s){return{ok:!1,error:s instanceof Error?s.message:String(s)}}}async getContacts(){const t=await this.sendAdminRequest("/api/admin/contacts","GET");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?{ok:!0,contacts:n.contacts}:{ok:!1,error:n.error||"Failed to read contacts."}}async approveContact(t,n){return this.contactAction("approve",t,n)}async rejectContact(t,n){return this.contactAction("reject",t,n)}async deleteContact(t,n){return this.contactAction("delete",t,n)}async updateContact(t,n,r){const a=await this.sendAdminRequest("/api/admin/contacts","PUT",{action:"update",platform:t,id:n,...r});if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const s=a.data??{};return a.status===200&&s.ok?s:{ok:!1,error:s.error||"Update failed."}}async contactAction(t,n,r){const a=await this.sendAdminRequest("/api/admin/contacts","PUT",{action:t,platform:n,nameOrId:r});if(!a)return{ok:!1,error:"Could not reach the dashboard server."};const s=a.data??{};return a.status===200&&s.ok?s:{ok:!1,error:s.error||`${t} failed.`}}async getPlatformConfigs(){const t=await this.sendAdminRequest("/api/config/platforms","GET");if(!t)return[];const n=t.data??{};return Array.isArray(n.platforms)?n.platforms:[]}async setPlatformConfig(t,n){const r=await this.sendAdminRequest(`/api/config/platforms/${encodeURIComponent(t)}`,"POST",{values:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok?a:{ok:!1,error:a.error||"Save failed.",unauthorized:r.status===401,forbidden:r.status===403}}async removePlatformConfig(t){const n=await this.sendAdminRequest(`/api/config/platforms/${encodeURIComponent(t)}`,"DELETE");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Remove failed.",unauthorized:n.status===401,forbidden:n.status===403}}async verifyPlatformConfig(t,n){const r=await this.sendAdminRequest(`/api/config/platforms/${encodeURIComponent(t)}/verify`,"POST",{values:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return{ok:a.ok??!1,info:a.info,error:a.error}}async saveAdminQuota(t){const n=await this.sendAdminRequest("/api/admin/quota","PUT",t);if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Save failed.",unauthorized:n.status===401}}async getBedrockStatus(){const t=await this.sendAdminRequest("/api/bedrock/status","GET");return!t||t.status!==200?{configured:!1,region:"us-east-1",authMethod:"none",apiKeySet:!1,iamKeySet:!1}:t.data??{}}async setupBedrock(t){const n=await this.sendAdminRequest("/api/bedrock/setup","POST",{envVars:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0,envVarsWritten:r.envVarsWritten}:{ok:!1,error:r.error||"Save failed."}}async probeBedrock(t){const n=await this.sendAdminRequest("/api/bedrock/probe","POST",{region:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0,models:r.models}:{ok:!1,error:r.error||"Probe failed."}}async listTasks(){const t=await this.sendAdminRequest("/api/tasks","GET");if(!t)return null;const n=t.data??{};return{status:t.status,tasks:Array.isArray(n.tasks)?n.tasks:[]}}async startTask(t,n){const r=await this.sendAdminRequest("/api/tasks","POST",{args:t,timeoutMs:n});if(!r)return{ok:!1,error:"Could not reach the dashboard server."};const a=r.data??{};return r.status===200&&a.ok&&a.task?a:{ok:!1,error:a.error||"Start failed.",unauthorized:r.status===401,forbidden:r.status===403}}async getTask(t){const n=await this.sendAdminRequest(`/api/tasks/${encodeURIComponent(t)}`,"GET");if(!n)return null;const r=n.data??{};return{status:n.status,task:r.task??null}}async cancelTask(t){const n=await this.sendAdminRequest(`/api/tasks/${encodeURIComponent(t)}/cancel`,"POST");if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Cancel failed.",unauthorized:n.status===401,forbidden:n.status===403}}subscribeTask(t,n){const r=rn(),a=new EventSource(`${this.baseUrl}/api/tasks/${encodeURIComponent(t)}/events?token=${encodeURIComponent(r??"")}`);return a.addEventListener("log",s=>{var o;try{(o=n.onLog)==null||o.call(n,JSON.parse(s.data))}catch{}}),a.addEventListener("status",s=>{var o;try{const l=JSON.parse(s.data);l.status&&((o=n.onStatus)==null||o.call(n,l.status))}catch{}}),()=>a.close()}async getWhatsAppStatus(){const t=await this.sendAdminRequest("/api/whatsapp","GET");if(!t)return null;const n=t.data??{};return t.status===200&&n.ok&&n.status?{status:n.status,contacts:n.contacts??{}}:null}async startWhatsAppPair(t){const n=await this.sendAdminRequest("/api/whatsapp/pair","POST",{phone:t||void 0});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?r:{ok:!1,error:r.error||"Pairing failed to start.",unauthorized:n.status===401,forbidden:n.status===403}}async cancelWhatsAppPair(){const t=await this.sendAdminRequest("/api/whatsapp/cancel","POST");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?n:{ok:!1,error:n.error||"Cancel failed.",unauthorized:t.status===401,forbidden:t.status===403}}async unpairWhatsApp(){const t=await this.sendAdminRequest("/api/whatsapp/unpair","POST");if(!t)return{ok:!1,error:"Could not reach the dashboard server."};const n=t.data??{};return t.status===200&&n.ok?n:{ok:!1,error:n.error||"Unpair failed.",unauthorized:t.status===401,forbidden:t.status===403}}subscribeWhatsApp(t){const n=rn(),r=new EventSource(`${this.baseUrl}/api/whatsapp/events?token=${encodeURIComponent(n??"")}`);return r.addEventListener("qr",a=>{var s;try{const o=JSON.parse(a.data);o.qr&&((s=t.onQr)==null||s.call(t,o.qr))}catch{}}),r.addEventListener("code",a=>{var s;try{const o=JSON.parse(a.data);o.code&&((s=t.onCode)==null||s.call(t,o.code))}catch{}}),r.addEventListener("status",a=>{var s;try{(s=t.onStatus)==null||s.call(t,JSON.parse(a.data))}catch{}}),()=>r.close()}async chatResolve(t){const n=rn();try{const r=await fetch(`${this.baseUrl}/api/chat/resolve`,{method:"POST",headers:{"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:{}},body:JSON.stringify({message:t}),signal:AbortSignal.timeout(1e4)}),a=await r.json();return r.status===200&&a.ok&&Array.isArray(a.matches)?{ok:!0,matches:a.matches}:{ok:!1,matches:[],error:typeof a.error=="string"?a.error:"Resolve failed."}}catch{return{ok:!1,matches:[],error:"Could not reach the dashboard server."}}}async listProjects(){const t=rn();try{const n=await fetch(`${this.baseUrl}/api/projects`,{headers:t?{Authorization:`Bearer ${t}`}:{},signal:AbortSignal.timeout(1e4)}),r=await n.json();return n.status===200&&r.ok&&Array.isArray(r.projects)?r.projects:[]}catch{return[]}}async attachProject(t){const n=rn();try{const r=await fetch(`${this.baseUrl}/api/projects/attach`,{method:"POST",headers:{"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:{}},body:JSON.stringify({path:t}),signal:AbortSignal.timeout(3e4)}),a=await r.json();return r.status===200&&a.ok&&a.project?{ok:!0,project:a.project}:{ok:!1,error:typeof a.error=="string"?a.error:"Attach failed."}}catch{return{ok:!1,error:"Could not reach the dashboard server."}}}async browseDirectories(t,n){const r=rn();try{const a=new URLSearchParams;t&&a.set("path",t),n!=null&&n.showDrives&&a.set("showDrives","1");const s=a.toString()?`?${a.toString()}`:"",o=await fetch(`${this.baseUrl}/api/browse${s}`,{headers:r?{Authorization:`Bearer ${r}`}:{},signal:AbortSignal.timeout(1e4)}),l=await o.json();return o.status===200&&l.ok&&Array.isArray(l.entries)?{ok:!0,path:l.path??"",entries:l.entries,parent:l.parent??null,isProject:l.isProject??!1,drives:l.drives,breadcrumbs:l.breadcrumbs}:{ok:!1,path:"",entries:[],parent:null,isProject:!1,error:typeof l.error=="string"?l.error:"Browse failed."}}catch{return{ok:!1,path:"",entries:[],parent:null,isProject:!1,error:"Could not reach the dashboard server."}}}async resolveFolder(t,n){const r=rn();try{const a=await fetch(this.baseUrl+"/api/browse/resolve-folder",{method:"POST",headers:{"Content-Type":"application/json",...r?{Authorization:"Bearer "+r}:{}},body:JSON.stringify({name:t,subPath:n||""}),signal:AbortSignal.timeout(1e4)}),s=await a.json();return a.status===200&&s.ok&&s.path?{ok:!0,path:s.path}:{ok:!1,path:"",error:typeof s.error=="string"?s.error:"Could not resolve folder."}}catch{return{ok:!1,path:"",error:"Could not reach the dashboard server."}}}async listChatSessions(){const t=rn();try{const n=await fetch(`${this.baseUrl}/api/sessions`,{headers:t?{Authorization:`Bearer ${t}`}:{},signal:AbortSignal.timeout(1e4)}),r=await n.json();return n.status===200&&r.ok&&Array.isArray(r.sessions)?r.sessions:[]}catch{return[]}}async deleteChatSession(t){const n=rn();try{const r=await fetch(`${this.baseUrl}/api/sessions/${encodeURIComponent(t)}`,{method:"DELETE",headers:n?{Authorization:`Bearer ${n}`}:{},signal:AbortSignal.timeout(1e4)}),a=await r.json();return r.status===200&&a.ok?{ok:!0}:{ok:!1,error:a.error||"Could not delete the session."}}catch{return{ok:!1,error:"Network error โ€” could not delete the session."}}}async renameChatSession(t,n){const r=rn();try{const a=await fetch(`${this.baseUrl}/api/sessions/${encodeURIComponent(t)}/rename`,{method:"POST",headers:{"Content-Type":"application/json",...r?{Authorization:`Bearer ${r}`}:{}},body:JSON.stringify({title:n}),signal:AbortSignal.timeout(1e4)}),s=await a.json();return a.status===200&&s.ok?{ok:!0}:{ok:!1,error:s.error||"Could not rename the session."}}catch{return{ok:!1,error:"Network error โ€” could not rename the session."}}}async getChatSession(t){const n=rn();try{const r=await fetch(`${this.baseUrl}/api/sessions/${encodeURIComponent(t)}`,{headers:n?{Authorization:`Bearer ${n}`}:{},signal:AbortSignal.timeout(1e4)}),a=await r.json();return r.status===200&&a.ok&&a.session?a.session:null}catch{return null}}async chatSend(t,n,r,a){const s=rn();try{const o=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{}},body:JSON.stringify({sessionId:t,message:n,provider:r==null?void 0:r.provider,model:r==null?void 0:r.model,projectPath:r==null?void 0:r.projectPath,attachments:r==null?void 0:r.attachments,...(r==null?void 0:r.worktree)===void 0?{}:{worktree:r.worktree},...(r==null?void 0:r.keepWorktree)===void 0?{}:{keepWorktree:r.keepWorktree},...(r==null?void 0:r.resume)===void 0?{}:{resume:r.resume}}),signal:a?AbortSignal.any([AbortSignal.timeout(3e5),a]):AbortSignal.timeout(3e5)}),l=await o.json();return o.status===200&&l.ok?{ok:!0,content:typeof l.content=="string"?l.content:"",followups:Array.isArray(l.followups)?l.followups:[],provider:typeof l.provider=="string"?l.provider:null,model:typeof l.model=="string"?l.model:null,generationFailed:l.generationFailed===!0,retryQueued:l.retryQueued===!0,...l.refused===!0?{refused:!0}:{},...T2(l.worktree)?{worktree:l.worktree}:{},...O2(l.resume)?{resume:l.resume}:{},...Array.isArray(l.findings)?{findings:l.findings}:{}}:{ok:!1,error:typeof l.error=="string"?l.error:"The agent could not answer.",unauthorized:o.status===401,forbidden:o.status===403}}catch{return{ok:!1,error:"Could not reach the dashboard server, or the turn timed out."}}}async chatReset(t){const n=await this.sendAdminRequest("/api/chat/reset","POST",{sessionId:t});if(!n)return{ok:!1,error:"Could not reach the dashboard server."};const r=n.data??{};return n.status===200&&r.ok?{ok:!0}:{ok:!1,error:r.error||"Reset failed."}}async chatSupportBundle(t){var r,a,s;const n=rn();try{const o=await fetch(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/support-bundle`,{method:"GET",headers:{...n?{Authorization:`Bearer ${n}`}:{}},signal:AbortSignal.timeout(3e4)});if(o.status===200&&((r=o.headers.get("content-type"))!=null&&r.includes("application/zip"))){const c=await o.blob(),u=URL.createObjectURL(c),d=document.createElement("a");return d.href=u,d.download=((s=(a=o.headers.get("content-disposition"))==null?void 0:a.match(/filename="(.+)"/))==null?void 0:s[1])||"nuvira-support.zip",document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(u),{ok:!0}}return{ok:!1,error:(await o.json().catch(()=>({}))).error||"Could not build the support bundle."}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"Could not reach the dashboard server."}}}subscribeChat(t,n){const r=rn(),a=new EventSource(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/events?token=${encodeURIComponent(r??"")}`);return a.addEventListener("progress",s=>{var o;try{const l=JSON.parse(s.data);l.line&&((o=n.onProgress)==null||o.call(n,l.line))}catch{}}),a.addEventListener("status",s=>{var o;try{const l=JSON.parse(s.data);l.status&&((o=n.onStatus)==null||o.call(n,l.status))}catch{}}),a.addEventListener("token",s=>{var o;try{const l=JSON.parse(s.data);typeof l.text=="string"&&l.text.length>0&&((o=n.onToken)==null||o.call(n,l.text))}catch{}}),a.addEventListener("tool",s=>{var o;try{const l=JSON.parse(s.data);l.tool&&(l.phase==="started"||l.phase==="called")&&((o=n.onTool)==null||o.call(n,{id:l.id||`call_${Math.random().toString(36).slice(2,8)}`,tool:l.tool,phase:l.phase,args:l.args,ok:l.ok,result:l.result,error:l.error,durationMs:l.durationMs}))}catch{}}),a.addEventListener("plan",s=>{var o;try{const l=JSON.parse(s.data);l.goal&&Array.isArray(l.steps)&&((o=n.onPlan)==null||o.call(n,{goal:l.goal,steps:l.steps,revision:l.revision??0}))}catch{}}),a.addEventListener("diff",s=>{var o;try{const l=JSON.parse(s.data);Array.isArray(l.files)&&((o=n.onDiff)==null||o.call(n,{files:l.files,summary:l.summary??""}))}catch{}}),a.addEventListener("finding",s=>{var o;try{const c=JSON.parse(s.data).finding;c&&typeof c.claim=="string"&&(c.verdict==="CONFIRMED"||c.verdict==="PLAUSIBLE")&&((o=n.onFinding)==null||o.call(n,{claim:c.claim,verdict:c.verdict,outcome:typeof c.outcome=="string"?c.outcome:"",evidence:Array.isArray(c.evidence)?c.evidence:[],source:typeof c.source=="string"?c.source:""}))}catch{}}),a.addEventListener("skill_draft",s=>{var o;try{const l=JSON.parse(s.data);l.name&&l.markdown&&((o=n.onSkillDraft)==null||o.call(n,{name:l.name,description:l.description??"",markdown:l.markdown,updatedAt:l.updatedAt??0}))}catch{}}),a.addEventListener("secret_request",s=>{var o;try{const l=JSON.parse(s.data);l.skillName&&Array.isArray(l.missing)&&((o=n.onSecretRequest)==null||o.call(n,{skillName:l.skillName,missing:l.missing,persisted:l.persisted??{}}))}catch{}}),a.addEventListener("execution_result",s=>{var o;try{const l=JSON.parse(s.data);l.skillName&&l.runtime!==void 0&&((o=n.onExecutionResult)==null||o.call(n,{skillName:l.skillName,runtime:l.runtime,success:l.success??!1,durationMs:l.durationMs??0,exitCode:l.exitCode??0,stdout:l.stdout??"",stderr:l.stderr??"",timestamp:l.timestamp??Date.now()}))}catch{}}),a.addEventListener("question",s=>{var o;try{const l=JSON.parse(s.data);l.questionId&&l.question&&((o=n.onQuestion)==null||o.call(n,{questionId:l.questionId,question:l.question,choices:l.choices??[],multiSelect:l.multiSelect===!0}))}catch{}}),()=>a.close()}async chatRespond(t,n,r={}){try{const s=await(await fetch(`${this.baseUrl}/api/chat/${encodeURIComponent(t)}/respond`,{method:"POST",headers:{"Content-Type":"application/json",...En()},body:JSON.stringify({questionId:n,...r})})).json();return{ok:s.ok===!0,error:s.error}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async skillDraftAccept(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/drafts/${encodeURIComponent(t)}/accept`,{method:"POST",headers:{...En()}})).json();return{ok:r.ok===!0,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async skillDraftReject(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/drafts/${encodeURIComponent(t)}`,{method:"DELETE",headers:{...En()}})).json();return{ok:r.ok===!0,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async saveSecrets(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/secrets`,{method:"POST",headers:{"Content-Type":"application/json",...En()},body:JSON.stringify({vars:t})})).json();return{ok:r.ok===!0,error:r.error,saved:r.saved,refused:r.refused}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async fetchSkillEnv(){try{const t=await fetch(`${this.baseUrl}/api/skills/env`,{headers:{...En()}}),n=await fr(t);return(n==null?void 0:n.vars)??[]}catch{return[]}}async deleteSkillEnvVar(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/env/delete`,{method:"POST",headers:{"Content-Type":"application/json",...En()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,removed:r.removed,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async testSkillEnvVar(t){try{const r=await(await fetch(`${this.baseUrl}/api/skills/env/test`,{method:"POST",headers:{"Content-Type":"application/json",...En()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,usable:r.usable,detail:r.detail,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}async fetchProcessEnv(){try{const t=await fetch(`${this.baseUrl}/api/process-env`,{headers:{...En()}}),n=await fr(t);return(n==null?void 0:n.vars)??[]}catch{return[]}}async fetchVerifyBacklog(){try{const t=await fetch(`${this.baseUrl}/api/models/verify-next`,{headers:{...En()}});return await fr(t)}catch{return null}}async startVerifyBacklog(t){try{const n=await fetch(`${this.baseUrl}/api/models/verify-next`,{method:"POST",headers:{"Content-Type":"application/json",...En()},body:JSON.stringify({count:t})}),r=await fr(n);return r?{ok:r.ok===!0,error:r.error,refusal:r.refusal,state:r.state}:{ok:!1,error:"The dashboard server did not respond."}}catch(n){return{ok:!1,error:n instanceof Error?n.message:"Could not start the run."}}}async saveProcessEnvVar(t,n){try{const a=await(await fetch(`${this.baseUrl}/api/process-env`,{method:"POST",headers:{"Content-Type":"application/json",...En()},body:JSON.stringify({name:t,value:n})})).json();return{ok:a.ok===!0,row:a.row,error:a.error,reason:a.reason}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}async deleteProcessEnvVar(t){try{const r=await(await fetch(`${this.baseUrl}/api/process-env/delete`,{method:"POST",headers:{"Content-Type":"application/json",...En()},body:JSON.stringify({name:t})})).json();return{ok:r.ok===!0,removed:r.removed,row:r.row,error:r.error}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}}const Q=new M2,Ox=["enterprise","neutral","pastel","executive","contrast"],Px=["light","dark"],Rx=[100,112,125,150],US={enterprise:"Enterprise",neutral:"Neutral",pastel:"Pastel",executive:"Executive",contrast:"High contrast"},dT="nuvira.dashboard.theme",WS={palette:"enterprise",mode:"dark",a11y:!1,fontScale:100};function ko(e,t){return e.includes(t)}function I2(){return typeof window>"u"||typeof window.matchMedia!="function"?null:window.matchMedia("(prefers-color-scheme: dark)").matches}function fT(){const e=I2();return e===null?{...WS}:{...WS,mode:e?"dark":"light"}}function hT(){const e=fT();if(typeof localStorage>"u")return e;let t;try{const a=localStorage.getItem(dT);if(!a)return e;t=JSON.parse(a)}catch{return e}if(typeof t!="object"||t===null)return e;const n=t,r=ko(Rx,n.fontScale)?n.fontScale:e.fontScale;return{palette:ko(Ox,n.palette)?n.palette:e.palette,mode:ko(Px,n.mode)?n.mode:e.mode,a11y:typeof n.a11y=="boolean"?n.a11y:e.a11y,fontScale:r}}function pT(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(dT,JSON.stringify(e))}catch{}}function Mx(e,t){const n=typeof document<"u"?document.documentElement:void 0;n&&(n.setAttribute("data-palette",e.palette),n.setAttribute("data-mode",e.mode),n.setAttribute("data-a11y",e.a11y?"on":"off"),n.setAttribute("data-font-scale",String(e.fontScale)),n.style.colorScheme=e.mode)}function $2(e,t){const n={palette:ko(Ox,t.palette)?t.palette:e.palette,mode:ko(Px,t.mode)?t.mode:e.mode,a11y:t.a11y??e.a11y,fontScale:ko(Rx,t.fontScale)?t.fontScale:e.fontScale};return n.a11y||(n.fontScale=100),n}let hr=hT();const Vv=new Set;function mT(){for(const e of Vv)e()}function L2(e){return Vv.add(e),()=>{Vv.delete(e)}}function HS(){return hr}function Sd(e){const t=$2(hr,e);t.palette===hr.palette&&t.mode===hr.mode&&t.a11y===hr.a11y&&t.fontScale===hr.fontScale||(hr=t,Mx(hr),pT(hr),mT())}function D2(){hr=fT(),Mx(hr),pT(hr),mT()}function B2(){return k.useSyncExternalStore(L2,HS,HS)}const GS={light:"Light",dark:"Dark"},qS={100:"100%",112:"112%",125:"125%",150:"150%"};function z2(){const e=B2(),[t,n]=k.useState(!1),r=k.useRef(null),a=k.useRef(null),s=k.useRef(null),o=k.useId(),l=`${o}-panel`;k.useEffect(()=>{if(!t)return;function u(f){var h;f.key==="Escape"&&(n(!1),(h=r.current)==null||h.focus())}function d(f){var p;const h=f.target;h&&((p=s.current)!=null&&p.contains(h))||n(!1)}return document.addEventListener("keydown",u),document.addEventListener("pointerdown",d),()=>{document.removeEventListener("keydown",u),document.removeEventListener("pointerdown",d)}},[t]),k.useEffect(()=>{var d,f,h;if(!t)return;(h=((d=a.current)==null?void 0:d.querySelector("input:checked"))??((f=a.current)==null?void 0:f.querySelector("input")))==null||h.focus()},[t]);const c=`${US[e.palette]} palette, ${GS[e.mode].toLowerCase()} mode, text size ${qS[e.fontScale]}`+(e.a11y?", accessibility mode on":"");return i.jsxs("div",{className:"theme-switcher",ref:s,onBlur:u=>{u.currentTarget.contains(u.relatedTarget)||n(!1)},children:[i.jsxs("button",{type:"button",ref:r,className:"theme-trigger","aria-expanded":t,"aria-controls":t?l:void 0,onClick:()=>n(u=>!u),children:[i.jsx("span",{"aria-hidden":"true",children:"๐ŸŽจ"}),i.jsx("span",{children:"Appearance"})]}),t&&i.jsxs("div",{className:"theme-panel",id:l,ref:a,children:[i.jsxs("fieldset",{className:"theme-group",children:[i.jsx("legend",{className:"theme-group-label",children:"Palette"}),Ox.map(u=>i.jsxs("label",{className:"theme-option",children:[i.jsx("input",{type:"radio",name:`${o}-palette`,value:u,checked:e.palette===u,onChange:()=>Sd({palette:u})}),i.jsx("span",{className:"theme-swatch","data-swatch":u,"aria-hidden":"true"}),i.jsx("span",{className:"theme-option-label",children:US[u]})]},u))]}),i.jsxs("fieldset",{className:"theme-group",children:[i.jsx("legend",{className:"theme-group-label",children:"Mode"}),Px.map(u=>i.jsxs("label",{className:"theme-option",children:[i.jsx("input",{type:"radio",name:`${o}-mode`,value:u,checked:e.mode===u,onChange:()=>Sd({mode:u})}),i.jsx("span",{className:"theme-option-label",children:GS[u]})]},u))]}),i.jsxs("fieldset",{className:"theme-group",children:[i.jsx("legend",{className:"theme-group-label",children:"Text size"}),Rx.map(u=>i.jsxs("label",{className:"theme-option",children:[i.jsx("input",{type:"radio",name:`${o}-scale`,value:u,checked:e.fontScale===u,onChange:()=>Sd({fontScale:u,a11y:e.a11y||u!==100})}),i.jsx("span",{className:"theme-option-label",children:qS[u]})]},u)),!e.a11y&&i.jsx("p",{className:"theme-hint",children:"A larger size turns on accessibility mode, which is what defines it."})]}),i.jsxs("div",{className:"theme-group",children:[i.jsxs("label",{className:"theme-switch",children:[i.jsx("input",{type:"checkbox",checked:e.a11y,onChange:u=>Sd({a11y:u.target.checked})}),i.jsx("span",{className:"theme-switch-track","aria-hidden":"true"}),i.jsx("span",{className:"theme-option-label",children:"Accessibility mode"})]}),i.jsx("p",{className:"theme-hint",children:"Larger targets, stronger borders and no motion. Off by default so it never changes the look for anyone who does not need it."})]}),i.jsx("button",{type:"button",className:"theme-reset",onClick:D2,children:"Reset to system default"}),i.jsx("p",{className:"sr-only",role:"status",children:c})]})]})}const F2=[{group:"General",items:[{keys:["?"],description:"Show this help"},{keys:["Esc"],description:"Close a dialog or panel"},{keys:["g","c"],description:"Go to Chat"},{keys:["g","o"],description:"Go to Overview"},{keys:["g","t"],description:"Go to Tasks"},{keys:["g","m"],description:"Go to Models"},{keys:["g","s"],description:"Go to System"},{keys:["g","h"],description:"Go to Agent Hub"}]},{group:"Navigation",items:[{keys:["/"],description:"Focus the navigation filter"},{keys:["["],description:"Collapse / expand the navigation drawer"}]}],U2={c:"/",o:"/overview",t:"/tasks",m:"/models",s:"/system",h:"/hub"};function W2(e){var a;const t=e;if(!t||typeof t.tagName!="string")return!1;if(t.isContentEditable)return!0;const n=(a=t.getAttribute)==null?void 0:a.call(t,"contenteditable");if(n!=null&&n!=="false")return!0;const r=t.tagName.toLowerCase();return r==="input"||r==="textarea"||r==="select"}function H2({open:e,onClose:t}){const n=k.useId(),r=k.useRef(null),a=k.useRef(null);return k.useEffect(()=>{var l;if(!e)return;a.current=document.activeElement;const s=()=>{var c;return Array.from(((c=r.current)==null?void 0:c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))??[])};(l=s()[0])==null||l.focus();function o(c){if(c.key==="Escape"){c.stopPropagation(),t();return}if(c.key!=="Tab")return;const u=s();if(u.length===0)return;const d=u[0],f=u[u.length-1];c.shiftKey&&document.activeElement===d?(c.preventDefault(),f.focus()):!c.shiftKey&&document.activeElement===f&&(c.preventDefault(),d.focus())}return document.addEventListener("keydown",o),()=>{var c;document.removeEventListener("keydown",o),(c=a.current)==null||c.focus()}},[e,t]),e?i.jsx("div",{className:"modal-scrim",onClick:t,children:i.jsxs("div",{className:"shortcuts-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,ref:r,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:"shortcuts-head",children:[i.jsx("h2",{className:"shortcuts-title",id:n,children:"โŒจ๏ธ Keyboard shortcuts"}),i.jsx("button",{type:"button",className:"btn-secondary",onClick:t,"aria-label":"Close keyboard shortcuts",children:"โœ• Close"})]}),F2.map(s=>i.jsxs("section",{className:"shortcuts-group",children:[i.jsx("h3",{className:"shortcuts-group-title",children:s.group}),i.jsx("dl",{className:"shortcuts-list",children:s.items.map(o=>i.jsxs("div",{className:"shortcuts-row",children:[i.jsx("dt",{className:"shortcuts-keys",children:o.keys.map(l=>i.jsx("kbd",{className:"shortcuts-key",children:l},l))}),i.jsx("dd",{className:"shortcuts-description",children:o.description})]},o.description))})]},s.group)),i.jsxs("p",{className:"shortcuts-note",children:["Shortcuts are ignored while you are typing, so ",i.jsx("kbd",{className:"shortcuts-key",children:"?"})," in a question stays a question mark."]})]})}):null}const G2=[{path:"/overview",label:"Overview",icon:"๐Ÿ“Š"},{path:"/tasks",label:"Tasks",icon:"๐Ÿš€"},{path:"/models",label:"Models",icon:"๐Ÿง "},{path:"/system",label:"System",icon:"โš™๏ธ"}],KS=[{label:"Agent Management",items:[{path:"/",label:"Chat",icon:"๐Ÿ’ฌ"},{path:"/dag",label:"Execution",icon:"๐Ÿ”€"},{path:"/routing",label:"Routing",icon:"๐Ÿค–"},{path:"/requests",label:"Requests",icon:"๐Ÿ“จ"},{path:"/hub",label:"Agent Hub",icon:"๐Ÿงฐ"}]},{label:"Analysis & Monitoring",items:[{path:"/traces",label:"Traces",icon:"๐Ÿ”"},{path:"/evals",label:"Evals",icon:"๐Ÿ†"},{path:"/benchmarks",label:"Benchmarks",icon:"๐Ÿ“ˆ"},{path:"/costs",label:"Costs",icon:"๐Ÿ’ฐ"}]},{label:"Resources",items:[{path:"/memory",label:"Memory",icon:"๐Ÿ’พ"},{path:"/history",label:"History",icon:"๐Ÿ“"},{path:"/env",label:"Env Config",icon:"๐Ÿ”"},{path:"/process-env",label:"Process Env",icon:"๐ŸŒฑ"}]},{label:"Integrations",items:[{path:"/platforms",label:"Platforms",icon:"๐ŸŒ"},{path:"/gateway",label:"Gateway",icon:"๐Ÿ“ก"},{path:"/contacts",label:"Contacts",icon:"๐Ÿ“‡"},{path:"/bedrock",label:"Bedrock",icon:"๐Ÿชจ"}]},{label:"Runtime",items:[{path:"/models/timeline",label:"Timeline",icon:"๐Ÿ“…"},{path:"/executions",label:"Executions",icon:"๐Ÿ“œ"},{path:"/admin",label:"Admin",icon:"๐Ÿ› ๏ธ"}]}];function q2(e){const t=e.trim().toLowerCase();return t?KS.map(n=>n.label.toLowerCase().includes(t)?n:{...n,items:n.items.filter(r=>r.label.toLowerCase().includes(t))}).filter(n=>n.items.length>0):KS}function K2({children:e,connected:t,lastUpdated:n,onRefresh:r,refreshing:a=!1}){const[s,o]=k.useState(!1),[l,c]=k.useState(""),[u,d]=k.useState(!1),f=k.useRef(null),h=k.useRef(null),p=k.useRef(0),g=k.useId(),m=ks(),y=Tx(),v=t?"connected":"reconnecting",b=t?"Connected":"Reconnecting...",w=q2(l),N=()=>o(!1);return k.useEffect(()=>{function S(x){var E,j;if(!(x.metaKey||x.ctrlKey||x.altKey)&&!W2(x.target)){if(x.key==="Escape"){if(u)return;s&&(o(!1),(E=f.current)==null||E.focus());return}if(x.key==="?"){x.preventDefault(),d(!0);return}if(x.key==="/"){x.preventDefault(),(j=h.current)==null||j.focus();return}if(x.key==="["){x.preventDefault(),o(C=>!C);return}if(x.key==="g"){p.current=Date.now();return}if(Date.now()-p.current<1500){const C=U2[x.key.toLowerCase()];p.current=0,C&&(x.preventDefault(),y(C))}}}return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[s,u,y]),k.useEffect(()=>{var S;s&&((S=h.current)==null||S.focus())},[s]),k.useEffect(()=>{N()},[m.pathname]),i.jsxs("div",{className:"layout",children:[i.jsxs("header",{className:"topbar",children:[i.jsx("button",{type:"button",ref:f,className:"topbar-menu","aria-label":"Toggle navigation","aria-controls":"app-nav","aria-expanded":s,onClick:()=>o(S=>!S),children:i.jsx("span",{"aria-hidden":"true",children:"โ˜ฐ"})}),i.jsxs("div",{className:"topbar-brand",children:[i.jsx("span",{className:"topbar-logo","aria-hidden":"true",children:"๐Ÿค–"}),i.jsx("span",{className:"topbar-title",children:"Agent-Nuvira"})]}),i.jsx("nav",{className:"primary-nav","aria-label":"Primary",children:G2.map(S=>i.jsxs(zS,{to:S.path,end:!0,className:({isActive:x})=>`primary-link${x?" active":""}`,children:[i.jsx("span",{"aria-hidden":"true",children:S.icon})," ",S.label]},S.path))}),i.jsxs("div",{className:"topbar-actions",children:[i.jsxs("button",{type:"button",className:"topbar-action",onClick:r,disabled:a,"aria-busy":a,children:[i.jsx("span",{"aria-hidden":"true",children:"โŸณ"})," ",a?"Refreshingโ€ฆ":"Refresh"]}),i.jsxs("button",{type:"button",className:"topbar-action","aria-haspopup":"dialog","aria-expanded":u,onClick:()=>d(!0),children:[i.jsx("span",{"aria-hidden":"true",children:"โŒจ๏ธ"})," Shortcuts"]}),i.jsx(z2,{})]})]}),i.jsxs("div",{className:"layout-body",children:[s&&i.jsx("div",{className:"nav-scrim",onClick:N,"aria-hidden":"true"}),i.jsxs("nav",{className:`nav${s?" open":""}`,id:"app-nav","aria-label":"Sections",children:[i.jsxs("div",{className:"nav-search",children:[i.jsx("label",{className:"sr-only",htmlFor:g,children:"Filter navigation"}),i.jsx("input",{id:g,ref:h,type:"search",className:"nav-search-input",placeholder:"Search",value:l,onChange:S=>c(S.target.value)})]}),i.jsxs("div",{className:"nav-links",children:[w.map(S=>i.jsxs("section",{className:"nav-group",children:[i.jsx("h2",{className:"nav-group-title",children:S.label}),S.items.map(x=>i.jsxs(zS,{to:x.path,end:x.path==="/",className:({isActive:E})=>`nav-link${E?" active":""}`,children:[i.jsx("span",{className:"nav-icon","aria-hidden":"true",children:x.icon}),x.label]},x.path))]},S.label)),w.length===0&&i.jsxs("p",{className:"nav-empty",children:["No sections match โ€œ",l,"โ€."]})]}),i.jsxs("div",{className:"nav-footer",children:[i.jsx("span",{className:`status-dot ${v}`}),i.jsx("span",{className:"status-text",children:b}),i.jsx("span",{className:"last-updated",children:n})]})]}),i.jsx("main",{className:"main",children:e})]}),i.jsx(H2,{open:u,onClose:()=>d(!1)})]})}function gT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=gT(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ye(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=gT(e))&&(r&&(r+=" "),r+=t);return r}var V2=Array.isArray,Un=V2,Y2=typeof Ja=="object"&&Ja&&Ja.Object===Object&&Ja,vT=Y2,X2=vT,Z2=typeof self=="object"&&self&&self.Object===Object&&self,Q2=X2||Z2||Function("return this")(),ca=Q2,J2=ca,eB=J2.Symbol,Lu=eB,VS=Lu,yT=Object.prototype,tB=yT.hasOwnProperty,nB=yT.toString,Wl=VS?VS.toStringTag:void 0;function rB(e){var t=tB.call(e,Wl),n=e[Wl];try{e[Wl]=void 0;var r=!0}catch{}var a=nB.call(e);return r&&(t?e[Wl]=n:delete e[Wl]),a}var aB=rB,iB=Object.prototype,sB=iB.toString;function oB(e){return sB.call(e)}var lB=oB,YS=Lu,cB=aB,uB=lB,dB="[object Null]",fB="[object Undefined]",XS=YS?YS.toStringTag:void 0;function hB(e){return e==null?e===void 0?fB:dB:XS&&XS in Object(e)?cB(e):uB(e)}var Da=hB;function pB(e){return e!=null&&typeof e=="object"}var Ba=pB,mB=Da,gB=Ba,vB="[object Symbol]";function yB(e){return typeof e=="symbol"||gB(e)&&mB(e)==vB}var ul=yB,bB=Un,xB=ul,wB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,SB=/^\w*$/;function kB(e,t){if(bB(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||xB(e)?!0:SB.test(e)||!wB.test(e)||t!=null&&e in Object(t)}var Ix=kB;function NB(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ki=NB;const dl=Qe(ki);var EB=Da,jB=ki,_B="[object AsyncFunction]",AB="[object Function]",CB="[object GeneratorFunction]",TB="[object Proxy]";function OB(e){if(!jB(e))return!1;var t=EB(e);return t==AB||t==CB||t==_B||t==TB}var $x=OB;const De=Qe($x);var PB=ca,RB=PB["__core-js_shared__"],MB=RB,Gm=MB,ZS=function(){var e=/[^.]+$/.exec(Gm&&Gm.keys&&Gm.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function IB(e){return!!ZS&&ZS in e}var $B=IB,LB=Function.prototype,DB=LB.toString;function BB(e){if(e!=null){try{return DB.call(e)}catch{}try{return e+""}catch{}}return""}var bT=BB,zB=$x,FB=$B,UB=ki,WB=bT,HB=/[\\^$.*+?()[\]{}|]/g,GB=/^\[object .+?Constructor\]$/,qB=Function.prototype,KB=Object.prototype,VB=qB.toString,YB=KB.hasOwnProperty,XB=RegExp("^"+VB.call(YB).replace(HB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ZB(e){if(!UB(e)||FB(e))return!1;var t=zB(e)?XB:GB;return t.test(WB(e))}var QB=ZB;function JB(e,t){return e==null?void 0:e[t]}var ez=JB,tz=QB,nz=ez;function rz(e,t){var n=nz(e,t);return tz(n)?n:void 0}var Ns=rz,az=Ns,iz=az(Object,"create"),hp=iz,QS=hp;function sz(){this.__data__=QS?QS(null):{},this.size=0}var oz=sz;function lz(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var cz=lz,uz=hp,dz="__lodash_hash_undefined__",fz=Object.prototype,hz=fz.hasOwnProperty;function pz(e){var t=this.__data__;if(uz){var n=t[e];return n===dz?void 0:n}return hz.call(t,e)?t[e]:void 0}var mz=pz,gz=hp,vz=Object.prototype,yz=vz.hasOwnProperty;function bz(e){var t=this.__data__;return gz?t[e]!==void 0:yz.call(t,e)}var xz=bz,wz=hp,Sz="__lodash_hash_undefined__";function kz(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=wz&&t===void 0?Sz:t,this}var Nz=kz,Ez=oz,jz=cz,_z=mz,Az=xz,Cz=Nz;function fl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}fl.prototype.clear=Ez;fl.prototype.delete=jz;fl.prototype.get=_z;fl.prototype.has=Az;fl.prototype.set=Cz;var Tz=fl;function Oz(){this.__data__=[],this.size=0}var Pz=Oz;function Rz(e,t){return e===t||e!==e&&t!==t}var Lx=Rz,Mz=Lx;function Iz(e,t){for(var n=e.length;n--;)if(Mz(e[n][0],t))return n;return-1}var pp=Iz,$z=pp,Lz=Array.prototype,Dz=Lz.splice;function Bz(e){var t=this.__data__,n=$z(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Dz.call(t,n,1),--this.size,!0}var zz=Bz,Fz=pp;function Uz(e){var t=this.__data__,n=Fz(t,e);return n<0?void 0:t[n][1]}var Wz=Uz,Hz=pp;function Gz(e){return Hz(this.__data__,e)>-1}var qz=Gz,Kz=pp;function Vz(e,t){var n=this.__data__,r=Kz(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var Yz=Vz,Xz=Pz,Zz=zz,Qz=Wz,Jz=qz,eF=Yz;function hl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}hl.prototype.clear=Xz;hl.prototype.delete=Zz;hl.prototype.get=Qz;hl.prototype.has=Jz;hl.prototype.set=eF;var mp=hl,tF=Ns,nF=ca,rF=tF(nF,"Map"),Dx=rF,JS=Tz,aF=mp,iF=Dx;function sF(){this.size=0,this.__data__={hash:new JS,map:new(iF||aF),string:new JS}}var oF=sF;function lF(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var cF=lF,uF=cF;function dF(e,t){var n=e.__data__;return uF(t)?n[typeof t=="string"?"string":"hash"]:n.map}var gp=dF,fF=gp;function hF(e){var t=fF(this,e).delete(e);return this.size-=t?1:0,t}var pF=hF,mF=gp;function gF(e){return mF(this,e).get(e)}var vF=gF,yF=gp;function bF(e){return yF(this,e).has(e)}var xF=bF,wF=gp;function SF(e,t){var n=wF(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var kF=SF,NF=oF,EF=pF,jF=vF,_F=xF,AF=kF;function pl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pl.prototype.clear=NF;pl.prototype.delete=EF;pl.prototype.get=jF;pl.prototype.has=_F;pl.prototype.set=AF;var Bx=pl,xT=Bx,CF="Expected a function";function zx(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(CF);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],s=n.cache;if(s.has(a))return s.get(a);var o=e.apply(this,r);return n.cache=s.set(a,o)||s,o};return n.cache=new(zx.Cache||xT),n}zx.Cache=xT;var wT=zx;const TF=Qe(wT);var OF=wT,PF=500;function RF(e){var t=OF(e,function(r){return n.size===PF&&n.clear(),r}),n=t.cache;return t}var MF=RF,IF=MF,$F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,LF=/\\(\\)?/g,DF=IF(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace($F,function(n,r,a,s){t.push(a?s.replace(LF,"$1"):r||n)}),t}),BF=DF;function zF(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}var Fx=zF,ek=Lu,FF=Fx,UF=Un,WF=ul,tk=ek?ek.prototype:void 0,nk=tk?tk.toString:void 0;function ST(e){if(typeof e=="string")return e;if(UF(e))return FF(e,ST)+"";if(WF(e))return nk?nk.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var HF=ST,GF=HF;function qF(e){return e==null?"":GF(e)}var kT=qF,KF=Un,VF=Ix,YF=BF,XF=kT;function ZF(e,t){return KF(e)?e:VF(e,t)?[e]:YF(XF(e))}var NT=ZF,QF=ul;function JF(e){if(typeof e=="string"||QF(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var vp=JF,eU=NT,tU=vp;function nU(e,t){t=eU(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[tU(t[n++])];return n&&n==r?e:void 0}var Ux=nU,rU=Ux;function aU(e,t,n){var r=e==null?void 0:rU(e,t);return r===void 0?n:r}var ET=aU;const xr=Qe(ET);function iU(e){return e==null}var sU=iU;const Xe=Qe(sU);var oU=Da,lU=Un,cU=Ba,uU="[object String]";function dU(e){return typeof e=="string"||!lU(e)&&cU(e)&&oU(e)==uU}var fU=dU;const ms=Qe(fU);var jT={exports:{}},et={};/**
68
- * @license React
69
- * react-is.production.min.js
70
- *
71
- * Copyright (c) Facebook, Inc. and its affiliates.
72
- *
73
- * This source code is licensed under the MIT license found in the
74
- * LICENSE file in the root directory of this source tree.
75
- */var Wx=Symbol.for("react.element"),Hx=Symbol.for("react.portal"),yp=Symbol.for("react.fragment"),bp=Symbol.for("react.strict_mode"),xp=Symbol.for("react.profiler"),wp=Symbol.for("react.provider"),Sp=Symbol.for("react.context"),hU=Symbol.for("react.server_context"),kp=Symbol.for("react.forward_ref"),Np=Symbol.for("react.suspense"),Ep=Symbol.for("react.suspense_list"),jp=Symbol.for("react.memo"),_p=Symbol.for("react.lazy"),pU=Symbol.for("react.offscreen"),_T;_T=Symbol.for("react.module.reference");function Nr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Wx:switch(e=e.type,e){case yp:case xp:case bp:case Np:case Ep:return e;default:switch(e=e&&e.$$typeof,e){case hU:case Sp:case kp:case _p:case jp:case wp:return e;default:return t}}case Hx:return t}}}et.ContextConsumer=Sp;et.ContextProvider=wp;et.Element=Wx;et.ForwardRef=kp;et.Fragment=yp;et.Lazy=_p;et.Memo=jp;et.Portal=Hx;et.Profiler=xp;et.StrictMode=bp;et.Suspense=Np;et.SuspenseList=Ep;et.isAsyncMode=function(){return!1};et.isConcurrentMode=function(){return!1};et.isContextConsumer=function(e){return Nr(e)===Sp};et.isContextProvider=function(e){return Nr(e)===wp};et.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Wx};et.isForwardRef=function(e){return Nr(e)===kp};et.isFragment=function(e){return Nr(e)===yp};et.isLazy=function(e){return Nr(e)===_p};et.isMemo=function(e){return Nr(e)===jp};et.isPortal=function(e){return Nr(e)===Hx};et.isProfiler=function(e){return Nr(e)===xp};et.isStrictMode=function(e){return Nr(e)===bp};et.isSuspense=function(e){return Nr(e)===Np};et.isSuspenseList=function(e){return Nr(e)===Ep};et.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===yp||e===xp||e===bp||e===Np||e===Ep||e===pU||typeof e=="object"&&e!==null&&(e.$$typeof===_p||e.$$typeof===jp||e.$$typeof===wp||e.$$typeof===Sp||e.$$typeof===kp||e.$$typeof===_T||e.getModuleId!==void 0)};et.typeOf=Nr;jT.exports=et;var mU=jT.exports,gU=Da,vU=Ba,yU="[object Number]";function bU(e){return typeof e=="number"||vU(e)&&gU(e)==yU}var AT=bU;const xU=Qe(AT);var wU=AT;function SU(e){return wU(e)&&e!=+e}var kU=SU;const Du=Qe(kU);var $r=function(t){return t===0?0:t>0?1:-1},Zi=function(t){return ms(t)&&t.indexOf("%")===t.length-1},de=function(t){return xU(t)&&!Du(t)},NU=function(t){return Xe(t)},qt=function(t){return de(t)||ms(t)},EU=0,Ap=function(t){var n=++EU;return"".concat(t||"").concat(n)},gs=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!de(t)&&!ms(t))return r;var s;if(Zi(t)){var o=t.indexOf("%");s=n*parseFloat(t.slice(0,o))/100}else s=+t;return Du(s)&&(s=r),a&&s>n&&(s=n),s},Za=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},jU=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a<n;a++)if(!r[t[a]])r[t[a]]=!0;else return!0;return!1},Us=function(t,n){return de(t)&&de(n)?function(r){return t+r*(n-t)}:function(){return n}};function Yv(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):xr(r,t))===n})}var _U=function(t,n){return de(t)&&de(n)?t-n:ms(t)&&ms(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function No(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function Xv(e){"@babel/helpers - typeof";return Xv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xv(e)}var AU=["viewBox","children"],CU=["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"],rk=["points","pathLength"],qm={svg:AU,polygon:rk,polyline:rk},Gx=["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"],Bf=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(k.isValidElement(t)&&(r=t.props),!dl(r))return null;var a={};return Object.keys(r).forEach(function(s){Gx.includes(s)&&(a[s]=n||function(o){return r[s](r,o)})}),a},TU=function(t,n,r){return function(a){return t(n,r,a),null}},zf=function(t,n,r){if(!dl(t)||Xv(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(s){var o=t[s];Gx.includes(s)&&typeof o=="function"&&(a||(a={}),a[s]=TU(o,n,r))}),a},OU=["children"],PU=["children"];function ak(e,t){if(e==null)return{};var n=RU(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function RU(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ik={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ja=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},sk=null,Km=null,qx=function e(t){if(t===sk&&Array.isArray(Km))return Km;var n=[];return k.Children.forEach(t,function(r){Xe(r)||(mU.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Km=n,sk=t,n};function Br(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return ja(a)}):r=[ja(t)],qx(e).forEach(function(a){var s=xr(a,"type.displayName")||xr(a,"type.name");r.indexOf(s)!==-1&&n.push(a)}),n}function Jn(e,t){var n=Br(e,t);return n&&n[0]}var ok=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!de(r)||r<=0||!de(a)||a<=0)},MU=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],IU=function(t){return t&&t.type&&ms(t.type)&&MU.indexOf(t.type)>=0},$U=function(t,n,r,a){var s,o=(s=qm==null?void 0:qm[a])!==null&&s!==void 0?s:[];return n.startsWith("data-")||!De(t)&&(a&&o.includes(n)||CU.includes(n))||r&&Gx.includes(n)},Ve=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(k.isValidElement(t)&&(a=t.props),!dl(a))return null;var s={};return Object.keys(a).forEach(function(o){var l;$U((l=a)===null||l===void 0?void 0:l[o],o,n,r)&&(s[o]=a[o])}),s},Zv=function e(t,n){if(t===n)return!0;var r=k.Children.count(t);if(r!==k.Children.count(n))return!1;if(r===0)return!0;if(r===1)return lk(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<r;a++){var s=t[a],o=n[a];if(Array.isArray(s)||Array.isArray(o)){if(!e(s,o))return!1}else if(!lk(s,o))return!1}return!0},lk=function(t,n){if(Xe(t)&&Xe(n))return!0;if(!Xe(t)&&!Xe(n)){var r=t.props||{},a=r.children,s=ak(r,OU),o=n.props||{},l=o.children,c=ak(o,PU);return a&&l?No(s,c)&&Zv(a,l):!a&&!l?No(s,c):!1}return!1},ck=function(t,n){var r=[],a={};return qx(t).forEach(function(s,o){if(IU(s))r.push(s);else if(s){var l=ja(s.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!a[l])){var f=u(s,l,o);r.push(f),a[l]=!0}}}),r},LU=function(t){var n=t&&t.type;return n&&ik[n]?ik[n]:null},DU=function(t,n){return qx(n).indexOf(t)},BU=["children","width","height","viewBox","className","style","title","desc"];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)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qv.apply(this,arguments)}function zU(e,t){if(e==null)return{};var n=FU(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FU(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jv(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,s=e.className,o=e.style,l=e.title,c=e.desc,u=zU(e,BU),d=a||{width:n,height:r,x:0,y:0},f=Ye("recharts-surface",s);return H.createElement("svg",Qv({},Ve(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),H.createElement("title",null,l),H.createElement("desc",null,c),t)}var UU=["children","className"];function ey(){return ey=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},ey.apply(this,arguments)}function WU(e,t){if(e==null)return{};var n=HU(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function HU(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Zt=H.forwardRef(function(e,t){var n=e.children,r=e.className,a=WU(e,UU),s=Ye("recharts-layer",r);return H.createElement("g",ey({className:s},Ve(a,!0),{ref:t}),n)}),_a=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),s=2;s<r;s++)a[s-2]=arguments[s]};function GU(e,t,n){var r=-1,a=e.length;t<0&&(t=-t>a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(a);++r<a;)s[r]=e[r+t];return s}var qU=GU,KU=qU;function VU(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:KU(e,t,n)}var YU=VU,XU="\\ud800-\\udfff",ZU="\\u0300-\\u036f",QU="\\ufe20-\\ufe2f",JU="\\u20d0-\\u20ff",e3=ZU+QU+JU,t3="\\ufe0e\\ufe0f",n3="\\u200d",r3=RegExp("["+n3+XU+e3+t3+"]");function a3(e){return r3.test(e)}var CT=a3;function i3(e){return e.split("")}var s3=i3,TT="\\ud800-\\udfff",o3="\\u0300-\\u036f",l3="\\ufe20-\\ufe2f",c3="\\u20d0-\\u20ff",u3=o3+l3+c3,d3="\\ufe0e\\ufe0f",f3="["+TT+"]",ty="["+u3+"]",ny="\\ud83c[\\udffb-\\udfff]",h3="(?:"+ty+"|"+ny+")",OT="[^"+TT+"]",PT="(?:\\ud83c[\\udde6-\\uddff]){2}",RT="[\\ud800-\\udbff][\\udc00-\\udfff]",p3="\\u200d",MT=h3+"?",IT="["+d3+"]?",m3="(?:"+p3+"(?:"+[OT,PT,RT].join("|")+")"+IT+MT+")*",g3=IT+MT+m3,v3="(?:"+[OT+ty+"?",ty,PT,RT,f3].join("|")+")",y3=RegExp(ny+"(?="+ny+")|"+v3+g3,"g");function b3(e){return e.match(y3)||[]}var x3=b3,w3=s3,S3=CT,k3=x3;function N3(e){return S3(e)?k3(e):w3(e)}var E3=N3,j3=YU,_3=CT,A3=E3,C3=kT;function T3(e){return function(t){t=C3(t);var n=_3(t)?A3(t):void 0,r=n?n[0]:t.charAt(0),a=n?j3(n,1).join(""):t.slice(1);return r[e]()+a}}var O3=T3,P3=O3,R3=P3("toUpperCase"),M3=R3;const Cp=Qe(M3);function ut(e){return function(){return e}}const $T=Math.cos,Ff=Math.sin,Wr=Math.sqrt,Uf=Math.PI,Tp=2*Uf,ry=Math.PI,ay=2*ry,Fi=1e-6,I3=ay-Fi;function LT(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function $3(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return LT;const n=10**t;return function(r){this._+=r[0];for(let a=1,s=r.length;a<s;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class L3{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?LT:$3(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,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,s,o){this._append`C${+t},${+n},${+r},${+a},${this._x1=+s},${this._y1=+o}`}arcTo(t,n,r,a,s){if(t=+t,n=+n,r=+r,a=+a,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,l=this._y1,c=r-t,u=a-n,d=o-t,f=l-n,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Fi)if(!(Math.abs(f*c-u*d)>Fi)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-o,g=a-l,m=c*c+u*u,y=p*p+g*g,v=Math.sqrt(m),b=Math.sqrt(h),w=s*Math.tan((ry-Math.acos((m+h-y)/(2*v*b)))/2),N=w/b,S=w/v;Math.abs(N-1)>Fi&&this._append`L${t+N*d},${n+N*f}`,this._append`A${s},${s},0,0,${+(f*p>d*g)},${this._x1=t+S*c},${this._y1=n+S*u}`}}arc(t,n,r,a,s,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(a),c=r*Math.sin(a),u=t+l,d=n+c,f=1^o,h=o?a-s:s-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Fi||Math.abs(this._y1-d)>Fi)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%ay+ay),h>I3?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:h>Fi&&this._append`A${r},${r},0,${+(h>=ry)},${f},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function Kx(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 L3(t)}function Vx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function DT(e){this._context=e}DT.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 Op(e){return new DT(e)}function BT(e){return e[0]}function zT(e){return e[1]}function FT(e,t){var n=ut(!0),r=null,a=Op,s=null,o=Kx(l);e=typeof e=="function"?e:e===void 0?BT:ut(e),t=typeof t=="function"?t:t===void 0?zT:ut(t);function l(c){var u,d=(c=Vx(c)).length,f,h=!1,p;for(r==null&&(s=a(p=o())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(f,u,c),+t(f,u,c));if(p)return s=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:ut(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ut(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ut(!!c),l):n},l.curve=function(c){return arguments.length?(a=c,r!=null&&(s=a(r)),l):a},l.context=function(c){return arguments.length?(c==null?r=s=null:s=a(r=c),l):r},l}function kd(e,t,n){var r=null,a=ut(!0),s=null,o=Op,l=null,c=Kx(u);e=typeof e=="function"?e:e===void 0?BT:ut(+e),t=typeof t=="function"?t:ut(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?zT:ut(+n);function u(f){var h,p,g,m=(f=Vx(f)).length,y,v=!1,b,w=new Array(m),N=new Array(m);for(s==null&&(l=o(b=c())),h=0;h<=m;++h){if(!(h<m&&a(y=f[h],h,f))===v)if(v=!v)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=h-1;g>=p;--g)l.point(w[g],N[g]);l.lineEnd(),l.areaEnd()}v&&(w[h]=+e(y,h,f),N[h]=+t(y,h,f),l.point(r?+r(y,h,f):w[h],n?+n(y,h,f):N[h]))}if(b)return l=null,b+""||null}function d(){return FT().defined(a).curve(o).context(s)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:ut(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ut(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ut(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:ut(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ut(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ut(+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?(a=typeof f=="function"?f:ut(!!f),u):a},u.curve=function(f){return arguments.length?(o=f,s!=null&&(l=o(s)),u):o},u.context=function(f){return arguments.length?(f==null?s=l=null:l=o(s=f),u):s},u}class UT{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 D3(e){return new UT(e,!0)}function B3(e){return new UT(e,!1)}const Yx={draw(e,t){const n=Wr(t/Uf);e.moveTo(n,0),e.arc(0,0,n,0,Tp)}},z3={draw(e,t){const n=Wr(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()}},WT=Wr(1/3),F3=WT*2,U3={draw(e,t){const n=Wr(t/F3),r=n*WT;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},W3={draw(e,t){const n=Wr(t),r=-n/2;e.rect(r,r,n,n)}},H3=.8908130915292852,HT=Ff(Uf/10)/Ff(7*Uf/10),G3=Ff(Tp/10)*HT,q3=-$T(Tp/10)*HT,K3={draw(e,t){const n=Wr(t*H3),r=G3*n,a=q3*n;e.moveTo(0,-n),e.lineTo(r,a);for(let s=1;s<5;++s){const o=Tp*s/5,l=$T(o),c=Ff(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*a,c*r+l*a)}e.closePath()}},Vm=Wr(3),V3={draw(e,t){const n=-Wr(t/(Vm*3));e.moveTo(0,n*2),e.lineTo(-Vm*n,-n),e.lineTo(Vm*n,-n),e.closePath()}},cr=-.5,ur=Wr(3)/2,iy=1/Wr(12),Y3=(iy/2+1)*3,X3={draw(e,t){const n=Wr(t/Y3),r=n/2,a=n*iy,s=r,o=n*iy+n,l=-s,c=o;e.moveTo(r,a),e.lineTo(s,o),e.lineTo(l,c),e.lineTo(cr*r-ur*a,ur*r+cr*a),e.lineTo(cr*s-ur*o,ur*s+cr*o),e.lineTo(cr*l-ur*c,ur*l+cr*c),e.lineTo(cr*r+ur*a,cr*a-ur*r),e.lineTo(cr*s+ur*o,cr*o-ur*s),e.lineTo(cr*l+ur*c,cr*c-ur*l),e.closePath()}};function Z3(e,t){let n=null,r=Kx(a);e=typeof e=="function"?e:ut(e||Yx),t=typeof t=="function"?t:ut(t===void 0?64:+t);function a(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return a.type=function(s){return arguments.length?(e=typeof s=="function"?s:ut(s),a):e},a.size=function(s){return arguments.length?(t=typeof s=="function"?s:ut(+s),a):t},a.context=function(s){return arguments.length?(n=s??null,a):n},a}function Wf(){}function Hf(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 GT(e){this._context=e}GT.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:Hf(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:Hf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Q3(e){return new GT(e)}function qT(e){this._context=e}qT.prototype={areaStart:Wf,areaEnd:Wf,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:Hf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function J3(e){return new qT(e)}function KT(e){this._context=e}KT.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:Hf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function e4(e){return new KT(e)}function VT(e){this._context=e}VT.prototype={areaStart:Wf,areaEnd:Wf,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 t4(e){return new VT(e)}function uk(e){return e<0?-1:1}function dk(e,t,n){var r=e._x1-e._x0,a=t-e._x1,s=(e._y1-e._y0)/(r||a<0&&-0),o=(n-e._y1)/(a||r<0&&-0),l=(s*a+o*r)/(r+a);return(uk(s)+uk(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function fk(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ym(e,t,n){var r=e._x0,a=e._y0,s=e._x1,o=e._y1,l=(s-r)/3;e._context.bezierCurveTo(r+l,a+l*t,s-l,o-l*n,s,o)}function Gf(e){this._context=e}Gf.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:Ym(this,this._t0,fk(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,Ym(this,fk(this,n=dk(this,e,t)),n);break;default:Ym(this,this._t0,n=dk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function YT(e){this._context=new XT(e)}(YT.prototype=Object.create(Gf.prototype)).point=function(e,t){Gf.prototype.point.call(this,t,e)};function XT(e){this._context=e}XT.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,a,s){this._context.bezierCurveTo(t,e,r,n,s,a)}};function n4(e){return new Gf(e)}function r4(e){return new YT(e)}function ZT(e){this._context=e}ZT.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=hk(e),a=hk(t),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(r[0][s],a[0][s],r[1][s],a[1][s],e[o],t[o]);(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 hk(e){var t,n=e.length-1,r,a=new Array(n),s=new Array(n),o=new Array(n);for(a[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,s[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/s[t-1],s[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/s[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/s[t];for(s[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-a[t+1];return[a,s]}function a4(e){return new ZT(e)}function Pp(e,t){this._context=e,this._t=t}Pp.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 i4(e){return new Pp(e,.5)}function s4(e){return new Pp(e,0)}function o4(e){return new Pp(e,1)}function $o(e,t){if((o=e.length)>1)for(var n=1,r,a,s=e[t[0]],o,l=s.length;n<o;++n)for(a=s,s=e[t[n]],r=0;r<l;++r)s[r][1]+=s[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function sy(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function l4(e,t){return e[t]}function c4(e){const t=[];return t.key=e,t}function u4(){var e=ut([]),t=sy,n=$o,r=l4;function a(s){var o=Array.from(e.apply(this,arguments),c4),l,c=o.length,u=-1,d;for(const f of s)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(f,o[l].key,u,s)]).data=f;for(l=0,d=Vx(t(o));l<c;++l)o[d[l]].index=l;return n(o,d),o}return a.keys=function(s){return arguments.length?(e=typeof s=="function"?s:ut(Array.from(s)),a):e},a.value=function(s){return arguments.length?(r=typeof s=="function"?s:ut(+s),a):r},a.order=function(s){return arguments.length?(t=s==null?sy:typeof s=="function"?s:ut(Array.from(s)),a):t},a.offset=function(s){return arguments.length?(n=s??$o,a):n},a}function d4(e,t){if((r=e.length)>0){for(var n,r,a=0,s=e[0].length,o;a<s;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}$o(e,t)}}function f4(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,s=r.length;n<s;++n){for(var o=0,l=0;o<a;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}$o(e,t)}}function h4(e,t){if(!(!((o=e.length)>0)||!((s=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,s,o;r<s;++r){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],f=d[r][1]||0,h=d[r-1][1]||0,p=(f-h)/2,g=0;g<l;++g){var m=e[t[g]],y=m[r][1]||0,v=m[r-1][1]||0;p+=y-v}c+=f,u+=p*f}a[r-1][1]+=a[r-1][0]=n,c&&(n-=u/c)}a[r-1][1]+=a[r-1][0]=n,$o(e,t)}}function qc(e){"@babel/helpers - typeof";return qc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qc(e)}var p4=["type","size","sizeType"];function oy(){return oy=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},oy.apply(this,arguments)}function pk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function mk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pk(Object(n),!0).forEach(function(r){m4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m4(e,t,n){return t=g4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g4(e){var t=v4(e,"string");return qc(t)=="symbol"?t:t+""}function v4(e,t){if(qc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function y4(e,t){if(e==null)return{};var n=b4(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function b4(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var QT={symbolCircle:Yx,symbolCross:z3,symbolDiamond:U3,symbolSquare:W3,symbolStar:K3,symbolTriangle:V3,symbolWye:X3},x4=Math.PI/180,w4=function(t){var n="symbol".concat(Cp(t));return QT[n]||Yx},S4=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*x4;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},k4=function(t,n){QT["symbol".concat(Cp(t))]=n},Xx=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,s=a===void 0?64:a,o=t.sizeType,l=o===void 0?"area":o,c=y4(t,p4),u=mk(mk({},c),{},{type:r,size:s,sizeType:l}),d=function(){var y=w4(r),v=Z3().type(y).size(S4(s,l,r));return v()},f=u.className,h=u.cx,p=u.cy,g=Ve(u,!0);return h===+h&&p===+p&&s===+s?H.createElement("path",oy({},g,{className:Ye("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};Xx.registerSymbol=k4;function Lo(e){"@babel/helpers - typeof";return Lo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lo(e)}function ly(){return ly=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},ly.apply(this,arguments)}function gk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function N4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gk(Object(n),!0).forEach(function(r){Kc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function E4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eO(r.key),r)}}function _4(e,t,n){return t&&j4(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function A4(e,t,n){return t=qf(t),C4(e,JT()?Reflect.construct(t,n||[],qf(e).constructor):t.apply(e,n))}function C4(e,t){if(t&&(Lo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T4(e)}function T4(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JT=function(){return!!e})()}function qf(e){return qf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qf(e)}function O4(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cy(e,t)}function cy(e,t){return cy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},cy(e,t)}function Kc(e,t,n){return t=eO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eO(e){var t=P4(e,"string");return Lo(t)=="symbol"?t:t+""}function P4(e,t){if(Lo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var dr=32,Zx=function(e){function t(){return E4(this,t),A4(this,t,arguments)}return O4(t,e),_4(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,s=dr/2,o=dr/6,l=dr/3,c=r.inactive?a:r.color;if(r.type==="plainline")return H.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:s,x2:dr,y2:s,className:"recharts-legend-icon"});if(r.type==="line")return H.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(s,"h").concat(l,`
76
- A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(s,`
77
- H`).concat(dr,"M").concat(2*l,",").concat(s,`
78
- A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(s),className:"recharts-legend-icon"});if(r.type==="rect")return H.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(dr/8,"h").concat(dr,"v").concat(dr*3/4,"h").concat(-dr,"z"),className:"recharts-legend-icon"});if(H.isValidElement(r.legendIcon)){var u=N4({},r);return delete u.legendIcon,H.cloneElement(r.legendIcon,u)}return H.createElement(Xx,{fill:c,cx:s,cy:s,size:dr,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,a=this.props,s=a.payload,o=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,d={x:0,y:0,width:dr,height:dr},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(p,g){var m=p.formatter||c,y=Ye(Kc(Kc({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var v=De(p.value)?null:p.value;_a(!De(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var b=p.inactive?u:p.color;return H.createElement("li",ly({className:y,style:f,key:"legend-item-".concat(g)},zf(r.props,p,g)),H.createElement(Jv,{width:o,height:o,viewBox:d,style:h},r.renderIcon(p)),H.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},m?m(v,p,g):v))})}},{key:"render",value:function(){var r=this.props,a=r.payload,s=r.layout,o=r.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:s==="horizontal"?o:"left"};return H.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(k.PureComponent);Kc(Zx,"displayName","Legend");Kc(Zx,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var R4=mp;function M4(){this.__data__=new R4,this.size=0}var I4=M4;function $4(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var L4=$4;function D4(e){return this.__data__.get(e)}var B4=D4;function z4(e){return this.__data__.has(e)}var F4=z4,U4=mp,W4=Dx,H4=Bx,G4=200;function q4(e,t){var n=this.__data__;if(n instanceof U4){var r=n.__data__;if(!W4||r.length<G4-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new H4(r)}return n.set(e,t),this.size=n.size,this}var K4=q4,V4=mp,Y4=I4,X4=L4,Z4=B4,Q4=F4,J4=K4;function ml(e){var t=this.__data__=new V4(e);this.size=t.size}ml.prototype.clear=Y4;ml.prototype.delete=X4;ml.prototype.get=Z4;ml.prototype.has=Q4;ml.prototype.set=J4;var tO=ml,e6="__lodash_hash_undefined__";function t6(e){return this.__data__.set(e,e6),this}var n6=t6;function r6(e){return this.__data__.has(e)}var a6=r6,i6=Bx,s6=n6,o6=a6;function Kf(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new i6;++t<n;)this.add(e[t])}Kf.prototype.add=Kf.prototype.push=s6;Kf.prototype.has=o6;var nO=Kf;function l6(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var rO=l6;function c6(e,t){return e.has(t)}var aO=c6,u6=nO,d6=rO,f6=aO,h6=1,p6=2;function m6(e,t,n,r,a,s){var o=n&h6,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,p=n&p6?new u6:void 0;for(s.set(e,t),s.set(t,e);++f<l;){var g=e[f],m=t[f];if(r)var y=o?r(m,g,f,t,e,s):r(g,m,f,e,t,s);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!d6(t,function(v,b){if(!f6(p,b)&&(g===v||a(g,v,n,r,s)))return p.push(b)})){h=!1;break}}else if(!(g===m||a(g,m,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}var iO=m6,g6=ca,v6=g6.Uint8Array,y6=v6;function b6(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}var x6=b6;function w6(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Qx=w6,vk=Lu,yk=y6,S6=Lx,k6=iO,N6=x6,E6=Qx,j6=1,_6=2,A6="[object Boolean]",C6="[object Date]",T6="[object Error]",O6="[object Map]",P6="[object Number]",R6="[object RegExp]",M6="[object Set]",I6="[object String]",$6="[object Symbol]",L6="[object ArrayBuffer]",D6="[object DataView]",bk=vk?vk.prototype:void 0,Xm=bk?bk.valueOf:void 0;function B6(e,t,n,r,a,s,o){switch(n){case D6:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case L6:return!(e.byteLength!=t.byteLength||!s(new yk(e),new yk(t)));case A6:case C6:case P6:return S6(+e,+t);case T6:return e.name==t.name&&e.message==t.message;case R6:case I6:return e==t+"";case O6:var l=N6;case M6:var c=r&j6;if(l||(l=E6),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=_6,o.set(e,t);var d=k6(l(e),l(t),r,a,s,o);return o.delete(e),d;case $6:if(Xm)return Xm.call(e)==Xm.call(t)}return!1}var z6=B6;function F6(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var sO=F6,U6=sO,W6=Un;function H6(e,t,n){var r=t(e);return W6(e)?r:U6(r,n(e))}var G6=H6;function q6(e,t){for(var n=-1,r=e==null?0:e.length,a=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[a++]=o)}return s}var K6=q6;function V6(){return[]}var Y6=V6,X6=K6,Z6=Y6,Q6=Object.prototype,J6=Q6.propertyIsEnumerable,xk=Object.getOwnPropertySymbols,eW=xk?function(e){return e==null?[]:(e=Object(e),X6(xk(e),function(t){return J6.call(e,t)}))}:Z6,tW=eW;function nW(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var rW=nW,aW=Da,iW=Ba,sW="[object Arguments]";function oW(e){return iW(e)&&aW(e)==sW}var lW=oW,wk=lW,cW=Ba,oO=Object.prototype,uW=oO.hasOwnProperty,dW=oO.propertyIsEnumerable,fW=wk(function(){return arguments}())?wk:function(e){return cW(e)&&uW.call(e,"callee")&&!dW.call(e,"callee")},Jx=fW,Vf={exports:{}};function hW(){return!1}var pW=hW;Vf.exports;(function(e,t){var n=ca,r=pW,a=t&&!t.nodeType&&t,s=a&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===a,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u})(Vf,Vf.exports);var lO=Vf.exports,mW=9007199254740991,gW=/^(?:0|[1-9]\d*)$/;function vW(e,t){var n=typeof e;return t=t??mW,!!t&&(n=="number"||n!="symbol"&&gW.test(e))&&e>-1&&e%1==0&&e<t}var e0=vW,yW=9007199254740991;function bW(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=yW}var t0=bW,xW=Da,wW=t0,SW=Ba,kW="[object Arguments]",NW="[object Array]",EW="[object Boolean]",jW="[object Date]",_W="[object Error]",AW="[object Function]",CW="[object Map]",TW="[object Number]",OW="[object Object]",PW="[object RegExp]",RW="[object Set]",MW="[object String]",IW="[object WeakMap]",$W="[object ArrayBuffer]",LW="[object DataView]",DW="[object Float32Array]",BW="[object Float64Array]",zW="[object Int8Array]",FW="[object Int16Array]",UW="[object Int32Array]",WW="[object Uint8Array]",HW="[object Uint8ClampedArray]",GW="[object Uint16Array]",qW="[object Uint32Array]",ht={};ht[DW]=ht[BW]=ht[zW]=ht[FW]=ht[UW]=ht[WW]=ht[HW]=ht[GW]=ht[qW]=!0;ht[kW]=ht[NW]=ht[$W]=ht[EW]=ht[LW]=ht[jW]=ht[_W]=ht[AW]=ht[CW]=ht[TW]=ht[OW]=ht[PW]=ht[RW]=ht[MW]=ht[IW]=!1;function KW(e){return SW(e)&&wW(e.length)&&!!ht[xW(e)]}var VW=KW;function YW(e){return function(t){return e(t)}}var cO=YW,Yf={exports:{}};Yf.exports;(function(e,t){var n=vT,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===r,o=s&&n.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(Yf,Yf.exports);var XW=Yf.exports,ZW=VW,QW=cO,Sk=XW,kk=Sk&&Sk.isTypedArray,JW=kk?QW(kk):ZW,uO=JW,e8=rW,t8=Jx,n8=Un,r8=lO,a8=e0,i8=uO,s8=Object.prototype,o8=s8.hasOwnProperty;function l8(e,t){var n=n8(e),r=!n&&t8(e),a=!n&&!r&&r8(e),s=!n&&!r&&!a&&i8(e),o=n||r||a||s,l=o?e8(e.length,String):[],c=l.length;for(var u in e)(t||o8.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||a8(u,c)))&&l.push(u);return l}var c8=l8,u8=Object.prototype;function d8(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||u8;return e===n}var f8=d8;function h8(e,t){return function(n){return e(t(n))}}var dO=h8,p8=dO,m8=p8(Object.keys,Object),g8=m8,v8=f8,y8=g8,b8=Object.prototype,x8=b8.hasOwnProperty;function w8(e){if(!v8(e))return y8(e);var t=[];for(var n in Object(e))x8.call(e,n)&&n!="constructor"&&t.push(n);return t}var S8=w8,k8=$x,N8=t0;function E8(e){return e!=null&&N8(e.length)&&!k8(e)}var Bu=E8,j8=c8,_8=S8,A8=Bu;function C8(e){return A8(e)?j8(e):_8(e)}var Rp=C8,T8=G6,O8=tW,P8=Rp;function R8(e){return T8(e,P8,O8)}var M8=R8,Nk=M8,I8=1,$8=Object.prototype,L8=$8.hasOwnProperty;function D8(e,t,n,r,a,s){var o=n&I8,l=Nk(e),c=l.length,u=Nk(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:L8.call(t,h)))return!1}var p=s.get(e),g=s.get(t);if(p&&g)return p==t&&g==e;var m=!0;s.set(e,t),s.set(t,e);for(var y=o;++f<c;){h=l[f];var v=e[h],b=t[h];if(r)var w=o?r(b,v,h,t,e,s):r(v,b,h,e,t,s);if(!(w===void 0?v===b||a(v,b,n,r,s):w)){m=!1;break}y||(y=h=="constructor")}if(m&&!y){var N=e.constructor,S=t.constructor;N!=S&&"constructor"in e&&"constructor"in t&&!(typeof N=="function"&&N instanceof N&&typeof S=="function"&&S instanceof S)&&(m=!1)}return s.delete(e),s.delete(t),m}var B8=D8,z8=Ns,F8=ca,U8=z8(F8,"DataView"),W8=U8,H8=Ns,G8=ca,q8=H8(G8,"Promise"),K8=q8,V8=Ns,Y8=ca,X8=V8(Y8,"Set"),fO=X8,Z8=Ns,Q8=ca,J8=Z8(Q8,"WeakMap"),e5=J8,uy=W8,dy=Dx,fy=K8,hy=fO,py=e5,hO=Da,gl=bT,Ek="[object Map]",t5="[object Object]",jk="[object Promise]",_k="[object Set]",Ak="[object WeakMap]",Ck="[object DataView]",n5=gl(uy),r5=gl(dy),a5=gl(fy),i5=gl(hy),s5=gl(py),Ui=hO;(uy&&Ui(new uy(new ArrayBuffer(1)))!=Ck||dy&&Ui(new dy)!=Ek||fy&&Ui(fy.resolve())!=jk||hy&&Ui(new hy)!=_k||py&&Ui(new py)!=Ak)&&(Ui=function(e){var t=hO(e),n=t==t5?e.constructor:void 0,r=n?gl(n):"";if(r)switch(r){case n5:return Ck;case r5:return Ek;case a5:return jk;case i5:return _k;case s5:return Ak}return t});var o5=Ui,Zm=tO,l5=iO,c5=z6,u5=B8,Tk=o5,Ok=Un,Pk=lO,d5=uO,f5=1,Rk="[object Arguments]",Mk="[object Array]",Nd="[object Object]",h5=Object.prototype,Ik=h5.hasOwnProperty;function p5(e,t,n,r,a,s){var o=Ok(e),l=Ok(t),c=o?Mk:Tk(e),u=l?Mk:Tk(t);c=c==Rk?Nd:c,u=u==Rk?Nd:u;var d=c==Nd,f=u==Nd,h=c==u;if(h&&Pk(e)){if(!Pk(t))return!1;o=!0,d=!1}if(h&&!d)return s||(s=new Zm),o||d5(e)?l5(e,t,n,r,a,s):c5(e,t,c,n,r,a,s);if(!(n&f5)){var p=d&&Ik.call(e,"__wrapped__"),g=f&&Ik.call(t,"__wrapped__");if(p||g){var m=p?e.value():e,y=g?t.value():t;return s||(s=new Zm),a(m,y,n,r,s)}}return h?(s||(s=new Zm),u5(e,t,n,r,a,s)):!1}var m5=p5,g5=m5,$k=Ba;function pO(e,t,n,r,a){return e===t?!0:e==null||t==null||!$k(e)&&!$k(t)?e!==e&&t!==t:g5(e,t,n,r,pO,a)}var n0=pO,v5=tO,y5=n0,b5=1,x5=2;function w5(e,t,n,r){var a=n.length,s=a,o=!r;if(e==null)return!s;for(e=Object(e);a--;){var l=n[a];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<s;){l=n[a];var c=l[0],u=e[c],d=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var f=new v5;if(r)var h=r(u,d,c,e,t,f);if(!(h===void 0?y5(d,u,b5|x5,r,f):h))return!1}}return!0}var S5=w5,k5=ki;function N5(e){return e===e&&!k5(e)}var mO=N5,E5=mO,j5=Rp;function _5(e){for(var t=j5(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,E5(a)]}return t}var A5=_5;function C5(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var gO=C5,T5=S5,O5=A5,P5=gO;function R5(e){var t=O5(e);return t.length==1&&t[0][2]?P5(t[0][0],t[0][1]):function(n){return n===e||T5(n,e,t)}}var M5=R5;function I5(e,t){return e!=null&&t in Object(e)}var $5=I5,L5=NT,D5=Jx,B5=Un,z5=e0,F5=t0,U5=vp;function W5(e,t,n){t=L5(t,e);for(var r=-1,a=t.length,s=!1;++r<a;){var o=U5(t[r]);if(!(s=e!=null&&n(e,o)))break;e=e[o]}return s||++r!=a?s:(a=e==null?0:e.length,!!a&&F5(a)&&z5(o,a)&&(B5(e)||D5(e)))}var H5=W5,G5=$5,q5=H5;function K5(e,t){return e!=null&&q5(e,t,G5)}var V5=K5,Y5=n0,X5=ET,Z5=V5,Q5=Ix,J5=mO,eH=gO,tH=vp,nH=1,rH=2;function aH(e,t){return Q5(e)&&J5(t)?eH(tH(e),t):function(n){var r=X5(n,e);return r===void 0&&r===t?Z5(n,e):Y5(t,r,nH|rH)}}var iH=aH;function sH(e){return e}var vl=sH;function oH(e){return function(t){return t==null?void 0:t[e]}}var lH=oH,cH=Ux;function uH(e){return function(t){return cH(t,e)}}var dH=uH,fH=lH,hH=dH,pH=Ix,mH=vp;function gH(e){return pH(e)?fH(mH(e)):hH(e)}var vH=gH,yH=M5,bH=iH,xH=vl,wH=Un,SH=vH;function kH(e){return typeof e=="function"?e:e==null?xH:typeof e=="object"?wH(e)?bH(e[0],e[1]):yH(e):SH(e)}var Ni=kH;function NH(e,t,n,r){for(var a=e.length,s=n+(r?1:-1);r?s--:++s<a;)if(t(e[s],s,e))return s;return-1}var vO=NH;function EH(e){return e!==e}var jH=EH;function _H(e,t,n){for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}var AH=_H,CH=vO,TH=jH,OH=AH;function PH(e,t,n){return t===t?OH(e,t,n):CH(e,TH,n)}var RH=PH,MH=RH;function IH(e,t){var n=e==null?0:e.length;return!!n&&MH(e,t,0)>-1}var $H=IH;function LH(e,t,n){for(var r=-1,a=e==null?0:e.length;++r<a;)if(n(t,e[r]))return!0;return!1}var DH=LH;function BH(){}var zH=BH,Qm=fO,FH=zH,UH=Qx,WH=1/0,HH=Qm&&1/UH(new Qm([,-0]))[1]==WH?function(e){return new Qm(e)}:FH,GH=HH,qH=nO,KH=$H,VH=DH,YH=aO,XH=GH,ZH=Qx,QH=200;function JH(e,t,n){var r=-1,a=KH,s=e.length,o=!0,l=[],c=l;if(n)o=!1,a=VH;else if(s>=QH){var u=t?null:XH(e);if(u)return ZH(u);o=!1,a=YH,c=new qH}else c=t?[]:l;e:for(;++r<s;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,o&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),l.push(d)}else a(c,f,n)||(c!==l&&c.push(f),l.push(d))}return l}var e9=JH,t9=Ni,n9=e9;function r9(e,t){return e&&e.length?n9(e,t9(t)):[]}var a9=r9;const Lk=Qe(a9);function yO(e,t,n){return t===!0?Lk(e,n):De(t)?Lk(e,t):e}function Do(e){"@babel/helpers - typeof";return Do=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Do(e)}var i9=["ref"];function Dk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ga(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dk(Object(n),!0).forEach(function(r){Mp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,xO(r.key),r)}}function o9(e,t,n){return t&&Bk(e.prototype,t),n&&Bk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l9(e,t,n){return t=Xf(t),c9(e,bO()?Reflect.construct(t,n||[],Xf(e).constructor):t.apply(e,n))}function c9(e,t){if(t&&(Do(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return u9(e)}function u9(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bO=function(){return!!e})()}function Xf(e){return Xf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xf(e)}function d9(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&my(e,t)}function my(e,t){return my=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},my(e,t)}function Mp(e,t,n){return t=xO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xO(e){var t=f9(e,"string");return Do(t)=="symbol"?t:t+""}function f9(e,t){if(Do(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Do(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function h9(e,t){if(e==null)return{};var n=p9(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function p9(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function m9(e){return e.value}function g9(e,t){if(H.isValidElement(e))return H.cloneElement(e,t);if(typeof e=="function")return H.createElement(e,t);t.ref;var n=h9(t,i9);return H.createElement(Zx,n)}var zk=1,as=function(e){function t(){var n;s9(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=l9(this,t,[].concat(a)),Mp(n,"lastBoundingBox",{width:-1,height:-1}),n}return d9(t,e),o9(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>zk||Math.abs(a.height-this.lastBoundingBox.height)>zk)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ga({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,s=a.layout,o=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,d=a.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&s==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();h={top:((d||0)-g.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return ga(ga({},f),h)}},{key:"render",value:function(){var r=this,a=this.props,s=a.content,o=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,d=a.payload,f=ga(ga({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return H.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},g9(s,ga(ga({},this.props),{},{payload:yO(d,u,m9)})))}}],[{key:"getWithHeight",value:function(r,a){var s=ga(ga({},this.defaultProps),r.props),o=s.layout;return o==="vertical"&&de(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])}(k.PureComponent);Mp(as,"displayName","Legend");Mp(as,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Fk=Lu,v9=Jx,y9=Un,Uk=Fk?Fk.isConcatSpreadable:void 0;function b9(e){return y9(e)||v9(e)||!!(Uk&&e&&e[Uk])}var x9=b9,w9=sO,S9=x9;function wO(e,t,n,r,a){var s=-1,o=e.length;for(n||(n=S9),a||(a=[]);++s<o;){var l=e[s];t>0&&n(l)?t>1?wO(l,t-1,n,r,a):w9(a,l):r||(a[a.length]=l)}return a}var SO=wO;function k9(e){return function(t,n,r){for(var a=-1,s=Object(t),o=r(t),l=o.length;l--;){var c=o[e?l:++a];if(n(s[c],c,s)===!1)break}return t}}var N9=k9,E9=N9,j9=E9(),_9=j9,A9=_9,C9=Rp;function T9(e,t){return e&&A9(e,t,C9)}var kO=T9,O9=Bu;function P9(e,t){return function(n,r){if(n==null)return n;if(!O9(n))return e(n,r);for(var a=n.length,s=t?a:-1,o=Object(n);(t?s--:++s<a)&&r(o[s],s,o)!==!1;);return n}}var R9=P9,M9=kO,I9=R9,$9=I9(M9),r0=$9,L9=r0,D9=Bu;function B9(e,t){var n=-1,r=D9(e)?Array(e.length):[];return L9(e,function(a,s,o){r[++n]=t(a,s,o)}),r}var NO=B9;function z9(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var F9=z9,Wk=ul;function U9(e,t){if(e!==t){var n=e!==void 0,r=e===null,a=e===e,s=Wk(e),o=t!==void 0,l=t===null,c=t===t,u=Wk(t);if(!l&&!u&&!s&&e>t||s&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!a)return 1;if(!r&&!s&&!u&&e<t||u&&n&&a&&!r&&!s||l&&n&&a||!o&&a||!c)return-1}return 0}var W9=U9,H9=W9;function G9(e,t,n){for(var r=-1,a=e.criteria,s=t.criteria,o=a.length,l=n.length;++r<o;){var c=H9(a[r],s[r]);if(c){if(r>=l)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var q9=G9,Jm=Fx,K9=Ux,V9=Ni,Y9=NO,X9=F9,Z9=cO,Q9=q9,J9=vl,eG=Un;function tG(e,t,n){t.length?t=Jm(t,function(s){return eG(s)?function(o){return K9(o,s.length===1?s[0]:s)}:s}):t=[J9];var r=-1;t=Jm(t,Z9(V9));var a=Y9(e,function(s,o,l){var c=Jm(t,function(u){return u(s)});return{criteria:c,index:++r,value:s}});return X9(a,function(s,o){return Q9(s,o,n)})}var nG=tG;function rG(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var aG=rG,iG=aG,Hk=Math.max;function sG(e,t,n){return t=Hk(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,s=Hk(r.length-t,0),o=Array(s);++a<s;)o[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(o),iG(e,this,l)}}var oG=sG;function lG(e){return function(){return e}}var cG=lG,uG=Ns,dG=function(){try{var e=uG(Object,"defineProperty");return e({},"",{}),e}catch{}}(),EO=dG,fG=cG,Gk=EO,hG=vl,pG=Gk?function(e,t){return Gk(e,"toString",{configurable:!0,enumerable:!1,value:fG(t),writable:!0})}:hG,mG=pG,gG=800,vG=16,yG=Date.now;function bG(e){var t=0,n=0;return function(){var r=yG(),a=vG-(r-n);if(n=r,a>0){if(++t>=gG)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var xG=bG,wG=mG,SG=xG,kG=SG(wG),NG=kG,EG=vl,jG=oG,_G=NG;function AG(e,t){return _G(jG(e,t,EG),e+"")}var CG=AG,TG=Lx,OG=Bu,PG=e0,RG=ki;function MG(e,t,n){if(!RG(n))return!1;var r=typeof t;return(r=="number"?OG(n)&&PG(t,n.length):r=="string"&&t in n)?TG(n[t],e):!1}var Ip=MG,IG=SO,$G=nG,LG=CG,qk=Ip,DG=LG(function(e,t){if(e==null)return[];var n=t.length;return n>1&&qk(e,t[0],t[1])?t=[]:n>2&&qk(t[0],t[1],t[2])&&(t=[t[0]]),$G(e,IG(t,1),[])}),BG=DG;const a0=Qe(BG);function Vc(e){"@babel/helpers - typeof";return Vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vc(e)}function gy(){return gy=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},gy.apply(this,arguments)}function zG(e,t){return HG(e)||WG(e,t)||UG(e,t)||FG()}function FG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
79
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UG(e,t){if(e){if(typeof e=="string")return Kk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kk(e,t)}}function Kk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function WG(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function HG(e){if(Array.isArray(e))return e}function Vk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function eg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vk(Object(n),!0).forEach(function(r){GG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GG(e,t,n){return t=qG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qG(e){var t=KG(e,"string");return Vc(t)=="symbol"?t:t+""}function KG(e,t){if(Vc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VG(e){return Array.isArray(e)&&qt(e[0])&&qt(e[1])?e.join(" ~ "):e}var YG=function(t){var n=t.separator,r=n===void 0?" : ":n,a=t.contentStyle,s=a===void 0?{}:a,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,h=t.itemSorter,p=t.wrapperClassName,g=t.labelClassName,m=t.label,y=t.labelFormatter,v=t.accessibilityLayer,b=v===void 0?!1:v,w=function(){if(d&&d.length){var R={padding:0,margin:0},I=(h?a0(d,h):d).map(function(L,F){if(L.type==="none")return null;var z=eg({display:"block",paddingTop:4,paddingBottom:4,color:L.color||"#000"},l),M=L.formatter||f||VG,O=L.value,U=L.name,A=O,Z=U;if(M&&A!=null&&Z!=null){var D=M(O,U,L,F,d);if(Array.isArray(D)){var P=zG(D,2);A=P[0],Z=P[1]}else A=D}return H.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(F),style:z},qt(Z)?H.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,qt(Z)?H.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,H.createElement("span",{className:"recharts-tooltip-item-value"},A),H.createElement("span",{className:"recharts-tooltip-item-unit"},L.unit||""))});return H.createElement("ul",{className:"recharts-tooltip-item-list",style:R},I)}return null},N=eg({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},s),S=eg({margin:0},u),x=!Xe(m),E=x?m:"",j=Ye("recharts-default-tooltip",p),C=Ye("recharts-tooltip-label",g);x&&y&&d!==void 0&&d!==null&&(E=y(m,d));var T=b?{role:"status","aria-live":"assertive"}:{};return H.createElement("div",gy({className:j,style:N},T),H.createElement("p",{className:C,style:S},H.isValidElement(E)?E:"".concat(E)),w())};function Yc(e){"@babel/helpers - typeof";return Yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yc(e)}function Ed(e,t,n){return t=XG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XG(e){var t=ZG(e,"string");return Yc(t)=="symbol"?t:t+""}function ZG(e,t){if(Yc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hl="recharts-tooltip-wrapper",QG={visibility:"hidden"};function JG(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ye(Hl,Ed(Ed(Ed(Ed({},"".concat(Hl,"-right"),de(n)&&t&&de(t.x)&&n>=t.x),"".concat(Hl,"-left"),de(n)&&t&&de(t.x)&&n<t.x),"".concat(Hl,"-bottom"),de(r)&&t&&de(t.y)&&r>=t.y),"".concat(Hl,"-top"),de(r)&&t&&de(t.y)&&r<t.y))}function Yk(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,a=e.offsetTopLeft,s=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(s&&de(s[r]))return s[r];var d=n[r]-l-a,f=n[r]+a;if(t[r])return o[r]?d:f;if(o[r]){var h=d,p=c[r];return h<p?Math.max(f,c[r]):Math.max(d,c[r])}var g=f+l,m=c[r]+u;return g>m?Math.max(d,c[r]):Math.max(f,c[r])}function eq(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function tq(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,s=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=Yk({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:s,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=Yk({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:s,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=eq({translateX:d,translateY:f,useTranslate3d:l})):u=QG,{cssProperties:u,cssClasses:JG({translateX:d,translateY:f,coordinate:n})}}function Bo(e){"@babel/helpers - typeof";return Bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bo(e)}function Xk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Zk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xk(Object(n),!0).forEach(function(r){yy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_O(r.key),r)}}function aq(e,t,n){return t&&rq(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function iq(e,t,n){return t=Zf(t),sq(e,jO()?Reflect.construct(t,n||[],Zf(e).constructor):t.apply(e,n))}function sq(e,t){if(t&&(Bo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oq(e)}function oq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jO=function(){return!!e})()}function Zf(e){return Zf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zf(e)}function lq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vy(e,t)}function vy(e,t){return vy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},vy(e,t)}function yy(e,t,n){return t=_O(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _O(e){var t=cq(e,"string");return Bo(t)=="symbol"?t:t+""}function cq(e,t){if(Bo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Qk=1,uq=function(e){function t(){var n;nq(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=iq(this,t,[].concat(a)),yy(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),yy(n,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return lq(t,e),aq(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>Qk||Math.abs(r.height-this.state.lastBoundingBox.height)>Qk)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,s=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,d=a.coordinate,f=a.hasPayload,h=a.isAnimationActive,p=a.offset,g=a.position,m=a.reverseDirection,y=a.useTranslate3d,v=a.viewBox,b=a.wrapperStyle,w=tq({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:v}),N=w.cssClasses,S=w.cssProperties,x=Zk(Zk({transition:h&&s?"transform ".concat(l,"ms ").concat(c):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&f?"visible":"hidden",position:"absolute",top:0,left:0},b);return H.createElement("div",{tabIndex:-1,className:N,style:x,ref:function(j){r.wrapperNode=j}},u)}}])}(k.PureComponent),dq=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},zu={isSsr:dq()};function zo(e){"@babel/helpers - typeof";return zo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zo(e)}function Jk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function e1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jk(Object(n),!0).forEach(function(r){i0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,CO(r.key),r)}}function pq(e,t,n){return t&&hq(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function mq(e,t,n){return t=Qf(t),gq(e,AO()?Reflect.construct(t,n||[],Qf(e).constructor):t.apply(e,n))}function gq(e,t){if(t&&(zo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vq(e)}function vq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AO=function(){return!!e})()}function Qf(e){return Qf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qf(e)}function yq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&by(e,t)}function by(e,t){return by=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},by(e,t)}function i0(e,t,n){return t=CO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CO(e){var t=bq(e,"string");return zo(t)=="symbol"?t:t+""}function bq(e,t){if(zo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function xq(e){return e.dataKey}function wq(e,t){return H.isValidElement(e)?H.cloneElement(e,t):typeof e=="function"?H.createElement(e,t):H.createElement(YG,t)}var gn=function(e){function t(){return fq(this,t),mq(this,t,arguments)}return yq(t,e),pq(t,[{key:"render",value:function(){var r=this,a=this.props,s=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,d=a.coordinate,f=a.filterNull,h=a.isAnimationActive,p=a.offset,g=a.payload,m=a.payloadUniqBy,y=a.position,v=a.reverseDirection,b=a.useTranslate3d,w=a.viewBox,N=a.wrapperStyle,S=g??[];f&&S.length&&(S=yO(g.filter(function(E){return E.value!=null&&(E.hide!==!0||r.props.includeHidden)}),m,xq));var x=S.length>0;return H.createElement(uq,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:s,coordinate:d,hasPayload:x,offset:p,position:y,reverseDirection:v,useTranslate3d:b,viewBox:w,wrapperStyle:N},wq(u,e1(e1({},this.props),{},{payload:S})))}}])}(k.PureComponent);i0(gn,"displayName","Tooltip");i0(gn,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!zu.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Sq=ca,kq=function(){return Sq.Date.now()},Nq=kq,Eq=/\s/;function jq(e){for(var t=e.length;t--&&Eq.test(e.charAt(t)););return t}var _q=jq,Aq=_q,Cq=/^\s+/;function Tq(e){return e&&e.slice(0,Aq(e)+1).replace(Cq,"")}var Oq=Tq,Pq=Oq,t1=ki,Rq=ul,n1=NaN,Mq=/^[-+]0x[0-9a-f]+$/i,Iq=/^0b[01]+$/i,$q=/^0o[0-7]+$/i,Lq=parseInt;function Dq(e){if(typeof e=="number")return e;if(Rq(e))return n1;if(t1(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=t1(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Pq(e);var n=Iq.test(e);return n||$q.test(e)?Lq(e.slice(2),n?2:8):Mq.test(e)?n1:+e}var TO=Dq,Bq=ki,tg=Nq,r1=TO,zq="Expected a function",Fq=Math.max,Uq=Math.min;function Wq(e,t,n){var r,a,s,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(zq);t=r1(t)||0,Bq(n)&&(d=!!n.leading,f="maxWait"in n,s=f?Fq(r1(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function p(x){var E=r,j=a;return r=a=void 0,u=x,o=e.apply(j,E),o}function g(x){return u=x,l=setTimeout(v,t),d?p(x):o}function m(x){var E=x-c,j=x-u,C=t-E;return f?Uq(C,s-j):C}function y(x){var E=x-c,j=x-u;return c===void 0||E>=t||E<0||f&&j>=s}function v(){var x=tg();if(y(x))return b(x);l=setTimeout(v,m(x))}function b(x){return l=void 0,h&&r?p(x):(r=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=a=l=void 0}function N(){return l===void 0?o:b(tg())}function S(){var x=tg(),E=y(x);if(r=arguments,a=this,c=x,E){if(l===void 0)return g(c);if(f)return clearTimeout(l),l=setTimeout(v,t),p(c)}return l===void 0&&(l=setTimeout(v,t)),o}return S.cancel=w,S.flush=N,S}var Hq=Wq,Gq=Hq,qq=ki,Kq="Expected a function";function Vq(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(Kq);return qq(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),Gq(e,t,{leading:r,maxWait:t,trailing:a})}var Yq=Vq;const OO=Qe(Yq);function Xc(e){"@babel/helpers - typeof";return Xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xc(e)}function a1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function jd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a1(Object(n),!0).forEach(function(r){Xq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xq(e,t,n){return t=Zq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zq(e){var t=Qq(e,"string");return Xc(t)=="symbol"?t:t+""}function Qq(e,t){if(Xc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jq(e,t){return rK(e)||nK(e,t)||tK(e,t)||eK()}function eK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
80
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tK(e,t){if(e){if(typeof e=="string")return i1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i1(e,t)}}function i1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function rK(e){if(Array.isArray(e))return e}var Gi=k.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,a=r===void 0?{width:-1,height:-1}:r,s=e.width,o=s===void 0?"100%":s,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,p=e.children,g=e.debounce,m=g===void 0?0:g,y=e.id,v=e.className,b=e.onResize,w=e.style,N=w===void 0?{}:w,S=k.useRef(null),x=k.useRef();x.current=b,k.useImperativeHandle(t,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),S.current},configurable:!0})});var E=k.useState({containerWidth:a.width,containerHeight:a.height}),j=Jq(E,2),C=j[0],T=j[1],$=k.useCallback(function(I,L){T(function(F){var z=Math.round(I),M=Math.round(L);return F.containerWidth===z&&F.containerHeight===M?F:{containerWidth:z,containerHeight:M}})},[]);k.useEffect(function(){var I=function(U){var A,Z=U[0].contentRect,D=Z.width,P=Z.height;$(D,P),(A=x.current)===null||A===void 0||A.call(x,D,P)};m>0&&(I=OO(I,m,{trailing:!0,leading:!1}));var L=new ResizeObserver(I),F=S.current.getBoundingClientRect(),z=F.width,M=F.height;return $(z,M),L.observe(S.current),function(){L.disconnect()}},[$,m]);var R=k.useMemo(function(){var I=C.containerWidth,L=C.containerHeight;if(I<0||L<0)return null;_a(Zi(o)||Zi(c),`The width(%s) and height(%s) are both fixed numbers,
81
- maybe you don't need to use a ResponsiveContainer.`,o,c),_a(!n||n>0,"The aspect(%s) must be greater than zero.",n);var F=Zi(o)?I:o,z=Zi(c)?L:c;n&&n>0&&(F?z=F/n:z&&(F=z*n),h&&z>h&&(z=h)),_a(F>0||z>0,`The width(%s) and height(%s) of chart should be greater than 0,
82
- please check the style of container, or the props width(%s) and height(%s),
83
- or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
84
- height and width.`,F,z,o,c,d,f,n);var M=!Array.isArray(p)&&ja(p.type).endsWith("Chart");return H.Children.map(p,function(O){return H.isValidElement(O)?k.cloneElement(O,jd({width:F,height:z},M?{style:jd({height:"100%",width:"100%",maxHeight:z,maxWidth:F},O.props.style)}:{})):O})},[n,p,c,h,f,d,C,o]);return H.createElement("div",{id:y?"".concat(y):void 0,className:Ye("recharts-responsive-container",v),style:jd(jd({},N),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:S},R)}),Zc=function(t){return null};Zc.displayName="Cell";function Qc(e){"@babel/helpers - typeof";return Qc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qc(e)}function s1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function xy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s1(Object(n),!0).forEach(function(r){aK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aK(e,t,n){return t=iK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iK(e){var t=sK(e,"string");return Qc(t)=="symbol"?t:t+""}function sK(e,t){if(Qc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ws={widthCache:{},cacheCount:0},oK=2e3,lK={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},o1="recharts_measurement_span";function cK(e){var t=xy({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var bc=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||zu.isSsr)return{width:0,height:0};var r=cK(n),a=JSON.stringify({text:t,copyStyle:r});if(Ws.widthCache[a])return Ws.widthCache[a];try{var s=document.getElementById(o1);s||(s=document.createElement("span"),s.setAttribute("id",o1),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var o=xy(xy({},lK),r);Object.assign(s.style,o),s.textContent="".concat(t);var l=s.getBoundingClientRect(),c={width:l.width,height:l.height};return Ws.widthCache[a]=c,++Ws.cacheCount>oK&&(Ws.cacheCount=0,Ws.widthCache={}),c}catch{return{width:0,height:0}}},uK=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Jc(e){"@babel/helpers - typeof";return Jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jc(e)}function Jf(e,t){return pK(e)||hK(e,t)||fK(e,t)||dK()}function dK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
85
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fK(e,t){if(e){if(typeof e=="string")return l1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l1(e,t)}}function l1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function pK(e){if(Array.isArray(e))return e}function mK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vK(r.key),r)}}function gK(e,t,n){return t&&c1(e.prototype,t),n&&c1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vK(e){var t=yK(e,"string");return Jc(t)=="symbol"?t:t+""}function yK(e,t){if(Jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var u1=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,d1=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,bK=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,xK=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,PO={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},wK=Object.keys(PO),ho="NaN";function SK(e,t){return e*PO[t]}var _d=function(){function e(t,n){mK(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!bK.test(n)&&(this.num=NaN,this.unit=""),wK.includes(n)&&(this.num=SK(t,n),this.unit="px")}return gK(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,a=(r=xK.exec(n))!==null&&r!==void 0?r:[],s=Jf(a,3),o=s[1],l=s[2];return new e(parseFloat(o),l??"")}}])}();function RO(e){if(e.includes(ho))return ho;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=u1.exec(t))!==null&&n!==void 0?n:[],a=Jf(r,4),s=a[1],o=a[2],l=a[3],c=_d.parse(s??""),u=_d.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return ho;t=t.replace(u1,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=d1.exec(t))!==null&&f!==void 0?f:[],p=Jf(h,4),g=p[1],m=p[2],y=p[3],v=_d.parse(g??""),b=_d.parse(y??""),w=m==="+"?v.add(b):v.subtract(b);if(w.isNaN())return ho;t=t.replace(d1,w.toString())}return t}var f1=/\(([^()]*)\)/;function kK(e){for(var t=e;t.includes("(");){var n=f1.exec(t),r=Jf(n,2),a=r[1];t=t.replace(f1,RO(a))}return t}function NK(e){var t=e.replace(/\s+/g,"");return t=kK(t),t=RO(t),t}function EK(e){try{return NK(e)}catch{return ho}}function ng(e){var t=EK(e.slice(5,-1));return t===ho?"":t}var jK=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],_K=["dx","dy","angle","className","breakAll"];function wy(){return wy=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},wy.apply(this,arguments)}function h1(e,t){if(e==null)return{};var n=AK(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function AK(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function p1(e,t){return PK(e)||OK(e,t)||TK(e,t)||CK()}function CK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
86
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TK(e,t){if(e){if(typeof e=="string")return m1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m1(e,t)}}function m1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function OK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function PK(e){if(Array.isArray(e))return e}var MO=/[ \f\n\r\t\v\u2028\u2029]+/,IO=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var s=[];Xe(n)||(r?s=n.toString().split(""):s=n.toString().split(MO));var o=s.map(function(c){return{word:c,width:bc(c,a).width}}),l=r?0:bc("ย ",a).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},RK=function(t,n,r,a,s){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=de(o),f=l,h=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return F.reduce(function(z,M){var O=M.word,U=M.width,A=z[z.length-1];if(A&&(a==null||s||A.width+U+r<Number(a)))A.words.push(O),A.width+=U+r;else{var Z={words:[O],width:U};z.push(Z)}return z},[])},p=h(n),g=function(F){return F.reduce(function(z,M){return z.width>M.width?z:M})};if(!d)return p;for(var m="โ€ฆ",y=function(F){var z=f.slice(0,F),M=IO({breakAll:u,style:c,children:z+m}).wordsWithComputedWidth,O=h(M),U=O.length>o||g(O).width>Number(a);return[U,O]},v=0,b=f.length-1,w=0,N;v<=b&&w<=f.length-1;){var S=Math.floor((v+b)/2),x=S-1,E=y(x),j=p1(E,2),C=j[0],T=j[1],$=y(S),R=p1($,1),I=R[0];if(!C&&!I&&(v=S+1),C&&I&&(b=S-1),!C&&I){N=T;break}w++}return N||p},g1=function(t){var n=Xe(t)?[]:t.toString().split(MO);return[{words:n}]},MK=function(t){var n=t.width,r=t.scaleToFit,a=t.children,s=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!zu.isSsr){var c,u,d=IO({breakAll:o,children:a,style:s});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return g1(a);return RK({breakAll:o,children:a,maxLines:l,style:s},c,u,n,r)}return g1(a)},v1="#808080",eh=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,s=a===void 0?0:a,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,p=h===void 0?"start":h,g=t.verticalAnchor,m=g===void 0?"end":g,y=t.fill,v=y===void 0?v1:y,b=h1(t,jK),w=k.useMemo(function(){return MK({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:f,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,f,b.style,b.width]),N=b.dx,S=b.dy,x=b.angle,E=b.className,j=b.breakAll,C=h1(b,_K);if(!qt(r)||!qt(s))return null;var T=r+(de(N)?N:0),$=s+(de(S)?S:0),R;switch(m){case"start":R=ng("calc(".concat(u,")"));break;case"middle":R=ng("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:R=ng("calc(".concat(w.length-1," * -").concat(l,")"));break}var I=[];if(f){var L=w[0].width,F=b.width;I.push("scale(".concat((de(F)?F/L:1)/L,")"))}return x&&I.push("rotate(".concat(x,", ").concat(T,", ").concat($,")")),I.length&&(C.transform=I.join(" ")),H.createElement("text",wy({},Ve(C,!0),{x:T,y:$,className:Ye("recharts-text",E),textAnchor:p,fill:v.includes("url")?v1:v}),w.map(function(z,M){var O=z.words.join(j?"":" ");return H.createElement("tspan",{x:T,dy:M===0?R:l,key:"".concat(O,"-").concat(M)},O)}))};function pi(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function IK(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function s0(e){let t,n,r;e.length!==2?(t=pi,n=(l,c)=>pi(e(l),c),r=(l,c)=>e(l)-c):(t=e===pi||e===IK?e:$K,n=e,r=e);function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=a(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:a,center:o,right:s}}function $K(){return 0}function $O(e){return e===null?NaN:+e}function*LK(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const DK=s0(pi),Fu=DK.right;s0($O).center;class y1 extends Map{constructor(t,n=FK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(b1(this,t))}has(t){return super.has(b1(this,t))}set(t,n){return super.set(BK(this,t),n)}delete(t){return super.delete(zK(this,t))}}function b1({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function BK({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function zK({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function FK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function UK(e=pi){if(e===pi)return LO;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 LO(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const WK=Math.sqrt(50),HK=Math.sqrt(10),GK=Math.sqrt(2);function th(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),s=r/Math.pow(10,a),o=s>=WK?10:s>=HK?5:s>=GK?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?th(e,t,n*2):[l,c,u]}function Sy(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,s,o]=r?th(t,e,n):th(e,t,n);if(!(s>=a))return[];const l=s-a+1,c=new Array(l);if(r)if(o<0)for(let u=0;u<l;++u)c[u]=(s-u)/-o;else for(let u=0;u<l;++u)c[u]=(s-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(a+u)/-o;else for(let u=0;u<l;++u)c[u]=(a+u)*o;return c}function ky(e,t,n){return t=+t,e=+e,n=+n,th(e,t,n)[2]}function Ny(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?ky(t,e,n):ky(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function x1(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function w1(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function DO(e,t,n=0,r=1/0,a){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(a=a===void 0?LO:UK(a);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));DO(e,t,p,g,a)}const s=e[t];let o=n,l=r;for(Gl(e,n,t),a(e[r],s)>0&&Gl(e,n,r);o<l;){for(Gl(e,o,l),++o,--l;a(e[o],s)<0;)++o;for(;a(e[l],s)>0;)--l}a(e[n],s)===0?Gl(e,n,l):(++l,Gl(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Gl(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function qK(e,t,n){if(e=Float64Array.from(LK(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return w1(e);if(t>=1)return x1(e);var r,a=(r-1)*t,s=Math.floor(a),o=x1(DO(e,s).subarray(0,s+1)),l=w1(e.subarray(s+1));return o+(l-o)*(a-s)}}function KK(e,t,n=$O){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,a=(r-1)*t,s=Math.floor(a),o=+n(e[s],s,e),l=+n(e[s+1],s+1,e);return o+(l-o)*(a-s)}}function VK(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(a);++r<a;)s[r]=e+r*n;return s}function Er(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function za(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 Ey=Symbol("implicit");function o0(){var e=new y1,t=[],n=[],r=Ey;function a(s){let o=e.get(s);if(o===void 0){if(r!==Ey)return r;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return a.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new y1;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(s){return arguments.length?(n=Array.from(s),a):n.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.copy=function(){return o0(t,n).unknown(r)},Er.apply(a,arguments),a}function eu(){var e=o0().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,s,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=a<r,g=p?a:r,m=p?r:a;s=(m-g)/Math.max(1,h-c+u*2),l&&(s=Math.floor(s)),g+=(m-g-s*(h-c))*d,o=s*(1-c),l&&(g=Math.round(g),o=Math.round(o));var y=VK(h).map(function(v){return g+s*v});return n(p?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,a]=h,r=+r,a=+a,f()):[r,a]},e.rangeRound=function(h){return[r,a]=h,r=+r,a=+a,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return s},e.round=function(h){return arguments.length?(l=!!h,f()):l},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 eu(t(),[r,a]).round(l).paddingInner(c).paddingOuter(u).align(d)},Er.apply(f(),arguments)}function BO(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return BO(t())},e}function xc(){return BO(eu.apply(null,arguments).paddingInner(1))}function l0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zO(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Uu(){}var tu=.7,nh=1/tu,Eo="\\s*([+-]?\\d+)\\s*",nu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ia="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",YK=/^#([0-9a-f]{3,8})$/,XK=new RegExp(`^rgb\\(${Eo},${Eo},${Eo}\\)$`),ZK=new RegExp(`^rgb\\(${ia},${ia},${ia}\\)$`),QK=new RegExp(`^rgba\\(${Eo},${Eo},${Eo},${nu}\\)$`),JK=new RegExp(`^rgba\\(${ia},${ia},${ia},${nu}\\)$`),eV=new RegExp(`^hsl\\(${nu},${ia},${ia}\\)$`),tV=new RegExp(`^hsla\\(${nu},${ia},${ia},${nu}\\)$`),S1={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};l0(Uu,ru,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:k1,formatHex:k1,formatHex8:nV,formatHsl:rV,formatRgb:N1,toString:N1});function k1(){return this.rgb().formatHex()}function nV(){return this.rgb().formatHex8()}function rV(){return FO(this).formatHsl()}function N1(){return this.rgb().formatRgb()}function ru(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=YK.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?E1(t):n===3?new Dn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ad(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ad(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=XK.exec(e))?new Dn(t[1],t[2],t[3],1):(t=ZK.exec(e))?new Dn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=QK.exec(e))?Ad(t[1],t[2],t[3],t[4]):(t=JK.exec(e))?Ad(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=eV.exec(e))?A1(t[1],t[2]/100,t[3]/100,1):(t=tV.exec(e))?A1(t[1],t[2]/100,t[3]/100,t[4]):S1.hasOwnProperty(e)?E1(S1[e]):e==="transparent"?new Dn(NaN,NaN,NaN,0):null}function E1(e){return new Dn(e>>16&255,e>>8&255,e&255,1)}function Ad(e,t,n,r){return r<=0&&(e=t=n=NaN),new Dn(e,t,n,r)}function aV(e){return e instanceof Uu||(e=ru(e)),e?(e=e.rgb(),new Dn(e.r,e.g,e.b,e.opacity)):new Dn}function jy(e,t,n,r){return arguments.length===1?aV(e):new Dn(e,t,n,r??1)}function Dn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}l0(Dn,jy,zO(Uu,{brighter(e){return e=e==null?nh:Math.pow(nh,e),new Dn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tu:Math.pow(tu,e),new Dn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Dn(is(this.r),is(this.g),is(this.b),rh(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:j1,formatHex:j1,formatHex8:iV,formatRgb:_1,toString:_1}));function j1(){return`#${Qi(this.r)}${Qi(this.g)}${Qi(this.b)}`}function iV(){return`#${Qi(this.r)}${Qi(this.g)}${Qi(this.b)}${Qi((isNaN(this.opacity)?1:this.opacity)*255)}`}function _1(){const e=rh(this.opacity);return`${e===1?"rgb(":"rgba("}${is(this.r)}, ${is(this.g)}, ${is(this.b)}${e===1?")":`, ${e})`}`}function rh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function is(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qi(e){return e=is(e),(e<16?"0":"")+e.toString(16)}function A1(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ir(e,t,n,r)}function FO(e){if(e instanceof Ir)return new Ir(e.h,e.s,e.l,e.opacity);if(e instanceof Uu||(e=ru(e)),!e)return new Ir;if(e instanceof Ir)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,l=s-a,c=(s+a)/2;return l?(t===s?o=(n-r)/l+(n<r)*6:n===s?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?s+a:2-s-a,o*=60):l=c>0&&c<1?0:o,new Ir(o,l,c,e.opacity)}function sV(e,t,n,r){return arguments.length===1?FO(e):new Ir(e,t,n,r??1)}function Ir(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}l0(Ir,sV,zO(Uu,{brighter(e){return e=e==null?nh:Math.pow(nh,e),new Ir(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tu:Math.pow(tu,e),new Ir(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,a=2*n-r;return new Dn(rg(e>=240?e-240:e+120,a,r),rg(e,a,r),rg(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Ir(C1(this.h),Cd(this.s),Cd(this.l),rh(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=rh(this.opacity);return`${e===1?"hsl(":"hsla("}${C1(this.h)}, ${Cd(this.s)*100}%, ${Cd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function C1(e){return e=(e||0)%360,e<0?e+360:e}function Cd(e){return Math.max(0,Math.min(1,e||0))}function rg(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 c0=e=>()=>e;function oV(e,t){return function(n){return e+n*t}}function lV(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 cV(e){return(e=+e)==1?UO:function(t,n){return n-t?lV(t,n,e):c0(isNaN(t)?n:t)}}function UO(e,t){var n=t-e;return n?oV(e,n):c0(isNaN(e)?t:e)}const T1=function e(t){var n=cV(t);function r(a,s){var o=n((a=jy(a)).r,(s=jy(s)).r),l=n(a.g,s.g),c=n(a.b,s.b),u=UO(a.opacity,s.opacity);return function(d){return a.r=o(d),a.g=l(d),a.b=c(d),a.opacity=u(d),a+""}}return r.gamma=e,r}(1);function uV(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(s){for(a=0;a<n;++a)r[a]=e[a]*(1-s)+t[a]*s;return r}}function dV(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function fV(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),s=new Array(n),o;for(o=0;o<r;++o)a[o]=yl(e[o],t[o]);for(;o<n;++o)s[o]=t[o];return function(l){for(o=0;o<r;++o)s[o]=a[o](l);return s}}function hV(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ah(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function pV(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=yl(e[a],t[a]):r[a]=t[a];return function(s){for(a in n)r[a]=n[a](s);return r}}var _y=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ag=new RegExp(_y.source,"g");function mV(e){return function(){return e}}function gV(e){return function(t){return e(t)+""}}function vV(e,t){var n=_y.lastIndex=ag.lastIndex=0,r,a,s,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=_y.exec(e))&&(a=ag.exec(t));)(s=a.index)>n&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(r=r[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:ah(r,a)})),n=ag.lastIndex;return n<t.length&&(s=t.slice(n),l[o]?l[o]+=s:l[++o]=s),l.length<2?c[0]?gV(c[0].x):mV(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function yl(e,t){var n=typeof t,r;return t==null||n==="boolean"?c0(t):(n==="number"?ah:n==="string"?(r=ru(t))?(t=r,T1):vV:t instanceof ru?T1:t instanceof Date?hV:dV(t)?uV:Array.isArray(t)?fV:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?pV:ah)(e,t)}function u0(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function yV(e,t){t===void 0&&(t=e,e=yl);for(var n=0,r=t.length-1,a=t[0],s=new Array(r<0?0:r);n<r;)s[n]=e(a,a=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return s[l](o-l)}}function bV(e){return function(){return e}}function ih(e){return+e}var O1=[0,1];function Cn(e){return e}function Ay(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:bV(isNaN(t)?NaN:.5)}function xV(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function wV(e,t,n){var r=e[0],a=e[1],s=t[0],o=t[1];return a<r?(r=Ay(a,r),s=n(o,s)):(r=Ay(r,a),s=n(s,o)),function(l){return s(r(l))}}function SV(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),s=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=Ay(e[o],e[o+1]),s[o]=n(t[o],t[o+1]);return function(l){var c=Fu(e,l,1,r)-1;return s[c](a[c](l))}}function Wu(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function $p(){var e=O1,t=O1,n=yl,r,a,s,o=Cn,l,c,u;function d(){var h=Math.min(e.length,t.length);return o!==Cn&&(o=xV(e[0],e[h-1])),l=h>2?SV:wV,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?s:(c||(c=l(e.map(r),t,n)))(r(o(h)))}return f.invert=function(h){return o(a((u||(u=l(t,e.map(r),ah)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,ih),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=u0,d()},f.clamp=function(h){return arguments.length?(o=h?!0:Cn,d()):o!==Cn},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(s=h,f):s},function(h,p){return r=h,a=p,d()}}function d0(){return $p()(Cn,Cn)}function kV(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function sh(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 Fo(e){return e=sh(Math.abs(e)),e?e[1]:NaN}function NV(e,t){return function(n,r){for(var a=n.length,s=[],o=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),s.push(n.substring(a-=l,a+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return s.reverse().join(t)}}function EV(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var jV=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function au(e){if(!(t=jV.exec(e)))throw new Error("invalid format: "+e);var t;return new f0({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]})}au.prototype=f0.prototype;function f0(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+""}f0.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 _V(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var oh;function AV(e,t){var n=sh(e,t);if(!n)return oh=void 0,e.toPrecision(t);var r=n[0],a=n[1],s=a-(oh=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return s===o?r:s>o?r+new Array(s-o+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+sh(e,Math.max(0,t+s-1))[0]}function P1(e,t){var n=sh(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const R1={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:kV,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)=>P1(e*100,t),r:P1,s:AV,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function M1(e){return e}var I1=Array.prototype.map,$1=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"];function CV(e){var t=e.grouping===void 0||e.thousands===void 0?M1:NV(I1.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?M1:EV(I1.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"โˆ’":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=au(f);var p=f.fill,g=f.align,m=f.sign,y=f.symbol,v=f.zero,b=f.width,w=f.comma,N=f.precision,S=f.trim,x=f.type;x==="n"?(w=!0,x="g"):R1[x]||(N===void 0&&(N=12),S=!0,x="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var E=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():""),j=(y==="$"?r:/[%p]/.test(x)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),C=R1[x],T=/[defgprs%]/.test(x);N=N===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function $(R){var I=E,L=j,F,z,M;if(x==="c")L=C(R)+L,R="";else{R=+R;var O=R<0||1/R<0;if(R=isNaN(R)?c:C(Math.abs(R),N),S&&(R=_V(R)),O&&+R==0&&m!=="+"&&(O=!1),I=(O?m==="("?m:l:m==="-"||m==="("?"":m)+I,L=(x==="s"&&!isNaN(R)&&oh!==void 0?$1[8+oh/3]:"")+L+(O&&m==="("?")":""),T){for(F=-1,z=R.length;++F<z;)if(M=R.charCodeAt(F),48>M||M>57){L=(M===46?a+R.slice(F+1):R.slice(F))+L,R=R.slice(0,F);break}}}w&&!v&&(R=t(R,1/0));var U=I.length+R.length+L.length,A=U<b?new Array(b-U+1).join(p):"";switch(w&&v&&(R=t(A+R,A.length?b-L.length:1/0),A=""),g){case"<":R=I+R+L+A;break;case"=":R=I+A+R+L;break;case"^":R=A.slice(0,U=A.length>>1)+I+R+L+A.slice(U);break;default:R=A+I+R+L;break}return s(R)}return $.toString=function(){return f+""},$}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(Fo(h)/3)))*3,g=Math.pow(10,-p),m=u((f=au(f),f.type="f",f),{suffix:$1[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:d}}var Td,h0,WO;TV({thousands:",",grouping:[3],currency:["$",""]});function TV(e){return Td=CV(e),h0=Td.format,WO=Td.formatPrefix,Td}function OV(e){return Math.max(0,-Fo(Math.abs(e)))}function PV(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Fo(t)/3)))*3-Fo(Math.abs(e)))}function RV(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Fo(t)-Fo(e))+1}function HO(e,t,n,r){var a=Ny(e,t,n),s;switch(r=au(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=PV(a,o))&&(r.precision=s),WO(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=RV(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=OV(a))&&(r.precision=s-(r.type==="%")*2);break}}return h0(r)}function Ei(e){var t=e.domain;return e.ticks=function(n){var r=t();return Sy(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return HO(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,s=r.length-1,o=r[a],l=r[s],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=a,a=s,s=u);d-- >0;){if(u=ky(o,l,n),u===c)return r[a]=o,r[s]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function lh(){var e=d0();return e.copy=function(){return Wu(e,lh())},Er.apply(e,arguments),Ei(e)}function GO(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,ih),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return GO(e).unknown(t)},e=arguments.length?Array.from(e,ih):[0,1],Ei(n)}function qO(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],s=e[r],o;return s<a&&(o=n,n=r,r=o,o=a,a=s,s=o),e[n]=t.floor(a),e[r]=t.ceil(s),e}function L1(e){return Math.log(e)}function D1(e){return Math.exp(e)}function MV(e){return-Math.log(-e)}function IV(e){return-Math.exp(-e)}function $V(e){return isFinite(e)?+("1e"+e):e<0?0:e}function LV(e){return e===10?$V:e===Math.E?Math.exp:t=>Math.pow(e,t)}function DV(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 B1(e){return(t,n)=>-e(-t,n)}function p0(e){const t=e(L1,D1),n=t.domain;let r=10,a,s;function o(){return a=DV(r),s=LV(r),n()[0]<0?(a=B1(a),s=B1(s),e(MV,IV)):e(L1,D1),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=a(u),p=a(d),g,m;const y=l==null?10:+l;let v=[];if(!(r%1)&&p-h<y){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(g=1;g<r;++g)if(m=h<0?g/s(-h):g*s(h),!(m<u)){if(m>d)break;v.push(m)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(m=h>0?g/s(-h):g*s(h),!(m<u)){if(m>d)break;v.push(m)}v.length*2<y&&(v=Sy(u,d,y))}else v=Sy(h,p,Math.min(p-h,y)).map(s);return f?v.reverse():v},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=au(c)).precision==null&&(c.trim=!0),c=h0(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/s(Math.round(a(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(qO(n(),{floor:l=>s(Math.floor(a(l))),ceil:l=>s(Math.ceil(a(l)))})),t}function KO(){const e=p0($p()).domain([1,10]);return e.copy=()=>Wu(e,KO()).base(e.base()),Er.apply(e,arguments),e}function z1(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function F1(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function m0(e){var t=1,n=e(z1(t),F1(t));return n.constant=function(r){return arguments.length?e(z1(t=+r),F1(t)):t},Ei(n)}function VO(){var e=m0($p());return e.copy=function(){return Wu(e,VO()).constant(e.constant())},Er.apply(e,arguments)}function U1(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function BV(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function zV(e){return e<0?-e*e:e*e}function g0(e){var t=e(Cn,Cn),n=1;function r(){return n===1?e(Cn,Cn):n===.5?e(BV,zV):e(U1(n),U1(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Ei(t)}function v0(){var e=g0($p());return e.copy=function(){return Wu(e,v0()).exponent(e.exponent())},Er.apply(e,arguments),e}function FV(){return v0.apply(null,arguments).exponent(.5)}function W1(e){return Math.sign(e)*e*e}function UV(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function YO(){var e=d0(),t=[0,1],n=!1,r;function a(s){var o=UV(e(s));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(s){return e.invert(W1(s))},a.domain=function(s){return arguments.length?(e.domain(s),a):e.domain()},a.range=function(s){return arguments.length?(e.range((t=Array.from(s,ih)).map(W1)),a):t.slice()},a.rangeRound=function(s){return a.range(s).round(!0)},a.round=function(s){return arguments.length?(n=!!s,a):n},a.clamp=function(s){return arguments.length?(e.clamp(s),a):e.clamp()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.copy=function(){return YO(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Er.apply(a,arguments),Ei(a)}function XO(){var e=[],t=[],n=[],r;function a(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=KK(e,o/l);return s}function s(o){return o==null||isNaN(o=+o)?r:t[Fu(n,o)]}return s.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},s.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(pi),a()},s.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.quantiles=function(){return n.slice()},s.copy=function(){return XO().domain(e).range(t).unknown(r)},Er.apply(s,arguments)}function ZO(){var e=0,t=1,n=1,r=[.5],a=[0,1],s;function o(c){return c!=null&&c<=c?a[Fu(r,c,0,n)]:s}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(a=Array.from(c)).length-1,l()):a.slice()},o.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(s=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return ZO().domain([e,t]).range(a).unknown(s)},Er.apply(Ei(o),arguments)}function QO(){var e=[.5],t=[0,1],n,r=1;function a(s){return s!=null&&s<=s?t[Fu(e,s,0,r)]:n}return a.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},a.unknown=function(s){return arguments.length?(n=s,a):n},a.copy=function(){return QO().domain(e).range(t).unknown(n)},Er.apply(a,arguments)}const ig=new Date,sg=new Date;function Kt(e,t,n,r){function a(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return a.floor=s=>(e(s=new Date(+s)),s),a.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),a.round=s=>{const o=a(s),l=a.ceil(s);return s-o<l-s?o:l},a.offset=(s,o)=>(t(s=new Date(+s),o==null?1:Math.floor(o)),s),a.range=(s,o,l)=>{const c=[];if(s=a.ceil(s),l=l==null?1:Math.floor(l),!(s<o)||!(l>0))return c;let u;do c.push(u=new Date(+s)),t(s,l),e(s);while(u<s&&s<o);return c},a.filter=s=>Kt(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!s(o););else for(;--l>=0;)for(;t(o,1),!s(o););}),n&&(a.count=(s,o)=>(ig.setTime(+s),sg.setTime(+o),e(ig),e(sg),Math.floor(n(ig,sg))),a.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?a.filter(r?o=>r(o)%s===0:o=>a.count(0,o)%s===0):a)),a}const ch=Kt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ch.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Kt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ch);ch.range;const Sa=1e3,yr=Sa*60,ka=yr*60,Ra=ka*24,y0=Ra*7,H1=Ra*30,og=Ra*365,Ji=Kt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Sa)},(e,t)=>(t-e)/Sa,e=>e.getUTCSeconds());Ji.range;const b0=Kt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Sa)},(e,t)=>{e.setTime(+e+t*yr)},(e,t)=>(t-e)/yr,e=>e.getMinutes());b0.range;const x0=Kt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*yr)},(e,t)=>(t-e)/yr,e=>e.getUTCMinutes());x0.range;const w0=Kt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Sa-e.getMinutes()*yr)},(e,t)=>{e.setTime(+e+t*ka)},(e,t)=>(t-e)/ka,e=>e.getHours());w0.range;const S0=Kt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ka)},(e,t)=>(t-e)/ka,e=>e.getUTCHours());S0.range;const Hu=Kt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*yr)/Ra,e=>e.getDate()-1);Hu.range;const Lp=Kt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ra,e=>e.getUTCDate()-1);Lp.range;const JO=Kt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ra,e=>Math.floor(e/Ra));JO.range;function Es(e){return Kt(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())*yr)/y0)}const Dp=Es(0),uh=Es(1),WV=Es(2),HV=Es(3),Uo=Es(4),GV=Es(5),qV=Es(6);Dp.range;uh.range;WV.range;HV.range;Uo.range;GV.range;qV.range;function js(e){return Kt(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)/y0)}const Bp=js(0),dh=js(1),KV=js(2),VV=js(3),Wo=js(4),YV=js(5),XV=js(6);Bp.range;dh.range;KV.range;VV.range;Wo.range;YV.range;XV.range;const k0=Kt(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());k0.range;const N0=Kt(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());N0.range;const Ma=Kt(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());Ma.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kt(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)});Ma.range;const Ia=Kt(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());Ia.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kt(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)});Ia.range;function eP(e,t,n,r,a,s){const o=[[Ji,1,Sa],[Ji,5,5*Sa],[Ji,15,15*Sa],[Ji,30,30*Sa],[s,1,yr],[s,5,5*yr],[s,15,15*yr],[s,30,30*yr],[a,1,ka],[a,3,3*ka],[a,6,6*ka],[a,12,12*ka],[r,1,Ra],[r,2,2*Ra],[n,1,y0],[t,1,H1],[t,3,3*H1],[e,1,og]];function l(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=s0(([,,y])=>y).right(o,h);if(p===o.length)return e.every(Ny(u/og,d/og,f));if(p===0)return ch.every(Math.max(Ny(u,d,f),1));const[g,m]=o[h/o[p-1][2]<o[p][2]/h?p-1:p];return g.every(m)}return[l,c]}const[ZV,QV]=eP(Ia,N0,Bp,JO,S0,x0),[JV,e7]=eP(Ma,k0,Dp,Hu,w0,b0);function lg(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 cg(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 ql(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function t7(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,s=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=Kl(a),d=Vl(a),f=Kl(s),h=Vl(s),p=Kl(o),g=Vl(o),m=Kl(l),y=Vl(l),v=Kl(c),b=Vl(c),w={a:M,A:O,b:U,B:A,c:null,d:X1,e:X1,f:N7,g:M7,G:$7,H:w7,I:S7,j:k7,L:tP,m:E7,M:j7,p:Z,q:D,Q:J1,s:eN,S:_7,u:A7,U:C7,V:T7,w:O7,W:P7,x:null,X:null,y:R7,Y:I7,Z:L7,"%":Q1},N={a:P,A:oe,b:be,B:pe,c:null,d:Z1,e:Z1,f:F7,g:Z7,G:J7,H:D7,I:B7,j:z7,L:rP,m:U7,M:W7,p:Ce,q:G,Q:J1,s:eN,S:H7,u:G7,U:q7,V:K7,w:V7,W:Y7,x:null,X:null,y:X7,Y:Q7,Z:eY,"%":Q1},S={a:T,A:$,b:R,B:I,c:L,d:V1,e:V1,f:v7,g:K1,G:q1,H:Y1,I:Y1,j:h7,L:g7,m:f7,M:p7,p:C,q:d7,Q:b7,s:x7,S:m7,u:s7,U:o7,V:l7,w:i7,W:c7,x:F,X:z,y:K1,Y:q1,Z:u7,"%":y7};w.x=x(n,w),w.X=x(r,w),w.c=x(t,w),N.x=x(n,N),N.X=x(r,N),N.c=x(t,N);function x(Y,ie){return function(le){var X=[],_e=-1,Ne=0,je=Y.length,ge,Le,fe;for(le instanceof Date||(le=new Date(+le));++_e<je;)Y.charCodeAt(_e)===37&&(X.push(Y.slice(Ne,_e)),(Le=G1[ge=Y.charAt(++_e)])!=null?ge=Y.charAt(++_e):Le=ge==="e"?" ":"0",(fe=ie[ge])&&(ge=fe(le,Le)),X.push(ge),Ne=_e+1);return X.push(Y.slice(Ne,_e)),X.join("")}}function E(Y,ie){return function(le){var X=ql(1900,void 0,1),_e=j(X,Y,le+="",0),Ne,je;if(_e!=le.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(ie&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(Ne=cg(ql(X.y,0,1)),je=Ne.getUTCDay(),Ne=je>4||je===0?dh.ceil(Ne):dh(Ne),Ne=Lp.offset(Ne,(X.V-1)*7),X.y=Ne.getUTCFullYear(),X.m=Ne.getUTCMonth(),X.d=Ne.getUTCDate()+(X.w+6)%7):(Ne=lg(ql(X.y,0,1)),je=Ne.getDay(),Ne=je>4||je===0?uh.ceil(Ne):uh(Ne),Ne=Hu.offset(Ne,(X.V-1)*7),X.y=Ne.getFullYear(),X.m=Ne.getMonth(),X.d=Ne.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),je="Z"in X?cg(ql(X.y,0,1)).getUTCDay():lg(ql(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(je+5)%7:X.w+X.U*7-(je+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,cg(X)):lg(X)}}function j(Y,ie,le,X){for(var _e=0,Ne=ie.length,je=le.length,ge,Le;_e<Ne;){if(X>=je)return-1;if(ge=ie.charCodeAt(_e++),ge===37){if(ge=ie.charAt(_e++),Le=S[ge in G1?ie.charAt(_e++):ge],!Le||(X=Le(Y,le,X))<0)return-1}else if(ge!=le.charCodeAt(X++))return-1}return X}function C(Y,ie,le){var X=u.exec(ie.slice(le));return X?(Y.p=d.get(X[0].toLowerCase()),le+X[0].length):-1}function T(Y,ie,le){var X=p.exec(ie.slice(le));return X?(Y.w=g.get(X[0].toLowerCase()),le+X[0].length):-1}function $(Y,ie,le){var X=f.exec(ie.slice(le));return X?(Y.w=h.get(X[0].toLowerCase()),le+X[0].length):-1}function R(Y,ie,le){var X=v.exec(ie.slice(le));return X?(Y.m=b.get(X[0].toLowerCase()),le+X[0].length):-1}function I(Y,ie,le){var X=m.exec(ie.slice(le));return X?(Y.m=y.get(X[0].toLowerCase()),le+X[0].length):-1}function L(Y,ie,le){return j(Y,t,ie,le)}function F(Y,ie,le){return j(Y,n,ie,le)}function z(Y,ie,le){return j(Y,r,ie,le)}function M(Y){return o[Y.getDay()]}function O(Y){return s[Y.getDay()]}function U(Y){return c[Y.getMonth()]}function A(Y){return l[Y.getMonth()]}function Z(Y){return a[+(Y.getHours()>=12)]}function D(Y){return 1+~~(Y.getMonth()/3)}function P(Y){return o[Y.getUTCDay()]}function oe(Y){return s[Y.getUTCDay()]}function be(Y){return c[Y.getUTCMonth()]}function pe(Y){return l[Y.getUTCMonth()]}function Ce(Y){return a[+(Y.getUTCHours()>=12)]}function G(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var ie=x(Y+="",w);return ie.toString=function(){return Y},ie},parse:function(Y){var ie=E(Y+="",!1);return ie.toString=function(){return Y},ie},utcFormat:function(Y){var ie=x(Y+="",N);return ie.toString=function(){return Y},ie},utcParse:function(Y){var ie=E(Y+="",!0);return ie.toString=function(){return Y},ie}}}var G1={"-":"",_:" ",0:"0"},Jt=/^\s*\d+/,n7=/^%/,r7=/[\\^$*+?|[\]().{}]/g;function qe(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",s=a.length;return r+(s<n?new Array(n-s+1).join(t)+a:a)}function a7(e){return e.replace(r7,"\\$&")}function Kl(e){return new RegExp("^(?:"+e.map(a7).join("|")+")","i")}function Vl(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function i7(e,t,n){var r=Jt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function s7(e,t,n){var r=Jt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function o7(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function l7(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function c7(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function q1(e,t,n){var r=Jt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function K1(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function u7(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 d7(e,t,n){var r=Jt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function f7(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function V1(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function h7(e,t,n){var r=Jt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Y1(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function p7(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function m7(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function g7(e,t,n){var r=Jt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function v7(e,t,n){var r=Jt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function y7(e,t,n){var r=n7.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function b7(e,t,n){var r=Jt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function x7(e,t,n){var r=Jt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function X1(e,t){return qe(e.getDate(),t,2)}function w7(e,t){return qe(e.getHours(),t,2)}function S7(e,t){return qe(e.getHours()%12||12,t,2)}function k7(e,t){return qe(1+Hu.count(Ma(e),e),t,3)}function tP(e,t){return qe(e.getMilliseconds(),t,3)}function N7(e,t){return tP(e,t)+"000"}function E7(e,t){return qe(e.getMonth()+1,t,2)}function j7(e,t){return qe(e.getMinutes(),t,2)}function _7(e,t){return qe(e.getSeconds(),t,2)}function A7(e){var t=e.getDay();return t===0?7:t}function C7(e,t){return qe(Dp.count(Ma(e)-1,e),t,2)}function nP(e){var t=e.getDay();return t>=4||t===0?Uo(e):Uo.ceil(e)}function T7(e,t){return e=nP(e),qe(Uo.count(Ma(e),e)+(Ma(e).getDay()===4),t,2)}function O7(e){return e.getDay()}function P7(e,t){return qe(uh.count(Ma(e)-1,e),t,2)}function R7(e,t){return qe(e.getFullYear()%100,t,2)}function M7(e,t){return e=nP(e),qe(e.getFullYear()%100,t,2)}function I7(e,t){return qe(e.getFullYear()%1e4,t,4)}function $7(e,t){var n=e.getDay();return e=n>=4||n===0?Uo(e):Uo.ceil(e),qe(e.getFullYear()%1e4,t,4)}function L7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+qe(t/60|0,"0",2)+qe(t%60,"0",2)}function Z1(e,t){return qe(e.getUTCDate(),t,2)}function D7(e,t){return qe(e.getUTCHours(),t,2)}function B7(e,t){return qe(e.getUTCHours()%12||12,t,2)}function z7(e,t){return qe(1+Lp.count(Ia(e),e),t,3)}function rP(e,t){return qe(e.getUTCMilliseconds(),t,3)}function F7(e,t){return rP(e,t)+"000"}function U7(e,t){return qe(e.getUTCMonth()+1,t,2)}function W7(e,t){return qe(e.getUTCMinutes(),t,2)}function H7(e,t){return qe(e.getUTCSeconds(),t,2)}function G7(e){var t=e.getUTCDay();return t===0?7:t}function q7(e,t){return qe(Bp.count(Ia(e)-1,e),t,2)}function aP(e){var t=e.getUTCDay();return t>=4||t===0?Wo(e):Wo.ceil(e)}function K7(e,t){return e=aP(e),qe(Wo.count(Ia(e),e)+(Ia(e).getUTCDay()===4),t,2)}function V7(e){return e.getUTCDay()}function Y7(e,t){return qe(dh.count(Ia(e)-1,e),t,2)}function X7(e,t){return qe(e.getUTCFullYear()%100,t,2)}function Z7(e,t){return e=aP(e),qe(e.getUTCFullYear()%100,t,2)}function Q7(e,t){return qe(e.getUTCFullYear()%1e4,t,4)}function J7(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Wo(e):Wo.ceil(e),qe(e.getUTCFullYear()%1e4,t,4)}function eY(){return"+0000"}function Q1(){return"%"}function J1(e){return+e}function eN(e){return Math.floor(+e/1e3)}var Hs,iP,sP;tY({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 tY(e){return Hs=t7(e),iP=Hs.format,Hs.parse,sP=Hs.utcFormat,Hs.utcParse,Hs}function nY(e){return new Date(e)}function rY(e){return e instanceof Date?+e:+new Date(+e)}function E0(e,t,n,r,a,s,o,l,c,u){var d=d0(),f=d.invert,h=d.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),b=u("%b %d"),w=u("%B"),N=u("%Y");function S(x){return(c(x)<x?p:l(x)<x?g:o(x)<x?m:s(x)<x?y:r(x)<x?a(x)<x?v:b:n(x)<x?w:N)(x)}return d.invert=function(x){return new Date(f(x))},d.domain=function(x){return arguments.length?h(Array.from(x,rY)):h().map(nY)},d.ticks=function(x){var E=h();return e(E[0],E[E.length-1],x??10)},d.tickFormat=function(x,E){return E==null?S:u(E)},d.nice=function(x){var E=h();return(!x||typeof x.range!="function")&&(x=t(E[0],E[E.length-1],x??10)),x?h(qO(E,x)):d},d.copy=function(){return Wu(d,E0(e,t,n,r,a,s,o,l,c,u))},d}function aY(){return Er.apply(E0(JV,e7,Ma,k0,Dp,Hu,w0,b0,Ji,iP).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function iY(){return Er.apply(E0(ZV,QV,Ia,N0,Bp,Lp,S0,x0,Ji,sP).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function zp(){var e=0,t=1,n,r,a,s,o=Cn,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(a===0?.5:(f=(s(f)-n)*a,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=s(e=+e),r=s(t=+t),a=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(h){var p,g;return arguments.length?([p,g]=h,o=f(p,g),u):[o(0),o(1)]}}return u.range=d(yl),u.rangeRound=d(u0),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return s=f,n=f(e),r=f(t),a=n===r?0:1/(r-n),u}}function ji(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function oP(){var e=Ei(zp()(Cn));return e.copy=function(){return ji(e,oP())},za.apply(e,arguments)}function lP(){var e=p0(zp()).domain([1,10]);return e.copy=function(){return ji(e,lP()).base(e.base())},za.apply(e,arguments)}function cP(){var e=m0(zp());return e.copy=function(){return ji(e,cP()).constant(e.constant())},za.apply(e,arguments)}function j0(){var e=g0(zp());return e.copy=function(){return ji(e,j0()).exponent(e.exponent())},za.apply(e,arguments)}function sY(){return j0.apply(null,arguments).exponent(.5)}function uP(){var e=[],t=Cn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Fu(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(pi),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,s)=>qK(e,s/r))},n.copy=function(){return uP(t).domain(e)},za.apply(n,arguments)}function Fp(){var e=0,t=.5,n=1,r=1,a,s,o,l,c,u=Cn,d,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+d(m))-s)*(r*m<r*s?l:c),u(f?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([e,t,n]=m,a=d(e=+e),s=d(t=+t),o=d(n=+n),l=a===s?0:.5/(s-a),c=s===o?0:.5/(o-s),r=s<a?-1:1,p):[e,t,n]},p.clamp=function(m){return arguments.length?(f=!!m,p):f},p.interpolator=function(m){return arguments.length?(u=m,p):u};function g(m){return function(y){var v,b,w;return arguments.length?([v,b,w]=y,u=yV(m,[v,b,w]),p):[u(0),u(.5),u(1)]}}return p.range=g(yl),p.rangeRound=g(u0),p.unknown=function(m){return arguments.length?(h=m,p):h},function(m){return d=m,a=m(e),s=m(t),o=m(n),l=a===s?0:.5/(s-a),c=s===o?0:.5/(o-s),r=s<a?-1:1,p}}function dP(){var e=Ei(Fp()(Cn));return e.copy=function(){return ji(e,dP())},za.apply(e,arguments)}function fP(){var e=p0(Fp()).domain([.1,1,10]);return e.copy=function(){return ji(e,fP()).base(e.base())},za.apply(e,arguments)}function hP(){var e=m0(Fp());return e.copy=function(){return ji(e,hP()).constant(e.constant())},za.apply(e,arguments)}function _0(){var e=g0(Fp());return e.copy=function(){return ji(e,_0()).exponent(e.exponent())},za.apply(e,arguments)}function oY(){return _0.apply(null,arguments).exponent(.5)}const tN=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:eu,scaleDiverging:dP,scaleDivergingLog:fP,scaleDivergingPow:_0,scaleDivergingSqrt:oY,scaleDivergingSymlog:hP,scaleIdentity:GO,scaleImplicit:Ey,scaleLinear:lh,scaleLog:KO,scaleOrdinal:o0,scalePoint:xc,scalePow:v0,scaleQuantile:XO,scaleQuantize:ZO,scaleRadial:YO,scaleSequential:oP,scaleSequentialLog:lP,scaleSequentialPow:j0,scaleSequentialQuantile:uP,scaleSequentialSqrt:sY,scaleSequentialSymlog:cP,scaleSqrt:FV,scaleSymlog:VO,scaleThreshold:QO,scaleTime:aY,scaleUtc:iY,tickFormat:HO},Symbol.toStringTag,{value:"Module"}));var lY=ul;function cY(e,t,n){for(var r=-1,a=e.length;++r<a;){var s=e[r],o=t(s);if(o!=null&&(l===void 0?o===o&&!lY(o):n(o,l)))var l=o,c=s}return c}var pP=cY;function uY(e,t){return e>t}var dY=uY,fY=pP,hY=dY,pY=vl;function mY(e){return e&&e.length?fY(e,pY,hY):void 0}var gY=mY;const Up=Qe(gY);function vY(e,t){return e<t}var yY=vY,bY=pP,xY=yY,wY=vl;function SY(e){return e&&e.length?bY(e,wY,xY):void 0}var kY=SY;const Wp=Qe(kY);var NY=Fx,EY=Ni,jY=NO,_Y=Un;function AY(e,t){var n=_Y(e)?NY:jY;return n(e,EY(t))}var CY=AY,TY=SO,OY=CY;function PY(e,t){return TY(OY(e,t),1)}var RY=PY;const MY=Qe(RY);var IY=n0;function $Y(e,t){return IY(e,t)}var LY=$Y;const A0=Qe(LY);var bl=1e9,DY={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},T0,yt=!0,kr="[DecimalError] ",ss=kr+"Invalid argument: ",C0=kr+"Exponent out of range: ",xl=Math.floor,Wi=Math.pow,BY=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,er,Yt=1e7,pt=7,mP=9007199254740991,fh=xl(mP/pt),ye={};ye.absoluteValue=ye.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ye.comparedTo=ye.cmp=function(e){var t,n,r,a,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return r===a?0:r>a^s.s<0?1:-1};ye.decimalPlaces=ye.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*pt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ye.dividedBy=ye.div=function(e){return Aa(this,new this.constructor(e))};ye.dividedToIntegerBy=ye.idiv=function(e){var t=this,n=t.constructor;return st(Aa(t,new n(e),0,1),n.precision)};ye.equals=ye.eq=function(e){return!this.cmp(e)};ye.exponent=function(){return It(this)};ye.greaterThan=ye.gt=function(e){return this.cmp(e)>0};ye.greaterThanOrEqualTo=ye.gte=function(e){return this.cmp(e)>=0};ye.isInteger=ye.isint=function(){return this.e>this.d.length-2};ye.isNegative=ye.isneg=function(){return this.s<0};ye.isPositive=ye.ispos=function(){return this.s>0};ye.isZero=function(){return this.s===0};ye.lessThan=ye.lt=function(e){return this.cmp(e)<0};ye.lessThanOrEqualTo=ye.lte=function(e){return this.cmp(e)<1};ye.logarithm=ye.log=function(e){var t,n=this,r=n.constructor,a=r.precision,s=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(er))throw Error(kr+"NaN");if(n.s<1)throw Error(kr+(n.s?"NaN":"-Infinity"));return n.eq(er)?new r(0):(yt=!1,t=Aa(iu(n,s),iu(e,s),s),yt=!0,st(t,a))};ye.minus=ye.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?yP(t,e):gP(t,(e.s=-e.s,e))};ye.modulo=ye.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(kr+"NaN");return n.s?(yt=!1,t=Aa(n,e,0,1).times(e),yt=!0,n.minus(t)):st(new r(n),a)};ye.naturalExponential=ye.exp=function(){return vP(this)};ye.naturalLogarithm=ye.ln=function(){return iu(this)};ye.negated=ye.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ye.plus=ye.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?gP(t,e):yP(t,(e.s=-e.s,e))};ye.precision=ye.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ss+e);if(t=It(a)+1,r=a.d.length-1,n=r*pt+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ye.squareRoot=ye.sqrt=function(){var e,t,n,r,a,s,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(kr+"NaN")}for(e=It(l),yt=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=na(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=xl((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(a.toString()),n=c.precision,a=o=n+3;;)if(s=r,r=s.plus(Aa(l,s,o+2)).times(.5),na(s.d).slice(0,o)===(t=na(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(st(s,n+1,0),s.times(s).eq(l)){r=s;break}}else if(t!="9999")break;o+=4}return yt=!0,st(r,n)};ye.times=ye.mul=function(e){var t,n,r,a,s,o,l,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&&(s=h,h=p,p=s,o=c,c=u,u=o),s=[],o=c+u,r=o;r--;)s.push(0);for(r=u;--r>=0;){for(t=0,a=c+r;a>r;)l=s[a]+p[r]*h[a-r-1]+t,s[a--]=l%Yt|0,t=l/Yt|0;s[a]=(s[a]+t)%Yt|0}for(;!s[--o];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,yt?st(e,f.precision):e};ye.toDecimalPlaces=ye.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(oa(e,0,bl),t===void 0?t=r.rounding:oa(t,0,8),st(n,e+It(n)+1,t))};ye.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=vs(r,!0):(oa(e,0,bl),t===void 0?t=a.rounding:oa(t,0,8),r=st(new a(r),e+1,t),n=vs(r,!0,e+1)),n};ye.toFixed=function(e,t){var n,r,a=this,s=a.constructor;return e===void 0?vs(a):(oa(e,0,bl),t===void 0?t=s.rounding:oa(t,0,8),r=st(new s(a),e+It(a)+1,t),n=vs(r.abs(),!1,e+It(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};ye.toInteger=ye.toint=function(){var e=this,t=e.constructor;return st(new t(e),It(e)+1,t.rounding)};ye.toNumber=function(){return+this};ye.toPower=ye.pow=function(e){var t,n,r,a,s,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(er);if(l=new c(l),!l.s){if(e.s<1)throw Error(kr+"Infinity");return l}if(l.eq(er))return l;if(r=c.precision,e.eq(er))return st(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,s=l.s,o){if((n=d<0?-d:d)<=mP){for(a=new c(er),t=Math.ceil(r/pt+4),yt=!1;n%2&&(a=a.times(l),rN(a.d,t)),n=xl(n/2),n!==0;)l=l.times(l),rN(l.d,t);return yt=!0,e.s<0?new c(er).div(a):st(a,r)}}else if(s<0)throw Error(kr+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,yt=!1,a=e.times(iu(l,r+u)),yt=!0,a=vP(a),a.s=s,a};ye.toPrecision=function(e,t){var n,r,a=this,s=a.constructor;return e===void 0?(n=It(a),r=vs(a,n<=s.toExpNeg||n>=s.toExpPos)):(oa(e,1,bl),t===void 0?t=s.rounding:oa(t,0,8),a=st(new s(a),e,t),n=It(a),r=vs(a,e<=n||n<=s.toExpNeg,e)),r};ye.toSignificantDigits=ye.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(oa(e,1,bl),t===void 0?t=r.rounding:oa(t,0,8)),st(new r(n),e,t)};ye.toString=ye.valueOf=ye.val=ye.toJSON=ye[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=It(e),n=e.constructor;return vs(e,t<=n.toExpNeg||t>=n.toExpPos)};function gP(e,t){var n,r,a,s,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),yt?st(t,f):t;if(c=e.d,u=t.d,o=e.e,a=t.e,c=c.slice(),s=o-a,s){for(s<0?(r=c,s=-s,l=u.length):(r=u,a=o,l=c.length),o=Math.ceil(f/pt),l=o>l?o+1:l+1,s>l&&(s=l,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(l=c.length,s=u.length,l-s<0&&(s=l,r=u,u=c,c=r),n=0;s;)n=(c[--s]=c[s]+u[s]+n)/Yt|0,c[s]%=Yt;for(n&&(c.unshift(n),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,yt?st(t,f):t}function oa(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ss+e)}function na(e){var t,n,r,a=e.length-1,s="",o=e[0];if(a>0){for(s+=o,t=1;t<a;t++)r=e[t]+"",n=pt-r.length,n&&(s+=Va(n)),s+=r;o=e[t],r=o+"",n=pt-r.length,n&&(s+=Va(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}var Aa=function(){function e(r,a){var s,o=0,l=r.length;for(r=r.slice();l--;)s=r[l]*a+o,r[l]=s%Yt|0,o=s/Yt|0;return o&&r.unshift(o),r}function t(r,a,s,o){var l,c;if(s!=o)c=s>o?1:-1;else for(l=c=0;l<s;l++)if(r[l]!=a[l]){c=r[l]>a[l]?1:-1;break}return c}function n(r,a,s){for(var o=0;s--;)r[s]-=o,o=r[s]<a[s]?1:0,r[s]=o*Yt+r[s]-a[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,s,o){var l,c,u,d,f,h,p,g,m,y,v,b,w,N,S,x,E,j,C=r.constructor,T=r.s==a.s?1:-1,$=r.d,R=a.d;if(!r.s)return new C(r);if(!a.s)throw Error(kr+"Division by zero");for(c=r.e-a.e,E=R.length,S=$.length,p=new C(T),g=p.d=[],u=0;R[u]==($[u]||0);)++u;if(R[u]>($[u]||0)&&--c,s==null?b=s=C.precision:o?b=s+(It(r)-It(a))+1:b=s,b<0)return new C(0);if(b=b/pt+2|0,u=0,E==1)for(d=0,R=R[0],b++;(u<S||d)&&b--;u++)w=d*Yt+($[u]||0),g[u]=w/R|0,d=w%R|0;else{for(d=Yt/(R[0]+1)|0,d>1&&(R=e(R,d),$=e($,d),E=R.length,S=$.length),N=E,m=$.slice(0,E),y=m.length;y<E;)m[y++]=0;j=R.slice(),j.unshift(0),x=R[0],R[1]>=Yt/2&&++x;do d=0,l=t(R,m,E,y),l<0?(v=m[0],E!=y&&(v=v*Yt+(m[1]||0)),d=v/x|0,d>1?(d>=Yt&&(d=Yt-1),f=e(R,d),h=f.length,y=m.length,l=t(f,m,h,y),l==1&&(d--,n(f,E<h?j:R,h))):(d==0&&(l=d=1),f=R.slice()),h=f.length,h<y&&f.unshift(0),n(m,f,y),l==-1&&(y=m.length,l=t(R,m,E,y),l<1&&(d++,n(m,E<y?j:R,y))),y=m.length):l===0&&(d++,m=[0]),g[u++]=d,l&&m[0]?m[y++]=$[N]||0:(m=[$[N]],y=1);while((N++<S||m[0]!==void 0)&&b--)}return g[0]||g.shift(),p.e=c,st(p,o?s+It(p)+1:s)}}();function vP(e,t){var n,r,a,s,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(It(e)>16)throw Error(C0+It(e));if(!e.s)return new d(er);for(yt=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Wi(2,u))/Math.LN10*2+5|0,l+=r,n=a=s=new d(er),d.precision=l;;){if(a=st(a.times(e),l),n=n.times(++c),o=s.plus(Aa(a,n,l)),na(o.d).slice(0,l)===na(s.d).slice(0,l)){for(;u--;)s=st(s.times(s),l);return d.precision=f,t==null?(yt=!0,st(s,f)):s}s=o}}function It(e){for(var t=e.e*pt,n=e.d[0];n>=10;n/=10)t++;return t}function ug(e,t,n){if(t>e.LN10.sd())throw yt=!0,n&&(e.precision=n),Error(kr+"LN10 precision limit exceeded");return st(new e(e.LN10),t)}function Va(e){for(var t="";e--;)t+="0";return t}function iu(e,t){var n,r,a,s,o,l,c,u,d,f=1,h=10,p=e,g=p.d,m=p.constructor,y=m.precision;if(p.s<1)throw Error(kr+(p.s?"NaN":"-Infinity"));if(p.eq(er))return new m(0);if(t==null?(yt=!1,u=y):u=t,p.eq(10))return t==null&&(yt=!0),ug(m,u);if(u+=h,m.precision=u,n=na(g),r=n.charAt(0),s=It(p),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=na(p.d),r=n.charAt(0),f++;s=It(p),r>1?(p=new m("0."+n),s++):p=new m(r+"."+n.slice(1))}else return c=ug(m,u+2,y).times(s+""),p=iu(new m(r+"."+n.slice(1)),u-h).plus(c),m.precision=y,t==null?(yt=!0,st(p,y)):p;for(l=o=p=Aa(p.minus(er),p.plus(er),u),d=st(p.times(p),u),a=3;;){if(o=st(o.times(d),u),c=l.plus(Aa(o,new m(a),u)),na(c.d).slice(0,u)===na(l.d).slice(0,u))return l=l.times(2),s!==0&&(l=l.plus(ug(m,u+2,y).times(s+""))),l=Aa(l,new m(f),u),m.precision=y,t==null?(yt=!0,st(l,y)):l;l=c,a+=2}}function nN(e,t){var n,r,a;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(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=xl(n/pt),e.d=[],r=(n+1)%pt,n<0&&(r+=pt),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=pt;r<a;)e.d.push(+t.slice(r,r+=pt));t=t.slice(r),r=pt-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),yt&&(e.e>fh||e.e<-fh))throw Error(C0+n)}else e.s=0,e.e=0,e.d=[0];return e}function st(e,t,n){var r,a,s,o,l,c,u,d,f=e.d;for(o=1,s=f[0];s>=10;s/=10)o++;if(r=t-o,r<0)r+=pt,a=t,u=f[d=0];else{if(d=Math.ceil((r+1)/pt),s=f.length,d>=s)return e;for(u=s=f[d],o=1;s>=10;s/=10)o++;r%=pt,a=r-pt+o}if(n!==void 0&&(s=Wi(10,o-a-1),l=u/s%10|0,c=t<0||f[d+1]!==void 0||u%s,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?a>0?u/Wi(10,o-a):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(s=It(e),f.length=1,t=t-s-1,f[0]=Wi(10,(pt-t%pt)%pt),e.e=xl(-t/pt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,s=1,d--):(f.length=d+1,s=Wi(10,pt-r),f[d]=a>0?(u/Wi(10,o-a)%Wi(10,a)|0)*s:0),c)for(;;)if(d==0){(f[0]+=s)==Yt&&(f[0]=1,++e.e);break}else{if(f[d]+=s,f[d]!=Yt)break;f[d--]=0,s=1}for(r=f.length;f[--r]===0;)f.pop();if(yt&&(e.e>fh||e.e<-fh))throw Error(C0+It(e));return e}function yP(e,t){var n,r,a,s,o,l,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),yt?st(t,p):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=f.length):(n=f,r=u,l=c.length),a=Math.max(Math.ceil(p/pt),l)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=c.length,l=f.length,d=a<l,d&&(l=a),a=0;a<l;a++)if(c[a]!=f[a]){d=c[a]<f[a];break}o=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,a=f.length-l;a>0;--a)c[l++]=0;for(a=f.length;a>o;){if(c[--a]<f[a]){for(s=a;s&&c[--s]===0;)c[s]=Yt-1;--c[s],c[a]+=Yt}c[a]-=f[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,yt?st(t,p):t):new h(0)}function vs(e,t,n){var r,a=It(e),s=na(e.d),o=s.length;return t?(n&&(r=n-o)>0?s=s.charAt(0)+"."+s.slice(1)+Va(r):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(a<0?"e":"e+")+a):a<0?(s="0."+Va(-a-1)+s,n&&(r=n-o)>0&&(s+=Va(r))):a>=o?(s+=Va(a+1-o),n&&(r=n-a-1)>0&&(s=s+"."+Va(r))):((r=a+1)<o&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(s+="."),s+=Va(r))),e.s<0?"-"+s:s}function rN(e,t){if(e.length>t)return e.length=t,!0}function bP(e){var t,n,r;function a(s){var o=this;if(!(o instanceof a))return new a(s);if(o.constructor=a,s instanceof a){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(ss+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return nN(o,s.toString())}else if(typeof s!="string")throw Error(ss+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,BY.test(s))nN(o,s);else throw Error(ss+s)}if(a.prototype=ye,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=bP,a.config=a.set=zY,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 a.config(e),a}function zY(e){if(!e||typeof e!="object")throw Error(kr+"Object expected");var t,n,r,a=["precision",1,bl,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if(xl(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(ss+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(ss+n+": "+r);return this}var T0=bP(DY);er=new T0(1);const at=T0;function FY(e){return GY(e)||HY(e)||WY(e)||UY()}function UY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
87
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WY(e,t){if(e){if(typeof e=="string")return Cy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cy(e,t)}}function HY(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function GY(e){if(Array.isArray(e))return Cy(e)}function Cy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var qY=function(t){return t},xP={},wP=function(t){return t===xP},aN=function(t){return function n(){return arguments.length===0||arguments.length===1&&wP(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},KY=function e(t,n){return t===1?n:aN(function(){for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];var o=a.filter(function(l){return l!==xP}).length;return o>=t?n.apply(void 0,a):e(t-o,aN(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=a.map(function(f){return wP(f)?c.shift():f});return n.apply(void 0,FY(d).concat(c))}))})},Hp=function(t){return KY(t.length,t)},Ty=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},VY=Hp(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),YY=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return qY;var a=n.reverse(),s=a[0],o=a.slice(1);return function(){return o.reduce(function(l,c){return c(l)},s.apply(void 0,arguments))}},Oy=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},SP=function(t){var n=null,r=null;return function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return n&&s.every(function(l,c){return l===n[c]})||(n=s,r=t.apply(void 0,s)),r}};function XY(e){var t;return e===0?t=1:t=Math.floor(new at(e).abs().log(10).toNumber())+1,t}function ZY(e,t,n){for(var r=new at(e),a=0,s=[];r.lt(t)&&a<1e5;)s.push(r.toNumber()),r=r.add(n),a++;return s}var QY=Hp(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),JY=Hp(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),eX=Hp(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Gp={rangeStep:ZY,getDigitCount:XY,interpolateNumber:QY,uninterpolateNumber:JY,uninterpolateTruncation:eX};function Py(e){return rX(e)||nX(e)||kP(e)||tX()}function tX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
88
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nX(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function rX(e){if(Array.isArray(e))return Ry(e)}function su(e,t){return sX(e)||iX(e,t)||kP(e,t)||aX()}function aX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
89
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kP(e,t){if(e){if(typeof e=="string")return Ry(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ry(e,t)}}function Ry(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function iX(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,s=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){a=!0,s=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(a)throw s}}return n}}function sX(e){if(Array.isArray(e))return e}function NP(e){var t=su(e,2),n=t[0],r=t[1],a=n,s=r;return n>r&&(a=r,s=n),[a,s]}function EP(e,t,n){if(e.lte(0))return new at(0);var r=Gp.getDigitCount(e.toNumber()),a=new at(10).pow(r),s=e.div(a),o=r!==1?.05:.1,l=new at(Math.ceil(s.div(o).toNumber())).add(n).mul(o),c=l.mul(a);return t?c:new at(Math.ceil(c))}function oX(e,t,n){var r=1,a=new at(e);if(!a.isint()&&n){var s=Math.abs(e);s<1?(r=new at(10).pow(Gp.getDigitCount(e)-1),a=new at(Math.floor(a.div(r).toNumber())).mul(r)):s>1&&(a=new at(Math.floor(e)))}else e===0?a=new at(Math.floor((t-1)/2)):n||(a=new at(Math.floor(e)));var o=Math.floor((t-1)/2),l=YY(VY(function(c){return a.add(new at(c-o).mul(r)).toNumber()}),Ty);return l(0,t)}function jP(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new at(0),tickMin:new at(0),tickMax:new at(0)};var s=EP(new at(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new at(0):(o=new at(e).add(t).div(2),o=o.sub(new at(o).mod(s)));var l=Math.ceil(o.sub(e).div(s).toNumber()),c=Math.ceil(new at(t).sub(o).div(s).toNumber()),u=l+c+1;return u>n?jP(e,t,n,r,a+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:s,tickMin:o.sub(new at(l).mul(s)),tickMax:o.add(new at(c).mul(s))})}function lX(e){var t=su(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),l=NP([n,r]),c=su(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(Py(Ty(0,a-1).map(function(){return 1/0}))):[].concat(Py(Ty(0,a-1).map(function(){return-1/0})),[d]);return n>r?Oy(f):f}if(u===d)return oX(u,a,s);var h=jP(u,d,o,s),p=h.step,g=h.tickMin,m=h.tickMax,y=Gp.rangeStep(g,m.add(new at(.1).mul(p)),p);return n>r?Oy(y):y}function cX(e,t){var n=su(e,2),r=n[0],a=n[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=NP([r,a]),l=su(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,a];if(c===u)return[c];var d=Math.max(t,2),f=EP(new at(u).sub(c).div(d-1),s,0),h=[].concat(Py(Gp.rangeStep(new at(c),new at(u).sub(new at(.99).mul(f)),f)),[u]);return r>a?Oy(h):h}var uX=SP(lX),dX=SP(cX),fX="Invariant failed";function ys(e,t){throw new Error(fX)}var hX=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Ho(e){"@babel/helpers - typeof";return Ho=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ho(e)}function hh(){return hh=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},hh.apply(this,arguments)}function pX(e,t){return yX(e)||vX(e,t)||gX(e,t)||mX()}function mX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
90
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gX(e,t){if(e){if(typeof e=="string")return iN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iN(e,t)}}function iN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vX(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function yX(e){if(Array.isArray(e))return e}function bX(e,t){if(e==null)return{};var n=xX(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xX(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function wX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,CP(r.key),r)}}function kX(e,t,n){return t&&SX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function NX(e,t,n){return t=ph(t),EX(e,_P()?Reflect.construct(t,n||[],ph(e).constructor):t.apply(e,n))}function EX(e,t){if(t&&(Ho(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jX(e)}function jX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _P(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_P=function(){return!!e})()}function ph(e){return ph=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ph(e)}function _X(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&My(e,t)}function My(e,t){return My=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},My(e,t)}function AP(e,t,n){return t=CP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CP(e){var t=AX(e,"string");return Ho(t)=="symbol"?t:t+""}function AX(e,t){if(Ho(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ho(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var qp=function(e){function t(){return wX(this,t),NX(this,t,arguments)}return _X(t,e),kX(t,[{key:"render",value:function(){var r=this.props,a=r.offset,s=r.layout,o=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,f=r.yAxis,h=bX(r,hX),p=Ve(h,!1);this.props.direction==="x"&&d.type!=="number"&&ys();var g=c.map(function(m){var y=u(m,l),v=y.x,b=y.y,w=y.value,N=y.errorVal;if(!N)return null;var S=[],x,E;if(Array.isArray(N)){var j=pX(N,2);x=j[0],E=j[1]}else x=E=N;if(s==="vertical"){var C=d.scale,T=b+a,$=T+o,R=T-o,I=C(w-x),L=C(w+E);S.push({x1:L,y1:$,x2:L,y2:R}),S.push({x1:I,y1:T,x2:L,y2:T}),S.push({x1:I,y1:$,x2:I,y2:R})}else if(s==="horizontal"){var F=f.scale,z=v+a,M=z-o,O=z+o,U=F(w-x),A=F(w+E);S.push({x1:M,y1:A,x2:O,y2:A}),S.push({x1:z,y1:U,x2:z,y2:A}),S.push({x1:M,y1:U,x2:O,y2:U})}return H.createElement(Zt,hh({className:"recharts-errorBar",key:"bar-".concat(S.map(function(Z){return"".concat(Z.x1,"-").concat(Z.x2,"-").concat(Z.y1,"-").concat(Z.y2)}))},p),S.map(function(Z){return H.createElement("line",hh({},Z,{key:"line-".concat(Z.x1,"-").concat(Z.x2,"-").concat(Z.y1,"-").concat(Z.y2)}))}))});return H.createElement(Zt,{className:"recharts-errorBars"},g)}}])}(H.Component);AP(qp,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});AP(qp,"displayName","ErrorBar");function ou(e){"@babel/helpers - typeof";return ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ou(e)}function sN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ii(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sN(Object(n),!0).forEach(function(r){CX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CX(e,t,n){return t=TX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TX(e){var t=OX(e,"string");return ou(t)=="symbol"?t:t+""}function OX(e,t){if(ou(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ou(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var TP=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,s=t.legendContent,o=Jn(n,as);if(!o)return null;var l=as.defaultProps,c=l!==void 0?Ii(Ii({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:s==="children"?u=(r||[]).reduce(function(d,f){var h=f.item,p=f.props,g=p.sectors||p.data||[];return d.concat(g.map(function(m){return{type:o.props.iconType||h.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(r||[]).map(function(d){var f=d.item,h=f.type.defaultProps,p=h!==void 0?Ii(Ii({},h),f.props):{},g=p.dataKey,m=p.name,y=p.legendType,v=p.hide;return{inactive:v,dataKey:g,type:c.iconType||y||"square",color:O0(f),value:m||g,payload:p}}),Ii(Ii(Ii({},c),as.getWithHeight(o,a)),{},{payload:u,item:o})};function lu(e){"@babel/helpers - typeof";return lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lu(e)}function oN(e){return IX(e)||MX(e)||RX(e)||PX()}function PX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
91
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RX(e,t){if(e){if(typeof e=="string")return Iy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Iy(e,t)}}function MX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IX(e){if(Array.isArray(e))return Iy(e)}function Iy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function At(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lN(Object(n),!0).forEach(function(r){jo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jo(e,t,n){return t=$X(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $X(e){var t=LX(e,"string");return lu(t)=="symbol"?t:t+""}function LX(e,t){if(lu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function la(e,t,n){return Xe(e)||Xe(t)?n:qt(t)?xr(e,t,n):De(t)?t(e):n}function wc(e,t,n,r){var a=MY(e,function(l){return la(l,t)});if(n==="number"){var s=a.filter(function(l){return de(l)||parseFloat(l)});return s.length?[Wp(s),Up(s)]:[1/0,-1/0]}var o=r?a.filter(function(l){return!Xe(l)}):a;return o.map(function(l){return qt(l)||l instanceof Date?l:""})}var DX=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var c=s.range,u=0;u<l;u++){var d=u>0?a[u-1].coordinate:a[l-1].coordinate,f=a[u].coordinate,h=u>=l-1?a[0].coordinate:a[u+1].coordinate,p=void 0;if($r(f-d)!==$r(h-f)){var g=[];if($r(h-f)===$r(c[1]-c[0])){p=h;var m=f+c[1]-c[0];g[0]=Math.min(m,(m+d)/2),g[1]=Math.max(m,(m+d)/2)}else{p=d;var y=h+c[1]-c[0];g[0]=Math.min(f,(y+f)/2),g[1]=Math.max(f,(y+f)/2)}var v=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>v[0]&&t<=v[1]||t>=g[0]&&t<=g[1]){o=a[u].index;break}}else{var b=Math.min(d,h),w=Math.max(d,h);if(t>(b+f)/2&&t<=(w+f)/2){o=a[u].index;break}}}else for(var N=0;N<l;N++)if(N===0&&t<=(r[N].coordinate+r[N+1].coordinate)/2||N>0&&N<l-1&&t>(r[N].coordinate+r[N-1].coordinate)/2&&t<=(r[N].coordinate+r[N+1].coordinate)/2||N===l-1&&t>(r[N].coordinate+r[N-1].coordinate)/2){o=r[N].index;break}return o},O0=function(t){var n,r=t,a=r.type.displayName,s=(n=t.type)!==null&&n!==void 0&&n.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,o=s.stroke,l=s.fill,c;switch(a){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},BX=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,s=a===void 0?{}:a;if(!s)return{};for(var o={},l=Object.keys(s),c=0,u=l.length;c<u;c++)for(var d=s[l[c]].stackGroups,f=Object.keys(d),h=0,p=f.length;h<p;h++){var g=d[f[h]],m=g.items,y=g.cateAxisId,v=m.filter(function(E){return ja(E.type).indexOf("Bar")>=0});if(v&&v.length){var b=v[0].type.defaultProps,w=b!==void 0?At(At({},b),v[0].props):v[0].props,N=w.barSize,S=w[y];o[S]||(o[S]=[]);var x=Xe(N)?n:N;o[S].push({item:v[0],stackList:v.slice(1),barSize:Xe(x)?void 0:gs(x,r,0)})}}return o},zX=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,s=t.sizeList,o=s===void 0?[]:s,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=gs(n,a,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=a/c,g=o.reduce(function(N,S){return N+S.barSize||0},0);g+=(c-1)*u,g>=a&&(g-=(c-1)*u,u=0),g>=a&&p>0&&(h=!0,p*=.9,g=c*p);var m=(a-g)/2>>0,y={offset:m-u,size:0};d=o.reduce(function(N,S){var x={item:S.item,position:{offset:y.offset+y.size+u,size:h?p:S.barSize}},E=[].concat(oN(N),[x]);return y=E[E.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(j){E.push({item:j,position:y})}),E},f)}else{var v=gs(r,a,0,!0);a-2*v-(c-1)*u<=0&&(u=0);var b=(a-2*v-(c-1)*u)/c;b>1&&(b>>=0);var w=l===+l?Math.min(b,l):b;d=o.reduce(function(N,S,x){var E=[].concat(oN(N),[{item:S.item,position:{offset:v+(b+u)*x+(b-w)/2,size:w}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(j){E.push({item:j,position:E[E.length-1].position})}),E},f)}return d},FX=function(t,n,r,a){var s=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=TP({children:s,legendWidth:c});if(u){var d=a||{},f=d.width,h=d.height,p=u.align,g=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&p!=="center"&&de(t[p]))return At(At({},t),{},jo({},p,t[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&de(t[g]))return At(At({},t),{},jo({},g,t[g]+(h||0)))}return t},UX=function(t,n,r){return Xe(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},OP=function(t,n,r,a,s){var o=n.props.children,l=Br(o,qp).filter(function(u){return UX(a,s,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=la(d,r);if(Xe(f))return u;var h=Array.isArray(f)?[Wp(f),Up(f)]:[f,f],p=c.reduce(function(g,m){var y=la(d,m,0),v=h[0]-Math.abs(Array.isArray(y)?y[0]:y),b=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(v,g[0]),Math.max(b,g[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},WX=function(t,n,r,a,s){var o=n.map(function(l){return OP(t,l,r,s,a)}).filter(function(l){return!Xe(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},PP=function(t,n,r,a,s){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&OP(t,c,u,a)||wc(t,u,r,s)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},RP=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},MP=function(t,n,r,a){if(a)return t.map(function(c){return c.coordinate});var s,o,l=t.map(function(c){return c.coordinate===n&&(s=!0),c.coordinate===r&&(o=!0),c.coordinate});return s||l.push(n),o||l.push(r),l},Na=function(t,n,r){if(!t)return null;var a=t.scale,s=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(n||r)&&o==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?$r(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=s?s.indexOf(f):f;return{coordinate:a(h)+u,value:f,offset:u}});return d.filter(function(f){return!Du(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:a(f)+u,value:f,index:h,offset:u}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(f){return{coordinate:a(f)+u,value:f,offset:u}}):a.domain().map(function(f,h){return{coordinate:a(f)+u,value:s?s[f]:f,index:h,offset:u}})},dg=new WeakMap,Od=function(t,n){if(typeof n!="function")return t;dg.has(t)||dg.set(t,new WeakMap);var r=dg.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},HX=function(t,n,r){var a=t.scale,s=t.type,o=t.layout,l=t.axisType;if(a==="auto")return o==="radial"&&l==="radiusAxis"?{scale:eu(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:lh(),realScaleType:"linear"}:s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:xc(),realScaleType:"point"}:s==="category"?{scale:eu(),realScaleType:"band"}:{scale:lh(),realScaleType:"linear"};if(ms(a)){var c="scale".concat(Cp(a));return{scale:(tN[c]||xc)(),realScaleType:tN[c]?c:"point"}}return De(a)?{scale:a}:{scale:xc(),realScaleType:"point"}},cN=1e-4,GX=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),s=Math.min(a[0],a[1])-cN,o=Math.max(a[0],a[1])+cN,l=t(n[0]),c=t(n[r-1]);(l<s||l>o||c<s||c>o)&&t.domain([n[0],n[r-1]])}},qX=function(t,n){if(!t)return null;for(var r=0,a=t.length;r<a;r++)if(t[r].item===n)return t[r].position;return null},KX=function(t,n){if(!n||n.length!==2||!de(n[0])||!de(n[1]))return t;var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]),s=[t[0],t[1]];return(!de(t[0])||t[0]<r)&&(s[0]=r),(!de(t[1])||t[1]>a)&&(s[1]=a),s[0]>a&&(s[0]=a),s[1]<r&&(s[1]=r),s},VX=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var s=0,o=0,l=0;l<n;++l){var c=Du(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=s,t[l][r][1]=s+c,s=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},YX=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var s=0,o=0;o<n;++o){var l=Du(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=s,t[o][r][1]=s+l,s=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},XX={sign:VX,expand:d4,none:$o,silhouette:f4,wiggle:h4,positive:YX},ZX=function(t,n,r){var a=n.map(function(l){return l.props.dataKey}),s=XX[r],o=u4().keys(a).value(function(l,c){return+la(l,c,0)}).order(sy).offset(s);return o(t)},QX=function(t,n,r,a,s,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(f,h){var p,g=(p=h.type)!==null&&p!==void 0&&p.defaultProps?At(At({},h.type.defaultProps),h.props):h.props,m=g.stackId,y=g.hide;if(y)return f;var v=g[r],b=f[v]||{hasStack:!1,stackGroups:{}};if(qt(m)){var w=b.stackGroups[m]||{numericAxisId:r,cateAxisId:a,items:[]};w.items.push(h),b.hasStack=!0,b.stackGroups[m]=w}else b.stackGroups[Ap("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[h]};return At(At({},f),{},jo({},v,b))},c),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,y){var v=p.stackGroups[y];return At(At({},m),{},jo({},y,{numericAxisId:r,cateAxisId:a,items:v.items,stackedData:ZX(t,v.items,s)}))},g)}return At(At({},f),{},jo({},h,p))},d)},JX=function(t,n){var r=n.realScaleType,a=n.type,s=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(s&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=uX(u,s,l);return t.domain([Wp(d),Up(d)]),{niceTicks:d}}if(s&&a==="number"){var f=t.domain(),h=dX(f,s,l);return{niceTicks:h}}return null},uN=function(t){var n=t.axis,r=t.ticks,a=t.offset,s=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+a:null;var c=la(o,n.dataKey,n.domain[l]);return Xe(c)?null:n.scale(c)-s/2+a},eZ=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return a<=0&&s>=0?0:s<0?s:a}return r[0]},tZ=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,s=a.stackId;if(qt(s)){var o=n[s];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},nZ=function(t){return t.reduce(function(n,r){return[Wp(r.concat([n[0]]).filter(de)),Up(r.concat([n[1]]).filter(de))]},[1/0,-1/0])},IP=function(t,n,r){return Object.keys(t).reduce(function(a,s){var o=t[s],l=o.stackedData,c=l.reduce(function(u,d){var f=nZ(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},dN=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,fN=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,$y=function(t,n,r){if(De(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(de(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(dN.test(t[0])){var s=+dN.exec(t[0])[1];a[0]=n[0]-s}else De(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(de(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(fN.test(t[1])){var o=+fN.exec(t[1])[1];a[1]=n[1]+o}else De(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},mh=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var s=a0(n,function(f){return f.coordinate}),o=1/0,l=1,c=s.length;l<c;l++){var u=s[l],d=s[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},hN=function(t,n,r){return!t||!t.length||A0(t,xr(r,"type.defaultProps.domain"))?n:t},$P=function(t,n){var r=t.type.defaultProps?At(At({},t.type.defaultProps),t.props):t.props,a=r.dataKey,s=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return At(At({},Ve(t,!1)),{},{dataKey:a,unit:o,formatter:l,name:s||a,color:O0(t),value:la(n,a),type:c,payload:n,chartType:u,hide:d})};function cu(e){"@babel/helpers - typeof";return cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cu(e)}function pN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function mN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pN(Object(n),!0).forEach(function(r){rZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rZ(e,t,n){return t=aZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aZ(e){var t=iZ(e,"string");return cu(t)=="symbol"?t:t+""}function iZ(e,t){if(cu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gh=Math.PI/180,sZ=function(t){return t*180/Math.PI},on=function(t,n,r,a){return{x:t+Math.cos(-gh*a)*r,y:n+Math.sin(-gh*a)*r}},oZ=function(t,n){var r=t.x,a=t.y,s=n.x,o=n.y;return Math.sqrt(Math.pow(r-s,2)+Math.pow(a-o,2))},lZ=function(t,n){var r=t.x,a=t.y,s=n.cx,o=n.cy,l=oZ({x:r,y:a},{x:s,y:o});if(l<=0)return{radius:l};var c=(r-s)/l,u=Math.acos(c);return a>o&&(u=2*Math.PI-u),{radius:l,angle:sZ(u),angleInRadian:u}},cZ=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),s=Math.floor(r/360),o=Math.min(a,s);return{startAngle:n-o*360,endAngle:r-o*360}},uZ=function(t,n){var r=n.startAngle,a=n.endAngle,s=Math.floor(r/360),o=Math.floor(a/360),l=Math.min(s,o);return t+l*360},gN=function(t,n){var r=t.x,a=t.y,s=lZ({x:r,y:a},n),o=s.radius,l=s.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=cZ(n),f=d.startAngle,h=d.endAngle,p=l,g;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;g=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;g=p>=h&&p<=f}return g?mN(mN({},n),{},{radius:o,angle:uZ(p,n)}):null};function uu(e){"@babel/helpers - typeof";return uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uu(e)}var dZ=["offset"];function fZ(e){return gZ(e)||mZ(e)||pZ(e)||hZ()}function hZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
92
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pZ(e,t){if(e){if(typeof e=="string")return Ly(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ly(e,t)}}function mZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gZ(e){if(Array.isArray(e))return Ly(e)}function Ly(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vZ(e,t){if(e==null)return{};var n=yZ(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yZ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function vN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ut(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vN(Object(n),!0).forEach(function(r){bZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bZ(e,t,n){return t=xZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xZ(e){var t=wZ(e,"string");return uu(t)=="symbol"?t:t+""}function wZ(e,t){if(uu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function du(){return du=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},du.apply(this,arguments)}var SZ=function(t){var n=t.value,r=t.formatter,a=Xe(t.children)?n:t.children;return De(r)?r(a):a},kZ=function(t,n){var r=$r(n-t),a=Math.min(Math.abs(n-t),360);return r*a},NZ=function(t,n,r){var a=t.position,s=t.viewBox,o=t.offset,l=t.className,c=s,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,p=c.startAngle,g=c.endAngle,m=c.clockWise,y=(f+h)/2,v=kZ(p,g),b=v>=0?1:-1,w,N;a==="insideStart"?(w=p+b*o,N=m):a==="insideEnd"?(w=g-b*o,N=!m):a==="end"&&(w=g+b*o,N=m),N=v<=0?N:!N;var S=on(u,d,y,w),x=on(u,d,y,w+(N?1:-1)*359),E="M".concat(S.x,",").concat(S.y,`
93
- A`).concat(y,",").concat(y,",0,1,").concat(N?0:1,`,
94
- `).concat(x.x,",").concat(x.y),j=Xe(t.id)?Ap("recharts-radial-line-"):t.id;return H.createElement("text",du({},r,{dominantBaseline:"central",className:Ye("recharts-radial-bar-label",l)}),H.createElement("defs",null,H.createElement("path",{id:j,d:E})),H.createElement("textPath",{xlinkHref:"#".concat(j)},n))},EZ=function(t){var n=t.viewBox,r=t.offset,a=t.position,s=n,o=s.cx,l=s.cy,c=s.innerRadius,u=s.outerRadius,d=s.startAngle,f=s.endAngle,h=(d+f)/2;if(a==="outside"){var p=on(o,l,u+r,h),g=p.x,m=p.y;return{x:g,y:m,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var y=(c+u)/2,v=on(o,l,y,h),b=v.x,w=v.y;return{x:b,y:w,textAnchor:"middle",verticalAnchor:"middle"}},jZ=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,s=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*a,p=f>0?"end":"start",g=f>0?"start":"end",m=u>=0?1:-1,y=m*a,v=m>0?"end":"start",b=m>0?"start":"end";if(s==="top"){var w={x:l+u/2,y:c-f*a,textAnchor:"middle",verticalAnchor:p};return Ut(Ut({},w),r?{height:Math.max(c-r.y,0),width:u}:{})}if(s==="bottom"){var N={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:g};return Ut(Ut({},N),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(s==="left"){var S={x:l-y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return Ut(Ut({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(s==="right"){var x={x:l+u+y,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return Ut(Ut({},x),r?{width:Math.max(r.x+r.width-x.x,0),height:d}:{})}var E=r?{width:u,height:d}:{};return s==="insideLeft"?Ut({x:l+y,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},E):s==="insideRight"?Ut({x:l+u-y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},E):s==="insideTop"?Ut({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},E):s==="insideBottom"?Ut({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},E):s==="insideTopLeft"?Ut({x:l+y,y:c+h,textAnchor:b,verticalAnchor:g},E):s==="insideTopRight"?Ut({x:l+u-y,y:c+h,textAnchor:v,verticalAnchor:g},E):s==="insideBottomLeft"?Ut({x:l+y,y:c+d-h,textAnchor:b,verticalAnchor:p},E):s==="insideBottomRight"?Ut({x:l+u-y,y:c+d-h,textAnchor:v,verticalAnchor:p},E):dl(s)&&(de(s.x)||Zi(s.x))&&(de(s.y)||Zi(s.y))?Ut({x:l+gs(s.x,u),y:c+gs(s.y,d),textAnchor:"end",verticalAnchor:"end"},E):Ut({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},E)},_Z=function(t){return"cx"in t&&de(t.cx)};function yn(e){var t=e.offset,n=t===void 0?5:t,r=vZ(e,dZ),a=Ut({offset:n},r),s=a.viewBox,o=a.position,l=a.value,c=a.children,u=a.content,d=a.className,f=d===void 0?"":d,h=a.textBreakAll;if(!s||Xe(l)&&Xe(c)&&!k.isValidElement(u)&&!De(u))return null;if(k.isValidElement(u))return k.cloneElement(u,a);var p;if(De(u)){if(p=k.createElement(u,a),k.isValidElement(p))return p}else p=SZ(a);var g=_Z(s),m=Ve(a,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return NZ(a,p,m);var y=g?EZ(a):jZ(a);return H.createElement(eh,du({className:Ye("recharts-label",f)},m,y,{breakAll:h}),p)}yn.displayName="Label";var LP=function(t){var n=t.cx,r=t.cy,a=t.angle,s=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,p=t.top,g=t.left,m=t.width,y=t.height,v=t.clockWise,b=t.labelViewBox;if(b)return b;if(de(m)&&de(y)){if(de(f)&&de(h))return{x:f,y:h,width:m,height:y};if(de(p)&&de(g))return{x:p,y:g,width:m,height:y}}return de(f)&&de(h)?{x:f,y:h,width:0,height:0}:de(n)&&de(r)?{cx:n,cy:r,startAngle:s||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:v}:t.viewBox?t.viewBox:{}},AZ=function(t,n){return t?t===!0?H.createElement(yn,{key:"label-implicit",viewBox:n}):qt(t)?H.createElement(yn,{key:"label-implicit",viewBox:n,value:t}):k.isValidElement(t)?t.type===yn?k.cloneElement(t,{key:"label-implicit",viewBox:n}):H.createElement(yn,{key:"label-implicit",content:t,viewBox:n}):De(t)?H.createElement(yn,{key:"label-implicit",content:t,viewBox:n}):dl(t)?H.createElement(yn,du({viewBox:n},t,{key:"label-implicit"})):null:null},CZ=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,s=LP(t),o=Br(a,yn).map(function(c,u){return k.cloneElement(c,{viewBox:n||s,key:"label-".concat(u)})});if(!r)return o;var l=AZ(t.label,n||s);return[l].concat(fZ(o))};yn.parseViewBox=LP;yn.renderCallByParent=CZ;function TZ(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var OZ=TZ;const PZ=Qe(OZ);function fu(e){"@babel/helpers - typeof";return fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fu(e)}var RZ=["valueAccessor"],MZ=["data","dataKey","clockWise","id","textBreakAll"];function IZ(e){return BZ(e)||DZ(e)||LZ(e)||$Z()}function $Z(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
95
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LZ(e,t){if(e){if(typeof e=="string")return Dy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dy(e,t)}}function DZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function BZ(e){if(Array.isArray(e))return Dy(e)}function Dy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vh(){return vh=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},vh.apply(this,arguments)}function yN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function bN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yN(Object(n),!0).forEach(function(r){zZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zZ(e,t,n){return t=FZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FZ(e){var t=UZ(e,"string");return fu(t)=="symbol"?t:t+""}function UZ(e,t){if(fu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xN(e,t){if(e==null)return{};var n=WZ(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WZ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var HZ=function(t){return Array.isArray(t.value)?PZ(t.value):t.value};function os(e){var t=e.valueAccessor,n=t===void 0?HZ:t,r=xN(e,RZ),a=r.data,s=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=xN(r,MZ);return!a||!a.length?null:H.createElement(Zt,{className:"recharts-label-list"},a.map(function(d,f){var h=Xe(s)?n(d,f):la(d&&d.payload,s),p=Xe(l)?{}:{id:"".concat(l,"-").concat(f)};return H.createElement(yn,vh({},Ve(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:yn.parseViewBox(Xe(o)?d:bN(bN({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}os.displayName="LabelList";function GZ(e,t){return e?e===!0?H.createElement(os,{key:"labelList-implicit",data:t}):H.isValidElement(e)||De(e)?H.createElement(os,{key:"labelList-implicit",data:t,content:e}):dl(e)?H.createElement(os,vh({data:t},e,{key:"labelList-implicit"})):null:null}function qZ(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=Br(r,os).map(function(o,l){return k.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return a;var s=GZ(e.label,t);return[s].concat(IZ(a))}os.renderCallByParent=qZ;function hu(e){"@babel/helpers - typeof";return hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hu(e)}function By(){return By=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},By.apply(this,arguments)}function wN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function SN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wN(Object(n),!0).forEach(function(r){KZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KZ(e,t,n){return t=VZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VZ(e){var t=YZ(e,"string");return hu(t)=="symbol"?t:t+""}function YZ(e,t){if(hu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var XZ=function(t,n){var r=$r(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},Pd=function(t){var n=t.cx,r=t.cy,a=t.radius,s=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+a,f=Math.asin(c/d)/gh,h=u?s:s+o*f,p=on(n,r,d,h),g=on(n,r,a,h),m=u?s-o*f:s,y=on(n,r,d*Math.cos(f*gh),m);return{center:p,circleTangency:g,lineTangency:y,theta:f}},DP=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,s=t.outerRadius,o=t.startAngle,l=t.endAngle,c=XZ(o,l),u=o+c,d=on(n,r,s,o),f=on(n,r,s,u),h="M ".concat(d.x,",").concat(d.y,`
96
- A `).concat(s,",").concat(s,`,0,
97
- `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
98
- `).concat(f.x,",").concat(f.y,`
99
- `);if(a>0){var p=on(n,r,a,o),g=on(n,r,a,u);h+="L ".concat(g.x,",").concat(g.y,`
100
- A `).concat(a,",").concat(a,`,0,
101
- `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
102
- `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},ZZ=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,s=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=$r(d-u),h=Pd({cx:n,cy:r,radius:s,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,g=h.lineTangency,m=h.theta,y=Pd({cx:n,cy:r,radius:s,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),v=y.circleTangency,b=y.lineTangency,w=y.theta,N=c?Math.abs(u-d):Math.abs(u-d)-m-w;if(N<0)return l?"M ".concat(g.x,",").concat(g.y,`
103
- a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
104
- a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
105
- `):DP({cx:n,cy:r,innerRadius:a,outerRadius:s,startAngle:u,endAngle:d});var S="M ".concat(g.x,",").concat(g.y,`
106
- A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,`
107
- A`).concat(s,",").concat(s,",0,").concat(+(N>180),",").concat(+(f<0),",").concat(v.x,",").concat(v.y,`
108
- A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(b.x,",").concat(b.y,`
109
- `);if(a>0){var x=Pd({cx:n,cy:r,radius:a,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),E=x.circleTangency,j=x.lineTangency,C=x.theta,T=Pd({cx:n,cy:r,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),$=T.circleTangency,R=T.lineTangency,I=T.theta,L=c?Math.abs(u-d):Math.abs(u-d)-C-I;if(L<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(R.x,",").concat(R.y,`
110
- A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat($.x,",").concat($.y,`
111
- A`).concat(a,",").concat(a,",0,").concat(+(L>180),",").concat(+(f>0),",").concat(E.x,",").concat(E.y,`
112
- A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(j.x,",").concat(j.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},QZ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},BP=function(t){var n=SN(SN({},QZ),t),r=n.cx,a=n.cy,s=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,h=n.className;if(o<s||d===f)return null;var p=Ye("recharts-sector",h),g=o-s,m=gs(l,g,0,!0),y;return m>0&&Math.abs(d-f)<360?y=ZZ({cx:r,cy:a,innerRadius:s,outerRadius:o,cornerRadius:Math.min(m,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):y=DP({cx:r,cy:a,innerRadius:s,outerRadius:o,startAngle:d,endAngle:f}),H.createElement("path",By({},Ve(n,!0),{className:p,d:y,role:"img"}))};function pu(e){"@babel/helpers - typeof";return pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pu(e)}function zy(){return zy=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},zy.apply(this,arguments)}function kN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function NN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kN(Object(n),!0).forEach(function(r){JZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JZ(e,t,n){return t=eQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eQ(e){var t=tQ(e,"string");return pu(t)=="symbol"?t:t+""}function tQ(e,t){if(pu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EN={curveBasisClosed:J3,curveBasisOpen:e4,curveBasis:Q3,curveBumpX:D3,curveBumpY:B3,curveLinearClosed:t4,curveLinear:Op,curveMonotoneX:n4,curveMonotoneY:r4,curveNatural:a4,curveStep:i4,curveStepAfter:o4,curveStepBefore:s4},Rd=function(t){return t.x===+t.x&&t.y===+t.y},Yl=function(t){return t.x},Xl=function(t){return t.y},nQ=function(t,n){if(De(t))return t;var r="curve".concat(Cp(t));return(r==="curveMonotone"||r==="curveBump")&&n?EN["".concat(r).concat(n==="vertical"?"Y":"X")]:EN[r]||Op},rQ=function(t){var n=t.type,r=n===void 0?"linear":n,a=t.points,s=a===void 0?[]:a,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=nQ(r,l),f=u?s.filter(function(m){return Rd(m)}):s,h;if(Array.isArray(o)){var p=u?o.filter(function(m){return Rd(m)}):o,g=f.map(function(m,y){return NN(NN({},m),{},{base:p[y]})});return l==="vertical"?h=kd().y(Xl).x1(Yl).x0(function(m){return m.base.x}):h=kd().x(Yl).y1(Xl).y0(function(m){return m.base.y}),h.defined(Rd).curve(d),h(g)}return l==="vertical"&&de(o)?h=kd().y(Xl).x1(Yl).x0(o):de(o)?h=kd().x(Yl).y1(Xl).y0(o):h=FT().x(Yl).y(Xl),h.defined(Rd).curve(d),h(f)},jN=function(t){var n=t.className,r=t.points,a=t.path,s=t.pathRef;if((!r||!r.length)&&!a)return null;var o=r&&r.length?rQ(t):a;return k.createElement("path",zy({},Ve(t,!1),Bf(t),{className:Ye("recharts-curve",n),d:o,ref:s}))},zP={exports:{}},aQ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",iQ=aQ,sQ=iQ;function FP(){}function UP(){}UP.resetWarningCache=FP;var oQ=function(){function e(r,a,s,o,l,c){if(c!==sQ){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:UP,resetWarningCache:FP};return n.PropTypes=n,n};zP.exports=oQ();var lQ=zP.exports;const Ze=Qe(lQ),{getOwnPropertyNames:cQ,getOwnPropertySymbols:uQ}=Object,{hasOwnProperty:dQ}=Object.prototype;function fg(e,t){return function(r,a,s){return e(r,a,s)&&t(r,a,s)}}function Md(e){return function(n,r,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a);const{cache:s}=a,o=s.get(n),l=s.get(r);if(o&&l)return o===r&&l===n;s.set(n,r),s.set(r,n);const c=e(n,r,a);return s.delete(n),s.delete(r),c}}function fQ(e){return e!=null?e[Symbol.toStringTag]:void 0}function _N(e){return cQ(e).concat(uQ(e))}const hQ=Object.hasOwn||((e,t)=>dQ.call(e,t));function _s(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const pQ="__v",mQ="__o",gQ="_owner",{getOwnPropertyDescriptor:AN,keys:CN}=Object;function vQ(e,t){return e.byteLength===t.byteLength&&yh(new Uint8Array(e),new Uint8Array(t))}function yQ(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function bQ(e,t){return e.byteLength===t.byteLength&&yh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function xQ(e,t){return _s(e.getTime(),t.getTime())}function wQ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function SQ(e,t){return e===t}function TN(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),s=e.entries();let o,l,c=0;for(;(o=s.next())&&!o.done;){const u=t.entries();let d=!1,f=0;for(;(l=u.next())&&!l.done;){if(a[f]){f++;continue}const h=o.value,p=l.value;if(n.equals(h[0],p[0],c,f,e,t,n)&&n.equals(h[1],p[1],h[0],p[0],e,t,n)){d=a[f]=!0;break}f++}if(!d)return!1;c++}return!0}const kQ=_s;function NQ(e,t,n){const r=CN(e);let a=r.length;if(CN(t).length!==a)return!1;for(;a-- >0;)if(!WP(e,t,n,r[a]))return!1;return!0}function Zl(e,t,n){const r=_N(e);let a=r.length;if(_N(t).length!==a)return!1;let s,o,l;for(;a-- >0;)if(s=r[a],!WP(e,t,n,s)||(o=AN(e,s),l=AN(t,s),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function EQ(e,t){return _s(e.valueOf(),t.valueOf())}function jQ(e,t){return e.source===t.source&&e.flags===t.flags}function ON(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),s=e.values();let o,l;for(;(o=s.next())&&!o.done;){const c=t.values();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(!a[d]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){u=a[d]=!0;break}d++}if(!u)return!1}return!0}function yh(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function _Q(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function WP(e,t,n,r){return(r===gQ||r===mQ||r===pQ)&&(e.$$typeof||t.$$typeof)?!0:hQ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const AQ="[object ArrayBuffer]",CQ="[object Arguments]",TQ="[object Boolean]",OQ="[object DataView]",PQ="[object Date]",RQ="[object Error]",MQ="[object Map]",IQ="[object Number]",$Q="[object Object]",LQ="[object RegExp]",DQ="[object Set]",BQ="[object String]",zQ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},FQ="[object URL]",UQ=Object.prototype.toString;function WQ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:a,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:g}){return function(y,v,b){if(y===v)return!0;if(y==null||v==null)return!1;const w=typeof y;if(w!==typeof v)return!1;if(w!=="object")return w==="number"?l(y,v,b):w==="function"?s(y,v,b):!1;const N=y.constructor;if(N!==v.constructor)return!1;if(N===Object)return c(y,v,b);if(Array.isArray(y))return t(y,v,b);if(N===Date)return r(y,v,b);if(N===RegExp)return d(y,v,b);if(N===Map)return o(y,v,b);if(N===Set)return f(y,v,b);const S=UQ.call(y);if(S===PQ)return r(y,v,b);if(S===LQ)return d(y,v,b);if(S===MQ)return o(y,v,b);if(S===DQ)return f(y,v,b);if(S===$Q)return typeof y.then!="function"&&typeof v.then!="function"&&c(y,v,b);if(S===FQ)return p(y,v,b);if(S===RQ)return a(y,v,b);if(S===CQ)return c(y,v,b);if(zQ[S])return h(y,v,b);if(S===AQ)return e(y,v,b);if(S===OQ)return n(y,v,b);if(S===TQ||S===IQ||S===BQ)return u(y,v,b);if(g){let x=g[S];if(!x){const E=fQ(y);E&&(x=g[E])}if(x)return x(y,v,b)}return!1}}function HQ({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:vQ,areArraysEqual:n?Zl:yQ,areDataViewsEqual:bQ,areDatesEqual:xQ,areErrorsEqual:wQ,areFunctionsEqual:SQ,areMapsEqual:n?fg(TN,Zl):TN,areNumbersEqual:kQ,areObjectsEqual:n?Zl:NQ,arePrimitiveWrappersEqual:EQ,areRegExpsEqual:jQ,areSetsEqual:n?fg(ON,Zl):ON,areTypedArraysEqual:n?fg(yh,Zl):yh,areUrlsEqual:_Q,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=Md(r.areArraysEqual),s=Md(r.areMapsEqual),o=Md(r.areObjectsEqual),l=Md(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:l})}return r}function GQ(e){return function(t,n,r,a,s,o,l){return e(t,n,l)}}function qQ({circular:e,comparator:t,createState:n,equals:r,strict:a}){if(n)return function(l,c){const{cache:u=e?new WeakMap:void 0,meta:d}=n();return t(l,c,{cache:u,equals:r,meta:d,strict:a})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:r,meta:void 0,strict:a})};const s={cache:void 0,equals:r,meta:void 0,strict:a};return function(l,c){return t(l,c,s)}}const KQ=_i();_i({strict:!0});_i({circular:!0});_i({circular:!0,strict:!0});_i({createInternalComparator:()=>_s});_i({strict:!0,createInternalComparator:()=>_s});_i({circular:!0,createInternalComparator:()=>_s});_i({circular:!0,createInternalComparator:()=>_s,strict:!0});function _i(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,s=HQ(e),o=WQ(s),l=n?n(o):GQ(o);return qQ({circular:t,comparator:o,createState:r,equals:l,strict:a})}function VQ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function PN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(s){n<0&&(n=s),s-n>t?(e(s),n=-1):VQ(a)};requestAnimationFrame(r)}function Fy(e){"@babel/helpers - typeof";return Fy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fy(e)}function YQ(e){return JQ(e)||QQ(e)||ZQ(e)||XQ()}function XQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
113
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZQ(e,t){if(e){if(typeof e=="string")return RN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return RN(e,t)}}function RN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function QQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JQ(e){if(Array.isArray(e))return e}function eJ(){var e={},t=function(){return null},n=!1,r=function a(s){if(!n){if(Array.isArray(s)){if(!s.length)return;var o=s,l=YQ(o),c=l[0],u=l.slice(1);if(typeof c=="number"){PN(a.bind(null,u),c);return}a(c),PN(a.bind(null,u));return}Fy(s)==="object"&&(e=s,t(e)),typeof s=="function"&&s()}};return{stop:function(){n=!0},start:function(s){n=!1,r(s)},subscribe:function(s){return t=s,function(){t=function(){return null}}}}}function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function MN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function IN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MN(Object(n),!0).forEach(function(r){HP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HP(e,t,n){return t=tJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tJ(e){var t=nJ(e,"string");return mu(t)==="symbol"?t:String(t)}function nJ(e,t){if(mu(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mu(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rJ=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(s){return a.includes(s)})})},aJ=function(t){return t},iJ=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Sc=function(t,n){return Object.keys(n).reduce(function(r,a){return IN(IN({},r),{},HP({},a,t(a,n[a])))},{})},$N=function(t,n,r){return t.map(function(a){return"".concat(iJ(a)," ").concat(n,"ms ").concat(r)}).join(",")};function sJ(e,t){return cJ(e)||lJ(e,t)||GP(e,t)||oJ()}function oJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
114
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function cJ(e){if(Array.isArray(e))return e}function uJ(e){return hJ(e)||fJ(e)||GP(e)||dJ()}function dJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
115
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GP(e,t){if(e){if(typeof e=="string")return Uy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Uy(e,t)}}function fJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hJ(e){if(Array.isArray(e))return Uy(e)}function Uy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bh=1e-4,qP=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},KP=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},LN=function(t,n){return function(r){var a=qP(t,n);return KP(a,r)}},pJ=function(t,n){return function(r){var a=qP(t,n),s=[].concat(uJ(a.map(function(o,l){return o*l}).slice(1)),[0]);return KP(s,r)}},DN=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],s=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,s=0,o=1,l=1;break;case"ease":a=.25,s=.1,o=.25,l=1;break;case"ease-in":a=.42,s=0,o=1,l=1;break;case"ease-out":a=.42,s=0,o=.58,l=1;break;case"ease-in-out":a=0,s=0,o=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),d=sJ(u,4);a=d[0],s=d[1],o=d[2],l=d[3]}}}var f=LN(a,o),h=LN(s,l),p=pJ(a,o),g=function(v){return v>1?1:v<0?0:v},m=function(v){for(var b=v>1?1:v,w=b,N=0;N<8;++N){var S=f(w)-b,x=p(w);if(Math.abs(S-b)<bh||x<bh)return h(w);w=g(w-S/x)}return h(w)};return m.isStepper=!1,m},mJ=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,s=a===void 0?8:a,o=t.dt,l=o===void 0?17:o,c=function(d,f,h){var p=-(d-f)*r,g=h*s,m=h+(p-g)*l/1e3,y=h*l/1e3+d;return Math.abs(y-f)<bh&&Math.abs(m)<bh?[f,0]:[y,m]};return c.isStepper=!0,c.dt=l,c},gJ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return DN(a);case"spring":return mJ();default:if(a.split("(")[0]==="cubic-bezier")return DN(a)}return typeof a=="function"?a:null};function gu(e){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gu(e)}function BN(e){return bJ(e)||yJ(e)||VP(e)||vJ()}function vJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
116
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bJ(e){if(Array.isArray(e))return Hy(e)}function zN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function an(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zN(Object(n),!0).forEach(function(r){Wy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wy(e,t,n){return t=xJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xJ(e){var t=wJ(e,"string");return gu(t)==="symbol"?t:String(t)}function wJ(e,t){if(gu(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gu(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SJ(e,t){return EJ(e)||NJ(e,t)||VP(e,t)||kJ()}function kJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
117
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VP(e,t){if(e){if(typeof e=="string")return Hy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hy(e,t)}}function Hy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function EJ(e){if(Array.isArray(e))return e}var xh=function(t,n,r){return t+(n-t)*r},Gy=function(t){var n=t.from,r=t.to;return n!==r},jJ=function e(t,n,r){var a=Sc(function(s,o){if(Gy(o)){var l=t(o.from,o.to,o.velocity),c=SJ(l,2),u=c[0],d=c[1];return an(an({},o),{},{from:u,velocity:d})}return o},n);return r<1?Sc(function(s,o){return Gy(o)?an(an({},o),{},{velocity:xh(o.velocity,a[s].velocity,r),from:xh(o.from,a[s].from,r)}):o},n):e(t,a,r-1)};const _J=function(e,t,n,r,a){var s=rJ(e,t),o=s.reduce(function(y,v){return an(an({},y),{},Wy({},v,[e[v],t[v]]))},{}),l=s.reduce(function(y,v){return an(an({},y),{},Wy({},v,{from:e[v],velocity:0,to:t[v]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return Sc(function(v,b){return b.from},l)},p=function(){return!Object.values(l).filter(Gy).length},g=function(v){u||(u=v);var b=v-u,w=b/n.dt;l=jJ(n,l,w),a(an(an(an({},e),t),h())),u=v,p()||(c=requestAnimationFrame(f))},m=function(v){d||(d=v);var b=(v-d)/r,w=Sc(function(S,x){return xh.apply(void 0,BN(x).concat([n(b)]))},o);if(a(an(an(an({},e),t),w)),b<1)c=requestAnimationFrame(f);else{var N=Sc(function(S,x){return xh.apply(void 0,BN(x).concat([n(1)]))},o);a(an(an(an({},e),t),N))}};return f=n.isStepper?g:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function Go(e){"@babel/helpers - typeof";return Go=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Go(e)}var AJ=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function CJ(e,t){if(e==null)return{};var n=TJ(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,s;for(s=0;s<r.length;s++)a=r[s],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function hg(e){return MJ(e)||RJ(e)||PJ(e)||OJ()}function OJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
118
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PJ(e,t){if(e){if(typeof e=="string")return qy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qy(e,t)}}function RJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function MJ(e){if(Array.isArray(e))return qy(e)}function qy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Cr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FN(Object(n),!0).forEach(function(r){lc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lc(e,t,n){return t=YP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $J(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,YP(r.key),r)}}function LJ(e,t,n){return t&&$J(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function YP(e){var t=DJ(e,"string");return Go(t)==="symbol"?t:String(t)}function DJ(e,t){if(Go(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Go(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ky(e,t)}function Ky(e,t){return Ky=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Ky(e,t)}function zJ(e){var t=FJ();return function(){var r=wh(e),a;if(t){var s=wh(this).constructor;a=Reflect.construct(r,arguments,s)}else a=r.apply(this,arguments);return Vy(this,a)}}function Vy(e,t){if(t&&(Go(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yy(e)}function Yy(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FJ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wh(e){return wh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},wh(e)}var yi=function(e){BJ(n,e);var t=zJ(n);function n(r,a){var s;IJ(this,n),s=t.call(this,r,a);var o=s.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,p=o.duration;if(s.handleStyleChange=s.handleStyleChange.bind(Yy(s)),s.changeStyle=s.changeStyle.bind(Yy(s)),!l||p<=0)return s.state={style:{}},typeof h=="function"&&(s.state={style:d}),Vy(s);if(f&&f.length)s.state={style:f[0].style};else if(u){if(typeof h=="function")return s.state={style:u},Vy(s);s.state={style:c?lc({},c,u):u}}else s.state={style:{}};return s}return LJ(n,[{key:"componentDidMount",value:function(){var a=this.props,s=a.isActive,o=a.canBegin;this.mounted=!0,!(!s||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var s=this.props,o=s.isActive,l=s.canBegin,c=s.attributeName,u=s.shouldReAnimate,d=s.to,f=s.from,h=this.state.style;if(l){if(!o){var p={style:c?lc({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(KQ(a.to,d)&&a.canBegin&&a.isActive)){var g=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=g||u?f:a.to;if(this.state&&h){var y={style:c?lc({},c,m):m};(c&&h[c]!==m||!c&&h!==m)&&this.setState(y)}this.runAnimation(Cr(Cr({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var s=this,o=a.from,l=a.to,c=a.duration,u=a.easing,d=a.begin,f=a.onAnimationEnd,h=a.onAnimationStart,p=_J(o,l,gJ(u),c,this.changeStyle),g=function(){s.stopJSAnimation=p()};this.manager.start([h,d,g,c,f])}},{key:"runStepAnimation",value:function(a){var s=this,o=a.steps,l=a.begin,c=a.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(m,y,v){if(v===0)return m;var b=y.duration,w=y.easing,N=w===void 0?"ease":w,S=y.style,x=y.properties,E=y.onAnimationEnd,j=v>0?o[v-1]:y,C=x||Object.keys(S);if(typeof N=="function"||N==="spring")return[].concat(hg(m),[s.runJSAnimation.bind(s,{from:j.style,to:S,duration:b,easing:N}),b]);var T=$N(C,b,N),$=Cr(Cr(Cr({},j.style),S),{},{transition:T});return[].concat(hg(m),[$,b,E]).filter(aJ)};return this.manager.start([c].concat(hg(o.reduce(p,[d,Math.max(h,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=eJ());var s=a.begin,o=a.duration,l=a.attributeName,c=a.to,u=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,h=a.steps,p=a.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var m=l?lc({},l,c):c,y=$N(Object.keys(m),o,u);g.start([d,s,Cr(Cr({},m),{},{transition:y}),o,f])}},{key:"render",value:function(){var a=this.props,s=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=CJ(a,AJ),u=k.Children.count(s),d=this.state.style;if(typeof s=="function")return s(d);if(!l||u===0||o<=0)return s;var f=function(p){var g=p.props,m=g.style,y=m===void 0?{}:m,v=g.className,b=k.cloneElement(p,Cr(Cr({},c),{},{style:Cr(Cr({},y),d),className:v}));return b};return u===1?f(k.Children.only(s)):H.createElement("div",null,k.Children.map(s,function(h){return f(h)}))}}]),n}(k.PureComponent);yi.displayName="Animate";yi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};yi.propTypes={from:Ze.oneOfType([Ze.object,Ze.string]),to:Ze.oneOfType([Ze.object,Ze.string]),attributeName:Ze.string,duration:Ze.number,begin:Ze.number,easing:Ze.oneOfType([Ze.string,Ze.func]),steps:Ze.arrayOf(Ze.shape({duration:Ze.number.isRequired,style:Ze.object.isRequired,easing:Ze.oneOfType([Ze.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ze.func]),properties:Ze.arrayOf("string"),onAnimationEnd:Ze.func})),children:Ze.oneOfType([Ze.node,Ze.func]),isActive:Ze.bool,canBegin:Ze.bool,onAnimationEnd:Ze.func,shouldReAnimate:Ze.bool,onAnimationStart:Ze.func,onAnimationReStart:Ze.func};function vu(e){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(e)}function Sh(){return Sh=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},Sh.apply(this,arguments)}function UJ(e,t){return qJ(e)||GJ(e,t)||HJ(e,t)||WJ()}function WJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
119
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HJ(e,t){if(e){if(typeof e=="string")return UN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UN(e,t)}}function UN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function GJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function qJ(e){if(Array.isArray(e))return e}function WN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function HN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WN(Object(n),!0).forEach(function(r){KJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KJ(e,t,n){return t=VJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VJ(e){var t=YJ(e,"string");return vu(t)=="symbol"?t:t+""}function YJ(e,t){if(vu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var GN=function(t,n,r,a,s){var o=Math.min(Math.abs(r)/2,Math.abs(a)/2),l=a>=0?1:-1,c=r>=0?1:-1,u=a>=0&&r>=0||a<0&&r<0?1:0,d;if(o>0&&s instanceof Array){for(var f=[0,0,0,0],h=0,p=4;h<p;h++)f[h]=s[h]>o?o:s[h];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(n)),d+="L ".concat(t+r-c*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
120
- `).concat(t+r,",").concat(n+l*f[1])),d+="L ".concat(t+r,",").concat(n+a-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
121
- `).concat(t+r-c*f[2],",").concat(n+a)),d+="L ".concat(t+c*f[3],",").concat(n+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
122
- `).concat(t,",").concat(n+a-l*f[3])),d+="Z"}else if(o>0&&s===+s&&s>0){var g=Math.min(o,s);d="M ".concat(t,",").concat(n+l*g,`
123
- A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+c*g,",").concat(n,`
124
- L `).concat(t+r-c*g,",").concat(n,`
125
- A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*g,`
126
- L `).concat(t+r,",").concat(n+a-l*g,`
127
- A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+r-c*g,",").concat(n+a,`
128
- L `).concat(t+c*g,",").concat(n+a,`
129
- A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(n+a-l*g," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return d},XJ=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,s=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(s,s+l),d=Math.max(s,s+l),f=Math.min(o,o+c),h=Math.max(o,o+c);return r>=u&&r<=d&&a>=f&&a<=h}return!1},ZJ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},P0=function(t){var n=HN(HN({},ZJ),t),r=k.useRef(),a=k.useState(-1),s=UJ(a,2),o=s[0],l=s[1];k.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var N=r.current.getTotalLength();N&&l(N)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,p=n.className,g=n.animationEasing,m=n.animationDuration,y=n.animationBegin,v=n.isAnimationActive,b=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var w=Ye("recharts-rectangle",p);return b?H.createElement(yi,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:m,animationEasing:g,isActive:b},function(N){var S=N.width,x=N.height,E=N.x,j=N.y;return H.createElement(yi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:v,easing:g},H.createElement("path",Sh({},Ve(n,!0),{className:w,d:GN(E,j,S,x,h),ref:r})))}):H.createElement("path",Sh({},Ve(n,!0),{className:w,d:GN(c,u,d,f,h)}))};function Xy(){return Xy=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},Xy.apply(this,arguments)}var XP=function(t){var n=t.cx,r=t.cy,a=t.r,s=t.className,o=Ye("recharts-dot",s);return n===+n&&r===+r&&a===+a?k.createElement("circle",Xy({},Ve(t,!1),Bf(t),{className:o,cx:n,cy:r,r:a})):null};function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}var QJ=["x","y","top","left","width","height","className"];function Zy(){return Zy=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},Zy.apply(this,arguments)}function qN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function JJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qN(Object(n),!0).forEach(function(r){eee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eee(e,t,n){return t=tee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tee(e){var t=nee(e,"string");return yu(t)=="symbol"?t:t+""}function nee(e,t){if(yu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ree(e,t){if(e==null)return{};var n=aee(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var iee=function(t,n,r,a,s,o){return"M".concat(t,",").concat(s,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},see=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,s=a===void 0?0:a,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,g=t.className,m=ree(t,QJ),y=JJ({x:r,y:s,top:l,left:u,width:f,height:p},m);return!de(r)||!de(s)||!de(f)||!de(p)||!de(l)||!de(u)?null:H.createElement("path",Zy({},Ve(y,!0),{className:Ye("recharts-cross",g),d:iee(r,s,f,p,l,u)}))},oee=dO,lee=oee(Object.getPrototypeOf,Object),cee=lee,uee=Da,dee=cee,fee=Ba,hee="[object Object]",pee=Function.prototype,mee=Object.prototype,ZP=pee.toString,gee=mee.hasOwnProperty,vee=ZP.call(Object);function yee(e){if(!fee(e)||uee(e)!=hee)return!1;var t=dee(e);if(t===null)return!0;var n=gee.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ZP.call(n)==vee}var bee=yee;const xee=Qe(bee);var wee=Da,See=Ba,kee="[object Boolean]";function Nee(e){return e===!0||e===!1||See(e)&&wee(e)==kee}var Eee=Nee;const jee=Qe(Eee);function bu(e){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bu(e)}function kh(){return kh=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},kh.apply(this,arguments)}function _ee(e,t){return Oee(e)||Tee(e,t)||Cee(e,t)||Aee()}function Aee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
130
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cee(e,t){if(e){if(typeof e=="string")return KN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KN(e,t)}}function KN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Tee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Oee(e){if(Array.isArray(e))return e}function VN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function YN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VN(Object(n),!0).forEach(function(r){Pee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pee(e,t,n){return t=Ree(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ree(e){var t=Mee(e,"string");return bu(t)=="symbol"?t:t+""}function Mee(e,t){if(bu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var XN=function(t,n,r,a,s){var o=r-a,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+s),l+="L ".concat(t+r-o/2-a,",").concat(n+s),l+="L ".concat(t,",").concat(n," Z"),l},Iee={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$ee=function(t){var n=YN(YN({},Iee),t),r=k.useRef(),a=k.useState(-1),s=_ee(a,2),o=s[0],l=s[1];k.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var w=r.current.getTotalLength();w&&l(w)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,f=n.lowerWidth,h=n.height,p=n.className,g=n.animationEasing,m=n.animationDuration,y=n.animationBegin,v=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var b=Ye("recharts-trapezoid",p);return v?H.createElement(yi,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:m,animationEasing:g,isActive:v},function(w){var N=w.upperWidth,S=w.lowerWidth,x=w.height,E=w.x,j=w.y;return H.createElement(yi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:g},H.createElement("path",kh({},Ve(n,!0),{className:b,d:XN(E,j,N,S,x),ref:r})))}):H.createElement("g",null,H.createElement("path",kh({},Ve(n,!0),{className:b,d:XN(c,u,d,f,h)})))},Lee=["option","shapeType","propTransformer","activeClassName","isActive"];function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function Dee(e,t){if(e==null)return{};var n=Bee(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Bee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ZN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Nh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZN(Object(n),!0).forEach(function(r){zee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zee(e,t,n){return t=Fee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fee(e){var t=Uee(e,"string");return xu(t)=="symbol"?t:t+""}function Uee(e,t){if(xu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wee(e,t){return Nh(Nh({},t),e)}function Hee(e,t){return e==="symbols"}function QN(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return H.createElement(P0,n);case"trapezoid":return H.createElement($ee,n);case"sector":return H.createElement(BP,n);case"symbols":if(Hee(t))return H.createElement(Xx,n);break;default:return null}}function Gee(e){return k.isValidElement(e)?e.props:e}function qee(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?Wee:r,s=e.activeClassName,o=s===void 0?"recharts-active-shape":s,l=e.isActive,c=Dee(e,Lee),u;if(k.isValidElement(t))u=k.cloneElement(t,Nh(Nh({},c),Gee(t)));else if(De(t))u=t(c);else if(xee(t)&&!jee(t)){var d=a(t,c);u=H.createElement(QN,{shapeType:n,elementProps:d})}else{var f=c;u=H.createElement(QN,{shapeType:n,elementProps:f})}return l?H.createElement(Zt,{className:o},u):u}function Kp(e,t){return t!=null&&"trapezoids"in e.props}function Vp(e,t){return t!=null&&"sectors"in e.props}function wu(e,t){return t!=null&&"points"in e.props}function Kee(e,t){var n,r,a=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,s=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return a&&s}function Vee(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Yee(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function Xee(e,t){var n;return Kp(e,t)?n=Kee:Vp(e,t)?n=Vee:wu(e,t)&&(n=Yee),n}function Zee(e,t){var n;return Kp(e,t)?n="trapezoids":Vp(e,t)?n="sectors":wu(e,t)&&(n="points"),n}function Qee(e,t){if(Kp(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(Vp(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return wu(e,t)?t.payload:{}}function Jee(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=Zee(n,t),s=Qee(n,t),o=r.filter(function(c,u){var d=A0(s,c),f=n.props[a].filter(function(g){var m=Xee(n,t);return m(g,t)}),h=n.props[a].indexOf(f[f.length-1]),p=u===h;return d&&p}),l=r.indexOf(o[o.length-1]);return l}var ete=Math.ceil,tte=Math.max;function nte(e,t,n,r){for(var a=-1,s=tte(ete((t-e)/(n||1)),0),o=Array(s);s--;)o[r?s:++a]=e,e+=n;return o}var rte=nte,ate=TO,JN=1/0,ite=17976931348623157e292;function ste(e){if(!e)return e===0?e:0;if(e=ate(e),e===JN||e===-JN){var t=e<0?-1:1;return t*ite}return e===e?e:0}var QP=ste,ote=rte,lte=Ip,pg=QP;function cte(e){return function(t,n,r){return r&&typeof r!="number"&&lte(t,n,r)&&(n=r=void 0),t=pg(t),n===void 0?(n=t,t=0):n=pg(n),r=r===void 0?t<n?1:-1:pg(r),ote(t,n,r,e)}}var ute=cte,dte=ute,fte=dte(),hte=fte;const Eh=Qe(hte);function Su(e){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Su(e)}function eE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eE(Object(n),!0).forEach(function(r){JP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JP(e,t,n){return t=pte(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pte(e){var t=mte(e,"string");return Su(t)=="symbol"?t:t+""}function mte(e,t){if(Su(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Su(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gte=["Webkit","Moz","O","ms"],vte=function(t,n){var r=t.replace(/(\w)/,function(s){return s.toUpperCase()}),a=gte.reduce(function(s,o){return tE(tE({},s),{},JP({},o+r,n))},{});return a[t]=n,a};function qo(e){"@babel/helpers - typeof";return qo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qo(e)}function jh(){return jh=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},jh.apply(this,arguments)}function nE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function mg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nE(Object(n),!0).forEach(function(r){Zn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tR(r.key),r)}}function bte(e,t,n){return t&&rE(e.prototype,t),n&&rE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xte(e,t,n){return t=_h(t),wte(e,eR()?Reflect.construct(t,n||[],_h(e).constructor):t.apply(e,n))}function wte(e,t){if(t&&(qo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ste(e)}function Ste(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eR=function(){return!!e})()}function _h(e){return _h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_h(e)}function kte(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qy(e,t)}function Qy(e,t){return Qy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Qy(e,t)}function Zn(e,t,n){return t=tR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tR(e){var t=Nte(e,"string");return qo(t)=="symbol"?t:t+""}function Nte(e,t){if(qo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ete=function(t){var n=t.data,r=t.startIndex,a=t.endIndex,s=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=xc().domain(Eh(0,c)).range([s,s+o-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(a),scale:u,scaleValues:d}},aE=function(t){return t.changedTouches&&!!t.changedTouches.length},Ko=function(e){function t(n){var r;return yte(this,t),r=xte(this,t,[n]),Zn(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Zn(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Zn(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,s=a.endIndex,o=a.onDragEnd,l=a.startIndex;o==null||o({endIndex:s,startIndex:l})}),r.detachDragEndListener()}),Zn(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Zn(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Zn(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Zn(r,"handleSlideDragStart",function(a){var s=aE(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return kte(t,e),bte(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,s=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(a,s),h=Math.max(a,s),p=t.getIndexInRange(o,f),g=t.getIndexInRange(o,h);return{startIndex:p-p%c,endIndex:g===d?d:g-g%c}}},{key:"getTextOfTick",value:function(r){var a=this.props,s=a.data,o=a.tickFormatter,l=a.dataKey,c=la(s[r],l,r);return De(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,s=a.slideMoveStartX,o=a.startX,l=a.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,p=c.endIndex,g=c.onChange,m=r.pageX-s;m>0?m=Math.min(m,u+d-f-l,u+d-f-o):m<0&&(m=Math.max(m,u-o,u-l));var y=this.getIndex({startX:o+m,endX:l+m});(y.startIndex!==h||y.endIndex!==p)&&g&&g(y),this.setState({startX:o+m,endX:l+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var s=aE(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,s=a.brushMoveStartX,o=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.onChange,m=d.gap,y=d.data,v={startX:this.state.startX,endX:this.state.endX},b=r.pageX-s;b>0?b=Math.min(b,f+h-p-u):b<0&&(b=Math.max(b,f-u)),v[o]=u+b;var w=this.getIndex(v),N=w.startIndex,S=w.endIndex,x=function(){var j=y.length-1;return o==="startX"&&(l>c?N%m===0:S%m===0)||l<c&&S===j||o==="endX"&&(l>c?S%m===0:N%m===0)||l>c&&S===j};this.setState(Zn(Zn({},o,u+b),"brushMoveStartX",r.pageX),function(){g&&x()&&g(w)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var s=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[a],f=l.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=l.length)){var p=l[h];a==="startX"&&p>=u||a==="endX"&&p<=c||this.setState(Zn({},a,p),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,s=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return H.createElement("rect",{stroke:u,fill:c,x:a,y:s,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,s=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=k.Children.only(u);return f?H.cloneElement(f,{x:a,y:s,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,a){var s,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,p=c.ariaLabel,g=c.data,m=c.startIndex,y=c.endIndex,v=Math.max(r,this.props.x),b=mg(mg({},Ve(this.props,!1)),{},{x:v,y:u,width:d,height:f}),w=p||"Min value: ".concat((s=g[m])===null||s===void 0?void 0:s.name,", Max value: ").concat((o=g[y])===null||o===void 0?void 0:o.name);return H.createElement(Zt,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),l.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,b))}},{key:"renderSlide",value:function(r,a){var s=this.props,o=s.y,l=s.height,c=s.stroke,u=s.travellerWidth,d=Math.min(r,a)+u,f=Math.max(Math.abs(a-r)-u,0);return H.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,s=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,h=d.endX,p=5,g={pointerEvents:"none",fill:u};return H.createElement(Zt,{className:"recharts-brush-texts"},H.createElement(eh,jh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+l/2},g),this.getTextOfTick(a)),H.createElement(eh,jh({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:o+l/2},g),this.getTextOfTick(s)))}},{key:"render",value:function(){var r=this.props,a=r.data,s=r.className,o=r.children,l=r.x,c=r.y,u=r.width,d=r.height,f=r.alwaysShowText,h=this.state,p=h.startX,g=h.endX,m=h.isTextActive,y=h.isSlideMoving,v=h.isTravellerMoving,b=h.isTravellerFocused;if(!a||!a.length||!de(l)||!de(c)||!de(u)||!de(d)||u<=0||d<=0)return null;var w=Ye("recharts-brush",s),N=H.Children.count(o)===1,S=vte("userSelect","none");return H.createElement(Zt,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),N&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(m||y||v||b||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,s=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(s+l/2)-1;return H.createElement(H.Fragment,null,H.createElement("rect",{x:a,y:s,width:o,height:l,fill:c,stroke:"none"}),H.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),H.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var s;return H.isValidElement(r)?s=H.cloneElement(r,a):De(r)?s=r(a):s=t.renderDefaultTraveller(a),s}},{key:"getDerivedStateFromProps",value:function(r,a){var s=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(s!==a.prevData||u!==a.prevUpdateId)return mg({prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},s&&s.length?Ete({data:s,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+o-c]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,a){for(var s=r.length,o=0,l=s-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>a?l=c:o=c}return a>=r[l]?l:o}}])}(k.PureComponent);Zn(Ko,"displayName","Brush");Zn(Ko,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var jte=r0;function _te(e,t){var n;return jte(e,function(r,a,s){return n=t(r,a,s),!n}),!!n}var Ate=_te,Cte=rO,Tte=Ni,Ote=Ate,Pte=Un,Rte=Ip;function Mte(e,t,n){var r=Pte(e)?Cte:Ote;return n&&Rte(e,t,n)&&(t=void 0),r(e,Tte(t))}var Ite=Mte;const $te=Qe(Ite);var sa=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},iE=EO;function Lte(e,t,n){t=="__proto__"&&iE?iE(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Dte=Lte,Bte=Dte,zte=kO,Fte=Ni;function Ute(e,t){var n={};return t=Fte(t),zte(e,function(r,a,s){Bte(n,a,t(r,a,s))}),n}var Wte=Ute;const Hte=Qe(Wte);function Gte(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var qte=Gte,Kte=r0;function Vte(e,t){var n=!0;return Kte(e,function(r,a,s){return n=!!t(r,a,s),n}),n}var Yte=Vte,Xte=qte,Zte=Yte,Qte=Ni,Jte=Un,ene=Ip;function tne(e,t,n){var r=Jte(e)?Xte:Zte;return n&&ene(e,t,n)&&(t=void 0),r(e,Qte(t))}var nne=tne;const nR=Qe(nne);var rne=["x","y"];function ku(e){"@babel/helpers - typeof";return ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ku(e)}function Jy(){return Jy=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},Jy.apply(this,arguments)}function sE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ql(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sE(Object(n),!0).forEach(function(r){ane(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ane(e,t,n){return t=ine(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ine(e){var t=sne(e,"string");return ku(t)=="symbol"?t:t+""}function sne(e,t){if(ku(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ku(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function one(e,t){if(e==null)return{};var n=lne(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function cne(e,t){var n=e.x,r=e.y,a=one(e,rne),s="".concat(n),o=parseInt(s,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),h=parseInt(f,10);return Ql(Ql(Ql(Ql(Ql({},t),a),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function oE(e){return H.createElement(qee,Jy({shapeType:"rectangle",propTransformer:cne,activeClassName:"recharts-active-bar"},e))}var une=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var s=de(r)||NU(r);return s?t(r,a):(s||ys(),n)}},dne=["value","background"],rR;function Vo(e){"@babel/helpers - typeof";return Vo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vo(e)}function fne(e,t){if(e==null)return{};var n=hne(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ah(){return Ah=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},Ah.apply(this,arguments)}function lE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lE(Object(n),!0).forEach(function(r){ri(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iR(r.key),r)}}function mne(e,t,n){return t&&cE(e.prototype,t),n&&cE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gne(e,t,n){return t=Ch(t),vne(e,aR()?Reflect.construct(t,n||[],Ch(e).constructor):t.apply(e,n))}function vne(e,t){if(t&&(Vo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yne(e)}function yne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aR=function(){return!!e})()}function Ch(e){return Ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ch(e)}function bne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eb(e,t)}function eb(e,t){return eb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},eb(e,t)}function ri(e,t,n){return t=iR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iR(e){var t=xne(e,"string");return Vo(t)=="symbol"?t:t+""}function xne(e,t){if(Vo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var mn=function(e){function t(){var n;pne(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return n=gne(this,t,[].concat(a)),ri(n,"state",{isAnimationFinished:!1}),ri(n,"id",Ap("recharts-bar-")),ri(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),ri(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return bne(t,e),mne(t,[{key:"renderRectanglesStatically",value:function(r){var a=this,s=this.props,o=s.shape,l=s.dataKey,c=s.activeIndex,u=s.activeBar,d=Ve(this.props,!1);return r&&r.map(function(f,h){var p=h===c,g=p?u:o,m=Pt(Pt(Pt({},d),f),{},{isActive:p,option:g,index:h,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return H.createElement(Zt,Ah({className:"recharts-bar-rectangle"},zf(a.props,f,h),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(h)}),H.createElement(oE,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,a=this.props,s=a.data,o=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,h=this.state.prevData;return H.createElement(yi,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var g=p.t,m=s.map(function(y,v){var b=h&&h[v];if(b){var w=Us(b.x,y.x),N=Us(b.y,y.y),S=Us(b.width,y.width),x=Us(b.height,y.height);return Pt(Pt({},y),{},{x:w(g),y:N(g),width:S(g),height:x(g)})}if(o==="horizontal"){var E=Us(0,y.height),j=E(g);return Pt(Pt({},y),{},{y:y.y+y.height-j,height:j})}var C=Us(0,y.width),T=C(g);return Pt(Pt({},y),{},{width:T})});return H.createElement(Zt,null,r.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,s=r.isAnimationActive,o=this.state.prevData;return s&&a&&a.length&&(!o||!A0(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var r=this,a=this.props,s=a.data,o=a.dataKey,l=a.activeIndex,c=Ve(this.props.background,!1);return s.map(function(u,d){u.value;var f=u.background,h=fne(u,dne);if(!f)return null;var p=Pt(Pt(Pt(Pt(Pt({},h),{},{fill:"#eee"},f),c),zf(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return H.createElement(oE,Ah({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},p))})}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.data,l=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,f=Br(d,qp);if(!f)return null;var h=u==="vertical"?o[0].height/2:o[0].width/2,p=function(y,v){var b=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:b,errorVal:la(y,v)}},g={clipPath:r?"url(#clipPath-".concat(a,")"):null};return H.createElement(Zt,g,f.map(function(m){return H.cloneElement(m,{key:"error-bar-".concat(a,"-").concat(m.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var r=this.props,a=r.hide,s=r.data,o=r.className,l=r.xAxis,c=r.yAxis,u=r.left,d=r.top,f=r.width,h=r.height,p=r.isAnimationActive,g=r.background,m=r.id;if(a||!s||!s.length)return null;var y=this.state.isAnimationFinished,v=Ye("recharts-bar",o),b=l&&l.allowDataOverflow,w=c&&c.allowDataOverflow,N=b||w,S=Xe(m)?this.id:m;return H.createElement(Zt,{className:v},b||w?H.createElement("defs",null,H.createElement("clipPath",{id:"clipPath-".concat(S)},H.createElement("rect",{x:b?u:u-f/2,y:w?d:d-h/2,width:b?f:f*2,height:w?h:h*2}))):null,H.createElement(Zt,{className:"recharts-bar-rectangles",clipPath:N?"url(#clipPath-".concat(S,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(N,S),(!p||y)&&os.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])}(k.PureComponent);rR=mn;ri(mn,"displayName","Bar");ri(mn,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!zu.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});ri(mn,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,s=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=qX(r,n);if(!p)return null;var g=t.layout,m=n.type.defaultProps,y=m!==void 0?Pt(Pt({},m),n.props):n.props,v=y.dataKey,b=y.children,w=y.minPointSize,N=g==="horizontal"?o:s,S=u?N.scale.domain():null,x=eZ({numericAxis:N}),E=Br(b,Zc),j=f.map(function(C,T){var $,R,I,L,F,z;u?$=KX(u[d+T],S):($=la(C,v),Array.isArray($)||($=[x,$]));var M=une(w,rR.defaultProps.minPointSize)($[1],T);if(g==="horizontal"){var O,U=[o.scale($[0]),o.scale($[1])],A=U[0],Z=U[1];R=uN({axis:s,ticks:l,bandSize:a,offset:p.offset,entry:C,index:T}),I=(O=Z??A)!==null&&O!==void 0?O:void 0,L=p.size;var D=A-Z;if(F=Number.isNaN(D)?0:D,z={x:R,y:o.y,width:L,height:o.height},Math.abs(M)>0&&Math.abs(F)<Math.abs(M)){var P=$r(F||M)*(Math.abs(M)-Math.abs(F));I-=P,F+=P}}else{var oe=[s.scale($[0]),s.scale($[1])],be=oe[0],pe=oe[1];if(R=be,I=uN({axis:o,ticks:c,bandSize:a,offset:p.offset,entry:C,index:T}),L=pe-be,F=p.size,z={x:s.x,y:I,width:s.width,height:F},Math.abs(M)>0&&Math.abs(L)<Math.abs(M)){var Ce=$r(L||M)*(Math.abs(M)-Math.abs(L));L+=Ce}}return Pt(Pt(Pt({},C),{},{x:R,y:I,width:L,height:F,value:u?$:$[1],payload:C,background:z},E&&E[T]&&E[T].props),{},{tooltipPayload:[$P(n,C)],tooltipPosition:{x:R+L/2,y:I+F/2}})});return Pt({data:j,layout:g},h)});function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}function wne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sR(r.key),r)}}function Sne(e,t,n){return t&&uE(e.prototype,t),n&&uE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function dE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Rr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dE(Object(n),!0).forEach(function(r){Yp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yp(e,t,n){return t=sR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sR(e){var t=kne(e,"string");return Nu(t)=="symbol"?t:t+""}function kne(e,t){if(Nu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Nne=function(t,n,r,a,s){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(n),f={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},h=!!Jn(u,mn);return d.reduce(function(p,g){var m=n[g],y=m.orientation,v=m.domain,b=m.padding,w=b===void 0?{}:b,N=m.mirror,S=m.reversed,x="".concat(y).concat(N?"Mirror":""),E,j,C,T,$;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var R=v[1]-v[0],I=1/0,L=m.categoricalDomain.sort(_U);if(L.forEach(function(oe,be){be>0&&(I=Math.min((oe||0)-(L[be-1]||0),I))}),Number.isFinite(I)){var F=I/R,z=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(E=F*z/2),m.padding==="no-gap"){var M=gs(t.barCategoryGap,F*z),O=F*z/2;E=O-M-(O-M)/z*M}}}a==="xAxis"?j=[r.left+(w.left||0)+(E||0),r.left+r.width-(w.right||0)-(E||0)]:a==="yAxis"?j=c==="horizontal"?[r.top+r.height-(w.bottom||0),r.top+(w.top||0)]:[r.top+(w.top||0)+(E||0),r.top+r.height-(w.bottom||0)-(E||0)]:j=m.range,S&&(j=[j[1],j[0]]);var U=HX(m,s,h),A=U.scale,Z=U.realScaleType;A.domain(v).range(j),GX(A);var D=JX(A,Rr(Rr({},m),{},{realScaleType:Z}));a==="xAxis"?($=y==="top"&&!N||y==="bottom"&&N,C=r.left,T=f[x]-$*m.height):a==="yAxis"&&($=y==="left"&&!N||y==="right"&&N,C=f[x]-$*m.width,T=r.top);var P=Rr(Rr(Rr({},m),D),{},{realScaleType:Z,x:C,y:T,scale:A,width:a==="xAxis"?r.width:m.width,height:a==="yAxis"?r.height:m.height});return P.bandSize=mh(P,D),!m.hide&&a==="xAxis"?f[x]+=($?-1:1)*P.height:m.hide||(f[x]+=($?-1:1)*P.width),Rr(Rr({},p),{},Yp({},g,P))},{})},oR=function(t,n){var r=t.x,a=t.y,s=n.x,o=n.y;return{x:Math.min(r,s),y:Math.min(a,o),width:Math.abs(s-r),height:Math.abs(o-a)}},Ene=function(t){var n=t.x1,r=t.y1,a=t.x2,s=t.y2;return oR({x:n,y:r},{x:a,y:s})},lR=function(){function e(t){wne(this,e),this.scale=t}return Sne(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,s=r.position;if(n!==void 0){if(s)switch(s){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],s=r[r.length-1];return a<=s?n>=a&&n<=s:n>=s&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])}();Yp(lR,"EPS",1e-4);var R0=function(t){var n=Object.keys(t).reduce(function(r,a){return Rr(Rr({},r),{},Yp({},a,lR.create(t[a])))},{});return Rr(Rr({},n),{},{apply:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=s.bandAware,l=s.position;return Hte(a,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(a){return nR(a,function(s,o){return n[o].isInRange(s)})}})};function jne(e){return(e%180+180)%180}var _ne=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=jne(a),o=s*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},Ane=Ni,Cne=Bu,Tne=Rp;function One(e){return function(t,n,r){var a=Object(t);if(!Cne(t)){var s=Ane(n);t=Tne(t),n=function(l){return s(a[l],l,a)}}var o=e(t,n,r);return o>-1?a[s?t[o]:o]:void 0}}var Pne=One,Rne=QP;function Mne(e){var t=Rne(e),n=t%1;return t===t?n?t-n:t:0}var Ine=Mne,$ne=vO,Lne=Ni,Dne=Ine,Bne=Math.max;function zne(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:Dne(n);return a<0&&(a=Bne(r+a,0)),$ne(e,Lne(t),a)}var Fne=zne,Une=Pne,Wne=Fne,Hne=Une(Wne),Gne=Hne;const qne=Qe(Gne);var Kne=TF(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),M0=k.createContext(void 0),I0=k.createContext(void 0),cR=k.createContext(void 0),uR=k.createContext({}),dR=k.createContext(void 0),fR=k.createContext(0),hR=k.createContext(0),fE=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,s=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=Kne(s);return H.createElement(M0.Provider,{value:r},H.createElement(I0.Provider,{value:a},H.createElement(uR.Provider,{value:s},H.createElement(cR.Provider,{value:d},H.createElement(dR.Provider,{value:o},H.createElement(fR.Provider,{value:u},H.createElement(hR.Provider,{value:c},l)))))))},Vne=function(){return k.useContext(dR)},pR=function(t){var n=k.useContext(M0);n==null&&ys();var r=n[t];return r==null&&ys(),r},Yne=function(){var t=k.useContext(M0);return Za(t)},Xne=function(){var t=k.useContext(I0),n=qne(t,function(r){return nR(r.domain,Number.isFinite)});return n||Za(t)},mR=function(t){var n=k.useContext(I0);n==null&&ys();var r=n[t];return r==null&&ys(),r},Zne=function(){var t=k.useContext(cR);return t},Qne=function(){return k.useContext(uR)},$0=function(){return k.useContext(hR)},L0=function(){return k.useContext(fR)};function Yo(e){"@babel/helpers - typeof";return Yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yo(e)}function Jne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ere(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vR(r.key),r)}}function tre(e,t,n){return t&&ere(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function nre(e,t,n){return t=Th(t),rre(e,gR()?Reflect.construct(t,n||[],Th(e).constructor):t.apply(e,n))}function rre(e,t){if(t&&(Yo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return are(e)}function are(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gR=function(){return!!e})()}function Th(e){return Th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Th(e)}function ire(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tb(e,t)}function tb(e,t){return tb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},tb(e,t)}function hE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pE(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){D0(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 D0(e,t,n){return t=vR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vR(e){var t=sre(e,"string");return Yo(t)=="symbol"?t:t+""}function sre(e,t){if(Yo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ore(e,t){return dre(e)||ure(e,t)||cre(e,t)||lre()}function lre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
131
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cre(e,t){if(e){if(typeof e=="string")return mE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mE(e,t)}}function mE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ure(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function dre(e){if(Array.isArray(e))return e}function nb(){return nb=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},nb.apply(this,arguments)}var fre=function(t,n){var r;return H.isValidElement(t)?r=H.cloneElement(t,n):De(t)?r=t(n):r=H.createElement("line",nb({},n,{className:"recharts-reference-line-line"})),r},hre=function(t,n,r,a,s,o,l,c,u){var d=s.x,f=s.y,h=s.width,p=s.height;if(r){var g=u.y,m=t.y.apply(g,{position:o});if(sa(u,"discard")&&!t.y.isInRange(m))return null;var y=[{x:d+h,y:m},{x:d,y:m}];return c==="left"?y.reverse():y}if(n){var v=u.x,b=t.x.apply(v,{position:o});if(sa(u,"discard")&&!t.x.isInRange(b))return null;var w=[{x:b,y:f+p},{x:b,y:f}];return l==="top"?w.reverse():w}if(a){var N=u.segment,S=N.map(function(x){return t.apply(x,{position:o})});return sa(u,"discard")&&$te(S,function(x){return!t.isInRange(x)})?null:S}return null};function pre(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,s=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=Vne(),d=pR(a),f=mR(s),h=Zne();if(!u||!h)return null;_a(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=R0({x:d.scale,y:f.scale}),g=qt(t),m=qt(n),y=r&&r.length===2,v=hre(p,g,m,y,h,e.position,d.orientation,f.orientation,e);if(!v)return null;var b=ore(v,2),w=b[0],N=w.x,S=w.y,x=b[1],E=x.x,j=x.y,C=sa(e,"hidden")?"url(#".concat(u,")"):void 0,T=pE(pE({clipPath:C},Ve(e,!0)),{},{x1:N,y1:S,x2:E,y2:j});return H.createElement(Zt,{className:Ye("recharts-reference-line",l)},fre(o,T),yn.renderCallByParent(e,Ene({x1:N,y1:S,x2:E,y2:j})))}var B0=function(e){function t(){return Jne(this,t),nre(this,t,arguments)}return ire(t,e),tre(t,[{key:"render",value:function(){return H.createElement(pre,this.props)}}])}(H.Component);D0(B0,"displayName","ReferenceLine");D0(B0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function rb(){return rb=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},rb.apply(this,arguments)}function Xo(e){"@babel/helpers - typeof";return Xo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xo(e)}function gE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function vE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gE(Object(n),!0).forEach(function(r){Xp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bR(r.key),r)}}function vre(e,t,n){return t&&gre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function yre(e,t,n){return t=Oh(t),bre(e,yR()?Reflect.construct(t,n||[],Oh(e).constructor):t.apply(e,n))}function bre(e,t){if(t&&(Xo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xre(e)}function xre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yR=function(){return!!e})()}function Oh(e){return Oh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Oh(e)}function wre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ab(e,t)}function ab(e,t){return ab=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},ab(e,t)}function Xp(e,t,n){return t=bR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bR(e){var t=Sre(e,"string");return Xo(t)=="symbol"?t:t+""}function Sre(e,t){if(Xo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var kre=function(t){var n=t.x,r=t.y,a=t.xAxis,s=t.yAxis,o=R0({x:a.scale,y:s.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return sa(t,"discard")&&!o.isInRange(l)?null:l},Zp=function(e){function t(){return mre(this,t),yre(this,t,arguments)}return wre(t,e),vre(t,[{key:"render",value:function(){var r=this.props,a=r.x,s=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=qt(a),d=qt(s);if(_a(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=kre(this.props);if(!f)return null;var h=f.x,p=f.y,g=this.props,m=g.shape,y=g.className,v=sa(this.props,"hidden")?"url(#".concat(c,")"):void 0,b=vE(vE({clipPath:v},Ve(this.props,!0)),{},{cx:h,cy:p});return H.createElement(Zt,{className:Ye("recharts-reference-dot",y)},t.renderDot(m,b),yn.renderCallByParent(this.props,{x:h-o,y:p-o,width:2*o,height:2*o}))}}])}(H.Component);Xp(Zp,"displayName","ReferenceDot");Xp(Zp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Xp(Zp,"renderDot",function(e,t){var n;return H.isValidElement(e)?n=H.cloneElement(e,t):De(e)?n=e(t):n=H.createElement(XP,rb({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function ib(){return ib=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},ib.apply(this,arguments)}function Zo(e){"@babel/helpers - typeof";return Zo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zo(e)}function yE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function bE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yE(Object(n),!0).forEach(function(r){Qp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ere(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wR(r.key),r)}}function jre(e,t,n){return t&&Ere(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _re(e,t,n){return t=Ph(t),Are(e,xR()?Reflect.construct(t,n||[],Ph(e).constructor):t.apply(e,n))}function Are(e,t){if(t&&(Zo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cre(e)}function Cre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xR=function(){return!!e})()}function Ph(e){return Ph=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ph(e)}function Tre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sb(e,t)}function sb(e,t){return sb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},sb(e,t)}function Qp(e,t,n){return t=wR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wR(e){var t=Ore(e,"string");return Zo(t)=="symbol"?t:t+""}function Ore(e,t){if(Zo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Pre=function(t,n,r,a,s){var o=s.x1,l=s.x2,c=s.y1,u=s.y2,d=s.xAxis,f=s.yAxis;if(!d||!f)return null;var h=R0({x:d.scale,y:f.scale}),p={x:t?h.x.apply(o,{position:"start"}):h.x.rangeMin,y:r?h.y.apply(c,{position:"start"}):h.y.rangeMin},g={x:n?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:a?h.y.apply(u,{position:"end"}):h.y.rangeMax};return sa(s,"discard")&&(!h.isInRange(p)||!h.isInRange(g))?null:oR(p,g)},Jp=function(e){function t(){return Nre(this,t),_re(this,t,arguments)}return Tre(t,e),jre(t,[{key:"render",value:function(){var r=this.props,a=r.x1,s=r.x2,o=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;_a(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=qt(a),h=qt(s),p=qt(o),g=qt(l),m=this.props.shape;if(!f&&!h&&!p&&!g&&!m)return null;var y=Pre(f,h,p,g,this.props);if(!y&&!m)return null;var v=sa(this.props,"hidden")?"url(#".concat(d,")"):void 0;return H.createElement(Zt,{className:Ye("recharts-reference-area",c)},t.renderRect(m,bE(bE({clipPath:v},Ve(this.props,!0)),y)),yn.renderCallByParent(this.props,y))}}])}(H.Component);Qp(Jp,"displayName","ReferenceArea");Qp(Jp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Qp(Jp,"renderRect",function(e,t){var n;return H.isValidElement(e)?n=H.cloneElement(e,t):De(e)?n=e(t):n=H.createElement(P0,ib({},t,{className:"recharts-reference-area-rect"})),n});function SR(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function Rre(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return _ne(r,n)}function Mre(e,t,n){var r=n==="width",a=e.x,s=e.y,o=e.width,l=e.height;return t===1?{start:r?a:s,end:r?a+o:s+l}:{start:r?a+o:s+l,end:r?a:s}}function Rh(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-a)<=0}function Ire(e,t){return SR(e,t+1)}function $re(e,t,n,r,a){for(var s=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:SR(r,u)};var m=c,y,v=function(){return y===void 0&&(y=n(g,m)),y},b=g.coordinate,w=c===0||Rh(e,b,v,d,l);w||(c=0,d=o,u+=1),w&&(d=b+e*(v()/2+a),c+=u)},h;u<=s.length;)if(h=f(),h)return h.v;return[]}function Eu(e){"@babel/helpers - typeof";return Eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eu(e)}function xE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xE(Object(n),!0).forEach(function(r){Lre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lre(e,t,n){return t=Dre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dre(e){var t=Bre(e,"string");return Eu(t)=="symbol"?t:t+""}function Bre(e,t){if(Eu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Eu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zre(e,t,n,r,a){for(var s=(r||[]).slice(),o=s.length,l=t.start,c=t.end,u=function(h){var p=s[h],g,m=function(){return g===void 0&&(g=n(p,h)),g};if(h===o-1){var y=e*(p.coordinate+e*m()/2-c);s[h]=p=pn(pn({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate})}else s[h]=p=pn(pn({},p),{},{tickCoord:p.coordinate});var v=Rh(e,p.tickCoord,m,l,c);v&&(c=p.tickCoord-e*(m()/2+a),s[h]=pn(pn({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return s}function Fre(e,t,n,r,a,s){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(s){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-u);o[l-1]=d=pn(pn({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=Rh(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+a),o[l-1]=pn(pn({},d),{},{isShow:!0}))}for(var g=s?l-1:l,m=function(b){var w=o[b],N,S=function(){return N===void 0&&(N=n(w,b)),N};if(b===0){var x=e*(w.coordinate-e*S()/2-c);o[b]=w=pn(pn({},w),{},{tickCoord:x<0?w.coordinate-x*e:w.coordinate})}else o[b]=w=pn(pn({},w),{},{tickCoord:w.coordinate});var E=Rh(e,w.tickCoord,S,c,u);E&&(c=w.tickCoord+e*(S()/2+a),o[b]=pn(pn({},w),{},{isShow:!0}))},y=0;y<g;y++)m(y);return o}function z0(e,t,n){var r=e.tick,a=e.ticks,s=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!a||!a.length||!r)return[];if(de(c)||zu.isSsr)return Ire(a,typeof c=="number"&&de(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",g=d&&p==="width"?bc(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(w,N){var S=De(u)?u(w.value,N):w.value;return p==="width"?Rre(bc(S,{fontSize:t,letterSpacing:n}),g,f):bc(S,{fontSize:t,letterSpacing:n})[p]},y=a.length>=2?$r(a[1].coordinate-a[0].coordinate):1,v=Mre(s,y,p);return c==="equidistantPreserveStart"?$re(y,v,m,a,o):(c==="preserveStart"||c==="preserveStartEnd"?h=Fre(y,v,m,a,o,c==="preserveStartEnd"):h=zre(y,v,m,a,o),h.filter(function(b){return b.isShow}))}var Ure=["viewBox"],Wre=["viewBox"],Hre=["ticks"];function Qo(e){"@babel/helpers - typeof";return Qo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qo(e)}function po(){return po=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},po.apply(this,arguments)}function wE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wE(Object(n),!0).forEach(function(r){F0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gg(e,t){if(e==null)return{};var n=Gre(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Gre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function qre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,NR(r.key),r)}}function Kre(e,t,n){return t&&SE(e.prototype,t),n&&SE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vre(e,t,n){return t=Mh(t),Yre(e,kR()?Reflect.construct(t,n||[],Mh(e).constructor):t.apply(e,n))}function Yre(e,t){if(t&&(Qo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xre(e)}function Xre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kR=function(){return!!e})()}function Mh(e){return Mh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Mh(e)}function Zre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ob(e,t)}function ob(e,t){return ob=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},ob(e,t)}function F0(e,t,n){return t=NR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NR(e){var t=Qre(e,"string");return Qo(t)=="symbol"?t:t+""}function Qre(e,t){if(Qo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wl=function(e){function t(n){var r;return qre(this,t),r=Vre(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Zre(t,e),Kre(t,[{key:"shouldComponentUpdate",value:function(r,a){var s=r.viewBox,o=gg(r,Ure),l=this.props,c=l.viewBox,u=gg(l,Wre);return!No(s,c)||!No(o,u)||!No(a,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var a=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var a=this.props,s=a.x,o=a.y,l=a.width,c=a.height,u=a.orientation,d=a.tickSize,f=a.mirror,h=a.tickMargin,p,g,m,y,v,b,w=f?-1:1,N=r.tickSize||d,S=de(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":p=g=r.coordinate,y=o+ +!f*c,m=y-w*N,b=m-w*h,v=S;break;case"left":m=y=r.coordinate,g=s+ +!f*l,p=g-w*N,v=p-w*h,b=S;break;case"right":m=y=r.coordinate,g=s+ +f*l,p=g+w*N,v=p+w*h,b=S;break;default:p=g=r.coordinate,y=o+ +f*c,m=y+w*N,b=m+w*h,v=S;break}return{line:{x1:p,y1:m,x2:g,y2:y},tick:{x:v,y:b}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,a=r.orientation,s=r.mirror,o;switch(a){case"left":o=s?"start":"end";break;case"right":o=s?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,a=r.orientation,s=r.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=s?"start":"end";break;default:o=s?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.x,s=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=Ft(Ft(Ft({},Ve(this.props,!1)),Ve(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=Ft(Ft({},f),{},{x1:a,y1:s+h*l,x2:a+o,y2:s+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);f=Ft(Ft({},f),{},{x1:a+p*o,y1:s,x2:a+p*o,y2:s+l})}return H.createElement("line",po({},f,{className:Ye("recharts-cartesian-axis-line",xr(d,"className"))}))}},{key:"renderTicks",value:function(r,a,s){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,p=z0(Ft(Ft({},this.props),{},{ticks:r}),a,s),g=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),y=Ve(this.props,!1),v=Ve(d,!1),b=Ft(Ft({},y),{},{fill:"none"},Ve(c,!1)),w=p.map(function(N,S){var x=o.getTickLineCoord(N),E=x.line,j=x.tick,C=Ft(Ft(Ft(Ft({textAnchor:g,verticalAnchor:m},y),{},{stroke:"none",fill:u},v),j),{},{index:S,payload:N,visibleTicksCount:p.length,tickFormatter:f});return H.createElement(Zt,po({className:"recharts-cartesian-axis-tick",key:"tick-".concat(N.value,"-").concat(N.coordinate,"-").concat(N.tickCoord)},zf(o.props,N,S)),c&&H.createElement("line",po({},b,E,{className:Ye("recharts-cartesian-axis-tick-line",xr(c,"className"))})),d&&t.renderTickItem(d,C,"".concat(De(f)?f(N.value,S):N.value).concat(h||"")))});return H.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{key:"render",value:function(){var r=this,a=this.props,s=a.axisLine,o=a.width,l=a.height,c=a.ticksGenerator,u=a.className,d=a.hide;if(d)return null;var f=this.props,h=f.ticks,p=gg(f,Hre),g=h;return De(c)&&(g=h&&h.length>0?c(this.props):c(p)),o<=0||l<=0||!g||!g.length?null:H.createElement(Zt,{className:Ye("recharts-cartesian-axis",u),ref:function(y){r.layerReference=y}},s&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),yn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,s){var o,l=Ye(a.className,"recharts-cartesian-axis-tick-value");return H.isValidElement(r)?o=H.cloneElement(r,Ft(Ft({},a),{},{className:l})):De(r)?o=r(Ft(Ft({},a),{},{className:l})):o=H.createElement(eh,po({},a,{className:"recharts-cartesian-axis-tick-value"}),s),o}}])}(k.Component);F0(wl,"displayName","CartesianAxis");F0(wl,"defaultProps",{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"});var Jre=["x1","y1","x2","y2","key"],eae=["offset"];function bs(e){"@babel/helpers - typeof";return bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bs(e)}function kE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kE(Object(n),!0).forEach(function(r){tae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tae(e,t,n){return t=nae(t),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 bs(t)=="symbol"?t:t+""}function rae(e,t){if(bs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function es(){return es=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},es.apply(this,arguments)}function NE(e,t){if(e==null)return{};var n=aae(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var iae=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,a=t.x,s=t.y,o=t.width,l=t.height,c=t.ry;return H.createElement("rect",{x:a,y:s,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function ER(e,t){var n;if(H.isValidElement(e))n=H.cloneElement(e,t);else if(De(e))n=e(t);else{var r=t.x1,a=t.y1,s=t.x2,o=t.y2,l=t.key,c=NE(t,Jre),u=Ve(c,!1);u.offset;var d=NE(u,eae);n=H.createElement("line",es({},d,{x1:r,y1:a,x2:s,y2:o,fill:"none",key:l}))}return n}function sae(e){var t=e.x,n=e.width,r=e.horizontal,a=r===void 0?!0:r,s=e.horizontalPoints;if(!a||!s||!s.length)return null;var o=s.map(function(l,c){var u=bn(bn({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return ER(a,u)});return H.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function oae(e){var t=e.y,n=e.height,r=e.vertical,a=r===void 0?!0:r,s=e.verticalPoints;if(!a||!s||!s.length)return null;var o=s.map(function(l,c){var u=bn(bn({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return ER(a,u)});return H.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function lae(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,a=e.y,s=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?a+o-h:d[p+1]-h;if(m<=0)return null;var y=p%t.length;return H.createElement("rect",{key:"react-".concat(p),y:h,x:r,height:m,width:s,stroke:"none",fill:t[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return H.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function cae(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,a=e.fillOpacity,s=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(h){return Math.round(h+s-s)}).sort(function(h,p){return h-p});s!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?s+l-h:d[p+1]-h;if(m<=0)return null;var y=p%r.length;return H.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:c,stroke:"none",fill:r[y],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return H.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var uae=function(t,n){var r=t.xAxis,a=t.width,s=t.height,o=t.offset;return MP(z0(bn(bn(bn({},wl.defaultProps),r),{},{ticks:Na(r,!0),viewBox:{x:0,y:0,width:a,height:s}})),o.left,o.left+o.width,n)},dae=function(t,n){var r=t.yAxis,a=t.width,s=t.height,o=t.offset;return MP(z0(bn(bn(bn({},wl.defaultProps),r),{},{ticks:Na(r,!0),viewBox:{x:0,y:0,width:a,height:s}})),o.top,o.top+o.height,n)},Gs={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Qa(e){var t,n,r,a,s,o,l=$0(),c=L0(),u=Qne(),d=bn(bn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Gs.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:Gs.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:Gs.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Gs.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:Gs.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Gs.verticalFill,x:de(e.x)?e.x:u.left,y:de(e.y)?e.y:u.top,width:de(e.width)?e.width:u.width,height:de(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,g=d.height,m=d.syncWithTicks,y=d.horizontalValues,v=d.verticalValues,b=Yne(),w=Xne();if(!de(p)||p<=0||!de(g)||g<=0||!de(f)||f!==+f||!de(h)||h!==+h)return null;var N=d.verticalCoordinatesGenerator||uae,S=d.horizontalCoordinatesGenerator||dae,x=d.horizontalPoints,E=d.verticalPoints;if((!x||!x.length)&&De(S)){var j=y&&y.length,C=S({yAxis:w?bn(bn({},w),{},{ticks:j?y:w.ticks}):void 0,width:l,height:c,offset:u},j?!0:m);_a(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(bs(C),"]")),Array.isArray(C)&&(x=C)}if((!E||!E.length)&&De(N)){var T=v&&v.length,$=N({xAxis:b?bn(bn({},b),{},{ticks:T?v:b.ticks}):void 0,width:l,height:c,offset:u},T?!0:m);_a(Array.isArray($),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(bs($),"]")),Array.isArray($)&&(E=$)}return H.createElement("g",{className:"recharts-cartesian-grid"},H.createElement(iae,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),H.createElement(sae,es({},d,{offset:u,horizontalPoints:x,xAxis:b,yAxis:w})),H.createElement(oae,es({},d,{offset:u,verticalPoints:E,xAxis:b,yAxis:w})),H.createElement(lae,es({},d,{horizontalPoints:x})),H.createElement(cae,es({},d,{verticalPoints:E})))}Qa.displayName="CartesianGrid";function Jo(e){"@babel/helpers - typeof";return Jo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(e)}function fae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,AR(r.key),r)}}function pae(e,t,n){return t&&hae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function mae(e,t,n){return t=Ih(t),gae(e,jR()?Reflect.construct(t,n||[],Ih(e).constructor):t.apply(e,n))}function gae(e,t){if(t&&(Jo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vae(e)}function vae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jR=function(){return!!e})()}function Ih(e){return Ih=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ih(e)}function yae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lb(e,t)}function lb(e,t){return lb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},lb(e,t)}function _R(e,t,n){return t=AR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AR(e){var t=bae(e,"string");return Jo(t)=="symbol"?t:t+""}function bae(e,t){if(Jo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function cb(){return cb=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},cb.apply(this,arguments)}function xae(e){var t=e.xAxisId,n=$0(),r=L0(),a=pR(t);return a==null?null:k.createElement(wl,cb({},a,{className:Ye("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Na(o,!0)}}))}var ea=function(e){function t(){return fae(this,t),mae(this,t,arguments)}return yae(t,e),pae(t,[{key:"render",value:function(){return k.createElement(xae,this.props)}}])}(k.Component);_R(ea,"displayName","XAxis");_R(ea,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function el(e){"@babel/helpers - typeof";return el=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},el(e)}function wae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,OR(r.key),r)}}function kae(e,t,n){return t&&Sae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nae(e,t,n){return t=$h(t),Eae(e,CR()?Reflect.construct(t,n||[],$h(e).constructor):t.apply(e,n))}function Eae(e,t){if(t&&(el(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jae(e)}function jae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CR=function(){return!!e})()}function $h(e){return $h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$h(e)}function _ae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ub(e,t)}function ub(e,t){return ub=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},ub(e,t)}function TR(e,t,n){return t=OR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OR(e){var t=Aae(e,"string");return el(t)=="symbol"?t:t+""}function Aae(e,t){if(el(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(el(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function db(){return db=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},db.apply(this,arguments)}var Cae=function(t){var n=t.yAxisId,r=$0(),a=L0(),s=mR(n);return s==null?null:k.createElement(wl,db({},s,{className:Ye("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(l){return Na(l,!0)}}))},ta=function(e){function t(){return wae(this,t),Nae(this,t,arguments)}return _ae(t,e),kae(t,[{key:"render",value:function(){return k.createElement(Cae,this.props)}}])}(k.Component);TR(ta,"displayName","YAxis");TR(ta,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function EE(e){return Rae(e)||Pae(e)||Oae(e)||Tae()}function Tae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
132
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oae(e,t){if(e){if(typeof e=="string")return fb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fb(e,t)}}function Pae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Rae(e){if(Array.isArray(e))return fb(e)}function fb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hb=function(t,n,r,a,s){var o=Br(t,B0),l=Br(t,Zp),c=[].concat(EE(o),EE(l)),u=Br(t,Jp),d="".concat(a,"Id"),f=a[0],h=n;if(c.length&&(h=c.reduce(function(m,y){if(y.props[d]===r&&sa(y.props,"extendDomain")&&de(y.props[f])){var v=y.props[f];return[Math.min(m[0],v),Math.max(m[1],v)]}return m},h)),u.length){var p="".concat(f,"1"),g="".concat(f,"2");h=u.reduce(function(m,y){if(y.props[d]===r&&sa(y.props,"extendDomain")&&de(y.props[p])&&de(y.props[g])){var v=y.props[p],b=y.props[g];return[Math.min(m[0],v,b),Math.max(m[1],v,b)]}return m},h)}return s&&s.length&&(h=s.reduce(function(m,y){return de(y)?[Math.min(m[0],y),Math.max(m[1],y)]:m},h)),h},PR={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function a(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function s(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new a(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 o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.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},l.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},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,p,g){var m=n?n+u:u;if(!this._events[m])return!1;var y=this._events[m],v=arguments.length,b,w;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),v){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,f),!0;case 4:return y.fn.call(y.context,d,f,h),!0;case 5:return y.fn.call(y.context,d,f,h,p),!0;case 6:return y.fn.call(y.context,d,f,h,p,g),!0}for(w=1,b=new Array(v-1);w<v;w++)b[w-1]=arguments[w];y.fn.apply(y.context,b)}else{var N=y.length,S;for(w=0;w<N;w++)switch(y[w].once&&this.removeListener(u,y[w].fn,void 0,!0),v){case 1:y[w].fn.call(y[w].context);break;case 2:y[w].fn.call(y[w].context,d);break;case 3:y[w].fn.call(y[w].context,d,f);break;case 4:y[w].fn.call(y[w].context,d,f,h);break;default:if(!b)for(S=1,b=new Array(v-1);S<v;S++)b[S-1]=arguments[S];y[w].fn.apply(y[w].context,b)}}return!0},l.prototype.on=function(u,d,f){return s(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return s(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var p=n?n+u:u;if(!this._events[p])return this;if(!d)return o(this,p),this;var g=this._events[p];if(g.fn)g.fn===d&&(!h||g.once)&&(!f||g.context===f)&&o(this,p);else{for(var m=0,y=[],v=g.length;m<v;m++)(g[m].fn!==d||h&&!g[m].once||f&&g[m].context!==f)&&y.push(g[m]);y.length?this._events[p]=y.length===1?y[0]:y:o(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(PR);var Mae=PR.exports;const Iae=Qe(Mae);var vg=new Iae,yg="recharts.syncMouseEvents";function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}function $ae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,RR(r.key),r)}}function Dae(e,t,n){return t&&Lae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function bg(e,t,n){return t=RR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RR(e){var t=Bae(e,"string");return ju(t)=="symbol"?t:t+""}function Bae(e,t){if(ju(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ju(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var zae=function(){function e(){$ae(this,e),bg(this,"activeIndex",0),bg(this,"coordinateList",[]),bg(this,"layout","horizontal")}return Dae(e,[{key:"setDetails",value:function(n){var r,a=n.coordinateList,s=a===void 0?null:a,o=n.container,l=o===void 0?null:o,c=n.layout,u=c===void 0?null:c,d=n.offset,f=d===void 0?null:d,h=n.mouseHandlerCallback,p=h===void 0?null:h;this.coordinateList=(r=s??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),s=a.x,o=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=s+c+u,h=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function Fae(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],a=e==null?void 0:e[1];if(r&&a&&de(r)&&de(a))return!0}return!1}function Uae(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function MR(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,s=e.endAngle,o=on(t,n,r,a),l=on(t,n,r,s);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:a,endAngle:s}}function Wae(e,t,n){var r,a,s,o;if(e==="horizontal")r=t.x,s=r,a=n.top,o=n.top+n.height;else if(e==="vertical")a=t.y,o=a,r=n.left,s=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,h=on(l,c,u,f),p=on(l,c,d,f);r=h.x,a=h.y,s=p.x,o=p.y}else return MR(t);return[{x:r,y:a},{x:s,y:o}]}function _u(e){"@babel/helpers - typeof";return _u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_u(e)}function jE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Id(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jE(Object(n),!0).forEach(function(r){Hae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hae(e,t,n){return t=Gae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gae(e){var t=qae(e,"string");return _u(t)=="symbol"?t:t+""}function qae(e,t){if(_u(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_u(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kae(e){var t,n,r=e.element,a=e.tooltipEventType,s=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,p=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!p||!s||!o||h!=="ScatterChart"&&a!=="axis")return null;var g,m=jN;if(h==="ScatterChart")g=o,m=see;else if(h==="BarChart")g=Uae(f,o,c,d),m=P0;else if(f==="radial"){var y=MR(o),v=y.cx,b=y.cy,w=y.radius,N=y.startAngle,S=y.endAngle;g={cx:v,cy:b,startAngle:N,endAngle:S,innerRadius:w,outerRadius:w},m=BP}else g={points:Wae(f,o,c)},m=jN;var x=Id(Id(Id(Id({stroke:"#ccc",pointerEvents:"none"},c),g),Ve(p,!1)),{},{payload:l,payloadIndex:u,className:Ye("recharts-tooltip-cursor",p.className)});return k.isValidElement(p)?k.cloneElement(p,x):k.createElement(m,x)}var Vae=["item"],Yae=["children","className","width","height","style","compact","title","desc"];function tl(e){"@babel/helpers - typeof";return tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tl(e)}function mo(){return mo=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},mo.apply(this,arguments)}function _E(e,t){return Qae(e)||Zae(e,t)||$R(e,t)||Xae()}function Xae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
133
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,o,l=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Qae(e){if(Array.isArray(e))return e}function AE(e,t){if(e==null)return{};var n=Jae(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function eie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,LR(r.key),r)}}function nie(e,t,n){return t&&tie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rie(e,t,n){return t=Lh(t),aie(e,IR()?Reflect.construct(t,n||[],Lh(e).constructor):t.apply(e,n))}function aie(e,t){if(t&&(tl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iie(e)}function iie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function IR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(IR=function(){return!!e})()}function Lh(e){return Lh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Lh(e)}function sie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pb(e,t)}function pb(e,t){return pb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},pb(e,t)}function nl(e){return cie(e)||lie(e)||$R(e)||oie()}function oie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
134
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $R(e,t){if(e){if(typeof e=="string")return mb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mb(e,t)}}function lie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cie(e){if(Array.isArray(e))return mb(e)}function mb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function CE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CE(Object(n),!0).forEach(function(r){Oe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oe(e,t,n){return t=LR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LR(e){var t=uie(e,"string");return tl(t)=="symbol"?t:t+""}function uie(e,t){if(tl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var die={xAxis:["bottom","top"],yAxis:["left","right"]},fie={width:"100%",height:"100%"},DR={x:0,y:0};function $d(e){return e}var hie=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},pie=function(t,n,r,a){var s=n.find(function(d){return d&&d.index===r});if(s){if(t==="horizontal")return{x:s.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:s.coordinate};if(t==="centric"){var o=s.coordinate,l=a.radius;return J(J(J({},a),on(a.cx,a.cy,l,o)),{},{angle:o,radius:l})}var c=s.coordinate,u=a.angle;return J(J(J({},a),on(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return DR},em=function(t,n){var r=n.graphicalItems,a=n.dataStartIndex,s=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(nl(l),nl(u)):l},[]);return o.length>0?o:t&&t.length&&de(a)&&de(s)?t.slice(a,s+1):[]};function BR(e){return e==="number"?[0,"auto"]:void 0}var gb=function(t,n,r,a){var s=t.graphicalItems,o=t.tooltipAxis,l=em(n,t);return r<0||!s||!s.length||r>=l.length?null:s.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=f===void 0?l:f;h=Yv(p,o.dataKey,a)}else h=f&&f[r]||l[r];return h?[].concat(nl(c),[$P(u,h)]):c},[])},TE=function(t,n,r,a){var s=a||{x:t.chartX,y:t.chartY},o=hie(s,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=DX(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=gb(t,n,d,f),p=pie(r,l,d,s);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},mie=function(t,n){var r=n.axes,a=n.graphicalItems,s=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=RP(d,s);return r.reduce(function(g,m){var y,v=m.type.defaultProps!==void 0?J(J({},m.type.defaultProps),m.props):m.props,b=v.type,w=v.dataKey,N=v.allowDataOverflow,S=v.allowDuplicatedCategory,x=v.scale,E=v.ticks,j=v.includeHidden,C=v[o];if(g[C])return g;var T=em(t.data,{graphicalItems:a.filter(function(D){var P,oe=o in D.props?D.props[o]:(P=D.type.defaultProps)===null||P===void 0?void 0:P[o];return oe===C}),dataStartIndex:c,dataEndIndex:u}),$=T.length,R,I,L;Fae(v.domain,N,b)&&(R=$y(v.domain,null,N),p&&(b==="number"||x!=="auto")&&(L=wc(T,w,"category")));var F=BR(b);if(!R||R.length===0){var z,M=(z=v.domain)!==null&&z!==void 0?z:F;if(w){if(R=wc(T,w,b),b==="category"&&p){var O=jU(R);S&&O?(I=R,R=Eh(0,$)):S||(R=hN(M,R,m).reduce(function(D,P){return D.indexOf(P)>=0?D:[].concat(nl(D),[P])},[]))}else if(b==="category")S?R=R.filter(function(D){return D!==""&&!Xe(D)}):R=hN(M,R,m).reduce(function(D,P){return D.indexOf(P)>=0||P===""||Xe(P)?D:[].concat(nl(D),[P])},[]);else if(b==="number"){var U=WX(T,a.filter(function(D){var P,oe,be=o in D.props?D.props[o]:(P=D.type.defaultProps)===null||P===void 0?void 0:P[o],pe="hide"in D.props?D.props.hide:(oe=D.type.defaultProps)===null||oe===void 0?void 0:oe.hide;return be===C&&(j||!pe)}),w,s,d);U&&(R=U)}p&&(b==="number"||x!=="auto")&&(L=wc(T,w,"category"))}else p?R=Eh(0,$):l&&l[C]&&l[C].hasStack&&b==="number"?R=h==="expand"?[0,1]:IP(l[C].stackGroups,c,u):R=PP(T,a.filter(function(D){var P=o in D.props?D.props[o]:D.type.defaultProps[o],oe="hide"in D.props?D.props.hide:D.type.defaultProps.hide;return P===C&&(j||!oe)}),b,d,!0);if(b==="number")R=hb(f,R,C,s,E),M&&(R=$y(M,R,N));else if(b==="category"&&M){var A=M,Z=R.every(function(D){return A.indexOf(D)>=0});Z&&(R=A)}}return J(J({},g),{},Oe({},C,J(J({},v),{},{axisType:s,domain:R,categoricalDomain:L,duplicateDomain:I,originalDomain:(y=v.domain)!==null&&y!==void 0?y:F,isCategorical:p,layout:d})))},{})},gie=function(t,n){var r=n.graphicalItems,a=n.Axis,s=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=em(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),p=h.length,g=RP(d,s),m=-1;return r.reduce(function(y,v){var b=v.type.defaultProps!==void 0?J(J({},v.type.defaultProps),v.props):v.props,w=b[o],N=BR("number");if(!y[w]){m++;var S;return g?S=Eh(0,p):l&&l[w]&&l[w].hasStack?(S=IP(l[w].stackGroups,c,u),S=hb(f,S,w,s)):(S=$y(N,PP(h,r.filter(function(x){var E,j,C=o in x.props?x.props[o]:(E=x.type.defaultProps)===null||E===void 0?void 0:E[o],T="hide"in x.props?x.props.hide:(j=x.type.defaultProps)===null||j===void 0?void 0:j.hide;return C===w&&!T}),"number",d),a.defaultProps.allowDataOverflow),S=hb(f,S,w,s)),J(J({},y),{},Oe({},w,J(J({axisType:s},a.defaultProps),{},{hide:!0,orientation:xr(die,"".concat(s,".").concat(m%2),null),domain:S,originalDomain:N,isCategorical:g,layout:d})))}return y},{})},vie=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,s=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(a,"Id"),h=Br(d,s),p={};return h&&h.length?p=mie(t,{axes:h,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=gie(t,{Axis:s,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},yie=function(t){var n=Za(t),r=Na(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:a0(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:mh(n,r)}},OE=function(t){var n=t.children,r=t.defaultShowTooltip,a=Jn(n,Ko),s=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(s=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},bie=function(t){return!t||!t.length?!1:t.some(function(n){var r=ja(n&&n.type);return r&&r.indexOf("Bar")>=0})},PE=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},xie=function(t,n){var r=t.props,a=t.graphicalItems,s=t.xAxisMap,o=s===void 0?{}:s,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,h=r.margin||{},p=Jn(f,Ko),g=Jn(f,as),m=Object.keys(c).reduce(function(S,x){var E=c[x],j=E.orientation;return!E.mirror&&!E.hide?J(J({},S),{},Oe({},j,S[j]+E.width)):S},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(S,x){var E=o[x],j=E.orientation;return!E.mirror&&!E.hide?J(J({},S),{},Oe({},j,xr(S,"".concat(j))+E.height)):S},{top:h.top||0,bottom:h.bottom||0}),v=J(J({},y),m),b=v.bottom;p&&(v.bottom+=p.props.height||Ko.defaultProps.height),g&&n&&(v=FX(v,a,r,n));var w=u-v.left-v.right,N=d-v.top-v.bottom;return J(J({brushBottom:b},v),{},{width:Math.max(w,0),height:Math.max(N,0)})},wie=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Sie=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,s=a===void 0?"axis":a,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(v,b){var w=b.graphicalItems,N=b.stackGroups,S=b.offset,x=b.updateId,E=b.dataStartIndex,j=b.dataEndIndex,C=v.barSize,T=v.layout,$=v.barGap,R=v.barCategoryGap,I=v.maxBarSize,L=PE(T),F=L.numericAxisName,z=L.cateAxisName,M=bie(w),O=[];return w.forEach(function(U,A){var Z=em(v.data,{graphicalItems:[U],dataStartIndex:E,dataEndIndex:j}),D=U.type.defaultProps!==void 0?J(J({},U.type.defaultProps),U.props):U.props,P=D.dataKey,oe=D.maxBarSize,be=D["".concat(F,"Id")],pe=D["".concat(z,"Id")],Ce={},G=c.reduce(function(Ee,Ke){var $t=b["".concat(Ke.axisType,"Map")],Rn=D["".concat(Ke.axisType,"Id")];$t&&$t[Rn]||Ke.axisType==="zAxis"||ys();var en=$t[Rn];return J(J({},Ee),{},Oe(Oe({},Ke.axisType,en),"".concat(Ke.axisType,"Ticks"),Na(en)))},Ce),Y=G[z],ie=G["".concat(z,"Ticks")],le=N&&N[be]&&N[be].hasStack&&tZ(U,N[be].stackGroups),X=ja(U.type).indexOf("Bar")>=0,_e=mh(Y,ie),Ne=[],je=M&&BX({barSize:C,stackGroups:N,totalSize:wie(G,z)});if(X){var ge,Le,fe=Xe(oe)?I:oe,tt=(ge=(Le=mh(Y,ie,!0))!==null&&Le!==void 0?Le:fe)!==null&&ge!==void 0?ge:0;Ne=zX({barGap:$,barCategoryGap:R,bandSize:tt!==_e?tt:_e,sizeList:je[pe],maxBarSize:fe}),tt!==_e&&(Ne=Ne.map(function(Ee){return J(J({},Ee),{},{position:J(J({},Ee.position),{},{offset:Ee.position.offset-tt/2})})}))}var Be=U&&U.type&&U.type.getComposedData;Be&&O.push({props:J(J({},Be(J(J({},G),{},{displayedData:Z,props:v,dataKey:P,item:U,bandSize:_e,barPosition:Ne,offset:S,stackedData:le,layout:T,dataStartIndex:E,dataEndIndex:j}))),{},Oe(Oe(Oe({key:U.key||"item-".concat(A)},F,G[F]),z,G[z]),"animationId",x)),childIndex:DU(U,v.children),item:U})}),O},p=function(v,b){var w=v.props,N=v.dataStartIndex,S=v.dataEndIndex,x=v.updateId;if(!ok({props:w}))return null;var E=w.children,j=w.layout,C=w.stackOffset,T=w.data,$=w.reverseStackOrder,R=PE(j),I=R.numericAxisName,L=R.cateAxisName,F=Br(E,r),z=QX(T,F,"".concat(I,"Id"),"".concat(L,"Id"),C,$),M=c.reduce(function(D,P){var oe="".concat(P.axisType,"Map");return J(J({},D),{},Oe({},oe,vie(w,J(J({},P),{},{graphicalItems:F,stackGroups:P.axisType===I&&z,dataStartIndex:N,dataEndIndex:S}))))},{}),O=xie(J(J({},M),{},{props:w,graphicalItems:F}),b==null?void 0:b.legendBBox);Object.keys(M).forEach(function(D){M[D]=d(w,M[D],O,D.replace("Map",""),n)});var U=M["".concat(L,"Map")],A=yie(U),Z=h(w,J(J({},M),{},{dataStartIndex:N,dataEndIndex:S,updateId:x,graphicalItems:F,stackGroups:z,offset:O}));return J(J({formattedGraphicalItems:Z,graphicalItems:F,offset:O,stackGroups:z},A),M)},g=function(y){function v(b){var w,N,S;return eie(this,v),S=rie(this,v,[b]),Oe(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Oe(S,"accessibilityManager",new zae),Oe(S,"handleLegendBBoxUpdate",function(x){if(x){var E=S.state,j=E.dataStartIndex,C=E.dataEndIndex,T=E.updateId;S.setState(J({legendBBox:x},p({props:S.props,dataStartIndex:j,dataEndIndex:C,updateId:T},J(J({},S.state),{},{legendBBox:x}))))}}),Oe(S,"handleReceiveSyncEvent",function(x,E,j){if(S.props.syncId===x){if(j===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(E)}}),Oe(S,"handleBrushChange",function(x){var E=x.startIndex,j=x.endIndex;if(E!==S.state.dataStartIndex||j!==S.state.dataEndIndex){var C=S.state.updateId;S.setState(function(){return J({dataStartIndex:E,dataEndIndex:j},p({props:S.props,dataStartIndex:E,dataEndIndex:j,updateId:C},S.state))}),S.triggerSyncEvent({dataStartIndex:E,dataEndIndex:j})}}),Oe(S,"handleMouseEnter",function(x){var E=S.getMouseInfo(x);if(E){var j=J(J({},E),{},{isTooltipActive:!0});S.setState(j),S.triggerSyncEvent(j);var C=S.props.onMouseEnter;De(C)&&C(j,x)}}),Oe(S,"triggeredAfterMouseMove",function(x){var E=S.getMouseInfo(x),j=E?J(J({},E),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(j),S.triggerSyncEvent(j);var C=S.props.onMouseMove;De(C)&&C(j,x)}),Oe(S,"handleItemMouseEnter",function(x){S.setState(function(){return{isTooltipActive:!0,activeItem:x,activePayload:x.tooltipPayload,activeCoordinate:x.tooltipPosition||{x:x.cx,y:x.cy}}})}),Oe(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Oe(S,"handleMouseMove",function(x){x.persist(),S.throttleTriggeredAfterMouseMove(x)}),Oe(S,"handleMouseLeave",function(x){S.throttleTriggeredAfterMouseMove.cancel();var E={isTooltipActive:!1};S.setState(E),S.triggerSyncEvent(E);var j=S.props.onMouseLeave;De(j)&&j(E,x)}),Oe(S,"handleOuterEvent",function(x){var E=LU(x),j=xr(S.props,"".concat(E));if(E&&De(j)){var C,T;/.*touch.*/i.test(E)?T=S.getMouseInfo(x.changedTouches[0]):T=S.getMouseInfo(x),j((C=T)!==null&&C!==void 0?C:{},x)}}),Oe(S,"handleClick",function(x){var E=S.getMouseInfo(x);if(E){var j=J(J({},E),{},{isTooltipActive:!0});S.setState(j),S.triggerSyncEvent(j);var C=S.props.onClick;De(C)&&C(j,x)}}),Oe(S,"handleMouseDown",function(x){var E=S.props.onMouseDown;if(De(E)){var j=S.getMouseInfo(x);E(j,x)}}),Oe(S,"handleMouseUp",function(x){var E=S.props.onMouseUp;if(De(E)){var j=S.getMouseInfo(x);E(j,x)}}),Oe(S,"handleTouchMove",function(x){x.changedTouches!=null&&x.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(x.changedTouches[0])}),Oe(S,"handleTouchStart",function(x){x.changedTouches!=null&&x.changedTouches.length>0&&S.handleMouseDown(x.changedTouches[0])}),Oe(S,"handleTouchEnd",function(x){x.changedTouches!=null&&x.changedTouches.length>0&&S.handleMouseUp(x.changedTouches[0])}),Oe(S,"handleDoubleClick",function(x){var E=S.props.onDoubleClick;if(De(E)){var j=S.getMouseInfo(x);E(j,x)}}),Oe(S,"handleContextMenu",function(x){var E=S.props.onContextMenu;if(De(E)){var j=S.getMouseInfo(x);E(j,x)}}),Oe(S,"triggerSyncEvent",function(x){S.props.syncId!==void 0&&vg.emit(yg,S.props.syncId,x,S.eventEmitterSymbol)}),Oe(S,"applySyncEvent",function(x){var E=S.props,j=E.layout,C=E.syncMethod,T=S.state.updateId,$=x.dataStartIndex,R=x.dataEndIndex;if(x.dataStartIndex!==void 0||x.dataEndIndex!==void 0)S.setState(J({dataStartIndex:$,dataEndIndex:R},p({props:S.props,dataStartIndex:$,dataEndIndex:R,updateId:T},S.state)));else if(x.activeTooltipIndex!==void 0){var I=x.chartX,L=x.chartY,F=x.activeTooltipIndex,z=S.state,M=z.offset,O=z.tooltipTicks;if(!M)return;if(typeof C=="function")F=C(O,x);else if(C==="value"){F=-1;for(var U=0;U<O.length;U++)if(O[U].value===x.activeLabel){F=U;break}}var A=J(J({},M),{},{x:M.left,y:M.top}),Z=Math.min(I,A.x+A.width),D=Math.min(L,A.y+A.height),P=O[F]&&O[F].value,oe=gb(S.state,S.props.data,F),be=O[F]?{x:j==="horizontal"?O[F].coordinate:Z,y:j==="horizontal"?D:O[F].coordinate}:DR;S.setState(J(J({},x),{},{activeLabel:P,activeCoordinate:be,activePayload:oe,activeTooltipIndex:F}))}else S.setState(x)}),Oe(S,"renderCursor",function(x){var E,j=S.state,C=j.isTooltipActive,T=j.activeCoordinate,$=j.activePayload,R=j.offset,I=j.activeTooltipIndex,L=j.tooltipAxisBandSize,F=S.getTooltipEventType(),z=(E=x.props.active)!==null&&E!==void 0?E:C,M=S.props.layout,O=x.key||"_recharts-cursor";return H.createElement(Kae,{key:O,activeCoordinate:T,activePayload:$,activeTooltipIndex:I,chartName:n,element:x,isActive:z,layout:M,offset:R,tooltipAxisBandSize:L,tooltipEventType:F})}),Oe(S,"renderPolarAxis",function(x,E,j){var C=xr(x,"type.axisType"),T=xr(S.state,"".concat(C,"Map")),$=x.type.defaultProps,R=$!==void 0?J(J({},$),x.props):x.props,I=T&&T[R["".concat(C,"Id")]];return k.cloneElement(x,J(J({},I),{},{className:Ye(C,I.className),key:x.key||"".concat(E,"-").concat(j),ticks:Na(I,!0)}))}),Oe(S,"renderPolarGrid",function(x){var E=x.props,j=E.radialLines,C=E.polarAngles,T=E.polarRadius,$=S.state,R=$.radiusAxisMap,I=$.angleAxisMap,L=Za(R),F=Za(I),z=F.cx,M=F.cy,O=F.innerRadius,U=F.outerRadius;return k.cloneElement(x,{polarAngles:Array.isArray(C)?C:Na(F,!0).map(function(A){return A.coordinate}),polarRadius:Array.isArray(T)?T:Na(L,!0).map(function(A){return A.coordinate}),cx:z,cy:M,innerRadius:O,outerRadius:U,key:x.key||"polar-grid",radialLines:j})}),Oe(S,"renderLegend",function(){var x=S.state.formattedGraphicalItems,E=S.props,j=E.children,C=E.width,T=E.height,$=S.props.margin||{},R=C-($.left||0)-($.right||0),I=TP({children:j,formattedGraphicalItems:x,legendWidth:R,legendContent:u});if(!I)return null;var L=I.item,F=AE(I,Vae);return k.cloneElement(L,J(J({},F),{},{chartWidth:C,chartHeight:T,margin:$,onBBoxUpdate:S.handleLegendBBoxUpdate}))}),Oe(S,"renderTooltip",function(){var x,E=S.props,j=E.children,C=E.accessibilityLayer,T=Jn(j,gn);if(!T)return null;var $=S.state,R=$.isTooltipActive,I=$.activeCoordinate,L=$.activePayload,F=$.activeLabel,z=$.offset,M=(x=T.props.active)!==null&&x!==void 0?x:R;return k.cloneElement(T,{viewBox:J(J({},z),{},{x:z.left,y:z.top}),active:M,label:F,payload:M?L:[],coordinate:I,accessibilityLayer:C})}),Oe(S,"renderBrush",function(x){var E=S.props,j=E.margin,C=E.data,T=S.state,$=T.offset,R=T.dataStartIndex,I=T.dataEndIndex,L=T.updateId;return k.cloneElement(x,{key:x.key||"_recharts-brush",onChange:Od(S.handleBrushChange,x.props.onChange),data:C,x:de(x.props.x)?x.props.x:$.left,y:de(x.props.y)?x.props.y:$.top+$.height+$.brushBottom-(j.bottom||0),width:de(x.props.width)?x.props.width:$.width,startIndex:R,endIndex:I,updateId:"brush-".concat(L)})}),Oe(S,"renderReferenceElement",function(x,E,j){if(!x)return null;var C=S,T=C.clipPathId,$=S.state,R=$.xAxisMap,I=$.yAxisMap,L=$.offset,F=x.type.defaultProps||{},z=x.props,M=z.xAxisId,O=M===void 0?F.xAxisId:M,U=z.yAxisId,A=U===void 0?F.yAxisId:U;return k.cloneElement(x,{key:x.key||"".concat(E,"-").concat(j),xAxis:R[O],yAxis:I[A],viewBox:{x:L.left,y:L.top,width:L.width,height:L.height},clipPathId:T})}),Oe(S,"renderActivePoints",function(x){var E=x.item,j=x.activePoint,C=x.basePoint,T=x.childIndex,$=x.isRange,R=[],I=E.props.key,L=E.item.type.defaultProps!==void 0?J(J({},E.item.type.defaultProps),E.item.props):E.item.props,F=L.activeDot,z=L.dataKey,M=J(J({index:T,dataKey:z,cx:j.x,cy:j.y,r:4,fill:O0(E.item),strokeWidth:2,stroke:"#fff",payload:j.payload,value:j.value},Ve(F,!1)),Bf(F));return R.push(v.renderActiveDot(F,M,"".concat(I,"-activePoint-").concat(T))),C?R.push(v.renderActiveDot(F,J(J({},M),{},{cx:C.x,cy:C.y}),"".concat(I,"-basePoint-").concat(T))):$&&R.push(null),R}),Oe(S,"renderGraphicChild",function(x,E,j){var C=S.filterFormatItem(x,E,j);if(!C)return null;var T=S.getTooltipEventType(),$=S.state,R=$.isTooltipActive,I=$.tooltipAxis,L=$.activeTooltipIndex,F=$.activeLabel,z=S.props.children,M=Jn(z,gn),O=C.props,U=O.points,A=O.isRange,Z=O.baseLine,D=C.item.type.defaultProps!==void 0?J(J({},C.item.type.defaultProps),C.item.props):C.item.props,P=D.activeDot,oe=D.hide,be=D.activeBar,pe=D.activeShape,Ce=!!(!oe&&R&&M&&(P||be||pe)),G={};T!=="axis"&&M&&M.props.trigger==="click"?G={onClick:Od(S.handleItemMouseEnter,x.props.onClick)}:T!=="axis"&&(G={onMouseLeave:Od(S.handleItemMouseLeave,x.props.onMouseLeave),onMouseEnter:Od(S.handleItemMouseEnter,x.props.onMouseEnter)});var Y=k.cloneElement(x,J(J({},C.props),G));function ie(Ke){return typeof I.dataKey=="function"?I.dataKey(Ke.payload):null}if(Ce)if(L>=0){var le,X;if(I.dataKey&&!I.allowDuplicatedCategory){var _e=typeof I.dataKey=="function"?ie:"payload.".concat(I.dataKey.toString());le=Yv(U,_e,F),X=A&&Z&&Yv(Z,_e,F)}else le=U==null?void 0:U[L],X=A&&Z&&Z[L];if(pe||be){var Ne=x.props.activeIndex!==void 0?x.props.activeIndex:L;return[k.cloneElement(x,J(J(J({},C.props),G),{},{activeIndex:Ne})),null,null]}if(!Xe(le))return[Y].concat(nl(S.renderActivePoints({item:C,activePoint:le,basePoint:X,childIndex:L,isRange:A})))}else{var je,ge=(je=S.getItemByXY(S.state.activeCoordinate))!==null&&je!==void 0?je:{graphicalItem:Y},Le=ge.graphicalItem,fe=Le.item,tt=fe===void 0?x:fe,Be=Le.childIndex,Ee=J(J(J({},C.props),G),{},{activeIndex:Be});return[k.cloneElement(tt,Ee),null,null]}return A?[Y,null,null]:[Y,null]}),Oe(S,"renderCustomized",function(x,E,j){return k.cloneElement(x,J(J({key:"recharts-customized-".concat(j)},S.props),S.state))}),Oe(S,"renderMap",{CartesianGrid:{handler:$d,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:$d},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:$d},YAxis:{handler:$d},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((w=b.id)!==null&&w!==void 0?w:Ap("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=OO(S.triggeredAfterMouseMove,(N=b.throttleDelay)!==null&&N!==void 0?N:1e3/60),S.state={},S}return sie(v,y),nie(v,[{key:"componentDidMount",value:function(){var w,N;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,N=w.children,S=w.data,x=w.height,E=w.layout,j=Jn(N,gn);if(j){var C=j.props.defaultIndex;if(!(typeof C!="number"||C<0||C>this.state.tooltipTicks.length-1)){var T=this.state.tooltipTicks[C]&&this.state.tooltipTicks[C].value,$=gb(this.state,S,C,T),R=this.state.tooltipTicks[C].coordinate,I=(this.state.offset.top+x)/2,L=E==="horizontal",F=L?{x:R,y:I}:{y:R,x:I},z=this.state.formattedGraphicalItems.find(function(O){var U=O.item;return U.type.name==="Scatter"});z&&(F=J(J({},F),z.props.points[C].tooltipPosition),$=z.props.points[C].tooltipPayload);var M={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:T,activePayload:$,activeCoordinate:F};this.setState(M),this.renderCursor(j),this.accessibilityManager.setIndex(C)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,N){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==N.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var S,x;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(x=this.props.margin.top)!==null&&x!==void 0?x:0}})}return null}},{key:"componentDidUpdate",value:function(w){Zv([Jn(w.children,gn)],[Jn(this.props.children,gn)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Jn(this.props.children,gn);if(w&&typeof w.props.shared=="boolean"){var N=w.props.shared?"axis":"item";return l.indexOf(N)>=0?N:s}return s}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var N=this.container,S=N.getBoundingClientRect(),x=uK(S),E={chartX:Math.round(w.pageX-x.left),chartY:Math.round(w.pageY-x.top)},j=S.width/N.offsetWidth||1,C=this.inRange(E.chartX,E.chartY,j);if(!C)return null;var T=this.state,$=T.xAxisMap,R=T.yAxisMap,I=this.getTooltipEventType(),L=TE(this.state,this.props.data,this.props.layout,C);if(I!=="axis"&&$&&R){var F=Za($).scale,z=Za(R).scale,M=F&&F.invert?F.invert(E.chartX):null,O=z&&z.invert?z.invert(E.chartY):null;return J(J({},E),{},{xValue:M,yValue:O},L)}return L?J(J({},E),L):null}},{key:"inRange",value:function(w,N){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,x=this.props.layout,E=w/S,j=N/S;if(x==="horizontal"||x==="vertical"){var C=this.state.offset,T=E>=C.left&&E<=C.left+C.width&&j>=C.top&&j<=C.top+C.height;return T?{x:E,y:j}:null}var $=this.state,R=$.angleAxisMap,I=$.radiusAxisMap;if(R&&I){var L=Za(R);return gN({x:E,y:j},L)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,N=this.getTooltipEventType(),S=Jn(w,gn),x={};S&&N==="axis"&&(S.props.trigger==="click"?x={onClick:this.handleClick}:x={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var E=Bf(this.props,this.handleOuterEvent);return J(J({},E),x)}},{key:"addListener",value:function(){vg.on(yg,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){vg.removeListener(yg,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,N,S){for(var x=this.state.formattedGraphicalItems,E=0,j=x.length;E<j;E++){var C=x[E];if(C.item===w||C.props.key===w.key||N===ja(C.item.type)&&S===C.childIndex)return C}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,N=this.state.offset,S=N.left,x=N.top,E=N.height,j=N.width;return H.createElement("defs",null,H.createElement("clipPath",{id:w},H.createElement("rect",{x:S,y:x,height:E,width:j})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(N,S){var x=_E(S,2),E=x[0],j=x[1];return J(J({},N),{},Oe({},E,j.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(N,S){var x=_E(S,2),E=x[0],j=x[1];return J(J({},N),{},Oe({},E,j.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(w){var N;return(N=this.state.xAxisMap)===null||N===void 0||(N=N[w])===null||N===void 0?void 0:N.scale}},{key:"getYScaleByAxisId",value:function(w){var N;return(N=this.state.yAxisMap)===null||N===void 0||(N=N[w])===null||N===void 0?void 0:N.scale}},{key:"getItemByXY",value:function(w){var N=this.state,S=N.formattedGraphicalItems,x=N.activeItem;if(S&&S.length)for(var E=0,j=S.length;E<j;E++){var C=S[E],T=C.props,$=C.item,R=$.type.defaultProps!==void 0?J(J({},$.type.defaultProps),$.props):$.props,I=ja($.type);if(I==="Bar"){var L=(T.data||[]).find(function(O){return XJ(w,O)});if(L)return{graphicalItem:C,payload:L}}else if(I==="RadialBar"){var F=(T.data||[]).find(function(O){return gN(w,O)});if(F)return{graphicalItem:C,payload:F}}else if(Kp(C,x)||Vp(C,x)||wu(C,x)){var z=Jee({graphicalItem:C,activeTooltipItem:x,itemData:R.data}),M=R.activeIndex===void 0?z:R.activeIndex;return{graphicalItem:J(J({},C),{},{childIndex:M}),payload:wu(C,x)?R.data[z]:C.props.data[z]}}}return null}},{key:"render",value:function(){var w=this;if(!ok(this))return null;var N=this.props,S=N.children,x=N.className,E=N.width,j=N.height,C=N.style,T=N.compact,$=N.title,R=N.desc,I=AE(N,Yae),L=Ve(I,!1);if(T)return H.createElement(fE,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},H.createElement(Jv,mo({},L,{width:E,height:j,title:$,desc:R}),this.renderClipPath(),ck(S,this.renderMap)));if(this.props.accessibilityLayer){var F,z;L.tabIndex=(F=this.props.tabIndex)!==null&&F!==void 0?F:0,L.role=(z=this.props.role)!==null&&z!==void 0?z:"application",L.onKeyDown=function(O){w.accessibilityManager.keyboardEvent(O)},L.onFocus=function(){w.accessibilityManager.focus()}}var M=this.parseEventsOfWrapper();return H.createElement(fE,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},H.createElement("div",mo({className:Ye("recharts-wrapper",x),style:J({position:"relative",cursor:"default",width:E,height:j},C)},M,{ref:function(U){w.container=U}}),H.createElement(Jv,mo({},L,{width:E,height:j,title:$,desc:R,style:fie}),this.renderClipPath(),ck(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(k.Component);Oe(g,"displayName",n),Oe(g,"defaultProps",J({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Oe(g,"getDerivedStateFromProps",function(y,v){var b=y.dataKey,w=y.data,N=y.children,S=y.width,x=y.height,E=y.layout,j=y.stackOffset,C=y.margin,T=v.dataStartIndex,$=v.dataEndIndex;if(v.updateId===void 0){var R=OE(y);return J(J(J({},R),{},{updateId:0},p(J(J({props:y},R),{},{updateId:0}),v)),{},{prevDataKey:b,prevData:w,prevWidth:S,prevHeight:x,prevLayout:E,prevStackOffset:j,prevMargin:C,prevChildren:N})}if(b!==v.prevDataKey||w!==v.prevData||S!==v.prevWidth||x!==v.prevHeight||E!==v.prevLayout||j!==v.prevStackOffset||!No(C,v.prevMargin)){var I=OE(y),L={chartX:v.chartX,chartY:v.chartY,isTooltipActive:v.isTooltipActive},F=J(J({},TE(v,w,E)),{},{updateId:v.updateId+1}),z=J(J(J({},I),L),F);return J(J(J({},z),p(J({props:y},z),v)),{},{prevDataKey:b,prevData:w,prevWidth:S,prevHeight:x,prevLayout:E,prevStackOffset:j,prevMargin:C,prevChildren:N})}if(!Zv(N,v.prevChildren)){var M,O,U,A,Z=Jn(N,Ko),D=Z&&(M=(O=Z.props)===null||O===void 0?void 0:O.startIndex)!==null&&M!==void 0?M:T,P=Z&&(U=(A=Z.props)===null||A===void 0?void 0:A.endIndex)!==null&&U!==void 0?U:$,oe=D!==T||P!==$,be=!Xe(w),pe=be&&!oe?v.updateId:v.updateId+1;return J(J({updateId:pe},p(J(J({props:y},v),{},{updateId:pe,dataStartIndex:D,dataEndIndex:P}),v)),{},{prevChildren:N,dataStartIndex:D,dataEndIndex:P})}return null}),Oe(g,"renderActiveDot",function(y,v,b){var w;return k.isValidElement(y)?w=k.cloneElement(y,v):De(y)?w=y(v):w=H.createElement(XP,v),H.createElement(Zt,{className:"recharts-active-dot",key:b},w)});var m=k.forwardRef(function(v,b){return H.createElement(g,mo({},v,{ref:b}))});return m.displayName=g.displayName,m},qi=Sie({chartName:"BarChart",GraphicalChild:mn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ea},{axisType:"yAxis",AxisComp:ta}],formatAxisMap:Nne});const kie=new Intl.NumberFormat("en-US");function mt(e){return kie.format(e)}function vb(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function Wt(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":mt(e)}function Nie(e,t){var a,s;const n=[];if(t){const o=t.toolsets.toolsets.filter(l=>l.enabled).reduce((l,c)=>l+c.toolCount,0);n.push({key:"tools",icon:"๐Ÿ”ง",value:Wt(o),label:"Active Tools",tone:"accent"})}const r=((a=t==null?void 0:t.conversations)==null?void 0:a.total)??((s=e==null?void 0:e.conversations)==null?void 0:s.total);return r!==void 0&&n.push({key:"conversations",icon:"๐Ÿ’ฌ",value:Wt(r),label:"Active Conversations",tone:"ok"}),t&&n.push({key:"skills",icon:"๐Ÿงฉ",value:Wt(t.skills.total),label:"Skills Loaded",tone:"warn"}),e&&n.push({key:"cost",icon:"๐Ÿ’ฐ",value:vb(e.cost.totalCost),label:"Total Cost",tone:"danger"}),n}function Eie({tiles:e}){return e.length===0?null:i.jsx("ul",{className:"metric-tiles",children:e.map(t=>i.jsxs("li",{className:`metric-tile metric-tile--${t.tone}`,children:[i.jsx("span",{className:"metric-tile-icon","aria-hidden":"true",children:t.icon}),i.jsxs("span",{children:[i.jsx("span",{className:"metric-tile-value",children:t.value}),i.jsx("span",{className:"metric-tile-label",children:t.label})]})]},t.key))})}function $e({icon:e,title:t,description:n,actions:r}){return i.jsxs("header",{className:"page-header",children:[i.jsxs("div",{className:"page-header-text",children:[i.jsxs("h1",{className:"page-header-title",children:[i.jsx("span",{"aria-hidden":"true",children:e})," ",t]}),n?i.jsx("p",{className:"page-header-description",children:n}):null]}),r?i.jsx("div",{className:"page-header-actions",children:r}):null]})}const jie={local:"var(--accent-green)",groq:"var(--accent-blue)",gemini:"var(--accent-purple)",nim:"var(--accent-cyan)",openrouter:"var(--accent-yellow)"};function RE(e){if(!e)return!1;const t=new Date;return t.setHours(0,0,0,0),e>=t.getTime()}function xg({title:e,children:t,action:n}){return i.jsxs("section",{className:"summary-card",children:[i.jsx("h2",{className:"summary-card-title",children:e}),i.jsx("div",{className:"summary-rows",children:t}),n?i.jsx("div",{className:"summary-card-action",children:n}):null]})}function va({value:e,label:t}){return i.jsxs("p",{className:"summary-row",children:[i.jsx("span",{className:"summary-row-value",children:e}),i.jsx("span",{className:"summary-row-label",children:t})]})}function _ie({data:e,onRefresh:t,refreshing:n=!1}){var j,C,T,$;const[r,a]=k.useState(null),[s,o]=k.useState(null);if(k.useEffect(()=>{let R=!1;return Q.fetchHub().then(I=>{!R&&I&&a(I)}),Q.listTasks().then(I=>{!R&&I&&o(I)}),()=>{R=!0}},[]),!e)return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ“Š",title:"System Overview",description:"Cost, memory, benchmarks and routing โ€” read live from the dashboard server."}),i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Connecting to dashboard..."})]})]});const{cost:l,history:c,benchmarks:u,memory:d,health:f}=e,h=[{icon:"๐Ÿ’ฐ",value:vb(l.totalCost),label:"Total Cost"},{icon:"๐Ÿ“ž",value:Wt(l.totalRequests),label:"API Requests"},{icon:"๐Ÿง ",value:Wt(d.total),label:"Trajectories"},{icon:"๐Ÿ“",value:Wt(c.total),label:"Chat Sessions"},{icon:"๐Ÿ†",value:Wt(u.totalRuns),label:"Benchmark Runs"},{icon:"๐Ÿ“ฆ",value:Wt(f.vectors),label:"Vector Entries"}],p=Object.entries(l.byProvider||{}).map(([R,I])=>({name:R,value:I})).sort((R,I)=>I.value-R.value),g=Object.entries(d.byFingerprint||{}).map(([R,I])=>({name:R.length>15?R.slice(0,13)+"..":R,value:I})).sort((R,I)=>I.value-R.value).slice(0,8),m=Nie(e,r),y=(s==null?void 0:s.tasks)??[],v=s!==null&&s.status===401,b=y.filter(R=>R.status==="running").length,w=y.filter(R=>RE(R.finishedAt)&&(R.status==="failed"||R.status==="error")).length,N=y.filter(R=>RE(R.finishedAt)&&R.status==="done").length,S=e.modelRegistry,x=((j=r==null?void 0:r.channels)==null?void 0:j.platforms)??[],E=x.filter(R=>R.configured).length;return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ“Š",title:"System Overview",description:"Cost, memory, benchmarks and routing โ€” read live from the dashboard server.",actions:t?i.jsx("button",{type:"button",className:"btn-secondary",onClick:t,disabled:n,"aria-busy":n,children:n?"Refreshingโ€ฆ":"โŸณ Refresh data"}):null}),i.jsx(Eie,{tiles:m}),i.jsxs("div",{className:"overview-summary",children:[i.jsxs("div",{className:"summary-cards",children:[i.jsx(xg,{title:"Task Summary",action:i.jsx(Or,{className:"summary-card-link",to:"/tasks",children:"Open console โ†’"}),children:v?i.jsx("p",{className:"summary-note",children:"Sign in to Admin to see task history."}):s===null?i.jsx("p",{className:"summary-note",children:"Loading task historyโ€ฆ"}):i.jsxs(i.Fragment,{children:[i.jsx(va,{value:Wt(b),label:"Running now"}),i.jsx(va,{value:Wt(N),label:"Completed today"}),w>0&&i.jsx(va,{value:Wt(w),label:"Failed today"})]})}),S&&i.jsxs(xg,{title:"Models",action:i.jsx(Or,{className:"summary-card-link",to:"/models",children:"Manage โ†’"}),children:[i.jsx(va,{value:Wt(S.verified),label:"Verified / routable"}),i.jsx(va,{value:Wt(S.total),label:"In the registry"}),S.parked>0&&i.jsx(va,{value:Wt(S.parked),label:"Quota-parked"})]}),r&&i.jsxs(xg,{title:"Gateway Status",action:i.jsx(Or,{className:"summary-card-link",to:"/gateway",children:"Gateway ops โ†’"}),children:[i.jsx(va,{value:`${E}/${x.length}`,label:"Platforms configured"}),i.jsx(va,{value:Wt(r.skills.total),label:"Skills loaded"}),i.jsx(va,{value:Wt(r.toolsets.enabled),label:"Toolsets enabled"})]})]}),i.jsxs("aside",{className:"quick-actions","aria-labelledby":"quick-actions-title",children:[i.jsx("h2",{className:"summary-card-title",id:"quick-actions-title",children:"Quick Actions"}),i.jsxs(Or,{className:"quick-action",to:"/tasks",children:[i.jsx("span",{"aria-hidden":"true",children:"๐Ÿš€"})," Run a CLI command"]}),i.jsxs(Or,{className:"quick-action",to:"/hub",children:[i.jsx("span",{"aria-hidden":"true",children:"๐Ÿงฐ"})," Skills & channels"]}),i.jsxs(Or,{className:"quick-action",to:"/models",children:[i.jsx("span",{"aria-hidden":"true",children:"๐Ÿง "})," Model registry"]}),i.jsxs(Or,{className:"quick-action",to:"/traces",children:[i.jsx("span",{"aria-hidden":"true",children:"๐Ÿ”"})," Reasoning traces"]}),i.jsxs(Or,{className:"quick-action",to:"/system",children:[i.jsx("span",{"aria-hidden":"true",children:"โš™๏ธ"})," Doctor checks"]})]})]}),i.jsx("h2",{className:"section-subtitle",children:"Key metrics"}),i.jsx("div",{className:"stats-grid",children:h.map(R=>i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-icon",children:R.icon}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:R.value}),i.jsx("div",{className:"stat-label",children:R.label})]})]},R.label))}),i.jsxs("div",{className:"memory-health-card",children:[i.jsx("h2",{className:"section-subtitle",children:"๐Ÿง  Memory Health"}),i.jsxs("div",{className:"memory-health-stats",children:[i.jsxs("div",{className:"memory-health-stat",children:[i.jsx("span",{className:"memory-health-value",children:Wt(d.total)}),i.jsx("span",{className:"memory-health-label",children:"Trajectories"})]}),i.jsxs("div",{className:"memory-health-stat",children:[i.jsx("span",{className:"memory-health-value",children:Wt(((C=d.facts)==null?void 0:C.total)||0)}),i.jsx("span",{className:"memory-health-label",children:"Facts Learned"})]}),i.jsxs("div",{className:"memory-health-stat",children:[i.jsx("span",{className:"memory-health-value",children:Wt(((T=d.recall)==null?void 0:T.last7d)||0)}),i.jsx("span",{className:"memory-health-label",children:"Recalls This Week"})]}),i.jsxs("div",{className:"memory-health-stat",children:[i.jsx("span",{className:"memory-health-value",children:f.patterns||0}),i.jsx("span",{className:"memory-health-label",children:"Coding Patterns"})]})]}),i.jsxs("p",{className:"memory-health-status",children:["Backend: ",i.jsx("code",{children:d.backend||"local"}),($=d.recall)!=null&&$.last7d?` ยท ${d.recall.last7d} recall(s) this week`:" ยท no recalls yet"]})]}),i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ’ฐ Cost by Provider"}),i.jsx("div",{className:"chart-container",children:p.length>0?i.jsx(Gi,{width:"100%",height:260,children:i.jsxs(qi,{data:p,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(Qa,{strokeDasharray:"3 3"}),i.jsx(ea,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ta,{tick:{fontSize:11},tickFormatter:R=>"$"+R.toFixed(4)}),i.jsx(gn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:R=>[vb(R),"Cost"]}),i.jsx(mn,{dataKey:"value",radius:[4,4,0,0],children:p.map(R=>i.jsx(Zc,{fillOpacity:.8,style:{fill:jie[R.name]||"var(--accent-blue)"}},R.name))})]})}):i.jsx("div",{className:"empty-state",children:"No cost data yet."})}),i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ“Š Trajectories by Project Type"}),i.jsx("div",{className:"chart-container",children:g.length>0?i.jsx(Gi,{width:"100%",height:260,children:i.jsxs(qi,{data:g,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(Qa,{strokeDasharray:"3 3"}),i.jsx(ea,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ta,{tick:{fontSize:11}}),i.jsx(gn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"}}),i.jsx(mn,{dataKey:"value",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-purple)",style:{fill:"var(--accent-purple)"}})]})}):i.jsx("div",{className:"empty-state",children:"No trajectory data yet."})})]})}const ME={planner:"๐Ÿ“‹","context-gatherer":"๐Ÿ“‚",writer:"โœ๏ธ",reviewer:"๐Ÿ‘๏ธ",tester:"๐Ÿงช",debugger:"๐Ÿ›",runner:"โ–ถ๏ธ",git:"๐Ÿ”€",package:"๐Ÿ“ฆ","github-release":"๐Ÿท๏ธ",security:"๐Ÿ”’",orchestrator:"๐ŸŽฏ"},IE={planner:"var(--accent-blue)","context-gatherer":"var(--accent-cyan)",writer:"var(--accent-yellow)",reviewer:"var(--accent-purple)",tester:"var(--accent-green)",debugger:"var(--accent-red)",runner:"var(--accent-blue)",git:"var(--accent-yellow)",package:"var(--accent-yellow)","github-release":"var(--accent-green)",security:"var(--accent-red)",orchestrator:"var(--accent-yellow)"},wg={planner:"Planner","context-gatherer":"Context",writer:"Writer",reviewer:"Reviewer",tester:"Tester",debugger:"Debugger",runner:"Runner",git:"Git",package:"Package","github-release":"Release",security:"Security",orchestrator:"Orchestrator"},$E={pending:{icon:"โณ",label:"Pending"},running:{icon:"โ–ถ๏ธ",label:"Running"},completed:{icon:"โœ…",label:"Done"},failed:{icon:"โŒ",label:"Failed"}},Aie={pending:"var(--text-muted)",running:"var(--accent-blue)",completed:"var(--accent-green)",failed:"var(--accent-red)"};function Cie(e){if(!e||e.nodes.length===0)return null;const t=e.nodes.map(s=>s.startedAt||0).filter(Boolean),n=e.nodes.map(s=>s.completedAt||0).filter(Boolean),r=t.length>0?Math.min(...t):Date.now(),a=n.length>0?Math.max(...n):Date.now();return{id:`live-${r}`,goal:e.pipeline||"Active execution",startedAt:r,endedAt:n.length>0?a:void 0,success:e.nodes.length>0&&e.nodes.every(s=>s.status==="completed"),totalDurationMs:Math.max(0,a-r),phases:e.nodes.map(s=>({id:s.id,agentType:s.agentType,status:s.status,description:s.description,complexity:s.complexity,summary:s.summary,startedAt:s.startedAt,completedAt:s.completedAt,durationMs:s.startedAt&&s.completedAt?s.completedAt-s.startedAt:void 0}))}}function Tie(e,t){const n=[],r=new Set,a=Cie(e);a&&(n.push(a),r.add(a.id));for(const s of(t==null?void 0:t.runs)||[])r.has(s.id)||(n.push(s),r.add(s.id));return n}function Ha(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`}function LE(e){return e?new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function Oie(e,t){if(e.length===0)return{laid:[],total:0};const n=e.length,r=e.map(d=>d.durationMs&&d.durationMs>0?d.durationMs:0),a=r.reduce((d,f)=>d+f,0),s=a>0?e.map((d,f)=>r[f]>0?r[f]:a/n):e.map(()=>1),o=s.reduce((d,f)=>d+f,0)||1;let l=0;const c=e.map((d,f)=>{const h=s[f]/o,p=l;return l+=h,{...d,start:p,width:h,dur:s[f]}}),u=t>0?t:o;return{laid:c,total:u}}function Pie({runs:e,selectedRunId:t,onSelectRun:n,onScrub:r}){const[a,s]=k.useState(null),o=e.find(E=>E.id===(t??a))??e[0]??null,[l,c]=k.useState(0),[u,d]=k.useState(!1),f=k.useRef(null),h=k.useRef(!1),p=k.useRef(r);k.useEffect(()=>{p.current=r},[r]),k.useEffect(()=>{var E;!o&&e.length>0?s(e[0].id):o&&!e.some(j=>j.id===o.id)&&s(((E=e[0])==null?void 0:E.id)??null)},[e,o]);const{laid:g,total:m}=k.useMemo(()=>Oie((o==null?void 0:o.phases)||[],(o==null?void 0:o.totalDurationMs)||0),[o]),y=m>0?Math.min(1,Math.max(0,l/m)):0,v=k.useMemo(()=>{if(m<=0)return null;const E=y*m;return g.find(j=>E>=j.start*m&&E<(j.start+j.width)*m)||null},[g,y,m]);k.useEffect(()=>{var E;(E=p.current)==null||E.call(p,(v==null?void 0:v.id)??null)},[v==null?void 0:v.id]),k.useEffect(()=>{if(!u)return;const E=setInterval(()=>{c(j=>j+m/2e3*50)},50);return()=>clearInterval(E)},[u,m]),k.useEffect(()=>{u&&m>0&&l>=m&&(d(!1),c(0))},[u,m,l]);const b=k.useCallback(E=>{const j=f.current;if(!j||m<=0)return;const C=j.getBoundingClientRect(),T=C.width||1,$=Math.min(1,Math.max(0,(E-C.left)/T));c($*m)},[m]),w=E=>{h.current=!0,d(!1),b(E.clientX)};if(k.useEffect(()=>{const E=C=>{h.current&&b(C.clientX)},j=()=>{h.current=!1};return window.addEventListener("pointermove",E),window.addEventListener("pointerup",j),()=>{window.removeEventListener("pointermove",E),window.removeEventListener("pointerup",j)}},[b]),!o)return i.jsx("div",{className:"phase-timeline phase-timeline-empty",children:i.jsx("p",{children:"No pipeline runs yet. Run an agent task to see its phase timeline here."})});const N=o.id.startsWith("live-"),S=o.phases.filter(E=>E.status==="completed").length,x=o.phases.filter(E=>E.status==="failed").length;return i.jsxs("div",{className:"phase-timeline",children:[i.jsxs("div",{className:"phase-timeline-header",children:[i.jsx("div",{className:"phase-timeline-runs",children:e.map(E=>i.jsxs("button",{className:`phase-run-chip ${E.id===o.id?"active":""} ${E.id.startsWith("live-")?"live":""}`,onClick:()=>{s(E.id),c(0),d(!1),n==null||n(E.id)},title:E.goal,children:[E.id.startsWith("live-")&&i.jsx("span",{className:"dag-live-dot"}),E.engine&&i.jsx("span",{className:`phase-run-chip-engine phase-run-chip-engine-${E.engine}`,children:E.engine==="loop"?"๐Ÿ”":"โฌก"}),E.goal.length>32?E.goal.slice(0,30)+"โ€ฆ":E.goal,i.jsx("span",{className:"phase-run-chip-time",children:LE(E.startedAt)})]},E.id))}),i.jsxs("div",{className:"phase-timeline-meta",children:[N&&i.jsx("span",{className:"dag-live-badge",children:"LIVE"}),o.engine&&i.jsx("span",{className:`dag-engine-badge dag-engine-${o.engine}`,title:o.engine==="loop"?"Loop turn (per-tool telemetry below)":"Orchestrator pipeline",children:o.engine==="loop"?"๐Ÿ” loop":"โฌก pipeline"}),i.jsxs("span",{className:"phase-meta-item",children:[o.phases.length," steps"]}),i.jsxs("span",{className:"phase-meta-item phase-meta-ok",children:["โœ… ",S]}),x>0&&i.jsxs("span",{className:"phase-meta-item phase-meta-bad",children:["โŒ ",x]}),o.turnTelemetry&&i.jsxs("span",{className:"phase-meta-item",title:`tool calls: ${o.turnTelemetry.toolCallCount}, errored: ${o.turnTelemetry.erroredToolCount}${o.turnTelemetry.bounded?", bounded":""}${o.turnTelemetry.provider?`, ${o.turnTelemetry.provider}${o.turnTelemetry.model?`/${o.turnTelemetry.model}`:""}`:""}`,children:["๐Ÿ”ง ",o.turnTelemetry.toolCallCount,o.turnTelemetry.erroredToolCount>0&&i.jsxs("span",{className:"phase-meta-bad",children:[" (",o.turnTelemetry.erroredToolCount," err)"]})]}),i.jsxs("span",{className:"phase-meta-item",children:["โฑ ",Ha(m)]})]})]}),i.jsxs("div",{className:"phase-timeline-controls",children:[i.jsx("button",{className:`phase-play-btn ${u?"paused":""}`,onClick:()=>{u?d(!1):(l>=m&&c(0),d(!0))},"aria-label":u?"Pause scrub":"Play scrub",children:u?"โธ Pause":"โ–ถ Play"}),i.jsxs("span",{className:"phase-time-label",children:[Ha(l)," / ",Ha(m)]}),i.jsx("input",{className:"phase-range",type:"range",min:0,max:m||1,step:1,value:Math.min(l,m||1),onChange:E=>{d(!1),c(Number(E.target.value))},"aria-label":"Scrub pipeline timeline"})]}),i.jsxs("div",{className:"phase-track-wrap",children:[i.jsxs("div",{ref:f,className:"phase-track",onPointerDown:w,style:{cursor:"grab"},children:[g.map(E=>{const j=IE[E.agentType]||"var(--accent-blue)",C=Aie[E.status],T=(v==null?void 0:v.id)===E.id;return i.jsxs("button",{className:`phase-block phase-block-${E.status} ${T?"active":""}`,style:{left:`${E.start*100}%`,width:`${Math.max(E.width*100,2)}%`,background:`linear-gradient(180deg, ${j}cc, ${j}66)`,boxShadow:T?`0 0 0 2px ${C}`:void 0},onClick:$=>{$.stopPropagation(),d(!1),c((E.start+E.width/2)*m)},title:`${wg[E.agentType]||E.agentType}: ${E.description}`,children:[i.jsx("span",{className:"phase-block-icon",children:ME[E.agentType]||"โš™๏ธ"}),i.jsx("span",{className:"phase-block-label",children:wg[E.agentType]||E.agentType})]},E.id)}),i.jsx("div",{className:"phase-caret",style:{left:`${y*100}%`},onPointerDown:E=>{E.stopPropagation(),w(E)},title:`${Ha(l)} elapsed`})]}),i.jsxs("div",{className:"phase-ticks",children:[i.jsx("span",{children:"0"}),i.jsx("span",{children:Ha(Math.round(m/2))}),i.jsx("span",{children:Ha(m)})]})]}),i.jsx("div",{className:"phase-detail",children:v?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"phase-detail-title",children:[i.jsx("span",{className:"phase-detail-icon",children:ME[v.agentType]||"โš™๏ธ"}),i.jsx("span",{className:"phase-detail-agent",style:{color:IE[v.agentType]||"var(--accent-blue)"},children:wg[v.agentType]||v.agentType}),i.jsxs("span",{className:`phase-status-badge phase-status-${v.status}`,children:[$E[v.status].icon," ",$E[v.status].label]})]}),i.jsx("p",{className:"phase-detail-desc",children:v.description}),i.jsxs("div",{className:"phase-detail-meta",children:[i.jsxs("span",{children:["โฑ ",v.durationMs?Ha(v.dur):`~${Ha(v.dur)}`]}),v.startedAt?i.jsxs("span",{children:["๐Ÿ• ",LE(v.startedAt)]}):null,v.complexity?i.jsxs("span",{children:["๐ŸŽฏ ",v.complexity]}):null]}),v.summary&&i.jsx("p",{className:"phase-detail-summary",children:v.summary})]}):i.jsxs("div",{className:"phase-detail-gap",children:[i.jsx("span",{className:"phase-detail-icon",children:"โณ"}),i.jsx("span",{children:"Between steps โ€” waiting for the next agent."})]})})]})}function Sg(e){return e===void 0?"โ€”":`$${e.toFixed(5)}`}function DE(e){if(e===void 0||!Number.isFinite(e)||e<0)return"โ€”";if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const n=Math.floor(t/60);return n<60?`${n}m ${String(Math.round(t%60)).padStart(2,"0")}s`:`${Math.floor(n/60)}h ${String(n%60).padStart(2,"0")}m`}function kg(e){return e===void 0?"โ€”":e.toLocaleString("en-US")}function Rie({jobs:e}){const t=k.useMemo(()=>e.filter(u=>u.batchStats.length>0),[e]),[n,r]=k.useState(null);if(t.length===0)return null;const a=t.find(u=>u.id===n)??t[0],s=a.batchStats,o=s.filter(u=>u.durationMs!==void 0),l=o.reduce((u,d)=>u+(d.durationMs??0),0),c=o.length>0?l/o.length:void 0;return i.jsxs("div",{className:"dag-timeline-section","data-testid":"batch-economy",children:[i.jsxs("h2",{className:"section-subtitle",children:["๐Ÿ“Š Per-batch cost & latency"," ",i.jsx("span",{className:"timeline-subtitle",children:"โ€” measured, not estimated"})]}),t.length>1&&i.jsx("div",{className:"dag-loop-turn-meta",style:{marginBottom:8},children:t.slice(0,5).map(u=>i.jsx("button",{type:"button",className:"dag-loop-turn-chip",onClick:()=>r(u.id),style:{cursor:"pointer",opacity:u.id===a.id?1:.55,fontWeight:u.id===a.id?600:400},children:u.progressLine??u.goal.slice(0,40)},u.id))}),i.jsxs("div",{className:"dag-loop-turn-meta",style:{marginBottom:8},children:[i.jsxs("span",{className:"dag-loop-turn-chip",children:[a.kind==="long-form"?"๐Ÿ“–":"๐Ÿ› ๏ธ"," ",a.status]}),i.jsxs("span",{className:"dag-loop-turn-chip",children:[a.progress,"% done"]}),i.jsxs("span",{className:"dag-loop-turn-chip",children:[a.batches," batch",a.batches===1?"":"es"]}),i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:[kg(a.tokens)," tokens ยท ",Sg(a.costUsd)]}),a.stopReason&&i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:["stopped: ",a.stopReason]})]}),i.jsx("div",{className:"dag-table-wrapper",children:i.jsxs("table",{className:"dag-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Batch"}),i.jsx("th",{children:"Done"}),i.jsx("th",{children:"Tokens"}),i.jsx("th",{children:"Cost"}),i.jsx("th",{children:"Time"})]})}),i.jsxs("tbody",{children:[s.map(u=>i.jsxs("tr",{children:[i.jsx("td",{children:u.index}),i.jsx("td",{children:`${Math.round(u.progress)}%`}),i.jsx("td",{children:kg(u.tokens)}),i.jsx("td",{children:Sg(u.costUsd)}),i.jsx("td",{children:DE(u.durationMs)})]},u.index)),s.some(u=>u.error)&&i.jsx("tr",{children:i.jsxs("td",{colSpan:5,style:{opacity:.75},children:["โœ— failures:"," ",s.filter(u=>u.error).map(u=>`#${u.index} ${u.error}`).join(" ยท ")]})}),i.jsxs("tr",{children:[i.jsx("td",{children:i.jsx("strong",{children:"total"})}),i.jsx("td",{children:i.jsx("strong",{children:`${a.progress}%`})}),i.jsx("td",{children:i.jsx("strong",{children:kg(a.tokens)})}),i.jsx("td",{children:i.jsx("strong",{children:Sg(a.costUsd)})}),i.jsx("td",{children:i.jsx("strong",{children:c===void 0?"โ€”":`~${DE(c)} avg`})})]})]})]})})]})}const BE={planner:"๐Ÿ“‹","context-gatherer":"๐Ÿ“‚",writer:"โœ๏ธ",reviewer:"๐Ÿ‘๏ธ",tester:"๐Ÿงช",debugger:"๐Ÿ›",runner:"โ–ถ๏ธ",git:"๐Ÿ”€",package:"๐Ÿ“ฆ","github-release":"๐Ÿท๏ธ",security:"๐Ÿ”’",orchestrator:"๐ŸŽฏ"},Ng={planner:"var(--accent-blue)","context-gatherer":"var(--accent-cyan)",writer:"var(--accent-yellow)",reviewer:"var(--accent-purple)",tester:"var(--accent-green)",debugger:"var(--accent-red)",runner:"var(--accent-blue)",git:"var(--accent-yellow)",package:"var(--accent-yellow)","github-release":"var(--accent-green)",security:"var(--accent-red)",orchestrator:"var(--accent-yellow)"},Mie={pending:{bg:"var(--bg-card)",stroke:"var(--border)",text:"var(--text-muted)"},running:{bg:"color-mix(in srgb, var(--accent-blue) 12%, transparent)",stroke:"var(--accent-blue)",text:"var(--accent-blue)"},completed:{bg:"color-mix(in srgb, var(--accent-green) 12%, transparent)",stroke:"var(--accent-green)",text:"var(--accent-green)"},failed:{bg:"color-mix(in srgb, var(--accent-red) 12%, transparent)",stroke:"var(--accent-red)",text:"var(--accent-red)"}},zE={pending:"โณ Pending",running:"โ–ถ๏ธ Running",completed:"โœ… Done",failed:"โŒ Failed"},qs={trivial:{icon:"๐ŸŸข",color:"var(--accent-green)"},simple:{icon:"๐Ÿ”ต",color:"var(--accent-blue)"},moderate:{icon:"๐ŸŸก",color:"var(--accent-yellow)"},complex:{icon:"๐ŸŸ ",color:"var(--accent-yellow)"},critical:{icon:"๐Ÿ”ด",color:"var(--accent-red)"}},Eg={planner:"Planner","context-gatherer":"Context",writer:"Writer",reviewer:"Reviewer",tester:"Tester",debugger:"Debugger",runner:"Runner",git:"Git",package:"Package","github-release":"Release",security:"Security",orchestrator:"Orchestrator"};function Iie(e,t,n=160,r=68,a=40,s=24,o=40){if(e.length===0)return{layoutNodes:[],svgW:400,svgH:200};const l=new Map,c=new Set;function u(y){if(l.has(y))return l.get(y);if(c.has(y))return 0;c.add(y);const v=t.filter(N=>N.to===y);if(v.length===0)return l.set(y,0),0;const w=Math.max(...v.map(N=>u(N.from)))+1;return l.set(y,w),w}for(const y of e)u(y.id);const d=new Map;for(const y of e){const v=l.get(y.id)??0;d.has(v)||d.set(v,[]),d.get(v).push(y)}const f=Math.max(...d.keys()),h=Math.max(...Array.from(d.values()).map(y=>y.length)),p=(f+1)*(n+a)+o*2-a,g=Math.max(h,1)*(r+s)+o*2-s,m=[];for(const y of e){const v=l.get(y.id)??0,b=d.get(v),w=b.indexOf(y),N=b.length,S=N*(r+s)-s,x=g/2-S/2;m.push({...y,x:o+v*(n+a),y:x+w*(r+s),w:n,h:r,step:v,totalInStep:N,indexInStep:w})}return{layoutNodes:m,svgW:p,svgH:g}}function jg(e,t){if(!e)return"--";const n=(t||Date.now())-e;return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${Math.floor(n/6e4)}m ${Math.floor(n%6e4/1e3)}s`}function FE(e){return e?new Date(e).toLocaleTimeString("en-US",{minute:"2-digit",second:"2-digit"}):""}function $ie({memoryTotal:e}){return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ”€",title:"Agent Execution DAG"}),i.jsx("p",{className:"section-description",children:"Live visualization of the agent execution pipeline. When an agent task runs, you'll see each step appear here in real time as it moves through planning โ†’ context gathering โ†’ writing โ†’ review โ†’ testing."}),i.jsxs("div",{className:"dag-empty",children:[i.jsx("div",{className:"dag-empty-icon",children:"๐Ÿ”€"}),i.jsx("h2",{children:"No Active Pipeline"}),i.jsx("p",{children:"Run an agent task to see the execution pipeline appear here in real time."}),e!==void 0&&e>0&&i.jsxs("p",{className:"dag-empty-hint",children:[i.jsx("code",{children:e})," past executions are stored in memory."]})]})]})}function Lie({data:e}){var A,Z;const t=e==null?void 0:e.dag,n=(A=e==null?void 0:e.memory)==null?void 0:A.total,[r,a]=k.useState(null),[s,o]=k.useState(null),[l,c]=k.useState(void 0),[u,d]=k.useState(void 0),[f,h]=k.useState(void 0);k.useEffect(()=>Q.onDAGEvent(P=>{a(P),c(P.engine),d(P.engineExplanation),h(P.loopTurn)}),[]);const p=t||r,g=r?l:(t==null?void 0:t.engine)??l,m=r?u:(t==null?void 0:t.engineExplanation)??u,y=r?f:(t==null?void 0:t.loopTurn)??f,v=k.useMemo(()=>Tie(p,e==null?void 0:e.pipelineRuns),[p,e==null?void 0:e.pipelineRuns]),b=D=>{o(D)},w=!!(p&&(p.nodes.length>0||p.active)),N=v.length>0,S=!!y,x=((Z=e==null?void 0:e.unattendedJobs)==null?void 0:Z.jobs)??[],E=x.some(D=>D.batchStats.length>0);if(!w&&!N&&!S&&!E)return i.jsx($ie,{memoryTotal:n});const{nodes:j,edges:C,pipeline:T,active:$}=p??{nodes:[],edges:[],pipeline:null,active:!1},{layoutNodes:R,svgW:I,svgH:L}=Iie(j,C),F=j.filter(D=>D.status==="running").length,z=j.filter(D=>D.status==="completed").length,M=j.filter(D=>D.status==="failed").length,O=j.filter(D=>D.status==="pending").length,U=j.length;return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ”€",title:"Agent Execution DAG"}),N&&i.jsxs("div",{className:"dag-timeline-section",children:[i.jsxs("h2",{className:"section-subtitle",children:["โฑ Run Timeline ",i.jsx("span",{className:"timeline-subtitle",children:"โ€” scrub to replay ยท click a run to switch"})]}),i.jsx(Pie,{runs:v,onScrub:b})]}),i.jsx(Rie,{jobs:x}),y&&i.jsxs("div",{className:"dag-loop-turn-card","data-testid":"dag-loop-turn-card",children:[i.jsxs("div",{className:"dag-loop-turn-header",children:[i.jsx("span",{className:"dag-loop-turn-icon",children:"๐Ÿ”"}),i.jsxs("span",{className:"dag-loop-turn-title",children:["Loop turn โ€” ",y.title||"chat turn"]}),y.active&&i.jsx("span",{className:"dag-loop-turn-live",children:"โ— recording"})]}),i.jsxs("div",{className:"dag-loop-turn-meta",children:[i.jsxs("span",{className:"dag-loop-turn-chip",children:["๐Ÿ”ง ",y.toolCallCount," tool call",y.toolCallCount===1?"":"s"]}),y.erroredToolCount>0&&i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:["โŒ ",y.erroredToolCount," errored"]}),y.provider&&i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:[y.provider,y.model?` ยท ${y.model}`:""]}),typeof y.startedAt=="number"&&i.jsxs("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:["โฑ ",jg(y.startedAt,y.endedAt)]}),y.bounded&&i.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:"โ›” bounded"}),y.generationFailed&&i.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-error",children:"๐Ÿ’€ generation failed"}),y.cancelled&&i.jsx("span",{className:"dag-loop-turn-chip dag-loop-turn-chip-dim",children:"โœ– cancelled"})]}),y.toolCalls.length>0&&i.jsx("div",{className:"dag-loop-turn-tools",children:y.toolCalls.slice(-12).map((D,P)=>i.jsxs("span",{className:`dag-loop-tool ${D.ok===!1?"dag-loop-tool-error":""}`,title:D.error||`${D.tool}${D.durationMs!==void 0?` ยท ${D.durationMs}ms`:""}`,children:[D.ok===!1?"โŒ":"โœ“"," ",D.tool]},`${D.tool}-${P}`))})]}),w&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:`dag-status-bar ${$?"active":""}`,children:[i.jsxs("div",{className:"dag-pipeline-name",children:[$&&i.jsx("span",{className:"dag-live-dot"}),T||"Execution Pipeline"]}),i.jsxs("div",{className:"dag-pipeline-meta",children:[$&&i.jsx("span",{className:"dag-live-badge",children:"LIVE"}),g&&i.jsx("span",{className:`dag-engine-badge dag-engine-${g}`,title:m||(g==="loop"?"Single agentic loop":"Orchestrator pipeline"),"data-testid":"dag-engine-badge",children:g==="loop"?"๐Ÿ” loop engine":"โฌก pipeline engine"}),i.jsxs("span",{className:"dag-step-count",children:[U," steps"]}),F>0&&i.jsxs("span",{className:"dag-running-badge",children:["โ–ถ ",F," running"]}),O>0&&i.jsxs("span",{className:"dag-pending-badge",children:["โณ ",O," pending"]}),i.jsxs("span",{className:"dag-completed-badge",children:["โœ… ",z," done"]}),M>0&&i.jsxs("span",{className:"dag-failed-badge",children:["โŒ ",M," failed"]})]})]}),i.jsx("div",{className:"dag-container",children:i.jsxs("svg",{width:I,height:L,viewBox:`0 0 ${I} ${L}`,children:[i.jsxs("defs",{children:[C.map(D=>i.jsx("marker",{id:`arrow-${D.from}-${D.to}`,markerWidth:"8",markerHeight:"6",refX:"8",refY:"3",orient:"auto",children:i.jsx("polygon",{points:"0 0, 8 3, 0 6",style:{fill:"var(--accent-blue)"}})},`arrow-${D.from}-${D.to}`)),i.jsxs("filter",{id:"glow",children:[i.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),i.jsxs("feMerge",{children:[i.jsx("feMergeNode",{in:"coloredBlur"}),i.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),C.map(D=>{const P=R.find(X=>X.id===D.from),oe=R.find(X=>X.id===D.to);if(!P||!oe)return null;const be=P.x+P.w,pe=P.y+P.h/2,Ce=oe.x,G=oe.y+oe.h/2,Y=(be+Ce)/2,ie=oe.status,le=ie==="failed"?"var(--accent-red)":ie==="running"?"var(--accent-blue)":ie==="completed"?"var(--accent-green)":"var(--border)";return i.jsx("g",{children:i.jsx("path",{d:`M ${be} ${pe} C ${Y} ${pe}, ${Y} ${G}, ${Ce} ${G}`,fill:"none",style:{stroke:le},strokeWidth:ie==="pending"?1.5:2.5,strokeOpacity:ie==="pending"?.3:.8,markerEnd:`url(#arrow-${D.from}-${D.to})`,className:"dag-edge"})},`edge-${D.from}-${D.to}`)}),R.map(D=>{const P=Mie[D.status];Ng[D.agentType];const oe=BE[D.agentType]||"โš™๏ธ",be=Eg[D.agentType]||D.agentType,pe=s===D.id,Ce=D.status==="running";return i.jsxs("g",{onClick:()=>o(pe?null:D.id),style:{cursor:"pointer"},className:"dag-node-group",children:[pe&&i.jsx("rect",{x:D.x-4,y:D.y-4,width:D.w+8,height:D.h+8,rx:10,ry:10,fill:"none",style:{stroke:"var(--accent-blue)"},strokeWidth:2,strokeOpacity:.5}),i.jsx("rect",{x:D.x,y:D.y,width:D.w,height:D.h,rx:8,ry:8,style:{fill:P.bg,stroke:P.stroke},strokeWidth:Ce?2.5:1.5,strokeOpacity:.9,className:Ce?"dag-node-running":"",filter:Ce?"url(#glow)":void 0}),i.jsxs("text",{x:D.x+10,y:D.y+22,style:{fill:"var(--text-primary)"},fontSize:10,fontWeight:600,children:[oe," ",be]}),i.jsx("text",{x:D.x+D.w-10,y:D.y+22,textAnchor:"end",style:{fill:P.text},fontSize:9,fontWeight:500,children:zE[D.status]}),i.jsx("text",{x:D.x+10,y:D.y+40,style:{fill:"var(--text-secondary)"},fontSize:9,children:D.description.length>28?D.description.slice(0,26)+"..":D.description}),D.complexity&&qs[D.complexity]&&i.jsxs("text",{x:D.x+10,y:D.y+54,style:{fill:qs[D.complexity].color},fontSize:8,fontWeight:600,children:[qs[D.complexity].icon," ",D.complexity]}),i.jsx("text",{x:D.x+10,y:D.y+56,style:{fill:"var(--text-muted)"},fontSize:8,children:jg(D.startedAt,D.completedAt)}),i.jsx("text",{x:D.x+D.w-10,y:D.y+56,textAnchor:"end",style:{fill:"var(--text-muted)"},fontSize:8,children:FE(D.startedAt||D.completedAt)}),(D.status==="failed"||pe)&&D.summary&&i.jsx("foreignObject",{x:Math.max(10,D.x-80),y:D.y+D.h+6,width:D.w+160,height:36,children:i.jsx("div",{className:"dag-node-summary",style:{color:D.status==="failed"?"var(--accent-red)":"var(--text-secondary)",fontSize:"10px",lineHeight:1.4,background:"var(--scrim)",padding:"4px 8px",borderRadius:"4px",border:`1px solid ${D.status==="failed"?"color-mix(in srgb, var(--accent-red) 30%, transparent)":"color-mix(in srgb, var(--border) 50%, transparent)"}`,maxHeight:"32px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:D.summary})})]},`node-${D.id}`)})]})}),i.jsx("h2",{className:"section-subtitle",children:"Step Details"}),i.jsx("div",{className:"dag-table-wrapper",children:i.jsxs("table",{className:"dag-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Step"}),i.jsx("th",{children:"Agent"}),i.jsx("th",{children:"Complexity"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Summary"})]})}),i.jsx("tbody",{children:R.map(D=>i.jsxs("tr",{className:`dag-row dag-row-${D.status}`,children:[i.jsx("td",{className:"dag-cell-step",children:D.step}),i.jsxs("td",{className:"dag-cell-agent",children:[i.jsx("span",{className:"dag-agent-dot",style:{background:Ng[D.agentType]||"var(--accent-blue)"}}),Eg[D.agentType]||D.agentType]}),i.jsx("td",{className:"dag-cell-complexity",children:D.complexity&&qs[D.complexity]?i.jsxs("span",{style:{color:qs[D.complexity].color,fontSize:12},children:[qs[D.complexity].icon," ",D.complexity]}):i.jsx("span",{style:{color:"var(--text-muted)",fontSize:12},children:"โ€”"})}),i.jsx("td",{className:`dag-cell-status dag-status-${D.status}`,children:zE[D.status]}),i.jsx("td",{className:"dag-cell-duration",children:jg(D.startedAt,D.completedAt)}),i.jsx("td",{className:"dag-cell-time",children:FE(D.startedAt||D.completedAt)}),i.jsx("td",{className:"dag-cell-summary",children:D.summary||D.description||"--"})]},D.id))})]})}),i.jsx("h2",{className:"section-subtitle",children:"Agent Types"}),i.jsxs("div",{className:"dag-legend",children:[Object.entries(BE).map(([D,P])=>i.jsxs("div",{className:"legend-item",children:[i.jsx("span",{className:"legend-dot",style:{background:Ng[D]||"var(--accent-blue)"}}),i.jsx("span",{className:"legend-icon",children:P}),i.jsx("span",{className:"legend-label",children:Eg[D]||D})]},D)),i.jsxs("div",{className:"legend-item",children:[i.jsx("span",{className:"legend-dot",style:{background:"transparent",border:"2px dashed var(--accent-blue)"}}),i.jsx("span",{className:"legend-icon",children:"โšก"}),i.jsx("span",{className:"legend-label",children:"Live node"})]})]})]})]})}function Ks(e){return e==null||e<1e-5?"$0.00":e<.01?"$"+e.toFixed(6):"$"+e.toFixed(4)}function Jl(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":mt(e)}function Die(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Bie({data:e}){if(!e)return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ’ฐ",title:"Cost Tracking"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading cost data..."})})]});const{cost:t}=e,n=Object.entries(t.byProvider||{}).sort(([,s],[,o])=>o-s),r=Object.entries(t.byModel||{}).sort(([,s],[,o])=>o-s).slice(0,10),a=n.reduce((s,[,o])=>s+o,0);return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ’ฐ",title:"Cost Tracking"}),i.jsxs("div",{className:"cost-summary",children:[i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"Total Spent"}),i.jsx("span",{className:"cost-amount",children:Ks(t.totalCost)})]}),i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"Total Tokens"}),i.jsx("span",{className:"cost-amount",children:Jl(t.totalTokens)})]}),i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"Total Requests"}),i.jsx("span",{className:"cost-amount",children:Jl(t.totalRequests)})]})]}),i.jsxs("div",{className:"cost-summary cost-summary-sub",children:[i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"๐Ÿ“ Measured (exact wire tokens)"}),i.jsx("span",{className:"cost-amount",children:Ks(t.measuredCost)}),i.jsxs("span",{className:"cost-label",children:[Jl(t.measuredCalls)," calls"]})]}),i.jsxs("div",{className:"cost-total",children:[i.jsx("span",{className:"cost-label",children:"๐Ÿ“ Estimated (length-based)"}),i.jsx("span",{className:"cost-amount",children:Ks(t.estimatedCost)}),i.jsxs("span",{className:"cost-label",children:[Jl(t.estimatedCalls)," calls"]})]})]}),i.jsx("h2",{className:"section-subtitle",children:"By Provider"}),i.jsx("div",{className:"cost-list",children:n.length===0?i.jsx("div",{className:"empty-state",children:"No costs recorded yet."}):n.map(([s,o])=>{const l=a>0?(o/a*100).toFixed(1):"0";return i.jsxs("div",{className:"cost-row",children:[i.jsx("span",{className:"cost-row-name",children:s}),i.jsx("div",{className:"cost-row-bar",children:i.jsx("div",{className:"cost-row-fill",style:{width:`${l}%`}})}),i.jsx("span",{className:"cost-row-value",children:Ks(o)})]},s)})}),i.jsx("h2",{className:"section-subtitle",children:"By Model"}),i.jsx("div",{className:"cost-list",children:r.length===0?i.jsx("div",{className:"empty-state",children:"No model costs recorded yet."}):r.map(([s,o])=>{const l=a>0?(o/a*100).toFixed(1):"0",c=s.length>30?s.slice(0,28)+"..":s;return i.jsxs("div",{className:"cost-row",children:[i.jsx("span",{className:"cost-row-name",children:c}),i.jsx("div",{className:"cost-row-bar",children:i.jsx("div",{className:"cost-row-fill",style:{width:`${l}%`}})}),i.jsx("span",{className:"cost-row-value",children:Ks(o)})]},s)})}),i.jsx("h2",{className:"section-subtitle",children:"Recent Requests"}),i.jsx("div",{className:"request-list",children:!t.recent||t.recent.length===0?i.jsx("div",{className:"empty-state",children:"No requests recorded yet."}):t.recent.slice(0,30).map((s,o)=>i.jsxs("div",{className:"request-row",children:[i.jsx("span",{className:"request-time",children:Die(s.timestamp)}),i.jsx("span",{className:"request-provider",children:s.provider||"--"}),i.jsx("span",{className:"request-model",children:s.model||"--"}),i.jsx("span",{className:"request-cost",children:Ks(s.costUsd)}),i.jsxs("span",{className:"request-tokens",children:[Jl(s.totalTokens)," tok"]})]},o))})]})}function zie(e){return e==null?"$0.00":"$"+e.toFixed(6)}function Ld(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function Fie({data:e}){if(!e)return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ“ˆ",title:"Benchmark Results"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading benchmark data..."})})]});const{benchmarks:t,evals:n}=e,r=t.latest,a=t.runs||[],s=(n==null?void 0:n.runs)||[],o=(n==null?void 0:n.latest)||null,l=s.map(u=>({name:u.model.length>12?u.model.slice(0,10)+"..":u.model,score:Math.round(u.summary.avgCompositeScore*100),completion:Math.round(u.summary.completionRate*100),tests:Math.round(u.summary.testPassRate*100),recovery:Math.round(u.summary.recoveryRate*100),efficiency:Math.round(u.summary.avgTokenEfficiency*100),fullModel:u.model,provider:u.provider})).reverse(),c=a.map(u=>({name:u.model.length>12?u.model.slice(0,10)+"..":u.model,passRate:u.summary.totalTasks>0?Math.round(u.summary.tasksPassed/u.summary.totalTasks*100):0,quality:Math.round(u.summary.avgQualityScore*100),latency:u.summary.medianLatencyMs,cost:u.summary.totalCostUsd,fullModel:u.model,provider:u.provider})).reverse();return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ“ˆ",title:"Benchmark Results"}),i.jsx("div",{className:"benchmark-latest",children:r?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"benchmark-header",children:[i.jsx("strong",{children:"Latest Run:"})," ",r.provider,"/",r.model]}),i.jsxs("div",{className:"benchmark-stats",children:[i.jsxs("div",{className:"benchmark-stat pass",children:[i.jsxs("div",{className:"benchmark-stat-value",children:[r.summary.tasksPassed,"/",r.summary.totalTasks]}),i.jsx("div",{className:"benchmark-stat-label",children:"Passed"})]}),i.jsxs("div",{className:"benchmark-stat quality",children:[i.jsx("div",{className:"benchmark-stat-value",children:Ld(r.summary.avgQualityScore)}),i.jsx("div",{className:"benchmark-stat-label",children:"Quality"})]}),i.jsxs("div",{className:"benchmark-stat latency",children:[i.jsxs("div",{className:"benchmark-stat-value",children:[r.summary.medianLatencyMs,"ms"]}),i.jsx("div",{className:"benchmark-stat-label",children:"Latency"})]}),i.jsxs("div",{className:"benchmark-stat fail",children:[i.jsx("div",{className:"benchmark-stat-value",children:zie(r.summary.totalCostUsd)}),i.jsx("div",{className:"benchmark-stat-label",children:"Cost"})]})]})]}):i.jsxs("div",{className:"empty-state",children:["No benchmark runs yet. Run ",i.jsx("code",{children:"buff benchmark"})," to start."]})}),c.length>1&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"Pass Rate by Model"}),i.jsx("div",{className:"chart-container",children:i.jsx(Gi,{width:"100%",height:260,children:i.jsxs(qi,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(Qa,{strokeDasharray:"3 3"}),i.jsx(ea,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ta,{domain:[0,100],tick:{fontSize:11},tickFormatter:u=>u+"%"}),i.jsx(gn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:u=>[u+"%","Pass Rate"]}),i.jsx(mn,{dataKey:"passRate",radius:[4,4,0,0],children:c.map((u,d)=>i.jsx(Zc,{fillOpacity:.8,style:{fill:u.passRate>=80?"var(--accent-green)":u.passRate>=50?"var(--accent-yellow)":"var(--accent-red)"}},d))})]})})}),i.jsx("h2",{className:"section-subtitle",children:"Latency by Model"}),i.jsx("div",{className:"chart-container",children:i.jsx(Gi,{width:"100%",height:260,children:i.jsxs(qi,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(Qa,{strokeDasharray:"3 3"}),i.jsx(ea,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ta,{tick:{fontSize:11},tickFormatter:u=>u+"ms"}),i.jsx(gn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:u=>[u+"ms","Latency"]}),i.jsx(mn,{dataKey:"latency",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-yellow)",style:{fill:"var(--accent-yellow)"}})]})})}),i.jsx("h2",{className:"section-subtitle",children:"Cost by Model"}),i.jsx("div",{className:"chart-container",children:i.jsx(Gi,{width:"100%",height:260,children:i.jsxs(qi,{data:c,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(Qa,{strokeDasharray:"3 3"}),i.jsx(ea,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ta,{tick:{fontSize:11},tickFormatter:u=>"$"+u.toFixed(6)}),i.jsx(gn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:u=>["$"+u.toFixed(6),"Cost"]}),i.jsx(mn,{dataKey:"cost",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-purple)",style:{fill:"var(--accent-purple)"}})]})})})]}),i.jsx("h2",{className:"section-subtitle",children:"๐ŸŽฏ Agent Evaluation"}),i.jsx("p",{className:"section-hint",style:{color:"var(--text-secondary)",fontSize:12,marginBottom:16},children:"End-to-end coding tasks run through the full agent pipeline โ€” measures if the agent is actually improving."}),i.jsx("div",{className:"benchmark-latest",children:o?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"benchmark-header",children:[i.jsx("strong",{children:"Latest Eval Run:"})," ",o.provider,"/",o.model]}),i.jsxs("div",{className:"benchmark-stats",children:[i.jsxs("div",{className:"benchmark-stat pass",children:[i.jsxs("div",{className:"benchmark-stat-value",children:[o.summary.tasksPassed,"/",o.summary.totalTasks]}),i.jsx("div",{className:"benchmark-stat-label",children:"Tests Passed"})]}),i.jsxs("div",{className:"benchmark-stat quality",children:[i.jsx("div",{className:"benchmark-stat-value",children:Ld(o.summary.avgCompositeScore)}),i.jsx("div",{className:"benchmark-stat-label",children:"Composite Score"})]}),i.jsxs("div",{className:"benchmark-stat latency",children:[i.jsx("div",{className:"benchmark-stat-value",children:Ld(o.summary.recoveryRate)}),i.jsx("div",{className:"benchmark-stat-label",children:"Recovery Rate"})]}),i.jsxs("div",{className:"benchmark-stat fail",children:[i.jsx("div",{className:"benchmark-stat-value",children:o.summary.totalRollbacks}),i.jsx("div",{className:"benchmark-stat-label",children:"Rollbacks"})]}),i.jsxs("div",{className:"benchmark-stat deps",children:[i.jsx("div",{className:"benchmark-stat-value",children:Ld(o.summary.dependencyInstallRate)}),i.jsx("div",{className:"benchmark-stat-label",children:"Deps Installed"})]})]})]}):i.jsxs("div",{className:"empty-state",children:["No eval runs yet. Run ",i.jsx("code",{children:"buff eval run"})," to measure the agent end-to-end."]})}),l.length>1&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"Composite Score by Model"}),i.jsx("div",{className:"chart-container",children:i.jsx(Gi,{width:"100%",height:260,children:i.jsxs(qi,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(Qa,{strokeDasharray:"3 3"}),i.jsx(ea,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ta,{domain:[0,100],tick:{fontSize:11},tickFormatter:u=>u+"%"}),i.jsx(gn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"},formatter:u=>[u+"%","Composite Score"]}),i.jsx(mn,{dataKey:"score",radius:[4,4,0,0],children:l.map((u,d)=>i.jsx(Zc,{fillOpacity:.8,style:{fill:u.score>=80?"var(--accent-green)":u.score>=50?"var(--accent-yellow)":"var(--accent-red)"}},d))})]})})}),i.jsx("h2",{className:"section-subtitle",children:"Metric Breakdown (completion / tests / recovery / token efficiency)"}),i.jsx("div",{className:"chart-container",children:i.jsx(Gi,{width:"100%",height:260,children:i.jsxs(qi,{data:l,margin:{top:20,right:20,left:10,bottom:40},children:[i.jsx(Qa,{strokeDasharray:"3 3"}),i.jsx(ea,{dataKey:"name",tick:{fontSize:11}}),i.jsx(ta,{domain:[0,100],tick:{fontSize:11},tickFormatter:u=>u+"%"}),i.jsx(gn,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8},labelStyle:{color:"var(--text-primary)"}}),i.jsx(as,{}),i.jsx(mn,{dataKey:"completion",name:"Completion",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-green)",style:{fill:"var(--accent-green)"}}),i.jsx(mn,{dataKey:"tests",name:"Tests",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-blue)",style:{fill:"var(--accent-blue)"}}),i.jsx(mn,{dataKey:"recovery",name:"Recovery",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-yellow)",style:{fill:"var(--accent-yellow)"}}),i.jsx(mn,{dataKey:"efficiency",name:"Token Eff.",radius:[4,4,0,0],fillOpacity:.8,fill:"var(--accent-purple)",style:{fill:"var(--accent-purple)"}})]})})})]}),i.jsx("h2",{className:"section-subtitle",children:"Eval Run History"}),i.jsx("div",{className:"benchmark-list",children:s.length===0?i.jsxs("div",{className:"empty-state",children:["No eval runs yet. Run ",i.jsx("code",{children:"buff eval run"})," to start."]}):s.map(u=>{const d=Math.round(u.summary.avgCompositeScore*100),f=d>=80?"high":d>=50?"medium":"low";return i.jsxs("div",{className:"benchmark-item",children:[i.jsx("span",{className:"benchmark-date",children:new Date(u.startedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),i.jsxs("span",{className:"benchmark-model",children:[u.provider,"/",u.model]}),i.jsxs("span",{className:`benchmark-score ${f}`,children:[d,"%"]})]},u.id)})}),i.jsx("h2",{className:"section-subtitle",children:"Run History"}),i.jsx("div",{className:"benchmark-list",children:a.length===0?i.jsxs("div",{className:"empty-state",children:["No benchmark runs yet. Run ",i.jsx("code",{children:"buff benchmark"})," to start."]}):a.map(u=>{const d=u.summary.totalTasks>0?Math.round(u.summary.tasksPassed/u.summary.totalTasks*100):0,f=d>=80?"high":d>=50?"medium":"low";return i.jsxs("div",{className:"benchmark-item",children:[i.jsx("span",{className:"benchmark-date",children:new Date(u.startedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),i.jsxs("span",{className:"benchmark-model",children:[u.provider,"/",u.model]}),i.jsxs("span",{className:`benchmark-score ${f}`,children:[d,"%"]})]},u.id)})})]})}const Uie={pass:"โœ…",warn:"โš ๏ธ",fail:"โŒ"},Wie={pass:"PASS",warn:"WARN",fail:"FAIL"};function zR(e){const t={pass:0,warn:0,fail:0};for(const n of e)t[n.status]!==void 0&&(t[n.status]+=1);return t}function FR(e){const t=[];return e.fail>0&&t.push(`${e.fail} failing`),e.warn>0&&t.push(`${e.warn} warning${e.warn===1?"":"s"}`),e.pass>0&&t.push(`${e.pass} passing`),t.length>0?t.join(" ยท "):"no checks"}function yb({check:e}){return i.jsxs("div",{className:"admin-check-row","data-status":e.status,"data-testid":`check-${e.name}`,children:[i.jsxs("span",{className:`admin-check-badge admin-check-${e.status}`,children:[Uie[e.status]," ",Wie[e.status]]}),i.jsxs("div",{className:"admin-check-body",children:[i.jsx("div",{className:"admin-check-name",children:e.name}),i.jsx("div",{className:"admin-check-message",children:e.message}),e.detail?i.jsx("div",{className:"admin-check-detail",children:e.detail}):null,e.fix?i.jsxs("div",{className:"admin-check-fix",children:["๐Ÿ’ก ",e.fix]}):null]})]})}function UE(e){return`${(e*100).toFixed(1)}%`}function ec(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":mt(e)}function Hie(e){if(!e)return"never";const t=Math.floor((Date.now()-e)/1e3);if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m ago`:`${Math.floor(r/24)}d ago`}function WE({title:e,blurb:t,checks:n,testId:r}){const a=zR(n);return i.jsxs("section",{style:{marginBottom:18},"data-testid":r,children:[i.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[i.jsx("h2",{className:"section-subtitle",style:{margin:0},children:e}),i.jsx("span",{style:{fontSize:12,color:a.fail>0?"var(--accent-red)":a.warn>0?"var(--accent-yellow)":"var(--accent-green)"},"data-testid":`${r}-summary`,children:FR(a)})]}),i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",margin:"4px 0 10px"},children:t}),i.jsx("div",{className:"admin-check-list",children:n.length>0?n.map(s=>i.jsx(yb,{check:s},s.name)):i.jsxs("div",{className:"empty-state",children:["No ",e.toLowerCase()," checks returned."]})})]})}function Gie({data:e,connected:t,lastUpdated:n}){const[r,a]=k.useState(null),[s,o]=k.useState(null),[l,c]=k.useState(!1),u=k.useCallback(async()=>{c(!0),o(null);const v=await Q.fetchAdminChecks();v?a(v):o("Could not reach the dashboard server, or it is older than this page. Run `nuvira dashboard` to start it."),c(!1)},[]);k.useEffect(()=>{u()},[u]);const d=e==null?void 0:e.health,f=(d==null?void 0:d.agentStats)??null,h=[...(r==null?void 0:r.system)??[],...(r==null?void 0:r.enterprise)??[]],p=zR(h),g=((r==null?void 0:r.providers)??[]).filter(v=>v.configured).length,m=((r==null?void 0:r.providers)??[]).length,y=f?Object.entries(f.agents).map(([v,b])=>({agent:v,...b})).sort((v,b)=>b.totalRuns-v.totalRuns||v.agent.localeCompare(b.agent)):[];return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"โš™๏ธ",title:"System Health"}),i.jsxs("p",{className:"section-description",style:{fontSize:12,color:"var(--text-secondary)",marginBottom:14},children:["The same checks ",i.jsx("code",{children:"nuvira doctor"})," runs, executed on demand โ€” pass / warn / fail, with the fix for anything that is not passing. The store counters at the bottom are how big the agent's memory files are; they are not a health verdict."]}),i.jsxs("div",{className:"health-grid",style:{marginBottom:18},children:[i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:t?"๐ŸŸข":"๐ŸŸ "}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Live Stream"}),i.jsx("div",{className:"health-value","data-testid":"connection-state",children:t?"โ— Connected":"โ— Reconnectingโ€ฆ"})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"โฑ๏ธ"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Last Update"}),i.jsx("div",{className:"health-value",children:n})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"๐Ÿฉบ"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Doctor"}),i.jsx("div",{className:"health-value","data-testid":"doctor-verdict",style:{color:p.fail>0?"var(--accent-red)":p.warn>0?"var(--accent-yellow)":"var(--accent-green)"},children:r?FR(p):l?"runningโ€ฆ":"--"})]})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:6},children:[i.jsx("h2",{className:"section-subtitle",style:{margin:0},children:"Doctor Checks"}),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:l,onClick:()=>void u(),"data-testid":"run-checks",children:l?"โณ Runningโ€ฆ":"โ†ป Run checks again"}),m>0?i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)"},children:[g," of ",m," providers configured โ€” per-provider detail is on the Admin tab"]}):null]}),s?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",style:{marginBottom:12},children:s}):null,!r&&!s?i.jsx("div",{className:"loading-state",children:"Running checksโ€ฆ"}):null,r?i.jsxs(i.Fragment,{children:[i.jsx(WE,{title:"System",blurb:"Runtime, filesystem, configuration and the local model surface.",checks:r.system,testId:"checks-system"}),i.jsx(WE,{title:"Enterprise",blurb:"Governance, audit, RBAC and the controls an operator is accountable for.",checks:r.enterprise,testId:"checks-enterprise"})]}):null,i.jsx("h2",{className:"section-subtitle",children:"Agent Performance"}),f?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"stats-grid",style:{marginBottom:10},children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:ec(f.totalRuns)}),i.jsx("div",{className:"stat-label",children:"Recorded runs"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:UE(f.overallSuccessRate)}),i.jsx("div",{className:"stat-label",children:"Overall success rate"})]})]}),y.length>0?i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:18},children:y.map(v=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,fontSize:12,padding:"4px 0",borderBottom:"1px solid var(--border-light)"},"data-testid":`agent-stats-${v.agent}`,children:[i.jsx("span",{style:{flex:1,color:"var(--text-primary)"},children:v.agent}),i.jsxs("span",{style:{color:"var(--text-secondary)"},children:[ec(v.totalRuns)," runs"]}),i.jsx("span",{style:{color:v.successRate>=.9?"var(--accent-green)":v.successRate>=.7?"var(--accent-yellow)":"var(--accent-red)"},children:UE(v.successRate)}),i.jsx("span",{style:{color:"var(--text-secondary)",minWidth:78,textAlign:"right"},children:Hie(v.lastRun)})]},v.agent))}):i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:18},children:"No agent runs recorded yet โ€” this fills in as agents execute."})]}):i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:18},children:"No agent-stats file yet. Run a task and the per-agent success rates appear here."}),i.jsx("h2",{className:"section-subtitle",children:"Learning Stores"}),i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",margin:"4px 0 10px"},children:"What the agent has learned into disk. Sizes, not verdicts."}),i.jsxs("div",{className:"health-grid",children:[i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"๐Ÿ’พ"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Memory Directory"}),i.jsx("div",{className:"health-path",children:(d==null?void 0:d.memoryDir)||"~/.buff/memory/"})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"๐Ÿ“"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Coding Patterns"}),i.jsx("div",{className:"health-value",children:ec(d==null?void 0:d.patterns)})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"๐Ÿ‘"}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"User Feedback"}),i.jsxs("div",{className:"health-value",children:[ec(d==null?void 0:d.feedback)," ratings"]})]})]}),i.jsxs("div",{className:"health-card",children:[i.jsx("span",{className:"health-icon",children:"๐Ÿง "}),i.jsxs("div",{className:"health-body",children:[i.jsx("div",{className:"health-title",children:"Vector Index"}),i.jsxs("div",{className:"health-value",children:[ec(d==null?void 0:d.vectors)," entries"]})]})]})]}),e?null:i.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:10},children:"Waiting for the first data frame from the dashboard server โ€” the checks above do not depend on it."}),i.jsx("h2",{className:"section-subtitle",children:"Server Info"}),i.jsxs("div",{className:"server-info",children:[i.jsxs("div",{className:"info-row",children:[i.jsx("span",{className:"info-label",children:"Stream"}),i.jsx("span",{className:"info-value",children:t?"โ— Connected":"โ— Reconnectingโ€ฆ"})]}),i.jsxs("div",{className:"info-row",children:[i.jsx("span",{className:"info-label",children:"Last Updated"}),i.jsx("span",{className:"info-value",children:n})]}),i.jsxs("div",{className:"info-row",children:[i.jsx("span",{className:"info-label",children:"Checks run at"}),i.jsx("span",{className:"info-value",children:r!=null&&r.serverTime?new Date(r.serverTime).toLocaleString():"--"})]}),i.jsxs("div",{className:"info-row",children:[i.jsx("span",{className:"info-label",children:"Data Directory"}),i.jsx("span",{className:"info-value",children:(d==null?void 0:d.memoryDir)||"~/.buff/memory/"})]})]})]})}const qie=new Set(["local","lmstudio","vllm"]),Kie=new Set([]),Dh={available:{bg:"var(--ok-soft)",text:"var(--accent-green)",dot:"var(--accent-green)",cardBorder:"var(--accent-green)",cardBg:"var(--ok-soft)"},limited:{bg:"var(--warn-soft)",text:"var(--accent-yellow)",dot:"var(--accent-yellow)",cardBorder:"var(--accent-yellow)",cardBg:"var(--warn-soft)"},unavailable:{bg:"var(--danger-soft)",text:"var(--accent-red)",dot:"var(--accent-red)",cardBorder:"var(--accent-red)",cardBg:"var(--danger-soft)"}},Vie=[3,4,5],UR=12e3,HE=[300,700],Yie=6e4,Xie=5e3;function Zie(e){return new Promise(t=>setTimeout(t,e))}async function WR(e,t){const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{return await fetch(e,{signal:n.signal})}finally{clearTimeout(r)}}function HR(e){return e instanceof TypeError||e instanceof Error&&e.name==="AbortError"}async function Qie(e){let t=null,n=!1;for(let r=0;;r++){try{const a=await WR("/api/models",UR);if(!a.ok)t=a.status;else{const s=await fr(a);if(s&&Array.isArray(s.providers))return s;throw new Error("Model health endpoint returned an unexpected response โ€” is the dashboard server up to date?")}}catch(a){if(!HR(a))throw a;n=!0,e==null||e()}if(r>=HE.length)throw new Error(n?"Dashboard server unreachable โ€” is it still running? Retrying automaticallyโ€ฆ":`Model health endpoint failed (HTTP ${t})`);await Zie(HE[r])}}async function Jie(e){for(let t=0;;t++)try{const n=await WR("/api/model-registry",UR);return n.ok?await fr(n):null}catch(n){if(!HR(n)||t>=1)return null;e==null||e()}}function ese(e){return e==="available"?"Available":e==="limited"?"Limited":"Unavailable"}function tse(e){return e==="available"?"Ready":e==="limited"?"Limited":"Down"}function GR(e){return{local:"๐Ÿ’ป",groq:"๐ŸŸข",nim:"๐Ÿ”ถ",gemini:"๐Ÿ”ท",openrouter:"๐ŸŸฃ",openai:"๐Ÿค–",anthropic:"๐Ÿ”ฎ",mistral:"๐ŸŒ€",cohere:"๐Ÿง ",together:"๐ŸŸข",deepinfra:"๐ŸŒ",fireworks:"๐ŸŽ†",perplexity:"โ“",azure:"๐Ÿ”ต",anyscale:"๐Ÿ”ท",lmstudio:"๐ŸŽจ",vllm:"โšก"}[e]||"๐Ÿ”Œ"}function U0(e){return{local:"Ollama",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter",openai:"OpenAI",anthropic:"Anthropic",mistral:"Mistral",cohere:"Cohere",together:"Together AI",deepinfra:"DeepInfra",fireworks:"Fireworks AI",perplexity:"Perplexity",azure:"Azure OpenAI",anyscale:"Anyscale",lmstudio:"LM Studio",vllm:"vLLM / TGI"}[e]||e}function GE({status:e,label:t}){const n=Dh[e];return i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,background:n.bg,color:n.text,padding:"3px 10px",borderRadius:12,fontSize:12,fontWeight:500,border:`1px solid ${n.text}22`},children:[i.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:n.dot}}),t]})}function nse({onRefresh:e,loading:t}){return i.jsxs("div",{className:"stats-grid mini",style:{marginBottom:16},children:[i.jsx("button",{onClick:e,disabled:t,className:"stat-card",style:{cursor:t?"not-allowed":"pointer",opacity:t?.6:1,border:"1px solid var(--border)",justifyContent:"center",fontSize:13},children:t?"โณ Testing...":"๐Ÿ”„ Refresh Status"}),i.jsx("div",{className:"stat-card",style:{border:"1px solid var(--border)"},children:i.jsx("div",{style:{fontSize:13,color:"var(--text-secondary)",textAlign:"center",width:"100%"},children:"Tests all configured providers and their API keys in real time"})})]})}function rse({data:e}){const t=e.totalModels;if(t===0)return null;const n=e.available||0,r=e.limited||0,a=e.unavailable||0;return i.jsxs("div",{style:{marginBottom:16},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:8,overflow:"hidden",height:10,display:"flex",border:"1px solid var(--border-light)"},children:[n>0&&i.jsx("div",{style:{width:`${n/t*100}%`,background:"var(--accent-green)",transition:"width 0.5s"},title:`${n} available`}),r>0&&i.jsx("div",{style:{width:`${r/t*100}%`,background:"var(--accent-yellow)",transition:"width 0.5s"},title:`${r} limited`}),a>0&&i.jsx("div",{style:{width:`${a/t*100}%`,background:"var(--accent-red)",transition:"width 0.5s"},title:`${a} unavailable`})]}),i.jsxs("div",{style:{display:"flex",gap:16,marginTop:6,fontSize:12,color:"var(--text-secondary)"},children:[i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"โ—"})," Ready"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"โ—"})," Limited"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-red)"},children:"โ—"})," Unavailable"]})]}),typeof e.routable=="number"&&i.jsxs("div",{style:{marginTop:6,fontSize:12,color:"var(--text-secondary)",lineHeight:1.5},children:[i.jsx("strong",{style:{color:"var(--text-primary)"},children:t})," listed by providers ยท"," ",i.jsx("strong",{style:{color:e.routable>0?"var(--accent-green)":"var(--accent-yellow)"},children:e.routable})," ","routable right now (verified, un-parked, not stale)",typeof e.registryTotal=="number"&&e.registryTotal>0&&i.jsxs(i.Fragment,{children:[" ","ยท registry tracks"," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:e.registryVerified??0})," of"," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:e.registryTotal})," verified"]})]})]})}function Dd({provider:e}){const[t,n]=k.useState(!1),r=Dh[e.overallStatus].text,a={available:e.models.filter(s=>s.status==="available").length,limited:e.models.filter(s=>s.status==="limited").length,unavailable:e.models.filter(s=>s.status==="unavailable").length};return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:`1px solid ${r}44`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[i.jsxs("div",{onClick:()=>n(!t),style:{padding:"14px 18px",cursor:"pointer",display:"flex",alignItems:"center",gap:14,userSelect:"none"},children:[i.jsx("span",{style:{fontSize:24},children:e.icon}),i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:2},children:[i.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)"},children:e.providerLabel}),i.jsx(GE,{status:e.overallStatus,label:ese(e.overallStatus)})]}),i.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:[e.models.length," model",e.models.length!==1?"s":"",a.available>0&&i.jsxs("span",{style:{color:"var(--accent-green)"},children:[" ยท ",a.available," ready"]}),a.limited>0&&i.jsxs("span",{style:{color:"var(--accent-yellow)"},children:[" ยท ",a.limited," limited"]}),a.unavailable>0&&i.jsxs("span",{style:{color:"var(--accent-red)"},children:[" ยท ",a.unavailable," unavailable"]})]})]}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",textAlign:"right"},children:[i.jsx("div",{style:{marginBottom:2,color:e.apiConfigured?"var(--accent-green)":"var(--accent-red)"},children:e.apiConfigured?"โœ… Key set":"โŒ No key"}),i.jsx("div",{style:{color:e.apiAccessible?"var(--accent-green)":"var(--accent-red)"},children:e.apiAccessible?"โœ… Connected":"โŒ Offline"})]}),i.jsx("span",{style:{color:"var(--text-secondary)",fontSize:18,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"โ–ถ"})]}),t&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{padding:"10px 18px",background:"var(--bg-primary)",fontSize:13,color:"var(--text-secondary)",display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:8,borderTop:"1px solid var(--border-light)"},children:[i.jsx("span",{children:e.notes}),e.freeTierInfo&&i.jsxs("span",{style:{color:"var(--accent-yellow)"},children:["๐ŸŽ ",e.freeTierInfo]})]}),i.jsx("div",{style:{overflowX:"auto",borderTop:"1px solid var(--border-light)"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 18px",textAlign:"left",fontWeight:500},children:"Model"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Status"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Quota"}),i.jsx("th",{style:{padding:"8px 18px",textAlign:"left",fontWeight:500},children:"Details"})]})}),i.jsx("tbody",{children:e.models.map((s,o)=>i.jsxs("tr",{style:{borderBottom:o<e.models.length-1?"1px solid var(--border-light)":"none",background:s.status==="unavailable"?"var(--bg-primary)":"transparent"},children:[i.jsxs("td",{style:{padding:"8px 18px",color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:[i.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:Dh[s.status].dot,marginRight:8}}),s.name]}),i.jsx("td",{style:{padding:"8px 12px"},children:i.jsx(GE,{status:s.status,label:tse(s.status)})}),i.jsx("td",{style:{padding:"8px 12px",color:"var(--text-secondary)",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:s.rateLimitRemaining!==void 0?s.rateLimitTotal?`${s.rateLimitRemaining}/${s.rateLimitTotal}`:`${s.rateLimitRemaining} left`:"โ€”"}),i.jsx("td",{style:{padding:"8px 18px",color:"var(--text-secondary)",fontSize:12},children:s.statusReason})]},s.id))})]})})]})]})}function qR(e){if(e<=0)return"now";const t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4);return t>0?`${t}h ${n}m`:n>0?`${n}m`:`${Math.ceil(e/1e3)}s`}function ase(e){return e==="verified"?{text:"var(--accent-green)",bg:"var(--ok-soft)",dot:"var(--accent-green)"}:e==="unavailable"?{text:"var(--accent-red)",bg:"var(--danger-soft)",dot:"var(--accent-red)"}:{text:"var(--text-secondary)",bg:"var(--bg-hover)",dot:"var(--bg-hover)"}}function ise({rate:e}){const t=Math.round(e*100);return i.jsxs("span",{title:`โธ flaky mid-stream ${t}% โ€” started streaming, died before finish; the router deprioritizes flaky models (P4 M4.4)`,style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--purple-soft)",border:"1px solid var(--accent-purple)",color:"var(--accent-purple)"},children:["โธ flaky ",t,"%"]})}function sse({tokens:e}){const t=e>=1048576?`${(e/1048576).toFixed(1).replace(/\.0$/,"")}M`:e>=1024?`${(e/1024).toFixed(0)}K`:`${e}`;return i.jsxs("span",{title:`โณ context window ${mt(e)} tokens โ€” live from the provider's model list (v1.60.x); feeds the router's context preflight`,style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--info-soft)",border:"1px solid var(--accent-blue)",color:"var(--accent-blue)"},children:["โณ ",t]})}function ose({history:e}){if(!e||e.length<2)return null;const t=46,n=14,r=1.5,a=Math.max(.01,...e.map(d=>d.rate)),s=e.map((d,f)=>{const h=r+f/(e.length-1)*(t-r*2),p=n-r-d.rate/a*(n-r*2);return`${h.toFixed(1)},${p.toFixed(1)}`}).join(" "),o=e[0].rate,l=e[e.length-1].rate,c=l<o,u=Math.round(l*100);return i.jsxs("svg",{width:t,height:n,viewBox:`0 0 ${t} ${n}`,style:{marginLeft:8,verticalAlign:"middle",cursor:"default"},"aria-label":"Flakiness trend",children:[i.jsx("title",{children:c?`Flakiness healing โ€” ${u}% now, trending down (clean successes decay the signal)`:`Flakiness climbing โ€” ${u}% now (recent mid-stream interruptions)`}),i.jsx("polyline",{points:s,fill:"none",style:{stroke:"var(--accent-purple)"},strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",opacity:.9}),i.jsx("circle",{cx:t-r,cy:n-r-l/a*(n-r*2),r:2,style:{fill:c?"var(--accent-green)":"var(--accent-purple)"}})]})}function lse({entry:e}){const t=ase(e.status),n=e.remainingTokens>=0?`${mt(e.remainingTokens)} left`:"unlimited";return i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"8px 12px",color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:[i.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:t.dot,marginRight:8}}),e.model.length>32?e.model.slice(0,29)+"โ€ฆ":e.model,(e.partialRate??0)>0&&i.jsx(ise,{rate:e.partialRate??0}),e.partialHistory&&e.partialHistory.length>=2&&i.jsx(ose,{history:e.partialHistory}),e.parked&&i.jsx("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,background:"var(--danger-soft)",border:"1px solid var(--accent-red)",color:"var(--accent-red)"},children:"โธ parked"}),e.measuredSamples?i.jsxs("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--ok-soft)",border:"1px solid var(--accent-green)",color:"var(--accent-green)"},children:["๐Ÿ“ ",e.measuredInputTokens,"โ†’",e.measuredOutputTokens," tok"]}):i.jsx("span",{style:{marginLeft:8,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--bg-hover)",border:"1px solid var(--border-hover)",color:"var(--text-secondary)"},children:"๐Ÿ“ est"}),e.contextWindowTokens&&i.jsx(sse,{tokens:e.contextWindowTokens})]}),i.jsx("td",{style:{padding:"8px 12px"},children:i.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11,fontWeight:600,background:t.bg,color:t.text,padding:"2px 8px",borderRadius:6},children:e.status==="verified"?"โœ“ Verified":e.status==="unavailable"?"โœ— Unavailable":"โ—Œ Unverified"})}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:e.remainingTokens>=0&&e.remainingTokens<=100?"var(--accent-yellow)":"var(--text-secondary)"},children:n}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"var(--text-secondary)",fontSize:12,whiteSpace:"nowrap"},children:e.resetsInMs>0?qR(e.resetsInMs):"โ€”"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"var(--text-secondary)",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.latencyMs!==void 0?`${e.latencyMs}ms`:"โ€”"}),i.jsx("td",{style:{padding:"8px 12px",color:"var(--text-muted)",fontSize:11,maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.lastError||(e.source?`learned via ${e.source}`:"")})]})}function cse({provider:e}){const[t,n]=k.useState(!1),r=e.verified>0?"var(--accent-green)":e.unavailable>0?"var(--accent-red)":"var(--border-hover)";return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:`1px solid ${r}44`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[i.jsxs("div",{onClick:()=>n(!t),style:{padding:"14px 18px",cursor:"pointer",display:"flex",alignItems:"center",gap:14,userSelect:"none"},children:[i.jsx("span",{style:{fontSize:24},children:GR(e.provider)}),i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:2},children:[i.jsx("span",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)"},children:U0(e.provider)}),i.jsx("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:10,background:e.parked>0?"var(--danger-soft)":"var(--ok-soft)",border:`1px solid ${e.parked>0?"var(--accent-red)":"var(--accent-green)"}`,color:e.parked>0?"var(--accent-red)":"var(--accent-green)"},children:e.parked>0?`${e.parked} parked`:"routable"}),(e.flaky??0)>0&&i.jsxs("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:10,background:"var(--purple-soft)",border:"1px solid var(--accent-purple)",color:"var(--accent-purple)"},children:["โธ ",e.flaky," flaky"]})]}),i.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:[e.verified," verified ยท ",e.unverified," unverified ยท ",e.unavailable," unavailable"]})]}),i.jsx("span",{style:{color:"var(--text-secondary)",fontSize:18,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"โ–ถ"})]}),t&&i.jsx("div",{style:{overflowX:"auto",borderTop:"1px solid var(--border-light)"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Model"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Availability"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Tokens left"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Resets in"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"right",fontWeight:500},children:"Latency"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Reason / Source"})]})}),i.jsx("tbody",{children:e.models.map(a=>i.jsx(lse,{entry:a},a.model))})]})})]})}function use(e){if(!e)return null;const t=Object.entries(e.consecutive).filter(([,n])=>n>0);return t.length===0?null:i.jsxs("div",{style:{background:"color-mix(in srgb, var(--accent-yellow) 8%, transparent)",border:"1px solid var(--accent-yellow)",borderRadius:10,padding:"10px 14px",marginBottom:14,fontSize:12,color:"var(--accent-yellow)",display:"flex",gap:10,alignItems:"flex-start"},children:[i.jsx("span",{style:{fontSize:15,lineHeight:"18px"},children:"๐Ÿงน"}),i.jsxs("div",{children:[i.jsx("div",{style:{fontWeight:600,color:"var(--accent-yellow)",marginBottom:2},children:"Key hygiene in progress"}),i.jsx("div",{children:t.map(([n,r])=>i.jsxs("span",{style:{display:"inline-block",marginRight:12},children:[i.jsx("code",{style:{color:"var(--text-primary)"},children:n})," ",r,"/",e.threshold," consecutive auth failures",r>=e.threshold?" โ€” key auto-cleared ๐Ÿšซ":" โ€” key will be auto-cleared at the threshold"]},n))}),i.jsxs("div",{style:{marginTop:4,color:"var(--accent-yellow)"},children:["After ",e.threshold," consecutive 401/403s the invalid key is removed from config; run"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff config set providers.<provider>.apiKey <real-key>"})," to re-enable."]})]})]})}function dse({data:e}){return e.enabled?i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ“ฆ",title:"Model Availability Registry"}),i.jsxs("p",{className:"section-description",children:["The unified sub-ms FAISS/JSON snapshot the Auto router consults on every pick: verified vs unavailable models plus quota telemetry (tokens remaining, reset windows) mirrored from the ledger. Each row's ",i.jsx("strong",{children:"โณ chip"})," is the LIVE provider-advertised context window (v1.60.x) โ€” the real spec the router's context preflight uses, recorded by the probe from each provider's model list (Ollama /api/tags + /api/show, OpenRouter, Gemini, NIM). State changes during a session are reported to the watch daemon and recorded here immediately."]}),i.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"๐Ÿ“ฆ"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:e.total}),i.jsx("div",{className:"stat-label",children:"Tracked models"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"โœ…"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-green)"},children:e.verified}),i.jsx("div",{className:"stat-label",children:"Verified"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"โ—Œ"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--text-secondary)"},children:e.unverified}),i.jsx("div",{className:"stat-label",children:"Unverified"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"โ›”"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-red)"},children:e.unavailable}),i.jsx("div",{className:"stat-label",children:"Unavailable"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"โธ"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-yellow)"},children:e.parked}),i.jsx("div",{className:"stat-label",children:"Quota-parked"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"โธ"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-purple)"},children:e.flaky??0}),i.jsx("div",{className:"stat-label",children:"Flaky mid-stream"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"๐Ÿ—‘๏ธ"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--text-secondary)"},children:e.deletedLocal??0}),i.jsx("div",{className:"stat-label",children:"Deleted locally"})]})]})]}),use(e.keyHygiene),e.providers.map(t=>i.jsx(cse,{provider:t},t.provider)),i.jsx("div",{style:{textAlign:"center",fontSize:12,color:"var(--text-muted)",marginTop:12},children:"Backend snapshot ยท auto-refreshes every 60s"})]}):i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px dashed var(--border)",padding:"20px 24px",marginTop:24,textAlign:"center"},children:[i.jsx("div",{style:{fontSize:24,marginBottom:8},children:"๐Ÿ“ฆ"}),i.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Model Availability Registry"}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:["No registry data yet โ€” run ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff models refresh"})," or use Auto routing; the registry learns from real usage and probes."]})]})}const fse={chat:"๐Ÿ’ฌ",execute:"โš™๏ธ",plan:"๐Ÿ—บ๏ธ",edit:"โœ๏ธ",skill:"๐Ÿงฉ",learn:"๐Ÿ“š",ci:"๐Ÿ”",doctor:"๐Ÿฉบ",probe:"๐Ÿ”ญ","spot-check":"๐Ÿงช",telemetry:"๐Ÿ“ก",usage:"๐Ÿงฎ"};function hse(e){return{chat:"Chat",execute:"Execute",plan:"Plan",edit:"Edit",skill:"Skill",learn:"Learn",ci:"CI Review",doctor:"Doctor Probe",probe:"Probe","spot-check":"Spot-check",telemetry:"Usage mirror"}[e]||e.charAt(0).toUpperCase()+e.slice(1)}function pse(e){return fse[e]||"๐ŸŽฏ"}function mse(e){return e?new Date(e).toLocaleDateString()+" "+new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"โ€”"}function ts({provider:e,model:t,reason:n,killed:r,transient:a,partial:s,streamedChunks:o}){const l=r===!0,c=a===!0,u=s===!0,d=u?"var(--accent-purple)":c?"var(--accent-yellow)":l?"var(--accent-red)":"var(--accent-green)",f=u?"var(--purple-soft)":c?"var(--warn-soft)":l?"var(--danger-soft)":"var(--ok-soft)";return i.jsxs("span",{title:u?`Mid-stream interruption โ€” started streaming${typeof o=="number"?` ~${o} chunks in`:""}, died before finish (P4 M4.4); router deprioritizes flaky mid-stream providers${n?` ยท ${n}`:""}`:c?`Transient failure โ€” health decayed, no flip${n?` ยท ${n}`:""}`:l?`Killed by this action โ€” predictively skipped by routing${n?` ยท ${n}`:""}`:"Verified by this action โ€” trusted by routing",style:{display:"inline-flex",alignItems:"center",gap:6,background:f,border:`1px solid ${d}`,color:d,padding:"3px 9px",borderRadius:8,fontSize:11,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",transition:"transform 0.15s",cursor:"default"},onMouseEnter:h=>{h.currentTarget.style.transform="scale(1.05)"},onMouseLeave:h=>{h.currentTarget.style.transform="scale(1)"},children:[i.jsx("span",{style:{opacity:.85},children:u?"โธ":c?"~":l?"โœ—":"โœ“"}),e,"/",t.length>30?t.slice(0,27)+"โ€ฆ":t,(l||u)&&n&&i.jsxs("span",{style:{color:`${d}99`,fontSize:10,fontWeight:400},children:["ยท ",n]})]})}function gse(e){const t=new Map;for(const r of e)t.set(`${r.provider}|${r.model}|${r.outcome}`,r);const n={unavailable:0,partial:1,verified:2,error:3};return[...t.values()].sort((r,a)=>n[r.outcome]-n[a.outcome]||a.at-r.at)}function vse(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.verified+n.killed+n.transient+(n.partial||0)>0)return t}return Math.max(0,e.length-1)}function yse({timeline:e}){const[t,n]=k.useState(()=>vse(e||[])),[r,a]=k.useState(!1),s=k.useRef(null),o=k.useRef(!1),l=(e==null?void 0:e.length)??0,c=Math.max(0,Math.min(t,l-1));k.useEffect(()=>{n(m=>Math.min(m,Math.max(0,l-1)))},[l]);const u=k.useCallback(m=>{const y=s.current;if(!y||l<=0)return;const v=y.getBoundingClientRect(),b=v.width||1,w=Math.min(1,Math.max(0,(m-v.left)/b));n(Math.min(l-1,Math.floor(w*l)))},[l]),d=m=>{o.current=!0,a(!1),u(m.clientX)};if(k.useEffect(()=>{const m=v=>{o.current&&u(v.clientX)},y=()=>{o.current=!1};return window.addEventListener("pointermove",m),window.addEventListener("pointerup",y),()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",y)}},[u]),k.useEffect(()=>{if(!r||l<=1)return;const m=setInterval(()=>{n(y=>Math.min(l-1,y+1))},300);return()=>clearInterval(m)},[r,l]),k.useEffect(()=>{r&&l>1&&t>=l-1&&(a(!1),n(0))},[r,l,t]),!e||l===0)return null;const f=Math.max(1,...e.map(m=>m.verified+m.killed+m.transient+(m.partial||0))),h=m=>new Date(m).toLocaleDateString([],{month:"short",day:"numeric"}),p=e[c],g=p?gse(p.events||[]):[];return i.jsxs("div",{style:{marginTop:12,paddingTop:10,borderTop:"1px solid var(--border-light)"},children:[i.jsxs("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-secondary)",marginBottom:8,textTransform:"uppercase",letterSpacing:.4,display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[i.jsxs("span",{children:["๐Ÿ“ˆ Learned from real usage โ€” last ",l," days"]}),i.jsx("span",{style:{fontWeight:400,color:"var(--text-muted)",letterSpacing:0},children:"โ€” drag across days ยท click a day ยท play to sweep"})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[i.jsx("button",{onClick:()=>{r?a(!1):(t>=l-1&&n(0),a(!0))},disabled:l<=1,"aria-label":r?"Pause scrub":"Play scrub",style:{background:"var(--bg-hover)",border:`1px solid ${r?"var(--accent-red)":"var(--border)"}`,color:"var(--text-primary)",padding:"3px 10px",borderRadius:6,cursor:l<=1?"not-allowed":"pointer",fontSize:11,fontWeight:600,transition:"all 0.15s",whiteSpace:"nowrap",opacity:l<=1?.5:1},children:r?"โธ Pause":"โ–ถ Play"}),i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)",whiteSpace:"nowrap"},children:[h(p.day)," ยท โœ“ ",p.verified," ยท โœ— ",p.killed,p.transient>0?` ยท ~ ${p.transient}`:"",p.partial>0?` ยท โธ ${p.partial}`:""]}),i.jsx("input",{type:"range",min:0,max:Math.max(0,l-1),step:1,value:c,onChange:m=>{a(!1),n(Number(m.target.value))},"aria-label":"Scrub action timeline",style:{flex:1,accentColor:"var(--accent-blue)",cursor:"pointer",minWidth:80}})]}),i.jsx("div",{ref:s,onPointerDown:d,style:{position:"relative",display:"flex",alignItems:"flex-end",gap:3,height:64,padding:"0 2px",cursor:"grab",userSelect:"none",touchAction:"none"},children:e.map((m,y)=>{const v=m.verified+m.killed+m.transient+(m.partial||0),b=m.verified/f*56,w=m.killed/f*56,N=m.transient/f*56,S=(m.partial||0)/f*56,x=y===c;return i.jsxs("div",{onClick:()=>{a(!1),n(y)},title:`${h(m.day)} โ€” โœ“ ${m.verified} verified ยท โœ— ${m.killed} killed ยท ~ ${m.transient} transient${(m.partial||0)>0?` ยท โธ ${m.partial} partial`:""}`,style:{flex:1,display:"flex",flexDirection:"column-reverse",alignItems:"center",gap:0,cursor:"pointer"},children:[i.jsxs("div",{style:{position:"relative",width:"100%",borderRadius:3,overflow:x?"visible":"hidden",background:v===0?"var(--bg-hover)":"transparent",height:v===0?4:56,display:"flex",flexDirection:"column-reverse",boxShadow:x?"0 0 0 1.5px var(--accent-blue)":void 0,opacity:v===0?.5:1,transition:"box-shadow 0.15s"},children:[x&&i.jsx("div",{style:{position:"absolute",top:-3,bottom:-3,width:2,left:"50%",transform:"translateX(-50%)",background:"var(--accent-blue)",borderRadius:2,pointerEvents:"none",boxShadow:"0 0 8px color-mix(in srgb, var(--accent-blue) 53%, transparent)",zIndex:1}}),m.verified>0&&i.jsx("div",{style:{height:b,background:"var(--accent-green)",minHeight:3}}),m.killed>0&&i.jsx("div",{style:{height:w,background:"var(--accent-red)",minHeight:3}}),m.transient>0&&i.jsx("div",{style:{height:N,background:"var(--accent-yellow)",minHeight:3}}),m.partial>0&&i.jsx("div",{style:{height:S,background:"var(--accent-purple)",minHeight:3}})]}),i.jsx("div",{style:{fontSize:9,color:x?"var(--accent-blue)":"var(--text-muted)",marginTop:4,whiteSpace:"nowrap",fontWeight:x?700:400},children:h(m.day)})]},m.day)})}),i.jsxs("div",{style:{display:"flex",gap:14,marginTop:6,fontSize:11,color:"var(--text-secondary)"},children:[i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"โ– "})," verified"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-red)"},children:"โ– "})," killed"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"โ– "})," transient"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-purple)"},children:"โ– "})," partial"]})]}),i.jsxs("div",{style:{marginTop:10,background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:8,padding:"10px 12px"},children:[i.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)",marginBottom:6},children:[h(p.day)," ",i.jsx("span",{style:{color:"var(--text-secondary)",fontWeight:400},children:"โ€” what this action learned that day"})]}),g.length===0?i.jsx("div",{style:{fontSize:12,color:"var(--text-muted)"},children:"No learning recorded that day โ€” nothing verified, killed, or partial."}):i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:g.map(m=>m.outcome==="unavailable"?i.jsx(ts,{provider:m.provider,model:m.model,reason:m.errorType,killed:!0},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="verified"?i.jsx(ts,{provider:m.provider,model:m.model},`${m.provider}|${m.model}|${m.outcome}`):m.outcome==="partial"?i.jsx(ts,{provider:m.provider,model:m.model,reason:m.errorType,partial:!0,streamedChunks:m.streamedChunks},`${m.provider}|${m.model}|${m.outcome}`):i.jsx(ts,{provider:m.provider,model:m.model,reason:m.errorType,transient:!0},`${m.provider}|${m.model}|${m.outcome}`))})]})]})}function bse({entry:e}){var a,s;const[t,n]=k.useState(!0),r=(e.partial||0)>0?"var(--accent-purple)":e.killed>0?"var(--accent-red)":e.verified>0?"var(--accent-green)":"var(--accent-yellow)";return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:`1px solid ${r}33`,borderLeft:`4px solid ${r}`,marginBottom:12,overflow:"hidden"},children:[i.jsxs("div",{onClick:()=>n(!t),style:{padding:"12px 16px",cursor:"pointer",display:"flex",alignItems:"center",gap:12,userSelect:"none"},children:[i.jsx("span",{style:{fontSize:20},children:pse(e.action)}),i.jsxs("div",{style:{flex:1},children:[i.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",marginBottom:2},children:hse(e.action)}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",display:"flex",gap:14,flexWrap:"wrap"},children:[i.jsxs("span",{children:[i.jsxs("span",{style:{color:"var(--accent-green)"},children:["โœ“ ",e.verified]})," verified"]}),i.jsxs("span",{children:[i.jsxs("span",{style:{color:"var(--accent-red)"},children:["โœ— ",e.killed]})," killed"]}),e.transient>0&&i.jsxs("span",{children:[i.jsxs("span",{style:{color:"var(--accent-yellow)"},children:["~ ",e.transient]})," transient"]}),(e.partial||0)>0&&i.jsxs("span",{children:[i.jsxs("span",{style:{color:"var(--accent-purple)"},children:["โธ ",e.partial]})," partial"]})]})]}),i.jsx("span",{style:{color:"var(--text-secondary)",fontSize:16,transition:"transform 0.2s",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"โ–ถ"})]}),t&&i.jsxs("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--border-light)",background:"var(--bg-primary)"},children:[e.killedModels.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--accent-red)",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"โ›” Killed โ€” skipped predictively by routing"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:14},children:e.killedModels.map(o=>i.jsx(ts,{provider:o.provider,model:o.model,reason:o.reason,killed:!0},`${o.provider}|${o.model}`))})]}),e.verifiedModels.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--accent-green)",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"โœ… Verified โ€” trusted by routing"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.verifiedModels.map(o=>i.jsx(ts,{provider:o.provider,model:o.model},`${o.provider}|${o.model}`))})]}),(((a=e.partialModels)==null?void 0:a.length)||0)>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--accent-purple)",marginBottom:6,textTransform:"uppercase",letterSpacing:.4},children:"โธ Partial โ€” mid-stream interruption (flaky provider, deprioritized)"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:14},children:e.partialModels.map(o=>i.jsx(ts,{provider:o.provider,model:o.model,reason:o.reason,partial:!0,streamedChunks:o.streamedChunks},`${o.provider}|${o.model}`))})]}),e.killedModels.length===0&&e.verifiedModels.length===0&&(((s=e.partialModels)==null?void 0:s.length)||0)===0&&i.jsx("div",{style:{fontSize:12,color:"var(--text-muted)"},children:"Only transient failures โ€” health decayed, no model flipped."}),i.jsx(yse,{timeline:e.timeline})]})]})}function xse({registry:e}){const t=e.actionTelemetry;return t?t.enabled?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"๐ŸŽ“ Learned from real usage โ€” per action"}),i.jsxs("p",{className:"section-description",children:["Every LLM call writes through to the health store with its action tag. This panel shows which provider ร— model each action ",i.jsx("span",{style:{color:"var(--accent-green)"},children:"verified"})," (routable) or"," ",i.jsx("span",{style:{color:"var(--accent-red)"},children:"killed"})," (predictively skipped) โ€” the exact feed that turns โ€œfail gemini โ†’ fail nim โ†’ localโ€ into โ€œstraight to localโ€."]}),i.jsxs("div",{className:"stats-grid mini",style:{marginBottom:16},children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"๐Ÿ“Š"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:t.total}),i.jsx("div",{className:"stat-label",children:"Telemetry events"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"๐ŸŽฏ"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:t.actions.length}),i.jsx("div",{className:"stat-label",children:"Actions learning"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"โฑ๏ธ"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{fontSize:15},children:mse(t.updatedAt)}),i.jsx("div",{className:"stat-label",children:"Last update"})]})]}),t.synthetic>0&&i.jsxs("div",{className:"stat-card",title:"Written by a test process โ€” excluded from every number on this panel. The records remain in the hash-chained log.",children:[i.jsx("span",{className:"stat-icon",children:"๐Ÿงช"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-yellow)"},children:t.synthetic}),i.jsx("div",{className:"stat-label",children:"Test-origin, excluded"})]})]})]}),t.actions.map(n=>i.jsx(bse,{entry:n},n.action)),i.jsx("div",{style:{textAlign:"center",fontSize:12,color:"var(--text-muted)",marginTop:12},children:"All actions share one health store โ€” a provider killed by any action is skipped by all others"})]}):i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px dashed var(--border)",padding:"18px 24px",marginTop:24,textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,marginBottom:6},children:"๐ŸŽ“"}),i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Learned from real usage โ€” per action"}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)",lineHeight:1.5},children:["No per-action telemetry yet. As you use ",i.jsx("strong",{style:{color:"var(--text-secondary)"},children:"chat"}),","," ",i.jsx("strong",{style:{color:"var(--text-secondary)"},children:"execute"}),", ",i.jsx("strong",{style:{color:"var(--text-secondary)"},children:"plan"}),", and ",i.jsx("strong",{style:{color:"var(--text-secondary)"},children:"edit"}),", each action's verified / killed provider ร— model combos appear here โ€” showing exactly what routing learned from real usage."]})]}):null}function Bd({icon:e,title:t,count:n}){return n===0?null:i.jsxs("h3",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:"24px 0 12px 0",display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{children:e})," ",t,i.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)",fontWeight:400,background:"var(--bg-card)",padding:"1px 8px",borderRadius:8},children:n})]})}function wse({value:e,onChange:t,totalCount:n}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[i.jsxs("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"center",background:"var(--bg-card)",borderRadius:8,border:"1px solid var(--border)",transition:"border-color 0.2s"},children:[i.jsx("span",{style:{position:"absolute",left:12,fontSize:14,color:"var(--text-muted)",pointerEvents:"none"},children:"๐Ÿ”"}),i.jsx("input",{type:"text",value:e,onChange:r=>t(r.target.value),placeholder:"Search models by name or provider...",style:{width:"100%",padding:"10px 12px 10px 36px",background:"transparent",border:"none",color:"var(--text-primary)",fontSize:13,outline:"none",fontFamily:"inherit"},onFocus:r=>{r.currentTarget.parentElement.style.borderColor="var(--accent-blue)"},onBlur:r=>{r.currentTarget.parentElement.style.borderColor="var(--border)"}}),e&&i.jsx("button",{onClick:()=>t(""),style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",padding:"8px 12px",fontSize:14,lineHeight:1},children:"โœ•"})]}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",whiteSpace:"nowrap"},children:[n," model",n!==1?"s":""]})]})}function Sse({value:e,onChange:t}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--text-secondary)",marginBottom:14},children:[i.jsx("span",{children:"Columns:"}),Vie.map(n=>i.jsx("button",{onClick:()=>t(n),style:{padding:"4px 12px",borderRadius:6,background:e===n?"var(--accent-blue)":"var(--bg-hover)",color:e===n?"var(--text-on-accent)":"var(--text-secondary)",border:`1px solid ${e===n?"var(--accent-blue)":"var(--border)"}`,cursor:"pointer",fontSize:12,fontWeight:e===n?600:400,transition:"all 0.15s"},children:n},n))]})}function kse({model:e,provider:t}){const n=Dh[e.status],r=e.rateLimitRemaining!==void 0?e.rateLimitTotal?`${e.rateLimitRemaining} / ${e.rateLimitTotal}`:`${e.rateLimitRemaining} left`:"โ€”";return i.jsx("td",{style:{padding:10,verticalAlign:"top"},children:i.jsxs("div",{style:{background:n.cardBg,border:`1px solid ${n.cardBorder}44`,borderRadius:10,padding:14,display:"flex",flexDirection:"column",gap:8,height:"100%",transition:"all 0.2s ease",position:"relative",overflow:"hidden",cursor:"default"},onMouseEnter:a=>{a.currentTarget.style.borderColor=n.cardBorder,a.currentTarget.style.boxShadow=`0 2px 10px ${n.cardBorder}22`},onMouseLeave:a=>{a.currentTarget.style.borderColor=`${n.cardBorder}44`,a.currentTarget.style.boxShadow="none"},children:[i.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:3,background:n.cardBorder,opacity:.6}}),i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",paddingTop:2},children:e.name.length>28?e.name.slice(0,25)+"โ€ฆ":e.name}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:[GR(t)," ",U0(t)]}),i.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:5,background:n.bg,color:n.text,padding:"3px 8px",borderRadius:6,fontSize:11,fontWeight:600,alignSelf:"flex-start"},children:[i.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:n.dot}}),e.status==="available"?"Available":e.status==="limited"?"Limited":"Unavailable"]}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)"},children:[i.jsx("span",{style:{color:"var(--text-secondary)"},children:"Tokens:"})," ",i.jsx("span",{style:{color:e.rateLimitRemaining!==void 0&&e.rateLimitRemaining<=10?"var(--accent-yellow)":"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace",fontWeight:500},children:r})]}),e.routable===!1&&i.jsx("div",{style:{fontSize:10,color:"var(--accent-yellow)",lineHeight:1.3,marginTop:2},children:e.registryStatus==="unavailable"?e.registryDead?"โœ— Not served here โ€” this id does not exist on the endpoint":"โœ— Your key cannot use this model (auth / entitlement / access)":e.registryStatus==="verified"?"โ—Œ Parked or gone stale โ€” not routable now":e.registryStatus==="unverified"?"โ—Œ Listed but never verified โ€” the router cannot pick it":"โ—Œ Not in the registry โ€” never probed"}),e.routable===!1&&e.registryError&&i.jsx("div",{style:{fontSize:10,color:"var(--text-muted)",lineHeight:1.3,marginTop:1},children:e.registryError.length>60?e.registryError.slice(0,57)+"โ€ฆ":e.registryError}),e.entitlement&&e.entitlement.tier!=="unknown"&&i.jsx("div",{title:e.entitlement.basis,style:{fontSize:10,lineHeight:1.3,marginTop:2,color:e.entitlement.tier==="free"?"var(--accent-green)":"var(--text-secondary)"},children:e.entitlement.tier==="free"?"๐ŸŽ free":"๐Ÿ’ธ metered"}),e.status!=="available"&&e.statusReason&&i.jsx("div",{style:{fontSize:10,color:"var(--text-muted)",lineHeight:1.3,marginTop:2},children:e.statusReason.length>45?e.statusReason.slice(0,42)+"โ€ฆ":e.statusReason}),e.parked&&e.resetsInMs!==void 0&&e.resetsInMs>0&&i.jsxs("div",{style:{fontSize:10,color:"var(--accent-yellow)",lineHeight:1.3,marginTop:4,padding:"3px 6px",borderRadius:4,background:"var(--warn-soft)",border:"1px solid color-mix(in srgb, var(--accent-yellow) 27%, transparent)"},children:["โณ Resets in ",qR(e.resetsInMs)]})]})})}function Nse({providers:e,colsPerRow:t,searchQuery:n}){const r=[];for(const l of e)for(const c of l.models)r.push({model:c,provider:l.provider});if(r.length===0)return null;let a=r;if(n.trim()){const l=n.toLowerCase().trim();a=r.filter(({model:c,provider:u})=>c.name.toLowerCase().includes(l)||U0(u).toLowerCase().includes(l)||u.toLowerCase().includes(l))}const s={available:0,limited:1,unavailable:2};a.sort((l,c)=>s[l.model.status]-s[c.model.status]);const o=[];for(let l=0;l<a.length;l+=t)o.push(a.slice(l,l+t));return i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ“‹ Model Health Overview"}),i.jsx("p",{className:"section-description",children:"All models across all providers, color-coded by health status. Each cell shows: Model ยท Provider ยท Health ยท Token Remaining."}),i.jsx("div",{style:{overflowX:"auto"},children:i.jsx("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:10,tableLayout:"fixed"},children:i.jsx("tbody",{children:o.length>0?o.map((l,c)=>i.jsxs("tr",{children:[l.map(({model:u,provider:d})=>i.jsx(kse,{model:u,provider:d},`${d}-${u.id}`)),l.length<t&&Array.from({length:t-l.length}).map((u,d)=>i.jsx("td",{style:{padding:10}},`empty-${d}`))]},c)):i.jsx("tr",{children:i.jsxs("td",{colSpan:t,style:{textAlign:"center",padding:40,color:"var(--text-muted)",fontSize:13},children:['No models match your search "',n,'"']})})})})}),n.trim()&&a.length>0&&i.jsxs("div",{style:{textAlign:"right",fontSize:11,color:"var(--text-muted)",marginTop:4},children:["Showing ",a.length," of ",r.length," models"]})]})}function Ese(){return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px dashed var(--border)",padding:"20px 24px",marginTop:24,textAlign:"center"},children:[i.jsx("div",{style:{fontSize:24,marginBottom:8},children:"๐ŸŽ™๏ธ"}),i.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Speech / TTS Provider"}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:["Speech/TTS provider support coming soon."," ",i.jsx("a",{href:"https://github.com/imdheerajKube/agent-nuvira-documentation/issues/new",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-blue)",textDecoration:"none",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.textDecoration="underline"},onMouseLeave:e=>{e.currentTarget.style.textDecoration="none"},children:"Request a provider"})]})]})}function jse(){return i.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:10,padding:14,marginBottom:20,border:"1px solid var(--border-light)",fontSize:13,color:"var(--text-secondary)",display:"flex",flexWrap:"wrap",gap:20},children:[i.jsxs("div",{children:[i.jsx("div",{style:{fontWeight:600,color:"var(--text-primary)",marginBottom:6},children:"Color Coding"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"โ—"})," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Green"})," โ€” Working with rate limit available"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"โ—"})," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Amber"})," โ€” Slow / low rate limit / needs action"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-red)"},children:"โ—"})," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Red"})," โ€” API key missing / payment needed / unreachable"]})]})]}),i.jsxs("div",{children:[i.jsx("div",{style:{fontWeight:600,color:"var(--text-primary)",marginBottom:6},children:"Provider Sections"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:3,fontSize:12},children:[i.jsxs("span",{children:["โœ… ",i.jsx("strong",{children:"Cloud"})," โ€” Online providers with active API keys"]}),i.jsxs("span",{children:["๐Ÿ  ",i.jsx("strong",{children:"Local"})," โ€” Locally running inference servers"]}),i.jsxs("span",{children:["โ›” ",i.jsx("strong",{children:"Unavailable"})," โ€” Missing keys or unreachable endpoints"]}),i.jsxs("span",{children:["๐ŸŽ™๏ธ ",i.jsx("strong",{children:"Speech"})," โ€” Text-to-speech / speech-to-text providers (coming)"]})]})]})]})}function _se(){const[e,t]=k.useState(null),[n,r]=k.useState(null),[a,s]=k.useState(!0),[o,l]=k.useState(null),[c,u]=k.useState(4),[d,f]=k.useState(""),h=k.useRef(!0),p=k.useRef(null),g=k.useRef(!1);function m(){p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{h.current&&y()},Xie)}async function y(){s(!0),l(null),g.current=!1;try{const[b,w]=await Promise.all([Qie(()=>{g.current=!0}),Jie(()=>{g.current=!0})]);if(!h.current)return;t(b),r(w),g.current&&m()}catch(b){if(!h.current)return;l(b instanceof Error&&b.message?b.message:"Failed to fetch model status"),g.current&&m()}finally{h.current&&s(!1)}}k.useEffect(()=>{h.current=!0,y();const b=setInterval(y,Yie);return()=>{h.current=!1,clearInterval(b),p.current&&clearTimeout(p.current)}},[]);function v(b){const w=[],N=[],S=[],x=[],E={available:0,limited:1,unavailable:2};for(const j of b.providers)Kie.has(j.provider)?S.push(j):qie.has(j.provider)?N.push(j):j.overallStatus==="available"?w.push(j):x.push(j);return w.sort((j,C)=>E[j.overallStatus]-E[C.overallStatus]),N.sort((j,C)=>E[j.overallStatus]-E[C.overallStatus]),S.sort((j,C)=>E[j.overallStatus]-E[C.overallStatus]),x.sort((j,C)=>E[j.overallStatus]-E[C.overallStatus]),{available:w,local:N,speech:S,unavailable:x}}return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿง ",title:"Model Provider Status",description:"Real-time health check of all AI providers and their available models. Providers are grouped into sections: Available cloud โ†’ Local โ†’ Unavailable."}),i.jsx(nse,{onRefresh:y,loading:a}),i.jsx(jse,{}),a&&!e&&i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Testing all 17 provider connections..."})]}),o&&i.jsxs("div",{className:"empty-state",style:{color:"var(--accent-red)",border:"1px solid color-mix(in srgb, var(--accent-red) 27%, transparent)",borderRadius:10,padding:16,marginBottom:16},children:["โš ๏ธ ",o]}),e&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"๐Ÿง "}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:e.totalModels}),i.jsx("div",{className:"stat-label",children:"Total Models"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"โœ…"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-green)"},children:e.available}),i.jsx("div",{className:"stat-label",children:"Available"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"๐ŸŸก"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-yellow)"},children:e.limited}),i.jsx("div",{className:"stat-label",children:"Limited"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"๐Ÿ”ด"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-red)"},children:e.unavailable}),i.jsx("div",{className:"stat-label",children:"Unavailable"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"๐Ÿ”Œ"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:e.providers.length}),i.jsx("div",{className:"stat-label",children:"Providers"})]})]})]}),i.jsx(rse,{data:e}),(()=>{const{available:b,local:w,speech:N,unavailable:S}=v(e);return i.jsxs(i.Fragment,{children:[i.jsx(Bd,{icon:"โœ…",title:"Available Cloud Providers",count:b.length}),b.map(x=>i.jsx(Dd,{provider:x},x.provider)),i.jsx(Bd,{icon:"๐Ÿ ",title:"Local Providers",count:w.length}),w.map(x=>i.jsx(Dd,{provider:x},x.provider)),i.jsx(Bd,{icon:"โ›”",title:"Unavailable Providers",count:S.length}),S.map(x=>i.jsx(Dd,{provider:x},x.provider)),i.jsx(Bd,{icon:"๐ŸŽ™๏ธ",title:"Speech / TTS Providers",count:N.length}),N.map(x=>i.jsx(Dd,{provider:x},x.provider))]})})(),i.jsx(wse,{value:d,onChange:f,totalCount:e.providers.reduce((b,w)=>b+w.models.length,0)}),i.jsx(Sse,{value:c,onChange:u}),i.jsx(Nse,{providers:e.providers,colsPerRow:c,searchQuery:d}),n&&i.jsx(dse,{data:n}),n&&i.jsx(xse,{registry:n}),e&&!n&&i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px dashed var(--border)",padding:"14px 20px",marginTop:24,fontSize:12,color:"var(--text-secondary)",lineHeight:1.6},children:["๐Ÿ“ฆ Registry & telemetry sections are hidden โ€” this dashboard server did not return model-registry data (it may be an"," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"older version"}),"). Restart the dashboard from the latest install to see them."]}),i.jsx(Ese,{}),i.jsxs("div",{style:{textAlign:"center",fontSize:12,color:"var(--text-muted)",marginTop:16},children:["Last checked: ",new Date(e.lastChecked).toLocaleTimeString()," ยท ","Auto-refreshes every 60s"]})]})]})}const Ase={local:"๐Ÿ’ป",groq:"๐ŸŸข",nim:"๐Ÿ”ถ",gemini:"๐Ÿ”ท",openrouter:"๐ŸŸฃ"},Cse={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},Tse={trivial:"๐ŸŸข",simple:"๐Ÿ”ต",moderate:"๐ŸŸก",complex:"๐ŸŸ ",critical:"๐Ÿ”ด"},KR={trivial:"๐ŸŸข trivial",simple:"๐Ÿ”ต simple",moderate:"๐ŸŸก moderate",complex:"๐ŸŸ  complex",critical:"๐Ÿ”ด critical"},Ose={chat:"๐Ÿ’ฌ chat",orchestrator:"๐Ÿ”€ orchestrator",explain:"๐Ÿ” explain",benchmark:"๐Ÿ“ˆ benchmark",eval:"๐ŸŽฏ eval"},$i=[{key:"request",icon:"๐ŸŽฏ",title:"Request"},{key:"candidates",icon:"โš–๏ธ",title:"Candidates"},{key:"exclusions",icon:"๐Ÿšซ",title:"Exclusions"},{key:"pick",icon:"โœ…",title:"Pick"}],Pse=2400;function _g(e){return Ase[e]||"๐Ÿ”Œ"}function qE(e){return Cse[e]||e}function W0(e){return e&&Ose[e]||e||"unknown"}function Rse(e){const t=Date.now()-e;return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}function KE(e){const t=Math.ceil(e/6e4);return t>=60?`${Math.floor(t/60)}h ${t%60}m`:`${t}m`}const Mse=8;function VE(e,t){const n=t.quota,r=n==null?void 0:n.entries.find(s=>s.provider===e);return r!=null&&r.parked?r.resetsInMs>0?`quota exhausted โ€” auto re-enables in ${KE(r.resetsInMs)}`:"quota exhausted โ€” parked":r&&r.cooldownRemaining>0?`circuit-breaker cooldown โ€” ${KE(r.cooldownRemaining)} remaining`:t.providers.some(s=>s.provider===e)?"ranked below the candidate cutoff for this complexity":"not scored for this complexity (no benchmark quality data)"}function Ise(e){var s,o,l;const t=new Set;for(const c of e.providers)t.add(c.provider);if(e.usage)for(const c of Object.keys(e.usage.byProvider))t.add(c);if(e.bestModels)for(const c of e.bestModels)t.add(c.model.split("/")[0]);if(e.quota)for(const c of e.quota.entries)t.add(c.provider);const n=new Map(e.preference.map(c=>[c.complexity,c])),r=[],a=[...e.history??[]].sort((c,u)=>(u.timestamp??0)-(c.timestamp??0));for(const c of a.slice(0,Mse)){const u=n.get(c.complexity),d=(s=u==null?void 0:u.providers)!=null&&s.length?u.providers.map(g=>({provider:g.provider,score:g.score,reason:g.reason})):[{provider:c.provider,score:c.score,reason:"actual pick recorded"}];d.some(g=>g.provider===c.provider)||d.push({provider:c.provider,score:c.score,reason:"actual pick recorded"});const f=new Set(d.map(g=>g.provider)),h=[...t].filter(g=>!f.has(g)).map(g=>({provider:g,reason:VE(g,e)})),p=(o=d.find(g=>g.provider===c.provider))==null?void 0:o.reason;r.push({id:c.id,label:`${W0(c.source)} ยท ${c.complexity} ยท ${(c.task||c.agentType).slice(0,26)}`,real:!0,complexity:c.complexity,task:c.task||c.agentType,agentType:c.agentType,source:c.source,timestamp:c.timestamp,winner:`${c.provider}/${c.model}`,winnerScore:c.score,winnerReason:p,candidates:d,exclusions:h})}if(r.length===0)for(const c of e.preference){const u=c.winner.split("/"),d=c.providers.map(g=>({provider:g.provider,score:g.score,reason:g.reason})),f=new Set(d.map(g=>g.provider)),h=[...t].filter(g=>!f.has(g)).map(g=>({provider:g,reason:VE(g,e)})),p=u[0];r.push({id:`profile-${c.complexity}`,label:`${KR[c.complexity]||c.complexity} โ€” what the router would pick`,real:!1,complexity:c.complexity,task:p?`A ${c.complexity} task (auto-routed)`:`A ${c.complexity} task`,agentType:"chat",winner:c.winner,winnerScore:c.score,winnerReason:(l=d.find(g=>g.provider===p))==null?void 0:l.reason,candidates:d,exclusions:h})}return r}function $se(e,t){switch(e){case"request":return`A ${t.complexity} task arrives${t.source?` from ${W0(t.source)}`:""} and must be routed.`;case"candidates":return`${t.candidates.length} provider${t.candidates.length!==1?"s":""} are scored against the ${t.complexity} weight profile.`;case"exclusions":return t.exclusions.length>0?`${t.exclusions.length} provider${t.exclusions.length!==1?"s":""} known to the system are skipped before scoring.`:"Every known provider was scored โ€” nothing was skipped.";case"pick":return t.winnerReason?`The top score wins: ${t.winner.split("/")[0]} ranked first โ€” ${t.winnerReason}.`:`The top score wins: ${t.winner}.`}}function Lse({value:e,color:t}){const n=Math.min(100,Math.max(0,e*100));return i.jsx("div",{style:{flex:1,background:"var(--bg-primary)",borderRadius:4,height:6,overflow:"hidden",border:"1px solid var(--border-light)"},children:i.jsx("div",{style:{width:`${n}%`,background:t,height:"100%",transition:"width 0.4s ease"}})})}function Dse({icon:e,title:t,narration:n}){return i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10,marginBottom:14},children:[i.jsx("span",{style:{fontSize:20,lineHeight:"24px"},children:e}),i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:t}),i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:2},children:n})]})]})}function Bse({routing:e}){const t=k.useMemo(()=>Ise(e),[e]),[n,r]=k.useState(""),[a,s]=k.useState(0),[o,l]=k.useState(!1);if(k.useEffect(()=>{t.length!==0&&(t.some(p=>p.id===n)||(r(t[0].id),s(0)))},[t,n]),k.useEffect(()=>{if(!o||t.length===0)return;const p=setInterval(()=>{s(g=>(g+1)%$i.length)},Pse);return()=>clearInterval(p)},[o,t.length]),t.length===0)return null;const c=t.find(p=>p.id===n)??t[0],u=$i[a],d=()=>{s(p=>(p+$i.length-1)%$i.length),l(!1)},f=()=>{s(p=>(p+1)%$i.length),l(!1)},h=()=>l(p=>!p);return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px solid var(--border-light)",padding:"18px 20px",marginBottom:16},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[i.jsx("span",{style:{fontSize:20},children:"๐ŸŽฌ"}),i.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:0},children:"Why did the router pick this?"}),c.real&&i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--ok-soft)",border:"1px solid var(--accent-green)",color:"var(--accent-green)"},children:"โœ“ real decision"})]}),i.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",margin:"2px 0 12px 0"},children:"Narrated step-by-step replay of a routing decision โ€” request, candidates, exclusions, and the pick. Scrubbable, or hit play."}),i.jsx("select",{"aria-label":"Routing decision to replay",value:n,onChange:p=>{r(p.target.value),s(0),l(!1)},style:{width:"100%",marginBottom:16,padding:"8px 10px",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:12,border:"1px solid var(--border)",borderRadius:8,outline:"none"},children:t.map(p=>i.jsxs("option",{value:p.id,style:{background:"var(--bg-primary)",color:"var(--text-primary)"},children:[p.real?"โ— ":"โ—‹ ",p.label]},p.id))}),i.jsx(Dse,{icon:u.icon,title:`${a+1}. ${u.title}${a>0?` โ€” ${c.complexity}`:""}`,narration:$se(u.key,c)}),u.key==="request"&&i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"14px 16px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",marginBottom:8},children:[i.jsxs("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"var(--bg-card)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:[Tse[c.complexity]||"โ€ข"," ",KR[c.complexity]||c.complexity]}),i.jsxs("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"var(--bg-card)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["๐Ÿค– ",c.agentType]}),c.source&&i.jsx("span",{style:{fontSize:12,padding:"2px 10px",borderRadius:12,background:"var(--bg-card)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:W0(c.source)}),c.timestamp&&i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",marginLeft:"auto"},children:Rse(c.timestamp)})]}),i.jsx("div",{style:{fontSize:13,color:"var(--text-primary)"},children:c.task})]}),u.key==="candidates"&&i.jsxs("div",{children:[c.candidates.map((p,g)=>{const m=p.provider===c.winner.split("/")[0];return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",background:m?"var(--ok-soft)":"var(--bg-primary)",border:`1px solid ${m?"var(--accent-green)":"var(--border-light)"}`,borderRadius:8,marginBottom:6},children:[i.jsxs("span",{style:{width:18,fontSize:11,color:"var(--text-muted)",textAlign:"right"},children:[g+1,"."]}),i.jsxs("span",{style:{width:104,color:m?"var(--accent-green)":"var(--text-primary)",fontWeight:m?600:400,whiteSpace:"nowrap",fontSize:12},children:[_g(p.provider)," ",qE(p.provider).split(" ")[0],m&&" ๐Ÿ‘‘"]}),i.jsx(Lse,{value:p.score,color:m?"var(--accent-green)":"var(--accent-blue)"}),i.jsx("span",{style:{width:44,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},children:p.score.toFixed(3)})]},p.provider)}),c.candidates.length>0&&i.jsxs("div",{style:{marginTop:10},children:[i.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",marginBottom:4},children:"Why each ranked where it did"}),c.candidates.map(p=>i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:3},children:[i.jsx("span",{style:{color:"var(--text-primary)"},children:p.provider}),": ",p.reason||"scored"]},p.provider))]})]}),u.key==="exclusions"&&(c.exclusions.length>0?i.jsx("div",{children:c.exclusions.map(p=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:8,marginBottom:6},children:[i.jsx("span",{style:{fontSize:13},children:"๐Ÿšซ"}),i.jsxs("span",{style:{width:110,color:"var(--text-primary)",whiteSpace:"nowrap",fontSize:12},children:[_g(p.provider)," ",qE(p.provider).split(" ")[0]]}),i.jsx("span",{style:{flex:1,fontSize:12,color:"var(--text-secondary)"},children:p.reason})]},p.provider))}):i.jsx("div",{style:{background:"var(--bg-primary)",border:"1px dashed var(--border)",borderRadius:10,padding:"14px 16px",color:"var(--text-secondary)",fontSize:13},children:"โœ… No exclusions โ€” every provider known to the system was scored for this decision."})),u.key==="pick"&&i.jsxs("div",{style:{background:"var(--ok-soft)",border:"1px solid var(--accent-green)",borderRadius:10,padding:"16px 18px"},children:[i.jsx("div",{style:{fontSize:12,color:"var(--accent-green)",fontWeight:600,marginBottom:6},children:"๐Ÿ† ROUTER PICK"}),i.jsxs("div",{style:{fontSize:16,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",marginBottom:4},children:[_g(c.winner.split("/")[0])," ",c.winner]}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:10},children:["composite score ",i.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--accent-green)"},children:c.winnerScore.toFixed(3)}),!c.real&&" ยท profile preview"]}),c.winnerReason&&i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",borderTop:"1px solid color-mix(in srgb, var(--accent-green) 33%, transparent)",paddingTop:8},children:[i.jsx("span",{style:{color:"var(--text-primary)"},children:"Why:"})," ",c.winnerReason]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:16},children:[i.jsx("button",{onClick:d,"aria-label":"Previous step",style:Ag,children:"โ—€"}),i.jsx("button",{onClick:h,"aria-label":o?"Pause playback":"Play playback",style:{...Ag,minWidth:84,color:o?"var(--accent-yellow)":"var(--accent-green)"},children:o?"โธ Pause":"โ–ถ Play"}),i.jsx("button",{onClick:f,"aria-label":"Next step",style:Ag,children:"โ–ถ"}),i.jsx("div",{style:{display:"flex",gap:6,marginLeft:8},children:$i.map((p,g)=>i.jsx("button",{"aria-label":`Go to step ${g+1}: ${p.title}`,onClick:()=>{s(g),l(!1)},style:{width:22,height:22,borderRadius:11,border:"none",cursor:"pointer",fontSize:10,lineHeight:"22px",padding:0,background:g===a?"var(--accent-blue)":"var(--bg-hover)",color:g===a?"var(--bg-primary)":"var(--text-secondary)"},title:p.title,children:p.icon},p.key))}),i.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--text-muted)"},children:["step ",a+1,"/",$i.length]})]})]})}const Ag={background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:8,padding:"6px 12px",fontSize:13,cursor:"pointer",transition:"background 0.15s"},zse={local:"๐Ÿ’ป",groq:"๐ŸŸข",nim:"๐Ÿ”ถ",gemini:"๐Ÿ”ท",openrouter:"๐ŸŸฃ"},Fse={local:"Ollama (Local)",groq:"Groq",nim:"NVIDIA NIM",gemini:"Gemini",openrouter:"OpenRouter"},VR={trivial:"๐ŸŸข",simple:"๐Ÿ”ต",moderate:"๐ŸŸก",complex:"๐ŸŸ ",critical:"๐Ÿ”ด"};function zr(e){return zse[e]||"๐Ÿ”Œ"}function mi(e){return Fse[e]||e}function Bh(e,t=1){return`${(e*100).toFixed(t)}%`}function Use(e){return`$${e.toFixed(6)}`}function ir({icon:e,title:t,subtitle:n,children:r}){return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px solid var(--border-light)",padding:"18px 20px",marginBottom:16},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[i.jsx("span",{style:{fontSize:20},children:e}),i.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:0},children:t})]}),n&&i.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",margin:"2px 0 12px 0"},children:n}),!n&&i.jsx("div",{style:{height:6}}),r]})}function H0({value:e,color:t}){const n=Math.min(100,Math.max(0,e*100));return i.jsx("div",{style:{flex:1,background:"var(--bg-primary)",borderRadius:4,height:6,overflow:"hidden",border:"1px solid var(--border-light)"},children:i.jsx("div",{style:{width:`${n}%`,background:t,height:"100%",transition:"width 0.4s ease"}})})}function go(e,t,n="var(--text-secondary)"){return{fontSize:10,padding:"1px 7px",borderRadius:9,background:e,border:`1px solid ${t}`,color:n,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap"}}function Wse(){return i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px dashed var(--border)",borderRadius:10,padding:"18px 20px",color:"var(--text-secondary)",fontSize:13,textAlign:"center"},children:["๐Ÿ“Š No routing data yet โ€” run ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff benchmark"})," to populate provider quality scores, or use Auto routing (",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff model switch auto"}),") to build per-agent best-model stats over time."]})}const Hse={chat:"๐Ÿ’ฌ chat",orchestrator:"๐Ÿ”€ orchestrator",explain:"๐Ÿ” explain",benchmark:"๐Ÿ“ˆ benchmark",eval:"๐ŸŽฏ eval"},Gse={trivial:"๐ŸŸข trivial",simple:"๐Ÿ”ต simple",moderate:"๐ŸŸก moderate",complex:"๐ŸŸ  complex",critical:"๐Ÿ”ด critical"};function YR(e){return Hse[e]||e}function XR(e){const t=Date.now()-e;return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}function YE(e){if(e<=0)return"now";const t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4);return t>0?`${t}h ${n}m`:n>0?`${n}m`:`${Math.ceil(e/1e3)}s`}function qse({label:e,value:t,total:n,color:r}){const a=n>0?t/n*100:0;return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[i.jsx("span",{style:{width:110,color:"var(--text-primary)",whiteSpace:"nowrap",fontSize:12},children:e}),i.jsx("div",{style:{flex:1,background:"var(--bg-primary)",borderRadius:4,height:6,overflow:"hidden",border:"1px solid var(--border-light)"},children:i.jsx("div",{style:{width:`${Math.min(100,a)}%`,background:r,height:"100%",transition:"width 0.4s ease"}})}),i.jsx("span",{style:{width:34,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},children:t})]})}function Kse({usage:e}){if(!e.total)return null;const t=e.total,n=Object.entries(e.byProvider).sort((a,s)=>s[1]-a[1]).slice(0,6),r=Object.entries(e.byModel).sort((a,s)=>s[1]-a[1]).slice(0,5);return i.jsxs(ir,{icon:"๐Ÿงฎ",title:"Routing Usage โ€” actual picks over time",subtitle:"Recorded from live chat, orchestrator runs, explain snapshots, benchmark --routing, and eval --routing",children:[i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.total}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"total decisions"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:e.last24h>0?"var(--accent-green)":"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.last24h}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"last 24h"})]})]}),i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:"By provider"}),n.map(([a,s])=>i.jsx(qse,{label:`${zr(a)} ${mi(a).split(" ")[0]}`,value:s,total:t,color:"var(--accent-blue)"},a)),Object.keys(e.bySource).length>0&&i.jsx("div",{style:{marginTop:12,display:"flex",gap:6,flexWrap:"wrap"},children:Object.entries(e.bySource).sort((a,s)=>s[1]-a[1]).map(([a,s])=>i.jsxs("span",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:20,padding:"3px 10px",fontSize:11,color:"var(--text-primary)"},children:[YR(a)," ยท ",s]},a))}),r.length>0&&i.jsxs("div",{style:{marginTop:14},children:[i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:"Most-picked models"}),r.map(([a,s])=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[i.jsx("span",{style:{flex:1,color:"var(--text-primary)",fontSize:12,fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:a,children:a.length>42?a.slice(0,39)+"โ€ฆ":a}),i.jsx("span",{style:{width:34,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},children:s})]},a))]})]})}function Vse({history:e}){return e.length?i.jsx(ir,{icon:"๐Ÿ•“",title:"Audit Trail โ€” routing decision timeline",subtitle:"Every explain snapshot (and routing-mode pick) persisted for transparency",children:i.jsx("div",{style:{maxHeight:320,overflowY:"auto",paddingRight:4},children:e.map(t=>i.jsxs("div",{style:{display:"flex",gap:10,padding:"8px 4px",borderBottom:"1px solid var(--border-light)"},children:[i.jsx("div",{style:{width:52,flexShrink:0,fontSize:11,color:"var(--text-muted)",paddingTop:2},children:XR(t.timestamp)}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:YR(t.source)}),i.jsxs("span",{style:{fontSize:12,fontWeight:600,color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:`${t.provider}/${t.model}`,children:[zr(t.provider)," ",t.provider,"/",t.model.length>26?t.model.slice(0,23)+"โ€ฆ":t.model]}),t.complexity&&i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)"},children:Gse[t.complexity]||t.complexity})]}),i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.task,children:t.task||t.agentType})]})]},t.id))})}):null}function Yse({routing:e}){return e.preference.length?i.jsx(ir,{icon:"๐Ÿค–",title:"Auto Router โ€” What the agent would pick",subtitle:"Complexity-weighted scoring across reasoning, speed, cost, privacy, and reliability (real provider pricing)",children:i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Complexity"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Winner"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Score"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"All providers"})]})}),i.jsx("tbody",{children:e.preference.map(t=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"10px 12px",color:"var(--text-primary)",whiteSpace:"nowrap"},children:[VR[t.complexity]||"โ€ข"," ",t.complexity]}),i.jsx("td",{style:{padding:"10px 12px",whiteSpace:"nowrap"},children:i.jsxs("span",{style:{color:"var(--accent-green)",fontWeight:600},children:[zr(t.winner.split("/")[0])," ",t.winner]})}),i.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--text-secondary)"},children:t.score.toFixed(3)}),i.jsx("td",{style:{padding:"10px 12px",minWidth:300},children:t.providers.map((n,r)=>i.jsxs("div",{style:{marginBottom:5},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsxs("span",{style:{width:16,fontSize:11,color:"var(--text-muted)",textAlign:"right"},children:[r+1,"."]}),i.jsxs("span",{style:{width:90,color:"var(--text-primary)",whiteSpace:"nowrap",fontSize:12},children:[zr(n.provider)," ",mi(n.provider).split(" ")[0]]}),i.jsx(H0,{value:n.score,color:r===0?"var(--accent-green)":"var(--accent-blue)"}),i.jsx("span",{style:{width:40,textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},children:n.score.toFixed(2)})]}),(n.capabilityFit!==void 0||n.costSource||n.contextUtilization!==void 0)&&i.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingLeft:16,marginTop:2},children:[n.capabilityFit!==void 0&&i.jsxs("span",{style:go("var(--bg-tertiary)","var(--border-hover)"),children:["๐ŸŽฏ fit ",n.capabilityFit,"%"]}),n.costSource==="measured"&&n.costBasis?i.jsxs("span",{style:go("var(--ok-soft)","var(--accent-green)","var(--accent-green)"),children:["๐Ÿ“ measured ",mt(n.costBasis.inputTokens),"โ†’",mt(n.costBasis.outputTokens)," tok"]}):i.jsx("span",{style:go("var(--bg-tertiary)","var(--border-hover)"),children:"๐Ÿ“ estimated"}),n.contextUtilization!==void 0&&n.contextWindowTokens!==void 0&&i.jsxs("span",{style:go("var(--bg-tertiary)","var(--accent-blue)","var(--accent-blue)"),children:["โณ ctx ",n.contextUtilization,"% (",mt(n.contextWindowTokens)," tok)"]})]})]},n.provider))})]},t.complexity))})]})})}):null}function Xse({routing:e}){return e.providers.length?i.jsx(ir,{icon:"๐Ÿ“ˆ",title:"Provider Benchmark Quality",subtitle:"Measured from your own `buff benchmark` runs โ€” blended into Auto routing decisions",children:i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Provider"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Runs"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Avg Quality"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Pass Rate"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontWeight:500},children:"Total Cost"})]})}),i.jsx("tbody",{children:e.providers.map(t=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"10px 12px",color:"var(--text-primary)",whiteSpace:"nowrap"},children:[zr(t.provider)," ",mi(t.provider)]}),i.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)"},children:t.runs}),i.jsx("td",{style:{padding:"10px 12px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx(H0,{value:t.avgQuality,color:"var(--accent-blue)"}),i.jsx("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"var(--text-secondary)",width:44,textAlign:"right"},children:Bh(t.avgQuality)})]})}),i.jsx("td",{style:{padding:"10px 12px",color:t.passRate>=.8?"var(--accent-green)":"var(--accent-yellow)"},children:Bh(t.passRate)}),i.jsx("td",{style:{padding:"10px 12px",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--text-secondary)"},children:Use(t.totalCostUsd)})]},t.provider))})]})})}):null}const XE=["trivial","simple","moderate","complex","critical"];function Zse(e){return e>=.7?"var(--accent-green)":e>=.45?"var(--accent-yellow)":"var(--accent-red)"}function Qse({bandit:e}){const t=Object.keys(e.priors).sort();if(!e.enabled||t.length===0)return null;const n=e.learningHistory.slice(-15).reverse();return i.jsxs(ir,{icon:"๐ŸŽฐ",title:"Bandit Learning โ€” Thompson-sampling priors",subtitle:"Beta(ฮฑ, ฮฒ) per provider ร— complexity bucket, learned from real task outcomes (routing.bandit = true). Higher expected win rate = more successful history.",children:[i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 10px",textAlign:"left",fontWeight:500},children:"Provider"}),XE.map(r=>i.jsxs("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:[VR[r]||"โ€ข"," ",r]},r))]})}),i.jsx("tbody",{children:t.map(r=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"8px 10px",color:"var(--text-primary)",whiteSpace:"nowrap"},children:[zr(r)," ",mi(r).split(" ")[0]]}),XE.map(a=>{var o;const s=(o=e.priors[r])==null?void 0:o[a];return!s||s.alpha===0&&s.beta===0?i.jsx("td",{style:{padding:"8px 10px",textAlign:"center",color:"var(--text-muted)"},children:"ยท"},a):i.jsxs("td",{style:{padding:"8px 10px",textAlign:"center"},children:[i.jsxs("div",{style:{fontSize:13,fontWeight:600,color:Zse(s.expectedWinRate),fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[(s.expectedWinRate*100).toFixed(0),"%"]}),i.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["ฮฑ",s.alpha," ฮฒ",s.beta]})]},a)})]},r))})]})}),n.length>0&&i.jsxs("div",{style:{marginTop:16},children:[i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:8},children:"Recent learning history"}),i.jsx("div",{style:{maxHeight:180,overflowY:"auto",paddingRight:4},children:n.map((r,a)=>{const s=r.outcome==="success"?"โœ…":r.outcome==="escalated"?"๐Ÿ”„":"โŒ",o=new Date(r.timestamp).toLocaleTimeString();return i.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",padding:"5px 4px",borderBottom:"1px solid var(--border-light)"},children:[i.jsx("span",{children:s}),i.jsx("span",{style:{color:"var(--text-primary)",fontSize:12,width:110,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:r.provider,children:r.provider}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",width:80},children:r.complexity}),i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["reward ",r.reward.toFixed(2)]}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",marginLeft:"auto"},children:o})]},a)})})]}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:12},children:["Cold-start Beta(1,1) behaves like the heuristic router until outcomes accumulate. Enable learning with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff config set routing.bandit true"}),"."]})]})}function Jse(e,t=1){return`${e>0?"+":""}${(e*100).toFixed(t)}%`}function eoe({state:e}){const t={pass:{bg:"var(--ok-soft)",border:"var(--accent-green)",color:"var(--accent-green)",label:"โœ“ pass"},fail:{bg:"var(--danger-soft)",border:"var(--accent-red)",color:"var(--accent-red)",label:"โœ— fail"},neutral:{bg:"var(--bg-tertiary)",border:"var(--border-hover)",color:"var(--text-secondary)",label:"โ—‹ neutral"}}[e];return i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:t.bg,border:`1px solid ${t.border}`,color:t.color},children:t.label})}function toe({promotion:e}){if(!e.decisionCount)return null;const t=e.promoted?{icon:"๐ŸŽ–๏ธ",label:"Promoted โ€” the bandit beats the heuristic",color:"var(--accent-green)"}:e.sufficient?{icon:"โš ๏ธ",label:"Not promoted โ€” the bandit is not (yet) better",color:"var(--accent-yellow)"}:{icon:"โณ",label:"Collecting data โ€” need more diverged decisions",color:"var(--accent-blue)"},n=e.minDecisions>0?Math.min(100,Math.round(e.divergedCount/e.minDecisions*100)):0,r=[{key:"quality",label:"Quality โ†‘",delta:e.qualityDelta,state:e.criteria.quality?"pass":"fail",note:"needs > +2%"},{key:"cost",label:"Cost โ†“",delta:e.costDelta,state:e.criteria.cost?"pass":"fail",note:"regression < +1%"},{key:"latency",label:"Latency โ†“",delta:e.latencyDelta,state:e.latencyMeasured?e.criteria.latency?"pass":"fail":"neutral",note:e.latencyMeasured?"regression < +5%":"no latency measurements yet"}];return i.jsxs(ir,{icon:"๐ŸŽ–๏ธ",title:"Promotion Gate โ€” is the bandit better than the heuristic?",subtitle:"A/B verdict from real trajectories (router-promotion.jsonl): quality must improve >2% while cost and latency don't regress (ruflo ADR-150)",children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[i.jsx("span",{style:{fontSize:22},children:t.icon}),i.jsx("span",{style:{fontSize:14,fontWeight:600,color:t.color},children:t.label})]}),i.jsxs("div",{style:{marginBottom:14},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11,color:"var(--text-secondary)",marginBottom:5},children:[i.jsxs("span",{children:[e.divergedCount," diverged decisions"]}),i.jsxs("span",{children:["need ",e.minDecisions," for a verdict"]})]}),i.jsx("div",{style:{background:"var(--bg-primary)",borderRadius:4,height:8,overflow:"hidden",border:"1px solid var(--border-light)"},children:i.jsx("div",{style:{width:`${n}%`,background:e.sufficient?"var(--accent-green)":"var(--accent-blue)",height:"100%",transition:"width 0.4s ease"}})}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4},children:[e.decisionCount," total decisions logged"]})]}),r.map(a=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"7px 0",borderBottom:"1px solid var(--border-light)"},children:[i.jsx("span",{style:{width:70,fontSize:12,color:"var(--text-primary)"},children:a.label}),i.jsx("span",{style:{width:92,fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:"var(--text-secondary)"},children:Jse(a.delta)}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",flex:1},children:a.note}),i.jsx(eoe,{state:a.state})]},a.key)),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:12},children:["Run auto-routed tasks with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"routing.bandit true"})," to accumulate A/B decisions. The gate does not disable the bandit โ€” it tells you whether it's actually winning."]})]})}function noe({ml:e}){if(!e.enabled||e.recordCount===0)return null;const t=e.providers.filter(r=>r.trusted),n=e.providers.filter(r=>!r.trusted);return i.jsxs(ir,{icon:"๐Ÿง ",title:"ML Router โ€” learned from similar tasks",subtitle:"Task-feature kNN (ruflo neural-router analog): outcomes of the most similar PAST tasks nudge each provider's score. Win rate is similarity-weighted; factor = 1 + 0.5 ร— (winRate โˆ’ 0.5), trusted only after 5 similar-task samples.",children:[i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:mt(e.recordCount)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"learned tasks"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--accent-green)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:t.length}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"trusted providers"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--accent-yellow)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--accent-yellow)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:n.length}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"still learning"})]})]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:e.providers.map(r=>i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"10px 14px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[i.jsx("span",{children:zr(r.provider)}),i.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:mi(r.provider)}),r.trusted?i.jsxs("span",{style:go("color-mix(in srgb, var(--accent-green) 15%, transparent)","var(--accent-green)","var(--accent-green)"),children:["trusted ยท ",r.samples," samples"]}):i.jsxs("span",{style:go("color-mix(in srgb, var(--accent-yellow) 15%, transparent)","var(--accent-yellow)","var(--accent-yellow)"),children:[r.samples,"/5 samples"]}),r.model&&i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",fontFamily:"'SFMono-Regular', Consolas, monospace",marginLeft:"auto"},children:r.model.length>30?r.model.slice(0,27)+"โ€ฆ":r.model})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[i.jsxs("div",{style:{width:70,fontSize:11,color:"var(--text-secondary)"},children:["win ",Bh(r.winRate,0)]}),i.jsx(H0,{value:r.winRate,color:r.winRate>=.5?"var(--accent-green)":"var(--accent-red)"}),i.jsxs("div",{style:{width:74,fontSize:11,color:"var(--text-secondary)",textAlign:"right"},children:["factor ",i.jsxs("span",{style:{color:r.trusted&&r.factor!==1?"var(--accent-blue)":"var(--text-muted)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[r.factor.toFixed(2),"ร—"]})]})]})]},r.provider))}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:12},children:["Enabled with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff config set routing.mlRouter true"})," โ€” the factor only adjusts scores when the provider has โ‰ฅ 5 similar-task wins (cold start is neutral)."]})]})}function roe({routing:e}){return e.bestModels.length?i.jsx(ir,{icon:"๐Ÿ†",title:"Best Model per Agent (from your runs)",subtitle:"Success-rate-ranked models from agent-stats โ€” the Auto router boosts the proven winner",children:i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:10},children:e.bestModels.map(t=>i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 14px",minWidth:200,flex:"1 1 200px",transition:"border-color 0.2s, box-shadow 0.2s"},onMouseEnter:n=>{n.currentTarget.style.borderColor="var(--accent-green)",n.currentTarget.style.boxShadow="0 2px 10px color-mix(in srgb, var(--accent-green) 13%, transparent)"},onMouseLeave:n=>{n.currentTarget.style.borderColor="var(--border-light)",n.currentTarget.style.boxShadow="none"},children:[i.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:4},children:[zr(t.model.split("/")[0])," ",t.agentType]}),i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:t.model,children:t.model.length>34?t.model.slice(0,31)+"โ€ฆ":t.model}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:6},children:[i.jsxs("span",{style:{color:t.successRate>=.8?"var(--accent-green)":"var(--accent-yellow)"},children:[Bh(t.successRate,0)," success"]})," ยท ",t.runs," run",t.runs!==1?"s":""]})]},`${t.agentType}-${t.model}`))})}):null}function aoe({retrieval:e}){var l,c;if(!e.enabled&&e.repoChunks===0)return null;const t=e.totalSavedTokens??0,n=e.avgPctReduced??0,r=e.lastCall,a=e.totalCalls??0,s=e.totalRetrievals??0,o=e.totalFailovers??0;return i.jsxs(ir,{icon:"๐Ÿง ",title:"Vector Retrieval โ€” token savings",subtitle:"Large contexts are chunked, embedded locally (bge-small-en-v1.5), and reduced to the top-k relevant chunks before the LLM โ€” saving tokens so free quotas stretch further. Complements the quota ledger: retrieval saves, the ledger manages.",children:[i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--accent-green)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:mt(t)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"tokens saved"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsxs("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[n.toFixed(1),"%"]}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"avg context reduction"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--accent-yellow)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--accent-yellow)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:mt(e.repoChunks)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"repo chunks indexed"})]})]}),i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",fontSize:12,color:"var(--text-secondary)",marginBottom:14},children:[i.jsxs("span",{children:["๐Ÿ“ž ",a," context calls ยท ๐Ÿง  ",s," retrievals used ยท โš ๏ธ ",o," failovers (full-context fallback)"]}),e.dimensions>0&&i.jsxs("span",{children:["ยท ",e.dimensions,"-dim embeddings"]})]}),r&&r.used!==!1&&((l=r.hits)==null?void 0:l.length)>0&&i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 16px",marginBottom:12},children:[i.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)",marginBottom:8},children:["Latest retrieval โ€” ",mt(r.originalTokens)," โ†’ ",mt(r.reducedTokens)," tokens",i.jsxs("span",{style:{color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[" (โˆ’",(c=r.pctReduced)==null?void 0:c.toFixed(0),"%)"]})]}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)"},children:r.hits.slice(0,5).map(u=>i.jsxs("div",{style:{marginTop:3},children:[i.jsx("span",{style:{color:"var(--accent-blue)"},children:"โ–ธ"})," ",u.filePath," ",i.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["(sim ",u.similarity.toFixed(3),")"]})]},u.filePath))})]}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)"},children:["Pre-index your repo with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff retrieval index <dir>"}),", query it with"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:'buff retrieval query "<question>"'}),", and see the same stats with"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff retrieval stats"}),"."]})]})}function ioe({quota:e}){var c;if((!e.enabled||e.entries.length===0)&&(((c=e.events)==null?void 0:c.length)??0)===0)return null;const t=e.entries.reduce((u,d)=>u+d.tokensConsumed,0),n=e.entries.reduce((u,d)=>u+d.requests,0),r=e.entries.filter(u=>u.parked).length,a=e.freeTokens??t-(e.paidTokens??0),s=e.paidTokens??0,o=e.estimatedSavedUsd??0,l=t>0?a/t*100:0;return i.jsxs(ir,{icon:"๐Ÿ“’",title:"Quota Ledger โ€” free-tier usage & auto re-enable",subtitle:"Tokens/requests per provider ร— model with reset windows. Exhausted providers are parked (excluded from Auto routing) and re-enable when the window rolls.",children:[i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:14},children:[i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:mt(t)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"tokens tracked"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:n}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"requests"})]}),i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 18px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:22,fontWeight:700,color:r>0?"var(--accent-yellow)":"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"parked"})]})]}),i.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",marginBottom:16},children:[i.jsxs("div",{style:{flex:"1 1 200px",background:"var(--bg-primary)",borderRadius:10,padding:"12px 16px",border:"1px solid var(--accent-green)"},children:[i.jsx("div",{style:{fontSize:20,fontWeight:700,color:"var(--accent-green)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:mt(a)}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:["tokens on free/local ยท ",l.toFixed(0),"% of usage"]}),i.jsxs("div",{style:{fontSize:12,color:"var(--accent-green)",marginTop:4,fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["๐Ÿ’ฐ est. $",o.toFixed(4)," saved"]})]}),i.jsxs("div",{style:{flex:"1 1 200px",background:"var(--bg-primary)",borderRadius:10,padding:"12px 16px",border:"1px solid var(--accent-yellow)"},children:[i.jsx("div",{style:{fontSize:20,fontWeight:700,color:s>0?"var(--accent-yellow)":"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:mt(s)}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:2},children:"tokens on paid providers (spend triggered)"}),i.jsxs("div",{style:{fontSize:12,color:s>0?"var(--accent-yellow)":"var(--text-secondary)",marginTop:4},children:[e.paidRequests??0," paid request",e.paidRequests===1?"":"s"]})]})]}),i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)"},children:[i.jsx("th",{style:{padding:"8px 10px",textAlign:"left",fontWeight:500},children:"Provider / Model"}),i.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Tokens"}),i.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Requests"}),i.jsx("th",{style:{padding:"8px 10px",textAlign:"right",fontWeight:500},children:"Resets in"}),i.jsx("th",{style:{padding:"8px 10px",textAlign:"center",fontWeight:500},children:"State"})]})}),i.jsx("tbody",{children:e.entries.map(u=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("td",{style:{padding:"8px 10px",whiteSpace:"nowrap"},children:[i.jsxs("span",{style:{color:"var(--text-primary)"},children:[zr(u.provider)," ",mi(u.provider).split(" ")[0]]}),i.jsxs("span",{style:{color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[" / ",u.model.length>24?u.model.slice(0,21)+"โ€ฆ":u.model]})]}),i.jsx("td",{style:{padding:"8px 10px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--text-secondary)"},children:mt(u.tokensConsumed)}),i.jsx("td",{style:{padding:"8px 10px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",color:"var(--text-secondary)"},children:u.requests}),i.jsx("td",{style:{padding:"8px 10px",textAlign:"right",color:"var(--text-secondary)",whiteSpace:"nowrap"},children:YE(u.resetsInMs)}),i.jsx("td",{style:{padding:"8px 10px",textAlign:"center"},children:u.parked?i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--danger-soft)",border:"1px solid var(--accent-red)",color:"var(--accent-red)"},children:"โธ parked"}):i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--ok-soft)",border:"1px solid var(--accent-green)",color:"var(--accent-green)"},children:"โœ“ available"})})]},`${u.provider}|${u.model}`))})]})}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:12},children:["Configure limits with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff config set routing.quota.gemini.requestsPerWindow 1500"}),"; the ledger always tracks usage but only parks when limits are set."]}),e.parkedAccounts&&e.parkedAccounts.length>0&&i.jsxs("div",{style:{marginTop:18},children:[i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",marginBottom:10},children:"๐Ÿ”‘ Parked Accounts โ€” multi-account key rotation"}),i.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:8},children:"Accounts skipped predictively by the failover walk (rate-limit / auth). Fingerprints only โ€” raw keys are never stored."}),i.jsx("div",{style:{maxHeight:180,overflowY:"auto",background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"8px 0"},children:e.parkedAccounts.map((u,d)=>{const f=u.reason==="auth"?"auth":u.reason==="rate-limit"?"rate-limit":u.reason||"cooldown",h=u.reason==="rate-limit"?"var(--accent-yellow)":"var(--accent-red)";return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px",borderBottom:d<e.parkedAccounts.length-1?"1px solid var(--bg-card)":"none"},children:[i.jsx("span",{style:{fontSize:13},children:"๐Ÿ”’"}),i.jsxs("span",{style:{width:90,flexShrink:0,fontSize:12,color:"var(--text-primary)"},children:[zr(u.provider)," ",mi(u.provider).split(" ")[0]]}),i.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11,color:"var(--text-secondary)"},title:u.accountId,children:["#",u.accountId.slice(0,8)]}),i.jsx("span",{style:{fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--bg-card)",border:`1px solid ${h}`,color:h,textAlign:"center"},children:f}),i.jsx("span",{style:{flex:1}}),i.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)",whiteSpace:"nowrap"},children:["re-admits in ",YE(u.remainingMs)]})]},`${u.provider}-${u.accountId}-${d}`)})})]}),e.events&&e.events.length>0&&i.jsxs("div",{style:{marginTop:18},children:[i.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",marginBottom:10},children:"๐Ÿ›Ÿ Failover Timeline โ€” quota management & mid-session swaps"}),i.jsx("div",{style:{maxHeight:220,overflowY:"auto",background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"8px 0"},children:e.events.map((u,d)=>{const f=u.type==="parked"?"โธ":u.type==="re-enabled"?"๐Ÿ”":u.type==="released"?"โœ…":"โšก",h=u.type==="parked"?"var(--accent-red)":u.type==="re-enabled"||u.type==="released"?"var(--accent-green)":"var(--accent-yellow)",p=u.type==="parked"?"parked":u.type==="re-enabled"?"re-enabled":u.type==="released"?"released":"failover";return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px",borderBottom:d<e.events.length-1?"1px solid var(--bg-card)":"none"},children:[i.jsx("span",{style:{fontSize:13},children:f}),i.jsx("span",{style:{width:80,flexShrink:0,fontSize:11,padding:"1px 8px",borderRadius:10,background:"var(--bg-card)",border:`1px solid ${h}`,color:h,textAlign:"center"},children:p}),i.jsxs("span",{style:{flex:1,fontSize:12,color:"var(--text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[zr(u.provider)," ",mi(u.provider)]}),u.reason&&i.jsx("span",{style:{fontSize:11,color:"var(--text-secondary)"},children:u.reason}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",whiteSpace:"nowrap"},children:XR(u.timestamp)})]},`${u.timestamp}-${d}`)})})]})]})}function uf({ok:e,children:t}){return i.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11,padding:"3px 9px",borderRadius:8,background:e===!1?"var(--danger-soft)":"var(--ok-soft)",border:`1px solid ${e===!1?"var(--accent-red)":"var(--accent-green)"}`,color:e===!1?"var(--accent-red)":"var(--accent-green)",whiteSpace:"nowrap"},children:t})}function soe({governance:e}){var r,a,s,o,l;if(!e.enabled)return i.jsx(ir,{icon:"โš–๏ธ",title:"Admin Governance Policy",subtitle:"Hard-constraint rules the Auto router enforces on every pick",children:i.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"Fully permissive"})," โ€” no governance rules active; any provider ร— model is eligible.",i.jsxs("div",{style:{marginTop:6,fontSize:12,color:"var(--text-muted)"},children:["Add rules with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff admin allow <provider>"})," ยท"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff admin deny <provider>"})," ยท"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff admin max-cost <usd>"})]})]})});const t=[];(r=e.allowProviders)!=null&&r.length&&t.push({label:"allow providers",items:e.allowProviders}),(a=e.denyProviders)!=null&&a.length&&t.push({label:"deny providers",items:e.denyProviders,deny:!0}),(s=e.allowModels)!=null&&s.length&&t.push({label:"allow models",items:e.allowModels}),(o=e.denyModels)!=null&&o.length&&t.push({label:"deny models",items:e.denyModels,deny:!0});const n=[];return e.maxCostUsd!==void 0&&n.push(`max cost $${e.maxCostUsd}`),e.minPrivacyForPii!==void 0&&e.minPrivacyForPii<1&&n.push(`PII min privacy ${e.minPrivacyForPii}`),(l=e.piiPatterns)!=null&&l.length&&n.push(`PII guard (${e.piiPatterns.length} patterns)`),e.allowUnblock===!1&&n.push("unblock admin-hard"),i.jsxs(ir,{icon:"โš–๏ธ",title:"Admin Governance Policy",subtitle:"Hard-constraint rules โ€” violating providers are eliminated, never just scored lower",children:[i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:10},children:[t.map(c=>i.jsxs(uf,{ok:!c.deny,children:[c.deny?"โ›”":"โœ…"," ",c.label,": ",c.items.join(", ")]},c.label)),n.map(c=>i.jsx(uf,{children:c},c)),t.length===0&&n.length===0&&i.jsx(uf,{ok:!1,children:"policy configured but no rules active"})]}),i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:["Managed via ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff admin"})," โ€” the same policy the CLIโ€™s"," ",i.jsx("code",{children:"model explain"})," surfaces as governance-blocked."]})]})}function ooe({rbac:e}){const t=n=>n==="admin"?"var(--accent-yellow)":n==="operator"?"var(--accent-green)":"var(--text-secondary)";return i.jsxs(ir,{icon:"๐Ÿ”",title:"RBAC Identity",subtitle:"Who may write policy โ€” role file ~/.buff/rbac.json",children:[i.jsxs("div",{style:{fontSize:13,marginBottom:10},children:[i.jsx("span",{style:{color:"var(--text-secondary)"},children:"You are "}),i.jsx("code",{style:{color:"var(--accent-blue)"},children:e.identity}),i.jsx("span",{style:{color:"var(--text-secondary)"},children:" as "}),e.role?i.jsx("span",{style:{color:t(e.role),fontWeight:600},children:e.role}):i.jsx("span",{style:{color:"var(--text-secondary)"},children:"unassigned"})]}),e.legacy?i.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)"},children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"Legacy single-user mode"})," โ€” no roles assigned; policy writes are open to every user. Assign roles with"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff admin role add <you> admin"}),"."]}):i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[e.users.map(n=>i.jsxs(uf,{ok:n.role!=="viewer",children:[n.user," ยท ",n.role,n.via==="oidc"?" (oidc)":""]},n.user)),i.jsxs("div",{style:{width:"100%",fontSize:12,color:"var(--text-muted)",marginTop:4},children:["Policy ",i.jsx("em",{children:"writes"})," require ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"admin"}),"; reads are open to every role."]})]})]})}function loe({data:e}){var p,g,m,y,v,b,w,N,S,x;const t=e==null?void 0:e.routing,n=t&&(t.preference.length>0||t.providers.length>0||t.bestModels.length>0),r=!!((p=t==null?void 0:t.usage)!=null&&p.total),a=!!((g=t==null?void 0:t.history)!=null&&g.length),s=!!t&&(((m=t.history)==null?void 0:m.length)??0)>0||!!((y=t==null?void 0:t.preference)!=null&&y.length),o=!!((v=t==null?void 0:t.bandit)!=null&&v.enabled),l=!!((b=t==null?void 0:t.promotion)!=null&&b.decisionCount),c=!!((w=t==null?void 0:t.ml)!=null&&w.enabled)&&(t.ml.recordCount??0)>0,u=!!((N=t==null?void 0:t.quota)!=null&&N.enabled),d=!!((S=t==null?void 0:t.retrieval)!=null&&S.enabled)||!!((x=t==null?void 0:t.retrieval)!=null&&x.repoChunks),f=!!(t!=null&&t.governance),h=!!(t!=null&&t.rbac);return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿค–",title:"Auto Routing Insights"}),i.jsxs("p",{className:"section-description",children:["Which providers and models the Auto router prefers โ€” from real pricing, benchmark quality, per-agent success stats, and the Thompson-sampling bandit. Run"," ",i.jsx("code",{children:"buff benchmark"})," and use Auto routing to build this up over time."]}),!n&&!r&&!a&&!o&&!l&&!c&&!u&&!d&&!f&&!h?i.jsx(Wse,{}):i.jsxs(i.Fragment,{children:[s&&t&&i.jsx(Bse,{routing:t}),f&&t.governance&&i.jsx(soe,{governance:t.governance}),(t==null?void 0:t.rbac)&&i.jsx(ooe,{rbac:t.rbac}),r&&i.jsx(Kse,{usage:t.usage}),a&&i.jsx(Vse,{history:t.history}),o&&i.jsx(Qse,{bandit:t.bandit}),l&&i.jsx(toe,{promotion:t.promotion}),c&&t.ml&&i.jsx(noe,{ml:t.ml}),u&&i.jsx(ioe,{quota:t.quota}),d&&i.jsx(aoe,{retrieval:t.retrieval}),i.jsx(Yse,{routing:t}),i.jsx(Xse,{routing:t}),i.jsx(roe,{routing:t})]}),t&&t.providers.length===0&&t.bestModels.length===0&&t.preference.length>0&&i.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",marginTop:4},children:"Auto-router preference is always available (static profiles + real pricing); quality metrics appear once you run benchmarks and agent tasks."})]})}const ZE={chat:"๐Ÿ’ฌ",execute:"โš™๏ธ",plan:"๐Ÿ—บ๏ธ",edit:"โœ๏ธ",skill:"๐Ÿงฉ",learn:"๐Ÿ“š",ci:"๐Ÿ”",doctor:"๐Ÿฉบ",probe:"๐Ÿ”ญ","spot-check":"๐Ÿงช",telemetry:"๐Ÿ“ก",usage:"๐Ÿงฎ","ide-chat":"๐Ÿ’ฌ","ide-inline":"โœ๏ธ","ide-execute":"โš™๏ธ"};function coe(e){return new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function zd(e){return e!==void 0?`${e}ms`:"โ€”"}function ZR(e){return e===0?"var(--accent-green)":e<.2?"var(--accent-yellow)":"var(--accent-red)"}function uoe({data:e}){const t=e.rows,n=t.reduce((c,u)=>c+u.requests,0),r=t.reduce((c,u)=>c+Math.round(u.errorRate*u.requests),0),a=t.reduce((c,u)=>c+(u.costUsd??0),0),s=t.flatMap(c=>c.latency?[c.latency.avg]:[]),o=s.length>0?Math.round(s.reduce((c,u)=>c+u,0)/s.length):void 0,l=new Set(t.map(c=>c.action)).size;return i.jsxs("div",{className:"stats-grid",style:{marginBottom:16},children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"๐Ÿ“จ"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:mt(n)}),i.jsx("div",{className:"stat-label",children:"Requests"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"๐ŸŽฏ"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",children:t.length}),i.jsx("div",{className:"stat-label",children:"provider ร— model ร— action groups"})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"โšก"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:o!==void 0?"var(--accent-green)":"var(--text-secondary)"},children:o!==void 0?`${o}ms`:"โ€”"}),i.jsxs("div",{className:"stat-label",children:["Avg latency",o!==void 0?` (${s.length} groups)`:" (no samples)"]})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"๐Ÿ“›"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:ZR(n>0?r/n:0)},children:n>0?`${(r/n*100).toFixed(1)}%`:"โ€”"}),i.jsxs("div",{className:"stat-label",children:["Overall error rate (",mt(r)," failures)"]})]})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("span",{className:"stat-icon",children:"๐Ÿ’ฐ"}),i.jsxs("div",{className:"stat-body",children:[i.jsx("div",{className:"stat-value",style:{color:a>0?"var(--accent-yellow)":"var(--text-secondary)"},children:a>0?`$${a.toFixed(4)}`:"โ€”"}),i.jsxs("div",{className:"stat-label",children:["Measured cost",l>0?` ยท ${l} actions`:""]})]})]})]})}function doe({data:e}){const[t,n]=k.useState(""),[r,a]=k.useState("all"),s=e==null?void 0:e.requests,o=k.useMemo(()=>{if(!s)return[];const u=t.trim().toLowerCase();return s.rows.filter(d=>r!=="all"&&d.action!==r?!1:u?`${d.provider} ${d.model} ${d.action}`.toLowerCase().includes(u):!0)},[s,t,r]),l=i.jsx($e,{icon:"๐Ÿ“จ",title:"Requests โ€” per provider ร— model ร— action",description:"Aggregated from the same action-telemetry log as the Models panel โ€” every Auto-routed call, grouped by action ร— provider ร— model. Latency percentiles appear once โ‰ฅ3 samples exist; cost when the caller reported usage."});if(!e)return i.jsxs(i.Fragment,{children:[l,i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading requests..."})})]});if(!s||!s.enabled||s.rows.length===0)return i.jsxs(i.Fragment,{children:[l,i.jsxs("div",{className:"empty-state",style:{padding:"40px 24px",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:28,marginBottom:10},children:"๐Ÿ“จ"}),i.jsxs("p",{className:"section-description",style:{maxWidth:560,margin:"0 auto"},children:["No request telemetry yet. As you use ",i.jsx("strong",{children:"chat"}),", ",i.jsx("strong",{children:"execute"}),","," ",i.jsx("strong",{children:"plan"})," and ",i.jsx("strong",{children:"edit"})," under Auto routing, every call writes to the action-telemetry log and this panel aggregates it: request counts, p50/p95/p99 latency, error rate and measured cost โ€” the same feed that drives the Models panel."]})]})]});const c=[...new Set(s.rows.map(u=>u.action))].sort();return i.jsxs(i.Fragment,{children:[l,i.jsx(uoe,{data:s}),i.jsxs("div",{style:{display:"flex",gap:12,marginBottom:14,flexWrap:"wrap",alignItems:"center"},children:[i.jsxs("select",{value:r,onChange:u=>a(u.target.value),"aria-label":"Filter by action",style:{background:"var(--bg-card)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:8,padding:"8px 10px",fontSize:13,cursor:"pointer"},children:[i.jsx("option",{value:"all",children:"All actions"}),c.map(u=>i.jsxs("option",{value:u,children:[ZE[u]||"๐ŸŽฏ"," ",u]},u))]}),i.jsxs("div",{style:{flex:1,minWidth:220,position:"relative"},children:[i.jsx("span",{style:{position:"absolute",left:10,top:8,color:"var(--text-muted)",fontSize:13},children:"๐Ÿ”"}),i.jsx("input",{type:"text",value:t,onChange:u=>n(u.target.value),placeholder:"Search provider, model or action...",style:{width:"100%",padding:"8px 12px 8px 32px",background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8,color:"var(--text-primary)",fontSize:13,outline:"none"}})]}),i.jsxs("span",{style:{fontSize:12,color:"var(--text-secondary)",whiteSpace:"nowrap"},children:[o.length," of ",s.rows.length," groups"]})]}),i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)",color:"var(--text-secondary)",textAlign:"left"},children:[i.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Action"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Provider"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500},children:"Model"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Requests"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Error rate"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Latency avg"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p50"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p95"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"p99"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Measured cost"}),i.jsx("th",{style:{padding:"8px 12px",fontWeight:500,textAlign:"right"},children:"Last seen"})]})}),i.jsx("tbody",{children:o.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:11,style:{padding:28,textAlign:"center",color:"var(--text-muted)"},children:"No request groups match your filter."})}):o.map(u=>{var d;return i.jsxs("tr",{style:{borderBottom:"1px solid var(--border-light)"},children:[i.jsx("td",{style:{padding:"8px 12px",whiteSpace:"nowrap"},children:i.jsxs("span",{style:{fontSize:11,padding:"2px 8px",borderRadius:8,background:"var(--bg-hover)",color:"var(--text-secondary)",border:"1px solid var(--border)"},children:[ZE[u.action]||"๐ŸŽฏ"," ",u.action]})}),i.jsx("td",{style:{padding:"8px 12px",color:"var(--text-primary)",whiteSpace:"nowrap"},children:u.provider}),i.jsxs("td",{style:{padding:"8px 12px",color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:u.callIds.length>0?`Correlation ids: ${u.callIds.join(", ")}`:void 0,children:[u.model.length>42?u.model.slice(0,39)+"โ€ฆ":u.model,u.callIds.length>0&&i.jsxs("span",{style:{color:"var(--text-muted)",marginLeft:6},title:u.callIds.join(", "),children:["๐Ÿ”—",u.callIds.length]})]}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:u.requests}),i.jsxs("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:ZR(u.errorRate)},children:[(u.errorRate*100).toFixed(1),"%",(u.partials??0)>0&&i.jsxs("span",{title:`โธ ${u.partials} mid-stream interruption(s) โ€” started streaming, died before finish; the router deprioritizes flaky providers (P4 M4.4)`,style:{display:"inline-flex",alignItems:"center",gap:3,marginLeft:6,fontSize:10,padding:"1px 6px",borderRadius:8,whiteSpace:"nowrap",background:"var(--purple-soft)",border:"1px solid var(--accent-purple)",color:"var(--accent-purple)"},children:["โธ ",u.partials]})]}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:zd((d=u.latency)==null?void 0:d.avg)}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:u.latency&&u.latency.samples>=3?zd(u.latency.p50):"โ€”"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:u.latency&&u.latency.samples>=3?zd(u.latency.p95):"โ€”"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12},children:u.latency&&u.latency.samples>=3?zd(u.latency.p99):"โ€”"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:12,color:u.costUsd?"var(--accent-yellow)":"var(--text-muted)"},children:u.costUsd!==void 0?`$${u.costUsd.toFixed(4)}`:"โ€”"}),i.jsx("td",{style:{padding:"8px 12px",textAlign:"right",color:"var(--text-muted)",fontSize:11,whiteSpace:"nowrap"},children:coe(u.lastAt)})]},`${u.action}|${u.provider}|${u.model}`)})})]})}),i.jsx("div",{style:{textAlign:"center",fontSize:12,color:"var(--text-muted)",marginTop:12},children:"Auto-refreshes with the dashboard feed ยท percentile columns need โ‰ฅ3 latency samples per group"})]})}const foe={local:"๐Ÿ’ป",groq:"๐ŸŸข",nim:"๐Ÿ”ถ",gemini:"๐Ÿ”ท",openrouter:"๐ŸŸฃ"},hoe={planner:"๐Ÿ—บ๏ธ",writer:"โœ๏ธ",reviewer:"๐Ÿ”Ž",tester:"๐Ÿงช",debugger:"๐Ÿ›",runner:"๐Ÿƒ","context-gatherer":"๐Ÿ“‚",memory:"๐Ÿง ","self-improver":"๐Ÿ“ˆ"};function poe(e){return foe[e]||"๐Ÿ”Œ"}function moe(e){return hoe[e]||"๐Ÿค–"}function QR(e){const t=Date.now()-e;return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${new Date(e).toLocaleDateString()}`}function G0(e){return e===void 0?"โ€”":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`}function kc(e){return e==null?"0":e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function goe(e){var n,r;if(!e)return null;const t={bg:"var(--bg-primary)",border:"var(--border)"};return e.unverifiedClaim?{text:"โš ๏ธ unverified claim โ€” said it acted, but no tool ran",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unfulfilledPromise?{text:"โš ๏ธ unfulfilled promise โ€” announced an action it never performed",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unverifiedEditClaim?{text:"โš ๏ธ unverified edit claim โ€” asserted a fix, but nothing verified it",color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.unverifiedEdit?{text:`โš ๏ธ unverified edit โ€” ${((n=e.tools)==null?void 0:n.length)??0} tool(s), no test/typecheck/browser run`,color:"var(--accent-yellow)",bg:"var(--warn-soft)",border:"var(--accent-yellow)"}:e.kind==="acted"?{text:e.delivered?"โœ… action performed โ€” message sent":`๐Ÿ”ง acted โ€” ${((r=e.tools)==null?void 0:r.length)??0} tool(s)`,color:"var(--accent-green)",bg:"var(--ok-soft)",border:"var(--accent-green)"}:e.kind==="answered"?{text:"๐Ÿ’ฌ answered โ€” no action taken",color:"var(--text-secondary)",...t}:e.kind==="cancelled"?{text:"โน cancelled",color:"var(--text-secondary)",...t}:{text:"โŒ generation failed",color:"var(--accent-red)",bg:"var(--danger-soft)",border:"var(--accent-red)"}}function QE(e){const t=e.filter(n=>n.verdict==="CONFIRMED"&&q0(n).length>0).length;return`${e.length} finding${e.length===1?"":"s"}: ${t} confirmed, ${e.length-t} plausible`}function q0(e){return(e.evidence??[]).filter(t=>typeof(t==null?void 0:t.ref)=="string"&&t.ref.trim().length>0)}function voe({finding:e}){const t=q0(e),n=e.verdict==="CONFIRMED"&&t.length>0;return i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderLeft:`3px solid ${n?"var(--accent-green)":"var(--accent-yellow)"}`,borderRadius:8,padding:"8px 12px",marginBottom:8},children:[i.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[i.jsx("span",{style:{fontSize:13},children:n?"โœ…":"๐Ÿ”Ž"}),i.jsx("span",{style:{flex:1,fontSize:12.5,fontWeight:600,color:"var(--text-primary)"},children:e.claim}),i.jsx("span",{style:{fontSize:9.5,fontWeight:700,letterSpacing:"0.04em",padding:"1px 7px",borderRadius:10,border:"1px solid",color:n?"var(--accent-green)":"var(--accent-yellow)",background:n?"var(--ok-soft)":"var(--warn-soft)",borderColor:n?"var(--accent-green)":"var(--accent-yellow)"},children:n?"CONFIRMED":"PLAUSIBLE"})]}),e.outcome?i.jsx("div",{style:{marginTop:3,fontSize:11.5,color:"var(--text-secondary)"},children:e.outcome}):null,t.length>0?i.jsx("ul",{style:{listStyle:"none",margin:"5px 0 0",padding:0},children:t.map((r,a)=>i.jsxs("li",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:3},children:[i.jsx("span",{style:{fontSize:9.5,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--accent-blue)",marginRight:5},children:r.kind}),i.jsx("span",{style:{color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r.ref}),r.detail?i.jsxs("span",{style:{marginLeft:5},children:["(",r.detail,")"]}):null]},a))}):i.jsx("div",{style:{marginTop:5,fontSize:11,color:"var(--accent-yellow)"},children:"no evidence โ€” reported as PLAUSIBLE, not verified"}),e.source?i.jsxs("div",{style:{marginTop:4,fontSize:10,color:"var(--text-muted)"},children:["source: ",e.source]}):null]})}function bb({icon:e,title:t,subtitle:n,children:r}){return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:12,border:"1px solid var(--border-light)",padding:"18px 20px",marginBottom:16},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[i.jsx("span",{style:{fontSize:20},children:e}),i.jsx("h2",{style:{fontSize:15,fontWeight:600,color:"var(--text-primary)",margin:0},children:t})]}),n&&i.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",margin:"2px 0 12px 0"},children:n}),!n&&i.jsx("div",{style:{height:6}}),r]})}function yoe(){return i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px dashed var(--border)",borderRadius:10,padding:"18px 20px",color:"var(--text-secondary)",fontSize:13,textAlign:"center"},children:["๐Ÿ” No reasoning traces yet โ€” every LLM call in a ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff execute"})," pipeline is recorded to ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"reasoning-traces.json"}),". Run a pipeline, then replay it here or with ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff trace replay <id>"}),"."]})}function boe({step:e}){const[t,n]=k.useState(!1),r=e.success?"var(--accent-green)":"var(--accent-red)",a=e.success?"ok":"failed";return i.jsxs("div",{style:{background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:8,marginBottom:8,overflow:"hidden"},children:[i.jsxs("button",{onClick:()=>n(!t),style:{width:"100%",background:"none",border:"none",cursor:"pointer",padding:"10px 14px",textAlign:"left",display:"flex",alignItems:"center",gap:10,color:"inherit"},children:[i.jsx("span",{style:{width:26,fontSize:16},children:moe(e.agentType)}),i.jsx("span",{style:{width:130,fontSize:12,fontWeight:600,color:"var(--text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:e.agentType,children:e.agentType}),i.jsxs("span",{style:{flex:1,fontSize:12,color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:`${e.provider}/${e.model}`,children:[poe(e.provider)," ",e.provider,"/",e.model]}),i.jsx("span",{style:{width:70,fontSize:11,color:"var(--text-muted)",textAlign:"right"},children:G0(e.latencyMs)}),i.jsxs("span",{style:{width:86,fontSize:11,color:"var(--text-muted)",fontFamily:"'SFMono-Regular', Consolas, monospace",textAlign:"right"},children:[kc(e.inputTokens),"โ†’",kc(e.outputTokens)," tok"]}),i.jsx("span",{style:{width:46,fontSize:11,color:r,textAlign:"right"},children:a}),i.jsx("span",{style:{width:22,fontSize:11,textAlign:"right"},children:e.escalated?i.jsx("span",{title:"Repair escalated to a stronger routed model (v1.60.4)",children:"๐Ÿš€"}):""}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)"},children:t?"โ–พ":"โ–ธ"})]}),t&&i.jsxs("div",{style:{padding:"0 14px 12px 50px",fontSize:12},children:[e.taskId&&i.jsxs("div",{style:{color:"var(--text-muted)",marginBottom:4},children:["Task: ",i.jsx("span",{style:{color:"var(--text-secondary)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:e.taskId})]}),e.description&&i.jsx("div",{style:{color:"var(--text-secondary)",marginBottom:6},children:e.description}),e.routing&&i.jsxs("div",{style:{marginBottom:6},children:[i.jsxs("span",{style:{fontSize:10,padding:"1px 8px",borderRadius:10,background:e.escalated?"var(--warn-soft)":"var(--bg-tertiary)",border:e.escalated?"1px solid var(--accent-yellow)":"1px solid var(--accent-blue)",color:e.escalated?"var(--accent-yellow)":"var(--accent-blue)"},children:[e.escalated?"๐Ÿš€ escalated auto โ†’ ":"๐Ÿค– auto โ†’ ",e.routing.provider,"/",e.routing.model," ยท score ",e.routing.score.toFixed(3)," ยท ",e.routing.complexity]}),e.escalated&&i.jsx("div",{style:{color:"var(--accent-yellow)",marginTop:4,fontSize:11},children:"Repair escalated to a stronger routed model (next complexity level)."}),e.routing.explanation&&i.jsx("div",{style:{color:"var(--text-muted)",marginTop:4,fontSize:11},children:e.routing.explanation})]}),e.layers&&i.jsxs("div",{style:{marginBottom:6,fontSize:11,color:"var(--text-muted)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:[i.jsx("span",{style:{color:"var(--accent-blue)"},children:"sys"})," ",e.layers.systemChars,"c/#",e.layers.systemDigest," ยท"," ",i.jsx("span",{style:{color:"var(--accent-green)"},children:"ctx"})," ",e.layers.contextChars,"c/#",e.layers.contextDigest," ยท"," ",i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"vol"})," ",e.layers.volatileChars,"c/#",e.layers.volatileDigest,i.jsxs("div",{style:{color:"var(--text-muted)",marginTop:2},children:["a constant ",i.jsx("span",{style:{color:"var(--accent-blue)"},children:"sys"})," digest across steps โ‡’ the stable layer is prompt-cacheable"]})]}),e.error&&i.jsxs("div",{style:{color:"var(--accent-red)",marginBottom:6},children:["โš ๏ธ ",e.error.slice(0,300)]}),i.jsxs("div",{style:{color:"var(--text-muted)",margin:"6px 0 3px 0"},children:["Prompt ",i.jsxs("span",{style:{fontFamily:"'SFMono-Regular', Consolas, monospace"},children:["#",e.promptDigest]})," ยท ",e.promptPreview.length,"+ chars:"]}),i.jsx("pre",{style:{background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:6,padding:8,margin:0,color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:180,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.promptPreview.slice(0,900)}),i.jsxs("div",{style:{color:"var(--text-muted)",margin:"8px 0 3px 0"},children:["Response (",kc(e.responseLength)," chars):"]}),i.jsx("pre",{style:{background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:6,padding:8,margin:0,color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:240,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.responsePreview.slice(0,1200)})]})]})}function xoe({trace:e}){const[t,n]=k.useState(e.steps??null),[r,a]=k.useState(!1);k.useEffect(()=>{if(e.steps){n(e.steps);return}let l=!1;return Q.fetchTraceDetail(e.id).then(c=>{l||(c!=null&&c.steps?n(c.steps):a(!0))}),()=>{l=!0}},[e.id,e.steps]);const s=e.success===!0?"โœ…":e.success===!1?"โŒ":"โณ",o=e.success===!0?"success":e.success===!1?"failed":"in progress";return i.jsxs(bb,{icon:s,title:`${e.id} โ€” ${o}`,subtitle:e.goal,children:[i.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12},children:[i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["๐Ÿ•“ ",QR(e.startedAt)]}),(()=>{const l=goe(e.outcome);return l?i.jsx("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:l.bg,border:`1px solid ${l.border}`,color:l.color},children:l.text}):null})(),i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["โฑ ",G0(e.durationMs)]}),i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["๐Ÿ”ข ",(t==null?void 0:t.length)??"?"," call(s)"]}),t&&t.some(l=>l.escalated)&&i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--warn-soft)",border:"1px solid var(--accent-yellow)",color:"var(--accent-yellow)"},children:["๐Ÿš€ ",t.filter(l=>l.escalated).length," escalated repair(s)"]}),e.totalTokens!==void 0&&i.jsxs("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:["๐Ÿงฎ ",kc(e.totalTokens)," tok"]}),e.findings&&e.findings.length>0&&i.jsx("span",{style:{fontSize:11,padding:"2px 10px",borderRadius:12,background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:`๐Ÿ”Ž ${QE(e.findings)}`})]}),e.findings&&e.findings.length>0?i.jsxs("div",{style:{marginBottom:12},children:[i.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:6},children:`๐Ÿ”Ž Findings โ€” ${QE(e.findings)}`}),e.findings.map((l,c)=>i.jsx(voe,{finding:l},`finding-${c}`))]}):null,e.systemPrompt&&i.jsxs("details",{style:{marginBottom:12},children:[i.jsxs("summary",{style:{cursor:"pointer",fontSize:12,color:"var(--accent-blue)"},children:["๐Ÿงฌ System prompt โ€” stable layer (",e.systemPromptChars??e.systemPrompt.length," chars)"]}),i.jsx("pre",{style:{background:"var(--bg-card)",border:"1px solid var(--border-light)",borderRadius:6,padding:10,margin:"8px 0 0 0",color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:320,overflowY:"auto",fontFamily:"'SFMono-Regular', Consolas, monospace",fontSize:11},children:e.systemPrompt})]}),r&&i.jsx("div",{style:{color:"var(--accent-red)",fontSize:12,marginBottom:10},children:"Could not load trace steps (trace may have been deleted)."}),t===null&&!r&&i.jsx("div",{style:{color:"var(--text-secondary)",fontSize:12},children:"Loading stepsโ€ฆ"}),t&&t.length===0&&i.jsx("div",{style:{color:"var(--text-secondary)",fontSize:12},children:"No LLM calls recorded in this trace."}),t&&t.map(l=>i.jsx(boe,{step:l},l.seq))]})}function woe({traces:e}){const[t,n]=k.useState(null);return t?i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>n(null),style:{background:"var(--bg-hover)",border:"1px solid var(--border)",color:"var(--text-primary)",borderRadius:8,padding:"6px 14px",fontSize:12,cursor:"pointer",marginBottom:12},children:"โ† Back to traces"}),i.jsx(xoe,{trace:t})]}):i.jsx("div",{children:e.map(r=>{const a=r.success===!0?"โœ…":r.success===!1?"โŒ":"โณ",s=r.steps?[...new Set(r.steps.map(o=>o.agentType))].join(", "):"";return i.jsxs("button",{onClick:()=>n(r),style:{width:"100%",background:"var(--bg-primary)",border:"1px solid var(--border-light)",borderRadius:10,padding:"12px 16px",marginBottom:8,cursor:"pointer",textAlign:"left",color:"inherit",transition:"border-color 0.2s, box-shadow 0.2s"},onMouseEnter:o=>{o.currentTarget.style.borderColor="var(--accent-blue)",o.currentTarget.style.boxShadow="0 2px 10px color-mix(in srgb, var(--accent-blue) 13%, transparent)"},onMouseLeave:o=>{o.currentTarget.style.borderColor="var(--border-light)",o.currentTarget.style.boxShadow="none"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[i.jsx("span",{children:a}),i.jsx("span",{style:{fontSize:11,color:"var(--accent-blue)",fontFamily:"'SFMono-Regular', Consolas, monospace"},children:r.id}),i.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",marginLeft:"auto"},children:QR(r.startedAt)})]}),i.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",marginBottom:6},children:r.goal}),i.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",fontSize:11,color:"var(--text-secondary)"},children:[i.jsxs("span",{children:["๐Ÿ”ข ",r.stepCount??0," call(s)"]}),i.jsxs("span",{children:["โฑ ",G0(r.durationMs)]}),r.failedSteps?i.jsxs("span",{style:{color:"var(--accent-red)"},children:["โŒ ",r.failedSteps," failed"]}):i.jsx("span",{style:{color:"var(--accent-green)"},children:"โœ“ all ok"}),r.totalTokens!==void 0&&i.jsxs("span",{children:["๐Ÿงฎ ",kc(r.totalTokens)," tok"]}),r.findings&&r.findings.length>0&&i.jsx("span",{style:{color:"var(--accent-yellow)"},children:`๐Ÿ”Ž ${r.findings.filter(o=>o.verdict==="CONFIRMED"&&q0(o).length>0).length}/${r.findings.length} confirmed`}),s&&i.jsxs("span",{children:["๐Ÿค– ",s.slice(0,60)]})]})]},r.id)})})}function Soe(){const[e,t]=k.useState(null),[n,r]=k.useState(!1),a=k.useCallback(()=>{Q.fetchTraces().then(s=>{s?(t(s),r(!1)):r(!0)})},[]);return k.useEffect(()=>{a();const s=setInterval(a,15e3);return()=>clearInterval(s)},[a]),i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"๐Ÿ”",title:"Reasoning Traces",description:"Every LLM call in each pipeline โ€” agent ร— model ร— prompt digest ร— response ร— tokens ร— latency ร— routing snapshot (assessment P0)."}),e===null&&!n&&i.jsx(bb,{icon:"โณ",title:"Loadingโ€ฆ",children:i.jsx("div",{style:{color:"var(--text-secondary)",fontSize:13},children:"Fetching reasoning tracesโ€ฆ"})}),n&&e===null&&i.jsx(bb,{icon:"โš ๏ธ",title:"Could not reach the dashboard server",children:i.jsxs("div",{style:{color:"var(--text-secondary)",fontSize:13},children:["The traces endpoint is unavailable right now โ€” retrying automatically. Run"," ",i.jsx("code",{style:{color:"var(--accent-blue)"},children:"buff trace list"})," in the terminal to inspect traces directly."]})}),e!==null&&e.length===0&&i.jsx(yoe,{}),e!==null&&e.length>0&&i.jsx(woe,{traces:e})]})}function Cg(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)&&t>=0?t:null}function koe({authed:e,role:t}){const[n,r]=k.useState(null),[a,s]=k.useState({}),[o,l]=k.useState(""),[c,u]=k.useState(!1),[d,f]=k.useState(null),[h,p]=k.useState(null),g=e&&(t==="admin"||t==="operator"),m=e&&t==="admin",y=k.useCallback(async()=>{var E,j,C;const S=await Q.fetchAdminQuota();if(!S){p("Could not load budget config.");return}p(null),r(S);const x={};for(const T of S.providers){const $=S.quota[T]||{};x[T]={provider:T,tokens:((E=$.tokensPerWindow)==null?void 0:E.toString())??"",requests:((j=$.requestsPerWindow)==null?void 0:j.toString())??"",windowMs:((C=$.windowMs)==null?void 0:C.toString())??""}}s(x),l(S.costUsd===null?"":String(S.costUsd))},[]);k.useEffect(()=>{y()},[y]);const v=(S,x,E)=>{s(j=>({...j,[S]:{...j[S]||{provider:S},[x]:E}}))},b=async()=>{u(!0),f(null);const S={};for(const j of Object.values(a)){const C={},T=Cg(j.tokens),$=Cg(j.requests),R=Cg(j.windowMs);T!==null&&(C.tokensPerWindow=T),$!==null&&(C.requestsPerWindow=$),R!==null&&(C.windowMs=R),S[j.provider]=Object.keys(C).length>0?C:null}const x={quota:S};if(m)if(o.trim()!==""){const j=Number(o);if(!Number.isFinite(j)||j<0){f({ok:!1,text:"Cost cap must be a non-negative number."}),u(!1);return}x.costUsd=j}else x.costUsd=null;const E=await Q.saveAdminQuota(x);u(!1),E.ok?(f({ok:!0,text:"Budget saved โ€” the quota ledger + auto-router will enforce it."}),y()):f({ok:!1,text:E.error||"Save failed."})},w=S=>{const x=n==null?void 0:n.quota[S];return!!x&&(x.tokensPerWindow!==void 0||x.requestsPerWindow!==void 0||x.windowMs!==void 0)},N=S=>"admin-input";return i.jsxs("div",{className:"admin-quota-panel",children:[i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ’ฐ Daily Budget (routing.quota โ€” your plan, your say)"}),i.jsxs("p",{className:"admin-quota-note",children:["Free-tier providers enforce tokens-per-day caps the API doesn't advertise โ€” only you know your plan's allowance. Declare it here and the agent paces around it (parks the provider at the cap, auto-resumes at window rollover) instead of exhausting your budget mid-task. Unset = current behavior. Same config as ",i.jsx("code",{children:"buff model quota set"}),"."]}),h?i.jsx("div",{className:"admin-error",children:h}):null,n?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-quota-table",children:[i.jsxs("div",{className:"admin-quota-row admin-quota-head",children:[i.jsx("span",{children:"Provider"}),i.jsx("span",{children:"Tokens / window"}),i.jsx("span",{children:"Requests / window"}),i.jsx("span",{children:"Window (ms)"}),i.jsx("span",{children:"Status"})]}),n.providers.map(S=>{var x,E,j;return i.jsxs("div",{className:"admin-quota-row",children:[i.jsx("span",{className:"admin-provider-type",children:S}),i.jsx("input",{className:N(!g),type:"number",min:0,placeholder:"unset",disabled:!g,value:((x=a[S])==null?void 0:x.tokens)??"",onChange:C=>v(S,"tokens",C.target.value)}),i.jsx("input",{className:N(!g),type:"number",min:0,placeholder:"unset",disabled:!g,value:((E=a[S])==null?void 0:E.requests)??"",onChange:C=>v(S,"requests",C.target.value)}),i.jsx("input",{className:N(!g),type:"number",min:0,placeholder:"86400000 (24h)",disabled:!g,value:((j=a[S])==null?void 0:j.windowMs)??"",onChange:C=>v(S,"windowMs",C.target.value)}),i.jsx("span",{className:`admin-role-badge ${w(S)?"admin-role-admin":"admin-role-viewer"}`,children:w(S)?"declared":"unset"})]},S)})]}),i.jsxs("div",{className:"admin-quota-row admin-quota-cost",children:[i.jsx("span",{className:"admin-provider-type",children:"Max cost / call (USD, admin)"}),i.jsx("input",{className:N(!m),type:"number",min:0,step:.01,placeholder:"unset",disabled:!m,value:o,onChange:S=>l(S.target.value)}),i.jsx("span",{className:"admin-quota-cost-hint",children:"governance.maxCostUsd โ€” hard admin cap"})]}),g||m?i.jsxs("div",{className:"admin-quota-actions",children:[i.jsx("button",{className:"admin-mini-btn",onClick:()=>void b(),disabled:c,children:c?"โณ Savingโ€ฆ":"๐Ÿ’พ Save budget"}),d?i.jsx("span",{className:d.ok?"admin-quota-ok":"admin-quota-err",children:d.text}):null]}):i.jsxs("div",{className:"admin-readonly-note",children:["๐Ÿ”’ Read-only for ",i.jsx("code",{children:t})," โ€” budget limits need ",i.jsx("code",{children:"admin"})," or"," ",i.jsx("code",{children:"operator"}),"; the cost cap needs ",i.jsx("code",{children:"admin"}),"."]})]}):i.jsx("div",{className:"empty-state",children:"Loading budgetโ€ฆ"})]})}const Noe={env:"Environment",config:"Config",vault:"Vault",local:"Local (no key)",none:"Not configured"};function Eoe(){const[e,t]=k.useState(null),[n,r]=k.useState(!0),[a,s]=k.useState(null),[o,l]=k.useState(null),[c,u]=k.useState(!1),[d,f]=k.useState(!1),[h,p]=k.useState(""),[g,m]=k.useState(""),[y,v]=k.useState(null),[b,w]=k.useState(null),[N,S]=k.useState(""),[x,E]=k.useState(""),[j,C]=k.useState(""),[T,$]=k.useState(null),[R,I]=k.useState(!1),[L,F]=k.useState([]),[z,M]=k.useState(null),[O,U]=k.useState(""),[A,Z]=k.useState(""),[D,P]=k.useState("viewer"),[oe,be]=k.useState([]),[pe,Ce]=k.useState({}),[G,Y]=k.useState(null),[ie,le]=k.useState({}),[X,_e]=k.useState(""),[Ne,je]=k.useState(null),[ge,Le]=k.useState(null),fe=k.useCallback(async()=>{r(!0),s(null);const q=await Q.fetchAdminChecks();t(q),q||s("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),r(!1)},[]),tt=k.useCallback(async()=>{const q=await Q.fetchAdminCatalog();q&&q.length>0&&be(q)},[]),Be=k.useCallback(async()=>{const q=await Q.fetchAdminUsers();q.ok&&q.users&&F(q.users)},[]);k.useEffect(()=>{let q=!0;return Q.fetchAdminAuthStatus().then(me=>{if(q){if(!me){s("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),r(!1);return}l({configured:me.configured,authenticated:me.authenticated}),u(me.authenticated),v(me.role??null),w(me.user??null),f(me.mustChangePassword===!0),me.authenticated?(fe(),tt(),Be()):r(!1)}}),()=>{q=!1}},[fe,tt,Be]);const Ee=y==="admin",Ke=()=>{u(!1),l(q=>q&&{...q,authenticated:!1}),$("Session expired โ€” log in again.")},$t=async q=>{q.preventDefault(),I(!0),$(null);const me=await Q.adminLogin(N,x);me.ok?(u(!0),l({configured:!0,authenticated:!0}),v(me.role??"admin"),w(me.user??null),S(""),E(""),Q.fetchAdminAuthStatus().then(Me=>{Me&&f(Me.mustChangePassword===!0)}),fe(),tt(),Be()):$(me.error||"Login failed."),I(!1)},Rn=async q=>{if(q.preventDefault(),I(!0),$(null),x.length<8){$("Password must be at least 8 characters."),I(!1);return}if(x!==j){$("Passwords do not match."),I(!1);return}const me=await Q.adminSetup(N,x);me.ok?(u(!0),l({configured:!0,authenticated:!0}),v(me.role??"admin"),w(me.user??null),S(""),E(""),C(""),fe(),tt(),Be()):$(me.error||"Setup failed."),I(!1)},en=async()=>{await Q.adminLogout(),u(!1),l(q=>q&&{...q,authenticated:!1}),v(null),w(null),t(null),Ce({}),le({}),F([])},W=async()=>{if(!window.confirm("Stop the running gateway? Channels will stop responding until you restart it with `buff gateway start`."))return;Le("gateway"),je(null);const q=await Q.shutdown("gateway");Le(null),q.ok?je(q.stopped?"โœ… Gateway stopped.":`โ„น๏ธ ${q.reason||"No running gateway found โ€” nothing to stop."}`):(je(`โŒ ${q.error||"Stop failed."}`),q.unauthorized&&Ke())},V=async()=>{window.confirm("Shut down the dashboard? This page will disconnect and the server will exit. Restart with `buff dashboard`.")&&(Le("dashboard"),je("๐Ÿ›‘ Shutting down the dashboard โ€” this page will disconnectโ€ฆ"),await Q.shutdown("dashboard"),Le(null),je("โ„น๏ธ The dashboard server did not stop (see the server terminal). You can also stop it with `buff dashboard stop`."))},ae=async q=>{if(q.preventDefault(),M(null),A.length<8){M("Password must be at least 8 characters.");return}const me=await Q.addAdminUser(O,A,D);me.ok?(U(""),Z(""),M("โœ… User added"),Be()):(M(`โŒ ${me.error||"Failed to add user"}`),me.unauthorized&&Ke())},he=async q=>{if(!window.confirm(`Remove dashboard user '${q}'?`))return;M(null);const me=await Q.removeAdminUser(q);me.ok?(M(`โœ… Removed ${q}`),Be()):(M(`โŒ ${me.error||"Failed to remove user"}`),me.unauthorized&&Ke())},xe=(q,me,Me)=>{Ce(Te=>({...Te,[q]:{...Te[q]||{},[me]:Me}}))},Ge=async q=>{Y(q),le({});const me=pe[q]||{},Me=await Q.saveProvider(q,me);Me.ok?(t(Te=>{if(!Te)return Te;const dn=Te.providers.some(Hr=>Hr.type===q)?Te.providers.map(Hr=>Hr.type===q&&Me.provider?Me.provider:Hr):Me.provider?[...Te.providers,Me.provider]:Te.providers;return{...Te,providers:dn}}),Ce(Te=>{const qn={...Te};return delete qn[q],qn}),le(Te=>({...Te,[q]:"โœ… Saved"}))):(le(Te=>({...Te,[q]:`โŒ ${Me.error||"Save failed"}`})),Me.unauthorized&&Ke()),Y(null)},un=async q=>{if(!window.confirm(`Remove ${q}'s API key and configuration? This cannot be undone.`))return;Y(q),le({});const me=await Q.deleteProvider(q);me.ok?me.envSourced?(t(Me=>Me&&{...Me,providers:Me.providers.map(Te=>Te.type===q&&me.provider||Te)}),le(Me=>({...Me,[q]:`โš ๏ธ Key comes from ${me.envVar?`$${me.envVar}`:"an env var"} โ€” unset it there to remove it (config can't override the env).`}))):(t(Me=>Me&&{...Me,providers:Me.providers.filter(Te=>Te.type!==q)}),Ce(Me=>{const Te={...Me};return delete Te[q],Te})):(le(Me=>({...Me,[q]:`โŒ ${me.error||"Remove failed"}`})),me.unauthorized&&Ke()),Y(null)},Ot=async q=>{Y(q);const me=await Q.testProvider(q);le(Me=>{var Te;return{...Me,[q]:me.ok?`โœ… Connected โ€” ${((Te=me.models)==null?void 0:Te.length)??0} model(s) reachable`:`โŒ ${me.error||"Connection failed"}`}}),Y(null)},Hn=()=>{X&&(Ce(q=>({...q,[X]:{}})),_e(""))};if(a&&!o)return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"๐Ÿ› ๏ธ",title:"Admin"}),i.jsx("div",{className:"admin-error",children:a})]});if(!o||!c&&n)return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"๐Ÿ› ๏ธ",title:"Admin"}),i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Loadingโ€ฆ"})]})]});if(!c){const q=!o.configured;return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"๐Ÿ› ๏ธ",title:`Admin โ€” ${q?"Set up access":"Log in"}`}),i.jsx("p",{className:"admin-subtitle",children:q?"Create the admin user-id and password that gate the dashboard write surface (API-key/provider configuration). The CLI keeps working exactly as before โ€” this only guards the GUI.":"The write surface (API-key/provider configuration) is gated by the admin credentials. Read-only checks stay open."}),i.jsxs("form",{className:"admin-gate-form",onSubmit:q?Rn:$t,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Username"}),i.jsx("input",{type:"text",value:N,onChange:me=>S(me.target.value),autoComplete:"username",placeholder:"admin"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Password"}),i.jsx("input",{type:"password",value:x,onChange:me=>E(me.target.value),autoComplete:q?"new-password":"current-password",placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข"})]}),q?i.jsxs("label",{children:[i.jsx("span",{children:"Confirm password"}),i.jsx("input",{type:"password",value:j,onChange:me=>C(me.target.value),autoComplete:"new-password",placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข"})]}):null,T?i.jsx("div",{className:"admin-error",children:T}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:R||!N||!x,children:R?"โณ โ€ฆ":q?"๐Ÿ” Create admin":"๐Ÿ” Log in"}),q?i.jsxs("p",{className:"admin-hint",children:["Automation alternative: set ",i.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_USER"})," and"," ",i.jsx("code",{children:"NUVIRA_DASHBOARD_ADMIN_PASSWORD"})," in the dashboard's environment."]}):null]})]})}if(d){const q=h.length>0&&h.length<8,me=g.length>0&&g!==h,Me=async Te=>{if(Te.preventDefault(),q||me||!h)return;I(!0),$(null);const qn=await Q.changeAdminPassword(x,h);qn.ok?(f(!1),E(""),p(""),m(""),fe(),tt(),Be()):$(qn.error||"Could not change the password."),I(!1)};return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"๐Ÿ”",title:"Set your own password"}),i.jsxs("p",{className:"admin-subtitle",children:["This dashboard is running on its ",i.jsx("strong",{children:"published default password"}),", so anyone who can reach this port can sign in. Until you replace it, the agent will refuse to save anything โ€” API keys, provider settings, users."]}),i.jsxs("form",{className:"admin-gate-form",onSubmit:Me,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Current password"}),i.jsx("input",{type:"password",value:x,onChange:Te=>E(Te.target.value),autoComplete:"current-password",placeholder:"admin"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"New password"}),i.jsx("input",{type:"password",value:h,onChange:Te=>p(Te.target.value),autoComplete:"new-password",placeholder:"at least 8 characters"})]}),q?i.jsx("div",{className:"admin-error",children:"Use at least 8 characters."}):null,i.jsxs("label",{children:[i.jsx("span",{children:"Confirm new password"}),i.jsx("input",{type:"password",value:g,onChange:Te=>m(Te.target.value),autoComplete:"new-password",placeholder:"repeat it"})]}),me?i.jsx("div",{className:"admin-error",children:"The two passwords do not match."}):null,T?i.jsx("div",{className:"admin-error",children:T}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:R||!x||!h||q||me,children:R?"โณ โ€ฆ":"๐Ÿ” Save new password"})]})]})}const kn=(e==null?void 0:e.system.filter(q=>q.status==="pass").length)??0,Re=(e==null?void 0:e.system.filter(q=>q.status==="warn").length)??0,Gn=(e==null?void 0:e.system.filter(q=>q.status==="fail").length)??0,Lt=(e==null?void 0:e.enterprise.filter(q=>q.status==="pass").length)??0,da=(e==null?void 0:e.enterprise.filter(q=>q.status==="warn").length)??0,Ci=(e==null?void 0:e.enterprise.filter(q=>q.status==="fail").length)??0,lr=(e==null?void 0:e.providers)??[],tn=q=>{const me=oe.find(Me=>Me.id===q);return me||{label:q}};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"๐Ÿ› ๏ธ",title:i.jsxs(i.Fragment,{children:["Admin โ€” Command Runner & Configuration",b?i.jsxs("span",{className:`admin-role-badge admin-role-${y||"viewer"}`,children:[" ",b," ยท ",y||"viewer"]}):null]})}),i.jsxs("div",{className:"admin-header-actions",children:[i.jsx("button",{className:"admin-refresh-btn",onClick:()=>void fe(),disabled:n,children:n?"โณ Running checksโ€ฆ":"๐Ÿ”„ Refresh (run all commands)"}),Ee||y==="operator"?i.jsx("button",{className:"admin-logout-btn",onClick:()=>void W(),disabled:ge!==null,title:"Stop the running gateway (buff gateway stop)",children:ge==="gateway"?"โณ Stoppingโ€ฆ":"โป Stop gateway"}):null,Ee?i.jsx("button",{className:"admin-logout-btn",onClick:()=>void V(),disabled:ge!==null,title:"Shut down this dashboard server (buff dashboard stop)",children:ge==="dashboard"?"โณ Stoppingโ€ฆ":"๐Ÿ›‘ Stop dashboard"}):null,i.jsx("button",{className:"admin-logout-btn",onClick:()=>void en(),children:"๐Ÿšช Log out"})]})]}),Ne?i.jsx("div",{className:"admin-error",children:Ne}):null,Ee?null:i.jsxs("div",{className:"admin-readonly-note",children:["๐Ÿ”’ Your role (",i.jsx("code",{children:y||"viewer"}),") is read-only here โ€” provider configuration and user management require the ",i.jsx("code",{children:"admin"})," role. The CLI enforces the same governance policy (rbac.json)."]}),i.jsx("p",{className:"admin-subtitle",children:"The dashboard executes the same state commands as the CLI โ€” no command needed. Provider keys are masked here and every write goes through the same config the CLI uses."}),a?i.jsx("div",{className:"admin-error",children:a}):null,e?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card admin-summary-pass",children:[i.jsx("div",{className:"admin-summary-value",children:kn+Lt}),i.jsx("div",{className:"admin-summary-label",children:"โœ… Passing"})]}),i.jsxs("div",{className:"admin-summary-card admin-summary-warn",children:[i.jsx("div",{className:"admin-summary-value",children:Re+da}),i.jsx("div",{className:"admin-summary-label",children:"โš ๏ธ Warnings"})]}),i.jsxs("div",{className:"admin-summary-card admin-summary-fail",children:[i.jsx("div",{className:"admin-summary-value",children:Gn+Ci}),i.jsx("div",{className:"admin-summary-label",children:"โŒ Failing"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:lr.length}),i.jsx("div",{className:"admin-summary-label",children:"Providers"})]})]}),i.jsx("h2",{className:"section-subtitle",children:"โš™๏ธ System Checks (buff doctor)"}),i.jsx("div",{className:"admin-check-list",children:e.system.map(q=>i.jsx(yb,{check:q},q.name))}),i.jsx("h2",{className:"section-subtitle",children:"๐Ÿฅ Enterprise Self-Check (doctor --enterprise)"}),i.jsx("div",{className:"admin-check-list",children:e.enterprise.length>0?e.enterprise.map(q=>i.jsx(yb,{check:q},q.name)):i.jsx("div",{className:"empty-state",children:"No enterprise checks returned."})}),i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ”‘ Provider Configuration (keys masked)"}),i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Provider"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Key"}),i.jsx("th",{children:"Base URL"}),i.jsx("th",{children:"Model"}),i.jsx("th",{children:"Actions"})]})}),i.jsxs("tbody",{children:[lr.map(q=>{const me=tn(q.type),Me=pe[q.type]||{};return i.jsxs("tr",{children:[i.jsxs("td",{className:"admin-provider-type",children:[me.icon?`${me.icon} `:"",me.label,i.jsxs("div",{className:"admin-provider-sub",children:[q.type," ยท ",Noe[q.keySource]||q.keySource]}),q.keySource==="env"?i.jsxs("div",{className:"admin-hint",children:["comes from ",me.envVar||"env var"," โ€” change it there, config can't override it"]}):q.keySource==="vault"?i.jsx("div",{className:"admin-hint",children:"stored in the OS keyring (vault)"}):null]}),i.jsx("td",{children:i.jsx("span",{className:`admin-check-badge ${q.configured?"admin-check-pass":"admin-check-warn"}`,children:q.configured?"โœ… Configured":"โš ๏ธ Not configured"})}),i.jsx("td",{children:me.keyless?i.jsx("div",{className:"admin-hint",children:"No key needed (probed)"}):Ee?i.jsx("input",{className:"admin-input admin-key-input",type:"password","aria-label":`${q.type} API key`,placeholder:q.keyMasked||"set a new keyโ€ฆ",value:Me.apiKey??"",onChange:Te=>xe(q.type,"apiKey",Te.target.value),autoComplete:"new-password"}):i.jsx("div",{className:"admin-hint",children:q.keyMasked||"โ€”"})}),i.jsx("td",{children:Ee?i.jsx("input",{className:"admin-input",type:"text","aria-label":`${q.type} base URL`,placeholder:q.baseUrl||"default endpoint",value:Me.baseUrl??"",onChange:Te=>xe(q.type,"baseUrl",Te.target.value)}):i.jsx("div",{className:"admin-hint",children:q.baseUrl?q.baseUrl.replace(/^https?:\/\/(?:[^@/]*@)?/,""):"default endpoint"})}),i.jsx("td",{children:Ee?i.jsx("input",{className:"admin-input",type:"text","aria-label":`${q.type} model`,placeholder:q.model||"default model",value:Me.model??"",onChange:Te=>xe(q.type,"model",Te.target.value)}):i.jsx("div",{className:"admin-hint",children:q.model||"default model"})}),i.jsx("td",{children:Ee?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-row-actions",children:[i.jsx("button",{className:"admin-mini-btn",disabled:G===q.type,onClick:()=>void Ge(q.type),children:"๐Ÿ’พ Save"}),i.jsx("button",{className:"admin-mini-btn",disabled:G===q.type,title:"Tests the SAVED configuration โ€” save first to test a new key",onClick:()=>void Ot(q.type),children:"๐Ÿ”Œ Test"}),i.jsx("button",{className:"admin-mini-btn admin-mini-danger",disabled:G===q.type,onClick:()=>void un(q.type),children:"๐Ÿ—‘ Remove"})]}),ie[q.type]?i.jsx("div",{className:"admin-row-msg",children:ie[q.type]}):null]}):i.jsx("div",{className:"admin-hint",children:"read-only"})})]},q.type)}),lr.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:6,className:"admin-empty-cell",children:"No providers configured yet."})}):null]})]})}),Ee&&oe.length>0?i.jsxs("div",{className:"admin-add-provider",children:[i.jsxs("select",{className:"admin-input",value:X,onChange:q=>_e(q.target.value),children:[i.jsx("option",{value:"",children:"Add a providerโ€ฆ"}),oe.filter(q=>!lr.some(me=>me.type===q.id)).map(q=>i.jsxs("option",{value:q.id,children:[q.icon?`${q.icon} `:"",q.label," (",q.id,")"]},q.id))]}),i.jsx("button",{className:"admin-mini-btn",disabled:!X,onClick:Hn,children:"โž• Add"})]}):null,i.jsx(koe,{authed:c,role:y||"viewer"}),Ee?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ‘ฅ Dashboard Users (role.manage)"}),i.jsxs("div",{className:"admin-users-list",children:[L.map(q=>i.jsxs("div",{className:"admin-user-row",children:[i.jsx("span",{className:"admin-user-name",children:q.user}),i.jsx("span",{className:`admin-role-badge admin-role-${q.role}`,children:q.role}),i.jsxs("span",{className:"admin-user-since",children:["since ",new Date(q.createdAt).toLocaleDateString()]}),q.user!==b?i.jsx("button",{className:"admin-mini-btn admin-mini-danger",onClick:()=>void he(q.user),children:"๐Ÿ—‘ Remove user"}):i.jsx("span",{className:"admin-hint",children:"you"})]},q.user)),L.length===0?i.jsx("div",{className:"empty-state",children:"No dashboard users yet."}):null]}),i.jsxs("form",{className:"admin-gate-form admin-user-form",onSubmit:ae,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Username"}),i.jsx("input",{type:"text",value:O,onChange:q=>U(q.target.value),autoComplete:"off"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Password (min 8 chars)"}),i.jsx("input",{type:"password",value:A,onChange:q=>Z(q.target.value),autoComplete:"new-password"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Role"}),i.jsxs("select",{value:D,onChange:q=>P(q.target.value),children:[i.jsx("option",{value:"viewer",children:"viewer โ€” read-only"}),i.jsx("option",{value:"operator",children:"operator โ€” read-only in the dashboard today"}),i.jsx("option",{value:"admin",children:"admin โ€” full control"})]})]}),z?i.jsx("div",{className:"admin-row-msg",children:z}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:!O||!A,children:"โž• Add user"})]})]}):null]}):n?i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Running all state checksโ€ฆ"})]}):null]})}function JR(e){return String(e??"").replace(/\d{3,}/g,t=>t.slice(0,2)+"***")}const joe={idle:"Not paired",pairing:"โณ Pairingโ€ฆ",paired:"โœ… Paired",failed:"โŒ Pairing failed",cancelled:"โน Cancelled",error:"๐Ÿ’ฅ Pairing error"};function _oe({authed:e,canWrite:t,sessionExpired:n,reveal:r=!1}){const[a,s]=k.useState(null),[o,l]=k.useState({}),[c,u]=k.useState(""),[d,f]=k.useState(!1),[h,p]=k.useState(null),g=k.useRef(null),m=k.useCallback(async()=>{const x=await Q.getWhatsAppStatus();x&&(s(x.status),l(x.contacts??{}))},[]);k.useEffect(()=>{if(m(),!e||typeof EventSource>"u")return;const x=Q.subscribeWhatsApp({onQr:E=>s(j=>j&&{...j,qr:E,state:"pairing"}),onCode:E=>s(j=>j&&{...j,pairingCode:E}),onStatus:E=>{s(E),(E.state==="paired"||E.state==="failed"||E.state==="error"||E.state==="cancelled")&&f(!1)}});return g.current=x,()=>{x(),g.current=null}},[e,m]);const y=async x=>{f(!0),p(null);const E=await x();if(!E.ok&&E.error&&/Not authenticated|Session expired/i.test(E.error)){n(),f(!1);return}E.ok?(p({kind:"ok",text:"Done."}),await m()):p({kind:"err",text:E.error||"Action failed."}),f(!1)},v=x=>{p(null),y(()=>Q.startWhatsAppPair(x?c.trim():void 0)).then(()=>u(""))},b=()=>{p(null),y(()=>Q.cancelWhatsAppPair())},w=()=>{window.confirm("Remove the paired WhatsApp session from this machine? You will need to scan a QR to pair again.")&&(p(null),y(()=>Q.unpairWhatsApp()))},N=(a==null?void 0:a.state)??"idle",S=N==="pairing";return i.jsxs("div",{className:"wa-panel",children:[i.jsxs("div",{className:"wa-panel-head",children:[i.jsx("span",{className:"wa-panel-title",children:"๐ŸŸข WhatsApp bridge"}),a?i.jsx("span",{className:`wa-badge ${a.paired?"wa-badge-paired":S?"wa-badge-pairing":""}`,children:joe[N]}):i.jsx("span",{className:"admin-hint",children:"loadingโ€ฆ"})]}),i.jsxs("p",{className:"admin-hint",children:["The personal Baileys bridge (no Meta Business account) โ€” pair once, and the gateway can send & receive WhatsApp. Session: ",i.jsx("code",{children:(a==null?void 0:a.sessionDir)??"~/.buff/whatsapp/session"}),". Same engine as"," ",i.jsx("code",{children:"buff whatsapp pair"}),"."]}),S?i.jsxs("div",{className:"wa-pairing",children:[a!=null&&a.qr?i.jsxs("div",{className:"wa-qr-box",children:[i.jsx("img",{className:"wa-qr-img",src:a.qr,alt:"WhatsApp pairing QR code"}),i.jsxs("p",{className:"admin-hint",children:["Open WhatsApp on the phone โ†’ ",i.jsx("strong",{children:"Linked devices โ†’ Link a device โ†’ scan"}),". The QR refreshes automatically while this window is open."]})]}):a!=null&&a.phone?i.jsxs("div",{className:"wa-code-box",children:[i.jsxs("p",{className:"admin-hint",children:["On the phone with ",i.jsx("strong",{children:a.phone}),": WhatsApp โ†’ Linked devices โ†’ Link a device โ†’"," ",i.jsx("strong",{children:"โ€œLink with phone number insteadโ€"})," โ†’ enter:"]}),i.jsx("div",{className:"wa-code",children:a.pairingCode??"โ€ฆ waiting for code"})]}):i.jsx("div",{className:"wa-code-box",children:i.jsx("p",{className:"admin-hint",children:"Waiting for WhatsApp to hand over a QRโ€ฆ (it usually appears within a few seconds)"})}),a!=null&&a.phone?null:i.jsxs("div",{className:"admin-hint",children:["Tip: on a phone, โ€œLink with phone number insteadโ€ needs the number format"," ",i.jsx("code",{children:"918844433322"})," (country code included) โ€” enter it below instead of scanning."]}),a!=null&&a.error?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:a.error}):null,t&&e?i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:b,disabled:d,children:d?"โณโ€ฆ":"โน Cancel pairing"}):null]}):i.jsxs("div",{className:"wa-actions",children:[t&&e?a!=null&&a.paired?i.jsxs("div",{className:"wa-action-row",children:[i.jsx("button",{className:"admin-refresh-btn wa-unpair-btn",type:"button",onClick:w,disabled:d,children:d?"โณโ€ฆ":"๐Ÿ—‘ Unpair (remove session)"}),i.jsx("span",{className:"admin-hint",children:"Removes creds.json โ€” you will need to scan a QR again."})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"wa-action-row",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>v(!1),disabled:d,children:d?"โณโ€ฆ":"๐Ÿ”ณ Pair with a QR"}),i.jsx("span",{className:"admin-hint",children:"Scans from the phone you want to link."})]}),i.jsxs("div",{className:"wa-action-row wa-phone-row",children:[i.jsx("input",{type:"text",className:"wa-phone-input",value:c,onChange:x=>u(x.target.value),placeholder:"or pair with a number โ€” e.g. 918844433322",disabled:d,maxLength:16}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>v(!0),disabled:d||!c.trim(),children:"Pair by number"})]})]}):null,N==="failed"||N==="error"||N==="cancelled"?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:(a==null?void 0:a.error)||(N==="cancelled"?"Pairing cancelled.":"Pairing failed โ€” try again.")}):null,e?t?null:i.jsx("div",{className:"admin-row-msg",children:"Your role can view pairing status but not change it (requires admin or operator)."}):i.jsx("div",{className:"admin-row-msg",children:"Log in (admin or operator) to pair, cancel, or unpair."}),h?i.jsx("div",{className:`admin-row-msg${h.kind==="ok"?"":" admin-row-msg-err"}`,children:h.text}):null]}),i.jsxs("div",{className:"wa-contacts",children:[i.jsxs("div",{className:"wa-contacts-head",children:[i.jsx("span",{className:"wa-panel-title",children:"๐Ÿ“‡ Send-by-name contacts"}),i.jsxs("span",{className:"admin-hint",children:[Object.keys(o).length," mapped"]})]}),i.jsxs("p",{className:"admin-hint",children:["These names are for ",i.jsx("strong",{children:"sending messages by name"})," (e.g."," ",i.jsx("code",{children:'buff gateway send whatsapp:Name "โ€ฆ"'}),") โ€” they do"," ",i.jsx("strong",{children:"NOT"})," let these numbers trigger the agent."]}),i.jsx("div",{className:"hub-alias-list",children:Object.keys(o).length===0?i.jsxs("span",{className:"admin-hint",children:["(none โ€” add one with ",i.jsx("code",{children:"buff whatsapp contact add <Name> <number>"}),")"]}):Object.entries(o).map(([x,E])=>i.jsxs("div",{className:"hub-alias-row",children:[i.jsx("span",{className:"hub-chip",children:x}),i.jsxs("span",{className:"admin-hint",children:["โ†’ ",r?E:JR(E)]})]},x))}),i.jsxs("p",{className:"admin-hint",style:{marginTop:8},children:["To let a number ",i.jsx("strong",{children:"trigger the agent"})," (respond to its messages), add it to the"," ",i.jsx("strong",{children:"verified list"})," in the ",i.jsx("strong",{children:"Permissions tab above"}),", or run"," ",i.jsx("code",{children:"buff config gateway allow whatsapp user <number>"}),"."]})]})]})}function Aoe({canWrite:e,sessionExpired:t,mode:n="grid"}){const[r,a]=k.useState(null),[s,o]=k.useState(null),[l,c]=k.useState(null),[u,d]=k.useState(null),[f,h]=k.useState(null),[p,g]=k.useState(0),[m,y]=k.useState({}),[v,b]=k.useState(!1),[w,N]=k.useState(null),S=k.useRef(!0),x=k.useCallback(async()=>{const I=await Q.getPlatformConfigs();S.current&&a(I)},[t]);k.useEffect(()=>(x(),()=>{S.current=!1}),[x]);const E=async(I,L)=>{c(I),d(null);const F=await Q.setPlatformConfig(I,L);if(S.current){if(c(null),F.unauthorized||F.forbidden){t(F.error);return}d({kind:F.ok?"ok":"err",text:F.ok?"Saved โ€” transport active.":F.error||"Save failed."}),F.ok&&(o(null),x())}},j=async I=>{if(!window.confirm(`Remove ${I} transport config? Tokens will be deleted from ~/.buff/.env.`))return;c(I),d(null);const L=await Q.removePlatformConfig(I);if(S.current){if(c(null),L.unauthorized||L.forbidden){t(L.error);return}d({kind:L.ok?"ok":"err",text:L.ok?"Removed.":L.error||"Remove failed."}),L.ok&&x()}},C={telegram:{steps:["Open Telegram and search for @BotFather","Send /newbot to BotFather and follow the prompts",'Give your bot a name (e.g. "My Agent Bot")','Give your bot a username (must end with "bot", e.g. "my_agent_bot")',"BotFather will give you a token โ€” paste it in the field below","Open your bot in Telegram and send it a message (e.g. /start)"],postSetup:["Start the gateway: buff gateway start (or from the Gateway tab)","Open your bot in Telegram and send a message โ€” the agent replies!"]},discord:{steps:["Go to https://discord.com/developers/applications",'Click "New Application" โ†’ give it a name โ†’ Create','Go to "Bot" in the left sidebar โ†’ click "Add Bot"','Under "Token", click "Copy" to copy the bot token','Enable "Message Content Intent" under Privileged Gateway Intents',"Invite the bot to your server with the OAuth2 URL generator"],postSetup:["Start the gateway: buff gateway start","Mention the bot in a Discord channel or send it a DM","The agent will reply automatically!"]},slack:{steps:["Go to https://api.slack.com/apps",'Click "Create New App" โ†’ "From scratch"',"Add Bot Token Scopes: chat:write, im:read, im:write","Install the app to your workspace","Copy the Bot User OAuth Token (starts with xoxb-)"],postSetup:["Start the gateway: buff gateway start","DM the bot or mention it in a channel","The agent will reply automatically!"]},email:{steps:["You need an SMTP relay (Gmail, SendGrid, Mailgun, etc.)","For Gmail: use smtp.gmail.com:587 with an App Password","For SendGrid/Mailgun: get SMTP credentials from their dashboard"],postSetup:["Start the gateway: buff gateway start","Send an email to the configured address","The agent will reply via email!"]}},T=I=>{e&&(h(I),g(0),y(Object.fromEntries(I.envVars.map(L=>[L.varName,L.value]))),N(null))},$=async()=>{if(!f||!e)return;b(!0),N(null);const I=await Q.setPlatformConfig(f.platform,m);if(b(!1),I.unauthorized||I.forbidden){t(I.error);return}I.ok?(N({kind:"ok",text:"โœ… Token saved! The transport is now active."}),x()):N({kind:"err",text:I.error||"Save failed."})};if(r===null)return i.jsx("div",{className:"empty-state",children:"Loading platform transportsโ€ฆ"});const R=f?C[f.platform]:null;return n==="table"?i.jsxs(i.Fragment,{children:[f&&R?i.jsx("div",{className:"wizard-overlay",onClick:()=>h(null),children:i.jsxs("div",{className:"wizard-modal",onClick:I=>I.stopPropagation(),children:[i.jsxs("div",{className:"wizard-header",children:[i.jsx("span",{className:"wizard-icon",children:"๐Ÿš€"}),i.jsxs("span",{className:"wizard-title",children:["Getting Started: ",f.label]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>h(null),children:"โœ•"})]}),i.jsx("div",{className:"wizard-body",children:p===0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"๐Ÿ“‹ Steps to create your bot:"}),i.jsx("ol",{className:"wizard-steps",children:R.steps.map((I,L)=>i.jsx("li",{children:I},L))}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>g(1),children:"I have my token โ†’"}),f.setupUrl?i.jsx("a",{href:f.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"๐Ÿ“– Docs"}):null]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"๐Ÿ”‘ Paste your token:"}),f.envVars.map(I=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:I.prompt}),i.jsx("input",{type:I.secret?"password":"text",value:m[I.varName]??"",onChange:L=>y(F=>({...F,[I.varName]:L.target.value})),placeholder:I.secret?"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},I.varName)),w?i.jsx("div",{className:`admin-row-msg${w.kind==="ok"?"":" admin-row-msg-err"}`,children:w.text}):null,i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>g(0),children:"โ† Back"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void $(),disabled:v||!e,children:v?"โณ Savingโ€ฆ":"๐Ÿ’พ Save token"})]}),(w==null?void 0:w.kind)==="ok"?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"๐Ÿ“‹ Next steps:"}),i.jsx("ol",{className:"wizard-steps",children:R.postSetup.map((I,L)=>i.jsx("li",{children:I},L))})]}):null]})})]})}):null,u?i.jsx("div",{className:`admin-row-msg${u.kind==="ok"?"":" admin-row-msg-err"}`,children:u.text}):null,i.jsx("div",{className:"platform-config-table-wrapper",children:i.jsxs("table",{className:"platform-config-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Platform"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Configuration"}),i.jsx("th",{children:"CLI Command"})]})}),i.jsx("tbody",{children:r.map(I=>i.jsxs(H.Fragment,{children:[i.jsxs("tr",{className:`platform-config-row ${I.configured?"configured":""}`,children:[i.jsxs("td",{className:"platform-config-name",children:[i.jsx("span",{className:"hub-platform-label",children:I.label}),i.jsx("span",{className:"hub-card-id",children:I.platform})]}),i.jsxs("td",{children:[i.jsx("span",{className:`status-dot ${I.configured?"connected":"reconnecting"}`}),i.jsx("span",{className:"platform-config-status-text",children:I.configured?"Active":"Not configured"})]}),i.jsxs("td",{className:"platform-config-actions",children:[I.configured?null:i.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>T(I),disabled:!e,children:"๐Ÿš€ Getting Started"}),I.setupUrl?i.jsx("a",{href:I.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"๐Ÿ“– Docs"}):null,i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>o(s===I.platform?null:I.platform),disabled:!e,children:s===I.platform?"โ–ด Close":I.configured?"โœŽ Edit":"โš™ Configure"}),I.configured?i.jsx("button",{type:"button",className:"admin-mini-btn contact-delete-btn",onClick:()=>void j(I.platform),disabled:!e,children:"๐Ÿ—‘๏ธ"}):null]}),i.jsx("td",{className:"platform-config-cli",children:i.jsxs("code",{children:["buff gateway setup ",I.platform]})})]}),s===I.platform?i.jsx("tr",{className:"platform-config-expanded",children:i.jsx("td",{colSpan:4,children:i.jsxs("div",{className:"platform-config-form",children:[I.envVars.map(L=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:L.prompt}),i.jsx("input",{type:L.secret?"password":"text",value:L.value,readOnly:!0,className:"platform-config-readonly",placeholder:L.secret?"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข":"value"})]},L.varName)),i.jsxs("p",{className:"admin-hint",children:["Tokens are in ",i.jsx("code",{children:"~/.buff/.env"})," โ€” edit there or use the wizard above."]})]})})}):null]},I.platform))})]})})]}):i.jsxs(i.Fragment,{children:[f&&R?i.jsx("div",{className:"wizard-overlay",onClick:()=>h(null),children:i.jsxs("div",{className:"wizard-modal",onClick:I=>I.stopPropagation(),children:[i.jsxs("div",{className:"wizard-header",children:[i.jsx("span",{className:"wizard-icon",children:"๐Ÿš€"}),i.jsxs("span",{className:"wizard-title",children:["Getting Started: ",f.label]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>h(null),children:"โœ•"})]}),i.jsx("div",{className:"wizard-body",children:p===0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"๐Ÿ“‹ Steps to create your bot:"}),i.jsx("ol",{className:"wizard-steps",children:R.steps.map((I,L)=>i.jsx("li",{children:I},L))}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>g(1),children:"I have my token โ†’"}),f.setupUrl?i.jsx("a",{href:f.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"๐Ÿ“– Open docs in new tab"}):null]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"๐Ÿ”‘ Paste your token:"}),f.envVars.map(I=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:I.prompt}),i.jsx("input",{type:I.secret?"password":"text",value:m[I.varName]??"",onChange:L=>y(F=>({...F,[I.varName]:L.target.value})),placeholder:I.secret?"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},I.varName)),w?i.jsx("div",{className:`admin-row-msg${w.kind==="ok"?"":" admin-row-msg-err"}`,children:w.text}):null,i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>g(0),children:"โ† Back"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void $(),disabled:v||!e,children:v?"โณ Savingโ€ฆ":"๐Ÿ’พ Save token"})]}),(w==null?void 0:w.kind)==="ok"?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"๐Ÿ“‹ Next steps:"}),i.jsx("ol",{className:"wizard-steps",children:R.postSetup.map((I,L)=>i.jsx("li",{children:I},L))})]}):null]})})]})}):null,i.jsxs("div",{className:"platform-config",children:[i.jsx("h2",{className:"section-subtitle",children:"โš™๏ธ Platform transports (buff config gateway)"}),u?i.jsx("div",{className:`admin-row-msg${u.kind==="ok"?"":" admin-row-msg-err"}`,children:u.text}):null,i.jsx("div",{className:"hub-platform-grid",children:r.map(I=>i.jsx(Coe,{entry:I,canWrite:e,busy:l===I.platform,expanded:s===I.platform,onToggle:()=>o(s===I.platform?null:I.platform),onSave:L=>void E(I.platform,L),onRemove:()=>void j(I.platform),onStartWizard:()=>T(I)},I.platform))}),i.jsxs("p",{className:"admin-hint",children:["Tokens are written to ",i.jsx("code",{children:"~/.buff/.env"})," (loaded by both the CLI and this dashboard at startup) โ€” no env vars to hand-export. The WhatsApp personal bridge is configured separately above via QR/code pairing."]})]})]})}function Coe(e){const{entry:t,canWrite:n,busy:r,expanded:a,onToggle:s,onSave:o,onRemove:l,onStartWizard:c}=e,[u,d]=k.useState(()=>Object.fromEntries(t.envVars.map(h=>[h.varName,h.value]))),f=(h,p)=>{d(g=>({...g,[h]:p}))};return i.jsxs("div",{className:`hub-platform${t.configured?" configured":""}`,children:[i.jsxs("div",{className:"hub-platform-head",children:[i.jsx("span",{className:`status-dot ${t.configured?"connected":"reconnecting"}`}),i.jsx("span",{className:"hub-platform-label",children:t.label}),i.jsx("span",{className:"hub-card-id",children:t.platform}),t.configured?null:i.jsx("button",{type:"button",className:"wizard-start-btn",onClick:c,disabled:!n,title:"Step-by-step setup wizard",children:"๐Ÿš€ Getting Started"}),t.setupUrl?i.jsx("a",{href:t.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",title:"Setup documentation",children:"๐Ÿ“– Docs"}):null,i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:s,disabled:!n,children:a?"โ–ด Collapse":t.configured?"โœŽ Edit":"โš™ Configure"})]}),!a&&t.setupHint&&!t.configured?i.jsx("div",{className:"platform-setup-hint",children:t.setupHint}):null,a?i.jsxs("div",{className:"platform-config-form",children:[t.setupHint?i.jsx("div",{className:"platform-setup-hint",children:t.setupHint}):null,t.envVars.map(h=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:h.prompt}),i.jsx("input",{type:h.secret?"password":"text",value:u[h.varName]??"",onChange:p=>f(h.varName,p.target.value),placeholder:h.secret?"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข":"value",autoComplete:"off",spellCheck:!1,maxLength:512})]},h.varName)),i.jsxs("div",{className:"platform-config-actions",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>o(u),disabled:r||!n,children:r?"โณ Savingโ€ฆ":"๐Ÿ’พ Save"}),t.configured?i.jsx("button",{type:"button",className:"hub-remove-btn",onClick:l,disabled:r||!n,children:"๐Ÿ—‘ Remove"}):null]})]}):i.jsx("div",{className:"hub-platform-env",children:t.envVars.map(h=>i.jsxs("div",{children:[i.jsx("code",{children:h.varName})," ",h.set?"โœ“ set":"โ€” unset"]},h.varName))})]})}const Toe=[{id:"tools",label:"Tools",icon:"๐Ÿงฐ"},{id:"channels",label:"Channels",icon:"๐Ÿ“ก"},{id:"conversations",label:"Conversations",icon:"๐Ÿ’ฌ"},{id:"artifacts",label:"Artifacts",icon:"๐Ÿ“ฆ"},{id:"skills",label:"Skills",icon:"๐Ÿง "},{id:"subagents",label:"Subagents",icon:"๐Ÿค–"}],Ooe={pending:"โณ pending",sent:"โœ… sent",failed:"โŒ failed"},Poe=5e3,Roe={spawning:"โณ spawning",running:"โ–ถ running",completed:"โœ… completed",failed:"โŒ failed",timeout:"โฐ timed out",killed:"โ›” killed"};function Moe(e){const t=typeof document<"u"?document.documentElement:null,n=(r,a)=>!t||typeof getComputedStyle!="function"?a:getComputedStyle(t).getPropertyValue(r).trim()||a;return{canvas:n("--bg-primary","Canvas"),text:n("--text-primary","CanvasText"),muted:n("--text-muted","GrayText"),userBubble:n("--accent-blue","Highlight"),onUserBubble:n("--text-on-accent","HighlightText"),agentBubble:n("--bg-card","ButtonFace")}}function Vs(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Ioe(e,t,n=new Date){const r=Vs(e.displayName),a=Vs(e.platform),s=e.messages.map(o=>{const l=o.role==="user",c=l?"user":"assistant",u=Vs(l?e.displayName:"Agent");return`<div class="msg msg-${c}">
135
- <div class="bubble bubble-${c}">${Vs(o.content)}</div>
136
- <div class="timestamp">${u} ยท ${Vs(new Date(o.ts).toLocaleString())}</div>
137
- </div>`}).join(`
138
- `);return`<!DOCTYPE html>
139
- <html lang="en">
140
- <head>
141
- <meta charset="utf-8">
142
- <title>Conversation with ${r}</title>
143
- <style>
144
- body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 700px; margin: 40px auto; padding: 0 20px; background: ${t.canvas}; color: ${t.text}; line-height: 1.6; }
145
- h1 { font-size: 20px; margin-bottom: 4px; }
146
- .meta { color: ${t.muted}; font-size: 13px; margin-bottom: 20px; }
147
- .msg { margin-bottom: 16px; }
148
- .msg-user { text-align: right; }
149
- .msg-assistant { text-align: left; }
150
- .bubble { display: inline-block; max-width: 80%; padding: 10px 14px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; word-break: break-word; text-align: left; }
151
- .bubble-user { background: ${t.userBubble}; color: ${t.onUserBubble}; border-bottom-right-radius: 4px; }
152
- .bubble-assistant { background: ${t.agentBubble}; color: ${t.text}; border-bottom-left-radius: 4px; }
153
- .timestamp { font-size: 11px; color: ${t.muted}; margin-top: 2px; }
154
- @media print { body { margin: 0; } }
155
- </style>
156
- </head>
157
- <body>
158
- <h1>Conversation with ${r}</h1>
159
- <div class="meta">Platform: ${a} ยท ${e.messageCount} messages ยท Exported: ${Vs(n.toLocaleString())}</div>
160
- ${s}
161
- </body>
162
- </html>`}function $oe(){var zt,Mn,kt,Kr,Yn,we,Ue,ct,Ct,nn,yw,bw,xw,ww,Sw;const[e,t]=k.useState("tools"),[n,r]=k.useState(null),[a,s]=k.useState(!0),[o,l]=k.useState(null),[c,u]=k.useState(!1),[d,f]=k.useState(null),[h,p]=k.useState(!1),[g,m]=k.useState(null),[y,v]=k.useState(null),[b,w]=k.useState(""),[N,S]=k.useState(""),[x,E]=k.useState(null),[j,C]=k.useState(!1),[T,$]=k.useState(null),[R,I]=k.useState(null),[L,F]=k.useState({}),[z,M]=k.useState(""),[O,U]=k.useState(""),[A,Z]=k.useState(!1),[D,P]=k.useState(null),[oe,be]=k.useState(!1),[pe,Ce]=k.useState({}),[G,Y]=k.useState(!1),[ie,le]=k.useState(null),[X,_e]=k.useState({}),[Ne,je]=k.useState({}),[ge,Le]=k.useState({}),[fe,tt]=k.useState(!1),[Be,Ee]=k.useState(null),[Ke,$t]=k.useState(""),[Rn,en]=k.useState(null),[W,V]=k.useState(!1),[ae,he]=k.useState(new Map),[xe,Ge]=k.useState(new Set),[un,Ot]=k.useState(!1),[Hn,kn]=k.useState([]),[Re,Gn]=k.useState(""),[Lt,da]=k.useState(null),[Ci,lr]=k.useState(""),[tn,q]=k.useState([]),[me,Me]=k.useState(0),[Te,qn]=k.useState(0),[dn,Hr]=k.useState(!0),[Nn,Os]=k.useState(!1),[Nl,Yu]=k.useState(!1),Xu=20,Ti=k.useRef(null),fa=k.useCallback(async(_=!1)=>{if(Nn)return;const K=_?0:Te;Os(!0);try{const ne=await Q.fetchGatewayConversations({offset:K,limit:Xu,q:Ke||void 0});ne.ok&&ne.conversations&&(q(re=>_?ne.conversations:[...re,...ne.conversations]),Me(ne.total??0),qn(K+ne.conversations.length),Hr(ne.hasMore??!1))}catch{}Os(!1)},[Nn,Te,Ke]);k.useEffect(()=>{e==="conversations"&&!Nl&&!Nn&&(Yu(!0),fa(!0))},[e,Nl,Nn,fa]),k.useEffect(()=>{const _=Ti.current;if(!_)return;const K=new IntersectionObserver(ne=>{var re;(re=ne[0])!=null&&re.isIntersecting&&dn&&!Nn&&fa(!1)},{threshold:.1});return K.observe(_),()=>K.disconnect()},[dn,Nn,fa]),k.useEffect(()=>{const _=setTimeout(()=>{e==="conversations"&&Nl&&(q([]),qn(0),Hr(!0),fa(!0))},300);return()=>clearTimeout(_)},[Ke]),k.useEffect(()=>Q.onTypingEvent(K=>{he(ne=>{const re=new Map(ne),ue=`${K.platform}:${K.channelId}`;return K.typing?re.set(ue,{platform:K.platform,channelId:K.channelId,startedAt:Date.now()}):re.delete(ue),re})}),[]);const lm=k.useCallback((_,K)=>{K.stopPropagation(),Ge(ne=>{const re=new Set(ne);return re.has(_)?re.delete(_):re.add(_),re})},[]),cm=k.useCallback(()=>{Ge(_=>_.size===tn.length?new Set:new Set(tn.map(K=>K.key)))},[tn]),Zu=k.useCallback(async()=>{if(xe.size!==0){Ot(!0);try{await Q.exportGatewayConversations([...xe])}catch{}Ot(!1)}},[xe]);k.useEffect(()=>{e==="conversations"&&Q.getAllConversationTags().then(_=>{_.ok&&_.tags&&kn(_.tags)})},[e]);const El=k.useCallback(async(_,K)=>{if(!K.trim())return;(await Q.addConversationTag(_,K.trim())).ok&&(q(re=>re.map(ue=>ue.key===_?{...ue,tags:[...ue.tags??[],K.trim().toLowerCase()]}:ue)),kn(re=>re.includes(K.trim().toLowerCase())?re:[...re,K.trim().toLowerCase()].sort())),da(null),lr("")},[]),jl=k.useCallback(async(_,K)=>{(await Q.removeConversationTag(_,K)).ok&&q(re=>re.map(ue=>ue.key===_?{...ue,tags:(ue.tags??[]).filter(Pe=>Pe!==K)}:ue))},[]),_l=k.useCallback((_,K)=>{K.stopPropagation();const ne=_.contactName||_.channelId,re=[`Conversation with ${ne} (${_.platform})`,`Exported: ${new Date().toLocaleString()}`,`Messages: ${_.messageCount}`,"โ”€".repeat(50),""];if(_.messages)for(const Et of _.messages){const Se=Et.role==="user"?ne:"Agent",jt=new Date(Et.ts).toLocaleString();re.push(`[${jt}] ${Se}:`),re.push(Et.content),re.push("")}const ue=new Blob([re.join(`
163
- `)],{type:"text/plain;charset=utf-8"}),Pe=URL.createObjectURL(ue),Nt=document.createElement("a");Nt.href=Pe,Nt.download=`conversation-${_.platform}-${_.channelId.replace(/[^\w]/g,"_")}-${new Date().toISOString().slice(0,10)}.txt`,document.body.appendChild(Nt),Nt.click(),document.body.removeChild(Nt),URL.revokeObjectURL(Pe)},[]),lt=k.useCallback((_,K)=>{K.stopPropagation();const ne=_.contactName||_.channelId,re=_.messages??[],ue=Ioe({displayName:ne,platform:_.platform,messageCount:_.messageCount,messages:re},Moe()),Pe=window.open("","_blank");Pe&&(Pe.document.write(ue),Pe.document.close(),setTimeout(()=>Pe.print(),300))},[]);k.useEffect(()=>{var K;const _=(K=n==null?void 0:n.conversations)==null?void 0:K.recent;!_||_.length===0||Nl&&(Te>Xu||Ke||q(ne=>{const re=new Set(ne.map(Se=>Se.key)),ue=_.map(Se=>({...Se})),Pe=new Map(ne.map(Se=>[Se.key,Se]));for(const Se of ue)Pe.has(Se.key)&&Pe.set(Se.key,Se);const Et=[...ue.filter(Se=>!re.has(Se.key)),...Pe.values()];return Et.sort((Se,jt)=>jt.lastActiveAt-Se.lastActiveAt),Et}))},[(zt=n==null?void 0:n.conversations)==null?void 0:zt.recent]);const[Oi,Ps]=k.useState(""),[Dt,Pi]=k.useState([]),[Ri,Qu]=k.useState(!1),[Al,Rs]=k.useState(!1),[ha,Kn]=k.useState(null),[Ms,Is]=k.useState(null),[Ju,ed]=k.useState({}),[pa,Cl]=k.useState([]),[Gr,Vn]=k.useState([]),[ma,$s]=k.useState(""),jr=_=>fe?String(_??""):JR(_),um=_=>{const K=_.match(/^(\d+)@/);if(!K)return"";const ne=K[1];return ne.length===12&&ne.startsWith("91")?`+${ne.slice(0,2)} ${ne.slice(2,7)} ${ne.slice(7)}`:ne.length===10?`+91 ${ne.slice(0,5)} ${ne.slice(5)}`:`+${ne}`},Bt=_=>{const K=um(_.channelId);return _.contactName?{name:_.contactName,phone:K}:{name:K||jr(_.channelId),phone:""}},Ls=k.useCallback(_=>{var K,ne;r(_),(K=_==null?void 0:_.channels)!=null&&K.statusRecipients&&Vn(_.channels.statusRecipients),(ne=_==null?void 0:_.channels)!=null&&ne.contacts&&Cl(_.channels.contacts),_||l("Could not reach the dashboard server, or the server is older than this panel. Run `buff dashboard` to start it."),s(!1)},[]),qr=k.useCallback(async()=>{u(!0),l(null),Ls(await Q.fetchHub()),u(!1)},[Ls]);k.useEffect(()=>{qr(),Q.fetchAdminAuthStatus().then(_=>{_&&(f({configured:_.configured,authenticated:_.authenticated}),p(_.authenticated),m(_.role??null),v(_.user??null))})},[qr]);const Tl=((Mn=n==null?void 0:n.subagents)==null?void 0:Mn.running)??0;k.useEffect(()=>{if(Tl===0)return;const _=setInterval(()=>{Q.fetchHub().then(K=>{K&&Ls(K)})},Poe);return()=>clearInterval(_)},[Tl,Ls]);const Vt=h&&(g==="admin"||g==="operator"),td=async _=>{_==null||_.preventDefault();const K=Oi.trim();if(!K)return;Rs(!0),Kn(null);const ne=await Q.marketplaceSearch(K);Pi(ne),Qu(!0),Rs(!1)},dm=async _=>{if(!h){Kn({kind:"err",text:"๐Ÿ” Log in (or set up admin access) to install skills."});return}if(!Vt){Kn({kind:"err",text:"Your role cannot install skills โ€” admin or operator only."});return}Is(_),Kn(null);const K=await Q.marketplaceInstall(_);K.ok?(Kn({kind:"ok",text:`โœ… Installed ${_} (quarantine checked) โ€” it appears in the Skills list and loads via the skill tool next turn.`}),qr()):Kn({kind:"err",text:K.quarantined?`โ›” ${K.error||"checksum mismatch โ€” quarantined"}`:`โŒ ${K.error||"Install failed."}`}),Is(null)},fm=async _=>{if(!h){Kn({kind:"err",text:"๐Ÿ” Log in (or set up admin access) to uninstall skills."});return}if(!Vt){Kn({kind:"err",text:"Your role cannot uninstall skills โ€” admin or operator only."});return}Is(_),Kn(null);const K=await Q.marketplaceUninstall(_);K.ok?(Kn({kind:"ok",text:`๐Ÿ—‘๏ธ Uninstalled ${_} โ€” removed from .agents/skills/ and provenance.`}),qr()):Kn({kind:"err",text:`โŒ ${K.error||"Uninstall failed."}`}),Is(null)},Mi=()=>{p(!1),f(_=>_&&{..._,authenticated:!1}),E("Session expired โ€” log in again to toggle capabilities.")},nd=async _=>{_.preventDefault(),C(!0),E(null);const K=await Q.adminLogin(b,N);if(K.ok){p(!0),f({configured:!0,authenticated:!0}),m(K.role??"admin"),v(K.user??null),w(""),S("");const ne=T;$(null),ne&&await Ds(ne.kind,ne.name,ne.enabled)}else E(K.error||"Login failed.");C(!1)},hm=async _=>{if(_.preventDefault(),C(!0),E(null),N.length<8){E("Password must be at least 8 characters."),C(!1);return}const K=await Q.adminSetup(b,N);if(K.ok){p(!0),f({configured:!0,authenticated:!0}),m(K.role??"admin"),v(K.user??null),w(""),S("");const ne=T;$(null),ne&&await Ds(ne.kind,ne.name,ne.enabled)}else E(K.error||"Setup failed.");C(!1)},Ua=async()=>{await Q.adminLogout(),p(!1),f(_=>_&&{..._,authenticated:!1}),m(null),v(null)},Ds=async(_,K,ne)=>{I(K);const re=_==="skill"?await Q.setSkillEnabled(K,ne):await Q.setToolsetEnabled(K,ne);re.ok?(F(ue=>({...ue,[K]:`โœ… ${ne?"Enabled":"Disabled"} โ€” live for new agent runs`})),qr()):re.unauthorized?Mi():(F(ue=>({...ue,[K]:`โŒ ${re.error||"Toggle failed"}`})),re.forbidden&&E(re.error||"Your role cannot change capabilities.")),I(null)},pm=(_,K)=>{if(!h){$({kind:"toolset",name:_,enabled:K});return}Ds("toolset",_,K)},rd=(_,K)=>{if(!h){$({kind:"skill",name:_,enabled:K});return}Ds("skill",_,K)},mm=async _=>{if(_.preventDefault(),!h){P({kind:"err",text:"๐Ÿ” Log in (or set up admin access) to send test messages."});return}if(!Vt){P({kind:"err",text:"๐Ÿ”’ Your role cannot send channel messages โ€” requires the admin or operator role."});return}Z(!0),P(null);const K=await Q.sendChannelMessage(z.trim(),O);K.ok?(P({kind:"ok",text:`โœ… Sent to ${z.trim()} (${K.platform}:${jr(K.channelId??"")})`}),U("")):K.unauthorized?(Mi(),P({kind:"err",text:K.error||"Session expired โ€” log in again."})):P({kind:"err",text:K.error||"Send failed."}),Z(!1)},Ol=(_,K)=>{var re,ue;return(((ue=(re=n==null?void 0:n.channels)==null?void 0:re.policies)==null?void 0:ue[_])??{})[K]??[]},Pl=_=>_==="user"?"allowedUsers":_==="group"?"allowedGroups":"outboundSenders",Bs=(_,K,ne)=>{const re=ne.trim();re&&Ce(ue=>{var jt;const Pe={...ue[_]??{}},Nt=Pl(K),Se=[...((jt=ue[_])==null?void 0:jt[Nt])??Ol(_,Nt)];return Se.includes(re)||Se.push(re),Pe[Nt]=Se,{...ue,[_]:Pe}})},zs=(_,K,ne)=>{Ce(re=>{var jt;const ue=Pl(K),Pe=Ol(_,ue),Et=(((jt=re[_])==null?void 0:jt[ue])??Pe).filter(Ml=>Ml!==ne);if(Et.length===0&&Pe.length===0){const Ml={...re[_]??{}};delete Ml[ue];const gm={...re};return Object.keys(Ml).length===0?delete gm[_]:gm[_]=Ml,gm}const Se={...re[_]??{}};return Se[ue]=Et,{...re,[_]:Se}})},Rl=(_,K)=>{const ne=_.trim().toLowerCase(),re=K.trim().toLowerCase();if(ne==="*"||re==="*"||ne===re)return!0;const ue=ne.replace(/\D+/g,""),Pe=re.replace(/\D+/g,"");return ue.length>0&&ue===Pe},ad=_=>{const K=(Ju[_]??"").trim(),ne=(X[_]??"").trim();ne&&(Bs(_,"user",ne),K&&Cl(re=>[...re.filter(Pe=>!(Pe.platform===_&&(Rl(Pe.id,ne)||Pe.name.toLowerCase()===K.toLowerCase()))),{name:K,platform:_,id:ne,addedAt:Date.now()}]),_e(re=>({...re,[_]:""})),ed(re=>({...re,[_]:""})))},B=(_,K)=>{zs(_,"user",K),Cl(ne=>ne.filter(re=>!(re.platform===_&&Rl(re.id,K))))},te=(_,K)=>{Ce(ne=>{const re={...ne[_]??{}};return K==="silentDrop"?re.silentDrop=re.silentDrop===!1:re[K]?delete re[K]:re[K]=!0,{...ne,[_]:re}})},ee=Object.keys(pe).length>0||pa.length!==(((Kr=(kt=n==null?void 0:n.channels)==null?void 0:kt.contacts)==null?void 0:Kr.length)??0)||pa.some((_,K)=>{var ne,re;return!((re=(ne=n==null?void 0:n.channels)==null?void 0:ne.contacts)!=null&&re[K])||_.platform!==n.channels.contacts[K].platform||_.id!==n.channels.contacts[K].id||_.name!==n.channels.contacts[K].name})||Gr.length!==(((we=(Yn=n==null?void 0:n.channels)==null?void 0:Yn.statusRecipients)==null?void 0:we.length)??0)||Gr.some((_,K)=>{var ne,re;return _!==((re=(ne=n==null?void 0:n.channels)==null?void 0:ne.statusRecipients)==null?void 0:re[K])}),ke=async()=>{var K;if(!h){le({kind:"err",text:"๐Ÿ” Log in (or set up admin access) to change permissions."});return}if(!Vt){le({kind:"err",text:"๐Ÿ”’ Your role cannot change permissions โ€” requires the admin or operator role."});return}Y(!0),le(null);const _=await Q.saveGatewayPolicies(pe,Gr,pa);if(_.ok){const ne=(K=_.contactErrors)!=null&&K.length?`
164
- โš ๏ธ Some contacts were rejected: ${_.contactErrors.join("; ")}`:"";le({kind:ne?"warn":"ok",text:`โœ… Permissions + saved contacts + status recipients saved โ€” the running gateway applies them immediately.${ne}`}),Ce({}),qr()}else _.unauthorized?(Mi(),le({kind:"err",text:_.error||"Session expired โ€” log in again."})):le({kind:"err",text:_.error||"Failed to save permissions."});Y(!1)};if(a)return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"๐Ÿงฐ",title:"Agent Hub"}),i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Loading hubโ€ฆ"})]})]});const _r=!h&&T!==null;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"๐Ÿงฐ",title:i.jsxs(i.Fragment,{children:["Agent Hub",y?i.jsxs("span",{className:`admin-role-badge admin-role-${g||"viewer"}`,children:[" ",y," ยท ",g||"viewer"]}):null]})}),i.jsxs("div",{className:"admin-header-actions",children:[i.jsx("button",{className:"admin-refresh-btn",onClick:()=>void qr(),disabled:c,children:c?"โณ Refreshingโ€ฆ":"๐Ÿ”„ Refresh"}),h?i.jsx("button",{className:"admin-logout-btn",onClick:()=>void Ua(),children:"๐Ÿšช Log out"}):null]})]}),i.jsxs("p",{className:"admin-subtitle",children:["Capabilities, messaging, artifacts and skills in one place โ€” a single 4-view management page. Toggles persist to ",i.jsx("code",{children:"buffconfig"})," and are honored by the runtime immediately (never cosmetic)."]}),o?i.jsx("div",{className:"admin-error",children:o}):null,_r?i.jsxs("div",{className:"admin-header",children:[i.jsx("h2",{className:"section-subtitle",children:d!=null&&d.configured?`๐Ÿ” Log in to ${T.enabled?"enable":"disable"} '${T.name}'`:`๐Ÿ” Set up admin access to ${T.enabled?"enable":"disable"} '${T.name}'`}),i.jsxs("form",{className:"admin-gate-form",onSubmit:d!=null&&d.configured?nd:hm,children:[i.jsxs("label",{children:[i.jsx("span",{children:"Username"}),i.jsx("input",{type:"text",value:b,onChange:_=>w(_.target.value),autoComplete:"username",placeholder:"admin"})]}),i.jsxs("label",{children:[i.jsx("span",{children:"Password"}),i.jsx("input",{type:"password",value:N,onChange:_=>S(_.target.value),autoComplete:d!=null&&d.configured?"current-password":"new-password",placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข"})]}),x?i.jsx("div",{className:"admin-error",children:x}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:j||!b||!N,children:j?"โณ โ€ฆ":d!=null&&d.configured?"๐Ÿ” Log in & apply":"๐Ÿ” Create admin & apply"}),d!=null&&d.configured?null:i.jsxs("p",{className:"admin-hint",children:["The first user is always an admin. Automation alternative: set"," ",i.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_USER"})," / ",i.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_PASSWORD"}),"."]})]})]}):null,!_r&&!Vt&&h?i.jsxs("div",{className:"admin-readonly-note",children:["๐Ÿ”’ Your role (",i.jsx("code",{children:g||"viewer"}),") can view but not change capabilities โ€” toggles require the ",i.jsx("code",{children:"admin"})," or ",i.jsx("code",{children:"operator"})," role."]}):null,i.jsx("div",{className:"hub-tabs",role:"tablist",children:Toe.map(_=>{var ne,re,ue;const K=_.id==="tools"?n?`${n.toolsets.enabled}/${n.toolsets.toolsets.length}`:"":_.id==="channels"?n?String(n.channels.delivery.total):"":_.id==="conversations"?n?String(((ne=n.conversations)==null?void 0:ne.total)??0):"":_.id==="artifacts"?n?String(n.artifacts.totalSessions):"":_.id==="subagents"?n?`${((re=n.subagents)==null?void 0:re.running)??0}/${((ue=n.subagents)==null?void 0:ue.total)??0}`:"":n?`${n.skills.enabled}/${n.skills.total}`:"";return i.jsxs("button",{role:"tab","aria-selected":e===_.id,className:`hub-tab${e===_.id?" active":""}`,onClick:()=>t(_.id),children:[_.icon," ",_.label,K?i.jsx("span",{className:"hub-tab-count",children:K}):null]},_.id)})}),e==="tools"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.toolsets.enabled}),i.jsx("div",{className:"admin-summary-label",children:"Enabled toolsets"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.toolsets.disabled}),i.jsx("div",{className:"admin-summary-label",children:"Disabled toolsets"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.toolsets.totalTools}),i.jsx("div",{className:"admin-summary-label",children:"Registered tools"})]})]}),i.jsx("div",{className:"hub-toolset-grid",children:n.toolsets.toolsets.map(_=>i.jsxs("div",{className:`hub-card${_.enabled?"":" hub-card-disabled"}`,children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:_.label}),i.jsx("span",{className:"hub-card-id",children:_.name})]}),i.jsx("button",{role:"switch","aria-checked":_.enabled,"aria-label":`${_.enabled?"Disable":"Enable"} ${_.label}`,className:`hub-switch${_.enabled?" on":""}`,disabled:R===_.name||T!==null||h&&!Vt,onClick:()=>pm(_.name,!_.enabled),children:i.jsx("span",{className:"hub-switch-knob"})})]}),i.jsx("p",{className:"hub-card-desc",children:_.description}),i.jsx("div",{className:"hub-card-tools",children:_.tools.length>0?_.tools.map(K=>i.jsx("span",{className:"hub-chip",children:K},K)):i.jsx("span",{className:"admin-hint",children:"gates dynamic MCP tools (no static names)"})}),L[_.name]?i.jsx("div",{className:"admin-row-msg",children:L[_.name]}):null,_.enabled?null:i.jsx("div",{className:"hub-card-note",children:"โ›” Removed from the model schema โ€” calls return an explicit error"})]},_.name))})]}):null,e==="channels"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"hub-reveal-row",children:[i.jsxs("label",{className:"hub-reveal-toggle",children:[i.jsx("input",{type:"checkbox",checked:fe,onChange:_=>tt(_.target.checked),disabled:!Vt}),"Show full sender ids ",i.jsx("span",{className:"admin-hint",children:"(masks phone numbers by default)"})]}),Vt?null:i.jsx("span",{className:"admin-hint",children:"โ€” admins and operators only"})]}),i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.pending}),i.jsx("div",{className:"admin-summary-label",children:"โณ Queued for retry"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.sent}),i.jsx("div",{className:"admin-summary-label",children:"โœ… Delivered"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.channels.delivery.failed}),i.jsx("div",{className:"admin-summary-label",children:"โŒ Failed (max retries)"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.channels.aliases.length}),i.jsx("div",{className:"admin-summary-label",children:"Channel aliases"})]})]}),i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ“ฎ Delivery ledger (guaranteed delivery)"}),n.channels.delivery.recent.length>0?i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Target"}),i.jsx("th",{children:"Platform"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Attempts"}),i.jsx("th",{children:"Next retry"}),i.jsx("th",{children:"Message"})]})}),i.jsx("tbody",{children:n.channels.delivery.recent.map(_=>i.jsxs("tr",{children:[i.jsx("td",{className:"admin-provider-type",children:jr(_.target)}),i.jsx("td",{children:_.platform}),i.jsx("td",{children:i.jsx("span",{className:`admin-check-badge admin-check-${_.status==="sent"?"pass":_.status==="failed"?"fail":"warn"}`,children:Ooe[_.status]||_.status})}),i.jsxs("td",{children:[_.attempts,"/5"]}),i.jsx("td",{children:_.status==="pending"?`${Math.max(0,Math.round((_.nextAttemptAt-Date.now())/1e3))}s`:"โ€”"}),i.jsx("td",{className:"admin-hint",children:_.lastError?`โš ๏ธ ${_.lastError}`:(_.text||"").slice(0,60)})]},_.id))})]})}):i.jsx("div",{className:"empty-state",children:"Delivery ledger is empty โ€” every gateway send has gone through."}),i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ“ฅ Inbox (received messages)"}),n.channels.inbox.recent.length>0?i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Platform"}),i.jsx("th",{children:"From"}),i.jsx("th",{children:"Message"}),i.jsx("th",{children:"Handled"}),i.jsx("th",{children:"When"})]})}),i.jsx("tbody",{children:n.channels.inbox.recent.map(_=>i.jsxs("tr",{children:[i.jsxs("td",{className:"admin-provider-type",children:[_.platform,_.isGroup?i.jsx("span",{className:"hub-chip",children:"group"}):null]}),i.jsx("td",{children:jr(_.from||_.senderId||_.channelId)}),i.jsx("td",{className:"admin-hint",children:(_.text||"").slice(0,60)}),i.jsxs("td",{children:[i.jsx("span",{className:`admin-check-badge admin-check-${_.handled==="pipeline"?"pass":_.handled==="refused"?"fail":"warn"}`,children:_.handled}),_.reply?i.jsx("div",{className:"admin-hint",children:_.reply.slice(0,_.handled==="attachment_failed"?160:40)}):null]}),i.jsx("td",{className:"admin-hint",children:new Date(_.at).toLocaleString()})]},_.id))})]})}):i.jsx("div",{className:"empty-state",children:"Inbox is empty โ€” messages the gateway receives will appear here."}),i.jsxs("p",{className:"admin-hint",children:[n.channels.inbox.total," received ยท ",n.channels.inbox.pipeline," triggered the pipeline ยท"," ",n.channels.inbox.help," got the help line ยท ",n.channels.inbox.refused," refused by policy ยท"," ",n.channels.inbox.duplicate??0," duplicate re-deliveries ignored ยท"," ",n.channels.inbox.attachmentFailed??0," attachment(s) could not be read."]}),i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ”Œ Platform transports"}),i.jsx(Aoe,{canWrite:Vt,sessionExpired:Mi,mode:"table"}),i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ”— Channel aliases (buff gateway status)"}),n.channels.aliases.length>0?i.jsx("div",{className:"hub-alias-list",children:n.channels.aliases.map(_=>i.jsxs("div",{className:"hub-alias-row",children:[i.jsx("span",{className:"hub-chip",children:_.alias}),i.jsxs("span",{className:"admin-hint",children:["โ†’ ",_.platform,":",jr(_.channelId)]})]},_.alias))}):i.jsxs("div",{className:"empty-state",children:["No aliases yet โ€” register one with ",i.jsx("code",{children:"buff gateway alias <name> <platform> <channelId>"}),"."]}),ee?i.jsxs("div",{className:"hub-unsaved-banner",role:"status",children:[i.jsxs("span",{children:["โš ๏ธ ",i.jsx("strong",{children:"Unsaved changes"})," โ€” what you see below is a ",i.jsx("em",{children:"draft"}),". Press"," ",i.jsx("strong",{children:"๐Ÿ’พ Save permissions"})," to apply it to the gateway; leaving the page discards it."]}),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:G,onClick:()=>void ke(),children:G?"โณ Savingโ€ฆ":"๐Ÿ’พ Save permissions"})]}):null,i.jsx("div",{style:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",gap:8,marginBottom:8},onClick:()=>be(!oe),children:i.jsxs("h2",{className:"section-subtitle",style:{margin:0},children:[oe?"โ–ผ":"โ–ถ"," ๐Ÿ” Permissions โ€” who can TRIGGER the agent"]})}),i.jsxs("p",{className:"admin-hint",style:{marginBottom:oe?10:0},children:["This list controls ",i.jsx("strong",{children:"who may trigger the agent"})," when they message you on each platform (WhatsApp, Telegram, email, โ€ฆ). Click to ",oe?"collapse":"expand"," and manage permissions."]}),oe?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"admin-hint",style:{marginBottom:10},children:["โš  ",i.jsx("strong",{children:"Not the same as send-by-name contacts:"})," a WhatsApp contact name (from"," ",i.jsx("code",{children:"buff whatsapp contact add"}),", shown in the WhatsApp bridge panel below) only lets"," ",i.jsx("em",{children:"you"})," send ",i.jsx("em",{children:"to"})," it by name โ€” it does ",i.jsx("strong",{children:"not"})," let that number trigger the agent. Add the number here (or ",i.jsx("code",{children:"buff config gateway allow <platform> user <id>"}),") to grant inbound access."]}),i.jsx("div",{className:"hub-permissions",children:n.channels.platforms.map(_=>{const K={...n.channels.policies[_.platform]??{},...pe[_.platform]??{}},ne=K.allowedUsers??[],re=K.allowedGroups??[];return i.jsxs("div",{className:"hub-card",children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsx("span",{className:"hub-chip",children:_.label}),i.jsx("span",{className:"hub-card-id",children:_.platform}),K.disabled?i.jsx("span",{className:"hub-chip",children:"disabled"}):null]}),i.jsx("div",{className:"admin-hint",style:{margin:"4px 0 8px"},children:"Allowed users โ€” who may trigger the agent"}),i.jsxs("div",{className:"hub-alias-list",children:[ne.length===0?i.jsxs("span",{className:"admin-hint",children:["(blank โ€” no one may trigger; add ",i.jsx("code",{children:"Allow-All"})," to allow everyone)"]}):null,ne.map(ue=>{var Nt,Et,Se,jt;const Pe=(((Nt=pe[_.platform])==null?void 0:Nt.allowedUsers)??[]).includes(ue)&&!(((jt=(Se=(Et=n==null?void 0:n.channels)==null?void 0:Et.policies)==null?void 0:Se[_.platform])==null?void 0:jt.allowedUsers)??[]).includes(ue);return i.jsxs("div",{className:"hub-alias-row",children:[i.jsxs("span",{className:`hub-chip${Pe?" hub-chip-pending":""}`,title:Pe?"Not saved yet โ€” press ๐Ÿ’พ Save permissions":void 0,children:[jr(ue),Pe?" ยท unsaved":""]}),i.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>B(_.platform,ue),children:"โœ•"})]},`u-${ue}`)})]}),i.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[i.jsx("input",{type:"text",value:Ju[_.platform]??"",onChange:ue=>ed(Pe=>({...Pe,[_.platform]:ue.target.value})),placeholder:"Name (optional)",disabled:G}),i.jsx("input",{type:"text",value:X[_.platform]??"",onChange:ue=>_e(Pe=>({...Pe,[_.platform]:ue.target.value})),placeholder:"Contact no / sender id, or Allow-All",disabled:G}),i.jsx("button",{className:"admin-refresh-btn",disabled:G||!(X[_.platform]??"").trim(),onClick:()=>ad(_.platform),children:"+ User"})]}),i.jsx("div",{className:"admin-hint",style:{margin:"4px 0 8px"},children:"Allowed groups"}),i.jsxs("div",{className:"hub-alias-list",children:[re.length===0?i.jsx("span",{className:"admin-hint",children:"(none โ€” any group may trigger)"}):null,re.map(ue=>{var Nt,Et,Se,jt;const Pe=(((Nt=pe[_.platform])==null?void 0:Nt.allowedGroups)??[]).includes(ue)&&!(((jt=(Se=(Et=n==null?void 0:n.channels)==null?void 0:Et.policies)==null?void 0:Se[_.platform])==null?void 0:jt.allowedGroups)??[]).includes(ue);return i.jsxs("div",{className:"hub-alias-row",children:[i.jsxs("span",{className:`hub-chip${Pe?" hub-chip-pending":""}`,title:Pe?"Not saved yet โ€” press ๐Ÿ’พ Save permissions":void 0,children:[ue,Pe?" ยท unsaved":""]}),i.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>zs(_.platform,"group",ue),children:"โœ•"})]},`g-${ue}`)})]}),i.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[i.jsx("input",{type:"text",value:Ne[_.platform]??"",onChange:ue=>je(Pe=>({...Pe,[_.platform]:ue.target.value})),placeholder:"group id, e.g. 1203630283471234@g.us",disabled:G}),i.jsx("button",{className:"admin-refresh-btn",disabled:G||!(Ne[_.platform]??"").trim(),onClick:()=>{Bs(_.platform,"group",Ne[_.platform]??""),je(ue=>({...ue,[_.platform]:""}))},children:"+ Group"})]}),i.jsx("div",{className:"admin-hint",style:{margin:"12px 0 4px"},children:"Send authority โ€” who may tell the agent to send to OTHER people"}),i.jsx("div",{className:"admin-hint",style:{margin:"0 0 6px",opacity:.8},children:(K.outboundSenders??[]).length===0?"Open โ€” anyone above who can trigger the agent can also direct outbound sends. Add senders to restrict it.":"Restricted to the senders below (Allow-All = everyone)."}),i.jsx("div",{className:"hub-alias-list",children:(K.outboundSenders??[]).map(ue=>{var Nt,Et,Se,jt;const Pe=(((Nt=pe[_.platform])==null?void 0:Nt.outboundSenders)??[]).includes(ue)&&!(((jt=(Se=(Et=n==null?void 0:n.channels)==null?void 0:Et.policies)==null?void 0:Se[_.platform])==null?void 0:jt.outboundSenders)??[]).includes(ue);return i.jsxs("div",{className:"hub-alias-row",children:[i.jsxs("span",{className:`hub-chip${Pe?" hub-chip-pending":""}`,title:Pe?"Not saved yet โ€” press ๐Ÿ’พ Save permissions":void 0,children:[jr(ue),Pe?" ยท unsaved":""]}),i.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>zs(_.platform,"send",ue),children:"โœ•"})]},`s-${ue}`)})}),i.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 10px"},children:[i.jsx("input",{type:"text",value:ge[_.platform]??"",onChange:ue=>Le(Pe=>({...Pe,[_.platform]:ue.target.value})),placeholder:"sender id, or Allow-All",disabled:G}),i.jsx("button",{className:"admin-refresh-btn",disabled:G||!(ge[_.platform]??"").trim(),onClick:()=>{Bs(_.platform,"send",ge[_.platform]??""),Le(ue=>({...ue,[_.platform]:""}))},children:"+ Sender"})]}),i.jsxs("div",{className:"hub-send-form",style:{margin:"6px 0 0"},children:[i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[i.jsx("input",{type:"checkbox",checked:K.silentDrop!==!1,disabled:G,onChange:()=>te(_.platform,"silentDrop")}),i.jsx("span",{className:"admin-hint",children:"Silent (no reply to unapproved) โ€” default"})]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[i.jsx("input",{type:"checkbox",checked:!!K.requireMention,disabled:G,onChange:()=>te(_.platform,"requireMention")}),i.jsx("span",{className:"admin-hint",children:"Groups: mention only"})]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginRight:12},children:[i.jsx("input",{type:"checkbox",checked:!!K.disabled,disabled:G,onChange:()=>te(_.platform,"disabled")}),i.jsx("span",{className:"admin-hint",children:"Disabled (off)"})]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[i.jsx("input",{type:"checkbox",checked:!!K.requireApprovedTarget,disabled:G,onChange:()=>te(_.platform,"requireApprovedTarget")}),i.jsx("span",{className:"admin-hint",children:"Require approved recipients for sends"})]})]})]},_.platform)})})]}):null,i.jsx("h2",{className:"section-subtitle",style:{marginTop:22},children:"๐Ÿ“‡ Telegram User Onboarding"}),i.jsxs("div",{className:"onboarding-summary",children:[i.jsx("p",{className:"admin-hint",style:{marginBottom:12},children:"Users who message your bot are auto-registered here. Approve them to enable outbound messaging."}),(()=>{const _=pa.filter(re=>re.status==="pending").length,K=pa.filter(re=>re.status==="approved").length,ne=pa.filter(re=>re.status==="rejected").length;return i.jsxs("div",{className:"onboarding-stats",children:[i.jsxs("span",{className:"onboarding-stat pending",children:["โณ ",_," pending"]}),i.jsxs("span",{className:"onboarding-stat approved",children:["โœ… ",K," approved"]}),i.jsxs("span",{className:"onboarding-stat rejected",children:["๐Ÿšซ ",ne," rejected"]})]})})(),i.jsxs("div",{className:"onboarding-steps",children:[i.jsxs("div",{className:"onboarding-step",children:[i.jsx("span",{className:"onboarding-step-num",children:"1"}),i.jsxs("span",{children:["User sends any message to ",i.jsx("code",{children:"@agent_nuvira_bot"})]})]}),i.jsxs("div",{className:"onboarding-step",children:[i.jsx("span",{className:"onboarding-step-num",children:"2"}),i.jsxs("span",{children:["Bot auto-registers them as ",i.jsx("strong",{children:"โณ pending"})]})]}),i.jsxs("div",{className:"onboarding-step",children:[i.jsx("span",{className:"onboarding-step-num",children:"3"}),i.jsx("span",{children:"Admin approves โ†’ they can receive outbound messages"})]})]}),i.jsx("a",{href:"/contacts",className:"admin-refresh-btn",style:{marginTop:12,display:"inline-block",textDecoration:"none"},children:"๐Ÿ“‹ Go to Contacts tab to manage โ†’"})]}),i.jsx("h2",{className:"section-subtitle",style:{marginTop:22},children:"๐Ÿ“Š Status recipients"}),i.jsxs("p",{className:"admin-hint",children:["Contacts/groups that ALWAYS receive the pipeline completion summary, whoever triggered it. Use a contact name, number, or ",i.jsx("code",{children:"platform:channelId"})," โ€” e.g."," ",i.jsx("code",{children:"whatsapp:Name"}),", ",i.jsx("code",{children:"whatsapp:+91***"}),", ",i.jsx("code",{children:"telegram:123456"}),","," ",i.jsx("code",{children:"slack:ops"}),"."]}),Gr.length>0?i.jsx("div",{className:"hub-alias-list",children:Gr.map(_=>{var K,ne;return i.jsxs("div",{className:"hub-alias-row",children:[i.jsx("span",{className:"hub-chip",children:"๐Ÿ“Š"}),i.jsx("span",{className:"admin-hint",children:((ne=(K=n==null?void 0:n.channels)==null?void 0:K.statusRecipientDisplay)==null?void 0:ne[_])??_}),i.jsx("button",{className:"admin-refresh-btn",disabled:G,onClick:()=>Vn(re=>re.filter(ue=>ue!==_)),children:"โœ•"})]},_)})}):i.jsx("div",{className:"empty-state",style:{padding:"14px"},children:"No status recipients โ€” add one below."}),i.jsxs("div",{className:"hub-send-form",children:[i.jsx("input",{type:"text",value:ma,onChange:_=>$s(_.target.value),placeholder:"whatsapp:Name or whatsapp:+91***",disabled:G,maxLength:128}),i.jsx("button",{className:"admin-refresh-btn",disabled:G||!ma.trim()||Gr.includes(ma.trim()),onClick:()=>{Vn(_=>[..._,ma.trim()]),$s("")},children:"+ Add"})]}),i.jsxs("div",{className:"hub-send-form",style:{marginTop:10},children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:G,onClick:()=>void ke(),children:G?"โณ Savingโ€ฆ":"๐Ÿ’พ Save permissions"}),Object.keys(pe).length>0?i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:G,onClick:()=>Ce({}),children:"Discard draft"}):null]}),ie?i.jsx("div",{className:`admin-row-msg${ie.kind==="err"?" admin-row-msg-err":""}`,children:ie.text}):null,i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ“ค Test a channel (buff gateway send)"}),i.jsxs("form",{className:"hub-send-form",onSubmit:_=>void mm(_),children:[i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"Target โ€” an alias or platform:channelId"}),i.jsx("input",{type:"text",value:z,onChange:_=>M(_.target.value),placeholder:"ops or slack:C0123 or email:team@example.com",disabled:A,maxLength:128})]}),i.jsxs("label",{className:"hub-send-message",children:[i.jsx("span",{className:"admin-hint",children:"Message"}),i.jsx("input",{type:"text",value:O,onChange:_=>U(_.target.value),placeholder:"nightly build done ๐ŸŽ‰",disabled:A,maxLength:4e3})]}),i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:A||!z.trim()||!O,children:A?"โณ Sendingโ€ฆ":"๐Ÿ“ค Send test message"})]}),D?i.jsx("div",{className:`admin-row-msg${D.kind==="ok"?"":" admin-row-msg-err"}`,children:D.text}):null,i.jsxs("p",{className:"admin-hint",children:["Sends through the same gateway the CLI uses โ€” the dashboard process must have the platform's env token set (e.g. ",i.jsx("code",{children:"BUFF_SMTP_HOST"}),"). Requires admin or operator."]}),i.jsx("h2",{className:"section-subtitle",children:"๐ŸŸข WhatsApp bridge (buff whatsapp pair)"}),i.jsx(_oe,{authed:h,canWrite:Vt,sessionExpired:Mi,reveal:fe})]}):null,e==="conversations"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:((Ue=n.conversations)==null?void 0:Ue.total)??0}),i.jsx("div",{className:"admin-summary-label",children:"Stored conversations"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:tn.filter(_=>Date.now()-_.lastActiveAt<864e5).length}),i.jsx("div",{className:"admin-summary-label",children:"Active today"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:tn.filter(_=>_.platform==="whatsapp").length}),i.jsx("div",{className:"admin-summary-label",children:"WhatsApp"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:tn.filter(_=>_.platform==="telegram").length}),i.jsx("div",{className:"admin-summary-label",children:"Telegram"})]})]}),((ct=n.conversations)==null?void 0:ct.analytics)&&n.conversations.analytics.totalConversations>0&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>V(!W),style:{marginBottom:12},children:W?"๐Ÿ“Š Hide Analytics":"๐Ÿ“Š Show Analytics"}),W?i.jsxs("div",{className:"hub-session-list",style:{marginBottom:16},children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.totalMessages}),i.jsx("div",{className:"admin-summary-label",children:"Total messages"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgMessagesPerConversation}),i.jsx("div",{className:"admin-summary-label",children:"Avg msgs/conversation"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgUserMessageLength}),i.jsx("div",{className:"admin-summary-label",children:"Avg user msg length"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.conversations.analytics.avgAssistantMessageLength}),i.jsx("div",{className:"admin-summary-label",children:"Avg assistant msg length"})]})]}),i.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[i.jsx("div",{className:"hub-card-top",children:i.jsx("div",{className:"hub-card-title",children:i.jsx("span",{className:"hub-card-name",children:"๐Ÿ† Most Active Contacts"})})}),i.jsx("div",{style:{marginTop:8},children:n.conversations.analytics.topContacts.map((_,K)=>{var ue;const ne=((ue=n.conversations.analytics.topContacts[0])==null?void 0:ue.messageCount)||1,re=Math.round(_.messageCount/ne*100);return i.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:6,fontSize:13},children:[i.jsx("span",{style:{width:24,textAlign:"center",fontWeight:600,color:K<3?"var(--accent-yellow)":"var(--muted)"},children:K===0?"๐Ÿฅ‡":K===1?"๐Ÿฅˆ":K===2?"๐Ÿฅ‰":`${K+1}.`}),i.jsxs("span",{style:{flex:1,marginLeft:8},children:[_.platform==="whatsapp"?"๐Ÿ“ฑ":"โœˆ๏ธ"," ",_.name]}),i.jsx("span",{style:{width:60,textAlign:"right",fontWeight:600},children:_.messageCount}),i.jsx("div",{style:{width:100,height:8,background:"var(--border)",borderRadius:4,marginLeft:8},children:i.jsx("div",{style:{width:`${re}%`,height:"100%",background:"var(--accent-blue)",borderRadius:4}})})]},K)})})]}),i.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[i.jsx("div",{className:"hub-card-top",children:i.jsx("div",{className:"hub-card-title",children:i.jsx("span",{className:"hub-card-name",children:"๐Ÿ• Peak Hours"})})}),i.jsx("div",{style:{display:"flex",alignItems:"flex-end",height:80,marginTop:8,gap:2},children:n.conversations.analytics.hourlyDistribution.map(({hour:_,count:K})=>{const ne=Math.max(...n.conversations.analytics.hourlyDistribution.map(ue=>ue.count),1),re=Math.round(K/ne*70);return i.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:i.jsx("div",{style:{width:"100%",height:re,background:_>=9&&_<=21?"var(--accent-blue)":"var(--text-muted)",borderRadius:2},title:`${_}:00 โ€” ${K} messages`})},_)})}),i.jsx("div",{style:{display:"flex",fontSize:10,color:"var(--muted)",marginTop:4},children:[0,6,12,18,23].map(_=>i.jsxs("span",{style:{flex:1,textAlign:_===0?"left":_===23?"right":"center"},children:[_,":00"]},_))})]}),i.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[i.jsx("div",{className:"hub-card-top",children:i.jsx("div",{className:"hub-card-title",children:i.jsx("span",{className:"hub-card-name",children:"๐Ÿ“ฑ Platform Breakdown"})})}),i.jsx("div",{style:{marginTop:8},children:n.conversations.analytics.platformBreakdown.map(_=>i.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:6,fontSize:13},children:[i.jsx("span",{className:"hub-chip",style:{width:80,textAlign:"center"},children:_.platform}),i.jsxs("span",{style:{marginLeft:8,flex:1},children:[_.conversations," conversations"]}),i.jsxs("span",{style:{fontWeight:600},children:[_.messages," msgs"]})]},_.platform))})]}),i.jsxs("div",{className:"hub-card",style:{marginTop:12},children:[i.jsx("div",{className:"hub-card-top",children:i.jsx("div",{className:"hub-card-title",children:i.jsx("span",{className:"hub-card-name",children:"๐Ÿ“ˆ Daily Volume (14 days)"})})}),i.jsx("div",{style:{display:"flex",alignItems:"flex-end",height:60,marginTop:8,gap:2},children:n.conversations.analytics.dailyVolume.map(({date:_,count:K})=>{const ne=Math.max(...n.conversations.analytics.dailyVolume.map(ue=>ue.count),1),re=Math.round(K/ne*50);return i.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:i.jsx("div",{style:{width:"100%",height:re,background:"var(--accent-green)",borderRadius:2},title:`${_}: ${K} messages`})},_)})}),i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:10,color:"var(--muted)",marginTop:4},children:[i.jsx("span",{children:(Ct=n.conversations.analytics.dailyVolume[0])==null?void 0:Ct.date}),i.jsx("span",{children:(nn=n.conversations.analytics.dailyVolume[n.conversations.analytics.dailyVolume.length-1])==null?void 0:nn.date})]})]})]}):null]}),i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ’ฌ Per-contact chat history"}),i.jsx("p",{className:"admin-hint",children:"Conversation history is stored per-contact and survives gateway restarts. Messages older than 7 days are auto-pruned. Click a conversation to expand the full chat thread."}),tn.length>0||Nn?i.jsxs(i.Fragment,{children:[Hn.length>0&&i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:8},children:[i.jsx("span",{className:"admin-hint",style:{marginRight:4},children:"Filter by tag:"}),Hn.map(_=>i.jsxs("button",{type:"button",onClick:()=>Gn(Re===_?"":_),style:{padding:"2px 10px",borderRadius:12,fontSize:11,cursor:"pointer",border:`1px solid ${Re===_?"var(--accent-blue)":"var(--border)"}`,background:Re===_?"color-mix(in srgb, var(--accent-blue) 13%, transparent)":"transparent",color:Re===_?"var(--accent-blue)":"var(--muted)"},children:["๐Ÿท๏ธ ",_]},_))]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12,flexWrap:"wrap"},children:[i.jsx("input",{type:"text",value:Ke,onChange:_=>$t(_.target.value),placeholder:"๐Ÿ” Search by contact name, phone number, or message contentโ€ฆ",style:{flex:1,minWidth:200}}),i.jsxs("span",{className:"admin-hint",children:[me," conversation",me===1?"":"s",Ke?` matching "${Ke}"`:""]}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:cm,style:{fontSize:12,padding:"4px 10px"},children:xe.size===tn.length?"โ˜‘ Deselect All":"โ˜ Select All"}),xe.size>0&&i.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:un,onClick:()=>void Zu(),style:{fontSize:12,padding:"4px 10px",background:"var(--accent-blue)",color:"var(--text-on-accent)",border:"none"},children:un?"โณ Exportingโ€ฆ":`๐Ÿ“ฆ Export ${xe.size} as ZIP`})]}),i.jsxs("div",{className:"hub-session-list",children:[tn.filter(_=>!Re||(_.tags??[]).includes(Re)).map(_=>{const K=Date.now()-_.lastActiveAt,ne=K<6e4?"just now":K<36e5?`${Math.round(K/6e4)}m ago`:K<864e5?`${Math.round(K/36e5)}h ago`:`${Math.round(K/864e5)}d ago`,re=Be===_.key,{name:ue,phone:Pe}=Bt(_),Nt=async Se=>{if(Se.stopPropagation(),!h||!Vt){le({kind:"err",text:"๐Ÿ” Log in (admin/operator) to clear conversations."});return}en(_.key);try{await Q.clearGatewayConversation(_.key),qr()}catch{}en(null)},Et=xe.has(_.key);return i.jsxs("div",{className:"hub-card",style:{cursor:"pointer",borderLeft:`3px solid ${_.platform==="whatsapp"?"#25d366":_.platform==="telegram"?"#0088cc":"var(--text-muted)"}`,opacity:xe.size>0&&!Et?.5:1,transition:"opacity 0.2s"},onClick:()=>Ee(re?null:_.key),children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i.jsx("input",{type:"checkbox",checked:Et,onClick:Se=>lm(_.key,Se),onChange:()=>{},style:{cursor:"pointer",width:16,height:16}}),i.jsxs("div",{className:"hub-card-title",children:[i.jsxs("span",{className:"hub-card-name",children:[_.platform==="whatsapp"?"๐Ÿ“ฑ":_.platform==="telegram"?"โœˆ๏ธ":"๐Ÿ’ฌ"," ",ue]}),i.jsxs("span",{className:"hub-card-id",children:[Pe&&i.jsx("span",{style:{color:"var(--text-secondary, var(--text-secondary))",marginRight:6},children:Pe}),_.platform," ยท ",ne]})]})]}),i.jsxs("div",{className:"hub-card-actions",style:{gap:6},children:[i.jsxs("span",{className:"hub-chip",children:[_.messageCount," msgs"]}),re&&_.messages&&_.messages.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"hub-mini-btn",onClick:Se=>_l(_,Se),title:"Export as text file",children:"๐Ÿ“„"}),i.jsx("button",{type:"button",className:"hub-mini-btn",onClick:Se=>lt(_,Se),title:"Export as PDF (opens print dialog)",children:"๐Ÿ“‘"})]}),i.jsx("button",{type:"button",className:"hub-mini-btn",disabled:Rn===_.key,onClick:Nt,title:"Clear conversation history",style:{color:"var(--accent-red)"},children:"๐Ÿ—‘๏ธ"}),i.jsx("span",{style:{fontSize:18,transition:"transform 0.2s",transform:re?"rotate(180deg)":"none"},children:"โ–ผ"})]})]}),i.jsxs("p",{className:"hub-card-desc",style:{fontStyle:"italic",color:"var(--text-muted, var(--text-muted))"},children:[i.jsx("span",{style:{color:"var(--text-primary, var(--text-primary))",fontWeight:500},children:"Last message:"})," ",_.lastUserMessage.slice(0,120),_.lastUserMessage.length>120?"โ€ฆ":""]}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:[(_.tags??[]).map(Se=>i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 8px",borderRadius:12,fontSize:11,background:"color-mix(in srgb, var(--accent-blue) 13%, transparent)",color:"var(--accent-blue)",border:"1px solid color-mix(in srgb, var(--accent-blue) 25%, transparent)"},children:["๐Ÿท๏ธ ",Se,i.jsx("button",{type:"button",onClick:jt=>{jt.stopPropagation(),jl(_.key,Se)},style:{background:"none",border:"none",color:"var(--accent-blue)",cursor:"pointer",padding:0,fontSize:12,lineHeight:1},children:"ร—"})]},Se)),Lt===_.key?i.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:2},children:i.jsx("input",{type:"text",value:Ci,onChange:Se=>lr(Se.target.value),onKeyDown:Se=>{Se.key==="Enter"&&El(_.key,Ci),Se.key==="Escape"&&(da(null),lr(""))},placeholder:"tag name",autoFocus:!0,onClick:Se=>Se.stopPropagation(),style:{width:80,padding:"1px 6px",fontSize:11,borderRadius:8,border:"1px solid var(--border)"}})}):i.jsx("button",{type:"button",onClick:Se=>{Se.stopPropagation(),da(_.key),lr("")},style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 8px",borderRadius:12,fontSize:11,background:"var(--border)",color:"var(--muted)",border:"none",cursor:"pointer"},children:"+ tag"})]}),re&&_.messages&&_.messages.length>0?i.jsxs("div",{className:"conversation-thread",style:{marginTop:10,borderTop:"1px solid var(--border)",paddingTop:10,maxHeight:400,overflowY:"auto"},children:[_.messages.map((Se,jt)=>i.jsxs("div",{style:{marginBottom:8,display:"flex",flexDirection:"column",alignItems:Se.role==="user"?"flex-end":"flex-start"},children:[i.jsxs("div",{style:{maxWidth:"80%",padding:"8px 12px",borderRadius:12,backgroundColor:Se.role==="user"?"var(--accent-blue)":"var(--bg-card, var(--bg-card))",color:Se.role==="user"?"var(--text-on-accent)":"var(--text-primary, var(--text-primary))",fontSize:13,lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[Se.content.slice(0,500),Se.content.length>500?"โ€ฆ":""]}),i.jsxs("span",{style:{fontSize:10,color:"var(--muted)",marginTop:2,padding:"0 4px"},children:[Se.role==="user"?"๐Ÿ‘ค":"๐Ÿค–"," ",new Date(Se.ts).toLocaleString()]})]},jt)),ae.has(_.key)&&i.jsxs("div",{style:{marginBottom:8,display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[i.jsxs("div",{style:{padding:"8px 16px",borderRadius:12,backgroundColor:"var(--bg-card, var(--bg-card))",fontSize:13,display:"flex",alignItems:"center",gap:4},children:[i.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out"},children:"โ—"}),i.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out 0.2s"},children:"โ—"}),i.jsx("span",{style:{animation:"typingBlink 1.4s infinite ease-in-out 0.4s"},children:"โ—"})]}),i.jsx("span",{style:{fontSize:10,color:"var(--muted)",marginTop:2,padding:"0 4px"},children:"๐Ÿค– typingโ€ฆ"})]})]}):re?i.jsx("p",{className:"admin-hint",style:{marginTop:8},children:"No message details available."}):null]},_.key)}),dn&&!Nn&&i.jsx("div",{ref:Ti,style:{height:1}}),Nn&&i.jsxs("div",{className:"loading-state",style:{padding:12},children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("span",{className:"admin-hint",style:{marginLeft:8},children:"Loading more conversationsโ€ฆ"})]}),!Nn&&!dn&&tn.length>0&&i.jsxs("p",{className:"admin-hint",style:{textAlign:"center",padding:12},children:["All ",me," conversation",me===1?"":"s"," loaded."]})]})]}):Nn?i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{className:"admin-hint",children:"Loading conversationsโ€ฆ"})]}):i.jsx("div",{className:"empty-state",children:"No conversations stored yet. Conversations are created when users message the agent via WhatsApp/Telegram/etc."})]}):null,e==="artifacts"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.artifacts.totalSessions}),i.jsx("div",{className:"admin-summary-label",children:"Sessions"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.artifacts.totalArtifacts}),i.jsx("div",{className:"admin-summary-label",children:"Artifacts"})]})]}),n.artifacts.sessions.length>0?i.jsx("div",{className:"hub-session-list",children:n.artifacts.sessions.map(_=>i.jsxs("div",{className:"hub-card",children:[i.jsx("div",{className:"hub-card-top",children:i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:_.sessionId}),i.jsxs("span",{className:"hub-card-id",children:[_.count," artifact",_.count===1?"":"s"," ยท ",new Date(_.latestAt).toLocaleString()]})]})}),_.recent.length>0?i.jsx("ul",{className:"hub-artifact-list",children:_.recent.map((K,ne)=>i.jsxs("li",{children:[i.jsx("span",{className:"hub-chip",children:K.kind}),i.jsx("span",{className:"hub-artifact-title",children:K.title||"(untitled)"}),K.preview?i.jsx("div",{className:"hub-artifact-preview",children:K.preview}):null]},ne))}):i.jsx("div",{className:"admin-hint",children:"No artifact details."})]},_.sessionId))}):i.jsx("div",{className:"empty-state",children:"No artifacts yet โ€” tools that return a deliverable payload land here per session."})]}):null,e==="skills"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.skills.enabled}),i.jsx("div",{className:"admin-summary-label",children:"Enabled skills"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.skills.disabled}),i.jsx("div",{className:"admin-summary-label",children:"Disabled skills"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:n.skills.hub.length}),i.jsx("div",{className:"admin-summary-label",children:"Hub skills (SKILL.md)"})]})]}),i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ“š Compiled skills (SkillStore โ€” matched at plan time)"}),n.skills.compiled.length>0?i.jsx("div",{className:"hub-session-list",children:n.skills.compiled.map(_=>i.jsxs("div",{className:`hub-card${_.enabled?"":" hub-card-disabled"}`,children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:_.name}),i.jsxs("span",{className:"hub-card-id",children:[_.id,_.version?` ยท v${_.version}`:""]})]}),i.jsxs("div",{className:"hub-card-actions",children:[_.bundled===!0?i.jsx("span",{className:"hub-chip hub-chip-bundled",children:"๐Ÿง  bundled"}):i.jsx("span",{className:"hub-chip",children:"community"}),i.jsx("button",{role:"switch","aria-checked":_.enabled,"aria-label":`${_.enabled?"Disable":"Enable"} ${_.name}`,className:`hub-switch${_.enabled?" on":""}`,disabled:R===_.id||T!==null||h&&!Vt,onClick:()=>rd(_.id,!_.enabled),children:i.jsx("span",{className:"hub-switch-knob"})})]})]}),i.jsx("p",{className:"hub-card-desc",children:_.description}),i.jsxs("div",{className:"hub-card-tools",children:[typeof _.usageCount=="number"?i.jsxs("span",{className:"hub-chip",children:[_.usageCount," uses"]}):null,_.enabled?null:i.jsx("span",{className:"hub-chip",children:"disabled"})]}),L[_.id]?i.jsx("div",{className:"admin-row-msg",children:L[_.id]}):null,_.enabled?null:i.jsx("div",{className:"hub-card-note",children:"โ›” Excluded from skill matching โ€” not injected into the planner"})]},`c-${_.id}`))}):i.jsx("div",{className:"empty-state",children:"No compiled skills."}),i.jsx("h2",{className:"section-subtitle",children:"๐ŸŒ Hub skills (installed SKILL.md)"}),n.skills.hub.length>0?i.jsx("div",{className:"hub-session-list",children:n.skills.hub.map(_=>i.jsxs("div",{className:`hub-card${_.enabled?"":" hub-card-disabled"}`,children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:_.name}),i.jsx("span",{className:"hub-card-id",children:_.id})]}),i.jsxs("div",{className:"hub-card-actions",children:[i.jsx("button",{type:"button",className:"hub-mini-btn",disabled:Ms===_.id||h&&!Vt,onClick:()=>void fm(_.id),children:"๐Ÿ—‘ Uninstall"}),i.jsx("button",{role:"switch","aria-checked":_.enabled,"aria-label":`${_.enabled?"Disable":"Enable"} ${_.name}`,className:`hub-switch${_.enabled?" on":""}`,disabled:R===_.id||T!==null||h&&!Vt,onClick:()=>rd(_.id,!_.enabled),children:i.jsx("span",{className:"hub-switch-knob"})})]})]}),i.jsx("p",{className:"hub-card-desc",children:_.description}),i.jsxs("div",{className:"hub-card-tools",children:[i.jsx("span",{className:"hub-chip",children:"SKILL.md"}),_.enabled?null:i.jsx("span",{className:"hub-chip",children:"disabled"})]}),L[_.id]?i.jsx("div",{className:"admin-row-msg",children:L[_.id]}):null,_.enabled?null:i.jsx("div",{className:"hub-card-note",children:"โ›” Excluded from skill matching โ€” not injected into the planner"})]},`h-${_.id}`))}):i.jsxs("div",{className:"empty-state",children:["No hub skills installed โ€” search the marketplace below or run ",i.jsx("code",{children:"buff skills install <name>"}),"."]}),i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ›’ Marketplace (community skills)"}),i.jsxs("form",{className:"hub-market-search",onSubmit:td,children:[i.jsx("input",{type:"text",value:Oi,onChange:_=>Ps(_.target.value),placeholder:"Search community skills (e.g. code-assist, deploy, testing)โ€ฆ"}),i.jsx("button",{type:"submit",className:"admin-refresh-btn",disabled:Al,children:Al?"Searchingโ€ฆ":"๐Ÿ”Ž Search"})]}),ha?i.jsx("div",{className:`admin-row-msg${ha.kind==="err"?" admin-row-msg-err":""}`,children:ha.text}):null,Ri&&!Al?Dt.length>0?i.jsx("div",{className:"hub-session-list",children:Dt.map(_=>i.jsxs("div",{className:"hub-card",children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:_.name}),i.jsxs("span",{className:"hub-card-id",children:["v",_.version," ยท ",_.sourceKind]})]}),i.jsx("button",{type:"button",className:"admin-refresh-btn",disabled:Ms===_.name||h&&!Vt,onClick:()=>void dm(_.name),children:Ms===_.name?"Installingโ€ฆ":"โฌ‡ Install"})]}),i.jsx("p",{className:"hub-card-desc",children:_.description}),i.jsxs("div",{className:"hub-card-tools",children:[i.jsx("span",{className:"hub-chip",children:_.author}),_.tags.slice(0,3).map(K=>i.jsx("span",{className:"hub-chip",children:K},K))]})]},`m-${_.name}`))}):i.jsxs("div",{className:"empty-state",children:['No skills match "',Oi,'" โ€” try a broader term, or add a registry to ',i.jsx("code",{children:"skills.registries"})," in config."]}):null]}):null,e==="subagents"&&n?i.jsxs("div",{role:"tabpanel",children:[i.jsxs("div",{className:"admin-summary-grid",children:[i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:((yw=n.subagents)==null?void 0:yw.total)??0}),i.jsx("div",{className:"admin-summary-label",children:"Runs recorded"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:((bw=n.subagents)==null?void 0:bw.running)??0}),i.jsx("div",{className:"admin-summary-label",children:"Running now"})]}),i.jsxs("div",{className:"admin-summary-card",children:[i.jsx("div",{className:"admin-summary-value",children:((xw=n.subagents)==null?void 0:xw.failed)??0}),i.jsx("div",{className:"admin-summary-label",children:"Failed"})]})]}),i.jsxs("p",{className:"admin-hint",children:["Each run is a separate child process. A transport of ",i.jsx("code",{children:"json"})," means the provider has no native tool protocol and the shared JSON fallback carried the tool calls; a refusal code means the run stopped deliberately instead of returning an answer."]}),(((ww=n.subagents)==null?void 0:ww.recent)??[]).length>0?i.jsx("div",{className:"hub-session-list",children:(((Sw=n.subagents)==null?void 0:Sw.recent)??[]).map(_=>i.jsxs("div",{className:"hub-card",children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("div",{className:"hub-card-title",children:[i.jsx("span",{className:"hub-card-name",children:_.goal||"(no goal recorded)"}),i.jsxs("span",{className:"hub-card-id",children:[_.id.slice(0,8),_.startedAt?` ยท ${new Date(_.startedAt).toLocaleString()}`:""]})]}),i.jsx("div",{className:"hub-card-actions",children:i.jsx("span",{className:"hub-chip",children:Roe[_.status]??_.status})})]}),i.jsxs("div",{className:"hub-card-tools",children:[i.jsxs("span",{className:"hub-chip",children:["๐Ÿ”Œ ",_.provider??"provider unknown",_.model?` ยท ${_.model}`:""]}),i.jsxs("span",{className:"hub-chip",children:["๐Ÿ›  ",_.transport??"transport unknown"," transport"]}),i.jsxs("span",{className:"hub-chip",children:[_.llmCalls," model call",_.llmCalls===1?"":"s"]}),i.jsxs("span",{className:"hub-chip",children:[_.toolCalls," tool call",_.toolCalls===1?"":"s"]}),typeof _.durationMs=="number"?i.jsxs("span",{className:"hub-chip",children:[(_.durationMs/1e3).toFixed(1),"s"]}):null]}),_.refusalCode?i.jsxs("div",{className:"hub-card-note",children:["โ›” Refused before answering โ€” code ",i.jsx("code",{children:_.refusalCode})]}):null,_.error?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:_.error}):null,_.resultPreview?i.jsx("div",{className:"hub-artifact-preview",children:_.resultPreview}):null]},_.id))}):i.jsxs("div",{className:"empty-state",children:["No subagent runs recorded yet โ€” a run shows up here once the agent spawns one (the ",i.jsx("code",{children:"subagent"})," tool), and only if it actually started."]})]}):null]})}const JE={running:"โณ running",done:"โœ… done",failed:"โŒ failed",cancelled:"โน cancelled",timeout:"โฐ timed out",error:"๐Ÿ’ฅ error"};function ej(e){switch(e){case"done":return"task-status-done";case"running":return"task-status-running";case"failed":return"task-status-failed";case"cancelled":return"task-status-cancelled";case"timeout":return"task-status-timeout";default:return"task-status-error"}}function Loe(e){const t=[];let n="",r=null;for(const a of e.trim())r?a===r?r=null:n+=a:a==='"'||a==="'"?r=a:/\s/.test(a)?n&&(t.push(n),n=""):n+=a;return n&&t.push(n),t}function tj(e){return e===null?"โ€”":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function Doe(e){const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function Boe(){const[e,t]=k.useState(null),[n,r]=k.useState(""),[a,s]=k.useState(300),[o,l]=k.useState(!1),[c,u]=k.useState(""),[d,f]=k.useState(null),[h,p]=k.useState([]),[g,m]=k.useState(!0),y=k.useRef(null),v=k.useRef(null),b=k.useCallback(async()=>{const j=await Q.listTasks();j&&p(j.tasks)},[]);k.useEffect(()=>{Q.fetchAdminAuthStatus().then(j=>{t(j?{configured:j.configured,authenticated:j.authenticated,role:j.role??null}:{configured:!1,authenticated:!1,role:null}),j!=null&&j.authenticated&&b()})},[b]),k.useEffect(()=>{var j,C;if(g&&(d==null?void 0:d.status)==="running")try{(C=(j=y.current)==null?void 0:j.scrollIntoView)==null||C.call(j,{block:"end"})}catch{}},[d==null?void 0:d.logs.length,d==null?void 0:d.status,g]),k.useEffect(()=>()=>{var j;return(j=v.current)==null?void 0:j.call(v)},[]);const w=k.useCallback((j,C)=>{var $;if(($=v.current)==null||$.call(v),f(j),u(""),!C)return;const T=Q.subscribeTask(j.id,{onLog:R=>f(I=>I&&I.id===j.id?{...I,logs:[...I.logs,R]}:I),onStatus:R=>f(I=>I&&I.id===j.id?{...I,status:R}:I)});v.current=T},[]),N=k.useCallback(async()=>{const j=Loe(n);if(j.length===0){u("Type a command first โ€” e.g. `eval run --task smoke-test` or `gateway status`.");return}l(!0),u("");const C=await Q.startTask(j,a*1e3);if(l(!1),!C.ok||!C.task){u(C.error||"Failed to start task.");return}r(""),b(),w(C.task,!0)},[n,a,w,b]),S=k.useCallback(async j=>{await Q.cancelTask(j)},[]),x=k.useCallback(async j=>{const C=await Q.getTask(j);C!=null&&C.task&&w(C.task,!1)},[w]),E=k.useCallback(()=>{var j;(j=v.current)==null||j.call(v),f(null)},[]);return e?e.authenticated?i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"๐Ÿš€",title:"Command Console"}),i.jsx("p",{className:"admin-subtitle",children:"Run any agent-nuvira command โ€” the same CLI, executed by the dashboard. Messaging, skills, tools, eval, memory, traces and more."}),i.jsxs("form",{className:"task-run-form",onSubmit:j=>{j.preventDefault(),N()},children:[i.jsx("input",{className:"admin-input task-cmd-input",placeholder:"eval run --task smoke-test ยท gateway status ยท skill list ยท memory stats",value:n,onChange:j=>r(j.target.value),autoComplete:"off",spellCheck:!1}),i.jsxs("select",{className:"admin-input task-timeout-select",title:"Task timeout",value:a,onChange:j=>s(Number(j.target.value)),children:[i.jsx("option",{value:60,children:"1 min"}),i.jsx("option",{value:300,children:"5 min"}),i.jsx("option",{value:600,children:"10 min"}),i.jsx("option",{value:1800,children:"30 min"})]}),i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:o||n.trim()==="",children:o?"โณ Startingโ€ฆ":"โ–ถ Run"})]}),c&&i.jsx("div",{className:"admin-error",children:c}),i.jsx("p",{className:"task-hint",children:"Long-running commands stream their output live. Runs are capped at the chosen timeout and can be cancelled."}),d&&i.jsxs("div",{className:"task-console-wrap",children:[i.jsxs("div",{className:"task-console-header",children:[i.jsx("code",{className:"task-console-cmd",children:d.command}),i.jsx("span",{className:`task-status ${ej(d.status)}`,children:JE[d.status]}),i.jsxs("span",{className:"task-meta",children:["exit ",d.exitCode??"โ€”"," ยท ",tj(d.durationMs)]}),d.status==="running"&&i.jsx("button",{className:"admin-mini-btn task-cancel-btn",onClick:()=>void S(d.id),children:"โน Cancel"}),i.jsx("button",{className:"admin-mini-btn",onClick:E,children:"โœ• Close"})]}),i.jsxs("div",{className:"task-console",children:[d.logs.map((j,C)=>i.jsx("div",{className:`task-line task-line-${j.stream}`,children:j.text},C)),d.logs.length===0&&d.status==="running"&&i.jsx("div",{className:"task-line task-line-system",children:"โณ waiting for outputโ€ฆ"}),i.jsx("div",{ref:y})]}),i.jsxs("label",{className:"task-autoscroll",children:[i.jsx("input",{type:"checkbox",checked:g,onChange:j=>m(j.target.checked)})," auto-scroll"]})]}),i.jsx("h3",{className:"task-history-title",children:"History"}),h.length===0?i.jsx("div",{className:"empty-state",children:"No tasks yet โ€” run your first command above."}):i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table task-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Command"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Exit"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{children:"When"})]})}),i.jsx("tbody",{children:h.map(j=>i.jsxs("tr",{className:(d==null?void 0:d.id)===j.id?"task-row-active":"",onClick:()=>void x(j.id),children:[i.jsx("td",{children:i.jsx("code",{children:j.command})}),i.jsx("td",{children:i.jsx("span",{className:`task-status ${ej(j.status)}`,children:JE[j.status]})}),i.jsx("td",{children:j.exitCode??"โ€”"}),i.jsx("td",{children:tj(j.durationMs)}),i.jsx("td",{children:Doe(j.startedAt)})]},j.id))})]})})]}):i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"๐Ÿš€",title:"Command Console"}),i.jsxs("div",{className:"empty-state",children:[i.jsxs("p",{children:[i.jsx("strong",{children:"Log in to run tasks."})," The console executes commands on this machine, so it needs an admin session (like the Agent Hub toggles)."]}),i.jsx("p",{children:e.configured?i.jsx(Or,{className:"admin-refresh-btn",to:"/admin",children:"๐Ÿ” Log in"}):i.jsx(Or,{className:"admin-refresh-btn",to:"/admin",children:"๐Ÿ” Create admin account"})})]})]}):i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"๐Ÿš€",title:"Command Console"}),i.jsx("div",{className:"loading-state",children:"Loadingโ€ฆ"})]})}function zoe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Foe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Uoe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Woe={};function nj(e,t){return(Woe.jsx?Uoe:Foe).test(e)}const Hoe=/[ \t\n\f\r]/g;function Goe(e){return typeof e=="object"?e.type==="text"?rj(e.value):!1:rj(e)}function rj(e){return e.replace(Hoe,"")===""}class Gu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Gu.prototype.normal={};Gu.prototype.property={};Gu.prototype.space=void 0;function eM(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Gu(n,r,t)}function xb(e){return e.toLowerCase()}class Wn{constructor(t,n){this.attribute=n,this.property=t}}Wn.prototype.attribute="";Wn.prototype.booleanish=!1;Wn.prototype.boolean=!1;Wn.prototype.commaOrSpaceSeparated=!1;Wn.prototype.commaSeparated=!1;Wn.prototype.defined=!1;Wn.prototype.mustUseProperty=!1;Wn.prototype.number=!1;Wn.prototype.overloadedBoolean=!1;Wn.prototype.property="";Wn.prototype.spaceSeparated=!1;Wn.prototype.space=void 0;let qoe=0;const Ie=As(),Rt=As(),wb=As(),ce=As(),it=As(),ls=As(),Xn=As();function As(){return 2**++qoe}const Sb=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Rt,commaOrSpaceSeparated:Xn,commaSeparated:ls,number:ce,overloadedBoolean:wb,spaceSeparated:it},Symbol.toStringTag,{value:"Module"})),Tg=Object.keys(Sb);class K0 extends Wn{constructor(t,n,r,a){let s=-1;if(super(t,n),aj(this,"space",a),typeof r=="number")for(;++s<Tg.length;){const o=Tg[s];aj(this,Tg[s],(r&Sb[o])===Sb[o])}}}K0.prototype.defined=!0;function aj(e,t,n){n&&(e[t]=n)}function Sl(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const s=new K0(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[xb(r)]=r,n[xb(s.attribute)]=r}return new Gu(t,n,e.space)}const tM=Sl({properties:{ariaActiveDescendant:null,ariaAtomic:Rt,ariaAutoComplete:null,ariaBusy:Rt,ariaChecked:Rt,ariaColCount:ce,ariaColIndex:ce,ariaColSpan:ce,ariaControls:it,ariaCurrent:null,ariaDescribedBy:it,ariaDetails:null,ariaDisabled:Rt,ariaDropEffect:it,ariaErrorMessage:null,ariaExpanded:Rt,ariaFlowTo:it,ariaGrabbed:Rt,ariaHasPopup:null,ariaHidden:Rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:it,ariaLevel:ce,ariaLive:null,ariaModal:Rt,ariaMultiLine:Rt,ariaMultiSelectable:Rt,ariaOrientation:null,ariaOwns:it,ariaPlaceholder:null,ariaPosInSet:ce,ariaPressed:Rt,ariaReadOnly:Rt,ariaRelevant:null,ariaRequired:Rt,ariaRoleDescription:it,ariaRowCount:ce,ariaRowIndex:ce,ariaRowSpan:ce,ariaSelected:Rt,ariaSetSize:ce,ariaSort:null,ariaValueMax:ce,ariaValueMin:ce,ariaValueNow:ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function nM(e,t){return t in e?e[t]:t}function rM(e,t){return nM(e,t.toLowerCase())}const Koe=Sl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ls,acceptCharset:it,accessKey:it,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:it,autoFocus:Ie,autoPlay:Ie,blocking:it,capture:null,charSet:null,checked:Ie,cite:null,className:it,closedBy:null,colorSpace:null,cols:ce,colSpan:ce,command:null,commandFor:null,content:null,contentEditable:Rt,controls:Ie,controlsList:it,coords:ce|ls,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:wb,draggable:Rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:it,height:ce,hidden:wb,high:ce,href:null,hrefLang:null,htmlFor:it,httpEquiv:it,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:it,itemRef:it,itemScope:Ie,itemType:it,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:ce,manifest:null,max:null,maxLength:ce,media:null,method:null,min:null,minLength:ce,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:ce,pattern:null,ping:it,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:it,required:Ie,reversed:Ie,rows:ce,rowSpan:ce,sandbox:it,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:ce,sizes:null,slot:null,span:ce,spellCheck:Rt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ce,step:null,style:null,tabIndex:ce,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Rt,width:ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:it,axis:null,background:null,bgColor:null,border:ce,borderColor:null,bottomMargin:ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:ce,leftMargin:ce,link:null,longDesc:null,lowSrc:null,marginHeight:ce,marginWidth:ce,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:ce,rules:null,scheme:null,scrolling:Rt,standby:null,summary:null,text:null,topMargin:ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ce,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:ls,part:it,prefix:null,property:null,results:ce,security:null,unselectable:null},space:"html",transform:rM}),Voe=Sl({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",maskType:"mask-type",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:Xn,accentHeight:ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ce,amplitude:ce,arabicForm:null,ascent:ce,attributeName:null,attributeType:null,azimuth:ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ce,by:null,calcMode:null,capHeight:ce,className:it,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:ce,diffuseConstant:ce,direction:null,display:null,dur:null,divisor:ce,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:ce,enableBackground:null,end:null,event:null,exponent:ce,externalResourcesRequired:null,fill:null,fillOpacity:ce,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:ls,g2:ls,glyphName:ls,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ce,horizOriginX:ce,horizOriginY:ce,id:null,ideographic:ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ce,k:ce,k1:ce,k2:ce,k3:ce,k4:ce,kernelMatrix:Xn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ce,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:ce,overlineThickness:ce,paintOrder:null,panose1:null,path:null,pathLength:ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:it,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ce,pointsAtY:ce,pointsAtZ:ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xn,rev:Xn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xn,requiredFeatures:Xn,requiredFonts:Xn,requiredFormats:Xn,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:ce,specularExponent:ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ce,strikethroughThickness:ce,string:null,stroke:null,strokeDashArray:Xn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ce,strokeOpacity:ce,strokeWidth:null,style:null,surfaceScale:ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xn,tabIndex:ce,tableValues:null,target:null,targetX:ce,targetY:ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ce,underlineThickness:ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ce,values:null,vAlphabetic:ce,vMathematical:ce,vectorEffect:null,vHanging:ce,vIdeographic:ce,version:null,vertAdvY:ce,vertOriginX:ce,vertOriginY:ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:nM}),aM=Sl({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()}}),iM=Sl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:rM}),sM=Sl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Yoe={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"},Xoe=/[A-Z]/g,ij=/-[a-z]/g,Zoe=/^data[-\w.:]+$/i;function Qoe(e,t){const n=xb(t);let r=t,a=Wn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Zoe.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(ij,ele);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!ij.test(s)){let o=s.replace(Xoe,Joe);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=K0}return new a(r,t)}function Joe(e){return"-"+e.toLowerCase()}function ele(e){return e.charAt(1).toUpperCase()}const tle=eM([tM,Koe,aM,iM,sM],"html"),V0=eM([tM,Voe,aM,iM,sM],"svg");function nle(e){return e.join(" ").trim()}var Y0={},sj=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,rle=/\n/g,ale=/^\s*/,ile=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,sle=/^:\s*/,ole=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,lle=/^[;\s]*/,cle=/^\s+|\s+$/g,ule=`
165
- `,oj="/",lj="*",Ki="",dle="comment",fle="declaration";function hle(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 a(g){var m=g.match(rle);m&&(n+=m.length);var y=g.lastIndexOf(ule);r=~y?g.length-y:r+g.length}function s(){var g={line:n,column:r};return function(m){return m.position=new o(g),u(),m}}function o(g){this.start=g,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(g){var m=new Error(t.source+":"+n+":"+r+": "+g);if(m.reason=g,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function c(g){var m=g.exec(e);if(m){var y=m[0];return a(y),e=e.slice(y.length),m}}function u(){c(ale)}function d(g){var m;for(g=g||[];m=f();)m!==!1&&g.push(m);return g}function f(){var g=s();if(!(oj!=e.charAt(0)||lj!=e.charAt(1))){for(var m=2;Ki!=e.charAt(m)&&(lj!=e.charAt(m)||oj!=e.charAt(m+1));)++m;if(m+=2,Ki===e.charAt(m-1))return l("End of comment missing");var y=e.slice(2,m-2);return r+=2,a(y),e=e.slice(m),r+=2,g({type:dle,comment:y})}}function h(){var g=s(),m=c(ile);if(m){if(f(),!c(sle))return l("property missing ':'");var y=c(ole),v=g({type:fle,property:cj(m[0].replace(sj,Ki)),value:y?cj(y[0].replace(sj,Ki)):Ki});return c(lle),v}}function p(){var g=[];d(g);for(var m;m=h();)m!==!1&&(g.push(m),d(g));return g}return u(),p()}function cj(e){return e?e.replace(cle,Ki):Ki}var ple=hle,mle=Ja&&Ja.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Y0,"__esModule",{value:!0});Y0.default=vle;const gle=mle(ple);function vle(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,gle.default)(e),a=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:l}=s;a?t(o,l,s):l&&(n=n||{},n[o]=l)}),n}var tm={};Object.defineProperty(tm,"__esModule",{value:!0});tm.camelCase=void 0;var yle=/^--[a-zA-Z0-9_-]+$/,ble=/-([a-z])/g,xle=/^[^-]+$/,wle=/^-(webkit|moz|ms|o|khtml)-/,Sle=/^-(ms)-/,kle=function(e){return!e||xle.test(e)||yle.test(e)},Nle=function(e,t){return t.toUpperCase()},uj=function(e,t){return"".concat(t,"-")},Ele=function(e,t){return t===void 0&&(t={}),kle(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Sle,uj):e=e.replace(wle,uj),e.replace(ble,Nle))};tm.camelCase=Ele;var jle=Ja&&Ja.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_le=jle(Y0),Ale=tm;function kb(e,t){var n={};return!e||typeof e!="string"||(0,_le.default)(e,function(r,a){r&&a&&(n[(0,Ale.camelCase)(r,t)]=a)}),n}kb.default=kb;var Cle=kb;const Tle=Qe(Cle),oM=lM("end"),X0=lM("start");function lM(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 Ole(e){const t=X0(e),n=oM(e);if(t&&n)return{start:t,end:n}}function Nc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?dj(e.position):"start"in e||"end"in e?dj(e):"line"in e||"column"in e?Nb(e):""}function Nb(e){return fj(e&&e.line)+":"+fj(e&&e.column)}function dj(e){return Nb(e&&e.start)+"-"+Nb(e&&e.end)}function fj(e){return e&&typeof e=="number"?e:1}class Sn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?a=t:!s.cause&&t&&(o=!0,a=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?s.ruleId=r:(s.source=r.slice(0,c),s.ruleId=r.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=l?l.line:void 0,this.name=Nc(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Sn.prototype.file="";Sn.prototype.name="";Sn.prototype.reason="";Sn.prototype.message="";Sn.prototype.stack="";Sn.prototype.column=void 0;Sn.prototype.line=void 0;Sn.prototype.ancestors=void 0;Sn.prototype.cause=void 0;Sn.prototype.fatal=void 0;Sn.prototype.place=void 0;Sn.prototype.ruleId=void 0;Sn.prototype.source=void 0;const Z0={}.hasOwnProperty,Ple=new Map,Rle=/[A-Z]/g,Mle=new Set(["table","tbody","thead","tfoot","tr"]),Ile=new Set(["td","th"]),cM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $le(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=Hle(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=Wle(n,t.jsx,t.jsxs)}const a={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"?V0:tle,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=uM(a,e,void 0);return s&&typeof s!="string"?s:a.create(e,a.Fragment,{children:s||void 0},void 0)}function uM(e,t,n){if(t.type==="element")return Lle(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Dle(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return zle(e,t,n);if(t.type==="mdxjsEsm")return Ble(e,t);if(t.type==="root")return Fle(e,t,n);if(t.type==="text")return Ule(e,t)}function Lle(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=V0,e.schema=a),e.ancestors.push(t);const s=fM(e,t.tagName,!1),o=Gle(e,t);let l=J0(e,t);return Mle.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Goe(c):!0})),dM(e,o,s,t),Q0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function Dle(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)}Au(e,t.position)}function Ble(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Au(e,t.position)}function zle(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=V0,e.schema=a),e.ancestors.push(t);const s=t.name===null?e.Fragment:fM(e,t.name,!0),o=qle(e,t),l=J0(e,t);return dM(e,o,s,t),Q0(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function Fle(e,t,n){const r={};return Q0(r,J0(e,t)),e.create(t,e.Fragment,r,n)}function Ule(e,t){return t.value}function dM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Q0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Wle(e,t,n){return r;function r(a,s,o,l){const u=Array.isArray(o.children)?n:t;return l?u(s,o,l):u(s,o)}}function Hle(e,t){return n;function n(r,a,s,o){const l=Array.isArray(s.children),c=X0(r);return t(a,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Gle(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&Z0.call(t.properties,a)){const s=Kle(e,a,t.properties[a]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Ile.has(t.tagName)?r=l:n[o]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function qle(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Au(e,t.position);else{const a=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else Au(e,t.position);else s=r.value===null?!0:r.value;n[a]=s}return n}function J0(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:Ple;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const u=a.get(c)||0;o=c+"-"+u,a.set(c,u+1)}}const l=uM(e,s,o);l!==void 0&&n.push(l)}return n}function Kle(e,t,n){const r=Qoe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?zoe(n):nle(n)),r.property==="style"){let a=typeof n=="object"?n:Vle(e,String(n));return e.stylePropertyNameCase==="css"&&(a=Yle(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?Yoe[r.property]||r.property:r.attribute,n]}}function Vle(e,t){try{return Tle(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Sn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=cM+"#cannot-parse-style-attribute",a}}function fM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let s=-1,o;for(;++s<a.length;){const l=nj(a[s])?{type:"Identifier",name:a[s]}:{type:"Literal",value:a[s]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=o}else r=nj(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return Z0.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Au(e)}function Au(e,t){const n=new Sn("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=cM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Yle(e){const t={};let n;for(n in e)Z0.call(e,n)&&(t[Xle(n)]=e[n]);return t}function Xle(e){let t=e.replace(Rle,Zle);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Zle(e){return"-"+e.toLowerCase()}const Og={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"]},Qle={};function ew(e,t){const n=Qle,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return hM(e,r,a)}function hM(e,t,n){if(Jle(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 hj(e.children,t,n)}return Array.isArray(e)?hj(e,t,n):""}function hj(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=hM(e[a],t,n);return r.join("")}function Jle(e){return!!(e&&typeof e=="object")}const pj=document.createElement("i");function tw(e){const t="&"+e+";";pj.innerHTML=t;const n=pj.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function rr(e,t,n,r){const a=e.length;let s=0,o;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function gr(e,t){return e.length>0?(rr(e,e.length,0,t),e):t}const mj={}.hasOwnProperty;function pM(e){const t={};let n=-1;for(;++n<e.length;)ece(t,e[n]);return t}function ece(e,t){let n;for(n in t){const a=(mj.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){mj.call(a,o)||(a[o]=[]);const l=s[o];tce(a[o],Array.isArray(l)?l:l?[l]:[])}}}function tce(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);rr(e,0,0,r)}function mM(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 Fr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const An=Ai(/[A-Za-z]/),xn=Ai(/[\dA-Za-z]/),nce=Ai(/[#-'*+\--9=?A-Z^-~]/);function zh(e){return e!==null&&(e<32||e===127)}const Eb=Ai(/\d/),rce=Ai(/[\dA-Fa-f]/),ace=Ai(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function ot(e){return e!==null&&(e<0||e===32)}function ze(e){return e===-2||e===-1||e===32}const nm=Ai(new RegExp("\\p{P}|\\p{S}","u")),xs=Ai(/\s/);function Ai(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function kl(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&xn(e.charCodeAt(n+1))&&xn(e.charCodeAt(n+2)))a=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),a=1):o="๏ฟฝ"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+a+1,o=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function We(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return ze(c)?(e.enter(n),l(c)):t(c)}function l(c){return ze(c)&&s++<a?(e.consume(c),l):(e.exit(n),t(c))}}const ice={tokenize:sce};function sce(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),We(e,t,"linePrefix")}function a(l){return e.enter("paragraph"),s(l)}function s(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Ae(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),o)}}const oce={tokenize:lce},gj={tokenize:cce};function lce(e){const t=this,n=[];let r=0,a,s,o;return l;function l(w){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&b();const N=t.events.length;let S=N,x;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){x=t.events[S][1].end;break}v(r);let E=N;for(;E<t.events.length;)t.events[E][1].end={...x},E++;return rr(t.events,S+1,0,t.events.slice(N)),t.events.length=E,u(w)}return l(w)}function u(w){if(r===n.length){if(!a)return h(w);if(a.currentConstruct&&a.currentConstruct.concrete)return g(w);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gj,d,f)(w)}function d(w){return a&&b(),v(r),h(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(w)}function h(w){return t.containerState={},e.attempt(gj,p,g)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function g(w){if(w===null){a&&b(),v(0),e.consume(w);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:s}),m(w)}function m(w){if(w===null){y(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return Ae(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),m)}function y(w,N){const S=t.sliceStream(w);if(N&&S.push(null),w.previous=s,s&&(s.next=w),s=w,a.defineSkip(w.start),a.write(S),t.parser.lazy[w.start.line]){let x=a.events.length;for(;x--;)if(a.events[x][1].start.offset<o&&(!a.events[x][1].end||a.events[x][1].end.offset>o))return;const E=t.events.length;let j=E,C,T;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if(C){T=t.events[j][1].end;break}C=!0}for(v(r),x=E;x<t.events.length;)t.events[x][1].end={...T},x++;rr(t.events,j+1,0,t.events.slice(E)),t.events.length=x}}function v(w){let N=n.length;for(;N-- >w;){const S=n[N];t.containerState=S[1],S[0].exit.call(t,e)}n.length=w}function b(){a.write([null]),s=void 0,a=void 0,t.containerState._closeFlow=void 0}}function cce(e,t,n){return We(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||ot(e)||xs(e))return 1;if(nm(e))return 2}function rm(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const s=e[a].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const jb={name:"attention",resolveAll:uce,tokenize:dce};function uce(e,t){let n=-1,r,a,s,o,l,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};vj(f,-c),vj(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=gr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=gr(u,[["enter",a,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=gr(u,rm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=gr(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=gr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,rr(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 dce(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=rl(r);let s;return o;function o(c){return s=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===s)return e.consume(c),l;const u=e.exit("attentionSequence"),d=rl(c),f=!d||d===2&&a||n.includes(c),h=!a||a===2&&d||n.includes(r);return u._open=!!(s===42?f:f&&(a||!h)),u._close=!!(s===42?h:h&&(d||!f)),t(c)}}function vj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const fce={name:"autolink",tokenize:hce};function hce(e,t,n){let r=0;return a;function a(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return An(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||xn(p)?(r=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||xn(p))&&r++<32?(e.consume(p),l):(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||zh(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):nce(p)?(e.consume(p),u):n(p)}function d(p){return xn(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||xn(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const qu={partial:!0,tokenize:pce};function pce(e,t,n){return r;function r(s){return ze(s)?We(e,a,"linePrefix")(s):a(s)}function a(s){return s===null||Ae(s)?t(s):n(s)}}const gM={continuation:{tokenize:gce},exit:vce,name:"blockQuote",tokenize:mce};function mce(e,t,n){const r=this;return a;function a(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return ze(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function gce(e,t,n){const r=this;return a;function a(o){return ze(o)?We(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(gM,t,n)(o)}}function vce(e){e.exit("blockQuote")}const vM={name:"characterEscape",tokenize:yce};function yce(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),a}function a(s){return ace(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const yM={name:"characterReference",tokenize:bce};function bce(e,t,n){const r=this;let a=0,s,o;return l;function l(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"),s=31,o=xn,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=rce,d):(e.enter("characterReferenceValue"),s=7,o=Eb,d(f))}function d(f){if(f===59&&a){const h=e.exit("characterReferenceValue");return o===xn&&!tw(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&a++<s?(e.consume(f),d):n(f)}}const yj={partial:!0,tokenize:wce},bj={concrete:!0,name:"codeFenced",tokenize:xce};function xce(e,t,n){const r=this,a={partial:!0,tokenize:S};let s=0,o=0,l;return c;function c(x){return u(x)}function u(x){const E=r.events[r.events.length-1];return s=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,l=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(x)}function d(x){return x===l?(o++,e.consume(x),d):o<3?n(x):(e.exit("codeFencedFenceSequence"),ze(x)?We(e,f,"whitespace")(x):f(x))}function f(x){return x===null||Ae(x)?(e.exit("codeFencedFence"),r.interrupt?t(x):e.check(yj,m,N)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===null||Ae(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(x)):ze(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),We(e,p,"whitespace")(x)):x===96&&x===l?n(x):(e.consume(x),h)}function p(x){return x===null||Ae(x)?f(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||Ae(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(x)):x===96&&x===l?n(x):(e.consume(x),g)}function m(x){return e.attempt(a,N,y)(x)}function y(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),v}function v(x){return s>0&&ze(x)?We(e,b,"linePrefix",s+1)(x):b(x)}function b(x){return x===null||Ae(x)?e.check(yj,m,N)(x):(e.enter("codeFlowValue"),w(x))}function w(x){return x===null||Ae(x)?(e.exit("codeFlowValue"),b(x)):(e.consume(x),w)}function N(x){return e.exit("codeFenced"),t(x)}function S(x,E,j){let C=0;return T;function T(F){return x.enter("lineEnding"),x.consume(F),x.exit("lineEnding"),$}function $(F){return x.enter("codeFencedFence"),ze(F)?We(x,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):R(F)}function R(F){return F===l?(x.enter("codeFencedFenceSequence"),I(F)):j(F)}function I(F){return F===l?(C++,x.consume(F),I):C>=o?(x.exit("codeFencedFenceSequence"),ze(F)?We(x,L,"whitespace")(F):L(F)):j(F)}function L(F){return F===null||Ae(F)?(x.exit("codeFencedFence"),E(F)):j(F)}}}function wce(e,t,n){const r=this;return a;function a(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Pg={name:"codeIndented",tokenize:kce},Sce={partial:!0,tokenize:Nce};function kce(e,t,n){const r=this;return a;function a(u){return e.enter("codeIndented"),We(e,s,"linePrefix",5)(u)}function s(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):Ae(u)?e.attempt(Sce,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Ae(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function Nce(e,t,n){const r=this;return a;function a(o){return r.parser.lazy[r.now().line]?n(o):Ae(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):We(e,s,"linePrefix",5)(o)}function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Ae(o)?a(o):n(o)}}const Ece={name:"codeText",previous:_ce,resolve:jce,tokenize:Ace};function jce(e){let t=e.length-4,n=3,r,a;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;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function _ce(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ace(e,t,n){let r=0,a,s;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),r++,l):(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?(s=e.enter("codeTextSequence"),a=0,d(f)):Ae(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||Ae(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),a++,d):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",u(f))}}class Cce{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 a=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&tc(this.left,r),s.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),tc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),tc(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);tc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);tc(this.left,n.reverse())}}}function tc(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 bM(e){const t={};let n=-1,r,a,s,o,l,c,u;const d=new Cce(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,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Tce(d,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,a=void 0;s--;)if(o=d.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),o[1].type="lineEnding",a=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;a&&(r[1].end={...d.get(a)[1].start},l=d.slice(a,n),l.unshift(r),d.splice(a,n-a+1,l))}}return rr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function Tce(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],u={};let d,f,h=-1,p=n,g=0,m=0;const y=[m];for(;p;){for(;e.get(++a)[1]!==p;);s.push(a),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(m=h+1,y.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),h=y.length;h--;){const v=l.slice(y[h],y[h+1]),b=s.pop();c.push([b,b+v.length-1]),e.splice(b,2,v)}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 Oce={resolve:Rce,tokenize:Mce},Pce={partial:!0,tokenize:Ice};function Rce(e){return bM(e),e}function Mce(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(l)}function a(l){return l===null?s(l):Ae(l)?e.check(Pce,o,s)(l):(e.consume(l),a)}function s(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function Ice(e,t,n){const r=this;return a;function a(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),We(e,s,"linePrefix")}function s(o){if(o===null||Ae(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function xM(e,t,n,r,a,s,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(v){return v===60?(e.enter(r),e.enter(a),e.enter(s),e.consume(v),e.exit(s),h):v===null||v===32||v===41||zh(v)?n(v):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),m(v))}function h(v){return v===62?(e.enter(s),e.consume(v),e.exit(s),e.exit(a),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===62?(e.exit("chunkString"),e.exit(l),h(v)):v===null||v===60||Ae(v)?n(v):(e.consume(v),v===92?g:p)}function g(v){return v===60||v===62||v===92?(e.consume(v),p):p(v)}function m(v){return!d&&(v===null||v===41||ot(v))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(v)):d<u&&v===40?(e.consume(v),d++,m):v===41?(e.consume(v),d--,m):v===null||v===32||v===40||zh(v)?n(v):(e.consume(v),v===92?y:m)}function y(v){return v===40||v===41||v===92?(e.consume(v),m):m(v)}}function wM(e,t,n,r,a,s){const o=this;let l=0,c;return u;function u(p){return e.enter(r),e.enter(a),e.consume(p),e.exit(a),e.enter(s),d}function d(p){return l>999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):Ae(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||Ae(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!ze(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function SM(e,t,n,r,a,s){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(a),e.consume(h),e.exit(a),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(a),e.consume(h),e.exit(a),e.exit(r),t):(e.enter(s),u(h))}function u(h){return h===o?(e.exit(s),c(o)):h===null?n(h):Ae(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),We(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||Ae(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===o||h===92?(e.consume(h),d):d(h)}}function Ec(e,t){let n;return r;function r(a){return Ae(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):ze(a)?We(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const $ce={name:"definition",tokenize:Dce},Lce={partial:!0,tokenize:Bce};function Dce(e,t,n){const r=this;let a;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return wM.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return a=Fr(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 ot(p)?Ec(e,u)(p):u(p)}function u(p){return xM(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Lce,f,f)(p)}function f(p){return ze(p)?We(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Ae(p)?(e.exit("definition"),r.parser.defined.push(a),t(p)):n(p)}}function Bce(e,t,n){return r;function r(l){return ot(l)?Ec(e,a)(l):n(l)}function a(l){return SM(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return ze(l)?We(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Ae(l)?t(l):n(l)}}const zce={name:"hardBreakEscape",tokenize:Fce};function Fce(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),a}function a(s){return Ae(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Uce={name:"headingAtx",resolve:Wce,tokenize:Hce};function Wce(e,t){let n=e.length-2,r=3,a,s;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&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},rr(e,r,n-r+1,[["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t]])),e}function Hce(e,t,n){let r=0;return a;function a(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||ot(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Ae(d)?(e.exit("atxHeading"),t(d)):ze(d)?We(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||ot(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const Gce=["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"],xj=["pre","script","style","textarea"],qce={concrete:!0,name:"htmlFlow",resolveTo:Yce,tokenize:Xce},Kce={partial:!0,tokenize:Qce},Vce={partial:!0,tokenize:Zce};function Yce(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 Xce(e,t,n){const r=this;let a,s,o,l,c;return u;function u(P){return d(P)}function d(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),s=!0,m):P===63?(e.consume(P),a=3,r.interrupt?t:A):An(P)?(e.consume(P),o=String.fromCharCode(P),y):n(P)}function h(P){return P===45?(e.consume(P),a=2,p):P===91?(e.consume(P),a=5,l=0,g):An(P)?(e.consume(P),a=4,r.interrupt?t:A):n(P)}function p(P){return P===45?(e.consume(P),r.interrupt?t:A):n(P)}function g(P){const oe="CDATA[";return P===oe.charCodeAt(l++)?(e.consume(P),l===oe.length?r.interrupt?t:R:g):n(P)}function m(P){return An(P)?(e.consume(P),o=String.fromCharCode(P),y):n(P)}function y(P){if(P===null||P===47||P===62||ot(P)){const oe=P===47,be=o.toLowerCase();return!oe&&!s&&xj.includes(be)?(a=1,r.interrupt?t(P):R(P)):Gce.includes(o.toLowerCase())?(a=6,oe?(e.consume(P),v):r.interrupt?t(P):R(P)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):s?b(P):w(P))}return P===45||xn(P)?(e.consume(P),o+=String.fromCharCode(P),y):n(P)}function v(P){return P===62?(e.consume(P),r.interrupt?t:R):n(P)}function b(P){return ze(P)?(e.consume(P),b):T(P)}function w(P){return P===47?(e.consume(P),T):P===58||P===95||An(P)?(e.consume(P),N):ze(P)?(e.consume(P),w):T(P)}function N(P){return P===45||P===46||P===58||P===95||xn(P)?(e.consume(P),N):S(P)}function S(P){return P===61?(e.consume(P),x):ze(P)?(e.consume(P),S):w(P)}function x(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),c=P,E):ze(P)?(e.consume(P),x):j(P)}function E(P){return P===c?(e.consume(P),c=null,C):P===null||Ae(P)?n(P):(e.consume(P),E)}function j(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||ot(P)?S(P):(e.consume(P),j)}function C(P){return P===47||P===62||ze(P)?w(P):n(P)}function T(P){return P===62?(e.consume(P),$):n(P)}function $(P){return P===null||Ae(P)?R(P):ze(P)?(e.consume(P),$):n(P)}function R(P){return P===45&&a===2?(e.consume(P),z):P===60&&a===1?(e.consume(P),M):P===62&&a===4?(e.consume(P),Z):P===63&&a===3?(e.consume(P),A):P===93&&a===5?(e.consume(P),U):Ae(P)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(Kce,D,I)(P)):P===null||Ae(P)?(e.exit("htmlFlowData"),I(P)):(e.consume(P),R)}function I(P){return e.check(Vce,L,D)(P)}function L(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),F}function F(P){return P===null||Ae(P)?I(P):(e.enter("htmlFlowData"),R(P))}function z(P){return P===45?(e.consume(P),A):R(P)}function M(P){return P===47?(e.consume(P),o="",O):R(P)}function O(P){if(P===62){const oe=o.toLowerCase();return xj.includes(oe)?(e.consume(P),Z):R(P)}return An(P)&&o.length<8?(e.consume(P),o+=String.fromCharCode(P),O):R(P)}function U(P){return P===93?(e.consume(P),A):R(P)}function A(P){return P===62?(e.consume(P),Z):P===45&&a===2?(e.consume(P),A):R(P)}function Z(P){return P===null||Ae(P)?(e.exit("htmlFlowData"),D(P)):(e.consume(P),Z)}function D(P){return e.exit("htmlFlow"),t(P)}}function Zce(e,t,n){const r=this;return a;function a(o){return Ae(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Qce(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(qu,t,n)}}const Jce={name:"htmlText",tokenize:eue};function eue(e,t,n){const r=this;let a,s,o;return l;function l(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),c}function c(A){return A===33?(e.consume(A),u):A===47?(e.consume(A),S):A===63?(e.consume(A),w):An(A)?(e.consume(A),j):n(A)}function u(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),s=0,g):An(A)?(e.consume(A),b):n(A)}function d(A){return A===45?(e.consume(A),p):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),h):Ae(A)?(o=f,M(A)):(e.consume(A),f)}function h(A){return A===45?(e.consume(A),p):f(A)}function p(A){return A===62?z(A):A===45?h(A):f(A)}function g(A){const Z="CDATA[";return A===Z.charCodeAt(s++)?(e.consume(A),s===Z.length?m:g):n(A)}function m(A){return A===null?n(A):A===93?(e.consume(A),y):Ae(A)?(o=m,M(A)):(e.consume(A),m)}function y(A){return A===93?(e.consume(A),v):m(A)}function v(A){return A===62?z(A):A===93?(e.consume(A),v):m(A)}function b(A){return A===null||A===62?z(A):Ae(A)?(o=b,M(A)):(e.consume(A),b)}function w(A){return A===null?n(A):A===63?(e.consume(A),N):Ae(A)?(o=w,M(A)):(e.consume(A),w)}function N(A){return A===62?z(A):w(A)}function S(A){return An(A)?(e.consume(A),x):n(A)}function x(A){return A===45||xn(A)?(e.consume(A),x):E(A)}function E(A){return Ae(A)?(o=E,M(A)):ze(A)?(e.consume(A),E):z(A)}function j(A){return A===45||xn(A)?(e.consume(A),j):A===47||A===62||ot(A)?C(A):n(A)}function C(A){return A===47?(e.consume(A),z):A===58||A===95||An(A)?(e.consume(A),T):Ae(A)?(o=C,M(A)):ze(A)?(e.consume(A),C):z(A)}function T(A){return A===45||A===46||A===58||A===95||xn(A)?(e.consume(A),T):$(A)}function $(A){return A===61?(e.consume(A),R):Ae(A)?(o=$,M(A)):ze(A)?(e.consume(A),$):C(A)}function R(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),a=A,I):Ae(A)?(o=R,M(A)):ze(A)?(e.consume(A),R):(e.consume(A),L)}function I(A){return A===a?(e.consume(A),a=void 0,F):A===null?n(A):Ae(A)?(o=I,M(A)):(e.consume(A),I)}function L(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||ot(A)?C(A):(e.consume(A),L)}function F(A){return A===47||A===62||ot(A)?C(A):n(A)}function z(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function M(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return ze(A)?We(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):U(A)}function U(A){return e.enter("htmlTextData"),o(A)}}const nw={name:"labelEnd",resolveAll:aue,resolveTo:iue,tokenize:sue},tue={tokenize:oue},nue={tokenize:lue},rue={tokenize:cue};function aue(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 a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&rr(e,0,e.length,n),e}function iue(e,t){let n=e.length,r=0,a,s,o,l;for(;n--;)if(a=e[n][1],s){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(s=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(o=n);const c={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=gr(l,e.slice(s+1,s+r+3)),l=gr(l,[["enter",d,t]]),l=gr(l,rm(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),l=gr(l,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),l=gr(l,e.slice(o+1)),l=gr(l,[["exit",c,t]]),rr(e,s,e.length,l),e}function sue(e,t,n){const r=this;let a=r.events.length,s,o;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){s=r.events[a][1];break}return l;function l(h){return s?s._inactive?f(h):(o=r.parser.defined.includes(Fr(r.sliceSerialize({start:s.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(tue,d,o?d:f)(h):h===91?e.attempt(nue,d,o?u:f)(h):o?d(h):f(h)}function u(h){return e.attempt(rue,d,f)(h)}function d(h){return t(h)}function f(h){return s._balanced=!0,n(h)}}function oue(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),a}function a(f){return ot(f)?Ec(e,s)(f):s(f)}function s(f){return f===41?d(f):xM(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return ot(f)?Ec(e,c)(f):d(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?SM(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return ot(f)?Ec(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 lue(e,t,n){const r=this;return a;function a(l){return wM.call(r,e,s,o,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(Fr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function cue(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),a}function a(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const uue={name:"labelStartImage",resolveAll:nw.resolveAll,tokenize:due};function due(e,t,n){const r=this;return a;function a(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),s}function s(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const fue={name:"labelStartLink",resolveAll:nw.resolveAll,tokenize:hue};function hue(e,t,n){const r=this;return a;function a(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Rg={name:"lineEnding",tokenize:pue};function pue(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),We(e,t,"linePrefix")}}const df={name:"thematicBreak",tokenize:mue};function mue(e,t,n){let r=0,a;return s;function s(u){return e.enter("thematicBreak"),o(u)}function o(u){return a=u,l(u)}function l(u){return u===a?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Ae(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===a?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),ze(u)?We(e,l,"whitespace")(u):l(u))}}const In={continuation:{tokenize:bue},exit:wue,name:"list",tokenize:yue},gue={partial:!0,tokenize:Sue},vue={partial:!0,tokenize:xue};function yue(e,t,n){const r=this,a=r.events[r.events.length-1];let s=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,o=0;return l;function l(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Eb(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(df,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 Eb(p)&&++o<10?(e.consume(p),c):(!r.interrupt||o<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(qu,r.interrupt?n:d,e.attempt(gue,h,f))}function d(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return ze(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function bue(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(qu,a,s);function a(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,We(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!ze(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vue,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,We(e,e.attempt(In,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function xue(e,t,n){const r=this;return We(e,a,"listItemIndent",r.containerState.size+1);function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function wue(e){e.exit(this.containerState.type)}function Sue(e,t,n){const r=this;return We(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(s){const o=r.events[r.events.length-1];return!ze(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const wj={name:"setextUnderline",resolveTo:kue,tokenize:Nue};function kue(e,t){let n=e.length,r,a,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",s?(e.splice(a,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Nue(e,t,n){const r=this;let a;return s;function s(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"),a=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===a?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),ze(u)?We(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ae(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Eue={tokenize:jue};function jue(e){const t=this,n=e.attempt(qu,r,e.attempt(this.parser.constructs.flowInitial,a,We(e,e.attempt(this.parser.constructs.flow,a,e.attempt(Oce,a)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const _ue={resolveAll:NM()},Aue=kM("string"),Cue=kM("text");function kM(e){return{resolveAll:NM(e==="text"?Tue:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],s=n.attempt(a,o,l);return o;function o(d){return u(d)?s(d):l(d)}function l(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"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=a[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 NM(e){return t;function t(n,r){let a=-1,s;for(;++a<=n.length;)s===void 0?n[a]&&n[a][1].type==="data"&&(s=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==s+2&&(n[s][1].end=n[a-1][1].end,n.splice(s+2,a-s-2),a=s+2),s=void 0);return e?e(n,r):n}}function Tue(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],a=t.sliceStream(r);let s=a.length,o=-1,l=0,c;for(;s--;){const u=a[s];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(u===-2)c=!0,l++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},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 Oue={42:In,43:In,45:In,48:In,49:In,50:In,51:In,52:In,53:In,54:In,55:In,56:In,57:In,62:gM},Pue={91:$ce},Rue={[-2]:Pg,[-1]:Pg,32:Pg},Mue={35:Uce,42:df,45:[wj,df],60:qce,61:wj,95:df,96:bj,126:bj},Iue={38:yM,92:vM},$ue={[-5]:Rg,[-4]:Rg,[-3]:Rg,33:uue,38:yM,42:jb,60:[fce,Jce],91:fue,92:[zce,vM],93:nw,95:jb,96:Ece},Lue={null:[jb,_ue]},Due={null:[42,95]},Bue={null:[]},zue=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Due,contentInitial:Pue,disable:Bue,document:Oue,flow:Mue,flowInitial:Rue,insideSpan:Lue,string:Iue,text:$ue},Symbol.toStringTag,{value:"Module"}));function Fue(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 a={},s=[];let o=[],l=[];const c={attempt:E(S),check:E(x),consume:b,enter:w,exit:N,interrupt:E(x,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&s.push(t),u;function f($){return o=gr(o,$),y(),o[o.length-1]!==null?[]:(j(t,0),u.events=rm(s,u.events,u),u.events)}function h($,R){return Wue(p($),R)}function p($){return Uue(o,$)}function g(){const{_bufferIndex:$,_index:R,line:I,column:L,offset:F}=r;return{_bufferIndex:$,_index:R,line:I,column:L,offset:F}}function m($){a[$.line]=$.column,T()}function y(){let $;for(;r._index<o.length;){const R=o[r._index];if(typeof R=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<R.length;)v(R.charCodeAt(r._bufferIndex));else v(R)}}function v($){d=d($)}function b($){Ae($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,T()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=$}function w($,R){const I=R||{};return I.type=$,I.start=g(),u.events.push(["enter",I,u]),l.push(I),I}function N($){const R=l.pop();return R.end=g(),u.events.push(["exit",R,u]),R}function S($,R){j($,R.from)}function x($,R){R.restore()}function E($,R){return I;function I(L,F,z){let M,O,U,A;return Array.isArray(L)?D(L):"tokenize"in L?D([L]):Z(L);function Z(pe){return Ce;function Ce(G){const Y=G!==null&&pe[G],ie=G!==null&&pe.null,le=[...Array.isArray(Y)?Y:Y?[Y]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return D(le)(G)}}function D(pe){return M=pe,O=0,pe.length===0?z:P(pe[O])}function P(pe){return Ce;function Ce(G){return A=C(),U=pe,pe.partial||(u.currentConstruct=pe),pe.name&&u.parser.constructs.disable.null.includes(pe.name)?be():pe.tokenize.call(R?Object.assign(Object.create(u),R):u,c,oe,be)(G)}}function oe(pe){return $(U,A),F}function be(pe){return A.restore(),++O<M.length?P(M[O]):z}}}function j($,R){$.resolveAll&&!s.includes($)&&s.push($),$.resolve&&rr(u.events,R,u.events.length-R,$.resolve(u.events.slice(R),u)),$.resolveTo&&(u.events=$.resolveTo(u.events,u))}function C(){const $=g(),R=u.previous,I=u.currentConstruct,L=u.events.length,F=Array.from(l);return{from:L,restore:z};function z(){r=$,u.previous=R,u.currentConstruct=I,u.events.length=L,l=F,T()}}function T(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function Uue(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,s=t.end._bufferIndex;let o;if(n===a)o=[e[n].slice(r,s)];else{if(o=e.slice(n,a),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}s>0&&o.push(e[a].slice(0,s))}return o}function Wue(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
166
- `;break}case-3:{o=`\r
167
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&a)continue;o=" ";break}default:o=String.fromCharCode(s)}a=s===-2,r.push(o)}return r.join("")}function Hue(e){const r={constructs:pM([zue,...(e||{}).extensions||[]]),content:a(ice),defined:[],document:a(oce),flow:a(Eue),lazy:{},string:a(Aue),text:a(Cue)};return r;function a(s){return o;function o(l){return Fue(r,s,l)}}}function Gue(e){for(;!bM(e););return e}const Sj=/[\0\t\n\r]/g;function que(){let e=1,t="",n=!0,r;return a;function a(s,o,l){const c=[];let u,d,f,h,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(Sj.lastIndex=f,u=Sj.exec(s),h=u&&u.index!==void 0?u.index:s.length,p=s.charCodeAt(h),!u){t=s.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(s.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 l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const Kue=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Vue(e){return e.replace(Kue,Yue)}function Yue(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),s=a===120||a===88;return mM(n.slice(s?2:1),s?16:10)}return tw(n)||e}const EM={}.hasOwnProperty;function Xue(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Zue(n)(Gue(Hue(n).document().write(que()(e,t,!0))))}function Zue(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(tt),autolinkProtocol:C,autolinkEmail:C,atxHeading:s(je),blockQuote:s(ie),characterEscape:C,characterReference:C,codeFenced:s(le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(le,o),codeText:s(X,o),codeTextData:C,data:C,codeFlowValue:C,definition:s(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Ne),hardBreakEscape:s(ge),hardBreakTrailing:s(ge),htmlFlow:s(Le,o),htmlFlowData:C,htmlText:s(Le,o),htmlTextData:C,image:s(fe),label:o,link:s(tt),listItem:s(Ee),listItemValue:h,listOrdered:s(Be,f),listUnordered:s(Be),paragraph:s(Ke),reference:P,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(je),strong:s($t),thematicBreak:s(en)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:Y,autolinkProtocol:G,blockQuote:c(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:pe,characterReference:Ce,codeFenced:c(y),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:T,codeIndented:c(v),codeText:c(F),codeTextData:T,data:T,definition:c(),definitionDestinationString:N,definitionLabelString:b,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(R),hardBreakTrailing:c(R),htmlFlow:c(I),htmlFlowData:T,htmlText:c(L),htmlTextData:T,image:c(M),label:U,labelText:O,lineEnding:$,link:c(z),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:A,resourceTitleString:Z,resource:D,setextHeading:c(j),setextHeadingLineSequence:E,setextHeadingText:x,strong:c(),thematicBreak:c()}};jM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(W){let V={type:"root",children:[]};const ae={stack:[V],tokenStack:[],config:t,enter:l,exit:u,buffer:o,resume:d,data:n},he=[];let xe=-1;for(;++xe<W.length;)if(W[xe][1].type==="listOrdered"||W[xe][1].type==="listUnordered")if(W[xe][0]==="enter")he.push(xe);else{const Ge=he.pop();xe=a(W,Ge,xe)}for(xe=-1;++xe<W.length;){const Ge=t[W[xe][0]];EM.call(Ge,W[xe][1].type)&&Ge[W[xe][1].type].call(Object.assign({sliceSerialize:W[xe][2].sliceSerialize},ae),W[xe][1])}if(ae.tokenStack.length>0){const Ge=ae.tokenStack[ae.tokenStack.length-1];(Ge[1]||kj).call(ae,void 0,Ge[0])}for(V.position={start:Ga(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Ga(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe<t.transforms.length;)V=t.transforms[xe](V)||V;return V}function a(W,V,ae){let he=V-1,xe=-1,Ge=!1,un,Ot,Hn,kn;for(;++he<=ae;){const Re=W[he];switch(Re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Re[0]==="enter"?xe++:xe--,kn=void 0;break}case"lineEndingBlank":{Re[0]==="enter"&&(un&&!kn&&!xe&&!Hn&&(Hn=he),kn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:kn=void 0}if(!xe&&Re[0]==="enter"&&Re[1].type==="listItemPrefix"||xe===-1&&Re[0]==="exit"&&(Re[1].type==="listUnordered"||Re[1].type==="listOrdered")){if(un){let Gn=he;for(Ot=void 0;Gn--;){const Lt=W[Gn];if(Lt[1].type==="lineEnding"||Lt[1].type==="lineEndingBlank"){if(Lt[0]==="exit")continue;Ot&&(W[Ot][1].type="lineEndingBlank",Ge=!0),Lt[1].type="lineEnding",Ot=Gn}else if(!(Lt[1].type==="linePrefix"||Lt[1].type==="blockQuotePrefix"||Lt[1].type==="blockQuotePrefixWhitespace"||Lt[1].type==="blockQuoteMarker"||Lt[1].type==="listItemIndent"))break}Hn&&(!Ot||Hn<Ot)&&(un._spread=!0),un.end=Object.assign({},Ot?W[Ot][1].start:Re[1].end),W.splice(Ot||he,0,["exit",un,Re[2]]),he++,ae++}if(Re[1].type==="listItemPrefix"){const Gn={type:"listItem",_spread:!1,start:Object.assign({},Re[1].start),end:void 0};un=Gn,W.splice(he,0,["enter",Gn,Re[2]]),he++,ae++,Hn=void 0,kn=!0}}}return W[V][1]._spread=Ge,ae}function s(W,V){return ae;function ae(he){l.call(this,W(he),he),V&&V.call(this,he)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(W,V,ae){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([V,ae||void 0]),W.position={start:Ga(V.start),end:void 0}}function c(W){return V;function V(ae){W&&W.call(this,ae),u.call(this,ae)}}function u(W,V){const ae=this.stack.pop(),he=this.tokenStack.pop();if(he)he[0].type!==W.type&&(V?V.call(this,W,he[0]):(he[1]||kj).call(this,W,he[0]));else throw new Error("Cannot close `"+W.type+"` ("+Nc({start:W.start,end:W.end})+"): itโ€™s not open");ae.position.end=Ga(W.end)}function d(){return ew(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(W){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function p(){const W=this.resume(),V=this.stack[this.stack.length-1];V.lang=W}function g(){const W=this.resume(),V=this.stack[this.stack.length-1];V.meta=W}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W.replace(/(\r?\n|\r)$/g,"")}function b(W){const V=this.resume(),ae=this.stack[this.stack.length-1];ae.label=V,ae.identifier=Fr(this.sliceSerialize(W)).toLowerCase()}function w(){const W=this.resume(),V=this.stack[this.stack.length-1];V.title=W}function N(){const W=this.resume(),V=this.stack[this.stack.length-1];V.url=W}function S(W){const V=this.stack[this.stack.length-1];if(!V.depth){const ae=this.sliceSerialize(W).length;V.depth=ae}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function E(W){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function C(W){const ae=this.stack[this.stack.length-1].children;let he=ae[ae.length-1];(!he||he.type!=="text")&&(he=Rn(),he.position={start:Ga(W.start),end:void 0},ae.push(he)),this.stack.push(he)}function T(W){const V=this.stack.pop();V.value+=this.sliceSerialize(W),V.position.end=Ga(W.end)}function $(W){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ae=V.children[V.children.length-1];ae.position.end=Ga(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(V.type)&&(C.call(this,W),T.call(this,W))}function R(){this.data.atHardBreak=!0}function I(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W}function L(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W}function F(){const W=this.resume(),V=this.stack[this.stack.length-1];V.value=W}function z(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=V,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function M(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=V,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function O(W){const V=this.sliceSerialize(W),ae=this.stack[this.stack.length-2];ae.label=Vue(V),ae.identifier=Fr(V).toLowerCase()}function U(){const W=this.stack[this.stack.length-1],V=this.resume(),ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,ae.type==="link"){const he=W.children;ae.children=he}else ae.alt=V}function A(){const W=this.resume(),V=this.stack[this.stack.length-1];V.url=W}function Z(){const W=this.resume(),V=this.stack[this.stack.length-1];V.title=W}function D(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function oe(W){const V=this.resume(),ae=this.stack[this.stack.length-1];ae.label=V,ae.identifier=Fr(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function be(W){this.data.characterReferenceType=W.type}function pe(W){const V=this.sliceSerialize(W),ae=this.data.characterReferenceType;let he;ae?(he=mM(V,ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):he=tw(V);const xe=this.stack[this.stack.length-1];xe.value+=he}function Ce(W){const V=this.stack.pop();V.position.end=Ga(W.end)}function G(W){T.call(this,W);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(W)}function Y(W){T.call(this,W);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(W)}function ie(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function X(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ne(){return{type:"emphasis",children:[]}}function je(){return{type:"heading",depth:0,children:[]}}function ge(){return{type:"break"}}function Le(){return{type:"html",value:""}}function fe(){return{type:"image",title:null,url:"",alt:null}}function tt(){return{type:"link",title:null,url:"",children:[]}}function Be(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function Ee(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function Ke(){return{type:"paragraph",children:[]}}function $t(){return{type:"strong",children:[]}}function Rn(){return{type:"text",value:""}}function en(){return{type:"thematicBreak"}}}function Ga(e){return{line:e.line,column:e.column,offset:e.offset}}function jM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?jM(e,r):Que(e,r)}}function Que(e,t){let n;for(n in t)if(EM.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 kj(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Nc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Nc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Nc({start:t.start,end:t.end})+") is still open")}function Jue(e){const t=this;t.parser=n;function n(r){return Xue(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ede(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 tde(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
168
- `}]}function nde(e,t){const n=t.value?t.value+`
169
- `:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function rde(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ade(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ide(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=kl(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function sde(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 ode(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function _M(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 a=e.all(t),s=a[0];s&&s.type==="text"?s.value="["+s.value:a.unshift({type:"text",value:"["});const o=a[a.length-1];return o&&o.type==="text"?o.value+=r:a.push({type:"text",value:r}),a}function lde(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _M(e,t);const a={src:kl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const s={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,s),e.applyData(t,s)}function cde(e,t){const n={src:kl(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 ude(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 dde(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _M(e,t);const a={href:kl(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const s={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function fde(e,t){const n={href:kl(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 hde(e,t,n){const r=e.all(t),a=n?pde(n):AM(t),s={},o=[];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:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const d=r[l];(a||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
170
- `}),d.type==="element"&&d.tagName==="p"&&!a?o.push(...d.children):o.push(d)}const c=r[r.length-1];c&&(a||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
171
- `});const u={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,u),e.applyData(t,u)}function pde(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=AM(n[r])}return t}function AM(e){const t=e.spread;return t??e.children.length>1}function mde(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const o=r[a];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function gde(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vde(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function yde(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bde(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),a.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=X0(t.children[1]),c=oM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),a.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,s),e.applyData(t,s)}function xde(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c<l;){const f=t.children[c],h={},p=o?o[c]:void 0;p&&(h.align=p);let g={type:"element",tagName:s,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 wde(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Nj=9,Ej=32;function Sde(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const s=[];for(;r;)s.push(jj(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return s.push(jj(t.slice(a),a>0,!1)),s.join("")}function jj(e,t,n){let r=0,a=e.length;if(t){let s=e.codePointAt(r);for(;s===Nj||s===Ej;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(a-1);for(;s===Nj||s===Ej;)a--,s=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function kde(e,t){const n={type:"text",value:Sde(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Nde(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Ede={blockquote:ede,break:tde,code:nde,delete:rde,emphasis:ade,footnoteReference:ide,heading:sde,html:ode,imageReference:lde,image:cde,inlineCode:ude,linkReference:dde,link:fde,listItem:hde,list:mde,paragraph:gde,root:vde,strong:yde,table:bde,tableCell:wde,tableRow:xde,text:kde,thematicBreak:Nde,toml:Fd,yaml:Fd,definition:Fd,footnoteDefinition:Fd};function Fd(){}const CM=-1,am=0,jc=1,Fh=2,rw=3,aw=4,iw=5,sw=6,TM=7,OM=8,PM=typeof self=="object"?self:globalThis,_j=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new PM[e](t)},jde=(e,t)=>{const n=(a,s)=>(e.set(s,a),a),r=a=>{if(e.has(a))return e.get(a);const[s,o]=t[a];switch(s){case am:case CM:return n(o,a);case jc:{const l=n([],a);for(const c of o)l.push(r(c));return l}case Fh:{const l=n({},a);for(const[c,u]of o)l[r(c)]=r(u);return l}case rw:return n(new Date(o),a);case aw:{const{source:l,flags:c}=o;return n(new RegExp(l,c),a)}case iw:{const l=n(new Map,a);for(const[c,u]of o)l.set(r(c),r(u));return l}case sw:{const l=n(new Set,a);for(const c of o)l.add(r(c));return l}case TM:{const{name:l,message:c}=o;return n(typeof PM[l]=="function"?_j(l,c):new Error(c),a)}case OM:return n(BigInt(o),a);case"BigInt":return n(Object(BigInt(o)),a);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(_j(s,o),a)};return r},Aj=e=>jde(new Map,e)(0),Hi="",{toString:_de}={},{keys:Ade}=Object,nc=e=>{const t=typeof e;if(t!=="object"||!e)return[am,t];const n=_de.call(e).slice(8,-1);switch(n){case"Array":return[jc,Hi];case"Object":return[Fh,Hi];case"Date":return[rw,Hi];case"RegExp":return[aw,Hi];case"Map":return[iw,Hi];case"Set":return[sw,Hi];case"DataView":return[jc,n]}return n.includes("Array")?[jc,n]:e instanceof Error?[TM,e.name||"Error"]:[Fh,n]},Ud=([e,t])=>e===am&&(t==="function"||t==="symbol"),Cde=(e,t,n,r)=>{const a=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=nc(o);switch(l){case am:{let d=o;switch(c){case"bigint":l=OM,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return a([CM],o)}return a([l,d],o)}case jc:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),a([c,[...h]],o)}const d=[],f=a([l,d],o);for(const h of o)d.push(s(h));return f}case Fh:{if(c)switch(c){case"BigInt":return a([c,o.toString()],o);case"Boolean":case"Number":case"String":return a([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],f=a([l,d],o);for(const h of Ade(o))(e||!Ud(nc(o[h])))&&d.push([s(h),s(o[h])]);return f}case rw:return a([l,isNaN(o.getTime())?Hi:o.toISOString()],o);case aw:{const{source:d,flags:f}=o;return a([l,{source:d,flags:f}],o)}case iw:{const d=[],f=a([l,d],o);for(const[h,p]of o)(e||!(Ud(nc(h))||Ud(nc(p))))&&d.push([s(h),s(p)]);return f}case sw:{const d=[],f=a([l,d],o);for(const h of o)(e||!Ud(nc(h)))&&d.push(s(h));return f}}const{message:u}=o;return a([l,{name:c,message:u}],o)};return s},Cj=(e,{json:t,lossy:n}={})=>{const r=[];return Cde(!(t||n),!!t,new Map,r)(e),r},Uh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Aj(Cj(e,t)):structuredClone(e):(e,t)=>Aj(Cj(e,t));function Tde(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 Ode(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Pde(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Tde,r=e.options.footnoteBackLabel||Ode,a=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];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=kl(f.toLowerCase());let p=0;const g=[],m=e.footnoteCounts.get(f);for(;m!==void 0&&++p<=m;){g.length>0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,p);typeof b=="string"&&(b={type:"text",value:b}),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(b)?b:[b]})}const y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const b=y.children[y.children.length-1];b&&b.type==="text"?b.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else d.push(...g);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,v),l.push(v)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Uh(o),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
172
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
173
- `}]}}const Ku=function(e){if(e==null)return $de;if(typeof e=="function")return im(e);if(typeof e=="object")return Array.isArray(e)?Rde(e):Mde(e);if(typeof e=="string")return Ide(e);throw new Error("Expected function, string, or object as test")};function Rde(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ku(e[n]);return im(r);function r(...a){let s=-1;for(;++s<t.length;)if(t[s].apply(this,a))return!0;return!1}}function Mde(e){const t=e;return im(n);function n(r){const a=r;let s;for(s in e)if(a[s]!==t[s])return!1;return!0}}function Ide(e){return im(t);function t(n){return n&&n.type===e}}function im(e){return t;function t(n,r,a){return!!(Lde(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function $de(){return!0}function Lde(e){return e!==null&&typeof e=="object"&&"type"in e}const RM=[],Dde=!0,_b=!1,Bde="skip";function MM(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const s=Ku(a),o=r?-1:1;l(e,void 0,[])();function l(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=RM,g,m,y;if((!t||s(c,u,d[d.length-1]||void 0))&&(p=zde(n(c,d)),p[0]===_b))return p;if("children"in c&&c.children){const v=c;if(v.children&&p[0]!==Bde)for(m=(r?v.children.length:-1)+o,y=d.concat(v);m>-1&&m<v.children.length;){const b=v.children[m];if(g=l(b,m,y)(),g[0]===_b)return g;m=typeof g[1]=="number"?g[1]:m+o}}return p}}}function zde(e){return Array.isArray(e)?e:typeof e=="number"?[Dde,e]:e==null?RM:[e]}function sm(e,t,n,r){let a,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,a=n):(s=t,o=n,a=r),MM(e,s,l,a);function l(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return o(c,f,d)}}const Ab={}.hasOwnProperty,Fde={};function Ude(e,t){const n=t||Fde,r=new Map,a=new Map,s=new Map,o={...Ede,...n.handlers},l={all:u,applyData:Hde,definitionById:r,footnoteById:a,footnoteCounts:s,footnoteOrder:[],handlers:o,one:c,options:n,patch:Wde,wrap:qde};return sm(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:a,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),l;function c(d,f){const h=d.type,p=l.handlers[h];if(Ab.call(l.handlers,h)&&p)return p(l,d,f);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in d){const{children:m,...y}=d,v=Uh(y);return v.children=l.all(d),v}return Uh(d)}return(l.options.unknownHandler||Gde)(l,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const g=l.one(h[p],d);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Tj(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=Tj(m.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function Wde(e,t){e.position&&(t.position=Ole(e))}function Hde(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,Uh(s)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function Gde(e,t){const n=t.data||{},r="value"in t&&!(Ab.call(n,"hProperties")||Ab.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 qde(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
174
- `});++r<e.length;)r&&n.push({type:"text",value:`
175
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
176
- `}),n}function Tj(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Oj(e,t){const n=Ude(e,t),r=n.one(e,void 0),a=Pde(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&s.children.push({type:"text",value:`
177
- `},a),s}function Kde(e,t){return e&&"run"in e?async function(n,r){const a=Oj(n,{file:r,...t});await e.run(a,r)}:function(n,r){return Oj(n,{file:r,...e||t})}}function Pj(e){if(e)throw e}var ff=Object.prototype.hasOwnProperty,IM=Object.prototype.toString,Rj=Object.defineProperty,Mj=Object.getOwnPropertyDescriptor,Ij=function(t){return typeof Array.isArray=="function"?Array.isArray(t):IM.call(t)==="[object Array]"},$j=function(t){if(!t||IM.call(t)!=="[object Object]")return!1;var n=ff.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&ff.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||ff.call(t,a)},Lj=function(t,n){Rj&&n.name==="__proto__"?Rj(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Dj=function(t,n){if(n==="__proto__")if(ff.call(t,n)){if(Mj)return Mj(t,n).value}else return;return t[n]},Vde=function e(){var t,n,r,a,s,o,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=Dj(l,n),a=Dj(t,n),l!==a&&(d&&a&&($j(a)||(s=Ij(a)))?(s?(s=!1,o=r&&Ij(r)?r:[]):o=r&&$j(r)?r:{},Lj(l,{name:n,newValue:e(d,o,a)})):typeof a<"u"&&Lj(l,{name:n,newValue:a}));return l};const Mg=Qe(Vde);function Cb(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 Yde(){const e=[],t={run:n,use:r};return t;function n(...a){let s=-1;const o=a.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...a);function l(c,...u){const d=e[++s];let f=-1;if(c){o(c);return}for(;++f<a.length;)(u[f]===null||u[f]===void 0)&&(u[f]=a[f]);a=u,d?Xde(d,l)(...u):o(null,...u)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function Xde(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(a);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return a(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,a):c instanceof Error?a(c):s(c))}function a(o,...l){n||(n=!0,t(o,...l))}function s(o){a(null,o)}}const Qr={basename:Zde,dirname:Qde,extname:Jde,join:efe,sep:"/"};function Zde(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vu(e);let n=0,r=-1,a=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(s){n=a+1;break}}else r<0&&(s=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(s){n=a+1;break}}else o<0&&(s=!0,o=a+1),l>-1&&(e.codePointAt(a)===t.codePointAt(l--)?l<0&&(r=a):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Qde(e){if(Vu(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 Jde(e){Vu(e);let t=e.length,n=-1,r=0,a=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?a<0?a=t:s!==1&&(s=1):a>-1&&(s=-1)}return a<0||n<0||s===0||s===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function efe(...e){let t=-1,n;for(;++t<e.length;)Vu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":tfe(n)}function tfe(e){Vu(e);const t=e.codePointAt(0)===47;let n=nfe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function nfe(e,t){let n="",r=0,a=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(a===o-1||s===1))if(a!==o-1&&s===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("/")),a=o,s=0;continue}}else if(n.length>0){n="",r=0,a=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,o):n=e.slice(a+1,o),r=o-a-1;a=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function Vu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const rfe={cwd:afe};function afe(){return"/"}function Tb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ife(e){if(typeof e=="string")e=new URL(e);else if(!Tb(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 sfe(e)}function sfe(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 a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Ig=["history","path","basename","stem","extname","dirname"];class $M{constructor(t){let n;t?Tb(t)?n={path:t}:typeof t=="string"||ofe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":rfe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ig.length;){const s=Ig[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let a;for(a in n)Ig.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Qr.basename(this.path):void 0}set basename(t){Lg(t,"basename"),$g(t,"basename"),this.path=Qr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Qr.dirname(this.path):void 0}set dirname(t){Bj(this.basename,"dirname"),this.path=Qr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Qr.extname(this.path):void 0}set extname(t){if($g(t,"extname"),Bj(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=Qr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Tb(t)&&(t=ife(t)),Lg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Qr.basename(this.path,this.extname):void 0}set stem(t){Lg(t,"stem"),$g(t,"stem"),this.path=Qr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new Sn(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function $g(e,t){if(e&&e.includes(Qr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Qr.sep+"`")}function Lg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Bj(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ofe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lfe=function(e){const r=this.constructor.prototype,a=r[e],s=function(){return a.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},cfe={}.hasOwnProperty;class ow extends lfe{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=Yde()}copy(){const t=new ow;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Mg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(zg("data",this.frozen),this.namespace[t]=n,this):cfe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(zg("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 a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Wd(t),r=this.parser||this.Parser;return Dg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Dg("process",this.parser||this.Parser),Bg("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(s,o){const l=Wd(t),c=r.parse(l);r.run(c,l,function(d,f,h){if(d||!f||!h)return u(d);const p=f,g=r.stringify(p,h);ffe(g)?h.value=g:h.result=g,u(d,h)});function u(d,f){d||!f?o(d):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Dg("processSync",this.parser||this.Parser),Bg("processSync",this.compiler||this.Compiler),this.process(t,a),Fj("processSync","process",n),r;function a(s,o){n=!0,Pj(s),r=o}}run(t,n,r){zj(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,l){const c=Wd(n);a.run(t,c,u);function u(d,f,h){const p=f||t;d?l(d):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,a;return this.run(t,n,s),Fj("runSync","run",r),a;function s(o,l){Pj(o),a=l,r=!0}}stringify(t,n){this.freeze();const r=Wd(n),a=this.compiler||this.Compiler;return Bg("stringify",a),zj(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(zg("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;c(d,f)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(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");l(u.plugins),u.settings&&(a.settings=Mg(!0,a.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];s(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 m=r[h][1];Cb(m)&&Cb(p)&&(p=Mg(!0,m,p)),r[h]=[u,p,...g]}}}}const ufe=new ow().freeze();function Dg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function zg(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 zj(e){if(!Cb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Fj(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wd(e){return dfe(e)?e:new $M(e)}function dfe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ffe(e){return typeof e=="string"||hfe(e)}function hfe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pfe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Uj=[],Wj={allowDangerousHtml:!0},mfe=/^(https?|ircs?|mailto|xmpp)$/i,gfe=[{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 vfe(e){const t=yfe(e),n=bfe(e);return xfe(t.runSync(t.parse(n),n),e)}function yfe(e){const t=e.rehypePlugins||Uj,n=e.remarkPlugins||Uj,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Wj}:Wj;return ufe().use(Jue).use(n).use(Kde,r).use(t)}function bfe(e){const t=e.children||"",n=new $M;return typeof t=="string"&&(n.value=t),n}function xfe(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||wfe;for(const d of gfe)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+pfe+d.id,void 0);return sm(e,u),$le(e,{Fragment:i.Fragment,components:a,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in Og)if(Object.hasOwn(Og,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],m=Og[p];(m===null||m.includes(d.tagName))&&(d.properties[p]=c(String(g||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(d,f,h)),p&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function wfe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||mfe.test(e.slice(0,t))?e:""}function Hj(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function Sfe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function kfe(e,t,n){const a=Ku((n||{}).ignore||[]),s=Nfe(t);let o=-1;for(;++o<s.length;)MM(e,"text",l);function l(u,d){let f=-1,h;for(;++f<d.length;){const p=d[f],g=h?h.children:void 0;if(a(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=s[o][0],p=s[o][1];let g=0;const y=f.children.indexOf(u);let v=!1,b=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const N=w.index,S={index:w.index,input:w.input,stack:[...d,u]};let x=p(...w,S);if(typeof x=="string"&&(x=x.length>0?{type:"text",value:x}:void 0),x===!1?h.lastIndex=N+1:(g!==N&&b.push({type:"text",value:u.value.slice(g,N)}),Array.isArray(x)?b.push(...x):x&&b.push(x),g=N+w[0].length,v=!0),!h.global)break;w=h.exec(u.value)}return v?(g<u.value.length&&b.push({type:"text",value:u.value.slice(g)}),f.children.splice(y,1,...b)):b=[u],y+b.length}}function Nfe(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 a=n[r];t.push([Efe(a[0]),jfe(a[1])])}return t}function Efe(e){return typeof e=="string"?new RegExp(Sfe(e),"g"):e}function jfe(e){return typeof e=="function"?e:function(){return e}}const Fg="phrasing",Ug=["autolink","link","image","label"];function _fe(){return{transforms:[Mfe],enter:{literalAutolink:Cfe,literalAutolinkEmail:Wg,literalAutolinkHttp:Wg,literalAutolinkWww:Wg},exit:{literalAutolink:Rfe,literalAutolinkEmail:Pfe,literalAutolinkHttp:Tfe,literalAutolinkWww:Ofe}}}function Afe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fg,notInConstruct:Ug},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fg,notInConstruct:Ug},{character:":",before:"[ps]",after:"\\/",inConstruct:Fg,notInConstruct:Ug}]}}function Cfe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Wg(e){this.config.enter.autolinkProtocol.call(this,e)}function Tfe(e){this.config.exit.autolinkProtocol.call(this,e)}function Ofe(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 Pfe(e){this.config.exit.autolinkEmail.call(this,e)}function Rfe(e){this.exit(e)}function Mfe(e){kfe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ife],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),$fe]],{ignore:["link","linkReference"]})}function Ife(e,t,n,r,a){let s="";if(!LM(a)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!Lfe(n)))return!1;const o=Dfe(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function $fe(e,t,n,r){return!LM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Lfe(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 Dfe(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 a=Hj(e,"(");let s=Hj(e,")");for(;r!==-1&&a>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function LM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||xs(n)||nm(n))&&(!t||n!==47)}DM.peek=Kfe;function Bfe(){this.buffer()}function zfe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ffe(){this.buffer()}function Ufe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Wfe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Hfe(e){this.exit(e)}function Gfe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qfe(e){this.exit(e)}function Kfe(){return"["}function DM(e,t,n,r){const a=n.createTracker(r);let s=a.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=a.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=a.move("]"),s}function Vfe(){return{enter:{gfmFootnoteCallString:Bfe,gfmFootnoteCall:zfe,gfmFootnoteDefinitionLabelString:Ffe,gfmFootnoteDefinition:Ufe},exit:{gfmFootnoteCallString:Wfe,gfmFootnoteCall:Hfe,gfmFootnoteDefinitionLabelString:Gfe,gfmFootnoteDefinition:qfe}}}function Yfe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:DM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,s,o){const l=s.createTracker(o);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
178
- `:" ")+s.indentLines(s.containerFlow(r,l.current()),t?BM:Xfe))),u(),c}}function Xfe(e,t,n){return t===0?e:BM(e,t,n)}function BM(e,t,n){return(n?"":" ")+e}const Zfe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];zM.peek=nhe;function Qfe(){return{canContainEols:["delete"],enter:{strikethrough:ehe},exit:{strikethrough:the}}}function Jfe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Zfe}],handlers:{delete:zM}}}function ehe(e){this.enter({type:"delete",children:[]},e)}function the(e){this.exit(e)}function zM(e,t,n,r){const a=n.createTracker(r),s=n.enter("strikethrough");let o=a.move("~~");return o+=n.containerPhrasing(e,{...a.current(),before:o,after:"~"}),o+=a.move("~~"),s(),o}function nhe(){return"~"}function rhe(e){return e.length}function ahe(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||rhe,s=[],o=[],l=[],c=[];let u=0,d=-1;for(;++d<e.length;){const m=[],y=[];let v=-1;for(e[d].length>u&&(u=e[d].length);++v<e[d].length;){const b=ihe(e[d][v]);if(n.alignDelimiters!==!1){const w=a(b);y[v]=w,(c[v]===void 0||w>c[v])&&(c[v]=w)}m.push(b)}o[d]=m,l[d]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)s[f]=Gj(r[f]);else{const m=Gj(r);for(;++f<u;)s[f]=m}f=-1;const h=[],p=[];for(;++f<u;){const m=s[f];let y="",v="";m===99?(y=":",v=":"):m===108?y=":":m===114&&(v=":");let b=n.alignDelimiters===!1?1:Math.max(1,c[f]-y.length-v.length);const w=y+"-".repeat(b)+v;n.alignDelimiters!==!1&&(b=y.length+b+v.length,b>c[f]&&(c[f]=b),p[f]=b),h[f]=w}o.splice(1,0,h),l.splice(1,0,p),d=-1;const g=[];for(;++d<o.length;){const m=o[d],y=l[d];f=-1;const v=[];for(;++f<u;){const b=m[f]||"";let w="",N="";if(n.alignDelimiters!==!1){const S=c[f]-(y[f]||0),x=s[f];x===114?w=" ".repeat(S):x===99?S%2?(w=" ".repeat(S/2+.5),N=" ".repeat(S/2-.5)):(w=" ".repeat(S/2),N=w):N=" ".repeat(S)}n.delimiterStart!==!1&&!f&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||f)&&v.push(" "),n.alignDelimiters!==!1&&v.push(w),v.push(b),n.alignDelimiters!==!1&&v.push(N),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&v.push("|")}g.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return g.join(`
179
- `)}function ihe(e){return e==null?"":String(e)}function Gj(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 she(e,t,n,r){const a=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),ohe);return a(),o}function ohe(e,t,n){return">"+(n?"":" ")+e}function lhe(e,t){return qj(e,t.inConstruct,!0)&&!qj(e,t.notInConstruct,!1)}function qj(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 Kj(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
180
- `&&lhe(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
181
- `}function che(e,t){const n=String(e);let r=n.indexOf(t),a=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++s>o&&(o=s):s=1,a=r+t.length,r=n.indexOf(t,a);return o}function uhe(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 dhe(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 fhe(e,t,n,r){const a=dhe(n),s=e.value||"",o=a==="`"?"GraveAccent":"Tilde";if(uhe(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,hhe);return f(),h}const l=n.createTracker(r),c=a.repeat(Math.max(che(s,a)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:`
182
- `,encode:["`"],...l.current()})),f()}return d+=l.move(`
183
- `),s&&(d+=l.move(s+`
184
- `)),d+=l.move(c),u(),d}function hhe(e,t,n){return(n?"":" ")+e}function lw(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 phe(e,t,n,r){const a=lw(n),s=a==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=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("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
185
- `,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+a),u+=c.move(n.safe(e.title,{before:u,after:a,...c.current()})),u+=c.move(a),l()),o(),u}function mhe(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 Cu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Wh(e,t,n){const r=rl(e),a=rl(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}FM.peek=ghe;function FM(e,t,n,r){const a=mhe(n),s=n.enter("emphasis"),o=n.createTracker(r),l=o.move(a);let c=o.move(n.containerPhrasing(e,{after:a,before:l,...o.current()}));const u=c.charCodeAt(0),d=Wh(r.before.charCodeAt(r.before.length-1),u,a);d.inside&&(c=Cu(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Wh(r.after.charCodeAt(0),f,a);h.inside&&(c=c.slice(0,-1)+Cu(f));const p=o.move(a);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function ghe(e,t,n){return n.options.emphasis||"*"}function vhe(e,t){let n=!1;return sm(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,_b}),!!((!e.depth||e.depth<3)&&ew(e)&&(t.options.setext||n))}function yhe(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(vhe(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
186
- `,after:`
187
- `});return f(),d(),h+`
188
- `+(a===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
189
- `))+1))}const o="#".repeat(a),l=n.enter("headingAtx"),c=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
190
- `,...s.current()});return/^[\t ]/.test(u)&&(u=Cu(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}UM.peek=bhe;function UM(e){return e.value||""}function bhe(){return"<"}WM.peek=xhe;function WM(e,t,n,r){const a=lw(n),s=a==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=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("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+a),u+=c.move(n.safe(e.title,{before:u,after:a,...c.current()})),u+=c.move(a),l()),u+=c.move(")"),o(),u}function xhe(){return"!"}HM.peek=whe;function HM(e,t,n,r){const a=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),a==="full"||!u||u!==f?c+=l.move(f+"]"):a==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function whe(){return"!"}GM.peek=She;function GM(e,t,n){let r=e.value||"",a="`",s=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],l=n.compilePattern(o);let c;if(o.atBreak)for(;c=l.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 a+r+a}function She(){return"`"}function qM(e,t){const n=ew(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))}KM.peek=khe;function KM(e,t,n,r){const a=lw(n),s=a==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(qM(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=o.move(" "+a),u+=o.move(n.safe(e.title,{before:u,after:a,...o.current()})),u+=o.move(a),c()),u+=o.move(")"),l(),u}function khe(e,t,n){return qM(e,n)?"<":"["}VM.peek=Nhe;function VM(e,t,n,r){const a=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),a==="full"||!u||u!==f?c+=l.move(f+"]"):a==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Nhe(){return"["}function cw(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 Ehe(e){const t=cw(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 jhe(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 YM(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 _he(e,t,n,r){const a=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?jhe(n):cw(n);const l=e.ordered?o==="."?")":".":Ehe(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&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),YM(n)===o&&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&&(o=l),n.bulletCurrent=o;const u=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,a(),u}function Ahe(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 Che(e,t,n,r){const a=Ahe(n);let s=n.bulletCurrent||cw(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(s+" ".repeat(o-s.length)),l.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,p){return h?(p?"":" ".repeat(o))+f:(p?s:s+" ".repeat(o-s.length))+f}}function The(e,t,n,r){const a=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),a(),o}const Ohe=Ku(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Phe(e,t,n,r){return(e.children.some(function(o){return Ohe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Rhe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}XM.peek=Mhe;function XM(e,t,n,r){const a=Rhe(n),s=n.enter("strong"),o=n.createTracker(r),l=o.move(a+a);let c=o.move(n.containerPhrasing(e,{after:a,before:l,...o.current()}));const u=c.charCodeAt(0),d=Wh(r.before.charCodeAt(r.before.length-1),u,a);d.inside&&(c=Cu(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=Wh(r.after.charCodeAt(0),f,a);h.inside&&(c=c.slice(0,-1)+Cu(f));const p=o.move(a+a);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function Mhe(e,t,n){return n.options.strong||"*"}function Ihe(e,t,n,r){return n.safe(e.value,r)}function $he(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 Lhe(e,t,n){const r=(YM(n)+(n.options.ruleSpaces?" ":"")).repeat($he(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ZM={blockquote:she,break:Kj,code:fhe,definition:phe,emphasis:FM,hardBreak:Kj,heading:yhe,html:UM,image:WM,imageReference:HM,inlineCode:GM,link:KM,linkReference:VM,list:_he,listItem:Che,paragraph:The,root:Phe,strong:XM,text:Ihe,thematicBreak:Lhe};function Dhe(){return{enter:{table:Bhe,tableData:Vj,tableHeader:Vj,tableRow:Fhe},exit:{codeText:Uhe,table:zhe,tableData:Hg,tableHeader:Hg,tableRow:Hg}}}function Bhe(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 zhe(e){this.exit(e),this.data.inTable=void 0}function Fhe(e){this.enter({type:"tableRow",children:[]},e)}function Hg(e){this.exit(e)}function Vj(e){this.enter({type:"tableCell",children:[]},e)}function Uhe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Whe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Whe(e,t){return t==="|"?t:e}function Hhe(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
191
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:c,tableRow:l}};function o(p,g,m,y){return u(d(p,m,y),p.align)}function l(p,g,m,y){const v=f(p,m,y),b=u([v]);return b.slice(0,b.indexOf(`
192
- `))}function c(p,g,m,y){const v=m.enter("tableCell"),b=m.enter("phrasing"),w=m.containerPhrasing(p,{...y,before:s,after:s});return b(),v(),w}function u(p,g){return ahe(p,{align:g,alignDelimiters:r,padding:n,stringLength:a})}function d(p,g,m){const y=p.children;let v=-1;const b=[],w=g.enter("table");for(;++v<y.length;)b[v]=f(y[v],g,m);return w(),b}function f(p,g,m){const y=p.children;let v=-1;const b=[],w=g.enter("tableRow");for(;++v<y.length;)b[v]=c(y[v],p,g,m);return w(),b}function h(p,g,m){let y=ZM.inlineCode(p,g,m);return m.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Ghe(){return{exit:{taskListCheckValueChecked:Yj,taskListCheckValueUnchecked:Yj,paragraph:Khe}}}function qhe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Vhe}}}function Yj(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Khe(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 a=t.children;let s=-1,o;for(;++s<a.length;){const l=a[s];if(l.type==="paragraph"){o=l;break}}o===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 Vhe(e,t,n,r){const a=e.children[0],s=typeof e.checked=="boolean"&&a&&a.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);s&&l.move(o);let c=ZM.listItem(e,t,n,{...r,...l.current()});return s&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+o}}function Yhe(){return[_fe(),Vfe(),Qfe(),Dhe(),Ghe()]}function Xhe(e){return{extensions:[Afe(),Yfe(e),Jfe(),Hhe(e),qhe()]}}const Zhe={tokenize:rpe,partial:!0},QM={tokenize:ape,partial:!0},JM={tokenize:ipe,partial:!0},eI={tokenize:spe,partial:!0},Qhe={tokenize:ope,partial:!0},tI={name:"wwwAutolink",tokenize:tpe,previous:rI},nI={name:"protocolAutolink",tokenize:npe,previous:aI},Fa={name:"emailAutolink",tokenize:epe,previous:iI},ua={};function Jhe(){return{text:ua}}let Li=48;for(;Li<123;)ua[Li]=Fa,Li++,Li===58?Li=65:Li===91&&(Li=97);ua[43]=Fa;ua[45]=Fa;ua[46]=Fa;ua[95]=Fa;ua[72]=[Fa,nI];ua[104]=[Fa,nI];ua[87]=[Fa,tI];ua[119]=[Fa,tI];function epe(e,t,n){const r=this;let a,s;return o;function o(f){return!Ob(f)||!iI.call(r,r.previous)||uw(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return Ob(f)?(e.consume(f),l):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(Qhe,d,u)(f):f===45||f===95||xn(f)?(s=!0,e.consume(f),c):d(f)}function u(f){return e.consume(f),a=!0,c}function d(f){return s&&a&&An(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function tpe(e,t,n){const r=this;return a;function a(o){return o!==87&&o!==119||!rI.call(r,r.previous)||uw(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Zhe,e.attempt(QM,e.attempt(JM,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function npe(e,t,n){const r=this;let a="",s=!1;return o;function o(f){return(f===72||f===104)&&aI.call(r,r.previous)&&!uw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(An(f)&&a.length<5)return a+=String.fromCodePoint(f),e.consume(f),l;if(f===58){const h=a.toLowerCase();if(h==="http"||h==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),s?u:(s=!0,c)):n(f)}function u(f){return f===null||zh(f)||ot(f)||xs(f)||nm(f)?n(f):e.attempt(QM,e.attempt(JM,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function rpe(e,t,n){let r=0;return a;function a(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),a):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function ape(e,t,n){let r,a,s;return o;function o(u){return u===46||u===95?e.check(eI,c,l)(u):u===null||ot(u)||xs(u)||u!==45&&nm(u)?c(u):(s=!0,e.consume(u),o)}function l(u){return u===95?r=!0:(a=r,r=void 0),e.consume(u),o}function c(u){return a||r||!s?n(u):t(u)}}function ipe(e,t){let n=0,r=0;return a;function a(o){return o===40?(n++,e.consume(o),a):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(eI,t,s)(o):o===null||ot(o)||xs(o)?t(o):(e.consume(o),a)}function s(o){return o===41&&r++,e.consume(o),a}}function spe(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),s):l===93?(e.consume(l),a):l===60||l===null||ot(l)||xs(l)?t(l):n(l)}function a(l){return l===null||l===40||l===91||ot(l)||xs(l)?t(l):r(l)}function s(l){return An(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):An(l)?(e.consume(l),o):n(l)}}function ope(e,t,n){return r;function r(s){return e.consume(s),a}function a(s){return xn(s)?n(s):t(s)}}function rI(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ot(e)}function aI(e){return!An(e)}function iI(e){return!(e===47||Ob(e))}function Ob(e){return e===43||e===45||e===46||e===95||xn(e)}function uw(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 lpe={tokenize:gpe,partial:!0};function cpe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:hpe,continuation:{tokenize:ppe},exit:mpe}},text:{91:{name:"gfmFootnoteCall",tokenize:fpe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:upe,resolveTo:dpe}}}}function upe(e,t,n){const r=this;let a=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;a--;){const c=r.events[a][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=Fr(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function dpe(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)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function fpe(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return l;function l(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(s>999||f===93&&!o||f===null||f===91||ot(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return a.includes(Fr(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ot(f)||(o=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function hpe(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,l;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(o>999||g===93&&!l||g===null||g===91||ot(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return s=Fr(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ot(g)||(l=!0),o++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),a.includes(s)||a.push(s),We(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function ppe(e,t,n){return e.check(qu,t,e.attempt(lpe,t,n))}function mpe(e){e.exit("gfmFootnoteDefinition")}function gpe(e,t,n){const r=this;return We(e,a,"gfmFootnoteDefinitionIndent",5);function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function vpe(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(o,l){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let u=c;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[c][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[c][1].end)},f={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[c][1].start)},h=[["enter",d,l],["enter",o[u][1],l],["exit",o[u][1],l],["enter",f,l]],p=l.parser.constructs.insideSpan.null;p&&rr(h,h.length,0,rm(p,o.slice(u+1,c),l)),rr(h,h.length,0,[["exit",f,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",d,l]]),rr(o,u-1,c-u+3,h),c=u+h.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function s(o,l,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):(o.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const m=rl(u);if(g===126)return f>1?c(g):(o.consume(g),f++,p);if(f<2&&!n)return c(g);const y=o.exit("strikethroughSequenceTemporary"),v=rl(g);return y._open=!v||v===2&&!!m,y._close=!m||m===2&&!!v,l(g)}}}class ype{constructor(){this.map=[]}add(t,n,r){bpe(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[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 a=r.pop();for(;a;){for(const s of a)t.push(s);a=r.pop()}this.map.length=0}}function bpe(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function xpe(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function wpe(){return{flow:{null:{name:"table",tokenize:Spe,resolveAll:kpe}}}}function Spe(e,t,n){const r=this;let a=0,s=0,o;return l;function l(T){let $=r.events.length-1;for(;$>-1;){const L=r.events[$][1].type;if(L==="lineEnding"||L==="linePrefix")$--;else break}const R=$>-1?r.events[$][1].type:null,I=R==="tableHead"||R==="tableRow"?x:c;return I===x&&r.parser.lazy[r.now().line]?n(T):I(T)}function c(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(o=!0,s+=1),d(T)}function d(T){return T===null?n(T):Ae(T)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),p):n(T):ze(T)?We(e,d,"whitespace")(T):(s+=1,o&&(o=!1,a+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||ot(T)?(e.exit("data"),d(T)):(e.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(e.consume(T),f):f(T)}function p(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,ze(T)?We(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):g(T))}function g(T){return T===45||T===58?y(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),m):S(T)}function m(T){return ze(T)?We(e,y,"whitespace")(T):y(T)}function y(T){return T===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),v):T===45?(s+=1,v(T)):T===null||Ae(T)?N(T):S(T)}function v(T){return T===45?(e.enter("tableDelimiterFiller"),b(T)):S(T)}function b(T){return T===45?(e.consume(T),b):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return ze(T)?We(e,N,"whitespace")(T):N(T)}function N(T){return T===124?g(T):T===null||Ae(T)?!o||a!==s?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return n(T)}function x(T){return e.enter("tableRow"),E(T)}function E(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),E):T===null||Ae(T)?(e.exit("tableRow"),t(T)):ze(T)?We(e,E,"whitespace")(T):(e.enter("data"),j(T))}function j(T){return T===null||T===124||ot(T)?(e.exit("data"),E(T)):(e.consume(T),T===92?C:j)}function C(T){return T===92||T===124?(e.consume(T),j):j(T)}}function kpe(e,t){let n=-1,r=!0,a=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new ype;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(l=!1,c!==0&&(Xj(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,s=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",d,t]])),a=g.type==="tableDelimiterRow"?2:d?3:1):a&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],f=Hd(h,t,s,a,void 0,f),s=[0,0,0,0]),o[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],f=Hd(h,t,s,a,void 0,f)),s=o,o=[s[1],n,0,0])):g.type==="tableHead"?(l=!0,c=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=n,s[1]!==0?(o[0]=o[1],f=Hd(h,t,s,a,n,f)):o[1]!==0&&(f=Hd(h,t,o,a,n,f)),a=0):a&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&Xj(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=xpe(t.events,n))}return e}function Hd(e,t,n,r,a,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(s.end=Object.assign({},Xs(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const c=Xs(t.events,n[1]);if(s={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Xs(t.events,n[2]),d=Xs(t.events,n[3]),f={type:l,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,m=n[3]-n[2]-1;e.add(g,m,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return a!==void 0&&(s.end=Object.assign({},Xs(t.events,a)),e.add(a,0,[["exit",s,t]]),s=void 0),s}function Xj(e,t,n,r,a){const s=[],o=Xs(t.events,n);a&&(a.end=Object.assign({},o),s.push(["exit",a,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Xs(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Npe={name:"tasklistCheck",tokenize:jpe};function Epe(){return{text:{91:Npe}}}function jpe(e,t,n){const r=this;return a;function a(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return ot(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Ae(c)?t(c):ze(c)?e.check({tokenize:_pe},t,n)(c):n(c)}}function _pe(e,t,n){return We(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function Ape(e){return pM([Jhe(),cpe(),vpe(e),wpe(),Epe()])}const Cpe={};function Tpe(e){const t=this,n=e||Cpe,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(Ape(n)),s.push(Yhe()),o.push(Xhe(n))}const Zj=function(e,t,n){const r=Ku(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]},Cs=function(e){if(e==null)return Rpe;if(typeof e=="string")return Ppe(e);if(typeof e=="object")return Ope(e);if(typeof e=="function")return dw(e);throw new Error("Expected function, string, or array as `test`")};function Ope(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Cs(e[n]);return dw(r);function r(...a){let s=-1;for(;++s<t.length;)if(t[s].apply(this,a))return!0;return!1}}function Ppe(e){return dw(t);function t(n){return n.tagName===e}}function dw(e){return t;function t(n,r,a){return!!(Mpe(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function Rpe(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Mpe(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Qj=/\n/g,Jj=/[\t ]+/g,Pb=Cs("br"),e_=Cs(Upe),Ipe=Cs("p"),t_=Cs("tr"),$pe=Cs(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Fpe,Wpe]),sI=Cs(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function Lpe(e,t){const n=t||{},r="children"in e?e.children:[],a=sI(e),s=cI(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...lI(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)o.push(...oI(r[l],e,{whitespace:s,breakBefore:l?void 0:a,breakAfter:l<r.length-1?Pb(r[l+1]):a}));const c=[];let u;for(l=-1;++l<o.length;){const d=o[l];typeof d=="number"?u!==void 0&&d>u&&(u=d):d&&(u!==void 0&&u>-1&&c.push(`
193
- `.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function oI(e,t,n){return e.type==="element"?Dpe(e,t,n):e.type==="text"?n.whitespace==="normal"?lI(e,n):Bpe(e):[]}function Dpe(e,t,n){const r=cI(e,n),a=e.children||[];let s=-1,o=[];if($pe(e))return o;let l,c;for(Pb(e)||t_(e)&&Zj(t,e,t_)?c=`
194
- `:Ipe(e)?(l=2,c=2):sI(e)&&(l=1,c=1);++s<a.length;)o=o.concat(oI(a[s],e,{whitespace:r,breakBefore:s?void 0:l,breakAfter:s<a.length-1?Pb(a[s+1]):c}));return e_(e)&&Zj(t,e,e_)&&o.push(" "),l&&o.unshift(l),c&&o.push(c),o}function lI(e,t){const n=String(e.value),r=[],a=[];let s=0;for(;s<=n.length;){Qj.lastIndex=s;const c=Qj.exec(n),u=c&&"index"in c?c.index:n.length;r.push(zpe(n.slice(s,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),s=u+1}let o=-1,l;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(a.push(r[o]),l=void 0):r[o]?(typeof l=="number"&&a.push(l),a.push(r[o]),l=0):(o===0||o===r.length-1)&&a.push(0);return a}function Bpe(e){return[String(e.value)]}function zpe(e,t,n){const r=[];let a=0,s;for(;a<e.length;){Jj.lastIndex=a;const o=Jj.exec(e);s=o?o.index:e.length,!a&&!s&&o&&!t&&r.push(""),a!==s&&r.push(e.slice(a,s)),a=o?s+o[0].length:s}return a!==s&&!n&&r.push(""),r.join(" ")}function cI(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function Fpe(e){return!!(e.properties||{}).hidden}function Upe(e){return e.tagName==="td"||e.tagName==="th"}function Wpe(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function Hpe(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},p=t.optional(a)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],v=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],N={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},S={className:"function.dispatch",relevance:0,keywords:{_hint:v},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},x=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:x.concat([{begin:/\(/,end:/\)/,keywords:N,contains:x.concat(["self"]),relevance:0}]),relevance:0},j={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:N,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:N,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(E,j,S,x,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:N,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:N},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Gpe(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=Hpe(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function qpe(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,a]};a.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],v={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],N=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:y,built_in:[...b,...w,"set","shopt",...N,...S]},contains:[p,e.SHEBANG(),g,f,s,o,v,l,c,u,d,n]}}function Kpe(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},p=t.optional(a)+e.IDENT_RE+"\\s*\\(",y={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},v=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:v.concat([{begin:/\(/,end:/\)/,keywords:y,contains:v.concat(["self"]),relevance:0}]),relevance:0},w={begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:y,disableAutodetect:!0,illegal:"</",contains:[].concat(b,w,v,[f,{begin:e.IDENT_RE+"::",keywords:y},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:y}}}function Vpe(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},p=t.optional(a)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],v=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],N={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},S={className:"function.dispatch",relevance:0,keywords:{_hint:v},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},x=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:x.concat([{begin:/\(/,end:/\)/,keywords:N,contains:x.concat(["self"]),relevance:0}]),relevance:0},j={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:N,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:N,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(E,j,S,x,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:N,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:N},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Ype(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],a=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:a.concat(s),built_in:t,literal:r},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9'_]+|(\\b[\\d'_]+(\\.[\\d'_]*)?|\\.[\\d'_]+)([eE][-+]?[\\d'_]+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:o},p=e.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},y=e.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[m,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[y,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const v={variants:[u,m,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},w=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",N={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},v,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+w+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[v,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},N]}}const Xpe=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Zpe=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Qpe=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Jpe=[...Zpe,...Qpe],eme=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),tme=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),nme=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rme=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function ame(e){const t=e.regex,n=Xpe(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+tme.join("|")+")"},{begin:":(:)?("+nme.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rme.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:eme.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Jpe.join("|")+")\\b"}]}}function ime(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function sme(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function ome(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function lme(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const a={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[r,s,a,o,n,"self"],relevance:0},c=/[A-Za-z0-9_-]+/,u=/"(\\"|[^"])*"/,d=/'[^']*'/,f=t.either(c,u,d),h=t.concat(f,"(\\s*\\.\\s*",f,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:h,className:"attr",starts:{end:/$/,contains:[r,l,s,a,o,n]}}]}}var Zs="[0-9](_*[0-9])*",Gd=`\\.(${Zs})`,qd="[0-9a-fA-F](_*[0-9a-fA-F])*",n_={className:"number",variants:[{begin:`(\\b(${Zs})((${Gd})|\\.)?|(${Gd}))[eE][+-]?(${Zs})[fFdD]?\\b`},{begin:`\\b(${Zs})((${Gd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Gd})[fFdD]?\\b`},{begin:`\\b(${Zs})[fFdD]\\b`},{begin:`\\b0[xX]((${qd})\\.?|(${qd})?\\.(${qd}))[pP][+-]?(${Zs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${qd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function uI(e,t,n){return n===-1?"":e.replace(t,r=>uI(e,t,n-1))}function cme(e){const t=e.regex,n="[ร€-สธa-zA-Z_$][ร€-สธa-zA-Z_$0-9]*",r=n+uI("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,n_,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},n_,u]}}const r_="[A-Za-z$_][0-9A-Za-z$_]*",ume=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],dme=["true","false","null","undefined","NaN","Infinity"],dI=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],fI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],hI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],fme=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],hme=[].concat(hI,dI,fI);function pme(e){const t=e.regex,n=(O,{after:U})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,U)!==-1},r=r_,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:A})||U.ignoreMatch());let D;const P=O.input.substring(A);if(D=P.match(/^\s*=/)){U.ignoreMatch();return}if((D=P.match(/^\s+extends\s+/))&&D.index===0){U.ignoreMatch();return}}},l={$pattern:r_,keyword:ume,literal:dme,built_in:hme,"variable.language":fme},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const N=[].concat(b,h.contains),S=N.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(N)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},E={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...dI,...fI]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(O){return t.concat("(?!",O.join("|"),")")}const I={match:t.concat(/\b/,R([...hI,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:j},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,b,{match:/\$\d+/},f,j,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},I,$,E,F,{match:/\$[(.]/}]}}const mme="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",gme={scope:"number",match:mme,relevance:0};function vme(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],a={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,gme,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Qs="[0-9](_*[0-9])*",Kd=`\\.(${Qs})`,Vd="[0-9a-fA-F](_*[0-9a-fA-F])*",yme={className:"number",variants:[{begin:`(\\b(${Qs})((${Kd})|\\.)?|(${Kd}))[eE][+-]?(${Qs})[fFdD]?\\b`},{begin:`\\b(${Qs})((${Kd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Kd})[fFdD]?\\b`},{begin:`\\b(${Qs})[fFdD]\\b`},{begin:`\\b0[xX]((${Vd})\\.?|(${Vd})?\\.(${Vd}))[pP][+-]?(${Qs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Vd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function bme(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,a]}]};a.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},u=yme,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,r,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,o,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
195
- `},u]}}const xme=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),wme=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Sme=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],kme=[...wme,...Sme],Nme=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),pI=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),mI=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Eme=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),jme=pI.concat(mI).sort().reverse();function _me(e){const t=xme(e),n=jme,r="and or not only",a="[\\w-]+",s="("+a+"|@\\{"+a+"\\})",o=[],l=[],c=function(w){return{className:"string",begin:"~?"+w+".*?"+w}},u=function(w,N,S){return{className:w,begin:N,relevance:S}},d={$pattern:/[a-z-]+/,keyword:r,attribute:Nme.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.UNICODE_RANGE,t.HEXCOLOR,f,u("variable","@@?"+a,10),u("variable","@\\{"+a+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:o}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},g={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Eme.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},y={className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a}],starts:{end:"[;}]",returnEnd:!0,contains:h}},v={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+a+"\\}"),{begin:"\\b("+kme.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+pI.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+mI.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:a+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[v]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,y,b,g,v,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function Ame(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},a=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:a.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function Cme(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},a={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,a,s,o]}}function Tme(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let p=[n,c];return[u,d,f,h].forEach(v=>{v.contains=v.contains.concat(p)}),p=p.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,s,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},a,r,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Ome(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function Pme(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,a={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},o={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,s,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(m,y,v="\\1")=>{const b=v==="\\1"?v:t.concat(v,y);return t.concat(t.concat("(?:",m,")"),y,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,v,r)},p=(m,y,v)=>t.concat(t.concat("(?:",m,")"),y,/(?:\\.|[^\\\/])*?/,v,r),g=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=g,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:a,contains:g}}function Rme(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),a=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(L,F)=>{F.data._beginMatch=L[1]||L[2]},"on:end":(L,F)=>{F.data._beginMatch!==L[1]&&F.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
196
- ]`,g={scope:"string",variants:[d,u,f,h]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},y=["false","null","true"],v=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],b=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],N={keyword:v,literal:(L=>{const F=[];return L.forEach(z=>{F.push(z),z.toLowerCase()===z?F.push(z.toUpperCase()):F.push(z.toLowerCase())}),F})(y),built_in:b},S=L=>L.map(F=>F.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",S(b).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},E=t.concat(r,"\\b(?!\\()"),j={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[a,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},C={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:N,contains:[C,o,j,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,x]},$={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(v).join("\\b|"),"|",S(b).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push($);const R=[C,j,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m,x],I={begin:t.concat(/#\[\s*\\?/,t.either(a,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...R]},...R,{scope:"meta",variants:[{match:a},{match:s}]}]};return{case_insensitive:!1,keywords:N,contains:[I,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,$,j,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},x,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:N,contains:["self",I,o,j,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,m]}}function Mme(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Ime(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function $me(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,g=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,m,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,m,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,v,f]}]}}function Lme(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Dme(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),a=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[a,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:a},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Bme(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),a=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},x=[f,{variants:[{match:[/class\s+/,a,/\s+<\s+/,a]},{match:[/\b(class|module)\s+/,a]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,a],scope:{2:"title.class"},keywords:o},{relevance:0,match:[a,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=x,m.contains=x;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:x}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:x}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(x)}}function zme(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),a=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:d}},{className:"punctuation",begin:"->"},s]}}const Fme=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ume=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Wme=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Hme=[...Ume,...Wme],Gme=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),qme=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Kme=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Vme=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Yme(e){const t=Fme(e),n=Kme,r=qme,a="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Hme.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Vme.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,t.UNICODE_RANGE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:a,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Gme.join(" ")},contains:[{begin:a,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Xme(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Zme(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,g=[...u,...c].filter(S=>!d.includes(S)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},v={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(S){return t.concat(/\b/,t.either(...S.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const w={scope:"keyword",match:b(h),relevance:0};function N(S,{exceptions:x,when:E}={}){const j=E;return x=x||[],S.map(C=>C.match(/\|\d+$/)||x.includes(C)?C:j(C)?`${C}|0`:C)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:N(g,{when:S=>S.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:b(o)},w,v,m,r,a,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,y]}}function gI(e){return e?typeof e=="string"?e:e.source:null}function rc(e){return rt("(?=",e,")")}function rt(...e){return e.map(n=>gI(n)).join("")}function Qme(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function jn(...e){return"("+(Qme(e).capture?"":"?:")+e.map(r=>gI(r)).join("|")+")"}const fw=e=>rt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Jme=["Protocol","Type"].map(fw),a_=["init","self"].map(fw),ege=["Any","Self"],Gg=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],i_=["false","nil","true"],tge=["assignment","associativity","higherThan","left","lowerThan","none","right"],nge=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],s_=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],vI=jn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),yI=jn(vI,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),qg=rt(vI,yI,"*"),bI=jn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Hh=jn(bI,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Xr=rt(bI,Hh,"*"),Yd=rt(/[A-Z]/,Hh,"*"),rge=["attached","autoclosure",rt(/convention\(/,jn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",rt(/objc\(/,Xr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],age=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function ige(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],a={match:[/\./,jn(...Jme,...a_)],className:{2:"keyword"}},s={match:rt(/\./,jn(...Gg)),relevance:0},o=Gg.filter(ge=>typeof ge=="string").concat(["_|0"]),l=Gg.filter(ge=>typeof ge!="string").concat(ege).map(fw),c={variants:[{className:"keyword",match:jn(...l,...a_)}]},u={$pattern:jn(/\b\w+/,/#\w+/),keyword:o.concat(nge),literal:i_},d=[a,s,c],f={match:rt(/\./,jn(...s_)),relevance:0},h={className:"built_in",match:rt(/\b/,jn(...s_),/(?=\()/)},p=[f,h],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:qg},{match:`\\.(\\.|${yI})+`}]},y=[g,m],v="([0-9]_*)+",b="([0-9a-fA-F]_*)+",w={className:"number",relevance:0,variants:[{match:`\\b(${v})(\\.(${v}))?([eE][+-]?(${v}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${v}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},N=(ge="")=>({className:"subst",variants:[{match:rt(/\\/,ge,/[0\\tnr"']/)},{match:rt(/\\/,ge,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(ge="")=>({className:"subst",match:rt(/\\/,ge,/[\t ]*(?:[\r\n]|\r\n)/)}),x=(ge="")=>({className:"subst",label:"interpol",begin:rt(/\\/,ge,/\(/),end:/\)/}),E=(ge="")=>({begin:rt(ge,/"""/),end:rt(/"""/,ge),contains:[N(ge),S(ge),x(ge)]}),j=(ge="")=>({begin:rt(ge,/"/),end:rt(/"/,ge),contains:[N(ge),x(ge)]}),C={className:"string",variants:[E(),E("#"),E("##"),E("###"),j(),j("#"),j("##"),j("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],$={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},R=ge=>{const Le=rt(ge,/\//),fe=rt(/\//,ge);return{begin:Le,end:fe,contains:[...T,{scope:"comment",begin:`#(?!.*${fe})`,end:/$/}]}},I={scope:"regexp",variants:[R("###"),R("##"),R("#"),$]},L={match:rt(/`/,Xr,/`/)},F={className:"variable",match:/\$\d+/},z={className:"variable",match:`\\$${Hh}+`},M=[L,F,z],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:age,contains:[...y,w,C]}]}},U={scope:"keyword",match:rt(/@/,jn(...rge),rc(jn(/\(/,/\s+/)))},A={scope:"meta",match:rt(/@/,Xr)},Z=[O,U,A],D={match:rc(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:rt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Hh,"+")},{className:"type",match:Yd,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:rt(/\s+&\s+/,rc(Yd)),relevance:0}]},P={begin:/</,end:/>/,keywords:u,contains:[...r,...d,...Z,g,D]};D.contains.push(P);const oe={match:rt(Xr,/\s*:/),keywords:"_|0",relevance:0},be={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",oe,...r,I,...d,...p,...y,w,C,...M,...Z,D]},pe={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,D]},Ce={begin:jn(rc(rt(Xr,/\s*:/)),rc(rt(Xr,/\s+/,Xr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Xr}]},G={begin:/\(/,end:/\)/,keywords:u,contains:[Ce,...r,...d,...y,w,C,...Z,D,be],endsParent:!0,illegal:/["']/},Y={match:[/(func|macro)/,/\s+/,jn(L.match,Xr,qg)],className:{1:"keyword",3:"title.function"},contains:[pe,G,t],illegal:[/\[/,/%/]},ie={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[pe,G,t],illegal:/\[|%/},le={match:[/operator/,/\s+/,qg],className:{1:"keyword",3:"title"}},X={begin:[/precedencegroup/,/\s+/,Yd],className:{1:"keyword",3:"title"},contains:[D],keywords:[...tge,...i_],end:/}/},_e={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ne={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},je={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Xr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[pe,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Yd},...d],relevance:0}]};for(const ge of C.variants){const Le=ge.contains.find(tt=>tt.label==="interpol");Le.keywords=u;const fe=[...d,...p,...y,w,C,...M];Le.contains=[...fe,{begin:/\(/,end:/\)/,contains:["self",...fe]}]}return{name:"Swift",keywords:u,contains:[...r,Y,ie,_e,Ne,je,le,X,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},I,...d,...p,...y,w,C,...M,...Z,D,be]}}const Gh="[A-Za-z$_][0-9A-Za-z$_]*",xI=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],wI=["true","false","null","undefined","NaN","Infinity"],SI=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],kI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],NI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],EI=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jI=[].concat(NI,SI,kI);function sge(e){const t=e.regex,n=(O,{after:U})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,U)!==-1},r=Gh,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:A})||U.ignoreMatch());let D;const P=O.input.substring(A);if(D=P.match(/^\s*=/)){U.ignoreMatch();return}if((D=P.match(/^\s+extends\s+/))&&D.index===0){U.ignoreMatch();return}}},l={$pattern:Gh,keyword:xI,literal:wI,built_in:jI,"variable.language":EI},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const N=[].concat(b,h.contains),S=N.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(N)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},E={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...SI,...kI]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(O){return t.concat("(?!",O.join("|"),")")}const I={match:t.concat(/\b/,R([...NI,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:j},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,b,{match:/\$\d+/},f,j,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},I,$,E,F,{match:/\$[(.]/}]}}function oge(e){const t=e.regex,n=sge(e),r=Gh,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Gh,keyword:xI.concat(c),literal:wI,built_in:jI.concat(a),"variable.language":EI},d={className:"meta",begin:"@"+r},f=(m,y,v)=>{const b=m.contains.findIndex(w=>w.label===y);if(b===-1)throw new Error("can not find mode to replace");m.contains.splice(b,1,v)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(m=>m.scope==="attr"),p=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,s,o,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(m=>m.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function lge(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},a=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,a),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,a),/ +/,t.either(o,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function cge(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],a={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,a,e.QUOTE_STRING_MODE,c,u,l]}}function uge(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,o,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function dge(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,a]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},y=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,m,s,o],v=[...y];return v.pop(),v.push(l),p.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}const fge={arduino:Gpe,bash:qpe,c:Kpe,cpp:Vpe,csharp:Ype,css:ame,diff:ime,go:sme,graphql:ome,ini:lme,java:cme,javascript:pme,json:vme,kotlin:bme,less:_me,lua:Ame,makefile:Cme,markdown:Tme,objectivec:Ome,perl:Pme,php:Rme,"php-template":Mme,plaintext:Ime,python:$me,"python-repl":Lme,r:Dme,ruby:Bme,rust:zme,scss:Yme,shell:Xme,sql:Zme,swift:ige,typescript:oge,vbnet:lge,wasm:cge,xml:uge,yaml:dge};function _I(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&_I(n)}),e}class o_{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function AI(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function ai(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const a in r)n[a]=r[a]}),n}const hge="</span>",l_=e=>!!e.scope,pge=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,a)=>`${r}${"_".repeat(a+1)}`)].join(" ")}return`${t}${e}`};class mge{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=AI(t)}openNode(t){if(!l_(t))return;const n=pge(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){l_(t)&&(this.buffer+=hge)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const c_=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class hw{constructor(){this.rootNode=c_(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=c_({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{hw._collapse(n)}))}}class gge extends hw{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new mge(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Tu(e){return e?typeof e=="string"?e:e.source:null}function CI(e){return Ts("(?=",e,")")}function vge(e){return Ts("(?:",e,")*")}function yge(e){return Ts("(?:",e,")?")}function Ts(...e){return e.map(n=>Tu(n)).join("")}function bge(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function pw(...e){return"("+(bge(e).capture?"":"?:")+e.map(r=>Tu(r)).join("|")+")"}function TI(e){return new RegExp(e.toString()+"|").exec("").length-1}function xge(e,t){const n=e&&e.exec(t);return n&&n.index===0}const wge=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function mw(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const a=n;let s=Tu(r),o="";for(;s.length>0;){const l=wge.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+a):(o+=l[0],l[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(t)}const Sge=/\b\B/,OI="[a-zA-Z]\\w*",gw="[a-zA-Z_]\\w*",PI="\\b\\d+(\\.\\d+)?",RI="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",MI="\\b(0b[01]+)",kge="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Nge=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Ts(t,/.*\b/,e.binary,/\b.*/)),ai({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Ou={begin:"\\\\[\\s\\S]",relevance:0},Ege={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ou]},jge={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ou]},_ge={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},om=function(e,t,n={}){const r=ai({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=pw("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Ts(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Age=om("//","$"),Cge=om("/\\*","\\*/"),Tge=om("#","$"),Oge={scope:"number",begin:PI,relevance:0},Pge={scope:"number",begin:RI,relevance:0},Rge={scope:"number",begin:MI,relevance:0},Mge={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ou,{begin:/\[/,end:/\]/,relevance:0,contains:[Ou]}]},Ige={scope:"title",begin:OI,relevance:0},$ge={scope:"title",begin:gw,relevance:0},Lge={begin:"\\.\\s*"+gw,relevance:0},Dge=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var Xd=Object.freeze({__proto__:null,APOS_STRING_MODE:Ege,BACKSLASH_ESCAPE:Ou,BINARY_NUMBER_MODE:Rge,BINARY_NUMBER_RE:MI,COMMENT:om,C_BLOCK_COMMENT_MODE:Cge,C_LINE_COMMENT_MODE:Age,C_NUMBER_MODE:Pge,C_NUMBER_RE:RI,END_SAME_AS_BEGIN:Dge,HASH_COMMENT_MODE:Tge,IDENT_RE:OI,MATCH_NOTHING_RE:Sge,METHOD_GUARD:Lge,NUMBER_MODE:Oge,NUMBER_RE:PI,PHRASAL_WORDS_MODE:_ge,QUOTE_STRING_MODE:jge,REGEXP_MODE:Mge,RE_STARTERS_RE:kge,SHEBANG:Nge,TITLE_MODE:Ige,UNDERSCORE_IDENT_RE:gw,UNDERSCORE_TITLE_MODE:$ge});function Bge(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function zge(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Fge(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Bge,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Uge(e,t){Array.isArray(e.illegal)&&(e.illegal=pw(...e.illegal))}function Wge(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Hge(e,t){e.relevance===void 0&&(e.relevance=1)}const Gge=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Ts(n.beforeMatch,CI(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},qge=["of","and","for","in","not","or","if","then","parent","list","value"],Kge="keyword";function II(e,t,n=Kge){const r=Object.create(null);return typeof e=="string"?a(n,e.split(" ")):Array.isArray(e)?a(n,e):Object.keys(e).forEach(function(s){Object.assign(r,II(e[s],t,s))}),r;function a(s,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");r[c[0]]=[s,Vge(c[0],c[1])]})}}function Vge(e,t){return t?Number(t):Yge(e)?0:1}function Yge(e){return qge.includes(e.toLowerCase())}const u_={},cs=e=>{console.error(e)},d_=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Ys=(e,t)=>{u_[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),u_[`${e}/${t}`]=!0)},qh=new Error;function $I(e,t,{key:n}){let r=0;const a=e[n],s={},o={};for(let l=1;l<=t.length;l++)o[l+r]=a[l],s[l+r]=!0,r+=TI(t[l-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function Xge(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw cs("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),qh;if(typeof e.beginScope!="object"||e.beginScope===null)throw cs("beginScope must be object"),qh;$I(e,e.begin,{key:"beginScope"}),e.begin=mw(e.begin,{joinWith:""})}}function Zge(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw cs("skip, excludeEnd, returnEnd not compatible with endScope: {}"),qh;if(typeof e.endScope!="object"||e.endScope===null)throw cs("endScope must be object"),qh;$I(e,e.end,{key:"endScope"}),e.end=mw(e.end,{joinWith:""})}}function Qge(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Jge(e){Qge(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Xge(e),Zge(e)}function eve(e){function t(o,l){return new RegExp(Tu(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=TI(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(mw(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function a(o){const l=new r;return o.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const c=o;if(o.isCompiled)return c;[zge,Wge,Jge,Gge].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[Fge,Uge,Hge].forEach(d=>d(o,l)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=II(o.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(o.begin||(o.begin=/\B|\b/),c.beginRe=t(c.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(c.endRe=t(c.end)),c.terminatorEnd=Tu(c.end)||"",o.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(c.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return tve(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,c)}),o.starts&&s(o.starts,l),c.matcher=a(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=ai(e.classNameAliases||{}),s(e)}function LI(e){return e?e.endsWithParent||LI(e.starts):!1}function tve(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ai(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:LI(e)?ai(e,{starts:e.starts?ai(e.starts):null}):Object.isFrozen(e)?ai(e):e}var nve="11.11.2";class rve extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Kg=AI,f_=ai,h_=Symbol("nomatch"),ave=7,DI=function(e){const t=Object.create(null),n=Object.create(null),r=[];let a=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:gge};function c(z){return l.noHighlightRe.test(z)}function u(z){let M=z.className+" ";M+=z.parentNode?z.parentNode.className:"";const O=l.languageDetectRe.exec(M);if(O){const U=j(O[1]);return U||(d_(s.replace("{}",O[1])),d_("Falling back to no-highlight mode for this block.",z)),U?O[1]:"no-highlight"}return M.split(/\s+/).find(U=>c(U)||j(U))}function d(z,M,O){let U="",A="";typeof M=="object"?(U=z,O=M.ignoreIllegals,A=M.language):(Ys("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ys("10.7.0",`Please use highlight(code, options) instead.
197
- https://github.com/highlightjs/highlight.js/issues/2277`),A=z,U=M),O===void 0&&(O=!0);const Z={code:U,language:A};L("before:highlight",Z);const D=Z.result?Z.result:f(Z.language,Z.code,O);return D.code=Z.code,L("after:highlight",D),D}function f(z,M,O,U){const A=Object.create(null);function Z(W,V){return W.keywords[V]}function D(){if(!fe.keywords){Be.addText(Ee);return}let W=0;fe.keywordPatternRe.lastIndex=0;let V=fe.keywordPatternRe.exec(Ee),ae="";for(;V;){ae+=Ee.substring(W,V.index);const he=je.case_insensitive?V[0].toLowerCase():V[0],xe=Z(fe,he);if(xe){const[Ge,un]=xe;if(Be.addText(ae),ae="",A[he]=(A[he]||0)+1,A[he]<=ave&&(Ke+=un),Ge.startsWith("_"))ae+=V[0];else{const Ot=je.classNameAliases[Ge]||Ge;be(V[0],Ot)}}else ae+=V[0];W=fe.keywordPatternRe.lastIndex,V=fe.keywordPatternRe.exec(Ee)}ae+=Ee.substring(W),Be.addText(ae)}function P(){if(Ee==="")return;let W=null;if(typeof fe.subLanguage=="string"){if(!t[fe.subLanguage]){Be.addText(Ee);return}W=f(fe.subLanguage,Ee,!0,tt[fe.subLanguage]),tt[fe.subLanguage]=W._top}else W=p(Ee,fe.subLanguage.length?fe.subLanguage:null);fe.relevance>0&&(Ke+=W.relevance),Be.__addSublanguage(W._emitter,W.language)}function oe(){fe.subLanguage!=null?P():D(),Ee=""}function be(W,V){W!==""&&(Be.startScope(V),Be.addText(W),Be.endScope())}function pe(W,V){let ae=1;const he=V.length-1;for(;ae<=he;){if(!W._emit[ae]){ae++;continue}const xe=je.classNameAliases[W[ae]]||W[ae],Ge=V[ae];xe?be(Ge,xe):(Ee=Ge,D(),Ee=""),ae++}}function Ce(W,V){return W.scope&&typeof W.scope=="string"&&Be.openNode(je.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(be(Ee,je.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),Ee=""):W.beginScope._multi&&(pe(W.beginScope,V),Ee="")),fe=Object.create(W,{parent:{value:fe}}),fe}function G(W,V,ae){let he=xge(W.endRe,ae);if(he){if(W["on:end"]){const xe=new o_(W);W["on:end"](V,xe),xe.isMatchIgnored&&(he=!1)}if(he){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return G(W.parent,V,ae)}function Y(W){return fe.matcher.regexIndex===0?(Ee+=W[0],1):(en=!0,0)}function ie(W){const V=W[0],ae=W.rule,he=new o_(ae),xe=[ae.__beforeBegin,ae["on:begin"]];for(const Ge of xe)if(Ge&&(Ge(W,he),he.isMatchIgnored))return Y(V);return ae.skip?Ee+=V:(ae.excludeBegin&&(Ee+=V),oe(),!ae.returnBegin&&!ae.excludeBegin&&(Ee=V)),Ce(ae,W),ae.returnBegin?0:V.length}function le(W){const V=W[0],ae=M.substring(W.index),he=G(fe,W,ae);if(!he)return h_;const xe=fe;fe.endScope&&fe.endScope._wrap?(oe(),be(V,fe.endScope._wrap)):fe.endScope&&fe.endScope._multi?(oe(),pe(fe.endScope,W)):xe.skip?Ee+=V:(xe.returnEnd||xe.excludeEnd||(Ee+=V),oe(),xe.excludeEnd&&(Ee=V));do fe.scope&&Be.closeNode(),!fe.skip&&!fe.subLanguage&&(Ke+=fe.relevance),fe=fe.parent;while(fe!==he.parent);return he.starts&&Ce(he.starts,W),xe.returnEnd?0:V.length}function X(){const W=[];for(let V=fe;V!==je;V=V.parent)V.scope&&W.unshift(V.scope);W.forEach(V=>Be.openNode(V))}let _e={};function Ne(W,V){const ae=V&&V[0];if(Ee+=W,ae==null)return oe(),0;if(_e.type==="begin"&&V.type==="end"&&_e.index===V.index&&ae===""){if(Ee+=M.slice(V.index,V.index+1),!a){const he=new Error(`0 width match regex (${z})`);throw he.languageName=z,he.badRule=_e.rule,he}return 1}if(_e=V,V.type==="begin")return ie(V);if(V.type==="illegal"&&!O){const he=new Error('Illegal lexeme "'+ae+'" for mode "'+(fe.scope||"<unnamed>")+'"');throw he.mode=fe,he}else if(V.type==="end"){const he=le(V);if(he!==h_)return he}if(V.type==="illegal"&&ae==="")return V.index===M.length||(Ee+=`
198
- `),1;if(Rn>1e5&&Rn>V.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ee+=ae,ae.length}const je=j(z);if(!je)throw cs(s.replace("{}",z)),new Error('Unknown language: "'+z+'"');const ge=eve(je);let Le="",fe=U||ge;const tt={},Be=new l.__emitter(l);X();let Ee="",Ke=0,$t=0,Rn=0,en=!1;try{if(je.__emitTokens)je.__emitTokens(M,Be);else{for(fe.matcher.considerAll();;){Rn++,en?en=!1:fe.matcher.considerAll(),fe.matcher.lastIndex=$t;const W=fe.matcher.exec(M);if(!W)break;const V=M.substring($t,W.index),ae=Ne(V,W);$t=W.index+ae}Ne(M.substring($t))}return Be.finalize(),Le=Be.toHTML(),{language:z,value:Le,relevance:Ke,illegal:!1,_emitter:Be,_top:fe}}catch(W){if(W.message&&W.message.includes("Illegal"))return{language:z,value:Kg(M),illegal:!0,relevance:0,_illegalBy:{message:W.message,index:$t,context:M.slice($t-100,$t+100),mode:W.mode,resultSoFar:Le},_emitter:Be};if(a)return{language:z,value:Kg(M),illegal:!1,relevance:0,errorRaised:W,_emitter:Be,_top:fe};throw W}}function h(z){const M={value:Kg(z),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return M._emitter.addText(z),M}function p(z,M){M=M||l.languages||Object.keys(t);const O=h(z),U=M.filter(j).filter(T).map(oe=>f(oe,z,!1));U.unshift(O);const A=U.sort((oe,be)=>{if(oe.relevance!==be.relevance)return be.relevance-oe.relevance;if(oe.language&&be.language){if(j(oe.language).supersetOf===be.language)return 1;if(j(be.language).supersetOf===oe.language)return-1}return 0}),[Z,D]=A,P=Z;return P.secondBest=D,P}function g(z,M,O){const U=M&&n[M]||O;z.classList.add("hljs"),z.classList.add(`language-${U}`)}function m(z){let M=null;const O=u(z);if(c(O))return;if(L("before:highlightElement",{el:z,language:O}),z.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",z);return}if(z.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(z)),l.throwUnescapedHTML))throw new rve("One of your code blocks includes unescaped HTML.",z.innerHTML);M=z;const U=M.textContent,A=O?d(U,{language:O,ignoreIllegals:!0}):p(U);z.innerHTML=A.value,z.dataset.highlighted="yes",g(z,O,A.language),z.result={language:A.language,re:A.relevance,relevance:A.relevance},A.secondBest&&(z.secondBest={language:A.secondBest.language,relevance:A.secondBest.relevance}),L("after:highlightElement",{el:z,result:A,text:U})}function y(z){l=f_(l,z)}const v=()=>{N(),Ys("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){N(),Ys("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let w=!1;function N(){function z(){N()}if(document.readyState==="loading"){w||window.addEventListener("DOMContentLoaded",z,!1),w=!0;return}document.querySelectorAll(l.cssSelector).forEach(m)}function S(z,M){let O=null;try{O=M(e)}catch(U){if(cs("Language definition for '{}' could not be registered.".replace("{}",z)),a)cs(U);else throw U;O=o}O.name||(O.name=z),t[z]=O,O.rawDefinition=M.bind(null,e),O.aliases&&C(O.aliases,{languageName:z})}function x(z){delete t[z];for(const M of Object.keys(n))n[M]===z&&delete n[M]}function E(){return Object.keys(t)}function j(z){return z=(z||"").toLowerCase(),t[z]||t[n[z]]}function C(z,{languageName:M}){typeof z=="string"&&(z=[z]),z.forEach(O=>{n[O.toLowerCase()]=M})}function T(z){const M=j(z);return M&&!M.disableAutodetect}function $(z){z["before:highlightBlock"]&&!z["before:highlightElement"]&&(z["before:highlightElement"]=M=>{z["before:highlightBlock"](Object.assign({block:M.el},M))}),z["after:highlightBlock"]&&!z["after:highlightElement"]&&(z["after:highlightElement"]=M=>{z["after:highlightBlock"](Object.assign({block:M.el},M))})}function R(z){$(z),r.push(z)}function I(z){const M=r.indexOf(z);M!==-1&&r.splice(M,1)}function L(z,M){const O=z;r.forEach(function(U){U[O]&&U[O](M)})}function F(z){return Ys("10.7.0","highlightBlock will be removed entirely in v12.0"),Ys("10.7.0","Please use highlightElement now."),m(z)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:N,highlightElement:m,highlightBlock:F,configure:y,initHighlighting:v,initHighlightingOnLoad:b,registerLanguage:S,unregisterLanguage:x,listLanguages:E,getLanguage:j,registerAliases:C,autoDetection:T,inherit:f_,addPlugin:R,removePlugin:I}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString=nve,e.regex={concat:Ts,lookahead:CI,either:pw,optional:yge,anyNumberOfTimes:vge};for(const z in Xd)typeof Xd[z]=="object"&&_I(Xd[z]);return Object.assign(e,Xd),e},al=DI({});al.newInstance=()=>DI({});var ive=al;al.HighlightJS=al;al.default=al;const sve=Qe(ive),p_={},ove="hljs-";function lve(e){const t=sve.newInstance();return e&&s(e),{highlight:n,highlightAuto:r,listLanguages:a,register:s,registerAlias:o,registered:l};function n(c,u,d){const f=d||p_,h=typeof f.prefix=="string"?f.prefix:ove;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:cve,classPrefix:h});const p=t.highlight(u,{ignoreIllegals:!0,language:c});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const g=p._emitter.root,m=g.data;return m.language=p.language,m.relevance=p.relevance,g}function r(c,u){const f=(u||p_).subset||a();let h=-1,p=0,g;for(;++h<f.length;){const m=f[h];if(!t.getLanguage(m))continue;const y=n(m,c,u);y.data&&y.data.relevance!==void 0&&y.data.relevance>p&&(p=y.data.relevance,g=y)}return g||{type:"root",children:[],data:{language:void 0,relevance:p}}}function a(){return t.listLanguages()}function s(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function o(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class cve{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],a=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:a}):r.children.push(...a)}openNode(t){const n=this,r=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),a=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};a.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const uve={};function dve(e){const t=e||uve,n=t.aliases,r=t.detect||!1,a=t.languages||fge,s=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=lve(a);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){sm(d,"element",function(h,p,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=fve(h);if(m===!1||!m&&!r||m&&s&&s.includes(m))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const y=Lpe(h,{whitespace:"pre"});let v;try{v=m?u.highlight(m,y,{prefix:o}):u.highlightAuto(y,{prefix:o,subset:l})}catch(b){const w=b;if(m&&/Unknown language/.test(w.message)){f.message("Cannot highlight as `"+m+"`, itโ€™s not registered",{ancestors:[g,h],cause:w,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw w}!m&&v.data&&v.data.language&&h.properties.className.push("language-"+v.data.language),v.children.length>0&&(h.children=v.children)})}}function fve(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const a=String(t[n]);if(a==="no-highlight"||a==="nohighlight")return!1;!r&&a.slice(0,5)==="lang-"&&(r=a.slice(5)),!r&&a.slice(0,9)==="language-"&&(r=a.slice(9))}return r}const Kh="[A-Za-z$_][0-9A-Za-z$_]*",BI=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],zI=["true","false","null","undefined","NaN","Infinity"],FI=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],UI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],WI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],HI=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],GI=[].concat(WI,FI,UI);function hve(e){const t=e.regex,n=(O,{after:U})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,U)!==-1},r=Kh,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:A})||U.ignoreMatch());let D;const P=O.input.substring(A);if(D=P.match(/^\s*=/)){U.ignoreMatch();return}if((D=P.match(/^\s+extends\s+/))&&D.index===0){U.ignoreMatch();return}}},l={$pattern:Kh,keyword:BI,literal:zI,built_in:GI,"variable.language":HI},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const N=[].concat(b,h.contains),S=N.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(N)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},E={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...FI,...UI]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(O){return t.concat("(?!",O.join("|"),")")}const I={match:t.concat(/\b/,R([...WI,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:j},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,b,{match:/\$\d+/},f,j,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},I,$,E,F,{match:/\$[(.]/}]}}function m_(e){const t=e.regex,n=hve(e),r=Kh,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Kh,keyword:BI.concat(c),literal:zI,built_in:GI.concat(a),"variable.language":HI},d={className:"meta",begin:"@"+r},f=(m,y,v)=>{const b=m.contains.findIndex(w=>w.label===y);if(b===-1)throw new Error("can not find mode to replace");m.contains.splice(b,1,v)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(m=>m.scope==="attr"),p=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,s,o,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(m=>m.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}const g_="[A-Za-z$_][0-9A-Za-z$_]*",pve=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],mve=["true","false","null","undefined","NaN","Infinity"],qI=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],KI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],VI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],gve=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],vve=[].concat(VI,qI,KI);function v_(e){const t=e.regex,n=(O,{after:U})=>{const A="</"+O[0].slice(1);return O.input.indexOf(A,U)!==-1},r=g_,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,U)=>{const A=O[0].length+O.index,Z=O.input[A];if(Z==="<"||Z===","){U.ignoreMatch();return}Z===">"&&(n(O,{after:A})||U.ignoreMatch());let D;const P=O.input.substring(A);if(D=P.match(/^\s*=/)){U.ignoreMatch();return}if((D=P.match(/^\s+extends\s+/))&&D.index===0){U.ignoreMatch();return}}},l={$pattern:g_,keyword:pve,literal:mve,built_in:vve,"variable.language":gve},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const N=[].concat(b,h.contains),S=N.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(N)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},E={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...qI,...KI]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(O){return t.concat("(?!",O.join("|"),")")}const I={match:t.concat(/\b/,R([...VI,"super","import","await"].map(O=>`${O}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:j},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,m,y,b,{match:/\$\d+/},f,j,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},I,$,E,F,{match:/\$[(.]/}]}}const yve="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",bve={scope:"number",match:yve,relevance:0};function xve(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],a={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,bve,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function wve(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,a]};a.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],v={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],N=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:y,built_in:[...b,...w,"set","shopt",...N,...S]},contains:[p,e.SHEBANG(),g,f,s,o,v,l,c,u,d,n]}}function y_(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function b_(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","sentinel","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,g=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,m,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,m,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,v,f]}]}}function x_(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let p=[n,c];return[u,d,f,h].forEach(v=>{v.contains=v.contains.concat(p)}),p=p.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,s,r,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},a,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function w_(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,a]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},y=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,m,s,o],v=[...y];return v.pop(),v.push(l),p.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}function Sve(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function kve(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,g=[...u,...c].filter(S=>!d.includes(S)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},v={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(S){return t.concat(/\b/,t.either(...S.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const w={scope:"keyword",match:b(h),relevance:0};function N(S,{exceptions:x,when:E}={}){const j=E;return x=x||[],S.map(C=>C.match(/\|\d+$/)||x.includes(C)?C:j(C)?`${C}|0`:C)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:N(g,{when:S=>S.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:b(o)},w,v,m,r,a,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,y]}}function S_(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,o,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:"css"}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:"javascript"}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const Nve=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Eve=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],jve=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],_ve=[...Eve,...jve],Ave=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Cve=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Tve=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ove=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Pve(e){const t=e.regex,n=Nve(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Cve.join("|")+")"},{begin:":(:)?("+Tve.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ove.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:Ave.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+_ve.join("|")+")\\b"}]}}function k_(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}const Rve={ts:m_,typescript:m_,js:v_,javascript:v_,json:xve,bash:wve,shell:y_,sh:y_,python:b_,py:b_,markdown:x_,md:x_,yaml:w_,yml:w_,diff:Sve,sql:kve,html:S_,xml:S_,css:Pve,text:k_,plaintext:k_};function YI(e){if(e==null)return"";const t=e;return typeof t.value=="string"?t.value:Array.isArray(t.children)?t.children.map(YI).join(""):""}function Mve({lang:e,code:t,children:n}){const[r,a]=k.useState(!1),s=async()=>{var o;try{await((o=navigator.clipboard)==null?void 0:o.writeText(t)),a(!0),setTimeout(()=>a(!1),1500)}catch{}};return i.jsxs("div",{className:"md-code-block",children:[i.jsxs("div",{className:"md-code-head",children:[i.jsx("span",{className:"md-code-lang",children:e}),i.jsx("button",{type:"button",className:"md-code-copy",onClick:()=>void s(),children:r?"โœ“ Copied":"โง‰ Copy"})]}),i.jsx("pre",{className:"md-code-pre",children:i.jsx("code",{children:n})})]})}function Ive({node:e,children:t}){var o,l,c,u;const n=(o=e==null?void 0:e.children)==null?void 0:o[0],a=((u=(Array.isArray((l=n==null?void 0:n.properties)==null?void 0:l.className)?(c=n==null?void 0:n.properties)==null?void 0:c.className:[]).find(d=>typeof d=="string"&&d.startsWith("language-")))==null?void 0:u.slice(9))??"text",s=k.useMemo(()=>YI(n),[n]);return i.jsx(Mve,{lang:a,code:s,children:t})}function N_({text:e}){const t=k.useMemo(()=>({h1:({node:n,...r})=>i.jsx("h1",{className:"md-heading md-h1",...r}),h2:({node:n,...r})=>i.jsx("h2",{className:"md-heading md-h2",...r}),h3:({node:n,...r})=>i.jsx("h3",{className:"md-heading md-h3",...r}),h4:({node:n,...r})=>i.jsx("h4",{className:"md-heading md-h4",...r}),h5:({node:n,...r})=>i.jsx("h5",{className:"md-heading md-h5",...r}),h6:({node:n,...r})=>i.jsx("h6",{className:"md-heading md-h6",...r}),p:({node:n,...r})=>i.jsx("p",{className:"md-para",...r}),ul:({node:n,...r})=>i.jsx("ul",{className:"md-list md-ul",...r}),ol:({node:n,...r})=>i.jsx("ol",{className:"md-list md-ol",...r}),blockquote:({node:n,...r})=>i.jsx("blockquote",{className:"md-quote",...r}),hr:({node:n,...r})=>i.jsx("hr",{className:"md-hr",...r}),table:({node:n,...r})=>i.jsx("table",{className:"md-table",...r}),a:({node:n,...r})=>i.jsx("a",{target:"_blank",rel:"noreferrer",...r}),pre:Ive}),[]);return i.jsx("div",{className:"md-root",children:i.jsx(vfe,{remarkPlugins:[Tpe],rehypePlugins:[[dve,{languages:Rve}]],components:t,children:e??""})})}const E_=/```([\w+-]*)\n([\s\S]*?)```/g;function $ve(e){if(!e.trim())return[];const t=[];let n=null;for(const r of e.split(`
199
- `))r.startsWith("diff --git ")?(n&&t.push(n),n={path:r.split(" b/").slice(1).join(" b/").replace(/^b\//,""),body:r}):n&&(n.body+=`
200
- ${r}`);return n&&t.push(n),t}function Lve(e){return/(^|\n)\s*(PASS|FAIL|โœ…|โŒ|โœ—|โœ“|\bok\b)/i.test(e)||/\b\d+\s+(passed|failed)\b/i.test(e)||/(tests?|build|suite|checks?)\s+(passed|failed|complete|green|red|ok)/i.test(e)||/(exit code|process exited|finished with)/i.test(e)}function Dve(e){return/(^|\n)\s*(FAIL|โŒ|โœ—)/i.test(e)||/\bfailed\b/i.test(e)?"fail":/(^|\n)\s*(PASS|โœ…|โœ“)/i.test(e)||/\bpassed\b/i.test(e)?"pass":"unknown"}function Bve(e){for(const t of e.split(`
201
- `)){const n=t.trim();if(n)return n.length>80?`${n.slice(0,77)}โ€ฆ`:n}return"Command output"}const j_=/https?:\/\/[^\s)\]}"'<>]+/i,__=/(๐Ÿš€|deploy(?:ed|ment|ing)?|live at|published|available at|open the)/i;function zve(e){return e.replace(/[.,;:!?]+$/,"")}function Fve(e){const t=e.split(`
202
- `),n=[],r=new Set;for(let a=0;a<t.length;a+=1){const s=t[a];let o=s.match(__);!o&&a+1<t.length&&/deploy(?:ed|ment|ing)?:\s*$/i.test(s.trim())&&(o=t[a+1].match(__));const l=s.match(j_)||(a+1<t.length?t[a+1].match(j_):null);if(!o||!l)continue;const c=zve(l[0]);r.has(c)||(r.add(c),n.push({url:c,title:s.trim().slice(0,80)||"Deployment"}))}return n}function A_(e){const t=[],n=[],r=[];E_.lastIndex=0;let a;for(;(a=E_.exec(e))!==null;){const s=(a[1]||"").toLowerCase(),o=a[2];if(s==="diff"||o.includes("diff --git ")){const l=$ve(o);l.length>0&&t.push({files:l,summary:`${l.length} file${l.length===1?"":"s"} changed`})}else Lve(o)&&n.push({verdict:Dve(o),title:Bve(o),body:o})}for(const s of Fve(e))r.push(s);return{diffs:t,results:n,deploys:r}}const Uve=/\x1b(?:\[[0-9;?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[@-Z\\-_])/g;function C_(e){return e?e.replace(Uve,""):""}const T_=3e5,Wve=2e3,Hve=/\.(pdf|docx|xlsx|pptx)$/i,Gve=/\.(png|jpe?g|gif|webp|bmp|tiff?)$/i,qve=/\.(txt|md|markdown|text|log|csv|tsv|json|xml|yaml|yml|html?|htaccess|css|js|mjs|cjs|jsx|ts|tsx|py|rb|go|rs|java|kt|c|h|cpp|cs|php|sh|bash|zsh|sql|ini|toml|cfg|conf|env)$/i;function Kve(e){let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}function Vve(e,t){const n=t.includes(0),r=t.length===0?1:t.reduce((a,s)=>s===9||s===10||s===13||s>=32&&s<127||s>=128?a+1:a,0)/t.length;return!n&&r>.9?{how:"text"}:Hve.test(e)?{how:"binary"}:qve.test(e)?{how:"text"}:Gve.test(e)?{how:"unsupported",reason:`"${e}" is an image, and this composer only sends text and documents. Save it into the project folder and ask me to describe it โ€” I can read images from there.`}:{how:"unsupported",reason:`"${e}" is not a text file and not a document type I can read. Attach a PDF, DOCX, XLSX, PPTX, or a text/CSV/JSON/Markdown file โ€” or put the file in the project folder and ask me to read it.`}}function Yve(e){const t=["pending","running","done","blocked"].includes(e.status);return{id:e.id,description:e.description,status:t?e.status:"pending"}}function Xve(e){return e==="read_file"||e==="glob"||e==="list_dir"?"๐Ÿ“–":e==="edit_file"||e==="write_file"?"โœ๏ธ":e==="run_terminal"||e==="run_cli"?"โš™๏ธ":e==="web_search"||e==="read_page"?"๐ŸŒ":e==="delegate"||e==="spawn_subagents"?"๐Ÿ‘ฅ":e==="ask_user"?"๐Ÿค”":"๐Ÿ”ง"}const Zve={running:"โณ running",done:"โœ… done",failed:"โŒ failed",cancelled:"โน cancelled",timeout:"โฐ timed out",error:"๐Ÿ’ฅ error"};function cc({diff:e,selectable:t=!1,onCommitAccepted:n,lockedHint:r}){const[a,s]=k.useState(null),o=new Set(a??e.files.map(d=>d.path)),l=d=>{s(f=>{const h=f??e.files.map(p=>p.path);return h.includes(d)?h.filter(p=>p!==d):[...h,d]})},c=e.files.reduce((d,f)=>{var h;return d+(((h=f.body.match(/^\+/gm))==null?void 0:h.length)??0)},0),u=e.files.reduce((d,f)=>{var h;return d+(((h=f.body.match(/^-/gm))==null?void 0:h.length)??0)},0);return i.jsxs("div",{className:"chat-diff-card",children:[i.jsxs("div",{className:"chat-diff-head",children:[i.jsx("span",{className:"chat-diff-icon",children:"๐Ÿ”ง"}),i.jsx("span",{className:"chat-diff-title",children:"git diff"}),i.jsxs("span",{className:"chat-diff-meta",children:[e.files.length," file",e.files.length===1?"":"s"," ยท +",c," โˆ’",u]})]}),i.jsx("div",{className:"chat-diff-files",children:e.files.map(d=>{const f=o.has(d.path);return i.jsxs("details",{className:`chat-diff-file${f?"":" chat-diff-file-rejected"}`,open:e.files.length===1,children:[i.jsxs("summary",{className:"chat-diff-file-path",children:[t?i.jsx("button",{type:"button",className:`chat-diff-toggle${f?" chat-diff-toggle-on":""}`,title:f?"Accepted โ€” click to reject":"Rejected โ€” click to accept",onClick:h=>{h.preventDefault(),h.stopPropagation(),l(d.path)},children:f?"โœ“":"โœ—"}):null,d.path]}),i.jsx("pre",{className:"chat-diff-body",children:d.body.split(`
203
- `).map((h,p)=>{const g=h.startsWith("+")?"diff-add":h.startsWith("-")?"diff-del":h.startsWith("@@")?"diff-hunk":"";return i.jsx("div",{className:`chat-diff-line ${g}`,children:h||" "},p)})})]},d.path)})}),t&&n?i.jsxs("div",{className:"chat-diff-actions",children:[i.jsxs("button",{className:"admin-refresh-btn",type:"button",disabled:o.size===0,onClick:()=>n([...o]),children:["Commit accepted (",o.size,")"]}),i.jsx("span",{className:"admin-hint",children:"Only accepted files are committed โ€” the agent re-confirms with a question card."})]}):r?i.jsx("div",{className:"chat-diff-actions",children:i.jsxs("span",{className:"admin-hint chat-diff-locked",children:["๐Ÿ”’ ",r]})}):null]})}function vw({text:e,label:t}){const[n,r]=k.useState(!1),a=async()=>{var s;try{await((s=navigator.clipboard)==null?void 0:s.writeText(e)),r(!0),setTimeout(()=>r(!1),1500)}catch{}};return i.jsx("button",{type:"button",className:"chat-card-copy",title:`Copy ${t}`,onClick:()=>void a(),children:n?"โœ“ Copied":"โง‰ Copy"})}function Qve({result:e}){const t=e.verdict==="pass"?"โœ…":e.verdict==="fail"?"โŒ":"๐Ÿ“‹";return i.jsxs("div",{className:`chat-result-card chat-result-${e.verdict}`,children:[i.jsxs("div",{className:"chat-result-head",children:[i.jsx("span",{className:"chat-result-icon",children:t}),i.jsx("span",{className:"chat-result-title",children:e.title}),i.jsx("span",{className:"chat-result-meta",children:e.verdict}),i.jsx(vw,{text:e.body,label:"result output"})]}),i.jsx("pre",{className:"chat-result-body",children:e.body})]})}function Jve({deploy:e}){return i.jsxs("div",{className:"chat-deploy-card",children:[i.jsxs("div",{className:"chat-deploy-head",children:[i.jsx("span",{className:"chat-deploy-icon",children:"๐Ÿš€"}),i.jsx("span",{className:"chat-deploy-title",children:e.title||"Deployment"}),i.jsx(vw,{text:e.url,label:"deployment URL"})]}),i.jsx("a",{className:"chat-deploy-url",href:e.url,target:"_blank",rel:"noopener noreferrer",children:e.url})]})}function eye({children:e}){const t=k.useRef(null),n=r=>{if(!t.current)return;const a=Array.from(t.current.querySelectorAll("[data-artifact-card]"));if(a.length===0)return;const s=a.indexOf(document.activeElement);let o=-1;r.key==="ArrowDown"?o=s+1>=a.length?0:s+1:r.key==="ArrowUp"?o=s-1<0?a.length-1:s-1:r.key==="Home"?o=0:r.key==="End"&&(o=a.length-1),o>=0&&o!==s&&(r.preventDefault(),a[o].focus())};return i.jsx("div",{className:"chat-artifacts",ref:t,role:"group","aria-label":"Artifacts",onKeyDown:n,children:e})}function tye({task:e,onCancel:t}){const n=e.status==="running",r=e.logs.map(a=>C_(a.text)).join(`
204
- `);return i.jsxs("div",{className:`chat-task-card${n?" chat-task-running":e.status==="done"?" chat-task-ok":" chat-task-err"}`,children:[i.jsxs("div",{className:"chat-task-head",children:[i.jsx("span",{className:"chat-task-icon",children:"โš™๏ธ"}),i.jsx("code",{className:"chat-task-cmd",children:e.command}),i.jsx("span",{className:"chat-task-status",title:e.status,children:Zve[e.status]}),!n&&e.exitCode!==null?i.jsxs("span",{className:"chat-task-exit",children:["exit ",e.exitCode]}):null,!n&&e.durationMs!==null?i.jsxs("span",{className:"chat-task-dur",children:[e.durationMs,"ms"]}):null,r?i.jsx(vw,{text:r,label:"task output"}):null,n&&t?i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:t,children:"โน Cancel"}):null]}),i.jsx("pre",{className:"chat-task-logs",role:"log",children:e.logs.length>0?e.logs.map((a,s)=>{const o=e.logs[s-1],l=o&&o.stream!==a.stream,c=C_(a.text)||" ";return i.jsxs("div",{children:[l?i.jsx("div",{className:`chat-task-log-sep chat-task-log-sep-${a.stream}`,"aria-hidden":"true",children:a.stream}):null,i.jsx("div",{className:`chat-task-log chat-task-log-${a.stream}`,children:c})]},s)}):i.jsx("div",{className:"admin-hint",children:n?"Waiting for outputโ€ฆ":"(no output)"})})]})}function O_({draft:e,onAccept:t,onReject:n,onEdit:r}){const a=e.status??"pending",s=e.markdown.split(`
205
- `),o=s.findIndex(c=>c.startsWith("# "))>=0?s.findIndex(c=>c.startsWith("# ")):0,l=s.slice(o,o+14).join(`
206
- `);return i.jsxs("div",{className:`chat-draft-card${a==="saved"?" chat-draft-saved":""}${a==="rejected"?" chat-draft-rejected":""}`,children:[i.jsxs("div",{className:"chat-draft-head",children:[i.jsx("span",{className:"chat-draft-icon",children:"๐Ÿง "}),i.jsxs("span",{className:"chat-draft-title",children:["New skill draft: ",e.name]}),i.jsx("span",{className:"chat-draft-meta",children:"pending your review"})]}),i.jsx("p",{className:"chat-draft-desc",children:e.description}),i.jsx("pre",{className:"chat-draft-body",children:l}),a==="saving"?i.jsx("div",{className:"admin-hint",children:"Savingโ€ฆ"}):a==="saved"?i.jsx("div",{className:"admin-hint",children:"โœ… Saved โ€” the skill is live: load it in chat or see it in the Agent Hub Skills tab."}):a==="rejected"?i.jsx("div",{className:"admin-hint",children:"๐Ÿ—‘๏ธ Rejected โ€” the draft was discarded, nothing was saved."}):i.jsxs("div",{className:"chat-draft-actions",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>t(e.name),children:"โœ… Accept"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>r(e.name),children:"โœ๏ธ Edit"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>n(e.name),children:"โ†ฉ Reject"})]})]})}function nye({request:e,onSave:t}){const[n,r]=k.useState({}),[a,s]=k.useState(!1),o=e.missing.every(u=>{var d;return(d=n[u])==null?void 0:d.trim()}),l=e.missing.filter(u=>e.persisted[u]),c=e.missing.filter(u=>!e.persisted[u]);return i.jsxs("div",{className:"chat-secret-card",children:[i.jsxs("div",{className:"chat-secret-head",children:[i.jsx("span",{className:"chat-secret-icon",children:"๐Ÿ”"}),i.jsxs("span",{className:"chat-secret-title",children:[e.skillName," needs environment variables"]})]}),l.length>0?i.jsxs("div",{className:"chat-secret-persisted",children:["Already configured: ",l.map(u=>i.jsx("code",{children:u},u)).join(", ")]}):null,c.length>0&&!a?i.jsxs("div",{className:"chat-secret-fields",children:[c.map(u=>i.jsxs("div",{className:"chat-secret-row",children:[i.jsxs("label",{className:"chat-secret-label",htmlFor:`secret-${u}`,children:[u,":"]}),i.jsx("input",{id:`secret-${u}`,className:"chat-secret-input",type:"password",placeholder:`Enter ${u} valueโ€ฆ`,value:n[u]??"",onChange:d=>r(f=>({...f,[u]:d.target.value}))})]},u)),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:!o,onClick:()=>{t(n),s(!0)},children:"๐Ÿ’พ Save to ~/.buff/.env"})]}):a?i.jsx("div",{className:"admin-hint",children:"โœ… Saved โ€” the skill will pick up these values on next load."}):i.jsx("div",{className:"admin-hint",children:"All required env vars are already configured."})]})}function rye({result:e}){const[t,n]=k.useState(!1),r=e.success?"โœ…":"โŒ",a=e.success?"Success":`Failed (exit ${e.exitCode})`,s=e.success?"chat-exec-success":"chat-exec-failure",o=new Date(e.timestamp).toLocaleTimeString();return i.jsxs("div",{className:`chat-exec-card ${s}`,children:[i.jsxs("div",{className:"chat-exec-head",onClick:()=>n(!t),style:{cursor:"pointer"},children:[i.jsx("span",{className:"chat-exec-icon",children:"๐Ÿ“œ"}),i.jsx("span",{className:"chat-exec-title",children:e.skillName}),i.jsxs("span",{className:"chat-exec-status",children:[r," ",a]}),i.jsxs("span",{className:"chat-exec-meta",children:[e.runtime," ยท ",e.durationMs,"ms ยท ",o]}),i.jsx("span",{className:"chat-exec-expand",children:t?"โ–ผ":"โ–ถ"})]}),t&&i.jsxs("div",{className:"chat-exec-body",children:[e.stdout&&i.jsxs("div",{className:"chat-exec-section",children:[i.jsx("div",{className:"chat-exec-section-title",children:"stdout"}),i.jsx("pre",{className:"chat-exec-output",children:e.stdout})]}),e.stderr&&i.jsxs("div",{className:"chat-exec-section chat-exec-stderr",children:[i.jsx("div",{className:"chat-exec-section-title",children:"stderr"}),i.jsx("pre",{className:"chat-exec-output",children:e.stderr})]}),i.jsxs("div",{className:"chat-exec-details",children:[i.jsxs("span",{children:["Runtime: ",e.runtime]}),i.jsxs("span",{children:["Exit code: ",e.exitCode]}),i.jsxs("span",{children:["Duration: ",e.durationMs,"ms"]})]})]})]})}function aye(e){return e==="done"?"โœ…":e==="running"?"๐Ÿ”„":e==="blocked"?"โ›”":"โฌœ"}function P_({plan:e}){const t=e.steps.filter(n=>n.status==="done").length;return i.jsxs("div",{className:"chat-plan-card",children:[i.jsxs("div",{className:"chat-plan-head",children:[i.jsx("span",{className:"chat-plan-icon",children:"๐Ÿ—‚๏ธ"}),i.jsx("span",{className:"chat-plan-goal",children:e.goal}),i.jsxs("span",{className:"chat-plan-count",children:[t,"/",e.steps.length," done"]})]}),i.jsx("div",{className:"chat-plan-steps",children:e.steps.map(n=>i.jsxs("div",{className:`chat-plan-step chat-plan-step-${n.status}`,children:[i.jsx("span",{className:"chat-plan-step-icon",children:aye(n.status)}),i.jsx("span",{className:"chat-plan-step-text",children:n.description}),i.jsx("span",{className:"chat-plan-step-status",children:n.status})]},n.id))})]})}function R_({tools:e,live:t}){return!e||e.length===0?null:i.jsx("div",{className:`chat-tool-cards${t?" chat-tool-cards-live":""}`,children:e.map(n=>{const r=n.phase==="started"||n.ok===void 0,a=n.ok===!1;return i.jsxs("div",{className:`chat-tool-card${r?" chat-tool-running":a?" chat-tool-err":" chat-tool-ok"}`,children:[i.jsxs("div",{className:"chat-tool-head",children:[i.jsx("span",{className:"chat-tool-icon",children:Xve(n.tool)}),i.jsx("span",{className:"chat-tool-name",children:n.tool}),n.args?i.jsx("code",{className:"chat-tool-args",children:n.args}):null,i.jsx("span",{className:"chat-tool-status",title:r?"running":a?"failed":"done",children:r?"โณ":a?"โœ—":"โœ“"}),n.durationMs!==void 0&&!r?i.jsxs("span",{className:"chat-tool-dur",children:[n.durationMs,"ms"]}):null]}),n.error||n.result?i.jsxs("details",{className:"chat-tool-detail",children:[i.jsx("summary",{children:a?"Error":"Result"}),i.jsx("pre",{className:"chat-tool-body",children:n.error||n.result})]}):null]},n.id)})})}function iye(e){return(e.evidence??[]).filter(t=>typeof(t==null?void 0:t.ref)=="string"&&t.ref.trim().length>0)}function M_({findings:e}){return!e||e.length===0?null:i.jsx("div",{className:"chat-finding-cards",children:e.map((t,n)=>{const r=iye(t),a=t.verdict==="CONFIRMED"&&r.length>0;return i.jsxs("div",{className:`chat-finding-card ${a?"chat-finding-confirmed":"chat-finding-plausible"}`,children:[i.jsxs("div",{className:"chat-finding-head",children:[i.jsx("span",{className:"chat-finding-icon","aria-hidden":"true",children:a?"โœ…":"๐Ÿ”Ž"}),i.jsx("span",{className:"chat-finding-claim",children:t.claim}),i.jsx("span",{className:`chat-finding-verdict ${a?"chat-finding-verdict-ok":"chat-finding-verdict-guess"}`,title:a?"a check was performed and is shown below":"reasoned, not verified",children:a?"CONFIRMED":"PLAUSIBLE"})]}),t.outcome?i.jsx("div",{className:"chat-finding-outcome",children:t.outcome}):null,r.length>0?i.jsx("ul",{className:"chat-finding-evidence",children:r.map((s,o)=>i.jsxs("li",{children:[i.jsx("span",{className:"chat-finding-kind",children:s.kind}),i.jsx("code",{className:"chat-finding-ref",children:s.ref}),s.detail?i.jsxs("span",{className:"chat-finding-detail",children:["(",s.detail,")"]}):null]},o))}):i.jsx("div",{className:"chat-finding-noevidence",children:"no evidence โ€” reported as PLAUSIBLE, not verified"}),t.source?i.jsxs("div",{className:"chat-finding-source",children:["source: ",t.source]}):null]},`${n}-${t.claim}`)})})}function sye({worktree:e}){return i.jsxs("div",{className:"chat-worktree-card",children:[i.jsxs("div",{className:"chat-worktree-head",children:[i.jsx("span",{className:"chat-worktree-icon","aria-hidden":"true",children:"๐ŸŒฟ"}),i.jsx("span",{className:"chat-worktree-title",children:"Ran in an isolated worktree"}),i.jsx("span",{className:`chat-worktree-state ${e.removed?"chat-worktree-gone":"chat-worktree-kept"}`,children:e.removed?"removed":"kept"})]}),i.jsxs("div",{className:"chat-worktree-meta",children:[i.jsx("code",{className:"chat-worktree-dir",title:e.dir,children:e.dir}),i.jsxs("span",{className:"admin-hint",children:["base ",e.base.slice(0,7)]})]}),i.jsx("div",{className:"chat-worktree-note admin-hint",children:e.removed?"the diff below is what is left of it โ€” nothing was written into the project tree":"the directory above is still on disk"}),i.jsx(cc,{diff:e.diff.payload})]})}function oye({resume:e}){return i.jsxs("div",{className:"chat-resume-card",children:[i.jsxs("div",{className:"chat-resume-head",children:[i.jsx("span",{className:"chat-resume-icon","aria-hidden":"true",children:"โ†ฉ๏ธ"}),i.jsx("span",{className:"chat-resume-title",children:"Resumed a recorded run"}),i.jsx("span",{className:`chat-resume-state ${e.saved?"chat-resume-saved":"chat-resume-unsaved"}`,title:e.saved?"the record was written back, so a later resume can replay this run":"the record could NOT be written โ€” a later resume will replay nothing from this run",children:e.saved?"recorded":"not recorded"})]}),i.jsxs("div",{className:"chat-resume-meta",children:[i.jsxs("span",{children:[e.replayed," step",e.replayed===1?"":"s"," replayed"]}),i.jsxs("span",{children:[e.modelCalls," model call",e.modelCalls===1?"":"s"," made"]}),i.jsx("code",{className:"chat-resume-id",title:"the checkpoint record this run used",children:e.id})]}),i.jsx("div",{className:"chat-resume-note",children:e.notice})]})}function Vg(){try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return`chat-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function lye(e,t){const n=t.trim().toLowerCase(),r=n?e.filter(u=>`${u.title} ${u.preview} ${u.firstUser}`.toLowerCase().includes(n)):e,a=[],s=new Date,o=new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime(),l=864e5,c=[{label:"Today",match:u=>u>=o},{label:"Yesterday",match:u=>u>=o-l&&u<o},{label:"This week",match:u=>u>=o-7*l&&u<o-l},{label:"Older",match:()=>!0}];for(const u of c){const d=r.filter(f=>u.match(f.updatedAt));d.length>0&&a.push({label:u.label,items:d})}return a}function I_(){var Pl,Bs,zs,Rl,ad;const[e,t]=k.useState(null),[n,r]=k.useState([]),[a,s]=k.useState(""),[o,l]=k.useState(!1),[c,u]=k.useState(""),[d,f]=k.useState(null),[h,p]=k.useState(!1),[g,m]=k.useState(!1),[y,v]=k.useState(!1),[b,w]=k.useState(""),[N,S]=k.useState(null),[x,E]=k.useState([]),[j,C]=k.useState([]),[T,$]=k.useState(null),[R,I]=k.useState(null),[L,F]=k.useState(null),[z,M]=k.useState([]),[O,U]=k.useState([]),[A,Z]=k.useState([]),[D,P]=k.useState(null),oe=k.useRef([]),be=k.useRef([]),pe=k.useRef(null),Ce=k.useRef(null),G=k.useRef(null),Y=k.useRef([]),[ie,le]=k.useState(""),X=k.useRef(""),_e=k.useRef(null),[Ne,je]=k.useState(null),ge=k.useRef(Vg()),Le=k.useRef(""),[fe,tt]=k.useState([]),[Be,Ee]=k.useState(!0),[Ke,$t]=k.useState(""),[Rn,en]=k.useState(null),[W,V]=k.useState(""),[ae,he]=k.useState([]),[xe,Ge]=k.useState(null),[un,Ot]=k.useState(!1),Hn=k.useRef(null),kn=k.useRef(null),[Re,Gn]=k.useState(null),[Lt,da]=k.useState(null),[Ci,lr]=k.useState([]),[tn,q]=k.useState(""),[me,Me]=k.useState(""),[Te,qn]=k.useState(!1),[dn,Hr]=k.useState(""),[Nn,Os]=k.useState([]),[Nl,Yu]=k.useState(null),[Xu,Ti]=k.useState(!1),[fa,lm]=k.useState([]),[cm,Zu]=k.useState([]),[El,jl]=k.useState(""),_l=k.useRef(null),lt=k.useRef(null),Oi=k.useRef(null),Ps=k.useRef(null),[Dt,Pi]=k.useState(null),[Ri,Qu]=k.useState(new Set);k.useEffect(()=>{Q.fetchAdminAuthStatus().then(B=>{t(B?{configured:B.configured,authenticated:B.authenticated,role:B.role??null}:{configured:!1,authenticated:!1,role:null})})},[]),k.useEffect(()=>{var B,te;try{(te=(B=Oi.current)==null?void 0:B.scrollTo)==null||te.call(B,{top:Oi.current.scrollHeight})}catch{}},[n,o,x]),k.useEffect(()=>()=>{var B;(B=lt.current)==null||B.call(lt),lt.current=null},[]);const Al=k.useCallback(async B=>{var ke,_r;(ke=lt.current)==null||ke.call(lt),lt.current=null;const te=await Q.getChatSession(B);if(!te)return;ge.current=B,r(te.turns.map(zt=>({role:zt.role,content:zt.content,...zt.role==="assistant"?{followups:[],artifacts:A_(zt.content)}:{}}))),E([]),oe.current=[],C([]),be.current=[],$(null),pe.current=null,I(null),Ce.current=null,F(null),G.current=null,M([]),Y.current=[],X.current="",le(""),je(null),u(""),S(null),P(null),Pi(null),Ee(!0);const ee=te.projectPath;if(ee){if(da(ee),(Re==null?void 0:Re.path)===ee)return;(_r=Ps.current)==null||_r.call(Ps,ee)}else da(null)},[Re]),Rs=k.useCallback(()=>{var B;(B=lt.current)==null||B.call(lt),lt.current=null,ge.current=Vg(),da(null),r([]),E([]),oe.current=[],C([]),be.current=[],$(null),pe.current=null,I(null),Ce.current=null,F(null),G.current=null,M([]),Y.current=[],X.current="",le(""),je(null),u(""),S(null),P(null),Pi(null),he([]),Ge(null),s(""),Ee(!0)},[]),ha=k.useCallback(B=>{he(te=>[...te,B].slice(-10))},[]),Kn=k.useCallback(B=>{he(te=>te.filter((ee,ke)=>ke!==B))},[]),Ms=k.useCallback(async B=>{if(!B)return;if(B.size>T_){u(`Attachment "${B.name}" is too large (max ${Math.round(T_/1024)} KB).`);return}const te=new Uint8Array(await B.slice(0,8192).arrayBuffer()),ee=Vve(B.name,te);if(ee.how==="unsupported"){u(ee.reason);return}if(ee.how==="binary"){const _r=new Uint8Array(await B.arrayBuffer());ha({name:B.name,content:Kve(_r),kind:"file",encoding:"base64"});return}const ke=await B.text();ha({name:B.name,content:ke,kind:"file",encoding:"text"})},[ha]),Is=k.useCallback(B=>{const te=B.currentTarget,ee=B.clipboardData.getData("text")||"";ee.length>=Wve&&(kn.current={start:te.selectionStart,end:te.selectionEnd},Ge({text:ee}))},[]),Ju=k.useCallback(()=>{const B=xe;if(!B)return;const te=kn.current;s(ee=>te?ee.slice(0,te.start)+ee.slice(te.end):ee),ha({name:"pasted-text.txt",content:B.text,kind:"paste",encoding:"text"}),Ge(null),kn.current=null},[xe,ha]),ed=k.useCallback(B=>{en(B.id),V(B.title==="(untitled conversation)"?"":B.title)},[]),pa=k.useCallback(async B=>{const te=await Q.renameChatSession(B,W);te.ok?tt(ee=>ee.map(ke=>ke.id===B?{...ke,title:W.trim()||ke.title}:ke)):u(te.error||"Could not rename the session."),en(null),V("")},[W]),Cl=k.useCallback(async B=>{const te=await Q.deleteChatSession(B);te.ok?(tt(ee=>ee.filter(ke=>ke.id!==B)),ge.current===B&&Rs()):u(te.error||"Could not delete the session.")},[Rs]),Gr=(e==null?void 0:e.authenticated)===!0&&(e.role==="admin"||e.role==="operator");k.useEffect(()=>{Gr&&(Q.listChatSessions().then(B=>{Array.isArray(B)&&tt(B)}),Q.listProjects().then(B=>{Array.isArray(B)&&lr(B)}))},[Gr]);const Vn=k.useCallback(async B=>{const te=B.trim();if(!te)return;Me("");const ee=await Q.attachProject(te);if(ee.ok&&ee.project){Gn(ee.project),q("");const ke=await Q.listProjects();Array.isArray(ke)&&lr(ke)}else Me(ee.error||"Could not attach that directory.")},[]);Ps.current=Vn;const ma=k.useCallback(async B=>{qn(!0),Ti(!0),jl("");const te=await Q.browseDirectories(B,{showDrives:!B});te.ok&&(Hr(te.path),Os(te.entries),Yu(te.parent),te.drives&&lm(te.drives),te.breadcrumbs&&Zu(te.breadcrumbs)),Ti(!1)},[]),$s=k.useCallback(async B=>{Ti(!0),jl("");const te=await Q.browseDirectories(B);te.ok&&(Hr(te.path),Os(te.entries),Yu(te.parent),te.breadcrumbs&&Zu(te.breadcrumbs)),Ti(!1)},[]),jr=k.useCallback(async()=>{if(!dn)return;const B=await Q.browseDirectories(dn);B.ok&&Os(B.entries)},[dn]);k.useEffect(()=>Q.onChatRetryEvent(te=>{if(te.sessionId!==ge.current){Q.listChatSessions().then(ee=>{Array.isArray(ee)&&tt(ee)});return}r(ee=>[...ee,{role:"assistant",content:te.content}]),te.kind==="answer"&&je(null)}),[]),k.useEffect(()=>(Te&&dn&&(_l.current=setInterval(()=>{jr()},5e3)),()=>{_l.current&&clearInterval(_l.current)}),[Te,dn,jr]);const um=k.useCallback(async()=>{if(typeof window<"u"&&"showDirectoryPicker"in window)try{const ee=(await window.showDirectoryPicker({mode:"read"})).name;if(!ee){ma();return}Me(""),l(!0);const ke=await Q.resolveFolder(ee);l(!1),ke.ok&&ke.path?(q(ke.path),Vn(ke.path)):Me('Folder "'+ee+'" found โ€” selecting it now. If this is wrong, type the full path below.');return}catch(te){if((te==null?void 0:te.name)==="AbortError")return}ma()},[ma,Vn]),Bt=k.useCallback(async(B,te)=>{var Kr,Yn;const ee=B.trim(),ke=Array.isArray(te)?te:ae,_r=!Array.isArray(te)&&(te==null?void 0:te.skipResolve)===!0;if(!ee&&ke.length===0||o)return;if(u(""),S(null),E([]),oe.current=[],C([]),be.current=[],$(null),pe.current=null,I(null),Ce.current=null,F(null),G.current=null,M([]),Y.current=[],r(we=>[...we,{role:"user",content:ee,attachments:ke.length>0?ke:void 0}]),s(""),he([]),Ge(null),Le.current=ee||`[${ke.length} attachment(s)]`,l(!0),Ee(!1),!_r){const ct=((await Q.chatResolve(ee)).matches??[])[0]??null;if(ct&&ct.command&&!ct.ambiguous&&ct.score>=.6){P({ask:ee,top:ct}),l(!1);return}if(ct&&ct.ambiguous&&!D){P({ask:ee,top:ct}),l(!1);return}}const zt=ge.current,Mn=new AbortController;_e.current=Mn,je(null),(Kr=lt.current)==null||Kr.call(lt),lt.current=Q.subscribeChat(zt,{onToken:we=>{X.current+=we,le(X.current)},onProgress:we=>{oe.current=[...oe.current,we],E(oe.current)},onQuestion:we=>{Pi(we),Qu(new Set)},onTool:we=>{const Ue=[...be.current],ct=Ue.findIndex(nn=>nn.id===we.id),Ct={id:we.id,tool:we.tool,phase:we.phase,args:we.args,ok:we.ok,result:we.result,error:we.error,durationMs:we.durationMs};ct>=0?Ue[ct]=Ct:Ue.push(Ct),be.current=Ue,C(Ue)},onPlan:we=>{const Ue={goal:we.goal,steps:we.steps.map(Yve),revision:we.revision};pe.current=Ue,$(Ue)},onDiff:we=>{const Ue={files:we.files,summary:we.summary};Ce.current=Ue,I(Ue)},onSkillDraft:we=>{const Ue={name:we.name,description:we.description,markdown:we.markdown,updatedAt:we.updatedAt,status:"pending"};G.current=Ue,F(Ue)},onFinding:we=>{Y.current=[...Y.current,we],M(Y.current)},onSecretRequest:we=>{U(Ue=>{const ct=Ue.findIndex(Ct=>Ct.skillName===we.skillName);if(ct>=0){const Ct=[...Ue];return Ct[ct]=we,Ct}return[...Ue,we]})},onExecutionResult:we=>{Z(Ue=>[...Ue,we])}});const kt=await Q.chatSend(zt,ee||`(see ${ke.length} attachment${ke.length===1?"":"s"})`,{projectPath:Re==null?void 0:Re.path,attachments:ke.map(we=>({name:we.name,content:we.content,kind:we.kind,encoding:we.encoding??"text"})),...h?{worktree:!0,keepWorktree:g}:{},...y?{resume:b.trim()||!0}:{}},Mn.signal);if(_e.current=null,(Yn=lt.current)==null||Yn.call(lt),lt.current=null,X.current="",le(""),kt.ok){S(kt.generationFailed?null:`${kt.provider??"provider"}${kt.model?` / ${kt.model}`:" (auto-routed)"}`),je(kt.generationFailed&&!kt.retryQueued&&!kt.refused?ee:null);const we=kt.content||"(the agent produced no text โ€” try rephrasing)";r(Ue=>[...Ue,{role:"assistant",content:we,error:kt.generationFailed,followups:kt.followups,steps:oe.current,tools:be.current,plan:pe.current,diff:Ce.current,draft:G.current,findings:kt.findings??Y.current,worktree:kt.worktree,resume:kt.resume,refused:kt.refused,artifacts:A_(we)}])}else Mn.signal.aborted?(u(""),je(null)):kt.unauthorized?(t(we=>we&&{...we,authenticated:!1}),u("Session expired โ€” log in again to chat.")):(u(kt.error||"The agent could not answer โ€” check that a provider API key is set for the dashboard process."),je(ee));l(!1),Ee(!0)},[o,Re,ae,h,g,y,b]),Ls=k.useCallback(()=>{var B;(B=_e.current)==null||B.abort()},[]),qr=k.useCallback(async()=>{f(null);const B=await Q.chatSupportBundle(ge.current);f(B.ok?{kind:"ok",text:"Support bundle downloaded โ€” attach it to your bug report."}:{kind:"err",text:B.error||"Could not build the support bundle."})},[]),Tl=k.useCallback(async B=>{F(ee=>ee&&{...ee,status:"saving"});const te=await Q.skillDraftAccept(B);F(ee=>ee&&{...ee,status:te.ok?"saved":"error"}),te.ok||u(te.error||"Could not accept the draft.")},[]),Vt=k.useCallback(async B=>{const te=await Q.skillDraftReject(B);te.ok?F(ee=>ee&&{...ee,status:"rejected"}):u(te.error||"Could not reject the draft.")},[]),td=k.useCallback(B=>{Bt(`Revise the skill draft "${B}" โ€” improve it per your best judgment and present it again.`)},[Bt]),dm=k.useCallback(async B=>{const te=await Q.saveSecrets(B);if(!te.ok){u(te.error||"Could not save secrets.");return}const ee=te.refused??[];ee.length>0&&u(ee.map(ke=>ke.reason==="provider-credential"?`${ke.name} is a provider credential โ€” set it up as a provider, skills never receive it.`:`${ke.name} was not saved (${ke.reason}).`).join(" "))},[]),fm=k.useCallback(async B=>{const ke=((await Q.chatResolve(B)).matches??[])[0]??null;if(!(ke!=null&&ke.command)){P(null);return}P(null),l(!0);const _r=ke.command.split(/\s+/),zt=await Q.startTask(_r,6e4);if(!zt.ok||!zt.task){u(zt.error||"The command could not be started."),l(!1);return}const Mn=zt.task.id,kt={id:Mn,command:ke.command,status:zt.task.status,exitCode:zt.task.exitCode,durationMs:zt.task.durationMs,logs:zt.task.logs??[]};r(ct=>[...ct,{role:"assistant",content:"",task:kt}]);const Kr=ct=>r(Ct=>Ct.map(nn=>nn.task&&nn.task.id===Mn?{...nn,task:{...nn.task,...ct}}:nn));let Yn=null;Yn=Q.subscribeTask(Mn,{onLog:ct=>r(Ct=>Ct.map(nn=>nn.task&&nn.task.id===Mn?{...nn,task:{...nn.task,logs:[...nn.task.logs,ct]}}:nn)),onStatus:ct=>{Kr({status:ct}),ct!=="running"&&(Q.getTask(Mn).then(Ct=>{Ct!=null&&Ct.task&&Kr({exitCode:Ct.task.exitCode,durationMs:Ct.task.durationMs,logs:Ct.task.logs??[]})}),Yn==null||Yn(),l(!1))}});const we=await Q.getTask(Mn);we!=null&&we.task&&Kr({status:we.task.status,exitCode:we.task.exitCode,durationMs:we.task.durationMs,logs:we.task.logs??[]});const Ue=await Q.getTask(Mn);Ue!=null&&Ue.task&&Ue.task.status!=="running"&&(Yn==null||Yn(),Kr({status:Ue.task.status,exitCode:Ue.task.exitCode,durationMs:Ue.task.durationMs,logs:Ue.task.logs??[]}),l(!1))},[]),Mi=k.useCallback(B=>{P(null),Bt(B,{skipResolve:!0})},[Bt]),nd=k.useCallback(B=>{if(B.length===0)return;const te=Re?` in the attached project ${Re.path}`:"";Bt(`Commit exactly these files that I accepted on the diff card (and nothing else)${te}: ${B.join(", ")}. Show me a short confirmation before finishing.`)},[Bt,Re]),hm=k.useCallback(async B=>{await Q.cancelTask(B)},[]),Ua=k.useCallback(async B=>{const te=Dt;if(!te)return;Pi(null);const ee=await Q.chatRespond(ge.current,te.questionId,B);ee.ok||u(ee.error||"The question could not be answered โ€” try sending your message again.")},[Dt]),Ds=k.useCallback(()=>{if(!Dt)return;const B=Dt.multiSelect?[...Ri]:[...Ri][0];Dt.multiSelect?Ua({index:[...Ri]}):Ua(B!==void 0?{index:B}:{index:-1})},[Dt,Ri,Ua]),pm=k.useCallback(()=>{Dt&&Ua({index:-1})},[Dt,Ua]),rd=k.useCallback(B=>{Qu(te=>{const ee=new Set(te);return Dt!=null&&Dt.multiSelect?ee.has(B)?ee.delete(B):ee.add(B):(ee.clear(),ee.add(B)),ee})},[Dt]),mm=k.useCallback(async()=>{var te;(te=lt.current)==null||te.call(lt),lt.current=null,ge.current=Vg(),r([]),E([]),oe.current=[],C([]),be.current=[],$(null),pe.current=null,I(null),Ce.current=null,F(null),G.current=null,M([]),Y.current=[],X.current="",le(""),je(null),u(""),S(null),P(null),Pi(null);const B=await Q.listChatSessions();Array.isArray(B)&&tt(B)},[]),Ol=((Pl=[...n].reverse().find(B=>{var te;return B.role==="assistant"&&!B.error&&(((te=B.followups)==null?void 0:te.length)??0)>0}))==null?void 0:Pl.followups)??[];return i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"๐Ÿ’ฌ",title:"Chat with the agent",actions:i.jsxs("div",{className:"chat-head-actions",children:[N?i.jsx("span",{className:"admin-hint",children:N}):null,i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void mm(),disabled:o||n.length===0,children:"๐Ÿ—‘ New conversation"})]})}),e!=null&&e.authenticated?Gr?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"chat-project-bar",children:Re?i.jsxs("div",{className:"chat-project-attached",children:[i.jsx("span",{className:"chat-project-icon",children:"๐Ÿ“"}),i.jsx("span",{className:"chat-project-name",children:Re.name}),i.jsxs("span",{className:"chat-project-meta",children:[Re.fileCount," files ยท ",Re.symbolCount," symbols",Re.truncated?" ยท truncated map":""]}),i.jsx("span",{className:"chat-project-path",title:Re.path,children:Re.path}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>Gn(null),children:"โœ• detach"})]}):i.jsxs("div",{className:"chat-project-pick",children:[i.jsx("span",{className:"chat-project-icon",children:"๐Ÿ“"}),i.jsx("span",{className:"chat-project-hint",children:"Select Project Folder"}),Ci.length>0?i.jsx("span",{className:"chat-project-chips",children:Ci.filter(B=>B.kind!=="cwd").slice(0,3).map(B=>i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Vn(B.path),children:B.name},B.path))}):null,i.jsx("input",{className:"chat-project-input",value:tn,onChange:B=>q(B.target.value),onKeyDown:B=>{B.key==="Enter"&&(B.preventDefault(),Vn(tn))},placeholder:"or type a path, e.g. ~/code/my-app",disabled:o}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void Vn(tn),disabled:o||!tn.trim(),children:"Attach"}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void um(),title:"Pick a project folder using your system's folder picker (Finder / Explorer)",children:"๐Ÿ—‚๏ธ Browse"}),me?i.jsx("span",{className:"chat-project-error",children:me}):null,Te?i.jsxs("div",{className:"chat-browse-popover",children:[i.jsxs("div",{className:"chat-browse-head",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>qn(!1),title:"Close",children:"โœ•"}),i.jsx("div",{className:"chat-browse-breadcrumbs",children:fa.length>0&&!dn?i.jsx("span",{className:"admin-hint",children:"Select a drive or home folder:"}):i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void ma(),children:"๐Ÿ "}),cm.map((B,te)=>i.jsxs("span",{children:[i.jsx("span",{className:"chat-breadcrumb-sep",children:"/"}),i.jsx("button",{type:"button",className:"chat-breadcrumb",onClick:()=>void $s(B.path),children:B.name})]},B.path))]})})]}),fa.length>0&&!dn?i.jsx("div",{className:"chat-browse-drives",children:fa.map(B=>i.jsx("button",{type:"button",className:"chat-browse-drive",onClick:()=>void $s(B.path),children:B.name},B.path))}):null,Nn.length>5?i.jsx("div",{className:"chat-browse-search",children:i.jsx("input",{type:"text",className:"chat-browse-filter",placeholder:"๐Ÿ” Filter foldersโ€ฆ",value:El,onChange:B=>jl(B.target.value),autoFocus:!0})}):null,i.jsx("div",{className:"chat-browse-list",children:Xu?i.jsx("span",{className:"admin-hint",children:"Loadingโ€ฆ"}):Nn.length===0?i.jsx("span",{className:"admin-hint",children:"No subdirectories found"}):Nn.filter(B=>!El||B.name.toLowerCase().includes(El.toLowerCase())).map(B=>i.jsxs("button",{type:"button",className:"chat-browse-entry",onClick:()=>void $s(B.path),children:[i.jsx("span",{className:"chat-browse-entry-icon",children:"๐Ÿ“"}),i.jsx("span",{className:"chat-browse-entry-name",children:B.name}),B.modified?i.jsx("span",{className:"chat-browse-entry-date",children:new Date(B.modified).toLocaleDateString()}):null]},B.path))}),i.jsxs("div",{className:"chat-browse-foot",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>void jr(),title:"Refresh folder list",children:"๐Ÿ”„"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>{qn(!1),Vn(dn)},disabled:!dn,children:"๐Ÿ“ Select this folder"})]})]}):null]})}),Lt&&(!Re||Re.path!==Lt)?i.jsxs("div",{className:"chat-session-project-banner",children:[i.jsxs("span",{children:["โš ๏ธ This conversation was working in ",i.jsx("code",{children:Lt})]}),Re?i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void Vn(Lt),children:"๐Ÿ“ Switch to it"}):i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void Vn(Lt),children:"๐Ÿ“ Attach it"})]}):null,i.jsxs("div",{className:"chat-layout",children:[Be?i.jsxs("div",{className:"chat-sidebar",children:[i.jsxs("div",{className:"chat-sidebar-head",children:[i.jsx("span",{children:"๐Ÿ“ Sessions"}),i.jsxs("div",{className:"chat-sidebar-head-actions",children:[i.jsx("button",{type:"button",className:"chat-mini-action",title:"New chat",onClick:Rs,children:"๏ผ‹ New"}),i.jsx("button",{type:"button",className:"chat-mini-action",title:"Collapse history",onClick:()=>Ee(!1),children:"โ–ธ"})]})]}),i.jsx("input",{className:"chat-session-search",placeholder:"Search conversationsโ€ฆ",value:Ke,onChange:B=>$t(B.target.value)}),fe.length===0?i.jsx("div",{className:"chat-sidebar-empty",children:"No past conversations yet."}):i.jsx("div",{className:"chat-sidebar-list",children:lye(fe,Ke).map(({label:B,items:te})=>i.jsxs("div",{className:"chat-session-group",children:[i.jsx("div",{className:"chat-session-group-label",children:B}),te.map(ee=>i.jsx("div",{className:`chat-session-item${ee.id===ge.current?" chat-session-active":""}`,children:Rn===ee.id?i.jsxs("div",{className:"chat-session-rename",children:[i.jsx("input",{autoFocus:!0,value:W,onChange:ke=>V(ke.target.value),onKeyDown:ke=>{ke.key==="Enter"&&pa(ee.id),ke.key==="Escape"&&en(null)},placeholder:"Session title"}),i.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>void pa(ee.id),children:"โœ“"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"chat-session-main",onClick:()=>void Al(ee.id),title:ee.preview||ee.title,children:[i.jsx("span",{className:"chat-session-title",children:ee.title}),i.jsx("span",{className:"chat-session-preview",children:ee.firstUser||ee.preview}),i.jsxs("span",{className:"chat-session-meta",children:[ee.projectPath?`๐Ÿ“ ${ee.projectPath.split("/").pop()} ยท `:"",ee.turnCount," msg",ee.turnCount===1?"":"s"," ยท ",new Date(ee.updatedAt).toLocaleString()]})]}),i.jsxs("span",{className:"chat-session-actions",children:[i.jsx("button",{type:"button",className:"chat-mini-action",title:"Rename",onClick:()=>ed(ee),children:"โœ๏ธ"}),i.jsx("button",{type:"button",className:"chat-mini-action",title:"Delete",onClick:()=>void Cl(ee.id),children:"๐Ÿ—‘"})]})]})},ee.id))]},B))})]}):i.jsx("div",{className:"chat-rail",children:i.jsx("button",{type:"button",className:"chat-rail-btn",onClick:()=>Ee(!0),title:"Show history",children:"๐Ÿ“"})}),i.jsxs("div",{className:"chat-main",children:[i.jsxs("div",{className:"chat-thread",ref:Oi,role:"log","aria-live":"polite",children:[n.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx("p",{className:"empty-state-title",children:"Say anything โ€” the agent decides what to do (answer, fix code, plan, run the pipeline)."}),i.jsxs("div",{className:"empty-state-chips",children:[i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Bt("what's the state of this project?"),children:"๐Ÿ“‹ assess this project"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Bt("run the test suite"),children:"๐Ÿงช run the tests"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Bt("stop the gateway"),children:"โน stop the gateway"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Bt("load the code-assessment skill and assess this project"),children:"๐Ÿง  load the code-assessment skill"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Bt("learn the workflow I just did as a skill"),children:"๐Ÿ“š learn a workflow as a skill"}),i.jsx("button",{type:"button",className:"chat-chip",onClick:()=>void Bt("publish the current version"),children:"๐Ÿš€ publish the release"})]})]}):n.map((B,te)=>i.jsxs("div",{className:`chat-bubble chat-${B.role}${B.error?" chat-error":""}`,children:[i.jsx("div",{className:"chat-bubble-role",children:B.role==="user"?"You":"๐Ÿค– Agent"}),B.role==="assistant"?i.jsx("div",{className:"chat-bubble-text",children:i.jsx(N_,{text:B.content})}):i.jsx("div",{className:"chat-bubble-text",children:B.content}),B.role==="user"&&B.attachments&&B.attachments.length>0?i.jsxs("details",{className:"chat-steps",open:B.attachments.length===1,children:[i.jsxs("summary",{children:["๐Ÿ“Ž ",B.attachments.length," attachment",B.attachments.length===1?"":"s",":"," ",B.attachments.map(ee=>ee.name).join(", ")]}),B.attachments.map((ee,ke)=>i.jsxs("div",{className:"chat-attach-content",children:[i.jsxs("div",{className:"admin-hint",children:[ee.name," โ€” ",mt(ee.content.length)," chars"]}),i.jsx("pre",{children:ee.content})]},ke))]}):null,B.role==="assistant"&&B.diff?i.jsxs("details",{className:"chat-steps",open:!0,children:[i.jsxs("summary",{children:["Changes: ",B.diff.summary]}),i.jsx(cc,{diff:B.diff,selectable:!0,onCommitAccepted:nd})]}):null,B.role==="assistant"&&B.artifacts&&(B.artifacts.diffs.length>0||B.artifacts.results.length>0||B.artifacts.deploys.length>0)?i.jsxs(eye,{children:[B.artifacts.diffs.map((ee,ke)=>i.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Diff: ${ee.summary}`,className:"chat-artifact-item",children:Re?i.jsx(cc,{diff:ee,selectable:!0,onCommitAccepted:nd}):i.jsx(cc,{diff:ee,lockedHint:"Attach a project to review and commit these changes."})},`diff-${ke}`)),B.artifacts.results.map((ee,ke)=>i.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Result: ${ee.title}`,className:"chat-artifact-item",children:i.jsx(Qve,{result:ee})},`result-${ke}`)),B.artifacts.deploys.map((ee,ke)=>i.jsx("div",{"data-artifact-card":!0,tabIndex:0,role:"group","aria-label":`Deployment: ${ee.url}`,className:"chat-artifact-item",children:i.jsx(Jve,{deploy:ee})},`deploy-${ke}`))]}):null,B.role==="assistant"&&B.task?i.jsx(tye,{task:B.task,onCancel:B.task.status==="running"?()=>void hm(B.task.id):void 0}):null,B.role==="assistant"&&B.draft?i.jsxs("details",{className:"chat-steps",open:!0,children:[i.jsxs("summary",{children:["Skill draft: ",B.draft.name]}),i.jsx(O_,{draft:B.draft,onAccept:Tl,onReject:Vt,onEdit:td})]}):null,B.role==="assistant"&&B.plan?i.jsxs("details",{className:"chat-steps",open:!0,children:[i.jsxs("summary",{children:["Plan: ",B.plan.goal]}),i.jsx(P_,{plan:B.plan})]}):null,B.role==="assistant"&&B.refused?i.jsx("div",{className:"chat-refused-line",children:"โ›” This turn did not run โ€” the isolation it asked for could not be made. Nothing was written, and the reason is above."}):null,B.role==="assistant"&&B.worktree?i.jsx(sye,{worktree:B.worktree}):null,B.role==="assistant"&&B.resume?i.jsx(oye,{resume:B.resume}):null,B.role==="assistant"&&B.findings&&B.findings.length>0?i.jsx(M_,{findings:B.findings}):null,B.role==="assistant"&&B.tools&&B.tools.length>0?i.jsxs("details",{className:"chat-steps",open:!0,children:[i.jsxs("summary",{children:[B.tools.length," tool call",B.tools.length===1?"":"s"]}),i.jsx(R_,{tools:B.tools})]}):null,B.role==="assistant"&&B.steps&&B.steps.length>0?i.jsxs("details",{className:"chat-steps",children:[i.jsxs("summary",{children:[B.steps.length," step",B.steps.length===1?"":"s"]}),i.jsx("div",{className:"chat-step-line",children:B.steps.map((ee,ke)=>i.jsx("div",{children:ee.trim()},ke))})]}):null]},te)),o?i.jsxs("div",{className:"chat-bubble chat-assistant",children:[i.jsx("div",{className:"chat-bubble-role",children:"๐Ÿค– Agent"}),T?i.jsx(P_,{plan:T}):null,R?i.jsx(cc,{diff:R}):null,h&&o?i.jsx("div",{className:"chat-resume-line",children:"๐ŸŒฟ this turn is running in its own git worktree โ€” the diff arrives with the answer"}):null,y&&o?i.jsx("div",{className:"chat-resume-line",children:"โ†ฉ๏ธ this turn is replaying the recorded steps of this ask that are unchanged โ€” the count arrives with the answer"}):null,z.length>0?i.jsx(M_,{findings:z}):null,L?i.jsx(O_,{draft:L,onAccept:Tl,onReject:Vt,onEdit:td}):null,O.map(B=>i.jsx(nye,{request:B,onSave:dm},B.skillName)),A.map((B,te)=>i.jsx(rye,{result:B},`${B.skillName}-${te}`)),i.jsx(R_,{tools:j,live:!0}),ie?i.jsx("div",{className:"chat-bubble-text chat-streaming",children:i.jsx(N_,{text:ie})}):null,i.jsx("div",{className:"chat-working",children:x.length>0?i.jsx("span",{className:"chat-working-lines",children:x.map((B,te)=>i.jsx("div",{className:"chat-step-line",children:B.trim()},te))}):i.jsxs(i.Fragment,{children:["๐Ÿ’ญ thinkingโ€ฆ ",i.jsx("span",{className:"chat-dots"})]})})]}):null]}),c?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:c}):null,d?i.jsx("div",{className:`admin-row-msg${d.kind==="err"?" admin-row-msg-err":""}`,children:d.text}):null,Ne&&!o?i.jsxs("div",{className:"chat-retry-row",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void Bt(Ne),children:"โ†ป Retry"}),i.jsx("span",{className:"admin-hint",children:"Re-send the last message โ€” the turn failed."})]}):null,D&&!o?i.jsx("div",{className:"chat-resolve-card",children:(Bs=D.top)!=null&&Bs.ambiguous&&((zs=D.top.options)!=null&&zs.length)?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"chat-resolve-head",children:[i.jsx("strong",{children:"๐Ÿค” Which do you mean?"}),' โ€” "',D.ask,'" maps to more than one action.']}),i.jsx("div",{className:"chat-resolve-options",children:D.top.options.map(B=>i.jsxs("button",{className:"chat-chip",type:"button",onClick:()=>void Bt(B.command),children:[B.summary," โ€” ",i.jsx("code",{children:B.command})]},B.command))}),i.jsx("div",{className:"chat-resolve-foot",children:i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{P(null)},children:"โœ• Not that โ€” ask the agent"})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"chat-resolve-head",children:[i.jsx("strong",{children:"โšก Run this command?"}),' โ€” "',D.ask,'"']}),i.jsx("div",{className:"chat-resolve-cmd",children:i.jsx("code",{children:(Rl=D.top)==null?void 0:Rl.command})}),(ad=D.top)!=null&&ad.confirmation?i.jsx("div",{className:"admin-hint",children:"โš  This changes running services/state."}):null,i.jsxs("div",{className:"chat-resolve-foot",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void fm(D.ask),children:"โ–ถ Run"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>Mi(D.ask),children:"โœ• No โ€” ask the agent"})]})]})}):null,Dt?i.jsxs("div",{className:"chat-resolve-card chat-question-card",children:[i.jsx("div",{className:"chat-resolve-head",children:i.jsxs("strong",{children:["๐Ÿค” ",Dt.question]})}),i.jsx("div",{className:"chat-resolve-options",children:Dt.choices.map((B,te)=>i.jsxs("button",{type:"button",className:`chat-chip${Ri.has(te)?" chat-chip-selected":""}`,onClick:()=>rd(te),children:[B.label,B.description?i.jsxs("span",{className:"admin-hint",children:[" โ€” ",B.description]}):null]},`${B.label}-${te}`))}),i.jsxs("div",{className:"chat-resolve-foot",children:[i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:Ds,children:Dt.multiSelect?"Submit":"Choose"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:pm,children:"Skip โ€” best judgment"})]})]}):null,Ol.length>0&&!o?i.jsxs("div",{className:"chat-followups",children:[i.jsx("span",{className:"admin-hint",children:"Next steps:"}),Ol.map((B,te)=>i.jsx("button",{className:"chat-chip",type:"button",onClick:()=>void Bt(B.prompt),children:B.label||B.prompt},te))]}):null,i.jsxs("form",{className:`chat-composer${un?" chat-composer-drag":""}`,onSubmit:B=>{B.preventDefault(),Bt(a)},onDragOver:B=>{B.preventDefault(),Ot(!0)},onDragLeave:()=>Ot(!1),onDrop:B=>{var ee;B.preventDefault(),Ot(!1);const te=Array.from(((ee=B.dataTransfer)==null?void 0:ee.files)??[]);for(const ke of te.slice(0,10))Ms(ke)},children:[xe?i.jsxs("div",{className:"chat-paste-offer",children:[i.jsxs("span",{className:"admin-hint",children:["๐Ÿ“„ You pasted ",mt(xe.text.length)," characters. Attach it as a file instead?"]}),i.jsx("button",{type:"button",className:"chat-chip",onClick:Ju,children:"Attach as text"}),i.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>{Ge(null),kn.current=null},children:"Keep inline"})]}):null,ae.length>0?i.jsx("div",{className:"chat-attach-row",children:ae.map((B,te)=>i.jsxs("span",{className:"chat-attach-chip",title:B.encoding==="base64"?`${B.name} (${mt(B.content.length)} base64 chars โ€” read on the server)`:`${B.name} (${mt(B.content.length)} chars)`,children:["๐Ÿ“Ž ",B.name,i.jsx("span",{className:"admin-hint",children:B.encoding==="base64"?`${Math.round(B.content.length*3/4096)} KB`:`${mt(B.content.length)}c`}),i.jsx("button",{type:"button",className:"chat-mini-action",onClick:()=>Kn(te),children:"โœ•"})]},`${B.name}-${te}`))}):null,i.jsxs("div",{className:"chat-input-row",children:[i.jsx("input",{ref:Hn,type:"file",accept:".pdf,.docx,.xlsx,.pptx,.txt,.md,.markdown,.text,.log,.csv,.tsv,.json,.xml,.yaml,.yml,.html,.htm,text/*",style:{display:"none"},onChange:B=>{var ee;const te=(ee=B.target.files)==null?void 0:ee[0];te&&Ms(te),B.target.value=""}}),i.jsx("button",{type:"button",className:"chat-attach-btn",title:"Attach a file (up to 300 KB): PDF, DOCX, XLSX, PPTX or text โ€” documents are read on the server",disabled:o||ae.length>=10,onClick:()=>{var B;return(B=Hn.current)==null?void 0:B.click()},children:"๐Ÿ“Ž"}),i.jsx("button",{type:"button",className:"chat-attach-btn","aria-label":"Download support bundle",title:"Download a support bundle for this chat: the session debug log (which backend served each turn) plus the conversation. Needs NUVIRA_DEBUG_LOG=1 in the dashboard process.",onClick:()=>void qr(),children:"๐Ÿž"}),i.jsxs("button",{type:"button",className:`chat-attach-btn${h?" chat-attach-btn-on":""}`,"aria-label":"Run turns in an isolated git worktree","aria-pressed":h,title:h?"Turns run in their own git worktree and report the diff โ€” click to run in the project tree again":"Run turns in their own git worktree of the attached project, and report the diff against the base commit. Refuses rather than running in your tree when the directory cannot be isolated. Needs an attached project (or the server's own git working directory).",onClick:()=>{p(B=>!B),f(null)},children:["๐ŸŒฟ",h?" isolated":" isolate"]}),i.jsxs("button",{type:"button",className:`chat-attach-btn${y?" chat-attach-btn-on":""}`,"aria-label":"Replay this ask's recorded steps instead of paying for them again","aria-pressed":y,title:y?"Recorded steps whose input is unchanged are replayed instead of paid for โ€” click to run fresh again":"Replay the steps of an earlier run of this same ask whose input is unchanged, instead of paying for them again. The record is keyed by the ask and the directory; name a checkpoint id below to resume a specific one. A step whose input CHANGED is paid for again.",onClick:()=>{v(B=>!B),f(null)},children:["โ†ฉ๏ธ",y?" resuming":" resume"]}),y?i.jsx("input",{className:"chat-resume-input",value:b,onChange:B=>w(B.target.value),placeholder:"checkpoint id (blank = this ask's record)",title:"Resume this specific checkpoint record. Blank resumes the record for this ask in this directory.","aria-label":"Checkpoint id to resume",disabled:o}):null,h?i.jsxs("button",{type:"button",className:`chat-attach-btn${g?" chat-attach-btn-on":""}`,"aria-pressed":g,title:g?"The worktree is KEPT after the turn so you can look inside it":"The worktree is measured and removed after each turn",onClick:()=>m(B=>!B),children:["๐Ÿ“Œ",g?" keep":" drop"]}):null,i.jsx("textarea",{className:"chat-input-box",value:a,onChange:B=>s(B.target.value),onPaste:Is,onKeyDown:B=>{B.key==="Enter"&&!B.shiftKey?(B.preventDefault(),Bt(a)):B.key==="ArrowUp"&&a===""&&Le.current&&(B.preventDefault(),s(Le.current))},placeholder:"Message the agentโ€ฆ (Enter to send ยท Shift+Enter for a new line ยท โ†‘ recalls last ยท ๐Ÿ“Ž attach a file or paste a large document)",disabled:o,maxLength:8e3,rows:1,autoFocus:!0}),o?i.jsx("button",{className:"admin-mini-btn chat-cancel-btn",type:"button",onClick:Ls,children:"โน Cancel"}):null,i.jsx("button",{className:"admin-refresh-btn",type:"submit",disabled:o||!a.trim()&&ae.length===0,children:o?"โณ Workingโ€ฆ":"โžค Send"})]})]}),i.jsxs("p",{className:"admin-hint",children:["Each message runs the full agent loop in the dashboard process (same engine as"," ",i.jsx("code",{children:'buff chat "<prompt>"'}),") โ€” the provider API keys must be configured in the dashboard process. Clarifications (",i.jsx("code",{children:"ask_user"}),") appear as a question card here โ€” choose an answer or skip (best judgment)."]})]})]})]}):i.jsx("div",{className:"admin-login-hint",children:i.jsx("p",{children:"Your role can view the dashboard but not chat (requires admin or operator)."})}):i.jsxs("div",{className:"admin-login-hint",children:[i.jsx("p",{children:"Log in (admin or operator) to chat with the agent. Configure the dashboard admin credential first if this is a fresh setup."}),(e==null?void 0:e.configured)===!1?i.jsxs("p",{className:"admin-hint",children:["Run ",i.jsx("code",{children:"buff dashboard"})," once, or set ",i.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_USER"})," / ",i.jsx("code",{children:"BUFF_DASHBOARD_ADMIN_PASSWORD"}),"."]}):null]})]})}const cye={running:"โณ running",done:"โœ… done",failed:"โŒ failed",cancelled:"โน cancelled",timeout:"โฐ timed out",error:"๐Ÿ’ฅ error"};function XI({presets:e,customPlaceholder:t,timeoutMs:n=3e5,hint:r}){const[a,s]=k.useState(null),[o,l]=k.useState(!1),[c,u]=k.useState(""),[d,f]=k.useState(""),[h,p]=k.useState(null),[g,m]=k.useState([]),y=k.useRef(null),v=k.useRef(null);k.useEffect(()=>{Q.fetchAdminAuthStatus().then(S=>{s(S?{authenticated:S.authenticated,role:S.role??null}:{authenticated:!1,role:null})})},[]),k.useEffect(()=>{var S,x;try{(x=(S=y.current)==null?void 0:S.scrollIntoView)==null||x.call(S,{block:"end"})}catch{}},[g]),k.useEffect(()=>()=>{var S;(S=v.current)==null||S.call(v)},[]);const b=(a==null?void 0:a.authenticated)===!0&&(a.role==="admin"||a.role==="operator"),w=k.useCallback(async(S,x)=>{var T;if(o)return;l(!0),u(""),m([]);const E=await Q.startTask(S,x??n);if(!E.ok||!E.task){u(E.error||"Could not start the command."),l(!1);return}const j=E.task;p(j);const C=await Q.getTask(j.id);C!=null&&C.task&&m(C.task.logs.map($=>({stream:$.stream,text:$.text}))),(T=v.current)==null||T.call(v),v.current=Q.subscribeTask(j.id,{onLog:$=>m(R=>[...R,{stream:$.stream,text:$.text}]),onStatus:$=>{p(R=>R&&{...R,status:$}),$!=="running"&&l(!1)}})},[o,n]),N=k.useCallback(async()=>{h&&await Q.cancelTask(h.id)},[h]);return i.jsxs("div",{className:"ops-console",children:[a!=null&&a.authenticated?b?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"ops-presets",children:e.map(S=>i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void w(S.args,S.timeoutMs),disabled:o,children:S.label},S.label))}),i.jsxs("div",{className:"ops-custom-row",children:[i.jsx("input",{type:"text",value:d,onChange:S=>f(S.target.value),placeholder:t,disabled:o,maxLength:160}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void w(d.trim().split(/\s+/)),disabled:o||!d.trim(),children:"Run"})]}),r?i.jsx("p",{className:"admin-hint",children:r}):null]}):i.jsx("div",{className:"admin-login-hint",children:"Your role can view but not run commands (requires admin or operator)."}):i.jsx("div",{className:"admin-login-hint",children:"Log in (admin or operator) to run commands."}),c?i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:c}):null,h?i.jsxs("div",{className:"ops-console-box",children:[i.jsxs("div",{className:"ops-console-head",children:[i.jsxs("span",{children:[h.command," ยท ",i.jsx("span",{className:h.status==="running"?"task-status-running":"",children:cye[h.status]})]}),h.status==="running"?i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void N(),children:"โน Cancel"}):null]}),i.jsxs("pre",{className:"ops-console",role:"log",children:[g.length>0?g.map((S,x)=>i.jsx("div",{children:S.text},x)):i.jsx("div",{className:"admin-hint",children:"Waiting for outputโ€ฆ"}),i.jsx("div",{ref:y})]})]}):null]})}const uye=[{label:"โšก Quick smoke",args:["eval","run","--tasks","quick","--format","text"]},{label:"โฑ Medium suite",args:["eval","run","--tasks","medium","--format","text"]},{label:"๐Ÿข Slow suite",args:["eval","run","--tasks","slow","--format","text"]},{label:"๐Ÿ† M2B parity",args:["eval","run","--suite","m2b","--format","text"]},{label:"๐Ÿ“ฆ Full suite",args:["eval","run","--suite","full","--format","text"]}];function $_(e){return typeof e!="number"?"โ€”":`${Math.round(e*100)}%`}function dye(e){return new Date(e).toLocaleString()}function fye({data:e}){var n;const t=((n=e==null?void 0:e.evals)==null?void 0:n.runs)??[];return i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"๐Ÿ†",title:"Evals โ€” run buff eval from the GUI"}),i.jsx(XI,{presets:uye,customPlaceholder:"e.g. eval run --tasks my-task --provider groq --model llama",timeoutMs:9e5,hint:i.jsxs(i.Fragment,{children:["Runs the real ",i.jsx("code",{children:"buff eval run"})," as an isolated process โ€” same engine, same ledger, same results as the CLI. Long suites can take minutes; you can cancel mid-run."]})}),i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ“œ Past runs (auto-refreshes)"}),t.length>0?i.jsx("div",{className:"admin-table-wrapper",children:i.jsxs("table",{className:"admin-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Started"}),i.jsx("th",{children:"Provider"}),i.jsx("th",{children:"Model"}),i.jsx("th",{children:"Tasks"}),i.jsx("th",{children:"Pass"}),i.jsx("th",{children:"Completion"}),i.jsx("th",{children:"Composite"}),i.jsx("th",{children:"Cost"})]})}),i.jsx("tbody",{children:t.map(r=>i.jsxs("tr",{children:[i.jsx("td",{children:dye(r.startedAt)}),i.jsx("td",{className:"admin-provider-type",children:r.provider}),i.jsx("td",{children:r.model}),i.jsx("td",{children:r.summary.totalTasks}),i.jsxs("td",{children:[r.summary.tasksPassed,"/",r.summary.totalTasks]}),i.jsx("td",{children:$_(r.summary.completionRate)}),i.jsx("td",{children:$_(r.summary.avgCompositeScore)}),i.jsxs("td",{children:["$",(r.summary.totalCostUsd??0).toFixed(4)]})]},r.id))})]})}):i.jsx("div",{className:"empty-state",children:"No eval runs yet โ€” start one above (or `buff eval run` from the CLI)."})]})}const hye=[{label:"๐ŸŒ Gateway status",args:["gateway","status"]},{label:"๐Ÿ“ฎ Delivery ledger",args:["gateway","delivery"]},{label:"โ–ถ๏ธ Start gateway (foreground)",args:["gateway","start","--no-events"],timeoutMs:0},{label:"โฐ Cron jobs",args:["admin","cron","list"]}];function pye(){return i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"๐ŸŒ",title:"Gateway ops โ€” run buff gateway from the GUI"}),i.jsx(XI,{presets:hye,customPlaceholder:"e.g. admin cron run nightly or gateway alias add ops email:team@example.com",timeoutMs:3e5,hint:i.jsxs(i.Fragment,{children:["Each command runs as the real CLI in an isolated process (the P1 task runner) โ€” the same engine as your terminal. ",i.jsx("code",{children:"gateway start"})," runs in the foreground ",i.jsx("strong",{children:"with no timeout"}),": it keeps running even after you switch tabs (the process lives on the dashboard server, not the page) and streams platform events until you press ",i.jsx("strong",{children:"Cancel"}),". The delivery ledger also has its own view in"," ",i.jsx("strong",{children:"Agent Hub โ†’ Channels"}),"."]})})]})}const Yg={telegram:{icon:"โœˆ๏ธ",category:"Chat",steps:["Open Telegram and search for @BotFather","Send /newbot and follow the prompts",'Give your bot a name (e.g. "My Agent Bot")','Give your bot a username ending in "bot"',"BotFather gives you a token โ€” paste it in Step 2","Open your bot in Telegram and send /start"],testTarget:"telegram:"},discord:{icon:"๐ŸŽฎ",category:"Chat",steps:["Go to discord.com/developers/applications",'Click "New Application" and give it a name','Go to Bot tab and click "Add Bot"',"Copy the bot token",'Enable "Message Content Intent"',"Invite bot to your server (OAuth2 URL generator)"],testTarget:"discord:"},slack:{icon:"๐Ÿ’ฌ",category:"Chat",steps:["Go to api.slack.com/apps","Create New App from scratch","Add Bot Token Scopes: chat:write, im:read, im:write","Install to workspace","Copy the Bot User OAuth Token (xoxb-...)"],testTarget:"slack:"},whatsapp:{icon:"๐Ÿ“ฑ",category:"Chat",steps:["Run: buff whatsapp pair (or from Gateway tab)","Scan the QR code with WhatsApp","Pairing completes automatically"],testTarget:""},whatsapp_cloud:{icon:"โ˜๏ธ",category:"Chat",steps:["Go to developers.facebook.com","Set up WhatsApp Cloud API","Copy token + Phone ID"],testTarget:"whatsapp_cloud:"},email:{icon:"๐Ÿ“ง",category:"Chat",steps:["Get SMTP credentials (Gmail, SendGrid, etc.)","For Gmail: use App Password at smtp.gmail.com:587","Paste SMTP host + user below"],testTarget:""},signal:{icon:"๐Ÿ”’",category:"Chat",steps:["Run signal-cli-rest-api Docker container","Register a Signal account","Paste account number below"],testTarget:""},dingtalk:{icon:"๐Ÿ””",category:"Webhooks",steps:["Open DingTalk and create a group","Add custom robot and copy webhook URL","Paste URL below"],testTarget:""},feishu:{icon:"๐Ÿฆ",category:"Webhooks",steps:["Open Feishu and create a bot","Copy webhook URL and paste below"],testTarget:""},wecom:{icon:"๐Ÿข",category:"Webhooks",steps:["Open WeCom and create a group bot","Copy webhook URL and paste below"],testTarget:""},mattermost:{icon:"๐Ÿ“‹",category:"Webhooks",steps:["Open Mattermost, go to Integrations","Create incoming webhook and copy URL"],testTarget:""},matrix:{icon:"๐Ÿ”—",category:"Chat",steps:["Get your Matrix homeserver URL","Create a bot user and get access token","Paste URL + token below"],testTarget:""},webhook:{icon:"๐Ÿช",category:"Webhooks",steps:["Enter your webhook URL","The agent sends outbound webhooks to this URL"],testTarget:""},bluebubbles:{icon:"๐Ÿ’™",category:"Chat",steps:["Set up BlueBubbles server","Copy server URL + password"],testTarget:""},ntfy:{icon:"๐Ÿ“ข",category:"Notifications",steps:["Choose an ntfy topic (or use ntfy.sh)","Paste the topic below"],testTarget:""},teams:{icon:"๐Ÿ‘ฅ",category:"Webhooks",steps:["Open Microsoft Teams, go to channel","Connectors, Incoming Webhook, create","Copy webhook URL"],testTarget:""},google_chat:{icon:"๐Ÿ’ฌ",category:"Webhooks",steps:["Open Google Chat, space settings","Create webhook and copy URL"],testTarget:""},weixin:{icon:"๐Ÿ”ด",category:"Chat",steps:["Get Weixin iLink bot token","Paste token below"],testTarget:""},sms:{icon:"๐Ÿ“ฒ",category:"Chat",steps:["Get Twilio account SID + auth token","Register a phone number","Paste credentials below"],testTarget:""},irc:{icon:"๐Ÿ’ป",category:"Chat",steps:["Choose an IRC server (e.g. irc.libera.chat)","Set nickname + channel and paste below"],testTarget:""},simplex:{icon:"๐Ÿ“จ",category:"Chat",steps:["Run local simplex-chat daemon","Paste WebSocket URL (ws://127.0.0.1:5225)"],testTarget:""},homeassistant:{icon:"๐Ÿ ",category:"IoT",steps:["Open Home Assistant Profile","Create long-lived access token and paste below"],testTarget:""}};function mye(){const[e,t]=k.useState(null),[n,r]=k.useState("all"),[a,s]=k.useState(null),[o,l]=k.useState(0),[c,u]=k.useState({}),[d,f]=k.useState(!1),[h,p]=k.useState(null),[g,m]=k.useState({status:"idle"}),[y,v]=k.useState(""),[b,w]=k.useState("Hello from agent-nuvira!"),[N,S]=k.useState(!1),[x,E]=k.useState(null),j=k.useRef(!0),C=k.useCallback(async()=>{const O=await Q.getPlatformConfigs();j.current&&t(O)},[]);k.useEffect(()=>(C(),()=>{j.current=!1}),[C]);const T=O=>{s(O),l(0),u(Object.fromEntries(O.envVars.map(A=>[A.varName,A.value]))),p(null),m({status:"idle"});const U=Yg[O.platform];v((U==null?void 0:U.testTarget)??""),w("Hello from agent-nuvira!"),E(null)},$=async()=>{if(!a)return;m({status:"checking"});const O=await Q.verifyPlatformConfig(a.platform,c);O.ok?(m({status:"ok",info:O.info}),p({kind:"ok",text:"Verified! "+(O.info?"Connected as "+O.info+".":"Token is valid.")})):(m({status:"err",error:O.error}),p({kind:"err",text:O.error||"Verification failed."}))},R=async()=>{if(!a)return;f(!0),p(null);const O=await Q.setPlatformConfig(a.platform,c);f(!1),O.ok?(p({kind:"ok",text:"Token saved! Verifying..."}),C(),l(2),$()):p({kind:"err",text:O.error||"Save failed."})},I=async()=>{if(!a||!y)return;S(!0),E(null);const O=await Q.sendChannelMessage(y,b);S(!1),O.ok?E({kind:"ok",text:"Message sent via "+O.platform+"! Check your "+a.label+" app."}):E({kind:"err",text:O.error||"Send failed. Make sure the gateway is running (Gateway tab)."})};if(e===null)return i.jsx("div",{className:"empty-state",children:"Loading platforms..."});const L=e.filter(O=>O.configured).length,F=e.filter(O=>n==="configured"?O.configured:n==="unconfigured"?!O.configured:!0),z=a?Yg[a.platform]:null;function M(O){return o===O?"wizard-step-dot active":"wizard-step-dot"}return i.jsxs("div",{className:"panel",children:[i.jsx($e,{icon:"๐ŸŒ",title:"Platforms โ€” Messaging Gateway Onboarding"}),i.jsxs("div",{className:"platforms-summary",children:[i.jsxs("div",{className:"platforms-summary-stat",children:[i.jsx("span",{className:"platforms-summary-number",children:L}),i.jsx("span",{className:"platforms-summary-label",children:"configured"})]}),i.jsxs("div",{className:"platforms-summary-stat",children:[i.jsx("span",{className:"platforms-summary-number",children:e.length-L}),i.jsx("span",{className:"platforms-summary-label",children:"available"})]}),i.jsx("div",{className:"platforms-summary-filters",children:["all","configured","unconfigured"].map(O=>i.jsx("button",{type:"button",className:n===O?"platforms-filter-btn active":"platforms-filter-btn",onClick:()=>r(O),children:O==="all"?"All":O==="configured"?"Configured":"Not set up"},O))})]}),i.jsx("div",{className:"platforms-grid",children:F.map(O=>{const U=Yg[O.platform];return i.jsxs("div",{className:O.configured?"platform-card configured":"platform-card",children:[i.jsxs("div",{className:"platform-card-head",children:[i.jsx("span",{className:"platform-card-icon",children:(U==null?void 0:U.icon)??"๐Ÿ”Œ"}),i.jsxs("div",{className:"platform-card-info",children:[i.jsx("span",{className:"platform-card-name",children:O.label}),i.jsx("span",{className:"platform-card-category",children:(U==null?void 0:U.category)??"Platform"})]}),i.jsx("span",{className:O.configured?"status-dot connected":"status-dot reconnecting"})]}),i.jsx("div",{className:"platform-card-vars",children:O.envVars.map(A=>i.jsxs("span",{className:A.set?"platform-var-chip set":"platform-var-chip",children:[A.varName," ",A.set?"done":"--"]},A.varName))}),i.jsxs("div",{className:"platform-card-actions",children:[O.configured?i.jsx("span",{className:"platform-card-badge",children:"Active"}):i.jsx("button",{type:"button",className:"wizard-start-btn",onClick:()=>T(O),children:"Setup"}),O.setupUrl?i.jsx("a",{href:O.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"Docs"}):null]}),!O.configured&&O.setupHint?i.jsx("div",{className:"platform-card-hint",children:O.setupHint}):null]},O.platform)})}),i.jsxs("div",{className:"platforms-cli-hint",children:[i.jsx("span",{className:"admin-hint",children:"Prefer the terminal? "}),i.jsx("code",{children:"buff gateway setup telegram"}),i.jsx("span",{className:"admin-hint",children:" โ€” same wizard from your CLI"})]}),a&&z?i.jsx("div",{className:"wizard-overlay",onClick:()=>s(null),children:i.jsxs("div",{className:"wizard-modal",onClick:O=>O.stopPropagation(),children:[i.jsxs("div",{className:"wizard-header",children:[i.jsx("span",{className:"wizard-icon",children:z.icon}),i.jsxs("span",{className:"wizard-title",children:["Getting Started: ",a.label]}),i.jsxs("div",{className:"wizard-steps-indicator",children:[i.jsx("span",{className:M(0),children:"1"}),i.jsx("span",{className:M(1),children:"2"}),i.jsx("span",{className:M(2),children:"3"})]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>s(null),children:"X"})]}),i.jsxs("div",{className:"wizard-body",children:[o===0&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"wizard-section-title",children:["Step 1: Create your bot on ",a.label]}),i.jsx("ol",{className:"wizard-steps",children:z.steps.map((O,U)=>i.jsx("li",{children:O},U))}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>l(1),children:"I have my token โ€” Step 2"}),a.setupUrl?i.jsx("a",{href:a.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn platform-docs-link",children:"Open docs"}):null]})]}),o===1&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"Step 2: Paste your token"}),a.envVars.map(O=>i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:O.prompt}),i.jsx("input",{type:O.secret?"password":"text",value:c[O.varName]??"",onChange:U=>u(A=>({...A,[O.varName]:U.target.value})),placeholder:O.secret?"paste your token here":"value",autoComplete:"off",spellCheck:!1,autoFocus:!0})]},O.varName)),h?i.jsx("div",{className:h.kind==="ok"?"admin-row-msg":"admin-row-msg admin-row-msg-err",children:h.text}):null,i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(0),children:"Back"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void R(),disabled:d,children:d?"Saving...":"Save & Verify"})]})]}),o===2&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"wizard-section-title",children:"Step 3: Verify and test"}),g.status==="checking"&&i.jsx("div",{className:"wizard-verify-status",children:"Verifying token..."}),g.status==="ok"&&i.jsxs("div",{className:"wizard-verify-status ok",children:["Connected as ",g.info]}),g.status==="err"&&i.jsx("div",{className:"wizard-verify-status err",children:g.error}),g.status==="idle"&&(h==null?void 0:h.kind)==="ok"&&i.jsx("div",{className:"wizard-verify-status ok",children:h.text}),y&&i.jsxs("div",{className:"wizard-test-section",children:[i.jsx("p",{className:"wizard-section-title",children:"Send a test message:"}),i.jsx("div",{className:"wizard-test-row",children:i.jsx("input",{className:"wizard-test-input",value:y,onChange:O=>v(O.target.value),placeholder:"telegram:YOUR_CHAT_ID"})}),i.jsxs("div",{className:"wizard-test-row",children:[i.jsx("input",{className:"wizard-test-input",value:b,onChange:O=>w(O.target.value),placeholder:"Hello from agent-nuvira!"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void I(),disabled:N||!y,children:N?"Sending...":"Send test"})]}),x?i.jsx("div",{className:x.kind==="ok"?"admin-row-msg":"admin-row-msg admin-row-msg-err",children:x.text}):null]}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(1),children:"Edit token"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>s(null),children:"Done"})]}),!y&&i.jsxs("p",{className:"wizard-hint",children:["Token saved! Start the gateway from the Gateway tab, then send a message from your ",a.label," app."]})]})]})]})}):null]})}const gye=[{value:"us-east-1",label:"us-east-1 (N. Virginia) โ€” most models"},{value:"us-west-2",label:"us-west-2 (Oregon) โ€” most models"},{value:"eu-west-1",label:"eu-west-1 (Ireland) โ€” EU coverage"},{value:"ap-southeast-1",label:"ap-southeast-1 (Singapore)"},{value:"ap-northeast-1",label:"ap-northeast-1 (Tokyo)"}],L_=[{name:"Anthropic Claude",models:["claude-haiku-4.5","claude-sonnet-4.6","claude-fable-5","claude-opus-4.6"],checked:!0},{name:"Meta Llama",models:["llama3-1-8b","llama3-1-70b","llama3-3-70b","llama4-scout","llama4-maverick"],checked:!0},{name:"Mistral AI",models:["mistral-large-3","devstral-2","ministral-3"],checked:!1},{name:"DeepSeek",models:["deepseek-v3.2","deepseek-r1"],checked:!1},{name:"Amazon Nova",models:["nova-pro","nova-lite"],checked:!1},{name:"OpenAI on Bedrock",models:["gpt-5.6-terra","gpt-oss-120b"],checked:!1},{name:"Qwen",models:["qwen3-coder-next","qwen3-32b"],checked:!1},{name:"Google Gemma",models:["gemma-3-12b"],checked:!1},{name:"xAI",models:["grok-4.6"],checked:!1}];function vye({canWrite:e,sessionExpired:t}){const[n,r]=k.useState(null),[a,s]=k.useState(null),[o,l]=k.useState(!1),[c,u]=k.useState("overview"),d=k.useRef(!0),[f,h]=k.useState("bearer"),[p,g]=k.useState(""),[m,y]=k.useState(""),[v,b]=k.useState(""),[w,N]=k.useState("us-east-1"),[S,x]=k.useState(L_.filter(L=>L.checked).map(L=>L.name)),[E,j]=k.useState(!1),[C,T]=k.useState(null),$=k.useCallback(async()=>{const L=await Q.getBedrockStatus();d.current&&r(L)},[]);k.useEffect(()=>($(),()=>{d.current=!1}),[$]);const R=async()=>{l(!0),s(null);try{const L=await Q.probeBedrock((n==null?void 0:n.region)||"us-east-1");if(!d.current)return;L.ok&&L.models&&(s(L.models),u("test"))}catch{}finally{d.current&&l(!1)}},I=async()=>{j(!0),T(null);try{const L={BEDROCK_REGION:w};f==="bearer"&&p?L.AWS_BEARER_TOKEN=p:f==="iam"&&(m&&(L.AWS_ACCESS_KEY_ID=m),v&&(L.AWS_SECRET_ACCESS_KEY=v));const F=await Q.setupBedrock(L);if(!d.current)return;F.ok?(T({kind:"ok",text:"โœ… Configuration saved! Running connectivity testโ€ฆ"}),u("overview"),await $(),setTimeout(()=>void R(),500)):T({kind:"err",text:F.error||"Save failed"})}catch{d.current&&T({kind:"err",text:"Could not reach the dashboard server."})}finally{d.current&&j(!1)}};return n===null?i.jsx("div",{className:"empty-state",children:"Loading Bedrock statusโ€ฆ"}):i.jsxs("div",{className:"bedrock-onboarding",children:[i.jsx($e,{icon:"๐ŸŸ ",title:"AWS Bedrock"}),i.jsxs("p",{className:"admin-subtitle",children:["Bedrock gives you access to Claude, Llama, Mistral, DeepSeek, and more โ€” all through a single AWS account. Unlike other providers, Bedrock requires a ",i.jsx("strong",{children:"region"}),", ",i.jsx("strong",{children:"AWS credentials"}),", and explicit ",i.jsx("strong",{children:"model access approval"}),"."]}),C?i.jsx("div",{className:`admin-row-msg${C.kind==="ok"?"":" admin-row-msg-err"}`,children:C.text}):null,i.jsxs("div",{className:"bedrock-status-bar",children:[i.jsxs("div",{className:"bedrock-status-item",children:[i.jsx("span",{className:`status-dot ${n.configured?"connected":"reconnecting"}`}),i.jsx("span",{children:n.configured?"Configured":"Not configured"})]}),i.jsxs("div",{className:"bedrock-status-item",children:[i.jsx("span",{className:"bedrock-status-label",children:"Region:"}),i.jsx("code",{children:n.region})]}),i.jsxs("div",{className:"bedrock-status-item",children:[i.jsx("span",{className:"bedrock-status-label",children:"Auth:"}),i.jsx("code",{children:n.authMethod==="bearer"?"API Key":n.authMethod==="iam"?"IAM":"None"})]}),i.jsxs("div",{className:"bedrock-status-actions",children:[e?i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>u(c==="setup"?"overview":"setup"),children:c==="setup"?"โœ• Cancel":"โš™ Setup Wizard"}):null,n.configured?i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void R(),disabled:o,children:o?"โณ Probingโ€ฆ":"๐Ÿ” Test Models"}):null]})]}),c==="setup"&&i.jsxs("div",{className:"bedrock-setup-wizard",children:[i.jsx("h2",{className:"section-subtitle",children:"๐Ÿš€ Bedrock Setup Wizard"}),i.jsxs("div",{className:"bedrock-wizard-step",children:[i.jsx("h4",{children:"Step 1: Authentication"}),i.jsxs("div",{className:"bedrock-auth-options",children:[i.jsxs("label",{className:`bedrock-auth-option ${f==="bearer"?"selected":""}`,children:[i.jsx("input",{type:"radio",name:"authMethod",checked:f==="bearer",onChange:()=>h("bearer")}),i.jsxs("div",{children:[i.jsx("strong",{children:"Bedrock API Key"}),i.jsx("span",{children:"Simpler โ€” get from Bedrock โ†’ Settings โ†’ API keys"})]})]}),i.jsxs("label",{className:`bedrock-auth-option ${f==="iam"?"selected":""}`,children:[i.jsx("input",{type:"radio",name:"authMethod",checked:f==="iam",onChange:()=>h("iam")}),i.jsxs("div",{children:[i.jsx("strong",{children:"IAM Credentials"}),i.jsx("span",{children:"Full AWS SDK auth โ€” AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY"})]})]})]}),f==="bearer"?i.jsxs("div",{className:"bedrock-wizard-fields",children:[i.jsxs("div",{className:"bedrock-setup-hint",children:[i.jsx("strong",{children:"How to get a Bedrock API key:"}),i.jsxs("ol",{children:[i.jsxs("li",{children:["Open ",i.jsx("a",{href:"https://console.aws.amazon.com/bedrock/",target:"_blank",rel:"noopener noreferrer",children:"AWS Bedrock Console"})]}),i.jsxs("li",{children:["Go to ",i.jsx("strong",{children:"Settings"})," โ†’ ",i.jsx("strong",{children:"API keys"})]}),i.jsx("li",{children:"Create a new key and paste it below"})]})]}),i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"Bedrock API Key (Bearer token)"}),i.jsx("input",{type:"password",value:p,onChange:L=>g(L.target.value),placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข",autoComplete:"off",spellCheck:!1})]})]}):i.jsxs("div",{className:"bedrock-wizard-fields",children:[i.jsxs("div",{className:"bedrock-setup-hint",children:[i.jsx("strong",{children:"IAM credentials"})," give full AWS SDK access. Create an IAM user with Bedrock permissions."]}),i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"AWS_ACCESS_KEY_ID"}),i.jsx("input",{type:"text",value:m,onChange:L=>y(L.target.value),placeholder:"AKIA...",autoComplete:"off",spellCheck:!1})]}),i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"AWS_SECRET_ACCESS_KEY"}),i.jsx("input",{type:"password",value:v,onChange:L=>b(L.target.value),placeholder:"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข",autoComplete:"off",spellCheck:!1})]})]})]}),i.jsxs("div",{className:"bedrock-wizard-step",children:[i.jsx("h4",{children:"Step 2: AWS Region"}),i.jsxs("p",{className:"admin-hint",children:["Models vary by region. ",i.jsx("strong",{children:"us-east-1"})," and ",i.jsx("strong",{children:"us-west-2"})," have the most models. โš ๏ธ Do NOT use eu-north-1 unless models are explicitly enabled there."]}),i.jsx("select",{className:"bedrock-region-select",value:w,onChange:L=>N(L.target.value),children:gye.map(L=>i.jsx("option",{value:L.value,children:L.label},L.value))})]}),i.jsxs("div",{className:"bedrock-wizard-step",children:[i.jsx("h4",{children:"Step 3: Model Access"}),i.jsx("p",{className:"admin-hint",children:"Bedrock requires you to request access for each model family."}),i.jsx("div",{className:"bedrock-model-access-hint",children:i.jsx("a",{href:`https://console.aws.amazon.com/bedrock/home?region=${w}#/modelaccess`,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn",children:"๐Ÿ“– Open Model Access in AWS Console"})}),i.jsx("div",{className:"bedrock-family-grid",children:L_.map(L=>i.jsxs("label",{className:`bedrock-family-card ${S.includes(L.name)?"selected":""}`,children:[i.jsx("input",{type:"checkbox",checked:S.includes(L.name),onChange:F=>{F.target.checked?x(z=>[...z,L.name]):x(z=>z.filter(M=>M!==L.name))}}),i.jsxs("div",{children:[i.jsx("strong",{children:L.name}),i.jsxs("span",{children:[L.models.length," model(s)"]})]})]},L.name))}),i.jsx("p",{className:"admin-hint",style:{marginTop:8},children:"In the AWS Console, select the families above and submit. Approval is usually instant for Anthropic and Meta models."})]}),i.jsxs("div",{className:"bedrock-wizard-actions",children:[i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void I(),disabled:E||f==="bearer"&&!p||f==="iam"&&(!m||!v),children:E?"โณ Savingโ€ฆ":"๐Ÿ’พ Save & Test"}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>u("overview"),children:"Cancel"})]})]}),c==="test"&&a&&i.jsxs("div",{className:"bedrock-probe-results",children:[i.jsxs("h2",{className:"section-subtitle",children:["๐Ÿ” Model Probe Results (",n.region,")"]}),i.jsx("div",{className:"bedrock-probe-grid",children:a.map(L=>i.jsxs("div",{className:`bedrock-probe-card bedrock-probe-${L.status}`,children:[i.jsx("span",{className:"bedrock-probe-icon",children:L.status==="accessible"?"โœ…":L.status==="permission-denied"?"๐Ÿ”’":L.status==="not-found"?"โšซ":"โŒ"}),i.jsx("span",{className:"bedrock-probe-id",children:L.modelId}),i.jsx("span",{className:"bedrock-probe-status",children:L.status==="accessible"?"Ready":L.status==="permission-denied"?`Need access (HTTP ${L.httpStatus})`:L.status==="not-found"?"Not in this region":"Error"})]},L.modelId))}),a.some(L=>L.status==="permission-denied")&&i.jsxs("div",{className:"bedrock-probe-action",children:[i.jsxs("p",{children:["Some models exist in ",n.region," but access is not approved."]}),i.jsx("a",{href:`https://console.aws.amazon.com/bedrock/home?region=${n.region}#/modelaccess`,target:"_blank",rel:"noopener noreferrer",className:"admin-mini-btn",children:"๐Ÿ”“ Request Model Access in AWS Console โ†’"})]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>u("overview"),style:{marginTop:12},children:"โ† Back"})]}),!n.configured&&c==="overview"&&i.jsxs("div",{className:"bedrock-getting-started",children:[i.jsx("h2",{className:"section-subtitle",children:"๐Ÿ“‹ Getting Started with Bedrock"}),i.jsxs("div",{className:"bedrock-steps",children:[i.jsxs("div",{className:"bedrock-step",children:[i.jsx("span",{className:"bedrock-step-num",children:"1"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Create an AWS account"})," (or use existing)",i.jsxs("span",{children:["New to AWS? Sign up at ",i.jsx("a",{href:"https://aws.amazon.com/",target:"_blank",rel:"noopener noreferrer",children:"aws.amazon.com"})]})]})]}),i.jsxs("div",{className:"bedrock-step",children:[i.jsx("span",{className:"bedrock-step-num",children:"2"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Get Bedrock API key"}),i.jsx("span",{children:"Bedrock โ†’ Settings โ†’ API keys โ†’ Create key"})]})]}),i.jsxs("div",{className:"bedrock-step",children:[i.jsx("span",{className:"bedrock-step-num",children:"3"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Request model access"}),i.jsx("span",{children:"Bedrock โ†’ Model access โ†’ Select Claude, Llama, etc. โ†’ Submit"})]})]}),i.jsxs("div",{className:"bedrock-step",children:[i.jsx("span",{className:"bedrock-step-num",children:"4"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Configure in this wizard"}),i.jsx("span",{children:'Click "Setup Wizard" above to enter your credentials'})]})]})]})]}),n.configured&&c==="overview"&&!a&&i.jsx("div",{className:"bedrock-quick-status",children:i.jsxs("p",{className:"admin-hint",children:["Bedrock is configured. Click ",i.jsx("strong",{children:"๐Ÿ” Test Models"})," to verify connectivity and discover which models are accessible in ",n.region,"."]})})]})}const Xg=["whatsapp","whatsapp_cloud","telegram","signal","slack","discord","email"];function yye(){const[e,t]=k.useState([]),[n,r]=k.useState(!0),[a,s]=k.useState("all"),[o,l]=k.useState(null),[c,u]=k.useState(""),[d,f]=k.useState(""),[h,p]=k.useState(null),[g,m]=k.useState({}),[y,v]=k.useState({}),[b,w]=k.useState({}),[N,S]=k.useState(null),[x,E]=k.useState(!1),[j,C]=k.useState(!1),[T,$]=k.useState(!1),[R,I]=k.useState(12e4),L=k.useCallback(async()=>{r(!0);const G=await Q.getContacts();G.ok&&G.contacts&&t(G.contacts);const Y=await Q.gatewayPolicies();if(Y.ok&&Y.policies){const ie={};for(const le of Xg){const X=Y.policies[le];X&&(ie[le]={...X.outboundSenders!==void 0?{outboundSenders:X.outboundSenders}:{},...X.requireApprovedTarget!==void 0?{requireApprovedTarget:X.requireApprovedTarget}:{}})}m(ie),v(ie)}C(Y.askUserWait===!0),$(Y.askUserWait===!0),typeof Y.askUserTimeoutMs=="number"&&I(Y.askUserTimeoutMs),r(!1)},[]);k.useEffect(()=>{L()},[L]);const F=e.filter(G=>a==="all"||G.status===a),z=async G=>{p(null);const Y=await Q.approveContact(G.platform,G.name);p(Y.ok?{kind:"ok",text:`โœ… ${G.name} approved.`}:{kind:"err",text:Y.error||"Failed."}),L()},M=async G=>{p(null);const Y=await Q.rejectContact(G.platform,G.name);p(Y.ok?{kind:"ok",text:`๐Ÿšซ ${G.name} rejected.`}:{kind:"err",text:Y.error||"Failed."}),L()},O=async G=>{p(null);const Y=await Q.deleteContact(G.platform,G.name);p(Y.ok?{kind:"ok",text:`๐Ÿ—‘๏ธ ${G.name} deleted.`}:{kind:"err",text:Y.error||"Failed."}),L()},U=async()=>{if(!o)return;p(null);const G=await Q.updateContact(o.platform,o.id,{name:c,phone:d});p(G.ok?{kind:"ok",text:`โœ… ${c} updated.`}:{kind:"err",text:G.error||"Failed."}),l(null),L()},A=G=>G==="approved"?i.jsx("span",{className:"contact-status-badge approved",children:"โœ… Approved"}):G==="pending"?i.jsx("span",{className:"contact-status-badge pending",children:"โณ Pending"}):i.jsx("span",{className:"contact-status-badge rejected",children:"๐Ÿšซ Rejected"}),Z=G=>({telegram:"โœˆ๏ธ",whatsapp:"๐Ÿ“ฑ",whatsapp_cloud:"๐Ÿ“ฑ",email:"๐Ÿ“ง",slack:"๐Ÿ’ฌ",discord:"๐ŸŽฎ"})[G]||"๐Ÿ”Œ",D=G=>G?new Date(G).toLocaleString():"โ€”",P=G=>{const Y=(b[G]??"").trim();Y&&(m(ie=>{var _e;const le={...ie[G]??{}},X=le.outboundSenders??((_e=y[G])==null?void 0:_e.outboundSenders)??[];return X.some(Ne=>Ne.toLowerCase()===Y.toLowerCase())||(le.outboundSenders=[...X,Y]),{...ie,[G]:le}}),w(ie=>({...ie,[G]:""})))},oe=(G,Y)=>{m(ie=>{var _e;const le={...ie[G]??{}},X=le.outboundSenders??((_e=y[G])==null?void 0:_e.outboundSenders)??[];return le.outboundSenders=X.filter(Ne=>Ne.toLowerCase()!==Y.toLowerCase()),{...ie,[G]:le}})},be=G=>{m(Y=>{const ie={...Y[G]??{}};return ie.requireApprovedTarget=ie.requireApprovedTarget!==!0,{...Y,[G]:ie}})},pe=G=>{m(Y=>{const ie={...Y[G]??{}};return delete ie.outboundSenders,{...Y,[G]:ie}})},Ce=async()=>{E(!0),S(null);const G={};for(const le of Xg){const X=g[le]??{},_e=y[le]??{};(JSON.stringify(X.outboundSenders??null)!==JSON.stringify(_e.outboundSenders??null)||!!X.requireApprovedTarget!=!!_e.requireApprovedTarget)&&(G[le]={...X.outboundSenders!==void 0?{outboundSenders:X.outboundSenders}:{outboundSenders:null},requireApprovedTarget:!!X.requireApprovedTarget})}const Y=j!==T;if(Object.keys(G).length===0&&!Y){E(!1),S({kind:"ok",text:"No changes to save."});return}const ie=await Q.saveGatewayPolicies(G,void 0,void 0,{wait:j,timeoutMs:R});ie.ok?(S({kind:"ok",text:"โœ… Send authority saved."}),L()):S({kind:"err",text:ie.error||"Failed to save send authority."}),E(!1)};return i.jsxs("div",{className:"panel contacts-page",children:[i.jsx($e,{icon:"๐Ÿ“‡",title:"Contacts โ€” Outbound Messaging Directory",description:"Manage who the bot can send messages to. Users auto-register on first Telegram message."}),h&&i.jsxs("div",{className:`admin-row-msg ${h.kind==="err"?"admin-row-msg-err":""}`,children:[h.text,i.jsx("button",{className:"admin-mini-btn",onClick:()=>p(null),children:"โœ•"})]}),i.jsxs("div",{className:"contacts-filters",children:[["all","approved","pending","rejected"].map(G=>i.jsx("button",{type:"button",className:a===G?"platforms-filter-btn active":"platforms-filter-btn",onClick:()=>s(G),children:G==="all"?`All (${e.length})`:G==="approved"?`โœ… Approved (${e.filter(Y=>Y.status==="approved").length})`:G==="pending"?`โณ Pending (${e.filter(Y=>Y.status==="pending").length})`:`๐Ÿšซ Rejected (${e.filter(Y=>Y.status==="rejected").length})`},G)),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void L(),children:"๐Ÿ”„ Refresh"})]}),n?i.jsx("div",{className:"empty-state",children:"Loading contacts..."}):F.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsxs("p",{children:["No contacts",a!=="all"?` with status "${a}"`:"","."]}),i.jsx("p",{className:"admin-hint",children:'Contacts auto-register when users message the bot on Telegram. They appear here as "Pending" until you approve them.'})]}):i.jsx("div",{className:"contacts-table-wrapper",children:i.jsxs("table",{className:"contacts-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Platform"}),i.jsx("th",{children:"Name"}),i.jsx("th",{children:"ID"}),i.jsx("th",{children:"Phone"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Registered"}),i.jsx("th",{children:"Actions"})]})}),i.jsx("tbody",{children:F.map(G=>i.jsxs("tr",{className:`contact-row status-${G.status}`,children:[i.jsxs("td",{children:[Z(G.platform)," ",G.platform]}),i.jsx("td",{className:"contact-name",children:G.name}),i.jsx("td",{className:"contact-id",children:i.jsx("code",{children:G.id})}),i.jsx("td",{className:"contact-phone",children:G.phone||"โ€”"}),i.jsx("td",{children:A(G.status)}),i.jsx("td",{className:"contact-date",children:D(G.registeredAt||G.addedAt)}),i.jsxs("td",{className:"contact-actions",children:[G.status!=="approved"&&i.jsx("button",{className:"admin-mini-btn contact-approve-btn",onClick:()=>void z(G),children:"โœ… Approve"}),G.status!=="rejected"&&i.jsx("button",{className:"admin-mini-btn contact-reject-btn",onClick:()=>void M(G),children:"๐Ÿšซ Reject"}),i.jsx("button",{className:"admin-mini-btn",onClick:()=>{l(G),u(G.name),f(G.phone||"")},children:"โœ๏ธ Edit"}),i.jsx("button",{className:"admin-mini-btn contact-delete-btn",onClick:()=>void O(G),children:"๐Ÿ—‘๏ธ"})]})]},`${G.platform}:${G.id}`))})]})}),i.jsxs("div",{className:"panel-header",style:{marginTop:28},children:[i.jsx("h2",{children:"๐Ÿ” Send authority โ€” who may message others"}),i.jsxs("p",{className:"admin-hint",children:["Controls who can ask the agent to send a message to ",i.jsx("strong",{children:"someone else"})," through the gateway (e.g. โ€œsend this poem to my brother on WhatsAppโ€). This is separate from a contactโ€™s approval status above, which only gates sending ",i.jsx("em",{children:"to"})," that person. Left empty, a platform ",i.jsx("strong",{children:"inherits"})," its allowed-users list (open). Add ",i.jsx("code",{children:"Allow-All"})," to allow everyone, or list specific senders to restrict it."]})]}),N&&i.jsxs("div",{className:`admin-row-msg ${N.kind==="err"?"admin-row-msg-err":""}`,children:[N.text,i.jsx("button",{className:"admin-mini-btn",onClick:()=>S(null),children:"โœ•"})]}),i.jsx("div",{className:"hub-permissions",children:Xg.map(G=>{const Y=g[G]??{},ie=Y.outboundSenders??[],le=Y.outboundSenders===void 0;return i.jsxs("div",{className:"hub-card",children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsxs("span",{className:"hub-chip",children:[Z(G)," ",G]}),le?i.jsx("span",{className:"hub-chip",children:"open"}):i.jsx("span",{className:"hub-chip",children:"restricted"})]}),i.jsx("div",{className:"hub-alias-list",children:le?i.jsx("span",{className:"admin-hint",children:"Open โ€” anyone who can trigger the agent may send to others."}):ie.length===0?i.jsx("span",{className:"admin-hint",children:"(empty โ€” nobody may send to others)"}):ie.map(X=>i.jsxs("div",{className:"hub-alias-row",children:[i.jsx("span",{className:"hub-chip",children:X}),i.jsx("button",{className:"admin-refresh-btn",disabled:x,onClick:()=>oe(G,X),children:"โœ•"})]},`sa-${G}-${X}`))}),i.jsxs("div",{className:"hub-send-form",children:[i.jsx("input",{type:"text",value:b[G]??"",onChange:X=>w(_e=>({..._e,[G]:X.target.value})),placeholder:"sender id, or Allow-All",disabled:x}),i.jsx("button",{className:"admin-refresh-btn",disabled:x||!(b[G]??"").trim(),onClick:()=>P(G),children:"+ Sender"}),le?null:i.jsx("button",{className:"admin-refresh-btn",disabled:x,onClick:()=>pe(G),children:"โ†บ Reset to open"})]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[i.jsx("input",{type:"checkbox",checked:!!Y.requireApprovedTarget,disabled:x,onChange:()=>be(G)}),i.jsx("span",{className:"admin-hint",children:"Require approved recipients"})]})]},`sa-${G}`)})}),i.jsxs("div",{className:"hub-card",style:{marginTop:16},children:[i.jsxs("div",{className:"hub-card-top",children:[i.jsx("span",{className:"hub-chip",children:"๐Ÿง  Clarifying questions"}),j?i.jsx("span",{className:"hub-chip",children:"wait for reply"}):i.jsx("span",{className:"hub-chip",children:"assume option 1"}),j!==T?i.jsx("span",{className:"hub-chip",children:"ยท unsaved"}):null]}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[i.jsx("input",{type:"checkbox",checked:j,disabled:x,onChange:()=>C(G=>!G)}),i.jsxs("span",{className:"admin-hint",children:["When the agent asks a question on a channel, ",i.jsx("strong",{children:"wait for the sender's reply"})," before acting. Off (default): the question is sent and the ",i.jsx("em",{children:"first"})," option is assumed immediately โ€” so a reply typed afterwards arrives too late to change anything."]})]}),j?i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:6},children:[i.jsx("span",{className:"admin-hint",children:"Reply window (seconds)"}),i.jsx("input",{type:"number",min:5,max:600,value:Math.round(R/1e3),disabled:x,onChange:G=>I(Math.max(5,Math.min(600,Number(G.target.value)||120))*1e3),style:{width:90}}),i.jsx("span",{className:"admin-hint",children:"then the first option is used, and the timeout is logged."})]}):null]}),i.jsx("div",{style:{marginTop:12},children:i.jsx("button",{className:"admin-refresh-btn",disabled:x,onClick:()=>void Ce(),children:"๐Ÿ’พ Save send authority"})}),o&&i.jsx("div",{className:"wizard-overlay",onClick:()=>l(null),children:i.jsxs("div",{className:"wizard-modal",onClick:G=>G.stopPropagation(),children:[i.jsxs("div",{className:"wizard-header",children:[i.jsx("span",{className:"wizard-icon",children:"โœ๏ธ"}),i.jsxs("span",{className:"wizard-title",children:["Edit Contact: ",o.name]}),i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(null),children:"โœ•"})]}),i.jsxs("div",{className:"wizard-body",children:[i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"Name"}),i.jsx("input",{type:"text",value:c,onChange:G=>u(G.target.value)})]}),i.jsxs("label",{className:"hub-send-target",children:[i.jsx("span",{className:"admin-hint",children:"Phone (optional, for flexible lookup)"}),i.jsx("input",{type:"text",value:d,onChange:G=>f(G.target.value),placeholder:"+918800123456"})]}),i.jsxs("p",{className:"admin-hint",children:["Platform: ",i.jsx("strong",{children:o.platform})," | ID: ",i.jsx("code",{children:o.id})]}),i.jsxs("div",{className:"wizard-nav",children:[i.jsx("button",{type:"button",className:"admin-mini-btn",onClick:()=>l(null),children:"Cancel"}),i.jsx("button",{type:"button",className:"admin-refresh-btn",onClick:()=>void U(),children:"Save"})]})]})]})})]})}const D_=["proven-dead","proof-expired","parked","never-verified"];function _o(e){if(e<=0)return"never";const t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60),a=Math.floor(r/24);return a>30?`${a}d ago`:a>0?`${a}d ${r%24}h ago`:r>0?`${r}h ${n%60}m ago`:n>0?`${n}m ago`:`${t}s ago`}function bye(e){if(e<=0)return"never";const t=(Date.now()-e)/(24*60*60*1e3);return t<1?`${(t*24).toFixed(1)}h`:`${t.toFixed(2)}d`}function xye({entry:e}){const t=Date.now(),n=t-e.lastProbedAt,r=t-e.lastVerifiedAt,a=t-e.lastUsedAt,s=Math.min(100,n/(30*24*60*60*1e3)*100),o=e.lastVerifiedAt>0?Math.min(100,r/(30*24*60*60*1e3)*100):-1,l=e.lastUsedAt>0?Math.min(100,a/(30*24*60*60*1e3)*100):-1;return i.jsxs("div",{className:"timeline-bar-container",children:[i.jsx("div",{className:"timeline-bar",title:`Last probed: ${_o(n)}`,children:i.jsx("div",{className:"timeline-bar-fill probe",style:{width:`${s}%`}})}),o>=0&&i.jsx("div",{className:"timeline-bar small",title:`Last verified: ${_o(r)}`,children:i.jsx("div",{className:"timeline-bar-fill verify",style:{width:`${o}%`}})}),l>=0&&i.jsx("div",{className:"timeline-bar small",title:`Last used: ${_o(a)}`,children:i.jsx("div",{className:"timeline-bar-fill use",style:{width:`${l}%`}})})]})}function B_(e){return{fontSize:11,padding:"2px 8px",borderRadius:4,background:`${e}20`,color:e,border:`1px solid ${e}40`,whiteSpace:"nowrap"}}function wye(){const[e,t]=k.useState(null),[n,r]=k.useState(!0),[a,s]=k.useState(null),[o,l]=k.useState("all"),[c,u]=k.useState("provider"),d=k.useRef(!0),f=k.useCallback(async()=>{try{const M=await fetch("/api/model-timeline");if(!M.ok)throw new Error("Failed to fetch timeline data");const O=await M.json();d.current&&(t(O),s(null))}catch(M){d.current&&s(M instanceof Error?M.message:"Failed to load timeline")}finally{d.current&&r(!1)}},[]),[h,p]=k.useState(null),[g,m]=k.useState(10),[y,v]=k.useState(!1),[b,w]=k.useState(null),N=k.useRef(!1),S=k.useCallback(async()=>{const M=await Q.fetchVerifyBacklog();if(!d.current)return;p(M);const O=(M==null?void 0:M.status)==="running";N.current&&!O&&f(),N.current=O},[f]);k.useEffect(()=>{d.current=!0,f(),S();const M=setInterval(()=>void f(),3e4);return()=>{d.current=!1,clearInterval(M)}},[f,S]);const x=(h==null?void 0:h.status)==="running";k.useEffect(()=>{if(!x)return;const M=setInterval(()=>void S(),1e3);return()=>clearInterval(M)},[x,S]);const E=k.useCallback(async()=>{v(!0),w(null);const M=await Q.startVerifyBacklog(g);if(d.current){if(M.state&&p(M.state),!M.ok){const O=M.refusal??M.error??"Could not start the run.";w({text:O,kind:M.refusal?"info":"error"})}v(!1)}},[g]);if(n)return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"๐Ÿ“…",title:"Model Discovery Timeline"}),i.jsxs("div",{className:"loading-state",children:[i.jsx("div",{className:"loading-spinner"}),i.jsx("p",{children:"Loading timeline..."})]})]});if(a)return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"๐Ÿ“…",title:"Model Discovery Timeline"}),i.jsx("div",{className:"admin-row-msg admin-row-msg-err",children:a})]});if(e&&!e.counts)return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"๐Ÿ“…",title:"Model Discovery Timeline"}),i.jsxs("div",{className:"admin-row-msg admin-row-msg-err",children:["This dashboard server predates the reachability view. Restart it (",i.jsx("code",{children:"nuvira dashboard stop"}),", then start it again) and reload this page."]})]});const j=(e==null?void 0:e.entries)??[],C=e==null?void 0:e.counts,T=e==null?void 0:e.reachabilityCopy,$=e==null?void 0:e.freshnessCopy,R=C?D_.reduce((M,O)=>M+(C[O]??0),0):0,I=j.filter(M=>o==="routable"?M.reachability==="routable":o==="not-routable"?M.reachability!=="routable":!0),L=[...I].sort((M,O)=>c==="provider"?M.provider.localeCompare(O.provider)||M.model.localeCompare(O.model):O.lastProbedAt-M.lastProbedAt),F=new Map;for(const M of L){const O=F.get(M.provider);O?O.push(M):F.set(M.provider,[M])}const z=M=>({background:M?"var(--accent-green)":"var(--bg-hover)",border:`1px solid ${M?"var(--accent-green)":"var(--border)"}`,padding:"4px 12px",fontSize:12,cursor:"pointer"});return i.jsxs("div",{className:"admin-header",children:[i.jsx($e,{icon:"๐Ÿ“…",title:"Model Discovery Timeline"}),i.jsxs("p",{className:"section-description",children:["The registry's age profile: when each tracked model was last probed, last ",i.jsx("em",{children:"verified"}),", and last used โ€” and which ones routing can actually reach. The Models page answers โ€œis it usable right nowโ€; this one answers โ€œwhat is ageing outโ€."]}),i.jsxs("div",{className:"stats-grid",style:{marginBottom:8},children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:(e==null?void 0:e.totalModels)??0}),i.jsx("div",{className:"stat-label",children:"Tracked models"})]}),i.jsxs("div",{className:"stat-card",style:{borderColor:"var(--accent-green)"},children:[i.jsx("div",{className:"stat-value",style:{color:"var(--accent-green)"},children:(C==null?void 0:C.routable)??0}),i.jsx("div",{className:"stat-label",children:"Routable now"})]}),i.jsxs("div",{className:"stat-card",style:{borderColor:"var(--border-hover)"},children:[i.jsx("div",{className:"stat-value",style:{color:"var(--text-secondary)"},children:R}),i.jsx("div",{className:"stat-label",children:"Not routable"})]})]}),C?i.jsx("div",{style:{display:"flex",gap:14,flexWrap:"wrap",marginBottom:14,fontSize:11},children:D_.map(M=>{const O=T==null?void 0:T[M];return i.jsxs("span",{title:O==null?void 0:O.blurb,children:[i.jsx("span",{style:{color:(O==null?void 0:O.color)??"var(--text-secondary)"},children:"โ– "})," ",i.jsxs("span",{style:{color:"var(--text-secondary)"},children:[(O==null?void 0:O.label)??M,": ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:C[M]??0})]})]},M)})}):null,h?i.jsxs("div",{style:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:8,padding:"12px 14px",marginBottom:16},"data-testid":"verify-backlog-panel",children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[i.jsx("span",{style:{fontWeight:600,color:"var(--text-primary)"},children:"Work the backlog down"}),i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)",flex:1,minWidth:260},children:["Each check is a real 1-token generation against one of your provider keys โ€” not a listing lookup. A never-verified model is an ",i.jsx("em",{children:"unknown"}),", not a broken one: a check either proves it routable or marks it proven dead. Runs are bounded and one at a time."]}),i.jsxs("label",{style:{fontSize:11,color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:6},children:["How many",i.jsx("input",{type:"number",min:1,max:h.maxCount??25,value:g,disabled:y||x,"aria-label":"how many models to verify",onChange:M=>m(Number(M.target.value)),style:{width:64,background:"var(--bg-primary)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:4,padding:"3px 6px",fontSize:12}})]}),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:y||x||!(g>0),onClick:()=>void E(),style:{background:"var(--accent-green)",border:"1px solid var(--accent-green)",padding:"4px 12px",fontSize:12,cursor:y||x?"default":"pointer"},"data-testid":"verify-backlog-start",children:x?"โณ Verifyingโ€ฆ":y?"Startingโ€ฆ":`โ–ถ Verify next ${g} now`})]}),x?i.jsxs("div",{className:"env-var-notice","data-testid":"verify-backlog-progress",children:["Probing"," ",i.jsx("code",{children:h.current?`${h.current.provider}/${h.current.model}`:"โ€ฆ"})," ","โ€” ",h.processed,"/",h.planned," done ยท ",h.verified," verified ยท ",h.unavailable," proven dead"]}):null,!x&&h.status==="done"?i.jsxs("div",{className:"env-var-notice","data-testid":"verify-backlog-summary",children:["โœ… ",h.verified," verified ยท โ›” ",h.unavailable," proven unavailable ยท โš ๏ธ ",h.errored," errored ยท โญ"," ",h.skipped," skipped",h.remaining!==null?` โ€” ${h.remaining} still never verified`:""]}):null,(h.results??[]).length>0?i.jsx("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginTop:8},children:(h.results??[]).map(M=>i.jsxs("span",{style:{fontSize:11,color:"var(--text-secondary)"},title:M.outcome==="verified"?"Proven routable โ€” a 1-token call succeeded":M.outcome==="unavailable"?"Proven dead โ€” the provider refused it (403/404), re-probing will not help":M.outcome==="skipped"?"Skipped โ€” verified recently enough":"Errored โ€” transient, still unknown, will be retried next run",children:[M.outcome==="verified"?"โœ…":M.outcome==="unavailable"?"โ›”":M.outcome==="skipped"?"โญ":"โš ๏ธ"," ",i.jsxs("code",{children:[M.provider,"/",M.model]})]},`${M.provider}:${M.model}`))}):null,b?i.jsx("div",{className:`env-var-notice${b.kind==="error"?" env-var-notice-error":""}`,"data-testid":"verify-backlog-message",children:b.text}):h.status==="idle"&&h.refusal?i.jsx("div",{className:"env-var-notice","data-testid":"verify-backlog-message",children:h.refusal}):null]}):null,i.jsxs("div",{style:{display:"flex",gap:8,marginBottom:16,flexWrap:"wrap"},children:[i.jsx("div",{style:{display:"flex",gap:4},children:["all","routable","not-routable"].map(M=>i.jsx("button",{className:`admin-refresh-btn ${o===M?"active":""}`,onClick:()=>l(M),style:z(o===M),children:M==="all"?"All":M==="routable"?"Routable":"Not routable"},M))}),i.jsx("div",{style:{display:"flex",gap:4},children:["provider","lastProbed"].map(M=>i.jsxs("button",{className:`admin-refresh-btn ${c===M?"active":""}`,onClick:()=>u(M),style:z(c===M),children:["Sort: ",M==="lastProbed"?"Last seen":"Provider"]},M))}),i.jsx("button",{className:"admin-refresh-btn",onClick:()=>void f(),style:{background:"var(--bg-hover)",border:"1px solid var(--border)",padding:"4px 12px",fontSize:12,cursor:"pointer"},children:"๐Ÿ”„ Refresh"})]}),i.jsxs("div",{style:{display:"flex",gap:16,marginBottom:4,fontSize:11,color:"var(--text-secondary)",flexWrap:"wrap"},children:[i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-blue)"},children:"โ– "})," Probe (last seen in the provider's catalog)"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-green)"},children:"โ– "})," Verified (last success)"]}),i.jsxs("span",{children:[i.jsx("span",{style:{color:"var(--accent-yellow)"},children:"โ– "})," Used (last invocation)"]})]}),i.jsxs("div",{style:{marginBottom:12,fontSize:11,color:"var(--text-secondary)"},children:[i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Fresh"})," means the provider still lists it."," ",i.jsx("strong",{style:{color:"var(--text-primary)"},children:"Routable"})," means a turn has been proven to work on it within"," ",(e==null?void 0:e.freshDays)??7," days. A fresh model that was never verified is an unknown, not a failure โ€” background spot-checks work through those a few at a time."]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from(F.entries()).map(([M,O])=>{const U=O.filter(A=>A.reachability==="routable").length;return i.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:8,border:"1px solid var(--border)",overflow:"hidden"},children:[i.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{style:{fontSize:16},children:M==="groq"?"โšก":M==="gemini"?"๐ŸŒ€":M==="local"?"๐Ÿ’ป":"๐Ÿค–"}),i.jsx("span",{style:{fontWeight:600,color:"var(--text-primary)"},children:M}),i.jsxs("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:["(",O.length," shown ยท ",U," routable)"]})]}),i.jsx("div",{style:{padding:"8px 14px"},children:O.map(A=>{const Z=Date.now(),D=T==null?void 0:T[A.reachability],P=$==null?void 0:$[A.freshness],oe=(D==null?void 0:D.color)??"var(--text-secondary)";return i.jsxs("div",{"data-testid":`timeline-row-${A.provider}-${A.model}`,style:{display:"flex",alignItems:"center",gap:12,padding:"6px 0",borderBottom:"1px solid var(--border-light)"},children:[i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:A.model}),i.jsxs("div",{style:{fontSize:11,color:"var(--text-secondary)",display:"flex",gap:12,flexWrap:"wrap"},children:[i.jsxs("span",{children:["Probed: ",_o(Z-A.lastProbedAt)]}),i.jsxs("span",{children:["Verified: ",A.lastVerifiedAt>0?_o(Z-A.lastVerifiedAt):"never"]}),A.lastUsedAt>0&&i.jsxs("span",{children:["Used: ",_o(Z-A.lastUsedAt)]}),A.latencyMs!==void 0&&i.jsxs("span",{children:[A.latencyMs,"ms"]}),A.errorRate>0&&i.jsxs("span",{style:{color:A.errorRate>.5?"var(--accent-red)":"var(--accent-yellow)"},children:["err ",(A.errorRate*100).toFixed(0),"%"]}),A.daysSinceVerify!==null&&A.daysSinceVerify>7&&i.jsxs("span",{style:{color:"var(--accent-yellow)"},children:["proof ",bye(A.lastVerifiedAt)," old"]})]})]}),i.jsx(xye,{entry:A}),P&&i.jsx("span",{style:B_(P.color),title:P.blurb,children:P.label}),i.jsx("span",{style:B_(oe),title:(D==null?void 0:D.blurb)??A.reachability,"data-testid":`reachability-${A.provider}-${A.model}`,children:((D==null?void 0:D.label)??A.reachability).toUpperCase()})]},A.model)})})]},M)})}),I.length===0&&i.jsx("div",{style:{textAlign:"center",padding:"40px 20px",color:"var(--text-secondary)"},children:o==="routable"&&j.length>0?"No model is routable right now โ€” every tracked model is unverified, parked, expired or dead. The Models page shows what each provider would offer live.":"No models match the current filter"})]})}function Di(e){return e==null?"0":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":mt(e)}function Sye(e){return e==null?"0%":(e*100).toFixed(1)+"%"}function kye({data:e}){var o,l;if(!e)return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ’พ",title:"Memory Store"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading memory data..."})})]});const{memory:t,health:n}=e,r=Object.entries(t.byFingerprint||{}).sort(([,c],[,u])=>u-c),a=Object.entries(((o=t.facts)==null?void 0:o.byProject)||{}).sort(([,c],[,u])=>u-c),s=t.recall||{total:0,today:0,last7d:0};return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ’พ",title:"Memory Store"}),i.jsxs("div",{className:"stats-grid mini",children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:Di(t.total)}),i.jsx("div",{className:"stat-label",children:"Trajectories"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:Sye(t.avgScore)}),i.jsx("div",{className:"stat-label",children:"Avg Score"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:Di((l=t.facts)==null?void 0:l.total)}),i.jsx("div",{className:"stat-label",children:"Facts"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:Di(s.total)}),i.jsx("div",{className:"stat-label",children:"Recall Hits"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:Di(n==null?void 0:n.patterns)}),i.jsx("div",{className:"stat-label",children:"Coding Patterns"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:Di(n==null?void 0:n.feedback)}),i.jsx("div",{className:"stat-label",children:"Feedback Ratings"})]})]}),i.jsxs("p",{className:"memory-backend",children:["Backend: ",i.jsx("code",{children:t.backend||"local"}),s.last7d>0?` ยท ${Di(s.last7d)} recall(s) this week, ${Di(s.today)} today`:" ยท no recalls yet"]}),r.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"By Project Type"}),i.jsx("div",{className:"memory-list",children:r.map(([c,u])=>i.jsxs("div",{className:"memory-item",children:[i.jsx("span",{className:"memory-project",children:c}),i.jsxs("span",{className:"memory-count",children:[u," trajectory(ies)"]})]},c))})]}),a.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-subtitle",children:"Facts by Project"}),i.jsx("div",{className:"memory-list",children:a.map(([c,u])=>i.jsxs("div",{className:"memory-item",children:[i.jsx("span",{className:"memory-project",children:c}),i.jsxs("span",{className:"memory-count",children:[u," fact(s)"]})]},c))})]})]})}function Nye(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Eye({data:e}){if(!e)return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ“",title:"Conversation History"}),i.jsx("div",{className:"loading-state",children:i.jsx("p",{children:"Loading history..."})})]});const{history:t}=e,n=t.recent||[];return i.jsxs(i.Fragment,{children:[i.jsx($e,{icon:"๐Ÿ“",title:"Conversation History"}),i.jsx("div",{className:"history-stats",children:i.jsxs("span",{className:"history-count",children:["Total: ",i.jsx("strong",{children:t.total})," sessions"]})}),i.jsx("div",{className:"history-list",children:n.length===0?i.jsx("div",{className:"empty-state",children:"No conversations recorded yet."}):n.map(r=>i.jsxs("div",{className:"history-item",children:[i.jsx("div",{className:"history-summary",children:r.summary||"Untitled"}),i.jsxs("div",{className:"history-meta",children:[i.jsxs("span",{children:["๐Ÿ“… ",Nye(r.startedAt)]}),i.jsxs("span",{children:["๐Ÿค– ",r.provider||"--"]}),i.jsxs("span",{children:["๐Ÿ’ฌ ",r.messageCount||0," msgs"]}),r.tags&&r.tags.length>0&&i.jsxs("span",{children:["๐Ÿท๏ธ ",r.tags.map(a=>i.jsx("span",{className:"history-tag",children:a},a))]})]})]},r.id))})]})}function jye({onFetch:e,onClear:t,onExport:n}){const[r,a]=k.useState([]),[s,o]=k.useState(!1),[l,c]=k.useState(""),[u,d]=k.useState(""),[f,h]=k.useState(null),[p,g]=k.useState(null);k.useEffect(()=>{m()},[l,u]);const m=async()=>{o(!0);try{const N=await e({skillName:l||void 0,status:u||void 0,limit:100});a(N);const S=N.length,x=N.filter(C=>C.status==="success").length,E=N.filter(C=>C.status==="failure").length,j=S>0?Math.round(N.reduce((C,T)=>C+T.durationMs,0)/S):0;g({total:S,success:x,failure:E,avgDuration:j})}catch(N){console.error("Failed to fetch execution history:",N)}finally{o(!1)}},y=async N=>{if(n)try{const S=await n(N),x=new Blob([S],{type:N==="json"?"application/json":"text/csv"}),E=URL.createObjectURL(x),j=document.createElement("a");j.href=E,j.download=`execution-history.${N}`,j.click(),URL.revokeObjectURL(E)}catch(S){console.error("Failed to export history:",S)}},v=async()=>{if(t&&confirm("Are you sure you want to clear all execution history?"))try{await t(),a([]),g(null)}catch(N){console.error("Failed to clear history:",N)}},b=N=>{switch(N){case"success":return"โœ…";case"failure":return"โŒ";case"timeout":return"โฐ";case"rejected":return"๐Ÿšซ";case"error":return"๐Ÿ’ฅ";default:return"โ“"}},w=N=>{switch(N){case"python":return"๐Ÿ";case"node":return"๐ŸŸข";case"shell":return"๐Ÿ–ฅ๏ธ";case"ruby":return"๐Ÿ’Ž";case"go":return"๐Ÿ”ต";case"rust":return"๐Ÿฆ€";default:return"๐Ÿ“œ"}};return i.jsxs("div",{className:"execution-history",children:[i.jsx($e,{icon:"๐Ÿ“œ",title:"Execution History",actions:i.jsxs("div",{className:"execution-history-actions",children:[i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>y("json"),children:"๐Ÿ“ฅ Export JSON"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>y("csv"),children:"๐Ÿ“ฅ Export CSV"}),t&&i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:v,children:"๐Ÿ—‘๏ธ Clear"})]})}),p&&i.jsxs("div",{className:"execution-history-stats",children:[i.jsxs("div",{className:"stat-item",children:[i.jsx("span",{className:"stat-value",children:p.total}),i.jsx("span",{className:"stat-label",children:"Total"})]}),i.jsxs("div",{className:"stat-item stat-success",children:[i.jsx("span",{className:"stat-value",children:p.success}),i.jsx("span",{className:"stat-label",children:"Success"})]}),i.jsxs("div",{className:"stat-item stat-failure",children:[i.jsx("span",{className:"stat-value",children:p.failure}),i.jsx("span",{className:"stat-label",children:"Failed"})]}),i.jsxs("div",{className:"stat-item",children:[i.jsxs("span",{className:"stat-value",children:[p.avgDuration,"ms"]}),i.jsx("span",{className:"stat-label",children:"Avg Duration"})]})]}),i.jsxs("div",{className:"execution-history-filters",children:[i.jsx("input",{className:"env-var-input",type:"text",placeholder:"Filter by skill name...",value:l,onChange:N=>c(N.target.value)}),i.jsxs("select",{className:"env-var-input",value:u,onChange:N=>d(N.target.value),children:[i.jsx("option",{value:"",children:"All statuses"}),i.jsx("option",{value:"success",children:"Success"}),i.jsx("option",{value:"failure",children:"Failure"}),i.jsx("option",{value:"timeout",children:"Timeout"}),i.jsx("option",{value:"rejected",children:"Rejected"}),i.jsx("option",{value:"error",children:"Error"})]})]}),i.jsx("div",{className:"execution-history-list",children:s?i.jsx("div",{className:"execution-history-empty",children:"Loading..."}):r.length===0?i.jsx("div",{className:"execution-history-empty",children:"No execution history found. Execute a skill to see results here."}):r.map(N=>i.jsxs("div",{className:`execution-history-entry ${N.status}`,onClick:()=>h((f==null?void 0:f.id)===N.id?null:N),children:[i.jsxs("div",{className:"entry-header",children:[i.jsx("span",{className:"entry-icon",children:b(N.status)}),i.jsx("span",{className:"entry-skill",children:N.skillName}),i.jsxs("span",{className:"entry-runtime",children:[w(N.runtime)," ",N.runtime]}),i.jsxs("span",{className:"entry-duration",children:[N.durationMs,"ms"]}),i.jsx("span",{className:"entry-time",children:new Date(N.timestamp).toLocaleString()}),i.jsx("span",{className:"entry-expand",children:(f==null?void 0:f.id)===N.id?"โ–ผ":"โ–ถ"})]}),(f==null?void 0:f.id)===N.id&&i.jsxs("div",{className:"entry-details",children:[i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Status:"}),i.jsx("span",{className:"detail-value",children:N.status})]}),i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Runtime:"}),i.jsx("span",{className:"detail-value",children:N.runtime})]}),i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Duration:"}),i.jsxs("span",{className:"detail-value",children:[N.durationMs,"ms"]})]}),N.exitCode!==void 0&&i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Exit Code:"}),i.jsx("span",{className:"detail-value",children:N.exitCode})]}),N.error&&i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Error:"}),i.jsx("span",{className:"detail-value entry-error",children:N.error})]}),N.command&&i.jsxs("div",{className:"entry-detail-row",children:[i.jsx("span",{className:"detail-label",children:"Command:"}),i.jsx("code",{className:"detail-value",children:N.command})]})]})]},N.id))})]})}function _ye({envVars:e,onSave:t,onDelete:n,onTest:r,readOnly:a=!1}){const[s,o]=k.useState(null),[l,c]=k.useState(""),[u,d]=k.useState(!1),[f,h]=k.useState(""),[p,g]=k.useState(""),[m,y]=k.useState(null),[v,b]=k.useState({}),w=[...e].sort((E,j)=>E.requiredBy&&!j.requiredBy?-1:!E.requiredBy&&j.requiredBy?1:E.name.localeCompare(j.name)),N=E=>{t(E,l),o(null),c("")},S=()=>{f&&p&&(t(f,p),h(""),g(""),d(!1))},x=async E=>{if(r){y(E);try{const j=await r(E);b(C=>({...C,[E]:j}))}catch{b(j=>({...j,[E]:!1}))}finally{y(null)}}};return i.jsxs("div",{className:"env-var-editor",children:[i.jsxs("div",{className:"env-var-header",children:[i.jsx("h2",{className:"env-var-title",children:"๐Ÿ” Environment Variables"}),!a&&i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>d(!u),children:u?"โœ• Cancel":"+ Add Variable"})]}),u&&!a&&i.jsxs("div",{className:"env-var-add-form",children:[i.jsx("input",{className:"env-var-input",type:"text",placeholder:"Variable name (e.g., MY_API_KEY)",value:f,onChange:E=>h(E.target.value)}),i.jsx("input",{className:"env-var-input",type:"password",placeholder:"Value",value:p,onChange:E=>g(E.target.value)}),i.jsx("button",{className:"admin-refresh-btn",type:"button",disabled:!f||!p,onClick:S,children:"๐Ÿ’พ Save"})]}),i.jsx("div",{className:"env-var-list",children:w.length===0?i.jsx("div",{className:"env-var-empty",children:"No environment variables configured. Add one to get started."}):w.map(E=>i.jsxs("div",{className:`env-var-row ${E.isSet?"env-var-set":"env-var-missing"} ${E.isProviderCredential?"env-var-blocked":""}`,children:[i.jsxs("div",{className:"env-var-row-header",children:[i.jsxs("span",{className:"env-var-name",children:[E.name,E.requiredBy&&i.jsxs("span",{className:"env-var-required-badge",children:["required by ",E.requiredBy]}),E.isProviderCredential&&i.jsx("span",{className:"env-var-blocked-badge",children:"๐Ÿ”’ provider credential (blocked)"})]}),i.jsx("span",{className:"env-var-status",children:E.isSet?"โœ… Set":"โŒ Not set"})]}),E.description&&i.jsx("div",{className:"env-var-description",children:E.description}),s===E.name?i.jsxs("div",{className:"env-var-edit",children:[i.jsx("input",{className:"env-var-input",type:"password",value:l,onChange:j=>c(j.target.value),placeholder:"Enter new value..."}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>N(E.name),children:"๐Ÿ’พ Save"}),i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>o(null),children:"Cancel"})]}):i.jsxs("div",{className:"env-var-actions",children:[!a&&!E.isProviderCredential&&i.jsx("button",{className:"admin-mini-btn",type:"button",onClick:()=>{o(E.name),c("")},children:"โœ๏ธ Edit"}),r&&i.jsx("button",{className:"admin-mini-btn",type:"button",disabled:m===E.name,onClick:()=>x(E.name),children:m===E.name?"โณ Testing...":"๐Ÿงช Test"}),!a&&i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",onClick:()=>n(E.name),children:"๐Ÿ—‘๏ธ Delete"}),v[E.name]!==void 0&&i.jsx("span",{className:`env-var-test-result ${v[E.name]?"env-var-test-pass":"env-var-test-fail"}`,children:v[E.name]?"โœ… Valid":"โŒ Invalid"})]})]},E.name))}),i.jsx("div",{className:"env-var-help",children:i.jsxs("p",{children:[i.jsx("strong",{children:"Tip:"})," Environment variables are stored in ",i.jsx("code",{children:"~/.nuvira/.env"})," and injected into skill executions. Provider credentials (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) are automatically blocked from skill execution for security."]})})]})}function Aye(){const[e,t]=k.useState({configured:!1,authenticated:!1,role:null}),[n,r]=k.useState([]),[a,s]=k.useState(!0),[o,l]=k.useState(null),[c,u]=k.useState(null),d=e.authenticated&&(e.role==="admin"||e.role==="operator"),f=k.useCallback(async()=>{s(!0);const m=await Q.fetchSkillEnv();r(m),s(!1)},[]);k.useEffect(()=>{Q.fetchAdminAuthStatus().then(m=>{t(m?{configured:m.configured,authenticated:m.authenticated,role:m.role??null}:{configured:!1,authenticated:!1,role:null})}),f()},[f]);const h=k.useCallback(async(m,y)=>{var w;l(null),u(null);const v=await Q.saveSecrets({[m]:y}),b=(w=v.refused)==null?void 0:w.find(N=>N.name===m);!v.ok||b?l(b?Cye(m,b.reason):v.error||`Could not save ${m}.`):u(`Saved ${m}.`),await f()},[f]),p=k.useCallback(async m=>{l(null),u(null);const y=await Q.deleteSkillEnvVar(m);y.ok?u(y.removed?`Deleted ${m}.`:`${m} was not stored in the env file.`):l(y.error||`Could not delete ${m}.`),await f()},[f]),g=k.useCallback(async m=>{const y=await Q.testSkillEnvVar(m);return y.ok?(l(null),u(y.detail||`${m}: ${y.usable?"usable by skills":"not usable by skills"}`),y.usable===!0):(l(y.error||`Could not test ${m}.`),!1)},[]);return i.jsxs("div",{children:[i.jsx($e,{icon:"๐Ÿ”",title:"Skill Environment Variables"}),i.jsxs("div",{className:"env-var-header",children:[i.jsx("span",{className:"env-var-title",children:"Values are masked; only names and set/unset state are shown."}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void f(),children:"โ†ป Refresh"})]}),i.jsxs("div",{className:"admin-hint",children:["Secrets here are injected into skill executions that declare them (",i.jsx("code",{children:"required_environment_variables"}),"). Provider credentials are listed but locked โ€” they belong to provider setup, and skills never receive them."]}),e.authenticated?null:i.jsx("div",{className:"admin-hint",children:e.configured?"Log in to view or edit skill secrets.":"Set up an admin account to manage skill secrets."}),e.authenticated&&!d?i.jsx("div",{className:"admin-hint",children:"Read-only โ€” admins and operators can change these values."}):null,o?i.jsx("div",{className:"env-var-notice env-var-notice-error",children:o}):null,c?i.jsx("div",{className:"env-var-notice",children:c}):null,a?i.jsx("div",{className:"loading-state",children:"Loadingโ€ฆ"}):i.jsx(_ye,{envVars:n,onSave:(m,y)=>void h(m,y),onDelete:m=>void p(m),onTest:g,readOnly:!d})]})}function Cye(e,t){switch(t){case"provider-credential":return`${e} is a provider credential โ€” configure it in provider setup instead. Skills never receive it.`;case"invalid-name":return`${e} is not a valid environment variable name.`;case"write-failed":return`${e} could not be written to the env file.`;default:return`${e} was not saved (${t}).`}}const Tye=[{id:"turn",title:"Turn behaviour",blurb:"How each turn runs. Unset means nobody has asked for anything, which is not the same as asking for no."},{id:"observability",title:"Observability",blurb:"What a run records about itself. Both are off by default and off unless asked for."},{id:"hooks",title:"Tool hooks",blurb:"A command run around every tool call, with the call on stdin as JSON. For a phase, a value here REPLACES the hooks declared in tools.hooks."}];function Oye(){const[e,t]=k.useState({configured:!1,authenticated:!1,role:null}),[n,r]=k.useState([]),[a,s]=k.useState(!0),[o,l]=k.useState(null),[c,u]=k.useState(null),[d,f]=k.useState({}),[h,p]=k.useState(null),g=e.authenticated&&(e.role==="admin"||e.role==="operator"),m=k.useCallback(async()=>{s(!0),r(await Q.fetchProcessEnv()),s(!1)},[]);k.useEffect(()=>{Q.fetchAdminAuthStatus().then(b=>{t(b?{configured:b.configured,authenticated:b.authenticated,role:b.role??null}:{configured:!1,authenticated:!1,role:null})}),m()},[m]);const y=k.useCallback(async(b,w)=>{p(b),l(null),u(null);const N=await Q.saveProcessEnvVar(b,w);if(!N.ok||!N.row)l(N.error||`Could not set ${b}.`);else{const S=N.row;r(x=>x.map(E=>E.name===S.name?S:E)),f(x=>({...x,[b]:""})),u(`${b} = ${S.fileValue}. Takes effect on the next turn; the dashboard picked it up immediately.`)}p(null)},[]),v=k.useCallback(async b=>{p(b),l(null),u(null);const w=await Q.deleteProcessEnvVar(b);if(!w.ok||!w.row)l(w.error||`Could not unset ${b}.`);else{const N=w.row;r(S=>S.map(x=>x.name===N.name?N:x)),f(S=>({...S,[b]:""})),u(w.removed?`${b} removed from the env file. ${N.unsetMeans}`:`${b} had no line in the env file. ${N.unsetMeans}`)}p(null)},[]);return i.jsxs("div",{children:[i.jsx($e,{icon:"๐ŸŒฑ",title:"Process Environment"}),i.jsxs("div",{className:"env-var-header",children:[i.jsx("span",{className:"env-var-title",children:"These are the switches Agent-Nuvira reads for how a run behaves. Values are written to the credential env file and are not masked โ€” do not put a secret in a hook command."}),i.jsx("button",{className:"admin-refresh-btn",type:"button",onClick:()=>void m(),children:"โ†ป Refresh"})]}),i.jsxs("div",{className:"admin-hint",children:["A value exported in your shell ",i.jsx("strong",{children:"wins over this file"}),", for the dashboard and for every CLI run in that shell. A row that says ",i.jsx("em",{children:"shell value wins"})," is reporting exactly that, and writes here will not change it."]}),e.authenticated?null:i.jsx("div",{className:"admin-hint",children:e.configured?"Log in to view or change the process environment.":"Set up an admin account to change the process environment."}),e.authenticated&&!g?i.jsx("div",{className:"admin-hint",children:"Read-only โ€” admins and operators can change these values."}):null,o?i.jsx("div",{className:"env-var-notice env-var-notice-error",children:o}):null,c?i.jsx("div",{className:"env-var-notice",children:c}):null,a?i.jsx("div",{className:"loading-state",children:"Loadingโ€ฆ"}):Tye.map(b=>{const w=n.filter(N=>N.group===b.id);return w.length===0?null:i.jsxs("section",{className:"process-env-group",children:[i.jsx("h3",{className:"process-env-group-title",children:b.title}),i.jsx("p",{className:"process-env-group-blurb",children:b.blurb}),i.jsx("div",{className:"env-var-list",children:w.map(N=>i.jsx(Pye,{row:N,draft:d[N.name]??"",busy:h===N.name,readOnly:!g,onDraft:S=>f(x=>({...x,[N.name]:S})),onSet:S=>void y(N.name,S),onUnset:()=>void v(N.name)},N.name))})]},b.id)})]})}function Pye({row:e,draft:t,busy:n,readOnly:r,onDraft:a,onSet:s,onUnset:o}){const l=e.state==="on",c=e.state!=="unset",u=f=>`admin-mini-btn${f?" process-env-active":""}`,d=e.kind==="flag"&&e.fileValue!==null&&e.fileValue!=="1"&&e.fileValue!=="0"?e.fileValue:null;return i.jsxs("div",{className:`env-var-row ${c?"env-var-set":"env-var-missing"}`,"data-testid":`process-env-row-${e.name}`,children:[i.jsxs("div",{className:"env-var-row-header",children:[i.jsxs("span",{className:"env-var-name",children:[e.name,e.shadowed?i.jsxs("span",{className:"env-var-blocked-badge",children:["โš ๏ธ shell value wins: ",e.processValue]}):null]}),i.jsxs("span",{className:"env-var-status",children:[e.kind==="flag"?l?"โœ… On":c?"โญ• Off":"โž– Unset":c?"โœ… Set":"โž– Unset",d?` (${d})`:""]})]}),i.jsxs("div",{className:"env-var-description",children:[i.jsx("strong",{children:e.label})," โ€” ",e.description]}),i.jsxs("div",{className:"env-var-description",children:["Unset: ",e.unsetMeans]}),e.cliEquivalent?i.jsxs("div",{className:"env-var-description",children:["Same switch: ",i.jsx("code",{children:e.cliEquivalent})]}):null,e.warning?i.jsxs("div",{className:"env-var-warning",children:["โš ๏ธ ",e.warning]}):null,r?null:i.jsxs("div",{className:"env-var-actions",children:[e.kind==="flag"?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:u(l),type:"button",disabled:n,onClick:()=>s("1"),children:"On"}),i.jsx("button",{className:u(c&&!l),type:"button",disabled:n,onClick:()=>s("0"),children:"Off"}),i.jsx("button",{className:u(!c),type:"button",disabled:n,onClick:o,children:"Unset"})]}):null,e.kind==="text"||e.acceptsValue?i.jsxs(i.Fragment,{children:[i.jsx("input",{className:"env-var-input",type:"text",value:t,placeholder:e.placeholder,disabled:n,onChange:f=>a(f.target.value),"aria-label":`${e.name} value`}),i.jsxs("button",{className:"admin-mini-btn",type:"button",disabled:n||t.trim()==="",onClick:()=>s(t),children:["๐Ÿ’พ ",e.valueLabel??"Save"]})]}):null,e.kind==="text"?i.jsx("button",{className:"admin-mini-btn admin-mini-btn-danger",type:"button",disabled:n,onClick:o,children:"๐Ÿ—‘๏ธ Unset"}):null]})]})}function Rye(){const[e,t]=k.useState(null),[n,r]=k.useState(!1),[a,s]=k.useState("--"),[o,l]=k.useState(!1),c=k.useCallback(f=>{t(f),s(new Date().toLocaleTimeString())},[]),u=k.useCallback(f=>{r(f)},[]),d=k.useCallback(async()=>{l(!0);try{const f=await Q.fetchAll();f&&c(f)}finally{l(!1)}},[c]);return k.useEffect(()=>{Q.fetchAll().then(p=>{p&&c(p)});const f=Q.subscribe(c),h=Q.onConnectionChange(u);return Q.connect(),()=>{f(),h(),Q.disconnect()}},[c,u]),i.jsx(K2,{connected:n,lastUpdated:a,onRefresh:d,refreshing:o,children:i.jsxs(g2,{children:[i.jsx(nt,{path:"/",element:i.jsx(I_,{})}),i.jsx(nt,{path:"/overview",element:i.jsx(_ie,{data:e,onRefresh:d,refreshing:o})}),i.jsx(nt,{path:"/chat",element:i.jsx(DS,{to:"/",replace:!0})}),i.jsx(nt,{path:"/dag",element:i.jsx(Lie,{data:e})}),i.jsx(nt,{path:"/costs",element:i.jsx(Bie,{data:e})}),i.jsx(nt,{path:"/benchmarks",element:i.jsx(Fie,{data:e})}),i.jsx(nt,{path:"/models",element:i.jsx(_se,{})}),i.jsx(nt,{path:"/models/timeline",element:i.jsx(wye,{})}),i.jsx(nt,{path:"/routing",element:i.jsx(loe,{data:e})}),i.jsx(nt,{path:"/requests",element:i.jsx(doe,{data:e})}),i.jsx(nt,{path:"/traces",element:i.jsx(Soe,{})}),i.jsx(nt,{path:"/hub",element:i.jsx($oe,{})}),i.jsx(nt,{path:"/tasks",element:i.jsx(Boe,{})}),i.jsx(nt,{path:"/chat",element:i.jsx(I_,{})}),i.jsx(nt,{path:"/evals",element:i.jsx(fye,{data:e})}),i.jsx(nt,{path:"/platforms",element:i.jsx(mye,{})}),i.jsx(nt,{path:"/bedrock",element:i.jsx(vye,{canWrite:!0,sessionExpired:f=>console.error(f)})}),i.jsx(nt,{path:"/contacts",element:i.jsx(yye,{})}),i.jsx(nt,{path:"/gateway",element:i.jsx(pye,{})}),i.jsx(nt,{path:"/env",element:i.jsx(Aye,{})}),i.jsx(nt,{path:"/process-env",element:i.jsx(Oye,{})}),i.jsx(nt,{path:"/memory",element:i.jsx(kye,{data:e})}),i.jsx(nt,{path:"/history",element:i.jsx(Eye,{data:e})}),i.jsx(nt,{path:"/executions",element:i.jsx(jye,{onFetch:f=>Q.fetchExecutionAudit(f)})}),i.jsx(nt,{path:"/system",element:i.jsx(Gie,{data:e,connected:n,lastUpdated:a})}),i.jsx(nt,{path:"/admin",element:i.jsx(Eoe,{})}),i.jsx(nt,{path:"*",element:i.jsx(DS,{to:"/",replace:!0})})]})})}Mx(hT());QC(document.getElementById("root")).render(i.jsx(k.StrictMode,{children:i.jsx(N2,{children:i.jsx(Rye,{})})}));
207
- //# sourceMappingURL=index-D1YFCcIZ.js.map