flowyml 1.7.1__py3-none-any.whl → 1.8.0__py3-none-any.whl

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 (137) hide show
  1. flowyml/assets/base.py +15 -0
  2. flowyml/assets/dataset.py +570 -17
  3. flowyml/assets/metrics.py +5 -0
  4. flowyml/assets/model.py +1052 -15
  5. flowyml/cli/main.py +709 -0
  6. flowyml/cli/stack_cli.py +138 -25
  7. flowyml/core/__init__.py +17 -0
  8. flowyml/core/executor.py +231 -37
  9. flowyml/core/image_builder.py +129 -0
  10. flowyml/core/log_streamer.py +227 -0
  11. flowyml/core/orchestrator.py +59 -4
  12. flowyml/core/pipeline.py +65 -13
  13. flowyml/core/routing.py +558 -0
  14. flowyml/core/scheduler.py +88 -5
  15. flowyml/core/step.py +9 -1
  16. flowyml/core/step_grouping.py +49 -35
  17. flowyml/core/types.py +407 -0
  18. flowyml/integrations/keras.py +247 -82
  19. flowyml/monitoring/alerts.py +10 -0
  20. flowyml/monitoring/notifications.py +104 -25
  21. flowyml/monitoring/slack_blocks.py +323 -0
  22. flowyml/plugins/__init__.py +251 -0
  23. flowyml/plugins/alerters/__init__.py +1 -0
  24. flowyml/plugins/alerters/slack.py +168 -0
  25. flowyml/plugins/base.py +752 -0
  26. flowyml/plugins/config.py +478 -0
  27. flowyml/plugins/deployers/__init__.py +22 -0
  28. flowyml/plugins/deployers/gcp_cloud_run.py +200 -0
  29. flowyml/plugins/deployers/sagemaker.py +306 -0
  30. flowyml/plugins/deployers/vertex.py +290 -0
  31. flowyml/plugins/integration.py +369 -0
  32. flowyml/plugins/manager.py +510 -0
  33. flowyml/plugins/model_registries/__init__.py +22 -0
  34. flowyml/plugins/model_registries/mlflow.py +159 -0
  35. flowyml/plugins/model_registries/sagemaker.py +489 -0
  36. flowyml/plugins/model_registries/vertex.py +386 -0
  37. flowyml/plugins/orchestrators/__init__.py +13 -0
  38. flowyml/plugins/orchestrators/sagemaker.py +443 -0
  39. flowyml/plugins/orchestrators/vertex_ai.py +461 -0
  40. flowyml/plugins/registries/__init__.py +13 -0
  41. flowyml/plugins/registries/ecr.py +321 -0
  42. flowyml/plugins/registries/gcr.py +313 -0
  43. flowyml/plugins/registry.py +454 -0
  44. flowyml/plugins/stack.py +494 -0
  45. flowyml/plugins/stack_config.py +537 -0
  46. flowyml/plugins/stores/__init__.py +13 -0
  47. flowyml/plugins/stores/gcs.py +460 -0
  48. flowyml/plugins/stores/s3.py +453 -0
  49. flowyml/plugins/trackers/__init__.py +11 -0
  50. flowyml/plugins/trackers/mlflow.py +316 -0
  51. flowyml/plugins/validators/__init__.py +3 -0
  52. flowyml/plugins/validators/deepchecks.py +119 -0
  53. flowyml/registry/__init__.py +2 -1
  54. flowyml/registry/model_environment.py +109 -0
  55. flowyml/registry/model_registry.py +241 -96
  56. flowyml/serving/__init__.py +17 -0
  57. flowyml/serving/model_server.py +628 -0
  58. flowyml/stacks/__init__.py +60 -0
  59. flowyml/stacks/aws.py +93 -0
  60. flowyml/stacks/base.py +62 -0
  61. flowyml/stacks/components.py +12 -0
  62. flowyml/stacks/gcp.py +44 -9
  63. flowyml/stacks/plugins.py +115 -0
  64. flowyml/stacks/registry.py +2 -1
  65. flowyml/storage/sql.py +401 -12
  66. flowyml/tracking/experiment.py +8 -5
  67. flowyml/ui/backend/Dockerfile +87 -16
  68. flowyml/ui/backend/auth.py +12 -2
  69. flowyml/ui/backend/main.py +149 -5
  70. flowyml/ui/backend/routers/ai_context.py +226 -0
  71. flowyml/ui/backend/routers/assets.py +23 -4
  72. flowyml/ui/backend/routers/auth.py +96 -0
  73. flowyml/ui/backend/routers/deployments.py +660 -0
  74. flowyml/ui/backend/routers/model_explorer.py +597 -0
  75. flowyml/ui/backend/routers/plugins.py +103 -51
  76. flowyml/ui/backend/routers/projects.py +91 -8
  77. flowyml/ui/backend/routers/runs.py +132 -1
  78. flowyml/ui/backend/routers/schedules.py +54 -29
  79. flowyml/ui/backend/routers/templates.py +319 -0
  80. flowyml/ui/backend/routers/websocket.py +2 -2
  81. flowyml/ui/frontend/Dockerfile +55 -6
  82. flowyml/ui/frontend/dist/assets/index-B5AsPTSz.css +1 -0
  83. flowyml/ui/frontend/dist/assets/index-dFbZ8wD8.js +753 -0
  84. flowyml/ui/frontend/dist/index.html +2 -2
  85. flowyml/ui/frontend/dist/logo.png +0 -0
  86. flowyml/ui/frontend/nginx.conf +65 -4
  87. flowyml/ui/frontend/package-lock.json +1415 -74
  88. flowyml/ui/frontend/package.json +4 -0
  89. flowyml/ui/frontend/public/logo.png +0 -0
  90. flowyml/ui/frontend/src/App.jsx +10 -7
  91. flowyml/ui/frontend/src/app/assets/page.jsx +890 -321
  92. flowyml/ui/frontend/src/app/auth/Login.jsx +90 -0
  93. flowyml/ui/frontend/src/app/dashboard/page.jsx +8 -8
  94. flowyml/ui/frontend/src/app/deployments/page.jsx +786 -0
  95. flowyml/ui/frontend/src/app/model-explorer/page.jsx +1031 -0
  96. flowyml/ui/frontend/src/app/pipelines/page.jsx +12 -2
  97. flowyml/ui/frontend/src/app/projects/[projectId]/_components/ProjectExperimentsList.jsx +19 -6
  98. flowyml/ui/frontend/src/app/projects/[projectId]/_components/ProjectMetricsPanel.jsx +1 -1
  99. flowyml/ui/frontend/src/app/runs/[runId]/page.jsx +601 -101
  100. flowyml/ui/frontend/src/app/runs/page.jsx +8 -2
  101. flowyml/ui/frontend/src/app/settings/page.jsx +267 -253
  102. flowyml/ui/frontend/src/components/ArtifactViewer.jsx +62 -2
  103. flowyml/ui/frontend/src/components/AssetDetailsPanel.jsx +424 -29
  104. flowyml/ui/frontend/src/components/AssetTreeHierarchy.jsx +119 -11
  105. flowyml/ui/frontend/src/components/DatasetViewer.jsx +753 -0
  106. flowyml/ui/frontend/src/components/Layout.jsx +6 -0
  107. flowyml/ui/frontend/src/components/PipelineGraph.jsx +79 -29
  108. flowyml/ui/frontend/src/components/RunDetailsPanel.jsx +36 -6
  109. flowyml/ui/frontend/src/components/RunMetaPanel.jsx +113 -0
  110. flowyml/ui/frontend/src/components/TrainingHistoryChart.jsx +514 -0
  111. flowyml/ui/frontend/src/components/TrainingMetricsPanel.jsx +175 -0
  112. flowyml/ui/frontend/src/components/ai/AIAssistantButton.jsx +71 -0
  113. flowyml/ui/frontend/src/components/ai/AIAssistantPanel.jsx +420 -0
  114. flowyml/ui/frontend/src/components/header/Header.jsx +22 -0
  115. flowyml/ui/frontend/src/components/plugins/PluginManager.jsx +4 -4
  116. flowyml/ui/frontend/src/components/plugins/{ZenMLIntegration.jsx → StackImport.jsx} +38 -12
  117. flowyml/ui/frontend/src/components/sidebar/Sidebar.jsx +36 -13
  118. flowyml/ui/frontend/src/contexts/AIAssistantContext.jsx +245 -0
  119. flowyml/ui/frontend/src/contexts/AuthContext.jsx +108 -0
  120. flowyml/ui/frontend/src/hooks/useAIContext.js +156 -0
  121. flowyml/ui/frontend/src/hooks/useWebGPU.js +54 -0
  122. flowyml/ui/frontend/src/layouts/MainLayout.jsx +6 -0
  123. flowyml/ui/frontend/src/router/index.jsx +47 -20
  124. flowyml/ui/frontend/src/services/pluginService.js +3 -1
  125. flowyml/ui/server_manager.py +5 -5
  126. flowyml/ui/utils.py +157 -39
  127. flowyml/utils/config.py +37 -15
  128. flowyml/utils/model_introspection.py +123 -0
  129. flowyml/utils/observability.py +30 -0
  130. flowyml-1.8.0.dist-info/METADATA +174 -0
  131. {flowyml-1.7.1.dist-info → flowyml-1.8.0.dist-info}/RECORD +134 -73
  132. {flowyml-1.7.1.dist-info → flowyml-1.8.0.dist-info}/WHEEL +1 -1
  133. flowyml/ui/frontend/dist/assets/index-BqDQvp63.js +0 -630
  134. flowyml/ui/frontend/dist/assets/index-By4trVyv.css +0 -1
  135. flowyml-1.7.1.dist-info/METADATA +0 -477
  136. {flowyml-1.7.1.dist-info → flowyml-1.8.0.dist-info}/entry_points.txt +0 -0
  137. {flowyml-1.7.1.dist-info → flowyml-1.8.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,753 @@
1
+ var VW=Object.defineProperty;var qW=(e,t,r)=>t in e?VW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ny=(e,t,r)=>qW(e,typeof t!="symbol"?t+"":t,r);function hz(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[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"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var ip=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pz={exports:{}},$g={},mz={exports:{}},Qe={};/**
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 Oh=Symbol.for("react.element"),UW=Symbol.for("react.portal"),HW=Symbol.for("react.fragment"),WW=Symbol.for("react.strict_mode"),GW=Symbol.for("react.profiler"),KW=Symbol.for("react.provider"),YW=Symbol.for("react.context"),XW=Symbol.for("react.forward_ref"),ZW=Symbol.for("react.suspense"),QW=Symbol.for("react.memo"),JW=Symbol.for("react.lazy"),KC=Symbol.iterator;function eG(e){return e===null||typeof e!="object"?null:(e=KC&&e[KC]||e["@@iterator"],typeof e=="function"?e:null)}var gz={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xz=Object.assign,yz={};function vu(e,t,r){this.props=e,this.context=t,this.refs=yz,this.updater=r||gz}vu.prototype.isReactComponent={};vu.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")};vu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function vz(){}vz.prototype=vu.prototype;function m_(e,t,r){this.props=e,this.context=t,this.refs=yz,this.updater=r||gz}var g_=m_.prototype=new vz;g_.constructor=m_;xz(g_,vu.prototype);g_.isPureReactComponent=!0;var YC=Array.isArray,bz=Object.prototype.hasOwnProperty,x_={current:null},wz={key:!0,ref:!0,__self:!0,__source:!0};function jz(e,t,r){var n,a={},i=null,s=null;if(t!=null)for(n in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)bz.call(t,n)&&!wz.hasOwnProperty(n)&&(a[n]=t[n]);var l=arguments.length-2;if(l===1)a.children=r;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(n in l=e.defaultProps,l)a[n]===void 0&&(a[n]=l[n]);return{$$typeof:Oh,type:e,key:i,ref:s,props:a,_owner:x_.current}}function tG(e,t){return{$$typeof:Oh,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function y_(e){return typeof e=="object"&&e!==null&&e.$$typeof===Oh}function rG(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var XC=/\/+/g;function Sy(e,t){return typeof e=="object"&&e!==null&&e.key!=null?rG(""+e.key):t.toString(36)}function hm(e,t,r,n,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Oh:case UW:s=!0}}if(s)return s=e,a=a(s),e=n===""?"."+Sy(s,0):n,YC(a)?(r="",e!=null&&(r=e.replace(XC,"$&/")+"/"),hm(a,t,r,"",function(u){return u})):a!=null&&(y_(a)&&(a=tG(a,r+(!a.key||s&&s.key===a.key?"":(""+a.key).replace(XC,"$&/")+"/")+e)),t.push(a)),1;if(s=0,n=n===""?".":n+":",YC(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+Sy(i,l);s+=hm(i,t,r,c,a)}else if(c=eG(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+Sy(i,l++),s+=hm(i,t,r,c,a);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function sp(e,t,r){if(e==null)return e;var n=[],a=0;return hm(e,n,"","",function(i){return t.call(r,i,a++)}),n}function nG(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Jr={current:null},pm={transition:null},aG={ReactCurrentDispatcher:Jr,ReactCurrentBatchConfig:pm,ReactCurrentOwner:x_};function kz(){throw Error("act(...) is not supported in production builds of React.")}Qe.Children={map:sp,forEach:function(e,t,r){sp(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return sp(e,function(){t++}),t},toArray:function(e){return sp(e,function(t){return t})||[]},only:function(e){if(!y_(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Qe.Component=vu;Qe.Fragment=HW;Qe.Profiler=GW;Qe.PureComponent=m_;Qe.StrictMode=WW;Qe.Suspense=ZW;Qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=aG;Qe.act=kz;Qe.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=xz({},e.props),a=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=x_.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)bz.call(t,c)&&!wz.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:Oh,type:e.type,key:a,ref:i,props:n,_owner:s}};Qe.createContext=function(e){return e={$$typeof:YW,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:KW,_context:e},e.Consumer=e};Qe.createElement=jz;Qe.createFactory=function(e){var t=jz.bind(null,e);return t.type=e,t};Qe.createRef=function(){return{current:null}};Qe.forwardRef=function(e){return{$$typeof:XW,render:e}};Qe.isValidElement=y_;Qe.lazy=function(e){return{$$typeof:JW,_payload:{_status:-1,_result:e},_init:nG}};Qe.memo=function(e,t){return{$$typeof:QW,type:e,compare:t===void 0?null:t}};Qe.startTransition=function(e){var t=pm.transition;pm.transition={};try{e()}finally{pm.transition=t}};Qe.unstable_act=kz;Qe.useCallback=function(e,t){return Jr.current.useCallback(e,t)};Qe.useContext=function(e){return Jr.current.useContext(e)};Qe.useDebugValue=function(){};Qe.useDeferredValue=function(e){return Jr.current.useDeferredValue(e)};Qe.useEffect=function(e,t){return Jr.current.useEffect(e,t)};Qe.useId=function(){return Jr.current.useId()};Qe.useImperativeHandle=function(e,t,r){return Jr.current.useImperativeHandle(e,t,r)};Qe.useInsertionEffect=function(e,t){return Jr.current.useInsertionEffect(e,t)};Qe.useLayoutEffect=function(e,t){return Jr.current.useLayoutEffect(e,t)};Qe.useMemo=function(e,t){return Jr.current.useMemo(e,t)};Qe.useReducer=function(e,t,r){return Jr.current.useReducer(e,t,r)};Qe.useRef=function(e){return Jr.current.useRef(e)};Qe.useState=function(e){return Jr.current.useState(e)};Qe.useSyncExternalStore=function(e,t,r){return Jr.current.useSyncExternalStore(e,t,r)};Qe.useTransition=function(){return Jr.current.useTransition()};Qe.version="18.3.1";mz.exports=Qe;var S=mz.exports;const M=lt(S),Nz=hz({__proto__:null,default:M},[S]);/**
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 iG=S,sG=Symbol.for("react.element"),oG=Symbol.for("react.fragment"),lG=Object.prototype.hasOwnProperty,cG=iG.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,uG={key:!0,ref:!0,__self:!0,__source:!0};function Sz(e,t,r){var n,a={},i=null,s=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)lG.call(t,n)&&!uG.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:sG,type:e,key:i,ref:s,props:a,_owner:cG.current}}$g.Fragment=oG;$g.jsx=Sz;$g.jsxs=Sz;pz.exports=$g;var o=pz.exports,r2={},_z={exports:{}},An={},Ez={exports:{}},Pz={};/**
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(I,$){var F=I.length;I.push($);e:for(;0<F;){var q=F-1>>>1,V=I[q];if(0<a(V,$))I[q]=$,I[F]=V,F=q;else break e}}function r(I){return I.length===0?null:I[0]}function n(I){if(I.length===0)return null;var $=I[0],F=I.pop();if(F!==$){I[0]=F;e:for(var q=0,V=I.length,L=V>>>1;q<L;){var B=2*(q+1)-1,Y=I[B],W=B+1,K=I[W];if(0>a(Y,F))W<V&&0>a(K,Y)?(I[q]=K,I[W]=F,q=W):(I[q]=Y,I[B]=F,q=B);else if(W<V&&0>a(K,F))I[q]=K,I[W]=F,q=W;else break e}}return $}function a(I,$){var F=I.sortIndex-$.sortIndex;return F!==0?F:I.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(I){for(var $=r(u);$!==null;){if($.callback===null)n(u);else if($.startTime<=I)n(u),$.sortIndex=$.expirationTime,t(c,$);else break;$=r(u)}}function j(I){if(g=!1,b(I),!m)if(r(c)!==null)m=!0,D(w);else{var $=r(u);$!==null&&z(j,$.startTime-I)}}function w(I,$){m=!1,g&&(g=!1,x(_),_=-1),p=!0;var F=h;try{for(b($),f=r(c);f!==null&&(!(f.expirationTime>$)||I&&!A());){var q=f.callback;if(typeof q=="function"){f.callback=null,h=f.priorityLevel;var V=q(f.expirationTime<=$);$=e.unstable_now(),typeof V=="function"?f.callback=V:f===r(c)&&n(c),b($)}else n(c);f=r(c)}if(f!==null)var L=!0;else{var B=r(u);B!==null&&z(j,B.startTime-$),L=!1}return L}finally{f=null,h=F,p=!1}}var k=!1,N=null,_=-1,P=5,C=-1;function A(){return!(e.unstable_now()-C<P)}function O(){if(N!==null){var I=e.unstable_now();C=I;var $=!0;try{$=N(!0,I)}finally{$?T():(k=!1,N=null)}}else k=!1}var T;if(typeof v=="function")T=function(){v(O)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,R=E.port2;E.port1.onmessage=O,T=function(){R.postMessage(null)}}else T=function(){y(O,0)};function D(I){N=I,k||(k=!0,T())}function z(I,$){_=y(function(){I(e.unstable_now())},$)}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(I){I.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,D(w))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(I){switch(h){case 1:case 2:case 3:var $=3;break;default:$=h}var F=h;h=$;try{return I()}finally{h=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,$){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var F=h;h=I;try{return $()}finally{h=F}},e.unstable_scheduleCallback=function(I,$,F){var q=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?q+F:q):F=q,I){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=F+V,I={id:d++,callback:$,priorityLevel:I,startTime:F,expirationTime:V,sortIndex:-1},F>q?(I.sortIndex=F,t(u,I),r(c)===null&&I===r(u)&&(g?(x(_),_=-1):g=!0,z(j,F-q))):(I.sortIndex=V,t(c,I),m||p||(m=!0,D(w))),I},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(I){var $=h;return function(){var F=h;h=$;try{return I.apply(this,arguments)}finally{h=F}}}})(Pz);Ez.exports=Pz;var dG=Ez.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 fG=S,En=dG;function oe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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 Cz=new Set,lf={};function pl(e,t){Tc(e,t),Tc(e+"Capture",t)}function Tc(e,t){for(lf[e]=t,e=0;e<t.length;e++)Cz.add(t[e])}var Si=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),n2=Object.prototype.hasOwnProperty,hG=/^[: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]*$/,ZC={},QC={};function pG(e){return n2.call(QC,e)?!0:n2.call(ZC,e)?!1:hG.test(e)?QC[e]=!0:(ZC[e]=!0,!1)}function mG(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function gG(e,t,r,n){if(t===null||typeof t>"u"||mG(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 en(e,t,r,n,a,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Rr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Rr[e]=new en(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Rr[t]=new en(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Rr[e]=new en(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Rr[e]=new en(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){Rr[e]=new en(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Rr[e]=new en(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Rr[e]=new en(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Rr[e]=new en(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Rr[e]=new en(e,5,!1,e.toLowerCase(),null,!1,!1)});var v_=/[\-:]([a-z])/g;function b_(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(v_,b_);Rr[t]=new en(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(v_,b_);Rr[t]=new en(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(v_,b_);Rr[t]=new en(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Rr[e]=new en(e,1,!1,e.toLowerCase(),null,!1,!1)});Rr.xlinkHref=new en("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Rr[e]=new en(e,1,!1,e.toLowerCase(),null,!0,!0)});function w_(e,t,r,n){var a=Rr.hasOwnProperty(t)?Rr[t]:null;(a!==null?a.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(gG(t,r,a,n)&&(r=null),n||a===null?pG(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,n=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Vi=fG.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,op=Symbol.for("react.element"),Hl=Symbol.for("react.portal"),Wl=Symbol.for("react.fragment"),j_=Symbol.for("react.strict_mode"),a2=Symbol.for("react.profiler"),Az=Symbol.for("react.provider"),Oz=Symbol.for("react.context"),k_=Symbol.for("react.forward_ref"),i2=Symbol.for("react.suspense"),s2=Symbol.for("react.suspense_list"),N_=Symbol.for("react.memo"),us=Symbol.for("react.lazy"),Tz=Symbol.for("react.offscreen"),JC=Symbol.iterator;function Uu(e){return e===null||typeof e!="object"?null:(e=JC&&e[JC]||e["@@iterator"],typeof e=="function"?e:null)}var Wt=Object.assign,_y;function kd(e){if(_y===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);_y=t&&t[1]||""}return`
34
+ `+_y+e}var Ey=!1;function Py(e,t){if(!e||Ey)return"";Ey=!0;var r=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 n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var a=u.stack.split(`
35
+ `),i=n.stack.split(`
36
+ `),s=a.length-1,l=i.length-1;1<=s&&0<=l&&a[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(a[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||a[s]!==i[l]){var c=`
37
+ `+a[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=l);break}}}finally{Ey=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?kd(e):""}function xG(e){switch(e.tag){case 5:return kd(e.type);case 16:return kd("Lazy");case 13:return kd("Suspense");case 19:return kd("SuspenseList");case 0:case 2:case 15:return e=Py(e.type,!1),e;case 11:return e=Py(e.type.render,!1),e;case 1:return e=Py(e.type,!0),e;default:return""}}function o2(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 Wl:return"Fragment";case Hl:return"Portal";case a2:return"Profiler";case j_:return"StrictMode";case i2:return"Suspense";case s2:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Oz:return(e.displayName||"Context")+".Consumer";case Az:return(e._context.displayName||"Context")+".Provider";case k_:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case N_:return t=e.displayName||null,t!==null?t:o2(e.type)||"Memo";case us:t=e._payload,e=e._init;try{return o2(e(t))}catch{}}return null}function yG(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 o2(t);case 8:return t===j_?"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 Bs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Mz(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vG(e){var t=Mz(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lp(e){e._valueTracker||(e._valueTracker=vG(e))}function Rz(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Mz(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Fm(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 l2(e,t){var r=t.checked;return Wt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function eA(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Bs(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Dz(e,t){t=t.checked,t!=null&&w_(e,"checked",t,!1)}function c2(e,t){Dz(e,t);var r=Bs(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?u2(e,t.type,r):t.hasOwnProperty("defaultValue")&&u2(e,t.type,Bs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function tA(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function u2(e,t,r){(t!=="number"||Fm(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Nd=Array.isArray;function pc(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Bs(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function d2(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(oe(91));return Wt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function rA(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(oe(92));if(Nd(r)){if(1<r.length)throw Error(oe(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Bs(r)}}function $z(e,t){var r=Bs(t.value),n=Bs(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function nA(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Iz(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 f2(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Iz(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var cp,Lz=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(cp=cp||document.createElement("div"),cp.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=cp.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cf(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Bd={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},bG=["Webkit","ms","Moz","O"];Object.keys(Bd).forEach(function(e){bG.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Bd[t]=Bd[e]})});function zz(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Bd.hasOwnProperty(e)&&Bd[e]?(""+t).trim():t+"px"}function Fz(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=zz(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var wG=Wt({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 h2(e,t){if(t){if(wG[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function p2(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 m2=null;function S_(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var g2=null,mc=null,gc=null;function aA(e){if(e=Rh(e)){if(typeof g2!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=Bg(t),g2(e.stateNode,e.type,t))}}function Bz(e){mc?gc?gc.push(e):gc=[e]:mc=e}function Vz(){if(mc){var e=mc,t=gc;if(gc=mc=null,aA(e),t)for(e=0;e<t.length;e++)aA(t[e])}}function qz(e,t){return e(t)}function Uz(){}var Cy=!1;function Hz(e,t,r){if(Cy)return e(t,r);Cy=!0;try{return qz(e,t,r)}finally{Cy=!1,(mc!==null||gc!==null)&&(Uz(),Vz())}}function uf(e,t){var r=e.stateNode;if(r===null)return null;var n=Bg(r);if(n===null)return null;r=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(oe(231,t,typeof r));return r}var x2=!1;if(Si)try{var Hu={};Object.defineProperty(Hu,"passive",{get:function(){x2=!0}}),window.addEventListener("test",Hu,Hu),window.removeEventListener("test",Hu,Hu)}catch{x2=!1}function jG(e,t,r,n,a,i,s,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var Vd=!1,Bm=null,Vm=!1,y2=null,kG={onError:function(e){Vd=!0,Bm=e}};function NG(e,t,r,n,a,i,s,l,c){Vd=!1,Bm=null,jG.apply(kG,arguments)}function SG(e,t,r,n,a,i,s,l,c){if(NG.apply(this,arguments),Vd){if(Vd){var u=Bm;Vd=!1,Bm=null}else throw Error(oe(198));Vm||(Vm=!0,y2=u)}}function ml(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Wz(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 iA(e){if(ml(e)!==e)throw Error(oe(188))}function _G(e){var t=e.alternate;if(!t){if(t=ml(e),t===null)throw Error(oe(188));return t!==e?null:e}for(var r=e,n=t;;){var a=r.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return iA(a),e;if(i===n)return iA(a),t;i=i.sibling}throw Error(oe(188))}if(r.return!==n.return)r=a,n=i;else{for(var s=!1,l=a.child;l;){if(l===r){s=!0,r=a,n=i;break}if(l===n){s=!0,n=a,r=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===r){s=!0,r=i,n=a;break}if(l===n){s=!0,n=i,r=a;break}l=l.sibling}if(!s)throw Error(oe(189))}}if(r.alternate!==n)throw Error(oe(190))}if(r.tag!==3)throw Error(oe(188));return r.stateNode.current===r?e:t}function Gz(e){return e=_G(e),e!==null?Kz(e):null}function Kz(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Kz(e);if(t!==null)return t;e=e.sibling}return null}var Yz=En.unstable_scheduleCallback,sA=En.unstable_cancelCallback,EG=En.unstable_shouldYield,PG=En.unstable_requestPaint,tr=En.unstable_now,CG=En.unstable_getCurrentPriorityLevel,__=En.unstable_ImmediatePriority,Xz=En.unstable_UserBlockingPriority,qm=En.unstable_NormalPriority,AG=En.unstable_LowPriority,Zz=En.unstable_IdlePriority,Ig=null,qa=null;function OG(e){if(qa&&typeof qa.onCommitFiberRoot=="function")try{qa.onCommitFiberRoot(Ig,e,void 0,(e.current.flags&128)===128)}catch{}}var Na=Math.clz32?Math.clz32:RG,TG=Math.log,MG=Math.LN2;function RG(e){return e>>>=0,e===0?32:31-(TG(e)/MG|0)|0}var up=64,dp=4194304;function Sd(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 Um(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var l=s&~a;l!==0?n=Sd(l):(i&=s,i!==0&&(n=Sd(i)))}else s=r&~a,s!==0?n=Sd(s):i!==0&&(n=Sd(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Na(t),a=1<<r,n|=e[r],t&=~a;return n}function DG(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 $G(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Na(i),l=1<<s,c=a[s];c===-1?(!(l&r)||l&n)&&(a[s]=DG(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function v2(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Qz(){var e=up;return up<<=1,!(up&4194240)&&(up=64),e}function Ay(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Th(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Na(t),e[t]=r}function IG(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-Na(r),i=1<<a;t[a]=0,n[a]=-1,e[a]=-1,r&=~i}}function E_(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Na(r),a=1<<n;a&t|e[n]&t&&(e[n]|=t),r&=~a}}var xt=0;function Jz(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var e6,P_,t6,r6,n6,b2=!1,fp=[],Cs=null,As=null,Os=null,df=new Map,ff=new Map,ps=[],LG="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 oA(e,t){switch(e){case"focusin":case"focusout":Cs=null;break;case"dragenter":case"dragleave":As=null;break;case"mouseover":case"mouseout":Os=null;break;case"pointerover":case"pointerout":df.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ff.delete(t.pointerId)}}function Wu(e,t,r,n,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Rh(t),t!==null&&P_(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function zG(e,t,r,n,a){switch(t){case"focusin":return Cs=Wu(Cs,e,t,r,n,a),!0;case"dragenter":return As=Wu(As,e,t,r,n,a),!0;case"mouseover":return Os=Wu(Os,e,t,r,n,a),!0;case"pointerover":var i=a.pointerId;return df.set(i,Wu(df.get(i)||null,e,t,r,n,a)),!0;case"gotpointercapture":return i=a.pointerId,ff.set(i,Wu(ff.get(i)||null,e,t,r,n,a)),!0}return!1}function a6(e){var t=So(e.target);if(t!==null){var r=ml(t);if(r!==null){if(t=r.tag,t===13){if(t=Wz(r),t!==null){e.blockedOn=t,n6(e.priority,function(){t6(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function mm(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=w2(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);m2=n,r.target.dispatchEvent(n),m2=null}else return t=Rh(r),t!==null&&P_(t),e.blockedOn=r,!1;t.shift()}return!0}function lA(e,t,r){mm(e)&&r.delete(t)}function FG(){b2=!1,Cs!==null&&mm(Cs)&&(Cs=null),As!==null&&mm(As)&&(As=null),Os!==null&&mm(Os)&&(Os=null),df.forEach(lA),ff.forEach(lA)}function Gu(e,t){e.blockedOn===t&&(e.blockedOn=null,b2||(b2=!0,En.unstable_scheduleCallback(En.unstable_NormalPriority,FG)))}function hf(e){function t(a){return Gu(a,e)}if(0<fp.length){Gu(fp[0],e);for(var r=1;r<fp.length;r++){var n=fp[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Cs!==null&&Gu(Cs,e),As!==null&&Gu(As,e),Os!==null&&Gu(Os,e),df.forEach(t),ff.forEach(t),r=0;r<ps.length;r++)n=ps[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<ps.length&&(r=ps[0],r.blockedOn===null);)a6(r),r.blockedOn===null&&ps.shift()}var xc=Vi.ReactCurrentBatchConfig,Hm=!0;function BG(e,t,r,n){var a=xt,i=xc.transition;xc.transition=null;try{xt=1,C_(e,t,r,n)}finally{xt=a,xc.transition=i}}function VG(e,t,r,n){var a=xt,i=xc.transition;xc.transition=null;try{xt=4,C_(e,t,r,n)}finally{xt=a,xc.transition=i}}function C_(e,t,r,n){if(Hm){var a=w2(e,t,r,n);if(a===null)Fy(e,t,n,Wm,r),oA(e,n);else if(zG(a,e,t,r,n))n.stopPropagation();else if(oA(e,n),t&4&&-1<LG.indexOf(e)){for(;a!==null;){var i=Rh(a);if(i!==null&&e6(i),i=w2(e,t,r,n),i===null&&Fy(e,t,n,Wm,r),i===a)break;a=i}a!==null&&n.stopPropagation()}else Fy(e,t,n,null,r)}}var Wm=null;function w2(e,t,r,n){if(Wm=null,e=S_(n),e=So(e),e!==null)if(t=ml(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Wz(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Wm=e,null}function i6(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(CG()){case __:return 1;case Xz:return 4;case qm:case AG:return 16;case Zz:return 536870912;default:return 16}default:return 16}}var js=null,A_=null,gm=null;function s6(){if(gm)return gm;var e,t=A_,r=t.length,n,a="value"in js?js.value:js.textContent,i=a.length;for(e=0;e<r&&t[e]===a[e];e++);var s=r-e;for(n=1;n<=s&&t[r-n]===a[i-n];n++);return gm=a.slice(e,1<n?1-n:void 0)}function xm(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 hp(){return!0}function cA(){return!1}function On(e){function t(r,n,a,i,s){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?hp:cA,this.isPropagationStopped=cA,this}return Wt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=hp)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=hp)},persist:function(){},isPersistent:hp}),t}var bu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},O_=On(bu),Mh=Wt({},bu,{view:0,detail:0}),qG=On(Mh),Oy,Ty,Ku,Lg=Wt({},Mh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:T_,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!==Ku&&(Ku&&e.type==="mousemove"?(Oy=e.screenX-Ku.screenX,Ty=e.screenY-Ku.screenY):Ty=Oy=0,Ku=e),Oy)},movementY:function(e){return"movementY"in e?e.movementY:Ty}}),uA=On(Lg),UG=Wt({},Lg,{dataTransfer:0}),HG=On(UG),WG=Wt({},Mh,{relatedTarget:0}),My=On(WG),GG=Wt({},bu,{animationName:0,elapsedTime:0,pseudoElement:0}),KG=On(GG),YG=Wt({},bu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),XG=On(YG),ZG=Wt({},bu,{data:0}),dA=On(ZG),QG={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JG={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"},eK={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tK(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=eK[e])?!!t[e]:!1}function T_(){return tK}var rK=Wt({},Mh,{key:function(e){if(e.key){var t=QG[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xm(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?JG[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:T_,charCode:function(e){return e.type==="keypress"?xm(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xm(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nK=On(rK),aK=Wt({},Lg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fA=On(aK),iK=Wt({},Mh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:T_}),sK=On(iK),oK=Wt({},bu,{propertyName:0,elapsedTime:0,pseudoElement:0}),lK=On(oK),cK=Wt({},Lg,{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}),uK=On(cK),dK=[9,13,27,32],M_=Si&&"CompositionEvent"in window,qd=null;Si&&"documentMode"in document&&(qd=document.documentMode);var fK=Si&&"TextEvent"in window&&!qd,o6=Si&&(!M_||qd&&8<qd&&11>=qd),hA=" ",pA=!1;function l6(e,t){switch(e){case"keyup":return dK.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c6(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gl=!1;function hK(e,t){switch(e){case"compositionend":return c6(t);case"keypress":return t.which!==32?null:(pA=!0,hA);case"textInput":return e=t.data,e===hA&&pA?null:e;default:return null}}function pK(e,t){if(Gl)return e==="compositionend"||!M_&&l6(e,t)?(e=s6(),gm=A_=js=null,Gl=!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 o6&&t.locale!=="ko"?null:t.data;default:return null}}var mK={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 mA(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!mK[e.type]:t==="textarea"}function u6(e,t,r,n){Bz(n),t=Gm(t,"onChange"),0<t.length&&(r=new O_("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Ud=null,pf=null;function gK(e){w6(e,0)}function zg(e){var t=Xl(e);if(Rz(t))return e}function xK(e,t){if(e==="change")return t}var d6=!1;if(Si){var Ry;if(Si){var Dy="oninput"in document;if(!Dy){var gA=document.createElement("div");gA.setAttribute("oninput","return;"),Dy=typeof gA.oninput=="function"}Ry=Dy}else Ry=!1;d6=Ry&&(!document.documentMode||9<document.documentMode)}function xA(){Ud&&(Ud.detachEvent("onpropertychange",f6),pf=Ud=null)}function f6(e){if(e.propertyName==="value"&&zg(pf)){var t=[];u6(t,pf,e,S_(e)),Hz(gK,t)}}function yK(e,t,r){e==="focusin"?(xA(),Ud=t,pf=r,Ud.attachEvent("onpropertychange",f6)):e==="focusout"&&xA()}function vK(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zg(pf)}function bK(e,t){if(e==="click")return zg(t)}function wK(e,t){if(e==="input"||e==="change")return zg(t)}function jK(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Aa=typeof Object.is=="function"?Object.is:jK;function mf(e,t){if(Aa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var a=r[n];if(!n2.call(t,a)||!Aa(e[a],t[a]))return!1}return!0}function yA(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vA(e,t){var r=yA(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=yA(r)}}function h6(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?h6(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function p6(){for(var e=window,t=Fm();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Fm(e.document)}return t}function R_(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 kK(e){var t=p6(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&h6(r.ownerDocument.documentElement,r)){if(n!==null&&R_(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=vA(r,i);var s=vA(r,n);a&&s&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var NK=Si&&"documentMode"in document&&11>=document.documentMode,Kl=null,j2=null,Hd=null,k2=!1;function bA(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;k2||Kl==null||Kl!==Fm(n)||(n=Kl,"selectionStart"in n&&R_(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Hd&&mf(Hd,n)||(Hd=n,n=Gm(j2,"onSelect"),0<n.length&&(t=new O_("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Kl)))}function pp(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Yl={animationend:pp("Animation","AnimationEnd"),animationiteration:pp("Animation","AnimationIteration"),animationstart:pp("Animation","AnimationStart"),transitionend:pp("Transition","TransitionEnd")},$y={},m6={};Si&&(m6=document.createElement("div").style,"AnimationEvent"in window||(delete Yl.animationend.animation,delete Yl.animationiteration.animation,delete Yl.animationstart.animation),"TransitionEvent"in window||delete Yl.transitionend.transition);function Fg(e){if($y[e])return $y[e];if(!Yl[e])return e;var t=Yl[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in m6)return $y[e]=t[r];return e}var g6=Fg("animationend"),x6=Fg("animationiteration"),y6=Fg("animationstart"),v6=Fg("transitionend"),b6=new Map,wA="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 Ks(e,t){b6.set(e,t),pl(t,[e])}for(var Iy=0;Iy<wA.length;Iy++){var Ly=wA[Iy],SK=Ly.toLowerCase(),_K=Ly[0].toUpperCase()+Ly.slice(1);Ks(SK,"on"+_K)}Ks(g6,"onAnimationEnd");Ks(x6,"onAnimationIteration");Ks(y6,"onAnimationStart");Ks("dblclick","onDoubleClick");Ks("focusin","onFocus");Ks("focusout","onBlur");Ks(v6,"onTransitionEnd");Tc("onMouseEnter",["mouseout","mouseover"]);Tc("onMouseLeave",["mouseout","mouseover"]);Tc("onPointerEnter",["pointerout","pointerover"]);Tc("onPointerLeave",["pointerout","pointerover"]);pl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));pl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));pl("onBeforeInput",["compositionend","keypress","textInput","paste"]);pl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));pl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));pl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _d="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(" "),EK=new Set("cancel close invalid load scroll toggle".split(" ").concat(_d));function jA(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,SG(n,t,void 0,e),e.currentTarget=null}function w6(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],a=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var s=n.length-1;0<=s;s--){var l=n[s],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;jA(a,l,u),i=c}else for(s=0;s<n.length;s++){if(l=n[s],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;jA(a,l,u),i=c}}}if(Vm)throw e=y2,Vm=!1,y2=null,e}function Ot(e,t){var r=t[P2];r===void 0&&(r=t[P2]=new Set);var n=e+"__bubble";r.has(n)||(j6(t,e,2,!1),r.add(n))}function zy(e,t,r){var n=0;t&&(n|=4),j6(r,e,n,t)}var mp="_reactListening"+Math.random().toString(36).slice(2);function gf(e){if(!e[mp]){e[mp]=!0,Cz.forEach(function(r){r!=="selectionchange"&&(EK.has(r)||zy(r,!1,e),zy(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mp]||(t[mp]=!0,zy("selectionchange",!1,t))}}function j6(e,t,r,n){switch(i6(t)){case 1:var a=BG;break;case 4:a=VG;break;default:a=C_}r=a.bind(null,t,r,e),a=void 0,!x2||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function Fy(e,t,r,n,a){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var s=n.tag;if(s===3||s===4){var l=n.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(s===4)for(s=n.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;s=s.return}for(;l!==null;){if(s=So(l),s===null)return;if(c=s.tag,c===5||c===6){n=i=s;continue e}l=l.parentNode}}n=n.return}Hz(function(){var u=i,d=S_(r),f=[];e:{var h=b6.get(e);if(h!==void 0){var p=O_,m=e;switch(e){case"keypress":if(xm(r)===0)break e;case"keydown":case"keyup":p=nK;break;case"focusin":m="focus",p=My;break;case"focusout":m="blur",p=My;break;case"beforeblur":case"afterblur":p=My;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=uA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=HG;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=sK;break;case g6:case x6:case y6:p=KG;break;case v6:p=lK;break;case"scroll":p=qG;break;case"wheel":p=uK;break;case"copy":case"cut":case"paste":p=XG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=fA}var g=(t&4)!==0,y=!g&&e==="scroll",x=g?h!==null?h+"Capture":null:h;g=[];for(var v=u,b;v!==null;){b=v;var j=b.stateNode;if(b.tag===5&&j!==null&&(b=j,x!==null&&(j=uf(v,x),j!=null&&g.push(xf(v,j,b)))),y)break;v=v.return}0<g.length&&(h=new p(h,m,null,r,d),f.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&r!==m2&&(m=r.relatedTarget||r.fromElement)&&(So(m)||m[_i]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=r.relatedTarget||r.toElement,p=u,m=m?So(m):null,m!==null&&(y=ml(m),m!==y||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=u),p!==m)){if(g=uA,j="onMouseLeave",x="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=fA,j="onPointerLeave",x="onPointerEnter",v="pointer"),y=p==null?h:Xl(p),b=m==null?h:Xl(m),h=new g(j,v+"leave",p,r,d),h.target=y,h.relatedTarget=b,j=null,So(d)===u&&(g=new g(x,v+"enter",m,r,d),g.target=b,g.relatedTarget=y,j=g),y=j,p&&m)t:{for(g=p,x=m,v=0,b=g;b;b=Cl(b))v++;for(b=0,j=x;j;j=Cl(j))b++;for(;0<v-b;)g=Cl(g),v--;for(;0<b-v;)x=Cl(x),b--;for(;v--;){if(g===x||x!==null&&g===x.alternate)break t;g=Cl(g),x=Cl(x)}g=null}else g=null;p!==null&&kA(f,h,p,g,!1),m!==null&&y!==null&&kA(f,y,m,g,!0)}}e:{if(h=u?Xl(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var w=xK;else if(mA(h))if(d6)w=wK;else{w=vK;var k=yK}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(w=bK);if(w&&(w=w(e,u))){u6(f,w,r,d);break e}k&&k(e,h,u),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&u2(h,"number",h.value)}switch(k=u?Xl(u):window,e){case"focusin":(mA(k)||k.contentEditable==="true")&&(Kl=k,j2=u,Hd=null);break;case"focusout":Hd=j2=Kl=null;break;case"mousedown":k2=!0;break;case"contextmenu":case"mouseup":case"dragend":k2=!1,bA(f,r,d);break;case"selectionchange":if(NK)break;case"keydown":case"keyup":bA(f,r,d)}var N;if(M_)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Gl?l6(e,r)&&(_="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(_="onCompositionStart");_&&(o6&&r.locale!=="ko"&&(Gl||_!=="onCompositionStart"?_==="onCompositionEnd"&&Gl&&(N=s6()):(js=d,A_="value"in js?js.value:js.textContent,Gl=!0)),k=Gm(u,_),0<k.length&&(_=new dA(_,e,null,r,d),f.push({event:_,listeners:k}),N?_.data=N:(N=c6(r),N!==null&&(_.data=N)))),(N=fK?hK(e,r):pK(e,r))&&(u=Gm(u,"onBeforeInput"),0<u.length&&(d=new dA("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:u}),d.data=N))}w6(f,t)})}function xf(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Gm(e,t){for(var r=t+"Capture",n=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=uf(e,r),i!=null&&n.unshift(xf(e,i,a)),i=uf(e,t),i!=null&&n.push(xf(e,i,a))),e=e.return}return n}function Cl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function kA(e,t,r,n,a){for(var i=t._reactName,s=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,a?(c=uf(r,i),c!=null&&s.unshift(xf(r,c,l))):a||(c=uf(r,i),c!=null&&s.push(xf(r,c,l)))),r=r.return}s.length!==0&&e.push({event:t,listeners:s})}var PK=/\r\n?/g,CK=/\u0000|\uFFFD/g;function NA(e){return(typeof e=="string"?e:""+e).replace(PK,`
38
+ `).replace(CK,"")}function gp(e,t,r){if(t=NA(t),NA(e)!==t&&r)throw Error(oe(425))}function Km(){}var N2=null,S2=null;function _2(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 E2=typeof setTimeout=="function"?setTimeout:void 0,AK=typeof clearTimeout=="function"?clearTimeout:void 0,SA=typeof Promise=="function"?Promise:void 0,OK=typeof queueMicrotask=="function"?queueMicrotask:typeof SA<"u"?function(e){return SA.resolve(null).then(e).catch(TK)}:E2;function TK(e){setTimeout(function(){throw e})}function By(e,t){var r=t,n=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){e.removeChild(a),hf(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);hf(t)}function Ts(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 _A(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var wu=Math.random().toString(36).slice(2),La="__reactFiber$"+wu,yf="__reactProps$"+wu,_i="__reactContainer$"+wu,P2="__reactEvents$"+wu,MK="__reactListeners$"+wu,RK="__reactHandles$"+wu;function So(e){var t=e[La];if(t)return t;for(var r=e.parentNode;r;){if(t=r[_i]||r[La]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=_A(e);e!==null;){if(r=e[La])return r;e=_A(e)}return t}e=r,r=e.parentNode}return null}function Rh(e){return e=e[La]||e[_i],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(oe(33))}function Bg(e){return e[yf]||null}var C2=[],Zl=-1;function Ys(e){return{current:e}}function Mt(e){0>Zl||(e.current=C2[Zl],C2[Zl]=null,Zl--)}function St(e,t){Zl++,C2[Zl]=e.current,e.current=t}var Vs={},qr=Ys(Vs),ln=Ys(!1),Go=Vs;function Mc(e,t){var r=e.type.contextTypes;if(!r)return Vs;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function cn(e){return e=e.childContextTypes,e!=null}function Ym(){Mt(ln),Mt(qr)}function EA(e,t,r){if(qr.current!==Vs)throw Error(oe(168));St(qr,t),St(ln,r)}function k6(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(oe(108,yG(e)||"Unknown",a));return Wt({},r,n)}function Xm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vs,Go=qr.current,St(qr,e),St(ln,ln.current),!0}function PA(e,t,r){var n=e.stateNode;if(!n)throw Error(oe(169));r?(e=k6(e,t,Go),n.__reactInternalMemoizedMergedChildContext=e,Mt(ln),Mt(qr),St(qr,e)):Mt(ln),St(ln,r)}var si=null,Vg=!1,Vy=!1;function N6(e){si===null?si=[e]:si.push(e)}function DK(e){Vg=!0,N6(e)}function Xs(){if(!Vy&&si!==null){Vy=!0;var e=0,t=xt;try{var r=si;for(xt=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}si=null,Vg=!1}catch(a){throw si!==null&&(si=si.slice(e+1)),Yz(__,Xs),a}finally{xt=t,Vy=!1}}return null}var Ql=[],Jl=0,Zm=null,Qm=0,Vn=[],qn=0,Ko=null,li=1,ci="";function mo(e,t){Ql[Jl++]=Qm,Ql[Jl++]=Zm,Zm=e,Qm=t}function S6(e,t,r){Vn[qn++]=li,Vn[qn++]=ci,Vn[qn++]=Ko,Ko=e;var n=li;e=ci;var a=32-Na(n)-1;n&=~(1<<a),r+=1;var i=32-Na(t)+a;if(30<i){var s=a-a%5;i=(n&(1<<s)-1).toString(32),n>>=s,a-=s,li=1<<32-Na(t)+a|r<<a|n,ci=i+e}else li=1<<i|r<<a|n,ci=e}function D_(e){e.return!==null&&(mo(e,1),S6(e,1,0))}function $_(e){for(;e===Zm;)Zm=Ql[--Jl],Ql[Jl]=null,Qm=Ql[--Jl],Ql[Jl]=null;for(;e===Ko;)Ko=Vn[--qn],Vn[qn]=null,ci=Vn[--qn],Vn[qn]=null,li=Vn[--qn],Vn[qn]=null}var _n=null,Nn=null,It=!1,ba=null;function _6(e,t){var r=Hn(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function CA(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,_n=e,Nn=Ts(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,_n=e,Nn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Ko!==null?{id:li,overflow:ci}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Hn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,_n=e,Nn=null,!0):!1;default:return!1}}function A2(e){return(e.mode&1)!==0&&(e.flags&128)===0}function O2(e){if(It){var t=Nn;if(t){var r=t;if(!CA(e,t)){if(A2(e))throw Error(oe(418));t=Ts(r.nextSibling);var n=_n;t&&CA(e,t)?_6(n,r):(e.flags=e.flags&-4097|2,It=!1,_n=e)}}else{if(A2(e))throw Error(oe(418));e.flags=e.flags&-4097|2,It=!1,_n=e}}}function AA(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;_n=e}function xp(e){if(e!==_n)return!1;if(!It)return AA(e),It=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!_2(e.type,e.memoizedProps)),t&&(t=Nn)){if(A2(e))throw E6(),Error(oe(418));for(;t;)_6(e,t),t=Ts(t.nextSibling)}if(AA(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(oe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Nn=Ts(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Nn=null}}else Nn=_n?Ts(e.stateNode.nextSibling):null;return!0}function E6(){for(var e=Nn;e;)e=Ts(e.nextSibling)}function Rc(){Nn=_n=null,It=!1}function I_(e){ba===null?ba=[e]:ba.push(e)}var $K=Vi.ReactCurrentBatchConfig;function Yu(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(oe(309));var n=r.stateNode}if(!n)throw Error(oe(147,e));var a=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=a.refs;s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(oe(284));if(!r._owner)throw Error(oe(290,e))}return e}function yp(e,t){throw e=Object.prototype.toString.call(t),Error(oe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function OA(e){var t=e._init;return t(e._payload)}function P6(e){function t(x,v){if(e){var b=x.deletions;b===null?(x.deletions=[v],x.flags|=16):b.push(v)}}function r(x,v){if(!e)return null;for(;v!==null;)t(x,v),v=v.sibling;return null}function n(x,v){for(x=new Map;v!==null;)v.key!==null?x.set(v.key,v):x.set(v.index,v),v=v.sibling;return x}function a(x,v){return x=$s(x,v),x.index=0,x.sibling=null,x}function i(x,v,b){return x.index=b,e?(b=x.alternate,b!==null?(b=b.index,b<v?(x.flags|=2,v):b):(x.flags|=2,v)):(x.flags|=1048576,v)}function s(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,v,b,j){return v===null||v.tag!==6?(v=Yy(b,x.mode,j),v.return=x,v):(v=a(v,b),v.return=x,v)}function c(x,v,b,j){var w=b.type;return w===Wl?d(x,v,b.props.children,j,b.key):v!==null&&(v.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===us&&OA(w)===v.type)?(j=a(v,b.props),j.ref=Yu(x,v,b),j.return=x,j):(j=Nm(b.type,b.key,b.props,null,x.mode,j),j.ref=Yu(x,v,b),j.return=x,j)}function u(x,v,b,j){return v===null||v.tag!==4||v.stateNode.containerInfo!==b.containerInfo||v.stateNode.implementation!==b.implementation?(v=Xy(b,x.mode,j),v.return=x,v):(v=a(v,b.children||[]),v.return=x,v)}function d(x,v,b,j,w){return v===null||v.tag!==7?(v=Fo(b,x.mode,j,w),v.return=x,v):(v=a(v,b),v.return=x,v)}function f(x,v,b){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Yy(""+v,x.mode,b),v.return=x,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case op:return b=Nm(v.type,v.key,v.props,null,x.mode,b),b.ref=Yu(x,null,v),b.return=x,b;case Hl:return v=Xy(v,x.mode,b),v.return=x,v;case us:var j=v._init;return f(x,j(v._payload),b)}if(Nd(v)||Uu(v))return v=Fo(v,x.mode,b,null),v.return=x,v;yp(x,v)}return null}function h(x,v,b,j){var w=v!==null?v.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return w!==null?null:l(x,v,""+b,j);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case op:return b.key===w?c(x,v,b,j):null;case Hl:return b.key===w?u(x,v,b,j):null;case us:return w=b._init,h(x,v,w(b._payload),j)}if(Nd(b)||Uu(b))return w!==null?null:d(x,v,b,j,null);yp(x,b)}return null}function p(x,v,b,j,w){if(typeof j=="string"&&j!==""||typeof j=="number")return x=x.get(b)||null,l(v,x,""+j,w);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case op:return x=x.get(j.key===null?b:j.key)||null,c(v,x,j,w);case Hl:return x=x.get(j.key===null?b:j.key)||null,u(v,x,j,w);case us:var k=j._init;return p(x,v,b,k(j._payload),w)}if(Nd(j)||Uu(j))return x=x.get(b)||null,d(v,x,j,w,null);yp(v,j)}return null}function m(x,v,b,j){for(var w=null,k=null,N=v,_=v=0,P=null;N!==null&&_<b.length;_++){N.index>_?(P=N,N=null):P=N.sibling;var C=h(x,N,b[_],j);if(C===null){N===null&&(N=P);break}e&&N&&C.alternate===null&&t(x,N),v=i(C,v,_),k===null?w=C:k.sibling=C,k=C,N=P}if(_===b.length)return r(x,N),It&&mo(x,_),w;if(N===null){for(;_<b.length;_++)N=f(x,b[_],j),N!==null&&(v=i(N,v,_),k===null?w=N:k.sibling=N,k=N);return It&&mo(x,_),w}for(N=n(x,N);_<b.length;_++)P=p(N,x,_,b[_],j),P!==null&&(e&&P.alternate!==null&&N.delete(P.key===null?_:P.key),v=i(P,v,_),k===null?w=P:k.sibling=P,k=P);return e&&N.forEach(function(A){return t(x,A)}),It&&mo(x,_),w}function g(x,v,b,j){var w=Uu(b);if(typeof w!="function")throw Error(oe(150));if(b=w.call(b),b==null)throw Error(oe(151));for(var k=w=null,N=v,_=v=0,P=null,C=b.next();N!==null&&!C.done;_++,C=b.next()){N.index>_?(P=N,N=null):P=N.sibling;var A=h(x,N,C.value,j);if(A===null){N===null&&(N=P);break}e&&N&&A.alternate===null&&t(x,N),v=i(A,v,_),k===null?w=A:k.sibling=A,k=A,N=P}if(C.done)return r(x,N),It&&mo(x,_),w;if(N===null){for(;!C.done;_++,C=b.next())C=f(x,C.value,j),C!==null&&(v=i(C,v,_),k===null?w=C:k.sibling=C,k=C);return It&&mo(x,_),w}for(N=n(x,N);!C.done;_++,C=b.next())C=p(N,x,_,C.value,j),C!==null&&(e&&C.alternate!==null&&N.delete(C.key===null?_:C.key),v=i(C,v,_),k===null?w=C:k.sibling=C,k=C);return e&&N.forEach(function(O){return t(x,O)}),It&&mo(x,_),w}function y(x,v,b,j){if(typeof b=="object"&&b!==null&&b.type===Wl&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case op:e:{for(var w=b.key,k=v;k!==null;){if(k.key===w){if(w=b.type,w===Wl){if(k.tag===7){r(x,k.sibling),v=a(k,b.props.children),v.return=x,x=v;break e}}else if(k.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===us&&OA(w)===k.type){r(x,k.sibling),v=a(k,b.props),v.ref=Yu(x,k,b),v.return=x,x=v;break e}r(x,k);break}else t(x,k);k=k.sibling}b.type===Wl?(v=Fo(b.props.children,x.mode,j,b.key),v.return=x,x=v):(j=Nm(b.type,b.key,b.props,null,x.mode,j),j.ref=Yu(x,v,b),j.return=x,x=j)}return s(x);case Hl:e:{for(k=b.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){r(x,v.sibling),v=a(v,b.children||[]),v.return=x,x=v;break e}else{r(x,v);break}else t(x,v);v=v.sibling}v=Xy(b,x.mode,j),v.return=x,x=v}return s(x);case us:return k=b._init,y(x,v,k(b._payload),j)}if(Nd(b))return m(x,v,b,j);if(Uu(b))return g(x,v,b,j);yp(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,v!==null&&v.tag===6?(r(x,v.sibling),v=a(v,b),v.return=x,x=v):(r(x,v),v=Yy(b,x.mode,j),v.return=x,x=v),s(x)):r(x,v)}return y}var Dc=P6(!0),C6=P6(!1),Jm=Ys(null),e0=null,ec=null,L_=null;function z_(){L_=ec=e0=null}function F_(e){var t=Jm.current;Mt(Jm),e._currentValue=t}function T2(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function yc(e,t){e0=e,L_=ec=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(an=!0),e.firstContext=null)}function ta(e){var t=e._currentValue;if(L_!==e)if(e={context:e,memoizedValue:t,next:null},ec===null){if(e0===null)throw Error(oe(308));ec=e,e0.dependencies={lanes:0,firstContext:e}}else ec=ec.next=e;return t}var _o=null;function B_(e){_o===null?_o=[e]:_o.push(e)}function A6(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,B_(t)):(r.next=a.next,a.next=r),t.interleaved=r,Ei(e,n)}function Ei(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var ds=!1;function V_(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function O6(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 gi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ms(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,it&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Ei(e,r)}return a=n.interleaved,a===null?(t.next=t,B_(n)):(t.next=a.next,a.next=t),n.interleaved=t,Ei(e,r)}function ym(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,E_(e,r)}}function TA(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=s:i=i.next=s,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function t0(e,t,r,n){var a=e.updateQueue;ds=!1;var i=a.firstBaseUpdate,s=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,s===null?i=u:s.next=u,s=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==s&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=a.baseState;s=0,d=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(h=t,p=r,g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=Wt({},f,h);break e;case 2:ds=!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,s|=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 s|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);Xo|=s,e.lanes=s,e.memoizedState=f}}function MA(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(oe(191,a));a.call(n)}}}var Dh={},Ua=Ys(Dh),vf=Ys(Dh),bf=Ys(Dh);function Eo(e){if(e===Dh)throw Error(oe(174));return e}function q_(e,t){switch(St(bf,t),St(vf,e),St(Ua,Dh),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:f2(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=f2(t,e)}Mt(Ua),St(Ua,t)}function $c(){Mt(Ua),Mt(vf),Mt(bf)}function T6(e){Eo(bf.current);var t=Eo(Ua.current),r=f2(t,e.type);t!==r&&(St(vf,e),St(Ua,r))}function U_(e){vf.current===e&&(Mt(Ua),Mt(vf))}var qt=Ys(0);function r0(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.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 qy=[];function H_(){for(var e=0;e<qy.length;e++)qy[e]._workInProgressVersionPrimary=null;qy.length=0}var vm=Vi.ReactCurrentDispatcher,Uy=Vi.ReactCurrentBatchConfig,Yo=0,Ht=null,pr=null,wr=null,n0=!1,Wd=!1,wf=0,IK=0;function $r(){throw Error(oe(321))}function W_(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Aa(e[r],t[r]))return!1;return!0}function G_(e,t,r,n,a,i){if(Yo=i,Ht=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,vm.current=e===null||e.memoizedState===null?BK:VK,e=r(n,a),Wd){i=0;do{if(Wd=!1,wf=0,25<=i)throw Error(oe(301));i+=1,wr=pr=null,t.updateQueue=null,vm.current=qK,e=r(n,a)}while(Wd)}if(vm.current=a0,t=pr!==null&&pr.next!==null,Yo=0,wr=pr=Ht=null,n0=!1,t)throw Error(oe(300));return e}function K_(){var e=wf!==0;return wf=0,e}function Ia(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wr===null?Ht.memoizedState=wr=e:wr=wr.next=e,wr}function ra(){if(pr===null){var e=Ht.alternate;e=e!==null?e.memoizedState:null}else e=pr.next;var t=wr===null?Ht.memoizedState:wr.next;if(t!==null)wr=t,pr=e;else{if(e===null)throw Error(oe(310));pr=e,e={memoizedState:pr.memoizedState,baseState:pr.baseState,baseQueue:pr.baseQueue,queue:pr.queue,next:null},wr===null?Ht.memoizedState=wr=e:wr=wr.next=e}return wr}function jf(e,t){return typeof t=="function"?t(e):t}function Hy(e){var t=ra(),r=t.queue;if(r===null)throw Error(oe(311));r.lastRenderedReducer=e;var n=pr,a=n.baseQueue,i=r.pending;if(i!==null){if(a!==null){var s=a.next;a.next=i.next,i.next=s}n.baseQueue=a=i,r.pending=null}if(a!==null){i=a.next,n=n.baseState;var l=s=null,c=null,u=i;do{var d=u.lane;if((Yo&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,s=n):c=c.next=f,Ht.lanes|=d,Xo|=d}u=u.next}while(u!==null&&u!==i);c===null?s=n:c.next=l,Aa(n,t.memoizedState)||(an=!0),t.memoizedState=n,t.baseState=s,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){a=e;do i=a.lane,Ht.lanes|=i,Xo|=i,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Wy(e){var t=ra(),r=t.queue;if(r===null)throw Error(oe(311));r.lastRenderedReducer=e;var n=r.dispatch,a=r.pending,i=t.memoizedState;if(a!==null){r.pending=null;var s=a=a.next;do i=e(i,s.action),s=s.next;while(s!==a);Aa(i,t.memoizedState)||(an=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function M6(){}function R6(e,t){var r=Ht,n=ra(),a=t(),i=!Aa(n.memoizedState,a);if(i&&(n.memoizedState=a,an=!0),n=n.queue,Y_(I6.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||wr!==null&&wr.memoizedState.tag&1){if(r.flags|=2048,kf(9,$6.bind(null,r,n,a,t),void 0,null),jr===null)throw Error(oe(349));Yo&30||D6(r,t,a)}return a}function D6(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ht.updateQueue,t===null?(t={lastEffect:null,stores:null},Ht.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function $6(e,t,r,n){t.value=r,t.getSnapshot=n,L6(t)&&z6(e)}function I6(e,t,r){return r(function(){L6(t)&&z6(e)})}function L6(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Aa(e,r)}catch{return!0}}function z6(e){var t=Ei(e,1);t!==null&&Sa(t,e,1,-1)}function RA(e){var t=Ia();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:jf,lastRenderedState:e},t.queue=e,e=e.dispatch=FK.bind(null,Ht,e),[t.memoizedState,e]}function kf(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Ht.updateQueue,t===null?(t={lastEffect:null,stores:null},Ht.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function F6(){return ra().memoizedState}function bm(e,t,r,n){var a=Ia();Ht.flags|=e,a.memoizedState=kf(1|t,r,void 0,n===void 0?null:n)}function qg(e,t,r,n){var a=ra();n=n===void 0?null:n;var i=void 0;if(pr!==null){var s=pr.memoizedState;if(i=s.destroy,n!==null&&W_(n,s.deps)){a.memoizedState=kf(t,r,i,n);return}}Ht.flags|=e,a.memoizedState=kf(1|t,r,i,n)}function DA(e,t){return bm(8390656,8,e,t)}function Y_(e,t){return qg(2048,8,e,t)}function B6(e,t){return qg(4,2,e,t)}function V6(e,t){return qg(4,4,e,t)}function q6(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 U6(e,t,r){return r=r!=null?r.concat([e]):null,qg(4,4,q6.bind(null,t,e),r)}function X_(){}function H6(e,t){var r=ra();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&W_(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function W6(e,t){var r=ra();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&W_(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function G6(e,t,r){return Yo&21?(Aa(r,t)||(r=Qz(),Ht.lanes|=r,Xo|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,an=!0),e.memoizedState=r)}function LK(e,t){var r=xt;xt=r!==0&&4>r?r:4,e(!0);var n=Uy.transition;Uy.transition={};try{e(!1),t()}finally{xt=r,Uy.transition=n}}function K6(){return ra().memoizedState}function zK(e,t,r){var n=Ds(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Y6(e))X6(t,r);else if(r=A6(e,t,r,n),r!==null){var a=Xr();Sa(r,e,n,a),Z6(r,t,n)}}function FK(e,t,r){var n=Ds(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Y6(e))X6(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,r);if(a.hasEagerState=!0,a.eagerState=l,Aa(l,s)){var c=t.interleaved;c===null?(a.next=a,B_(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}r=A6(e,t,a,n),r!==null&&(a=Xr(),Sa(r,e,n,a),Z6(r,t,n))}}function Y6(e){var t=e.alternate;return e===Ht||t!==null&&t===Ht}function X6(e,t){Wd=n0=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Z6(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,E_(e,r)}}var a0={readContext:ta,useCallback:$r,useContext:$r,useEffect:$r,useImperativeHandle:$r,useInsertionEffect:$r,useLayoutEffect:$r,useMemo:$r,useReducer:$r,useRef:$r,useState:$r,useDebugValue:$r,useDeferredValue:$r,useTransition:$r,useMutableSource:$r,useSyncExternalStore:$r,useId:$r,unstable_isNewReconciler:!1},BK={readContext:ta,useCallback:function(e,t){return Ia().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:DA,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,bm(4194308,4,q6.bind(null,t,e),r)},useLayoutEffect:function(e,t){return bm(4194308,4,e,t)},useInsertionEffect:function(e,t){return bm(4,2,e,t)},useMemo:function(e,t){var r=Ia();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ia();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=zK.bind(null,Ht,e),[n.memoizedState,e]},useRef:function(e){var t=Ia();return e={current:e},t.memoizedState=e},useState:RA,useDebugValue:X_,useDeferredValue:function(e){return Ia().memoizedState=e},useTransition:function(){var e=RA(!1),t=e[0];return e=LK.bind(null,e[1]),Ia().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ht,a=Ia();if(It){if(r===void 0)throw Error(oe(407));r=r()}else{if(r=t(),jr===null)throw Error(oe(349));Yo&30||D6(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,DA(I6.bind(null,n,i,e),[e]),n.flags|=2048,kf(9,$6.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Ia(),t=jr.identifierPrefix;if(It){var r=ci,n=li;r=(n&~(1<<32-Na(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=wf++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=IK++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},VK={readContext:ta,useCallback:H6,useContext:ta,useEffect:Y_,useImperativeHandle:U6,useInsertionEffect:B6,useLayoutEffect:V6,useMemo:W6,useReducer:Hy,useRef:F6,useState:function(){return Hy(jf)},useDebugValue:X_,useDeferredValue:function(e){var t=ra();return G6(t,pr.memoizedState,e)},useTransition:function(){var e=Hy(jf)[0],t=ra().memoizedState;return[e,t]},useMutableSource:M6,useSyncExternalStore:R6,useId:K6,unstable_isNewReconciler:!1},qK={readContext:ta,useCallback:H6,useContext:ta,useEffect:Y_,useImperativeHandle:U6,useInsertionEffect:B6,useLayoutEffect:V6,useMemo:W6,useReducer:Wy,useRef:F6,useState:function(){return Wy(jf)},useDebugValue:X_,useDeferredValue:function(e){var t=ra();return pr===null?t.memoizedState=e:G6(t,pr.memoizedState,e)},useTransition:function(){var e=Wy(jf)[0],t=ra().memoizedState;return[e,t]},useMutableSource:M6,useSyncExternalStore:R6,useId:K6,unstable_isNewReconciler:!1};function pa(e,t){if(e&&e.defaultProps){t=Wt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function M2(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Wt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Ug={isMounted:function(e){return(e=e._reactInternals)?ml(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Xr(),a=Ds(e),i=gi(n,a);i.payload=t,r!=null&&(i.callback=r),t=Ms(e,i,a),t!==null&&(Sa(t,e,a,n),ym(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Xr(),a=Ds(e),i=gi(n,a);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=Ms(e,i,a),t!==null&&(Sa(t,e,a,n),ym(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Xr(),n=Ds(e),a=gi(r,n);a.tag=2,t!=null&&(a.callback=t),t=Ms(e,a,n),t!==null&&(Sa(t,e,n,r),ym(t,e,n))}};function $A(e,t,r,n,a,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,s):t.prototype&&t.prototype.isPureReactComponent?!mf(r,n)||!mf(a,i):!0}function Q6(e,t,r){var n=!1,a=Vs,i=t.contextType;return typeof i=="object"&&i!==null?i=ta(i):(a=cn(t)?Go:qr.current,n=t.contextTypes,i=(n=n!=null)?Mc(e,a):Vs),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ug,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function IA(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Ug.enqueueReplaceState(t,t.state,null)}function R2(e,t,r,n){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},V_(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=ta(i):(i=cn(t)?Go:qr.current,a.context=Mc(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(M2(e,t,i,r),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&&Ug.enqueueReplaceState(a,a.state,null),t0(e,r,a,n),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Ic(e,t){try{var r="",n=t;do r+=xG(n),n=n.return;while(n);var a=r}catch(i){a=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:a,digest:null}}function Gy(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function D2(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var UK=typeof WeakMap=="function"?WeakMap:Map;function J6(e,t,r){r=gi(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){s0||(s0=!0,H2=n),D2(e,t)},r}function e8(e,t,r){r=gi(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var a=t.value;r.payload=function(){return n(a)},r.callback=function(){D2(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){D2(e,t),typeof n!="function"&&(Rs===null?Rs=new Set([this]):Rs.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),r}function LA(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new UK;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(r)||(a.add(r),e=aY.bind(null,e,t,r),t.then(e,e))}function zA(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 FA(e,t,r,n,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=gi(-1,1),t.tag=2,Ms(r,t,1))),r.lanes|=1),e)}var HK=Vi.ReactCurrentOwner,an=!1;function Gr(e,t,r,n){t.child=e===null?C6(t,null,r,n):Dc(t,e.child,r,n)}function BA(e,t,r,n,a){r=r.render;var i=t.ref;return yc(t,a),n=G_(e,t,r,n,i,a),r=K_(),e!==null&&!an?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Pi(e,t,a)):(It&&r&&D_(t),t.flags|=1,Gr(e,t,n,a),t.child)}function VA(e,t,r,n,a){if(e===null){var i=r.type;return typeof i=="function"&&!aE(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,t8(e,t,i,n,a)):(e=Nm(r.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var s=i.memoizedProps;if(r=r.compare,r=r!==null?r:mf,r(s,n)&&e.ref===t.ref)return Pi(e,t,a)}return t.flags|=1,e=$s(i,n),e.ref=t.ref,e.return=t,t.child=e}function t8(e,t,r,n,a){if(e!==null){var i=e.memoizedProps;if(mf(i,n)&&e.ref===t.ref)if(an=!1,t.pendingProps=n=i,(e.lanes&a)!==0)e.flags&131072&&(an=!0);else return t.lanes=e.lanes,Pi(e,t,a)}return $2(e,t,r,n,a)}function r8(e,t,r){var n=t.pendingProps,a=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},St(rc,xn),xn|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,St(rc,xn),xn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,St(rc,xn),xn|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,St(rc,xn),xn|=n;return Gr(e,t,a,r),t.child}function n8(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function $2(e,t,r,n,a){var i=cn(r)?Go:qr.current;return i=Mc(t,i),yc(t,a),r=G_(e,t,r,n,i,a),n=K_(),e!==null&&!an?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Pi(e,t,a)):(It&&n&&D_(t),t.flags|=1,Gr(e,t,r,a),t.child)}function qA(e,t,r,n,a){if(cn(r)){var i=!0;Xm(t)}else i=!1;if(yc(t,a),t.stateNode===null)wm(e,t),Q6(t,r,n),R2(t,r,n,a),n=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var c=s.context,u=r.contextType;typeof u=="object"&&u!==null?u=ta(u):(u=cn(r)?Go:qr.current,u=Mc(t,u));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==n||c!==u)&&IA(t,s,n,u),ds=!1;var h=t.memoizedState;s.state=h,t0(t,n,s,a),c=t.memoizedState,l!==n||h!==c||ln.current||ds?(typeof d=="function"&&(M2(t,r,d,n),c=t.memoizedState),(l=ds||$A(t,r,l,n,h,c,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),s.props=n,s.state=c,s.context=u,n=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,O6(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:pa(t.type,l),s.props=u,f=t.pendingProps,h=s.context,c=r.contextType,typeof c=="object"&&c!==null?c=ta(c):(c=cn(r)?Go:qr.current,c=Mc(t,c));var p=r.getDerivedStateFromProps;(d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||h!==c)&&IA(t,s,n,c),ds=!1,h=t.memoizedState,s.state=h,t0(t,n,s,a);var m=t.memoizedState;l!==f||h!==m||ln.current||ds?(typeof p=="function"&&(M2(t,r,p,n),m=t.memoizedState),(u=ds||$A(t,r,u,n,h,m,c)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,m,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,m,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=m),s.props=n,s.state=m,s.context=c,n=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return I2(e,t,r,n,i,a)}function I2(e,t,r,n,a,i){n8(e,t);var s=(t.flags&128)!==0;if(!n&&!s)return a&&PA(t,r,!1),Pi(e,t,i);n=t.stateNode,HK.current=t;var l=s&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&s?(t.child=Dc(t,e.child,null,i),t.child=Dc(t,null,l,i)):Gr(e,t,l,i),t.memoizedState=n.state,a&&PA(t,r,!0),t.child}function a8(e){var t=e.stateNode;t.pendingContext?EA(e,t.pendingContext,t.pendingContext!==t.context):t.context&&EA(e,t.context,!1),q_(e,t.containerInfo)}function UA(e,t,r,n,a){return Rc(),I_(a),t.flags|=256,Gr(e,t,r,n),t.child}var L2={dehydrated:null,treeContext:null,retryLane:0};function z2(e){return{baseLanes:e,cachePool:null,transitions:null}}function i8(e,t,r){var n=t.pendingProps,a=qt.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),St(qt,a&1),e===null)return O2(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=n.children,e=n.fallback,i?(n=t.mode,i=t.child,s={mode:"hidden",children:s},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Gg(s,n,0,null),e=Fo(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=z2(r),t.memoizedState=L2,e):Z_(t,s));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return WK(e,t,s,n,l,a,r);if(i){i=n.fallback,s=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:n.children};return!(s&1)&&t.child!==a?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=$s(a,c),n.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=$s(l,i):(i=Fo(i,s,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,s=e.child.memoizedState,s=s===null?z2(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~r,t.memoizedState=L2,n}return i=e.child,e=i.sibling,n=$s(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Z_(e,t){return t=Gg({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vp(e,t,r,n){return n!==null&&I_(n),Dc(t,e.child,null,r),e=Z_(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function WK(e,t,r,n,a,i,s){if(r)return t.flags&256?(t.flags&=-257,n=Gy(Error(oe(422))),vp(e,t,s,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,a=t.mode,n=Gg({mode:"visible",children:n.children},a,0,null),i=Fo(i,a,s,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Dc(t,e.child,null,s),t.child.memoizedState=z2(s),t.memoizedState=L2,i);if(!(t.mode&1))return vp(e,t,s,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(oe(419)),n=Gy(i,n,void 0),vp(e,t,s,n)}if(l=(s&e.childLanes)!==0,an||l){if(n=jr,n!==null){switch(s&-s){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&(n.suspendedLanes|s)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Ei(e,a),Sa(n,e,a,-1))}return nE(),n=Gy(Error(oe(421))),vp(e,t,s,n)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=iY.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,Nn=Ts(a.nextSibling),_n=t,It=!0,ba=null,e!==null&&(Vn[qn++]=li,Vn[qn++]=ci,Vn[qn++]=Ko,li=e.id,ci=e.overflow,Ko=t),t=Z_(t,n.children),t.flags|=4096,t)}function HA(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),T2(e.return,t,r)}function Ky(e,t,r,n,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function s8(e,t,r){var n=t.pendingProps,a=n.revealOrder,i=n.tail;if(Gr(e,t,n.children,r),n=qt.current,n&2)n=n&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&&HA(e,r,t);else if(e.tag===19)HA(e,r,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}n&=1}if(St(qt,n),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&r0(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),Ky(t,!1,a,r,i);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&r0(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}Ky(t,!0,r,null,i);break;case"together":Ky(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wm(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pi(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Xo|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,r=$s(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=$s(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function GK(e,t,r){switch(t.tag){case 3:a8(t),Rc();break;case 5:T6(t);break;case 1:cn(t.type)&&Xm(t);break;case 4:q_(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,a=t.memoizedProps.value;St(Jm,n._currentValue),n._currentValue=a;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(St(qt,qt.current&1),t.flags|=128,null):r&t.child.childLanes?i8(e,t,r):(St(qt,qt.current&1),e=Pi(e,t,r),e!==null?e.sibling:null);St(qt,qt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return s8(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),St(qt,qt.current),n)break;return null;case 22:case 23:return t.lanes=0,r8(e,t,r)}return Pi(e,t,r)}var o8,F2,l8,c8;o8=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};F2=function(){};l8=function(e,t,r,n){var a=e.memoizedProps;if(a!==n){e=t.stateNode,Eo(Ua.current);var i=null;switch(r){case"input":a=l2(e,a),n=l2(e,n),i=[];break;case"select":a=Wt({},a,{value:void 0}),n=Wt({},n,{value:void 0}),i=[];break;case"textarea":a=d2(e,a),n=d2(e,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Km)}h2(r,n);var s;r=null;for(u in a)if(!n.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(s in l)l.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(lf.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=a!=null?a[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(r||(r={}),r[s]=c[s])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(lf.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Ot("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};c8=function(e,t,r,n){r!==n&&(t.flags|=4)};function Xu(e,t){if(!It)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ir(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function KK(e,t,r){var n=t.pendingProps;switch($_(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ir(t),null;case 1:return cn(t.type)&&Ym(),Ir(t),null;case 3:return n=t.stateNode,$c(),Mt(ln),Mt(qr),H_(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(xp(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ba!==null&&(K2(ba),ba=null))),F2(e,t),Ir(t),null;case 5:U_(t);var a=Eo(bf.current);if(r=t.type,e!==null&&t.stateNode!=null)l8(e,t,r,n,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(oe(166));return Ir(t),null}if(e=Eo(Ua.current),xp(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[La]=t,n[yf]=i,e=(t.mode&1)!==0,r){case"dialog":Ot("cancel",n),Ot("close",n);break;case"iframe":case"object":case"embed":Ot("load",n);break;case"video":case"audio":for(a=0;a<_d.length;a++)Ot(_d[a],n);break;case"source":Ot("error",n);break;case"img":case"image":case"link":Ot("error",n),Ot("load",n);break;case"details":Ot("toggle",n);break;case"input":eA(n,i),Ot("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},Ot("invalid",n);break;case"textarea":rA(n,i),Ot("invalid",n)}h2(r,i),a=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&gp(n.textContent,l,e),a=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&gp(n.textContent,l,e),a=["children",""+l]):lf.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&Ot("scroll",n)}switch(r){case"input":lp(n),tA(n,i,!0);break;case"textarea":lp(n),nA(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Km)}n=a,t.updateQueue=n,n!==null&&(t.flags|=4)}else{s=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Iz(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[La]=t,e[yf]=n,o8(e,t,!1,!1),t.stateNode=e;e:{switch(s=p2(r,n),r){case"dialog":Ot("cancel",e),Ot("close",e),a=n;break;case"iframe":case"object":case"embed":Ot("load",e),a=n;break;case"video":case"audio":for(a=0;a<_d.length;a++)Ot(_d[a],e);a=n;break;case"source":Ot("error",e),a=n;break;case"img":case"image":case"link":Ot("error",e),Ot("load",e),a=n;break;case"details":Ot("toggle",e),a=n;break;case"input":eA(e,n),a=l2(e,n),Ot("invalid",e);break;case"option":a=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=Wt({},n,{value:void 0}),Ot("invalid",e);break;case"textarea":rA(e,n),a=d2(e,n),Ot("invalid",e);break;default:a=n}h2(r,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Fz(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Lz(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&cf(e,c):typeof c=="number"&&cf(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(lf.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Ot("scroll",e):c!=null&&w_(e,i,c,s))}switch(r){case"input":lp(e),tA(e,n,!1);break;case"textarea":lp(e),nA(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Bs(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?pc(e,!!n.multiple,i,!1):n.defaultValue!=null&&pc(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Km)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ir(t),null;case 6:if(e&&t.stateNode!=null)c8(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(oe(166));if(r=Eo(bf.current),Eo(Ua.current),xp(t)){if(n=t.stateNode,r=t.memoizedProps,n[La]=t,(i=n.nodeValue!==r)&&(e=_n,e!==null))switch(e.tag){case 3:gp(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&gp(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[La]=t,t.stateNode=n}return Ir(t),null;case 13:if(Mt(qt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(It&&Nn!==null&&t.mode&1&&!(t.flags&128))E6(),Rc(),t.flags|=98560,i=!1;else if(i=xp(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(oe(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(oe(317));i[La]=t}else Rc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ir(t),i=!1}else ba!==null&&(K2(ba),ba=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||qt.current&1?mr===0&&(mr=3):nE())),t.updateQueue!==null&&(t.flags|=4),Ir(t),null);case 4:return $c(),F2(e,t),e===null&&gf(t.stateNode.containerInfo),Ir(t),null;case 10:return F_(t.type._context),Ir(t),null;case 17:return cn(t.type)&&Ym(),Ir(t),null;case 19:if(Mt(qt),i=t.memoizedState,i===null)return Ir(t),null;if(n=(t.flags&128)!==0,s=i.rendering,s===null)if(n)Xu(i,!1);else{if(mr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=r0(e),s!==null){for(t.flags|=128,Xu(i,!1),n=s.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return St(qt,qt.current&1|2),t.child}e=e.sibling}i.tail!==null&&tr()>Lc&&(t.flags|=128,n=!0,Xu(i,!1),t.lanes=4194304)}else{if(!n)if(e=r0(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Xu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!It)return Ir(t),null}else 2*tr()-i.renderingStartTime>Lc&&r!==1073741824&&(t.flags|=128,n=!0,Xu(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=tr(),t.sibling=null,r=qt.current,St(qt,n?r&1|2:r&1),t):(Ir(t),null);case 22:case 23:return rE(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?xn&1073741824&&(Ir(t),t.subtreeFlags&6&&(t.flags|=8192)):Ir(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function YK(e,t){switch($_(t),t.tag){case 1:return cn(t.type)&&Ym(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $c(),Mt(ln),Mt(qr),H_(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return U_(t),null;case 13:if(Mt(qt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Rc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Mt(qt),null;case 4:return $c(),null;case 10:return F_(t.type._context),null;case 22:case 23:return rE(),null;case 24:return null;default:return null}}var bp=!1,zr=!1,XK=typeof WeakSet=="function"?WeakSet:Set,ve=null;function tc(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Kt(e,t,n)}else r.current=null}function B2(e,t,r){try{r()}catch(n){Kt(e,t,n)}}var WA=!1;function ZK(e,t){if(N2=Hm,e=p6(),R_(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==r||a!==0&&f.nodeType!==3||(l=s+a),f!==i||n!==0&&f.nodeType!==3||(c=s+n),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===r&&++u===a&&(l=s),h===i&&++d===n&&(c=s),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(S2={focusedElem:e,selectionRange:r},Hm=!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 m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,y=m.memoizedState,x=t.stateNode,v=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:pa(t.type,g),y);x.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(j){Kt(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,ve=e;break}ve=t.return}return m=WA,WA=!1,m}function Gd(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&B2(t,r,i)}a=a.next}while(a!==n)}}function Hg(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function V2(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function u8(e){var t=e.alternate;t!==null&&(e.alternate=null,u8(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[La],delete t[yf],delete t[P2],delete t[MK],delete t[RK])),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 d8(e){return e.tag===5||e.tag===3||e.tag===4}function GA(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||d8(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 q2(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Km));else if(n!==4&&(e=e.child,e!==null))for(q2(e,t,r),e=e.sibling;e!==null;)q2(e,t,r),e=e.sibling}function U2(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(U2(e,t,r),e=e.sibling;e!==null;)U2(e,t,r),e=e.sibling}var Cr=null,ma=!1;function es(e,t,r){for(r=r.child;r!==null;)f8(e,t,r),r=r.sibling}function f8(e,t,r){if(qa&&typeof qa.onCommitFiberUnmount=="function")try{qa.onCommitFiberUnmount(Ig,r)}catch{}switch(r.tag){case 5:zr||tc(r,t);case 6:var n=Cr,a=ma;Cr=null,es(e,t,r),Cr=n,ma=a,Cr!==null&&(ma?(e=Cr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Cr.removeChild(r.stateNode));break;case 18:Cr!==null&&(ma?(e=Cr,r=r.stateNode,e.nodeType===8?By(e.parentNode,r):e.nodeType===1&&By(e,r),hf(e)):By(Cr,r.stateNode));break;case 4:n=Cr,a=ma,Cr=r.stateNode.containerInfo,ma=!0,es(e,t,r),Cr=n,ma=a;break;case 0:case 11:case 14:case 15:if(!zr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&B2(r,t,s),a=a.next}while(a!==n)}es(e,t,r);break;case 1:if(!zr&&(tc(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Kt(r,t,l)}es(e,t,r);break;case 21:es(e,t,r);break;case 22:r.mode&1?(zr=(n=zr)||r.memoizedState!==null,es(e,t,r),zr=n):es(e,t,r);break;default:es(e,t,r)}}function KA(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new XK),t.forEach(function(n){var a=sY.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function da(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Cr=l.stateNode,ma=!1;break e;case 3:Cr=l.stateNode.containerInfo,ma=!0;break e;case 4:Cr=l.stateNode.containerInfo,ma=!0;break e}l=l.return}if(Cr===null)throw Error(oe(160));f8(i,s,a),Cr=null,ma=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){Kt(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)h8(t,e),t=t.sibling}function h8(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(da(t,e),$a(e),n&4){try{Gd(3,e,e.return),Hg(3,e)}catch(g){Kt(e,e.return,g)}try{Gd(5,e,e.return)}catch(g){Kt(e,e.return,g)}}break;case 1:da(t,e),$a(e),n&512&&r!==null&&tc(r,r.return);break;case 5:if(da(t,e),$a(e),n&512&&r!==null&&tc(r,r.return),e.flags&32){var a=e.stateNode;try{cf(a,"")}catch(g){Kt(e,e.return,g)}}if(n&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,s=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Dz(a,i),p2(l,s);var u=p2(l,i);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];d==="style"?Fz(a,f):d==="dangerouslySetInnerHTML"?Lz(a,f):d==="children"?cf(a,f):w_(a,d,f,u)}switch(l){case"input":c2(a,i);break;case"textarea":$z(a,i);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?pc(a,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?pc(a,!!i.multiple,i.defaultValue,!0):pc(a,!!i.multiple,i.multiple?[]:"",!1))}a[yf]=i}catch(g){Kt(e,e.return,g)}}break;case 6:if(da(t,e),$a(e),n&4){if(e.stateNode===null)throw Error(oe(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(g){Kt(e,e.return,g)}}break;case 3:if(da(t,e),$a(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{hf(t.containerInfo)}catch(g){Kt(e,e.return,g)}break;case 4:da(t,e),$a(e);break;case 13:da(t,e),$a(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(eE=tr())),n&4&&KA(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(zr=(u=zr)||d,da(t,e),zr=u):da(t,e),$a(e),n&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:Gd(4,h,h.return);break;case 1:tc(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){Kt(n,r,g)}}break;case 5:tc(h,h.return);break;case 22:if(h.memoizedState!==null){XA(f);continue}}p!==null?(p.return=h,ve=p):XA(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=zz("display",s))}catch(g){Kt(e,e.return,g)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){Kt(e,e.return,g)}}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:da(t,e),$a(e),n&4&&KA(e);break;case 21:break;default:da(t,e),$a(e)}}function $a(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(d8(r)){var n=r;break e}r=r.return}throw Error(oe(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(cf(a,""),n.flags&=-33);var i=GA(e);U2(e,i,a);break;case 3:case 4:var s=n.stateNode.containerInfo,l=GA(e);q2(e,l,s);break;default:throw Error(oe(161))}}catch(c){Kt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function QK(e,t,r){ve=e,p8(e)}function p8(e,t,r){for(var n=(e.mode&1)!==0;ve!==null;){var a=ve,i=a.child;if(a.tag===22&&n){var s=a.memoizedState!==null||bp;if(!s){var l=a.alternate,c=l!==null&&l.memoizedState!==null||zr;l=bp;var u=zr;if(bp=s,(zr=c)&&!u)for(ve=a;ve!==null;)s=ve,c=s.child,s.tag===22&&s.memoizedState!==null?ZA(a):c!==null?(c.return=s,ve=c):ZA(a);for(;i!==null;)ve=i,p8(i),i=i.sibling;ve=a,bp=l,zr=u}YA(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,ve=i):YA(e)}}function YA(e){for(;ve!==null;){var t=ve;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:zr||Hg(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!zr)if(r===null)n.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:pa(t.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&MA(t,i,n);break;case 3:var s=t.updateQueue;if(s!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}MA(t,s,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.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&&hf(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(oe(163))}zr||t.flags&512&&V2(t)}catch(h){Kt(t,t.return,h)}}if(t===e){ve=null;break}if(r=t.sibling,r!==null){r.return=t.return,ve=r;break}ve=t.return}}function XA(e){for(;ve!==null;){var t=ve;if(t===e){ve=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ve=r;break}ve=t.return}}function ZA(e){for(;ve!==null;){var t=ve;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Hg(4,t)}catch(c){Kt(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var a=t.return;try{n.componentDidMount()}catch(c){Kt(t,a,c)}}var i=t.return;try{V2(t)}catch(c){Kt(t,i,c)}break;case 5:var s=t.return;try{V2(t)}catch(c){Kt(t,s,c)}}}catch(c){Kt(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 JK=Math.ceil,i0=Vi.ReactCurrentDispatcher,Q_=Vi.ReactCurrentOwner,Yn=Vi.ReactCurrentBatchConfig,it=0,jr=null,lr=null,Mr=0,xn=0,rc=Ys(0),mr=0,Nf=null,Xo=0,Wg=0,J_=0,Kd=null,nn=null,eE=0,Lc=1/0,ii=null,s0=!1,H2=null,Rs=null,wp=!1,ks=null,o0=0,Yd=0,W2=null,jm=-1,km=0;function Xr(){return it&6?tr():jm!==-1?jm:jm=tr()}function Ds(e){return e.mode&1?it&2&&Mr!==0?Mr&-Mr:$K.transition!==null?(km===0&&(km=Qz()),km):(e=xt,e!==0||(e=window.event,e=e===void 0?16:i6(e.type)),e):1}function Sa(e,t,r,n){if(50<Yd)throw Yd=0,W2=null,Error(oe(185));Th(e,r,n),(!(it&2)||e!==jr)&&(e===jr&&(!(it&2)&&(Wg|=r),mr===4&&ms(e,Mr)),un(e,n),r===1&&it===0&&!(t.mode&1)&&(Lc=tr()+500,Vg&&Xs()))}function un(e,t){var r=e.callbackNode;$G(e,t);var n=Um(e,e===jr?Mr:0);if(n===0)r!==null&&sA(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&sA(r),t===1)e.tag===0?DK(QA.bind(null,e)):N6(QA.bind(null,e)),OK(function(){!(it&6)&&Xs()}),r=null;else{switch(Jz(n)){case 1:r=__;break;case 4:r=Xz;break;case 16:r=qm;break;case 536870912:r=Zz;break;default:r=qm}r=j8(r,m8.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function m8(e,t){if(jm=-1,km=0,it&6)throw Error(oe(327));var r=e.callbackNode;if(vc()&&e.callbackNode!==r)return null;var n=Um(e,e===jr?Mr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=l0(e,n);else{t=n;var a=it;it|=2;var i=x8();(jr!==e||Mr!==t)&&(ii=null,Lc=tr()+500,zo(e,t));do try{rY();break}catch(l){g8(e,l)}while(!0);z_(),i0.current=i,it=a,lr!==null?t=0:(jr=null,Mr=0,t=mr)}if(t!==0){if(t===2&&(a=v2(e),a!==0&&(n=a,t=G2(e,a))),t===1)throw r=Nf,zo(e,0),ms(e,n),un(e,tr()),r;if(t===6)ms(e,n);else{if(a=e.current.alternate,!(n&30)&&!eY(a)&&(t=l0(e,n),t===2&&(i=v2(e),i!==0&&(n=i,t=G2(e,i))),t===1))throw r=Nf,zo(e,0),ms(e,n),un(e,tr()),r;switch(e.finishedWork=a,e.finishedLanes=n,t){case 0:case 1:throw Error(oe(345));case 2:go(e,nn,ii);break;case 3:if(ms(e,n),(n&130023424)===n&&(t=eE+500-tr(),10<t)){if(Um(e,0)!==0)break;if(a=e.suspendedLanes,(a&n)!==n){Xr(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=E2(go.bind(null,e,nn,ii),t);break}go(e,nn,ii);break;case 4:if(ms(e,n),(n&4194240)===n)break;for(t=e.eventTimes,a=-1;0<n;){var s=31-Na(n);i=1<<s,s=t[s],s>a&&(a=s),n&=~i}if(n=a,n=tr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*JK(n/1960))-n,10<n){e.timeoutHandle=E2(go.bind(null,e,nn,ii),n);break}go(e,nn,ii);break;case 5:go(e,nn,ii);break;default:throw Error(oe(329))}}}return un(e,tr()),e.callbackNode===r?m8.bind(null,e):null}function G2(e,t){var r=Kd;return e.current.memoizedState.isDehydrated&&(zo(e,t).flags|=256),e=l0(e,t),e!==2&&(t=nn,nn=r,t!==null&&K2(t)),e}function K2(e){nn===null?nn=e:nn.push.apply(nn,e)}function eY(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var a=r[n],i=a.getSnapshot;a=a.value;try{if(!Aa(i(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 ms(e,t){for(t&=~J_,t&=~Wg,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Na(t),n=1<<r;e[r]=-1,t&=~n}}function QA(e){if(it&6)throw Error(oe(327));vc();var t=Um(e,0);if(!(t&1))return un(e,tr()),null;var r=l0(e,t);if(e.tag!==0&&r===2){var n=v2(e);n!==0&&(t=n,r=G2(e,n))}if(r===1)throw r=Nf,zo(e,0),ms(e,t),un(e,tr()),r;if(r===6)throw Error(oe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,go(e,nn,ii),un(e,tr()),null}function tE(e,t){var r=it;it|=1;try{return e(t)}finally{it=r,it===0&&(Lc=tr()+500,Vg&&Xs())}}function Zo(e){ks!==null&&ks.tag===0&&!(it&6)&&vc();var t=it;it|=1;var r=Yn.transition,n=xt;try{if(Yn.transition=null,xt=1,e)return e()}finally{xt=n,Yn.transition=r,it=t,!(it&6)&&Xs()}}function rE(){xn=rc.current,Mt(rc)}function zo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,AK(r)),lr!==null)for(r=lr.return;r!==null;){var n=r;switch($_(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Ym();break;case 3:$c(),Mt(ln),Mt(qr),H_();break;case 5:U_(n);break;case 4:$c();break;case 13:Mt(qt);break;case 19:Mt(qt);break;case 10:F_(n.type._context);break;case 22:case 23:rE()}r=r.return}if(jr=e,lr=e=$s(e.current,null),Mr=xn=t,mr=0,Nf=null,J_=Wg=Xo=0,nn=Kd=null,_o!==null){for(t=0;t<_o.length;t++)if(r=_o[t],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,i=r.pending;if(i!==null){var s=i.next;i.next=a,n.next=s}r.pending=n}_o=null}return e}function g8(e,t){do{var r=lr;try{if(z_(),vm.current=a0,n0){for(var n=Ht.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}n0=!1}if(Yo=0,wr=pr=Ht=null,Wd=!1,wf=0,Q_.current=null,r===null||r.return===null){mr=1,Nf=t,lr=null;break}e:{var i=e,s=r.return,l=r,c=t;if(t=Mr,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=zA(s);if(p!==null){p.flags&=-257,FA(p,s,l,i,t),p.mode&1&&LA(i,u,t),t=p,c=u;var m=t.updateQueue;if(m===null){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}else{if(!(t&1)){LA(i,u,t),nE();break e}c=Error(oe(426))}}else if(It&&l.mode&1){var y=zA(s);if(y!==null){!(y.flags&65536)&&(y.flags|=256),FA(y,s,l,i,t),I_(Ic(c,l));break e}}i=c=Ic(c,l),mr!==4&&(mr=2),Kd===null?Kd=[i]:Kd.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=J6(i,c,t);TA(i,x);break e;case 1:l=c;var v=i.type,b=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Rs===null||!Rs.has(b)))){i.flags|=65536,t&=-t,i.lanes|=t;var j=e8(i,l,t);TA(i,j);break e}}i=i.return}while(i!==null)}v8(r)}catch(w){t=w,lr===r&&r!==null&&(lr=r=r.return);continue}break}while(!0)}function x8(){var e=i0.current;return i0.current=a0,e===null?a0:e}function nE(){(mr===0||mr===3||mr===2)&&(mr=4),jr===null||!(Xo&268435455)&&!(Wg&268435455)||ms(jr,Mr)}function l0(e,t){var r=it;it|=2;var n=x8();(jr!==e||Mr!==t)&&(ii=null,zo(e,t));do try{tY();break}catch(a){g8(e,a)}while(!0);if(z_(),it=r,i0.current=n,lr!==null)throw Error(oe(261));return jr=null,Mr=0,mr}function tY(){for(;lr!==null;)y8(lr)}function rY(){for(;lr!==null&&!EG();)y8(lr)}function y8(e){var t=w8(e.alternate,e,xn);e.memoizedProps=e.pendingProps,t===null?v8(e):lr=t,Q_.current=null}function v8(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=YK(r,t),r!==null){r.flags&=32767,lr=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{mr=6,lr=null;return}}else if(r=KK(r,t,xn),r!==null){lr=r;return}if(t=t.sibling,t!==null){lr=t;return}lr=t=e}while(t!==null);mr===0&&(mr=5)}function go(e,t,r){var n=xt,a=Yn.transition;try{Yn.transition=null,xt=1,nY(e,t,r,n)}finally{Yn.transition=a,xt=n}return null}function nY(e,t,r,n){do vc();while(ks!==null);if(it&6)throw Error(oe(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(oe(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(IG(e,i),e===jr&&(lr=jr=null,Mr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||wp||(wp=!0,j8(qm,function(){return vc(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Yn.transition,Yn.transition=null;var s=xt;xt=1;var l=it;it|=4,Q_.current=null,ZK(e,r),h8(r,e),kK(S2),Hm=!!N2,S2=N2=null,e.current=r,QK(r),PG(),it=l,xt=s,Yn.transition=i}else e.current=r;if(wp&&(wp=!1,ks=e,o0=a),i=e.pendingLanes,i===0&&(Rs=null),OG(r.stateNode),un(e,tr()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(s0)throw s0=!1,e=H2,H2=null,e;return o0&1&&e.tag!==0&&vc(),i=e.pendingLanes,i&1?e===W2?Yd++:(Yd=0,W2=e):Yd=0,Xs(),null}function vc(){if(ks!==null){var e=Jz(o0),t=Yn.transition,r=xt;try{if(Yn.transition=null,xt=16>e?16:e,ks===null)var n=!1;else{if(e=ks,ks=null,o0=0,it&6)throw Error(oe(331));var a=it;for(it|=4,ve=e.current;ve!==null;){var i=ve,s=i.child;if(ve.flags&16){var l=i.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:Gd(8,d,i)}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(u8(d),d===u){ve=null;break}if(h!==null){h.return=p,ve=h;break}ve=p}}}var m=i.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(g!==null)}}ve=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,ve=s;else e:for(;ve!==null;){if(i=ve,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Gd(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,ve=x;break e}ve=i.return}}var v=e.current;for(ve=v;ve!==null;){s=ve;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,ve=b;else e:for(s=v;ve!==null;){if(l=ve,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Hg(9,l)}}catch(w){Kt(l,l.return,w)}if(l===s){ve=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,ve=j;break e}ve=l.return}}if(it=a,Xs(),qa&&typeof qa.onPostCommitFiberRoot=="function")try{qa.onPostCommitFiberRoot(Ig,e)}catch{}n=!0}return n}finally{xt=r,Yn.transition=t}}return!1}function JA(e,t,r){t=Ic(r,t),t=J6(e,t,1),e=Ms(e,t,1),t=Xr(),e!==null&&(Th(e,1,t),un(e,t))}function Kt(e,t,r){if(e.tag===3)JA(e,e,r);else for(;t!==null;){if(t.tag===3){JA(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Rs===null||!Rs.has(n))){e=Ic(r,e),e=e8(t,e,1),t=Ms(t,e,1),e=Xr(),t!==null&&(Th(t,1,e),un(t,e));break}}t=t.return}}function aY(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Xr(),e.pingedLanes|=e.suspendedLanes&r,jr===e&&(Mr&r)===r&&(mr===4||mr===3&&(Mr&130023424)===Mr&&500>tr()-eE?zo(e,0):J_|=r),un(e,t)}function b8(e,t){t===0&&(e.mode&1?(t=dp,dp<<=1,!(dp&130023424)&&(dp=4194304)):t=1);var r=Xr();e=Ei(e,t),e!==null&&(Th(e,t,r),un(e,r))}function iY(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),b8(e,r)}function sY(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(oe(314))}n!==null&&n.delete(t),b8(e,r)}var w8;w8=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ln.current)an=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return an=!1,GK(e,t,r);an=!!(e.flags&131072)}else an=!1,It&&t.flags&1048576&&S6(t,Qm,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;wm(e,t),e=t.pendingProps;var a=Mc(t,qr.current);yc(t,r),a=G_(null,t,n,e,a,r);var i=K_();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,cn(n)?(i=!0,Xm(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,V_(t),a.updater=Ug,t.stateNode=a,a._reactInternals=t,R2(t,n,e,r),t=I2(null,t,n,!0,i,r)):(t.tag=0,It&&i&&D_(t),Gr(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(wm(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=lY(n),e=pa(n,e),a){case 0:t=$2(null,t,n,e,r);break e;case 1:t=qA(null,t,n,e,r);break e;case 11:t=BA(null,t,n,e,r);break e;case 14:t=VA(null,t,n,pa(n.type,e),r);break e}throw Error(oe(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:pa(n,a),$2(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:pa(n,a),qA(e,t,n,a,r);case 3:e:{if(a8(t),e===null)throw Error(oe(387));n=t.pendingProps,i=t.memoizedState,a=i.element,O6(e,t),t0(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Ic(Error(oe(423)),t),t=UA(e,t,n,r,a);break e}else if(n!==a){a=Ic(Error(oe(424)),t),t=UA(e,t,n,r,a);break e}else for(Nn=Ts(t.stateNode.containerInfo.firstChild),_n=t,It=!0,ba=null,r=C6(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Rc(),n===a){t=Pi(e,t,r);break e}Gr(e,t,n,r)}t=t.child}return t;case 5:return T6(t),e===null&&O2(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,s=a.children,_2(n,a)?s=null:i!==null&&_2(n,i)&&(t.flags|=32),n8(e,t),Gr(e,t,s,r),t.child;case 6:return e===null&&O2(t),null;case 13:return i8(e,t,r);case 4:return q_(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Dc(t,null,n,r):Gr(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:pa(n,a),BA(e,t,n,a,r);case 7:return Gr(e,t,t.pendingProps,r),t.child;case 8:return Gr(e,t,t.pendingProps.children,r),t.child;case 12:return Gr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,s=a.value,St(Jm,n._currentValue),n._currentValue=s,i!==null)if(Aa(i.value,s)){if(i.children===a.children&&!ln.current){t=Pi(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=gi(-1,r&-r),c.tag=2;var u=i.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}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),T2(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(oe(341));s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),T2(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Gr(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,yc(t,r),a=ta(a),n=n(a),t.flags|=1,Gr(e,t,n,r),t.child;case 14:return n=t.type,a=pa(n,t.pendingProps),a=pa(n.type,a),VA(e,t,n,a,r);case 15:return t8(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:pa(n,a),wm(e,t),t.tag=1,cn(n)?(e=!0,Xm(t)):e=!1,yc(t,r),Q6(t,n,a),R2(t,n,a,r),I2(null,t,n,!0,e,r);case 19:return s8(e,t,r);case 22:return r8(e,t,r)}throw Error(oe(156,t.tag))};function j8(e,t){return Yz(e,t)}function oY(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hn(e,t,r,n){return new oY(e,t,r,n)}function aE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function lY(e){if(typeof e=="function")return aE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===k_)return 11;if(e===N_)return 14}return 2}function $s(e,t){var r=e.alternate;return r===null?(r=Hn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Nm(e,t,r,n,a,i){var s=2;if(n=e,typeof e=="function")aE(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Wl:return Fo(r.children,a,i,t);case j_:s=8,a|=8;break;case a2:return e=Hn(12,r,t,a|2),e.elementType=a2,e.lanes=i,e;case i2:return e=Hn(13,r,t,a),e.elementType=i2,e.lanes=i,e;case s2:return e=Hn(19,r,t,a),e.elementType=s2,e.lanes=i,e;case Tz:return Gg(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Az:s=10;break e;case Oz:s=9;break e;case k_:s=11;break e;case N_:s=14;break e;case us:s=16,n=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=Hn(s,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function Fo(e,t,r,n){return e=Hn(7,e,n,t),e.lanes=r,e}function Gg(e,t,r,n){return e=Hn(22,e,n,t),e.elementType=Tz,e.lanes=r,e.stateNode={isHidden:!1},e}function Yy(e,t,r){return e=Hn(6,e,null,t),e.lanes=r,e}function Xy(e,t,r){return t=Hn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function cY(e,t,r,n,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=Ay(0),this.expirationTimes=Ay(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ay(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function iE(e,t,r,n,a,i,s,l,c){return e=new cY(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Hn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},V_(i),e}function uY(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Hl,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function k8(e){if(!e)return Vs;e=e._reactInternals;e:{if(ml(e)!==e||e.tag!==1)throw Error(oe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(cn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(oe(171))}if(e.tag===1){var r=e.type;if(cn(r))return k6(e,r,t)}return t}function N8(e,t,r,n,a,i,s,l,c){return e=iE(r,n,!0,e,a,i,s,l,c),e.context=k8(null),r=e.current,n=Xr(),a=Ds(r),i=gi(n,a),i.callback=t??null,Ms(r,i,a),e.current.lanes=a,Th(e,a,n),un(e,n),e}function Kg(e,t,r,n){var a=t.current,i=Xr(),s=Ds(a);return r=k8(r),t.context===null?t.context=r:t.pendingContext=r,t=gi(i,s),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Ms(a,t,s),e!==null&&(Sa(e,a,s,i),ym(e,a,s)),s}function c0(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 eO(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function sE(e,t){eO(e,t),(e=e.alternate)&&eO(e,t)}function dY(){return null}var S8=typeof reportError=="function"?reportError:function(e){console.error(e)};function oE(e){this._internalRoot=e}Yg.prototype.render=oE.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(oe(409));Kg(e,t,null,null)};Yg.prototype.unmount=oE.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Zo(function(){Kg(null,e,null,null)}),t[_i]=null}};function Yg(e){this._internalRoot=e}Yg.prototype.unstable_scheduleHydration=function(e){if(e){var t=r6();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ps.length&&t!==0&&t<ps[r].priority;r++);ps.splice(r,0,e),r===0&&a6(e)}};function lE(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Xg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function tO(){}function fY(e,t,r,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var u=c0(s);i.call(u)}}var s=N8(t,n,e,0,null,!1,!1,"",tO);return e._reactRootContainer=s,e[_i]=s.current,gf(e.nodeType===8?e.parentNode:e),Zo(),s}for(;a=e.lastChild;)e.removeChild(a);if(typeof n=="function"){var l=n;n=function(){var u=c0(c);l.call(u)}}var c=iE(e,0,!1,null,null,!1,!1,"",tO);return e._reactRootContainer=c,e[_i]=c.current,gf(e.nodeType===8?e.parentNode:e),Zo(function(){Kg(t,c,r,n)}),c}function Zg(e,t,r,n,a){var i=r._reactRootContainer;if(i){var s=i;if(typeof a=="function"){var l=a;a=function(){var c=c0(s);l.call(c)}}Kg(t,s,e,a)}else s=fY(r,t,e,a,n);return c0(s)}e6=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Sd(t.pendingLanes);r!==0&&(E_(t,r|1),un(t,tr()),!(it&6)&&(Lc=tr()+500,Xs()))}break;case 13:Zo(function(){var n=Ei(e,1);if(n!==null){var a=Xr();Sa(n,e,1,a)}}),sE(e,1)}};P_=function(e){if(e.tag===13){var t=Ei(e,134217728);if(t!==null){var r=Xr();Sa(t,e,134217728,r)}sE(e,134217728)}};t6=function(e){if(e.tag===13){var t=Ds(e),r=Ei(e,t);if(r!==null){var n=Xr();Sa(r,e,t,n)}sE(e,t)}};r6=function(){return xt};n6=function(e,t){var r=xt;try{return xt=e,t()}finally{xt=r}};g2=function(e,t,r){switch(t){case"input":if(c2(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var a=Bg(n);if(!a)throw Error(oe(90));Rz(n),c2(n,a)}}}break;case"textarea":$z(e,r);break;case"select":t=r.value,t!=null&&pc(e,!!r.multiple,t,!1)}};qz=tE;Uz=Zo;var hY={usingClientEntryPoint:!1,Events:[Rh,Xl,Bg,Bz,Vz,tE]},Zu={findFiberByHostInstance:So,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},pY={bundleType:Zu.bundleType,version:Zu.version,rendererPackageName:Zu.rendererPackageName,rendererConfig:Zu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Vi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Gz(e),e===null?null:e.stateNode},findFiberByHostInstance:Zu.findFiberByHostInstance||dY,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 jp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jp.isDisabled&&jp.supportsFiber)try{Ig=jp.inject(pY),qa=jp}catch{}}An.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hY;An.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!lE(t))throw Error(oe(200));return uY(e,t,null,r)};An.createRoot=function(e,t){if(!lE(e))throw Error(oe(299));var r=!1,n="",a=S8;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=iE(e,1,!1,null,null,r,!1,n,a),e[_i]=t.current,gf(e.nodeType===8?e.parentNode:e),new oE(t)};An.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(oe(188)):(e=Object.keys(e).join(","),Error(oe(268,e)));return e=Gz(t),e=e===null?null:e.stateNode,e};An.flushSync=function(e){return Zo(e)};An.hydrate=function(e,t,r){if(!Xg(t))throw Error(oe(200));return Zg(null,e,t,!0,r)};An.hydrateRoot=function(e,t,r){if(!lE(e))throw Error(oe(405));var n=r!=null&&r.hydratedSources||null,a=!1,i="",s=S8;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(s=r.onRecoverableError)),t=N8(t,null,e,1,r??null,a,!1,i,s),e[_i]=t.current,gf(e),n)for(e=0;e<n.length;e++)r=n[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new Yg(t)};An.render=function(e,t,r){if(!Xg(t))throw Error(oe(200));return Zg(null,e,t,!1,r)};An.unmountComponentAtNode=function(e){if(!Xg(e))throw Error(oe(40));return e._reactRootContainer?(Zo(function(){Zg(null,null,e,!1,function(){e._reactRootContainer=null,e[_i]=null})}),!0):!1};An.unstable_batchedUpdates=tE;An.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Xg(r))throw Error(oe(200));if(e==null||e._reactInternals===void 0)throw Error(oe(38));return Zg(e,t,r,!1,n)};An.version="18.3.1-next-f1338f8080-20240426";function _8(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_8)}catch(e){console.error(e)}}_8(),_z.exports=An;var cE=_z.exports;const mY=lt(cE),gY=hz({__proto__:null,default:mY},[cE]);var rO=cE;r2.createRoot=rO.createRoot,r2.hydrateRoot=rO.hydrateRoot;/**
41
+ * @remix-run/router v1.23.1
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 $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$t.apply(this,arguments)}var sr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(sr||(sr={}));const nO="popstate";function xY(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:s,hash:l}=n.location;return Sf("",{pathname:i,search:s,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Jo(a)}return vY(t,r,null,e)}function Ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Qo(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function yY(){return Math.random().toString(36).substr(2,8)}function aO(e,t){return{usr:e.state,key:e.key,idx:t}}function Sf(e,t,r,n){return r===void 0&&(r=null),$t({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Zs(t):t,{state:r,key:t&&t.key||n||yY()})}function Jo(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Zs(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function vY(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,s=a.history,l=sr.Pop,c=null,u=d();u==null&&(u=0,s.replaceState($t({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){l=sr.Pop;let y=d(),x=y==null?null:y-u;u=y,c&&c({action:l,location:g.location,delta:x})}function h(y,x){l=sr.Push;let v=Sf(g.location,y,x);u=d()+1;let b=aO(v,u),j=g.createHref(v);try{s.pushState(b,"",j)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;a.location.assign(j)}i&&c&&c({action:l,location:g.location,delta:1})}function p(y,x){l=sr.Replace;let v=Sf(g.location,y,x);u=d();let b=aO(v,u),j=g.createHref(v);s.replaceState(b,"",j),i&&c&&c({action:l,location:g.location,delta:0})}function m(y){let x=a.location.origin!=="null"?a.location.origin:a.location.href,v=typeof y=="string"?y:Jo(y);return v=v.replace(/ $/,"%20"),Ye(x,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,x)}let g={get action(){return l},get location(){return e(a,s)},listen(y){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(nO,f),c=y,()=>{a.removeEventListener(nO,f),c=null}},createHref(y){return t(a,y)},createURL:m,encodeLocation(y){let x=m(y);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:p,go(y){return s.go(y)}};return g}var gt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(gt||(gt={}));const bY=new Set(["lazy","caseSensitive","path","id","index","children"]);function wY(e){return e.index===!0}function u0(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,i)=>{let s=[...r,String(i)],l=typeof a.id=="string"?a.id:s.join("-");if(Ye(a.index!==!0||!a.children,"Cannot specify children on an index route"),Ye(!n[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),wY(a)){let c=$t({},a,t(a),{id:l});return n[l]=c,c}else{let c=$t({},a,t(a),{id:l,children:void 0});return n[l]=c,a.children&&(c.children=u0(a.children,t,s,n)),c}})}function jo(e,t,r){return r===void 0&&(r="/"),Sm(e,t,r,!1)}function Sm(e,t,r,n){let a=typeof t=="string"?Zs(t):t,i=Ci(a.pathname||"/",r);if(i==null)return null;let s=E8(e);kY(s);let l=null;for(let c=0;l==null&&c<s.length;++c){let u=RY(i);l=TY(s[c],u,n)}return l}function jY(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function E8(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,s,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};c.relativePath.startsWith("/")&&(Ye(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=xi([n,c.relativePath]),d=r.concat(c);i.children&&i.children.length>0&&(Ye(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),E8(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:AY(u,i.index),routesMeta:d})};return e.forEach((i,s)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,s);else for(let c of P8(i.path))a(i,s,c)}),t}function P8(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let s=P8(n.join("/")),l=[];return l.push(...s.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function kY(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:OY(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const NY=/^:[\w-]+$/,SY=3,_Y=2,EY=1,PY=10,CY=-2,iO=e=>e==="*";function AY(e,t){let r=e.split("/"),n=r.length;return r.some(iO)&&(n+=CY),t&&(n+=_Y),r.filter(a=>!iO(a)).reduce((a,i)=>a+(NY.test(i)?SY:i===""?EY:PY),n)}function OY(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function TY(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},i="/",s=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=d0({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&r&&!n[n.length-1].route.index&&(f=d0({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;Object.assign(a,f.params),s.push({params:a,pathname:xi([i,f.pathname]),pathnameBase:LY(xi([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=xi([i,f.pathnameBase]))}return s}function d0(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=MY(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],s=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let g=l[f]||"";s=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const m=l[f];return p&&!m?u[h]=void 0:u[h]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function MY(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Qo(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function RY(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Qo(!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 Ci(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const DY=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$Y=e=>DY.test(e);function IY(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Zs(e):e,i;if(r)if($Y(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),Qo(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=sO(r.substring(1),"/"):i=sO(r,t)}else i=t;return{pathname:i,search:zY(n),hash:FY(a)}}function sO(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Zy(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function C8(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function uE(e,t){let r=C8(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function dE(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Zs(e):(a=$t({},e),Ye(!a.pathname||!a.pathname.includes("?"),Zy("?","pathname","search",a)),Ye(!a.pathname||!a.pathname.includes("#"),Zy("#","pathname","hash",a)),Ye(!a.search||!a.search.includes("#"),Zy("#","search","hash",a)));let i=e===""||a.pathname==="",s=i?"/":a.pathname,l;if(s==null)l=r;else{let f=t.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;a.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=IY(a,l),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const xi=e=>e.join("/").replace(/\/\/+/g,"/"),LY=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),zY=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,FY=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class f0{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function _f(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const A8=["post","put","patch","delete"],BY=new Set(A8),VY=["get",...A8],qY=new Set(VY),UY=new Set([301,302,303,307,308]),HY=new Set([307,308]),Qy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},WY={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},fE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,GY=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),O8="remix-router-transitions";function KY(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;Ye(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let H=e.detectErrorBoundary;a=Z=>({hasErrorBoundary:H(Z)})}else a=GY;let i={},s=u0(e.routes,a,void 0,i),l,c=e.basename||"/",u=e.dataStrategy||QY,d=e.patchRoutesOnNavigation,f=$t({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,p=new Set,m=null,g=null,y=null,x=e.hydrationData!=null,v=jo(s,e.history.location,c),b=!1,j=null;if(v==null&&!d){let H=rn(404,{pathname:e.history.location.pathname}),{matches:Z,route:J}=xO(s);v=Z,j={[J.id]:H}}v&&!e.hydrationData&&Sl(v,s,e.history.location.pathname).active&&(v=null);let w;if(v)if(v.some(H=>H.route.lazy))w=!1;else if(!v.some(H=>H.route.loader))w=!0;else if(f.v7_partialHydration){let H=e.hydrationData?e.hydrationData.loaderData:null,Z=e.hydrationData?e.hydrationData.errors:null;if(Z){let J=v.findIndex(ie=>Z[ie.route.id]!==void 0);w=v.slice(0,J+1).every(ie=>!X2(ie.route,H,Z))}else w=v.every(J=>!X2(J.route,H,Z))}else w=e.hydrationData!=null;else if(w=!1,v=[],f.v7_partialHydration){let H=Sl(null,s,e.history.location.pathname);H.active&&H.matches&&(b=!0,v=H.matches)}let k,N={historyAction:e.history.action,location:e.history.location,matches:v,initialized:w,navigation:Qy,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||j,fetchers:new Map,blockers:new Map},_=sr.Pop,P=!1,C,A=!1,O=new Map,T=null,E=!1,R=!1,D=[],z=new Set,I=new Map,$=0,F=-1,q=new Map,V=new Set,L=new Map,B=new Map,Y=new Set,W=new Map,K=new Map,Q;function X(){if(h=e.history.listen(H=>{let{action:Z,location:J,delta:ie}=H;if(Q){Q(),Q=void 0;return}Qo(K.size===0||ie!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let pe=Xe({currentLocation:N.location,nextLocation:J,historyAction:Z});if(pe&&ie!=null){let Ce=new Promise(Re=>{Q=Re});e.history.go(ie*-1),Ae(pe,{state:"blocked",location:J,proceed(){Ae(pe,{state:"proceeding",proceed:void 0,reset:void 0,location:J}),Ce.then(()=>e.history.go(ie))},reset(){let Re=new Map(N.blockers);Re.set(pe,Qu),G({blockers:Re})}});return}return je(Z,J)}),r){fX(t,O);let H=()=>hX(t,O);t.addEventListener("pagehide",H),T=()=>t.removeEventListener("pagehide",H)}return N.initialized||je(sr.Pop,N.location,{initialHydration:!0}),k}function ee(){h&&h(),T&&T(),p.clear(),C&&C.abort(),N.fetchers.forEach((H,Z)=>he(Z)),N.blockers.forEach((H,Z)=>re(Z))}function U(H){return p.add(H),()=>p.delete(H)}function G(H,Z){Z===void 0&&(Z={}),N=$t({},N,H);let J=[],ie=[];f.v7_fetcherPersist&&N.fetchers.forEach((pe,Ce)=>{pe.state==="idle"&&(Y.has(Ce)?ie.push(Ce):J.push(Ce))}),Y.forEach(pe=>{!N.fetchers.has(pe)&&!I.has(pe)&&ie.push(pe)}),[...p].forEach(pe=>pe(N,{deletedFetchers:ie,viewTransitionOpts:Z.viewTransitionOpts,flushSync:Z.flushSync===!0})),f.v7_fetcherPersist?(J.forEach(pe=>N.fetchers.delete(pe)),ie.forEach(pe=>he(pe))):ie.forEach(pe=>Y.delete(pe))}function ae(H,Z,J){var ie,pe;let{flushSync:Ce}=J===void 0?{}:J,Re=N.actionData!=null&&N.navigation.formMethod!=null&&ga(N.navigation.formMethod)&&N.navigation.state==="loading"&&((ie=H.state)==null?void 0:ie._isRedirect)!==!0,we;Z.actionData?Object.keys(Z.actionData).length>0?we=Z.actionData:we=null:Re?we=N.actionData:we=null;let ke=Z.loaderData?mO(N.loaderData,Z.loaderData,Z.matches||[],Z.errors):N.loaderData,ye=N.blockers;ye.size>0&&(ye=new Map(ye),ye.forEach((et,dr)=>ye.set(dr,Qu)));let Se=P===!0||N.navigation.formMethod!=null&&ga(N.navigation.formMethod)&&((pe=H.state)==null?void 0:pe._isRedirect)!==!0;l&&(s=l,l=void 0),E||_===sr.Pop||(_===sr.Push?e.history.push(H,H.state):_===sr.Replace&&e.history.replace(H,H.state));let ze;if(_===sr.Pop){let et=O.get(N.location.pathname);et&&et.has(H.pathname)?ze={currentLocation:N.location,nextLocation:H}:O.has(H.pathname)&&(ze={currentLocation:H,nextLocation:N.location})}else if(A){let et=O.get(N.location.pathname);et?et.add(H.pathname):(et=new Set([H.pathname]),O.set(N.location.pathname,et)),ze={currentLocation:N.location,nextLocation:H}}G($t({},Z,{actionData:we,loaderData:ke,historyAction:_,location:H,initialized:!0,navigation:Qy,revalidation:"idle",restoreScrollPosition:kt(H,Z.matches||N.matches),preventScrollReset:Se,blockers:ye}),{viewTransitionOpts:ze,flushSync:Ce===!0}),_=sr.Pop,P=!1,A=!1,E=!1,R=!1,D=[]}async function ce(H,Z){if(typeof H=="number"){e.history.go(H);return}let J=Y2(N.location,N.matches,c,f.v7_prependBasename,H,f.v7_relativeSplatPath,Z==null?void 0:Z.fromRouteId,Z==null?void 0:Z.relative),{path:ie,submission:pe,error:Ce}=oO(f.v7_normalizeFormMethod,!1,J,Z),Re=N.location,we=Sf(N.location,ie,Z&&Z.state);we=$t({},we,e.history.encodeLocation(we));let ke=Z&&Z.replace!=null?Z.replace:void 0,ye=sr.Push;ke===!0?ye=sr.Replace:ke===!1||pe!=null&&ga(pe.formMethod)&&pe.formAction===N.location.pathname+N.location.search&&(ye=sr.Replace);let Se=Z&&"preventScrollReset"in Z?Z.preventScrollReset===!0:void 0,ze=(Z&&Z.flushSync)===!0,et=Xe({currentLocation:Re,nextLocation:we,historyAction:ye});if(et){Ae(et,{state:"blocked",location:we,proceed(){Ae(et,{state:"proceeding",proceed:void 0,reset:void 0,location:we}),ce(H,Z)},reset(){let dr=new Map(N.blockers);dr.set(et,Qu),G({blockers:dr})}});return}return await je(ye,we,{submission:pe,pendingError:Ce,preventScrollReset:Se,replace:Z&&Z.replace,enableViewTransition:Z&&Z.viewTransition,flushSync:ze})}function de(){if(Vt(),G({revalidation:"loading"}),N.navigation.state!=="submitting"){if(N.navigation.state==="idle"){je(N.historyAction,N.location,{startUninterruptedRevalidation:!0});return}je(_||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:A===!0})}}async function je(H,Z,J){C&&C.abort(),C=null,_=H,E=(J&&J.startUninterruptedRevalidation)===!0,Qa(N.location,N.matches),P=(J&&J.preventScrollReset)===!0,A=(J&&J.enableViewTransition)===!0;let ie=l||s,pe=J&&J.overrideNavigation,Ce=J!=null&&J.initialHydration&&N.matches&&N.matches.length>0&&!b?N.matches:jo(ie,Z,c),Re=(J&&J.flushSync)===!0;if(Ce&&N.initialized&&!R&&aX(N.location,Z)&&!(J&&J.submission&&ga(J.submission.formMethod))){ae(Z,{matches:Ce},{flushSync:Re});return}let we=Sl(Ce,ie,Z.pathname);if(we.active&&we.matches&&(Ce=we.matches),!Ce){let{error:vt,notFoundMatches:at,route:Rt}=Ze(Z.pathname);ae(Z,{matches:at,loaderData:{},errors:{[Rt.id]:vt}},{flushSync:Re});return}C=new AbortController;let ke=Al(e.history,Z,C.signal,J&&J.submission),ye;if(J&&J.pendingError)ye=[ko(Ce).route.id,{type:gt.error,error:J.pendingError}];else if(J&&J.submission&&ga(J.submission.formMethod)){let vt=await le(ke,Z,J.submission,Ce,we.active,{replace:J.replace,flushSync:Re});if(vt.shortCircuited)return;if(vt.pendingActionResult){let[at,Rt]=vt.pendingActionResult;if(bn(Rt)&&_f(Rt.error)&&Rt.error.status===404){C=null,ae(Z,{matches:vt.matches,loaderData:{},errors:{[at]:Rt.error}});return}}Ce=vt.matches||Ce,ye=vt.pendingActionResult,pe=Jy(Z,J.submission),Re=!1,we.active=!1,ke=Al(e.history,ke.url,ke.signal)}let{shortCircuited:Se,matches:ze,loaderData:et,errors:dr}=await se(ke,Z,Ce,we.active,pe,J&&J.submission,J&&J.fetcherSubmission,J&&J.replace,J&&J.initialHydration===!0,Re,ye);Se||(C=null,ae(Z,$t({matches:ze||Ce},gO(ye),{loaderData:et,errors:dr})))}async function le(H,Z,J,ie,pe,Ce){Ce===void 0&&(Ce={}),Vt();let Re=uX(Z,J);if(G({navigation:Re},{flushSync:Ce.flushSync===!0}),pe){let ye=await _l(ie,Z.pathname,H.signal);if(ye.type==="aborted")return{shortCircuited:!0};if(ye.type==="error"){let Se=ko(ye.partialMatches).route.id;return{matches:ye.partialMatches,pendingActionResult:[Se,{type:gt.error,error:ye.error}]}}else if(ye.matches)ie=ye.matches;else{let{notFoundMatches:Se,error:ze,route:et}=Ze(Z.pathname);return{matches:Se,pendingActionResult:[et.id,{type:gt.error,error:ze}]}}}let we,ke=Ed(ie,Z);if(!ke.route.action&&!ke.route.lazy)we={type:gt.error,error:rn(405,{method:H.method,pathname:Z.pathname,routeId:ke.route.id})};else if(we=(await Me("action",N,H,[ke],ie,null))[ke.route.id],H.signal.aborted)return{shortCircuited:!0};if(Po(we)){let ye;return Ce&&Ce.replace!=null?ye=Ce.replace:ye=fO(we.response.headers.get("Location"),new URL(H.url),c)===N.location.pathname+N.location.search,await Le(H,we,!0,{submission:J,replace:ye}),{shortCircuited:!0}}if(Ns(we))throw rn(400,{type:"defer-action"});if(bn(we)){let ye=ko(ie,ke.route.id);return(Ce&&Ce.replace)!==!0&&(_=sr.Push),{matches:ie,pendingActionResult:[ye.route.id,we]}}return{matches:ie,pendingActionResult:[ke.route.id,we]}}async function se(H,Z,J,ie,pe,Ce,Re,we,ke,ye,Se){let ze=pe||Jy(Z,Ce),et=Ce||Re||vO(ze),dr=!E&&(!f.v7_partialHydration||!ke);if(ie){if(dr){let Dt=$e(Se);G($t({navigation:ze},Dt!==void 0?{actionData:Dt}:{}),{flushSync:ye})}let nt=await _l(J,Z.pathname,H.signal);if(nt.type==="aborted")return{shortCircuited:!0};if(nt.type==="error"){let Dt=ko(nt.partialMatches).route.id;return{matches:nt.partialMatches,loaderData:{},errors:{[Dt]:nt.error}}}else if(nt.matches)J=nt.matches;else{let{error:Dt,notFoundMatches:Ji,route:ei}=Ze(Z.pathname);return{matches:Ji,loaderData:{},errors:{[ei.id]:Dt}}}}let vt=l||s,[at,Rt]=cO(e.history,N,J,et,Z,f.v7_partialHydration&&ke===!0,f.v7_skipActionErrorRevalidation,R,D,z,Y,L,V,vt,c,Se);if(ut(nt=>!(J&&J.some(Dt=>Dt.route.id===nt))||at&&at.some(Dt=>Dt.route.id===nt)),F=++$,at.length===0&&Rt.length===0){let nt=vr();return ae(Z,$t({matches:J,loaderData:{},errors:Se&&bn(Se[1])?{[Se[0]]:Se[1].error}:null},gO(Se),nt?{fetchers:new Map(N.fetchers)}:{}),{flushSync:ye}),{shortCircuited:!0}}if(dr){let nt={};if(!ie){nt.navigation=ze;let Dt=$e(Se);Dt!==void 0&&(nt.actionData=Dt)}Rt.length>0&&(nt.fetchers=Pt(Rt)),G(nt,{flushSync:ye})}Rt.forEach(nt=>{Pe(nt.key),nt.controller&&I.set(nt.key,nt.controller)});let Zi=()=>Rt.forEach(nt=>Pe(nt.key));C&&C.signal.addEventListener("abort",Zi);let{loaderResults:Qi,fetcherResults:ua}=await ur(N,J,at,Rt,H);if(H.signal.aborted)return{shortCircuited:!0};C&&C.signal.removeEventListener("abort",Zi),Rt.forEach(nt=>I.delete(nt.key));let Rn=kp(Qi);if(Rn)return await Le(H,Rn.result,!0,{replace:we}),{shortCircuited:!0};if(Rn=kp(ua),Rn)return V.add(Rn.key),await Le(H,Rn.result,!0,{replace:we}),{shortCircuited:!0};let{loaderData:qu,errors:co}=pO(N,J,Qi,Se,Rt,ua,W);W.forEach((nt,Dt)=>{nt.subscribe(Ji=>{(Ji||nt.done)&&W.delete(Dt)})}),f.v7_partialHydration&&ke&&N.errors&&(co=$t({},N.errors,co));let Ja=vr(),El=Er(F),uo=Ja||El||Rt.length>0;return $t({matches:J,loaderData:qu,errors:co},uo?{fetchers:new Map(N.fetchers)}:{})}function $e(H){if(H&&!bn(H[1]))return{[H[0]]:H[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function Pt(H){return H.forEach(Z=>{let J=N.fetchers.get(Z.key),ie=Ju(void 0,J?J.data:void 0);N.fetchers.set(Z.key,ie)}),new Map(N.fetchers)}function st(H,Z,J,ie){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Pe(H);let pe=(ie&&ie.flushSync)===!0,Ce=l||s,Re=Y2(N.location,N.matches,c,f.v7_prependBasename,J,f.v7_relativeSplatPath,Z,ie==null?void 0:ie.relative),we=jo(Ce,Re,c),ke=Sl(we,Ce,Re);if(ke.active&&ke.matches&&(we=ke.matches),!we){jt(H,Z,rn(404,{pathname:Re}),{flushSync:pe});return}let{path:ye,submission:Se,error:ze}=oO(f.v7_normalizeFormMethod,!0,Re,ie);if(ze){jt(H,Z,ze,{flushSync:pe});return}let et=Ed(we,ye),dr=(ie&&ie.preventScrollReset)===!0;if(Se&&ga(Se.formMethod)){xe(H,Z,ye,et,we,ke.active,pe,dr,Se);return}L.set(H,{routeId:Z,path:ye}),rt(H,Z,ye,et,we,ke.active,pe,dr,Se)}async function xe(H,Z,J,ie,pe,Ce,Re,we,ke){Vt(),L.delete(H);function ye(ar){if(!ar.route.action&&!ar.route.lazy){let Pl=rn(405,{method:ke.formMethod,pathname:J,routeId:Z});return jt(H,Z,Pl,{flushSync:Re}),!0}return!1}if(!Ce&&ye(ie))return;let Se=N.fetchers.get(H);pt(H,dX(ke,Se),{flushSync:Re});let ze=new AbortController,et=Al(e.history,J,ze.signal,ke);if(Ce){let ar=await _l(pe,new URL(et.url).pathname,et.signal,H);if(ar.type==="aborted")return;if(ar.type==="error"){jt(H,Z,ar.error,{flushSync:Re});return}else if(ar.matches){if(pe=ar.matches,ie=Ed(pe,J),ye(ie))return}else{jt(H,Z,rn(404,{pathname:J}),{flushSync:Re});return}}I.set(H,ze);let dr=$,at=(await Me("action",N,et,[ie],pe,H))[ie.route.id];if(et.signal.aborted){I.get(H)===ze&&I.delete(H);return}if(f.v7_fetcherPersist&&Y.has(H)){if(Po(at)||bn(at)){pt(H,os(void 0));return}}else{if(Po(at))if(I.delete(H),F>dr){pt(H,os(void 0));return}else return V.add(H),pt(H,Ju(ke)),Le(et,at,!1,{fetcherSubmission:ke,preventScrollReset:we});if(bn(at)){jt(H,Z,at.error);return}}if(Ns(at))throw rn(400,{type:"defer-action"});let Rt=N.navigation.location||N.location,Zi=Al(e.history,Rt,ze.signal),Qi=l||s,ua=N.navigation.state!=="idle"?jo(Qi,N.navigation.location,c):N.matches;Ye(ua,"Didn't find any matches after fetcher action");let Rn=++$;q.set(H,Rn);let qu=Ju(ke,at.data);N.fetchers.set(H,qu);let[co,Ja]=cO(e.history,N,ua,ke,Rt,!1,f.v7_skipActionErrorRevalidation,R,D,z,Y,L,V,Qi,c,[ie.route.id,at]);Ja.filter(ar=>ar.key!==H).forEach(ar=>{let Pl=ar.key,GC=N.fetchers.get(Pl),BW=Ju(void 0,GC?GC.data:void 0);N.fetchers.set(Pl,BW),Pe(Pl),ar.controller&&I.set(Pl,ar.controller)}),G({fetchers:new Map(N.fetchers)});let El=()=>Ja.forEach(ar=>Pe(ar.key));ze.signal.addEventListener("abort",El);let{loaderResults:uo,fetcherResults:nt}=await ur(N,ua,co,Ja,Zi);if(ze.signal.aborted)return;ze.signal.removeEventListener("abort",El),q.delete(H),I.delete(H),Ja.forEach(ar=>I.delete(ar.key));let Dt=kp(uo);if(Dt)return Le(Zi,Dt.result,!1,{preventScrollReset:we});if(Dt=kp(nt),Dt)return V.add(Dt.key),Le(Zi,Dt.result,!1,{preventScrollReset:we});let{loaderData:Ji,errors:ei}=pO(N,ua,uo,void 0,Ja,nt,W);if(N.fetchers.has(H)){let ar=os(at.data);N.fetchers.set(H,ar)}Er(Rn),N.navigation.state==="loading"&&Rn>F?(Ye(_,"Expected pending action"),C&&C.abort(),ae(N.navigation.location,{matches:ua,loaderData:Ji,errors:ei,fetchers:new Map(N.fetchers)})):(G({errors:ei,loaderData:mO(N.loaderData,Ji,ua,ei),fetchers:new Map(N.fetchers)}),R=!1)}async function rt(H,Z,J,ie,pe,Ce,Re,we,ke){let ye=N.fetchers.get(H);pt(H,Ju(ke,ye?ye.data:void 0),{flushSync:Re});let Se=new AbortController,ze=Al(e.history,J,Se.signal);if(Ce){let at=await _l(pe,new URL(ze.url).pathname,ze.signal,H);if(at.type==="aborted")return;if(at.type==="error"){jt(H,Z,at.error,{flushSync:Re});return}else if(at.matches)pe=at.matches,ie=Ed(pe,J);else{jt(H,Z,rn(404,{pathname:J}),{flushSync:Re});return}}I.set(H,Se);let et=$,vt=(await Me("loader",N,ze,[ie],pe,H))[ie.route.id];if(Ns(vt)&&(vt=await hE(vt,ze.signal,!0)||vt),I.get(H)===Se&&I.delete(H),!ze.signal.aborted){if(Y.has(H)){pt(H,os(void 0));return}if(Po(vt))if(F>et){pt(H,os(void 0));return}else{V.add(H),await Le(ze,vt,!1,{preventScrollReset:we});return}if(bn(vt)){jt(H,Z,vt.error);return}Ye(!Ns(vt),"Unhandled fetcher deferred data"),pt(H,os(vt.data))}}async function Le(H,Z,J,ie){let{submission:pe,fetcherSubmission:Ce,preventScrollReset:Re,replace:we}=ie===void 0?{}:ie;Z.response.headers.has("X-Remix-Revalidate")&&(R=!0);let ke=Z.response.headers.get("Location");Ye(ke,"Expected a Location header on the redirect Response"),ke=fO(ke,new URL(H.url),c);let ye=Sf(N.location,ke,{_isRedirect:!0});if(r){let at=!1;if(Z.response.headers.has("X-Remix-Reload-Document"))at=!0;else if(fE.test(ke)){const Rt=e.history.createURL(ke);at=Rt.origin!==t.location.origin||Ci(Rt.pathname,c)==null}if(at){we?t.location.replace(ke):t.location.assign(ke);return}}C=null;let Se=we===!0||Z.response.headers.has("X-Remix-Replace")?sr.Replace:sr.Push,{formMethod:ze,formAction:et,formEncType:dr}=N.navigation;!pe&&!Ce&&ze&&et&&dr&&(pe=vO(N.navigation));let vt=pe||Ce;if(HY.has(Z.response.status)&&vt&&ga(vt.formMethod))await je(Se,ye,{submission:$t({},vt,{formAction:ke}),preventScrollReset:Re||P,enableViewTransition:J?A:void 0});else{let at=Jy(ye,pe);await je(Se,ye,{overrideNavigation:at,fetcherSubmission:Ce,preventScrollReset:Re||P,enableViewTransition:J?A:void 0})}}async function Me(H,Z,J,ie,pe,Ce){let Re,we={};try{Re=await JY(u,H,Z,J,ie,pe,Ce,i,a)}catch(ke){return ie.forEach(ye=>{we[ye.route.id]={type:gt.error,error:ke}}),we}for(let[ke,ye]of Object.entries(Re))if(iX(ye)){let Se=ye.result;we[ke]={type:gt.redirect,response:rX(Se,J,ke,pe,c,f.v7_relativeSplatPath)}}else we[ke]=await tX(ye);return we}async function ur(H,Z,J,ie,pe){let Ce=H.matches,Re=Me("loader",H,pe,J,Z,null),we=Promise.all(ie.map(async Se=>{if(Se.matches&&Se.match&&Se.controller){let et=(await Me("loader",H,Al(e.history,Se.path,Se.controller.signal),[Se.match],Se.matches,Se.key))[Se.match.route.id];return{[Se.key]:et}}else return Promise.resolve({[Se.key]:{type:gt.error,error:rn(404,{pathname:Se.path})}})})),ke=await Re,ye=(await we).reduce((Se,ze)=>Object.assign(Se,ze),{});return await Promise.all([lX(Z,ke,pe.signal,Ce,H.loaderData),cX(Z,ye,ie)]),{loaderResults:ke,fetcherResults:ye}}function Vt(){R=!0,D.push(...ut()),L.forEach((H,Z)=>{I.has(Z)&&z.add(Z),Pe(Z)})}function pt(H,Z,J){J===void 0&&(J={}),N.fetchers.set(H,Z),G({fetchers:new Map(N.fetchers)},{flushSync:(J&&J.flushSync)===!0})}function jt(H,Z,J,ie){ie===void 0&&(ie={});let pe=ko(N.matches,Z);he(H),G({errors:{[pe.route.id]:J},fetchers:new Map(N.fetchers)},{flushSync:(ie&&ie.flushSync)===!0})}function me(H){return B.set(H,(B.get(H)||0)+1),Y.has(H)&&Y.delete(H),N.fetchers.get(H)||WY}function he(H){let Z=N.fetchers.get(H);I.has(H)&&!(Z&&Z.state==="loading"&&q.has(H))&&Pe(H),L.delete(H),q.delete(H),V.delete(H),f.v7_fetcherPersist&&Y.delete(H),z.delete(H),N.fetchers.delete(H)}function Ee(H){let Z=(B.get(H)||0)-1;Z<=0?(B.delete(H),Y.add(H),f.v7_fetcherPersist||he(H)):B.set(H,Z),G({fetchers:new Map(N.fetchers)})}function Pe(H){let Z=I.get(H);Z&&(Z.abort(),I.delete(H))}function Je(H){for(let Z of H){let J=me(Z),ie=os(J.data);N.fetchers.set(Z,ie)}}function vr(){let H=[],Z=!1;for(let J of V){let ie=N.fetchers.get(J);Ye(ie,"Expected fetcher: "+J),ie.state==="loading"&&(V.delete(J),H.push(J),Z=!0)}return Je(H),Z}function Er(H){let Z=[];for(let[J,ie]of q)if(ie<H){let pe=N.fetchers.get(J);Ye(pe,"Expected fetcher: "+J),pe.state==="loading"&&(Pe(J),q.delete(J),Z.push(J))}return Je(Z),Z.length>0}function Wr(H,Z){let J=N.blockers.get(H)||Qu;return K.get(H)!==Z&&K.set(H,Z),J}function re(H){N.blockers.delete(H),K.delete(H)}function Ae(H,Z){let J=N.blockers.get(H)||Qu;Ye(J.state==="unblocked"&&Z.state==="blocked"||J.state==="blocked"&&Z.state==="blocked"||J.state==="blocked"&&Z.state==="proceeding"||J.state==="blocked"&&Z.state==="unblocked"||J.state==="proceeding"&&Z.state==="unblocked","Invalid blocker state transition: "+J.state+" -> "+Z.state);let ie=new Map(N.blockers);ie.set(H,Z),G({blockers:ie})}function Xe(H){let{currentLocation:Z,nextLocation:J,historyAction:ie}=H;if(K.size===0)return;K.size>1&&Qo(!1,"A router only supports one blocker at a time");let pe=Array.from(K.entries()),[Ce,Re]=pe[pe.length-1],we=N.blockers.get(Ce);if(!(we&&we.state==="proceeding")&&Re({currentLocation:Z,nextLocation:J,historyAction:ie}))return Ce}function Ze(H){let Z=rn(404,{pathname:H}),J=l||s,{matches:ie,route:pe}=xO(J);return ut(),{notFoundMatches:ie,route:pe,error:Z}}function ut(H){let Z=[];return W.forEach((J,ie)=>{(!H||H(ie))&&(J.cancel(),Z.push(ie),W.delete(ie))}),Z}function Ct(H,Z,J){if(m=H,y=Z,g=J||null,!x&&N.navigation===Qy){x=!0;let ie=kt(N.location,N.matches);ie!=null&&G({restoreScrollPosition:ie})}return()=>{m=null,y=null,g=null}}function Mn(H,Z){return g&&g(H,Z.map(ie=>jY(ie,N.loaderData)))||H.key}function Qa(H,Z){if(m&&y){let J=Mn(H,Z);m[J]=y()}}function kt(H,Z){if(m){let J=Mn(H,Z),ie=m[J];if(typeof ie=="number")return ie}return null}function Sl(H,Z,J){if(d)if(H){if(Object.keys(H[0].params).length>0)return{active:!0,matches:Sm(Z,J,c,!0)}}else return{active:!0,matches:Sm(Z,J,c,!0)||[]};return{active:!1,matches:null}}async function _l(H,Z,J,ie){if(!d)return{type:"success",matches:H};let pe=H;for(;;){let Ce=l==null,Re=l||s,we=i;try{await d({signal:J,path:Z,matches:pe,fetcherKey:ie,patch:(Se,ze)=>{J.aborted||dO(Se,ze,Re,we,a)}})}catch(Se){return{type:"error",error:Se,partialMatches:pe}}finally{Ce&&!J.aborted&&(s=[...s])}if(J.aborted)return{type:"aborted"};let ke=jo(Re,Z,c);if(ke)return{type:"success",matches:ke};let ye=Sm(Re,Z,c,!0);if(!ye||pe.length===ye.length&&pe.every((Se,ze)=>Se.route.id===ye[ze].route.id))return{type:"success",matches:null};pe=ye}}function jy(H){i={},l=u0(H,a,void 0,i)}function ky(H,Z){let J=l==null;dO(H,Z,l||s,i,a),J&&(s=[...s],G({}))}return k={get basename(){return c},get future(){return f},get state(){return N},get routes(){return s},get window(){return t},initialize:X,subscribe:U,enableScrollRestoration:Ct,navigate:ce,fetch:st,revalidate:de,createHref:H=>e.history.createHref(H),encodeLocation:H=>e.history.encodeLocation(H),getFetcher:me,deleteFetcher:Ee,dispose:ee,getBlocker:Wr,deleteBlocker:re,patchRoutes:ky,_internalFetchControllers:I,_internalActiveDeferreds:W,_internalSetRoutes:jy},k}function YY(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Y2(e,t,r,n,a,i,s,l){let c,u;if(s){c=[];for(let f of t)if(c.push(f),f.route.id===s){u=f;break}}else c=t,u=t[t.length-1];let d=dE(a||".",uE(c,i),Ci(e.pathname,r)||e.pathname,l==="path");if(a==null&&(d.search=e.search,d.hash=e.hash),(a==null||a===""||a===".")&&u){let f=pE(d.search);if(u.route.index&&!f)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&f){let h=new URLSearchParams(d.search),p=h.getAll("index");h.delete("index"),p.filter(g=>g).forEach(g=>h.append("index",g));let m=h.toString();d.search=m?"?"+m:""}}return n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:xi([r,d.pathname])),Jo(d)}function oO(e,t,r,n){if(!n||!YY(n))return{path:r};if(n.formMethod&&!oX(n.formMethod))return{path:r,error:rn(405,{method:n.formMethod})};let a=()=>({path:r,error:rn(400,{type:"invalid-body"})}),i=n.formMethod||"get",s=e?i.toUpperCase():i.toLowerCase(),l=R8(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ga(s))return a();let h=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((p,m)=>{let[g,y]=m;return""+p+g+"="+y+`
50
+ `},""):String(n.body);return{path:r,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:h}}}else if(n.formEncType==="application/json"){if(!ga(s))return a();try{let h=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:h,text:void 0}}}catch{return a()}}}Ye(typeof FormData=="function","FormData is not available in this environment");let c,u;if(n.formData)c=Z2(n.formData),u=n.formData;else if(n.body instanceof FormData)c=Z2(n.body),u=n.body;else if(n.body instanceof URLSearchParams)c=n.body,u=hO(c);else if(n.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(n.body),u=hO(c)}catch{return a()}let d={formMethod:s,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(ga(d.formMethod))return{path:r,submission:d};let f=Zs(r);return t&&f.search&&pE(f.search)&&c.append("index",""),f.search="?"+c,{path:Jo(f),submission:d}}function lO(e,t,r){r===void 0&&(r=!1);let n=e.findIndex(a=>a.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function cO(e,t,r,n,a,i,s,l,c,u,d,f,h,p,m,g){let y=g?bn(g[1])?g[1].error:g[1].data:void 0,x=e.createURL(t.location),v=e.createURL(a),b=r;i&&t.errors?b=lO(r,Object.keys(t.errors)[0],!0):g&&bn(g[1])&&(b=lO(r,g[0]));let j=g?g[1].statusCode:void 0,w=s&&j&&j>=400,k=b.filter((_,P)=>{let{route:C}=_;if(C.lazy)return!0;if(C.loader==null)return!1;if(i)return X2(C,t.loaderData,t.errors);if(XY(t.loaderData,t.matches[P],_)||c.some(T=>T===_.route.id))return!0;let A=t.matches[P],O=_;return uO(_,$t({currentUrl:x,currentParams:A.params,nextUrl:v,nextParams:O.params},n,{actionResult:y,actionStatus:j,defaultShouldRevalidate:w?!1:l||x.pathname+x.search===v.pathname+v.search||x.search!==v.search||T8(A,O)}))}),N=[];return f.forEach((_,P)=>{if(i||!r.some(E=>E.route.id===_.routeId)||d.has(P))return;let C=jo(p,_.path,m);if(!C){N.push({key:P,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let A=t.fetchers.get(P),O=Ed(C,_.path),T=!1;h.has(P)?T=!1:u.has(P)?(u.delete(P),T=!0):A&&A.state!=="idle"&&A.data===void 0?T=l:T=uO(O,$t({currentUrl:x,currentParams:t.matches[t.matches.length-1].params,nextUrl:v,nextParams:r[r.length-1].params},n,{actionResult:y,actionStatus:j,defaultShouldRevalidate:w?!1:l})),T&&N.push({key:P,routeId:_.routeId,path:_.path,matches:C,match:O,controller:new AbortController})}),[k,N]}function X2(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&t[e.id]!==void 0,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function XY(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function T8(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function uO(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function dO(e,t,r,n,a){var i;let s;if(e){let u=n[e];Ye(u,"No route found to patch children into: routeId = "+e),u.children||(u.children=[]),s=u.children}else s=r;let l=t.filter(u=>!s.some(d=>M8(u,d))),c=u0(l,a,[e||"_","patch",String(((i=s)==null?void 0:i.length)||"0")],n);s.push(...c)}function M8(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(i=>M8(r,i))}):!1}async function ZY(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];Ye(a,"No route found in manifest");let i={};for(let s in n){let c=a[s]!==void 0&&s!=="hasErrorBoundary";Qo(!c,'Route "'+a.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!c&&!bY.has(s)&&(i[s]=n[s])}Object.assign(a,i),Object.assign(a,$t({},t(a),{lazy:void 0}))}async function QY(e){let{matches:t}=e,r=t.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,i,s)=>Object.assign(a,{[r[s].route.id]:i}),{})}async function JY(e,t,r,n,a,i,s,l,c,u){let d=i.map(p=>p.route.lazy?ZY(p.route,c,l):void 0),f=i.map((p,m)=>{let g=d[m],y=a.some(v=>v.route.id===p.route.id);return $t({},p,{shouldLoad:y,resolve:async v=>(v&&n.method==="GET"&&(p.route.lazy||p.route.loader)&&(y=!0),y?eX(t,n,p,g,v,u):Promise.resolve({type:gt.data,result:void 0}))})}),h=await e({matches:f,request:n,params:i[0].params,fetcherKey:s,context:u});try{await Promise.all(d)}catch{}return h}async function eX(e,t,r,n,a,i){let s,l,c=u=>{let d,f=new Promise((m,g)=>d=g);l=()=>d(),t.signal.addEventListener("abort",l);let h=m=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):u({request:t,params:r.params,context:i},...m!==void 0?[m]:[]),p=(async()=>{try{return{type:"data",result:await(a?a(g=>h(g)):h())}}catch(m){return{type:"error",result:m}}})();return Promise.race([p,f])};try{let u=r.route[e];if(n)if(u){let d,[f]=await Promise.all([c(u).catch(h=>{d=h}),n]);if(d!==void 0)throw d;s=f}else if(await n,u=r.route[e],u)s=await c(u);else if(e==="action"){let d=new URL(t.url),f=d.pathname+d.search;throw rn(405,{method:t.method,pathname:f,routeId:r.route.id})}else return{type:gt.data,result:void 0};else if(u)s=await c(u);else{let d=new URL(t.url),f=d.pathname+d.search;throw rn(404,{pathname:f})}Ye(s.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:gt.error,result:u}}finally{l&&t.signal.removeEventListener("abort",l)}return s}async function tX(e){let{result:t,type:r}=e;if(D8(t)){let f;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?f=null:f=await t.json():f=await t.text()}catch(h){return{type:gt.error,error:h}}return r===gt.error?{type:gt.error,error:new f0(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:gt.data,data:f,statusCode:t.status,headers:t.headers}}if(r===gt.error){if(yO(t)){var n,a;if(t.data instanceof Error){var i,s;return{type:gt.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}}return{type:gt.error,error:new f0(((n=t.init)==null?void 0:n.status)||500,void 0,t.data),statusCode:_f(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:gt.error,error:t,statusCode:_f(t)?t.status:void 0}}if(sX(t)){var l,c;return{type:gt.deferred,deferredData:t,statusCode:(l=t.init)==null?void 0:l.status,headers:((c=t.init)==null?void 0:c.headers)&&new Headers(t.init.headers)}}if(yO(t)){var u,d;return{type:gt.data,data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(d=t.init)!=null&&d.headers?new Headers(t.init.headers):void 0}}return{type:gt.data,data:t}}function rX(e,t,r,n,a,i){let s=e.headers.get("Location");if(Ye(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!fE.test(s)){let l=n.slice(0,n.findIndex(c=>c.route.id===r)+1);s=Y2(new URL(t.url),l,a,!0,s,i),e.headers.set("Location",s)}return e}function fO(e,t,r){if(fE.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),i=Ci(a.pathname,r)!=null;if(a.origin===t.origin&&i)return a.pathname+a.search+a.hash}return e}function Al(e,t,r,n){let a=e.createURL(R8(t)).toString(),i={signal:r};if(n&&ga(n.formMethod)){let{formMethod:s,formEncType:l}=n;i.method=s.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(n.json)):l==="text/plain"?i.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?i.body=Z2(n.formData):i.body=n.formData}return new Request(a,i)}function Z2(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function hO(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function nX(e,t,r,n,a){let i={},s=null,l,c=!1,u={},d=r&&bn(r[1])?r[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let h=f.route.id,p=t[h];if(Ye(!Po(p),"Cannot handle redirect results in processLoaderData"),bn(p)){let m=p.error;d!==void 0&&(m=d,d=void 0),s=s||{};{let g=ko(e,h);s[g.route.id]==null&&(s[g.route.id]=m)}i[h]=void 0,c||(c=!0,l=_f(p.error)?p.error.status:500),p.headers&&(u[h]=p.headers)}else Ns(p)?(n.set(h,p.deferredData),i[h]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!c&&(l=p.statusCode),p.headers&&(u[h]=p.headers)):(i[h]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(l=p.statusCode),p.headers&&(u[h]=p.headers))}),d!==void 0&&r&&(s={[r[0]]:d},i[r[0]]=void 0),{loaderData:i,errors:s,statusCode:l||200,loaderHeaders:u}}function pO(e,t,r,n,a,i,s){let{loaderData:l,errors:c}=nX(t,r,n,s);return a.forEach(u=>{let{key:d,match:f,controller:h}=u,p=i[d];if(Ye(p,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(bn(p)){let m=ko(e.matches,f==null?void 0:f.route.id);c&&c[m.route.id]||(c=$t({},c,{[m.route.id]:p.error})),e.fetchers.delete(d)}else if(Po(p))Ye(!1,"Unhandled fetcher revalidation redirect");else if(Ns(p))Ye(!1,"Unhandled fetcher deferred data");else{let m=os(p.data);e.fetchers.set(d,m)}}),{loaderData:l,errors:c}}function mO(e,t,r,n){let a=$t({},t);for(let i of r){let s=i.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(a[s]=t[s]):e[s]!==void 0&&i.route.loader&&(a[s]=e[s]),n&&n.hasOwnProperty(s))break}return a}function gO(e){return e?bn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ko(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function xO(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function rn(e,t){let{pathname:r,routeId:n,method:a,type:i,message:s}=t===void 0?{}:t,l="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(l="Bad Request",a&&r&&n?c="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":i==="defer-action"?c="defer() is not supported in actions":i==="invalid-body"&&(c="Unable to encode submission body")):e===403?(l="Forbidden",c='Route "'+n+'" does not match URL "'+r+'"'):e===404?(l="Not Found",c='No route matches URL "'+r+'"'):e===405&&(l="Method Not Allowed",a&&r&&n?c="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(c='Invalid request method "'+a.toUpperCase()+'"')),new f0(e||500,l,new Error(c),!0)}function kp(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Po(a))return{key:n,result:a}}}function R8(e){let t=typeof e=="string"?Zs(e):e;return Jo($t({},t,{hash:""}))}function aX(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function iX(e){return D8(e.result)&&UY.has(e.result.status)}function Ns(e){return e.type===gt.deferred}function bn(e){return e.type===gt.error}function Po(e){return(e&&e.type)===gt.redirect}function yO(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function sX(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function D8(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function oX(e){return qY.has(e.toLowerCase())}function ga(e){return BY.has(e.toLowerCase())}async function lX(e,t,r,n,a){let i=Object.entries(t);for(let s=0;s<i.length;s++){let[l,c]=i[s],u=e.find(h=>(h==null?void 0:h.route.id)===l);if(!u)continue;let d=n.find(h=>h.route.id===u.route.id),f=d!=null&&!T8(d,u)&&(a&&a[u.route.id])!==void 0;Ns(c)&&f&&await hE(c,r,!1).then(h=>{h&&(t[l]=h)})}}async function cX(e,t,r){for(let n=0;n<r.length;n++){let{key:a,routeId:i,controller:s}=r[n],l=t[a];e.find(u=>(u==null?void 0:u.route.id)===i)&&Ns(l)&&(Ye(s,"Expected an AbortController for revalidating fetcher deferred result"),await hE(l,s.signal,!0).then(u=>{u&&(t[a]=u)}))}}async function hE(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:gt.data,data:e.deferredData.unwrappedData}}catch(a){return{type:gt.error,error:a}}return{type:gt.data,data:e.deferredData.data}}}function pE(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ed(e,t){let r=typeof t=="string"?Zs(t).search:t.search;if(e[e.length-1].route.index&&pE(r||""))return e[e.length-1];let n=C8(e);return n[n.length-1]}function vO(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:i,json:s}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:s,text:void 0}}}function Jy(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function uX(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Ju(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function dX(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function os(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function fX(e,t){try{let r=e.sessionStorage.getItem(O8);if(r){let n=JSON.parse(r);for(let[a,i]of Object.entries(n||{}))i&&Array.isArray(i)&&t.set(a,new Set(i||[]))}}catch{}}function hX(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(O8,JSON.stringify(r))}catch(n){Qo(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
51
+ * React Router v6.30.2
52
+ *
53
+ * Copyright (c) Remix Software Inc.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE.md file in the root directory of this source tree.
57
+ *
58
+ * @license MIT
59
+ */function h0(){return h0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h0.apply(this,arguments)}const $h=S.createContext(null),mE=S.createContext(null),Qs=S.createContext(null),gE=S.createContext(null),qi=S.createContext({outlet:null,matches:[],isDataRoute:!1}),$8=S.createContext(null);function pX(e,t){let{relative:r}=t===void 0?{}:t;Ih()||Ye(!1);let{basename:n,navigator:a}=S.useContext(Qs),{hash:i,pathname:s,search:l}=Qg(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:xi([n,s])),a.createHref({pathname:c,search:l,hash:i})}function Ih(){return S.useContext(gE)!=null}function Js(){return Ih()||Ye(!1),S.useContext(gE).location}function I8(e){S.useContext(Qs).static||S.useLayoutEffect(e)}function Lh(){let{isDataRoute:e}=S.useContext(qi);return e?PX():mX()}function mX(){Ih()||Ye(!1);let e=S.useContext($h),{basename:t,future:r,navigator:n}=S.useContext(Qs),{matches:a}=S.useContext(qi),{pathname:i}=Js(),s=JSON.stringify(uE(a,r.v7_relativeSplatPath)),l=S.useRef(!1);return I8(()=>{l.current=!0}),S.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let f=dE(u,JSON.parse(s),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:xi([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,s,i,e])}const gX=S.createContext(null);function xX(e){let t=S.useContext(qi).outlet;return t&&S.createElement(gX.Provider,{value:e},t)}function xE(){let{matches:e}=S.useContext(qi),t=e[e.length-1];return t?t.params:{}}function Qg(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=S.useContext(Qs),{matches:a}=S.useContext(qi),{pathname:i}=Js(),s=JSON.stringify(uE(a,n.v7_relativeSplatPath));return S.useMemo(()=>dE(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}function yX(e,t,r,n){Ih()||Ye(!1);let{navigator:a}=S.useContext(Qs),{matches:i}=S.useContext(qi),s=i[i.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=Js(),d;d=u;let f=d.pathname||"/",h=f;if(c!=="/"){let g=c.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let p=jo(e,{pathname:h});return kX(p&&p.map(g=>Object.assign({},g,{params:Object.assign({},l,g.params),pathname:xi([c,a.encodeLocation?a.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?c:xi([c,a.encodeLocation?a.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),i,r,n)}function vX(){let e=EX(),t=_f(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),r?S.createElement("pre",{style:a},r):null,null)}const bX=S.createElement(vX,null);class wX extends S.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?S.createElement(qi.Provider,{value:this.props.routeContext},S.createElement($8.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function jX(e){let{routeContext:t,match:r,children:n}=e,a=S.useContext($h);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),S.createElement(qi.Provider,{value:t},n)}function kX(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,l=(a=r)==null?void 0:a.errors;if(l!=null){let d=s.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||Ye(!1),s=s.slice(0,Math.min(s.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<s.length;d++){let f=s[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:p}=r,m=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||m){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,f,h)=>{let p,m=!1,g=null,y=null;r&&(p=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||bX,c&&(u<0&&h===0?(CX("route-fallback"),m=!0,y=null):u===h&&(m=!0,y=f.route.hydrateFallbackElement||null)));let x=t.concat(s.slice(0,h+1)),v=()=>{let b;return p?b=g:m?b=y:f.route.Component?b=S.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=d,S.createElement(jX,{match:f,routeContext:{outlet:d,matches:x,isDataRoute:r!=null},children:b})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?S.createElement(wX,{location:r.location,revalidation:r.revalidation,component:g,error:p,children:v(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):v()},null)}var L8=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(L8||{}),z8=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}(z8||{});function NX(e){let t=S.useContext($h);return t||Ye(!1),t}function SX(e){let t=S.useContext(mE);return t||Ye(!1),t}function _X(e){let t=S.useContext(qi);return t||Ye(!1),t}function F8(e){let t=_X(),r=t.matches[t.matches.length-1];return r.route.id||Ye(!1),r.route.id}function EX(){var e;let t=S.useContext($8),r=SX(z8.UseRouteError),n=F8();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function PX(){let{router:e}=NX(L8.UseNavigateStable),t=F8(),r=S.useRef(!1);return I8(()=>{r.current=!0}),S.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,h0({fromRouteId:t},i)))},[e,t])}const bO={};function CX(e,t,r){bO[e]||(bO[e]=!0)}function AX(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function OX(e){return xX(e.context)}function TX(e){let{basename:t="/",children:r=null,location:n,navigationType:a=sr.Pop,navigator:i,static:s=!1,future:l}=e;Ih()&&Ye(!1);let c=t.replace(/^\/*/,"/"),u=S.useMemo(()=>({basename:c,navigator:i,static:s,future:h0({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Zs(n));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:m="default"}=n,g=S.useMemo(()=>{let y=Ci(d,c);return y==null?null:{location:{pathname:y,search:f,hash:h,state:p,key:m},navigationType:a}},[c,d,f,h,p,m,a]);return g==null?null:S.createElement(Qs.Provider,{value:u},S.createElement(gE.Provider,{children:r,value:g}))}new Promise(()=>{});function MX(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:S.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:S.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:S.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
60
+ * React Router DOM v6.30.2
61
+ *
62
+ * Copyright (c) Remix Software Inc.
63
+ *
64
+ * This source code is licensed under the MIT license found in the
65
+ * LICENSE.md file in the root directory of this source tree.
66
+ *
67
+ * @license MIT
68
+ */function zc(){return zc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zc.apply(this,arguments)}function B8(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function RX(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function DX(e,t){return e.button===0&&(!t||t==="_self")&&!RX(e)}function Q2(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function $X(e,t){let r=Q2(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}const IX=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],LX=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],zX="6";try{window.__reactRouterVersion=zX}catch{}function FX(e,t){return KY({basename:void 0,future:zc({},void 0,{v7_prependBasename:!0}),history:xY({window:void 0}),hydrationData:BX(),routes:e,mapRouteProperties:MX,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function BX(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=zc({},t,{errors:VX(t.errors)})),t}function VX(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new f0(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let i=window[a.__subType];if(typeof i=="function")try{let s=new i(a.message);s.stack="",r[n]=s}catch{}}if(r[n]==null){let i=new Error(a.message);i.stack="",r[n]=i}}else r[n]=a;return r}const V8=S.createContext({isTransitioning:!1}),qX=S.createContext(new Map),UX="startTransition",wO=Nz[UX],HX="flushSync",jO=gY[HX];function WX(e){wO?wO(e):e()}function ed(e){jO?jO(e):e()}class GX{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function KX(e){let{fallbackElement:t,router:r,future:n}=e,[a,i]=S.useState(r.state),[s,l]=S.useState(),[c,u]=S.useState({isTransitioning:!1}),[d,f]=S.useState(),[h,p]=S.useState(),[m,g]=S.useState(),y=S.useRef(new Map),{v7_startTransition:x}=n||{},v=S.useCallback(_=>{x?WX(_):_()},[x]),b=S.useCallback((_,P)=>{let{deletedFetchers:C,flushSync:A,viewTransitionOpts:O}=P;_.fetchers.forEach((E,R)=>{E.data!==void 0&&y.current.set(R,E.data)}),C.forEach(E=>y.current.delete(E));let T=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!O||T){A?ed(()=>i(_)):v(()=>i(_));return}if(A){ed(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:O.currentLocation,nextLocation:O.nextLocation})});let E=r.window.document.startViewTransition(()=>{ed(()=>i(_))});E.finished.finally(()=>{ed(()=>{f(void 0),p(void 0),l(void 0),u({isTransitioning:!1})})}),ed(()=>p(E));return}h?(d&&d.resolve(),h.skipTransition(),g({state:_,currentLocation:O.currentLocation,nextLocation:O.nextLocation})):(l(_),u({isTransitioning:!0,flushSync:!1,currentLocation:O.currentLocation,nextLocation:O.nextLocation}))},[r.window,h,d,y,v]);S.useLayoutEffect(()=>r.subscribe(b),[r,b]),S.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new GX)},[c]),S.useEffect(()=>{if(d&&s&&r.window){let _=s,P=d.promise,C=r.window.document.startViewTransition(async()=>{v(()=>i(_)),await P});C.finished.finally(()=>{f(void 0),p(void 0),l(void 0),u({isTransitioning:!1})}),p(C)}},[v,s,d,r.window]),S.useEffect(()=>{d&&s&&a.location.key===s.location.key&&d.resolve()},[d,h,a.location,s]),S.useEffect(()=>{!c.isTransitioning&&m&&(l(m.state),u({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),g(void 0))},[c.isTransitioning,m]),S.useEffect(()=>{},[]);let j=S.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:_=>r.navigate(_),push:(_,P,C)=>r.navigate(_,{state:P,preventScrollReset:C==null?void 0:C.preventScrollReset}),replace:(_,P,C)=>r.navigate(_,{replace:!0,state:P,preventScrollReset:C==null?void 0:C.preventScrollReset})}),[r]),w=r.basename||"/",k=S.useMemo(()=>({router:r,navigator:j,static:!1,basename:w}),[r,j,w]),N=S.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return S.useEffect(()=>AX(n,r.future),[n,r.future]),S.createElement(S.Fragment,null,S.createElement($h.Provider,{value:k},S.createElement(mE.Provider,{value:a},S.createElement(qX.Provider,{value:y.current},S.createElement(V8.Provider,{value:c},S.createElement(TX,{basename:w,location:a.location,navigationType:a.historyAction,navigator:j,future:N},a.initialized||r.future.v7_partialHydration?S.createElement(YX,{routes:r.routes,future:r.future,state:a}):t))))),null)}const YX=S.memo(XX);function XX(e){let{routes:t,future:r,state:n}=e;return yX(t,void 0,n,r)}const ZX=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",QX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ft=S.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:s,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=B8(t,IX),{basename:p}=S.useContext(Qs),m,g=!1;if(typeof u=="string"&&QX.test(u)&&(m=u,ZX))try{let b=new URL(window.location.href),j=u.startsWith("//")?new URL(b.protocol+u):new URL(u),w=Ci(j.pathname,p);j.origin===b.origin&&w!=null?u=w+j.search+j.hash:g=!0}catch{}let y=pX(u,{relative:a}),x=tZ(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:a,viewTransition:f});function v(b){n&&n(b),b.defaultPrevented||x(b)}return S.createElement("a",zc({},h,{href:m||y,onClick:g||i?n:v,ref:r,target:c}))}),JX=S.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:i="",end:s=!1,style:l,to:c,viewTransition:u,children:d}=t,f=B8(t,LX),h=Qg(c,{relative:f.relative}),p=Js(),m=S.useContext(mE),{navigator:g,basename:y}=S.useContext(Qs),x=m!=null&&rZ(h)&&u===!0,v=g.encodeLocation?g.encodeLocation(h).pathname:h.pathname,b=p.pathname,j=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;a||(b=b.toLowerCase(),j=j?j.toLowerCase():null,v=v.toLowerCase()),j&&y&&(j=Ci(j,y)||j);const w=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let k=b===v||!s&&b.startsWith(v)&&b.charAt(w)==="/",N=j!=null&&(j===v||!s&&j.startsWith(v)&&j.charAt(v.length)==="/"),_={isActive:k,isPending:N,isTransitioning:x},P=k?n:void 0,C;typeof i=="function"?C=i(_):C=[i,k?"active":null,N?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let A=typeof l=="function"?l(_):l;return S.createElement(ft,zc({},f,{"aria-current":P,className:C,ref:r,style:A,to:c,viewTransition:u}),typeof d=="function"?d(_):d)});var J2;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(J2||(J2={}));var kO;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(kO||(kO={}));function eZ(e){let t=S.useContext($h);return t||Ye(!1),t}function tZ(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=Lh(),u=Js(),d=Qg(e,{relative:s});return S.useCallback(f=>{if(DX(f,r)){f.preventDefault();let h=n!==void 0?n:Jo(u)===Jo(d);c(e,{replace:h,state:a,preventScrollReset:i,relative:s,viewTransition:l})}},[u,c,d,n,a,r,e,i,s,l])}function Jg(e){let t=S.useRef(Q2(e)),r=S.useRef(!1),n=Js(),a=S.useMemo(()=>$X(n.search,r.current?null:t.current),[n.search]),i=Lh(),s=S.useCallback((l,c)=>{const u=Q2(typeof l=="function"?l(a):l);r.current=!0,i("?"+u,c)},[i,a]);return[a,s]}function rZ(e,t){t===void 0&&(t={});let r=S.useContext(V8);r==null&&Ye(!1);let{basename:n}=eZ(J2.useViewTransitionState),a=Qg(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=Ci(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=Ci(r.nextLocation.pathname,n)||r.nextLocation.pathname;return d0(a.pathname,s)!=null||d0(a.pathname,i)!=null}const q8=S.createContext();function nZ({children:e}){const[t,r]=S.useState(()=>{const a=localStorage.getItem("flowyml-theme");return a?(document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(a),a):window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?(document.documentElement.classList.remove("light"),document.documentElement.classList.add("dark"),"dark"):(document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light"),"light")});S.useEffect(()=>{document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(t),localStorage.setItem("flowyml-theme",t)},[t]);const n=()=>{r(a=>a==="light"?"dark":"light")};return o.jsx(q8.Provider,{value:{theme:t,setTheme:r,toggleTheme:n},children:e})}function aZ(){const e=S.useContext(q8);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const U8=S.createContext();function iZ({children:e}){const[t,r]=S.useState(()=>localStorage.getItem("flowyml-selected-project")||null),[n,a]=S.useState([]),[i,s]=S.useState(!0);S.useEffect(()=>{fetch("/api/projects/").then(d=>d.json()).then(d=>{a(d.projects||[]),s(!1)}).catch(d=>{console.error("Failed to fetch projects:",d),s(!1)})},[]),S.useEffect(()=>{t?localStorage.setItem("flowyml-selected-project",t):localStorage.removeItem("flowyml-selected-project")},[t]);const l=d=>{r(d)},c=()=>{r(null)},u=async()=>{s(!0);try{const f=await(await fetch("/api/projects/")).json();a(f.projects||[])}catch(d){console.error("Failed to refresh projects:",d)}finally{s(!1)}};return o.jsx(U8.Provider,{value:{selectedProject:t,projects:n,loading:i,selectProject:l,clearProject:c,refreshProjects:u},children:e})}function Ui(){const e=S.useContext(U8);if(!e)throw new Error("useProject must be used within ProjectProvider");return e}/**
69
+ * @license lucide-react v0.344.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */var sZ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
74
+ * @license lucide-react v0.344.0 - ISC
75
+ *
76
+ * This source code is licensed under the ISC license.
77
+ * See the LICENSE file in the root directory of this source tree.
78
+ */const oZ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),ne=(e,t)=>{const r=S.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:s,className:l="",children:c,...u},d)=>S.createElement("svg",{ref:d,...sZ,width:a,height:a,stroke:n,strokeWidth:s?Number(i)*24/Number(a):i,className:["lucide",`lucide-${oZ(e)}`,l].join(" "),...u},[...t.map(([f,h])=>S.createElement(f,h)),...Array.isArray(c)?c:[c]]));return r.displayName=`${e}`,r};/**
79
+ * @license lucide-react v0.344.0 - ISC
80
+ *
81
+ * This source code is licensed under the ISC license.
82
+ * See the LICENSE file in the root directory of this source tree.
83
+ */const Fe=ne("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
84
+ * @license lucide-react v0.344.0 - ISC
85
+ *
86
+ * This source code is licensed under the ISC license.
87
+ * See the LICENSE file in the root directory of this source tree.
88
+ */const dn=ne("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
89
+ * @license lucide-react v0.344.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ */const ex=ne("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
94
+ * @license lucide-react v0.344.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */const lZ=ne("ArrowDownCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]]);/**
99
+ * @license lucide-react v0.344.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */const H8=ne("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
104
+ * @license lucide-react v0.344.0 - ISC
105
+ *
106
+ * This source code is licensed under the ISC license.
107
+ * See the LICENSE file in the root directory of this source tree.
108
+ */const Ai=ne("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
109
+ * @license lucide-react v0.344.0 - ISC
110
+ *
111
+ * This source code is licensed under the ISC license.
112
+ * See the LICENSE file in the root directory of this source tree.
113
+ */const cZ=ne("ArrowUpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
114
+ * @license lucide-react v0.344.0 - ISC
115
+ *
116
+ * This source code is licensed under the ISC license.
117
+ * See the LICENSE file in the root directory of this source tree.
118
+ */const W8=ne("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
119
+ * @license lucide-react v0.344.0 - ISC
120
+ *
121
+ * This source code is licensed under the ISC license.
122
+ * See the LICENSE file in the root directory of this source tree.
123
+ */const Pn=ne("BarChart2",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
124
+ * @license lucide-react v0.344.0 - ISC
125
+ *
126
+ * This source code is licensed under the ISC license.
127
+ * See the LICENSE file in the root directory of this source tree.
128
+ */const p0=ne("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
129
+ * @license lucide-react v0.344.0 - ISC
130
+ *
131
+ * This source code is licensed under the ISC license.
132
+ * See the LICENSE file in the root directory of this source tree.
133
+ */const uZ=ne("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
134
+ * @license lucide-react v0.344.0 - ISC
135
+ *
136
+ * This source code is licensed under the ISC license.
137
+ * See the LICENSE file in the root directory of this source tree.
138
+ */const Ur=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
139
+ * @license lucide-react v0.344.0 - ISC
140
+ *
141
+ * This source code is licensed under the ISC license.
142
+ * See the LICENSE file in the root directory of this source tree.
143
+ */const dZ=ne("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
144
+ * @license lucide-react v0.344.0 - ISC
145
+ *
146
+ * This source code is licensed under the ISC license.
147
+ * See the LICENSE file in the root directory of this source tree.
148
+ */const _a=ne("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
149
+ * @license lucide-react v0.344.0 - ISC
150
+ *
151
+ * This source code is licensed under the ISC license.
152
+ * See the LICENSE file in the root directory of this source tree.
153
+ */const _m=ne("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
154
+ * @license lucide-react v0.344.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */const rr=ne("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
159
+ * @license lucide-react v0.344.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */const fZ=ne("CheckSquare",[["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}],["path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11",key:"1jnkn4"}]]);/**
164
+ * @license lucide-react v0.344.0 - ISC
165
+ *
166
+ * This source code is licensed under the ISC license.
167
+ * See the LICENSE file in the root directory of this source tree.
168
+ */const Ef=ne("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
169
+ * @license lucide-react v0.344.0 - ISC
170
+ *
171
+ * This source code is licensed under the ISC license.
172
+ * See the LICENSE file in the root directory of this source tree.
173
+ */const yE=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
174
+ * @license lucide-react v0.344.0 - ISC
175
+ *
176
+ * This source code is licensed under the ISC license.
177
+ * See the LICENSE file in the root directory of this source tree.
178
+ */const hZ=ne("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
179
+ * @license lucide-react v0.344.0 - ISC
180
+ *
181
+ * This source code is licensed under the ISC license.
182
+ * See the LICENSE file in the root directory of this source tree.
183
+ */const na=ne("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
184
+ * @license lucide-react v0.344.0 - ISC
185
+ *
186
+ * This source code is licensed under the ISC license.
187
+ * See the LICENSE file in the root directory of this source tree.
188
+ */const ht=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
189
+ * @license lucide-react v0.344.0 - ISC
190
+ *
191
+ * This source code is licensed under the ISC license.
192
+ * See the LICENSE file in the root directory of this source tree.
193
+ */const G8=ne("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
194
+ * @license lucide-react v0.344.0 - ISC
195
+ *
196
+ * This source code is licensed under the ISC license.
197
+ * See the LICENSE file in the root directory of this source tree.
198
+ */const pZ=ne("Code2",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
199
+ * @license lucide-react v0.344.0 - ISC
200
+ *
201
+ * This source code is licensed under the ISC license.
202
+ * See the LICENSE file in the root directory of this source tree.
203
+ */const NO=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
204
+ * @license lucide-react v0.344.0 - ISC
205
+ *
206
+ * This source code is licensed under the ISC license.
207
+ * See the LICENSE file in the root directory of this source tree.
208
+ */const mZ=ne("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
209
+ * @license lucide-react v0.344.0 - ISC
210
+ *
211
+ * This source code is licensed under the ISC license.
212
+ * See the LICENSE file in the root directory of this source tree.
213
+ */const Pf=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
214
+ * @license lucide-react v0.344.0 - ISC
215
+ *
216
+ * This source code is licensed under the ISC license.
217
+ * See the LICENSE file in the root directory of this source tree.
218
+ */const gZ=ne("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
219
+ * @license lucide-react v0.344.0 - ISC
220
+ *
221
+ * This source code is licensed under the ISC license.
222
+ * See the LICENSE file in the root directory of this source tree.
223
+ */const nr=ne("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
224
+ * @license lucide-react v0.344.0 - ISC
225
+ *
226
+ * This source code is licensed under the ISC license.
227
+ * See the LICENSE file in the root directory of this source tree.
228
+ */const xZ=ne("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
229
+ * @license lucide-react v0.344.0 - ISC
230
+ *
231
+ * This source code is licensed under the ISC license.
232
+ * See the LICENSE file in the root directory of this source tree.
233
+ */const Oa=ne("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
234
+ * @license lucide-react v0.344.0 - ISC
235
+ *
236
+ * This source code is licensed under the ISC license.
237
+ * See the LICENSE file in the root directory of this source tree.
238
+ */const bc=ne("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
239
+ * @license lucide-react v0.344.0 - ISC
240
+ *
241
+ * This source code is licensed under the ISC license.
242
+ * See the LICENSE file in the root directory of this source tree.
243
+ */const K8=ne("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
244
+ * @license lucide-react v0.344.0 - ISC
245
+ *
246
+ * This source code is licensed under the ISC license.
247
+ * See the LICENSE file in the root directory of this source tree.
248
+ */const ju=ne("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
249
+ * @license lucide-react v0.344.0 - ISC
250
+ *
251
+ * This source code is licensed under the ISC license.
252
+ * See the LICENSE file in the root directory of this source tree.
253
+ */const gs=ne("FileBox",[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]]);/**
254
+ * @license lucide-react v0.344.0 - ISC
255
+ *
256
+ * This source code is licensed under the ISC license.
257
+ * See the LICENSE file in the root directory of this source tree.
258
+ */const yZ=ne("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);/**
259
+ * @license lucide-react v0.344.0 - ISC
260
+ *
261
+ * This source code is licensed under the ISC license.
262
+ * See the LICENSE file in the root directory of this source tree.
263
+ */const qs=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
264
+ * @license lucide-react v0.344.0 - ISC
265
+ *
266
+ * This source code is licensed under the ISC license.
267
+ * See the LICENSE file in the root directory of this source tree.
268
+ */const Y8=ne("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
269
+ * @license lucide-react v0.344.0 - ISC
270
+ *
271
+ * This source code is licensed under the ISC license.
272
+ * See the LICENSE file in the root directory of this source tree.
273
+ */const Xn=ne("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
274
+ * @license lucide-react v0.344.0 - ISC
275
+ *
276
+ * This source code is licensed under the ISC license.
277
+ * See the LICENSE file in the root directory of this source tree.
278
+ */const vZ=ne("FolderKanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);/**
279
+ * @license lucide-react v0.344.0 - ISC
280
+ *
281
+ * This source code is licensed under the ISC license.
282
+ * See the LICENSE file in the root directory of this source tree.
283
+ */const m0=ne("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
284
+ * @license lucide-react v0.344.0 - ISC
285
+ *
286
+ * This source code is licensed under the ISC license.
287
+ * See the LICENSE file in the root directory of this source tree.
288
+ */const Zn=ne("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
289
+ * @license lucide-react v0.344.0 - ISC
290
+ *
291
+ * This source code is licensed under the ISC license.
292
+ * See the LICENSE file in the root directory of this source tree.
293
+ */const bZ=ne("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
294
+ * @license lucide-react v0.344.0 - ISC
295
+ *
296
+ * This source code is licensed under the ISC license.
297
+ * See the LICENSE file in the root directory of this source tree.
298
+ */const Fc=ne("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
299
+ * @license lucide-react v0.344.0 - ISC
300
+ *
301
+ * This source code is licensed under the ISC license.
302
+ * See the LICENSE file in the root directory of this source tree.
303
+ */const vE=ne("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
304
+ * @license lucide-react v0.344.0 - ISC
305
+ *
306
+ * This source code is licensed under the ISC license.
307
+ * See the LICENSE file in the root directory of this source tree.
308
+ */const el=ne("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
309
+ * @license lucide-react v0.344.0 - ISC
310
+ *
311
+ * This source code is licensed under the ISC license.
312
+ * See the LICENSE file in the root directory of this source tree.
313
+ */const X8=ne("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
314
+ * @license lucide-react v0.344.0 - ISC
315
+ *
316
+ * This source code is licensed under the ISC license.
317
+ * See the LICENSE file in the root directory of this source tree.
318
+ */const bE=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
319
+ * @license lucide-react v0.344.0 - ISC
320
+ *
321
+ * This source code is licensed under the ISC license.
322
+ * See the LICENSE file in the root directory of this source tree.
323
+ */const Xd=ne("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
324
+ * @license lucide-react v0.344.0 - ISC
325
+ *
326
+ * This source code is licensed under the ISC license.
327
+ * See the LICENSE file in the root directory of this source tree.
328
+ */const wZ=ne("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/**
329
+ * @license lucide-react v0.344.0 - ISC
330
+ *
331
+ * This source code is licensed under the ISC license.
332
+ * See the LICENSE file in the root directory of this source tree.
333
+ */const jZ=ne("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
334
+ * @license lucide-react v0.344.0 - ISC
335
+ *
336
+ * This source code is licensed under the ISC license.
337
+ * See the LICENSE file in the root directory of this source tree.
338
+ */const Z8=ne("Import",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);/**
339
+ * @license lucide-react v0.344.0 - ISC
340
+ *
341
+ * This source code is licensed under the ISC license.
342
+ * See the LICENSE file in the root directory of this source tree.
343
+ */const yi=ne("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
344
+ * @license lucide-react v0.344.0 - ISC
345
+ *
346
+ * This source code is licensed under the ISC license.
347
+ * See the LICENSE file in the root directory of this source tree.
348
+ */const g0=ne("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
349
+ * @license lucide-react v0.344.0 - ISC
350
+ *
351
+ * This source code is licensed under the ISC license.
352
+ * See the LICENSE file in the root directory of this source tree.
353
+ */const Zr=ne("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
354
+ * @license lucide-react v0.344.0 - ISC
355
+ *
356
+ * This source code is licensed under the ISC license.
357
+ * See the LICENSE file in the root directory of this source tree.
358
+ */const Q8=ne("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
359
+ * @license lucide-react v0.344.0 - ISC
360
+ *
361
+ * This source code is licensed under the ISC license.
362
+ * See the LICENSE file in the root directory of this source tree.
363
+ */const J8=ne("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
364
+ * @license lucide-react v0.344.0 - ISC
365
+ *
366
+ * This source code is licensed under the ISC license.
367
+ * See the LICENSE file in the root directory of this source tree.
368
+ */const tl=ne("LineChart",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
369
+ * @license lucide-react v0.344.0 - ISC
370
+ *
371
+ * This source code is licensed under the ISC license.
372
+ * See the LICENSE file in the root directory of this source tree.
373
+ */const kZ=ne("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
374
+ * @license lucide-react v0.344.0 - ISC
375
+ *
376
+ * This source code is licensed under the ISC license.
377
+ * See the LICENSE file in the root directory of this source tree.
378
+ */const eF=ne("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
379
+ * @license lucide-react v0.344.0 - ISC
380
+ *
381
+ * This source code is licensed under the ISC license.
382
+ * See the LICENSE file in the root directory of this source tree.
383
+ */const Sn=ne("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
384
+ * @license lucide-react v0.344.0 - ISC
385
+ *
386
+ * This source code is licensed under the ISC license.
387
+ * See the LICENSE file in the root directory of this source tree.
388
+ */const tF=ne("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
389
+ * @license lucide-react v0.344.0 - ISC
390
+ *
391
+ * This source code is licensed under the ISC license.
392
+ * See the LICENSE file in the root directory of this source tree.
393
+ */const Cf=ne("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
394
+ * @license lucide-react v0.344.0 - ISC
395
+ *
396
+ * This source code is licensed under the ISC license.
397
+ * See the LICENSE file in the root directory of this source tree.
398
+ */const rF=ne("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
399
+ * @license lucide-react v0.344.0 - ISC
400
+ *
401
+ * This source code is licensed under the ISC license.
402
+ * See the LICENSE file in the root directory of this source tree.
403
+ */const nF=ne("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/**
404
+ * @license lucide-react v0.344.0 - ISC
405
+ *
406
+ * This source code is licensed under the ISC license.
407
+ * See the LICENSE file in the root directory of this source tree.
408
+ */const SO=ne("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
409
+ * @license lucide-react v0.344.0 - ISC
410
+ *
411
+ * This source code is licensed under the ISC license.
412
+ * See the LICENSE file in the root directory of this source tree.
413
+ */const NZ=ne("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
414
+ * @license lucide-react v0.344.0 - ISC
415
+ *
416
+ * This source code is licensed under the ISC license.
417
+ * See the LICENSE file in the root directory of this source tree.
418
+ */const aF=ne("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
419
+ * @license lucide-react v0.344.0 - ISC
420
+ *
421
+ * This source code is licensed under the ISC license.
422
+ * See the LICENSE file in the root directory of this source tree.
423
+ */const Ea=ne("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
424
+ * @license lucide-react v0.344.0 - ISC
425
+ *
426
+ * This source code is licensed under the ISC license.
427
+ * See the LICENSE file in the root directory of this source tree.
428
+ */const SZ=ne("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
429
+ * @license lucide-react v0.344.0 - ISC
430
+ *
431
+ * This source code is licensed under the ISC license.
432
+ * See the LICENSE file in the root directory of this source tree.
433
+ */const _Z=ne("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
434
+ * @license lucide-react v0.344.0 - ISC
435
+ *
436
+ * This source code is licensed under the ISC license.
437
+ * See the LICENSE file in the root directory of this source tree.
438
+ */const EZ=ne("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
439
+ * @license lucide-react v0.344.0 - ISC
440
+ *
441
+ * This source code is licensed under the ISC license.
442
+ * See the LICENSE file in the root directory of this source tree.
443
+ */const iF=ne("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);/**
444
+ * @license lucide-react v0.344.0 - ISC
445
+ *
446
+ * This source code is licensed under the ISC license.
447
+ * See the LICENSE file in the root directory of this source tree.
448
+ */const _O=ne("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/**
449
+ * @license lucide-react v0.344.0 - ISC
450
+ *
451
+ * This source code is licensed under the ISC license.
452
+ * See the LICENSE file in the root directory of this source tree.
453
+ */const PZ=ne("PenTool",[["path",{d:"m12 19 7-7 3 3-7 7-3-3z",key:"rklqx2"}],["path",{d:"m18 13-1.5-7.5L2 2l3.5 14.5L13 18l5-5z",key:"1et58u"}],["path",{d:"m2 2 7.586 7.586",key:"etlp93"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]]);/**
454
+ * @license lucide-react v0.344.0 - ISC
455
+ *
456
+ * This source code is licensed under the ISC license.
457
+ * See the LICENSE file in the root directory of this source tree.
458
+ */const sF=ne("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/**
459
+ * @license lucide-react v0.344.0 - ISC
460
+ *
461
+ * This source code is licensed under the ISC license.
462
+ * See the LICENSE file in the root directory of this source tree.
463
+ */const fn=ne("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
464
+ * @license lucide-react v0.344.0 - ISC
465
+ *
466
+ * This source code is licensed under the ISC license.
467
+ * See the LICENSE file in the root directory of this source tree.
468
+ */const x0=ne("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
469
+ * @license lucide-react v0.344.0 - ISC
470
+ *
471
+ * This source code is licensed under the ISC license.
472
+ * See the LICENSE file in the root directory of this source tree.
473
+ */const rl=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
474
+ * @license lucide-react v0.344.0 - ISC
475
+ *
476
+ * This source code is licensed under the ISC license.
477
+ * See the LICENSE file in the root directory of this source tree.
478
+ */const CZ=ne("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/**
479
+ * @license lucide-react v0.344.0 - ISC
480
+ *
481
+ * This source code is licensed under the ISC license.
482
+ * See the LICENSE file in the root directory of this source tree.
483
+ */const vi=ne("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
484
+ * @license lucide-react v0.344.0 - ISC
485
+ *
486
+ * This source code is licensed under the ISC license.
487
+ * See the LICENSE file in the root directory of this source tree.
488
+ */const No=ne("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
489
+ * @license lucide-react v0.344.0 - ISC
490
+ *
491
+ * This source code is licensed under the ISC license.
492
+ * See the LICENSE file in the root directory of this source tree.
493
+ */const AZ=ne("Rows2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]]);/**
494
+ * @license lucide-react v0.344.0 - ISC
495
+ *
496
+ * This source code is licensed under the ISC license.
497
+ * See the LICENSE file in the root directory of this source tree.
498
+ */const OZ=ne("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
499
+ * @license lucide-react v0.344.0 - ISC
500
+ *
501
+ * This source code is licensed under the ISC license.
502
+ * See the LICENSE file in the root directory of this source tree.
503
+ */const Af=ne("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
504
+ * @license lucide-react v0.344.0 - ISC
505
+ *
506
+ * This source code is licensed under the ISC license.
507
+ * See the LICENSE file in the root directory of this source tree.
508
+ */const TZ=ne("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
509
+ * @license lucide-react v0.344.0 - ISC
510
+ *
511
+ * This source code is licensed under the ISC license.
512
+ * See the LICENSE file in the root directory of this source tree.
513
+ */const tx=ne("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
514
+ * @license lucide-react v0.344.0 - ISC
515
+ *
516
+ * This source code is licensed under the ISC license.
517
+ * See the LICENSE file in the root directory of this source tree.
518
+ */const MZ=ne("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
519
+ * @license lucide-react v0.344.0 - ISC
520
+ *
521
+ * This source code is licensed under the ISC license.
522
+ * See the LICENSE file in the root directory of this source tree.
523
+ */const wE=ne("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
524
+ * @license lucide-react v0.344.0 - ISC
525
+ *
526
+ * This source code is licensed under the ISC license.
527
+ * See the LICENSE file in the root directory of this source tree.
528
+ */const RZ=ne("Sliders",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
529
+ * @license lucide-react v0.344.0 - ISC
530
+ *
531
+ * This source code is licensed under the ISC license.
532
+ * See the LICENSE file in the root directory of this source tree.
533
+ */const DZ=ne("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
534
+ * @license lucide-react v0.344.0 - ISC
535
+ *
536
+ * This source code is licensed under the ISC license.
537
+ * See the LICENSE file in the root directory of this source tree.
538
+ */const EO=ne("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
539
+ * @license lucide-react v0.344.0 - ISC
540
+ *
541
+ * This source code is licensed under the ISC license.
542
+ * See the LICENSE file in the root directory of this source tree.
543
+ */const $Z=ne("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
544
+ * @license lucide-react v0.344.0 - ISC
545
+ *
546
+ * This source code is licensed under the ISC license.
547
+ * See the LICENSE file in the root directory of this source tree.
548
+ */const oF=ne("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
549
+ * @license lucide-react v0.344.0 - ISC
550
+ *
551
+ * This source code is licensed under the ISC license.
552
+ * See the LICENSE file in the root directory of this source tree.
553
+ */const Of=ne("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
554
+ * @license lucide-react v0.344.0 - ISC
555
+ *
556
+ * This source code is licensed under the ISC license.
557
+ * See the LICENSE file in the root directory of this source tree.
558
+ */const Tf=ne("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
559
+ * @license lucide-react v0.344.0 - ISC
560
+ *
561
+ * This source code is licensed under the ISC license.
562
+ * See the LICENSE file in the root directory of this source tree.
563
+ */const jE=ne("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
564
+ * @license lucide-react v0.344.0 - ISC
565
+ *
566
+ * This source code is licensed under the ISC license.
567
+ * See the LICENSE file in the root directory of this source tree.
568
+ */const nl=ne("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
569
+ * @license lucide-react v0.344.0 - ISC
570
+ *
571
+ * This source code is licensed under the ISC license.
572
+ * See the LICENSE file in the root directory of this source tree.
573
+ */const Oi=ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
574
+ * @license lucide-react v0.344.0 - ISC
575
+ *
576
+ * This source code is licensed under the ISC license.
577
+ * See the LICENSE file in the root directory of this source tree.
578
+ */const rx=ne("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
579
+ * @license lucide-react v0.344.0 - ISC
580
+ *
581
+ * This source code is licensed under the ISC license.
582
+ * See the LICENSE file in the root directory of this source tree.
583
+ */const Hr=ne("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
584
+ * @license lucide-react v0.344.0 - ISC
585
+ *
586
+ * This source code is licensed under the ISC license.
587
+ * See the LICENSE file in the root directory of this source tree.
588
+ */const ql=ne("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
589
+ * @license lucide-react v0.344.0 - ISC
590
+ *
591
+ * This source code is licensed under the ISC license.
592
+ * See the LICENSE file in the root directory of this source tree.
593
+ */const IZ=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
594
+ * @license lucide-react v0.344.0 - ISC
595
+ *
596
+ * This source code is licensed under the ISC license.
597
+ * See the LICENSE file in the root directory of this source tree.
598
+ */const kr=ne("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
599
+ * @license lucide-react v0.344.0 - ISC
600
+ *
601
+ * This source code is licensed under the ISC license.
602
+ * See the LICENSE file in the root directory of this source tree.
603
+ */const Tn=ne("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
604
+ * @license lucide-react v0.344.0 - ISC
605
+ *
606
+ * This source code is licensed under the ISC license.
607
+ * See the LICENSE file in the root directory of this source tree.
608
+ */const hn=ne("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);/**
609
+ * @license lucide-react v0.344.0 - ISC
610
+ *
611
+ * This source code is licensed under the ISC license.
612
+ * See the LICENSE file in the root directory of this source tree.
613
+ */const LZ=ne("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),kE=S.createContext({});function NE(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const SE=typeof window<"u",lF=SE?S.useLayoutEffect:S.useEffect,nx=S.createContext(null);function _E(e,t){e.indexOf(t)===-1&&e.push(t)}function EE(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const Ti=(e,t,r)=>r>t?t:r<e?e:r;let PE=()=>{};const Mi={},cF=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function uF(e){return typeof e=="object"&&e!==null}const dF=e=>/^0[^.\s]+$/u.test(e);function CE(e){let t;return()=>(t===void 0&&(t=e()),t)}const Qn=e=>e,zZ=(e,t)=>r=>t(e(r)),zh=(...e)=>e.reduce(zZ),Mf=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n};class AE{constructor(){this.subscriptions=[]}add(t){return _E(this.subscriptions,t),()=>EE(this.subscriptions,t)}notify(t,r,n){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,r,n);else for(let i=0;i<a;i++){const s=this.subscriptions[i];s&&s(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ha=e=>e*1e3,Wn=e=>e/1e3;function fF(e,t){return t?e*(1e3/t):0}const hF=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,FZ=1e-7,BZ=12;function VZ(e,t,r,n,a){let i,s,l=0;do s=t+(r-t)/2,i=hF(s,n,a)-e,i>0?r=s:t=s;while(Math.abs(i)>FZ&&++l<BZ);return s}function Fh(e,t,r,n){if(e===t&&r===n)return Qn;const a=i=>VZ(i,0,1,e,r);return i=>i===0||i===1?i:hF(a(i),t,n)}const pF=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,mF=e=>t=>1-e(1-t),gF=Fh(.33,1.53,.69,.99),OE=mF(gF),xF=pF(OE),yF=e=>(e*=2)<1?.5*OE(e):.5*(2-Math.pow(2,-10*(e-1))),TE=e=>1-Math.sin(Math.acos(e)),vF=mF(TE),bF=pF(TE),qZ=Fh(.42,0,1,1),UZ=Fh(0,0,.58,1),wF=Fh(.42,0,.58,1),HZ=e=>Array.isArray(e)&&typeof e[0]!="number",jF=e=>Array.isArray(e)&&typeof e[0]=="number",WZ={linear:Qn,easeIn:qZ,easeInOut:wF,easeOut:UZ,circIn:TE,circInOut:bF,circOut:vF,backIn:OE,backInOut:xF,backOut:gF,anticipate:yF},GZ=e=>typeof e=="string",PO=e=>{if(jF(e)){PE(e.length===4);const[t,r,n,a]=e;return Fh(t,r,n,a)}else if(GZ(e))return WZ[e];return e},Np=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function KZ(e,t){let r=new Set,n=new Set,a=!1,i=!1;const s=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){s.has(d)&&(u.schedule(d),e()),d(l)}const u={schedule:(d,f=!1,h=!1)=>{const m=h&&a?r:n;return f&&s.add(d),m.has(d)||m.add(d),d},cancel:d=>{n.delete(d),s.delete(d)},process:d=>{if(l=d,a){i=!0;return}a=!0,[r,n]=[n,r],r.forEach(c),r.clear(),a=!1,i&&(i=!1,u.process(d))}};return u}const YZ=40;function kF(e,t){let r=!1,n=!0;const a={delta:0,timestamp:0,isProcessing:!1},i=()=>r=!0,s=Np.reduce((b,j)=>(b[j]=KZ(i),b),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:p,postRender:m}=s,g=()=>{const b=Mi.useManualTiming?a.timestamp:performance.now();r=!1,Mi.useManualTiming||(a.delta=n?1e3/60:Math.max(Math.min(b-a.timestamp,YZ),1)),a.timestamp=b,a.isProcessing=!0,l.process(a),c.process(a),u.process(a),d.process(a),f.process(a),h.process(a),p.process(a),m.process(a),a.isProcessing=!1,r&&t&&(n=!1,e(g))},y=()=>{r=!0,n=!0,a.isProcessing||e(g)};return{schedule:Np.reduce((b,j)=>{const w=s[j];return b[j]=(k,N=!1,_=!1)=>(r||y(),w.schedule(k,N,_)),b},{}),cancel:b=>{for(let j=0;j<Np.length;j++)s[Np[j]].cancel(b)},state:a,steps:s}}const{schedule:Lt,cancel:Us,state:Ar,steps:ev}=kF(typeof requestAnimationFrame<"u"?requestAnimationFrame:Qn,!0);let Em;function XZ(){Em=void 0}const sn={now:()=>(Em===void 0&&sn.set(Ar.isProcessing||Mi.useManualTiming?Ar.timestamp:performance.now()),Em),set:e=>{Em=e,queueMicrotask(XZ)}},NF=e=>t=>typeof t=="string"&&t.startsWith(e),ME=NF("--"),ZZ=NF("var(--"),RE=e=>ZZ(e)?QZ.test(e.split("/*")[0].trim()):!1,QZ=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ku={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Rf={...ku,transform:e=>Ti(0,1,e)},Sp={...ku,default:1},Zd=e=>Math.round(e*1e5)/1e5,DE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function JZ(e){return e==null}const eQ=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$E=(e,t)=>r=>!!(typeof r=="string"&&eQ.test(r)&&r.startsWith(e)||t&&!JZ(r)&&Object.prototype.hasOwnProperty.call(r,t)),SF=(e,t,r)=>n=>{if(typeof n!="string")return n;const[a,i,s,l]=n.match(DE);return{[e]:parseFloat(a),[t]:parseFloat(i),[r]:parseFloat(s),alpha:l!==void 0?parseFloat(l):1}},tQ=e=>Ti(0,255,e),tv={...ku,transform:e=>Math.round(tQ(e))},Co={test:$E("rgb","red"),parse:SF("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+tv.transform(e)+", "+tv.transform(t)+", "+tv.transform(r)+", "+Zd(Rf.transform(n))+")"};function rQ(e){let t="",r="",n="",a="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),a=e.substring(4,5),t+=t,r+=r,n+=n,a+=a),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:a?parseInt(a,16)/255:1}}const eN={test:$E("#"),parse:rQ,transform:Co.transform},Bh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ls=Bh("deg"),Wa=Bh("%"),De=Bh("px"),nQ=Bh("vh"),aQ=Bh("vw"),CO={...Wa,parse:e=>Wa.parse(e)/100,transform:e=>Wa.transform(e*100)},nc={test:$E("hsl","hue"),parse:SF("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Wa.transform(Zd(t))+", "+Wa.transform(Zd(r))+", "+Zd(Rf.transform(n))+")"},or={test:e=>Co.test(e)||eN.test(e)||nc.test(e),parse:e=>Co.test(e)?Co.parse(e):nc.test(e)?nc.parse(e):eN.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Co.transform(e):nc.transform(e),getAnimatableNone:e=>{const t=or.parse(e);return t.alpha=0,or.transform(t)}},iQ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sQ(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(DE))==null?void 0:t.length)||0)+(((r=e.match(iQ))==null?void 0:r.length)||0)>0}const _F="number",EF="color",oQ="var",lQ="var(",AO="${}",cQ=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Df(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},a=[];let i=0;const l=t.replace(cQ,c=>(or.test(c)?(n.color.push(i),a.push(EF),r.push(or.parse(c))):c.startsWith(lQ)?(n.var.push(i),a.push(oQ),r.push(c)):(n.number.push(i),a.push(_F),r.push(parseFloat(c))),++i,AO)).split(AO);return{values:r,split:l,indexes:n,types:a}}function PF(e){return Df(e).values}function CF(e){const{split:t,types:r}=Df(e),n=t.length;return a=>{let i="";for(let s=0;s<n;s++)if(i+=t[s],a[s]!==void 0){const l=r[s];l===_F?i+=Zd(a[s]):l===EF?i+=or.transform(a[s]):i+=a[s]}return i}}const uQ=e=>typeof e=="number"?0:or.test(e)?or.getAnimatableNone(e):e;function dQ(e){const t=PF(e);return CF(e)(t.map(uQ))}const Hs={test:sQ,parse:PF,createTransformer:CF,getAnimatableNone:dQ};function rv(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function fQ({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let a=0,i=0,s=0;if(!t)a=i=s=r;else{const l=r<.5?r*(1+t):r+t-r*t,c=2*r-l;a=rv(c,l,e+1/3),i=rv(c,l,e),s=rv(c,l,e-1/3)}return{red:Math.round(a*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:n}}function y0(e,t){return r=>r>0?t:e}const Ut=(e,t,r)=>e+(t-e)*r,nv=(e,t,r)=>{const n=e*e,a=r*(t*t-n)+n;return a<0?0:Math.sqrt(a)},hQ=[eN,Co,nc],pQ=e=>hQ.find(t=>t.test(e));function OO(e){const t=pQ(e);if(!t)return!1;let r=t.parse(e);return t===nc&&(r=fQ(r)),r}const TO=(e,t)=>{const r=OO(e),n=OO(t);if(!r||!n)return y0(e,t);const a={...r};return i=>(a.red=nv(r.red,n.red,i),a.green=nv(r.green,n.green,i),a.blue=nv(r.blue,n.blue,i),a.alpha=Ut(r.alpha,n.alpha,i),Co.transform(a))},tN=new Set(["none","hidden"]);function mQ(e,t){return tN.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function gQ(e,t){return r=>Ut(e,t,r)}function IE(e){return typeof e=="number"?gQ:typeof e=="string"?RE(e)?y0:or.test(e)?TO:vQ:Array.isArray(e)?AF:typeof e=="object"?or.test(e)?TO:xQ:y0}function AF(e,t){const r=[...e],n=r.length,a=e.map((i,s)=>IE(i)(i,t[s]));return i=>{for(let s=0;s<n;s++)r[s]=a[s](i);return r}}function xQ(e,t){const r={...e,...t},n={};for(const a in r)e[a]!==void 0&&t[a]!==void 0&&(n[a]=IE(e[a])(e[a],t[a]));return a=>{for(const i in n)r[i]=n[i](a);return r}}function yQ(e,t){const r=[],n={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],s=e.indexes[i][n[i]],l=e.values[s]??0;r[a]=l,n[i]++}return r}const vQ=(e,t)=>{const r=Hs.createTransformer(t),n=Df(e),a=Df(t);return n.indexes.var.length===a.indexes.var.length&&n.indexes.color.length===a.indexes.color.length&&n.indexes.number.length>=a.indexes.number.length?tN.has(e)&&!a.values.length||tN.has(t)&&!n.values.length?mQ(e,t):zh(AF(yQ(n,a),a.values),r):y0(e,t)};function OF(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?Ut(e,t,r):IE(e)(e,t)}const bQ=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>Lt.update(t,r),stop:()=>Us(t),now:()=>Ar.isProcessing?Ar.timestamp:sn.now()}},TF=(e,t,r=10)=>{let n="";const a=Math.max(Math.round(t/r),2);for(let i=0;i<a;i++)n+=Math.round(e(i/(a-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},v0=2e4;function LE(e){let t=0;const r=50;let n=e.next(t);for(;!n.done&&t<v0;)t+=r,n=e.next(t);return t>=v0?1/0:t}function wQ(e,t=100,r){const n=r({...e,keyframes:[0,t]}),a=Math.min(LE(n),v0);return{type:"keyframes",ease:i=>n.next(a*i).value/t,duration:Wn(a)}}const jQ=5;function MF(e,t,r){const n=Math.max(t-jQ,0);return fF(r-e(n),t-n)}const Gt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},av=.001;function kQ({duration:e=Gt.duration,bounce:t=Gt.bounce,velocity:r=Gt.velocity,mass:n=Gt.mass}){let a,i,s=1-t;s=Ti(Gt.minDamping,Gt.maxDamping,s),e=Ti(Gt.minDuration,Gt.maxDuration,Wn(e)),s<1?(a=u=>{const d=u*s,f=d*e,h=d-r,p=rN(u,s),m=Math.exp(-f);return av-h/p*m},i=u=>{const f=u*s*e,h=f*r+r,p=Math.pow(s,2)*Math.pow(u,2)*e,m=Math.exp(-f),g=rN(Math.pow(u,2),s);return(-a(u)+av>0?-1:1)*((h-p)*m)/g}):(a=u=>{const d=Math.exp(-u*e),f=(u-r)*e+1;return-av+d*f},i=u=>{const d=Math.exp(-u*e),f=(r-u)*(e*e);return d*f});const l=5/e,c=SQ(a,i,l);if(e=Ha(e),isNaN(c))return{stiffness:Gt.stiffness,damping:Gt.damping,duration:e};{const u=Math.pow(c,2)*n;return{stiffness:u,damping:s*2*Math.sqrt(n*u),duration:e}}}const NQ=12;function SQ(e,t,r){let n=r;for(let a=1;a<NQ;a++)n=n-e(n)/t(n);return n}function rN(e,t){return e*Math.sqrt(1-t*t)}const _Q=["duration","bounce"],EQ=["stiffness","damping","mass"];function MO(e,t){return t.some(r=>e[r]!==void 0)}function PQ(e){let t={velocity:Gt.velocity,stiffness:Gt.stiffness,damping:Gt.damping,mass:Gt.mass,isResolvedFromDuration:!1,...e};if(!MO(e,EQ)&&MO(e,_Q))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),a=n*n,i=2*Ti(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Gt.mass,stiffness:a,damping:i}}else{const r=kQ(e);t={...t,...r,mass:Gt.mass},t.isResolvedFromDuration=!0}return t}function b0(e=Gt.visualDuration,t=Gt.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:a}=r;const i=r.keyframes[0],s=r.keyframes[r.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=PQ({...r,velocity:-Wn(r.velocity||0)}),m=h||0,g=u/(2*Math.sqrt(c*d)),y=s-i,x=Wn(Math.sqrt(c/d)),v=Math.abs(y)<5;n||(n=v?Gt.restSpeed.granular:Gt.restSpeed.default),a||(a=v?Gt.restDelta.granular:Gt.restDelta.default);let b;if(g<1){const w=rN(x,g);b=k=>{const N=Math.exp(-g*x*k);return s-N*((m+g*x*y)/w*Math.sin(w*k)+y*Math.cos(w*k))}}else if(g===1)b=w=>s-Math.exp(-x*w)*(y+(m+x*y)*w);else{const w=x*Math.sqrt(g*g-1);b=k=>{const N=Math.exp(-g*x*k),_=Math.min(w*k,300);return s-N*((m+g*x*y)*Math.sinh(_)+w*y*Math.cosh(_))/w}}const j={calculatedDuration:p&&f||null,next:w=>{const k=b(w);if(p)l.done=w>=f;else{let N=w===0?m:0;g<1&&(N=w===0?Ha(m):MF(b,w,k));const _=Math.abs(N)<=n,P=Math.abs(s-k)<=a;l.done=_&&P}return l.value=l.done?s:k,l},toString:()=>{const w=Math.min(LE(j),v0),k=TF(N=>j.next(w*N).value,w,30);return w+"ms "+k},toTransition:()=>{}};return j}b0.applyToOptions=e=>{const t=wQ(e,100,b0);return e.ease=t.ease,e.duration=Ha(t.duration),e.type="keyframes",e};function nN({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:a=10,bounceStiffness:i=500,modifyTarget:s,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=_=>l!==void 0&&_<l||c!==void 0&&_>c,m=_=>l===void 0?c:c===void 0||Math.abs(l-_)<Math.abs(c-_)?l:c;let g=r*t;const y=f+g,x=s===void 0?y:s(y);x!==y&&(g=x-f);const v=_=>-g*Math.exp(-_/n),b=_=>x+v(_),j=_=>{const P=v(_),C=b(_);h.done=Math.abs(P)<=u,h.value=h.done?x:C};let w,k;const N=_=>{p(h.value)&&(w=_,k=b0({keyframes:[h.value,m(h.value)],velocity:MF(b,_,h.value),damping:a,stiffness:i,restDelta:u,restSpeed:d}))};return N(0),{calculatedDuration:null,next:_=>{let P=!1;return!k&&w===void 0&&(P=!0,j(_),N(_)),w!==void 0&&_>=w?k.next(_-w):(!P&&j(_),h)}}}function CQ(e,t,r){const n=[],a=r||Mi.mix||OF,i=e.length-1;for(let s=0;s<i;s++){let l=a(e[s],e[s+1]);if(t){const c=Array.isArray(t)?t[s]||Qn:t;l=zh(c,l)}n.push(l)}return n}function AQ(e,t,{clamp:r=!0,ease:n,mixer:a}={}){const i=e.length;if(PE(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=CQ(t,n,a),c=l.length,u=d=>{if(s&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const h=Mf(e[f],e[f+1],d);return l[f](h)};return r?d=>u(Ti(e[0],e[i-1],d)):u}function OQ(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const a=Mf(0,t,n);e.push(Ut(r,1,a))}}function TQ(e){const t=[0];return OQ(t,e.length-1),t}function MQ(e,t){return e.map(r=>r*t)}function RQ(e,t){return e.map(()=>t||wF).splice(0,e.length-1)}function Qd({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const a=HZ(n)?n.map(PO):PO(n),i={done:!1,value:t[0]},s=MQ(r&&r.length===t.length?r:TQ(t),e),l=AQ(s,t,{ease:Array.isArray(a)?a:RQ(t,a)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const DQ=e=>e!==null;function zE(e,{repeat:t,repeatType:r="loop"},n,a=1){const i=e.filter(DQ),l=a<0||t&&r!=="loop"&&t%2===1?0:i.length-1;return!l||n===void 0?i[l]:n}const $Q={decay:nN,inertia:nN,tween:Qd,keyframes:Qd,spring:b0};function RF(e){typeof e.type=="string"&&(e.type=$Q[e.type])}class FE{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}}const IQ=e=>e/100;class BE extends FE{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,a;const{motionValue:r}=this.options;r&&r.updatedAt!==sn.now()&&this.tick(sn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(a=(n=this.options).onStop)==null||a.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;RF(t);const{type:r=Qd,repeat:n=0,repeatDelay:a=0,repeatType:i,velocity:s=0}=t;let{keyframes:l}=t;const c=r||Qd;c!==Qd&&typeof l[0]!="number"&&(this.mixKeyframes=zh(IQ,OF(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-s})),u.calculatedDuration===null&&(u.calculatedDuration=LE(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+a,this.totalDuration=this.resolvedDuration*(n+1)-a,this.generator=u}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:n,totalDuration:a,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return n.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const x=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?x<0:x>a;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let b=this.currentTime,j=n;if(f){const _=Math.min(this.currentTime,a)/l;let P=Math.floor(_),C=_%1;!C&&_>=1&&(C=1),C===1&&P--,P=Math.min(P,f+1),!!(P%2)&&(h==="reverse"?(C=1-C,p&&(C-=p/l)):h==="mirror"&&(j=s)),b=Ti(0,1,C)*l}const w=v?{done:!1,value:d[0]}:j.next(b);i&&(w.value=i(w.value));let{done:k}=w;!v&&c!==null&&(k=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return N&&m!==nN&&(w.value=zE(d,this.options,y,this.speed)),g&&g(w.value),N&&this.finish(),w}then(t,r){return this.finished.then(t,r)}get duration(){return Wn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Wn(t)}get time(){return Wn(this.currentTime)}set time(t){var r;t=Ha(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(sn.now());const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=Wn(this.currentTime))}play(){var a,i;if(this.isStopped)return;const{driver:t=bQ,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),(i=(a=this.options).onPlay)==null||i.call(a);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(sn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}function LQ(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ao=e=>e*180/Math.PI,aN=e=>{const t=Ao(Math.atan2(e[1],e[0]));return iN(t)},zQ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:aN,rotateZ:aN,skewX:e=>Ao(Math.atan(e[1])),skewY:e=>Ao(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},iN=e=>(e=e%360,e<0&&(e+=360),e),RO=aN,DO=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),$O=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),FQ={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:DO,scaleY:$O,scale:e=>(DO(e)+$O(e))/2,rotateX:e=>iN(Ao(Math.atan2(e[6],e[5]))),rotateY:e=>iN(Ao(Math.atan2(-e[2],e[0]))),rotateZ:RO,rotate:RO,skewX:e=>Ao(Math.atan(e[4])),skewY:e=>Ao(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function sN(e){return e.includes("scale")?1:0}function oN(e,t){if(!e||e==="none")return sN(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,a;if(r)n=FQ,a=r;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=zQ,a=l}if(!a)return sN(t);const i=n[t],s=a[1].split(",").map(VQ);return typeof i=="function"?i(s):s[i]}const BQ=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return oN(r,t)};function VQ(e){return parseFloat(e.trim())}const Nu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Su=new Set(Nu),IO=e=>e===ku||e===De,qQ=new Set(["x","y","z"]),UQ=Nu.filter(e=>!qQ.has(e));function HQ(e){const t=[];return UQ.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const Bo={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>oN(t,"x"),y:(e,{transform:t})=>oN(t,"y")};Bo.translateX=Bo.x;Bo.translateY=Bo.y;const Vo=new Set;let lN=!1,cN=!1,uN=!1;function DF(){if(cN){const e=Array.from(Vo).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const a=HQ(n);a.length&&(r.set(n,a),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const a=r.get(n);a&&a.forEach(([i,s])=>{var l;(l=n.getValue(i))==null||l.set(s)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}cN=!1,lN=!1,Vo.forEach(e=>e.complete(uN)),Vo.clear()}function $F(){Vo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(cN=!0)})}function WQ(){uN=!0,$F(),DF(),uN=!1}class VE{constructor(t,r,n,a,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=a,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(Vo.add(this),lN||(lN=!0,Lt.read($F),Lt.resolveKeyframes(DF))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:a}=this;if(t[0]===null){const i=a==null?void 0:a.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(n&&r){const l=n.readValue(r,s);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=s),a&&i===void 0&&a.set(t[0])}LQ(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Vo.delete(this)}cancel(){this.state==="scheduled"&&(Vo.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const GQ=e=>e.startsWith("--");function KQ(e,t,r){GQ(t)?e.style.setProperty(t,r):e.style[t]=r}const YQ=CE(()=>window.ScrollTimeline!==void 0),XQ={};function ZQ(e,t){const r=CE(e);return()=>XQ[t]??r()}const IF=ZQ(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pd=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,LO={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pd([0,.65,.55,1]),circOut:Pd([.55,0,1,.45]),backIn:Pd([.31,.01,.66,-.59]),backOut:Pd([.33,1.53,.69,.99])};function LF(e,t){if(e)return typeof e=="function"?IF()?TF(e,t):"ease-out":jF(e)?Pd(e):Array.isArray(e)?e.map(r=>LF(r,t)||LO.easeOut):LO[e]}function QQ(e,t,r,{delay:n=0,duration:a=300,repeat:i=0,repeatType:s="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:r};c&&(d.offset=c);const f=LF(l,a);Array.isArray(f)&&(d.easing=f);const h={delay:n,duration:a,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),e.animate(d,h)}function zF(e){return typeof e=="function"&&"applyToOptions"in e}function JQ({type:e,...t}){return zF(e)&&IF()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class eJ extends FE{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:r,name:n,keyframes:a,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,PE(typeof t.type!="string");const u=JQ(t);this.animation=QQ(r,n,a,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=zE(a,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):KQ(r,n,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,r;this.isPseudoElement||(r=(t=this.animation).commitStyles)==null||r.call(t)}get duration(){var r,n;const t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return Wn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Wn(t)}get time(){return Wn(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Ha(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&YQ()?(this.animation.timeline=t,Qn):r(this)}}const FF={anticipate:yF,backInOut:xF,circInOut:bF};function tJ(e){return e in FF}function rJ(e){typeof e.ease=="string"&&tJ(e.ease)&&(e.ease=FF[e.ease])}const zO=10;class nJ extends eJ{constructor(t){rJ(t),RF(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:n,onComplete:a,element:i,...s}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const l=new BE({...s,autoplay:!1}),c=Ha(this.finishedTime??this.time);r.setWithVelocity(l.sample(c-zO).value,l.sample(c).value,zO),l.stop()}}const FO=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Hs.test(e)||e==="0")&&!e.startsWith("url("));function aJ(e){const t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function iJ(e,t,r,n){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],s=FO(a,t),l=FO(i,t);return!s||!l?!1:aJ(e)||(r==="spring"||zF(r))&&n}function dN(e){e.duration=0,e.type="keyframes"}const sJ=new Set(["opacity","clipPath","filter","transform"]),oJ=CE(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function lJ(e){var d;const{motionValue:t,name:r,repeatDelay:n,repeatType:a,damping:i,type:s}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return oJ()&&r&&sJ.has(r)&&(r!=="transform"||!u)&&!c&&!n&&a!=="mirror"&&i!==0&&s!=="inertia"}const cJ=40;class uJ extends FE{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:a=0,repeatDelay:i=0,repeatType:s="loop",keyframes:l,name:c,motionValue:u,element:d,...f}){var m;super(),this.stop=()=>{var g,y;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=sn.now();const h={autoplay:t,delay:r,type:n,repeat:a,repeatDelay:i,repeatType:s,name:c,motionValue:u,element:d,...f},p=(d==null?void 0:d.KeyframeResolver)||VE;this.keyframeResolver=new p(l,(g,y,x)=>this.onKeyframesResolved(g,y,h,!x),c,u,d),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,r,n,a){this.keyframeResolver=void 0;const{name:i,type:s,velocity:l,delay:c,isHandoff:u,onUpdate:d}=n;this.resolvedAt=sn.now(),iJ(t,i,s,l)||((Mi.instantAnimations||!c)&&(d==null||d(zE(t,n,r))),t[0]=t[t.length-1],dN(n),n.repeat=0);const h={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>cJ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},p=!u&&lJ(h)?new nJ({...h,element:h.motionValue.owner.current}):new BE(h);p.finished.then(()=>this.notifyFinished()).catch(Qn),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),WQ()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const dJ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fJ(e){const t=dJ.exec(e);if(!t)return[,];const[,r,n,a]=t;return[`--${r??n}`,a]}function BF(e,t,r=1){const[n,a]=fJ(e);if(!n)return;const i=window.getComputedStyle(t).getPropertyValue(n);if(i){const s=i.trim();return cF(s)?parseFloat(s):s}return RE(a)?BF(a,t,r+1):a}function qE(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const VF=new Set(["width","height","top","left","right","bottom",...Nu]),hJ={test:e=>e==="auto",parse:e=>e},qF=e=>t=>t.test(e),UF=[ku,De,Wa,ls,aQ,nQ,hJ],BO=e=>UF.find(qF(e));function pJ(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||dF(e):!0}const mJ=new Set(["brightness","contrast","saturate","opacity"]);function gJ(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(DE)||[];if(!n)return e;const a=r.replace(n,"");let i=mJ.has(t)?1:0;return n!==r&&(i*=100),t+"("+i+a+")"}const xJ=/\b([a-z-]*)\(.*?\)/gu,fN={...Hs,getAnimatableNone:e=>{const t=e.match(xJ);return t?t.map(gJ).join(" "):e}},VO={...ku,transform:Math.round},yJ={rotate:ls,rotateX:ls,rotateY:ls,rotateZ:ls,scale:Sp,scaleX:Sp,scaleY:Sp,scaleZ:Sp,skew:ls,skewX:ls,skewY:ls,distance:De,translateX:De,translateY:De,translateZ:De,x:De,y:De,z:De,perspective:De,transformPerspective:De,opacity:Rf,originX:CO,originY:CO,originZ:De},UE={borderWidth:De,borderTopWidth:De,borderRightWidth:De,borderBottomWidth:De,borderLeftWidth:De,borderRadius:De,radius:De,borderTopLeftRadius:De,borderTopRightRadius:De,borderBottomRightRadius:De,borderBottomLeftRadius:De,width:De,maxWidth:De,height:De,maxHeight:De,top:De,right:De,bottom:De,left:De,padding:De,paddingTop:De,paddingRight:De,paddingBottom:De,paddingLeft:De,margin:De,marginTop:De,marginRight:De,marginBottom:De,marginLeft:De,backgroundPositionX:De,backgroundPositionY:De,...yJ,zIndex:VO,fillOpacity:Rf,strokeOpacity:Rf,numOctaves:VO},vJ={...UE,color:or,backgroundColor:or,outlineColor:or,fill:or,stroke:or,borderColor:or,borderTopColor:or,borderRightColor:or,borderBottomColor:or,borderLeftColor:or,filter:fN,WebkitFilter:fN},HF=e=>vJ[e];function WF(e,t){let r=HF(e);return r!==fN&&(r=Hs),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const bJ=new Set(["auto","none","0"]);function wJ(e,t,r){let n=0,a;for(;n<e.length&&!a;){const i=e[n];typeof i=="string"&&!bJ.has(i)&&Df(i).values.length&&(a=e[n]),n++}if(a&&r)for(const i of t)e[i]=WF(r,a)}class jJ extends VE{constructor(t,r,n,a,i){super(t,r,n,a,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),RE(u))){const d=BF(u,r.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!VF.has(n)||t.length!==2)return;const[a,i]=t,s=BO(a),l=BO(i);if(s!==l)if(IO(s)&&IO(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else Bo[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:r}=this,n=[];for(let a=0;a<t.length;a++)(t[a]===null||pJ(t[a]))&&n.push(a);n.length&&wJ(t,n,r)}measureInitialState(){const{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Bo[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;const a=r[r.length-1];a!==void 0&&t.getValue(n,a).jump(a,!1)}measureEndState(){var l;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const a=t.getValue(r);a&&a.jump(this.measuredOrigin,!1);const i=n.length-1,s=n[i];n[i]=Bo[r](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function kJ(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const a=(r==null?void 0:r[e])??n.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}const GF=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function KF(e){return uF(e)&&"offsetHeight"in e}const qO=30,NJ=e=>!isNaN(parseFloat(e));class SJ{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var i;const a=sn.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=sn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=NJ(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new AE);const n=this.events[t].add(r);return t==="change"?()=>{n(),Lt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=sn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>qO)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,qO);return fF(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Bc(e,t){return new SJ(e,t)}const{schedule:HE}=kF(queueMicrotask,!1),ha={x:!1,y:!1};function YF(){return ha.x||ha.y}function _J(e){return e==="x"||e==="y"?ha[e]?null:(ha[e]=!0,()=>{ha[e]=!1}):ha.x||ha.y?null:(ha.x=ha.y=!0,()=>{ha.x=ha.y=!1})}function XF(e,t){const r=kJ(e),n=new AbortController,a={passive:!0,...t,signal:n.signal};return[r,a,()=>n.abort()]}function UO(e){return!(e.pointerType==="touch"||YF())}function EJ(e,t,r={}){const[n,a,i]=XF(e,r),s=l=>{if(!UO(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{UO(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,a)};return n.forEach(l=>{l.addEventListener("pointerenter",s,a)}),i}const ZF=(e,t)=>t?e===t?!0:ZF(e,t.parentElement):!1,WE=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,PJ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function CJ(e){return PJ.has(e.tagName)||e.tabIndex!==-1}const Pm=new WeakSet;function HO(e){return t=>{t.key==="Enter"&&e(t)}}function iv(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const AJ=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=HO(()=>{if(Pm.has(r))return;iv(r,"down");const a=HO(()=>{iv(r,"up")}),i=()=>iv(r,"cancel");r.addEventListener("keyup",a,t),r.addEventListener("blur",i,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function WO(e){return WE(e)&&!YF()}function OJ(e,t,r={}){const[n,a,i]=XF(e,r),s=l=>{const c=l.currentTarget;if(!WO(l))return;Pm.add(c);const u=t(c,l),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Pm.has(c)&&Pm.delete(c),WO(p)&&typeof u=="function"&&u(p,{success:m})},f=p=>{d(p,c===window||c===document||r.useGlobalTarget||ZF(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,a),window.addEventListener("pointercancel",h,a)};return n.forEach(l=>{(r.useGlobalTarget?window:l).addEventListener("pointerdown",s,a),KF(l)&&(l.addEventListener("focus",u=>AJ(u,a)),!CJ(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function QF(e){return uF(e)&&"ownerSVGElement"in e}function TJ(e){return QF(e)&&e.tagName==="svg"}const Vr=e=>!!(e&&e.getVelocity),MJ=[...UF,or,Hs],RJ=e=>MJ.find(qF(e)),GE=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function GO(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function DJ(...e){return t=>{let r=!1;const n=e.map(a=>{const i=GO(a,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():GO(e[a],null)}}}}function $J(...e){return S.useCallback(DJ(...e),e)}class IJ extends S.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const n=r.offsetParent,a=KF(n)&&n.offsetWidth||0,i=this.props.sizeRef.current;i.height=r.offsetHeight||0,i.width=r.offsetWidth||0,i.top=r.offsetTop,i.left=r.offsetLeft,i.right=a-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function LJ({children:e,isPresent:t,anchorX:r,root:n}){const a=S.useId(),i=S.useRef(null),s=S.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=S.useContext(GE),c=$J(i,e==null?void 0:e.ref);return S.useInsertionEffect(()=>{const{width:u,height:d,top:f,left:h,right:p}=s.current;if(t||!i.current||!u||!d)return;const m=r==="left"?`left: ${h}`:`right: ${p}`;i.current.dataset.motionPopId=a;const g=document.createElement("style");l&&(g.nonce=l);const y=n??document.head;return y.appendChild(g),g.sheet&&g.sheet.insertRule(`
614
+ [data-motion-pop-id="${a}"] {
615
+ position: absolute !important;
616
+ width: ${u}px !important;
617
+ height: ${d}px !important;
618
+ ${m}px !important;
619
+ top: ${f}px !important;
620
+ }
621
+ `),()=>{y.contains(g)&&y.removeChild(g)}},[t]),o.jsx(IJ,{isPresent:t,childRef:i,sizeRef:s,children:S.cloneElement(e,{ref:c})})}const zJ=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:a,presenceAffectsLayout:i,mode:s,anchorX:l,root:c})=>{const u=NE(FJ),d=S.useId();let f=!0,h=S.useMemo(()=>(f=!1,{id:d,initial:t,isPresent:r,custom:a,onExitComplete:p=>{u.set(p,!0);for(const m of u.values())if(!m)return;n&&n()},register:p=>(u.set(p,!1),()=>u.delete(p))}),[r,u,n]);return i&&f&&(h={...h}),S.useMemo(()=>{u.forEach((p,m)=>u.set(m,!1))},[r]),S.useEffect(()=>{!r&&!u.size&&n&&n()},[r]),s==="popLayout"&&(e=o.jsx(LJ,{isPresent:r,anchorX:l,root:c,children:e})),o.jsx(nx.Provider,{value:h,children:e})};function FJ(){return new Map}function JF(e=!0){const t=S.useContext(nx);if(t===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:a}=t,i=S.useId();S.useEffect(()=>{if(e)return a(i)},[e]);const s=S.useCallback(()=>e&&n&&n(i),[i,n,e]);return!r&&n?[!1,s]:[!0]}const _p=e=>e.key||"";function KO(e){const t=[];return S.Children.forEach(e,r=>{S.isValidElement(r)&&t.push(r)}),t}const Zt=({children:e,custom:t,initial:r=!0,onExitComplete:n,presenceAffectsLayout:a=!0,mode:i="sync",propagate:s=!1,anchorX:l="left",root:c})=>{const[u,d]=JF(s),f=S.useMemo(()=>KO(e),[e]),h=s&&!u?[]:f.map(_p),p=S.useRef(!0),m=S.useRef(f),g=NE(()=>new Map),[y,x]=S.useState(f),[v,b]=S.useState(f);lF(()=>{p.current=!1,m.current=f;for(let k=0;k<v.length;k++){const N=_p(v[k]);h.includes(N)?g.delete(N):g.get(N)!==!0&&g.set(N,!1)}},[v,h.length,h.join("-")]);const j=[];if(f!==y){let k=[...f];for(let N=0;N<v.length;N++){const _=v[N],P=_p(_);h.includes(P)||(k.splice(N,0,_),j.push(_))}return i==="wait"&&j.length&&(k=j),b(KO(k)),x(f),null}const{forceRender:w}=S.useContext(kE);return o.jsx(o.Fragment,{children:v.map(k=>{const N=_p(k),_=s&&!u?!1:f===v||h.includes(N),P=()=>{if(g.has(N))g.set(N,!0);else return;let C=!0;g.forEach(A=>{A||(C=!1)}),C&&(w==null||w(),b(m.current),s&&(d==null||d()),n&&n())};return o.jsx(zJ,{isPresent:_,initial:!p.current||r?void 0:!1,custom:t,presenceAffectsLayout:a,mode:i,root:c,onExitComplete:_?void 0:P,anchorX:l,children:k},N)})})},e7=S.createContext({strict:!1}),YO={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Vc={};for(const e in YO)Vc[e]={isEnabled:t=>YO[e].some(r=>!!t[r])};function BJ(e){for(const t in e)Vc[t]={...Vc[t],...e[t]}}const VJ=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function w0(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||VJ.has(e)}let t7=e=>!w0(e);function qJ(e){typeof e=="function"&&(t7=t=>t.startsWith("on")?!w0(t):e(t))}try{qJ(require("@emotion/is-prop-valid").default)}catch{}function UJ(e,t,r){const n={};for(const a in e)a==="values"&&typeof e.values=="object"||(t7(a)||r===!0&&w0(a)||!t&&!w0(a)||e.draggable&&a.startsWith("onDrag"))&&(n[a]=e[a]);return n}const ax=S.createContext({});function ix(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function $f(e){return typeof e=="string"||Array.isArray(e)}const KE=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],YE=["initial",...KE];function sx(e){return ix(e.animate)||YE.some(t=>$f(e[t]))}function r7(e){return!!(sx(e)||e.variants)}function HJ(e,t){if(sx(e)){const{initial:r,animate:n}=e;return{initial:r===!1||$f(r)?r:void 0,animate:$f(n)?n:void 0}}return e.inherit!==!1?t:{}}function WJ(e){const{initial:t,animate:r}=HJ(e,S.useContext(ax));return S.useMemo(()=>({initial:t,animate:r}),[XO(t),XO(r)])}function XO(e){return Array.isArray(e)?e.join(" "):e}const If={};function GJ(e){for(const t in e)If[t]=e[t],ME(t)&&(If[t].isCSSVariable=!0)}function n7(e,{layout:t,layoutId:r}){return Su.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!If[e]||e==="opacity")}const KJ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},YJ=Nu.length;function XJ(e,t,r){let n="",a=!0;for(let i=0;i<YJ;i++){const s=Nu[i],l=e[s];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(s.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||r){const u=GF(l,UE[s]);if(!c){a=!1;const d=KJ[s]||s;n+=`${d}(${u}) `}r&&(t[s]=u)}}return n=n.trim(),r?n=r(t,a?"":n):a&&(n="none"),n}function XE(e,t,r){const{style:n,vars:a,transformOrigin:i}=e;let s=!1,l=!1;for(const c in t){const u=t[c];if(Su.has(c)){s=!0;continue}else if(ME(c)){a[c]=u;continue}else{const d=GF(u,UE[c]);c.startsWith("origin")?(l=!0,i[c]=d):n[c]=d}}if(t.transform||(s||r?n.transform=XJ(t,e.transform,r):n.transform&&(n.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=i;n.transformOrigin=`${c} ${u} ${d}`}}const ZE=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function a7(e,t,r){for(const n in t)!Vr(t[n])&&!n7(n,r)&&(e[n]=t[n])}function ZJ({transformTemplate:e},t){return S.useMemo(()=>{const r=ZE();return XE(r,t,e),Object.assign({},r.vars,r.style)},[t])}function QJ(e,t){const r=e.style||{},n={};return a7(n,r,e),Object.assign(n,ZJ(e,t)),n}function JJ(e,t){const r={},n=QJ(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}const eee={offset:"stroke-dashoffset",array:"stroke-dasharray"},tee={offset:"strokeDashoffset",array:"strokeDasharray"};function ree(e,t,r=1,n=0,a=!0){e.pathLength=1;const i=a?eee:tee;e[i.offset]=De.transform(-n);const s=De.transform(t),l=De.transform(r);e[i.array]=`${s} ${l}`}function i7(e,{attrX:t,attrY:r,attrScale:n,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...l},c,u,d){if(XE(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),r!==void 0&&(f.y=r),n!==void 0&&(f.scale=n),a!==void 0&&ree(f,a,i,s,!1)}const s7=()=>({...ZE(),attrs:{}}),o7=e=>typeof e=="string"&&e.toLowerCase()==="svg";function nee(e,t,r,n){const a=S.useMemo(()=>{const i=s7();return i7(i,t,o7(n),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};a7(i,e.style,e),a.style={...i,...a.style}}return a}const aee=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function QE(e){return typeof e!="string"||e.includes("-")?!1:!!(aee.indexOf(e)>-1||/[A-Z]/u.test(e))}function iee(e,t,r,{latestValues:n},a,i=!1){const l=(QE(e)?nee:JJ)(t,n,a,e),c=UJ(t,typeof e=="string",i),u=e!==S.Fragment?{...c,...l,ref:r}:{},{children:d}=t,f=S.useMemo(()=>Vr(d)?d.get():d,[d]);return S.createElement(e,{...u,children:f})}function ZO(e){const t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function JE(e,t,r,n){if(typeof t=="function"){const[a,i]=ZO(n);t=t(r!==void 0?r:e.custom,a,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,i]=ZO(n);t=t(r!==void 0?r:e.custom,a,i)}return t}function Cm(e){return Vr(e)?e.get():e}function see({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,a){return{latestValues:oee(r,n,a,e),renderState:t()}}function oee(e,t,r,n){const a={},i=n(e,{});for(const h in i)a[h]=Cm(i[h]);let{initial:s,animate:l}=e;const c=sx(e),u=r7(e);t&&u&&!c&&e.inherit!==!1&&(s===void 0&&(s=t.initial),l===void 0&&(l=t.animate));let d=r?r.initial===!1:!1;d=d||s===!1;const f=d?l:s;if(f&&typeof f!="boolean"&&!ix(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const m=JE(e,h[p]);if(m){const{transitionEnd:g,transition:y,...x}=m;for(const v in x){let b=x[v];if(Array.isArray(b)){const j=d?b.length-1:0;b=b[j]}b!==null&&(a[v]=b)}for(const v in g)a[v]=g[v]}}}return a}const l7=e=>(t,r)=>{const n=S.useContext(ax),a=S.useContext(nx),i=()=>see(e,t,n,a);return r?i():NE(i)};function eP(e,t,r){var i;const{style:n}=e,a={};for(const s in n)(Vr(n[s])||t.style&&Vr(t.style[s])||n7(s,e)||((i=r==null?void 0:r.getValue(s))==null?void 0:i.liveStyle)!==void 0)&&(a[s]=n[s]);return a}const lee=l7({scrapeMotionValuesFromProps:eP,createRenderState:ZE});function c7(e,t,r){const n=eP(e,t,r);for(const a in e)if(Vr(e[a])||Vr(t[a])){const i=Nu.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;n[i]=e[a]}return n}const cee=l7({scrapeMotionValuesFromProps:c7,createRenderState:s7}),uee=Symbol.for("motionComponentSymbol");function ac(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function dee(e,t,r){return S.useCallback(n=>{n&&e.onMount&&e.onMount(n),t&&(n?t.mount(n):t.unmount()),r&&(typeof r=="function"?r(n):ac(r)&&(r.current=n))},[t])}const tP=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),fee="framerAppearId",u7="data-"+tP(fee),d7=S.createContext({});function hee(e,t,r,n,a){var g,y;const{visualElement:i}=S.useContext(ax),s=S.useContext(e7),l=S.useContext(nx),c=S.useContext(GE).reducedMotion,u=S.useRef(null);n=n||s.renderer,!u.current&&n&&(u.current=n(e,{visualState:t,parent:i,props:r,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=S.useContext(d7);d&&!d.projection&&a&&(d.type==="html"||d.type==="svg")&&pee(u.current,r,a,f);const h=S.useRef(!1);S.useInsertionEffect(()=>{d&&h.current&&d.update(r,l)});const p=r[u7],m=S.useRef(!!p&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,p))&&((y=window.MotionHasOptimisedAnimation)==null?void 0:y.call(window,p)));return lF(()=>{d&&(h.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),m.current&&d.animationState&&d.animationState.animateChanges())}),S.useEffect(()=>{d&&(!m.current&&d.animationState&&d.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,p)}),m.current=!1),d.enteringChildren=void 0)}),d}function pee(e,t,r,n){const{layoutId:a,layout:i,drag:s,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:f7(e.parent)),e.projection.setOptions({layoutId:a,layout:i,alwaysMeasureLayout:!!s||l&&ac(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:n,crossfade:d,layoutScroll:c,layoutRoot:u})}function f7(e){if(e)return e.options.allowProjection!==!1?e.projection:f7(e.parent)}function sv(e,{forwardMotionProps:t=!1}={},r,n){r&&BJ(r);const a=QE(e)?cee:lee;function i(l,c){let u;const d={...S.useContext(GE),...l,layoutId:mee(l)},{isStatic:f}=d,h=WJ(l),p=a(l,f);if(!f&&SE){gee();const m=xee(d);u=m.MeasureLayout,h.visualElement=hee(e,p,d,n,m.ProjectionNode)}return o.jsxs(ax.Provider,{value:h,children:[u&&h.visualElement?o.jsx(u,{visualElement:h.visualElement,...d}):null,iee(e,l,dee(p,h.visualElement,c),p,f,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=S.forwardRef(i);return s[uee]=e,s}function mee({layoutId:e}){const t=S.useContext(kE).id;return t&&e!==void 0?t+"-"+e:e}function gee(e,t){S.useContext(e7).strict}function xee(e){const{drag:t,layout:r}=Vc;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:t!=null&&t.isEnabled(e)||r!=null&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function yee(e,t){if(typeof Proxy>"u")return sv;const r=new Map,n=(i,s)=>sv(i,s,e,t),a=(i,s)=>n(i,s);return new Proxy(a,{get:(i,s)=>s==="create"?n:(r.has(s)||r.set(s,sv(s,void 0,e,t)),r.get(s))})}function h7({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function vee({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function bee(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function ov(e){return e===void 0||e===1}function hN({scale:e,scaleX:t,scaleY:r}){return!ov(e)||!ov(t)||!ov(r)}function xo(e){return hN(e)||p7(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function p7(e){return QO(e.x)||QO(e.y)}function QO(e){return e&&e!=="0%"}function j0(e,t,r){const n=e-r,a=t*n;return r+a}function JO(e,t,r,n,a){return a!==void 0&&(e=j0(e,a,n)),j0(e,r,n)+t}function pN(e,t=0,r=1,n,a){e.min=JO(e.min,t,r,n,a),e.max=JO(e.max,t,r,n,a)}function m7(e,{x:t,y:r}){pN(e.x,t.translate,t.scale,t.originPoint),pN(e.y,r.translate,r.scale,r.originPoint)}const eT=.999999999999,tT=1.0000000000001;function wee(e,t,r,n=!1){const a=r.length;if(!a)return;t.x=t.y=1;let i,s;for(let l=0;l<a;l++){i=r[l],s=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(n&&i.options.layoutScroll&&i.scroll&&i!==i.root&&sc(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,m7(e,s)),n&&xo(i.latestValues)&&sc(e,i.latestValues))}t.x<tT&&t.x>eT&&(t.x=1),t.y<tT&&t.y>eT&&(t.y=1)}function ic(e,t){e.min=e.min+t,e.max=e.max+t}function rT(e,t,r,n,a=.5){const i=Ut(e.min,e.max,a);pN(e,t,r,i,n)}function sc(e,t){rT(e.x,t.x,t.scaleX,t.scale,t.originX),rT(e.y,t.y,t.scaleY,t.scale,t.originY)}function g7(e,t){return h7(bee(e.getBoundingClientRect(),t))}function jee(e,t,r){const n=g7(e,r),{scroll:a}=t;return a&&(ic(n.x,a.offset.x),ic(n.y,a.offset.y)),n}const nT=()=>({translate:0,scale:1,origin:0,originPoint:0}),oc=()=>({x:nT(),y:nT()}),aT=()=>({min:0,max:0}),er=()=>({x:aT(),y:aT()}),mN={current:null},x7={current:!1};function kee(){if(x7.current=!0,!!SE)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>mN.current=e.matches;e.addEventListener("change",t),t()}else mN.current=!1}const Nee=new WeakMap;function See(e,t,r){for(const n in t){const a=t[n],i=r[n];if(Vr(a))e.addValue(n,a);else if(Vr(i))e.addValue(n,Bc(a,{owner:e}));else if(i!==a)if(e.hasValue(n)){const s=e.getValue(n);s.liveStyle===!0?s.jump(a):s.hasAnimated||s.set(a)}else{const s=e.getStaticValue(n);e.addValue(n,Bc(s!==void 0?s:a,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const iT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class _ee{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:a,blockInitialAnimation:i,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=VE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=sn.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Lt.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=s;this.latestValues=c,this.baseTarget={...c},this.initialValues=r.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=sx(r),this.isVariantNode=r7(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(r,{},this);for(const h in f){const p=f[h];c[h]!==void 0&&Vr(p)&&p.set(c[h])}}mount(t){var r;this.current=t,Nee.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,a)=>this.bindToMotionValue(a,n)),x7.current||kee(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:mN.current,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Us(this.notifyUpdate),Us(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const n=this.features[r];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Su.has(t);n&&this.onBindTransform&&this.onBindTransform();const a=r.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Lt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{a(),i&&i(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Vc){const r=Vc[t];if(!r)continue;const{isEnabled:n,Feature:a}=r;if(!this.features[t]&&a&&n(this.props)&&(this.features[t]=new a(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):er()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<iT.length;n++){const a=iT[n];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const i="on"+a,s=t[i];s&&(this.propEventSubscriptions[a]=this.on(a,s))}this.prevMotionValues=See(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){const n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=Bc(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(cF(n)||dF(n))?n=parseFloat(n):!RJ(n)&&Hs.test(r)&&(n=WF(t,r)),this.setBaseTarget(t,Vr(n)?n.get():n)),Vr(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var i;const{initial:r}=this.props;let n;if(typeof r=="string"||typeof r=="object"){const s=JE(this.props,r,(i=this.presenceContext)==null?void 0:i.custom);s&&(n=s[t])}if(r&&n!==void 0)return n;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Vr(a)?a:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new AE),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){HE.render(this.render)}}class y7 extends _ee{constructor(){super(...arguments),this.KeyframeResolver=jJ}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Vr(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function v7(e,{style:t,vars:r},n,a){const i=e.style;let s;for(s in t)i[s]=t[s];a==null||a.applyProjectionStyles(i,n);for(s in r)i.setProperty(s,r[s])}function Eee(e){return window.getComputedStyle(e)}class Pee extends y7{constructor(){super(...arguments),this.type="html",this.renderInstance=v7}readValueFromInstance(t,r){var n;if(Su.has(r))return(n=this.projection)!=null&&n.isProjecting?sN(r):BQ(t,r);{const a=Eee(t),i=(ME(r)?a.getPropertyValue(r):a[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:r}){return g7(t,r)}build(t,r,n){XE(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return eP(t,r,n)}}const b7=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Cee(e,t,r,n){v7(e,t,void 0,n);for(const a in t.attrs)e.setAttribute(b7.has(a)?a:tP(a),t.attrs[a])}class Aee extends y7{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=er}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(Su.has(r)){const n=HF(r);return n&&n.default||0}return r=b7.has(r)?r:tP(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return c7(t,r,n)}build(t,r,n){i7(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,a){Cee(t,r,n,a)}mount(t){this.isSVGTag=o7(t.tagName),super.mount(t)}}const Oee=(e,t)=>QE(e)?new Aee(t):new Pee(t,{allowProjection:e!==S.Fragment});function wc(e,t,r){const n=e.getProps();return JE(n,t,r!==void 0?r:n.custom,e)}const gN=e=>Array.isArray(e);function Tee(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Bc(r))}function Mee(e){return gN(e)?e[e.length-1]||0:e}function Ree(e,t){const r=wc(e,t);let{transitionEnd:n={},transition:a={},...i}=r||{};i={...i,...n};for(const s in i){const l=Mee(i[s]);Tee(e,s,l)}}function Dee(e){return!!(Vr(e)&&e.add)}function xN(e,t){const r=e.getValue("willChange");if(Dee(r))return r.add(t);if(!r&&Mi.WillChange){const n=new Mi.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function w7(e){return e.props[u7]}const $ee=e=>e!==null;function Iee(e,{repeat:t,repeatType:r="loop"},n){const a=e.filter($ee),i=t&&r!=="loop"&&t%2===1?0:a.length-1;return a[i]}const Lee={type:"spring",stiffness:500,damping:25,restSpeed:10},zee=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Fee={type:"keyframes",duration:.8},Bee={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Vee=(e,{keyframes:t})=>t.length>2?Fee:Su.has(e)?e.startsWith("scale")?zee(t[1]):Lee:Bee;function qee({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:a,repeat:i,repeatType:s,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const rP=(e,t,r,n={},a,i)=>s=>{const l=qE(n,e)||{},c=l.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Ha(c);const d={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{s(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:a};qee(l)||Object.assign(d,Vee(e,d)),d.duration&&(d.duration=Ha(d.duration)),d.repeatDelay&&(d.repeatDelay=Ha(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(dN(d),d.delay===0&&(f=!0)),(Mi.instantAnimations||Mi.skipAnimations)&&(f=!0,dN(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,f&&!i&&t.get()!==void 0){const h=Iee(d.keyframes,l);if(h!==void 0){Lt.update(()=>{d.onUpdate(h),d.onComplete()});return}}return l.isSync?new BE(d):new uJ(d)};function Uee({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function j7(e,t,{delay:r=0,transitionOverride:n,type:a}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...l}=t;n&&(i=n);const c=[],u=a&&e.animationState&&e.animationState.getState()[a];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),h=l[d];if(h===void 0||u&&Uee(u,d))continue;const p={delay:r,...qE(i||{},d)},m=f.get();if(m!==void 0&&!f.isAnimating&&!Array.isArray(h)&&h===m&&!p.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const x=w7(e);if(x){const v=window.MotionHandoffAnimation(x,d,Lt);v!==null&&(p.startTime=v,g=!0)}}xN(e,d),f.start(rP(d,f,h,e.shouldReduceMotion&&VF.has(d)?{type:!1}:p,e,g));const y=f.animation;y&&c.push(y)}return s&&Promise.all(c).then(()=>{Lt.update(()=>{s&&Ree(e,s)})}),c}function k7(e,t,r,n=0,a=1){const i=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),s=e.size,l=(s-1)*n;return typeof r=="function"?r(i,s):a===1?i*n:l-i*n}function yN(e,t,r={}){var c;const n=wc(e,t,r.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(a=r.transitionOverride);const i=n?()=>Promise.all(j7(e,n,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=a;return Hee(e,t,u,d,f,h,r)}:()=>Promise.resolve(),{when:l}=a;if(l){const[u,d]=l==="beforeChildren"?[i,s]:[s,i];return u().then(()=>d())}else return Promise.all([i(),s(r.delay)])}function Hee(e,t,r=0,n=0,a=0,i=1,s){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(yN(c,t,{...s,delay:r+(typeof n=="function"?0:n)+k7(e.variantChildren,c,n,a,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function Wee(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const a=t.map(i=>yN(e,i,r));n=Promise.all(a)}else if(typeof t=="string")n=yN(e,t,r);else{const a=typeof t=="function"?wc(e,t,r.custom):t;n=Promise.all(j7(e,a,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}function N7(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}const Gee=YE.length;function S7(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?S7(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}const t={};for(let r=0;r<Gee;r++){const n=YE[r],a=e.props[n];($f(a)||a===!1)&&(t[n]=a)}return t}const Kee=[...KE].reverse(),Yee=KE.length;function Xee(e){return t=>Promise.all(t.map(({animation:r,options:n})=>Wee(e,r,n)))}function Zee(e){let t=Xee(e),r=sT(),n=!0;const a=c=>(u,d)=>{var h;const f=wc(e,d,c==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(f){const{transition:p,transitionEnd:m,...g}=f;u={...u,...g,...m}}return u};function i(c){t=c(e)}function s(c){const{props:u}=e,d=S7(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let y=0;y<Yee;y++){const x=Kee[y],v=r[x],b=u[x]!==void 0?u[x]:d[x],j=$f(b),w=x===c?v.isActive:null;w===!1&&(m=y);let k=b===d[x]&&b!==u[x]&&j;if(k&&n&&e.manuallyAnimateOnMount&&(k=!1),v.protectedKeys={...p},!v.isActive&&w===null||!b&&!v.prevProp||ix(b)||typeof b=="boolean")continue;const N=Qee(v.prevProp,b);let _=N||x===c&&v.isActive&&!k&&j||y>m&&j,P=!1;const C=Array.isArray(b)?b:[b];let A=C.reduce(a(x),{});w===!1&&(A={});const{prevResolvedValues:O={}}=v,T={...O,...A},E=z=>{_=!0,h.has(z)&&(P=!0,h.delete(z)),v.needsAnimating[z]=!0;const I=e.getValue(z);I&&(I.liveStyle=!1)};for(const z in T){const I=A[z],$=O[z];if(p.hasOwnProperty(z))continue;let F=!1;gN(I)&&gN($)?F=!N7(I,$):F=I!==$,F?I!=null?E(z):h.add(z):I!==void 0&&h.has(z)?E(z):v.protectedKeys[z]=!0}v.prevProp=b,v.prevResolvedValues=A,v.isActive&&(p={...p,...A}),n&&e.blockInitialAnimation&&(_=!1);const R=k&&N;_&&(!R||P)&&f.push(...C.map(z=>{const I={type:x};if(typeof z=="string"&&n&&!R&&e.manuallyAnimateOnMount&&e.parent){const{parent:$}=e,F=wc($,z);if($.enteringChildren&&F){const{delayChildren:q}=F.transition||{};I.delay=k7($.enteringChildren,e,q)}}return{animation:z,options:I}}))}if(h.size){const y={};if(typeof u.initial!="boolean"){const x=wc(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(y.transition=x.transition)}h.forEach(x=>{const v=e.getBaseTarget(x),b=e.getValue(x);b&&(b.liveStyle=!0),y[x]=v??null}),f.push({animation:y})}let g=!!f.length;return n&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(g=!1),n=!1,g?t(f):Promise.resolve()}function l(c,u){var f;if(r[c].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(h=>{var p;return(p=h.animationState)==null?void 0:p.setActive(c,u)}),r[c].isActive=u;const d=s(c);for(const h in r)r[h].protectedKeys={};return d}return{animateChanges:s,setActive:l,setAnimateFunction:i,getState:()=>r,reset:()=>{r=sT()}}}function Qee(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!N7(t,e):!1}function fo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sT(){return{animate:fo(!0),whileInView:fo(),whileHover:fo(),whileTap:fo(),whileDrag:fo(),whileFocus:fo(),exit:fo()}}class eo{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Jee extends eo{constructor(t){super(t),t.animationState||(t.animationState=Zee(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ix(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let ete=0;class tte extends eo{constructor(){super(...arguments),this.id=ete++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const a=this.node.animationState.setActive("exit",!t);r&&!t&&a.then(()=>{r(this.id)})}mount(){const{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const rte={animation:{Feature:Jee},exit:{Feature:tte}};function Lf(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function Vh(e){return{point:{x:e.pageX,y:e.pageY}}}const nte=e=>t=>WE(t)&&e(t,Vh(t));function Jd(e,t,r,n){return Lf(e,t,nte(r),n)}const _7=1e-4,ate=1-_7,ite=1+_7,E7=.01,ste=0-E7,ote=0+E7;function Kr(e){return e.max-e.min}function lte(e,t,r){return Math.abs(e-t)<=r}function oT(e,t,r,n=.5){e.origin=n,e.originPoint=Ut(t.min,t.max,e.origin),e.scale=Kr(r)/Kr(t),e.translate=Ut(r.min,r.max,e.origin)-e.originPoint,(e.scale>=ate&&e.scale<=ite||isNaN(e.scale))&&(e.scale=1),(e.translate>=ste&&e.translate<=ote||isNaN(e.translate))&&(e.translate=0)}function ef(e,t,r,n){oT(e.x,t.x,r.x,n?n.originX:void 0),oT(e.y,t.y,r.y,n?n.originY:void 0)}function lT(e,t,r){e.min=r.min+t.min,e.max=e.min+Kr(t)}function cte(e,t,r){lT(e.x,t.x,r.x),lT(e.y,t.y,r.y)}function cT(e,t,r){e.min=t.min-r.min,e.max=e.min+Kr(t)}function tf(e,t,r){cT(e.x,t.x,r.x),cT(e.y,t.y,r.y)}function Fn(e){return[e("x"),e("y")]}const P7=({current:e})=>e?e.ownerDocument.defaultView:null,uT=(e,t)=>Math.abs(e-t);function ute(e,t){const r=uT(e.x,t.x),n=uT(e.y,t.y);return Math.sqrt(r**2+n**2)}class C7{constructor(t,r,{transformPagePoint:n,contextWindow:a=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=cv(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=ute(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:g}=h,{timestamp:y}=Ar;this.history.push({...g,timestamp:y});const{onStart:x,onMove:v}=this.handlers;p||(x&&x(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,p)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=lv(p,this.transformPagePoint),Lt.update(this.updatePoint,!0)},this.handlePointerUp=(h,p)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=cv(h.type==="pointercancel"?this.lastMoveEventInfo:lv(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(h,x),g&&g(h,x)},!WE(t))return;this.dragSnapToOrigin=i,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=s,this.contextWindow=a||window;const l=Vh(t),c=lv(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Ar;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=r;f&&f(t,cv(c,this.history)),this.removeListeners=zh(Jd(this.contextWindow,"pointermove",this.handlePointerMove),Jd(this.contextWindow,"pointerup",this.handlePointerUp),Jd(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Us(this.updatePoint)}}function lv(e,t){return t?{point:t(e.point)}:e}function dT(e,t){return{x:e.x-t.x,y:e.y-t.y}}function cv({point:e},t){return{point:e,delta:dT(e,A7(t)),offset:dT(e,dte(t)),velocity:fte(t,.1)}}function dte(e){return e[0]}function A7(e){return e[e.length-1]}function fte(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const a=A7(e);for(;r>=0&&(n=e[r],!(a.timestamp-n.timestamp>Ha(t)));)r--;if(!n)return{x:0,y:0};const i=Wn(a.timestamp-n.timestamp);if(i===0)return{x:0,y:0};const s={x:(a.x-n.x)/i,y:(a.y-n.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function hte(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?Ut(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?Ut(r,e,n.max):Math.min(e,r)),e}function fT(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function pte(e,{top:t,left:r,bottom:n,right:a}){return{x:fT(e.x,r,a),y:fT(e.y,t,n)}}function hT(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function mte(e,t){return{x:hT(e.x,t.x),y:hT(e.y,t.y)}}function gte(e,t){let r=.5;const n=Kr(e),a=Kr(t);return a>n?r=Mf(t.min,t.max-n,e.min):n>a&&(r=Mf(e.min,e.max-a,t.min)),Ti(0,1,r)}function xte(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const vN=.35;function yte(e=vN){return e===!1?e=0:e===!0&&(e=vN),{x:pT(e,"left","right"),y:pT(e,"top","bottom")}}function pT(e,t,r){return{min:mT(e,t),max:mT(e,r)}}function mT(e,t){return typeof e=="number"?e:e[t]||0}const vte=new WeakMap;class bte{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=er(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Vh(f).point)},s=(f,h)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_J(p),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Fn(x=>{let v=this.getAxisMotionValue(x).get()||0;if(Wa.test(v)){const{projection:b}=this.visualElement;if(b&&b.layout){const j=b.layout.layoutBox[x];j&&(v=Kr(j)*(parseFloat(v)/100))}}this.originPoint[x]=v}),g&&Lt.postRender(()=>g(f,h)),xN(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:y}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:x}=h;if(m&&this.currentDirection===null){this.currentDirection=wte(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),y&&y(f,h)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Fn(f=>{var h;return this.getAnimationState(f)==="paused"&&((h=this.getAxisMotionValue(f).animation)==null?void 0:h.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new C7(t,{onSessionStart:i,onStart:s,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:n,contextWindow:P7(this.visualElement)})}stop(t,r){const n=t||this.latestPointerEvent,a=r||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!a||!n)return;const{velocity:s}=a;this.startAnimation(s);const{onDragEnd:l}=this.getProps();l&&Lt.postRender(()=>l(n,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){const{drag:a}=this.getProps();if(!n||!Ep(t,a,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=hte(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,a=this.constraints;t&&ac(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=pte(n.layoutBox,t):this.constraints=!1,this.elastic=yte(r),a!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Fn(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=xte(n.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!ac(t))return!1;const n=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const i=jee(n,a.root,this.visualElement.getTransformPagePoint());let s=mte(a.layout.layoutBox,i);if(r){const l=r(vee(s));this.hasMutatedConstraints=!!l,l&&(s=h7(l))}return s}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:a,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Fn(d=>{if(!Ep(d,r,this.currentDirection))return;let f=c&&c[d]||{};s&&(f={min:0,max:0});const h=a?200:1e6,p=a?40:1e7,m={type:"inertia",velocity:n?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(l)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return xN(this.visualElement,t),n.start(rP(t,n,0,r,this.visualElement,!1))}stopAnimation(){Fn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Fn(t=>{var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.state}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),a=n[r];return a||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Fn(r=>{const{drag:n}=this.getProps();if(!Ep(r,n,this.currentDirection))return;const{projection:a}=this.visualElement,i=this.getAxisMotionValue(r);if(a&&a.layout){const{min:s,max:l}=a.layout.layoutBox[r];i.set(t[r]-Ut(s,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!ac(r)||!n||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};Fn(s=>{const l=this.getAxisMotionValue(s);if(l&&this.constraints!==!1){const c=l.get();a[s]=gte({min:c,max:c},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Fn(s=>{if(!Ep(s,t,null))return;const l=this.getAxisMotionValue(s),{min:c,max:u}=this.constraints[s];l.set(Ut(c,u,a[s]))})}addListeners(){if(!this.visualElement.current)return;vte.set(this.visualElement,this);const t=this.visualElement.current,r=Jd(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),n=()=>{const{dragConstraints:c}=this.getProps();ac(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,i=a.addEventListener("measure",n);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),Lt.read(n);const s=Lf(window,"resize",()=>this.scalePositionWithinConstraints()),l=a.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Fn(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{s(),r(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:a=!1,dragConstraints:i=!1,dragElastic:s=vN,dragMomentum:l=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:a,dragConstraints:i,dragElastic:s,dragMomentum:l}}}function Ep(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function wte(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class jte extends eo{constructor(t){super(t),this.removeGroupControls=Qn,this.removeListeners=Qn,this.controls=new bte(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qn}unmount(){this.removeGroupControls(),this.removeListeners()}}const gT=e=>(t,r)=>{e&&Lt.postRender(()=>e(t,r))};class kte extends eo{constructor(){super(...arguments),this.removePointerDownListener=Qn}onPointerDown(t){this.session=new C7(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:P7(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:a}=this.node.getProps();return{onSessionStart:gT(t),onStart:gT(r),onMove:n,onEnd:(i,s)=>{delete this.session,a&&Lt.postRender(()=>a(i,s))}}}mount(){this.removePointerDownListener=Jd(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Am={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function xT(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const td={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(De.test(e))e=parseFloat(e);else return e;const r=xT(e,t.target.x),n=xT(e,t.target.y);return`${r}% ${n}%`}},Nte={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,a=Hs.parse(e);if(a.length>5)return n;const i=Hs.createTransformer(e),s=typeof a[0]!="number"?1:0,l=r.x.scale*t.x,c=r.y.scale*t.y;a[0+s]/=l,a[1+s]/=c;const u=Ut(l,c,.5);return typeof a[2+s]=="number"&&(a[2+s]/=u),typeof a[3+s]=="number"&&(a[3+s]/=u),i(a)}};let uv=!1;class Ste extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:a}=this.props,{projection:i}=t;GJ(_te),i&&(r.group&&r.group.add(i),n&&n.register&&a&&n.register(i),uv&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Am.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:a,isPresent:i}=this.props,{projection:s}=n;return s&&(s.isPresent=i,uv=!0,a||t.layoutDependency!==r||r===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Lt.postRender(()=>{const l=s.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),HE.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:a}=t;uv=!0,a&&(a.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(a),n&&n.deregister&&n.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function O7(e){const[t,r]=JF(),n=S.useContext(kE);return o.jsx(Ste,{...e,layoutGroup:n,switchLayoutGroup:S.useContext(d7),isPresent:t,safeToRemove:r})}const _te={borderRadius:{...td,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:td,borderTopRightRadius:td,borderBottomLeftRadius:td,borderBottomRightRadius:td,boxShadow:Nte};function Ete(e,t,r){const n=Vr(e)?e:Bc(e);return n.start(rP("",n,t,r)),n.animation}const Pte=(e,t)=>e.depth-t.depth;class Cte{constructor(){this.children=[],this.isDirty=!1}add(t){_E(this.children,t),this.isDirty=!0}remove(t){EE(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Pte),this.isDirty=!1,this.children.forEach(t)}}function Ate(e,t){const r=sn.now(),n=({timestamp:a})=>{const i=a-r;i>=t&&(Us(n),e(i-t))};return Lt.setup(n,!0),()=>Us(n)}const T7=["TopLeft","TopRight","BottomLeft","BottomRight"],Ote=T7.length,yT=e=>typeof e=="string"?parseFloat(e):e,vT=e=>typeof e=="number"||De.test(e);function Tte(e,t,r,n,a,i){a?(e.opacity=Ut(0,r.opacity??1,Mte(n)),e.opacityExit=Ut(t.opacity??1,0,Rte(n))):i&&(e.opacity=Ut(t.opacity??1,r.opacity??1,n));for(let s=0;s<Ote;s++){const l=`border${T7[s]}Radius`;let c=bT(t,l),u=bT(r,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||vT(c)===vT(u)?(e[l]=Math.max(Ut(yT(c),yT(u),n),0),(Wa.test(u)||Wa.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||r.rotate)&&(e.rotate=Ut(t.rotate||0,r.rotate||0,n))}function bT(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Mte=M7(0,.5,vF),Rte=M7(.5,.95,Qn);function M7(e,t,r){return n=>n<e?0:n>t?1:r(Mf(e,t,n))}function wT(e,t){e.min=t.min,e.max=t.max}function Dn(e,t){wT(e.x,t.x),wT(e.y,t.y)}function jT(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function kT(e,t,r,n,a){return e-=t,e=j0(e,1/r,n),a!==void 0&&(e=j0(e,1/a,n)),e}function Dte(e,t=0,r=1,n=.5,a,i=e,s=e){if(Wa.test(t)&&(t=parseFloat(t),t=Ut(s.min,s.max,t/100)-s.min),typeof t!="number")return;let l=Ut(i.min,i.max,n);e===i&&(l-=t),e.min=kT(e.min,t,r,l,a),e.max=kT(e.max,t,r,l,a)}function NT(e,t,[r,n,a],i,s){Dte(e,t[r],t[n],t[a],t.scale,i,s)}const $te=["x","scaleX","originX"],Ite=["y","scaleY","originY"];function ST(e,t,r,n){NT(e.x,t,$te,r?r.x:void 0,n?n.x:void 0),NT(e.y,t,Ite,r?r.y:void 0,n?n.y:void 0)}function _T(e){return e.translate===0&&e.scale===1}function R7(e){return _T(e.x)&&_T(e.y)}function ET(e,t){return e.min===t.min&&e.max===t.max}function Lte(e,t){return ET(e.x,t.x)&&ET(e.y,t.y)}function PT(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function D7(e,t){return PT(e.x,t.x)&&PT(e.y,t.y)}function CT(e){return Kr(e.x)/Kr(e.y)}function AT(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class zte{constructor(){this.members=[]}add(t){_E(this.members,t),t.scheduleRender()}remove(t){if(EE(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){const r=this.members.findIndex(a=>t===a);if(r===0)return!1;let n;for(let a=r;a>=0;a--){const i=this.members[a];if(i.isPresent!==!1){n=i;break}}return n?(this.promote(n),!0):!1}promote(t,r){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:a}=t.options;a===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Fte(e,t,r){let n="";const a=e.x.translate/t.x,i=e.y.translate/t.y,s=(r==null?void 0:r.z)||0;if((a||i||s)&&(n=`translate3d(${a}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:m}=r;u&&(n=`perspective(${u}px) ${n}`),d&&(n+=`rotate(${d}deg) `),f&&(n+=`rotateX(${f}deg) `),h&&(n+=`rotateY(${h}deg) `),p&&(n+=`skewX(${p}deg) `),m&&(n+=`skewY(${m}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(n+=`scale(${l}, ${c})`),n||"none"}const dv=["","X","Y","Z"],Bte=1e3;let Vte=0;function fv(e,t,r,n){const{latestValues:a}=t;a[e]&&(r[e]=a[e],t.setStaticValue(e,0),n&&(n[e]=0))}function $7(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=w7(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:a,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",Lt,!(a||i))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&$7(n)}function I7({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:a}){return class{constructor(s={},l=t==null?void 0:t()){this.id=Vte++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Hte),this.nodes.forEach(Yte),this.nodes.forEach(Xte),this.nodes.forEach(Wte)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Cte)}addEventListener(s,l){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new AE),this.eventHandlers.get(s).add(l)}notifyListeners(s,...l){const c=this.eventHandlers.get(s);c&&c.notify(...l)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=QF(s)&&!TJ(s),this.instance=s;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;Lt.read(()=>{f=window.innerWidth}),e(s,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,d&&d(),d=Ate(h,250),Am.hasAnimatedSinceResize&&(Am.hasAnimatedSinceResize=!1,this.nodes.forEach(MT)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||tre,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=u.getProps(),x=!this.targetLayout||!D7(this.targetLayout,p),v=!f&&h;if(this.options.layoutRoot||this.resumeFrom||v||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...qE(m,"layout"),onPlay:g,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(d,v)}else f||MT(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Us(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Zte),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&$7(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(OT);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(TT);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Kte),this.nodes.forEach(qte),this.nodes.forEach(Ute)):this.nodes.forEach(TT),this.clearAllSnapshots();const l=sn.now();Ar.delta=Ti(0,1e3/60,l-Ar.timestamp),Ar.timestamp=l,Ar.isProcessing=!0,ev.update.process(Ar),ev.preRender.process(Ar),ev.render.process(Ar),Ar.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,HE.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Gte),this.sharedNodes.forEach(Qte)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Lt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Lt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Kr(this.snapshot.measuredBox.x)&&!Kr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=er(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(l=!1),l&&this.instance){const c=n(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:c,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!a)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!R7(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;s&&this.instance&&(l||xo(this.latestValues)||d)&&(a(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return s&&(c=this.removeTransform(c)),rre(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:s}=this.options;if(!s)return er();const l=s.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(nre))){const{scroll:d}=this.root;d&&(ic(l.x,d.offset.x),ic(l.y,d.offset.y))}return l}removeElementScroll(s){var c;const l=er();if(Dn(l,s),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Dn(l,s),ic(l.x,f.offset.x),ic(l.y,f.offset.y))}return l}applyTransform(s,l=!1){const c=er();Dn(c,s);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&sc(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),xo(d.latestValues)&&sc(c,d.latestValues)}return xo(this.latestValues)&&sc(c,this.latestValues),c}removeTransform(s){const l=er();Dn(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!xo(u.latestValues))continue;hN(u.latestValues)&&u.updateSnapshot();const d=er(),f=u.measurePageBox();Dn(d,f),ST(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return xo(this.latestValues)&&ST(l,this.latestValues),l}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ar.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var h;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(s||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Ar.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=er(),this.relativeTargetOrigin=er(),tf(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Dn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=er(),this.targetWithTransforms=er()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),cte(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Dn(this.target,this.layout.layoutBox),m7(this.target,this.targetDelta)):Dn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=er(),this.relativeTargetOrigin=er(),tf(this.relativeTargetOrigin,this.target,p.target),Dn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||hN(this.parent.latestValues)||p7(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var m;const s=this.getLead(),l=!!this.resumingFrom||this!==s;let c=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Ar.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Dn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;wee(this.layoutCorrected,this.treeScale,this.path,l),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=er());const{target:p}=s;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(jT(this.prevProjectionDelta.x,this.projectionDelta.x),jT(this.prevProjectionDelta.y,this.projectionDelta.y)),ef(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!AT(this.projectionDelta.x,this.prevProjectionDelta.x)||!AT(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),s){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=oc(),this.projectionDelta=oc(),this.projectionDeltaWithTransform=oc()}setAnimationOrigin(s,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=oc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=er(),p=c?c.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,y=this.getStack(),x=!y||y.members.length<=1,v=!!(g&&!x&&this.options.crossfade===!0&&!this.path.some(ere));this.animationProgress=0;let b;this.mixTargetDelta=j=>{const w=j/1e3;RT(f.x,s.x,w),RT(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(tf(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Jte(this.relativeTarget,this.relativeTargetOrigin,h,w),b&&Lte(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=er()),Dn(b,this.relativeTarget)),g&&(this.animationValues=d,Tte(d,u,this.latestValues,w,v,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Us(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Lt.update(()=>{Am.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Bc(0)),this.currentAnimation=Ete(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),s.onUpdate&&s.onUpdate(d)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Bte),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=s;if(!(!l||!c||!u)){if(this!==s&&this.layout&&u&&L7(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||er();const f=Kr(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+f;const h=Kr(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+h}Dn(l,c),sc(l,d),ef(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(s,l){this.sharedNodes.has(s)||this.sharedNodes.set(s,new zte),this.sharedNodes.get(s).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var l;const{layoutId:s}=this.options;return s?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:s}=this.options;return s?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let l=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&fv("z",s,u,this.animationValues);for(let d=0;d<dv.length;d++)fv(`rotate${dv[d]}`,s,u,this.animationValues),fv(`skew${dv[d]}`,s,u,this.animationValues);s.render();for(const d in u)s.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);s.scheduleRender()}applyProjectionStyles(s,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Cm(l==null?void 0:l.pointerEvents)||"",s.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Cm(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!xo(this.latestValues)&&(s.transform=c?c({},""):"none",this.hasProjected=!1);return}s.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Fte(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),s.transform=f;const{x:h,y:p}=this.projectionDelta;s.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,u.animationValues?s.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:s.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in If){if(d[m]===void 0)continue;const{correct:g,applyTo:y,isCSSVariable:x}=If[m],v=f==="none"?d[m]:g(d[m],u);if(y){const b=y.length;for(let j=0;j<b;j++)s[y[j]]=v}else x?this.options.visualElement.renderState.vars[m]=v:s[m]=v}this.options.layoutId&&(s.pointerEvents=u===this?Cm(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var l;return(l=s.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(OT),this.root.sharedNodes.clear()}}}function qte(e){e.updateLayout()}function Ute(e){var r;const t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=e.layout,{animationType:i}=e.options,s=t.source!==e.layout.source;i==="size"?Fn(f=>{const h=s?t.measuredBox[f]:t.layoutBox[f],p=Kr(h);h.min=n[f].min,h.max=h.min+p}):L7(i,t.layoutBox,n)&&Fn(f=>{const h=s?t.measuredBox[f]:t.layoutBox[f],p=Kr(n[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const l=oc();ef(l,n,t.layoutBox);const c=oc();s?ef(c,e.applyTransform(a,!0),t.measuredBox):ef(c,n,t.layoutBox);const u=!R7(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const m=er();tf(m,t.layoutBox,h.layoutBox);const g=er();tf(g,n,p.layoutBox),D7(m,g)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Hte(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Wte(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Gte(e){e.clearSnapshot()}function OT(e){e.clearMeasurements()}function TT(e){e.isLayoutDirty=!1}function Kte(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function MT(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Yte(e){e.resolveTargetDelta()}function Xte(e){e.calcProjection()}function Zte(e){e.resetSkewAndRotation()}function Qte(e){e.removeLeadSnapshot()}function RT(e,t,r){e.translate=Ut(t.translate,0,r),e.scale=Ut(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function DT(e,t,r,n){e.min=Ut(t.min,r.min,n),e.max=Ut(t.max,r.max,n)}function Jte(e,t,r,n){DT(e.x,t.x,r.x,n),DT(e.y,t.y,r.y,n)}function ere(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const tre={duration:.45,ease:[.4,0,.1,1]},$T=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),IT=$T("applewebkit/")&&!$T("chrome/")?Math.round:Qn;function LT(e){e.min=IT(e.min),e.max=IT(e.max)}function rre(e){LT(e.x),LT(e.y)}function L7(e,t,r){return e==="position"||e==="preserve-aspect"&&!lte(CT(t),CT(r),.2)}function nre(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const are=I7({attachResizeListener:(e,t)=>Lf(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),hv={current:void 0},z7=I7({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!hv.current){const e=new are({});e.mount(window),e.setOptions({layoutScroll:!0}),hv.current=e}return hv.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ire={pan:{Feature:kte},drag:{Feature:jte,ProjectionNode:z7,MeasureLayout:O7}};function zT(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const a="onHover"+r,i=n[a];i&&Lt.postRender(()=>i(t,Vh(t)))}class sre extends eo{mount(){const{current:t}=this.node;t&&(this.unmount=EJ(t,(r,n)=>(zT(this.node,n,"Start"),a=>zT(this.node,a,"End"))))}unmount(){}}class ore extends eo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=zh(Lf(this.node.current,"focus",()=>this.onFocus()),Lf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function FT(e,t,r){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const a="onTap"+(r==="End"?"":r),i=n[a];i&&Lt.postRender(()=>i(t,Vh(t)))}class lre extends eo{mount(){const{current:t}=this.node;t&&(this.unmount=OJ(t,(r,n)=>(FT(this.node,n,"Start"),(a,{success:i})=>FT(this.node,a,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const bN=new WeakMap,pv=new WeakMap,cre=e=>{const t=bN.get(e.target);t&&t(e)},ure=e=>{e.forEach(cre)};function dre({root:e,...t}){const r=e||document;pv.has(r)||pv.set(r,{});const n=pv.get(r),a=JSON.stringify(t);return n[a]||(n[a]=new IntersectionObserver(ure,{root:e,...t})),n[a]}function fre(e,t,r){const n=dre(t);return bN.set(e,r),n.observe(e),()=>{bN.delete(e),n.unobserve(e)}}const hre={some:0,all:1};class pre extends eo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:a="some",once:i}=t,s={root:r?r.current:void 0,rootMargin:n,threshold:typeof a=="number"?a:hre[a]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return fre(this.node.current,s,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(mre(t,r))&&this.startObserver()}unmount(){}}function mre({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const gre={inView:{Feature:pre},tap:{Feature:lre},focus:{Feature:ore},hover:{Feature:sre}},xre={layout:{ProjectionNode:z7,MeasureLayout:O7}},yre={...rte,...gre,...ire,...xre},ge=yee(yre,Oee),F7=S.createContext();function vre({children:e}){const[t,r]=S.useState([]),n=S.useCallback((u,d="info",f=5e3)=>{const h=Date.now()+Math.random();r(p=>[...p,{id:h,message:u,type:d,duration:f}]),f>0&&setTimeout(()=>{a(h)},f)},[]),a=S.useCallback(u=>{r(d=>d.filter(f=>f.id!==u))},[]),i=S.useCallback((u,d)=>n(u,"success",d),[n]),s=S.useCallback((u,d)=>n(u,"error",d),[n]),l=S.useCallback((u,d)=>n(u,"warning",d),[n]),c=S.useCallback((u,d)=>n(u,"info",d),[n]);return o.jsxs(F7.Provider,{value:{success:i,error:s,warning:l,info:c,addToast:n},children:[e,o.jsx(bre,{toasts:t,onRemove:a})]})}function B7(){const e=S.useContext(F7);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function bre({toasts:e,onRemove:t}){return o.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col gap-2 pointer-events-none",children:o.jsx(Zt,{children:e.map(r=>o.jsx(wre,{toast:r,onRemove:()=>t(r.id)},r.id))})})}function wre({toast:e,onRemove:t}){const{message:r,type:n}=e,a={success:{icon:rr,bgClass:"bg-emerald-50 dark:bg-emerald-900/20 border-emerald-200 dark:border-emerald-800",iconClass:"text-emerald-600 dark:text-emerald-400",textClass:"text-emerald-900 dark:text-emerald-100"},error:{icon:dn,bgClass:"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800",iconClass:"text-red-600 dark:text-red-400",textClass:"text-red-900 dark:text-red-100"},warning:{icon:ex,bgClass:"bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800",iconClass:"text-amber-600 dark:text-amber-400",textClass:"text-amber-900 dark:text-amber-100"},info:{icon:yi,bgClass:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",iconClass:"text-blue-600 dark:text-blue-400",textClass:"text-blue-900 dark:text-blue-100"}},{icon:i,bgClass:s,iconClass:l,textClass:c}=a[n]||a.info;return o.jsxs(ge.div,{initial:{opacity:0,y:-20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,x:100,scale:.95},transition:{duration:.2},className:`pointer-events-auto ${s} border rounded-lg shadow-lg p-4 pr-12 max-w-md relative`,children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(i,{className:`${l} shrink-0 mt-0.5`,size:20}),o.jsx("p",{className:`${c} text-sm font-medium leading-relaxed`,children:r})]}),o.jsx("button",{onClick:t,className:`absolute top-3 right-3 ${l} hover:opacity-70 transition-opacity`,children:o.jsx(Tn,{size:16})})]})}const jre=[{title:"Workspace",items:[{icon:Q8,label:"Dashboard",path:"/"},{icon:vZ,label:"Projects",path:"/projects"}]},{title:"Automation",items:[{icon:fn,label:"Pipelines",path:"/pipelines"},{icon:_a,label:"Schedules",path:"/schedules"},{icon:fn,label:"Runs",path:"/runs"},{icon:No,label:"Deployments",path:"/deployments"}]},{title:"Insights",items:[{icon:ql,label:"Leaderboard",path:"/leaderboard"},{icon:Xn,label:"Experiments",path:"/experiments"},{icon:nF,label:"Model Explorer",path:"/model-explorer"}]},{title:"Data & Observability",items:[{icon:nr,label:"Assets",path:"/assets"},{icon:rF,label:"Traces",path:"/traces"},{icon:Fe,label:"Observability",path:"/observability"}]}],kre=[{icon:Ea,label:"Plugins",path:"/plugins"},{icon:g0,label:"API Tokens",path:"/tokens"},{icon:tx,label:"Settings",path:"/settings"}];function Nre({collapsed:e,setCollapsed:t}){const r=Js();return o.jsxs(ge.aside,{initial:!1,animate:{width:e?80:256},className:"h-screen bg-white dark:bg-slate-800 border-r border-slate-200 dark:border-slate-700 flex flex-col shadow-sm z-20 relative",children:[o.jsxs("div",{className:"p-4 border-b border-slate-100 dark:border-slate-700 flex items-center gap-3 h-[73px]",children:[o.jsx("img",{src:"/logo.png",alt:"FlowyML",className:"w-12 h-12 min-w-[48px] rounded-lg shadow-lg"}),o.jsx(Zt,{children:!e&&o.jsxs(ge.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},className:"flex flex-col",children:[o.jsx("h1",{className:"text-xl font-bold text-slate-900 dark:text-white tracking-tight whitespace-nowrap overflow-hidden",children:"FlowyML"}),o.jsx("span",{className:"text-[10px] text-slate-400 dark:text-slate-500",children:"by UnicoLab"})]})})]}),o.jsxs("nav",{className:"flex-1 p-4 space-y-4 overflow-y-auto overflow-x-hidden scrollbar-thin scrollbar-thumb-slate-200 dark:scrollbar-thumb-slate-700",children:[jre.map(n=>o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:`px-4 text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wider transition-opacity duration-200 ${e?"opacity-0 h-0":"opacity-100"}`,children:n.title}),n.items.map(a=>o.jsx(BT,{to:a.path,icon:a.icon,label:a.label,collapsed:e,isActive:r.pathname===a.path},a.path))]},n.title)),o.jsx("div",{className:`px-4 py-2 text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wider mt-2 transition-opacity duration-200 ${e?"opacity-0 h-0":"opacity-100"}`,children:"Settings"}),kre.map(n=>o.jsx(BT,{to:n.path,icon:n.icon,label:n.label,collapsed:e,isActive:r.pathname===n.path},n.path))]}),o.jsx("div",{className:"p-4 border-t border-slate-100 dark:border-slate-700",children:o.jsx("div",{className:`bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 rounded-lg p-3 border border-slate-200 dark:border-slate-700 transition-all duration-200 ${e?"p-2 flex justify-center":""}`,children:e?o.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse",title:"Online"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse"}),o.jsx("p",{className:"text-xs font-semibold text-slate-600 dark:text-slate-300 whitespace-nowrap",children:"FlowyML v1.3.0"})]}),o.jsxs("p",{className:"text-[10px] text-slate-400 dark:text-slate-500 whitespace-nowrap",children:["Made with ❤️ by ",o.jsx("span",{className:"font-medium text-primary-500",children:"UnicoLab"})]})]})})}),o.jsx("button",{onClick:()=>t(!e),className:"absolute -right-3 top-20 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-full p-1 shadow-md text-slate-500 hover:text-primary-600 dark:hover:text-primary-400 transition-colors",children:e?o.jsx(na,{size:14}):o.jsx(hZ,{size:14})})]})}function BT({to:e,icon:t,label:r,collapsed:n,isActive:a}){return o.jsxs(JX,{to:e,className:`flex items-center gap-3 px-4 py-2.5 rounded-lg transition-all duration-200 group relative ${a?"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-400 font-medium shadow-sm":"text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-700 hover:text-slate-900 dark:hover:text-white"}`,title:n?r:void 0,children:[o.jsx("span",{className:`transition-colors flex-shrink-0 ${a?"text-primary-600 dark:text-primary-400":"text-slate-400 group-hover:text-slate-600 dark:group-hover:text-slate-300"}`,children:o.jsx(t,{size:20})}),!n&&o.jsx("span",{className:"text-sm whitespace-nowrap overflow-hidden text-ellipsis",children:r}),n&&a&&o.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-1 h-8 bg-primary-600 rounded-r-full"})]})}function Sre(){const{selectedProject:e,projects:t,loading:r,selectProject:n,clearProject:a}=Ui(),[i,s]=M.useState(!1),l=t.find(c=>c.name===e);return o.jsxs("div",{className:"relative",children:[o.jsxs("button",{onClick:()=>s(!i),className:"flex items-center gap-2 px-4 py-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors min-w-[200px]",children:[e?o.jsxs(o.Fragment,{children:[o.jsx(m0,{size:18,className:"text-primary-600 dark:text-primary-400"}),o.jsxs("div",{className:"flex-1 text-left",children:[o.jsx("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:(l==null?void 0:l.name)||e}),(l==null?void 0:l.description)&&o.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 truncate max-w-[150px]",children:l.description})]})]}):o.jsxs(o.Fragment,{children:[o.jsx(el,{size:18,className:"text-slate-400"}),o.jsx("span",{className:"flex-1 text-left text-sm font-medium text-slate-700 dark:text-slate-300",children:"All Projects"})]}),o.jsx(yE,{size:16,className:`text-slate-400 transition-transform ${i?"rotate-180":""}`})]}),o.jsx(Zt,{children:i&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),o.jsxs(ge.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.15},className:"absolute top-full mt-2 left-0 w-full min-w-[280px] bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg shadow-xl z-20 max-h-[400px] overflow-y-auto",children:[o.jsxs("button",{onClick:()=>{a(),s(!1)},className:`w-full flex items-center gap-3 px-4 py-3 hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors ${e?"":"bg-primary-50 dark:bg-primary-900/20"}`,children:[o.jsx(el,{size:18,className:"text-slate-400"}),o.jsxs("div",{className:"flex-1 text-left",children:[o.jsx("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:"All Projects"}),o.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:"View data from all projects"})]}),!e&&o.jsx("div",{className:"w-2 h-2 rounded-full bg-primary-600"})]}),o.jsx("div",{className:"border-t border-slate-200 dark:border-slate-700"}),r?o.jsx("div",{className:"px-4 py-8 text-center text-slate-500 dark:text-slate-400 text-sm",children:"Loading projects..."}):t.length===0?o.jsx("div",{className:"px-4 py-8 text-center text-slate-500 dark:text-slate-400 text-sm",children:"No projects yet"}):t.map(c=>o.jsxs("button",{onClick:()=>{n(c.name),s(!1)},className:`w-full flex items-center gap-3 px-4 py-3 hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors ${e===c.name?"bg-primary-50 dark:bg-primary-900/20":""}`,children:[o.jsx(m0,{size:18,className:e===c.name?"text-primary-600 dark:text-primary-400":"text-slate-400"}),o.jsxs("div",{className:"flex-1 text-left",children:[o.jsx("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:c.name}),c.description&&o.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:c.description})]}),e===c.name&&o.jsx("div",{className:"w-2 h-2 rounded-full bg-primary-600"})]},c.name))]})]})})]})}let Pp=null;const V7=async()=>{if(Pp)return Pp;try{return Pp=await(await fetch("/api/config")).json(),Pp}catch(e){return console.error("Failed to fetch config:",e),{execution_mode:"local"}}},q7=async()=>{const e=await V7();return e.execution_mode==="remote"&&e.remote_server_url?e.remote_server_url:""},Ne=async(e,t={})=>{const r=await q7(),n=e.startsWith("/")?e:`/${e}`,a=`${r}${n}`;return fetch(a,t)},_re=()=>{const[e,t]=S.useState(null),[r,n]=S.useState(!0);return S.useEffect(()=>{V7().then(a=>{t(a),n(!1)})},[]),{config:e,loading:r}};function Ere(){const{theme:e,toggleTheme:t}=aZ(),r=Js(),{config:n,loading:a}=_re(),i=r.pathname.split("/").filter(c=>c),s=!a&&(n==null?void 0:n.execution_mode)==="remote",l=s&&Array.isArray(n==null?void 0:n.remote_services)?n.remote_services:[];return o.jsxs("header",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4 flex items-center justify-between shadow-sm z-10",children:[o.jsx("div",{className:"flex items-center gap-4 flex-1",children:o.jsxs("nav",{className:"flex items-center text-sm text-slate-500 dark:text-slate-400",children:[o.jsx(ft,{to:"/",className:"hover:text-primary-600 dark:hover:text-primary-400 transition-colors",children:o.jsx(wZ,{size:16})}),i.length>0&&o.jsx(na,{size:14,className:"mx-2 text-slate-300 dark:text-slate-600"}),i.map((c,u)=>{const d=`/${i.slice(0,u+1).join("/")}`,f=u===i.length-1,h=c.charAt(0).toUpperCase()+c.slice(1).replace(/-/g," ");return o.jsxs(M.Fragment,{children:[f?o.jsx("span",{className:"font-medium text-slate-900 dark:text-white",children:h}):o.jsx(ft,{to:d,className:"hover:text-primary-600 dark:hover:text-primary-400 transition-colors",children:h}),!f&&o.jsx(na,{size:14,className:"mx-2 text-slate-300 dark:text-slate-600"})]},c)})]})}),o.jsxs("div",{className:"flex items-center gap-4",children:[s&&o.jsxs("div",{className:"flex flex-col gap-2 px-4 py-2 rounded-xl bg-primary-50 text-primary-800 border border-primary-100 dark:bg-primary-900/20 dark:text-primary-200 dark:border-primary-900/40",children:[o.jsxs("div",{className:"flex items-center gap-2 text-xs uppercase tracking-wide font-semibold",children:[o.jsx(TZ,{size:14})," Remote Stack"]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[(n==null?void 0:n.remote_ui_url)&&o.jsxs("a",{href:n.remote_ui_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs font-medium bg-white/70 dark:bg-slate-800/40 px-2 py-1 rounded-lg hover:underline",children:["UI ",o.jsx(bc,{size:12})]}),(n==null?void 0:n.remote_server_url)&&o.jsxs("a",{href:n.remote_server_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs font-medium bg-white/70 dark:bg-slate-800/40 px-2 py-1 rounded-lg hover:underline",children:["API ",o.jsx(bc,{size:12})]}),l.map((c,u)=>o.jsxs("a",{href:(c==null?void 0:c.url)||(c==null?void 0:c.link),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs font-medium bg-white/70 dark:bg-slate-800/40 px-2 py-1 rounded-lg hover:underline",children:[(c==null?void 0:c.label)||(c==null?void 0:c.name)||"Service"," ",o.jsx(bc,{size:12})]},`${(c==null?void 0:c.name)||(c==null?void 0:c.label)||"service"}-${u}`))]})]}),o.jsx(Sre,{}),o.jsx("div",{className:"h-6 w-px bg-slate-200 dark:bg-slate-700 mx-2"}),o.jsx("button",{onClick:t,className:"p-2 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors text-slate-500 hover:text-primary-600 dark:text-slate-400 dark:hover:text-primary-400","aria-label":"Toggle theme",children:e==="dark"?o.jsx(oF,{size:20}):o.jsx(aF,{size:20})})]})]})}function U7(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=U7(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function tt(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=U7(e))&&(n&&(n+=" "),n+=t);return n}const nP="-",Pre=e=>{const t=Are(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{const l=s.split(nP);return l[0]===""&&l.length!==1&&l.shift(),H7(l,t)||Cre(s)},getConflictingClassGroupIds:(s,l)=>{const c=r[s]||[];return l&&n[s]?[...c,...n[s]]:c}}},H7=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?H7(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(nP);return(s=t.validators.find(({validator:l})=>l(i)))==null?void 0:s.classGroupId},VT=/^\[(.+)\]$/,Cre=e=>{if(VT.test(e)){const t=VT.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Are=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Tre(Object.entries(e.classGroups),r).forEach(([i,s])=>{wN(s,n,i,t)}),n},wN=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:qT(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(Ore(a)){wN(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,s])=>{wN(s,qT(t,i),r,n)})})},qT=(e,t)=>{let r=e;return t.split(nP).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Ore=e=>e.isThemeGetter,Tre=(e,t)=>t?e.map(([r,n])=>{const a=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,l])=>[t+s,l])):i);return[r,a]}):e,Mre=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(i,s)=>{r.set(i,s),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let s=r.get(i);if(s!==void 0)return s;if((s=n.get(i))!==void 0)return a(i,s),s},set(i,s){r.has(i)?r.set(i,s):a(i,s)}}},W7="!",Rre=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,a=t[0],i=t.length,s=l=>{const c=[];let u=0,d=0,f;for(let y=0;y<l.length;y++){let x=l[y];if(u===0){if(x===a&&(n||l.slice(y,y+i)===t)){c.push(l.slice(d,y)),d=y+i;continue}if(x==="/"){f=y;continue}}x==="["?u++:x==="]"&&u--}const h=c.length===0?l:l.substring(d),p=h.startsWith(W7),m=p?h.substring(1):h,g=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return r?l=>r({className:l,parseClassName:s}):s},Dre=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},$re=e=>({cache:Mre(e.cacheSize),parseClassName:Rre(e),...Pre(e)}),Ire=/\s+/,Lre=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=t,i=[],s=e.trim().split(Ire);let l="";for(let c=s.length-1;c>=0;c-=1){const u=s[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=r(u);let m=!!p,g=n(m?h.substring(0,p):h);if(!g){if(!m){l=u+(l.length>0?" "+l:l);continue}if(g=n(h),!g){l=u+(l.length>0?" "+l:l);continue}m=!1}const y=Dre(d).join(":"),x=f?y+W7:y,v=x+g;if(i.includes(v))continue;i.push(v);const b=a(g,m);for(let j=0;j<b.length;++j){const w=b[j];i.push(x+w)}l=u+(l.length>0?" "+l:l)}return l};function zre(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=G7(t))&&(n&&(n+=" "),n+=r);return n}const G7=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=G7(e[n]))&&(r&&(r+=" "),r+=t);return r};function Fre(e,...t){let r,n,a,i=s;function s(c){const u=t.reduce((d,f)=>f(d),e());return r=$re(u),n=r.cache.get,a=r.cache.set,i=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=Lre(c,r);return a(c,d),d}return function(){return i(zre.apply(null,arguments))}}const At=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},K7=/^\[(?:([a-z-]+):)?(.+)\]$/i,Bre=/^\d+\/\d+$/,Vre=new Set(["px","full","screen"]),qre=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ure=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hre=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wre=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gre=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ti=e=>jc(e)||Vre.has(e)||Bre.test(e),ts=e=>_u(e,"length",tne),jc=e=>!!e&&!Number.isNaN(Number(e)),mv=e=>_u(e,"number",jc),rd=e=>!!e&&Number.isInteger(Number(e)),Kre=e=>e.endsWith("%")&&jc(e.slice(0,-1)),Ve=e=>K7.test(e),rs=e=>qre.test(e),Yre=new Set(["length","size","percentage"]),Xre=e=>_u(e,Yre,Y7),Zre=e=>_u(e,"position",Y7),Qre=new Set(["image","url"]),Jre=e=>_u(e,Qre,nne),ene=e=>_u(e,"",rne),nd=()=>!0,_u=(e,t,r)=>{const n=K7.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},tne=e=>Ure.test(e)&&!Hre.test(e),Y7=()=>!1,rne=e=>Wre.test(e),nne=e=>Gre.test(e),ane=()=>{const e=At("colors"),t=At("spacing"),r=At("blur"),n=At("brightness"),a=At("borderColor"),i=At("borderRadius"),s=At("borderSpacing"),l=At("borderWidth"),c=At("contrast"),u=At("grayscale"),d=At("hueRotate"),f=At("invert"),h=At("gap"),p=At("gradientColorStops"),m=At("gradientColorStopPositions"),g=At("inset"),y=At("margin"),x=At("opacity"),v=At("padding"),b=At("saturate"),j=At("scale"),w=At("sepia"),k=At("skew"),N=At("space"),_=At("translate"),P=()=>["auto","contain","none"],C=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",Ve,t],O=()=>[Ve,t],T=()=>["",ti,ts],E=()=>["auto",jc,Ve],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",Ve],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[jc,Ve];return{cacheSize:500,separator:":",theme:{colors:[nd],spacing:[ti,ts],blur:["none","",rs,Ve],brightness:q(),borderColor:[e],borderRadius:["none","","full",rs,Ve],borderSpacing:O(),borderWidth:T(),contrast:q(),grayscale:$(),hueRotate:q(),invert:$(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[Kre,ts],inset:A(),margin:A(),opacity:q(),padding:O(),saturate:q(),scale:q(),sepia:$(),skew:q(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",Ve]}],container:["container"],columns:[{columns:[rs]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...R(),Ve]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",rd,Ve]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ve]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",rd,Ve]}],"grid-cols":[{"grid-cols":[nd]}],"col-start-end":[{col:["auto",{span:["full",rd,Ve]},Ve]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[nd]}],"row-start-end":[{row:["auto",{span:[rd,Ve]},Ve]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ve]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ve]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ve,t]}],"min-w":[{"min-w":[Ve,t,"min","max","fit"]}],"max-w":[{"max-w":[Ve,t,"none","full","min","max","fit","prose",{screen:[rs]},rs]}],h:[{h:[Ve,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ve,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ve,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ve,t,"auto","min","max","fit"]}],"font-size":[{text:["base",rs,ts]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",mv]}],"font-family":[{font:[nd]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ve]}],"line-clamp":[{"line-clamp":["none",jc,mv]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ti,Ve]}],"list-image":[{"list-image":["none",Ve]}],"list-style-type":[{list:["none","disc","decimal",Ve]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ti,ts]}],"underline-offset":[{"underline-offset":["auto",ti,Ve]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),Zre]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xre]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Jre]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:D()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[ti,Ve]}],"outline-w":[{outline:[ti,ts]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[ti,ts]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",rs,ene]}],"shadow-color":[{shadow:[nd]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",rs,Ve]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ve]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",Ve]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ve]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[rd,Ve]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ve]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ve]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ve]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ti,ts,mv]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},ine=Fre(ane);function Eu(...e){return ine(tt(e))}const sne={primary:"bg-primary-600 text-white hover:bg-primary-700 shadow-md shadow-primary-500/20",secondary:"bg-white text-slate-900 border border-slate-200 hover:bg-slate-50",ghost:"bg-transparent text-slate-600 hover:bg-slate-100",danger:"bg-rose-600 text-white hover:bg-rose-700 shadow-md shadow-rose-500/20"},one={sm:"h-8 px-3 text-xs",md:"h-10 px-4 py-2",lg:"h-12 px-8 text-lg",icon:"h-10 w-10"};function fe({className:e,variant:t="primary",size:r="md",children:n,...a}){return o.jsx(ge.button,{whileTap:{scale:.98},className:Eu("inline-flex items-center justify-center rounded-lg font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:pointer-events-none disabled:opacity-50",sne[t],one[r],e),...a,children:n})}class X7 extends M.Component{constructor(r){super(r);Ny(this,"reportError",async(r,n)=>{if(!this.state.reported)try{await fetch("/api/client/errors",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:r.message||"Unknown error",stack:r.stack,component_stack:n==null?void 0:n.componentStack,url:window.location.href,user_agent:navigator.userAgent})}),this.setState({reported:!0})}catch(a){console.error("Failed to report error:",a)}});Ny(this,"handleReset",()=>{this.setState({hasError:!1,error:null,errorInfo:null,reported:!1}),this.props.onReset&&this.props.onReset()});this.state={hasError:!1,error:null,errorInfo:null,reported:!1}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){console.error("Uncaught error:",r,n),this.setState({errorInfo:n}),this.reportError(r,n)}render(){var r;return this.state.hasError?this.props.fallback?this.props.fallback:o.jsx("div",{className:"min-h-[400px] flex items-center justify-center p-6 w-full",children:o.jsxs("div",{className:"max-w-lg w-full bg-white dark:bg-gray-900 rounded-2xl shadow-xl overflow-hidden border border-gray-200 dark:border-gray-800",children:[o.jsx("div",{className:"bg-gradient-to-r from-pink-500 via-red-500 to-yellow-500 h-2"}),o.jsxs("div",{className:"p-8",children:[o.jsx("div",{className:"flex justify-center mb-6",children:o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute inset-0 bg-red-100 dark:bg-red-900/30 rounded-full animate-ping opacity-75"}),o.jsx("div",{className:"relative p-4 bg-red-50 dark:bg-red-900/20 rounded-full",children:o.jsx(dZ,{className:"w-12 h-12 text-red-500 dark:text-red-400"})})]})}),o.jsx("h2",{className:"text-2xl font-bold text-center text-gray-900 dark:text-white mb-2",children:"Well, this is awkward..."}),o.jsx("p",{className:"text-center text-gray-600 dark:text-gray-400 mb-6",children:"The hamsters powering this component decided to take an unscheduled nap. We've dispatched a team of digital veterinarians (aka developers) to wake them up."}),o.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800 rounded-lg p-4 mb-6 font-mono text-xs text-left overflow-auto max-h-32 border border-gray-200 dark:border-gray-700",children:[o.jsxs("div",{className:"flex items-center text-red-500 mb-2",children:[o.jsx(nl,{className:"w-3 h-3 mr-2"}),o.jsx("span",{className:"font-semibold",children:"Error Log"})]}),o.jsx("code",{className:"text-gray-700 dark:text-gray-300 break-all whitespace-pre-wrap",children:((r=this.state.error)==null?void 0:r.message)||"Unknown error"})]}),o.jsxs("div",{className:"flex justify-center gap-4",children:[o.jsx(fe,{onClick:()=>window.location.reload(),variant:"outline",className:"border-gray-300 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800",children:"Reload Page"}),o.jsxs(fe,{onClick:this.handleReset,className:"bg-gradient-to-r from-red-500 to-pink-600 hover:from-red-600 hover:to-pink-700 text-white border-0",children:[o.jsx(vi,{className:"w-4 h-4 mr-2"}),"Try Again"]})]})]})]})}):this.props.children}}function lne(){const[e,t]=S.useState(!1);return o.jsxs("div",{className:"flex h-screen bg-slate-50 dark:bg-slate-900 overflow-hidden",children:[o.jsx(Nre,{collapsed:e,setCollapsed:t}),o.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[o.jsx(Ere,{}),o.jsx("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-slate-200 dark:scrollbar-thumb-slate-700",children:o.jsx("div",{className:"max-w-7xl mx-auto w-full",children:o.jsx(X7,{children:o.jsx(OX,{})})})})]})]})}function Te({className:e,children:t,hover:r=!0,...n}){return o.jsx(ge.div,{whileHover:r?{y:-2,boxShadow:"0 10px 30px -10px rgba(0,0,0,0.1)"}:{},transition:{duration:.2},className:Eu("bg-white dark:bg-slate-800 rounded-xl border border-slate-100 dark:border-slate-700 shadow-sm p-6","transition-colors duration-200",e),...n,children:t})}function Z7({className:e,children:t,...r}){return o.jsx("div",{className:Eu("flex flex-col space-y-1.5 mb-4",e),...r,children:t})}function Q7({className:e,children:t,...r}){return o.jsx("h3",{className:Eu("font-semibold leading-none tracking-tight text-slate-900 dark:text-white",e),...r,children:t})}function jN({className:e,children:t,...r}){return o.jsx("div",{className:Eu("",e),...r,children:t})}const cne={default:"bg-slate-100 text-slate-800",primary:"bg-primary-50 text-primary-700 border border-primary-100",success:"bg-emerald-50 text-emerald-700 border border-emerald-100",warning:"bg-amber-50 text-amber-700 border border-amber-100",danger:"bg-rose-50 text-rose-700 border border-rose-100",outline:"bg-transparent border border-slate-200 text-slate-600"};function qe({className:e,variant:t="default",children:r,...n}){return o.jsx("span",{className:Eu("inline-flex items-center rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ring-black/5",cne[t],e),...n,children:r})}const UT={completed:{icon:rr,label:"Completed",color:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-50 dark:bg-emerald-900/20",border:"border-emerald-200 dark:border-emerald-800"},success:{icon:rr,label:"Success",color:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-50 dark:bg-emerald-900/20",border:"border-emerald-200 dark:border-emerald-800"},failed:{icon:kr,label:"Failed",color:"text-rose-600 dark:text-rose-400",bg:"bg-rose-50 dark:bg-rose-900/20",border:"border-rose-200 dark:border-rose-800"},running:{icon:tF,label:"Running",color:"text-blue-600 dark:text-blue-400",bg:"bg-blue-50 dark:bg-blue-900/20",border:"border-blue-200 dark:border-blue-800",animate:!0},pending:{icon:ht,label:"Pending",color:"text-amber-600 dark:text-amber-400",bg:"bg-amber-50 dark:bg-amber-900/20",border:"border-amber-200 dark:border-amber-800"},queued:{icon:ht,label:"Queued",color:"text-slate-600 dark:text-slate-400",bg:"bg-slate-50 dark:bg-slate-900/20",border:"border-slate-200 dark:border-slate-700"},initializing:{icon:fn,label:"Initializing",color:"text-blue-600 dark:text-blue-400",bg:"bg-blue-50 dark:bg-blue-900/20",border:"border-blue-200 dark:border-blue-800"},cached:{icon:rr,label:"Cached",color:"text-cyan-600 dark:text-cyan-400",bg:"bg-cyan-50 dark:bg-cyan-900/20",border:"border-cyan-200 dark:border-cyan-800"}};function une({status:e,size:t="md",showLabel:r=!0,className:n="",iconOnly:a=!1}){const i=UT[e==null?void 0:e.toLowerCase()]||UT.pending,s=i.icon,l={sm:{icon:14,text:"text-xs",padding:"px-2 py-0.5"},md:{icon:16,text:"text-sm",padding:"px-2.5 py-1"},lg:{icon:20,text:"text-base",padding:"px-3 py-1.5"}},{icon:c,text:u,padding:d}=l[t];return a?o.jsx(s,{size:c,className:`${i.color} ${i.animate?"animate-spin":""} ${n}`}):o.jsxs("div",{className:`inline-flex items-center gap-1.5 ${d} rounded-full border ${i.bg} ${i.border} ${n}`,children:[o.jsx(s,{size:c,className:`${i.color} ${i.animate?"animate-spin":""}`}),r&&o.jsx("span",{className:`font-medium ${i.color} ${u}`,children:i.label})]})}function qc({status:e,className:t=""}){return o.jsx(une,{status:e,size:"sm",className:t})}const J7=6048e5,dne=864e5,Cp=43200,HT=1440,WT=Symbol.for("constructDateFrom");function Ri(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&WT in e?e[WT](t):e instanceof Date?new e.constructor(t):new Date(t)}function Nr(e,t){return Ri(t||e,e)}let fne={};function qh(){return fne}function zf(e,t){var l,c,u,d;const r=qh(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,a=Nr(e,t==null?void 0:t.in),i=a.getDay(),s=(i<n?7:0)+i-n;return a.setDate(a.getDate()-s),a.setHours(0,0,0,0),a}function k0(e,t){return zf(e,{...t,weekStartsOn:1})}function e9(e,t){const r=Nr(e,t==null?void 0:t.in),n=r.getFullYear(),a=Ri(r,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const i=k0(a),s=Ri(r,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const l=k0(s);return r.getTime()>=i.getTime()?n+1:r.getTime()>=l.getTime()?n:n-1}function N0(e){const t=Nr(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function ox(e,...t){const r=Ri.bind(null,e||t.find(n=>typeof n=="object"));return t.map(r)}function GT(e,t){const r=Nr(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function hne(e,t,r){const[n,a]=ox(r==null?void 0:r.in,e,t),i=GT(n),s=GT(a),l=+i-N0(i),c=+s-N0(s);return Math.round((l-c)/dne)}function pne(e,t){const r=e9(e,t),n=Ri(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),k0(n)}function Om(e,t){const r=+Nr(e)-+Nr(t);return r<0?-1:r>0?1:r}function mne(e){return Ri(e,Date.now())}function gne(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function t9(e){return!(!gne(e)&&typeof e!="number"||isNaN(+Nr(e)))}function xne(e,t,r){const[n,a]=ox(r==null?void 0:r.in,e,t),i=n.getFullYear()-a.getFullYear(),s=n.getMonth()-a.getMonth();return i*12+s}function yne(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function vne(e,t){return+Nr(e)-+Nr(t)}function bne(e,t){const r=Nr(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function wne(e,t){const r=Nr(e,t==null?void 0:t.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function jne(e,t){const r=Nr(e,t==null?void 0:t.in);return+bne(r,t)==+wne(r,t)}function kne(e,t,r){const[n,a,i]=ox(r==null?void 0:r.in,e,e,t),s=Om(a,i),l=Math.abs(xne(a,i));if(l<1)return 0;a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-s*l);let c=Om(a,i)===-s;jne(n)&&l===1&&Om(n,i)===1&&(c=!1);const u=s*(l-+c);return u===0?0:u}function Nne(e,t,r){const n=vne(e,t)/1e3;return yne(r==null?void 0:r.roundingMethod)(n)}function Sne(e,t){const r=Nr(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const _ne={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ene=(e,t,r)=>{let n;const a=_ne[e];return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function gv(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Pne={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Cne={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ane={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},One={date:gv({formats:Pne,defaultWidth:"full"}),time:gv({formats:Cne,defaultWidth:"full"}),dateTime:gv({formats:Ane,defaultWidth:"full"})},Tne={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Mne=(e,t,r,n)=>Tne[e];function ad(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let a;if(n==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):s;a=e.formattingValues[l]||e.formattingValues[s]}else{const s=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;a=e.values[l]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const Rne={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Dne={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$ne={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ine={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Lne={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},zne={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Fne=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Bne={ordinalNumber:Fne,era:ad({values:Rne,defaultWidth:"wide"}),quarter:ad({values:Dne,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ad({values:$ne,defaultWidth:"wide"}),day:ad({values:Ine,defaultWidth:"wide"}),dayPeriod:ad({values:Lne,defaultWidth:"wide",formattingValues:zne,defaultFormattingWidth:"wide"})};function id(e){return(t,r={})=>{const n=r.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const s=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?qne(l,f=>f.test(s)):Vne(l,f=>f.test(s));let u;u=e.valueCallback?e.valueCallback(c):c,u=r.valueCallback?r.valueCallback(u):u;const d=t.slice(s.length);return{value:u,rest:d}}}function Vne(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function qne(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function Une(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const a=n[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=r.valueCallback?r.valueCallback(s):s;const l=t.slice(a.length);return{value:s,rest:l}}}const Hne=/^(\d+)(th|st|nd|rd)?/i,Wne=/\d+/i,Gne={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Kne={any:[/^b/i,/^(a|c)/i]},Yne={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Xne={any:[/1/i,/2/i,/3/i,/4/i]},Zne={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Qne={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Jne={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},eae={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},tae={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},rae={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},nae={ordinalNumber:Une({matchPattern:Hne,parsePattern:Wne,valueCallback:e=>parseInt(e,10)}),era:id({matchPatterns:Gne,defaultMatchWidth:"wide",parsePatterns:Kne,defaultParseWidth:"any"}),quarter:id({matchPatterns:Yne,defaultMatchWidth:"wide",parsePatterns:Xne,defaultParseWidth:"any",valueCallback:e=>e+1}),month:id({matchPatterns:Zne,defaultMatchWidth:"wide",parsePatterns:Qne,defaultParseWidth:"any"}),day:id({matchPatterns:Jne,defaultMatchWidth:"wide",parsePatterns:eae,defaultParseWidth:"any"}),dayPeriod:id({matchPatterns:tae,defaultMatchWidth:"any",parsePatterns:rae,defaultParseWidth:"any"})},r9={code:"en-US",formatDistance:Ene,formatLong:One,formatRelative:Mne,localize:Bne,match:nae,options:{weekStartsOn:0,firstWeekContainsDate:1}};function aae(e,t){const r=Nr(e,t==null?void 0:t.in);return hne(r,Sne(r))+1}function iae(e,t){const r=Nr(e,t==null?void 0:t.in),n=+k0(r)-+pne(r);return Math.round(n/J7)+1}function n9(e,t){var d,f,h,p;const r=Nr(e,t==null?void 0:t.in),n=r.getFullYear(),a=qh(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((p=(h=a.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=Ri((t==null?void 0:t.in)||e,0);s.setFullYear(n+1,0,i),s.setHours(0,0,0,0);const l=zf(s,t),c=Ri((t==null?void 0:t.in)||e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const u=zf(c,t);return+r>=+l?n+1:+r>=+u?n:n-1}function sae(e,t){var l,c,u,d;const r=qh(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,a=n9(e,t),i=Ri((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),zf(i,t)}function oae(e,t){const r=Nr(e,t==null?void 0:t.in),n=+zf(r,t)-+sae(r,t);return Math.round(n/J7)+1}function mt(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const ns={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return mt(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):mt(r+1,2)},d(e,t){return mt(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return mt(e.getHours()%12||12,t.length)},H(e,t){return mt(e.getHours(),t.length)},m(e,t){return mt(e.getMinutes(),t.length)},s(e,t){return mt(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return mt(a,t.length)}},Ol={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},KT={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return ns.y(e,t)},Y:function(e,t,r,n){const a=n9(e,n),i=a>0?a:1-a;if(t==="YY"){const s=i%100;return mt(s,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):mt(i,t.length)},R:function(e,t){const r=e9(e);return mt(r,t.length)},u:function(e,t){const r=e.getFullYear();return mt(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return mt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return mt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return ns.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return mt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const a=oae(e,n);return t==="wo"?r.ordinalNumber(a,{unit:"week"}):mt(a,t.length)},I:function(e,t,r){const n=iae(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):mt(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):ns.d(e,t)},D:function(e,t,r){const n=aae(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):mt(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return mt(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return mt(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),a=n===0?7:n;switch(t){case"i":return String(a);case"ii":return mt(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let a;switch(n===12?a=Ol.noon:n===0?a=Ol.midnight:a=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let a;switch(n>=17?a=Ol.evening:n>=12?a=Ol.afternoon:n>=4?a=Ol.morning:a=Ol.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return ns.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):ns.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):mt(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):mt(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):ns.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):ns.s(e,t)},S:function(e,t){return ns.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return XT(n);case"XXXX":case"XX":return yo(n);case"XXXXX":case"XXX":default:return yo(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return XT(n);case"xxxx":case"xx":return yo(n);case"xxxxx":case"xxx":default:return yo(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+YT(n,":");case"OOOO":default:return"GMT"+yo(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+YT(n,":");case"zzzz":default:return"GMT"+yo(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return mt(n,t.length)},T:function(e,t,r){return mt(+e,t.length)}};function YT(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),i=n%60;return i===0?r+String(a):r+String(a)+t+mt(i,2)}function XT(e,t){return e%60===0?(e>0?"-":"+")+mt(Math.abs(e)/60,2):yo(e,t)}function yo(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=mt(Math.trunc(n/60),2),i=mt(n%60,2);return r+a+t+i}const ZT=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},a9=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},lae=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return ZT(e,t);let i;switch(n){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",ZT(n,t)).replace("{{time}}",a9(a,t))},cae={p:a9,P:lae},uae=/^D+$/,dae=/^Y+$/,fae=["D","DD","YY","YYYY"];function hae(e){return uae.test(e)}function pae(e){return dae.test(e)}function mae(e,t,r){const n=gae(e,t,r);if(console.warn(n),fae.includes(e))throw new RangeError(n)}function gae(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const xae=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yae=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vae=/^'([^]*?)'?$/,bae=/''/g,wae=/[a-zA-Z]/;function Ft(e,t,r){var d,f,h,p;const n=qh(),a=n.locale??r9,i=n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,s=n.weekStartsOn??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,l=Nr(e,r==null?void 0:r.in);if(!t9(l))throw new RangeError("Invalid time value");let c=t.match(yae).map(m=>{const g=m[0];if(g==="p"||g==="P"){const y=cae[g];return y(m,a.formatLong)}return m}).join("").match(xae).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const g=m[0];if(g==="'")return{isToken:!1,value:jae(m)};if(KT[g])return{isToken:!0,value:m};if(g.match(wae))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:s,locale:a};return c.map(m=>{if(!m.isToken)return m.value;const g=m.value;(pae(g)||hae(g))&&mae(g,t,String(e));const y=KT[g[0]];return y(l,g,a.localize,u)}).join("")}function jae(e){const t=e.match(vae);return t?t[1].replace(bae,"'"):e}function kae(e,t,r){const n=qh(),a=(r==null?void 0:r.locale)??n.locale??r9,i=2520,s=Om(e,t);if(isNaN(s))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:s}),[c,u]=ox(r==null?void 0:r.in,...s>0?[t,e]:[e,t]),d=Nne(u,c),f=(N0(u)-N0(c))/1e3,h=Math.round((d-f)/60);let p;if(h<2)return r!=null&&r.includeSeconds?d<5?a.formatDistance("lessThanXSeconds",5,l):d<10?a.formatDistance("lessThanXSeconds",10,l):d<20?a.formatDistance("lessThanXSeconds",20,l):d<40?a.formatDistance("halfAMinute",0,l):d<60?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",1,l):h===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",h,l);if(h<45)return a.formatDistance("xMinutes",h,l);if(h<90)return a.formatDistance("aboutXHours",1,l);if(h<HT){const m=Math.round(h/60);return a.formatDistance("aboutXHours",m,l)}else{if(h<i)return a.formatDistance("xDays",1,l);if(h<Cp){const m=Math.round(h/HT);return a.formatDistance("xDays",m,l)}else if(h<Cp*2)return p=Math.round(h/Cp),a.formatDistance("aboutXMonths",p,l)}if(p=kne(u,c),p<12){const m=Math.round(h/Cp);return a.formatDistance("xMonths",m,l)}else{const m=p%12,g=Math.trunc(p/12);return m<3?a.formatDistance("aboutXYears",g,l):m<9?a.formatDistance("overXYears",g,l):a.formatDistance("almostXYears",g+1,l)}}function Nae(e,t){return kae(e,mne(e),t)}function Sae(){const[e,t]=S.useState(null),[r,n]=S.useState([]),[a,i]=S.useState(!0),[s,l]=S.useState(null),{selectedProject:c}=Ui(),u=B7();if(S.useEffect(()=>{(async()=>{i(!0),l(null);try{const p=c?`/api/stats?project=${encodeURIComponent(c)}`:"/api/stats",m=c?`/api/runs/?limit=5&project=${encodeURIComponent(c)}`:"/api/runs/?limit=5",[g,y]=await Promise.all([Ne(p),Ne(m)]);if(!g.ok)throw new Error(`Failed to fetch stats: ${g.statusText}`);if(!y.ok)throw new Error(`Failed to fetch runs: ${y.statusText}`);const x=await g.json(),v=await y.json();t(x),n(v.runs||[])}catch(p){console.error(p),l(p.message),u.error(`Failed to load dashboard: ${p.message}`)}finally{i(!1)}})()},[c]),a)return o.jsx("div",{className:"flex items-center justify-center h-96",children:o.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})});if(s)return o.jsx("div",{className:"flex items-center justify-center h-96",children:o.jsxs("div",{className:"text-center p-8 bg-red-50 dark:bg-red-900/20 rounded-2xl border border-red-100 dark:border-red-800 max-w-md",children:[o.jsx(kr,{className:"w-12 h-12 text-red-500 mx-auto mb-4"}),o.jsx("h3",{className:"text-lg font-bold text-red-700 dark:text-red-300 mb-2",children:"Failed to load dashboard"}),o.jsx("p",{className:"text-red-600 dark:text-red-400 mb-6",children:s}),o.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg shadow-sm hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors text-slate-700 dark:text-slate-300 font-medium",children:"Retry Connection"})]})});const d={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},f={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return o.jsxs(ge.div,{initial:"hidden",animate:"show",variants:d,className:"space-y-8",children:[o.jsxs(ge.div,{variants:f,className:"relative overflow-hidden bg-gradient-to-br from-primary-500 via-primary-600 to-purple-600 rounded-2xl p-8 text-white shadow-xl",children:[o.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-white/10 rounded-full -mr-32 -mt-32"}),o.jsx("div",{className:"absolute bottom-0 left-0 w-48 h-48 bg-white/10 rounded-full -ml-24 -mb-24"}),o.jsxs("div",{className:"relative z-10",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[o.jsx(hn,{size:32,className:"text-yellow-300"}),o.jsx("h1",{className:"text-4xl font-bold",children:"Welcome to flowyml"})]}),o.jsx("p",{className:"text-primary-100 text-lg max-w-2xl",children:"Your lightweight, artifact-centric ML orchestration platform. Build, run, and track your ML pipelines with ease."}),o.jsxs("div",{className:"mt-6 flex gap-3",children:[o.jsx(ft,{to:"/pipelines",children:o.jsx("button",{className:"px-6 py-2.5 bg-white text-primary-600 rounded-lg font-semibold hover:bg-primary-50 transition-colors shadow-lg",children:"View Pipelines"})}),o.jsx(ft,{to:"/runs",children:o.jsx("button",{className:"px-6 py-2.5 bg-primary-700/50 backdrop-blur-sm text-white rounded-lg font-semibold hover:bg-primary-700/70 transition-colors border border-white/20",children:"Recent Runs"})})]})]})]}),o.jsxs(ge.div,{variants:f,className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[o.jsx(Ap,{icon:o.jsx(Zr,{size:24}),label:"Total Pipelines",value:(e==null?void 0:e.pipelines)||0,trend:"+12%",color:"blue"}),o.jsx(Ap,{icon:o.jsx(Fe,{size:24}),label:"Pipeline Runs",value:(e==null?void 0:e.runs)||0,trend:"+23%",color:"purple"}),o.jsx(Ap,{icon:o.jsx(nr,{size:24}),label:"Artifacts",value:(e==null?void 0:e.artifacts)||0,trend:"+8%",color:"emerald"}),o.jsx(Ap,{icon:o.jsx(rr,{size:24}),label:"Success Rate",value:(e==null?void 0:e.runs)>0?`${Math.round(e.completed_runs/e.runs*100)}%`:"0%",trend:"+5%",color:"cyan"})]}),o.jsxs(ge.div,{variants:f,className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[o.jsxs("div",{className:"lg:col-span-2",children:[o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsxs("h3",{className:"text-xl font-bold text-slate-900 flex items-center gap-2",children:[o.jsx(ht,{className:"text-primary-500",size:24}),"Recent Runs"]}),o.jsxs(ft,{to:"/runs",className:"text-sm font-semibold text-primary-600 hover:text-primary-700 flex items-center gap-1",children:["View All ",o.jsx(Ai,{size:16})]})]}),o.jsx("div",{className:"space-y-3",children:r.length>0?r.map((h,p)=>o.jsx(_ae,{run:h,index:p},h.run_id)):o.jsxs(Te,{className:"p-12 text-center border-dashed",children:[o.jsx(Fe,{className:"mx-auto text-slate-300 mb-3",size:32}),o.jsx("p",{className:"text-slate-500",children:"No recent runs"})]})})]}),o.jsxs("div",{children:[o.jsxs("h3",{className:"text-xl font-bold text-slate-900 mb-6 flex items-center gap-2",children:[o.jsx(Hr,{className:"text-primary-500",size:24}),"Quick Stats"]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(Op,{label:"Completed Today",value:(e==null?void 0:e.completed_runs)||0,icon:o.jsx(rr,{size:18}),color:"emerald"}),o.jsx(Op,{label:"Failed Runs",value:(e==null?void 0:e.failed_runs)||0,icon:o.jsx(kr,{size:18}),color:"rose"}),o.jsx(Op,{label:"Avg Duration",value:e!=null&&e.avg_duration?`${e.avg_duration.toFixed(1)}s`:"0s",icon:o.jsx(ht,{size:18}),color:"blue"}),o.jsx(Op,{label:"Cache Hit Rate",value:"87%",icon:o.jsx(hn,{size:18}),color:"amber"})]})]})]})]})}function Ap({icon:e,label:t,value:r,trend:n,color:a}){const i={blue:"from-blue-500 to-cyan-500",purple:"from-purple-500 to-pink-500",emerald:"from-emerald-500 to-teal-500",cyan:"from-cyan-500 to-blue-500"};return o.jsxs(Te,{className:"relative overflow-hidden group hover:shadow-lg transition-all duration-200",children:[o.jsx("div",{className:`absolute inset-0 bg-gradient-to-br ${i[a]} opacity-0 group-hover:opacity-5 transition-opacity`}),o.jsxs("div",{className:"relative",children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsx("div",{className:`p-3 rounded-xl bg-gradient-to-br ${i[a]} text-white shadow-lg`,children:e}),o.jsx("span",{className:"text-xs font-semibold text-emerald-600 bg-emerald-50 px-2 py-1 rounded-full",children:n})]}),o.jsx("p",{className:"text-sm text-slate-500 font-medium mb-1",children:t}),o.jsx("p",{className:"text-3xl font-bold text-slate-900",children:r})]})]})}function _ae({run:e,index:t}){var a;const r={completed:{icon:o.jsx(rr,{size:16}),color:"text-emerald-500",bg:"bg-emerald-50"},failed:{icon:o.jsx(kr,{size:16}),color:"text-rose-500",bg:"bg-rose-50"},running:{icon:o.jsx(Fe,{size:16,className:"animate-pulse"}),color:"text-amber-500",bg:"bg-amber-50"}},n=r[e.status]||r.completed;return o.jsx(ge.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:t*.1},children:o.jsx(ft,{to:`/runs/${e.run_id}`,children:o.jsx(Te,{className:"group hover:shadow-md hover:border-primary-200 transition-all duration-200",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:`p-2 rounded-lg ${n.bg} ${n.color}`,children:n.icon}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h4",{className:"font-semibold text-slate-900 truncate group-hover:text-primary-600 transition-colors",children:e.pipeline_name}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-500 mt-0.5",children:[o.jsx("span",{className:"font-mono",children:((a=e.run_id)==null?void 0:a.substring(0,8))||"N/A"}),e.start_time&&o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"•"}),o.jsx("span",{children:Ft(new Date(e.start_time),"MMM d, HH:mm")})]})]})]}),o.jsx(qe,{variant:e.status==="completed"?"success":e.status==="failed"?"danger":"warning",className:"text-xs",children:e.status})]})})})})}function Op({label:e,value:t,icon:r,color:n}){const a={emerald:"bg-emerald-50 text-emerald-600",rose:"bg-rose-50 text-rose-600",blue:"bg-blue-50 text-blue-600",amber:"bg-amber-50 text-amber-600"};return o.jsx(Te,{className:"hover:shadow-md transition-shadow duration-200",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm text-slate-500 font-medium mb-1",children:e}),o.jsx("p",{className:"text-2xl font-bold text-slate-900",children:t})]}),o.jsx("div",{className:`p-2.5 rounded-lg ${a[n]}`,children:r})]})})}const Eae=({item:e,columns:t})=>o.jsx("tr",{className:"bg-white dark:bg-slate-800 hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors",children:t.map((r,n)=>o.jsx("td",{className:"px-6 py-4",children:r.render?r.render(e):e[r.key]},n))});function Uh({title:e,subtitle:t,actions:r,items:n=[],columns:a=[],renderGrid:i,renderList:s,searchPlaceholder:l="Search...",initialView:c="table",emptyState:u,loading:d=!1}){const[f,h]=S.useState(c),[p,m]=S.useState(""),[g,y]=S.useState({key:null,direction:"asc"}),x=Array.isArray(n)?n:[],v=Array.isArray(a)?a:[],j=i||(P=>o.jsx("div",{className:"p-4 bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700",children:o.jsx("pre",{className:"text-xs overflow-auto",children:JSON.stringify(P,null,2)})})),w=s||j,N=[...x.filter(P=>{if(!p)return!0;const C=p.toLowerCase();return Object.values(P).some(A=>String(A).toLowerCase().includes(C))})].sort((P,C)=>{if(!g.key)return 0;const A=P[g.key],O=C[g.key];return A<O?g.direction==="asc"?-1:1:A>O?g.direction==="asc"?1:-1:0}),_=P=>{y(C=>({key:P,direction:C.key===P&&C.direction==="asc"?"desc":"asc"}))};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:e}),t&&o.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-1",children:t})]}),r&&o.jsx("div",{className:"flex gap-2",children:r})]}),o.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-center justify-between bg-white dark:bg-slate-800 p-4 rounded-xl border border-slate-200 dark:border-slate-700 shadow-sm",children:[o.jsxs("div",{className:"relative w-full md:w-96",children:[o.jsx(Af,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400 w-4 h-4"}),o.jsx("input",{type:"text",placeholder:l,value:p,onChange:P=>m(P.target.value),className:"w-full pl-10 pr-4 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 text-sm text-slate-900 dark:text-white"})]}),o.jsx("div",{className:"flex items-center gap-2 w-full md:w-auto justify-end",children:o.jsxs("div",{className:"flex bg-slate-100 dark:bg-slate-900 p-1 rounded-lg border border-slate-200 dark:border-slate-700",children:[o.jsx("button",{onClick:()=>h("grid"),className:`p-2 rounded-md transition-all ${f==="grid"?"bg-white dark:bg-slate-800 shadow-sm text-primary-600":"text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,title:"Grid View",children:o.jsx(J8,{size:18})}),o.jsx("button",{onClick:()=>h("list"),className:`p-2 rounded-md transition-all ${f==="list"?"bg-white dark:bg-slate-800 shadow-sm text-primary-600":"text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,title:"List View",children:o.jsx(eF,{size:18})}),o.jsx("button",{onClick:()=>h("table"),className:`p-2 rounded-md transition-all ${f==="table"?"bg-white dark:bg-slate-800 shadow-sm text-primary-600":"text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,title:"Table View",children:o.jsx(Of,{size:18})})]})})]}),d?o.jsx("div",{className:"flex justify-center py-12",children:o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-500"})}):N.length===0?u||o.jsxs("div",{className:"text-center py-12 bg-slate-50 dark:bg-slate-800/50 rounded-xl border-2 border-dashed border-slate-200 dark:border-slate-700",children:[o.jsx("div",{className:"flex justify-center mb-4",children:o.jsx(Af,{className:"w-12 h-12 text-slate-300 dark:text-slate-600"})}),o.jsx("h3",{className:"text-lg font-medium text-slate-900 dark:text-white",children:"No items found"}),o.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-1",children:p?`No results matching "${p}"`:"Get started by creating a new item."})]}):o.jsxs("div",{className:"animate-in fade-in duration-300",children:[f==="grid"&&o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:N.map((P,C)=>o.jsx("div",{children:j(P)},C))}),f==="list"&&o.jsx("div",{className:"space-y-4",children:N.map((P,C)=>o.jsx("div",{children:w(P)},C))}),f==="table"&&o.jsx("div",{className:"bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm text-left",children:[o.jsx("thead",{className:"text-xs text-slate-500 uppercase bg-slate-50 dark:bg-slate-900/50 border-b border-slate-200 dark:border-slate-700",children:o.jsx("tr",{children:v.map((P,C)=>o.jsx("th",{className:"px-6 py-3 font-medium cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",onClick:()=>P.sortable&&_(P.key),children:o.jsxs("div",{className:"flex items-center gap-2",children:[P.header,P.sortable&&o.jsx(W8,{size:14,className:"text-slate-400"})]})},C))})}),o.jsx("tbody",{className:"divide-y divide-slate-200 dark:divide-slate-700",children:N.map((P,C)=>o.jsx(Eae,{item:P,columns:v},C))})]})})})]})]})}function Di(e,t="MMM d, yyyy"){if(!e)return"-";const r=new Date(e);return t9(r)?Ft(r,t):"-"}const Pae=({status:e})=>{switch(e==null?void 0:e.toLowerCase()){case"completed":case"success":return o.jsx(rr,{className:"w-3.5 h-3.5 text-emerald-500"});case"failed":return o.jsx(kr,{className:"w-3.5 h-3.5 text-rose-500"});case"running":return o.jsx(Fe,{className:"w-3.5 h-3.5 text-amber-500 animate-spin"});default:return o.jsx(ht,{className:"w-3.5 h-3.5 text-slate-400"})}},Tl=({label:e,icon:t,children:r,defaultExpanded:n=!1,actions:a,status:i,level:s=0,badge:l,onClick:c,isActive:u=!1,subLabel:d,checkable:f=!1,checked:h=!1,onCheck:p})=>{const[m,g]=S.useState(n),y=r&&r.length>0;return o.jsxs("div",{className:"select-none",children:[o.jsxs(ge.div,{initial:!1,animate:{backgroundColor:u?"rgba(59, 130, 246, 0.1)":"transparent"},className:`
622
+ group flex items-center gap-2 px-2 py-1.5 rounded-lg cursor-pointer transition-all
623
+ hover:bg-slate-100 dark:hover:bg-slate-800
624
+ ${u?"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400":"text-slate-700 dark:text-slate-300"}
625
+ ${s===0?"mb-0.5":""}
626
+ `,style:{paddingLeft:`${s*1.25+.5}rem`},onClick:x=>{x.stopPropagation(),y&&g(!m),c==null||c()},children:[f&&o.jsx("div",{className:"shrink-0 mr-1",onClick:x=>x.stopPropagation(),children:o.jsx("input",{type:"checkbox",checked:h,onChange:x=>p==null?void 0:p(x.target.checked),className:"w-4 h-4 rounded border-slate-300 text-primary-600 focus:ring-primary-500 cursor-pointer accent-blue-600"})}),o.jsx("div",{className:"flex items-center gap-1 text-slate-400 shrink-0",children:y?o.jsx(ge.div,{animate:{rotate:m?90:0},transition:{duration:.2},children:o.jsx(na,{className:"w-3.5 h-3.5"})}):o.jsx("div",{className:"w-3.5"})}),t&&o.jsx(t,{className:`w-4 h-4 shrink-0 ${u?"text-blue-500":"text-slate-400 group-hover:text-slate-500 dark:text-slate-500 dark:group-hover:text-slate-400"}`}),o.jsxs("div",{className:"flex-1 flex items-center justify-between gap-2 min-w-0 overflow-hidden",children:[o.jsxs("div",{className:"flex flex-col min-w-0",children:[o.jsx("span",{className:`text-sm truncate ${u?"font-medium":""}`,children:e}),d&&o.jsx("span",{className:"text-[10px] text-slate-400 truncate",children:d})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l,i&&o.jsx(Pae,{status:i}),a]})]})]}),o.jsx(Zt,{initial:!1,children:m&&y&&o.jsx(ge.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2},children:r})})]})};function aP({projectId:e,onSelect:t,selectedId:r,mode:n="experiments",className:a="",selectionMode:i="single",selectedIds:s=[],onMultiSelect:l}){const[c,u]=S.useState({projects:[],items:[]}),[d,f]=S.useState(!0),[h,p]=S.useState(null),[m,g]=S.useState("");if(S.useEffect(()=>{(async()=>{f(!0),p(null);try{let w="",k="";switch(n){case"experiments":w=e?`/api/experiments/?project=${encodeURIComponent(e)}`:"/api/experiments/",k="experiments";break;case"pipelines":w=e?`/api/pipelines/?project=${encodeURIComponent(e)}`:"/api/pipelines/",k="pipelines";break;case"runs":w=e?`/api/runs/?project=${encodeURIComponent(e)}&limit=100`:"/api/runs/?limit=100",k="runs";break;default:break}const N=await Ne(w);if(!N.ok)throw new Error(`Failed to fetch ${n}: ${N.statusText}`);const _=await N.json();let P=[];if(!e){const C=_[k]||[];P=[...new Set(C.map(O=>O.project).filter(Boolean))].map(O=>({name:O}))}u({projects:P,items:_[k]||[]})}catch(w){console.error("Failed to fetch navigation data:",w),p(w.message)}finally{f(!1)}})()},[e,n]),d)return o.jsx("div",{className:`p-4 ${a}`,children:o.jsx("div",{className:"animate-pulse space-y-3",children:[1,2,3,4,5].map(j=>o.jsx("div",{className:"h-8 bg-slate-100 dark:bg-slate-800 rounded-lg"},j))})});if(h)return o.jsx("div",{className:`p-4 text-center ${a}`,children:o.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg border border-red-100 dark:border-red-800",children:[o.jsx(kr,{className:"w-8 h-8 text-red-500 mx-auto mb-2"}),o.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 font-medium",children:"Failed to load data"}),o.jsx("p",{className:"text-xs text-red-500 dark:text-red-500/80 mt-1",children:h}),o.jsx("button",{onClick:()=>window.location.reload(),className:"mt-3 text-xs bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 px-3 py-1.5 rounded-md hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors",children:"Retry"})]})});const y=c.items.filter(j=>(j.name||j.run_id||"").toLowerCase().includes(m.toLowerCase())),x=()=>{const j=(w,k)=>o.jsx(Tl,{label:w.name,icon:Xn,level:k,isActive:r===w.experiment_id,onClick:()=>t==null?void 0:t(w),checkable:i==="multi",checked:s==null?void 0:s.includes(w.experiment_id),onCheck:N=>l==null?void 0:l(w.experiment_id,N),badge:o.jsx("span",{className:"text-[10px] bg-slate-100 dark:bg-slate-800 text-slate-500 px-1.5 py-0.5 rounded-full",children:w.run_count||0})},w.experiment_id);return e||c.projects.length===0?y.map(w=>j(w,0)):c.projects.map(w=>{const k=y.filter(N=>N.project===w.name);return k.length===0?null:o.jsx(Tl,{label:w.name,icon:Zn,level:0,defaultExpanded:!0,badge:o.jsx("span",{className:"text-xs text-slate-400",children:k.length}),children:k.map(N=>j(N,1))},w.name)})},v=()=>{const j=(w,k)=>o.jsx(Tl,{label:w.name,icon:Zr,level:k,isActive:r===w.name,onClick:()=>t==null?void 0:t(w),badge:o.jsxs("span",{className:"text-[10px] bg-slate-100 dark:bg-slate-800 text-slate-500 px-1.5 py-0.5 rounded-full",children:["v",w.version||"1"]})},w.name);return e||c.projects.length===0?y.map(w=>j(w,0)):c.projects.map(w=>{const k=y.filter(N=>N.project===w.name);return k.length===0?null:o.jsx(Tl,{label:w.name,icon:Zn,level:0,defaultExpanded:!0,children:k.map(N=>j(N,1))},w.name)})},b=()=>{const j=(k,N)=>o.jsx(Tl,{label:k.name||k.run_id.slice(0,8),subLabel:Di(k.created||k.start_time),icon:fn,level:N,status:k.status,isActive:r===k.run_id,onClick:()=>t==null?void 0:t(k),checkable:i==="multi",checked:s==null?void 0:s.includes(k.run_id),onCheck:_=>l==null?void 0:l(k.run_id,_)},k.run_id);return[...new Set(y.map(k=>k.pipeline_name).filter(Boolean))].map(k=>{const N=y.filter(_=>_.pipeline_name===k);return o.jsx(Tl,{label:k,icon:Fe,level:0,defaultExpanded:!0,badge:o.jsx("span",{className:"text-xs text-slate-400",children:N.length}),children:N.map(_=>j(_,1))},k)})};return o.jsxs("div",{className:`flex flex-col h-full bg-slate-50/50 dark:bg-slate-900/50 ${a}`,children:[o.jsx("div",{className:"p-2 sticky top-0 bg-inherit z-10",children:o.jsxs("div",{className:"relative",children:[o.jsx(Af,{className:"absolute left-2.5 top-2.5 w-4 h-4 text-slate-400"}),o.jsx("input",{type:"text",placeholder:`Search ${n}...`,value:m,onChange:j=>g(j.target.value),className:"w-full pl-9 pr-3 py-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500"})]})}),o.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-0.5",children:y.length===0?o.jsxs("div",{className:"text-center py-8 text-slate-400 text-sm",children:["No ",n," found"]}):o.jsxs(o.Fragment,{children:[n==="experiments"&&x(),n==="pipelines"&&v(),n==="runs"&&b()]})})]})}function lx({currentProject:e,onUpdate:t,type:r="default"}){const[n,a]=S.useState([]),[i,s]=S.useState(!1),[l,c]=S.useState(!1);S.useEffect(()=>{i&&n.length===0&&u()},[i]);const u=async()=>{c(!0);try{const h=await(await Ne("/api/projects/")).json();a(h.projects||[])}catch(f){console.error("Failed to fetch projects:",f)}finally{c(!1)}},d=async f=>{if(f===e){s(!1);return}await t(f),s(!1)};return o.jsxs("div",{className:"relative",children:[o.jsxs("button",{onClick:()=>s(!i),className:`
627
+ flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-all
628
+ ${e?"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 hover:bg-blue-100 dark:hover:bg-blue-900/30":"bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-400 hover:bg-slate-200 dark:hover:bg-slate-700"}
629
+ `,children:[o.jsx(Zn,{size:14}),o.jsx("span",{children:e||"Assign Project"}),o.jsx(yE,{size:12,className:`transition-transform ${i?"rotate-180":""}`})]}),o.jsx(Zt,{children:i&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>s(!1)}),o.jsxs(ge.div,{initial:{opacity:0,y:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:5,scale:.95},transition:{duration:.1},className:"absolute top-full left-0 mt-2 w-56 bg-white dark:bg-slate-800 rounded-xl shadow-xl border border-slate-200 dark:border-slate-700 z-50 overflow-hidden",children:[o.jsx("div",{className:"p-2 border-b border-slate-100 dark:border-slate-700 bg-slate-50 dark:bg-slate-800/50",children:o.jsx("span",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider px-2",children:"Select Project"})}),o.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:l?o.jsx("div",{className:"p-4 text-center text-slate-400 text-xs",children:"Loading..."}):o.jsxs(o.Fragment,{children:[n.map(f=>o.jsxs("button",{onClick:()=>d(f.name),className:`
630
+ w-full flex items-center justify-between px-3 py-2 rounded-lg text-sm transition-colors
631
+ ${e===f.name?"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300":"text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700"}
632
+ `,children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Zn,{size:14}),o.jsx("span",{className:"truncate max-w-[140px]",children:f.name})]}),e===f.name&&o.jsx(Ef,{size:14})]},f.name)),n.length===0&&o.jsx("div",{className:"p-3 text-center text-slate-400 text-xs",children:"No projects found"})]})})]})]})})]})}function Cae({pipeline:e,onClose:t,onProjectUpdate:r}){const[n,a]=S.useState([]),[i,s]=S.useState(!1),[l,c]=S.useState(e==null?void 0:e.project),u=B7();S.useEffect(()=>{e&&(d(),c(e.project))},[e]);const d=async()=>{s(!0);try{const m=`/api/runs?pipeline=${encodeURIComponent(e.name)}&limit=50`,y=await(await Ne(m)).json();a(y.runs||[])}catch(m){console.error("Failed to fetch runs:",m),u.error(`Failed to load pipeline runs: ${m.message}`)}finally{s(!1)}},f=async m=>{try{await Ne(`/api/pipelines/${e.name}/project`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_name:m})}),c(m),u.success(`Pipeline assigned to project: ${m}`),r&&r()}catch(g){console.error("Failed to update project:",g),u.error(`Failed to update project: ${g.message}`)}};if(!e)return null;const h={total:n.length,success:n.filter(m=>m.status==="completed").length,failed:n.filter(m=>m.status==="failed").length,avgDuration:n.length>0?n.reduce((m,g)=>m+(g.duration||0),0)/n.length:0},p=h.total>0?h.success/h.total*100:0;return o.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-slate-900",children:[o.jsxs("div",{className:"p-6 border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50",children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"p-3 bg-gradient-to-br from-primary-500 to-purple-500 rounded-xl text-white shadow-lg",children:o.jsx(Zr,{size:24})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:e.name}),o.jsxs("div",{className:"flex items-center gap-2 mt-1 text-sm text-slate-500",children:[o.jsx(lx,{currentProject:l,onUpdate:f}),e.version&&o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"•"}),o.jsxs(qe,{variant:"secondary",className:"text-xs",children:["v",e.version]})]})]})]})]}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(fe,{variant:"ghost",size:"sm",onClick:t,children:o.jsx(Tn,{size:20,className:"text-slate-400"})})})]}),o.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[o.jsx(Tp,{label:"Total Runs",value:h.total,icon:Fe,color:"blue"}),o.jsx(Tp,{label:"Success Rate",value:`${Math.round(p)}%`,icon:rr,color:p>=80?"emerald":p>=50?"amber":"rose"}),o.jsx(Tp,{label:"Avg Duration",value:`${h.avgDuration.toFixed(1)}s`,icon:ht,color:"purple"}),o.jsx(Tp,{label:"Failed",value:h.failed,icon:kr,color:"rose"})]})]}),o.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[o.jsxs("div",{className:"p-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between bg-white dark:bg-slate-900",children:[o.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(fn,{size:18,className:"text-slate-400"}),"Recent Executions"]}),o.jsx(ft,{to:`/runs?pipeline=${encodeURIComponent(e.name)}`,children:o.jsxs(fe,{variant:"ghost",size:"sm",className:"text-primary-600",children:["View All Runs ",o.jsx(Ai,{size:16,className:"ml-1"})]})})]}),o.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-slate-50 dark:bg-slate-900/50",children:i?o.jsx("div",{className:"flex justify-center py-8",children:o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):n.length===0?o.jsx("div",{className:"text-center py-12 text-slate-500",children:"No runs found for this pipeline"}):n.map(m=>o.jsx(ft,{to:`/runs/${m.run_id}`,children:o.jsx(ge.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"bg-white dark:bg-slate-800 p-4 rounded-xl border border-slate-200 dark:border-slate-700 hover:shadow-md hover:border-primary-300 dark:hover:border-primary-700 transition-all group",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(qc,{status:m.status}),o.jsxs("div",{children:[o.jsxs("div",{className:"font-medium text-slate-900 dark:text-white flex items-center gap-2",children:[m.name||`Run ${m.run_id.slice(0,8)}`,o.jsxs("span",{className:"text-xs font-mono text-slate-400",children:["#",m.run_id.slice(0,6)]})]}),o.jsxs("div",{className:"flex items-center gap-3 text-xs text-slate-500 mt-1",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(_a,{size:12}),Ft(new Date(m.created||m.start_time),"MMM d, HH:mm")]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(ht,{size:12}),m.duration?`${m.duration.toFixed(1)}s`:"-"]})]})]})]}),o.jsx(Ai,{size:16,className:"text-slate-300 group-hover:text-primary-500 transition-colors"})]})})},m.run_id))})]})]})}function Tp({label:e,value:t,icon:r,color:n}){const a={blue:"text-blue-600 bg-blue-50 dark:bg-blue-900/20",emerald:"text-emerald-600 bg-emerald-50 dark:bg-emerald-900/20",purple:"text-purple-600 bg-purple-50 dark:bg-purple-900/20",rose:"text-rose-600 bg-rose-50 dark:bg-rose-900/20",amber:"text-amber-600 bg-amber-50 dark:bg-amber-900/20"};return o.jsxs("div",{className:"bg-white dark:bg-slate-800 p-3 rounded-xl border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("div",{className:`p-1 rounded-lg ${a[n]||a.blue}`,children:o.jsx(r,{size:14})}),o.jsx("span",{className:"text-xs text-slate-500 font-medium",children:e})]}),o.jsx("div",{className:"text-lg font-bold text-slate-900 dark:text-white pl-1",children:t})]})}function Aae(){const[e,t]=S.useState([]),[r,n]=S.useState(!0),[a,i]=S.useState(null),[s,l]=S.useState(null),{selectedProject:c}=Ui(),u=async()=>{n(!0),i(null);try{const f=c?`/api/pipelines/?project=${encodeURIComponent(c)}`:"/api/pipelines/",h=await Ne(f);if(!h.ok)throw new Error(`Failed to fetch pipelines: ${h.statusText}`);const p=await h.json();t(p.pipelines||[])}catch(f){console.error(f),i(f.message)}finally{n(!1)}};S.useEffect(()=>{u()},[c]);const d=f=>{l(f)};return a?o.jsx("div",{className:"flex items-center justify-center h-screen bg-slate-50 dark:bg-slate-900",children:o.jsxs("div",{className:"text-center p-8 bg-red-50 dark:bg-red-900/20 rounded-2xl border border-red-100 dark:border-red-800 max-w-md",children:[o.jsx(kr,{className:"w-12 h-12 text-red-500 mx-auto mb-4"}),o.jsx("h3",{className:"text-lg font-bold text-red-700 dark:text-red-300 mb-2",children:"Failed to load pipelines"}),o.jsx("p",{className:"text-red-600 dark:text-red-400 mb-6",children:a}),o.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg shadow-sm hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors text-slate-700 dark:text-slate-300 font-medium",children:"Retry Connection"})]})}):o.jsxs("div",{className:"h-screen flex flex-col overflow-hidden bg-slate-50 dark:bg-slate-900",children:[o.jsx("div",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4 shrink-0",children:o.jsx("div",{className:"flex items-center justify-between max-w-[1800px] mx-auto",children:o.jsxs("div",{children:[o.jsxs("h1",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(Zr,{className:"text-primary-500"}),"Pipelines"]}),o.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:"View and manage your ML pipelines"})]})})}),o.jsx("div",{className:"flex-1 overflow-hidden",children:o.jsx("div",{className:"h-full max-w-[1800px] mx-auto px-6 py-6",children:o.jsxs("div",{className:"h-full flex gap-6",children:[o.jsxs("div",{className:"w-[320px] shrink-0 flex flex-col bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:[o.jsx("div",{className:"p-3 border-b border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50",children:o.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Explorer"})}),o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(aP,{mode:"pipelines",projectId:c,onSelect:d,selectedId:s==null?void 0:s.name})})]}),o.jsx("div",{className:"flex-1 min-w-0 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:s?o.jsx(Cae,{pipeline:s,onClose:()=>l(null),onProjectUpdate:u}):o.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center p-8 bg-slate-50/50 dark:bg-slate-900/50",children:[o.jsx("div",{className:"w-20 h-20 bg-primary-100 dark:bg-primary-900/30 rounded-full flex items-center justify-center mb-6 animate-pulse",children:o.jsx(Zr,{size:40,className:"text-primary-500"})}),o.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-2",children:"Select a Pipeline"}),o.jsx("p",{className:"text-slate-500 max-w-md",children:"Choose a pipeline from the sidebar to view execution history and statistics."})]})})]})})})]})}function Dr(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,n;r<e.length;r++)(n=Dr(e[r]))!==""&&(t+=(t&&" ")+n);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var i9={exports:{}},s9={},o9={exports:{}},l9={};/**
633
+ * @license React
634
+ * use-sync-external-store-shim.production.js
635
+ *
636
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
637
+ *
638
+ * This source code is licensed under the MIT license found in the
639
+ * LICENSE file in the root directory of this source tree.
640
+ */var Uc=S;function Oae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tae=typeof Object.is=="function"?Object.is:Oae,Mae=Uc.useState,Rae=Uc.useEffect,Dae=Uc.useLayoutEffect,$ae=Uc.useDebugValue;function Iae(e,t){var r=t(),n=Mae({inst:{value:r,getSnapshot:t}}),a=n[0].inst,i=n[1];return Dae(function(){a.value=r,a.getSnapshot=t,xv(a)&&i({inst:a})},[e,r,t]),Rae(function(){return xv(a)&&i({inst:a}),e(function(){xv(a)&&i({inst:a})})},[e]),$ae(r),r}function xv(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Tae(e,r)}catch{return!0}}function Lae(e,t){return t()}var zae=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Lae:Iae;l9.useSyncExternalStore=Uc.useSyncExternalStore!==void 0?Uc.useSyncExternalStore:zae;o9.exports=l9;var Fae=o9.exports;/**
641
+ * @license React
642
+ * use-sync-external-store-shim/with-selector.production.js
643
+ *
644
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
645
+ *
646
+ * This source code is licensed under the MIT license found in the
647
+ * LICENSE file in the root directory of this source tree.
648
+ */var cx=S,Bae=Fae;function Vae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qae=typeof Object.is=="function"?Object.is:Vae,Uae=Bae.useSyncExternalStore,Hae=cx.useRef,Wae=cx.useEffect,Gae=cx.useMemo,Kae=cx.useDebugValue;s9.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var i=Hae(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=Gae(function(){function c(p){if(!u){if(u=!0,d=p,p=n(p),a!==void 0&&s.hasValue){var m=s.value;if(a(m,p))return f=m}return f=p}if(m=f,qae(d,p))return m;var g=n(p);return a!==void 0&&a(m,g)?(d=p,m):(d=p,f=g)}var u=!1,d,f,h=r===void 0?null:r;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,r,n,a]);var l=Uae(e,i[0],i[1]);return Wae(function(){s.hasValue=!0,s.value=l},[l]),Kae(l),l};i9.exports=s9;var Yae=i9.exports;const Xae=lt(Yae),Zae={},QT=e=>{let t;const r=new Set,n=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),r.forEach(m=>m(t,p))}},a=()=>t,c={setState:n,getState:a,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(Zae?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,a,c);return c},Qae=e=>e?QT(e):QT,{useDebugValue:Jae}=M,{useSyncExternalStoreWithSelector:eie}=Xae,tie=e=>e;function c9(e,t=tie,r){const n=eie(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return Jae(n),n}const JT=(e,t)=>{const r=Qae(e),n=(a,i=t)=>c9(r,a,i);return Object.assign(n,r),n},rie=(e,t)=>e?JT(e,t):JT;function Sr(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,a]of e)if(!Object.is(a,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||!Object.is(e[n],t[n]))return!1;return!0}var nie={value:()=>{}};function ux(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Tm(r)}function Tm(e){this._=e}function aie(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",a=r.indexOf(".");if(a>=0&&(n=r.slice(a+1),r=r.slice(0,a)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}Tm.prototype=ux.prototype={constructor:Tm,on:function(e,t){var r=this._,n=aie(e+"",r),a,i=-1,s=n.length;if(arguments.length<2){for(;++i<s;)if((a=(e=n[i]).type)&&(a=iie(r[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(a=(e=n[i]).type)r[a]=eM(r[a],e.name,t);else if(t==null)for(a in r)r[a]=eM(r[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Tm(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var r=new Array(a),n=0,a,i;n<a;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],n=0,a=i.length;n<a;++n)i[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],a=0,i=n.length;a<i;++a)n[a].value.apply(t,r)}};function iie(e,t){for(var r=0,n=e.length,a;r<n;++r)if((a=e[r]).name===t)return a.value}function eM(e,t,r){for(var n=0,a=e.length;n<a;++n)if(e[n].name===t){e[n]=nie,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var kN="http://www.w3.org/1999/xhtml";const tM={svg:"http://www.w3.org/2000/svg",xhtml:kN,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function dx(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),tM.hasOwnProperty(t)?{space:tM[t],local:e}:e}function sie(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===kN&&t.documentElement.namespaceURI===kN?t.createElement(e):t.createElementNS(r,e)}}function oie(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function u9(e){var t=dx(e);return(t.local?oie:sie)(t)}function lie(){}function iP(e){return e==null?lie:function(){return this.querySelector(e)}}function cie(e){typeof e!="function"&&(e=iP(e));for(var t=this._groups,r=t.length,n=new Array(r),a=0;a<r;++a)for(var i=t[a],s=i.length,l=n[a]=new Array(s),c,u,d=0;d<s;++d)(c=i[d])&&(u=e.call(c,c.__data__,d,i))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new Cn(n,this._parents)}function uie(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function die(){return[]}function d9(e){return e==null?die:function(){return this.querySelectorAll(e)}}function fie(e){return function(){return uie(e.apply(this,arguments))}}function hie(e){typeof e=="function"?e=fie(e):e=d9(e);for(var t=this._groups,r=t.length,n=[],a=[],i=0;i<r;++i)for(var s=t[i],l=s.length,c,u=0;u<l;++u)(c=s[u])&&(n.push(e.call(c,c.__data__,u,s)),a.push(c));return new Cn(n,a)}function f9(e){return function(){return this.matches(e)}}function h9(e){return function(t){return t.matches(e)}}var pie=Array.prototype.find;function mie(e){return function(){return pie.call(this.children,e)}}function gie(){return this.firstElementChild}function xie(e){return this.select(e==null?gie:mie(typeof e=="function"?e:h9(e)))}var yie=Array.prototype.filter;function vie(){return Array.from(this.children)}function bie(e){return function(){return yie.call(this.children,e)}}function wie(e){return this.selectAll(e==null?vie:bie(typeof e=="function"?e:h9(e)))}function jie(e){typeof e!="function"&&(e=f9(e));for(var t=this._groups,r=t.length,n=new Array(r),a=0;a<r;++a)for(var i=t[a],s=i.length,l=n[a]=[],c,u=0;u<s;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new Cn(n,this._parents)}function p9(e){return new Array(e.length)}function kie(){return new Cn(this._enter||this._groups.map(p9),this._parents)}function S0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}S0.prototype={constructor:S0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Nie(e){return function(){return e}}function Sie(e,t,r,n,a,i){for(var s=0,l,c=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],n[s]=l):r[s]=new S0(e,i[s]);for(;s<c;++s)(l=t[s])&&(a[s]=l)}function _ie(e,t,r,n,a,i,s){var l,c,u=new Map,d=t.length,f=i.length,h=new Array(d),p;for(l=0;l<d;++l)(c=t[l])&&(h[l]=p=s.call(c,c.__data__,l,t)+"",u.has(p)?a[l]=c:u.set(p,c));for(l=0;l<f;++l)p=s.call(e,i[l],l,i)+"",(c=u.get(p))?(n[l]=c,c.__data__=i[l],u.delete(p)):r[l]=new S0(e,i[l]);for(l=0;l<d;++l)(c=t[l])&&u.get(h[l])===c&&(a[l]=c)}function Eie(e){return e.__data__}function Pie(e,t){if(!arguments.length)return Array.from(this,Eie);var r=t?_ie:Sie,n=this._parents,a=this._groups;typeof e!="function"&&(e=Nie(e));for(var i=a.length,s=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var d=n[u],f=a[u],h=f.length,p=Cie(e.call(d,d&&d.__data__,u,n)),m=p.length,g=l[u]=new Array(m),y=s[u]=new Array(m),x=c[u]=new Array(h);r(d,f,g,y,x,p,t);for(var v=0,b=0,j,w;v<m;++v)if(j=g[v]){for(v>=b&&(b=v+1);!(w=y[b])&&++b<m;);j._next=w||null}}return s=new Cn(s,n),s._enter=l,s._exit=c,s}function Cie(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Aie(){return new Cn(this._exit||this._groups.map(p9),this._parents)}function Oie(e,t,r){var n=this.enter(),a=this,i=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),r==null?i.remove():r(i),n&&a?n.merge(a).order():a}function Tie(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,a=r.length,i=n.length,s=Math.min(a,i),l=new Array(a),c=0;c<s;++c)for(var u=r[c],d=n[c],f=u.length,h=l[c]=new Array(f),p,m=0;m<f;++m)(p=u[m]||d[m])&&(h[m]=p);for(;c<a;++c)l[c]=r[c];return new Cn(l,this._parents)}function Mie(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],a=n.length-1,i=n[a],s;--a>=0;)(s=n[a])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Rie(e){e||(e=Die);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var r=this._groups,n=r.length,a=new Array(n),i=0;i<n;++i){for(var s=r[i],l=s.length,c=a[i]=new Array(l),u,d=0;d<l;++d)(u=s[d])&&(c[d]=u);c.sort(t)}return new Cn(a,this._parents).order()}function Die(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function $ie(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Iie(){return Array.from(this)}function Lie(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],a=0,i=n.length;a<i;++a){var s=n[a];if(s)return s}return null}function zie(){let e=0;for(const t of this)++e;return e}function Fie(){return!this.node()}function Bie(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var a=t[r],i=0,s=a.length,l;i<s;++i)(l=a[i])&&e.call(l,l.__data__,i,a);return this}function Vie(e){return function(){this.removeAttribute(e)}}function qie(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Uie(e,t){return function(){this.setAttribute(e,t)}}function Hie(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Wie(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Gie(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function Kie(e,t){var r=dx(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?qie:Vie:typeof t=="function"?r.local?Gie:Wie:r.local?Hie:Uie)(r,t))}function m9(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Yie(e){return function(){this.style.removeProperty(e)}}function Xie(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Zie(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function Qie(e,t,r){return arguments.length>1?this.each((t==null?Yie:typeof t=="function"?Zie:Xie)(e,t,r??"")):Hc(this.node(),e)}function Hc(e,t){return e.style.getPropertyValue(t)||m9(e).getComputedStyle(e,null).getPropertyValue(t)}function Jie(e){return function(){delete this[e]}}function ese(e,t){return function(){this[e]=t}}function tse(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function rse(e,t){return arguments.length>1?this.each((t==null?Jie:typeof t=="function"?tse:ese)(e,t)):this.node()[e]}function g9(e){return e.trim().split(/^|\s+/)}function sP(e){return e.classList||new x9(e)}function x9(e){this._node=e,this._names=g9(e.getAttribute("class")||"")}x9.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function y9(e,t){for(var r=sP(e),n=-1,a=t.length;++n<a;)r.add(t[n])}function v9(e,t){for(var r=sP(e),n=-1,a=t.length;++n<a;)r.remove(t[n])}function nse(e){return function(){y9(this,e)}}function ase(e){return function(){v9(this,e)}}function ise(e,t){return function(){(t.apply(this,arguments)?y9:v9)(this,e)}}function sse(e,t){var r=g9(e+"");if(arguments.length<2){for(var n=sP(this.node()),a=-1,i=r.length;++a<i;)if(!n.contains(r[a]))return!1;return!0}return this.each((typeof t=="function"?ise:t?nse:ase)(r,t))}function ose(){this.textContent=""}function lse(e){return function(){this.textContent=e}}function cse(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function use(e){return arguments.length?this.each(e==null?ose:(typeof e=="function"?cse:lse)(e)):this.node().textContent}function dse(){this.innerHTML=""}function fse(e){return function(){this.innerHTML=e}}function hse(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function pse(e){return arguments.length?this.each(e==null?dse:(typeof e=="function"?hse:fse)(e)):this.node().innerHTML}function mse(){this.nextSibling&&this.parentNode.appendChild(this)}function gse(){return this.each(mse)}function xse(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function yse(){return this.each(xse)}function vse(e){var t=typeof e=="function"?e:u9(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function bse(){return null}function wse(e,t){var r=typeof e=="function"?e:u9(e),n=t==null?bse:typeof t=="function"?t:iP(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function jse(){var e=this.parentNode;e&&e.removeChild(this)}function kse(){return this.each(jse)}function Nse(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Sse(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function _se(e){return this.select(e?Sse:Nse)}function Ese(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Pse(e){return function(t){e.call(this,t,this.__data__)}}function Cse(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function Ase(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,a=t.length,i;r<a;++r)i=t[r],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++n]=i;++n?t.length=n:delete this.__on}}}function Ose(e,t,r){return function(){var n=this.__on,a,i=Pse(t);if(n){for(var s=0,l=n.length;s<l;++s)if((a=n[s]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=r),a.value=t;return}}this.addEventListener(e.type,i,r),a={type:e.type,name:e.name,value:t,listener:i,options:r},n?n.push(a):this.__on=[a]}}function Tse(e,t,r){var n=Cse(e+""),a,i=n.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,d;c<u;++c)for(a=0,d=l[c];a<i;++a)if((s=n[a]).type===d.type&&s.name===d.name)return d.value}return}for(l=t?Ose:Ase,a=0;a<i;++a)this.each(l(n[a],t,r));return this}function b9(e,t,r){var n=m9(e),a=n.CustomEvent;typeof a=="function"?a=new a(t,r):(a=n.document.createEvent("Event"),r?(a.initEvent(t,r.bubbles,r.cancelable),a.detail=r.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function Mse(e,t){return function(){return b9(this,e,t)}}function Rse(e,t){return function(){return b9(this,e,t.apply(this,arguments))}}function Dse(e,t){return this.each((typeof t=="function"?Rse:Mse)(e,t))}function*$se(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],a=0,i=n.length,s;a<i;++a)(s=n[a])&&(yield s)}var w9=[null];function Cn(e,t){this._groups=e,this._parents=t}function Hh(){return new Cn([[document.documentElement]],w9)}function Ise(){return this}Cn.prototype=Hh.prototype={constructor:Cn,select:cie,selectAll:hie,selectChild:xie,selectChildren:wie,filter:jie,data:Pie,enter:kie,exit:Aie,join:Oie,merge:Tie,selection:Ise,order:Mie,sort:Rie,call:$ie,nodes:Iie,node:Lie,size:zie,empty:Fie,each:Bie,attr:Kie,style:Qie,property:rse,classed:sse,text:use,html:pse,raise:gse,lower:yse,append:vse,insert:wse,remove:kse,clone:_se,datum:Ese,on:Tse,dispatch:Dse,[Symbol.iterator]:$se};function Un(e){return typeof e=="string"?new Cn([[document.querySelector(e)]],[document.documentElement]):new Cn([[e]],w9)}function Lse(e){let t;for(;t=e.sourceEvent;)e=t;return e}function xa(e,t){if(e=Lse(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const zse={passive:!1},Ff={capture:!0,passive:!1};function yv(e){e.stopImmediatePropagation()}function kc(e){e.preventDefault(),e.stopImmediatePropagation()}function j9(e){var t=e.document.documentElement,r=Un(e).on("dragstart.drag",kc,Ff);"onselectstart"in t?r.on("selectstart.drag",kc,Ff):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function k9(e,t){var r=e.document.documentElement,n=Un(e).on("dragstart.drag",null);t&&(n.on("click.drag",kc,Ff),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Mp=e=>()=>e;function NN(e,{sourceEvent:t,subject:r,target:n,identifier:a,active:i,x:s,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}NN.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Fse(e){return!e.ctrlKey&&!e.button}function Bse(){return this.parentNode}function Vse(e,t){return t??{x:e.x,y:e.y}}function qse(){return navigator.maxTouchPoints||"ontouchstart"in this}function Use(){var e=Fse,t=Bse,r=Vse,n=qse,a={},i=ux("start","drag","end"),s=0,l,c,u,d,f=0;function h(j){j.on("mousedown.drag",p).filter(n).on("touchstart.drag",y).on("touchmove.drag",x,zse).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(j,w){if(!(d||!e.call(this,j,w))){var k=b(this,t.call(this,j,w),j,w,"mouse");k&&(Un(j.view).on("mousemove.drag",m,Ff).on("mouseup.drag",g,Ff),j9(j.view),yv(j),u=!1,l=j.clientX,c=j.clientY,k("start",j))}}function m(j){if(kc(j),!u){var w=j.clientX-l,k=j.clientY-c;u=w*w+k*k>f}a.mouse("drag",j)}function g(j){Un(j.view).on("mousemove.drag mouseup.drag",null),k9(j.view,u),kc(j),a.mouse("end",j)}function y(j,w){if(e.call(this,j,w)){var k=j.changedTouches,N=t.call(this,j,w),_=k.length,P,C;for(P=0;P<_;++P)(C=b(this,N,j,w,k[P].identifier,k[P]))&&(yv(j),C("start",j,k[P]))}}function x(j){var w=j.changedTouches,k=w.length,N,_;for(N=0;N<k;++N)(_=a[w[N].identifier])&&(kc(j),_("drag",j,w[N]))}function v(j){var w=j.changedTouches,k=w.length,N,_;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),N=0;N<k;++N)(_=a[w[N].identifier])&&(yv(j),_("end",j,w[N]))}function b(j,w,k,N,_,P){var C=i.copy(),A=xa(P||k,w),O,T,E;if((E=r.call(j,new NN("beforestart",{sourceEvent:k,target:h,identifier:_,active:s,x:A[0],y:A[1],dx:0,dy:0,dispatch:C}),N))!=null)return O=E.x-A[0]||0,T=E.y-A[1]||0,function R(D,z,I){var $=A,F;switch(D){case"start":a[_]=R,F=s++;break;case"end":delete a[_],--s;case"drag":A=xa(I||z,w),F=s;break}C.call(D,j,new NN(D,{sourceEvent:z,subject:E,target:h,identifier:_,active:F,x:A[0]+O,y:A[1]+T,dx:A[0]-$[0],dy:A[1]-$[1],dispatch:C}),N)}}return h.filter=function(j){return arguments.length?(e=typeof j=="function"?j:Mp(!!j),h):e},h.container=function(j){return arguments.length?(t=typeof j=="function"?j:Mp(j),h):t},h.subject=function(j){return arguments.length?(r=typeof j=="function"?j:Mp(j),h):r},h.touchable=function(j){return arguments.length?(n=typeof j=="function"?j:Mp(!!j),h):n},h.on=function(){var j=i.on.apply(i,arguments);return j===i?h:j},h.clickDistance=function(j){return arguments.length?(f=(j=+j)*j,h):Math.sqrt(f)},h}function oP(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function N9(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Wh(){}var Bf=.7,_0=1/Bf,Nc="\\s*([+-]?\\d+)\\s*",Vf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ga="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Hse=/^#([0-9a-f]{3,8})$/,Wse=new RegExp(`^rgb\\(${Nc},${Nc},${Nc}\\)$`),Gse=new RegExp(`^rgb\\(${Ga},${Ga},${Ga}\\)$`),Kse=new RegExp(`^rgba\\(${Nc},${Nc},${Nc},${Vf}\\)$`),Yse=new RegExp(`^rgba\\(${Ga},${Ga},${Ga},${Vf}\\)$`),Xse=new RegExp(`^hsl\\(${Vf},${Ga},${Ga}\\)$`),Zse=new RegExp(`^hsla\\(${Vf},${Ga},${Ga},${Vf}\\)$`),rM={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};oP(Wh,al,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:nM,formatHex:nM,formatHex8:Qse,formatHsl:Jse,formatRgb:aM,toString:aM});function nM(){return this.rgb().formatHex()}function Qse(){return this.rgb().formatHex8()}function Jse(){return S9(this).formatHsl()}function aM(){return this.rgb().formatRgb()}function al(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Hse.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?iM(t):r===3?new on(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Rp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Rp(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=Wse.exec(e))?new on(t[1],t[2],t[3],1):(t=Gse.exec(e))?new on(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Kse.exec(e))?Rp(t[1],t[2],t[3],t[4]):(t=Yse.exec(e))?Rp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Xse.exec(e))?lM(t[1],t[2]/100,t[3]/100,1):(t=Zse.exec(e))?lM(t[1],t[2]/100,t[3]/100,t[4]):rM.hasOwnProperty(e)?iM(rM[e]):e==="transparent"?new on(NaN,NaN,NaN,0):null}function iM(e){return new on(e>>16&255,e>>8&255,e&255,1)}function Rp(e,t,r,n){return n<=0&&(e=t=r=NaN),new on(e,t,r,n)}function eoe(e){return e instanceof Wh||(e=al(e)),e?(e=e.rgb(),new on(e.r,e.g,e.b,e.opacity)):new on}function SN(e,t,r,n){return arguments.length===1?eoe(e):new on(e,t,r,n??1)}function on(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}oP(on,SN,N9(Wh,{brighter(e){return e=e==null?_0:Math.pow(_0,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Bf:Math.pow(Bf,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new on(qo(this.r),qo(this.g),qo(this.b),E0(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:sM,formatHex:sM,formatHex8:toe,formatRgb:oM,toString:oM}));function sM(){return`#${Oo(this.r)}${Oo(this.g)}${Oo(this.b)}`}function toe(){return`#${Oo(this.r)}${Oo(this.g)}${Oo(this.b)}${Oo((isNaN(this.opacity)?1:this.opacity)*255)}`}function oM(){const e=E0(this.opacity);return`${e===1?"rgb(":"rgba("}${qo(this.r)}, ${qo(this.g)}, ${qo(this.b)}${e===1?")":`, ${e})`}`}function E0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oo(e){return e=qo(e),(e<16?"0":"")+e.toString(16)}function lM(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ja(e,t,r,n)}function S9(e){if(e instanceof ja)return new ja(e.h,e.s,e.l,e.opacity);if(e instanceof Wh||(e=al(e)),!e)return new ja;if(e instanceof ja)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),s=NaN,l=i-a,c=(i+a)/2;return l?(t===i?s=(r-n)/l+(r<n)*6:r===i?s=(n-t)/l+2:s=(t-r)/l+4,l/=c<.5?i+a:2-i-a,s*=60):l=c>0&&c<1?0:s,new ja(s,l,c,e.opacity)}function roe(e,t,r,n){return arguments.length===1?S9(e):new ja(e,t,r,n??1)}function ja(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}oP(ja,roe,N9(Wh,{brighter(e){return e=e==null?_0:Math.pow(_0,e),new ja(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Bf:Math.pow(Bf,e),new ja(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,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new on(vv(e>=240?e-240:e+120,a,n),vv(e,a,n),vv(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new ja(cM(this.h),Dp(this.s),Dp(this.l),E0(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=E0(this.opacity);return`${e===1?"hsl(":"hsla("}${cM(this.h)}, ${Dp(this.s)*100}%, ${Dp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function cM(e){return e=(e||0)%360,e<0?e+360:e}function Dp(e){return Math.max(0,Math.min(1,e||0))}function vv(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const lP=e=>()=>e;function noe(e,t){return function(r){return e+r*t}}function aoe(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function ioe(e){return(e=+e)==1?_9:function(t,r){return r-t?aoe(t,r,e):lP(isNaN(t)?r:t)}}function _9(e,t){var r=t-e;return r?noe(e,r):lP(isNaN(e)?t:e)}const P0=function e(t){var r=ioe(t);function n(a,i){var s=r((a=SN(a)).r,(i=SN(i)).r),l=r(a.g,i.g),c=r(a.b,i.b),u=_9(a.opacity,i.opacity);return function(d){return a.r=s(d),a.g=l(d),a.b=c(d),a.opacity=u(d),a+""}}return n.gamma=e,n}(1);function soe(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;a<r;++a)n[a]=e[a]*(1-i)+t[a]*i;return n}}function ooe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function loe(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),i=new Array(r),s;for(s=0;s<n;++s)a[s]=Pu(e[s],t[s]);for(;s<r;++s)i[s]=t[s];return function(l){for(s=0;s<n;++s)i[s]=a[s](l);return i}}function coe(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function wa(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function uoe(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=Pu(e[a],t[a]):n[a]=t[a];return function(i){for(a in r)n[a]=r[a](i);return n}}var _N=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bv=new RegExp(_N.source,"g");function doe(e){return function(){return e}}function foe(e){return function(t){return e(t)+""}}function E9(e,t){var r=_N.lastIndex=bv.lastIndex=0,n,a,i,s=-1,l=[],c=[];for(e=e+"",t=t+"";(n=_N.exec(e))&&(a=bv.exec(t));)(i=a.index)>r&&(i=t.slice(r,i),l[s]?l[s]+=i:l[++s]=i),(n=n[0])===(a=a[0])?l[s]?l[s]+=a:l[++s]=a:(l[++s]=null,c.push({i:s,x:wa(n,a)})),r=bv.lastIndex;return r<t.length&&(i=t.slice(r),l[s]?l[s]+=i:l[++s]=i),l.length<2?c[0]?foe(c[0].x):doe(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 Pu(e,t){var r=typeof t,n;return t==null||r==="boolean"?lP(t):(r==="number"?wa:r==="string"?(n=al(t))?(t=n,P0):E9:t instanceof al?P0:t instanceof Date?coe:ooe(t)?soe:Array.isArray(t)?loe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?uoe:wa)(e,t)}function cP(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var uM=180/Math.PI,EN={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function P9(e,t,r,n,a,i){var s,l,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*r+t*n)&&(r-=e*c,n-=t*c),(l=Math.sqrt(r*r+n*n))&&(r/=l,n/=l,c/=l),e*n<t*r&&(e=-e,t=-t,c=-c,s=-s),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*uM,skewX:Math.atan(c)*uM,scaleX:s,scaleY:l}}var $p;function hoe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?EN:P9(t.a,t.b,t.c,t.d,t.e,t.f)}function poe(e){return e==null||($p||($p=document.createElementNS("http://www.w3.org/2000/svg","g")),$p.setAttribute("transform",e),!(e=$p.transform.baseVal.consolidate()))?EN:(e=e.matrix,P9(e.a,e.b,e.c,e.d,e.e,e.f))}function C9(e,t,r,n){function a(u){return u.length?u.pop()+" ":""}function i(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push("translate(",null,t,null,r);m.push({i:g-4,x:wa(u,f)},{i:g-2,x:wa(d,h)})}else(f||h)&&p.push("translate("+f+t+h+r)}function s(u,d,f,h){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(a(f)+"rotate(",null,n)-2,x:wa(u,d)})):d&&f.push(a(f)+"rotate("+d+n)}function l(u,d,f,h){u!==d?h.push({i:f.push(a(f)+"skewX(",null,n)-2,x:wa(u,d)}):d&&f.push(a(f)+"skewX("+d+n)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push(a(p)+"scale(",null,",",null,")");m.push({i:g-4,x:wa(u,f)},{i:g-2,x:wa(d,h)})}else(f!==1||h!==1)&&p.push(a(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,f,h),s(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,g=h.length,y;++m<g;)f[(y=h[m]).i]=y.x(p);return f.join("")}}}var moe=C9(hoe,"px, ","px)","deg)"),goe=C9(poe,", ",")",")"),xoe=1e-12;function dM(e){return((e=Math.exp(e))+1/e)/2}function yoe(e){return((e=Math.exp(e))-1/e)/2}function voe(e){return((e=Math.exp(2*e))-1)/(e+1)}const boe=function e(t,r,n){function a(i,s){var l=i[0],c=i[1],u=i[2],d=s[0],f=s[1],h=s[2],p=d-l,m=f-c,g=p*p+m*m,y,x;if(g<xoe)x=Math.log(h/u)/t,y=function(N){return[l+N*p,c+N*m,u*Math.exp(t*N*x)]};else{var v=Math.sqrt(g),b=(h*h-u*u+n*g)/(2*u*r*v),j=(h*h-u*u-n*g)/(2*h*r*v),w=Math.log(Math.sqrt(b*b+1)-b),k=Math.log(Math.sqrt(j*j+1)-j);x=(k-w)/t,y=function(N){var _=N*x,P=dM(w),C=u/(r*v)*(P*voe(t*_+w)-yoe(w));return[l+C*p,c+C*m,u*P/dM(t*_+w)]}}return y.duration=x*1e3*t/Math.SQRT2,y}return a.rho=function(i){var s=Math.max(.001,+i),l=s*s,c=l*l;return e(s,l,c)},a}(Math.SQRT2,2,4);function woe(e,t){t===void 0&&(t=e,e=Pu);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return function(s){var l=Math.max(0,Math.min(n-1,Math.floor(s*=n)));return i[l](s-l)}}var Wc=0,Cd=0,sd=0,A9=1e3,C0,Ad,A0=0,il=0,fx=0,qf=typeof performance=="object"&&performance.now?performance:Date,O9=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function uP(){return il||(O9(joe),il=qf.now()+fx)}function joe(){il=0}function O0(){this._call=this._time=this._next=null}O0.prototype=T9.prototype={constructor:O0,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?uP():+r)+(t==null?0:+t),!this._next&&Ad!==this&&(Ad?Ad._next=this:C0=this,Ad=this),this._call=e,this._time=r,PN()},stop:function(){this._call&&(this._call=null,this._time=1/0,PN())}};function T9(e,t,r){var n=new O0;return n.restart(e,t,r),n}function koe(){uP(),++Wc;for(var e=C0,t;e;)(t=il-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Wc}function fM(){il=(A0=qf.now())+fx,Wc=Cd=0;try{koe()}finally{Wc=0,Soe(),il=0}}function Noe(){var e=qf.now(),t=e-A0;t>A9&&(fx-=t,A0=e)}function Soe(){for(var e,t=C0,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:C0=r);Ad=e,PN(n)}function PN(e){if(!Wc){Cd&&(Cd=clearTimeout(Cd));var t=e-il;t>24?(e<1/0&&(Cd=setTimeout(fM,e-qf.now()-fx)),sd&&(sd=clearInterval(sd))):(sd||(A0=qf.now(),sd=setInterval(Noe,A9)),Wc=1,O9(fM))}}function hM(e,t,r){var n=new O0;return t=t==null?0:+t,n.restart(a=>{n.stop(),e(a+t)},t,r),n}var _oe=ux("start","end","cancel","interrupt"),Eoe=[],M9=0,pM=1,CN=2,Mm=3,mM=4,AN=5,Rm=6;function hx(e,t,r,n,a,i){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;Poe(e,r,{name:t,index:n,group:a,on:_oe,tween:Eoe,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:M9})}function dP(e,t){var r=Ta(e,t);if(r.state>M9)throw new Error("too late; already scheduled");return r}function Za(e,t){var r=Ta(e,t);if(r.state>Mm)throw new Error("too late; already running");return r}function Ta(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Poe(e,t,r){var n=e.__transition,a;n[t]=r,r.timer=T9(i,0,r.time);function i(u){r.state=pM,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var d,f,h,p;if(r.state!==pM)return c();for(d in n)if(p=n[d],p.name===r.name){if(p.state===Mm)return hM(s);p.state===mM?(p.state=Rm,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete n[d]):+d<t&&(p.state=Rm,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete n[d])}if(hM(function(){r.state===Mm&&(r.state=mM,r.timer.restart(l,r.delay,r.time),l(u))}),r.state=CN,r.on.call("start",e,e.__data__,r.index,r.group),r.state===CN){for(r.state=Mm,a=new Array(h=r.tween.length),d=0,f=-1;d<h;++d)(p=r.tween[d].value.call(e,e.__data__,r.index,r.group))&&(a[++f]=p);a.length=f+1}}function l(u){for(var d=u<r.duration?r.ease.call(null,u/r.duration):(r.timer.restart(c),r.state=AN,1),f=-1,h=a.length;++f<h;)a[f].call(e,d);r.state===AN&&(r.on.call("end",e,e.__data__,r.index,r.group),c())}function c(){r.state=Rm,r.timer.stop(),delete n[t];for(var u in n)return;delete e.__transition}}function Dm(e,t){var r=e.__transition,n,a,i=!0,s;if(r){t=t==null?null:t+"";for(s in r){if((n=r[s]).name!==t){i=!1;continue}a=n.state>CN&&n.state<AN,n.state=Rm,n.timer.stop(),n.on.call(a?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[s]}i&&delete e.__transition}}function Coe(e){return this.each(function(){Dm(this,e)})}function Aoe(e,t){var r,n;return function(){var a=Za(this,e),i=a.tween;if(i!==r){n=r=i;for(var s=0,l=n.length;s<l;++s)if(n[s].name===t){n=n.slice(),n.splice(s,1);break}}a.tween=n}}function Ooe(e,t,r){var n,a;if(typeof r!="function")throw new Error;return function(){var i=Za(this,e),s=i.tween;if(s!==n){a=(n=s).slice();for(var l={name:t,value:r},c=0,u=a.length;c<u;++c)if(a[c].name===t){a[c]=l;break}c===u&&a.push(l)}i.tween=a}}function Toe(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=Ta(this.node(),r).tween,a=0,i=n.length,s;a<i;++a)if((s=n[a]).name===e)return s.value;return null}return this.each((t==null?Aoe:Ooe)(r,e,t))}function fP(e,t,r){var n=e._id;return e.each(function(){var a=Za(this,n);(a.value||(a.value={}))[t]=r.apply(this,arguments)}),function(a){return Ta(a,n).value[t]}}function R9(e,t){var r;return(typeof t=="number"?wa:t instanceof al?P0:(r=al(t))?(t=r,P0):E9)(e,t)}function Moe(e){return function(){this.removeAttribute(e)}}function Roe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Doe(e,t,r){var n,a=r+"",i;return function(){var s=this.getAttribute(e);return s===a?null:s===n?i:i=t(n=s,r)}}function $oe(e,t,r){var n,a=r+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===a?null:s===n?i:i=t(n=s,r)}}function Ioe(e,t,r){var n,a,i;return function(){var s,l=r(this),c;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=l+"",s===c?null:s===n&&c===a?i:(a=c,i=t(n=s,l)))}}function Loe(e,t,r){var n,a,i;return function(){var s,l=r(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=l+"",s===c?null:s===n&&c===a?i:(a=c,i=t(n=s,l)))}}function zoe(e,t){var r=dx(e),n=r==="transform"?goe:R9;return this.attrTween(e,typeof t=="function"?(r.local?Loe:Ioe)(r,n,fP(this,"attr."+e,t)):t==null?(r.local?Roe:Moe)(r):(r.local?$oe:Doe)(r,n,t))}function Foe(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Boe(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Voe(e,t){var r,n;function a(){var i=t.apply(this,arguments);return i!==n&&(r=(n=i)&&Boe(e,i)),r}return a._value=t,a}function qoe(e,t){var r,n;function a(){var i=t.apply(this,arguments);return i!==n&&(r=(n=i)&&Foe(e,i)),r}return a._value=t,a}function Uoe(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=dx(e);return this.tween(r,(n.local?Voe:qoe)(n,t))}function Hoe(e,t){return function(){dP(this,e).delay=+t.apply(this,arguments)}}function Woe(e,t){return t=+t,function(){dP(this,e).delay=t}}function Goe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Hoe:Woe)(t,e)):Ta(this.node(),t).delay}function Koe(e,t){return function(){Za(this,e).duration=+t.apply(this,arguments)}}function Yoe(e,t){return t=+t,function(){Za(this,e).duration=t}}function Xoe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Koe:Yoe)(t,e)):Ta(this.node(),t).duration}function Zoe(e,t){if(typeof t!="function")throw new Error;return function(){Za(this,e).ease=t}}function Qoe(e){var t=this._id;return arguments.length?this.each(Zoe(t,e)):Ta(this.node(),t).ease}function Joe(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Za(this,e).ease=r}}function ele(e){if(typeof e!="function")throw new Error;return this.each(Joe(this._id,e))}function tle(e){typeof e!="function"&&(e=f9(e));for(var t=this._groups,r=t.length,n=new Array(r),a=0;a<r;++a)for(var i=t[a],s=i.length,l=n[a]=[],c,u=0;u<s;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new $i(n,this._parents,this._name,this._id)}function rle(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,a=r.length,i=Math.min(n,a),s=new Array(n),l=0;l<i;++l)for(var c=t[l],u=r[l],d=c.length,f=s[l]=new Array(d),h,p=0;p<d;++p)(h=c[p]||u[p])&&(f[p]=h);for(;l<n;++l)s[l]=t[l];return new $i(s,this._parents,this._name,this._id)}function nle(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function ale(e,t,r){var n,a,i=nle(t)?dP:Za;return function(){var s=i(this,e),l=s.on;l!==n&&(a=(n=l).copy()).on(t,r),s.on=a}}function ile(e,t){var r=this._id;return arguments.length<2?Ta(this.node(),r).on.on(e):this.each(ale(r,e,t))}function sle(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function ole(){return this.on("end.remove",sle(this._id))}function lle(e){var t=this._name,r=this._id;typeof e!="function"&&(e=iP(e));for(var n=this._groups,a=n.length,i=new Array(a),s=0;s<a;++s)for(var l=n[s],c=l.length,u=i[s]=new Array(c),d,f,h=0;h<c;++h)(d=l[h])&&(f=e.call(d,d.__data__,h,l))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f,hx(u[h],t,r,h,u,Ta(d,r)));return new $i(i,this._parents,t,r)}function cle(e){var t=this._name,r=this._id;typeof e!="function"&&(e=d9(e));for(var n=this._groups,a=n.length,i=[],s=[],l=0;l<a;++l)for(var c=n[l],u=c.length,d,f=0;f<u;++f)if(d=c[f]){for(var h=e.call(d,d.__data__,f,c),p,m=Ta(d,r),g=0,y=h.length;g<y;++g)(p=h[g])&&hx(p,t,r,g,h,m);i.push(h),s.push(d)}return new $i(i,s,t,r)}var ule=Hh.prototype.constructor;function dle(){return new ule(this._groups,this._parents)}function fle(e,t){var r,n,a;return function(){var i=Hc(this,e),s=(this.style.removeProperty(e),Hc(this,e));return i===s?null:i===r&&s===n?a:a=t(r=i,n=s)}}function D9(e){return function(){this.style.removeProperty(e)}}function hle(e,t,r){var n,a=r+"",i;return function(){var s=Hc(this,e);return s===a?null:s===n?i:i=t(n=s,r)}}function ple(e,t,r){var n,a,i;return function(){var s=Hc(this,e),l=r(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),Hc(this,e))),s===c?null:s===n&&c===a?i:(a=c,i=t(n=s,l))}}function mle(e,t){var r,n,a,i="style."+t,s="end."+i,l;return function(){var c=Za(this,e),u=c.on,d=c.value[i]==null?l||(l=D9(t)):void 0;(u!==r||a!==d)&&(n=(r=u).copy()).on(s,a=d),c.on=n}}function gle(e,t,r){var n=(e+="")=="transform"?moe:R9;return t==null?this.styleTween(e,fle(e,n)).on("end.style."+e,D9(e)):typeof t=="function"?this.styleTween(e,ple(e,n,fP(this,"style."+e,t))).each(mle(this._id,e)):this.styleTween(e,hle(e,n,t),r).on("end.style."+e,null)}function xle(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function yle(e,t,r){var n,a;function i(){var s=t.apply(this,arguments);return s!==a&&(n=(a=s)&&xle(e,s,r)),n}return i._value=t,i}function vle(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,yle(e,t,r??""))}function ble(e){return function(){this.textContent=e}}function wle(e){return function(){var t=e(this);this.textContent=t??""}}function jle(e){return this.tween("text",typeof e=="function"?wle(fP(this,"text",e)):ble(e==null?"":e+""))}function kle(e){return function(t){this.textContent=e.call(this,t)}}function Nle(e){var t,r;function n(){var a=e.apply(this,arguments);return a!==r&&(t=(r=a)&&kle(a)),t}return n._value=e,n}function Sle(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Nle(e))}function _le(){for(var e=this._name,t=this._id,r=$9(),n=this._groups,a=n.length,i=0;i<a;++i)for(var s=n[i],l=s.length,c,u=0;u<l;++u)if(c=s[u]){var d=Ta(c,t);hx(c,e,r,u,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new $i(n,this._parents,e,r)}function Ele(){var e,t,r=this,n=r._id,a=r.size();return new Promise(function(i,s){var l={value:s},c={value:function(){--a===0&&i()}};r.each(function(){var u=Za(this,n),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),a===0&&i()})}var Ple=0;function $i(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function $9(){return++Ple}var ri=Hh.prototype;$i.prototype={constructor:$i,select:lle,selectAll:cle,selectChild:ri.selectChild,selectChildren:ri.selectChildren,filter:tle,merge:rle,selection:dle,transition:_le,call:ri.call,nodes:ri.nodes,node:ri.node,size:ri.size,empty:ri.empty,each:ri.each,on:ile,attr:zoe,attrTween:Uoe,style:gle,styleTween:vle,text:jle,textTween:Sle,remove:ole,tween:Toe,delay:Goe,duration:Xoe,ease:Qoe,easeVarying:ele,end:Ele,[Symbol.iterator]:ri[Symbol.iterator]};function Cle(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ale={time:null,delay:0,duration:250,ease:Cle};function Ole(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function Tle(e){var t,r;e instanceof $i?(t=e._id,e=e._name):(t=$9(),(r=Ale).time=uP(),e=e==null?null:e+"");for(var n=this._groups,a=n.length,i=0;i<a;++i)for(var s=n[i],l=s.length,c,u=0;u<l;++u)(c=s[u])&&hx(c,e,t,u,s,r||Ole(c,t));return new $i(n,this._parents,e,t)}Hh.prototype.interrupt=Coe;Hh.prototype.transition=Tle;const Ip=e=>()=>e;function Mle(e,{sourceEvent:t,target:r,transform:n,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:a}})}function ui(e,t,r){this.k=e,this.x=t,this.y=r}ui.prototype={constructor:ui,scale:function(e){return e===1?this:new ui(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ui(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var bi=new ui(1,0,0);ui.prototype;function wv(e){e.stopImmediatePropagation()}function od(e){e.preventDefault(),e.stopImmediatePropagation()}function Rle(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Dle(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function gM(){return this.__zoom||bi}function $le(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Ile(){return navigator.maxTouchPoints||"ontouchstart"in this}function Lle(e,t,r){var n=e.invertX(t[0][0])-r[0][0],a=e.invertX(t[1][0])-r[1][0],i=e.invertY(t[0][1])-r[0][1],s=e.invertY(t[1][1])-r[1][1];return e.translate(a>n?(n+a)/2:Math.min(0,n)||Math.max(0,a),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function I9(){var e=Rle,t=Dle,r=Lle,n=$le,a=Ile,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,c=boe,u=ux("start","zoom","end"),d,f,h,p=500,m=150,g=0,y=10;function x(E){E.property("__zoom",gM).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",C).filter(a).on("touchstart.zoom",A).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(E,R,D,z){var I=E.selection?E.selection():E;I.property("__zoom",gM),E!==I?w(E,R,D,z):I.interrupt().each(function(){k(this,arguments).event(z).start().zoom(null,typeof R=="function"?R.apply(this,arguments):R).end()})},x.scaleBy=function(E,R,D,z){x.scaleTo(E,function(){var I=this.__zoom.k,$=typeof R=="function"?R.apply(this,arguments):R;return I*$},D,z)},x.scaleTo=function(E,R,D,z){x.transform(E,function(){var I=t.apply(this,arguments),$=this.__zoom,F=D==null?j(I):typeof D=="function"?D.apply(this,arguments):D,q=$.invert(F),V=typeof R=="function"?R.apply(this,arguments):R;return r(b(v($,V),F,q),I,s)},D,z)},x.translateBy=function(E,R,D,z){x.transform(E,function(){return r(this.__zoom.translate(typeof R=="function"?R.apply(this,arguments):R,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),s)},null,z)},x.translateTo=function(E,R,D,z,I){x.transform(E,function(){var $=t.apply(this,arguments),F=this.__zoom,q=z==null?j($):typeof z=="function"?z.apply(this,arguments):z;return r(bi.translate(q[0],q[1]).scale(F.k).translate(typeof R=="function"?-R.apply(this,arguments):-R,typeof D=="function"?-D.apply(this,arguments):-D),$,s)},z,I)};function v(E,R){return R=Math.max(i[0],Math.min(i[1],R)),R===E.k?E:new ui(R,E.x,E.y)}function b(E,R,D){var z=R[0]-D[0]*E.k,I=R[1]-D[1]*E.k;return z===E.x&&I===E.y?E:new ui(E.k,z,I)}function j(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function w(E,R,D,z){E.on("start.zoom",function(){k(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(z).end()}).tween("zoom",function(){var I=this,$=arguments,F=k(I,$).event(z),q=t.apply(I,$),V=D==null?j(q):typeof D=="function"?D.apply(I,$):D,L=Math.max(q[1][0]-q[0][0],q[1][1]-q[0][1]),B=I.__zoom,Y=typeof R=="function"?R.apply(I,$):R,W=c(B.invert(V).concat(L/B.k),Y.invert(V).concat(L/Y.k));return function(K){if(K===1)K=Y;else{var Q=W(K),X=L/Q[2];K=new ui(X,V[0]-Q[0]*X,V[1]-Q[1]*X)}F.zoom(null,K)}})}function k(E,R,D){return!D&&E.__zooming||new N(E,R)}function N(E,R){this.that=E,this.args=R,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,R),this.taps=0}N.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,R){return this.mouse&&E!=="mouse"&&(this.mouse[1]=R.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=R.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=R.invert(this.touch1[0])),this.that.__zoom=R,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var R=Un(this.that).datum();u.call(E,this.that,new Mle(E,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:u}),R)}};function _(E,...R){if(!e.apply(this,arguments))return;var D=k(this,R).event(E),z=this.__zoom,I=Math.max(i[0],Math.min(i[1],z.k*Math.pow(2,n.apply(this,arguments)))),$=xa(E);if(D.wheel)(D.mouse[0][0]!==$[0]||D.mouse[0][1]!==$[1])&&(D.mouse[1]=z.invert(D.mouse[0]=$)),clearTimeout(D.wheel);else{if(z.k===I)return;D.mouse=[$,z.invert($)],Dm(this),D.start()}od(E),D.wheel=setTimeout(F,m),D.zoom("mouse",r(b(v(z,I),D.mouse[0],D.mouse[1]),D.extent,s));function F(){D.wheel=null,D.end()}}function P(E,...R){if(h||!e.apply(this,arguments))return;var D=E.currentTarget,z=k(this,R,!0).event(E),I=Un(E.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",L,!0),$=xa(E,D),F=E.clientX,q=E.clientY;j9(E.view),wv(E),z.mouse=[$,this.__zoom.invert($)],Dm(this),z.start();function V(B){if(od(B),!z.moved){var Y=B.clientX-F,W=B.clientY-q;z.moved=Y*Y+W*W>g}z.event(B).zoom("mouse",r(b(z.that.__zoom,z.mouse[0]=xa(B,D),z.mouse[1]),z.extent,s))}function L(B){I.on("mousemove.zoom mouseup.zoom",null),k9(B.view,z.moved),od(B),z.event(B).end()}}function C(E,...R){if(e.apply(this,arguments)){var D=this.__zoom,z=xa(E.changedTouches?E.changedTouches[0]:E,this),I=D.invert(z),$=D.k*(E.shiftKey?.5:2),F=r(b(v(D,$),z,I),t.apply(this,R),s);od(E),l>0?Un(this).transition().duration(l).call(w,F,z,E):Un(this).call(x.transform,F,z,E)}}function A(E,...R){if(e.apply(this,arguments)){var D=E.touches,z=D.length,I=k(this,R,E.changedTouches.length===z).event(E),$,F,q,V;for(wv(E),F=0;F<z;++F)q=D[F],V=xa(q,this),V=[V,this.__zoom.invert(V),q.identifier],I.touch0?!I.touch1&&I.touch0[2]!==V[2]&&(I.touch1=V,I.taps=0):(I.touch0=V,$=!0,I.taps=1+!!d);d&&(d=clearTimeout(d)),$&&(I.taps<2&&(f=V[0],d=setTimeout(function(){d=null},p)),Dm(this),I.start())}}function O(E,...R){if(this.__zooming){var D=k(this,R).event(E),z=E.changedTouches,I=z.length,$,F,q,V;for(od(E),$=0;$<I;++$)F=z[$],q=xa(F,this),D.touch0&&D.touch0[2]===F.identifier?D.touch0[0]=q:D.touch1&&D.touch1[2]===F.identifier&&(D.touch1[0]=q);if(F=D.that.__zoom,D.touch1){var L=D.touch0[0],B=D.touch0[1],Y=D.touch1[0],W=D.touch1[1],K=(K=Y[0]-L[0])*K+(K=Y[1]-L[1])*K,Q=(Q=W[0]-B[0])*Q+(Q=W[1]-B[1])*Q;F=v(F,Math.sqrt(K/Q)),q=[(L[0]+Y[0])/2,(L[1]+Y[1])/2],V=[(B[0]+W[0])/2,(B[1]+W[1])/2]}else if(D.touch0)q=D.touch0[0],V=D.touch0[1];else return;D.zoom("touch",r(b(F,q,V),D.extent,s))}}function T(E,...R){if(this.__zooming){var D=k(this,R).event(E),z=E.changedTouches,I=z.length,$,F;for(wv(E),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),$=0;$<I;++$)F=z[$],D.touch0&&D.touch0[2]===F.identifier?delete D.touch0:D.touch1&&D.touch1[2]===F.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(F=xa(F,this),Math.hypot(f[0]-F[0],f[1]-F[1])<y)){var q=Un(this).on("dblclick.zoom");q&&q.apply(this,arguments)}}}return x.wheelDelta=function(E){return arguments.length?(n=typeof E=="function"?E:Ip(+E),x):n},x.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Ip(!!E),x):e},x.touchable=function(E){return arguments.length?(a=typeof E=="function"?E:Ip(!!E),x):a},x.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Ip([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),x):t},x.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],x):[i[0],i[1]]},x.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],x):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},x.constrain=function(E){return arguments.length?(r=E,x):r},x.duration=function(E){return arguments.length?(l=+E,x):l},x.interpolate=function(E){return arguments.length?(c=E,x):c},x.on=function(){var E=u.on.apply(u,arguments);return E===u?x:E},x.clickDistance=function(E){return arguments.length?(g=(E=+E)*E,x):Math.sqrt(g)},x.tapDistance=function(E){return arguments.length?(y=+E,x):y},x}const px=S.createContext(null),zle=px.Provider,Ii={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},L9=Ii.error001();function Et(e,t){const r=S.useContext(px);if(r===null)throw new Error(L9);return c9(r,e,t)}const xr=()=>{const e=S.useContext(px);if(e===null)throw new Error(L9);return S.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},Fle=e=>e.userSelectionActive?"none":"all";function hP({position:e,children:t,className:r,style:n,...a}){const i=Et(Fle),s=`${e}`.split("-");return M.createElement("div",{className:Dr(["react-flow__panel",r,...s]),style:{...n,pointerEvents:i},...a},t)}function Ble({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:M.createElement(hP,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},M.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const Vle=({x:e,y:t,label:r,labelStyle:n={},labelShowBg:a=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d})=>{const f=S.useRef(null),[h,p]=S.useState({x:0,y:0,width:0,height:0}),m=Dr(["react-flow__edge-textwrapper",u]);return S.useEffect(()=>{if(f.current){const g=f.current.getBBox();p({x:g.x,y:g.y,width:g.width,height:g.height})}},[r]),typeof r>"u"||!r?null:M.createElement("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:m,visibility:h.width?"visible":"hidden",...d},a&&M.createElement("rect",{width:h.width+2*s[0],x:-s[0],y:-s[1],height:h.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),M.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:f,style:n},r),c)};var qle=S.memo(Vle);const pP=e=>({width:e.offsetWidth,height:e.offsetHeight}),Gc=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),mP=(e={x:0,y:0},t)=>({x:Gc(e.x,t[0][0],t[1][0]),y:Gc(e.y,t[0][1],t[1][1])}),xM=(e,t,r)=>e<t?Gc(Math.abs(e-t),1,50)/50:e>r?-Gc(Math.abs(e-r),1,50)/50:0,z9=(e,t)=>{const r=xM(e.x,35,t.width-35)*20,n=xM(e.y,35,t.height-35)*20;return[r,n]},F9=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},B9=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Uf=({x:e,y:t,width:r,height:n})=>({x:e,y:t,x2:e+r,y2:t+n}),V9=({x:e,y:t,x2:r,y2:n})=>({x:e,y:t,width:r-e,height:n-t}),yM=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Ule=(e,t)=>V9(B9(Uf(e),Uf(t))),ON=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),n=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*n)},Hle=e=>Gn(e.width)&&Gn(e.height)&&Gn(e.x)&&Gn(e.y),Gn=e=>!isNaN(e)&&isFinite(e),Qt=Symbol.for("internals"),q9=["Enter"," ","Escape"],Wle=(e,t)=>{},Gle=e=>"nativeEvent"in e;function TN(e){var a,i;const t=Gle(e)?e.nativeEvent:e,r=((i=(a=t.composedPath)==null?void 0:a.call(t))==null?void 0:i[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(r==null?void 0:r.nodeName)||(r==null?void 0:r.hasAttribute("contenteditable"))||!!(r!=null&&r.closest(".nokey"))}const U9=e=>"clientX"in e,Is=(e,t)=>{var i,s;const r=U9(e),n=r?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,a=r?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:n-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},T0=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Gh=({id:e,path:t,labelX:r,labelY:n,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:h,interactionWidth:p=20})=>M.createElement(M.Fragment,null,M.createElement("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:h}),p&&M.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}),a&&Gn(r)&&Gn(n)?M.createElement(qle,{x:r,y:n,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);Gh.displayName="BaseEdge";function ld(e,t,r){return r===void 0?r:n=>{const a=t().edges.find(i=>i.id===e);a&&r(n,{...a})}}function H9({sourceX:e,sourceY:t,targetX:r,targetY:n}){const a=Math.abs(r-e)/2,i=r<e?r+a:r-a,s=Math.abs(n-t)/2,l=n<t?n+s:n-s;return[i,l,a,s]}function W9({sourceX:e,sourceY:t,targetX:r,targetY:n,sourceControlX:a,sourceControlY:i,targetControlX:s,targetControlY:l}){const c=e*.125+a*.375+s*.375+r*.125,u=t*.125+i*.375+l*.375+n*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}var sl;(function(e){e.Strict="strict",e.Loose="loose"})(sl||(sl={}));var To;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(To||(To={}));var Hf;(function(e){e.Partial="partial",e.Full="full"})(Hf||(Hf={}));var xs;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(xs||(xs={}));var Kc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Kc||(Kc={}));var _e;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(_e||(_e={}));function vM({pos:e,x1:t,y1:r,x2:n,y2:a}){return e===_e.Left||e===_e.Right?[.5*(t+n),r]:[t,.5*(r+a)]}function G9({sourceX:e,sourceY:t,sourcePosition:r=_e.Bottom,targetX:n,targetY:a,targetPosition:i=_e.Top}){const[s,l]=vM({pos:r,x1:e,y1:t,x2:n,y2:a}),[c,u]=vM({pos:i,x1:n,y1:a,x2:e,y2:t}),[d,f,h,p]=W9({sourceX:e,sourceY:t,targetX:n,targetY:a,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${n},${a}`,d,f,h,p]}const gP=S.memo(({sourceX:e,sourceY:t,targetX:r,targetY:n,sourcePosition:a=_e.Bottom,targetPosition:i=_e.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})=>{const[y,x,v]=G9({sourceX:e,sourceY:t,sourcePosition:a,targetX:r,targetY:n,targetPosition:i});return M.createElement(Gh,{path:y,labelX:x,labelY:v,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})});gP.displayName="SimpleBezierEdge";const bM={[_e.Left]:{x:-1,y:0},[_e.Right]:{x:1,y:0},[_e.Top]:{x:0,y:-1},[_e.Bottom]:{x:0,y:1}},Kle=({source:e,sourcePosition:t=_e.Bottom,target:r})=>t===_e.Left||t===_e.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},wM=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Yle({source:e,sourcePosition:t=_e.Bottom,target:r,targetPosition:n=_e.Top,center:a,offset:i}){const s=bM[t],l=bM[n],c={x:e.x+s.x*i,y:e.y+s.y*i},u={x:r.x+l.x*i,y:r.y+l.y*i},d=Kle({source:c,sourcePosition:t,target:u}),f=d.x!==0?"x":"y",h=d[f];let p=[],m,g;const y={x:0,y:0},x={x:0,y:0},[v,b,j,w]=H9({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(s[f]*l[f]===-1){m=a.x??v,g=a.y??b;const N=[{x:m,y:c.y},{x:m,y:u.y}],_=[{x:c.x,y:g},{x:u.x,y:g}];s[f]===h?p=f==="x"?N:_:p=f==="x"?_:N}else{const N=[{x:c.x,y:u.y}],_=[{x:u.x,y:c.y}];if(f==="x"?p=s.x===h?_:N:p=s.y===h?N:_,t===n){const T=Math.abs(e[f]-r[f]);if(T<=i){const E=Math.min(i-1,i-T);s[f]===h?y[f]=(c[f]>e[f]?-1:1)*E:x[f]=(u[f]>r[f]?-1:1)*E}}if(t!==n){const T=f==="x"?"y":"x",E=s[f]===l[T],R=c[T]>u[T],D=c[T]<u[T];(s[f]===1&&(!E&&R||E&&D)||s[f]!==1&&(!E&&D||E&&R))&&(p=f==="x"?N:_)}const P={x:c.x+y.x,y:c.y+y.y},C={x:u.x+x.x,y:u.y+x.y},A=Math.max(Math.abs(P.x-p[0].x),Math.abs(C.x-p[0].x)),O=Math.max(Math.abs(P.y-p[0].y),Math.abs(C.y-p[0].y));A>=O?(m=(P.x+C.x)/2,g=p[0].y):(m=p[0].x,g=(P.y+C.y)/2)}return[[e,{x:c.x+y.x,y:c.y+y.y},...p,{x:u.x+x.x,y:u.y+x.y},r],m,g,j,w]}function Xle(e,t,r,n){const a=Math.min(wM(e,t)/2,wM(t,r)/2,n),{x:i,y:s}=t;if(e.x===i&&i===r.x||e.y===s&&s===r.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<r.x?-1:1,d=e.y<r.y?1:-1;return`L ${i+a*u},${s}Q ${i},${s} ${i},${s+a*d}`}const l=e.x<r.x?1:-1,c=e.y<r.y?-1:1;return`L ${i},${s+a*c}Q ${i},${s} ${i+a*l},${s}`}function MN({sourceX:e,sourceY:t,sourcePosition:r=_e.Bottom,targetX:n,targetY:a,targetPosition:i=_e.Top,borderRadius:s=5,centerX:l,centerY:c,offset:u=20}){const[d,f,h,p,m]=Yle({source:{x:e,y:t},sourcePosition:r,target:{x:n,y:a},targetPosition:i,center:{x:l,y:c},offset:u});return[d.reduce((y,x,v)=>{let b="";return v>0&&v<d.length-1?b=Xle(d[v-1],x,d[v+1],s):b=`${v===0?"M":"L"}${x.x} ${x.y}`,y+=b,y},""),f,h,p,m]}const mx=S.memo(({sourceX:e,sourceY:t,targetX:r,targetY:n,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=_e.Bottom,targetPosition:h=_e.Top,markerEnd:p,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[x,v,b]=MN({sourceX:e,sourceY:t,sourcePosition:f,targetX:r,targetY:n,targetPosition:h,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset});return M.createElement(Gh,{path:x,labelX:v,labelY:b,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:p,markerStart:m,interactionWidth:y})});mx.displayName="SmoothStepEdge";const xP=S.memo(e=>{var t;return M.createElement(mx,{...e,pathOptions:S.useMemo(()=>{var r;return{borderRadius:0,offset:(r=e.pathOptions)==null?void 0:r.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});xP.displayName="StepEdge";function Zle({sourceX:e,sourceY:t,targetX:r,targetY:n}){const[a,i,s,l]=H9({sourceX:e,sourceY:t,targetX:r,targetY:n});return[`M ${e},${t}L ${r},${n}`,a,i,s,l]}const yP=S.memo(({sourceX:e,sourceY:t,targetX:r,targetY:n,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:h,interactionWidth:p})=>{const[m,g,y]=Zle({sourceX:e,sourceY:t,targetX:r,targetY:n});return M.createElement(Gh,{path:m,labelX:g,labelY:y,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:h,interactionWidth:p})});yP.displayName="StraightEdge";function Lp(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function jM({pos:e,x1:t,y1:r,x2:n,y2:a,c:i}){switch(e){case _e.Left:return[t-Lp(t-n,i),r];case _e.Right:return[t+Lp(n-t,i),r];case _e.Top:return[t,r-Lp(r-a,i)];case _e.Bottom:return[t,r+Lp(a-r,i)]}}function K9({sourceX:e,sourceY:t,sourcePosition:r=_e.Bottom,targetX:n,targetY:a,targetPosition:i=_e.Top,curvature:s=.25}){const[l,c]=jM({pos:r,x1:e,y1:t,x2:n,y2:a,c:s}),[u,d]=jM({pos:i,x1:n,y1:a,x2:e,y2:t,c:s}),[f,h,p,m]=W9({sourceX:e,sourceY:t,targetX:n,targetY:a,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${n},${a}`,f,h,p,m]}const M0=S.memo(({sourceX:e,sourceY:t,targetX:r,targetY:n,sourcePosition:a=_e.Bottom,targetPosition:i=_e.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[x,v,b]=K9({sourceX:e,sourceY:t,sourcePosition:a,targetX:r,targetY:n,targetPosition:i,curvature:g==null?void 0:g.curvature});return M.createElement(Gh,{path:x,labelX:v,labelY:b,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})});M0.displayName="BezierEdge";const vP=S.createContext(null),Qle=vP.Provider;vP.Consumer;const Jle=()=>S.useContext(vP),ece=e=>"id"in e&&"source"in e&&"target"in e,tce=({source:e,sourceHandle:t,target:r,targetHandle:n})=>`reactflow__edge-${e}${t||""}-${r}${n||""}`,RN=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(n=>`${n}=${e[n]}`).join("&")}`,rce=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),nce=(e,t)=>{if(!e.source||!e.target)return t;let r;return ece(e)?r={...e}:r={...e,id:tce(e)},rce(r,t)?t:t.concat(r)},DN=({x:e,y:t},[r,n,a],i,[s,l])=>{const c={x:(e-r)/a,y:(t-n)/a};return i?{x:s*Math.round(c.x/s),y:l*Math.round(c.y/l)}:c},Y9=({x:e,y:t},[r,n,a])=>({x:e*a+r,y:t*a+n}),Uo=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const r=(e.width??0)*t[0],n=(e.height??0)*t[1],a={x:e.position.x-r,y:e.position.y-n};return{...a,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-r,y:e.positionAbsolute.y-n}:a}},gx=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((n,a)=>{const{x:i,y:s}=Uo(a,t).positionAbsolute;return B9(n,Uf({x:i,y:s,width:a.width||0,height:a.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return V9(r)},X9=(e,t,[r,n,a]=[0,0,1],i=!1,s=!1,l=[0,0])=>{const c={x:(t.x-r)/a,y:(t.y-n)/a,width:t.width/a,height:t.height/a},u=[];return e.forEach(d=>{const{width:f,height:h,selectable:p=!0,hidden:m=!1}=d;if(s&&!p||m)return!1;const{positionAbsolute:g}=Uo(d,l),y={x:g.x,y:g.y,width:f||0,height:h||0},x=ON(c,y),v=typeof f>"u"||typeof h>"u"||f===null||h===null,b=i&&x>0,j=(f||0)*(h||0);(v||b||x>=j||d.dragging)&&u.push(d)}),u},Z9=(e,t)=>{const r=e.map(n=>n.id);return t.filter(n=>r.includes(n.source)||r.includes(n.target))},Q9=(e,t,r,n,a,i=.1)=>{const s=t/(e.width*(1+i)),l=r/(e.height*(1+i)),c=Math.min(s,l),u=Gc(c,n,a),d=e.x+e.width/2,f=e.y+e.height/2,h=t/2-d*u,p=r/2-f*u;return{x:h,y:p,zoom:u}},vo=(e,t=0)=>e.transition().duration(t);function kM(e,t,r,n){return(t[r]||[]).reduce((a,i)=>{var s,l;return`${e.id}-${i.id}-${r}`!==n&&a.push({id:i.id||null,type:r,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+i.x+i.width/2,y:(((l=e.positionAbsolute)==null?void 0:l.y)??0)+i.y+i.height/2}),a},[])}function ace(e,t,r,n,a,i){const{x:s,y:l}=Is(e),u=t.elementsFromPoint(s,l).find(m=>m.classList.contains("react-flow__handle"));if(u){const m=u.getAttribute("data-nodeid");if(m){const g=bP(void 0,u),y=u.getAttribute("data-handleid"),x=i({nodeId:m,id:y,type:g});if(x){const v=a.find(b=>b.nodeId===m&&b.type===g&&b.id===y);return{handle:{id:y,type:g,nodeId:m,x:(v==null?void 0:v.x)||r.x,y:(v==null?void 0:v.y)||r.y},validHandleResult:x}}}}let d=[],f=1/0;if(a.forEach(m=>{const g=Math.sqrt((m.x-r.x)**2+(m.y-r.y)**2);if(g<=n){const y=i(m);g<=f&&(g<f?d=[{handle:m,validHandleResult:y}]:g===f&&d.push({handle:m,validHandleResult:y}),f=g)}}),!d.length)return{handle:null,validHandleResult:J9()};if(d.length===1)return d[0];const h=d.some(({validHandleResult:m})=>m.isValid),p=d.some(({handle:m})=>m.type==="target");return d.find(({handle:m,validHandleResult:g})=>p?m.type==="target":h?g.isValid:!0)||d[0]}const ice={source:null,target:null,sourceHandle:null,targetHandle:null},J9=()=>({handleDomNode:null,isValid:!1,connection:ice,endHandle:null});function eB(e,t,r,n,a,i,s){const l=a==="target",c=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...J9(),handleDomNode:c};if(c){const d=bP(void 0,c),f=c.getAttribute("data-nodeid"),h=c.getAttribute("data-handleid"),p=c.classList.contains("connectable"),m=c.classList.contains("connectableend"),g={source:l?f:r,sourceHandle:l?h:n,target:l?r:f,targetHandle:l?n:h};u.connection=g,p&&m&&(t===sl.Strict?l&&d==="source"||!l&&d==="target":f!==r||h!==n)&&(u.endHandle={nodeId:f,handleId:h,type:d},u.isValid=i(g))}return u}function sce({nodes:e,nodeId:t,handleId:r,handleType:n}){return e.reduce((a,i)=>{if(i[Qt]){const{handleBounds:s}=i[Qt];let l=[],c=[];s&&(l=kM(i,s,"source",`${t}-${r}-${n}`),c=kM(i,s,"target",`${t}-${r}-${n}`)),a.push(...l,...c)}return a},[])}function bP(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function jv(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function oce(e,t){let r=null;return t?r="valid":e&&!t&&(r="invalid"),r}function tB({event:e,handleId:t,nodeId:r,onConnect:n,isTarget:a,getState:i,setState:s,isValidConnection:l,edgeUpdaterType:c,onReconnectEnd:u}){const d=F9(e.target),{connectionMode:f,domNode:h,autoPanOnConnect:p,connectionRadius:m,onConnectStart:g,panBy:y,getNodes:x,cancelConnection:v}=i();let b=0,j;const{x:w,y:k}=Is(e),N=d==null?void 0:d.elementFromPoint(w,k),_=bP(c,N),P=h==null?void 0:h.getBoundingClientRect();if(!P||!_)return;let C,A=Is(e,P),O=!1,T=null,E=!1,R=null;const D=sce({nodes:x(),nodeId:r,handleId:t,handleType:_}),z=()=>{if(!p)return;const[F,q]=z9(A,P);y({x:F,y:q}),b=requestAnimationFrame(z)};s({connectionPosition:A,connectionStatus:null,connectionNodeId:r,connectionHandleId:t,connectionHandleType:_,connectionStartHandle:{nodeId:r,handleId:t,type:_},connectionEndHandle:null}),g==null||g(e,{nodeId:r,handleId:t,handleType:_});function I(F){const{transform:q}=i();A=Is(F,P);const{handle:V,validHandleResult:L}=ace(F,d,DN(A,q,!1,[1,1]),m,D,B=>eB(B,f,r,t,a?"target":"source",l,d));if(j=V,O||(z(),O=!0),R=L.handleDomNode,T=L.connection,E=L.isValid,s({connectionPosition:j&&E?Y9({x:j.x,y:j.y},q):A,connectionStatus:oce(!!j,E),connectionEndHandle:L.endHandle}),!j&&!E&&!R)return jv(C);T.source!==T.target&&R&&(jv(C),C=R,R.classList.add("connecting","react-flow__handle-connecting"),R.classList.toggle("valid",E),R.classList.toggle("react-flow__handle-valid",E))}function $(F){var q,V;(j||R)&&T&&E&&(n==null||n(T)),(V=(q=i()).onConnectEnd)==null||V.call(q,F),c&&(u==null||u(F)),jv(C),v(),cancelAnimationFrame(b),O=!1,E=!1,T=null,R=null,d.removeEventListener("mousemove",I),d.removeEventListener("mouseup",$),d.removeEventListener("touchmove",I),d.removeEventListener("touchend",$)}d.addEventListener("mousemove",I),d.addEventListener("mouseup",$),d.addEventListener("touchmove",I),d.addEventListener("touchend",$)}const NM=()=>!0,lce=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),cce=(e,t,r)=>n=>{const{connectionStartHandle:a,connectionEndHandle:i,connectionClickStartHandle:s}=n;return{connecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===r||(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===r,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===r}},rB=S.forwardRef(({type:e="source",position:t=_e.Top,isValidConnection:r,isConnectable:n=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p)=>{var P,C;const m=s||null,g=e==="target",y=xr(),x=Jle(),{connectOnClick:v,noPanClassName:b}=Et(lce,Sr),{connecting:j,clickConnecting:w}=Et(cce(x,m,e),Sr);x||(C=(P=y.getState()).onError)==null||C.call(P,"010",Ii.error010());const k=A=>{const{defaultEdgeOptions:O,onConnect:T,hasDefaultEdges:E}=y.getState(),R={...O,...A};if(E){const{edges:D,setEdges:z}=y.getState();z(nce(R,D))}T==null||T(R),l==null||l(R)},N=A=>{if(!x)return;const O=U9(A);a&&(O&&A.button===0||!O)&&tB({event:A,handleId:m,nodeId:x,onConnect:k,isTarget:g,getState:y.getState,setState:y.setState,isValidConnection:r||y.getState().isValidConnection||NM}),O?d==null||d(A):f==null||f(A)},_=A=>{const{onClickConnectStart:O,onClickConnectEnd:T,connectionClickStartHandle:E,connectionMode:R,isValidConnection:D}=y.getState();if(!x||!E&&!a)return;if(!E){O==null||O(A,{nodeId:x,handleId:m,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:x,type:e,handleId:m}});return}const z=F9(A.target),I=r||D||NM,{connection:$,isValid:F}=eB({nodeId:x,id:m,type:e},R,E.nodeId,E.handleId||null,E.type,I,z);F&&k($),T==null||T(A),y.setState({connectionClickStartHandle:null})};return M.createElement("div",{"data-handleid":m,"data-nodeid":x,"data-handlepos":t,"data-id":`${x}-${m}-${e}`,className:Dr(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,u,{source:!g,target:g,connectable:n,connectablestart:a,connectableend:i,connecting:w,connectionindicator:n&&(a&&!j||i&&j)}]),onMouseDown:N,onTouchStart:N,onClick:v?_:void 0,ref:p,...h},c)});rB.displayName="Handle";var Ws=S.memo(rB);const nB=({data:e,isConnectable:t,targetPosition:r=_e.Top,sourcePosition:n=_e.Bottom})=>M.createElement(M.Fragment,null,M.createElement(Ws,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,M.createElement(Ws,{type:"source",position:n,isConnectable:t}));nB.displayName="DefaultNode";var $N=S.memo(nB);const aB=({data:e,isConnectable:t,sourcePosition:r=_e.Bottom})=>M.createElement(M.Fragment,null,e==null?void 0:e.label,M.createElement(Ws,{type:"source",position:r,isConnectable:t}));aB.displayName="InputNode";var iB=S.memo(aB);const sB=({data:e,isConnectable:t,targetPosition:r=_e.Top})=>M.createElement(M.Fragment,null,M.createElement(Ws,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label);sB.displayName="OutputNode";var oB=S.memo(sB);const wP=()=>null;wP.displayName="GroupNode";const uce=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),zp=e=>e.id;function dce(e,t){return Sr(e.selectedNodes.map(zp),t.selectedNodes.map(zp))&&Sr(e.selectedEdges.map(zp),t.selectedEdges.map(zp))}const lB=S.memo(({onSelectionChange:e})=>{const t=xr(),{selectedNodes:r,selectedEdges:n}=Et(uce,dce);return S.useEffect(()=>{const a={nodes:r,edges:n};e==null||e(a),t.getState().onSelectionChange.forEach(i=>i(a))},[r,n,e]),null});lB.displayName="SelectionListener";const fce=e=>!!e.onSelectionChange;function hce({onSelectionChange:e}){const t=Et(fce);return e||t?M.createElement(lB,{onSelectionChange:e}):null}const pce=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Ml(e,t){S.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Ke(e,t,r){S.useEffect(()=>{typeof t<"u"&&r({[e]:t})},[t])}const mce=({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,onConnect:a,onConnectStart:i,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:f,edgesFocusable:h,edgesUpdatable:p,elevateNodesOnSelect:m,minZoom:g,maxZoom:y,nodeExtent:x,onNodesChange:v,onEdgesChange:b,elementsSelectable:j,connectionMode:w,snapGrid:k,snapToGrid:N,translateExtent:_,connectOnClick:P,defaultEdgeOptions:C,fitView:A,fitViewOptions:O,onNodesDelete:T,onEdgesDelete:E,onNodeDrag:R,onNodeDragStart:D,onNodeDragStop:z,onSelectionDrag:I,onSelectionDragStart:$,onSelectionDragStop:F,noPanClassName:q,nodeOrigin:V,rfId:L,autoPanOnConnect:B,autoPanOnNodeDrag:Y,onError:W,connectionRadius:K,isValidConnection:Q,nodeDragThreshold:X})=>{const{setNodes:ee,setEdges:U,setDefaultNodesAndEdges:G,setMinZoom:ae,setMaxZoom:ce,setTranslateExtent:de,setNodeExtent:je,reset:le}=Et(pce,Sr),se=xr();return S.useEffect(()=>{const $e=n==null?void 0:n.map(Pt=>({...Pt,...C}));return G(r,$e),()=>{le()}},[]),Ke("defaultEdgeOptions",C,se.setState),Ke("connectionMode",w,se.setState),Ke("onConnect",a,se.setState),Ke("onConnectStart",i,se.setState),Ke("onConnectEnd",s,se.setState),Ke("onClickConnectStart",l,se.setState),Ke("onClickConnectEnd",c,se.setState),Ke("nodesDraggable",u,se.setState),Ke("nodesConnectable",d,se.setState),Ke("nodesFocusable",f,se.setState),Ke("edgesFocusable",h,se.setState),Ke("edgesUpdatable",p,se.setState),Ke("elementsSelectable",j,se.setState),Ke("elevateNodesOnSelect",m,se.setState),Ke("snapToGrid",N,se.setState),Ke("snapGrid",k,se.setState),Ke("onNodesChange",v,se.setState),Ke("onEdgesChange",b,se.setState),Ke("connectOnClick",P,se.setState),Ke("fitViewOnInit",A,se.setState),Ke("fitViewOnInitOptions",O,se.setState),Ke("onNodesDelete",T,se.setState),Ke("onEdgesDelete",E,se.setState),Ke("onNodeDrag",R,se.setState),Ke("onNodeDragStart",D,se.setState),Ke("onNodeDragStop",z,se.setState),Ke("onSelectionDrag",I,se.setState),Ke("onSelectionDragStart",$,se.setState),Ke("onSelectionDragStop",F,se.setState),Ke("noPanClassName",q,se.setState),Ke("nodeOrigin",V,se.setState),Ke("rfId",L,se.setState),Ke("autoPanOnConnect",B,se.setState),Ke("autoPanOnNodeDrag",Y,se.setState),Ke("onError",W,se.setState),Ke("connectionRadius",K,se.setState),Ke("isValidConnection",Q,se.setState),Ke("nodeDragThreshold",X,se.setState),Ml(e,ee),Ml(t,U),Ml(g,ae),Ml(y,ce),Ml(_,de),Ml(x,je),null},SM={display:"none"},gce={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},cB="react-flow__node-desc",uB="react-flow__edge-desc",xce="react-flow__aria-live",yce=e=>e.ariaLiveMessage;function vce({rfId:e}){const t=Et(yce);return M.createElement("div",{id:`${xce}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:gce},t)}function bce({rfId:e,disableKeyboardA11y:t}){return M.createElement(M.Fragment,null,M.createElement("div",{id:`${cB}-${e}`,style:SM},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),M.createElement("div",{id:`${uB}-${e}`,style:SM},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&M.createElement(vce,{rfId:e}))}var Wf=(e=null,t={actInsideInputWithModifier:!0})=>{const[r,n]=S.useState(!1),a=S.useRef(!1),i=S.useRef(new Set([])),[s,l]=S.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return S.useEffect(()=>{const c=typeof document<"u"?document:null,u=(t==null?void 0:t.target)||c;if(e!==null){const d=p=>{if(a.current=p.ctrlKey||p.metaKey||p.shiftKey,(!a.current||a.current&&!t.actInsideInputWithModifier)&&TN(p))return!1;const g=EM(p.code,l);i.current.add(p[g]),_M(s,i.current,!1)&&(p.preventDefault(),n(!0))},f=p=>{if((!a.current||a.current&&!t.actInsideInputWithModifier)&&TN(p))return!1;const g=EM(p.code,l);_M(s,i.current,!0)?(n(!1),i.current.clear()):i.current.delete(p[g]),p.key==="Meta"&&i.current.clear(),a.current=!1},h=()=>{i.current.clear(),n(!1)};return u==null||u.addEventListener("keydown",d),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",h),()=>{u==null||u.removeEventListener("keydown",d),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",h)}}},[e,n]),r};function _M(e,t,r){return e.filter(n=>r||n.length===t.size).some(n=>n.every(a=>t.has(a)))}function EM(e,t){return t.includes(e)?"code":"key"}function dB(e,t,r,n){var l,c;const a=e.parentNode||e.parentId;if(!a)return r;const i=t.get(a),s=Uo(i,n);return dB(i,t,{x:(r.x??0)+s.x,y:(r.y??0)+s.y,z:(((l=i[Qt])==null?void 0:l.z)??0)>(r.z??0)?((c=i[Qt])==null?void 0:c.z)??0:r.z??0},n)}function fB(e,t,r){e.forEach(n=>{var i;const a=n.parentNode||n.parentId;if(a&&!e.has(a))throw new Error(`Parent node ${a} not found`);if(a||r!=null&&r[n.id]){const{x:s,y:l,z:c}=dB(n,e,{...n.position,z:((i=n[Qt])==null?void 0:i.z)??0},t);n.positionAbsolute={x:s,y:l},n[Qt].z=c,r!=null&&r[n.id]&&(n[Qt].isParent=!0)}})}function kv(e,t,r,n){const a=new Map,i={},s=n?1e3:0;return e.forEach(l=>{var p;const c=(Gn(l.zIndex)?l.zIndex:0)+(l.selected?s:0),u=t.get(l.id),d={...l,positionAbsolute:{x:l.position.x,y:l.position.y}},f=l.parentNode||l.parentId;f&&(i[f]=!0);const h=(u==null?void 0:u.type)&&(u==null?void 0:u.type)!==l.type;Object.defineProperty(d,Qt,{enumerable:!1,value:{handleBounds:h||(p=u==null?void 0:u[Qt])==null?void 0:p.handleBounds,z:c}}),a.set(l.id,d)}),fB(a,r,i),a}function hB(e,t={}){const{getNodes:r,width:n,height:a,minZoom:i,maxZoom:s,d3Zoom:l,d3Selection:c,fitViewOnInitDone:u,fitViewOnInit:d,nodeOrigin:f}=e(),h=t.initial&&!u&&d;if(l&&c&&(h||!t.initial)){const m=r().filter(y=>{var v;const x=t.includeHiddenNodes?y.width&&y.height:!y.hidden;return(v=t.nodes)!=null&&v.length?x&&t.nodes.some(b=>b.id===y.id):x}),g=m.every(y=>y.width&&y.height);if(m.length>0&&g){const y=gx(m,f),{x,y:v,zoom:b}=Q9(y,n,a,t.minZoom??i,t.maxZoom??s,t.padding??.1),j=bi.translate(x,v).scale(b);return typeof t.duration=="number"&&t.duration>0?l.transform(vo(c,t.duration),j):l.transform(c,j),!0}}return!1}function wce(e,t){return e.forEach(r=>{const n=t.get(r.id);n&&t.set(n.id,{...n,[Qt]:n[Qt],selected:r.selected})}),new Map(t)}function jce(e,t){return t.map(r=>{const n=e.find(a=>a.id===r.id);return n&&(r.selected=n.selected),r})}function Fp({changedNodes:e,changedEdges:t,get:r,set:n}){const{nodeInternals:a,edges:i,onNodesChange:s,onEdgesChange:l,hasDefaultNodes:c,hasDefaultEdges:u}=r();e!=null&&e.length&&(c&&n({nodeInternals:wce(e,a)}),s==null||s(e)),t!=null&&t.length&&(u&&n({edges:jce(t,i)}),l==null||l(t))}const Rl=()=>{},kce={zoomIn:Rl,zoomOut:Rl,zoomTo:Rl,getZoom:()=>1,setViewport:Rl,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Rl,fitBounds:Rl,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Nce=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),Sce=()=>{const e=xr(),{d3Zoom:t,d3Selection:r}=Et(Nce,Sr);return S.useMemo(()=>r&&t?{zoomIn:a=>t.scaleBy(vo(r,a==null?void 0:a.duration),1.2),zoomOut:a=>t.scaleBy(vo(r,a==null?void 0:a.duration),1/1.2),zoomTo:(a,i)=>t.scaleTo(vo(r,i==null?void 0:i.duration),a),getZoom:()=>e.getState().transform[2],setViewport:(a,i)=>{const[s,l,c]=e.getState().transform,u=bi.translate(a.x??s,a.y??l).scale(a.zoom??c);t.transform(vo(r,i==null?void 0:i.duration),u)},getViewport:()=>{const[a,i,s]=e.getState().transform;return{x:a,y:i,zoom:s}},fitView:a=>hB(e.getState,a),setCenter:(a,i,s)=>{const{width:l,height:c,maxZoom:u}=e.getState(),d=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,f=l/2-a*d,h=c/2-i*d,p=bi.translate(f,h).scale(d);t.transform(vo(r,s==null?void 0:s.duration),p)},fitBounds:(a,i)=>{const{width:s,height:l,minZoom:c,maxZoom:u}=e.getState(),{x:d,y:f,zoom:h}=Q9(a,s,l,c,u,(i==null?void 0:i.padding)??.1),p=bi.translate(d,f).scale(h);t.transform(vo(r,i==null?void 0:i.duration),p)},project:a=>{const{transform:i,snapToGrid:s,snapGrid:l}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),DN(a,i,s,l)},screenToFlowPosition:a=>{const{transform:i,snapToGrid:s,snapGrid:l,domNode:c}=e.getState();if(!c)return a;const{x:u,y:d}=c.getBoundingClientRect(),f={x:a.x-u,y:a.y-d};return DN(f,i,s,l)},flowToScreenPosition:a=>{const{transform:i,domNode:s}=e.getState();if(!s)return a;const{x:l,y:c}=s.getBoundingClientRect(),u=Y9(a,i);return{x:u.x+l,y:u.y+c}},viewportInitialized:!0}:kce,[t,r])};function jP(){const e=Sce(),t=xr(),r=S.useCallback(()=>t.getState().getNodes().map(g=>({...g})),[]),n=S.useCallback(g=>t.getState().nodeInternals.get(g),[]),a=S.useCallback(()=>{const{edges:g=[]}=t.getState();return g.map(y=>({...y}))},[]),i=S.useCallback(g=>{const{edges:y=[]}=t.getState();return y.find(x=>x.id===g)},[]),s=S.useCallback(g=>{const{getNodes:y,setNodes:x,hasDefaultNodes:v,onNodesChange:b}=t.getState(),j=y(),w=typeof g=="function"?g(j):g;if(v)x(w);else if(b){const k=w.length===0?j.map(N=>({type:"remove",id:N.id})):w.map(N=>({item:N,type:"reset"}));b(k)}},[]),l=S.useCallback(g=>{const{edges:y=[],setEdges:x,hasDefaultEdges:v,onEdgesChange:b}=t.getState(),j=typeof g=="function"?g(y):g;if(v)x(j);else if(b){const w=j.length===0?y.map(k=>({type:"remove",id:k.id})):j.map(k=>({item:k,type:"reset"}));b(w)}},[]),c=S.useCallback(g=>{const y=Array.isArray(g)?g:[g],{getNodes:x,setNodes:v,hasDefaultNodes:b,onNodesChange:j}=t.getState();if(b){const k=[...x(),...y];v(k)}else if(j){const w=y.map(k=>({item:k,type:"add"}));j(w)}},[]),u=S.useCallback(g=>{const y=Array.isArray(g)?g:[g],{edges:x=[],setEdges:v,hasDefaultEdges:b,onEdgesChange:j}=t.getState();if(b)v([...x,...y]);else if(j){const w=y.map(k=>({item:k,type:"add"}));j(w)}},[]),d=S.useCallback(()=>{const{getNodes:g,edges:y=[],transform:x}=t.getState(),[v,b,j]=x;return{nodes:g().map(w=>({...w})),edges:y.map(w=>({...w})),viewport:{x:v,y:b,zoom:j}}},[]),f=S.useCallback(({nodes:g,edges:y})=>{const{nodeInternals:x,getNodes:v,edges:b,hasDefaultNodes:j,hasDefaultEdges:w,onNodesDelete:k,onEdgesDelete:N,onNodesChange:_,onEdgesChange:P}=t.getState(),C=(g||[]).map(R=>R.id),A=(y||[]).map(R=>R.id),O=v().reduce((R,D)=>{const z=D.parentNode||D.parentId,I=!C.includes(D.id)&&z&&R.find(F=>F.id===z);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(C.includes(D.id)||I)&&R.push(D),R},[]),T=b.filter(R=>typeof R.deletable=="boolean"?R.deletable:!0),E=T.filter(R=>A.includes(R.id));if(O||E){const R=Z9(O,T),D=[...E,...R],z=D.reduce((I,$)=>(I.includes($.id)||I.push($.id),I),[]);if((w||j)&&(w&&t.setState({edges:b.filter(I=>!z.includes(I.id))}),j&&(O.forEach(I=>{x.delete(I.id)}),t.setState({nodeInternals:new Map(x)}))),z.length>0&&(N==null||N(D),P&&P(z.map(I=>({id:I,type:"remove"})))),O.length>0&&(k==null||k(O),_)){const I=O.map($=>({id:$.id,type:"remove"}));_(I)}}},[]),h=S.useCallback(g=>{const y=Hle(g),x=y?null:t.getState().nodeInternals.get(g.id);return!y&&!x?[null,null,y]:[y?g:yM(x),x,y]},[]),p=S.useCallback((g,y=!0,x)=>{const[v,b,j]=h(g);return v?(x||t.getState().getNodes()).filter(w=>{if(!j&&(w.id===b.id||!w.positionAbsolute))return!1;const k=yM(w),N=ON(k,v);return y&&N>0||N>=v.width*v.height}):[]},[]),m=S.useCallback((g,y,x=!0)=>{const[v]=h(g);if(!v)return!1;const b=ON(v,y);return x&&b>0||b>=v.width*v.height},[]);return S.useMemo(()=>({...e,getNodes:r,getNode:n,getEdges:a,getEdge:i,setNodes:s,setEdges:l,addNodes:c,addEdges:u,toObject:d,deleteElements:f,getIntersectingNodes:p,isNodeIntersecting:m}),[e,r,n,a,i,s,l,c,u,d,f,p,m])}const _ce={actInsideInputWithModifier:!1};var Ece=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const r=xr(),{deleteElements:n}=jP(),a=Wf(e,_ce),i=Wf(t);S.useEffect(()=>{if(a){const{edges:s,getNodes:l}=r.getState(),c=l().filter(d=>d.selected),u=s.filter(d=>d.selected);n({nodes:c,edges:u}),r.setState({nodesSelectionActive:!1})}},[a]),S.useEffect(()=>{r.setState({multiSelectionActive:i})},[i])};function Pce(e){const t=xr();S.useEffect(()=>{let r;const n=()=>{var i,s;if(!e.current)return;const a=pP(e.current);(a.height===0||a.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",Ii.error004())),t.setState({width:a.width||500,height:a.height||500})};return n(),window.addEventListener("resize",n),e.current&&(r=new ResizeObserver(()=>n()),r.observe(e.current)),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}},[])}const kP={position:"absolute",width:"100%",height:"100%",top:0,left:0},Cce=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Bp=e=>({x:e.x,y:e.y,zoom:e.k}),Dl=(e,t)=>e.target.closest(`.${t}`),PM=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),CM=e=>{const t=e.ctrlKey&&T0()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},Ace=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Oce=({onMove:e,onMoveStart:t,onMoveEnd:r,onPaneContextMenu:n,zoomOnScroll:a=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=To.Free,zoomOnDoubleClick:u=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:h,translateExtent:p,minZoom:m,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:x=!0,children:v,noWheelClassName:b,noPanClassName:j})=>{const w=S.useRef(),k=xr(),N=S.useRef(!1),_=S.useRef(!1),P=S.useRef(null),C=S.useRef({x:0,y:0,zoom:0}),{d3Zoom:A,d3Selection:O,d3ZoomHandler:T,userSelectionActive:E}=Et(Ace,Sr),R=Wf(y),D=S.useRef(0),z=S.useRef(!1),I=S.useRef();return Pce(P),S.useEffect(()=>{if(P.current){const $=P.current.getBoundingClientRect(),F=I9().scaleExtent([m,g]).translateExtent(p),q=Un(P.current).call(F),V=bi.translate(h.x,h.y).scale(Gc(h.zoom,m,g)),L=[[0,0],[$.width,$.height]],B=F.constrain()(V,L,p);F.transform(q,B),F.wheelDelta(CM),k.setState({d3Zoom:F,d3Selection:q,d3ZoomHandler:q.on("wheel.zoom"),transform:[B.x,B.y,B.k],domNode:P.current.closest(".react-flow")})}},[]),S.useEffect(()=>{O&&A&&(s&&!R&&!E?O.on("wheel.zoom",$=>{if(Dl($,b))return!1;$.preventDefault(),$.stopImmediatePropagation();const F=O.property("__zoom").k||1;if($.ctrlKey&&i){const Q=xa($),X=CM($),ee=F*Math.pow(2,X);A.scaleTo(O,ee,Q,$);return}const q=$.deltaMode===1?20:1;let V=c===To.Vertical?0:$.deltaX*q,L=c===To.Horizontal?0:$.deltaY*q;!T0()&&$.shiftKey&&c!==To.Vertical&&(V=$.deltaY*q,L=0),A.translateBy(O,-(V/F)*l,-(L/F)*l,{internal:!0});const B=Bp(O.property("__zoom")),{onViewportChangeStart:Y,onViewportChange:W,onViewportChangeEnd:K}=k.getState();clearTimeout(I.current),z.current||(z.current=!0,t==null||t($,B),Y==null||Y(B)),z.current&&(e==null||e($,B),W==null||W(B),I.current=setTimeout(()=>{r==null||r($,B),K==null||K(B),z.current=!1},150))},{passive:!1}):typeof T<"u"&&O.on("wheel.zoom",function($,F){if(!x&&$.type==="wheel"&&!$.ctrlKey||Dl($,b))return null;$.preventDefault(),T.call(this,$,F)},{passive:!1}))},[E,s,c,O,A,T,R,i,x,b,t,e,r]),S.useEffect(()=>{A&&A.on("start",$=>{var V,L;if(!$.sourceEvent||$.sourceEvent.internal)return null;D.current=(V=$.sourceEvent)==null?void 0:V.button;const{onViewportChangeStart:F}=k.getState(),q=Bp($.transform);N.current=!0,C.current=q,((L=$.sourceEvent)==null?void 0:L.type)==="mousedown"&&k.setState({paneDragging:!0}),F==null||F(q),t==null||t($.sourceEvent,q)})},[A,t]),S.useEffect(()=>{A&&(E&&!N.current?A.on("zoom",null):E||A.on("zoom",$=>{var q;const{onViewportChange:F}=k.getState();if(k.setState({transform:[$.transform.x,$.transform.y,$.transform.k]}),_.current=!!(n&&PM(f,D.current??0)),(e||F)&&!((q=$.sourceEvent)!=null&&q.internal)){const V=Bp($.transform);F==null||F(V),e==null||e($.sourceEvent,V)}}))},[E,A,e,f,n]),S.useEffect(()=>{A&&A.on("end",$=>{if(!$.sourceEvent||$.sourceEvent.internal)return null;const{onViewportChangeEnd:F}=k.getState();if(N.current=!1,k.setState({paneDragging:!1}),n&&PM(f,D.current??0)&&!_.current&&n($.sourceEvent),_.current=!1,(r||F)&&Cce(C.current,$.transform)){const q=Bp($.transform);C.current=q,clearTimeout(w.current),w.current=setTimeout(()=>{F==null||F(q),r==null||r($.sourceEvent,q)},s?150:0)}})},[A,s,f,r,n]),S.useEffect(()=>{A&&A.filter($=>{const F=R||a,q=i&&$.ctrlKey;if((f===!0||Array.isArray(f)&&f.includes(1))&&$.button===1&&$.type==="mousedown"&&(Dl($,"react-flow__node")||Dl($,"react-flow__edge")))return!0;if(!f&&!F&&!s&&!u&&!i||E||!u&&$.type==="dblclick"||Dl($,b)&&$.type==="wheel"||Dl($,j)&&($.type!=="wheel"||s&&$.type==="wheel"&&!R)||!i&&$.ctrlKey&&$.type==="wheel"||!F&&!s&&!q&&$.type==="wheel"||!f&&($.type==="mousedown"||$.type==="touchstart")||Array.isArray(f)&&!f.includes($.button)&&$.type==="mousedown")return!1;const V=Array.isArray(f)&&f.includes($.button)||!$.button||$.button<=1;return(!$.ctrlKey||$.type==="wheel")&&V})},[E,A,a,i,s,u,f,d,R]),M.createElement("div",{className:"react-flow__renderer",ref:P,style:kP},v)},Tce=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Mce(){const{userSelectionActive:e,userSelectionRect:t}=Et(Tce,Sr);return e&&t?M.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function AM(e,t){const r=t.parentNode||t.parentId,n=e.find(a=>a.id===r);if(n){const a=t.position.x+t.width-n.width,i=t.position.y+t.height-n.height;if(a>0||i>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,a>0&&(n.style.width+=a),i>0&&(n.style.height+=i),t.position.x<0){const s=Math.abs(t.position.x);n.position.x=n.position.x-s,n.style.width+=s,t.position.x=0}if(t.position.y<0){const s=Math.abs(t.position.y);n.position.y=n.position.y-s,n.style.height+=s,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function pB(e,t){if(e.some(n=>n.type==="reset"))return e.filter(n=>n.type==="reset").map(n=>n.item);const r=e.filter(n=>n.type==="add").map(n=>n.item);return t.reduce((n,a)=>{const i=e.filter(l=>l.id===a.id);if(i.length===0)return n.push(a),n;const s={...a};for(const l of i)if(l)switch(l.type){case"select":{s.selected=l.selected;break}case"position":{typeof l.position<"u"&&(s.position=l.position),typeof l.positionAbsolute<"u"&&(s.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(s.dragging=l.dragging),s.expandParent&&AM(n,s);break}case"dimensions":{typeof l.dimensions<"u"&&(s.width=l.dimensions.width,s.height=l.dimensions.height),typeof l.updateStyle<"u"&&(s.style={...s.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(s.resizing=l.resizing),s.expandParent&&AM(n,s);break}case"remove":return n}return n.push(s),n},r)}function mB(e,t){return pB(e,t)}function Rce(e,t){return pB(e,t)}const fs=(e,t)=>({id:e,type:"select",selected:t});function lc(e,t){return e.reduce((r,n)=>{const a=t.includes(n.id);return!n.selected&&a?(n.selected=!0,r.push(fs(n.id,!0))):n.selected&&!a&&(n.selected=!1,r.push(fs(n.id,!1))),r},[])}const Nv=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},Dce=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),gB=S.memo(({isSelecting:e,selectionMode:t=Hf.Full,panOnDrag:r,onSelectionStart:n,onSelectionEnd:a,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:l,onPaneMouseEnter:c,onPaneMouseMove:u,onPaneMouseLeave:d,children:f})=>{const h=S.useRef(null),p=xr(),m=S.useRef(0),g=S.useRef(0),y=S.useRef(),{userSelectionActive:x,elementsSelectable:v,dragging:b}=Et(Dce,Sr),j=()=>{p.setState({userSelectionActive:!1,userSelectionRect:null}),m.current=0,g.current=0},w=T=>{i==null||i(T),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},k=T=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){T.preventDefault();return}s==null||s(T)},N=l?T=>l(T):void 0,_=T=>{const{resetSelectedElements:E,domNode:R}=p.getState();if(y.current=R==null?void 0:R.getBoundingClientRect(),!v||!e||T.button!==0||T.target!==h.current||!y.current)return;const{x:D,y:z}=Is(T,y.current);E(),p.setState({userSelectionRect:{width:0,height:0,startX:D,startY:z,x:D,y:z}}),n==null||n(T)},P=T=>{const{userSelectionRect:E,nodeInternals:R,edges:D,transform:z,onNodesChange:I,onEdgesChange:$,nodeOrigin:F,getNodes:q}=p.getState();if(!e||!y.current||!E)return;p.setState({userSelectionActive:!0,nodesSelectionActive:!1});const V=Is(T,y.current),L=E.startX??0,B=E.startY??0,Y={...E,x:V.x<L?V.x:L,y:V.y<B?V.y:B,width:Math.abs(V.x-L),height:Math.abs(V.y-B)},W=q(),K=X9(R,Y,z,t===Hf.Partial,!0,F),Q=Z9(K,D).map(ee=>ee.id),X=K.map(ee=>ee.id);if(m.current!==X.length){m.current=X.length;const ee=lc(W,X);ee.length&&(I==null||I(ee))}if(g.current!==Q.length){g.current=Q.length;const ee=lc(D,Q);ee.length&&($==null||$(ee))}p.setState({userSelectionRect:Y})},C=T=>{if(T.button!==0)return;const{userSelectionRect:E}=p.getState();!x&&E&&T.target===h.current&&(w==null||w(T)),p.setState({nodesSelectionActive:m.current>0}),j(),a==null||a(T)},A=T=>{x&&(p.setState({nodesSelectionActive:m.current>0}),a==null||a(T)),j()},O=v&&(e||x);return M.createElement("div",{className:Dr(["react-flow__pane",{dragging:b,selection:e}]),onClick:O?void 0:Nv(w,h),onContextMenu:Nv(k,h),onWheel:Nv(N,h),onMouseEnter:O?void 0:c,onMouseDown:O?_:void 0,onMouseMove:O?P:u,onMouseUp:O?C:void 0,onMouseLeave:O?A:d,ref:h,style:kP},f,M.createElement(Mce,null))});gB.displayName="Pane";function xB(e,t){const r=e.parentNode||e.parentId;if(!r)return!1;const n=t.get(r);return n?n.selected?!0:xB(n,t):!1}function OM(e,t,r){let n=e;do{if(n!=null&&n.matches(t))return!0;if(n===r.current)return!1;n=n.parentElement}while(n);return!1}function $ce(e,t,r,n){return Array.from(e.values()).filter(a=>(a.selected||a.id===n)&&(!a.parentNode||a.parentId||!xB(a,e))&&(a.draggable||t&&typeof a.draggable>"u")).map(a=>{var i,s;return{id:a.id,position:a.position||{x:0,y:0},positionAbsolute:a.positionAbsolute||{x:0,y:0},distance:{x:r.x-(((i=a.positionAbsolute)==null?void 0:i.x)??0),y:r.y-(((s=a.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:a.extent,parentNode:a.parentNode||a.parentId,parentId:a.parentNode||a.parentId,width:a.width,height:a.height,expandParent:a.expandParent}})}function Ice(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function yB(e,t,r,n,a=[0,0],i){const s=Ice(e,e.extent||n);let l=s;const c=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(c&&e.width&&e.height){const f=r.get(c),{x:h,y:p}=Uo(f,a).positionAbsolute;l=f&&Gn(h)&&Gn(p)&&Gn(f.width)&&Gn(f.height)?[[h+e.width*a[0],p+e.height*a[1]],[h+f.width-e.width+e.width*a[0],p+f.height-e.height+e.height*a[1]]]:l}else i==null||i("005",Ii.error005()),l=s;else if(e.extent&&c&&e.extent!=="parent"){const f=r.get(c),{x:h,y:p}=Uo(f,a).positionAbsolute;l=[[e.extent[0][0]+h,e.extent[0][1]+p],[e.extent[1][0]+h,e.extent[1][1]+p]]}let u={x:0,y:0};if(c){const f=r.get(c);u=Uo(f,a).positionAbsolute}const d=l&&l!=="parent"?mP(t,l):t;return{position:{x:d.x-u.x,y:d.y-u.y},positionAbsolute:d}}function Sv({nodeId:e,dragItems:t,nodeInternals:r}){const n=t.map(a=>({...r.get(a.id),position:a.position,positionAbsolute:a.positionAbsolute}));return[e?n.find(a=>a.id===e):n[0],n]}const TM=(e,t,r,n)=>{const a=t.querySelectorAll(e);if(!a||!a.length)return null;const i=Array.from(a),s=t.getBoundingClientRect(),l={x:s.width*n[0],y:s.height*n[1]};return i.map(c=>{const u=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(u.left-s.left-l.x)/r,y:(u.top-s.top-l.y)/r,...pP(c)}})};function cd(e,t,r){return r===void 0?r:n=>{const a=t().nodeInternals.get(e);a&&r(n,{...a})}}function IN({id:e,store:t,unselect:r=!1,nodeRef:n}){const{addSelectedNodes:a,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Ii.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(r||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=n==null?void 0:n.current)==null?void 0:d.blur()})):a([e])}function Lce(){const e=xr();return S.useCallback(({sourceEvent:r})=>{const{transform:n,snapGrid:a,snapToGrid:i}=e.getState(),s=r.touches?r.touches[0].clientX:r.clientX,l=r.touches?r.touches[0].clientY:r.clientY,c={x:(s-n[0])/n[2],y:(l-n[1])/n[2]};return{xSnapped:i?a[0]*Math.round(c.x/a[0]):c.x,ySnapped:i?a[1]*Math.round(c.y/a[1]):c.y,...c}},[])}function _v(e){return(t,r,n)=>e==null?void 0:e(t,n)}function vB({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:n,nodeId:a,isSelectable:i,selectNodesOnDrag:s}){const l=xr(),[c,u]=S.useState(!1),d=S.useRef([]),f=S.useRef({x:null,y:null}),h=S.useRef(0),p=S.useRef(null),m=S.useRef({x:0,y:0}),g=S.useRef(null),y=S.useRef(!1),x=S.useRef(!1),v=S.useRef(!1),b=Lce();return S.useEffect(()=>{if(e!=null&&e.current){const j=Un(e.current),w=({x:_,y:P})=>{const{nodeInternals:C,onNodeDrag:A,onSelectionDrag:O,updateNodePositions:T,nodeExtent:E,snapGrid:R,snapToGrid:D,nodeOrigin:z,onError:I}=l.getState();f.current={x:_,y:P};let $=!1,F={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&E){const V=gx(d.current,z);F=Uf(V)}if(d.current=d.current.map(V=>{const L={x:_-V.distance.x,y:P-V.distance.y};D&&(L.x=R[0]*Math.round(L.x/R[0]),L.y=R[1]*Math.round(L.y/R[1]));const B=[[E[0][0],E[0][1]],[E[1][0],E[1][1]]];d.current.length>1&&E&&!V.extent&&(B[0][0]=V.positionAbsolute.x-F.x+E[0][0],B[1][0]=V.positionAbsolute.x+(V.width??0)-F.x2+E[1][0],B[0][1]=V.positionAbsolute.y-F.y+E[0][1],B[1][1]=V.positionAbsolute.y+(V.height??0)-F.y2+E[1][1]);const Y=yB(V,L,C,B,z,I);return $=$||V.position.x!==Y.position.x||V.position.y!==Y.position.y,V.position=Y.position,V.positionAbsolute=Y.positionAbsolute,V}),!$)return;T(d.current,!0,!0),u(!0);const q=a?A:_v(O);if(q&&g.current){const[V,L]=Sv({nodeId:a,dragItems:d.current,nodeInternals:C});q(g.current,V,L)}},k=()=>{if(!p.current)return;const[_,P]=z9(m.current,p.current);if(_!==0||P!==0){const{transform:C,panBy:A}=l.getState();f.current.x=(f.current.x??0)-_/C[2],f.current.y=(f.current.y??0)-P/C[2],A({x:_,y:P})&&w(f.current)}h.current=requestAnimationFrame(k)},N=_=>{var z;const{nodeInternals:P,multiSelectionActive:C,nodesDraggable:A,unselectNodesAndEdges:O,onNodeDragStart:T,onSelectionDragStart:E}=l.getState();x.current=!0;const R=a?T:_v(E);(!s||!i)&&!C&&a&&((z=P.get(a))!=null&&z.selected||O()),a&&i&&s&&IN({id:a,store:l,nodeRef:e});const D=b(_);if(f.current=D,d.current=$ce(P,A,D,a),R&&d.current){const[I,$]=Sv({nodeId:a,dragItems:d.current,nodeInternals:P});R(_.sourceEvent,I,$)}};if(t)j.on(".drag",null);else{const _=Use().on("start",P=>{const{domNode:C,nodeDragThreshold:A}=l.getState();A===0&&N(P),v.current=!1;const O=b(P);f.current=O,p.current=(C==null?void 0:C.getBoundingClientRect())||null,m.current=Is(P.sourceEvent,p.current)}).on("drag",P=>{var T,E;const C=b(P),{autoPanOnNodeDrag:A,nodeDragThreshold:O}=l.getState();if(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1&&(v.current=!0),!v.current){if(!y.current&&x.current&&A&&(y.current=!0,k()),!x.current){const R=C.xSnapped-(((T=f==null?void 0:f.current)==null?void 0:T.x)??0),D=C.ySnapped-(((E=f==null?void 0:f.current)==null?void 0:E.y)??0);Math.sqrt(R*R+D*D)>O&&N(P)}(f.current.x!==C.xSnapped||f.current.y!==C.ySnapped)&&d.current&&x.current&&(g.current=P.sourceEvent,m.current=Is(P.sourceEvent,p.current),w(C))}}).on("end",P=>{if(!(!x.current||v.current)&&(u(!1),y.current=!1,x.current=!1,cancelAnimationFrame(h.current),d.current)){const{updateNodePositions:C,nodeInternals:A,onNodeDragStop:O,onSelectionDragStop:T}=l.getState(),E=a?O:_v(T);if(C(d.current,!1,!1),E){const[R,D]=Sv({nodeId:a,dragItems:d.current,nodeInternals:A});E(P.sourceEvent,R,D)}}}).filter(P=>{const C=P.target;return!P.button&&(!r||!OM(C,`.${r}`,e))&&(!n||OM(C,n,e))});return j.call(_),()=>{j.on(".drag",null)}}}},[e,t,r,n,i,l,a,s,b]),c}function bB(){const e=xr();return S.useCallback(r=>{const{nodeInternals:n,nodeExtent:a,updateNodePositions:i,getNodes:s,snapToGrid:l,snapGrid:c,onError:u,nodesDraggable:d}=e.getState(),f=s().filter(v=>v.selected&&(v.draggable||d&&typeof v.draggable>"u")),h=l?c[0]:5,p=l?c[1]:5,m=r.isShiftPressed?4:1,g=r.x*h*m,y=r.y*p*m,x=f.map(v=>{if(v.positionAbsolute){const b={x:v.positionAbsolute.x+g,y:v.positionAbsolute.y+y};l&&(b.x=c[0]*Math.round(b.x/c[0]),b.y=c[1]*Math.round(b.y/c[1]));const{positionAbsolute:j,position:w}=yB(v,b,n,a,void 0,u);v.position=w,v.positionAbsolute=j}return v});i(x,!0,!1)},[])}const Sc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ud=e=>{const t=({id:r,type:n,data:a,xPos:i,yPos:s,xPosOrigin:l,yPosOrigin:c,selected:u,onClick:d,onMouseEnter:f,onMouseMove:h,onMouseLeave:p,onContextMenu:m,onDoubleClick:g,style:y,className:x,isDraggable:v,isSelectable:b,isConnectable:j,isFocusable:w,selectNodesOnDrag:k,sourcePosition:N,targetPosition:_,hidden:P,resizeObserver:C,dragHandle:A,zIndex:O,isParent:T,noDragClassName:E,noPanClassName:R,initialized:D,disableKeyboardA11y:z,ariaLabel:I,rfId:$,hasHandleBounds:F})=>{const q=xr(),V=S.useRef(null),L=S.useRef(null),B=S.useRef(N),Y=S.useRef(_),W=S.useRef(n),K=b||v||d||f||h||p,Q=bB(),X=cd(r,q.getState,f),ee=cd(r,q.getState,h),U=cd(r,q.getState,p),G=cd(r,q.getState,m),ae=cd(r,q.getState,g),ce=le=>{const{nodeDragThreshold:se}=q.getState();if(b&&(!k||!v||se>0)&&IN({id:r,store:q,nodeRef:V}),d){const $e=q.getState().nodeInternals.get(r);$e&&d(le,{...$e})}},de=le=>{if(!TN(le)&&!z)if(q9.includes(le.key)&&b){const se=le.key==="Escape";IN({id:r,store:q,unselect:se,nodeRef:V})}else v&&u&&Object.prototype.hasOwnProperty.call(Sc,le.key)&&(q.setState({ariaLiveMessage:`Moved selected node ${le.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),Q({x:Sc[le.key].x,y:Sc[le.key].y,isShiftPressed:le.shiftKey}))};S.useEffect(()=>()=>{L.current&&(C==null||C.unobserve(L.current),L.current=null)},[]),S.useEffect(()=>{if(V.current&&!P){const le=V.current;(!D||!F||L.current!==le)&&(L.current&&(C==null||C.unobserve(L.current)),C==null||C.observe(le),L.current=le)}},[P,D,F]),S.useEffect(()=>{const le=W.current!==n,se=B.current!==N,$e=Y.current!==_;V.current&&(le||se||$e)&&(le&&(W.current=n),se&&(B.current=N),$e&&(Y.current=_),q.getState().updateNodeDimensions([{id:r,nodeElement:V.current,forceUpdate:!0}]))},[r,n,N,_]);const je=vB({nodeRef:V,disabled:P||!v,noDragClassName:E,handleSelector:A,nodeId:r,isSelectable:b,selectNodesOnDrag:k});return P?null:M.createElement("div",{className:Dr(["react-flow__node",`react-flow__node-${n}`,{[R]:v},x,{selected:u,selectable:b,parent:T,dragging:je}]),ref:V,style:{zIndex:O,transform:`translate(${l}px,${c}px)`,pointerEvents:K?"all":"none",visibility:D?"visible":"hidden",...y},"data-id":r,"data-testid":`rf__node-${r}`,onMouseEnter:X,onMouseMove:ee,onMouseLeave:U,onContextMenu:G,onClick:ce,onDoubleClick:ae,onKeyDown:w?de:void 0,tabIndex:w?0:void 0,role:w?"button":void 0,"aria-describedby":z?void 0:`${cB}-${$}`,"aria-label":I},M.createElement(Qle,{value:r},M.createElement(e,{id:r,data:a,type:n,xPos:i,yPos:s,selected:u,isConnectable:j,sourcePosition:N,targetPosition:_,dragging:je,dragHandle:A,zIndex:O})))};return t.displayName="NodeWrapper",S.memo(t)};const zce=e=>{const t=e.getNodes().filter(r=>r.selected);return{...gx(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function Fce({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const n=xr(),{width:a,height:i,x:s,y:l,transformString:c,userSelectionActive:u}=Et(zce,Sr),d=bB(),f=S.useRef(null);if(S.useEffect(()=>{var m;r||(m=f.current)==null||m.focus({preventScroll:!0})},[r]),vB({nodeRef:f}),u||!a||!i)return null;const h=e?m=>{const g=n.getState().getNodes().filter(y=>y.selected);e(m,g)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(Sc,m.key)&&d({x:Sc[m.key].x,y:Sc[m.key].y,isShiftPressed:m.shiftKey})};return M.createElement("div",{className:Dr(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c}},M.createElement("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:r?void 0:-1,onKeyDown:r?void 0:p,style:{width:a,height:i,top:l,left:s}}))}var Bce=S.memo(Fce);const Vce=e=>e.nodesSelectionActive,wB=({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:n,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:l,onMove:c,onMoveStart:u,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:h,selectionMode:p,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:x,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:j,zoomOnPinch:w,panOnScroll:k,panOnScrollSpeed:N,panOnScrollMode:_,zoomOnDoubleClick:P,panOnDrag:C,defaultViewport:A,translateExtent:O,minZoom:T,maxZoom:E,preventScrolling:R,onSelectionContextMenu:D,noWheelClassName:z,noPanClassName:I,disableKeyboardA11y:$})=>{const F=Et(Vce),q=Wf(f),V=Wf(x),L=V||C,B=V||k,Y=q||h&&L!==!0;return Ece({deleteKeyCode:l,multiSelectionKeyCode:y}),M.createElement(Oce,{onMove:c,onMoveStart:u,onMoveEnd:d,onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:j,zoomOnPinch:w,panOnScroll:B,panOnScrollSpeed:N,panOnScrollMode:_,zoomOnDoubleClick:P,panOnDrag:!q&&L,defaultViewport:A,translateExtent:O,minZoom:T,maxZoom:E,zoomActivationKeyCode:v,preventScrolling:R,noWheelClassName:z,noPanClassName:I},M.createElement(gB,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:n,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:L,isSelecting:!!Y,selectionMode:p},e,F&&M.createElement(Bce,{onSelectionContextMenu:D,noPanClassName:I,disableKeyboardA11y:$})))};wB.displayName="FlowRenderer";var qce=S.memo(wB);function Uce(e){return Et(S.useCallback(r=>e?X9(r.nodeInternals,{x:0,y:0,width:r.width,height:r.height},r.transform,!0):r.getNodes(),[e]))}function Hce(e){const t={input:ud(e.input||iB),default:ud(e.default||$N),output:ud(e.output||oB),group:ud(e.group||wP)},r={},n=Object.keys(e).filter(a=>!["input","default","output","group"].includes(a)).reduce((a,i)=>(a[i]=ud(e[i]||$N),a),r);return{...t,...n}}const Wce=({x:e,y:t,width:r,height:n,origin:a})=>!r||!n?{x:e,y:t}:a[0]<0||a[1]<0||a[0]>1||a[1]>1?{x:e,y:t}:{x:e-r*a[0],y:t-n*a[1]},Gce=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),jB=e=>{const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:n,elementsSelectable:a,updateNodeDimensions:i,onError:s}=Et(Gce,Sr),l=Uce(e.onlyRenderVisibleElements),c=S.useRef(),u=S.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(f=>{const h=f.map(p=>({id:p.target.getAttribute("data-id"),nodeElement:p.target,forceUpdate:!0}));i(h)});return c.current=d,d},[]);return S.useEffect(()=>()=>{var d;(d=c==null?void 0:c.current)==null||d.disconnect()},[]),M.createElement("div",{className:"react-flow__nodes",style:kP},l.map(d=>{var w,k,N;let f=d.type||"default";e.nodeTypes[f]||(s==null||s("003",Ii.error003(f)),f="default");const h=e.nodeTypes[f]||e.nodeTypes.default,p=!!(d.draggable||t&&typeof d.draggable>"u"),m=!!(d.selectable||a&&typeof d.selectable>"u"),g=!!(d.connectable||r&&typeof d.connectable>"u"),y=!!(d.focusable||n&&typeof d.focusable>"u"),x=e.nodeExtent?mP(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,v=(x==null?void 0:x.x)??0,b=(x==null?void 0:x.y)??0,j=Wce({x:v,y:b,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return M.createElement(h,{key:d.id,id:d.id,className:d.className,style:d.style,type:f,data:d.data,sourcePosition:d.sourcePosition||_e.Bottom,targetPosition:d.targetPosition||_e.Top,hidden:d.hidden,xPos:v,yPos:b,xPosOrigin:j.x,yPosOrigin:j.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!d.selected,isDraggable:p,isSelectable:m,isConnectable:g,isFocusable:y,resizeObserver:u,dragHandle:d.dragHandle,zIndex:((w=d[Qt])==null?void 0:w.z)??0,isParent:!!((k=d[Qt])!=null&&k.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel,hasHandleBounds:!!((N=d[Qt])!=null&&N.handleBounds)})}))};jB.displayName="NodeRenderer";var Kce=S.memo(jB);const Yce=(e,t,r)=>r===_e.Left?e-t:r===_e.Right?e+t:e,Xce=(e,t,r)=>r===_e.Top?e-t:r===_e.Bottom?e+t:e,MM="react-flow__edgeupdater",RM=({position:e,centerX:t,centerY:r,radius:n=10,onMouseDown:a,onMouseEnter:i,onMouseOut:s,type:l})=>M.createElement("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:s,className:Dr([MM,`${MM}-${l}`]),cx:Yce(t,n,e),cy:Xce(r,n,e),r:n,stroke:"transparent",fill:"transparent"}),Zce=()=>!0;var $l=e=>{const t=({id:r,className:n,type:a,data:i,onClick:s,onEdgeDoubleClick:l,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:y,source:x,target:v,sourceX:b,sourceY:j,targetX:w,targetY:k,sourcePosition:N,targetPosition:_,elementsSelectable:P,hidden:C,sourceHandleId:A,targetHandleId:O,onContextMenu:T,onMouseEnter:E,onMouseMove:R,onMouseLeave:D,reconnectRadius:z,onReconnect:I,onReconnectStart:$,onReconnectEnd:F,markerEnd:q,markerStart:V,rfId:L,ariaLabel:B,isFocusable:Y,isReconnectable:W,pathOptions:K,interactionWidth:Q,disableKeyboardA11y:X})=>{const ee=S.useRef(null),[U,G]=S.useState(!1),[ae,ce]=S.useState(!1),de=xr(),je=S.useMemo(()=>`url('#${RN(V,L)}')`,[V,L]),le=S.useMemo(()=>`url('#${RN(q,L)}')`,[q,L]);if(C)return null;const se=he=>{var Wr;const{edges:Ee,addSelectedEdges:Pe,unselectNodesAndEdges:Je,multiSelectionActive:vr}=de.getState(),Er=Ee.find(re=>re.id===r);Er&&(P&&(de.setState({nodesSelectionActive:!1}),Er.selected&&vr?(Je({nodes:[],edges:[Er]}),(Wr=ee.current)==null||Wr.blur()):Pe([r])),s&&s(he,Er))},$e=ld(r,de.getState,l),Pt=ld(r,de.getState,T),st=ld(r,de.getState,E),xe=ld(r,de.getState,R),rt=ld(r,de.getState,D),Le=(he,Ee)=>{if(he.button!==0)return;const{edges:Pe,isValidConnection:Je}=de.getState(),vr=Ee?v:x,Er=(Ee?O:A)||null,Wr=Ee?"target":"source",re=Je||Zce,Ae=Ee,Xe=Pe.find(Ct=>Ct.id===r);ce(!0),$==null||$(he,Xe,Wr);const Ze=Ct=>{ce(!1),F==null||F(Ct,Xe,Wr)};tB({event:he,handleId:Er,nodeId:vr,onConnect:Ct=>I==null?void 0:I(Xe,Ct),isTarget:Ae,getState:de.getState,setState:de.setState,isValidConnection:re,edgeUpdaterType:Wr,onReconnectEnd:Ze})},Me=he=>Le(he,!0),ur=he=>Le(he,!1),Vt=()=>G(!0),pt=()=>G(!1),jt=!P&&!s,me=he=>{var Ee;if(!X&&q9.includes(he.key)&&P){const{unselectNodesAndEdges:Pe,addSelectedEdges:Je,edges:vr}=de.getState();he.key==="Escape"?((Ee=ee.current)==null||Ee.blur(),Pe({edges:[vr.find(Wr=>Wr.id===r)]})):Je([r])}};return M.createElement("g",{className:Dr(["react-flow__edge",`react-flow__edge-${a}`,n,{selected:c,animated:u,inactive:jt,updating:U}]),onClick:se,onDoubleClick:$e,onContextMenu:Pt,onMouseEnter:st,onMouseMove:xe,onMouseLeave:rt,onKeyDown:Y?me:void 0,tabIndex:Y?0:void 0,role:Y?"button":"img","data-testid":`rf__edge-${r}`,"aria-label":B===null?void 0:B||`Edge from ${x} to ${v}`,"aria-describedby":Y?`${uB}-${L}`:void 0,ref:ee},!ae&&M.createElement(e,{id:r,source:x,target:v,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,data:i,style:y,sourceX:b,sourceY:j,targetX:w,targetY:k,sourcePosition:N,targetPosition:_,sourceHandleId:A,targetHandleId:O,markerStart:je,markerEnd:le,pathOptions:K,interactionWidth:Q}),W&&M.createElement(M.Fragment,null,(W==="source"||W===!0)&&M.createElement(RM,{position:N,centerX:b,centerY:j,radius:z,onMouseDown:Me,onMouseEnter:Vt,onMouseOut:pt,type:"source"}),(W==="target"||W===!0)&&M.createElement(RM,{position:_,centerX:w,centerY:k,radius:z,onMouseDown:ur,onMouseEnter:Vt,onMouseOut:pt,type:"target"})))};return t.displayName="EdgeWrapper",S.memo(t)};function Qce(e){const t={default:$l(e.default||M0),straight:$l(e.bezier||yP),step:$l(e.step||xP),smoothstep:$l(e.step||mx),simplebezier:$l(e.simplebezier||gP)},r={},n=Object.keys(e).filter(a=>!["default","bezier"].includes(a)).reduce((a,i)=>(a[i]=$l(e[i]||M0),a),r);return{...t,...n}}function DM(e,t,r=null){const n=((r==null?void 0:r.x)||0)+t.x,a=((r==null?void 0:r.y)||0)+t.y,i=(r==null?void 0:r.width)||t.width,s=(r==null?void 0:r.height)||t.height;switch(e){case _e.Top:return{x:n+i/2,y:a};case _e.Right:return{x:n+i,y:a+s/2};case _e.Bottom:return{x:n+i/2,y:a+s};case _e.Left:return{x:n,y:a+s/2}}}function $M(e,t){return e?e.length===1||!t?e[0]:t&&e.find(r=>r.id===t)||null:null}const Jce=(e,t,r,n,a,i)=>{const s=DM(r,e,t),l=DM(i,n,a);return{sourceX:s.x,sourceY:s.y,targetX:l.x,targetY:l.y}};function eue({sourcePos:e,targetPos:t,sourceWidth:r,sourceHeight:n,targetWidth:a,targetHeight:i,width:s,height:l,transform:c}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+r,t.x+a),y2:Math.max(e.y+n,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const d=Uf({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:s/c[2],height:l/c[2]}),f=Math.max(0,Math.min(d.x2,u.x2)-Math.max(d.x,u.x)),h=Math.max(0,Math.min(d.y2,u.y2)-Math.max(d.y,u.y));return Math.ceil(f*h)>0}function IM(e){var n,a,i,s,l;const t=((n=e==null?void 0:e[Qt])==null?void 0:n.handleBounds)||null,r=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.x)<"u"&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!r]}const tue=[{level:0,isMaxLevel:!0,edges:[]}];function rue(e,t,r=!1){let n=-1;const a=e.reduce((s,l)=>{var d,f;const c=Gn(l.zIndex);let u=c?l.zIndex:0;if(r){const h=t.get(l.target),p=t.get(l.source),m=l.selected||(h==null?void 0:h.selected)||(p==null?void 0:p.selected),g=Math.max(((d=p==null?void 0:p[Qt])==null?void 0:d.z)||0,((f=h==null?void 0:h[Qt])==null?void 0:f.z)||0,1e3);u=(c?l.zIndex:0)+(m?g:0)}return s[u]?s[u].push(l):s[u]=[l],n=u>n?u:n,s},{}),i=Object.entries(a).map(([s,l])=>{const c=+s;return{edges:l,level:c,isMaxLevel:c===n}});return i.length===0?tue:i}function nue(e,t,r){const n=Et(S.useCallback(a=>e?a.edges.filter(i=>{const s=t.get(i.source),l=t.get(i.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&eue({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:l.width,targetHeight:l.height,width:a.width,height:a.height,transform:a.transform})}):a.edges,[e,t]));return rue(n,t,r)}const aue=({color:e="none",strokeWidth:t=1})=>M.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),iue=({color:e="none",strokeWidth:t=1})=>M.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),LM={[Kc.Arrow]:aue,[Kc.ArrowClosed]:iue};function sue(e){const t=xr();return S.useMemo(()=>{var a,i;return Object.prototype.hasOwnProperty.call(LM,e)?LM[e]:((i=(a=t.getState()).onError)==null||i.call(a,"009",Ii.error009(e)),null)},[e])}const oue=({id:e,type:t,color:r,width:n=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const c=sue(t);return c?M.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${n}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},M.createElement(c,{color:r,strokeWidth:s})):null},lue=({defaultColor:e,rfId:t})=>r=>{const n=[];return r.edges.reduce((a,i)=>([i.markerStart,i.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const l=RN(s,t);n.includes(l)||(a.push({id:l,color:s.color||e,...s}),n.push(l))}}),a),[]).sort((a,i)=>a.id.localeCompare(i.id))},kB=({defaultColor:e,rfId:t})=>{const r=Et(S.useCallback(lue({defaultColor:e,rfId:t}),[e,t]),(n,a)=>!(n.length!==a.length||n.some((i,s)=>i.id!==a[s].id)));return M.createElement("defs",null,r.map(n=>M.createElement(oue,{id:n.id,key:n.id,type:n.type,color:n.color,width:n.width,height:n.height,markerUnits:n.markerUnits,strokeWidth:n.strokeWidth,orient:n.orient})))};kB.displayName="MarkerDefinitions";var cue=S.memo(kB);const uue=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),NB=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:r,rfId:n,edgeTypes:a,noPanClassName:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,onEdgeDoubleClick:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:m,reconnectRadius:g,children:y,disableKeyboardA11y:x})=>{const{edgesFocusable:v,edgesUpdatable:b,elementsSelectable:j,width:w,height:k,connectionMode:N,nodeInternals:_,onError:P}=Et(uue,Sr),C=nue(t,_,r);return w?M.createElement(M.Fragment,null,C.map(({level:A,edges:O,isMaxLevel:T})=>M.createElement("svg",{key:A,style:{zIndex:A},width:w,height:k,className:"react-flow__edges react-flow__container"},T&&M.createElement(cue,{defaultColor:e,rfId:n}),M.createElement("g",null,O.map(E=>{const[R,D,z]=IM(_.get(E.source)),[I,$,F]=IM(_.get(E.target));if(!z||!F)return null;let q=E.type||"default";a[q]||(P==null||P("011",Ii.error011(q)),q="default");const V=a[q]||a.default,L=N===sl.Strict?$.target:($.target??[]).concat($.source??[]),B=$M(D.source,E.sourceHandle),Y=$M(L,E.targetHandle),W=(B==null?void 0:B.position)||_e.Bottom,K=(Y==null?void 0:Y.position)||_e.Top,Q=!!(E.focusable||v&&typeof E.focusable>"u"),X=E.reconnectable||E.updatable,ee=typeof h<"u"&&(X||b&&typeof X>"u");if(!B||!Y)return P==null||P("008",Ii.error008(B,E)),null;const{sourceX:U,sourceY:G,targetX:ae,targetY:ce}=Jce(R,B,W,I,Y,K);return M.createElement(V,{key:E.id,id:E.id,className:Dr([E.className,i]),type:q,data:E.data,selected:!!E.selected,animated:!!E.animated,hidden:!!E.hidden,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,style:E.style,source:E.source,target:E.target,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerEnd:E.markerEnd,markerStart:E.markerStart,sourceX:U,sourceY:G,targetX:ae,targetY:ce,sourcePosition:W,targetPosition:K,elementsSelectable:j,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onEdgeDoubleClick:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:m,reconnectRadius:g,rfId:n,ariaLabel:E.ariaLabel,isFocusable:Q,isReconnectable:ee,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth,disableKeyboardA11y:x})})))),y):null};NB.displayName="EdgeRenderer";var due=S.memo(NB);const fue=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function hue({children:e}){const t=Et(fue);return M.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function pue(e){const t=jP(),r=S.useRef(!1);S.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const mue={[_e.Left]:_e.Right,[_e.Right]:_e.Left,[_e.Top]:_e.Bottom,[_e.Bottom]:_e.Top},SB=({nodeId:e,handleType:t,style:r,type:n=xs.Bezier,CustomComponent:a,connectionStatus:i})=>{var k,N,_;const{fromNode:s,handleId:l,toX:c,toY:u,connectionMode:d}=Et(S.useCallback(P=>({fromNode:P.nodeInternals.get(e),handleId:P.connectionHandleId,toX:(P.connectionPosition.x-P.transform[0])/P.transform[2],toY:(P.connectionPosition.y-P.transform[1])/P.transform[2],connectionMode:P.connectionMode}),[e]),Sr),f=(k=s==null?void 0:s[Qt])==null?void 0:k.handleBounds;let h=f==null?void 0:f[t];if(d===sl.Loose&&(h=h||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!h)return null;const p=l?h.find(P=>P.id===l):h[0],m=p?p.x+p.width/2:(s.width??0)/2,g=p?p.y+p.height/2:s.height??0,y=(((N=s.positionAbsolute)==null?void 0:N.x)??0)+m,x=(((_=s.positionAbsolute)==null?void 0:_.y)??0)+g,v=p==null?void 0:p.position,b=v?mue[v]:null;if(!v||!b)return null;if(a)return M.createElement(a,{connectionLineType:n,connectionLineStyle:r,fromNode:s,fromHandle:p,fromX:y,fromY:x,toX:c,toY:u,fromPosition:v,toPosition:b,connectionStatus:i});let j="";const w={sourceX:y,sourceY:x,sourcePosition:v,targetX:c,targetY:u,targetPosition:b};return n===xs.Bezier?[j]=K9(w):n===xs.Step?[j]=MN({...w,borderRadius:0}):n===xs.SmoothStep?[j]=MN(w):n===xs.SimpleBezier?[j]=G9(w):j=`M${y},${x} ${c},${u}`,M.createElement("path",{d:j,fill:"none",className:"react-flow__connection-path",style:r})};SB.displayName="ConnectionLine";const gue=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function xue({containerStyle:e,style:t,type:r,component:n}){const{nodeId:a,handleType:i,nodesConnectable:s,width:l,height:c,connectionStatus:u}=Et(gue,Sr);return!(a&&i&&l&&s)?null:M.createElement("svg",{style:e,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},M.createElement("g",{className:Dr(["react-flow__connection",u])},M.createElement(SB,{nodeId:a,handleType:i,style:t,type:r,CustomComponent:n,connectionStatus:u})))}function zM(e,t){return S.useRef(null),xr(),S.useMemo(()=>t(e),[e])}const _B=({nodeTypes:e,edgeTypes:t,onMove:r,onMoveStart:n,onMoveEnd:a,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:p,onSelectionContextMenu:m,onSelectionStart:g,onSelectionEnd:y,connectionLineType:x,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:j,selectionKeyCode:w,selectionOnDrag:k,selectionMode:N,multiSelectionKeyCode:_,panActivationKeyCode:P,zoomActivationKeyCode:C,deleteKeyCode:A,onlyRenderVisibleElements:O,elementsSelectable:T,selectNodesOnDrag:E,defaultViewport:R,translateExtent:D,minZoom:z,maxZoom:I,preventScrolling:$,defaultMarkerColor:F,zoomOnScroll:q,zoomOnPinch:V,panOnScroll:L,panOnScrollSpeed:B,panOnScrollMode:Y,zoomOnDoubleClick:W,panOnDrag:K,onPaneClick:Q,onPaneMouseEnter:X,onPaneMouseMove:ee,onPaneMouseLeave:U,onPaneScroll:G,onPaneContextMenu:ae,onEdgeContextMenu:ce,onEdgeMouseEnter:de,onEdgeMouseMove:je,onEdgeMouseLeave:le,onReconnect:se,onReconnectStart:$e,onReconnectEnd:Pt,reconnectRadius:st,noDragClassName:xe,noWheelClassName:rt,noPanClassName:Le,elevateEdgesOnSelect:Me,disableKeyboardA11y:ur,nodeOrigin:Vt,nodeExtent:pt,rfId:jt})=>{const me=zM(e,Hce),he=zM(t,Qce);return pue(i),M.createElement(qce,{onPaneClick:Q,onPaneMouseEnter:X,onPaneMouseMove:ee,onPaneMouseLeave:U,onPaneContextMenu:ae,onPaneScroll:G,deleteKeyCode:A,selectionKeyCode:w,selectionOnDrag:k,selectionMode:N,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:_,panActivationKeyCode:P,zoomActivationKeyCode:C,elementsSelectable:T,onMove:r,onMoveStart:n,onMoveEnd:a,zoomOnScroll:q,zoomOnPinch:V,zoomOnDoubleClick:W,panOnScroll:L,panOnScrollSpeed:B,panOnScrollMode:Y,panOnDrag:K,defaultViewport:R,translateExtent:D,minZoom:z,maxZoom:I,onSelectionContextMenu:m,preventScrolling:$,noDragClassName:xe,noWheelClassName:rt,noPanClassName:Le,disableKeyboardA11y:ur},M.createElement(hue,null,M.createElement(due,{edgeTypes:he,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:O,onEdgeContextMenu:ce,onEdgeMouseEnter:de,onEdgeMouseMove:je,onEdgeMouseLeave:le,onReconnect:se,onReconnectStart:$e,onReconnectEnd:Pt,reconnectRadius:st,defaultMarkerColor:F,noPanClassName:Le,elevateEdgesOnSelect:!!Me,disableKeyboardA11y:ur,rfId:jt},M.createElement(xue,{style:v,type:x,component:b,containerStyle:j})),M.createElement("div",{className:"react-flow__edgelabel-renderer"}),M.createElement(Kce,{nodeTypes:me,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:p,selectNodesOnDrag:E,onlyRenderVisibleElements:O,noPanClassName:Le,noDragClassName:xe,disableKeyboardA11y:ur,nodeOrigin:Vt,nodeExtent:pt,rfId:jt})))};_B.displayName="GraphView";var yue=S.memo(_B);const LN=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],as={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:LN,nodeExtent:LN,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:sl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:Wle,isValidConnection:void 0},vue=()=>rie((e,t)=>({...as,setNodes:r=>{const{nodeInternals:n,nodeOrigin:a,elevateNodesOnSelect:i}=t();e({nodeInternals:kv(r,n,a,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:r=>{const{defaultEdgeOptions:n={}}=t();e({edges:r.map(a=>({...n,...a}))})},setDefaultNodesAndEdges:(r,n)=>{const a=typeof r<"u",i=typeof n<"u",s=a?kv(r,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:i?n:[],hasDefaultNodes:a,hasDefaultEdges:i})},updateNodeDimensions:r=>{const{onNodesChange:n,nodeInternals:a,fitViewOnInit:i,fitViewOnInitDone:s,fitViewOnInitOptions:l,domNode:c,nodeOrigin:u}=t(),d=c==null?void 0:c.querySelector(".react-flow__viewport");if(!d)return;const f=window.getComputedStyle(d),{m22:h}=new window.DOMMatrixReadOnly(f.transform),p=r.reduce((g,y)=>{const x=a.get(y.id);if(x!=null&&x.hidden)a.set(x.id,{...x,[Qt]:{...x[Qt],handleBounds:void 0}});else if(x){const v=pP(y.nodeElement);!!(v.width&&v.height&&(x.width!==v.width||x.height!==v.height||y.forceUpdate))&&(a.set(x.id,{...x,[Qt]:{...x[Qt],handleBounds:{source:TM(".source",y.nodeElement,h,u),target:TM(".target",y.nodeElement,h,u)}},...v}),g.push({id:x.id,type:"dimensions",dimensions:v}))}return g},[]);fB(a,u);const m=s||i&&!s&&hB(t,{initial:!0,...l});e({nodeInternals:new Map(a),fitViewOnInitDone:m}),(p==null?void 0:p.length)>0&&(n==null||n(p))},updateNodePositions:(r,n=!0,a=!1)=>{const{triggerNodeChanges:i}=t(),s=r.map(l=>{const c={id:l.id,type:"position",dragging:a};return n&&(c.positionAbsolute=l.positionAbsolute,c.position=l.position),c});i(s)},triggerNodeChanges:r=>{const{onNodesChange:n,nodeInternals:a,hasDefaultNodes:i,nodeOrigin:s,getNodes:l,elevateNodesOnSelect:c}=t();if(r!=null&&r.length){if(i){const u=mB(r,l()),d=kv(u,a,s,c);e({nodeInternals:d})}n==null||n(r)}},addSelectedNodes:r=>{const{multiSelectionActive:n,edges:a,getNodes:i}=t();let s,l=null;n?s=r.map(c=>fs(c,!0)):(s=lc(i(),r),l=lc(a,[])),Fp({changedNodes:s,changedEdges:l,get:t,set:e})},addSelectedEdges:r=>{const{multiSelectionActive:n,edges:a,getNodes:i}=t();let s,l=null;n?s=r.map(c=>fs(c,!0)):(s=lc(a,r),l=lc(i(),[])),Fp({changedNodes:l,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:r,edges:n}={})=>{const{edges:a,getNodes:i}=t(),s=r||i(),l=n||a,c=s.map(d=>(d.selected=!1,fs(d.id,!1))),u=l.map(d=>fs(d.id,!1));Fp({changedNodes:c,changedEdges:u,get:t,set:e})},setMinZoom:r=>{const{d3Zoom:n,maxZoom:a}=t();n==null||n.scaleExtent([r,a]),e({minZoom:r})},setMaxZoom:r=>{const{d3Zoom:n,minZoom:a}=t();n==null||n.scaleExtent([a,r]),e({maxZoom:r})},setTranslateExtent:r=>{var n;(n=t().d3Zoom)==null||n.translateExtent(r),e({translateExtent:r})},resetSelectedElements:()=>{const{edges:r,getNodes:n}=t(),i=n().filter(l=>l.selected).map(l=>fs(l.id,!1)),s=r.filter(l=>l.selected).map(l=>fs(l.id,!1));Fp({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:r=>{const{nodeInternals:n}=t();n.forEach(a=>{a.positionAbsolute=mP(a.position,r)}),e({nodeExtent:r,nodeInternals:new Map(n)})},panBy:r=>{const{transform:n,width:a,height:i,d3Zoom:s,d3Selection:l,translateExtent:c}=t();if(!s||!l||!r.x&&!r.y)return!1;const u=bi.translate(n[0]+r.x,n[1]+r.y).scale(n[2]),d=[[0,0],[a,i]],f=s==null?void 0:s.constrain()(u,d,c);return s.transform(l,f),n[0]!==f.x||n[1]!==f.y||n[2]!==f.k},cancelConnection:()=>e({connectionNodeId:as.connectionNodeId,connectionHandleId:as.connectionHandleId,connectionHandleType:as.connectionHandleType,connectionStatus:as.connectionStatus,connectionStartHandle:as.connectionStartHandle,connectionEndHandle:as.connectionEndHandle}),reset:()=>e({...as})}),Object.is),EB=({children:e})=>{const t=S.useRef(null);return t.current||(t.current=vue()),M.createElement(zle,{value:t.current},e)};EB.displayName="ReactFlowProvider";const PB=({children:e})=>S.useContext(px)?M.createElement(M.Fragment,null,e):M.createElement(EB,null,e);PB.displayName="ReactFlowWrapper";const bue={input:iB,default:$N,output:oB,group:wP},wue={default:M0,straight:yP,step:xP,smoothstep:mx,simplebezier:gP},jue=[0,0],kue=[15,15],Nue={x:0,y:0,zoom:1},Sue={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},CB=S.forwardRef(({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,className:a,nodeTypes:i=bue,edgeTypes:s=wue,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:x,onNodeMouseEnter:v,onNodeMouseMove:b,onNodeMouseLeave:j,onNodeContextMenu:w,onNodeDoubleClick:k,onNodeDragStart:N,onNodeDrag:_,onNodeDragStop:P,onNodesDelete:C,onEdgesDelete:A,onSelectionChange:O,onSelectionDragStart:T,onSelectionDrag:E,onSelectionDragStop:R,onSelectionContextMenu:D,onSelectionStart:z,onSelectionEnd:I,connectionMode:$=sl.Strict,connectionLineType:F=xs.Bezier,connectionLineStyle:q,connectionLineComponent:V,connectionLineContainerStyle:L,deleteKeyCode:B="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:W=!1,selectionMode:K=Hf.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:X=T0()?"Meta":"Control",zoomActivationKeyCode:ee=T0()?"Meta":"Control",snapToGrid:U=!1,snapGrid:G=kue,onlyRenderVisibleElements:ae=!1,selectNodesOnDrag:ce=!0,nodesDraggable:de,nodesConnectable:je,nodesFocusable:le,nodeOrigin:se=jue,edgesFocusable:$e,edgesUpdatable:Pt,elementsSelectable:st,defaultViewport:xe=Nue,minZoom:rt=.5,maxZoom:Le=2,translateExtent:Me=LN,preventScrolling:ur=!0,nodeExtent:Vt,defaultMarkerColor:pt="#b1b1b7",zoomOnScroll:jt=!0,zoomOnPinch:me=!0,panOnScroll:he=!1,panOnScrollSpeed:Ee=.5,panOnScrollMode:Pe=To.Free,zoomOnDoubleClick:Je=!0,panOnDrag:vr=!0,onPaneClick:Er,onPaneMouseEnter:Wr,onPaneMouseMove:re,onPaneMouseLeave:Ae,onPaneScroll:Xe,onPaneContextMenu:Ze,children:ut,onEdgeContextMenu:Ct,onEdgeDoubleClick:Mn,onEdgeMouseEnter:Qa,onEdgeMouseMove:kt,onEdgeMouseLeave:Sl,onEdgeUpdate:_l,onEdgeUpdateStart:jy,onEdgeUpdateEnd:ky,onReconnect:H,onReconnectStart:Z,onReconnectEnd:J,reconnectRadius:ie=10,edgeUpdaterRadius:pe=10,onNodesChange:Ce,onEdgesChange:Re,noDragClassName:we="nodrag",noWheelClassName:ke="nowheel",noPanClassName:ye="nopan",fitView:Se=!1,fitViewOptions:ze,connectOnClick:et=!0,attributionPosition:dr,proOptions:vt,defaultEdgeOptions:at,elevateNodesOnSelect:Rt=!0,elevateEdgesOnSelect:Zi=!1,disableKeyboardA11y:Qi=!1,autoPanOnConnect:ua=!0,autoPanOnNodeDrag:Rn=!0,connectionRadius:qu=20,isValidConnection:co,onError:Ja,style:El,id:uo,nodeDragThreshold:nt,...Dt},Ji)=>{const ei=uo||"1";return M.createElement("div",{...Dt,style:{...El,...Sue},ref:Ji,className:Dr(["react-flow",a]),"data-testid":"rf__wrapper",id:uo},M.createElement(PB,null,M.createElement(yue,{onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:b,onNodeMouseLeave:j,onNodeContextMenu:w,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:s,connectionLineType:F,connectionLineStyle:q,connectionLineComponent:V,connectionLineContainerStyle:L,selectionKeyCode:Y,selectionOnDrag:W,selectionMode:K,deleteKeyCode:B,multiSelectionKeyCode:X,panActivationKeyCode:Q,zoomActivationKeyCode:ee,onlyRenderVisibleElements:ae,selectNodesOnDrag:ce,defaultViewport:xe,translateExtent:Me,minZoom:rt,maxZoom:Le,preventScrolling:ur,zoomOnScroll:jt,zoomOnPinch:me,zoomOnDoubleClick:Je,panOnScroll:he,panOnScrollSpeed:Ee,panOnScrollMode:Pe,panOnDrag:vr,onPaneClick:Er,onPaneMouseEnter:Wr,onPaneMouseMove:re,onPaneMouseLeave:Ae,onPaneScroll:Xe,onPaneContextMenu:Ze,onSelectionContextMenu:D,onSelectionStart:z,onSelectionEnd:I,onEdgeContextMenu:Ct,onEdgeDoubleClick:Mn,onEdgeMouseEnter:Qa,onEdgeMouseMove:kt,onEdgeMouseLeave:Sl,onReconnect:H??_l,onReconnectStart:Z??jy,onReconnectEnd:J??ky,reconnectRadius:ie??pe,defaultMarkerColor:pt,noDragClassName:we,noWheelClassName:ke,noPanClassName:ye,elevateEdgesOnSelect:Zi,rfId:ei,disableKeyboardA11y:Qi,nodeOrigin:se,nodeExtent:Vt}),M.createElement(mce,{nodes:e,edges:t,defaultNodes:r,defaultEdges:n,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:x,nodesDraggable:de,nodesConnectable:je,nodesFocusable:le,edgesFocusable:$e,edgesUpdatable:Pt,elementsSelectable:st,elevateNodesOnSelect:Rt,minZoom:rt,maxZoom:Le,nodeExtent:Vt,onNodesChange:Ce,onEdgesChange:Re,snapToGrid:U,snapGrid:G,connectionMode:$,translateExtent:Me,connectOnClick:et,defaultEdgeOptions:at,fitView:Se,fitViewOptions:ze,onNodesDelete:C,onEdgesDelete:A,onNodeDragStart:N,onNodeDrag:_,onNodeDragStop:P,onSelectionDrag:E,onSelectionDragStart:T,onSelectionDragStop:R,noPanClassName:ye,nodeOrigin:se,rfId:ei,autoPanOnConnect:ua,autoPanOnNodeDrag:Rn,onError:Ja,connectionRadius:qu,isValidConnection:co,nodeDragThreshold:nt}),M.createElement(hce,{onSelectionChange:O}),ut,M.createElement(Ble,{proOptions:vt,position:dr}),M.createElement(bce,{rfId:ei,disableKeyboardA11y:Qi})))});CB.displayName="ReactFlow";function AB(e){return t=>{const[r,n]=S.useState(t),a=S.useCallback(i=>n(s=>e(i,s)),[]);return[r,n,a]}}const _ue=AB(mB),Eue=AB(Rce),OB=({id:e,x:t,y:r,width:n,height:a,style:i,color:s,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,onClick:h,selected:p})=>{const{background:m,backgroundColor:g}=i||{},y=s||m||g;return M.createElement("rect",{className:Dr(["react-flow__minimap-node",{selected:p},u]),x:t,y:r,rx:d,ry:d,width:n,height:a,fill:y,stroke:l,strokeWidth:c,shapeRendering:f,onClick:h?x=>h(x,e):void 0})};OB.displayName="MiniMapNode";var Pue=S.memo(OB);const Cue=e=>e.nodeOrigin,Aue=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),Ev=e=>e instanceof Function?e:()=>e;function Oue({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:r="",nodeBorderRadius:n=5,nodeStrokeWidth:a=2,nodeComponent:i=Pue,onClick:s}){const l=Et(Aue,Sr),c=Et(Cue),u=Ev(t),d=Ev(e),f=Ev(r),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return M.createElement(M.Fragment,null,l.map(p=>{const{x:m,y:g}=Uo(p,c).positionAbsolute;return M.createElement(i,{key:p.id,x:m,y:g,width:p.width,height:p.height,style:p.style,selected:p.selected,className:f(p),color:u(p),borderRadius:n,strokeColor:d(p),strokeWidth:a,shapeRendering:h,onClick:s,id:p.id})}))}var Tue=S.memo(Oue);const Mue=200,Rue=150,Due=e=>{const t=e.getNodes(),r={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:r,boundingRect:t.length>0?Ule(gx(t,e.nodeOrigin),r):r,rfId:e.rfId}},$ue="react-flow__minimap-desc";function TB({style:e,className:t,nodeStrokeColor:r="transparent",nodeColor:n="#e2e2e2",nodeClassName:a="",nodeBorderRadius:i=5,nodeStrokeWidth:s=2,nodeComponent:l,maskColor:c="rgb(240, 240, 240, 0.6)",maskStrokeColor:u="none",maskStrokeWidth:d=1,position:f="bottom-right",onClick:h,onNodeClick:p,pannable:m=!1,zoomable:g=!1,ariaLabel:y="React Flow mini map",inversePan:x=!1,zoomStep:v=10,offsetScale:b=5}){const j=xr(),w=S.useRef(null),{boundingRect:k,viewBB:N,rfId:_}=Et(Due,Sr),P=(e==null?void 0:e.width)??Mue,C=(e==null?void 0:e.height)??Rue,A=k.width/P,O=k.height/C,T=Math.max(A,O),E=T*P,R=T*C,D=b*T,z=k.x-(E-k.width)/2-D,I=k.y-(R-k.height)/2-D,$=E+D*2,F=R+D*2,q=`${$ue}-${_}`,V=S.useRef(0);V.current=T,S.useEffect(()=>{if(w.current){const Y=Un(w.current),W=X=>{const{transform:ee,d3Selection:U,d3Zoom:G}=j.getState();if(X.sourceEvent.type!=="wheel"||!U||!G)return;const ae=-X.sourceEvent.deltaY*(X.sourceEvent.deltaMode===1?.05:X.sourceEvent.deltaMode?1:.002)*v,ce=ee[2]*Math.pow(2,ae);G.scaleTo(U,ce)},K=X=>{const{transform:ee,d3Selection:U,d3Zoom:G,translateExtent:ae,width:ce,height:de}=j.getState();if(X.sourceEvent.type!=="mousemove"||!U||!G)return;const je=V.current*Math.max(1,ee[2])*(x?-1:1),le={x:ee[0]-X.sourceEvent.movementX*je,y:ee[1]-X.sourceEvent.movementY*je},se=[[0,0],[ce,de]],$e=bi.translate(le.x,le.y).scale(ee[2]),Pt=G.constrain()($e,se,ae);G.transform(U,Pt)},Q=I9().on("zoom",m?K:null).on("zoom.wheel",g?W:null);return Y.call(Q),()=>{Y.on("zoom",null)}}},[m,g,x,v]);const L=h?Y=>{const W=xa(Y);h(Y,{x:W[0],y:W[1]})}:void 0,B=p?(Y,W)=>{const K=j.getState().nodeInternals.get(W);p(Y,K)}:void 0;return M.createElement(hP,{position:f,style:e,className:Dr(["react-flow__minimap",t]),"data-testid":"rf__minimap"},M.createElement("svg",{width:P,height:C,viewBox:`${z} ${I} ${$} ${F}`,role:"img","aria-labelledby":q,ref:w,onClick:L},y&&M.createElement("title",{id:q},y),M.createElement(Tue,{onClick:B,nodeColor:n,nodeStrokeColor:r,nodeBorderRadius:i,nodeClassName:a,nodeStrokeWidth:s,nodeComponent:l}),M.createElement("path",{className:"react-flow__minimap-mask",d:`M${z-D},${I-D}h${$+D*2}v${F+D*2}h${-$-D*2}z
649
+ M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fill:c,fillRule:"evenodd",stroke:u,strokeWidth:d,pointerEvents:"none"})))}TB.displayName="MiniMap";var Iue=S.memo(TB);function Lue(){return M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},M.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function zue(){return M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},M.createElement("path",{d:"M0 0h32v4.2H0z"}))}function Fue(){return M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},M.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function Bue(){return M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},M.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function Vue(){return M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},M.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const Od=({children:e,className:t,...r})=>M.createElement("button",{type:"button",className:Dr(["react-flow__controls-button",t]),...r},e);Od.displayName="ControlButton";const que=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),MB=({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:n=!0,fitViewOptions:a,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left"})=>{const h=xr(),[p,m]=S.useState(!1),{isInteractive:g,minZoomReached:y,maxZoomReached:x}=Et(que,Sr),{zoomIn:v,zoomOut:b,fitView:j}=jP();if(S.useEffect(()=>{m(!0)},[]),!p)return null;const w=()=>{v(),i==null||i()},k=()=>{b(),s==null||s()},N=()=>{j(a),l==null||l()},_=()=>{h.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c==null||c(!g)};return M.createElement(hP,{className:Dr(["react-flow__controls",u]),position:f,style:e,"data-testid":"rf__controls"},t&&M.createElement(M.Fragment,null,M.createElement(Od,{onClick:w,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:x},M.createElement(Lue,null)),M.createElement(Od,{onClick:k,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:y},M.createElement(zue,null))),r&&M.createElement(Od,{className:"react-flow__controls-fitview",onClick:N,title:"fit view","aria-label":"fit view"},M.createElement(Fue,null)),n&&M.createElement(Od,{className:"react-flow__controls-interactive",onClick:_,title:"toggle interactivity","aria-label":"toggle interactivity"},g?M.createElement(Vue,null):M.createElement(Bue,null)),d)};MB.displayName="Controls";var Uue=S.memo(MB),Pa;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Pa||(Pa={}));function Hue({color:e,dimensions:t,lineWidth:r}){return M.createElement("path",{stroke:e,strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function Wue({color:e,radius:t}){return M.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const Gue={[Pa.Dots]:"#91919a",[Pa.Lines]:"#eee",[Pa.Cross]:"#e2e2e2"},Kue={[Pa.Dots]:1,[Pa.Lines]:1,[Pa.Cross]:6},Yue=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function RB({id:e,variant:t=Pa.Dots,gap:r=20,size:n,lineWidth:a=1,offset:i=2,color:s,style:l,className:c}){const u=S.useRef(null),{transform:d,patternId:f}=Et(Yue,Sr),h=s||Gue[t],p=n||Kue[t],m=t===Pa.Dots,g=t===Pa.Cross,y=Array.isArray(r)?r:[r,r],x=[y[0]*d[2]||1,y[1]*d[2]||1],v=p*d[2],b=g?[v,v]:x,j=m?[v/i,v/i]:[b[0]/i,b[1]/i];return M.createElement("svg",{className:Dr(["react-flow__background",c]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:u,"data-testid":"rf__background"},M.createElement("pattern",{id:f+e,x:d[0]%x[0],y:d[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${j[0]},-${j[1]})`},m?M.createElement(Wue,{color:h,radius:v/i}):M.createElement(Hue,{dimensions:b,color:h,lineWidth:a})),M.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}RB.displayName="Background";var Xue=S.memo(RB);function NP(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Pv,FM;function Zue(){if(FM)return Pv;FM=1;function e(){this.__data__=[],this.size=0}return Pv=e,Pv}var Cv,BM;function Cu(){if(BM)return Cv;BM=1;function e(t,r){return t===r||t!==t&&r!==r}return Cv=e,Cv}var Av,VM;function xx(){if(VM)return Av;VM=1;var e=Cu();function t(r,n){for(var a=r.length;a--;)if(e(r[a][0],n))return a;return-1}return Av=t,Av}var Ov,qM;function Que(){if(qM)return Ov;qM=1;var e=xx(),t=Array.prototype,r=t.splice;function n(a){var i=this.__data__,s=e(i,a);if(s<0)return!1;var l=i.length-1;return s==l?i.pop():r.call(i,s,1),--this.size,!0}return Ov=n,Ov}var Tv,UM;function Jue(){if(UM)return Tv;UM=1;var e=xx();function t(r){var n=this.__data__,a=e(n,r);return a<0?void 0:n[a][1]}return Tv=t,Tv}var Mv,HM;function ede(){if(HM)return Mv;HM=1;var e=xx();function t(r){return e(this.__data__,r)>-1}return Mv=t,Mv}var Rv,WM;function tde(){if(WM)return Rv;WM=1;var e=xx();function t(r,n){var a=this.__data__,i=e(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return Rv=t,Rv}var Dv,GM;function yx(){if(GM)return Dv;GM=1;var e=Zue(),t=Que(),r=Jue(),n=ede(),a=tde();function i(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var u=s[l];this.set(u[0],u[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Dv=i,Dv}var $v,KM;function rde(){if(KM)return $v;KM=1;var e=yx();function t(){this.__data__=new e,this.size=0}return $v=t,$v}var Iv,YM;function nde(){if(YM)return Iv;YM=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Iv=e,Iv}var Lv,XM;function ade(){if(XM)return Lv;XM=1;function e(t){return this.__data__.get(t)}return Lv=e,Lv}var zv,ZM;function ide(){if(ZM)return zv;ZM=1;function e(t){return this.__data__.has(t)}return zv=e,zv}var Fv,QM;function DB(){if(QM)return Fv;QM=1;var e=typeof ip=="object"&&ip&&ip.Object===Object&&ip;return Fv=e,Fv}var Bv,JM;function Ma(){if(JM)return Bv;JM=1;var e=DB(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Bv=r,Bv}var Vv,e5;function Au(){if(e5)return Vv;e5=1;var e=Ma(),t=e.Symbol;return Vv=t,Vv}var qv,t5;function sde(){if(t5)return qv;t5=1;var e=Au(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,a=e?e.toStringTag:void 0;function i(s){var l=r.call(s,a),c=s[a];try{s[a]=void 0;var u=!0}catch{}var d=n.call(s);return u&&(l?s[a]=c:delete s[a]),d}return qv=i,qv}var Uv,r5;function ode(){if(r5)return Uv;r5=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Uv=r,Uv}var Hv,n5;function Hi(){if(n5)return Hv;n5=1;var e=Au(),t=sde(),r=ode(),n="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function s(l){return l==null?l===void 0?a:n:i&&i in Object(l)?t(l):r(l)}return Hv=s,Hv}var Wv,a5;function tn(){if(a5)return Wv;a5=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Wv=e,Wv}var Gv,i5;function Ou(){if(i5)return Gv;i5=1;var e=Hi(),t=tn(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function s(l){if(!t(l))return!1;var c=e(l);return c==n||c==a||c==r||c==i}return Gv=s,Gv}var Kv,s5;function lde(){if(s5)return Kv;s5=1;var e=Ma(),t=e["__core-js_shared__"];return Kv=t,Kv}var Yv,o5;function cde(){if(o5)return Yv;o5=1;var e=lde(),t=function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!t&&t in n}return Yv=r,Yv}var Xv,l5;function $B(){if(l5)return Xv;l5=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Xv=r,Xv}var Zv,c5;function ude(){if(c5)return Zv;c5=1;var e=Ou(),t=cde(),r=tn(),n=$B(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,c=s.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!r(h)||t(h))return!1;var p=e(h)?d:i;return p.test(n(h))}return Zv=f,Zv}var Qv,u5;function dde(){if(u5)return Qv;u5=1;function e(t,r){return t==null?void 0:t[r]}return Qv=e,Qv}var Jv,d5;function gl(){if(d5)return Jv;d5=1;var e=ude(),t=dde();function r(n,a){var i=t(n,a);return e(i)?i:void 0}return Jv=r,Jv}var eb,f5;function SP(){if(f5)return eb;f5=1;var e=gl(),t=Ma(),r=e(t,"Map");return eb=r,eb}var tb,h5;function vx(){if(h5)return tb;h5=1;var e=gl(),t=e(Object,"create");return tb=t,tb}var rb,p5;function fde(){if(p5)return rb;p5=1;var e=vx();function t(){this.__data__=e?e(null):{},this.size=0}return rb=t,rb}var nb,m5;function hde(){if(m5)return nb;m5=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return nb=e,nb}var ab,g5;function pde(){if(g5)return ab;g5=1;var e=vx(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var s=this.__data__;if(e){var l=s[i];return l===t?void 0:l}return n.call(s,i)?s[i]:void 0}return ab=a,ab}var ib,x5;function mde(){if(x5)return ib;x5=1;var e=vx(),t=Object.prototype,r=t.hasOwnProperty;function n(a){var i=this.__data__;return e?i[a]!==void 0:r.call(i,a)}return ib=n,ib}var sb,y5;function gde(){if(y5)return sb;y5=1;var e=vx(),t="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=e&&a===void 0?t:a,this}return sb=r,sb}var ob,v5;function xde(){if(v5)return ob;v5=1;var e=fde(),t=hde(),r=pde(),n=mde(),a=gde();function i(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var u=s[l];this.set(u[0],u[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,ob=i,ob}var lb,b5;function yde(){if(b5)return lb;b5=1;var e=xde(),t=yx(),r=SP();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return lb=n,lb}var cb,w5;function vde(){if(w5)return cb;w5=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return cb=e,cb}var ub,j5;function bx(){if(j5)return ub;j5=1;var e=vde();function t(r,n){var a=r.__data__;return e(n)?a[typeof n=="string"?"string":"hash"]:a.map}return ub=t,ub}var db,k5;function bde(){if(k5)return db;k5=1;var e=bx();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return db=t,db}var fb,N5;function wde(){if(N5)return fb;N5=1;var e=bx();function t(r){return e(this,r).get(r)}return fb=t,fb}var hb,S5;function jde(){if(S5)return hb;S5=1;var e=bx();function t(r){return e(this,r).has(r)}return hb=t,hb}var pb,_5;function kde(){if(_5)return pb;_5=1;var e=bx();function t(r,n){var a=e(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return pb=t,pb}var mb,E5;function _P(){if(E5)return mb;E5=1;var e=yde(),t=bde(),r=wde(),n=jde(),a=kde();function i(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var u=s[l];this.set(u[0],u[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,mb=i,mb}var gb,P5;function Nde(){if(P5)return gb;P5=1;var e=yx(),t=SP(),r=_P(),n=200;function a(i,s){var l=this.__data__;if(l instanceof e){var c=l.__data__;if(!t||c.length<n-1)return c.push([i,s]),this.size=++l.size,this;l=this.__data__=new r(c)}return l.set(i,s),this.size=l.size,this}return gb=a,gb}var xb,C5;function wx(){if(C5)return xb;C5=1;var e=yx(),t=rde(),r=nde(),n=ade(),a=ide(),i=Nde();function s(l){var c=this.__data__=new e(l);this.size=c.size}return s.prototype.clear=t,s.prototype.delete=r,s.prototype.get=n,s.prototype.has=a,s.prototype.set=i,xb=s,xb}var yb,A5;function EP(){if(A5)return yb;A5=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n<a&&r(t[n],n,t)!==!1;);return t}return yb=e,yb}var vb,O5;function IB(){if(O5)return vb;O5=1;var e=gl(),t=function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}}();return vb=t,vb}var bb,T5;function jx(){if(T5)return bb;T5=1;var e=IB();function t(r,n,a){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return bb=t,bb}var wb,M5;function kx(){if(M5)return wb;M5=1;var e=jx(),t=Cu(),r=Object.prototype,n=r.hasOwnProperty;function a(i,s,l){var c=i[s];(!(n.call(i,s)&&t(c,l))||l===void 0&&!(s in i))&&e(i,s,l)}return wb=a,wb}var jb,R5;function Kh(){if(R5)return jb;R5=1;var e=kx(),t=jx();function r(n,a,i,s){var l=!i;i||(i={});for(var c=-1,u=a.length;++c<u;){var d=a[c],f=s?s(i[d],n[d],d,i,n):void 0;f===void 0&&(f=n[d]),l?t(i,d,f):e(i,d,f)}return i}return jb=r,jb}var kb,D5;function Sde(){if(D5)return kb;D5=1;function e(t,r){for(var n=-1,a=Array(t);++n<t;)a[n]=r(n);return a}return kb=e,kb}var Nb,$5;function ia(){if($5)return Nb;$5=1;function e(t){return t!=null&&typeof t=="object"}return Nb=e,Nb}var Sb,I5;function _de(){if(I5)return Sb;I5=1;var e=Hi(),t=ia(),r="[object Arguments]";function n(a){return t(a)&&e(a)==r}return Sb=n,Sb}var _b,L5;function Yh(){if(L5)return _b;L5=1;var e=_de(),t=ia(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(s){return t(s)&&n.call(s,"callee")&&!a.call(s,"callee")};return _b=i,_b}var Eb,z5;function Jt(){if(z5)return Eb;z5=1;var e=Array.isArray;return Eb=e,Eb}var Td={exports:{}},Pb,F5;function Ede(){if(F5)return Pb;F5=1;function e(){return!1}return Pb=e,Pb}Td.exports;var B5;function Tu(){return B5||(B5=1,function(e,t){var r=Ma(),n=Ede(),a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,l=s?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u}(Td,Td.exports)),Td.exports}var Cb,V5;function Nx(){if(V5)return Cb;V5=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??e,!!a&&(i=="number"||i!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<a}return Cb=r,Cb}var Ab,q5;function PP(){if(q5)return Ab;q5=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return Ab=t,Ab}var Ob,U5;function Pde(){if(U5)return Ob;U5=1;var e=Hi(),t=PP(),r=ia(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",s="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",d="[object Number]",f="[object Object]",h="[object RegExp]",p="[object Set]",m="[object String]",g="[object WeakMap]",y="[object ArrayBuffer]",x="[object DataView]",v="[object Float32Array]",b="[object Float64Array]",j="[object Int8Array]",w="[object Int16Array]",k="[object Int32Array]",N="[object Uint8Array]",_="[object Uint8ClampedArray]",P="[object Uint16Array]",C="[object Uint32Array]",A={};A[v]=A[b]=A[j]=A[w]=A[k]=A[N]=A[_]=A[P]=A[C]=!0,A[n]=A[a]=A[y]=A[i]=A[x]=A[s]=A[l]=A[c]=A[u]=A[d]=A[f]=A[h]=A[p]=A[m]=A[g]=!1;function O(T){return r(T)&&t(T.length)&&!!A[e(T)]}return Ob=O,Ob}var Tb,H5;function Sx(){if(H5)return Tb;H5=1;function e(t){return function(r){return t(r)}}return Tb=e,Tb}var Md={exports:{}};Md.exports;var W5;function CP(){return W5||(W5=1,function(e,t){var r=DB(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();e.exports=l}(Md,Md.exports)),Md.exports}var Mb,G5;function Xh(){if(G5)return Mb;G5=1;var e=Pde(),t=Sx(),r=CP(),n=r&&r.isTypedArray,a=n?t(n):e;return Mb=a,Mb}var Rb,K5;function LB(){if(K5)return Rb;K5=1;var e=Sde(),t=Yh(),r=Jt(),n=Tu(),a=Nx(),i=Xh(),s=Object.prototype,l=s.hasOwnProperty;function c(u,d){var f=r(u),h=!f&&t(u),p=!f&&!h&&n(u),m=!f&&!h&&!p&&i(u),g=f||h||p||m,y=g?e(u.length,String):[],x=y.length;for(var v in u)(d||l.call(u,v))&&!(g&&(v=="length"||p&&(v=="offset"||v=="parent")||m&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||a(v,x)))&&y.push(v);return y}return Rb=c,Rb}var Db,Y5;function _x(){if(Y5)return Db;Y5=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return Db=t,Db}var $b,X5;function zB(){if(X5)return $b;X5=1;function e(t,r){return function(n){return t(r(n))}}return $b=e,$b}var Ib,Z5;function Cde(){if(Z5)return Ib;Z5=1;var e=zB(),t=e(Object.keys,Object);return Ib=t,Ib}var Lb,Q5;function AP(){if(Q5)return Lb;Q5=1;var e=_x(),t=Cde(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!e(i))return t(i);var s=[];for(var l in Object(i))n.call(i,l)&&l!="constructor"&&s.push(l);return s}return Lb=a,Lb}var zb,J5;function Wi(){if(J5)return zb;J5=1;var e=Ou(),t=PP();function r(n){return n!=null&&t(n.length)&&!e(n)}return zb=r,zb}var Fb,eR;function to(){if(eR)return Fb;eR=1;var e=LB(),t=AP(),r=Wi();function n(a){return r(a)?e(a):t(a)}return Fb=n,Fb}var Bb,tR;function Ade(){if(tR)return Bb;tR=1;var e=Kh(),t=to();function r(n,a){return n&&e(a,t(a),n)}return Bb=r,Bb}var Vb,rR;function Ode(){if(rR)return Vb;rR=1;function e(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}return Vb=e,Vb}var qb,nR;function Tde(){if(nR)return qb;nR=1;var e=tn(),t=_x(),r=Ode(),n=Object.prototype,a=n.hasOwnProperty;function i(s){if(!e(s))return r(s);var l=t(s),c=[];for(var u in s)u=="constructor"&&(l||!a.call(s,u))||c.push(u);return c}return qb=i,qb}var Ub,aR;function xl(){if(aR)return Ub;aR=1;var e=LB(),t=Tde(),r=Wi();function n(a){return r(a)?e(a,!0):t(a)}return Ub=n,Ub}var Hb,iR;function Mde(){if(iR)return Hb;iR=1;var e=Kh(),t=xl();function r(n,a){return n&&e(a,t(a),n)}return Hb=r,Hb}var Rd={exports:{}};Rd.exports;var sR;function FB(){return sR||(sR=1,function(e,t){var r=Ma(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i?r.Buffer:void 0,l=s?s.allocUnsafe:void 0;function c(u,d){if(d)return u.slice();var f=u.length,h=l?l(f):new u.constructor(f);return u.copy(h),h}e.exports=c}(Rd,Rd.exports)),Rd.exports}var Wb,oR;function BB(){if(oR)return Wb;oR=1;function e(t,r){var n=-1,a=t.length;for(r||(r=Array(a));++n<a;)r[n]=t[n];return r}return Wb=e,Wb}var Gb,lR;function VB(){if(lR)return Gb;lR=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,i=0,s=[];++n<a;){var l=t[n];r(l,n,t)&&(s[i++]=l)}return s}return Gb=e,Gb}var Kb,cR;function qB(){if(cR)return Kb;cR=1;function e(){return[]}return Kb=e,Kb}var Yb,uR;function OP(){if(uR)return Yb;uR=1;var e=VB(),t=qB(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(s){return s==null?[]:(s=Object(s),e(a(s),function(l){return n.call(s,l)}))}:t;return Yb=i,Yb}var Xb,dR;function Rde(){if(dR)return Xb;dR=1;var e=Kh(),t=OP();function r(n,a){return e(n,t(n),a)}return Xb=r,Xb}var Zb,fR;function TP(){if(fR)return Zb;fR=1;function e(t,r){for(var n=-1,a=r.length,i=t.length;++n<a;)t[i+n]=r[n];return t}return Zb=e,Zb}var Qb,hR;function Ex(){if(hR)return Qb;hR=1;var e=zB(),t=e(Object.getPrototypeOf,Object);return Qb=t,Qb}var Jb,pR;function UB(){if(pR)return Jb;pR=1;var e=TP(),t=Ex(),r=OP(),n=qB(),a=Object.getOwnPropertySymbols,i=a?function(s){for(var l=[];s;)e(l,r(s)),s=t(s);return l}:n;return Jb=i,Jb}var e1,mR;function Dde(){if(mR)return e1;mR=1;var e=Kh(),t=UB();function r(n,a){return e(n,t(n),a)}return e1=r,e1}var t1,gR;function HB(){if(gR)return t1;gR=1;var e=TP(),t=Jt();function r(n,a,i){var s=a(n);return t(n)?s:e(s,i(n))}return t1=r,t1}var r1,xR;function WB(){if(xR)return r1;xR=1;var e=HB(),t=OP(),r=to();function n(a){return e(a,r,t)}return r1=n,r1}var n1,yR;function $de(){if(yR)return n1;yR=1;var e=HB(),t=UB(),r=xl();function n(a){return e(a,r,t)}return n1=n,n1}var a1,vR;function Ide(){if(vR)return a1;vR=1;var e=gl(),t=Ma(),r=e(t,"DataView");return a1=r,a1}var i1,bR;function Lde(){if(bR)return i1;bR=1;var e=gl(),t=Ma(),r=e(t,"Promise");return i1=r,i1}var s1,wR;function GB(){if(wR)return s1;wR=1;var e=gl(),t=Ma(),r=e(t,"Set");return s1=r,s1}var o1,jR;function zde(){if(jR)return o1;jR=1;var e=gl(),t=Ma(),r=e(t,"WeakMap");return o1=r,o1}var l1,kR;function Mu(){if(kR)return l1;kR=1;var e=Ide(),t=SP(),r=Lde(),n=GB(),a=zde(),i=Hi(),s=$B(),l="[object Map]",c="[object Object]",u="[object Promise]",d="[object Set]",f="[object WeakMap]",h="[object DataView]",p=s(e),m=s(t),g=s(r),y=s(n),x=s(a),v=i;return(e&&v(new e(new ArrayBuffer(1)))!=h||t&&v(new t)!=l||r&&v(r.resolve())!=u||n&&v(new n)!=d||a&&v(new a)!=f)&&(v=function(b){var j=i(b),w=j==c?b.constructor:void 0,k=w?s(w):"";if(k)switch(k){case p:return h;case m:return l;case g:return u;case y:return d;case x:return f}return j}),l1=v,l1}var c1,NR;function Fde(){if(NR)return c1;NR=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&t.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return c1=r,c1}var u1,SR;function KB(){if(SR)return u1;SR=1;var e=Ma(),t=e.Uint8Array;return u1=t,u1}var d1,_R;function MP(){if(_R)return d1;_R=1;var e=KB();function t(r){var n=new r.constructor(r.byteLength);return new e(n).set(new e(r)),n}return d1=t,d1}var f1,ER;function Bde(){if(ER)return f1;ER=1;var e=MP();function t(r,n){var a=n?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return f1=t,f1}var h1,PR;function Vde(){if(PR)return h1;PR=1;var e=/\w*$/;function t(r){var n=new r.constructor(r.source,e.exec(r));return n.lastIndex=r.lastIndex,n}return h1=t,h1}var p1,CR;function qde(){if(CR)return p1;CR=1;var e=Au(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return p1=n,p1}var m1,AR;function YB(){if(AR)return m1;AR=1;var e=MP();function t(r,n){var a=n?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return m1=t,m1}var g1,OR;function Ude(){if(OR)return g1;OR=1;var e=MP(),t=Bde(),r=Vde(),n=qde(),a=YB(),i="[object Boolean]",s="[object Date]",l="[object Map]",c="[object Number]",u="[object RegExp]",d="[object Set]",f="[object String]",h="[object Symbol]",p="[object ArrayBuffer]",m="[object DataView]",g="[object Float32Array]",y="[object Float64Array]",x="[object Int8Array]",v="[object Int16Array]",b="[object Int32Array]",j="[object Uint8Array]",w="[object Uint8ClampedArray]",k="[object Uint16Array]",N="[object Uint32Array]";function _(P,C,A){var O=P.constructor;switch(C){case p:return e(P);case i:case s:return new O(+P);case m:return t(P,A);case g:case y:case x:case v:case b:case j:case w:case k:case N:return a(P,A);case l:return new O;case c:case f:return new O(P);case u:return r(P);case d:return new O;case h:return n(P)}}return g1=_,g1}var x1,TR;function XB(){if(TR)return x1;TR=1;var e=tn(),t=Object.create,r=function(){function n(){}return function(a){if(!e(a))return{};if(t)return t(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}}();return x1=r,x1}var y1,MR;function ZB(){if(MR)return y1;MR=1;var e=XB(),t=Ex(),r=_x();function n(a){return typeof a.constructor=="function"&&!r(a)?e(t(a)):{}}return y1=n,y1}var v1,RR;function Hde(){if(RR)return v1;RR=1;var e=Mu(),t=ia(),r="[object Map]";function n(a){return t(a)&&e(a)==r}return v1=n,v1}var b1,DR;function Wde(){if(DR)return b1;DR=1;var e=Hde(),t=Sx(),r=CP(),n=r&&r.isMap,a=n?t(n):e;return b1=a,b1}var w1,$R;function Gde(){if($R)return w1;$R=1;var e=Mu(),t=ia(),r="[object Set]";function n(a){return t(a)&&e(a)==r}return w1=n,w1}var j1,IR;function Kde(){if(IR)return j1;IR=1;var e=Gde(),t=Sx(),r=CP(),n=r&&r.isSet,a=n?t(n):e;return j1=a,j1}var k1,LR;function QB(){if(LR)return k1;LR=1;var e=wx(),t=EP(),r=kx(),n=Ade(),a=Mde(),i=FB(),s=BB(),l=Rde(),c=Dde(),u=WB(),d=$de(),f=Mu(),h=Fde(),p=Ude(),m=ZB(),g=Jt(),y=Tu(),x=Wde(),v=tn(),b=Kde(),j=to(),w=xl(),k=1,N=2,_=4,P="[object Arguments]",C="[object Array]",A="[object Boolean]",O="[object Date]",T="[object Error]",E="[object Function]",R="[object GeneratorFunction]",D="[object Map]",z="[object Number]",I="[object Object]",$="[object RegExp]",F="[object Set]",q="[object String]",V="[object Symbol]",L="[object WeakMap]",B="[object ArrayBuffer]",Y="[object DataView]",W="[object Float32Array]",K="[object Float64Array]",Q="[object Int8Array]",X="[object Int16Array]",ee="[object Int32Array]",U="[object Uint8Array]",G="[object Uint8ClampedArray]",ae="[object Uint16Array]",ce="[object Uint32Array]",de={};de[P]=de[C]=de[B]=de[Y]=de[A]=de[O]=de[W]=de[K]=de[Q]=de[X]=de[ee]=de[D]=de[z]=de[I]=de[$]=de[F]=de[q]=de[V]=de[U]=de[G]=de[ae]=de[ce]=!0,de[T]=de[E]=de[L]=!1;function je(le,se,$e,Pt,st,xe){var rt,Le=se&k,Me=se&N,ur=se&_;if($e&&(rt=st?$e(le,Pt,st,xe):$e(le)),rt!==void 0)return rt;if(!v(le))return le;var Vt=g(le);if(Vt){if(rt=h(le),!Le)return s(le,rt)}else{var pt=f(le),jt=pt==E||pt==R;if(y(le))return i(le,Le);if(pt==I||pt==P||jt&&!st){if(rt=Me||jt?{}:m(le),!Le)return Me?c(le,a(rt,le)):l(le,n(rt,le))}else{if(!de[pt])return st?le:{};rt=p(le,pt,Le)}}xe||(xe=new e);var me=xe.get(le);if(me)return me;xe.set(le,rt),b(le)?le.forEach(function(Pe){rt.add(je(Pe,se,$e,Pe,le,xe))}):x(le)&&le.forEach(function(Pe,Je){rt.set(Je,je(Pe,se,$e,Je,le,xe))});var he=ur?Me?d:u:Me?w:j,Ee=Vt?void 0:he(le);return t(Ee||le,function(Pe,Je){Ee&&(Je=Pe,Pe=le[Je]),r(rt,Je,je(Pe,se,$e,Je,le,xe))}),rt}return k1=je,k1}var N1,zR;function Yde(){if(zR)return N1;zR=1;var e=QB(),t=4;function r(n){return e(n,t)}return N1=r,N1}var S1,FR;function RP(){if(FR)return S1;FR=1;function e(t){return function(){return t}}return S1=e,S1}var _1,BR;function Xde(){if(BR)return _1;BR=1;function e(t){return function(r,n,a){for(var i=-1,s=Object(r),l=a(r),c=l.length;c--;){var u=l[t?c:++i];if(n(s[u],u,s)===!1)break}return r}}return _1=e,_1}var E1,VR;function DP(){if(VR)return E1;VR=1;var e=Xde(),t=e();return E1=t,E1}var P1,qR;function $P(){if(qR)return P1;qR=1;var e=DP(),t=to();function r(n,a){return n&&e(n,a,t)}return P1=r,P1}var C1,UR;function Zde(){if(UR)return C1;UR=1;var e=Wi();function t(r,n){return function(a,i){if(a==null)return a;if(!e(a))return r(a,i);for(var s=a.length,l=n?s:-1,c=Object(a);(n?l--:++l<s)&&i(c[l],l,c)!==!1;);return a}}return C1=t,C1}var A1,HR;function Ru(){if(HR)return A1;HR=1;var e=$P(),t=Zde(),r=t(e);return A1=r,A1}var O1,WR;function yl(){if(WR)return O1;WR=1;function e(t){return t}return O1=e,O1}var T1,GR;function JB(){if(GR)return T1;GR=1;var e=yl();function t(r){return typeof r=="function"?r:e}return T1=t,T1}var M1,KR;function eV(){if(KR)return M1;KR=1;var e=EP(),t=Ru(),r=JB(),n=Jt();function a(i,s){var l=n(i)?e:t;return l(i,r(s))}return M1=a,M1}var R1,YR;function tV(){return YR||(YR=1,R1=eV()),R1}var D1,XR;function Qde(){if(XR)return D1;XR=1;var e=Ru();function t(r,n){var a=[];return e(r,function(i,s,l){n(i,s,l)&&a.push(i)}),a}return D1=t,D1}var $1,ZR;function Jde(){if(ZR)return $1;ZR=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return $1=t,$1}var I1,QR;function efe(){if(QR)return I1;QR=1;function e(t){return this.__data__.has(t)}return I1=e,I1}var L1,JR;function rV(){if(JR)return L1;JR=1;var e=_P(),t=Jde(),r=efe();function n(a){var i=-1,s=a==null?0:a.length;for(this.__data__=new e;++i<s;)this.add(a[i])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,L1=n,L1}function tfe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var nV=tfe,z1,e4;function aV(){if(e4)return z1;e4=1;function e(t,r){return t.has(r)}return z1=e,z1}var F1,t4;function iV(){if(t4)return F1;t4=1;var e=rV(),t=nV,r=aV(),n=1,a=2;function i(s,l,c,u,d,f){var h=c&n,p=s.length,m=l.length;if(p!=m&&!(h&&m>p))return!1;var g=f.get(s),y=f.get(l);if(g&&y)return g==l&&y==s;var x=-1,v=!0,b=c&a?new e:void 0;for(f.set(s,l),f.set(l,s);++x<p;){var j=s[x],w=l[x];if(u)var k=h?u(w,j,x,l,s,f):u(j,w,x,s,l,f);if(k!==void 0){if(k)continue;v=!1;break}if(b){if(!t(l,function(N,_){if(!r(b,_)&&(j===N||d(j,N,c,u,f)))return b.push(_)})){v=!1;break}}else if(!(j===w||d(j,w,c,u,f))){v=!1;break}}return f.delete(s),f.delete(l),v}return F1=i,F1}var B1,r4;function rfe(){if(r4)return B1;r4=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a,i){n[++r]=[i,a]}),n}return B1=e,B1}var V1,n4;function IP(){if(n4)return V1;n4=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(a){n[++r]=a}),n}return V1=e,V1}var q1,a4;function nfe(){if(a4)return q1;a4=1;var e=Au(),t=KB(),r=Cu(),n=iV(),a=rfe(),i=IP(),s=1,l=2,c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Map]",h="[object Number]",p="[object RegExp]",m="[object Set]",g="[object String]",y="[object Symbol]",x="[object ArrayBuffer]",v="[object DataView]",b=e?e.prototype:void 0,j=b?b.valueOf:void 0;function w(k,N,_,P,C,A,O){switch(_){case v:if(k.byteLength!=N.byteLength||k.byteOffset!=N.byteOffset)return!1;k=k.buffer,N=N.buffer;case x:return!(k.byteLength!=N.byteLength||!A(new t(k),new t(N)));case c:case u:case h:return r(+k,+N);case d:return k.name==N.name&&k.message==N.message;case p:case g:return k==N+"";case f:var T=a;case m:var E=P&s;if(T||(T=i),k.size!=N.size&&!E)return!1;var R=O.get(k);if(R)return R==N;P|=l,O.set(k,N);var D=n(T(k),T(N),P,C,A,O);return O.delete(k),D;case y:if(j)return j.call(k)==j.call(N)}return!1}return q1=w,q1}var U1,i4;function afe(){if(i4)return U1;i4=1;var e=WB(),t=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,s,l,c,u,d){var f=l&t,h=e(i),p=h.length,m=e(s),g=m.length;if(p!=g&&!f)return!1;for(var y=p;y--;){var x=h[y];if(!(f?x in s:n.call(s,x)))return!1}var v=d.get(i),b=d.get(s);if(v&&b)return v==s&&b==i;var j=!0;d.set(i,s),d.set(s,i);for(var w=f;++y<p;){x=h[y];var k=i[x],N=s[x];if(c)var _=f?c(N,k,x,s,i,d):c(k,N,x,i,s,d);if(!(_===void 0?k===N||u(k,N,l,c,d):_)){j=!1;break}w||(w=x=="constructor")}if(j&&!w){var P=i.constructor,C=s.constructor;P!=C&&"constructor"in i&&"constructor"in s&&!(typeof P=="function"&&P instanceof P&&typeof C=="function"&&C instanceof C)&&(j=!1)}return d.delete(i),d.delete(s),j}return U1=a,U1}var H1,s4;function ife(){if(s4)return H1;s4=1;var e=wx(),t=iV(),r=nfe(),n=afe(),a=Mu(),i=Jt(),s=Tu(),l=Xh(),c=1,u="[object Arguments]",d="[object Array]",f="[object Object]",h=Object.prototype,p=h.hasOwnProperty;function m(g,y,x,v,b,j){var w=i(g),k=i(y),N=w?d:a(g),_=k?d:a(y);N=N==u?f:N,_=_==u?f:_;var P=N==f,C=_==f,A=N==_;if(A&&s(g)){if(!s(y))return!1;w=!0,P=!1}if(A&&!P)return j||(j=new e),w||l(g)?t(g,y,x,v,b,j):r(g,y,N,x,v,b,j);if(!(x&c)){var O=P&&p.call(g,"__wrapped__"),T=C&&p.call(y,"__wrapped__");if(O||T){var E=O?g.value():g,R=T?y.value():y;return j||(j=new e),b(E,R,x,v,j)}}return A?(j||(j=new e),n(g,y,x,v,b,j)):!1}return H1=m,H1}var W1,o4;function LP(){if(o4)return W1;o4=1;var e=ife(),t=ia();function r(n,a,i,s,l){return n===a?!0:n==null||a==null||!t(n)&&!t(a)?n!==n&&a!==a:e(n,a,i,s,r,l)}return W1=r,W1}var G1,l4;function sfe(){if(l4)return G1;l4=1;var e=wx(),t=LP(),r=1,n=2;function a(i,s,l,c){var u=l.length,d=u,f=!c;if(i==null)return!d;for(i=Object(i);u--;){var h=l[u];if(f&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++u<d;){h=l[u];var p=h[0],m=i[p],g=h[1];if(f&&h[2]){if(m===void 0&&!(p in i))return!1}else{var y=new e;if(c)var x=c(m,g,p,i,s,y);if(!(x===void 0?t(g,m,r|n,c,y):x))return!1}}return!0}return G1=a,G1}var K1,c4;function sV(){if(c4)return K1;c4=1;var e=tn();function t(r){return r===r&&!e(r)}return K1=t,K1}var Y1,u4;function ofe(){if(u4)return Y1;u4=1;var e=sV(),t=to();function r(n){for(var a=t(n),i=a.length;i--;){var s=a[i],l=n[s];a[i]=[s,l,e(l)]}return a}return Y1=r,Y1}var X1,d4;function oV(){if(d4)return X1;d4=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return X1=e,X1}var Z1,f4;function lfe(){if(f4)return Z1;f4=1;var e=sfe(),t=ofe(),r=oV();function n(a){var i=t(a);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(s){return s===a||e(s,a,i)}}return Z1=n,Z1}var Q1,h4;function Du(){if(h4)return Q1;h4=1;var e=Hi(),t=ia(),r="[object Symbol]";function n(a){return typeof a=="symbol"||t(a)&&e(a)==r}return Q1=n,Q1}var J1,p4;function zP(){if(p4)return J1;p4=1;var e=Jt(),t=Du(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,s){if(e(i))return!1;var l=typeof i;return l=="number"||l=="symbol"||l=="boolean"||i==null||t(i)?!0:n.test(i)||!r.test(i)||s!=null&&i in Object(s)}return J1=a,J1}var ew,m4;function lV(){if(m4)return ew;m4=1;var e=_P(),t="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var i=function(){var s=arguments,l=a?a.apply(this,s):s[0],c=i.cache;if(c.has(l))return c.get(l);var u=n.apply(this,s);return i.cache=c.set(l,u)||c,u};return i.cache=new(r.Cache||e),i}return r.Cache=e,ew=r,ew}var tw,g4;function cfe(){if(g4)return tw;g4=1;var e=lV(),t=500;function r(n){var a=e(n,function(s){return i.size===t&&i.clear(),s}),i=a.cache;return a}return tw=r,tw}var rw,x4;function ufe(){if(x4)return rw;x4=1;var e=cfe(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(t,function(s,l,c,u){i.push(c?u.replace(r,"$1"):l||s)}),i});return rw=n,rw}var nw,y4;function Px(){if(y4)return nw;y4=1;function e(t,r){for(var n=-1,a=t==null?0:t.length,i=Array(a);++n<a;)i[n]=r(t[n],n,t);return i}return nw=e,nw}var aw,v4;function dfe(){if(v4)return aw;v4=1;var e=Au(),t=Px(),r=Jt(),n=Du(),a=e?e.prototype:void 0,i=a?a.toString:void 0;function s(l){if(typeof l=="string")return l;if(r(l))return t(l,s)+"";if(n(l))return i?i.call(l):"";var c=l+"";return c=="0"&&1/l==-1/0?"-0":c}return aw=s,aw}var iw,b4;function FP(){if(b4)return iw;b4=1;var e=dfe();function t(r){return r==null?"":e(r)}return iw=t,iw}var sw,w4;function Cx(){if(w4)return sw;w4=1;var e=Jt(),t=zP(),r=ufe(),n=FP();function a(i,s){return e(i)?i:t(i,s)?[i]:r(n(i))}return sw=a,sw}var ow,j4;function Zh(){if(j4)return ow;j4=1;var e=Du();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return ow=t,ow}var lw,k4;function Ax(){if(k4)return lw;k4=1;var e=Cx(),t=Zh();function r(n,a){a=e(a,n);for(var i=0,s=a.length;n!=null&&i<s;)n=n[t(a[i++])];return i&&i==s?n:void 0}return lw=r,lw}var cw,N4;function cV(){if(N4)return cw;N4=1;var e=Ax();function t(r,n,a){var i=r==null?void 0:e(r,n);return i===void 0?a:i}return cw=t,cw}var uw,S4;function ffe(){if(S4)return uw;S4=1;function e(t,r){return t!=null&&r in Object(t)}return uw=e,uw}var dw,_4;function uV(){if(_4)return dw;_4=1;var e=Cx(),t=Yh(),r=Jt(),n=Nx(),a=PP(),i=Zh();function s(l,c,u){c=e(c,l);for(var d=-1,f=c.length,h=!1;++d<f;){var p=i(c[d]);if(!(h=l!=null&&u(l,p)))break;l=l[p]}return h||++d!=f?h:(f=l==null?0:l.length,!!f&&a(f)&&n(p,f)&&(r(l)||t(l)))}return dw=s,dw}var fw,E4;function dV(){if(E4)return fw;E4=1;var e=ffe(),t=uV();function r(n,a){return n!=null&&t(n,a,e)}return fw=r,fw}var hw,P4;function hfe(){if(P4)return hw;P4=1;var e=LP(),t=cV(),r=dV(),n=zP(),a=sV(),i=oV(),s=Zh(),l=1,c=2;function u(d,f){return n(d)&&a(f)?i(s(d),f):function(h){var p=t(h,d);return p===void 0&&p===f?r(h,d):e(f,p,l|c)}}return hw=u,hw}var pw,C4;function fV(){if(C4)return pw;C4=1;function e(t){return function(r){return r==null?void 0:r[t]}}return pw=e,pw}var mw,A4;function pfe(){if(A4)return mw;A4=1;var e=Ax();function t(r){return function(n){return e(n,r)}}return mw=t,mw}var gw,O4;function mfe(){if(O4)return gw;O4=1;var e=fV(),t=pfe(),r=zP(),n=Zh();function a(i){return r(i)?e(n(i)):t(i)}return gw=a,gw}var xw,T4;function sa(){if(T4)return xw;T4=1;var e=lfe(),t=hfe(),r=yl(),n=Jt(),a=mfe();function i(s){return typeof s=="function"?s:s==null?r:typeof s=="object"?n(s)?t(s[0],s[1]):e(s):a(s)}return xw=i,xw}var yw,M4;function hV(){if(M4)return yw;M4=1;var e=VB(),t=Qde(),r=sa(),n=Jt();function a(i,s){var l=n(i)?e:t;return l(i,r(s,3))}return yw=a,yw}var vw,R4;function gfe(){if(R4)return vw;R4=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n,a){return n!=null&&t.call(n,a)}return vw=r,vw}var bw,D4;function pV(){if(D4)return bw;D4=1;var e=gfe(),t=uV();function r(n,a){return n!=null&&t(n,a,e)}return bw=r,bw}var ww,$4;function xfe(){if($4)return ww;$4=1;var e=AP(),t=Mu(),r=Yh(),n=Jt(),a=Wi(),i=Tu(),s=_x(),l=Xh(),c="[object Map]",u="[object Set]",d=Object.prototype,f=d.hasOwnProperty;function h(p){if(p==null)return!0;if(a(p)&&(n(p)||typeof p=="string"||typeof p.splice=="function"||i(p)||l(p)||r(p)))return!p.length;var m=t(p);if(m==c||m==u)return!p.size;if(s(p))return!e(p).length;for(var g in p)if(f.call(p,g))return!1;return!0}return ww=h,ww}var jw,I4;function mV(){if(I4)return jw;I4=1;function e(t){return t===void 0}return jw=e,jw}var kw,L4;function gV(){if(L4)return kw;L4=1;var e=Ru(),t=Wi();function r(n,a){var i=-1,s=t(n)?Array(n.length):[];return e(n,function(l,c,u){s[++i]=a(l,c,u)}),s}return kw=r,kw}var Nw,z4;function BP(){if(z4)return Nw;z4=1;var e=Px(),t=sa(),r=gV(),n=Jt();function a(i,s){var l=n(i)?e:r;return l(i,t(s,3))}return Nw=a,Nw}var Sw,F4;function yfe(){if(F4)return Sw;F4=1;function e(t,r,n,a){var i=-1,s=t==null?0:t.length;for(a&&s&&(n=t[++i]);++i<s;)n=r(n,t[i],i,t);return n}return Sw=e,Sw}var _w,B4;function vfe(){if(B4)return _w;B4=1;function e(t,r,n,a,i){return i(t,function(s,l,c){n=a?(a=!1,s):r(n,s,l,c)}),n}return _w=e,_w}var Ew,V4;function xV(){if(V4)return Ew;V4=1;var e=yfe(),t=Ru(),r=sa(),n=vfe(),a=Jt();function i(s,l,c){var u=a(s)?e:n,d=arguments.length<3;return u(s,r(l,4),c,d,t)}return Ew=i,Ew}var Pw,q4;function yV(){if(q4)return Pw;q4=1;var e=Hi(),t=Jt(),r=ia(),n="[object String]";function a(i){return typeof i=="string"||!t(i)&&r(i)&&e(i)==n}return Pw=a,Pw}var Cw,U4;function bfe(){if(U4)return Cw;U4=1;var e=fV(),t=e("length");return Cw=t,Cw}var Aw,H4;function VP(){if(H4)return Aw;H4=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,i="\\ufe0e\\ufe0f",s="\\u200d",l=RegExp("["+s+e+a+i+"]");function c(u){return l.test(u)}return Aw=c,Aw}var Ow,W4;function wfe(){if(W4)return Ow;W4=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,i="\\ufe0e\\ufe0f",s="["+e+"]",l="["+a+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+l+"|"+c+")",d="[^"+e+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",p="\\u200d",m=u+"?",g="["+i+"]?",y="(?:"+p+"(?:"+[d,f,h].join("|")+")"+g+m+")*",x=g+m+y,v="(?:"+[d+l+"?",l,f,h,s].join("|")+")",b=RegExp(c+"(?="+c+")|"+v+x,"g");function j(w){for(var k=b.lastIndex=0;b.test(w);)++k;return k}return Ow=j,Ow}var Tw,G4;function jfe(){if(G4)return Tw;G4=1;var e=bfe(),t=VP(),r=wfe();function n(a){return t(a)?r(a):e(a)}return Tw=n,Tw}var Mw,K4;function kfe(){if(K4)return Mw;K4=1;var e=AP(),t=Mu(),r=Wi(),n=yV(),a=jfe(),i="[object Map]",s="[object Set]";function l(c){if(c==null)return 0;if(r(c))return n(c)?a(c):c.length;var u=t(c);return u==i||u==s?c.size:e(c).length}return Mw=l,Mw}var Rw,Y4;function Nfe(){if(Y4)return Rw;Y4=1;var e=EP(),t=XB(),r=$P(),n=sa(),a=Ex(),i=Jt(),s=Tu(),l=Ou(),c=tn(),u=Xh();function d(f,h,p){var m=i(f),g=m||s(f)||u(f);if(h=n(h,4),p==null){var y=f&&f.constructor;g?p=m?new y:[]:c(f)?p=l(y)?t(a(f)):{}:p={}}return(g?e:r)(f,function(x,v,b){return h(p,x,v,b)}),p}return Rw=d,Rw}var Dw,X4;function Sfe(){if(X4)return Dw;X4=1;var e=Au(),t=Yh(),r=Jt(),n=e?e.isConcatSpreadable:void 0;function a(i){return r(i)||t(i)||!!(n&&i&&i[n])}return Dw=a,Dw}var $w,Z4;function Ox(){if(Z4)return $w;Z4=1;var e=TP(),t=Sfe();function r(n,a,i,s,l){var c=-1,u=n.length;for(i||(i=t),l||(l=[]);++c<u;){var d=n[c];a>0&&i(d)?a>1?r(d,a-1,i,s,l):e(l,d):s||(l[l.length]=d)}return l}return $w=r,$w}var Iw,Q4;function _fe(){if(Q4)return Iw;Q4=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return Iw=e,Iw}var Lw,J4;function vV(){if(J4)return Lw;J4=1;var e=_fe(),t=Math.max;function r(n,a,i){return a=t(a===void 0?n.length-1:a,0),function(){for(var s=arguments,l=-1,c=t(s.length-a,0),u=Array(c);++l<c;)u[l]=s[a+l];l=-1;for(var d=Array(a+1);++l<a;)d[l]=s[l];return d[a]=i(u),e(n,this,d)}}return Lw=r,Lw}var zw,e3;function Efe(){if(e3)return zw;e3=1;var e=RP(),t=IB(),r=yl(),n=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:r;return zw=n,zw}var Fw,t3;function Pfe(){if(t3)return Fw;t3=1;var e=800,t=16,r=Date.now;function n(a){var i=0,s=0;return function(){var l=r(),c=t-(l-s);if(s=l,c>0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return Fw=n,Fw}var Bw,r3;function bV(){if(r3)return Bw;r3=1;var e=Efe(),t=Pfe(),r=t(e);return Bw=r,Bw}var Vw,n3;function Tx(){if(n3)return Vw;n3=1;var e=yl(),t=vV(),r=bV();function n(a,i){return r(t(a,i,e),a+"")}return Vw=n,Vw}var qw,a3;function wV(){if(a3)return qw;a3=1;function e(t,r,n,a){for(var i=t.length,s=n+(a?1:-1);a?s--:++s<i;)if(r(t[s],s,t))return s;return-1}return qw=e,qw}var Uw,i3;function Cfe(){if(i3)return Uw;i3=1;function e(t){return t!==t}return Uw=e,Uw}var Hw,s3;function Afe(){if(s3)return Hw;s3=1;function e(t,r,n){for(var a=n-1,i=t.length;++a<i;)if(t[a]===r)return a;return-1}return Hw=e,Hw}var Ww,o3;function Ofe(){if(o3)return Ww;o3=1;var e=wV(),t=Cfe(),r=Afe();function n(a,i,s){return i===i?r(a,i,s):e(a,t,s)}return Ww=n,Ww}var Gw,l3;function Tfe(){if(l3)return Gw;l3=1;var e=Ofe();function t(r,n){var a=r==null?0:r.length;return!!a&&e(r,n,0)>-1}return Gw=t,Gw}var Kw,c3;function Mfe(){if(c3)return Kw;c3=1;function e(t,r,n){for(var a=-1,i=t==null?0:t.length;++a<i;)if(n(r,t[a]))return!0;return!1}return Kw=e,Kw}var Yw,u3;function Rfe(){if(u3)return Yw;u3=1;function e(){}return Yw=e,Yw}var Xw,d3;function Dfe(){if(d3)return Xw;d3=1;var e=GB(),t=Rfe(),r=IP(),n=1/0,a=e&&1/r(new e([,-0]))[1]==n?function(i){return new e(i)}:t;return Xw=a,Xw}var Zw,f3;function jV(){if(f3)return Zw;f3=1;var e=rV(),t=Tfe(),r=Mfe(),n=aV(),a=Dfe(),i=IP(),s=200;function l(c,u,d){var f=-1,h=t,p=c.length,m=!0,g=[],y=g;if(d)m=!1,h=r;else if(p>=s){var x=u?null:a(c);if(x)return i(x);m=!1,h=n,y=new e}else y=u?[]:g;e:for(;++f<p;){var v=c[f],b=u?u(v):v;if(v=d||v!==0?v:0,m&&b===b){for(var j=y.length;j--;)if(y[j]===b)continue e;u&&y.push(b),g.push(v)}else h(y,b,d)||(y!==g&&y.push(b),g.push(v))}return g}return Zw=l,Zw}var Qw,h3;function kV(){if(h3)return Qw;h3=1;var e=Wi(),t=ia();function r(n){return t(n)&&e(n)}return Qw=r,Qw}var Jw,p3;function $fe(){if(p3)return Jw;p3=1;var e=Ox(),t=Tx(),r=jV(),n=kV(),a=t(function(i){return r(e(i,1,n,!0))});return Jw=a,Jw}var ej,m3;function Ife(){if(m3)return ej;m3=1;var e=Px();function t(r,n){return e(n,function(a){return r[a]})}return ej=t,ej}var tj,g3;function NV(){if(g3)return tj;g3=1;var e=Ife(),t=to();function r(n){return n==null?[]:e(n,t(n))}return tj=r,tj}var rj,x3;function oa(){if(x3)return rj;x3=1;var e;if(typeof NP=="function")try{e={clone:Yde(),constant:RP(),each:tV(),filter:hV(),has:pV(),isArray:Jt(),isEmpty:xfe(),isFunction:Ou(),isUndefined:mV(),keys:to(),map:BP(),reduce:xV(),size:kfe(),transform:Nfe(),union:$fe(),values:NV()}}catch{}return e||(e=window._),rj=e,rj}var nj,y3;function qP(){if(y3)return nj;y3=1;var e=oa();nj=a;var t="\0",r="\0",n="";function a(d){this._isDirected=e.has(d,"directed")?d.directed:!0,this._isMultigraph=e.has(d,"multigraph")?d.multigraph:!1,this._isCompound=e.has(d,"compound")?d.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(d){return this._label=d,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(d){return e.isFunction(d)||(d=e.constant(d)),this._defaultNodeLabelFn=d,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return e.keys(this._nodes)},a.prototype.sources=function(){var d=this;return e.filter(this.nodes(),function(f){return e.isEmpty(d._in[f])})},a.prototype.sinks=function(){var d=this;return e.filter(this.nodes(),function(f){return e.isEmpty(d._out[f])})},a.prototype.setNodes=function(d,f){var h=arguments,p=this;return e.each(d,function(m){h.length>1?p.setNode(m,f):p.setNode(m)}),this},a.prototype.setNode=function(d,f){return e.has(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=f),this):(this._nodes[d]=arguments.length>1?f:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]=r,this._children[d]={},this._children[r][d]=!0),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)},a.prototype.node=function(d){return this._nodes[d]},a.prototype.hasNode=function(d){return e.has(this._nodes,d)},a.prototype.removeNode=function(d){var f=this;if(e.has(this._nodes,d)){var h=function(p){f.removeEdge(f._edgeObjs[p])};delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],e.each(this.children(d),function(p){f.setParent(p)}),delete this._children[d]),e.each(e.keys(this._in[d]),h),delete this._in[d],delete this._preds[d],e.each(e.keys(this._out[d]),h),delete this._out[d],delete this._sucs[d],--this._nodeCount}return this},a.prototype.setParent=function(d,f){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(f))f=r;else{f+="";for(var h=f;!e.isUndefined(h);h=this.parent(h))if(h===d)throw new Error("Setting "+f+" as parent of "+d+" would create a cycle");this.setNode(f)}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=f,this._children[f][d]=!0,this},a.prototype._removeFromParentsChildList=function(d){delete this._children[this._parent[d]][d]},a.prototype.parent=function(d){if(this._isCompound){var f=this._parent[d];if(f!==r)return f}},a.prototype.children=function(d){if(e.isUndefined(d)&&(d=r),this._isCompound){var f=this._children[d];if(f)return e.keys(f)}else{if(d===r)return this.nodes();if(this.hasNode(d))return[]}},a.prototype.predecessors=function(d){var f=this._preds[d];if(f)return e.keys(f)},a.prototype.successors=function(d){var f=this._sucs[d];if(f)return e.keys(f)},a.prototype.neighbors=function(d){var f=this.predecessors(d);if(f)return e.union(f,this.successors(d))},a.prototype.isLeaf=function(d){var f;return this.isDirected()?f=this.successors(d):f=this.neighbors(d),f.length===0},a.prototype.filterNodes=function(d){var f=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});f.setGraph(this.graph());var h=this;e.each(this._nodes,function(g,y){d(y)&&f.setNode(y,g)}),e.each(this._edgeObjs,function(g){f.hasNode(g.v)&&f.hasNode(g.w)&&f.setEdge(g,h.edge(g))});var p={};function m(g){var y=h.parent(g);return y===void 0||f.hasNode(y)?(p[g]=y,y):y in p?p[y]:m(y)}return this._isCompound&&e.each(f.nodes(),function(g){f.setParent(g,m(g))}),f},a.prototype.setDefaultEdgeLabel=function(d){return e.isFunction(d)||(d=e.constant(d)),this._defaultEdgeLabelFn=d,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return e.values(this._edgeObjs)},a.prototype.setPath=function(d,f){var h=this,p=arguments;return e.reduce(d,function(m,g){return p.length>1?h.setEdge(m,g,f):h.setEdge(m,g),g}),this},a.prototype.setEdge=function(){var d,f,h,p,m=!1,g=arguments[0];typeof g=="object"&&g!==null&&"v"in g?(d=g.v,f=g.w,h=g.name,arguments.length===2&&(p=arguments[1],m=!0)):(d=g,f=arguments[1],h=arguments[3],arguments.length>2&&(p=arguments[2],m=!0)),d=""+d,f=""+f,e.isUndefined(h)||(h=""+h);var y=l(this._isDirected,d,f,h);if(e.has(this._edgeLabels,y))return m&&(this._edgeLabels[y]=p),this;if(!e.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(f),this._edgeLabels[y]=m?p:this._defaultEdgeLabelFn(d,f,h);var x=c(this._isDirected,d,f,h);return d=x.v,f=x.w,Object.freeze(x),this._edgeObjs[y]=x,i(this._preds[f],d),i(this._sucs[d],f),this._in[f][y]=x,this._out[d][y]=x,this._edgeCount++,this},a.prototype.edge=function(d,f,h){var p=arguments.length===1?u(this._isDirected,arguments[0]):l(this._isDirected,d,f,h);return this._edgeLabels[p]},a.prototype.hasEdge=function(d,f,h){var p=arguments.length===1?u(this._isDirected,arguments[0]):l(this._isDirected,d,f,h);return e.has(this._edgeLabels,p)},a.prototype.removeEdge=function(d,f,h){var p=arguments.length===1?u(this._isDirected,arguments[0]):l(this._isDirected,d,f,h),m=this._edgeObjs[p];return m&&(d=m.v,f=m.w,delete this._edgeLabels[p],delete this._edgeObjs[p],s(this._preds[f],d),s(this._sucs[d],f),delete this._in[f][p],delete this._out[d][p],this._edgeCount--),this},a.prototype.inEdges=function(d,f){var h=this._in[d];if(h){var p=e.values(h);return f?e.filter(p,function(m){return m.v===f}):p}},a.prototype.outEdges=function(d,f){var h=this._out[d];if(h){var p=e.values(h);return f?e.filter(p,function(m){return m.w===f}):p}},a.prototype.nodeEdges=function(d,f){var h=this.inEdges(d,f);if(h)return h.concat(this.outEdges(d,f))};function i(d,f){d[f]?d[f]++:d[f]=1}function s(d,f){--d[f]||delete d[f]}function l(d,f,h,p){var m=""+f,g=""+h;if(!d&&m>g){var y=m;m=g,g=y}return m+n+g+n+(e.isUndefined(p)?t:p)}function c(d,f,h,p){var m=""+f,g=""+h;if(!d&&m>g){var y=m;m=g,g=y}var x={v:m,w:g};return p&&(x.name=p),x}function u(d,f){return l(d,f.v,f.w,f.name)}return nj}var aj,v3;function Lfe(){return v3||(v3=1,aj="2.1.8"),aj}var ij,b3;function zfe(){return b3||(b3=1,ij={Graph:qP(),version:Lfe()}),ij}var sj,w3;function Ffe(){if(w3)return sj;w3=1;var e=oa(),t=qP();sj={write:r,read:i};function r(s){var l={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:n(s),edges:a(s)};return e.isUndefined(s.graph())||(l.value=e.clone(s.graph())),l}function n(s){return e.map(s.nodes(),function(l){var c=s.node(l),u=s.parent(l),d={v:l};return e.isUndefined(c)||(d.value=c),e.isUndefined(u)||(d.parent=u),d})}function a(s){return e.map(s.edges(),function(l){var c=s.edge(l),u={v:l.v,w:l.w};return e.isUndefined(l.name)||(u.name=l.name),e.isUndefined(c)||(u.value=c),u})}function i(s){var l=new t(s.options).setGraph(s.value);return e.each(s.nodes,function(c){l.setNode(c.v,c.value),c.parent&&l.setParent(c.v,c.parent)}),e.each(s.edges,function(c){l.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),l}return sj}var oj,j3;function Bfe(){if(j3)return oj;j3=1;var e=oa();oj=t;function t(r){var n={},a=[],i;function s(l){e.has(n,l)||(n[l]=!0,i.push(l),e.each(r.successors(l),s),e.each(r.predecessors(l),s))}return e.each(r.nodes(),function(l){i=[],s(l),i.length&&a.push(i)}),a}return oj}var lj,k3;function SV(){if(k3)return lj;k3=1;var e=oa();lj=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(r){return r.key})},t.prototype.has=function(r){return e.has(this._keyIndices,r)},t.prototype.priority=function(r){var n=this._keyIndices[r];if(n!==void 0)return this._arr[n].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(r,n){var a=this._keyIndices;if(r=String(r),!e.has(a,r)){var i=this._arr,s=i.length;return a[r]=s,i.push({key:r,priority:n}),this._decrease(s),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},t.prototype.decrease=function(r,n){var a=this._keyIndices[r];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},t.prototype._heapify=function(r){var n=this._arr,a=2*r,i=a+1,s=r;a<n.length&&(s=n[a].priority<n[s].priority?a:s,i<n.length&&(s=n[i].priority<n[s].priority?i:s),s!==r&&(this._swap(r,s),this._heapify(s)))},t.prototype._decrease=function(r){for(var n=this._arr,a=n[r].priority,i;r!==0&&(i=r>>1,!(n[i].priority<a));)this._swap(r,i),r=i},t.prototype._swap=function(r,n){var a=this._arr,i=this._keyIndices,s=a[r],l=a[n];a[r]=l,a[n]=s,i[l.key]=r,i[s.key]=n},lj}var cj,N3;function _V(){if(N3)return cj;N3=1;var e=oa(),t=SV();cj=n;var r=e.constant(1);function n(i,s,l,c){return a(i,String(s),l||r,c||function(u){return i.outEdges(u)})}function a(i,s,l,c){var u={},d=new t,f,h,p=function(m){var g=m.v!==f?m.v:m.w,y=u[g],x=l(m),v=h.distance+x;if(x<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+m+" Weight: "+x);v<y.distance&&(y.distance=v,y.predecessor=f,d.decrease(g,v))};for(i.nodes().forEach(function(m){var g=m===s?0:Number.POSITIVE_INFINITY;u[m]={distance:g},d.add(m,g)});d.size()>0&&(f=d.removeMin(),h=u[f],h.distance!==Number.POSITIVE_INFINITY);)c(f).forEach(p);return u}return cj}var uj,S3;function Vfe(){if(S3)return uj;S3=1;var e=_V(),t=oa();uj=r;function r(n,a,i){return t.transform(n.nodes(),function(s,l){s[l]=e(n,l,a,i)},{})}return uj}var dj,_3;function EV(){if(_3)return dj;_3=1;var e=oa();dj=t;function t(r){var n=0,a=[],i={},s=[];function l(c){var u=i[c]={onStack:!0,lowlink:n,index:n++};if(a.push(c),r.successors(c).forEach(function(h){e.has(i,h)?i[h].onStack&&(u.lowlink=Math.min(u.lowlink,i[h].index)):(l(h),u.lowlink=Math.min(u.lowlink,i[h].lowlink))}),u.lowlink===u.index){var d=[],f;do f=a.pop(),i[f].onStack=!1,d.push(f);while(c!==f);s.push(d)}}return r.nodes().forEach(function(c){e.has(i,c)||l(c)}),s}return dj}var fj,E3;function qfe(){if(E3)return fj;E3=1;var e=oa(),t=EV();fj=r;function r(n){return e.filter(t(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return fj}var hj,P3;function Ufe(){if(P3)return hj;P3=1;var e=oa();hj=r;var t=e.constant(1);function r(a,i,s){return n(a,i||t,s||function(l){return a.outEdges(l)})}function n(a,i,s){var l={},c=a.nodes();return c.forEach(function(u){l[u]={},l[u][u]={distance:0},c.forEach(function(d){u!==d&&(l[u][d]={distance:Number.POSITIVE_INFINITY})}),s(u).forEach(function(d){var f=d.v===u?d.w:d.v,h=i(d);l[u][f]={distance:h,predecessor:u}})}),c.forEach(function(u){var d=l[u];c.forEach(function(f){var h=l[f];c.forEach(function(p){var m=h[u],g=d[p],y=h[p],x=m.distance+g.distance;x<y.distance&&(y.distance=x,y.predecessor=g.predecessor)})})}),l}return hj}var pj,C3;function PV(){if(C3)return pj;C3=1;var e=oa();pj=t,t.CycleException=r;function t(n){var a={},i={},s=[];function l(c){if(e.has(i,c))throw new r;e.has(a,c)||(i[c]=!0,a[c]=!0,e.each(n.predecessors(c),l),delete i[c],s.push(c))}if(e.each(n.sinks(),l),e.size(a)!==n.nodeCount())throw new r;return s}function r(){}return r.prototype=new Error,pj}var mj,A3;function Hfe(){if(A3)return mj;A3=1;var e=PV();mj=t;function t(r){try{e(r)}catch(n){if(n instanceof e.CycleException)return!1;throw n}return!0}return mj}var gj,O3;function CV(){if(O3)return gj;O3=1;var e=oa();gj=t;function t(n,a,i){e.isArray(a)||(a=[a]);var s=(n.isDirected()?n.successors:n.neighbors).bind(n),l=[],c={};return e.each(a,function(u){if(!n.hasNode(u))throw new Error("Graph does not have node: "+u);r(n,u,i==="post",c,s,l)}),l}function r(n,a,i,s,l,c){e.has(s,a)||(s[a]=!0,i||c.push(a),e.each(l(a),function(u){r(n,u,i,s,l,c)}),i&&c.push(a))}return gj}var xj,T3;function Wfe(){if(T3)return xj;T3=1;var e=CV();xj=t;function t(r,n){return e(r,n,"post")}return xj}var yj,M3;function Gfe(){if(M3)return yj;M3=1;var e=CV();yj=t;function t(r,n){return e(r,n,"pre")}return yj}var vj,R3;function Kfe(){if(R3)return vj;R3=1;var e=oa(),t=qP(),r=SV();vj=n;function n(a,i){var s=new t,l={},c=new r,u;function d(h){var p=h.v===u?h.w:h.v,m=c.priority(p);if(m!==void 0){var g=i(h);g<m&&(l[p]=u,c.decrease(p,g))}}if(a.nodeCount()===0)return s;e.each(a.nodes(),function(h){c.add(h,Number.POSITIVE_INFINITY),s.setNode(h)}),c.decrease(a.nodes()[0],0);for(var f=!1;c.size()>0;){if(u=c.removeMin(),e.has(l,u))s.setEdge(u,l[u]);else{if(f)throw new Error("Input graph is not connected: "+a);f=!0}a.nodeEdges(u).forEach(d)}return s}return vj}var bj,D3;function Yfe(){return D3||(D3=1,bj={components:Bfe(),dijkstra:_V(),dijkstraAll:Vfe(),findCycles:qfe(),floydWarshall:Ufe(),isAcyclic:Hfe(),postorder:Wfe(),preorder:Gfe(),prim:Kfe(),tarjan:EV(),topsort:PV()}),bj}var wj,$3;function Xfe(){if($3)return wj;$3=1;var e=zfe();return wj={Graph:e.Graph,json:Ffe(),alg:Yfe(),version:e.version},wj}var R0;if(typeof NP=="function")try{R0=Xfe()}catch{}R0||(R0=window.graphlib);var Ra=R0,jj,I3;function Zfe(){if(I3)return jj;I3=1;var e=QB(),t=1,r=4;function n(a){return e(a,t|r)}return jj=n,jj}var kj,L3;function $u(){if(L3)return kj;L3=1;var e=Cu(),t=Wi(),r=Nx(),n=tn();function a(i,s,l){if(!n(l))return!1;var c=typeof s;return(c=="number"?t(l)&&r(s,l.length):c=="string"&&s in l)?e(l[s],i):!1}return kj=a,kj}var Nj,z3;function Qfe(){if(z3)return Nj;z3=1;var e=Tx(),t=Cu(),r=$u(),n=xl(),a=Object.prototype,i=a.hasOwnProperty,s=e(function(l,c){l=Object(l);var u=-1,d=c.length,f=d>2?c[2]:void 0;for(f&&r(c[0],c[1],f)&&(d=1);++u<d;)for(var h=c[u],p=n(h),m=-1,g=p.length;++m<g;){var y=p[m],x=l[y];(x===void 0||t(x,a[y])&&!i.call(l,y))&&(l[y]=h[y])}return l});return Nj=s,Nj}var Sj,F3;function Jfe(){if(F3)return Sj;F3=1;var e=sa(),t=Wi(),r=to();function n(a){return function(i,s,l){var c=Object(i);if(!t(i)){var u=e(s,3);i=r(i),s=function(f){return u(c[f],f,c)}}var d=a(i,s,l);return d>-1?c[u?i[d]:d]:void 0}}return Sj=n,Sj}var _j,B3;function ehe(){if(B3)return _j;B3=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return _j=t,_j}var Ej,V3;function the(){if(V3)return Ej;V3=1;var e=ehe(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Ej=r,Ej}var Pj,q3;function AV(){if(q3)return Pj;q3=1;var e=the(),t=tn(),r=Du(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;function c(u){if(typeof u=="number")return u;if(r(u))return n;if(t(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=t(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=e(u);var f=i.test(u);return f||s.test(u)?l(u.slice(2),f?2:8):a.test(u)?n:+u}return Pj=c,Pj}var Cj,U3;function OV(){if(U3)return Cj;U3=1;var e=AV(),t=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*r}return a===a?a:0}return Cj=n,Cj}var Aj,H3;function rhe(){if(H3)return Aj;H3=1;var e=OV();function t(r){var n=e(r),a=n%1;return n===n?a?n-a:n:0}return Aj=t,Aj}var Oj,W3;function nhe(){if(W3)return Oj;W3=1;var e=wV(),t=sa(),r=rhe(),n=Math.max;function a(i,s,l){var c=i==null?0:i.length;if(!c)return-1;var u=l==null?0:r(l);return u<0&&(u=n(c+u,0)),e(i,t(s,3),u)}return Oj=a,Oj}var Tj,G3;function TV(){if(G3)return Tj;G3=1;var e=Jfe(),t=nhe(),r=e(t);return Tj=r,Tj}var Mj,K3;function MV(){if(K3)return Mj;K3=1;var e=Ox();function t(r){var n=r==null?0:r.length;return n?e(r,1):[]}return Mj=t,Mj}var Rj,Y3;function ahe(){if(Y3)return Rj;Y3=1;var e=DP(),t=JB(),r=xl();function n(a,i){return a==null?a:e(a,t(i),r)}return Rj=n,Rj}var Dj,X3;function RV(){if(X3)return Dj;X3=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Dj=e,Dj}var $j,Z3;function DV(){if(Z3)return $j;Z3=1;var e=jx(),t=$P(),r=sa();function n(a,i){var s={};return i=r(i,3),t(a,function(l,c,u){e(s,c,i(l,c,u))}),s}return $j=n,$j}var Ij,Q3;function UP(){if(Q3)return Ij;Q3=1;var e=Du();function t(r,n,a){for(var i=-1,s=r.length;++i<s;){var l=r[i],c=n(l);if(c!=null&&(u===void 0?c===c&&!e(c):a(c,u)))var u=c,d=l}return d}return Ij=t,Ij}var Lj,J3;function ihe(){if(J3)return Lj;J3=1;function e(t,r){return t>r}return Lj=e,Lj}var zj,eD;function $V(){if(eD)return zj;eD=1;var e=UP(),t=ihe(),r=yl();function n(a){return a&&a.length?e(a,r,t):void 0}return zj=n,zj}var Fj,tD;function IV(){if(tD)return Fj;tD=1;var e=jx(),t=Cu();function r(n,a,i){(i!==void 0&&!t(n[a],i)||i===void 0&&!(a in n))&&e(n,a,i)}return Fj=r,Fj}var Bj,rD;function LV(){if(rD)return Bj;rD=1;var e=Hi(),t=Ex(),r=ia(),n="[object Object]",a=Function.prototype,i=Object.prototype,s=a.toString,l=i.hasOwnProperty,c=s.call(Object);function u(d){if(!r(d)||e(d)!=n)return!1;var f=t(d);if(f===null)return!0;var h=l.call(f,"constructor")&&f.constructor;return typeof h=="function"&&h instanceof h&&s.call(h)==c}return Bj=u,Bj}var Vj,nD;function zV(){if(nD)return Vj;nD=1;function e(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}return Vj=e,Vj}var qj,aD;function she(){if(aD)return qj;aD=1;var e=Kh(),t=xl();function r(n){return e(n,t(n))}return qj=r,qj}var Uj,iD;function ohe(){if(iD)return Uj;iD=1;var e=IV(),t=FB(),r=YB(),n=BB(),a=ZB(),i=Yh(),s=Jt(),l=kV(),c=Tu(),u=Ou(),d=tn(),f=LV(),h=Xh(),p=zV(),m=she();function g(y,x,v,b,j,w,k){var N=p(y,v),_=p(x,v),P=k.get(_);if(P){e(y,v,P);return}var C=w?w(N,_,v+"",y,x,k):void 0,A=C===void 0;if(A){var O=s(_),T=!O&&c(_),E=!O&&!T&&h(_);C=_,O||T||E?s(N)?C=N:l(N)?C=n(N):T?(A=!1,C=t(_,!0)):E?(A=!1,C=r(_,!0)):C=[]:f(_)||i(_)?(C=N,i(N)?C=m(N):(!d(N)||u(N))&&(C=a(_))):A=!1}A&&(k.set(_,C),j(C,_,b,w,k),k.delete(_)),e(y,v,C)}return Uj=g,Uj}var Hj,sD;function lhe(){if(sD)return Hj;sD=1;var e=wx(),t=IV(),r=DP(),n=ohe(),a=tn(),i=xl(),s=zV();function l(c,u,d,f,h){c!==u&&r(u,function(p,m){if(h||(h=new e),a(p))n(c,u,m,d,l,f,h);else{var g=f?f(s(c,m),p,m+"",c,u,h):void 0;g===void 0&&(g=p),t(c,m,g)}},i)}return Hj=l,Hj}var Wj,oD;function che(){if(oD)return Wj;oD=1;var e=Tx(),t=$u();function r(n){return e(function(a,i){var s=-1,l=i.length,c=l>1?i[l-1]:void 0,u=l>2?i[2]:void 0;for(c=n.length>3&&typeof c=="function"?(l--,c):void 0,u&&t(i[0],i[1],u)&&(c=l<3?void 0:c,l=1),a=Object(a);++s<l;){var d=i[s];d&&n(a,d,s,c)}return a})}return Wj=r,Wj}var Gj,lD;function uhe(){if(lD)return Gj;lD=1;var e=lhe(),t=che(),r=t(function(n,a,i){e(n,a,i)});return Gj=r,Gj}var Kj,cD;function FV(){if(cD)return Kj;cD=1;function e(t,r){return t<r}return Kj=e,Kj}var Yj,uD;function BV(){if(uD)return Yj;uD=1;var e=UP(),t=FV(),r=yl();function n(a){return a&&a.length?e(a,r,t):void 0}return Yj=n,Yj}var Xj,dD;function dhe(){if(dD)return Xj;dD=1;var e=UP(),t=sa(),r=FV();function n(a,i){return a&&a.length?e(a,t(i,2),r):void 0}return Xj=n,Xj}var Zj,fD;function VV(){if(fD)return Zj;fD=1;var e=Ma(),t=function(){return e.Date.now()};return Zj=t,Zj}var Qj,hD;function fhe(){if(hD)return Qj;hD=1;var e=kx(),t=Cx(),r=Nx(),n=tn(),a=Zh();function i(s,l,c,u){if(!n(s))return s;l=t(l,s);for(var d=-1,f=l.length,h=f-1,p=s;p!=null&&++d<f;){var m=a(l[d]),g=c;if(m==="__proto__"||m==="constructor"||m==="prototype")return s;if(d!=h){var y=p[m];g=u?u(y,m,p):void 0,g===void 0&&(g=n(y)?y:r(l[d+1])?[]:{})}e(p,m,g),p=p[m]}return s}return Qj=i,Qj}var Jj,pD;function hhe(){if(pD)return Jj;pD=1;var e=Ax(),t=fhe(),r=Cx();function n(a,i,s){for(var l=-1,c=i.length,u={};++l<c;){var d=i[l],f=e(a,d);s(f,d)&&t(u,r(d,a),f)}return u}return Jj=n,Jj}var ek,mD;function phe(){if(mD)return ek;mD=1;var e=hhe(),t=dV();function r(n,a){return e(n,a,function(i,s){return t(n,s)})}return ek=r,ek}var tk,gD;function mhe(){if(gD)return tk;gD=1;var e=MV(),t=vV(),r=bV();function n(a){return r(t(a,void 0,e),a+"")}return tk=n,tk}var rk,xD;function ghe(){if(xD)return rk;xD=1;var e=phe(),t=mhe(),r=t(function(n,a){return n==null?{}:e(n,a)});return rk=r,rk}var nk,yD;function xhe(){if(yD)return nk;yD=1;var e=Math.ceil,t=Math.max;function r(n,a,i,s){for(var l=-1,c=t(e((a-n)/(i||1)),0),u=Array(c);c--;)u[s?c:++l]=n,n+=i;return u}return nk=r,nk}var ak,vD;function yhe(){if(vD)return ak;vD=1;var e=xhe(),t=$u(),r=OV();function n(a){return function(i,s,l){return l&&typeof l!="number"&&t(i,s,l)&&(s=l=void 0),i=r(i),s===void 0?(s=i,i=0):s=r(s),l=l===void 0?i<s?1:-1:r(l),e(i,s,l,a)}}return ak=n,ak}var ik,bD;function qV(){if(bD)return ik;bD=1;var e=yhe(),t=e();return ik=t,ik}var sk,wD;function vhe(){if(wD)return sk;wD=1;function e(t,r){var n=t.length;for(t.sort(r);n--;)t[n]=t[n].value;return t}return sk=e,sk}var ok,jD;function bhe(){if(jD)return ok;jD=1;var e=Du();function t(r,n){if(r!==n){var a=r!==void 0,i=r===null,s=r===r,l=e(r),c=n!==void 0,u=n===null,d=n===n,f=e(n);if(!u&&!f&&!l&&r>n||l&&c&&d&&!u&&!f||i&&c&&d||!a&&d||!s)return 1;if(!i&&!l&&!f&&r<n||f&&a&&s&&!i&&!l||u&&a&&s||!c&&s||!d)return-1}return 0}return ok=t,ok}var lk,kD;function whe(){if(kD)return lk;kD=1;var e=bhe();function t(r,n,a){for(var i=-1,s=r.criteria,l=n.criteria,c=s.length,u=a.length;++i<c;){var d=e(s[i],l[i]);if(d){if(i>=u)return d;var f=a[i];return d*(f=="desc"?-1:1)}}return r.index-n.index}return lk=t,lk}var ck,ND;function jhe(){if(ND)return ck;ND=1;var e=Px(),t=Ax(),r=sa(),n=gV(),a=vhe(),i=Sx(),s=whe(),l=yl(),c=Jt();function u(d,f,h){f.length?f=e(f,function(g){return c(g)?function(y){return t(y,g.length===1?g[0]:g)}:g}):f=[l];var p=-1;f=e(f,i(r));var m=n(d,function(g,y,x){var v=e(f,function(b){return b(g)});return{criteria:v,index:++p,value:g}});return a(m,function(g,y){return s(g,y,h)})}return ck=u,ck}var uk,SD;function UV(){if(SD)return uk;SD=1;var e=Ox(),t=jhe(),r=Tx(),n=$u(),a=r(function(i,s){if(i==null)return[];var l=s.length;return l>1&&n(i,s[0],s[1])?s=[]:l>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),t(i,e(s,1),[])});return uk=a,uk}var dk,_D;function khe(){if(_D)return dk;_D=1;var e=FP(),t=0;function r(n){var a=++t;return e(n)+a}return dk=r,dk}var fk,ED;function Nhe(){if(ED)return fk;ED=1;function e(t,r,n){for(var a=-1,i=t.length,s=r.length,l={};++a<i;){var c=a<s?r[a]:void 0;n(l,t[a],c)}return l}return fk=e,fk}var hk,PD;function She(){if(PD)return hk;PD=1;var e=kx(),t=Nhe();function r(n,a){return t(n||[],a||[],e)}return hk=r,hk}var D0;if(typeof NP=="function")try{D0={cloneDeep:Zfe(),constant:RP(),defaults:Qfe(),each:tV(),filter:hV(),find:TV(),flatten:MV(),forEach:eV(),forIn:ahe(),has:pV(),isUndefined:mV(),last:RV(),map:BP(),mapValues:DV(),max:$V(),merge:uhe(),min:BV(),minBy:dhe(),now:VV(),pick:ghe(),range:qV(),reduce:xV(),sortBy:UV(),uniqueId:khe(),values:NV(),zipObject:She()}}catch{}D0||(D0=window._);var Bt=D0,_he=Mx;function Mx(){var e={};e._next=e._prev=e,this._sentinel=e}Mx.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return HV(t),t};Mx.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&HV(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t};Mx.prototype.toString=function(){for(var e=[],t=this._sentinel,r=t._prev;r!==t;)e.push(JSON.stringify(r,Ehe)),r=r._prev;return"["+e.join(", ")+"]"};function HV(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Ehe(e,t){if(e!=="_next"&&e!=="_prev")return t}var di=Bt,Phe=Ra.Graph,Che=_he,Ahe=The,Ohe=di.constant(1);function The(e,t){if(e.nodeCount()<=1)return[];var r=Rhe(e,t||Ohe),n=Mhe(r.graph,r.buckets,r.zeroIdx);return di.flatten(di.map(n,function(a){return e.outEdges(a.v,a.w)}),!0)}function Mhe(e,t,r){for(var n=[],a=t[t.length-1],i=t[0],s;e.nodeCount();){for(;s=i.dequeue();)pk(e,t,r,s);for(;s=a.dequeue();)pk(e,t,r,s);if(e.nodeCount()){for(var l=t.length-2;l>0;--l)if(s=t[l].dequeue(),s){n=n.concat(pk(e,t,r,s,!0));break}}}return n}function pk(e,t,r,n,a){var i=a?[]:void 0;return di.forEach(e.inEdges(n.v),function(s){var l=e.edge(s),c=e.node(s.v);a&&i.push({v:s.v,w:s.w}),c.out-=l,zN(t,r,c)}),di.forEach(e.outEdges(n.v),function(s){var l=e.edge(s),c=s.w,u=e.node(c);u.in-=l,zN(t,r,u)}),e.removeNode(n.v),i}function Rhe(e,t){var r=new Phe,n=0,a=0;di.forEach(e.nodes(),function(l){r.setNode(l,{v:l,in:0,out:0})}),di.forEach(e.edges(),function(l){var c=r.edge(l.v,l.w)||0,u=t(l),d=c+u;r.setEdge(l.v,l.w,d),a=Math.max(a,r.node(l.v).out+=u),n=Math.max(n,r.node(l.w).in+=u)});var i=di.range(a+n+3).map(function(){return new Che}),s=n+1;return di.forEach(r.nodes(),function(l){zN(i,s,r.node(l))}),{graph:r,buckets:i,zeroIdx:s}}function zN(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var Mo=Bt,Dhe=Ahe,$he={run:Ihe,undo:zhe};function Ihe(e){var t=e.graph().acyclicer==="greedy"?Dhe(e,r(e)):Lhe(e);Mo.forEach(t,function(n){var a=e.edge(n);e.removeEdge(n),a.forwardName=n.name,a.reversed=!0,e.setEdge(n.w,n.v,a,Mo.uniqueId("rev"))});function r(n){return function(a){return n.edge(a).weight}}}function Lhe(e){var t=[],r={},n={};function a(i){Mo.has(n,i)||(n[i]=!0,r[i]=!0,Mo.forEach(e.outEdges(i),function(s){Mo.has(r,s.w)?t.push(s):a(s.w)}),delete r[i])}return Mo.forEach(e.nodes(),a),t}function zhe(e){Mo.forEach(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}var ct=Bt,WV=Ra.Graph,pn={addDummyNode:GV,simplify:Fhe,asNonCompoundGraph:Bhe,successorWeights:Vhe,predecessorWeights:qhe,intersectRect:Uhe,buildLayerMatrix:Hhe,normalizeRanks:Whe,removeEmptyRanks:Ghe,addBorderNode:Khe,maxRank:KV,partition:Yhe,time:Xhe,notime:Zhe};function GV(e,t,r,n){var a;do a=ct.uniqueId(n);while(e.hasNode(a));return r.dummy=t,e.setNode(a,r),a}function Fhe(e){var t=new WV().setGraph(e.graph());return ct.forEach(e.nodes(),function(r){t.setNode(r,e.node(r))}),ct.forEach(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+a.weight,minlen:Math.max(n.minlen,a.minlen)})}),t}function Bhe(e){var t=new WV({multigraph:e.isMultigraph()}).setGraph(e.graph());return ct.forEach(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),ct.forEach(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t}function Vhe(e){var t=ct.map(e.nodes(),function(r){var n={};return ct.forEach(e.outEdges(r),function(a){n[a.w]=(n[a.w]||0)+e.edge(a).weight}),n});return ct.zipObject(e.nodes(),t)}function qhe(e){var t=ct.map(e.nodes(),function(r){var n={};return ct.forEach(e.inEdges(r),function(a){n[a.v]=(n[a.v]||0)+e.edge(a).weight}),n});return ct.zipObject(e.nodes(),t)}function Uhe(e,t){var r=e.x,n=e.y,a=t.x-r,i=t.y-n,s=e.width/2,l=e.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var c,u;return Math.abs(i)*s>Math.abs(a)*l?(i<0&&(l=-l),c=l*a/i,u=l):(a<0&&(s=-s),c=s,u=s*i/a),{x:r+c,y:n+u}}function Hhe(e){var t=ct.map(ct.range(KV(e)+1),function(){return[]});return ct.forEach(e.nodes(),function(r){var n=e.node(r),a=n.rank;ct.isUndefined(a)||(t[a][n.order]=r)}),t}function Whe(e){var t=ct.min(ct.map(e.nodes(),function(r){return e.node(r).rank}));ct.forEach(e.nodes(),function(r){var n=e.node(r);ct.has(n,"rank")&&(n.rank-=t)})}function Ghe(e){var t=ct.min(ct.map(e.nodes(),function(i){return e.node(i).rank})),r=[];ct.forEach(e.nodes(),function(i){var s=e.node(i).rank-t;r[s]||(r[s]=[]),r[s].push(i)});var n=0,a=e.graph().nodeRankFactor;ct.forEach(r,function(i,s){ct.isUndefined(i)&&s%a!==0?--n:n&&ct.forEach(i,function(l){e.node(l).rank+=n})})}function Khe(e,t,r,n){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=n),GV(e,"border",a,t)}function KV(e){return ct.max(ct.map(e.nodes(),function(t){var r=e.node(t).rank;if(!ct.isUndefined(r))return r}))}function Yhe(e,t){var r={lhs:[],rhs:[]};return ct.forEach(e,function(n){t(n)?r.lhs.push(n):r.rhs.push(n)}),r}function Xhe(e,t){var r=ct.now();try{return t()}finally{console.log(e+" time: "+(ct.now()-r)+"ms")}}function Zhe(e,t){return t()}var YV=Bt,Qhe=pn,Jhe={run:epe,undo:rpe};function epe(e){e.graph().dummyChains=[],YV.forEach(e.edges(),function(t){tpe(e,t)})}function tpe(e,t){var r=t.v,n=e.node(r).rank,a=t.w,i=e.node(a).rank,s=t.name,l=e.edge(t),c=l.labelRank;if(i!==n+1){e.removeEdge(t);var u,d,f;for(f=0,++n;n<i;++f,++n)l.points=[],d={width:0,height:0,edgeLabel:l,edgeObj:t,rank:n},u=Qhe.addDummyNode(e,"edge",d,"_d"),n===c&&(d.width=l.width,d.height=l.height,d.dummy="edge-label",d.labelpos=l.labelpos),e.setEdge(r,u,{weight:l.weight},s),f===0&&e.graph().dummyChains.push(u),r=u;e.setEdge(r,a,{weight:l.weight},s)}}function rpe(e){YV.forEach(e.graph().dummyChains,function(t){var r=e.node(t),n=r.edgeLabel,a;for(e.setEdge(r.edgeObj,n);r.dummy;)a=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=a,r=e.node(t)})}var Vp=Bt,Rx={longestPath:npe,slack:ape};function npe(e){var t={};function r(n){var a=e.node(n);if(Vp.has(t,n))return a.rank;t[n]=!0;var i=Vp.min(Vp.map(e.outEdges(n),function(s){return r(s.w)-e.edge(s).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),a.rank=i}Vp.forEach(e.sources(),r)}function ape(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var $0=Bt,ipe=Ra.Graph,I0=Rx.slack,XV=spe;function spe(e){var t=new ipe({directed:!1}),r=e.nodes()[0],n=e.nodeCount();t.setNode(r,{});for(var a,i;ope(t,e)<n;)a=lpe(t,e),i=t.hasNode(a.v)?I0(e,a):-I0(e,a),cpe(t,e,i);return t}function ope(e,t){function r(n){$0.forEach(t.nodeEdges(n),function(a){var i=a.v,s=n===i?a.w:i;!e.hasNode(s)&&!I0(t,a)&&(e.setNode(s,{}),e.setEdge(n,s,{}),r(s))})}return $0.forEach(e.nodes(),r),e.nodeCount()}function lpe(e,t){return $0.minBy(t.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return I0(t,r)})}function cpe(e,t,r){$0.forEach(e.nodes(),function(n){t.node(n).rank+=r})}var Li=Bt,upe=XV,dpe=Rx.slack,fpe=Rx.longestPath,hpe=Ra.alg.preorder,ppe=Ra.alg.postorder,mpe=pn.simplify,gpe=vl;vl.initLowLimValues=WP;vl.initCutValues=HP;vl.calcCutValue=ZV;vl.leaveEdge=JV;vl.enterEdge=eq;vl.exchangeEdges=tq;function vl(e){e=mpe(e),fpe(e);var t=upe(e);WP(t),HP(t,e);for(var r,n;r=JV(t);)n=eq(t,e,r),tq(t,e,r,n)}function HP(e,t){var r=ppe(e,e.nodes());r=r.slice(0,r.length-1),Li.forEach(r,function(n){xpe(e,t,n)})}function xpe(e,t,r){var n=e.node(r),a=n.parent;e.edge(r,a).cutvalue=ZV(e,t,r)}function ZV(e,t,r){var n=e.node(r),a=n.parent,i=!0,s=t.edge(r,a),l=0;return s||(i=!1,s=t.edge(a,r)),l=s.weight,Li.forEach(t.nodeEdges(r),function(c){var u=c.v===r,d=u?c.w:c.v;if(d!==a){var f=u===i,h=t.edge(c).weight;if(l+=f?h:-h,vpe(e,r,d)){var p=e.edge(r,d).cutvalue;l+=f?-p:p}}}),l}function WP(e,t){arguments.length<2&&(t=e.nodes()[0]),QV(e,{},1,t)}function QV(e,t,r,n,a){var i=r,s=e.node(n);return t[n]=!0,Li.forEach(e.neighbors(n),function(l){Li.has(t,l)||(r=QV(e,t,r,l,n))}),s.low=i,s.lim=r++,a?s.parent=a:delete s.parent,r}function JV(e){return Li.find(e.edges(),function(t){return e.edge(t).cutvalue<0})}function eq(e,t,r){var n=r.v,a=r.w;t.hasEdge(n,a)||(n=r.w,a=r.v);var i=e.node(n),s=e.node(a),l=i,c=!1;i.lim>s.lim&&(l=s,c=!0);var u=Li.filter(t.edges(),function(d){return c===CD(e,e.node(d.v),l)&&c!==CD(e,e.node(d.w),l)});return Li.minBy(u,function(d){return dpe(t,d)})}function tq(e,t,r,n){var a=r.v,i=r.w;e.removeEdge(a,i),e.setEdge(n.v,n.w,{}),WP(e),HP(e,t),ype(e,t)}function ype(e,t){var r=Li.find(e.nodes(),function(a){return!t.node(a).parent}),n=hpe(e,r);n=n.slice(1),Li.forEach(n,function(a){var i=e.node(a).parent,s=t.edge(a,i),l=!1;s||(s=t.edge(i,a),l=!0),t.node(a).rank=t.node(i).rank+(l?s.minlen:-s.minlen)})}function vpe(e,t,r){return e.hasEdge(t,r)}function CD(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}var bpe=Rx,rq=bpe.longestPath,wpe=XV,jpe=gpe,kpe=Npe;function Npe(e){switch(e.graph().ranker){case"network-simplex":AD(e);break;case"tight-tree":_pe(e);break;case"longest-path":Spe(e);break;default:AD(e)}}var Spe=rq;function _pe(e){rq(e),wpe(e)}function AD(e){jpe(e)}var FN=Bt,Epe=Ppe;function Ppe(e){var t=Ape(e);FN.forEach(e.graph().dummyChains,function(r){for(var n=e.node(r),a=n.edgeObj,i=Cpe(e,t,a.v,a.w),s=i.path,l=i.lca,c=0,u=s[c],d=!0;r!==a.w;){if(n=e.node(r),d){for(;(u=s[c])!==l&&e.node(u).maxRank<n.rank;)c++;u===l&&(d=!1)}if(!d){for(;c<s.length-1&&e.node(u=s[c+1]).minRank<=n.rank;)c++;u=s[c]}e.setParent(r,u),r=e.successors(r)[0]}})}function Cpe(e,t,r,n){var a=[],i=[],s=Math.min(t[r].low,t[n].low),l=Math.max(t[r].lim,t[n].lim),c,u;c=r;do c=e.parent(c),a.push(c);while(c&&(t[c].low>s||l>t[c].lim));for(u=c,c=n;(c=e.parent(c))!==u;)i.push(c);return{path:a.concat(i.reverse()),lca:u}}function Ape(e){var t={},r=0;function n(a){var i=r;FN.forEach(e.children(a),n),t[a]={low:i,lim:r++}}return FN.forEach(e.children(),n),t}var fi=Bt,BN=pn,Ope={run:Tpe,cleanup:Dpe};function Tpe(e){var t=BN.addDummyNode(e,"root",{},"_root"),r=Mpe(e),n=fi.max(fi.values(r))-1,a=2*n+1;e.graph().nestingRoot=t,fi.forEach(e.edges(),function(s){e.edge(s).minlen*=a});var i=Rpe(e)+1;fi.forEach(e.children(),function(s){nq(e,t,a,i,n,r,s)}),e.graph().nodeRankFactor=a}function nq(e,t,r,n,a,i,s){var l=e.children(s);if(!l.length){s!==t&&e.setEdge(t,s,{weight:0,minlen:r});return}var c=BN.addBorderNode(e,"_bt"),u=BN.addBorderNode(e,"_bb"),d=e.node(s);e.setParent(c,s),d.borderTop=c,e.setParent(u,s),d.borderBottom=u,fi.forEach(l,function(f){nq(e,t,r,n,a,i,f);var h=e.node(f),p=h.borderTop?h.borderTop:f,m=h.borderBottom?h.borderBottom:f,g=h.borderTop?n:2*n,y=p!==m?1:a-i[s]+1;e.setEdge(c,p,{weight:g,minlen:y,nestingEdge:!0}),e.setEdge(m,u,{weight:g,minlen:y,nestingEdge:!0})}),e.parent(s)||e.setEdge(t,c,{weight:0,minlen:a+i[s]})}function Mpe(e){var t={};function r(n,a){var i=e.children(n);i&&i.length&&fi.forEach(i,function(s){r(s,a+1)}),t[n]=a}return fi.forEach(e.children(),function(n){r(n,1)}),t}function Rpe(e){return fi.reduce(e.edges(),function(t,r){return t+e.edge(r).weight},0)}function Dpe(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,fi.forEach(e.edges(),function(r){var n=e.edge(r);n.nestingEdge&&e.removeEdge(r)})}var mk=Bt,$pe=pn,Ipe=Lpe;function Lpe(e){function t(r){var n=e.children(r),a=e.node(r);if(n.length&&mk.forEach(n,t),mk.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var i=a.minRank,s=a.maxRank+1;i<s;++i)OD(e,"borderLeft","_bl",r,a,i),OD(e,"borderRight","_br",r,a,i)}}mk.forEach(e.children(),t)}function OD(e,t,r,n,a,i){var s={width:0,height:0,rank:i,borderType:t},l=a[t][i-1],c=$pe.addDummyNode(e,"border",s,r);a[t][i]=c,e.setParent(c,n),l&&e.setEdge(l,c,{weight:1})}var Fa=Bt,zpe={adjust:Fpe,undo:Bpe};function Fpe(e){var t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&aq(e)}function Bpe(e){var t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&Vpe(e),(t==="lr"||t==="rl")&&(qpe(e),aq(e))}function aq(e){Fa.forEach(e.nodes(),function(t){TD(e.node(t))}),Fa.forEach(e.edges(),function(t){TD(e.edge(t))})}function TD(e){var t=e.width;e.width=e.height,e.height=t}function Vpe(e){Fa.forEach(e.nodes(),function(t){gk(e.node(t))}),Fa.forEach(e.edges(),function(t){var r=e.edge(t);Fa.forEach(r.points,gk),Fa.has(r,"y")&&gk(r)})}function gk(e){e.y=-e.y}function qpe(e){Fa.forEach(e.nodes(),function(t){xk(e.node(t))}),Fa.forEach(e.edges(),function(t){var r=e.edge(t);Fa.forEach(r.points,xk),Fa.has(r,"x")&&xk(r)})}function xk(e){var t=e.x;e.x=e.y,e.y=t}var ni=Bt,Upe=Hpe;function Hpe(e){var t={},r=ni.filter(e.nodes(),function(l){return!e.children(l).length}),n=ni.max(ni.map(r,function(l){return e.node(l).rank})),a=ni.map(ni.range(n+1),function(){return[]});function i(l){if(!ni.has(t,l)){t[l]=!0;var c=e.node(l);a[c.rank].push(l),ni.forEach(e.successors(l),i)}}var s=ni.sortBy(r,function(l){return e.node(l).rank});return ni.forEach(s,i),a}var is=Bt,Wpe=Gpe;function Gpe(e,t){for(var r=0,n=1;n<t.length;++n)r+=Kpe(e,t[n-1],t[n]);return r}function Kpe(e,t,r){for(var n=is.zipObject(r,is.map(r,function(u,d){return d})),a=is.flatten(is.map(t,function(u){return is.sortBy(is.map(e.outEdges(u),function(d){return{pos:n[d.w],weight:e.edge(d).weight}}),"pos")}),!0),i=1;i<r.length;)i<<=1;var s=2*i-1;i-=1;var l=is.map(new Array(s),function(){return 0}),c=0;return is.forEach(a.forEach(function(u){var d=u.pos+i;l[d]+=u.weight;for(var f=0;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f})),c}var MD=Bt,Ype=Xpe;function Xpe(e,t){return MD.map(t,function(r){var n=e.inEdges(r);if(n.length){var a=MD.reduce(n,function(i,s){var l=e.edge(s),c=e.node(s.v);return{sum:i.sum+l.weight*c.order,weight:i.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}var wn=Bt,Zpe=Qpe;function Qpe(e,t){var r={};wn.forEach(e,function(a,i){var s=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i};wn.isUndefined(a.barycenter)||(s.barycenter=a.barycenter,s.weight=a.weight)}),wn.forEach(t.edges(),function(a){var i=r[a.v],s=r[a.w];!wn.isUndefined(i)&&!wn.isUndefined(s)&&(s.indegree++,i.out.push(r[a.w]))});var n=wn.filter(r,function(a){return!a.indegree});return Jpe(n)}function Jpe(e){var t=[];function r(i){return function(s){s.merged||(wn.isUndefined(s.barycenter)||wn.isUndefined(i.barycenter)||s.barycenter>=i.barycenter)&&eme(i,s)}}function n(i){return function(s){s.in.push(i),--s.indegree===0&&e.push(s)}}for(;e.length;){var a=e.pop();t.push(a),wn.forEach(a.in.reverse(),r(a)),wn.forEach(a.out,n(a))}return wn.map(wn.filter(t,function(i){return!i.merged}),function(i){return wn.pick(i,["vs","i","barycenter","weight"])})}function eme(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}var Dd=Bt,tme=pn,rme=nme;function nme(e,t){var r=tme.partition(e,function(d){return Dd.has(d,"barycenter")}),n=r.lhs,a=Dd.sortBy(r.rhs,function(d){return-d.i}),i=[],s=0,l=0,c=0;n.sort(ame(!!t)),c=RD(i,a,c),Dd.forEach(n,function(d){c+=d.vs.length,i.push(d.vs),s+=d.barycenter*d.weight,l+=d.weight,c=RD(i,a,c)});var u={vs:Dd.flatten(i,!0)};return l&&(u.barycenter=s/l,u.weight=l),u}function RD(e,t,r){for(var n;t.length&&(n=Dd.last(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}function ame(e){return function(t,r){return t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}}var ys=Bt,ime=Ype,sme=Zpe,ome=rme,lme=iq;function iq(e,t,r,n){var a=e.children(t),i=e.node(t),s=i?i.borderLeft:void 0,l=i?i.borderRight:void 0,c={};s&&(a=ys.filter(a,function(m){return m!==s&&m!==l}));var u=ime(e,a);ys.forEach(u,function(m){if(e.children(m.v).length){var g=iq(e,m.v,r,n);c[m.v]=g,ys.has(g,"barycenter")&&ume(m,g)}});var d=sme(u,r);cme(d,c);var f=ome(d,n);if(s&&(f.vs=ys.flatten([s,f.vs,l],!0),e.predecessors(s).length)){var h=e.node(e.predecessors(s)[0]),p=e.node(e.predecessors(l)[0]);ys.has(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+h.order+p.order)/(f.weight+2),f.weight+=2}return f}function cme(e,t){ys.forEach(e,function(r){r.vs=ys.flatten(r.vs.map(function(n){return t[n]?t[n].vs:n}),!0)})}function ume(e,t){ys.isUndefined(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}var $d=Bt,dme=Ra.Graph,fme=hme;function hme(e,t,r){var n=pme(e),a=new dme({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(i){return e.node(i)});return $d.forEach(e.nodes(),function(i){var s=e.node(i),l=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,l||n),$d.forEach(e[r](i),function(c){var u=c.v===i?c.w:c.v,d=a.edge(u,i),f=$d.isUndefined(d)?0:d.weight;a.setEdge(u,i,{weight:e.edge(c).weight+f})}),$d.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),a}function pme(e){for(var t;e.hasNode(t=$d.uniqueId("_root")););return t}var mme=Bt,gme=xme;function xme(e,t,r){var n={},a;mme.forEach(r,function(i){for(var s=e.parent(i),l,c;s;){if(l=e.parent(s),l?(c=n[l],n[l]=s):(c=a,a=s),c&&c!==s){t.setEdge(c,s);return}s=l}})}var Ls=Bt,yme=Upe,vme=Wpe,bme=lme,wme=fme,jme=gme,kme=Ra.Graph,DD=pn,Nme=Sme;function Sme(e){var t=DD.maxRank(e),r=$D(e,Ls.range(1,t+1),"inEdges"),n=$D(e,Ls.range(t-1,-1,-1),"outEdges"),a=yme(e);ID(e,a);for(var i=Number.POSITIVE_INFINITY,s,l=0,c=0;c<4;++l,++c){_me(l%2?r:n,l%4>=2),a=DD.buildLayerMatrix(e);var u=vme(e,a);u<i&&(c=0,s=Ls.cloneDeep(a),i=u)}ID(e,s)}function $D(e,t,r){return Ls.map(t,function(n){return wme(e,n,r)})}function _me(e,t){var r=new kme;Ls.forEach(e,function(n){var a=n.graph().root,i=bme(n,a,r,t);Ls.forEach(i.vs,function(s,l){n.node(s).order=l}),jme(n,r,i.vs)})}function ID(e,t){Ls.forEach(t,function(r){Ls.forEach(r,function(n,a){e.node(n).order=a})})}var Ie=Bt,Eme=Ra.Graph,Pme=pn,Cme={positionX:Fme};function Ame(e,t){var r={};function n(a,i){var s=0,l=0,c=a.length,u=Ie.last(i);return Ie.forEach(i,function(d,f){var h=Tme(e,d),p=h?e.node(h).order:c;(h||d===u)&&(Ie.forEach(i.slice(l,f+1),function(m){Ie.forEach(e.predecessors(m),function(g){var y=e.node(g),x=y.order;(x<s||p<x)&&!(y.dummy&&e.node(m).dummy)&&sq(r,g,m)})}),l=f+1,s=p)}),i}return Ie.reduce(t,n),r}function Ome(e,t){var r={};function n(i,s,l,c,u){var d;Ie.forEach(Ie.range(s,l),function(f){d=i[f],e.node(d).dummy&&Ie.forEach(e.predecessors(d),function(h){var p=e.node(h);p.dummy&&(p.order<c||p.order>u)&&sq(r,h,d)})})}function a(i,s){var l=-1,c,u=0;return Ie.forEach(s,function(d,f){if(e.node(d).dummy==="border"){var h=e.predecessors(d);h.length&&(c=e.node(h[0]).order,n(s,u,f,l,c),u=f,l=c)}n(s,u,s.length,c,i.length)}),s}return Ie.reduce(t,a),r}function Tme(e,t){if(e.node(t).dummy)return Ie.find(e.predecessors(t),function(r){return e.node(r).dummy})}function sq(e,t,r){if(t>r){var n=t;t=r,r=n}var a=e[t];a||(e[t]=a={}),a[r]=!0}function Mme(e,t,r){if(t>r){var n=t;t=r,r=n}return Ie.has(e[t],r)}function Rme(e,t,r,n){var a={},i={},s={};return Ie.forEach(t,function(l){Ie.forEach(l,function(c,u){a[c]=c,i[c]=c,s[c]=u})}),Ie.forEach(t,function(l){var c=-1;Ie.forEach(l,function(u){var d=n(u);if(d.length){d=Ie.sortBy(d,function(g){return s[g]});for(var f=(d.length-1)/2,h=Math.floor(f),p=Math.ceil(f);h<=p;++h){var m=d[h];i[u]===u&&c<s[m]&&!Mme(r,u,m)&&(i[m]=u,i[u]=a[u]=a[m],c=s[m])}}})}),{root:a,align:i}}function Dme(e,t,r,n,a){var i={},s=$me(e,t,r,a),l=a?"borderLeft":"borderRight";function c(f,h){for(var p=s.nodes(),m=p.pop(),g={};m;)g[m]?f(m):(g[m]=!0,p.push(m),p=p.concat(h(m))),m=p.pop()}function u(f){i[f]=s.inEdges(f).reduce(function(h,p){return Math.max(h,i[p.v]+s.edge(p))},0)}function d(f){var h=s.outEdges(f).reduce(function(m,g){return Math.min(m,i[g.w]-s.edge(g))},Number.POSITIVE_INFINITY),p=e.node(f);h!==Number.POSITIVE_INFINITY&&p.borderType!==l&&(i[f]=Math.max(i[f],h))}return c(u,s.predecessors.bind(s)),c(d,s.successors.bind(s)),Ie.forEach(n,function(f){i[f]=i[r[f]]}),i}function $me(e,t,r,n){var a=new Eme,i=e.graph(),s=Bme(i.nodesep,i.edgesep,n);return Ie.forEach(t,function(l){var c;Ie.forEach(l,function(u){var d=r[u];if(a.setNode(d),c){var f=r[c],h=a.edge(f,d);a.setEdge(f,d,Math.max(s(e,u,c),h||0))}c=u})}),a}function Ime(e,t){return Ie.minBy(Ie.values(t),function(r){var n=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return Ie.forIn(r,function(i,s){var l=Vme(e,s)/2;n=Math.max(i+l,n),a=Math.min(i-l,a)}),n-a})}function Lme(e,t){var r=Ie.values(t),n=Ie.min(r),a=Ie.max(r);Ie.forEach(["u","d"],function(i){Ie.forEach(["l","r"],function(s){var l=i+s,c=e[l],u;if(c!==t){var d=Ie.values(c);u=s==="l"?n-Ie.min(d):a-Ie.max(d),u&&(e[l]=Ie.mapValues(c,function(f){return f+u}))}})})}function zme(e,t){return Ie.mapValues(e.ul,function(r,n){if(t)return e[t.toLowerCase()][n];var a=Ie.sortBy(Ie.map(e,n));return(a[1]+a[2])/2})}function Fme(e){var t=Pme.buildLayerMatrix(e),r=Ie.merge(Ame(e,t),Ome(e,t)),n={},a;Ie.forEach(["u","d"],function(s){a=s==="u"?t:Ie.values(t).reverse(),Ie.forEach(["l","r"],function(l){l==="r"&&(a=Ie.map(a,function(f){return Ie.values(f).reverse()}));var c=(s==="u"?e.predecessors:e.successors).bind(e),u=Rme(e,a,r,c),d=Dme(e,a,u.root,u.align,l==="r");l==="r"&&(d=Ie.mapValues(d,function(f){return-f})),n[s+l]=d})});var i=Ime(e,n);return Lme(n,i),zme(n,e.graph().align)}function Bme(e,t,r){return function(n,a,i){var s=n.node(a),l=n.node(i),c=0,u;if(c+=s.width/2,Ie.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=-s.width/2;break;case"r":u=s.width/2;break}if(u&&(c+=r?u:-u),u=0,c+=(s.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Ie.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=r?u:-u),u=0,c}}function Vme(e,t){return e.node(t).width}var Id=Bt,oq=pn,qme=Cme.positionX,Ume=Hme;function Hme(e){e=oq.asNonCompoundGraph(e),Wme(e),Id.forEach(qme(e),function(t,r){e.node(r).x=t})}function Wme(e){var t=oq.buildLayerMatrix(e),r=e.graph().ranksep,n=0;Id.forEach(t,function(a){var i=Id.max(Id.map(a,function(s){return e.node(s).height}));Id.forEach(a,function(s){e.node(s).y=n+i/2}),n+=i+r})}var We=Bt,LD=$he,zD=Jhe,Gme=kpe,Kme=pn.normalizeRanks,Yme=Epe,Xme=pn.removeEmptyRanks,FD=Ope,Zme=Ipe,BD=zpe,Qme=Nme,Jme=Ume,Gs=pn,e0e=Ra.Graph,t0e=r0e;function r0e(e,t){var r=t&&t.debugTiming?Gs.time:Gs.notime;r("layout",function(){var n=r(" buildLayoutGraph",function(){return h0e(e)});r(" runLayout",function(){n0e(n,r)}),r(" updateInputGraph",function(){a0e(e,n)})})}function n0e(e,t){t(" makeSpaceForEdgeLabels",function(){p0e(e)}),t(" removeSelfEdges",function(){k0e(e)}),t(" acyclic",function(){LD.run(e)}),t(" nestingGraph.run",function(){FD.run(e)}),t(" rank",function(){Gme(Gs.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){m0e(e)}),t(" removeEmptyRanks",function(){Xme(e)}),t(" nestingGraph.cleanup",function(){FD.cleanup(e)}),t(" normalizeRanks",function(){Kme(e)}),t(" assignRankMinMax",function(){g0e(e)}),t(" removeEdgeLabelProxies",function(){x0e(e)}),t(" normalize.run",function(){zD.run(e)}),t(" parentDummyChains",function(){Yme(e)}),t(" addBorderSegments",function(){Zme(e)}),t(" order",function(){Qme(e)}),t(" insertSelfEdges",function(){N0e(e)}),t(" adjustCoordinateSystem",function(){BD.adjust(e)}),t(" position",function(){Jme(e)}),t(" positionSelfEdges",function(){S0e(e)}),t(" removeBorderNodes",function(){j0e(e)}),t(" normalize.undo",function(){zD.undo(e)}),t(" fixupEdgeLabelCoords",function(){b0e(e)}),t(" undoCoordinateSystem",function(){BD.undo(e)}),t(" translateGraph",function(){y0e(e)}),t(" assignNodeIntersects",function(){v0e(e)}),t(" reversePoints",function(){w0e(e)}),t(" acyclic.undo",function(){LD.undo(e)})}function a0e(e,t){We.forEach(e.nodes(),function(r){var n=e.node(r),a=t.node(r);n&&(n.x=a.x,n.y=a.y,t.children(r).length&&(n.width=a.width,n.height=a.height))}),We.forEach(e.edges(),function(r){var n=e.edge(r),a=t.edge(r);n.points=a.points,We.has(a,"x")&&(n.x=a.x,n.y=a.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var i0e=["nodesep","edgesep","ranksep","marginx","marginy"],s0e={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},o0e=["acyclicer","ranker","rankdir","align"],l0e=["width","height"],c0e={width:0,height:0},u0e=["minlen","weight","width","height","labeloffset"],d0e={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},f0e=["labelpos"];function h0e(e){var t=new e0e({multigraph:!0,compound:!0}),r=vk(e.graph());return t.setGraph(We.merge({},s0e,yk(r,i0e),We.pick(r,o0e))),We.forEach(e.nodes(),function(n){var a=vk(e.node(n));t.setNode(n,We.defaults(yk(a,l0e),c0e)),t.setParent(n,e.parent(n))}),We.forEach(e.edges(),function(n){var a=vk(e.edge(n));t.setEdge(n,We.merge({},d0e,yk(a,u0e),We.pick(a,f0e)))}),t}function p0e(e){var t=e.graph();t.ranksep/=2,We.forEach(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function m0e(e){We.forEach(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),a=e.node(t.w),i={rank:(a.rank-n.rank)/2+n.rank,e:t};Gs.addDummyNode(e,"edge-proxy",i,"_ep")}})}function g0e(e){var t=0;We.forEach(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=We.max(t,n.maxRank))}),e.graph().maxRank=t}function x0e(e){We.forEach(e.nodes(),function(t){var r=e.node(t);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function y0e(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,a=0,i=e.graph(),s=i.marginx||0,l=i.marginy||0;function c(u){var d=u.x,f=u.y,h=u.width,p=u.height;t=Math.min(t,d-h/2),r=Math.max(r,d+h/2),n=Math.min(n,f-p/2),a=Math.max(a,f+p/2)}We.forEach(e.nodes(),function(u){c(e.node(u))}),We.forEach(e.edges(),function(u){var d=e.edge(u);We.has(d,"x")&&c(d)}),t-=s,n-=l,We.forEach(e.nodes(),function(u){var d=e.node(u);d.x-=t,d.y-=n}),We.forEach(e.edges(),function(u){var d=e.edge(u);We.forEach(d.points,function(f){f.x-=t,f.y-=n}),We.has(d,"x")&&(d.x-=t),We.has(d,"y")&&(d.y-=n)}),i.width=r-t+s,i.height=a-n+l}function v0e(e){We.forEach(e.edges(),function(t){var r=e.edge(t),n=e.node(t.v),a=e.node(t.w),i,s;r.points?(i=r.points[0],s=r.points[r.points.length-1]):(r.points=[],i=a,s=n),r.points.unshift(Gs.intersectRect(n,i)),r.points.push(Gs.intersectRect(a,s))})}function b0e(e){We.forEach(e.edges(),function(t){var r=e.edge(t);if(We.has(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function w0e(e){We.forEach(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}function j0e(e){We.forEach(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),a=e.node(r.borderBottom),i=e.node(We.last(r.borderLeft)),s=e.node(We.last(r.borderRight));r.width=Math.abs(s.x-i.x),r.height=Math.abs(a.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),We.forEach(e.nodes(),function(t){e.node(t).dummy==="border"&&e.removeNode(t)})}function k0e(e){We.forEach(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function N0e(e){var t=Gs.buildLayerMatrix(e);We.forEach(t,function(r){var n=0;We.forEach(r,function(a,i){var s=e.node(a);s.order=i+n,We.forEach(s.selfEdges,function(l){Gs.addDummyNode(e,"selfedge",{width:l.label.width,height:l.label.height,rank:s.rank,order:i+ ++n,e:l.e,label:l.label},"_se")}),delete s.selfEdges})})}function S0e(e){We.forEach(e.nodes(),function(t){var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v),a=n.x+n.width/2,i=n.y,s=r.x-a,l=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:a+2*s/3,y:i-l},{x:a+5*s/6,y:i-l},{x:a+s,y:i},{x:a+5*s/6,y:i+l},{x:a+2*s/3,y:i+l}],r.label.x=r.x,r.label.y=r.y}})}function yk(e,t){return We.mapValues(We.pick(e,t),Number)}function vk(e){var t={};return We.forEach(e,function(r,n){t[n.toLowerCase()]=r}),t}var qp=Bt,_0e=pn,E0e=Ra.Graph,P0e={debugOrdering:C0e};function C0e(e){var t=_0e.buildLayerMatrix(e),r=new E0e({compound:!0,multigraph:!0}).setGraph({});return qp.forEach(e.nodes(),function(n){r.setNode(n,{label:n}),r.setParent(n,"layer"+e.node(n).rank)}),qp.forEach(e.edges(),function(n){r.setEdge(n.v,n.w,{},n.name)}),qp.forEach(t,function(n,a){var i="layer"+a;r.setNode(i,{rank:"same"}),qp.reduce(n,function(s,l){return r.setEdge(s,l,{style:"invis"}),l})}),r}var A0e="0.8.5",O0e={graphlib:Ra,layout:t0e,debug:P0e,util:{time:pn.time,notime:pn.notime},version:A0e};const VD=lt(O0e),VN=240,qN=100,qD=180,UN=50,T0e=(e,t,r="TB")=>{const n=new VD.graphlib.Graph;n.setDefaultEdgeLabel(()=>({}));const a=r==="LR";return n.setGraph({rankdir:r,nodesep:80,ranksep:100}),e.forEach(i=>{const s=i.type==="artifact"?qD:VN,l=i.type==="artifact"?UN:qN;n.setNode(i.id,{width:s,height:l})}),t.forEach(i=>{n.setEdge(i.source,i.target)}),VD.layout(n),e.forEach(i=>{const s=n.node(i.id);i.targetPosition=a?"left":"top",i.sourcePosition=a?"right":"bottom";const l=i.type==="artifact"?qD:VN,c=i.type==="artifact"?UN:qN;return i.position={x:s.x-l/2,y:s.y-c/2},i}),{nodes:e,edges:t}};function lq({dag:e,steps:t,selectedStep:r,onStepSelect:n,onArtifactSelect:a}){const{nodes:i,edges:s}=S.useMemo(()=>{if(!e||!e.nodes)return{nodes:[],edges:[]};const x=[],v=[],b=new Set,j=new Map,w=P=>{if(j.has(P))return j.get(P);const C=`artifact-${P}`;return b.has(C)||(x.push({id:C,type:"artifact",data:{label:P}}),b.add(C),j.set(P,C)),C},k={},N=[{bg:"bg-blue-50 dark:bg-blue-900/20",border:"border-blue-400 dark:border-blue-500",text:"text-blue-700 dark:text-blue-300",badge:"bg-blue-100 dark:bg-blue-800 text-blue-700 dark:text-blue-300"},{bg:"bg-purple-50 dark:bg-purple-900/20",border:"border-purple-400 dark:border-purple-500",text:"text-purple-700 dark:text-purple-300",badge:"bg-purple-100 dark:bg-purple-800 text-purple-700 dark:text-purple-300"},{bg:"bg-green-50 dark:bg-green-900/20",border:"border-green-400 dark:border-green-500",text:"text-green-700 dark:text-green-300",badge:"bg-green-100 dark:bg-green-800 text-green-700 dark:text-green-300"},{bg:"bg-orange-50 dark:bg-orange-900/20",border:"border-orange-400 dark:border-orange-500",text:"text-orange-700 dark:text-orange-300",badge:"bg-orange-100 dark:bg-orange-800 text-orange-700 dark:text-orange-300"},{bg:"bg-pink-50 dark:bg-pink-900/20",border:"border-pink-400 dark:border-pink-500",text:"text-pink-700 dark:text-pink-300",badge:"bg-pink-100 dark:bg-pink-800 text-pink-700 dark:text-pink-300"},{bg:"bg-cyan-50 dark:bg-cyan-900/20",border:"border-cyan-400 dark:border-cyan-500",text:"text-cyan-700 dark:text-cyan-300",badge:"bg-cyan-100 dark:bg-cyan-800 text-cyan-700 dark:text-cyan-300"}],_=new Set;return e.nodes.forEach(P=>{const C=(t==null?void 0:t[P.id])||{};C.execution_group&&_.add(C.execution_group)}),Array.from(_).forEach((P,C)=>{k[P]=N[C%N.length]}),e.nodes.forEach(P=>{var E,R;const C=(t==null?void 0:t[P.id])||{},A=C.success?"success":C.error?"failed":C.running?"running":"pending",O=C.execution_group,T=O?k[O]:null;x.push({id:P.id,type:"step",data:{label:P.name,status:A,duration:C.duration,cached:C.cached,selected:r===P.id,execution_group:O,groupColor:T}}),(E=P.inputs)==null||E.forEach(D=>{const z=w(D);v.push({id:`e-${z}-${P.id}`,source:z,target:P.id,type:"smoothstep",animated:!0,style:{stroke:"#94a3b8",strokeWidth:2},markerEnd:{type:Kc.ArrowClosed,color:"#94a3b8"}})}),(R=P.outputs)==null||R.forEach(D=>{const z=w(D);v.push({id:`e-${P.id}-${z}`,source:P.id,target:z,type:"smoothstep",animated:!0,style:{stroke:"#94a3b8",strokeWidth:2},markerEnd:{type:Kc.ArrowClosed,color:"#94a3b8"}})})}),{nodes:x,edges:v}},[e,t,r]),{nodes:l,edges:c}=S.useMemo(()=>T0e(i,s,"TB"),[i,s]),[u,d,f]=_ue(l),[h,p,m]=Eue(c);S.useEffect(()=>{d(l.map(x=>x.type==="step"?{...x,data:{...x.data,selected:r===x.id}}:x)),p(c)},[l,c,r,d,p]);const g=S.useCallback((x,v)=>{v.type==="step"&&n?n(v.id):v.type==="artifact"&&a&&a(v.data.label)},[n,a]),y=S.useMemo(()=>({step:M0e,artifact:R0e}),[]);return o.jsx("div",{className:"w-full h-full bg-slate-50/50 dark:bg-slate-900/50 rounded-xl border border-slate-200 dark:border-slate-800 overflow-hidden",children:o.jsxs(CB,{nodes:u,edges:h,onNodesChange:f,onEdgesChange:m,onNodeClick:g,nodeTypes:y,fitView:!0,attributionPosition:"bottom-left",minZoom:.2,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.8},fitViewOptions:{padding:.2},children:[o.jsx(Xue,{color:"#e2e8f0",gap:20,size:1}),o.jsx(Uue,{className:"bg-white border border-slate-200 shadow-sm rounded-lg"}),o.jsx(Iue,{nodeColor:x=>x.type==="step"?"#3b82f6":"#cbd5e1",maskColor:"rgba(241, 245, 249, 0.7)",className:"bg-white border border-slate-200 shadow-sm rounded-lg"})]})})}function M0e({data:e}){const t={success:{icon:o.jsx(rr,{size:18}),color:"text-emerald-600 dark:text-emerald-400",bg:"bg-white dark:bg-slate-800",border:"border-emerald-500 dark:border-emerald-500",ring:"ring-emerald-200 dark:ring-emerald-900",shadow:"shadow-emerald-100 dark:shadow-none"},failed:{icon:o.jsx(kr,{size:18}),color:"text-rose-600 dark:text-rose-400",bg:"bg-white dark:bg-slate-800",border:"border-rose-500 dark:border-rose-500",ring:"ring-rose-200 dark:ring-rose-900",shadow:"shadow-rose-100 dark:shadow-none"},running:{icon:o.jsx(tF,{size:18,className:"animate-spin"}),color:"text-amber-600 dark:text-amber-400",bg:"bg-white dark:bg-slate-800",border:"border-amber-500 dark:border-amber-500",ring:"ring-amber-200 dark:ring-amber-900",shadow:"shadow-amber-100 dark:shadow-none"},pending:{icon:o.jsx(ht,{size:18}),color:"text-slate-400 dark:text-slate-500",bg:"bg-slate-50 dark:bg-slate-800/50",border:"border-slate-300 dark:border-slate-700",ring:"ring-slate-200 dark:ring-slate-800",shadow:"shadow-slate-100 dark:shadow-none"}},r=t[e.status]||t.pending,n=e.groupColor,a=e.execution_group&&n;return o.jsxs("div",{className:`
650
+ relative px-4 py-3 rounded-lg border-2 transition-all duration-200
651
+ ${a?n.bg:r.bg}
652
+ ${a?n.border:r.border}
653
+ ${e.selected?`ring-4 ${r.ring} shadow-lg`:`hover:shadow-md ${r.shadow}`}
654
+ `,style:{width:VN,height:qN},children:[o.jsx(Ws,{type:"target",position:_e.Top,className:"!bg-slate-400 !w-2 !h-2"}),o.jsxs("div",{className:"flex flex-col h-full justify-between",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:`p-1.5 rounded-md bg-slate-50 border border-slate-100 ${r.color}`,children:r.icon}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("h3",{className:`font-bold text-sm truncate ${a?n.text:"text-slate-900 dark:text-white"}`,title:e.label,children:e.label}),o.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[o.jsx("p",{className:"text-xs text-slate-500 capitalize",children:e.status}),a&&o.jsx("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded ${n.badge}`,children:e.execution_group})]})]})]}),e.duration!==void 0&&o.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-slate-100 mt-1",children:[o.jsxs("span",{className:"text-xs text-slate-400 font-mono",children:[e.duration.toFixed(2),"s"]}),e.cached&&o.jsx("span",{className:"text-[10px] font-bold text-blue-600 bg-blue-50 px-1.5 py-0.5 rounded uppercase tracking-wider",children:"Cached"})]})]}),o.jsx(Ws,{type:"source",position:_e.Bottom,className:"!bg-slate-400 !w-2 !h-2"})]})}function R0e({data:e}){const r=(a=>{const i=a.toLowerCase();return i.includes("model")||i.includes("weights")?{icon:Ur,bgColor:"bg-purple-100 dark:bg-purple-900/30",borderColor:"border-purple-400 dark:border-purple-600",iconColor:"text-purple-600 dark:text-purple-400",textColor:"text-purple-900 dark:text-purple-100"}:i.includes("feature")||i.includes("train_set")||i.includes("test_set")?{icon:Zr,bgColor:"bg-emerald-100 dark:bg-emerald-900/30",borderColor:"border-emerald-400 dark:border-emerald-600",iconColor:"text-emerald-600 dark:text-emerald-400",textColor:"text-emerald-900 dark:text-emerald-100"}:i.includes("data")||i.includes("batch")||i.includes("set")?{icon:nr,bgColor:"bg-blue-100 dark:bg-blue-900/30",borderColor:"border-blue-400 dark:border-blue-600",iconColor:"text-blue-600 dark:text-blue-400",textColor:"text-blue-900 dark:text-blue-100"}:i.includes("metrics")||i.includes("report")||i.includes("status")?{icon:Pn,bgColor:"bg-orange-100 dark:bg-orange-900/30",borderColor:"border-orange-400 dark:border-orange-600",iconColor:"text-orange-600 dark:text-orange-400",textColor:"text-orange-900 dark:text-orange-100"}:i.includes("image")||i.includes("docker")?{icon:Ur,bgColor:"bg-cyan-100 dark:bg-cyan-900/30",borderColor:"border-cyan-400 dark:border-cyan-600",iconColor:"text-cyan-600 dark:text-cyan-400",textColor:"text-cyan-900 dark:text-cyan-100"}:{icon:qs,bgColor:"bg-slate-100 dark:bg-slate-800",borderColor:"border-slate-300 dark:border-slate-600",iconColor:"text-slate-500 dark:text-slate-400",textColor:"text-slate-700 dark:text-slate-300"}})(e.label),n=r.icon;return o.jsxs("div",{className:`px-3 py-2 rounded-lg ${r.bgColor} border-2 ${r.borderColor} flex items-center justify-center gap-2 shadow-md hover:shadow-lg transition-all min-w-[140px] cursor-pointer`,style:{height:UN},children:[o.jsx(Ws,{type:"target",position:_e.Top,className:"!bg-slate-400 !w-2 !h-2"}),o.jsx(n,{size:14,className:r.iconColor}),o.jsx("span",{className:`text-xs font-semibold ${r.textColor} truncate max-w-[100px]`,title:e.label,children:e.label}),o.jsx(Ws,{type:"source",position:_e.Bottom,className:"!bg-slate-400 !w-2 !h-2"})]})}function D0e({run:e,onClose:t}){var g;const[r,n]=S.useState(null),[a,i]=S.useState([]),[s,l]=S.useState(!1),[c,u]=S.useState("overview"),[d,f]=S.useState(e==null?void 0:e.project);S.useEffect(()=>{e&&(h(),f(e.project))},[e]);const h=async()=>{l(!0);try{const[y,x]=await Promise.all([Ne(`/api/runs/${e.run_id}`),Ne(`/api/assets?run_id=${e.run_id}`)]),v=await y.json(),b=await x.json();n(v),i(b.assets||[]),v.project&&f(v.project)}catch(y){console.error("Failed to fetch run details:",y)}finally{l(!1)}},p=async y=>{try{await Ne(`/api/runs/${e.run_id}/project`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_name:y})}),f(y)}catch(x){console.error("Failed to update project:",x)}};if(!e)return null;const m=r||e;return o.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-slate-900",children:[o.jsxs("div",{className:"p-6 border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50",children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"p-3 bg-blue-100 dark:bg-blue-900/30 rounded-xl text-blue-600 dark:text-blue-400",children:o.jsx(fn,{size:24})}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:m.name||`Run ${(g=m.run_id)==null?void 0:g.slice(0,8)}`}),o.jsx(qc,{status:m.status})]}),o.jsxs("div",{className:"flex items-center gap-2 mt-1 text-sm text-slate-500",children:[o.jsx("span",{className:"font-mono text-xs bg-slate-100 dark:bg-slate-800 px-1.5 py-0.5 rounded",children:m.run_id}),o.jsx("span",{children:"•"}),o.jsx(lx,{currentProject:d,onUpdate:p}),m.pipeline_name&&o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"•"}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Zr,{size:12}),m.pipeline_name]})]})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ft,{to:`/runs/${m.run_id}`,children:o.jsxs(fe,{variant:"outline",size:"sm",children:["Full View ",o.jsx(Ai,{size:16,className:"ml-1"})]})}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:t,children:o.jsx(Tn,{size:20,className:"text-slate-400"})})]})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsx(bk,{label:"Duration",value:m.duration?`${m.duration.toFixed(2)}s`:"-",icon:ht,color:"blue"}),o.jsx(bk,{label:"Started",value:m.start_time?Ft(new Date(m.start_time),"MMM d, HH:mm"):"-",icon:_a,color:"purple"}),o.jsx(bk,{label:"Steps",value:m.steps?Object.keys(m.steps).length:0,icon:Fe,color:"emerald"})]})]}),o.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[o.jsxs("div",{className:"flex items-center gap-1 p-2 border-b border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900",children:[o.jsx(wk,{active:c==="overview",onClick:()=>u("overview"),icon:Fe,label:"Overview"}),o.jsx(wk,{active:c==="steps",onClick:()=>u("steps"),icon:Zr,label:"Steps"}),o.jsx(wk,{active:c==="artifacts",onClick:()=>u("artifacts"),icon:Ur,label:"Artifacts"})]}),o.jsx("div",{className:"flex-1 overflow-y-auto bg-slate-50 dark:bg-slate-900/50 p-4",children:s?o.jsx("div",{className:"flex justify-center py-12",children:o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):o.jsxs(o.Fragment,{children:[c==="overview"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden h-[400px] flex flex-col bg-white dark:bg-slate-800",children:[o.jsx("div",{className:"p-3 border-b border-slate-100 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50 flex justify-between items-center shrink-0",children:o.jsx("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300",children:"Pipeline Graph"})}),o.jsx("div",{className:"flex-1 min-h-0 bg-slate-50/50 dark:bg-slate-900/50",children:m.dag?o.jsx(lq,{dag:m.dag,steps:m.steps}):o.jsx("div",{className:"h-full flex items-center justify-center text-slate-400 text-sm",children:"No graph data available"})})]}),m.status==="failed"&&m.error&&o.jsxs("div",{className:"bg-rose-50 dark:bg-rose-900/20 border border-rose-200 dark:border-rose-800 rounded-xl p-4",children:[o.jsxs("h3",{className:"text-rose-700 dark:text-rose-400 font-semibold flex items-center gap-2 mb-2",children:[o.jsx(kr,{size:18}),"Execution Failed"]}),o.jsx("pre",{className:"text-xs font-mono text-rose-600 dark:text-rose-300 whitespace-pre-wrap overflow-x-auto",children:m.error})]})]}),c==="steps"&&o.jsxs("div",{className:"space-y-3",children:[m.steps&&Object.entries(m.steps).map(([y,x])=>o.jsxs("div",{className:"bg-white dark:bg-slate-800 p-3 rounded-xl border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(qc,{status:x.success?"completed":x.error?"failed":"running",size:"sm"}),o.jsx("span",{className:"font-medium text-slate-900 dark:text-white",children:y})]}),o.jsx("span",{className:"text-xs text-slate-500 font-mono",children:x.duration?`${x.duration.toFixed(2)}s`:"-"})]}),x.error&&o.jsx("div",{className:"text-xs text-rose-600 bg-rose-50 dark:bg-rose-900/20 p-2 rounded mt-2 font-mono",children:x.error})]},y)),(!m.steps||Object.keys(m.steps).length===0)&&o.jsx("div",{className:"text-center py-8 text-slate-500",children:"No steps recorded"})]}),c==="artifacts"&&o.jsx("div",{className:"space-y-3",children:a.length>0?a.map(y=>o.jsxs("div",{className:"flex items-center gap-3 p-3 bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700 hover:border-primary-300 dark:hover:border-primary-700 transition-colors",children:[o.jsx("div",{className:"p-2 bg-slate-50 dark:bg-slate-700 rounded-md text-slate-500 dark:text-slate-400",children:o.jsx(qs,{size:18})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white truncate",children:y.name}),o.jsx("p",{className:"text-xs text-slate-500 truncate",children:y.type})]}),o.jsx(ft,{to:`/runs/${e.run_id}`,children:o.jsx(fe,{variant:"ghost",size:"sm",children:o.jsx(Ai,{size:14})})})]},y.artifact_id)):o.jsx("div",{className:"text-center py-8 text-slate-500",children:"No artifacts found for this run."})})]})})]})]})}function bk({label:e,value:t,icon:r,color:n}){const a={blue:"text-blue-600 bg-blue-50 dark:bg-blue-900/20",emerald:"text-emerald-600 bg-emerald-50 dark:bg-emerald-900/20",purple:"text-purple-600 bg-purple-50 dark:bg-purple-900/20",rose:"text-rose-600 bg-rose-50 dark:bg-rose-900/20"};return o.jsxs("div",{className:"bg-white dark:bg-slate-800 p-3 rounded-xl border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("div",{className:`p-1 rounded-lg ${a[n]}`,children:o.jsx(r,{size:14})}),o.jsx("span",{className:"text-xs text-slate-500 font-medium",children:e})]}),o.jsx("div",{className:"text-sm font-bold text-slate-900 dark:text-white pl-1 truncate",title:t,children:t})]})}function wk({active:e,onClick:t,icon:r,label:n}){return o.jsxs("button",{onClick:t,className:`
655
+ flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all
656
+ ${e?"bg-slate-100 dark:bg-slate-800 text-slate-900 dark:text-white":"text-slate-500 hover:bg-slate-50 dark:hover:bg-slate-800/50 hover:text-slate-700 dark:hover:text-slate-300"}
657
+ `,children:[o.jsx(r,{size:16}),n]})}function $0e(){const[e,t]=S.useState([]),[r,n]=S.useState(!0),[a,i]=S.useState(null),[s]=Jg(),l=Lh(),{selectedProject:c}=Ui(),[u,d]=S.useState("single"),[f,h]=S.useState([]),[p,m]=S.useState("all"),g=s.get("pipeline"),y=async()=>{n(!0);try{let w="/api/runs/?limit=100";c&&(w+=`&project=${encodeURIComponent(c)}`),g&&(w+=`&pipeline=${encodeURIComponent(g)}`);const N=await(await Ne(w)).json();t(N.runs||[])}catch(w){console.error(w)}finally{n(!1)}};S.useEffect(()=>{y()},[c,g]);const x=w=>{u==="single"&&i(w)},v=()=>{u==="single"?(d("multi"),h([])):(d("single"),h([]))},b=(w,k)=>{h(k?N=>[...N,w]:N=>N.filter(_=>_!==w))},j=()=>{f.length>=2&&l(`/compare?runs=${f.join(",")}`)};return o.jsxs("div",{className:"h-screen flex flex-col overflow-hidden bg-slate-50 dark:bg-slate-900",children:[o.jsx("div",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4 shrink-0",children:o.jsxs("div",{className:"flex items-center justify-between max-w-[1800px] mx-auto",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(fn,{className:"text-blue-500"}),"Pipeline Runs"]}),o.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:"Monitor and track all your pipeline executions"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[u==="multi"?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"text-sm text-slate-500 mr-2",children:[f.length," selected"]}),o.jsxs(fe,{size:"sm",variant:"primary",disabled:f.length<2,onClick:j,children:[o.jsx(vE,{size:16,className:"mr-2"}),"Compare"]}),o.jsxs(fe,{variant:"ghost",size:"sm",onClick:v,children:[o.jsx(Tn,{size:16,className:"mr-2"}),"Cancel"]})]}):o.jsxs(fe,{variant:"outline",size:"sm",onClick:v,children:[o.jsx(fZ,{size:16,className:"mr-2"}),"Select to Compare"]}),o.jsxs(fe,{variant:"outline",size:"sm",onClick:y,disabled:r,children:[o.jsx(vi,{size:16,className:`mr-2 ${r?"animate-spin":""}`}),"Refresh"]})]})]})}),o.jsx("div",{className:"flex-1 overflow-hidden",children:o.jsx("div",{className:"h-full max-w-[1800px] mx-auto px-6 py-6",children:o.jsxs("div",{className:"h-full flex gap-6",children:[o.jsxs("div",{className:"w-[320px] shrink-0 flex flex-col bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:[o.jsxs("div",{className:"p-3 border-b border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50 flex justify-between items-center",children:[o.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Explorer"}),g&&o.jsxs(qe,{variant:"secondary",className:"text-[10px]",children:["Filtered: ",g]})]}),o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(aP,{mode:"runs",projectId:c,onSelect:x,selectedId:a==null?void 0:a.run_id,selectionMode:u,selectedIds:f,onMultiSelect:b})})]}),o.jsx("div",{className:"flex-1 min-w-0 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:a?o.jsx(D0e,{run:a,onClose:()=>i(null)}):o.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center p-8 bg-slate-50/50 dark:bg-slate-900/50",children:[o.jsx("div",{className:"w-20 h-20 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center mb-6 animate-pulse",children:o.jsx(fn,{size:40,className:"text-blue-500"})}),o.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-2",children:"Select a Run"}),o.jsx("p",{className:"text-slate-500 max-w-md",children:"Choose a run from the sidebar to view execution details, logs, and artifacts."})]})})]})})})]})}const Yc=async e=>{if(!e)return;const r=`${await q7()}/api/assets/${e}/download`;window.open(r,"_blank","noopener,noreferrer")};function I0e(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function L0e(e,t){if(e==null)return{};var r,n,a=I0e(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function HN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function z0e(e){if(Array.isArray(e))return HN(e)}function F0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function B0e(e,t){if(e){if(typeof e=="string")return HN(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?HN(e,t):void 0}}function V0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
658
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WN(e){return z0e(e)||F0e(e)||B0e(e)||V0e()}function Gf(e){"@babel/helpers - typeof";return Gf=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},Gf(e)}function q0e(e,t){if(Gf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function U0e(e){var t=q0e(e,"string");return Gf(t)=="symbol"?t:t+""}function cq(e,t,r){return(t=U0e(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GN(){return GN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GN.apply(null,arguments)}function UD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function cc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UD(Object(r),!0).forEach(function(n){cq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function H0e(e){var t=e.length;if(t===0||t===1)return e;if(t===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(t===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(t>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var jk={};function W0e(e){if(e.length===0||e.length===1)return e;var t=e.join(".");return jk[t]||(jk[t]=H0e(e)),jk[t]}function G0e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=e.filter(function(i){return i!=="token"}),a=W0e(n);return a.reduce(function(i,s){return cc(cc({},i),r[s])},t)}function HD(e){return e.join(" ")}function K0e(e,t){var r=0;return function(n){return r+=1,n.map(function(a,i){return uq({node:a,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(r,"-").concat(i)})})}}function uq(e){var t=e.node,r=e.stylesheet,n=e.style,a=n===void 0?{}:n,i=e.useInlineStyles,s=e.key,l=t.properties,c=t.type,u=t.tagName,d=t.value;if(c==="text")return d;if(u){var f=K0e(r,i),h;if(!i)h=cc(cc({},l),{},{className:HD(l.className)});else{var p=Object.keys(r).reduce(function(x,v){return v.split(".").forEach(function(b){x.includes(b)||x.push(b)}),x},[]),m=l.className&&l.className.includes("token")?["token"]:[],g=l.className&&m.concat(l.className.filter(function(x){return!p.includes(x)}));h=cc(cc({},l),{},{className:HD(g)||void 0,style:G0e(l.className,Object.assign({},l.style,a),r)})}var y=f(t.children);return M.createElement(u,GN({key:s},h),y)}}const Y0e=function(e,t){var r=e.listLanguages();return r.indexOf(t)!==-1};var X0e=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function WD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ss(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WD(Object(r),!0).forEach(function(n){cq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Z0e=/\n/g;function Q0e(e){return e.match(Z0e)}function J0e(e){var t=e.lines,r=e.startingLineNumber,n=e.style;return t.map(function(a,i){var s=i+r;return M.createElement("span",{key:"line-".concat(i),className:"react-syntax-highlighter-line-number",style:typeof n=="function"?n(s):n},"".concat(s,`
659
+ `))})}function ege(e){var t=e.codeString,r=e.codeStyle,n=e.containerStyle,a=n===void 0?{float:"left",paddingRight:"10px"}:n,i=e.numberStyle,s=i===void 0?{}:i,l=e.startingLineNumber;return M.createElement("code",{style:Object.assign({},r,a)},J0e({lines:t.replace(/\n$/,"").split(`
660
+ `),style:s,startingLineNumber:l}))}function tge(e){return"".concat(e.toString().length,".25em")}function dq(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function fq(e,t,r){var n={display:"inline-block",minWidth:tge(r),paddingRight:"1em",textAlign:"right",userSelect:"none"},a=typeof e=="function"?e(t):e,i=Ss(Ss({},n),a);return i}function $m(e){var t=e.children,r=e.lineNumber,n=e.lineNumberStyle,a=e.largestLineNumber,i=e.showInlineLineNumbers,s=e.lineProps,l=s===void 0?{}:s,c=e.className,u=c===void 0?[]:c,d=e.showLineNumbers,f=e.wrapLongLines,h=e.wrapLines,p=h===void 0?!1:h,m=p?Ss({},typeof l=="function"?l(r):l):{};if(m.className=m.className?[].concat(WN(m.className.trim().split(/\s+/)),WN(u)):u,r&&i){var g=fq(n,r,a);t.unshift(dq(r,g))}return f&d&&(m.style=Ss({display:"flex"},m.style)),{type:"element",tagName:"span",properties:m,children:t}}function hq(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];e.length===void 0&&(e=[e]);for(var n=0;n<e.length;n++){var a=e[n];if(a.type==="text")r.push($m({children:[a],className:WN(new Set(t))}));else if(a.children){var i,s=t.concat(((i=a.properties)===null||i===void 0?void 0:i.className)||[]);hq(a.children,s).forEach(function(l){return r.push(l)})}}return r}function rge(e,t,r,n,a,i,s,l,c){var u,d=hq(e.value),f=[],h=-1,p=0;function m(w,k){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return $m({children:w,lineNumber:k,lineNumberStyle:l,largestLineNumber:s,showInlineLineNumbers:a,lineProps:r,className:N,showLineNumbers:n,wrapLongLines:c,wrapLines:t})}function g(w,k){if(n&&k&&a){var N=fq(l,k,s);w.unshift(dq(k,N))}return w}function y(w,k){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||N.length>0?m(w,k,N):g(w,k)}for(var x=function(){var k=d[p],N=k.children[0].value,_=Q0e(N);if(_){var P=N.split(`
661
+ `);P.forEach(function(C,A){var O=n&&f.length+i,T={type:"text",value:"".concat(C,`
662
+ `)};if(A===0){var E=d.slice(h+1,p).concat($m({children:[T],className:k.properties.className})),R=y(E,O);f.push(R)}else if(A===P.length-1){var D=d[p+1]&&d[p+1].children&&d[p+1].children[0],z={type:"text",value:"".concat(C)};if(D){var I=$m({children:[z],className:k.properties.className});d.splice(p+1,0,I)}else{var $=[z],F=y($,O,k.properties.className);f.push(F)}}else{var q=[T],V=y(q,O,k.properties.className);f.push(V)}}),h=p}p++};p<d.length;)x();if(h!==d.length-1){var v=d.slice(h+1,d.length);if(v&&v.length){var b=n&&f.length+i,j=y(v,b);f.push(j)}}return t?f:(u=[]).concat.apply(u,f)}function nge(e){var t=e.rows,r=e.stylesheet,n=e.useInlineStyles;return t.map(function(a,i){return uq({node:a,stylesheet:r,useInlineStyles:n,key:"code-segment-".concat(i)})})}function pq(e){return e&&typeof e.highlightAuto<"u"}function age(e){var t=e.astGenerator,r=e.language,n=e.code,a=e.defaultCodeValue;if(pq(t)){var i=Y0e(t,r);return r==="text"?{value:a,language:"text"}:i?t.highlight(r,n):t.highlightAuto(n)}try{return r&&r!=="text"?{value:t.highlight(n,r)}:{value:a}}catch{return{value:a}}}function ige(e,t){return function(n){var a,i,s=n.language,l=n.children,c=n.style,u=c===void 0?t:c,d=n.customStyle,f=d===void 0?{}:d,h=n.codeTagProps,p=h===void 0?{className:s?"language-".concat(s):void 0,style:Ss(Ss({},u['code[class*="language-"]']),u['code[class*="language-'.concat(s,'"]')])}:h,m=n.useInlineStyles,g=m===void 0?!0:m,y=n.showLineNumbers,x=y===void 0?!1:y,v=n.showInlineLineNumbers,b=v===void 0?!0:v,j=n.startingLineNumber,w=j===void 0?1:j,k=n.lineNumberContainerStyle,N=n.lineNumberStyle,_=N===void 0?{}:N,P=n.wrapLines,C=n.wrapLongLines,A=C===void 0?!1:C,O=n.lineProps,T=O===void 0?{}:O,E=n.renderer,R=n.PreTag,D=R===void 0?"pre":R,z=n.CodeTag,I=z===void 0?"code":z,$=n.code,F=$===void 0?(Array.isArray(l)?l[0]:l)||"":$,q=n.astGenerator,V=L0e(n,X0e);q=q||e;var L=x?M.createElement(ege,{containerStyle:k,codeStyle:p.style||{},numberStyle:_,startingLineNumber:w,codeString:F}):null,B=u.hljs||u['pre[class*="language-"]']||{backgroundColor:"#fff"},Y=pq(q)?"hljs":"prismjs",W=g?Object.assign({},V,{style:Object.assign({},B,f)}):Object.assign({},V,{className:V.className?"".concat(Y," ").concat(V.className):Y,style:Object.assign({},f)});if(A?p.style=Ss({whiteSpace:"pre-wrap"},p.style):p.style=Ss({whiteSpace:"pre"},p.style),!q)return M.createElement(D,W,L,M.createElement(I,p,F));(P===void 0&&E||A)&&(P=!0),E=E||nge;var K=[{type:"text",value:F}],Q=age({astGenerator:q,language:s,code:F,defaultCodeValue:K});Q.language===null&&(Q.value=K);var X=(a=(i=F.match(/\n/g))===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0,ee=w+X,U=rge(Q,P,T,x,b,w,ee,_,A);return M.createElement(D,W,M.createElement(I,p,!b&&L,E({rows:U,stylesheet:u,useInlineStyles:g})))}}var bl={};function GP(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(function(t){var r=e[t];typeof r=="object"&&!Object.isFrozen(r)&&GP(r)}),e}var mq=GP,sge=GP;mq.default=sge;class GD{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function _c(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function _s(e,...t){const r=Object.create(null);for(const n in e)r[n]=e[n];return t.forEach(function(n){for(const a in n)r[a]=n[a]}),r}const oge="</span>",KD=e=>!!e.kind;class lge{constructor(t,r){this.buffer="",this.classPrefix=r.classPrefix,t.walk(this)}addText(t){this.buffer+=_c(t)}openNode(t){if(!KD(t))return;let r=t.kind;t.sublanguage||(r=`${this.classPrefix}${r}`),this.span(r)}closeNode(t){KD(t)&&(this.buffer+=oge)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}class KP{constructor(){this.rootNode={children:[]},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 r={kind:t,children:[]};this.add(r),this.stack.push(r)}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,r){return typeof r=="string"?t.addText(r):r.children&&(t.openNode(r),r.children.forEach(n=>this._walk(t,n)),t.closeNode(r)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(r=>typeof r=="string")?t.children=[t.children.join("")]:t.children.forEach(r=>{KP._collapse(r)}))}}class cge extends KP{constructor(t){super(),this.options=t}addKeyword(t,r){t!==""&&(this.openNode(r),this.addText(t),this.closeNode())}addText(t){t!==""&&this.add(t)}addSublanguage(t,r){const n=t.root;n.kind=r,n.sublanguage=!0,this.add(n)}toHTML(){return new lge(this,this.options).value()}finalize(){return!0}}function uge(e){return new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function Kf(e){return e?typeof e=="string"?e:e.source:null}function dge(...e){return e.map(r=>Kf(r)).join("")}function fge(...e){return"("+e.map(r=>Kf(r)).join("|")+")"}function hge(e){return new RegExp(e.toString()+"|").exec("").length-1}function pge(e,t){const r=e&&e.exec(t);return r&&r.index===0}const mge=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function gge(e,t="|"){let r=0;return e.map(n=>{r+=1;const a=r;let i=Kf(n),s="";for(;i.length>0;){const l=mge.exec(i);if(!l){s+=i;break}s+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+a):(s+=l[0],l[0]==="("&&r++)}return s}).map(n=>`(${n})`).join(t)}const xge=/\b\B/,gq="[a-zA-Z]\\w*",YP="[a-zA-Z_]\\w*",XP="\\b\\d+(\\.\\d+)?",xq="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",yq="\\b(0b[01]+)",yge="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",vge=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=dge(t,/.*\b/,e.binary,/\b.*/)),_s({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch()}},e)},Yf={begin:"\\\\[\\s\\S]",relevance:0},bge={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[Yf]},wge={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[Yf]},vq={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/},Dx=function(e,t,r={}){const n=_s({className:"comment",begin:e,end:t,contains:[]},r);return n.contains.push(vq),n.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),n},jge=Dx("//","$"),kge=Dx("/\\*","\\*/"),Nge=Dx("#","$"),Sge={className:"number",begin:XP,relevance:0},_ge={className:"number",begin:xq,relevance:0},Ege={className:"number",begin:yq,relevance:0},Pge={className:"number",begin:XP+"(%|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},Cge={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Yf,{begin:/\[/,end:/\]/,relevance:0,contains:[Yf]}]}]},Age={className:"title",begin:gq,relevance:0},Oge={className:"title",begin:YP,relevance:0},Tge={begin:"\\.\\s*"+YP,relevance:0},Mge=function(e){return Object.assign(e,{"on:begin":(t,r)=>{r.data._beginMatch=t[1]},"on:end":(t,r)=>{r.data._beginMatch!==t[1]&&r.ignoreMatch()}})};var Up=Object.freeze({__proto__:null,MATCH_NOTHING_RE:xge,IDENT_RE:gq,UNDERSCORE_IDENT_RE:YP,NUMBER_RE:XP,C_NUMBER_RE:xq,BINARY_NUMBER_RE:yq,RE_STARTERS_RE:yge,SHEBANG:vge,BACKSLASH_ESCAPE:Yf,APOS_STRING_MODE:bge,QUOTE_STRING_MODE:wge,PHRASAL_WORDS_MODE:vq,COMMENT:Dx,C_LINE_COMMENT_MODE:jge,C_BLOCK_COMMENT_MODE:kge,HASH_COMMENT_MODE:Nge,NUMBER_MODE:Sge,C_NUMBER_MODE:_ge,BINARY_NUMBER_MODE:Ege,CSS_NUMBER_MODE:Pge,REGEXP_MODE:Cge,TITLE_MODE:Age,UNDERSCORE_TITLE_MODE:Oge,METHOD_GUARD:Tge,END_SAME_AS_BEGIN:Mge});function Rge(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Dge(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Rge,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function $ge(e,t){Array.isArray(e.illegal)&&(e.illegal=fge(...e.illegal))}function Ige(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 Lge(e,t){e.relevance===void 0&&(e.relevance=1)}const zge=["of","and","for","in","not","or","if","then","parent","list","value"],Fge="keyword";function bq(e,t,r=Fge){const n={};return typeof e=="string"?a(r,e.split(" ")):Array.isArray(e)?a(r,e):Object.keys(e).forEach(function(i){Object.assign(n,bq(e[i],t,i))}),n;function a(i,s){t&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){const c=l.split("|");n[c[0]]=[i,Bge(c[0],c[1])]})}}function Bge(e,t){return t?Number(t):Vge(e)?0:1}function Vge(e){return zge.includes(e.toLowerCase())}function qge(e,{plugins:t}){function r(l,c){return new RegExp(Kf(l),"m"+(e.case_insensitive?"i":"")+(c?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,c]),this.matchAt+=hge(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const c=this.regexes.map(u=>u[1]);this.matcherRe=r(gge(c),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;const u=this.matcherRe.exec(c);if(!u)return null;const d=u.findIndex((h,p)=>p>0&&h!==void 0),f=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,f)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];const u=new n;return this.rules.slice(c).forEach(([d,f])=>u.addRule(d,f)),u.compile(),this.multiRegexes[c]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,u){this.rules.push([c,u]),u.type==="begin"&&this.count++}exec(c){const u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(c);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){const f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(c)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(l){const c=new a;return l.contains.forEach(u=>c.addRule(u.begin,{rule:u,type:"begin"})),l.terminatorEnd&&c.addRule(l.terminatorEnd,{type:"end"}),l.illegal&&c.addRule(l.illegal,{type:"illegal"}),c}function s(l,c){const u=l;if(l.isCompiled)return u;[Ige].forEach(f=>f(l,c)),e.compilerExtensions.forEach(f=>f(l,c)),l.__beforeBegin=null,[Dge,$ge,Lge].forEach(f=>f(l,c)),l.isCompiled=!0;let d=null;if(typeof l.keywords=="object"&&(d=l.keywords.$pattern,delete l.keywords.$pattern),l.keywords&&(l.keywords=bq(l.keywords,e.case_insensitive)),l.lexemes&&d)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return d=d||l.lexemes||/\w+/,u.keywordPatternRe=r(d,!0),c&&(l.begin||(l.begin=/\B|\b/),u.beginRe=r(l.begin),l.endSameAsBegin&&(l.end=l.begin),!l.end&&!l.endsWithParent&&(l.end=/\B|\b/),l.end&&(u.endRe=r(l.end)),u.terminatorEnd=Kf(l.end)||"",l.endsWithParent&&c.terminatorEnd&&(u.terminatorEnd+=(l.end?"|":"")+c.terminatorEnd)),l.illegal&&(u.illegalRe=r(l.illegal)),l.contains||(l.contains=[]),l.contains=[].concat(...l.contains.map(function(f){return Uge(f==="self"?l:f)})),l.contains.forEach(function(f){s(f,u)}),l.starts&&s(l.starts,c),u.matcher=i(u),u}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=_s(e.classNameAliases||{}),s(e)}function wq(e){return e?e.endsWithParent||wq(e.starts):!1}function Uge(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return _s(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:wq(e)?_s(e,{starts:e.starts?_s(e.starts):null}):Object.isFrozen(e)?_s(e):e}var Hge="10.7.3";function Wge(e){return!!(e||e==="")}function Gge(e){const t={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,_c(this.code);let n={};return this.autoDetect?(n=e.highlightAuto(this.code),this.detectedLanguage=n.language):(n=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),n.value},autoDetect(){return!this.language||Wge(this.autodetect)},ignoreIllegals(){return!0}},render(n){return n("pre",{},[n("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:t,VuePlugin:{install(n){n.component("highlightjs",t)}}}}const Kge={"after:highlightElement":({el:e,result:t,text:r})=>{const n=YD(e);if(!n.length)return;const a=document.createElement("div");a.innerHTML=t.value,t.value=Yge(n,YD(a),r)}};function KN(e){return e.nodeName.toLowerCase()}function YD(e){const t=[];return function r(n,a){for(let i=n.firstChild;i;i=i.nextSibling)i.nodeType===3?a+=i.nodeValue.length:i.nodeType===1&&(t.push({event:"start",offset:a,node:i}),a=r(i,a),KN(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:a,node:i}));return a}(e,0),t}function Yge(e,t,r){let n=0,a="";const i=[];function s(){return!e.length||!t.length?e.length?e:t:e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:t[0].event==="start"?e:t}function l(d){function f(h){return" "+h.nodeName+'="'+_c(h.value)+'"'}a+="<"+KN(d)+[].map.call(d.attributes,f).join("")+">"}function c(d){a+="</"+KN(d)+">"}function u(d){(d.event==="start"?l:c)(d.node)}for(;e.length||t.length;){let d=s();if(a+=_c(r.substring(n,d[0].offset)),n=d[0].offset,d===e){i.reverse().forEach(c);do u(d.splice(0,1)[0]),d=s();while(d===e&&d.length&&d[0].offset===n);i.reverse().forEach(l)}else d[0].event==="start"?i.push(d[0].node):i.pop(),u(d.splice(0,1)[0])}return a+_c(r.substr(n))}const XD={},kk=e=>{console.error(e)},ZD=(e,...t)=>{console.log(`WARN: ${e}`,...t)},$n=(e,t)=>{XD[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),XD[`${e}/${t}`]=!0)},Nk=_c,QD=_s,JD=Symbol("nomatch"),Xge=function(e){const t=Object.create(null),r=Object.create(null),n=[];let a=!0;const i=/(^(<[^>]+>|\t|)+|\n)/gm,s="Could not find the language '{}', did you forget to load/include a language module?",l={disableAutodetect:!0,name:"Plain text",contains:[]};let c={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:cge};function u(L){return c.noHighlightRe.test(L)}function d(L){let B=L.className+" ";B+=L.parentNode?L.parentNode.className:"";const Y=c.languageDetectRe.exec(B);if(Y){const W=R(Y[1]);return W||(ZD(s.replace("{}",Y[1])),ZD("Falling back to no-highlight mode for this block.",L)),W?Y[1]:"no-highlight"}return B.split(/\s+/).find(W=>u(W)||R(W))}function f(L,B,Y,W){let K="",Q="";typeof B=="object"?(K=L,Y=B.ignoreIllegals,Q=B.language,W=void 0):($n("10.7.0","highlight(lang, code, ...args) has been deprecated."),$n("10.7.0",`Please use highlight(code, options) instead.
663
+ https://github.com/highlightjs/highlight.js/issues/2277`),Q=L,K=B);const X={code:K,language:Q};F("before:highlight",X);const ee=X.result?X.result:h(X.language,X.code,Y,W);return ee.code=X.code,F("after:highlight",ee),ee}function h(L,B,Y,W){function K(me,he){const Ee=$e.case_insensitive?he[0].toLowerCase():he[0];return Object.prototype.hasOwnProperty.call(me.keywords,Ee)&&me.keywords[Ee]}function Q(){if(!xe.keywords){Le.addText(Me);return}let me=0;xe.keywordPatternRe.lastIndex=0;let he=xe.keywordPatternRe.exec(Me),Ee="";for(;he;){Ee+=Me.substring(me,he.index);const Pe=K(xe,he);if(Pe){const[Je,vr]=Pe;if(Le.addText(Ee),Ee="",ur+=vr,Je.startsWith("_"))Ee+=he[0];else{const Er=$e.classNameAliases[Je]||Je;Le.addKeyword(he[0],Er)}}else Ee+=he[0];me=xe.keywordPatternRe.lastIndex,he=xe.keywordPatternRe.exec(Me)}Ee+=Me.substr(me),Le.addText(Ee)}function X(){if(Me==="")return;let me=null;if(typeof xe.subLanguage=="string"){if(!t[xe.subLanguage]){Le.addText(Me);return}me=h(xe.subLanguage,Me,!0,rt[xe.subLanguage]),rt[xe.subLanguage]=me.top}else me=m(Me,xe.subLanguage.length?xe.subLanguage:null);xe.relevance>0&&(ur+=me.relevance),Le.addSublanguage(me.emitter,me.language)}function ee(){xe.subLanguage!=null?X():Q(),Me=""}function U(me){return me.className&&Le.openNode($e.classNameAliases[me.className]||me.className),xe=Object.create(me,{parent:{value:xe}}),xe}function G(me,he,Ee){let Pe=pge(me.endRe,Ee);if(Pe){if(me["on:end"]){const Je=new GD(me);me["on:end"](he,Je),Je.isMatchIgnored&&(Pe=!1)}if(Pe){for(;me.endsParent&&me.parent;)me=me.parent;return me}}if(me.endsWithParent)return G(me.parent,he,Ee)}function ae(me){return xe.matcher.regexIndex===0?(Me+=me[0],1):(jt=!0,0)}function ce(me){const he=me[0],Ee=me.rule,Pe=new GD(Ee),Je=[Ee.__beforeBegin,Ee["on:begin"]];for(const vr of Je)if(vr&&(vr(me,Pe),Pe.isMatchIgnored))return ae(he);return Ee&&Ee.endSameAsBegin&&(Ee.endRe=uge(he)),Ee.skip?Me+=he:(Ee.excludeBegin&&(Me+=he),ee(),!Ee.returnBegin&&!Ee.excludeBegin&&(Me=he)),U(Ee),Ee.returnBegin?0:he.length}function de(me){const he=me[0],Ee=B.substr(me.index),Pe=G(xe,me,Ee);if(!Pe)return JD;const Je=xe;Je.skip?Me+=he:(Je.returnEnd||Je.excludeEnd||(Me+=he),ee(),Je.excludeEnd&&(Me=he));do xe.className&&Le.closeNode(),!xe.skip&&!xe.subLanguage&&(ur+=xe.relevance),xe=xe.parent;while(xe!==Pe.parent);return Pe.starts&&(Pe.endSameAsBegin&&(Pe.starts.endRe=Pe.endRe),U(Pe.starts)),Je.returnEnd?0:he.length}function je(){const me=[];for(let he=xe;he!==$e;he=he.parent)he.className&&me.unshift(he.className);me.forEach(he=>Le.openNode(he))}let le={};function se(me,he){const Ee=he&&he[0];if(Me+=me,Ee==null)return ee(),0;if(le.type==="begin"&&he.type==="end"&&le.index===he.index&&Ee===""){if(Me+=B.slice(he.index,he.index+1),!a){const Pe=new Error("0 width match regex");throw Pe.languageName=L,Pe.badRule=le.rule,Pe}return 1}if(le=he,he.type==="begin")return ce(he);if(he.type==="illegal"&&!Y){const Pe=new Error('Illegal lexeme "'+Ee+'" for mode "'+(xe.className||"<unnamed>")+'"');throw Pe.mode=xe,Pe}else if(he.type==="end"){const Pe=de(he);if(Pe!==JD)return Pe}if(he.type==="illegal"&&Ee==="")return 1;if(pt>1e5&&pt>he.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Me+=Ee,Ee.length}const $e=R(L);if(!$e)throw kk(s.replace("{}",L)),new Error('Unknown language: "'+L+'"');const Pt=qge($e,{plugins:n});let st="",xe=W||Pt;const rt={},Le=new c.__emitter(c);je();let Me="",ur=0,Vt=0,pt=0,jt=!1;try{for(xe.matcher.considerAll();;){pt++,jt?jt=!1:xe.matcher.considerAll(),xe.matcher.lastIndex=Vt;const me=xe.matcher.exec(B);if(!me)break;const he=B.substring(Vt,me.index),Ee=se(he,me);Vt=me.index+Ee}return se(B.substr(Vt)),Le.closeAllNodes(),Le.finalize(),st=Le.toHTML(),{relevance:Math.floor(ur),value:st,language:L,illegal:!1,emitter:Le,top:xe}}catch(me){if(me.message&&me.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:me.message,context:B.slice(Vt-100,Vt+100),mode:me.mode},sofar:st,relevance:0,value:Nk(B),emitter:Le};if(a)return{illegal:!1,relevance:0,value:Nk(B),emitter:Le,language:L,top:xe,errorRaised:me};throw me}}function p(L){const B={relevance:0,emitter:new c.__emitter(c),value:Nk(L),illegal:!1,top:l};return B.emitter.addText(L),B}function m(L,B){B=B||c.languages||Object.keys(t);const Y=p(L),W=B.filter(R).filter(z).map(U=>h(U,L,!1));W.unshift(Y);const K=W.sort((U,G)=>{if(U.relevance!==G.relevance)return G.relevance-U.relevance;if(U.language&&G.language){if(R(U.language).supersetOf===G.language)return 1;if(R(G.language).supersetOf===U.language)return-1}return 0}),[Q,X]=K,ee=Q;return ee.second_best=X,ee}function g(L){return c.tabReplace||c.useBR?L.replace(i,B=>B===`
664
+ `?c.useBR?"<br>":B:c.tabReplace?B.replace(/\t/g,c.tabReplace):B):L}function y(L,B,Y){const W=B?r[B]:Y;L.classList.add("hljs"),W&&L.classList.add(W)}const x={"before:highlightElement":({el:L})=>{c.useBR&&(L.innerHTML=L.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,`
665
+ `))},"after:highlightElement":({result:L})=>{c.useBR&&(L.value=L.value.replace(/\n/g,"<br>"))}},v=/^(<[^>]+>|\t)+/gm,b={"after:highlightElement":({result:L})=>{c.tabReplace&&(L.value=L.value.replace(v,B=>B.replace(/\t/g,c.tabReplace)))}};function j(L){let B=null;const Y=d(L);if(u(Y))return;F("before:highlightElement",{el:L,language:Y}),B=L;const W=B.textContent,K=Y?f(W,{language:Y,ignoreIllegals:!0}):m(W);F("after:highlightElement",{el:L,result:K,text:W}),L.innerHTML=K.value,y(L,Y,K.language),L.result={language:K.language,re:K.relevance,relavance:K.relevance},K.second_best&&(L.second_best={language:K.second_best.language,re:K.second_best.relevance,relavance:K.second_best.relevance})}function w(L){L.useBR&&($n("10.3.0","'useBR' will be removed entirely in v11.0"),$n("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),c=QD(c,L)}const k=()=>{if(k.called)return;k.called=!0,$n("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead."),document.querySelectorAll("pre code").forEach(j)};function N(){$n("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),_=!0}let _=!1;function P(){if(document.readyState==="loading"){_=!0;return}document.querySelectorAll("pre code").forEach(j)}function C(){_&&P()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",C,!1);function A(L,B){let Y=null;try{Y=B(e)}catch(W){if(kk("Language definition for '{}' could not be registered.".replace("{}",L)),a)kk(W);else throw W;Y=l}Y.name||(Y.name=L),t[L]=Y,Y.rawDefinition=B.bind(null,e),Y.aliases&&D(Y.aliases,{languageName:L})}function O(L){delete t[L];for(const B of Object.keys(r))r[B]===L&&delete r[B]}function T(){return Object.keys(t)}function E(L){$n("10.4.0","requireLanguage will be removed entirely in v11."),$n("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const B=R(L);if(B)return B;throw new Error("The '{}' language is required, but not loaded.".replace("{}",L))}function R(L){return L=(L||"").toLowerCase(),t[L]||t[r[L]]}function D(L,{languageName:B}){typeof L=="string"&&(L=[L]),L.forEach(Y=>{r[Y.toLowerCase()]=B})}function z(L){const B=R(L);return B&&!B.disableAutodetect}function I(L){L["before:highlightBlock"]&&!L["before:highlightElement"]&&(L["before:highlightElement"]=B=>{L["before:highlightBlock"](Object.assign({block:B.el},B))}),L["after:highlightBlock"]&&!L["after:highlightElement"]&&(L["after:highlightElement"]=B=>{L["after:highlightBlock"](Object.assign({block:B.el},B))})}function $(L){I(L),n.push(L)}function F(L,B){const Y=L;n.forEach(function(W){W[Y]&&W[Y](B)})}function q(L){return $n("10.2.0","fixMarkup will be removed entirely in v11.0"),$n("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),g(L)}function V(L){return $n("10.7.0","highlightBlock will be removed entirely in v12.0"),$n("10.7.0","Please use highlightElement now."),j(L)}Object.assign(e,{highlight:f,highlightAuto:m,highlightAll:P,fixMarkup:q,highlightElement:j,highlightBlock:V,configure:w,initHighlighting:k,initHighlightingOnLoad:N,registerLanguage:A,unregisterLanguage:O,listLanguages:T,getLanguage:R,registerAliases:D,requireLanguage:E,autoDetection:z,inherit:QD,addPlugin:$,vuePlugin:Gge(e).VuePlugin}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString=Hge;for(const L in Up)typeof Up[L]=="object"&&mq(Up[L]);return Object.assign(e,Up),e.addPlugin(x),e.addPlugin(Kge),e.addPlugin(b),e};var Zge=Xge({}),Qge=Zge,jq={exports:{}};(function(e){(function(){var t;t=e.exports=a,t.format=a,t.vsprintf=n,typeof console<"u"&&typeof console.log=="function"&&(t.printf=r);function r(){console.log(a.apply(null,arguments))}function n(i,s){return a.apply(null,[i].concat(s))}function a(i){for(var s=1,l=[].slice.call(arguments),c=0,u=i.length,d="",f,h=!1,p,m,g=!1,y,x=function(){return l[s++]},v=function(){for(var b="";/\d/.test(i[c]);)b+=i[c++],f=i[c];return b.length>0?parseInt(b):null};c<u;++c)if(f=i[c],h)switch(h=!1,f=="."?(g=!1,f=i[++c]):f=="0"&&i[c+1]=="."?(g=!0,c+=2,f=i[c]):g=!0,y=v(),f){case"b":d+=parseInt(x(),10).toString(2);break;case"c":p=x(),typeof p=="string"||p instanceof String?d+=p:d+=String.fromCharCode(parseInt(p,10));break;case"d":d+=parseInt(x(),10);break;case"f":m=String(parseFloat(x()).toFixed(y||6)),d+=g?m:m.replace(/^0/,"");break;case"j":d+=JSON.stringify(x());break;case"o":d+="0"+parseInt(x(),10).toString(8);break;case"s":d+=x();break;case"x":d+="0x"+parseInt(x(),10).toString(16);break;case"X":d+="0x"+parseInt(x(),10).toString(16).toUpperCase();break;default:d+=f;break}else f==="%"?h=!0:d+=f;return d}})()})(jq);var Jge=jq.exports,exe=Jge,ro=no(Error),txe=ro;ro.eval=no(EvalError);ro.range=no(RangeError);ro.reference=no(ReferenceError);ro.syntax=no(SyntaxError);ro.type=no(TypeError);ro.uri=no(URIError);ro.create=no;function no(e){return t.displayName=e.displayName||e.name,t;function t(r){return r&&(r=exe.apply(null,arguments)),new e(r)}}var za=Qge,Im=txe;bl.highlight=kq;bl.highlightAuto=nxe;bl.registerLanguage=axe;bl.listLanguages=ixe;bl.registerAlias=sxe;Gi.prototype.addText=cxe;Gi.prototype.addKeyword=oxe;Gi.prototype.addSublanguage=lxe;Gi.prototype.openNode=uxe;Gi.prototype.closeNode=dxe;Gi.prototype.closeAllNodes=Nq;Gi.prototype.finalize=Nq;Gi.prototype.toHTML=fxe;var rxe="hljs-";function kq(e,t,r){var n=za.configure({}),a=r||{},i=a.prefix,s;if(typeof e!="string")throw Im("Expected `string` for name, got `%s`",e);if(!za.getLanguage(e))throw Im("Unknown language: `%s` is not registered",e);if(typeof t!="string")throw Im("Expected `string` for value, got `%s`",t);if(i==null&&(i=rxe),za.configure({__emitter:Gi,classPrefix:i}),s=za.highlight(t,{language:e,ignoreIllegals:!0}),za.configure(n||{}),s.errorRaised)throw s.errorRaised;return{relevance:s.relevance,language:s.language,value:s.emitter.rootNode.children}}function nxe(e,t){var r=t||{},n=r.subset||za.listLanguages();r.prefix;var a=n.length,i=-1,s,l,c,u;if(typeof e!="string")throw Im("Expected `string` for value, got `%s`",e);for(l={relevance:0,language:null,value:[]},s={relevance:0,language:null,value:[]};++i<a;)u=n[i],za.getLanguage(u)&&(c=kq(u,e,t),c.language=u,c.relevance>l.relevance&&(l=c),c.relevance>s.relevance&&(l=s,s=c));return l.language&&(s.secondBest=l),s}function axe(e,t){za.registerLanguage(e,t)}function ixe(){return za.listLanguages()}function sxe(e,t){var r=e,n;t&&(r={},r[e]=t);for(n in r)za.registerAliases(r[n],{languageName:n})}function Gi(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function oxe(e,t){this.openNode(t),this.addText(e),this.closeNode()}function lxe(e,t){var r=this.stack,n=r[r.length-1],a=e.rootNode.children,i=t?{type:"element",tagName:"span",properties:{className:[t]},children:a}:a;n.children=n.children.concat(i)}function cxe(e){var t=this.stack,r,n;e!==""&&(r=t[t.length-1],n=r.children[r.children.length-1],n&&n.type==="text"?n.value+=e:r.children.push({type:"text",value:e}))}function uxe(e){var t=this.stack,r=this.options.classPrefix+e,n=t[t.length-1],a={type:"element",tagName:"span",properties:{className:[r]},children:[]};n.children.push(a),t.push(a)}function dxe(){this.stack.pop()}function fxe(){return""}function Nq(){}function hxe(e){const t={literal:"true false null"},r=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],n=[e.QUOTE_STRING_MODE,e.C_NUMBER_MODE],a={end:",",endsWithParent:!0,excludeEnd:!0,contains:n,keywords:t},i={begin:/\{/,end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE],illegal:"\\n"},e.inherit(a,{begin:/:/})].concat(r),illegal:"\\S"},s={begin:"\\[",end:"\\]",contains:[e.inherit(a)],illegal:"\\S"};return n.push(i,s),r.forEach(function(l){n.push(l)}),{name:"JSON",contains:n,keywords:t,illegal:"\\S"}}var pxe=hxe;const mxe=lt(pxe);function gxe(e){return e?typeof e=="string"?e:e.source:null}function xxe(e){return yxe("(?=",e,")")}function yxe(...e){return e.map(r=>gxe(r)).join("")}function vxe(e){const i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],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"]},s={className:"meta",begin:/^(>>>|\.\.\.) /},l={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},c={begin:/\{\{/,relevance:0},u={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,s,c,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,s,c,l]},{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,c,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,c,l]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",f=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${f}))[eE][+-]?(${d})[jJ]?\\b`},{begin:`(${f})[jJ]?`},{begin:"\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"},{begin:"\\b0[bB](_?[01])+[lL]?\\b"},{begin:"\\b0[oO](_?[0-7])+[lL]?\\b"},{begin:"\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"},{begin:`\\b(${d})[jJ]\\b`}]},p={className:"comment",begin:xxe(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",s,h,u,e.HASH_COMMENT_MODE]}]};return l.contains=[u,h,s],{name:"Python",aliases:["py","gyp","ipython"],keywords:i,illegal:/(<\/|->|\?)|=>/,contains:[s,h,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},u,p,e.HASH_COMMENT_MODE,{variants:[{className:"function",beginKeywords:"def"},{className:"class",beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/,contains:[e.UNDERSCORE_TITLE_MODE,m,{begin:/->/,endsWithParent:!0,keywords:i}]},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,m,u]}]}}var bxe=vxe;const wxe=lt(bxe);var Xf=ige(bl,{});Xf.registerLanguage=bl.registerLanguage;const e$={hljs:{display:"block",overflowX:"auto",padding:"0.5em",color:"#000",background:"#f8f8ff"},"hljs-comment":{color:"#408080",fontStyle:"italic"},"hljs-quote":{color:"#408080",fontStyle:"italic"},"hljs-keyword":{color:"#954121"},"hljs-selector-tag":{color:"#954121"},"hljs-literal":{color:"#954121"},"hljs-subst":{color:"#954121"},"hljs-number":{color:"#40a070"},"hljs-string":{color:"#219161"},"hljs-doctag":{color:"#219161"},"hljs-selector-id":{color:"#19469d"},"hljs-selector-class":{color:"#19469d"},"hljs-section":{color:"#19469d"},"hljs-type":{color:"#19469d"},"hljs-params":{color:"#00f"},"hljs-title":{color:"#458",fontWeight:"bold"},"hljs-tag":{color:"#000080",fontWeight:"normal"},"hljs-name":{color:"#000080",fontWeight:"normal"},"hljs-attribute":{color:"#000080",fontWeight:"normal"},"hljs-variable":{color:"#008080"},"hljs-template-variable":{color:"#008080"},"hljs-regexp":{color:"#b68"},"hljs-link":{color:"#b68"},"hljs-symbol":{color:"#990073"},"hljs-bullet":{color:"#990073"},"hljs-built_in":{color:"#0086b3"},"hljs-builtin-name":{color:"#0086b3"},"hljs-meta":{color:"#999",fontWeight:"bold"},"hljs-deletion":{background:"#fdd"},"hljs-addition":{background:"#dfd"},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}};var jxe=cV();const Jn=lt(jxe);function kxe(e){return e==null}var Nxe=kxe;const Ge=lt(Nxe);var Sxe=yV();const ol=lt(Sxe);var _xe=Ou();const Be=lt(_xe);var Exe=tn();const Iu=lt(Exe);var Sq={exports:{}},yt={};/**
666
+ * @license React
667
+ * react-is.production.min.js
668
+ *
669
+ * Copyright (c) Facebook, Inc. and its affiliates.
670
+ *
671
+ * This source code is licensed under the MIT license found in the
672
+ * LICENSE file in the root directory of this source tree.
673
+ */var ZP=Symbol.for("react.element"),QP=Symbol.for("react.portal"),$x=Symbol.for("react.fragment"),Ix=Symbol.for("react.strict_mode"),Lx=Symbol.for("react.profiler"),zx=Symbol.for("react.provider"),Fx=Symbol.for("react.context"),Pxe=Symbol.for("react.server_context"),Bx=Symbol.for("react.forward_ref"),Vx=Symbol.for("react.suspense"),qx=Symbol.for("react.suspense_list"),Ux=Symbol.for("react.memo"),Hx=Symbol.for("react.lazy"),Cxe=Symbol.for("react.offscreen"),_q;_q=Symbol.for("react.module.reference");function la(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ZP:switch(e=e.type,e){case $x:case Lx:case Ix:case Vx:case qx:return e;default:switch(e=e&&e.$$typeof,e){case Pxe:case Fx:case Bx:case Hx:case Ux:case zx:return e;default:return t}}case QP:return t}}}yt.ContextConsumer=Fx;yt.ContextProvider=zx;yt.Element=ZP;yt.ForwardRef=Bx;yt.Fragment=$x;yt.Lazy=Hx;yt.Memo=Ux;yt.Portal=QP;yt.Profiler=Lx;yt.StrictMode=Ix;yt.Suspense=Vx;yt.SuspenseList=qx;yt.isAsyncMode=function(){return!1};yt.isConcurrentMode=function(){return!1};yt.isContextConsumer=function(e){return la(e)===Fx};yt.isContextProvider=function(e){return la(e)===zx};yt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ZP};yt.isForwardRef=function(e){return la(e)===Bx};yt.isFragment=function(e){return la(e)===$x};yt.isLazy=function(e){return la(e)===Hx};yt.isMemo=function(e){return la(e)===Ux};yt.isPortal=function(e){return la(e)===QP};yt.isProfiler=function(e){return la(e)===Lx};yt.isStrictMode=function(e){return la(e)===Ix};yt.isSuspense=function(e){return la(e)===Vx};yt.isSuspenseList=function(e){return la(e)===qx};yt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===$x||e===Lx||e===Ix||e===Vx||e===qx||e===Cxe||typeof e=="object"&&e!==null&&(e.$$typeof===Hx||e.$$typeof===Ux||e.$$typeof===zx||e.$$typeof===Fx||e.$$typeof===Bx||e.$$typeof===_q||e.getModuleId!==void 0)};yt.typeOf=la;Sq.exports=yt;var Axe=Sq.exports,Oxe=Hi(),Txe=ia(),Mxe="[object Number]";function Rxe(e){return typeof e=="number"||Txe(e)&&Oxe(e)==Mxe}var Eq=Rxe;const Dxe=lt(Eq);var $xe=Eq;function Ixe(e){return $xe(e)&&e!=+e}var Lxe=Ixe;const Lu=lt(Lxe);var ka=function(t){return t===0?0:t>0?1:-1},Ro=function(t){return ol(t)&&t.indexOf("%")===t.length-1},ue=function(t){return Dxe(t)&&!Lu(t)},zxe=function(t){return Ge(t)},gr=function(t){return ue(t)||ol(t)},Fxe=0,zu=function(t){var r=++Fxe;return"".concat(t||"").concat(r)},ll=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ue(t)&&!ol(t))return n;var i;if(Ro(t)){var s=t.indexOf("%");i=r*parseFloat(t.slice(0,s))/100}else i=+t;return Lu(i)&&(i=n),a&&i>r&&(i=r),i},vs=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},Bxe=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a<r;a++)if(!n[t[a]])n[t[a]]=!0;else return!0;return!1},Or=function(t,r){return ue(t)&&ue(r)?function(n){return t+n*(r-t)}:function(){return r}};function L0(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Jn(n,t))===r})}var Vxe=function(t,r){return ue(t)&&ue(r)?t-r:ol(t)&&ol(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function Ec(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function YN(e){"@babel/helpers - typeof";return YN=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},YN(e)}var qxe=["viewBox","children"],Uxe=["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"],t$=["points","pathLength"],Sk={svg:qxe,polygon:t$,polyline:t$},JP=["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"],z0=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(S.isValidElement(t)&&(n=t.props),!Iu(n))return null;var a={};return Object.keys(n).forEach(function(i){JP.includes(i)&&(a[i]=r||function(s){return n[i](n,s)})}),a},Hxe=function(t,r,n){return function(a){return t(r,n,a),null}},F0=function(t,r,n){if(!Iu(t)||YN(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var s=t[i];JP.includes(i)&&typeof s=="function"&&(a||(a={}),a[i]=Hxe(s,r,n))}),a},Wxe=["children"],Gxe=["children"];function r$(e,t){if(e==null)return{};var r=Kxe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Kxe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function XN(e){"@babel/helpers - typeof";return XN=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},XN(e)}var n$={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"},wi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},a$=null,_k=null,eC=function e(t){if(t===a$&&Array.isArray(_k))return _k;var r=[];return S.Children.forEach(t,function(n){Ge(n)||(Axe.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),_k=r,a$=t,r};function ea(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return wi(a)}):n=[wi(t)],eC(e).forEach(function(a){var i=Jn(a,"type.displayName")||Jn(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function yn(e,t){var r=ea(e,t);return r&&r[0]}var i$=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!ue(n)||n<=0||!ue(a)||a<=0)},Yxe=["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"],Xxe=function(t){return t&&t.type&&ol(t.type)&&Yxe.indexOf(t.type)>=0},Pq=function(t){return t&&XN(t)==="object"&&"clipDot"in t},Zxe=function(t,r,n,a){var i,s=(i=Sk==null?void 0:Sk[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!Be(t)&&(a&&s.includes(r)||Uxe.includes(r))||n&&JP.includes(r)},Ue=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(S.isValidElement(t)&&(a=t.props),!Iu(a))return null;var i={};return Object.keys(a).forEach(function(s){var l;Zxe((l=a)===null||l===void 0?void 0:l[s],s,r,n)&&(i[s]=a[s])}),i},ZN=function e(t,r){if(t===r)return!0;var n=S.Children.count(t);if(n!==S.Children.count(r))return!1;if(n===0)return!0;if(n===1)return s$(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a<n;a++){var i=t[a],s=r[a];if(Array.isArray(i)||Array.isArray(s)){if(!e(i,s))return!1}else if(!s$(i,s))return!1}return!0},s$=function(t,r){if(Ge(t)&&Ge(r))return!0;if(!Ge(t)&&!Ge(r)){var n=t.props||{},a=n.children,i=r$(n,Wxe),s=r.props||{},l=s.children,c=r$(s,Gxe);return a&&l?Ec(i,c)&&ZN(a,l):!a&&!l?Ec(i,c):!1}return!1},o$=function(t,r){var n=[],a={};return eC(t).forEach(function(i,s){if(Xxe(i))n.push(i);else if(i){var l=wi(i.type),c=r[l]||{},u=c.handler,d=c.once;if(u&&(!d||!a[l])){var f=u(i,l,s);n.push(f),a[l]=!0}}}),n},Qxe=function(t){var r=t&&t.type;return r&&n$[r]?n$[r]:null},Jxe=function(t,r){return eC(r).indexOf(t)},eye=["children","width","height","viewBox","className","style","title","desc"];function QN(){return QN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QN.apply(this,arguments)}function tye(e,t){if(e==null)return{};var r=rye(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rye(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function JN(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,s=e.style,l=e.title,c=e.desc,u=tye(e,eye),d=a||{width:r,height:n,x:0,y:0},f=tt("recharts-surface",i);return M.createElement("svg",QN({},Ue(u,!0,"svg"),{className:f,width:r,height:n,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),M.createElement("title",null,l),M.createElement("desc",null,c),t)}var nye=["children","className"];function eS(){return eS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eS.apply(this,arguments)}function aye(e,t){if(e==null)return{};var r=iye(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function iye(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var _t=M.forwardRef(function(e,t){var r=e.children,n=e.className,a=aye(e,nye),i=tt("recharts-layer",n);return M.createElement("g",eS({className:i},Ue(a,!0),{ref:t}),r)}),ji=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i]};function sye(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n<a;)i[n]=e[n+t];return i}var oye=sye,lye=oye;function cye(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:lye(e,t,r)}var uye=cye;function dye(e){return e.split("")}var fye=dye,Cq="\\ud800-\\udfff",hye="\\u0300-\\u036f",pye="\\ufe20-\\ufe2f",mye="\\u20d0-\\u20ff",gye=hye+pye+mye,xye="\\ufe0e\\ufe0f",yye="["+Cq+"]",tS="["+gye+"]",rS="\\ud83c[\\udffb-\\udfff]",vye="(?:"+tS+"|"+rS+")",Aq="[^"+Cq+"]",Oq="(?:\\ud83c[\\udde6-\\uddff]){2}",Tq="[\\ud800-\\udbff][\\udc00-\\udfff]",bye="\\u200d",Mq=vye+"?",Rq="["+xye+"]?",wye="(?:"+bye+"(?:"+[Aq,Oq,Tq].join("|")+")"+Rq+Mq+")*",jye=Rq+Mq+wye,kye="(?:"+[Aq+tS+"?",tS,Oq,Tq,yye].join("|")+")",Nye=RegExp(rS+"(?="+rS+")|"+kye+jye,"g");function Sye(e){return e.match(Nye)||[]}var _ye=Sye,Eye=fye,Pye=VP(),Cye=_ye;function Aye(e){return Pye(e)?Cye(e):Eye(e)}var Oye=Aye,Tye=uye,Mye=VP(),Rye=Oye,Dye=FP();function $ye(e){return function(t){t=Dye(t);var r=Mye(t)?Rye(t):void 0,n=r?r[0]:t.charAt(0),a=r?Tye(r,1).join(""):t.slice(1);return n[e]()+a}}var Iye=$ye,Lye=Iye,zye=Lye("toUpperCase"),Fye=zye;const Wx=lt(Fye);function Nt(e){return function(){return e}}const Dq=Math.cos,B0=Math.sin,Da=Math.sqrt,V0=Math.PI,Gx=2*V0,nS=Math.PI,aS=2*nS,bo=1e-6,Bye=aS-bo;function $q(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Vye(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return $q;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;a<i;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}class qye{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?$q:Vye(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,i,s){this._append`C${+t},${+r},${+n},${+a},${this._x1=+i},${this._y1=+s}`}arcTo(t,r,n,a,i){if(t=+t,r=+r,n=+n,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,l=this._y1,c=n-t,u=a-r,d=s-t,f=l-r,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>bo)if(!(Math.abs(f*c-u*d)>bo)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-s,m=a-l,g=c*c+u*u,y=p*p+m*m,x=Math.sqrt(g),v=Math.sqrt(h),b=i*Math.tan((nS-Math.acos((g+h-y)/(2*x*v)))/2),j=b/v,w=b/x;Math.abs(j-1)>bo&&this._append`L${t+j*d},${r+j*f}`,this._append`A${i},${i},0,0,${+(f*p>d*m)},${this._x1=t+w*c},${this._y1=r+w*u}`}}arc(t,r,n,a,i,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(a),c=n*Math.sin(a),u=t+l,d=r+c,f=1^s,h=s?a-i:i-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>bo||Math.abs(this._y1-d)>bo)&&this._append`L${u},${d}`,n&&(h<0&&(h=h%aS+aS),h>Bye?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=u},${this._y1=d}`:h>bo&&this._append`A${n},${n},0,${+(h>=nS)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function tC(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new qye(t)}function rC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Iq(e){this._context=e}Iq.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 Kx(e){return new Iq(e)}function Lq(e){return e[0]}function zq(e){return e[1]}function Fq(e,t){var r=Nt(!0),n=null,a=Kx,i=null,s=tC(l);e=typeof e=="function"?e:e===void 0?Lq:Nt(e),t=typeof t=="function"?t:t===void 0?zq:Nt(t);function l(c){var u,d=(c=rC(c)).length,f,h=!1,p;for(n==null&&(i=a(p=s())),u=0;u<=d;++u)!(u<d&&r(f=c[u],u,c))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(f,u,c),+t(f,u,c));if(p)return i=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Nt(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Nt(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:Nt(!!c),l):r},l.curve=function(c){return arguments.length?(a=c,n!=null&&(i=a(n)),l):a},l.context=function(c){return arguments.length?(c==null?n=i=null:i=a(n=c),l):n},l}function Hp(e,t,r){var n=null,a=Nt(!0),i=null,s=Kx,l=null,c=tC(u);e=typeof e=="function"?e:e===void 0?Lq:Nt(+e),t=typeof t=="function"?t:Nt(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?zq:Nt(+r);function u(f){var h,p,m,g=(f=rC(f)).length,y,x=!1,v,b=new Array(g),j=new Array(g);for(i==null&&(l=s(v=c())),h=0;h<=g;++h){if(!(h<g&&a(y=f[h],h,f))===x)if(x=!x)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),m=h-1;m>=p;--m)l.point(b[m],j[m]);l.lineEnd(),l.areaEnd()}x&&(b[h]=+e(y,h,f),j[h]=+t(y,h,f),l.point(n?+n(y,h,f):b[h],r?+r(y,h,f):j[h]))}if(v)return l=null,v+""||null}function d(){return Fq().defined(a).curve(s).context(i)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Nt(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Nt(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Nt(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Nt(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Nt(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Nt(+f),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(n).y(t)},u.defined=function(f){return arguments.length?(a=typeof f=="function"?f:Nt(!!f),u):a},u.curve=function(f){return arguments.length?(s=f,i!=null&&(l=s(i)),u):s},u.context=function(f){return arguments.length?(f==null?i=l=null:l=s(i=f),u):i},u}class Bq{constructor(t,r){this._context=t,this._x=r}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,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Uye(e){return new Bq(e,!0)}function Hye(e){return new Bq(e,!1)}const nC={draw(e,t){const r=Da(t/V0);e.moveTo(r,0),e.arc(0,0,r,0,Gx)}},Wye={draw(e,t){const r=Da(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},Vq=Da(1/3),Gye=Vq*2,Kye={draw(e,t){const r=Da(t/Gye),n=r*Vq;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Yye={draw(e,t){const r=Da(t),n=-r/2;e.rect(n,n,r,r)}},Xye=.8908130915292852,qq=B0(V0/10)/B0(7*V0/10),Zye=B0(Gx/10)*qq,Qye=-Dq(Gx/10)*qq,Jye={draw(e,t){const r=Da(t*Xye),n=Zye*r,a=Qye*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const s=Gx*i/5,l=Dq(s),c=B0(s);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*a,c*n+l*a)}e.closePath()}},Ek=Da(3),eve={draw(e,t){const r=-Da(t/(Ek*3));e.moveTo(0,r*2),e.lineTo(-Ek*r,-r),e.lineTo(Ek*r,-r),e.closePath()}},In=-.5,Ln=Da(3)/2,iS=1/Da(12),tve=(iS/2+1)*3,rve={draw(e,t){const r=Da(t/tve),n=r/2,a=r*iS,i=n,s=r*iS+r,l=-i,c=s;e.moveTo(n,a),e.lineTo(i,s),e.lineTo(l,c),e.lineTo(In*n-Ln*a,Ln*n+In*a),e.lineTo(In*i-Ln*s,Ln*i+In*s),e.lineTo(In*l-Ln*c,Ln*l+In*c),e.lineTo(In*n+Ln*a,In*a-Ln*n),e.lineTo(In*i+Ln*s,In*s-Ln*i),e.lineTo(In*l+Ln*c,In*c-Ln*l),e.closePath()}};function nve(e,t){let r=null,n=tC(a);e=typeof e=="function"?e:Nt(e||nC),t=typeof t=="function"?t:Nt(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:Nt(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:Nt(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function q0(){}function U0(e,t,r){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+r)/6)}function Uq(e){this._context=e}Uq.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:U0(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:U0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ave(e){return new Uq(e)}function Hq(e){this._context=e}Hq.prototype={areaStart:q0,areaEnd:q0,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:U0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ive(e){return new Hq(e)}function Wq(e){this._context=e}Wq.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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:U0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function sve(e){return new Wq(e)}function Gq(e){this._context=e}Gq.prototype={areaStart:q0,areaEnd:q0,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 ove(e){return new Gq(e)}function l$(e){return e<0?-1:1}function c$(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),s=(r-e._y1)/(a||n<0&&-0),l=(i*a+s*n)/(n+a);return(l$(i)+l$(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(l))||0}function u$(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Pk(e,t,r){var n=e._x0,a=e._y0,i=e._x1,s=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,a+l*t,i-l,s-l*r,i,s)}function H0(e){this._context=e}H0.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:Pk(this,this._t0,u$(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 r=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,Pk(this,u$(this,r=c$(this,e,t)),r);break;default:Pk(this,this._t0,r=c$(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Kq(e){this._context=new Yq(e)}(Kq.prototype=Object.create(H0.prototype)).point=function(e,t){H0.prototype.point.call(this,t,e)};function Yq(e){this._context=e}Yq.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,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function lve(e){return new H0(e)}function cve(e){return new Kq(e)}function Xq(e){this._context=e}Xq.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=d$(e),a=d$(t),i=0,s=1;s<r;++i,++s)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],e[s],t[s]);(this._line||this._line!==0&&r===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 d$(e){var t,r=e.length-1,n,a=new Array(r),i=new Array(r),s=new Array(r);for(a[0]=0,i[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)a[t]=1,i[t]=4,s[t]=4*e[t]+2*e[t+1];for(a[r-1]=2,i[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=a[t]/i[t-1],i[t]-=n,s[t]-=n*s[t-1];for(a[r-1]=s[r-1]/i[r-1],t=r-2;t>=0;--t)a[t]=(s[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function uve(e){return new Xq(e)}function Yx(e,t){this._context=e,this._t=t}Yx.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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function dve(e){return new Yx(e,.5)}function fve(e){return new Yx(e,0)}function hve(e){return new Yx(e,1)}function Xc(e,t){if((s=e.length)>1)for(var r=1,n,a,i=e[t[0]],s,l=i.length;r<s;++r)for(a=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(a[n][1])?a[n][0]:a[n][1]}function sS(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function pve(e,t){return e[t]}function mve(e){const t=[];return t.key=e,t}function gve(){var e=Nt([]),t=sS,r=Xc,n=pve;function a(i){var s=Array.from(e.apply(this,arguments),mve),l,c=s.length,u=-1,d;for(const f of i)for(l=0,++u;l<c;++l)(s[l][u]=[0,+n(f,s[l].key,u,i)]).data=f;for(l=0,d=rC(t(s));l<c;++l)s[d[l]].index=l;return r(s,d),s}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:Nt(Array.from(i)),a):e},a.value=function(i){return arguments.length?(n=typeof i=="function"?i:Nt(+i),a):n},a.order=function(i){return arguments.length?(t=i==null?sS:typeof i=="function"?i:Nt(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(r=i??Xc,a):r},a}function xve(e,t){if((n=e.length)>0){for(var r,n,a=0,i=e[0].length,s;a<i;++a){for(s=r=0;r<n;++r)s+=e[r][a][1]||0;if(s)for(r=0;r<n;++r)e[r][a][1]/=s}Xc(e,t)}}function yve(e,t){if((a=e.length)>0){for(var r=0,n=e[t[0]],a,i=n.length;r<i;++r){for(var s=0,l=0;s<a;++s)l+=e[s][r][1]||0;n[r][1]+=n[r][0]=-l/2}Xc(e,t)}}function vve(e,t){if(!(!((s=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,s;n<i;++n){for(var l=0,c=0,u=0;l<s;++l){for(var d=e[t[l]],f=d[n][1]||0,h=d[n-1][1]||0,p=(f-h)/2,m=0;m<l;++m){var g=e[t[m]],y=g[n][1]||0,x=g[n-1][1]||0;p+=y-x}c+=f,u+=p*f}a[n-1][1]+=a[n-1][0]=r,c&&(r-=u/c)}a[n-1][1]+=a[n-1][0]=r,Xc(e,t)}}function Zf(e){"@babel/helpers - typeof";return Zf=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},Zf(e)}var bve=["type","size","sizeType"];function oS(){return oS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oS.apply(this,arguments)}function f$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function h$(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?f$(Object(r),!0).forEach(function(n){wve(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f$(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wve(e,t,r){return t=jve(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jve(e){var t=kve(e,"string");return Zf(t)=="symbol"?t:t+""}function kve(e,t){if(Zf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nve(e,t){if(e==null)return{};var r=Sve(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Sve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Zq={symbolCircle:nC,symbolCross:Wye,symbolDiamond:Kye,symbolSquare:Yye,symbolStar:Jye,symbolTriangle:eve,symbolWye:rve},_ve=Math.PI/180,Eve=function(t){var r="symbol".concat(Wx(t));return Zq[r]||nC},Pve=function(t,r,n){if(r==="area")return t;switch(n){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*_ve;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}},Cve=function(t,r){Zq["symbol".concat(Wx(t))]=r},aC=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,s=t.sizeType,l=s===void 0?"area":s,c=Nve(t,bve),u=h$(h$({},c),{},{type:n,size:i,sizeType:l}),d=function(){var y=Eve(n),x=nve().type(y).size(Pve(i,l,n));return x()},f=u.className,h=u.cx,p=u.cy,m=Ue(u,!0);return h===+h&&p===+p&&i===+i?M.createElement("path",oS({},m,{className:tt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};aC.registerSymbol=Cve;function Zc(e){"@babel/helpers - typeof";return Zc=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},Zc(e)}function lS(){return lS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lS.apply(this,arguments)}function p$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ave(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p$(Object(r),!0).forEach(function(n){Qf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p$(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ove(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jq(n.key),n)}}function Mve(e,t,r){return t&&Tve(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rve(e,t,r){return t=W0(t),Dve(e,Qq()?Reflect.construct(t,r||[],W0(e).constructor):t.apply(e,r))}function Dve(e,t){if(t&&(Zc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $ve(e)}function $ve(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qq=function(){return!!e})()}function W0(e){return W0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},W0(e)}function Ive(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&&cS(e,t)}function cS(e,t){return cS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},cS(e,t)}function Qf(e,t,r){return t=Jq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jq(e){var t=Lve(e,"string");return Zc(t)=="symbol"?t:t+""}function Lve(e,t){if(Zc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var zn=32,iC=function(e){function t(){return Ove(this,t),Rve(this,t,arguments)}return Ive(t,e),Mve(t,[{key:"renderIcon",value:function(n){var a=this.props.inactiveColor,i=zn/2,s=zn/6,l=zn/3,c=n.inactive?a:n.color;if(n.type==="plainline")return M.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:i,x2:zn,y2:i,className:"recharts-legend-icon"});if(n.type==="line")return M.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
674
+ A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(i,`
675
+ H`).concat(zn,"M").concat(2*l,",").concat(i,`
676
+ A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(n.type==="rect")return M.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(zn/8,"h").concat(zn,"v").concat(zn*3/4,"h").concat(-zn,"z"),className:"recharts-legend-icon"});if(M.isValidElement(n.legendIcon)){var u=Ave({},n);return delete u.legendIcon,M.cloneElement(n.legendIcon,u)}return M.createElement(aC,{fill:c,cx:i,cy:i,size:zn,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,a=this.props,i=a.payload,s=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,d={x:0,y:0,width:zn,height:zn},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(p,m){var g=p.formatter||c,y=tt(Qf(Qf({"recharts-legend-item":!0},"legend-item-".concat(m),!0),"inactive",p.inactive));if(p.type==="none")return null;var x=Be(p.value)?null:p.value;ji(!Be(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 v=p.inactive?u:p.color;return M.createElement("li",lS({className:y,style:f,key:"legend-item-".concat(m)},F0(n.props,p,m)),M.createElement(JN,{width:s,height:s,viewBox:d,style:h},n.renderIcon(p)),M.createElement("span",{className:"recharts-legend-item-text",style:{color:v}},g?g(x,p,m):x))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,s=n.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?s:"left"};return M.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(S.PureComponent);Qf(iC,"displayName","Legend");Qf(iC,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var zve=sa(),Fve=jV();function Bve(e,t){return e&&e.length?Fve(e,zve(t,2)):[]}var Vve=Bve;const m$=lt(Vve);function eU(e,t,r){return t===!0?m$(e,r):Be(t)?m$(e,t):e}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 qve=["ref"];function g$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ai(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?g$(Object(r),!0).forEach(function(n){Xx(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g$(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Uve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x$(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,rU(n.key),n)}}function Hve(e,t,r){return t&&x$(e.prototype,t),r&&x$(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wve(e,t,r){return t=G0(t),Gve(e,tU()?Reflect.construct(t,r||[],G0(e).constructor):t.apply(e,r))}function Gve(e,t){if(t&&(Qc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kve(e)}function Kve(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tU=function(){return!!e})()}function G0(e){return G0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},G0(e)}function Yve(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&&uS(e,t)}function uS(e,t){return uS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},uS(e,t)}function Xx(e,t,r){return t=rU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rU(e){var t=Xve(e,"string");return Qc(t)=="symbol"?t:t+""}function Xve(e,t){if(Qc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Zve(e,t){if(e==null)return{};var r=Qve(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Qve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Jve(e){return e.value}function ebe(e,t){if(M.isValidElement(e))return M.cloneElement(e,t);if(typeof e=="function")return M.createElement(e,t);t.ref;var r=Zve(t,qve);return M.createElement(iC,r)}var y$=1,zs=function(e){function t(){var r;Uve(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=Wve(this,t,[].concat(a)),Xx(r,"lastBoundingBox",{width:-1,height:-1}),r}return Yve(t,e),Hve(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>y$||Math.abs(a.height-this.lastBoundingBox.height)>y$)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ai({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,s=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,d=a.chartHeight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&i==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=s==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var m=this.getBBoxSnapshot();h={top:((d||0)-m.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return ai(ai({},f),h)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,s=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,d=a.payload,f=ai(ai({position:"absolute",width:s||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return M.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){n.wrapperNode=p}},ebe(i,ai(ai({},this.props),{},{payload:eU(d,u,Jve)})))}}],[{key:"getWithHeight",value:function(n,a){var i=ai(ai({},this.defaultProps),n.props),s=i.layout;return s==="vertical"&&ue(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||a}:null}}])}(S.PureComponent);Xx(zs,"displayName","Legend");Xx(zs,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var tbe=UV();const sC=lt(tbe);function Jf(e){"@babel/helpers - typeof";return Jf=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},Jf(e)}function dS(){return dS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dS.apply(this,arguments)}function rbe(e,t){return sbe(e)||ibe(e,t)||abe(e,t)||nbe()}function nbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
677
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function abe(e,t){if(e){if(typeof e=="string")return v$(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v$(e,t)}}function v$(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ibe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function sbe(e){if(Array.isArray(e))return e}function b$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ck(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b$(Object(r),!0).forEach(function(n){obe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b$(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function obe(e,t,r){return t=lbe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lbe(e){var t=cbe(e,"string");return Jf(t)=="symbol"?t:t+""}function cbe(e,t){if(Jf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ube(e){return Array.isArray(e)&&gr(e[0])&&gr(e[1])?e.join(" ~ "):e}var dbe=function(t){var r=t.separator,n=r===void 0?" : ":r,a=t.contentStyle,i=a===void 0?{}:a,s=t.itemStyle,l=s===void 0?{}:s,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,h=t.itemSorter,p=t.wrapperClassName,m=t.labelClassName,g=t.label,y=t.labelFormatter,x=t.accessibilityLayer,v=x===void 0?!1:x,b=function(){if(d&&d.length){var O={padding:0,margin:0},T=(h?sC(d,h):d).map(function(E,R){if(E.type==="none")return null;var D=Ck({display:"block",paddingTop:4,paddingBottom:4,color:E.color||"#000"},l),z=E.formatter||f||ube,I=E.value,$=E.name,F=I,q=$;if(z&&F!=null&&q!=null){var V=z(I,$,E,R,d);if(Array.isArray(V)){var L=rbe(V,2);F=L[0],q=L[1]}else F=V}return M.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:D},gr(q)?M.createElement("span",{className:"recharts-tooltip-item-name"},q):null,gr(q)?M.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,M.createElement("span",{className:"recharts-tooltip-item-value"},F),M.createElement("span",{className:"recharts-tooltip-item-unit"},E.unit||""))});return M.createElement("ul",{className:"recharts-tooltip-item-list",style:O},T)}return null},j=Ck({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),w=Ck({margin:0},u),k=!Ge(g),N=k?g:"",_=tt("recharts-default-tooltip",p),P=tt("recharts-tooltip-label",m);k&&y&&d!==void 0&&d!==null&&(N=y(g,d));var C=v?{role:"status","aria-live":"assertive"}:{};return M.createElement("div",dS({className:_,style:j},C),M.createElement("p",{className:P,style:w},M.isValidElement(N)?N:"".concat(N)),b())};function eh(e){"@babel/helpers - typeof";return eh=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},eh(e)}function Wp(e,t,r){return t=fbe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fbe(e){var t=hbe(e,"string");return eh(t)=="symbol"?t:t+""}function hbe(e,t){if(eh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(eh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var dd="recharts-tooltip-wrapper",pbe={visibility:"hidden"};function mbe(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return tt(dd,Wp(Wp(Wp(Wp({},"".concat(dd,"-right"),ue(r)&&t&&ue(t.x)&&r>=t.x),"".concat(dd,"-left"),ue(r)&&t&&ue(t.x)&&r<t.x),"".concat(dd,"-bottom"),ue(n)&&t&&ue(t.y)&&n>=t.y),"".concat(dd,"-top"),ue(n)&&t&&ue(t.y)&&n<t.y))}function w$(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,a=e.offsetTopLeft,i=e.position,s=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(i&&ue(i[n]))return i[n];var d=r[n]-l-a,f=r[n]+a;if(t[n])return s[n]?d:f;if(s[n]){var h=d,p=c[n];return h<p?Math.max(f,c[n]):Math.max(d,c[n])}var m=f+l,g=c[n]+u;return m>g?Math.max(d,c[n]):Math.max(f,c[n])}function gbe(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function xbe(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,s=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return s.height>0&&s.width>0&&r?(d=w$({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:s.width,viewBox:c,viewBoxDimension:c.width}),f=w$({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:s.height,viewBox:c,viewBoxDimension:c.height}),u=gbe({translateX:d,translateY:f,useTranslate3d:l})):u=pbe,{cssProperties:u,cssClasses:mbe({translateX:d,translateY:f,coordinate:r})}}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 j$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function k$(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j$(Object(r),!0).forEach(function(n){hS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j$(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ybe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vbe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,aU(n.key),n)}}function bbe(e,t,r){return t&&vbe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wbe(e,t,r){return t=K0(t),jbe(e,nU()?Reflect.construct(t,r||[],K0(e).constructor):t.apply(e,r))}function jbe(e,t){if(t&&(Jc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kbe(e)}function kbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nU=function(){return!!e})()}function K0(e){return K0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},K0(e)}function Nbe(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&&fS(e,t)}function fS(e,t){return fS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},fS(e,t)}function hS(e,t,r){return t=aU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aU(e){var t=Sbe(e,"string");return Jc(t)=="symbol"?t:t+""}function Sbe(e,t){if(Jc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var N$=1,_be=function(e){function t(){var r;ybe(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=wbe(this,t,[].concat(a)),hS(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),hS(r,"handleKeyDown",function(s){if(s.key==="Escape"){var l,c,u,d;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=r.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),r}return Nbe(t,e),bbe(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>N$||Math.abs(n.height-this.state.lastBoundingBox.height)>N$)&&this.setState({lastBoundingBox:{width:n.width,height:n.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 n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.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 n=this,a=this.props,i=a.active,s=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,d=a.coordinate,f=a.hasPayload,h=a.isAnimationActive,p=a.offset,m=a.position,g=a.reverseDirection,y=a.useTranslate3d,x=a.viewBox,v=a.wrapperStyle,b=xbe({allowEscapeViewBox:s,coordinate:d,offsetTopLeft:p,position:m,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:x}),j=b.cssClasses,w=b.cssProperties,k=k$(k$({transition:h&&i?"transform ".concat(l,"ms ").concat(c):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&f?"visible":"hidden",position:"absolute",top:0,left:0},v);return M.createElement("div",{tabIndex:-1,className:j,style:k,ref:function(_){n.wrapperNode=_}},u)}}])}(S.PureComponent),Ebe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},wl={isSsr:Ebe()};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 S$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function _$(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?S$(Object(r),!0).forEach(function(n){oC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S$(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cbe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,sU(n.key),n)}}function Abe(e,t,r){return t&&Cbe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Obe(e,t,r){return t=Y0(t),Tbe(e,iU()?Reflect.construct(t,r||[],Y0(e).constructor):t.apply(e,r))}function Tbe(e,t){if(t&&(eu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mbe(e)}function Mbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iU=function(){return!!e})()}function Y0(e){return Y0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Y0(e)}function Rbe(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&&pS(e,t)}function pS(e,t){return pS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},pS(e,t)}function oC(e,t,r){return t=sU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sU(e){var t=Dbe(e,"string");return eu(t)=="symbol"?t:t+""}function Dbe(e,t){if(eu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(eu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function $be(e){return e.dataKey}function Ibe(e,t){return M.isValidElement(e)?M.cloneElement(e,t):typeof e=="function"?M.createElement(e,t):M.createElement(dbe,t)}var jn=function(e){function t(){return Pbe(this,t),Obe(this,t,arguments)}return Rbe(t,e),Abe(t,[{key:"render",value:function(){var n=this,a=this.props,i=a.active,s=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,d=a.coordinate,f=a.filterNull,h=a.isAnimationActive,p=a.offset,m=a.payload,g=a.payloadUniqBy,y=a.position,x=a.reverseDirection,v=a.useTranslate3d,b=a.viewBox,j=a.wrapperStyle,w=m??[];f&&w.length&&(w=eU(m.filter(function(N){return N.value!=null&&(N.hide!==!0||n.props.includeHidden)}),g,$be));var k=w.length>0;return M.createElement(_be,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:h,active:i,coordinate:d,hasPayload:k,offset:p,position:y,reverseDirection:x,useTranslate3d:v,viewBox:b,wrapperStyle:j},Ibe(u,_$(_$({},this.props),{},{payload:w})))}}])}(S.PureComponent);oC(jn,"displayName","Tooltip");oC(jn,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!wl.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 Lbe=tn(),Ak=VV(),E$=AV(),zbe="Expected a function",Fbe=Math.max,Bbe=Math.min;function Vbe(e,t,r){var n,a,i,s,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(zbe);t=E$(t)||0,Lbe(r)&&(d=!!r.leading,f="maxWait"in r,i=f?Fbe(E$(r.maxWait)||0,t):i,h="trailing"in r?!!r.trailing:h);function p(k){var N=n,_=a;return n=a=void 0,u=k,s=e.apply(_,N),s}function m(k){return u=k,l=setTimeout(x,t),d?p(k):s}function g(k){var N=k-c,_=k-u,P=t-N;return f?Bbe(P,i-_):P}function y(k){var N=k-c,_=k-u;return c===void 0||N>=t||N<0||f&&_>=i}function x(){var k=Ak();if(y(k))return v(k);l=setTimeout(x,g(k))}function v(k){return l=void 0,h&&n?p(k):(n=a=void 0,s)}function b(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function j(){return l===void 0?s:v(Ak())}function w(){var k=Ak(),N=y(k);if(n=arguments,a=this,c=k,N){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(x,t),p(c)}return l===void 0&&(l=setTimeout(x,t)),s}return w.cancel=b,w.flush=j,w}var qbe=Vbe,Ube=qbe,Hbe=tn(),Wbe="Expected a function";function Gbe(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(Wbe);return Hbe(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),Ube(e,t,{leading:n,maxWait:t,trailing:a})}var Kbe=Gbe;const oU=lt(Kbe);function th(e){"@babel/helpers - typeof";return th=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},th(e)}function P$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Gp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?P$(Object(r),!0).forEach(function(n){Ybe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P$(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ybe(e,t,r){return t=Xbe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xbe(e){var t=Zbe(e,"string");return th(t)=="symbol"?t:t+""}function Zbe(e,t){if(th(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(th(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qbe(e,t){return r1e(e)||t1e(e,t)||e1e(e,t)||Jbe()}function Jbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
678
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e1e(e,t){if(e){if(typeof e=="string")return C$(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C$(e,t)}}function C$(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t1e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function r1e(e){if(Array.isArray(e))return e}var Zx=S.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,a=n===void 0?{width:-1,height:-1}:n,i=e.width,s=i===void 0?"100%":i,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,m=e.debounce,g=m===void 0?0:m,y=e.id,x=e.className,v=e.onResize,b=e.style,j=b===void 0?{}:b,w=S.useRef(null),k=S.useRef();k.current=v,S.useImperativeHandle(t,function(){return Object.defineProperty(w.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),w.current},configurable:!0})});var N=S.useState({containerWidth:a.width,containerHeight:a.height}),_=Qbe(N,2),P=_[0],C=_[1],A=S.useCallback(function(T,E){C(function(R){var D=Math.round(T),z=Math.round(E);return R.containerWidth===D&&R.containerHeight===z?R:{containerWidth:D,containerHeight:z}})},[]);S.useEffect(function(){var T=function($){var F,q=$[0].contentRect,V=q.width,L=q.height;A(V,L),(F=k.current)===null||F===void 0||F.call(k,V,L)};g>0&&(T=oU(T,g,{trailing:!0,leading:!1}));var E=new ResizeObserver(T),R=w.current.getBoundingClientRect(),D=R.width,z=R.height;return A(D,z),E.observe(w.current),function(){E.disconnect()}},[A,g]);var O=S.useMemo(function(){var T=P.containerWidth,E=P.containerHeight;if(T<0||E<0)return null;ji(Ro(s)||Ro(c),`The width(%s) and height(%s) are both fixed numbers,
679
+ maybe you don't need to use a ResponsiveContainer.`,s,c),ji(!r||r>0,"The aspect(%s) must be greater than zero.",r);var R=Ro(s)?T:s,D=Ro(c)?E:c;r&&r>0&&(R?D=R/r:D&&(R=D*r),h&&D>h&&(D=h)),ji(R>0||D>0,`The width(%s) and height(%s) of chart should be greater than 0,
680
+ please check the style of container, or the props width(%s) and height(%s),
681
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
682
+ height and width.`,R,D,s,c,d,f,r);var z=!Array.isArray(p)&&wi(p.type).endsWith("Chart");return M.Children.map(p,function(I){return M.isValidElement(I)?S.cloneElement(I,Gp({width:R,height:D},z?{style:Gp({height:"100%",width:"100%",maxHeight:D,maxWidth:R},I.props.style)}:{})):I})},[r,p,c,h,f,d,P,s]);return M.createElement("div",{id:y?"".concat(y):void 0,className:tt("recharts-responsive-container",x),style:Gp(Gp({},j),{},{width:s,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:w},O)}),lC=function(t){return null};lC.displayName="Cell";function rh(e){"@babel/helpers - typeof";return rh=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},rh(e)}function A$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function mS(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?A$(Object(r),!0).forEach(function(n){n1e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A$(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function n1e(e,t,r){return t=a1e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a1e(e){var t=i1e(e,"string");return rh(t)=="symbol"?t:t+""}function i1e(e,t){if(rh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(rh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Il={widthCache:{},cacheCount:0},s1e=2e3,o1e={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},O$="recharts_measurement_span";function l1e(e){var t=mS({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var rf=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||wl.isSsr)return{width:0,height:0};var n=l1e(r),a=JSON.stringify({text:t,copyStyle:n});if(Il.widthCache[a])return Il.widthCache[a];try{var i=document.getElementById(O$);i||(i=document.createElement("span"),i.setAttribute("id",O$),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var s=mS(mS({},o1e),n);Object.assign(i.style,s),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return Il.widthCache[a]=c,++Il.cacheCount>s1e&&(Il.cacheCount=0,Il.widthCache={}),c}catch{return{width:0,height:0}}},c1e=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function nh(e){"@babel/helpers - typeof";return nh=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},nh(e)}function X0(e,t){return h1e(e)||f1e(e,t)||d1e(e,t)||u1e()}function u1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
683
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d1e(e,t){if(e){if(typeof e=="string")return T$(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T$(e,t)}}function T$(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function f1e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function h1e(e){if(Array.isArray(e))return e}function p1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M$(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,g1e(n.key),n)}}function m1e(e,t,r){return t&&M$(e.prototype,t),r&&M$(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function g1e(e){var t=x1e(e,"string");return nh(t)=="symbol"?t:t+""}function x1e(e,t){if(nh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(nh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var R$=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,D$=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,y1e=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,v1e=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,lU={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},b1e=Object.keys(lU),uc="NaN";function w1e(e,t){return e*lU[t]}var Kp=function(){function e(t,r){p1e(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!y1e.test(r)&&(this.num=NaN,this.unit=""),b1e.includes(r)&&(this.num=w1e(t,r),this.unit="px")}return m1e(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.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(r){var n,a=(n=v1e.exec(r))!==null&&n!==void 0?n:[],i=X0(a,3),s=i[1],l=i[2];return new e(parseFloat(s),l??"")}}])}();function cU(e){if(e.includes(uc))return uc;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=R$.exec(t))!==null&&r!==void 0?r:[],a=X0(n,4),i=a[1],s=a[2],l=a[3],c=Kp.parse(i??""),u=Kp.parse(l??""),d=s==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return uc;t=t.replace(R$,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=D$.exec(t))!==null&&f!==void 0?f:[],p=X0(h,4),m=p[1],g=p[2],y=p[3],x=Kp.parse(m??""),v=Kp.parse(y??""),b=g==="+"?x.add(v):x.subtract(v);if(b.isNaN())return uc;t=t.replace(D$,b.toString())}return t}var $$=/\(([^()]*)\)/;function j1e(e){for(var t=e;t.includes("(");){var r=$$.exec(t),n=X0(r,2),a=n[1];t=t.replace($$,cU(a))}return t}function k1e(e){var t=e.replace(/\s+/g,"");return t=j1e(t),t=cU(t),t}function N1e(e){try{return k1e(e)}catch{return uc}}function Ok(e){var t=N1e(e.slice(5,-1));return t===uc?"":t}var S1e=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],_1e=["dx","dy","angle","className","breakAll"];function gS(){return gS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gS.apply(this,arguments)}function I$(e,t){if(e==null)return{};var r=E1e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function E1e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function L$(e,t){return O1e(e)||A1e(e,t)||C1e(e,t)||P1e()}function P1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
684
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C1e(e,t){if(e){if(typeof e=="string")return z$(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z$(e,t)}}function z$(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function A1e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function O1e(e){if(Array.isArray(e))return e}var uU=/[ \f\n\r\t\v\u2028\u2029]+/,dU=function(t){var r=t.children,n=t.breakAll,a=t.style;try{var i=[];Ge(r)||(n?i=r.toString().split(""):i=r.toString().split(uU));var s=i.map(function(c){return{word:c,width:rf(c,a).width}}),l=n?0:rf(" ",a).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}},T1e=function(t,r,n,a,i){var s=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=ue(s),f=l,h=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return R.reduce(function(D,z){var I=z.word,$=z.width,F=D[D.length-1];if(F&&(a==null||i||F.width+$+n<Number(a)))F.words.push(I),F.width+=$+n;else{var q={words:[I],width:$};D.push(q)}return D},[])},p=h(r),m=function(R){return R.reduce(function(D,z){return D.width>z.width?D:z})};if(!d)return p;for(var g="…",y=function(R){var D=f.slice(0,R),z=dU({breakAll:u,style:c,children:D+g}).wordsWithComputedWidth,I=h(z),$=I.length>s||m(I).width>Number(a);return[$,I]},x=0,v=f.length-1,b=0,j;x<=v&&b<=f.length-1;){var w=Math.floor((x+v)/2),k=w-1,N=y(k),_=L$(N,2),P=_[0],C=_[1],A=y(w),O=L$(A,1),T=O[0];if(!P&&!T&&(x=w+1),P&&T&&(v=w-1),!P&&T){j=C;break}b++}return j||p},F$=function(t){var r=Ge(t)?[]:t.toString().split(uU);return[{words:r}]},M1e=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,s=t.breakAll,l=t.maxLines;if((r||n)&&!wl.isSsr){var c,u,d=dU({breakAll:s,children:a,style:i});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return F$(a);return T1e({breakAll:s,children:a,maxLines:l,style:i},c,u,r,n)}return F$(a)},B$="#808080",Z0=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,s=t.lineHeight,l=s===void 0?"1em":s,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,m=t.verticalAnchor,g=m===void 0?"end":m,y=t.fill,x=y===void 0?B$:y,v=I$(t,S1e),b=S.useMemo(function(){return M1e({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:f,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,f,v.style,v.width]),j=v.dx,w=v.dy,k=v.angle,N=v.className,_=v.breakAll,P=I$(v,_1e);if(!gr(n)||!gr(i))return null;var C=n+(ue(j)?j:0),A=i+(ue(w)?w:0),O;switch(g){case"start":O=Ok("calc(".concat(u,")"));break;case"middle":O=Ok("calc(".concat((b.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:O=Ok("calc(".concat(b.length-1," * -").concat(l,")"));break}var T=[];if(f){var E=b[0].width,R=v.width;T.push("scale(".concat((ue(R)?R/E:1)/E,")"))}return k&&T.push("rotate(".concat(k,", ").concat(C,", ").concat(A,")")),T.length&&(P.transform=T.join(" ")),M.createElement("text",gS({},Ue(P,!0),{x:C,y:A,className:tt("recharts-text",N),textAnchor:p,fill:x.includes("url")?B$:x}),b.map(function(D,z){var I=D.words.join(_?"":" ");return M.createElement("tspan",{x:C,dy:z===0?O:l,key:"".concat(I,"-").concat(z)},I)}))};function Fs(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function R1e(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function cC(e){let t,r,n;e.length!==2?(t=Fs,r=(l,c)=>Fs(e(l),c),n=(l,c)=>e(l)-c):(t=e===Fs||e===R1e?e:D1e,r=e,n=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;r(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function i(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function s(l,c,u=0,d=l.length){const f=a(l,c,u,d-1);return f>u&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:a,center:s,right:i}}function D1e(){return 0}function fU(e){return e===null?NaN:+e}function*$1e(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const I1e=cC(Fs),Qh=I1e.right;cC(fU).center;class V$ extends Map{constructor(t,r=F1e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(q$(this,t))}has(t){return super.has(q$(this,t))}set(t,r){return super.set(L1e(this,t),r)}delete(t){return super.delete(z1e(this,t))}}function q$({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function L1e({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function z1e({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function F1e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function B1e(e=Fs){if(e===Fs)return hU;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function hU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const V1e=Math.sqrt(50),q1e=Math.sqrt(10),U1e=Math.sqrt(2);function Q0(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),s=i>=V1e?10:i>=q1e?5:i>=U1e?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/s,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)*s,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?Q0(e,t,r*2):[l,c,u]}function xS(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[a,i,s]=n?Q0(t,e,r):Q0(e,t,r);if(!(i>=a))return[];const l=i-a+1,c=new Array(l);if(n)if(s<0)for(let u=0;u<l;++u)c[u]=(i-u)/-s;else for(let u=0;u<l;++u)c[u]=(i-u)*s;else if(s<0)for(let u=0;u<l;++u)c[u]=(a+u)/-s;else for(let u=0;u<l;++u)c[u]=(a+u)*s;return c}function yS(e,t,r){return t=+t,e=+e,r=+r,Q0(e,t,r)[2]}function vS(e,t,r){t=+t,e=+e,r=+r;const n=t<e,a=n?yS(t,e,r):yS(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function U$(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function H$(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function pU(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?hU:B1e(a);n>r;){if(n-r>600){const c=n-r+1,u=t-r+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(r,Math.floor(t-u*f/c+h)),m=Math.min(n,Math.floor(t+(c-u)*f/c+h));pU(e,t,p,m,a)}const i=e[t];let s=r,l=n;for(fd(e,r,t),a(e[n],i)>0&&fd(e,r,n);s<l;){for(fd(e,s,l),++s,--l;a(e[s],i)<0;)++s;for(;a(e[l],i)>0;)--l}a(e[r],i)===0?fd(e,r,l):(++l,fd(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function fd(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function H1e(e,t,r){if(e=Float64Array.from($1e(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return H$(e);if(t>=1)return U$(e);var n,a=(n-1)*t,i=Math.floor(a),s=U$(pU(e,i).subarray(0,i+1)),l=H$(e.subarray(i+1));return s+(l-s)*(a-i)}}function W1e(e,t,r=fU){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),s=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return s+(l-s)*(a-i)}}function G1e(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n<a;)i[n]=e+n*r;return i}function ca(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ki(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 bS=Symbol("implicit");function uC(){var e=new V$,t=[],r=[],n=bS;function a(i){let s=e.get(i);if(s===void 0){if(n!==bS)return n;e.set(i,s=t.push(i)-1)}return r[s%r.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new V$;for(const s of i)e.has(s)||e.set(s,t.push(s)-1);return a},a.range=function(i){return arguments.length?(r=Array.from(i),a):r.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return uC(t,r).unknown(n)},ca.apply(a,arguments),a}function ah(){var e=uC().unknown(void 0),t=e.domain,r=e.range,n=0,a=1,i,s,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=a<n,m=p?a:n,g=p?n:a;i=(g-m)/Math.max(1,h-c+u*2),l&&(i=Math.floor(i)),m+=(g-m-i*(h-c))*d,s=i*(1-c),l&&(m=Math.round(m),s=Math.round(s));var y=G1e(h).map(function(x){return m+i*x});return r(p?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([n,a]=h,n=+n,a=+a,f()):[n,a]},e.rangeRound=function(h){return[n,a]=h,n=+n,a=+a,l=!0,f()},e.bandwidth=function(){return s},e.step=function(){return i},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 ah(t(),[n,a]).round(l).paddingInner(c).paddingOuter(u).align(d)},ca.apply(f(),arguments)}function mU(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return mU(t())},e}function nf(){return mU(ah.apply(null,arguments).paddingInner(1))}function K1e(e){return function(){return e}}function J0(e){return+e}var W$=[0,1];function Yr(e){return e}function wS(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:K1e(isNaN(t)?NaN:.5)}function Y1e(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function X1e(e,t,r){var n=e[0],a=e[1],i=t[0],s=t[1];return a<n?(n=wS(a,n),i=r(s,i)):(n=wS(n,a),i=r(i,s)),function(l){return i(n(l))}}function Z1e(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),i=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)a[s]=wS(e[s],e[s+1]),i[s]=r(t[s],t[s+1]);return function(l){var c=Qh(e,l,1,n)-1;return i[c](a[c](l))}}function Jh(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Qx(){var e=W$,t=W$,r=Pu,n,a,i,s=Yr,l,c,u;function d(){var h=Math.min(e.length,t.length);return s!==Yr&&(s=Y1e(e[0],e[h-1])),l=h>2?Z1e:X1e,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?i:(c||(c=l(e.map(n),t,r)))(n(s(h)))}return f.invert=function(h){return s(a((u||(u=l(t,e.map(n),wa)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,J0),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),r=cP,d()},f.clamp=function(h){return arguments.length?(s=h?!0:Yr,d()):s!==Yr},f.interpolate=function(h){return arguments.length?(r=h,d()):r},f.unknown=function(h){return arguments.length?(i=h,f):i},function(h,p){return n=h,a=p,d()}}function dC(){return Qx()(Yr,Yr)}function Q1e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function eg(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function tu(e){return e=eg(Math.abs(e)),e?e[1]:NaN}function J1e(e,t){return function(r,n){for(var a=r.length,i=[],s=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(a-=l,a+l)),!((c+=l+1)>n));)l=e[s=(s+1)%e.length];return i.reverse().join(t)}}function ewe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var twe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ih(e){if(!(t=twe.exec(e)))throw new Error("invalid format: "+e);var t;return new fC({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]})}ih.prototype=fC.prototype;function fC(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+""}fC.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 rwe(e){e:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var gU;function nwe(e,t){var r=eg(e,t);if(!r)return e+"";var n=r[0],a=r[1],i=a-(gU=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=n.length;return i===s?n:i>s?n+new Array(i-s+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+eg(e,Math.max(0,t+i-1))[0]}function G$(e,t){var r=eg(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const K$={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Q1e,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)=>G$(e*100,t),r:G$,s:nwe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Y$(e){return e}var X$=Array.prototype.map,Z$=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function awe(e){var t=e.grouping===void 0||e.thousands===void 0?Y$:J1e(X$.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?Y$:ewe(X$.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=ih(f);var h=f.fill,p=f.align,m=f.sign,g=f.symbol,y=f.zero,x=f.width,v=f.comma,b=f.precision,j=f.trim,w=f.type;w==="n"?(v=!0,w="g"):K$[w]||(b===void 0&&(b=12),j=!0,w="g"),(y||h==="0"&&p==="=")&&(y=!0,h="0",p="=");var k=g==="$"?r:g==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",N=g==="$"?n:/[%p]/.test(w)?s:"",_=K$[w],P=/[defgprs%]/.test(w);b=b===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function C(A){var O=k,T=N,E,R,D;if(w==="c")T=_(A)+T,A="";else{A=+A;var z=A<0||1/A<0;if(A=isNaN(A)?c:_(Math.abs(A),b),j&&(A=rwe(A)),z&&+A==0&&m!=="+"&&(z=!1),O=(z?m==="("?m:l:m==="-"||m==="("?"":m)+O,T=(w==="s"?Z$[8+gU/3]:"")+T+(z&&m==="("?")":""),P){for(E=-1,R=A.length;++E<R;)if(D=A.charCodeAt(E),48>D||D>57){T=(D===46?a+A.slice(E+1):A.slice(E))+T,A=A.slice(0,E);break}}}v&&!y&&(A=t(A,1/0));var I=O.length+A.length+T.length,$=I<x?new Array(x-I+1).join(h):"";switch(v&&y&&(A=t($+A,$.length?x-T.length:1/0),$=""),p){case"<":A=O+A+T+$;break;case"=":A=O+$+A+T;break;case"^":A=$.slice(0,I=$.length>>1)+O+A+T+$.slice(I);break;default:A=$+O+A+T;break}return i(A)}return C.toString=function(){return f+""},C}function d(f,h){var p=u((f=ih(f),f.type="f",f)),m=Math.max(-8,Math.min(8,Math.floor(tu(h)/3)))*3,g=Math.pow(10,-m),y=Z$[8+m/3];return function(x){return p(g*x)+y}}return{format:u,formatPrefix:d}}var Yp,hC,xU;iwe({thousands:",",grouping:[3],currency:["$",""]});function iwe(e){return Yp=awe(e),hC=Yp.format,xU=Yp.formatPrefix,Yp}function swe(e){return Math.max(0,-tu(Math.abs(e)))}function owe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(tu(t)/3)))*3-tu(Math.abs(e)))}function lwe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,tu(t)-tu(e))+1}function yU(e,t,r,n){var a=vS(e,t,r),i;switch(n=ih(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=owe(a,s))&&(n.precision=i),xU(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=lwe(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=swe(a))&&(n.precision=i-(n.type==="%")*2);break}}return hC(n)}function ao(e){var t=e.domain;return e.ticks=function(r){var n=t();return xS(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return yU(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,s=n[a],l=n[i],c,u,d=10;for(l<s&&(u=s,s=l,l=u,u=a,a=i,i=u);d-- >0;){if(u=yS(s,l,r),u===c)return n[a]=s,n[i]=l,t(n);if(u>0)s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u;else if(u<0)s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function tg(){var e=dC();return e.copy=function(){return Jh(e,tg())},ca.apply(e,arguments),ao(e)}function vU(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,J0),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return vU(e).unknown(t)},e=arguments.length?Array.from(e,J0):[0,1],ao(r)}function bU(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],s;return i<a&&(s=r,r=n,n=s,s=a,a=i,i=s),e[r]=t.floor(a),e[n]=t.ceil(i),e}function Q$(e){return Math.log(e)}function J$(e){return Math.exp(e)}function cwe(e){return-Math.log(-e)}function uwe(e){return-Math.exp(-e)}function dwe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function fwe(e){return e===10?dwe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function hwe(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 eI(e){return(t,r)=>-e(-t,r)}function pC(e){const t=e(Q$,J$),r=t.domain;let n=10,a,i;function s(){return a=hwe(n),i=fwe(n),r()[0]<0?(a=eI(a),i=eI(i),e(cwe,uwe)):e(Q$,J$),t}return t.base=function(l){return arguments.length?(n=+l,s()):n},t.domain=function(l){return arguments.length?(r(l),s()):r()},t.ticks=l=>{const c=r();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),m,g;const y=l==null?10:+l;let x=[];if(!(n%1)&&p-h<y){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(m=1;m<n;++m)if(g=h<0?m/i(-h):m*i(h),!(g<u)){if(g>d)break;x.push(g)}}else for(;h<=p;++h)for(m=n-1;m>=1;--m)if(g=h>0?m/i(-h):m*i(h),!(g<u)){if(g>d)break;x.push(g)}x.length*2<y&&(x=xS(u,d,y))}else x=xS(h,p,Math.min(p-h,y)).map(i);return f?x.reverse():x},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=ih(c)).precision==null&&(c.trim=!0),c=hC(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return d=>{let f=d/i(Math.round(a(d)));return f*n<n-.5&&(f*=n),f<=u?c(d):""}},t.nice=()=>r(bU(r(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),t}function wU(){const e=pC(Qx()).domain([1,10]);return e.copy=()=>Jh(e,wU()).base(e.base()),ca.apply(e,arguments),e}function tI(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function rI(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function mC(e){var t=1,r=e(tI(t),rI(t));return r.constant=function(n){return arguments.length?e(tI(t=+n),rI(t)):t},ao(r)}function jU(){var e=mC(Qx());return e.copy=function(){return Jh(e,jU()).constant(e.constant())},ca.apply(e,arguments)}function nI(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function pwe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function mwe(e){return e<0?-e*e:e*e}function gC(e){var t=e(Yr,Yr),r=1;function n(){return r===1?e(Yr,Yr):r===.5?e(pwe,mwe):e(nI(r),nI(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},ao(t)}function xC(){var e=gC(Qx());return e.copy=function(){return Jh(e,xC()).exponent(e.exponent())},ca.apply(e,arguments),e}function gwe(){return xC.apply(null,arguments).exponent(.5)}function aI(e){return Math.sign(e)*e*e}function xwe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function kU(){var e=dC(),t=[0,1],r=!1,n;function a(i){var s=xwe(e(i));return isNaN(s)?n:r?Math.round(s):s}return a.invert=function(i){return e.invert(aI(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,J0)).map(aI)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return kU(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},ca.apply(a,arguments),ao(a)}function NU(){var e=[],t=[],r=[],n;function a(){var s=0,l=Math.max(1,t.length);for(r=new Array(l-1);++s<l;)r[s-1]=W1e(e,s/l);return i}function i(s){return s==null||isNaN(s=+s)?n:t[Qh(r,s)]}return i.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},i.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Fs),a()},i.range=function(s){return arguments.length?(t=Array.from(s),a()):t.slice()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return NU().domain(e).range(t).unknown(n)},ca.apply(i,arguments)}function SU(){var e=0,t=1,r=1,n=[.5],a=[0,1],i;function s(c){return c!=null&&c<=c?a[Qh(n,c,0,r)]:i}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(r=(a=Array.from(c)).length-1,l()):a.slice()},s.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},s.unknown=function(c){return arguments.length&&(i=c),s},s.thresholds=function(){return n.slice()},s.copy=function(){return SU().domain([e,t]).range(a).unknown(i)},ca.apply(ao(s),arguments)}function _U(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[Qh(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var s=t.indexOf(i);return[e[s-1],e[s]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return _U().domain(e).range(t).unknown(r)},ca.apply(a,arguments)}const Tk=new Date,Mk=new Date;function yr(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const s=a(i),l=a.ceil(i);return i-s<l-i?s:l},a.offset=(i,s)=>(t(i=new Date(+i),s==null?1:Math.floor(s)),i),a.range=(i,s,l)=>{const c=[];if(i=a.ceil(i),l=l==null?1:Math.floor(l),!(i<s)||!(l>0))return c;let u;do c.push(u=new Date(+i)),t(i,l),e(i);while(u<i&&i<s);return c},a.filter=i=>yr(s=>{if(s>=s)for(;e(s),!i(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!i(s););else for(;--l>=0;)for(;t(s,1),!i(s););}),r&&(a.count=(i,s)=>(Tk.setTime(+i),Mk.setTime(+s),e(Tk),e(Mk),Math.floor(r(Tk,Mk))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?s=>n(s)%i===0:s=>a.count(0,s)%i===0):a)),a}const rg=yr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);rg.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?yr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):rg);rg.range;const hi=1e3,Kn=hi*60,pi=Kn*60,zi=pi*24,yC=zi*7,iI=zi*30,Rk=zi*365,Do=yr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*hi)},(e,t)=>(t-e)/hi,e=>e.getUTCSeconds());Do.range;const vC=yr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hi)},(e,t)=>{e.setTime(+e+t*Kn)},(e,t)=>(t-e)/Kn,e=>e.getMinutes());vC.range;const bC=yr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Kn)},(e,t)=>(t-e)/Kn,e=>e.getUTCMinutes());bC.range;const wC=yr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hi-e.getMinutes()*Kn)},(e,t)=>{e.setTime(+e+t*pi)},(e,t)=>(t-e)/pi,e=>e.getHours());wC.range;const jC=yr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*pi)},(e,t)=>(t-e)/pi,e=>e.getUTCHours());jC.range;const ep=yr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Kn)/zi,e=>e.getDate()-1);ep.range;const Jx=yr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/zi,e=>e.getUTCDate()-1);Jx.range;const EU=yr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/zi,e=>Math.floor(e/zi));EU.range;function jl(e){return yr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Kn)/yC)}const ey=jl(0),ng=jl(1),ywe=jl(2),vwe=jl(3),ru=jl(4),bwe=jl(5),wwe=jl(6);ey.range;ng.range;ywe.range;vwe.range;ru.range;bwe.range;wwe.range;function kl(e){return yr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/yC)}const ty=kl(0),ag=kl(1),jwe=kl(2),kwe=kl(3),nu=kl(4),Nwe=kl(5),Swe=kl(6);ty.range;ag.range;jwe.range;kwe.range;nu.range;Nwe.range;Swe.range;const kC=yr(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());kC.range;const NC=yr(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());NC.range;const Fi=yr(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());Fi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:yr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Fi.range;const Bi=yr(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());Bi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:yr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Bi.range;function PU(e,t,r,n,a,i){const s=[[Do,1,hi],[Do,5,5*hi],[Do,15,15*hi],[Do,30,30*hi],[i,1,Kn],[i,5,5*Kn],[i,15,15*Kn],[i,30,30*Kn],[a,1,pi],[a,3,3*pi],[a,6,6*pi],[a,12,12*pi],[n,1,zi],[n,2,2*zi],[r,1,yC],[t,1,iI],[t,3,3*iI],[e,1,Rk]];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),m=p?p.range(u,+d+1):[];return h?m.reverse():m}function c(u,d,f){const h=Math.abs(d-u)/f,p=cC(([,,y])=>y).right(s,h);if(p===s.length)return e.every(vS(u/Rk,d/Rk,f));if(p===0)return rg.every(Math.max(vS(u,d,f),1));const[m,g]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return m.every(g)}return[l,c]}const[_we,Ewe]=PU(Bi,NC,ty,EU,jC,bC),[Pwe,Cwe]=PU(Fi,kC,ey,ep,wC,vC);function Dk(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 $k(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 hd(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function Awe(e){var t=e.dateTime,r=e.date,n=e.time,a=e.periods,i=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,u=pd(a),d=md(a),f=pd(i),h=md(i),p=pd(s),m=md(s),g=pd(l),y=md(l),x=pd(c),v=md(c),b={a:z,A:I,b:$,B:F,c:null,d:dI,e:dI,f:Jwe,g:cje,G:dje,H:Xwe,I:Zwe,j:Qwe,L:CU,m:eje,M:tje,p:q,q:V,Q:pI,s:mI,S:rje,u:nje,U:aje,V:ije,w:sje,W:oje,x:null,X:null,y:lje,Y:uje,Z:fje,"%":hI},j={a:L,A:B,b:Y,B:W,c:null,d:fI,e:fI,f:gje,g:_je,G:Pje,H:hje,I:pje,j:mje,L:OU,m:xje,M:yje,p:K,q:Q,Q:pI,s:mI,S:vje,u:bje,U:wje,V:jje,w:kje,W:Nje,x:null,X:null,y:Sje,Y:Eje,Z:Cje,"%":hI},w={a:C,A,b:O,B:T,c:E,d:cI,e:cI,f:Wwe,g:lI,G:oI,H:uI,I:uI,j:Vwe,L:Hwe,m:Bwe,M:qwe,p:P,q:Fwe,Q:Kwe,s:Ywe,S:Uwe,u:Dwe,U:$we,V:Iwe,w:Rwe,W:Lwe,x:R,X:D,y:lI,Y:oI,Z:zwe,"%":Gwe};b.x=k(r,b),b.X=k(n,b),b.c=k(t,b),j.x=k(r,j),j.X=k(n,j),j.c=k(t,j);function k(X,ee){return function(U){var G=[],ae=-1,ce=0,de=X.length,je,le,se;for(U instanceof Date||(U=new Date(+U));++ae<de;)X.charCodeAt(ae)===37&&(G.push(X.slice(ce,ae)),(le=sI[je=X.charAt(++ae)])!=null?je=X.charAt(++ae):le=je==="e"?" ":"0",(se=ee[je])&&(je=se(U,le)),G.push(je),ce=ae+1);return G.push(X.slice(ce,ae)),G.join("")}}function N(X,ee){return function(U){var G=hd(1900,void 0,1),ae=_(G,X,U+="",0),ce,de;if(ae!=U.length)return null;if("Q"in G)return new Date(G.Q);if("s"in G)return new Date(G.s*1e3+("L"in G?G.L:0));if(ee&&!("Z"in G)&&(G.Z=0),"p"in G&&(G.H=G.H%12+G.p*12),G.m===void 0&&(G.m="q"in G?G.q:0),"V"in G){if(G.V<1||G.V>53)return null;"w"in G||(G.w=1),"Z"in G?(ce=$k(hd(G.y,0,1)),de=ce.getUTCDay(),ce=de>4||de===0?ag.ceil(ce):ag(ce),ce=Jx.offset(ce,(G.V-1)*7),G.y=ce.getUTCFullYear(),G.m=ce.getUTCMonth(),G.d=ce.getUTCDate()+(G.w+6)%7):(ce=Dk(hd(G.y,0,1)),de=ce.getDay(),ce=de>4||de===0?ng.ceil(ce):ng(ce),ce=ep.offset(ce,(G.V-1)*7),G.y=ce.getFullYear(),G.m=ce.getMonth(),G.d=ce.getDate()+(G.w+6)%7)}else("W"in G||"U"in G)&&("w"in G||(G.w="u"in G?G.u%7:"W"in G?1:0),de="Z"in G?$k(hd(G.y,0,1)).getUTCDay():Dk(hd(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(de+5)%7:G.w+G.U*7-(de+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,$k(G)):Dk(G)}}function _(X,ee,U,G){for(var ae=0,ce=ee.length,de=U.length,je,le;ae<ce;){if(G>=de)return-1;if(je=ee.charCodeAt(ae++),je===37){if(je=ee.charAt(ae++),le=w[je in sI?ee.charAt(ae++):je],!le||(G=le(X,U,G))<0)return-1}else if(je!=U.charCodeAt(G++))return-1}return G}function P(X,ee,U){var G=u.exec(ee.slice(U));return G?(X.p=d.get(G[0].toLowerCase()),U+G[0].length):-1}function C(X,ee,U){var G=p.exec(ee.slice(U));return G?(X.w=m.get(G[0].toLowerCase()),U+G[0].length):-1}function A(X,ee,U){var G=f.exec(ee.slice(U));return G?(X.w=h.get(G[0].toLowerCase()),U+G[0].length):-1}function O(X,ee,U){var G=x.exec(ee.slice(U));return G?(X.m=v.get(G[0].toLowerCase()),U+G[0].length):-1}function T(X,ee,U){var G=g.exec(ee.slice(U));return G?(X.m=y.get(G[0].toLowerCase()),U+G[0].length):-1}function E(X,ee,U){return _(X,t,ee,U)}function R(X,ee,U){return _(X,r,ee,U)}function D(X,ee,U){return _(X,n,ee,U)}function z(X){return s[X.getDay()]}function I(X){return i[X.getDay()]}function $(X){return c[X.getMonth()]}function F(X){return l[X.getMonth()]}function q(X){return a[+(X.getHours()>=12)]}function V(X){return 1+~~(X.getMonth()/3)}function L(X){return s[X.getUTCDay()]}function B(X){return i[X.getUTCDay()]}function Y(X){return c[X.getUTCMonth()]}function W(X){return l[X.getUTCMonth()]}function K(X){return a[+(X.getUTCHours()>=12)]}function Q(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var ee=k(X+="",b);return ee.toString=function(){return X},ee},parse:function(X){var ee=N(X+="",!1);return ee.toString=function(){return X},ee},utcFormat:function(X){var ee=k(X+="",j);return ee.toString=function(){return X},ee},utcParse:function(X){var ee=N(X+="",!0);return ee.toString=function(){return X},ee}}}var sI={"-":"",_:" ",0:"0"},_r=/^\s*\d+/,Owe=/^%/,Twe=/[\\^$*+?|[\]().{}]/g;function ot(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function Mwe(e){return e.replace(Twe,"\\$&")}function pd(e){return new RegExp("^(?:"+e.map(Mwe).join("|")+")","i")}function md(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function Rwe(e,t,r){var n=_r.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Dwe(e,t,r){var n=_r.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function $we(e,t,r){var n=_r.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Iwe(e,t,r){var n=_r.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Lwe(e,t,r){var n=_r.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function oI(e,t,r){var n=_r.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function lI(e,t,r){var n=_r.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function zwe(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Fwe(e,t,r){var n=_r.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Bwe(e,t,r){var n=_r.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function cI(e,t,r){var n=_r.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Vwe(e,t,r){var n=_r.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function uI(e,t,r){var n=_r.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function qwe(e,t,r){var n=_r.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Uwe(e,t,r){var n=_r.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Hwe(e,t,r){var n=_r.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Wwe(e,t,r){var n=_r.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Gwe(e,t,r){var n=Owe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Kwe(e,t,r){var n=_r.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Ywe(e,t,r){var n=_r.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function dI(e,t){return ot(e.getDate(),t,2)}function Xwe(e,t){return ot(e.getHours(),t,2)}function Zwe(e,t){return ot(e.getHours()%12||12,t,2)}function Qwe(e,t){return ot(1+ep.count(Fi(e),e),t,3)}function CU(e,t){return ot(e.getMilliseconds(),t,3)}function Jwe(e,t){return CU(e,t)+"000"}function eje(e,t){return ot(e.getMonth()+1,t,2)}function tje(e,t){return ot(e.getMinutes(),t,2)}function rje(e,t){return ot(e.getSeconds(),t,2)}function nje(e){var t=e.getDay();return t===0?7:t}function aje(e,t){return ot(ey.count(Fi(e)-1,e),t,2)}function AU(e){var t=e.getDay();return t>=4||t===0?ru(e):ru.ceil(e)}function ije(e,t){return e=AU(e),ot(ru.count(Fi(e),e)+(Fi(e).getDay()===4),t,2)}function sje(e){return e.getDay()}function oje(e,t){return ot(ng.count(Fi(e)-1,e),t,2)}function lje(e,t){return ot(e.getFullYear()%100,t,2)}function cje(e,t){return e=AU(e),ot(e.getFullYear()%100,t,2)}function uje(e,t){return ot(e.getFullYear()%1e4,t,4)}function dje(e,t){var r=e.getDay();return e=r>=4||r===0?ru(e):ru.ceil(e),ot(e.getFullYear()%1e4,t,4)}function fje(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ot(t/60|0,"0",2)+ot(t%60,"0",2)}function fI(e,t){return ot(e.getUTCDate(),t,2)}function hje(e,t){return ot(e.getUTCHours(),t,2)}function pje(e,t){return ot(e.getUTCHours()%12||12,t,2)}function mje(e,t){return ot(1+Jx.count(Bi(e),e),t,3)}function OU(e,t){return ot(e.getUTCMilliseconds(),t,3)}function gje(e,t){return OU(e,t)+"000"}function xje(e,t){return ot(e.getUTCMonth()+1,t,2)}function yje(e,t){return ot(e.getUTCMinutes(),t,2)}function vje(e,t){return ot(e.getUTCSeconds(),t,2)}function bje(e){var t=e.getUTCDay();return t===0?7:t}function wje(e,t){return ot(ty.count(Bi(e)-1,e),t,2)}function TU(e){var t=e.getUTCDay();return t>=4||t===0?nu(e):nu.ceil(e)}function jje(e,t){return e=TU(e),ot(nu.count(Bi(e),e)+(Bi(e).getUTCDay()===4),t,2)}function kje(e){return e.getUTCDay()}function Nje(e,t){return ot(ag.count(Bi(e)-1,e),t,2)}function Sje(e,t){return ot(e.getUTCFullYear()%100,t,2)}function _je(e,t){return e=TU(e),ot(e.getUTCFullYear()%100,t,2)}function Eje(e,t){return ot(e.getUTCFullYear()%1e4,t,4)}function Pje(e,t){var r=e.getUTCDay();return e=r>=4||r===0?nu(e):nu.ceil(e),ot(e.getUTCFullYear()%1e4,t,4)}function Cje(){return"+0000"}function hI(){return"%"}function pI(e){return+e}function mI(e){return Math.floor(+e/1e3)}var Ll,MU,RU;Aje({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 Aje(e){return Ll=Awe(e),MU=Ll.format,Ll.parse,RU=Ll.utcFormat,Ll.utcParse,Ll}function Oje(e){return new Date(e)}function Tje(e){return e instanceof Date?+e:+new Date(+e)}function SC(e,t,r,n,a,i,s,l,c,u){var d=dC(),f=d.invert,h=d.domain,p=u(".%L"),m=u(":%S"),g=u("%I:%M"),y=u("%I %p"),x=u("%a %d"),v=u("%b %d"),b=u("%B"),j=u("%Y");function w(k){return(c(k)<k?p:l(k)<k?m:s(k)<k?g:i(k)<k?y:n(k)<k?a(k)<k?x:v:r(k)<k?b:j)(k)}return d.invert=function(k){return new Date(f(k))},d.domain=function(k){return arguments.length?h(Array.from(k,Tje)):h().map(Oje)},d.ticks=function(k){var N=h();return e(N[0],N[N.length-1],k??10)},d.tickFormat=function(k,N){return N==null?w:u(N)},d.nice=function(k){var N=h();return(!k||typeof k.range!="function")&&(k=t(N[0],N[N.length-1],k??10)),k?h(bU(N,k)):d},d.copy=function(){return Jh(d,SC(e,t,r,n,a,i,s,l,c,u))},d}function Mje(){return ca.apply(SC(Pwe,Cwe,Fi,kC,ey,ep,wC,vC,Do,MU).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Rje(){return ca.apply(SC(_we,Ewe,Bi,NC,ty,Jx,jC,bC,Do,RU).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ry(){var e=0,t=1,r,n,a,i,s=Yr,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:s(a===0?.5:(f=(i(f)-r)*a,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,r=i(e=+e),n=i(t=+t),a=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(s=f,u):s};function d(f){return function(h){var p,m;return arguments.length?([p,m]=h,s=f(p,m),u):[s(0),s(1)]}}return u.range=d(Pu),u.rangeRound=d(cP),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return i=f,r=f(e),n=f(t),a=r===n?0:1/(n-r),u}}function io(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function DU(){var e=ao(ry()(Yr));return e.copy=function(){return io(e,DU())},Ki.apply(e,arguments)}function $U(){var e=pC(ry()).domain([1,10]);return e.copy=function(){return io(e,$U()).base(e.base())},Ki.apply(e,arguments)}function IU(){var e=mC(ry());return e.copy=function(){return io(e,IU()).constant(e.constant())},Ki.apply(e,arguments)}function _C(){var e=gC(ry());return e.copy=function(){return io(e,_C()).exponent(e.exponent())},Ki.apply(e,arguments)}function Dje(){return _C.apply(null,arguments).exponent(.5)}function LU(){var e=[],t=Yr;function r(n){if(n!=null&&!isNaN(n=+n))return t((Qh(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Fs),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>H1e(e,i/n))},r.copy=function(){return LU(t).domain(e)},Ki.apply(r,arguments)}function ny(){var e=0,t=.5,r=1,n=1,a,i,s,l,c,u=Yr,d,f=!1,h;function p(g){return isNaN(g=+g)?h:(g=.5+((g=+d(g))-i)*(n*g<n*i?l:c),u(f?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([e,t,r]=g,a=d(e=+e),i=d(t=+t),s=d(r=+r),l=a===i?0:.5/(i-a),c=i===s?0:.5/(s-i),n=i<a?-1:1,p):[e,t,r]},p.clamp=function(g){return arguments.length?(f=!!g,p):f},p.interpolator=function(g){return arguments.length?(u=g,p):u};function m(g){return function(y){var x,v,b;return arguments.length?([x,v,b]=y,u=woe(g,[x,v,b]),p):[u(0),u(.5),u(1)]}}return p.range=m(Pu),p.rangeRound=m(cP),p.unknown=function(g){return arguments.length?(h=g,p):h},function(g){return d=g,a=g(e),i=g(t),s=g(r),l=a===i?0:.5/(i-a),c=i===s?0:.5/(s-i),n=i<a?-1:1,p}}function zU(){var e=ao(ny()(Yr));return e.copy=function(){return io(e,zU())},Ki.apply(e,arguments)}function FU(){var e=pC(ny()).domain([.1,1,10]);return e.copy=function(){return io(e,FU()).base(e.base())},Ki.apply(e,arguments)}function BU(){var e=mC(ny());return e.copy=function(){return io(e,BU()).constant(e.constant())},Ki.apply(e,arguments)}function EC(){var e=gC(ny());return e.copy=function(){return io(e,EC()).exponent(e.exponent())},Ki.apply(e,arguments)}function $je(){return EC.apply(null,arguments).exponent(.5)}const gI=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:ah,scaleDiverging:zU,scaleDivergingLog:FU,scaleDivergingPow:EC,scaleDivergingSqrt:$je,scaleDivergingSymlog:BU,scaleIdentity:vU,scaleImplicit:bS,scaleLinear:tg,scaleLog:wU,scaleOrdinal:uC,scalePoint:nf,scalePow:xC,scaleQuantile:NU,scaleQuantize:SU,scaleRadial:kU,scaleSequential:DU,scaleSequentialLog:$U,scaleSequentialPow:_C,scaleSequentialQuantile:LU,scaleSequentialSqrt:Dje,scaleSequentialSymlog:IU,scaleSqrt:gwe,scaleSymlog:jU,scaleThreshold:_U,scaleTime:Mje,scaleUtc:Rje,tickFormat:yU},Symbol.toStringTag,{value:"Module"}));var Ije=$V();const Es=lt(Ije);var Lje=BV();const ay=lt(Lje);var zje=Ox(),Fje=BP();function Bje(e,t){return zje(Fje(e,t),1)}var Vje=Bje;const qje=lt(Vje);var Uje=LP();function Hje(e,t){return Uje(e,t)}var Wje=Hje;const au=lt(Wje);var Fu=1e9,Gje={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},CC,zt=!0,aa="[DecimalError] ",Ho=aa+"Invalid argument: ",PC=aa+"Exponent out of range: ",Bu=Math.floor,wo=Math.pow,Kje=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,kn,br=1e7,Tt=7,VU=9007199254740991,ig=Bu(VU/Tt),be={};be.absoluteValue=be.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};be.comparedTo=be.cmp=function(e){var t,r,n,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=n<a?n:a;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};be.decimalPlaces=be.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Tt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};be.dividedBy=be.div=function(e){return ki(this,new this.constructor(e))};be.dividedToIntegerBy=be.idiv=function(e){var t=this,r=t.constructor;return wt(ki(t,new r(e),0,1),r.precision)};be.equals=be.eq=function(e){return!this.cmp(e)};be.exponent=function(){return cr(this)};be.greaterThan=be.gt=function(e){return this.cmp(e)>0};be.greaterThanOrEqualTo=be.gte=function(e){return this.cmp(e)>=0};be.isInteger=be.isint=function(){return this.e>this.d.length-2};be.isNegative=be.isneg=function(){return this.s<0};be.isPositive=be.ispos=function(){return this.s>0};be.isZero=function(){return this.s===0};be.lessThan=be.lt=function(e){return this.cmp(e)<0};be.lessThanOrEqualTo=be.lte=function(e){return this.cmp(e)<1};be.logarithm=be.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(kn))throw Error(aa+"NaN");if(r.s<1)throw Error(aa+(r.s?"NaN":"-Infinity"));return r.eq(kn)?new n(0):(zt=!1,t=ki(sh(r,i),sh(e,i),i),zt=!0,wt(t,a))};be.minus=be.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?HU(t,e):qU(t,(e.s=-e.s,e))};be.modulo=be.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(aa+"NaN");return r.s?(zt=!1,t=ki(r,e,0,1).times(e),zt=!0,r.minus(t)):wt(new n(r),a)};be.naturalExponential=be.exp=function(){return UU(this)};be.naturalLogarithm=be.ln=function(){return sh(this)};be.negated=be.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};be.plus=be.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?qU(t,e):HU(t,(e.s=-e.s,e))};be.precision=be.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ho+e);if(t=cr(a)+1,n=a.d.length-1,r=n*Tt+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};be.squareRoot=be.sqrt=function(){var e,t,r,n,a,i,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(aa+"NaN")}for(e=cr(l),zt=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=Ba(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Bu((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),n=new c(t)):n=new c(a.toString()),r=c.precision,a=s=r+3;;)if(i=n,n=i.plus(ki(l,i,s+2)).times(.5),Ba(i.d).slice(0,s)===(t=Ba(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),a==s&&t=="4999"){if(wt(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;s+=4}return zt=!0,wt(n,r)};be.times=be.mul=function(e){var t,r,n,a,i,s,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,r=d.e+e.e,c=h.length,u=p.length,c<u&&(i=h,h=p,p=i,s=c,c=u,u=s),i=[],s=c+u,n=s;n--;)i.push(0);for(n=u;--n>=0;){for(t=0,a=c+n;a>n;)l=i[a]+p[n]*h[a-n-1]+t,i[a--]=l%br|0,t=l/br|0;i[a]=(i[a]+t)%br|0}for(;!i[--s];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,zt?wt(e,f.precision):e};be.toDecimalPlaces=be.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Ya(e,0,Fu),t===void 0?t=n.rounding:Ya(t,0,8),wt(r,e+cr(r)+1,t))};be.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=cl(n,!0):(Ya(e,0,Fu),t===void 0?t=a.rounding:Ya(t,0,8),n=wt(new a(n),e+1,t),r=cl(n,!0,e+1)),r};be.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?cl(a):(Ya(e,0,Fu),t===void 0?t=i.rounding:Ya(t,0,8),n=wt(new i(a),e+cr(a)+1,t),r=cl(n.abs(),!1,e+cr(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};be.toInteger=be.toint=function(){var e=this,t=e.constructor;return wt(new t(e),cr(e)+1,t.rounding)};be.toNumber=function(){return+this};be.toPower=be.pow=function(e){var t,r,n,a,i,s,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(kn);if(l=new c(l),!l.s){if(e.s<1)throw Error(aa+"Infinity");return l}if(l.eq(kn))return l;if(n=c.precision,e.eq(kn))return wt(l,n);if(t=e.e,r=e.d.length-1,s=t>=r,i=l.s,s){if((r=d<0?-d:d)<=VU){for(a=new c(kn),t=Math.ceil(n/Tt+4),zt=!1;r%2&&(a=a.times(l),yI(a.d,t)),r=Bu(r/2),r!==0;)l=l.times(l),yI(l.d,t);return zt=!0,e.s<0?new c(kn).div(a):wt(a,n)}}else if(i<0)throw Error(aa+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,zt=!1,a=e.times(sh(l,n+u)),zt=!0,a=UU(a),a.s=i,a};be.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=cr(a),n=cl(a,r<=i.toExpNeg||r>=i.toExpPos)):(Ya(e,1,Fu),t===void 0?t=i.rounding:Ya(t,0,8),a=wt(new i(a),e,t),r=cr(a),n=cl(a,e<=r||r<=i.toExpNeg,e)),n};be.toSignificantDigits=be.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Ya(e,1,Fu),t===void 0?t=n.rounding:Ya(t,0,8)),wt(new n(r),e,t)};be.toString=be.valueOf=be.val=be.toJSON=be[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=cr(e),r=e.constructor;return cl(e,t<=r.toExpNeg||t>=r.toExpPos)};function qU(e,t){var r,n,a,i,s,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),zt?wt(t,f):t;if(c=e.d,u=t.d,s=e.e,a=t.e,c=c.slice(),i=s-a,i){for(i<0?(n=c,i=-i,l=u.length):(n=u,a=s,l=c.length),s=Math.ceil(f/Tt),l=s>l?s+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=u.length,l-i<0&&(i=l,n=u,u=c,c=n),r=0;i;)r=(c[--i]=c[i]+u[i]+r)/br|0,c[i]%=br;for(r&&(c.unshift(r),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,zt?wt(t,f):t}function Ya(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Ho+e)}function Ba(e){var t,r,n,a=e.length-1,i="",s=e[0];if(a>0){for(i+=s,t=1;t<a;t++)n=e[t]+"",r=Tt-n.length,r&&(i+=hs(r)),i+=n;s=e[t],n=s+"",r=Tt-n.length,r&&(i+=hs(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return i+s}var ki=function(){function e(n,a){var i,s=0,l=n.length;for(n=n.slice();l--;)i=n[l]*a+s,n[l]=i%br|0,s=i/br|0;return s&&n.unshift(s),n}function t(n,a,i,s){var l,c;if(i!=s)c=i>s?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=a[l]){c=n[l]>a[l]?1:-1;break}return c}function r(n,a,i){for(var s=0;i--;)n[i]-=s,s=n[i]<a[i]?1:0,n[i]=s*br+n[i]-a[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,a,i,s){var l,c,u,d,f,h,p,m,g,y,x,v,b,j,w,k,N,_,P=n.constructor,C=n.s==a.s?1:-1,A=n.d,O=a.d;if(!n.s)return new P(n);if(!a.s)throw Error(aa+"Division by zero");for(c=n.e-a.e,N=O.length,w=A.length,p=new P(C),m=p.d=[],u=0;O[u]==(A[u]||0);)++u;if(O[u]>(A[u]||0)&&--c,i==null?v=i=P.precision:s?v=i+(cr(n)-cr(a))+1:v=i,v<0)return new P(0);if(v=v/Tt+2|0,u=0,N==1)for(d=0,O=O[0],v++;(u<w||d)&&v--;u++)b=d*br+(A[u]||0),m[u]=b/O|0,d=b%O|0;else{for(d=br/(O[0]+1)|0,d>1&&(O=e(O,d),A=e(A,d),N=O.length,w=A.length),j=N,g=A.slice(0,N),y=g.length;y<N;)g[y++]=0;_=O.slice(),_.unshift(0),k=O[0],O[1]>=br/2&&++k;do d=0,l=t(O,g,N,y),l<0?(x=g[0],N!=y&&(x=x*br+(g[1]||0)),d=x/k|0,d>1?(d>=br&&(d=br-1),f=e(O,d),h=f.length,y=g.length,l=t(f,g,h,y),l==1&&(d--,r(f,N<h?_:O,h))):(d==0&&(l=d=1),f=O.slice()),h=f.length,h<y&&f.unshift(0),r(g,f,y),l==-1&&(y=g.length,l=t(O,g,N,y),l<1&&(d++,r(g,N<y?_:O,y))),y=g.length):l===0&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[y++]=A[j]||0:(g=[A[j]],y=1);while((j++<w||g[0]!==void 0)&&v--)}return m[0]||m.shift(),p.e=c,wt(p,s?i+cr(p)+1:i)}}();function UU(e,t){var r,n,a,i,s,l,c=0,u=0,d=e.constructor,f=d.precision;if(cr(e)>16)throw Error(PC+cr(e));if(!e.s)return new d(kn);for(zt=!1,l=f,s=new d(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(n=Math.log(wo(2,u))/Math.LN10*2+5|0,l+=n,r=a=i=new d(kn),d.precision=l;;){if(a=wt(a.times(e),l),r=r.times(++c),s=i.plus(ki(a,r,l)),Ba(s.d).slice(0,l)===Ba(i.d).slice(0,l)){for(;u--;)i=wt(i.times(i),l);return d.precision=f,t==null?(zt=!0,wt(i,f)):i}i=s}}function cr(e){for(var t=e.e*Tt,r=e.d[0];r>=10;r/=10)t++;return t}function Ik(e,t,r){if(t>e.LN10.sd())throw zt=!0,r&&(e.precision=r),Error(aa+"LN10 precision limit exceeded");return wt(new e(e.LN10),t)}function hs(e){for(var t="";e--;)t+="0";return t}function sh(e,t){var r,n,a,i,s,l,c,u,d,f=1,h=10,p=e,m=p.d,g=p.constructor,y=g.precision;if(p.s<1)throw Error(aa+(p.s?"NaN":"-Infinity"));if(p.eq(kn))return new g(0);if(t==null?(zt=!1,u=y):u=t,p.eq(10))return t==null&&(zt=!0),Ik(g,u);if(u+=h,g.precision=u,r=Ba(m),n=r.charAt(0),i=cr(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=Ba(p.d),n=r.charAt(0),f++;i=cr(p),n>1?(p=new g("0."+r),i++):p=new g(n+"."+r.slice(1))}else return c=Ik(g,u+2,y).times(i+""),p=sh(new g(n+"."+r.slice(1)),u-h).plus(c),g.precision=y,t==null?(zt=!0,wt(p,y)):p;for(l=s=p=ki(p.minus(kn),p.plus(kn),u),d=wt(p.times(p),u),a=3;;){if(s=wt(s.times(d),u),c=l.plus(ki(s,new g(a),u)),Ba(c.d).slice(0,u)===Ba(l.d).slice(0,u))return l=l.times(2),i!==0&&(l=l.plus(Ik(g,u+2,y).times(i+""))),l=ki(l,new g(f),u),g.precision=y,t==null?(zt=!0,wt(l,y)):l;l=c,a+=2}}function xI(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Bu(r/Tt),e.d=[],n=(r+1)%Tt,r<0&&(n+=Tt),n<a){for(n&&e.d.push(+t.slice(0,n)),a-=Tt;n<a;)e.d.push(+t.slice(n,n+=Tt));t=t.slice(n),n=Tt-t.length}else n-=a;for(;n--;)t+="0";if(e.d.push(+t),zt&&(e.e>ig||e.e<-ig))throw Error(PC+r)}else e.s=0,e.e=0,e.d=[0];return e}function wt(e,t,r){var n,a,i,s,l,c,u,d,f=e.d;for(s=1,i=f[0];i>=10;i/=10)s++;if(n=t-s,n<0)n+=Tt,a=t,u=f[d=0];else{if(d=Math.ceil((n+1)/Tt),i=f.length,d>=i)return e;for(u=i=f[d],s=1;i>=10;i/=10)s++;n%=Tt,a=n-Tt+s}if(r!==void 0&&(i=wo(10,s-a-1),l=u/i%10|0,c=t<0||f[d+1]!==void 0||u%i,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?a>0?u/wo(10,s-a):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(i=cr(e),f.length=1,t=t-i-1,f[0]=wo(10,(Tt-t%Tt)%Tt),e.e=Bu(-t/Tt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,i=1,d--):(f.length=d+1,i=wo(10,Tt-n),f[d]=a>0?(u/wo(10,s-a)%wo(10,a)|0)*i:0),c)for(;;)if(d==0){(f[0]+=i)==br&&(f[0]=1,++e.e);break}else{if(f[d]+=i,f[d]!=br)break;f[d--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(zt&&(e.e>ig||e.e<-ig))throw Error(PC+cr(e));return e}function HU(e,t){var r,n,a,i,s,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),zt?wt(t,p):t;if(c=e.d,f=t.d,n=t.e,u=e.e,c=c.slice(),s=u-n,s){for(d=s<0,d?(r=c,s=-s,l=f.length):(r=f,n=u,l=c.length),a=Math.max(Math.ceil(p/Tt),l)+2,s>a&&(s=a,r.length=1),r.reverse(),a=s;a--;)r.push(0);r.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}s=0}for(d&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,a=f.length-l;a>0;--a)c[l++]=0;for(a=f.length;a>s;){if(c[--a]<f[a]){for(i=a;i&&c[--i]===0;)c[i]=br-1;--c[i],c[a]+=br}c[a]-=f[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,zt?wt(t,p):t):new h(0)}function cl(e,t,r){var n,a=cr(e),i=Ba(e.d),s=i.length;return t?(r&&(n=r-s)>0?i=i.charAt(0)+"."+i.slice(1)+hs(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+hs(-a-1)+i,r&&(n=r-s)>0&&(i+=hs(n))):a>=s?(i+=hs(a+1-s),r&&(n=r-a-1)>0&&(i=i+"."+hs(n))):((n=a+1)<s&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-s)>0&&(a+1===s&&(i+="."),i+=hs(n))),e.s<0?"-"+i:i}function yI(e,t){if(e.length>t)return e.length=t,!0}function WU(e){var t,r,n;function a(i){var s=this;if(!(s instanceof a))return new a(i);if(s.constructor=a,i instanceof a){s.s=i.s,s.e=i.e,s.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Ho+i);if(i>0)s.s=1;else if(i<0)i=-i,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(i===~~i&&i<1e7){s.e=0,s.d=[i];return}return xI(s,i.toString())}else if(typeof i!="string")throw Error(Ho+i);if(i.charCodeAt(0)===45?(i=i.slice(1),s.s=-1):s.s=1,Kje.test(i))xI(s,i);else throw Error(Ho+i)}if(a.prototype=be,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=WU,a.config=a.set=Yje,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return a.config(e),a}function Yje(e){if(!e||typeof e!="object")throw Error(aa+"Object expected");var t,r,n,a=["precision",1,Fu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((n=e[r=a[t]])!==void 0)if(Bu(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(Ho+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Ho+r+": "+n);return this}var CC=WU(Gje);kn=new CC(1);const bt=CC;function Xje(e){return eke(e)||Jje(e)||Qje(e)||Zje()}function Zje(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
685
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qje(e,t){if(e){if(typeof e=="string")return jS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jS(e,t)}}function Jje(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function eke(e){if(Array.isArray(e))return jS(e)}function jS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var tke=function(t){return t},GU={},KU=function(t){return t===GU},vI=function(t){return function r(){return arguments.length===0||arguments.length===1&&KU(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},rke=function e(t,r){return t===1?r:vI(function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var s=a.filter(function(l){return l!==GU}).length;return s>=t?r.apply(void 0,a):e(t-s,vI(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 KU(f)?c.shift():f});return r.apply(void 0,Xje(d).concat(c))}))})},iy=function(t){return rke(t.length,t)},kS=function(t,r){for(var n=[],a=t;a<r;++a)n[a-t]=a;return n},nke=iy(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),ake=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return tke;var a=r.reverse(),i=a[0],s=a.slice(1);return function(){return s.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},NS=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},YU=function(t){var r=null,n=null;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return r&&i.every(function(l,c){return l===r[c]})||(r=i,n=t.apply(void 0,i)),n}};function ike(e){var t;return e===0?t=1:t=Math.floor(new bt(e).abs().log(10).toNumber())+1,t}function ske(e,t,r){for(var n=new bt(e),a=0,i=[];n.lt(t)&&a<1e5;)i.push(n.toNumber()),n=n.add(r),a++;return i}var oke=iy(function(e,t,r){var n=+e,a=+t;return n+r*(a-n)}),lke=iy(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),cke=iy(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const sy={rangeStep:ske,getDigitCount:ike,interpolateNumber:oke,uninterpolateNumber:lke,uninterpolateTruncation:cke};function SS(e){return fke(e)||dke(e)||XU(e)||uke()}function uke(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
686
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dke(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function fke(e){if(Array.isArray(e))return _S(e)}function oh(e,t){return mke(e)||pke(e,t)||XU(e,t)||hke()}function hke(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
687
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XU(e,t){if(e){if(typeof e=="string")return _S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _S(e,t)}}function _S(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pke(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){a=!0,i=c}finally{try{!n&&s.return!=null&&s.return()}finally{if(a)throw i}}return r}}function mke(e){if(Array.isArray(e))return e}function ZU(e){var t=oh(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function QU(e,t,r){if(e.lte(0))return new bt(0);var n=sy.getDigitCount(e.toNumber()),a=new bt(10).pow(n),i=e.div(a),s=n!==1?.05:.1,l=new bt(Math.ceil(i.div(s).toNumber())).add(r).mul(s),c=l.mul(a);return t?c:new bt(Math.ceil(c))}function gke(e,t,r){var n=1,a=new bt(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new bt(10).pow(sy.getDigitCount(e)-1),a=new bt(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new bt(Math.floor(e)))}else e===0?a=new bt(Math.floor((t-1)/2)):r||(a=new bt(Math.floor(e)));var s=Math.floor((t-1)/2),l=ake(nke(function(c){return a.add(new bt(c-s).mul(n)).toNumber()}),kS);return l(0,t)}function JU(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new bt(0),tickMin:new bt(0),tickMax:new bt(0)};var i=QU(new bt(t).sub(e).div(r-1),n,a),s;e<=0&&t>=0?s=new bt(0):(s=new bt(e).add(t).div(2),s=s.sub(new bt(s).mod(i)));var l=Math.ceil(s.sub(e).div(i).toNumber()),c=Math.ceil(new bt(t).sub(s).div(i).toNumber()),u=l+c+1;return u>r?JU(e,t,r,n,a+1):(u<r&&(c=t>0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:i,tickMin:s.sub(new bt(l).mul(i)),tickMax:s.add(new bt(c).mul(i))})}function xke(e){var t=oh(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(a,2),l=ZU([r,n]),c=oh(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(SS(kS(0,a-1).map(function(){return 1/0}))):[].concat(SS(kS(0,a-1).map(function(){return-1/0})),[d]);return r>n?NS(f):f}if(u===d)return gke(u,a,i);var h=JU(u,d,s,i),p=h.step,m=h.tickMin,g=h.tickMax,y=sy.rangeStep(m,g.add(new bt(.1).mul(p)),p);return r>n?NS(y):y}function yke(e,t){var r=oh(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=ZU([n,a]),l=oh(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,a];if(c===u)return[c];var d=Math.max(t,2),f=QU(new bt(u).sub(c).div(d-1),i,0),h=[].concat(SS(sy.rangeStep(new bt(c),new bt(u).sub(new bt(.99).mul(f)),f)),[u]);return n>a?NS(h):h}var vke=YU(xke),bke=YU(yke),wke="Invariant failed";function ul(e,t){throw new Error(wke)}var jke=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function iu(e){"@babel/helpers - typeof";return iu=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},iu(e)}function sg(){return sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sg.apply(this,arguments)}function kke(e,t){return Eke(e)||_ke(e,t)||Ske(e,t)||Nke()}function Nke(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
688
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ske(e,t){if(e){if(typeof e=="string")return bI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bI(e,t)}}function bI(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _ke(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function Eke(e){if(Array.isArray(e))return e}function Pke(e,t){if(e==null)return{};var r=Cke(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Cke(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ake(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oke(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,rH(n.key),n)}}function Tke(e,t,r){return t&&Oke(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mke(e,t,r){return t=og(t),Rke(e,eH()?Reflect.construct(t,r||[],og(e).constructor):t.apply(e,r))}function Rke(e,t){if(t&&(iu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dke(e)}function Dke(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eH=function(){return!!e})()}function og(e){return og=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},og(e)}function $ke(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&&ES(e,t)}function ES(e,t){return ES=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},ES(e,t)}function tH(e,t,r){return t=rH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rH(e){var t=Ike(e,"string");return iu(t)=="symbol"?t:t+""}function Ike(e,t){if(iu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(iu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var tp=function(e){function t(){return Ake(this,t),Mke(this,t,arguments)}return $ke(t,e),Tke(t,[{key:"render",value:function(){var n=this.props,a=n.offset,i=n.layout,s=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,d=n.xAxis,f=n.yAxis,h=Pke(n,jke),p=Ue(h,!1);this.props.direction==="x"&&d.type!=="number"&&ul();var m=c.map(function(g){var y=u(g,l),x=y.x,v=y.y,b=y.value,j=y.errorVal;if(!j)return null;var w=[],k,N;if(Array.isArray(j)){var _=kke(j,2);k=_[0],N=_[1]}else k=N=j;if(i==="vertical"){var P=d.scale,C=v+a,A=C+s,O=C-s,T=P(b-k),E=P(b+N);w.push({x1:E,y1:A,x2:E,y2:O}),w.push({x1:T,y1:C,x2:E,y2:C}),w.push({x1:T,y1:A,x2:T,y2:O})}else if(i==="horizontal"){var R=f.scale,D=x+a,z=D-s,I=D+s,$=R(b-k),F=R(b+N);w.push({x1:z,y1:F,x2:I,y2:F}),w.push({x1:D,y1:$,x2:D,y2:F}),w.push({x1:z,y1:$,x2:I,y2:$})}return M.createElement(_t,sg({className:"recharts-errorBar",key:"bar-".concat(w.map(function(q){return"".concat(q.x1,"-").concat(q.x2,"-").concat(q.y1,"-").concat(q.y2)}))},p),w.map(function(q){return M.createElement("line",sg({},q,{key:"line-".concat(q.x1,"-").concat(q.x2,"-").concat(q.y1,"-").concat(q.y2)}))}))});return M.createElement(_t,{className:"recharts-errorBars"},m)}}])}(M.Component);tH(tp,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});tH(tp,"displayName","ErrorBar");function lh(e){"@babel/helpers - typeof";return lh=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},lh(e)}function wI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ho(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wI(Object(r),!0).forEach(function(n){Lke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Lke(e,t,r){return t=zke(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zke(e){var t=Fke(e,"string");return lh(t)=="symbol"?t:t+""}function Fke(e,t){if(lh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(lh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nH=function(t){var r=t.children,n=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,s=yn(r,zs);if(!s)return null;var l=zs.defaultProps,c=l!==void 0?ho(ho({},l),s.props):{},u;return s.props&&s.props.payload?u=s.props&&s.props.payload:i==="children"?u=(n||[]).reduce(function(d,f){var h=f.item,p=f.props,m=p.sectors||p.data||[];return d.concat(m.map(function(g){return{type:s.props.iconType||h.props.legendType,value:g.name,color:g.fill,payload:g}}))},[]):u=(n||[]).map(function(d){var f=d.item,h=f.type.defaultProps,p=h!==void 0?ho(ho({},h),f.props):{},m=p.dataKey,g=p.name,y=p.legendType,x=p.hide;return{inactive:x,dataKey:m,type:c.iconType||y||"square",color:AC(f),value:g||m,payload:p}}),ho(ho(ho({},c),zs.getWithHeight(s,a)),{},{payload:u,item:s})};function ch(e){"@babel/helpers - typeof";return ch=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},ch(e)}function jI(e){return Uke(e)||qke(e)||Vke(e)||Bke()}function Bke(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
689
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vke(e,t){if(e){if(typeof e=="string")return PS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return PS(e,t)}}function qke(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Uke(e){if(Array.isArray(e))return PS(e)}function PS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Yt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kI(Object(r),!0).forEach(function(n){Pc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pc(e,t,r){return t=Hke(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hke(e){var t=Wke(e,"string");return ch(t)=="symbol"?t:t+""}function Wke(e,t){if(ch(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ch(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qr(e,t,r){return Ge(e)||Ge(t)?r:gr(t)?Jn(e,t,r):Be(t)?t(e):r}function af(e,t,r,n){var a=qje(e,function(l){return Qr(l,t)});if(r==="number"){var i=a.filter(function(l){return ue(l)||parseFloat(l)});return i.length?[ay(i),Es(i)]:[1/0,-1/0]}var s=n?a.filter(function(l){return!Ge(l)}):a;return s.map(function(l){return gr(l)||l instanceof Date?l:""})}var Gke=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,s=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.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(ka(f-d)!==ka(h-f)){var m=[];if(ka(h-f)===ka(c[1]-c[0])){p=h;var g=f+c[1]-c[0];m[0]=Math.min(g,(g+d)/2),m[1]=Math.max(g,(g+d)/2)}else{p=d;var y=h+c[1]-c[0];m[0]=Math.min(f,(y+f)/2),m[1]=Math.max(f,(y+f)/2)}var x=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>x[0]&&t<=x[1]||t>=m[0]&&t<=m[1]){s=a[u].index;break}}else{var v=Math.min(d,h),b=Math.max(d,h);if(t>(v+f)/2&&t<=(b+f)/2){s=a[u].index;break}}}else for(var j=0;j<l;j++)if(j===0&&t<=(n[j].coordinate+n[j+1].coordinate)/2||j>0&&j<l-1&&t>(n[j].coordinate+n[j-1].coordinate)/2&&t<=(n[j].coordinate+n[j+1].coordinate)/2||j===l-1&&t>(n[j].coordinate+n[j-1].coordinate)/2){s=n[j].index;break}return s},AC=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Yt(Yt({},t.type.defaultProps),t.props):t.props,s=i.stroke,l=i.fill,c;switch(a){case"Line":c=s;break;case"Area":case"Radar":c=s&&s!=="none"?s:l;break;default:c=l;break}return c},Kke=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var s={},l=Object.keys(i),c=0,u=l.length;c<u;c++)for(var d=i[l[c]].stackGroups,f=Object.keys(d),h=0,p=f.length;h<p;h++){var m=d[f[h]],g=m.items,y=m.cateAxisId,x=g.filter(function(N){return wi(N.type).indexOf("Bar")>=0});if(x&&x.length){var v=x[0].type.defaultProps,b=v!==void 0?Yt(Yt({},v),x[0].props):x[0].props,j=b.barSize,w=b[y];s[w]||(s[w]=[]);var k=Ge(j)?r:j;s[w].push({item:x[0],stackList:x.slice(1),barSize:Ge(k)?void 0:ll(k,n,0)})}}return s},Yke=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,s=i===void 0?[]:i,l=t.maxBarSize,c=s.length;if(c<1)return null;var u=ll(r,a,0,!0),d,f=[];if(s[0].barSize===+s[0].barSize){var h=!1,p=a/c,m=s.reduce(function(j,w){return j+w.barSize||0},0);m+=(c-1)*u,m>=a&&(m-=(c-1)*u,u=0),m>=a&&p>0&&(h=!0,p*=.9,m=c*p);var g=(a-m)/2>>0,y={offset:g-u,size:0};d=s.reduce(function(j,w){var k={item:w.item,position:{offset:y.offset+y.size+u,size:h?p:w.barSize}},N=[].concat(jI(j),[k]);return y=N[N.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(_){N.push({item:_,position:y})}),N},f)}else{var x=ll(n,a,0,!0);a-2*x-(c-1)*u<=0&&(u=0);var v=(a-2*x-(c-1)*u)/c;v>1&&(v>>=0);var b=l===+l?Math.min(v,l):v;d=s.reduce(function(j,w,k){var N=[].concat(jI(j),[{item:w.item,position:{offset:x+(v+u)*k+(v-b)/2,size:b}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(_){N.push({item:_,position:N[N.length-1].position})}),N},f)}return d},Xke=function(t,r,n,a){var i=n.children,s=n.width,l=n.margin,c=s-(l.left||0)-(l.right||0),u=nH({children:i,legendWidth:c});if(u){var d=a||{},f=d.width,h=d.height,p=u.align,m=u.verticalAlign,g=u.layout;if((g==="vertical"||g==="horizontal"&&m==="middle")&&p!=="center"&&ue(t[p]))return Yt(Yt({},t),{},Pc({},p,t[p]+(f||0)));if((g==="horizontal"||g==="vertical"&&p==="center")&&m!=="middle"&&ue(t[m]))return Yt(Yt({},t),{},Pc({},m,t[m]+(h||0)))}return t},Zke=function(t,r,n){return Ge(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},aH=function(t,r,n,a,i){var s=r.props.children,l=ea(s,tp).filter(function(u){return Zke(a,i,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=Qr(d,n);if(Ge(f))return u;var h=Array.isArray(f)?[ay(f),Es(f)]:[f,f],p=c.reduce(function(m,g){var y=Qr(d,g,0),x=h[0]-Math.abs(Array.isArray(y)?y[0]:y),v=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(x,m[0]),Math.max(v,m[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},Qke=function(t,r,n,a,i){var s=r.map(function(l){return aH(t,l,n,i,a)}).filter(function(l){return!Ge(l)});return s&&s.length?s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},iH=function(t,r,n,a,i){var s=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&aH(t,c,u,a)||af(t,u,n,i)});if(n==="number")return s.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return s.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},[])},sH=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},oH=function(t,r,n,a){if(a)return t.map(function(c){return c.coordinate});var i,s,l=t.map(function(c){return c.coordinate===r&&(i=!0),c.coordinate===n&&(s=!0),c.coordinate});return i||l.push(r),s||l.push(n),l},mi=function(t,r,n){if(!t)return null;var a=t.scale,i=t.duplicateDomain,s=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(r||n)&&s==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?ka(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=i?i.indexOf(f):f;return{coordinate:a(h)+u,value:f,offset:u}});return d.filter(function(f){return!Lu(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&&!n?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:i?i[f]:f,index:h,offset:u}})},Lk=new WeakMap,Xp=function(t,r){if(typeof r!="function")return t;Lk.has(t)||Lk.set(t,new WeakMap);var n=Lk.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},Jke=function(t,r,n){var a=t.scale,i=t.type,s=t.layout,l=t.axisType;if(a==="auto")return s==="radial"&&l==="radiusAxis"?{scale:ah(),realScaleType:"band"}:s==="radial"&&l==="angleAxis"?{scale:tg(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:nf(),realScaleType:"point"}:i==="category"?{scale:ah(),realScaleType:"band"}:{scale:tg(),realScaleType:"linear"};if(ol(a)){var c="scale".concat(Wx(a));return{scale:(gI[c]||nf)(),realScaleType:gI[c]?c:"point"}}return Be(a)?{scale:a}:{scale:nf(),realScaleType:"point"}},NI=1e-4,e2e=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-NI,s=Math.max(a[0],a[1])+NI,l=t(r[0]),c=t(r[n-1]);(l<i||l>s||c<i||c>s)&&t.domain([r[0],r[n-1]])}},t2e=function(t,r){if(!t)return null;for(var n=0,a=t.length;n<a;n++)if(t[n].item===r)return t[n].position;return null},r2e=function(t,r){if(!r||r.length!==2||!ue(r[0])||!ue(r[1]))return t;var n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]),i=[t[0],t[1]];return(!ue(t[0])||t[0]<n)&&(i[0]=n),(!ue(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<n&&(i[1]=n),i},n2e=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,s=0,l=0;l<r;++l){var c=Lu(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=i,t[l][n][1]=i+c,i=t[l][n][1]):(t[l][n][0]=s,t[l][n][1]=s+c,s=t[l][n][1])}},a2e=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,s=0;s<r;++s){var l=Lu(t[s][n][1])?t[s][n][0]:t[s][n][1];l>=0?(t[s][n][0]=i,t[s][n][1]=i+l,i=t[s][n][1]):(t[s][n][0]=0,t[s][n][1]=0)}},i2e={sign:n2e,expand:xve,none:Xc,silhouette:yve,wiggle:vve,positive:a2e},s2e=function(t,r,n){var a=r.map(function(l){return l.props.dataKey}),i=i2e[n],s=gve().keys(a).value(function(l,c){return+Qr(l,c,0)}).order(sS).offset(i);return s(t)},o2e=function(t,r,n,a,i,s){if(!t)return null;var l=s?r.reverse():r,c={},u=l.reduce(function(f,h){var p,m=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Yt(Yt({},h.type.defaultProps),h.props):h.props,g=m.stackId,y=m.hide;if(y)return f;var x=m[n],v=f[x]||{hasStack:!1,stackGroups:{}};if(gr(g)){var b=v.stackGroups[g]||{numericAxisId:n,cateAxisId:a,items:[]};b.items.push(h),v.hasStack=!0,v.stackGroups[g]=b}else v.stackGroups[zu("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[h]};return Yt(Yt({},f),{},Pc({},x,v))},c),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var m={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(g,y){var x=p.stackGroups[y];return Yt(Yt({},g),{},Pc({},y,{numericAxisId:n,cateAxisId:a,items:x.items,stackedData:s2e(t,x.items,i)}))},m)}return Yt(Yt({},f),{},Pc({},h,p))},d)},l2e=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,s=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&a==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=vke(u,i,l);return t.domain([ay(d),Es(d)]),{niceTicks:d}}if(i&&a==="number"){var f=t.domain(),h=bke(f,i,l);return{niceTicks:h}}return null};function lg(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ge(a[t.dataKey])){var l=L0(r,"value",a[t.dataKey]);if(l)return l.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var c=Qr(a,Ge(s)?t.dataKey:s);return Ge(c)?null:t.scale(c)}var SI=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,s=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+a:null;var c=Qr(s,r.dataKey,r.domain[l]);return Ge(c)?null:r.scale(c)-i/2+a},c2e=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},u2e=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Yt(Yt({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(gr(i)){var s=r[i];if(s){var l=s.items.indexOf(t);return l>=0?s.stackedData[l]:null}}return null},d2e=function(t){return t.reduce(function(r,n){return[ay(n.concat([r[0]]).filter(ue)),Es(n.concat([r[1]]).filter(ue))]},[1/0,-1/0])},lH=function(t,r,n){return Object.keys(t).reduce(function(a,i){var s=t[i],l=s.stackedData,c=l.reduce(function(u,d){var f=d2e(d.slice(r,n+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})},_I=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,EI=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,CS=function(t,r,n){if(Be(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(ue(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(_I.test(t[0])){var i=+_I.exec(t[0])[1];a[0]=r[0]-i}else Be(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(ue(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(EI.test(t[1])){var s=+EI.exec(t[1])[1];a[1]=r[1]+s}else Be(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},cg=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=sC(r,function(f){return f.coordinate}),s=1/0,l=1,c=i.length;l<c;l++){var u=i[l],d=i[l-1];s=Math.min((u.coordinate||0)-(d.coordinate||0),s)}return s===1/0?0:s}return n?void 0:0},PI=function(t,r,n){return!t||!t.length||au(t,Jn(n,"type.defaultProps.domain"))?r:t},cH=function(t,r){var n=t.type.defaultProps?Yt(Yt({},t.type.defaultProps),t.props):t.props,a=n.dataKey,i=n.name,s=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,d=n.hide;return Yt(Yt({},Ue(t,!1)),{},{dataKey:a,unit:s,formatter:l,name:i||a,color:AC(t),value:Qr(r,a),type:c,payload:r,chartType:u,hide:d})};function uh(e){"@babel/helpers - typeof";return uh=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},uh(e)}function CI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function AI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?CI(Object(r),!0).forEach(function(n){f2e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function f2e(e,t,r){return t=h2e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h2e(e){var t=p2e(e,"string");return uh(t)=="symbol"?t:t+""}function p2e(e,t){if(uh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(uh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ug=Math.PI/180,m2e=function(t){return t*180/Math.PI},Tr=function(t,r,n,a){return{x:t+Math.cos(-ug*a)*n,y:r+Math.sin(-ug*a)*n}},g2e=function(t,r){var n=t.x,a=t.y,i=r.x,s=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-s,2))},x2e=function(t,r){var n=t.x,a=t.y,i=r.cx,s=r.cy,l=g2e({x:n,y:a},{x:i,y:s});if(l<=0)return{radius:l};var c=(n-i)/l,u=Math.acos(c);return a>s&&(u=2*Math.PI-u),{radius:l,angle:m2e(u),angleInRadian:u}},y2e=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),s=Math.min(a,i);return{startAngle:r-s*360,endAngle:n-s*360}},v2e=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),s=Math.floor(a/360),l=Math.min(i,s);return t+l*360},OI=function(t,r){var n=t.x,a=t.y,i=x2e({x:n,y:a},r),s=i.radius,l=i.angle,c=r.innerRadius,u=r.outerRadius;if(s<c||s>u)return!1;if(s===0)return!0;var d=y2e(r),f=d.startAngle,h=d.endAngle,p=l,m;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;m=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;m=p>=h&&p<=f}return m?AI(AI({},r),{},{radius:s,angle:v2e(p,r)}):null};function dh(e){"@babel/helpers - typeof";return dh=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},dh(e)}var b2e=["offset"];function w2e(e){return S2e(e)||N2e(e)||k2e(e)||j2e()}function j2e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
690
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k2e(e,t){if(e){if(typeof e=="string")return AS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return AS(e,t)}}function N2e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function S2e(e){if(Array.isArray(e))return AS(e)}function AS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _2e(e,t){if(e==null)return{};var r=E2e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function E2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function TI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function hr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?TI(Object(r),!0).forEach(function(n){P2e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function P2e(e,t,r){return t=C2e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C2e(e){var t=A2e(e,"string");return dh(t)=="symbol"?t:t+""}function A2e(e,t){if(dh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(dh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fh(){return fh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fh.apply(this,arguments)}var O2e=function(t){var r=t.value,n=t.formatter,a=Ge(t.children)?r:t.children;return Be(n)?n(a):a},T2e=function(t,r){var n=ka(r-t),a=Math.min(Math.abs(r-t),360);return n*a},M2e=function(t,r,n){var a=t.position,i=t.viewBox,s=t.offset,l=t.className,c=i,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,p=c.startAngle,m=c.endAngle,g=c.clockWise,y=(f+h)/2,x=T2e(p,m),v=x>=0?1:-1,b,j;a==="insideStart"?(b=p+v*s,j=g):a==="insideEnd"?(b=m-v*s,j=!g):a==="end"&&(b=m+v*s,j=g),j=x<=0?j:!j;var w=Tr(u,d,y,b),k=Tr(u,d,y,b+(j?1:-1)*359),N="M".concat(w.x,",").concat(w.y,`
691
+ A`).concat(y,",").concat(y,",0,1,").concat(j?0:1,`,
692
+ `).concat(k.x,",").concat(k.y),_=Ge(t.id)?zu("recharts-radial-line-"):t.id;return M.createElement("text",fh({},n,{dominantBaseline:"central",className:tt("recharts-radial-bar-label",l)}),M.createElement("defs",null,M.createElement("path",{id:_,d:N})),M.createElement("textPath",{xlinkHref:"#".concat(_)},r))},R2e=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,s=i.cx,l=i.cy,c=i.innerRadius,u=i.outerRadius,d=i.startAngle,f=i.endAngle,h=(d+f)/2;if(a==="outside"){var p=Tr(s,l,u+n,h),m=p.x,g=p.y;return{x:m,y:g,textAnchor:m>=s?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"end"};var y=(c+u)/2,x=Tr(s,l,y,h),v=x.x,b=x.y;return{x:v,y:b,textAnchor:"middle",verticalAnchor:"middle"}},D2e=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,s=r,l=s.x,c=s.y,u=s.width,d=s.height,f=d>=0?1:-1,h=f*a,p=f>0?"end":"start",m=f>0?"start":"end",g=u>=0?1:-1,y=g*a,x=g>0?"end":"start",v=g>0?"start":"end";if(i==="top"){var b={x:l+u/2,y:c-f*a,textAnchor:"middle",verticalAnchor:p};return hr(hr({},b),n?{height:Math.max(c-n.y,0),width:u}:{})}if(i==="bottom"){var j={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:m};return hr(hr({},j),n?{height:Math.max(n.y+n.height-(c+d),0),width:u}:{})}if(i==="left"){var w={x:l-y,y:c+d/2,textAnchor:x,verticalAnchor:"middle"};return hr(hr({},w),n?{width:Math.max(w.x-n.x,0),height:d}:{})}if(i==="right"){var k={x:l+u+y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return hr(hr({},k),n?{width:Math.max(n.x+n.width-k.x,0),height:d}:{})}var N=n?{width:u,height:d}:{};return i==="insideLeft"?hr({x:l+y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},N):i==="insideRight"?hr({x:l+u-y,y:c+d/2,textAnchor:x,verticalAnchor:"middle"},N):i==="insideTop"?hr({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:m},N):i==="insideBottom"?hr({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},N):i==="insideTopLeft"?hr({x:l+y,y:c+h,textAnchor:v,verticalAnchor:m},N):i==="insideTopRight"?hr({x:l+u-y,y:c+h,textAnchor:x,verticalAnchor:m},N):i==="insideBottomLeft"?hr({x:l+y,y:c+d-h,textAnchor:v,verticalAnchor:p},N):i==="insideBottomRight"?hr({x:l+u-y,y:c+d-h,textAnchor:x,verticalAnchor:p},N):Iu(i)&&(ue(i.x)||Ro(i.x))&&(ue(i.y)||Ro(i.y))?hr({x:l+ll(i.x,u),y:c+ll(i.y,d),textAnchor:"end",verticalAnchor:"end"},N):hr({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},N)},$2e=function(t){return"cx"in t&&ue(t.cx)};function Fr(e){var t=e.offset,r=t===void 0?5:t,n=_2e(e,b2e),a=hr({offset:r},n),i=a.viewBox,s=a.position,l=a.value,c=a.children,u=a.content,d=a.className,f=d===void 0?"":d,h=a.textBreakAll;if(!i||Ge(l)&&Ge(c)&&!S.isValidElement(u)&&!Be(u))return null;if(S.isValidElement(u))return S.cloneElement(u,a);var p;if(Be(u)){if(p=S.createElement(u,a),S.isValidElement(p))return p}else p=O2e(a);var m=$2e(i),g=Ue(a,!0);if(m&&(s==="insideStart"||s==="insideEnd"||s==="end"))return M2e(a,p,g);var y=m?R2e(a):D2e(a);return M.createElement(Z0,fh({className:tt("recharts-label",f)},g,y,{breakAll:h}),p)}Fr.displayName="Label";var uH=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,s=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,p=t.top,m=t.left,g=t.width,y=t.height,x=t.clockWise,v=t.labelViewBox;if(v)return v;if(ue(g)&&ue(y)){if(ue(f)&&ue(h))return{x:f,y:h,width:g,height:y};if(ue(p)&&ue(m))return{x:p,y:m,width:g,height:y}}return ue(f)&&ue(h)?{x:f,y:h,width:0,height:0}:ue(r)&&ue(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:s||a||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:x}:t.viewBox?t.viewBox:{}},I2e=function(t,r){return t?t===!0?M.createElement(Fr,{key:"label-implicit",viewBox:r}):gr(t)?M.createElement(Fr,{key:"label-implicit",viewBox:r,value:t}):S.isValidElement(t)?t.type===Fr?S.cloneElement(t,{key:"label-implicit",viewBox:r}):M.createElement(Fr,{key:"label-implicit",content:t,viewBox:r}):Be(t)?M.createElement(Fr,{key:"label-implicit",content:t,viewBox:r}):Iu(t)?M.createElement(Fr,fh({viewBox:r},t,{key:"label-implicit"})):null:null},L2e=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=uH(t),s=ea(a,Fr).map(function(c,u){return S.cloneElement(c,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return s;var l=I2e(t.label,r||i);return[l].concat(w2e(s))};Fr.parseViewBox=uH;Fr.renderCallByParent=L2e;var z2e=RV();const F2e=lt(z2e);function hh(e){"@babel/helpers - typeof";return hh=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},hh(e)}var B2e=["valueAccessor"],V2e=["data","dataKey","clockWise","id","textBreakAll"];function q2e(e){return G2e(e)||W2e(e)||H2e(e)||U2e()}function U2e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
693
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function H2e(e,t){if(e){if(typeof e=="string")return OS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return OS(e,t)}}function W2e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function G2e(e){if(Array.isArray(e))return OS(e)}function OS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dg(){return dg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dg.apply(this,arguments)}function MI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function RI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MI(Object(r),!0).forEach(function(n){K2e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function K2e(e,t,r){return t=Y2e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Y2e(e){var t=X2e(e,"string");return hh(t)=="symbol"?t:t+""}function X2e(e,t){if(hh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(hh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DI(e,t){if(e==null)return{};var r=Z2e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Z2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Q2e=function(t){return Array.isArray(t.value)?F2e(t.value):t.value};function Ni(e){var t=e.valueAccessor,r=t===void 0?Q2e:t,n=DI(e,B2e),a=n.data,i=n.dataKey,s=n.clockWise,l=n.id,c=n.textBreakAll,u=DI(n,V2e);return!a||!a.length?null:M.createElement(_t,{className:"recharts-label-list"},a.map(function(d,f){var h=Ge(i)?r(d,f):Qr(d&&d.payload,i),p=Ge(l)?{}:{id:"".concat(l,"-").concat(f)};return M.createElement(Fr,dg({},Ue(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:Fr.parseViewBox(Ge(s)?d:RI(RI({},d),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}Ni.displayName="LabelList";function J2e(e,t){return e?e===!0?M.createElement(Ni,{key:"labelList-implicit",data:t}):M.isValidElement(e)||Be(e)?M.createElement(Ni,{key:"labelList-implicit",data:t,content:e}):Iu(e)?M.createElement(Ni,dg({data:t},e,{key:"labelList-implicit"})):null:null}function eNe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=ea(n,Ni).map(function(s,l){return S.cloneElement(s,{data:t,key:"labelList-".concat(l)})});if(!r)return a;var i=J2e(e.label,t);return[i].concat(q2e(a))}Ni.renderCallByParent=eNe;function ph(e){"@babel/helpers - typeof";return ph=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},ph(e)}function TS(){return TS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TS.apply(this,arguments)}function $I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function II(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$I(Object(r),!0).forEach(function(n){tNe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$I(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tNe(e,t,r){return t=rNe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rNe(e){var t=nNe(e,"string");return ph(t)=="symbol"?t:t+""}function nNe(e,t){if(ph(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ph(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aNe=function(t,r){var n=ka(r-t),a=Math.min(Math.abs(r-t),359.999);return n*a},Zp=function(t){var r=t.cx,n=t.cy,a=t.radius,i=t.angle,s=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+a,f=Math.asin(c/d)/ug,h=u?i:i+s*f,p=Tr(r,n,d,h),m=Tr(r,n,a,h),g=u?i-s*f:i,y=Tr(r,n,d*Math.cos(f*ug),g);return{center:p,circleTangency:m,lineTangency:y,theta:f}},dH=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,s=t.startAngle,l=t.endAngle,c=aNe(s,l),u=s+c,d=Tr(r,n,i,s),f=Tr(r,n,i,u),h="M ".concat(d.x,",").concat(d.y,`
694
+ A `).concat(i,",").concat(i,`,0,
695
+ `).concat(+(Math.abs(c)>180),",").concat(+(s>u),`,
696
+ `).concat(f.x,",").concat(f.y,`
697
+ `);if(a>0){var p=Tr(r,n,a,s),m=Tr(r,n,a,u);h+="L ".concat(m.x,",").concat(m.y,`
698
+ A `).concat(a,",").concat(a,`,0,
699
+ `).concat(+(Math.abs(c)>180),",").concat(+(s<=u),`,
700
+ `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},iNe=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,s=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=ka(d-u),h=Zp({cx:r,cy:n,radius:i,angle:u,sign:f,cornerRadius:s,cornerIsExternal:c}),p=h.circleTangency,m=h.lineTangency,g=h.theta,y=Zp({cx:r,cy:n,radius:i,angle:d,sign:-f,cornerRadius:s,cornerIsExternal:c}),x=y.circleTangency,v=y.lineTangency,b=y.theta,j=c?Math.abs(u-d):Math.abs(u-d)-g-b;if(j<0)return l?"M ".concat(m.x,",").concat(m.y,`
701
+ a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0
702
+ a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0
703
+ `):dH({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:d});var w="M ".concat(m.x,",").concat(m.y,`
704
+ A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,`
705
+ A`).concat(i,",").concat(i,",0,").concat(+(j>180),",").concat(+(f<0),",").concat(x.x,",").concat(x.y,`
706
+ A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(v.x,",").concat(v.y,`
707
+ `);if(a>0){var k=Zp({cx:r,cy:n,radius:a,angle:u,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),N=k.circleTangency,_=k.lineTangency,P=k.theta,C=Zp({cx:r,cy:n,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),A=C.circleTangency,O=C.lineTangency,T=C.theta,E=c?Math.abs(u-d):Math.abs(u-d)-P-T;if(E<0&&s===0)return"".concat(w,"L").concat(r,",").concat(n,"Z");w+="L".concat(O.x,",").concat(O.y,`
708
+ A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(A.x,",").concat(A.y,`
709
+ A`).concat(a,",").concat(a,",0,").concat(+(E>180),",").concat(+(f>0),",").concat(N.x,",").concat(N.y,`
710
+ A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(_.x,",").concat(_.y,"Z")}else w+="L".concat(r,",").concat(n,"Z");return w},sNe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},fH=function(t){var r=II(II({},sNe),t),n=r.cx,a=r.cy,i=r.innerRadius,s=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,f=r.endAngle,h=r.className;if(s<i||d===f)return null;var p=tt("recharts-sector",h),m=s-i,g=ll(l,m,0,!0),y;return g>0&&Math.abs(d-f)<360?y=iNe({cx:n,cy:a,innerRadius:i,outerRadius:s,cornerRadius:Math.min(g,m/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):y=dH({cx:n,cy:a,innerRadius:i,outerRadius:s,startAngle:d,endAngle:f}),M.createElement("path",TS({},Ue(r,!0),{className:p,d:y,role:"img"}))};function mh(e){"@babel/helpers - typeof";return mh=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},mh(e)}function MS(){return MS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MS.apply(this,arguments)}function LI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function zI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LI(Object(r),!0).forEach(function(n){oNe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oNe(e,t,r){return t=lNe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lNe(e){var t=cNe(e,"string");return mh(t)=="symbol"?t:t+""}function cNe(e,t){if(mh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(mh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var FI={curveBasisClosed:ive,curveBasisOpen:sve,curveBasis:ave,curveBumpX:Uye,curveBumpY:Hye,curveLinearClosed:ove,curveLinear:Kx,curveMonotoneX:lve,curveMonotoneY:cve,curveNatural:uve,curveStep:dve,curveStepAfter:hve,curveStepBefore:fve},Qp=function(t){return t.x===+t.x&&t.y===+t.y},gd=function(t){return t.x},xd=function(t){return t.y},uNe=function(t,r){if(Be(t))return t;var n="curve".concat(Wx(t));return(n==="curveMonotone"||n==="curveBump")&&r?FI["".concat(n).concat(r==="vertical"?"Y":"X")]:FI[n]||Kx},dNe=function(t){var r=t.type,n=r===void 0?"linear":r,a=t.points,i=a===void 0?[]:a,s=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=uNe(n,l),f=u?i.filter(function(g){return Qp(g)}):i,h;if(Array.isArray(s)){var p=u?s.filter(function(g){return Qp(g)}):s,m=f.map(function(g,y){return zI(zI({},g),{},{base:p[y]})});return l==="vertical"?h=Hp().y(xd).x1(gd).x0(function(g){return g.base.x}):h=Hp().x(gd).y1(xd).y0(function(g){return g.base.y}),h.defined(Qp).curve(d),h(m)}return l==="vertical"&&ue(s)?h=Hp().y(xd).x1(gd).x0(s):ue(s)?h=Hp().x(gd).y1(xd).y0(s):h=Fq().x(gd).y(xd),h.defined(Qp).curve(d),h(f)},Cc=function(t){var r=t.className,n=t.points,a=t.path,i=t.pathRef;if((!n||!n.length)&&!a)return null;var s=n&&n.length?dNe(t):a;return S.createElement("path",MS({},Ue(t,!1),z0(t),{className:tt("recharts-curve",r),d:s,ref:i}))},hH={exports:{}},fNe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",hNe=fNe,pNe=hNe;function pH(){}function mH(){}mH.resetWarningCache=pH;var mNe=function(){function e(n,a,i,s,l,c){if(c!==pNe){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 r={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:mH,resetWarningCache:pH};return r.PropTypes=r,r};hH.exports=mNe();var gNe=hH.exports;const dt=lt(gNe);var xNe=Object.getOwnPropertyNames,yNe=Object.getOwnPropertySymbols,vNe=Object.prototype.hasOwnProperty;function BI(e,t){return function(n,a,i){return e(n,a,i)&&t(n,a,i)}}function Jp(e){return function(r,n,a){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,a);var i=a.cache,s=i.get(r),l=i.get(n);if(s&&l)return s===n&&l===r;i.set(r,n),i.set(n,r);var c=e(r,n,a);return i.delete(r),i.delete(n),c}}function bNe(e){return e!=null?e[Symbol.toStringTag]:void 0}function VI(e){return xNe(e).concat(yNe(e))}var wNe=Object.hasOwn||function(e,t){return vNe.call(e,t)};function Nl(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var jNe="__v",kNe="__o",NNe="_owner",qI=Object.getOwnPropertyDescriptor,UI=Object.keys;function SNe(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function _Ne(e,t){return Nl(e.getTime(),t.getTime())}function ENe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function PNe(e,t){return e===t}function HI(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var a=new Array(n),i=e.entries(),s,l,c=0;(s=i.next())&&!s.done;){for(var u=t.entries(),d=!1,f=0;(l=u.next())&&!l.done;){if(a[f]){f++;continue}var h=s.value,p=l.value;if(r.equals(h[0],p[0],c,f,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){d=a[f]=!0;break}f++}if(!d)return!1;c++}return!0}var CNe=Nl;function ANe(e,t,r){var n=UI(e),a=n.length;if(UI(t).length!==a)return!1;for(;a-- >0;)if(!gH(e,t,r,n[a]))return!1;return!0}function yd(e,t,r){var n=VI(e),a=n.length;if(VI(t).length!==a)return!1;for(var i,s,l;a-- >0;)if(i=n[a],!gH(e,t,r,i)||(s=qI(e,i),l=qI(t,i),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function ONe(e,t){return Nl(e.valueOf(),t.valueOf())}function TNe(e,t){return e.source===t.source&&e.flags===t.flags}function WI(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var a=new Array(n),i=e.values(),s,l;(s=i.next())&&!s.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!a[d]&&r.equals(s.value,l.value,s.value,l.value,e,t,r)){u=a[d]=!0;break}d++}if(!u)return!1}return!0}function MNe(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function RNe(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 gH(e,t,r,n){return(n===NNe||n===kNe||n===jNe)&&(e.$$typeof||t.$$typeof)?!0:wNe(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var DNe="[object Arguments]",$Ne="[object Boolean]",INe="[object Date]",LNe="[object Error]",zNe="[object Map]",FNe="[object Number]",BNe="[object Object]",VNe="[object RegExp]",qNe="[object Set]",UNe="[object String]",HNe="[object URL]",WNe=Array.isArray,GI=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,KI=Object.assign,GNe=Object.prototype.toString.call.bind(Object.prototype.toString);function KNe(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,a=e.areFunctionsEqual,i=e.areMapsEqual,s=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,h=e.areUrlsEqual,p=e.unknownTagComparators;return function(g,y,x){if(g===y)return!0;if(g==null||y==null)return!1;var v=typeof g;if(v!==typeof y)return!1;if(v!=="object")return v==="number"?s(g,y,x):v==="function"?a(g,y,x):!1;var b=g.constructor;if(b!==y.constructor)return!1;if(b===Object)return l(g,y,x);if(WNe(g))return t(g,y,x);if(GI!=null&&GI(g))return f(g,y,x);if(b===Date)return r(g,y,x);if(b===RegExp)return u(g,y,x);if(b===Map)return i(g,y,x);if(b===Set)return d(g,y,x);var j=GNe(g);if(j===INe)return r(g,y,x);if(j===VNe)return u(g,y,x);if(j===zNe)return i(g,y,x);if(j===qNe)return d(g,y,x);if(j===BNe)return typeof g.then!="function"&&typeof y.then!="function"&&l(g,y,x);if(j===HNe)return h(g,y,x);if(j===LNe)return n(g,y,x);if(j===DNe)return l(g,y,x);if(j===$Ne||j===FNe||j===UNe)return c(g,y,x);if(p){var w=p[j];if(!w){var k=bNe(g);k&&(w=p[k])}if(w)return w(g,y,x)}return!1}}function YNe(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,a={areArraysEqual:n?yd:SNe,areDatesEqual:_Ne,areErrorsEqual:ENe,areFunctionsEqual:PNe,areMapsEqual:n?BI(HI,yd):HI,areNumbersEqual:CNe,areObjectsEqual:n?yd:ANe,arePrimitiveWrappersEqual:ONe,areRegExpsEqual:TNe,areSetsEqual:n?BI(WI,yd):WI,areTypedArraysEqual:n?yd:MNe,areUrlsEqual:RNe,unknownTagComparators:void 0};if(r&&(a=KI({},a,r(a))),t){var i=Jp(a.areArraysEqual),s=Jp(a.areMapsEqual),l=Jp(a.areObjectsEqual),c=Jp(a.areSetsEqual);a=KI({},a,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:l,areSetsEqual:c})}return a}function XNe(e){return function(t,r,n,a,i,s,l){return e(t,r,l)}}function ZNe(e){var t=e.circular,r=e.comparator,n=e.createState,a=e.equals,i=e.strict;if(n)return function(c,u){var d=n(),f=d.cache,h=f===void 0?t?new WeakMap:void 0:f,p=d.meta;return r(c,u,{cache:h,equals:a,meta:p,strict:i})};if(t)return function(c,u){return r(c,u,{cache:new WeakMap,equals:a,meta:void 0,strict:i})};var s={cache:void 0,equals:a,meta:void 0,strict:i};return function(c,u){return r(c,u,s)}}var QNe=so();so({strict:!0});so({circular:!0});so({circular:!0,strict:!0});so({createInternalComparator:function(){return Nl}});so({strict:!0,createInternalComparator:function(){return Nl}});so({circular:!0,createInternalComparator:function(){return Nl}});so({circular:!0,createInternalComparator:function(){return Nl},strict:!0});function so(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,a=e.createState,i=e.strict,s=i===void 0?!1:i,l=YNe(e),c=KNe(l),u=n?n(c):XNe(c);return ZNe({circular:r,comparator:c,createState:a,equals:u,strict:s})}function JNe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function YI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):JNe(a)};requestAnimationFrame(n)}function RS(e){"@babel/helpers - typeof";return RS=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},RS(e)}function eSe(e){return aSe(e)||nSe(e)||rSe(e)||tSe()}function tSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
711
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rSe(e,t){if(e){if(typeof e=="string")return XI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return XI(e,t)}}function XI(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function nSe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aSe(e){if(Array.isArray(e))return e}function iSe(){var e={},t=function(){return null},r=!1,n=function a(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var s=i,l=eSe(s),c=l[0],u=l.slice(1);if(typeof c=="number"){YI(a.bind(null,u),c);return}a(c),YI(a.bind(null,u));return}RS(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,n(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function gh(e){"@babel/helpers - typeof";return gh=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},gh(e)}function ZI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function QI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZI(Object(r),!0).forEach(function(n){xH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xH(e,t,r){return t=sSe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sSe(e){var t=oSe(e,"string");return gh(t)==="symbol"?t:String(t)}function oSe(e,t){if(gh(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(gh(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lSe=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,a){return n.filter(function(i){return a.includes(i)})})},cSe=function(t){return t},uSe=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},sf=function(t,r){return Object.keys(r).reduce(function(n,a){return QI(QI({},n),{},xH({},a,t(a,r[a])))},{})},JI=function(t,r,n){return t.map(function(a){return"".concat(uSe(a)," ").concat(r,"ms ").concat(n)}).join(",")};function dSe(e,t){return pSe(e)||hSe(e,t)||yH(e,t)||fSe()}function fSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
712
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hSe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function pSe(e){if(Array.isArray(e))return e}function mSe(e){return ySe(e)||xSe(e)||yH(e)||gSe()}function gSe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
713
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yH(e,t){if(e){if(typeof e=="string")return DS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return DS(e,t)}}function xSe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ySe(e){if(Array.isArray(e))return DS(e)}function DS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var fg=1e-4,vH=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},bH=function(t,r){return t.map(function(n,a){return n*Math.pow(r,a)}).reduce(function(n,a){return n+a})},eL=function(t,r){return function(n){var a=vH(t,r);return bH(a,n)}},vSe=function(t,r){return function(n){var a=vH(t,r),i=[].concat(mSe(a.map(function(s,l){return s*l}).slice(1)),[0]);return bH(i,n)}},tL=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0],i=r[1],s=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":a=0,i=0,s=1,l=1;break;case"ease":a=.25,i=.1,s=.25,l=1;break;case"ease-in":a=.42,i=0,s=1,l=1;break;case"ease-out":a=.42,i=0,s=.58,l=1;break;case"ease-in-out":a=0,i=0,s=.58,l=1;break;default:{var c=r[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=dSe(u,4);a=d[0],i=d[1],s=d[2],l=d[3]}}}var f=eL(a,s),h=eL(i,l),p=vSe(a,s),m=function(x){return x>1?1:x<0?0:x},g=function(x){for(var v=x>1?1:x,b=v,j=0;j<8;++j){var w=f(b)-v,k=p(b);if(Math.abs(w-v)<fg||k<fg)return h(b);b=m(b-w/k)}return h(b)};return g.isStepper=!1,g},bSe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,s=t.dt,l=s===void 0?17:s,c=function(d,f,h){var p=-(d-f)*n,m=h*i,g=h+(p-m)*l/1e3,y=h*l/1e3+d;return Math.abs(y-f)<fg&&Math.abs(g)<fg?[f,0]:[y,g]};return c.isStepper=!0,c.dt=l,c},wSe=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return tL(a);case"spring":return bSe();default:if(a.split("(")[0]==="cubic-bezier")return tL(a)}return typeof a=="function"?a:null};function xh(e){"@babel/helpers - typeof";return xh=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},xh(e)}function rL(e){return NSe(e)||kSe(e)||wH(e)||jSe()}function jSe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
714
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kSe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NSe(e){if(Array.isArray(e))return IS(e)}function nL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nL(Object(r),!0).forEach(function(n){$S(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $S(e,t,r){return t=SSe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SSe(e){var t=_Se(e,"string");return xh(t)==="symbol"?t:String(t)}function _Se(e,t){if(xh(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xh(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ESe(e,t){return ASe(e)||CSe(e,t)||wH(e,t)||PSe()}function PSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
715
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wH(e,t){if(e){if(typeof e=="string")return IS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return IS(e,t)}}function IS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function CSe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function ASe(e){if(Array.isArray(e))return e}var hg=function(t,r,n){return t+(r-t)*n},LS=function(t){var r=t.from,n=t.to;return r!==n},OSe=function e(t,r,n){var a=sf(function(i,s){if(LS(s)){var l=t(s.from,s.to,s.velocity),c=ESe(l,2),u=c[0],d=c[1];return Pr(Pr({},s),{},{from:u,velocity:d})}return s},r);return n<1?sf(function(i,s){return LS(s)?Pr(Pr({},s),{},{velocity:hg(s.velocity,a[i].velocity,n),from:hg(s.from,a[i].from,n)}):s},r):e(t,a,n-1)};const TSe=function(e,t,r,n,a){var i=lSe(e,t),s=i.reduce(function(y,x){return Pr(Pr({},y),{},$S({},x,[e[x],t[x]]))},{}),l=i.reduce(function(y,x){return Pr(Pr({},y),{},$S({},x,{from:e[x],velocity:0,to:t[x]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return sf(function(x,v){return v.from},l)},p=function(){return!Object.values(l).filter(LS).length},m=function(x){u||(u=x);var v=x-u,b=v/r.dt;l=OSe(r,l,b),a(Pr(Pr(Pr({},e),t),h())),u=x,p()||(c=requestAnimationFrame(f))},g=function(x){d||(d=x);var v=(x-d)/n,b=sf(function(w,k){return hg.apply(void 0,rL(k).concat([r(v)]))},s);if(a(Pr(Pr(Pr({},e),t),b)),v<1)c=requestAnimationFrame(f);else{var j=sf(function(w,k){return hg.apply(void 0,rL(k).concat([r(1)]))},s);a(Pr(Pr(Pr({},e),t),j))}};return f=r.isStepper?m:g,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};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)}var MSe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function RSe(e,t){if(e==null)return{};var r=DSe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function DSe(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function zk(e){return zSe(e)||LSe(e)||ISe(e)||$Se()}function $Se(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
716
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ISe(e,t){if(e){if(typeof e=="string")return zS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zS(e,t)}}function LSe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zSe(e){if(Array.isArray(e))return zS(e)}function zS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function aL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?aL(Object(r),!0).forEach(function(n){Ld(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ld(e,t,r){return t=jH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BSe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,jH(n.key),n)}}function VSe(e,t,r){return t&&BSe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function jH(e){var t=qSe(e,"string");return su(t)==="symbol"?t:String(t)}function qSe(e,t){if(su(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(su(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function USe(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&&FS(e,t)}function FS(e,t){return FS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},FS(e,t)}function HSe(e){var t=WSe();return function(){var n=pg(e),a;if(t){var i=pg(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return BS(this,a)}}function BS(e,t){if(t&&(su(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VS(e)}function VS(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WSe(){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 pg(e){return pg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pg(e)}var Xa=function(e){USe(r,e);var t=HSe(r);function r(n,a){var i;FSe(this,r),i=t.call(this,n,a);var s=i.props,l=s.isActive,c=s.attributeName,u=s.from,d=s.to,f=s.steps,h=s.children,p=s.duration;if(i.handleStyleChange=i.handleStyleChange.bind(VS(i)),i.changeStyle=i.changeStyle.bind(VS(i)),!l||p<=0)return i.state={style:{}},typeof h=="function"&&(i.state={style:d}),BS(i);if(f&&f.length)i.state={style:f[0].style};else if(u){if(typeof h=="function")return i.state={style:u},BS(i);i.state={style:c?Ld({},c,u):u}}else i.state={style:{}};return i}return VSe(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,s=a.canBegin;this.mounted=!0,!(!i||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,s=i.isActive,l=i.canBegin,c=i.attributeName,u=i.shouldReAnimate,d=i.to,f=i.from,h=this.state.style;if(l){if(!s){var p={style:c?Ld({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(QNe(a.to,d)&&a.canBegin&&a.isActive)){var m=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=m||u?f:a.to;if(this.state&&h){var y={style:c?Ld({},c,g):g};(c&&h[c]!==g||!c&&h!==g)&&this.setState(y)}this.runAnimation(fa(fa({},this.props),{},{from:g,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 i=this,s=a.from,l=a.to,c=a.duration,u=a.easing,d=a.begin,f=a.onAnimationEnd,h=a.onAnimationStart,p=TSe(s,l,wSe(u),c,this.changeStyle),m=function(){i.stopJSAnimation=p()};this.manager.start([h,d,m,c,f])}},{key:"runStepAnimation",value:function(a){var i=this,s=a.steps,l=a.begin,c=a.onAnimationStart,u=s[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(g,y,x){if(x===0)return g;var v=y.duration,b=y.easing,j=b===void 0?"ease":b,w=y.style,k=y.properties,N=y.onAnimationEnd,_=x>0?s[x-1]:y,P=k||Object.keys(w);if(typeof j=="function"||j==="spring")return[].concat(zk(g),[i.runJSAnimation.bind(i,{from:_.style,to:w,duration:v,easing:j}),v]);var C=JI(P,v,j),A=fa(fa(fa({},_.style),w),{},{transition:C});return[].concat(zk(g),[A,v,N]).filter(cSe)};return this.manager.start([c].concat(zk(s.reduce(p,[d,Math.max(h,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=iSe());var i=a.begin,s=a.duration,l=a.attributeName,c=a.to,u=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,h=a.steps,p=a.children,m=this.manager;if(this.unSubscribe=m.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var g=l?Ld({},l,c):c,y=JI(Object.keys(g),s,u);m.start([d,i,fa(fa({},g),{},{transition:y}),s,f])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var s=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=RSe(a,MSe),u=S.Children.count(i),d=this.state.style;if(typeof i=="function")return i(d);if(!l||u===0||s<=0)return i;var f=function(p){var m=p.props,g=m.style,y=g===void 0?{}:g,x=m.className,v=S.cloneElement(p,fa(fa({},c),{},{style:fa(fa({},y),d),className:x}));return v};return u===1?f(S.Children.only(i)):M.createElement("div",null,S.Children.map(i,function(h){return f(h)}))}}]),r}(S.PureComponent);Xa.displayName="Animate";Xa.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Xa.propTypes={from:dt.oneOfType([dt.object,dt.string]),to:dt.oneOfType([dt.object,dt.string]),attributeName:dt.string,duration:dt.number,begin:dt.number,easing:dt.oneOfType([dt.string,dt.func]),steps:dt.arrayOf(dt.shape({duration:dt.number.isRequired,style:dt.object.isRequired,easing:dt.oneOfType([dt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),dt.func]),properties:dt.arrayOf("string"),onAnimationEnd:dt.func})),children:dt.oneOfType([dt.node,dt.func]),isActive:dt.bool,canBegin:dt.bool,onAnimationEnd:dt.func,shouldReAnimate:dt.bool,onAnimationStart:dt.func,onAnimationReStart:dt.func};function yh(e){"@babel/helpers - typeof";return yh=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},yh(e)}function mg(){return mg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mg.apply(this,arguments)}function GSe(e,t){return ZSe(e)||XSe(e,t)||YSe(e,t)||KSe()}function KSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
717
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YSe(e,t){if(e){if(typeof e=="string")return iL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return iL(e,t)}}function iL(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function XSe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function ZSe(e){if(Array.isArray(e))return e}function sL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function oL(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sL(Object(r),!0).forEach(function(n){QSe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QSe(e,t,r){return t=JSe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JSe(e){var t=e_e(e,"string");return yh(t)=="symbol"?t:t+""}function e_e(e,t){if(yh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(yh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lL=function(t,r,n,a,i){var s=Math.min(Math.abs(n)/2,Math.abs(a)/2),l=a>=0?1:-1,c=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,d;if(s>0&&i instanceof Array){for(var f=[0,0,0,0],h=0,p=4;h<p;h++)f[h]=i[h]>s?s:i[h];d="M".concat(t,",").concat(r+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(r)),d+="L ".concat(t+n-c*f[1],",").concat(r),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
718
+ `).concat(t+n,",").concat(r+l*f[1])),d+="L ".concat(t+n,",").concat(r+a-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
719
+ `).concat(t+n-c*f[2],",").concat(r+a)),d+="L ".concat(t+c*f[3],",").concat(r+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
720
+ `).concat(t,",").concat(r+a-l*f[3])),d+="Z"}else if(s>0&&i===+i&&i>0){var m=Math.min(s,i);d="M ".concat(t,",").concat(r+l*m,`
721
+ A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+c*m,",").concat(r,`
722
+ L `).concat(t+n-c*m,",").concat(r,`
723
+ A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*m,`
724
+ L `).concat(t+n,",").concat(r+a-l*m,`
725
+ A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+n-c*m,",").concat(r+a,`
726
+ L `).concat(t+c*m,",").concat(r+a,`
727
+ A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t,",").concat(r+a-l*m," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return d},t_e=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,s=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(i,i+l),d=Math.max(i,i+l),f=Math.min(s,s+c),h=Math.max(s,s+c);return n>=u&&n<=d&&a>=f&&a<=h}return!1},r_e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},OC=function(t){var r=oL(oL({},r_e),t),n=S.useRef(),a=S.useState(-1),i=GSe(a,2),s=i[0],l=i[1];S.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var j=n.current.getTotalLength();j&&l(j)}catch{}},[]);var c=r.x,u=r.y,d=r.width,f=r.height,h=r.radius,p=r.className,m=r.animationEasing,g=r.animationDuration,y=r.animationBegin,x=r.isAnimationActive,v=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var b=tt("recharts-rectangle",p);return v?M.createElement(Xa,{canBegin:s>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:g,animationEasing:m,isActive:v},function(j){var w=j.width,k=j.height,N=j.x,_=j.y;return M.createElement(Xa,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,isActive:x,easing:m},M.createElement("path",mg({},Ue(r,!0),{className:b,d:lL(N,_,w,k,h),ref:n})))}):M.createElement("path",mg({},Ue(r,!0),{className:b,d:lL(c,u,d,f,h)}))};function qS(){return qS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qS.apply(this,arguments)}var oy=function(t){var r=t.cx,n=t.cy,a=t.r,i=t.className,s=tt("recharts-dot",i);return r===+r&&n===+n&&a===+a?S.createElement("circle",qS({},Ue(t,!1),z0(t),{className:s,cx:r,cy:n,r:a})):null};function vh(e){"@babel/helpers - typeof";return vh=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},vh(e)}var n_e=["x","y","top","left","width","height","className"];function US(){return US=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},US.apply(this,arguments)}function cL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function a_e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cL(Object(r),!0).forEach(function(n){i_e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function i_e(e,t,r){return t=s_e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s_e(e){var t=o_e(e,"string");return vh(t)=="symbol"?t:t+""}function o_e(e,t){if(vh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(vh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function l_e(e,t){if(e==null)return{};var r=c_e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function c_e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var u_e=function(t,r,n,a,i,s){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(s,",").concat(r,"h").concat(n)},d_e=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,s=t.top,l=s===void 0?0:s,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,m=t.className,g=l_e(t,n_e),y=a_e({x:n,y:i,top:l,left:u,width:f,height:p},g);return!ue(n)||!ue(i)||!ue(f)||!ue(p)||!ue(l)||!ue(u)?null:M.createElement("path",US({},Ue(y,!0),{className:tt("recharts-cross",m),d:u_e(n,i,f,p,l,u)}))},f_e=LV();const h_e=lt(f_e);var p_e=Hi(),m_e=ia(),g_e="[object Boolean]";function x_e(e){return e===!0||e===!1||m_e(e)&&p_e(e)==g_e}var y_e=x_e;const v_e=lt(y_e);function bh(e){"@babel/helpers - typeof";return bh=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},bh(e)}function gg(){return gg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gg.apply(this,arguments)}function b_e(e,t){return N_e(e)||k_e(e,t)||j_e(e,t)||w_e()}function w_e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
728
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j_e(e,t){if(e){if(typeof e=="string")return uL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uL(e,t)}}function uL(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function k_e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function N_e(e){if(Array.isArray(e))return e}function dL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fL(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dL(Object(r),!0).forEach(function(n){S_e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function S_e(e,t,r){return t=__e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function __e(e){var t=E_e(e,"string");return bh(t)=="symbol"?t:t+""}function E_e(e,t){if(bh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(bh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hL=function(t,r,n,a,i){var s=n-a,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-s/2,",").concat(r+i),l+="L ".concat(t+n-s/2-a,",").concat(r+i),l+="L ".concat(t,",").concat(r," Z"),l},P_e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},C_e=function(t){var r=fL(fL({},P_e),t),n=S.useRef(),a=S.useState(-1),i=b_e(a,2),s=i[0],l=i[1];S.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var b=n.current.getTotalLength();b&&l(b)}catch{}},[]);var c=r.x,u=r.y,d=r.upperWidth,f=r.lowerWidth,h=r.height,p=r.className,m=r.animationEasing,g=r.animationDuration,y=r.animationBegin,x=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var v=tt("recharts-trapezoid",p);return x?M.createElement(Xa,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:g,animationEasing:m,isActive:x},function(b){var j=b.upperWidth,w=b.lowerWidth,k=b.height,N=b.x,_=b.y;return M.createElement(Xa,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,easing:m},M.createElement("path",gg({},Ue(r,!0),{className:v,d:hL(N,_,j,w,k),ref:n})))}):M.createElement("g",null,M.createElement("path",gg({},Ue(r,!0),{className:v,d:hL(c,u,d,f,h)})))},A_e=["option","shapeType","propTransformer","activeClassName","isActive"];function wh(e){"@babel/helpers - typeof";return wh=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},wh(e)}function O_e(e,t){if(e==null)return{};var r=T_e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function T_e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function xg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pL(Object(r),!0).forEach(function(n){M_e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function M_e(e,t,r){return t=R_e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R_e(e){var t=D_e(e,"string");return wh(t)=="symbol"?t:t+""}function D_e(e,t){if(wh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(wh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $_e(e,t){return xg(xg({},t),e)}function I_e(e,t){return e==="symbols"}function mL(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return M.createElement(OC,r);case"trapezoid":return M.createElement(C_e,r);case"sector":return M.createElement(fH,r);case"symbols":if(I_e(t))return M.createElement(aC,r);break;default:return null}}function L_e(e){return S.isValidElement(e)?e.props:e}function z_e(e){var t=e.option,r=e.shapeType,n=e.propTransformer,a=n===void 0?$_e:n,i=e.activeClassName,s=i===void 0?"recharts-active-shape":i,l=e.isActive,c=O_e(e,A_e),u;if(S.isValidElement(t))u=S.cloneElement(t,xg(xg({},c),L_e(t)));else if(Be(t))u=t(c);else if(h_e(t)&&!v_e(t)){var d=a(t,c);u=M.createElement(mL,{shapeType:r,elementProps:d})}else{var f=c;u=M.createElement(mL,{shapeType:r,elementProps:f})}return l?M.createElement(_t,{className:s},u):u}function ly(e,t){return t!=null&&"trapezoids"in e.props}function cy(e,t){return t!=null&&"sectors"in e.props}function jh(e,t){return t!=null&&"points"in e.props}function F_e(e,t){var r,n,a=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,i=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return a&&i}function B_e(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function V_e(e,t){var r=e.x===t.x,n=e.y===t.y,a=e.z===t.z;return r&&n&&a}function q_e(e,t){var r;return ly(e,t)?r=F_e:cy(e,t)?r=B_e:jh(e,t)&&(r=V_e),r}function U_e(e,t){var r;return ly(e,t)?r="trapezoids":cy(e,t)?r="sectors":jh(e,t)&&(r="points"),r}function H_e(e,t){if(ly(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}if(cy(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}return jh(e,t)?t.payload:{}}function W_e(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,a=U_e(r,t),i=H_e(r,t),s=n.filter(function(c,u){var d=au(i,c),f=r.props[a].filter(function(m){var g=q_e(r,t);return g(m,t)}),h=r.props[a].indexOf(f[f.length-1]),p=u===h;return d&&p}),l=n.indexOf(s[s.length-1]);return l}var G_e=qV();const yg=lt(G_e);function kh(e){"@babel/helpers - typeof";return kh=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},kh(e)}function gL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function xL(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gL(Object(r),!0).forEach(function(n){kH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kH(e,t,r){return t=K_e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function K_e(e){var t=Y_e(e,"string");return kh(t)=="symbol"?t:t+""}function Y_e(e,t){if(kh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(kh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var X_e=["Webkit","Moz","O","ms"],Z_e=function(t,r){var n=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=X_e.reduce(function(i,s){return xL(xL({},i),{},kH({},s+n,r))},{});return a[t]=r,a};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 vg(){return vg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vg.apply(this,arguments)}function yL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Fk(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yL(Object(r),!0).forEach(function(n){gn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Q_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,SH(n.key),n)}}function J_e(e,t,r){return t&&vL(e.prototype,t),r&&vL(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function eEe(e,t,r){return t=bg(t),tEe(e,NH()?Reflect.construct(t,r||[],bg(e).constructor):t.apply(e,r))}function tEe(e,t){if(t&&(ou(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rEe(e)}function rEe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NH=function(){return!!e})()}function bg(e){return bg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bg(e)}function nEe(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&&HS(e,t)}function HS(e,t){return HS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},HS(e,t)}function gn(e,t,r){return t=SH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SH(e){var t=aEe(e,"string");return ou(t)=="symbol"?t:t+""}function aEe(e,t){if(ou(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var iEe=function(t){var r=t.data,n=t.startIndex,a=t.endIndex,i=t.x,s=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=nf().domain(yg(0,c)).range([i,i+s-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(a),scale:u,scaleValues:d}},bL=function(t){return t.changedTouches&&!!t.changedTouches.length},dl=function(e){function t(r){var n;return Q_e(this,t),n=eEe(this,t,[r]),gn(n,"handleDrag",function(a){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(a):n.state.isSlideMoving&&n.handleSlideDrag(a)}),gn(n,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&n.handleDrag(a.changedTouches[0])}),gn(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,s=a.onDragEnd,l=a.startIndex;s==null||s({endIndex:i,startIndex:l})}),n.detachDragEndListener()}),gn(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),gn(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),gn(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),gn(n,"handleSlideDragStart",function(a){var i=bL(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return nEe(t,e),J_e(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,s=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(a,i),h=Math.max(a,i),p=t.getIndexInRange(s,f),m=t.getIndexInRange(s,h);return{startIndex:p-p%c,endIndex:m===d?d:m-m%c}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,s=a.tickFormatter,l=a.dataKey,c=Qr(i[n],l,n);return Be(s)?s(c,n):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(n){var a=this.state,i=a.slideMoveStartX,s=a.startX,l=a.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,p=c.endIndex,m=c.onChange,g=n.pageX-i;g>0?g=Math.min(g,u+d-f-l,u+d-f-s):g<0&&(g=Math.max(g,u-s,u-l));var y=this.getIndex({startX:s+g,endX:l+g});(y.startIndex!==h||y.endIndex!==p)&&m&&m(y),this.setState({startX:s+g,endX:l+g,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=bL(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,s=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[s],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,m=d.onChange,g=d.gap,y=d.data,x={startX:this.state.startX,endX:this.state.endX},v=n.pageX-i;v>0?v=Math.min(v,f+h-p-u):v<0&&(v=Math.max(v,f-u)),x[s]=u+v;var b=this.getIndex(x),j=b.startIndex,w=b.endIndex,k=function(){var _=y.length-1;return s==="startX"&&(l>c?j%g===0:w%g===0)||l<c&&w===_||s==="endX"&&(l>c?w%g===0:j%g===0)||l>c&&w===_};this.setState(gn(gn({},s,u+v),"brushMoveStartX",n.pageX),function(){m&&k()&&m(b)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,s=this.state,l=s.scaleValues,c=s.startX,u=s.endX,d=this.state[a],f=l.indexOf(d);if(f!==-1){var h=f+n;if(!(h===-1||h>=l.length)){var p=l[h];a==="startX"&&p>=u||a==="endX"&&p<=c||this.setState(gn({},a,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,l=n.height,c=n.fill,u=n.stroke;return M.createElement("rect",{stroke:u,fill:c,x:a,y:i,width:s,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,l=n.height,c=n.data,u=n.children,d=n.padding,f=S.Children.only(u);return f?M.cloneElement(f,{x:a,y:i,width:s,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,s,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,p=c.ariaLabel,m=c.data,g=c.startIndex,y=c.endIndex,x=Math.max(n,this.props.x),v=Fk(Fk({},Ue(this.props,!1)),{},{x,y:u,width:d,height:f}),b=p||"Min value: ".concat((i=m[g])===null||i===void 0?void 0:i.name,", Max value: ").concat((s=m[y])===null||s===void 0?void 0:s.name);return M.createElement(_t,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),l.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,v))}},{key:"renderSlide",value:function(n,a){var i=this.props,s=i.y,l=i.height,c=i.stroke,u=i.travellerWidth,d=Math.min(n,a)+u,f=Math.max(Math.abs(a-n)-u,0);return M.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:s,width:f,height:l})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,s=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,d=this.state,f=d.startX,h=d.endX,p=5,m={pointerEvents:"none",fill:u};return M.createElement(_t,{className:"recharts-brush-texts"},M.createElement(Z0,vg({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:s+l/2},m),this.getTextOfTick(a)),M.createElement(Z0,vg({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:s+l/2},m),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,s=n.children,l=n.x,c=n.y,u=n.width,d=n.height,f=n.alwaysShowText,h=this.state,p=h.startX,m=h.endX,g=h.isTextActive,y=h.isSlideMoving,x=h.isTravellerMoving,v=h.isTravellerFocused;if(!a||!a.length||!ue(l)||!ue(c)||!ue(u)||!ue(d)||u<=0||d<=0)return null;var b=tt("recharts-brush",i),j=M.Children.count(s)===1,w=Z_e("userSelect","none");return M.createElement(_t,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),j&&this.renderPanorama(),this.renderSlide(p,m),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(m,"endX"),(g||y||x||v||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,s=n.width,l=n.height,c=n.stroke,u=Math.floor(i+l/2)-1;return M.createElement(M.Fragment,null,M.createElement("rect",{x:a,y:i,width:s,height:l,fill:c,stroke:"none"}),M.createElement("line",{x1:a+1,y1:u,x2:a+s-1,y2:u,fill:"none",stroke:"#fff"}),M.createElement("line",{x1:a+1,y1:u+2,x2:a+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return M.isValidElement(n)?i=M.cloneElement(n,a):Be(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,s=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,d=n.startIndex,f=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return Fk({prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s},i&&i.length?iEe({data:i,width:s,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(s!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+s-c]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,s=0,l=i-1;l-s>1;){var c=Math.floor((s+l)/2);n[c]>a?l=c:s=c}return a>=n[l]?l:s}}])}(S.PureComponent);gn(dl,"displayName","Brush");gn(dl,"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 sEe=Ru();function oEe(e,t){var r;return sEe(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var lEe=oEe,cEe=nV,uEe=sa(),dEe=lEe,fEe=Jt(),hEe=$u();function pEe(e,t,r){var n=fEe(e)?cEe:dEe;return r&&hEe(e,t,r)&&(t=void 0),n(e,uEe(t,3))}var mEe=pEe;const gEe=lt(mEe);var Ka=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},xEe=DV();const yEe=lt(xEe);function vEe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}var bEe=vEe,wEe=Ru();function jEe(e,t){var r=!0;return wEe(e,function(n,a,i){return r=!!t(n,a,i),r}),r}var kEe=jEe,NEe=bEe,SEe=kEe,_Ee=sa(),EEe=Jt(),PEe=$u();function CEe(e,t,r){var n=EEe(e)?NEe:SEe;return r&&PEe(e,t,r)&&(t=void 0),n(e,_Ee(t,3))}var AEe=CEe;const _H=lt(AEe);var OEe=["x","y"];function Nh(e){"@babel/helpers - typeof";return Nh=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},Nh(e)}function WS(){return WS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WS.apply(this,arguments)}function wL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function vd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wL(Object(r),!0).forEach(function(n){TEe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TEe(e,t,r){return t=MEe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MEe(e){var t=REe(e,"string");return Nh(t)=="symbol"?t:t+""}function REe(e,t){if(Nh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Nh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DEe(e,t){if(e==null)return{};var r=$Ee(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $Ee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function IEe(e,t){var r=e.x,n=e.y,a=DEe(e,OEe),i="".concat(r),s=parseInt(i,10),l="".concat(n),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 vd(vd(vd(vd(vd({},t),a),s?{x:s}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function jL(e){return M.createElement(z_e,WS({shapeType:"rectangle",propTransformer:IEe,activeClassName:"recharts-active-bar"},e))}var LEe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=ue(n)||zxe(n);return i?t(n,a):(i||ul(),r)}},zEe=["value","background"],EH;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 FEe(e,t){if(e==null)return{};var r=BEe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function BEe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wg(){return wg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wg.apply(this,arguments)}function kL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ir(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kL(Object(r),!0).forEach(function(n){Ps(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function VEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,CH(n.key),n)}}function qEe(e,t,r){return t&&NL(e.prototype,t),r&&NL(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function UEe(e,t,r){return t=jg(t),HEe(e,PH()?Reflect.construct(t,r||[],jg(e).constructor):t.apply(e,r))}function HEe(e,t){if(t&&(lu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WEe(e)}function WEe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PH=function(){return!!e})()}function jg(e){return jg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jg(e)}function GEe(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&&GS(e,t)}function GS(e,t){return GS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},GS(e,t)}function Ps(e,t,r){return t=CH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CH(e){var t=KEe(e,"string");return lu(t)=="symbol"?t:t+""}function KEe(e,t){if(lu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(lu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var oo=function(e){function t(){var r;VEe(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=UEe(this,t,[].concat(a)),Ps(r,"state",{isAnimationFinished:!1}),Ps(r,"id",zu("recharts-bar-")),Ps(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),s&&s()}),Ps(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),s&&s()}),r}return GEe(t,e),qEe(t,[{key:"renderRectanglesStatically",value:function(n){var a=this,i=this.props,s=i.shape,l=i.dataKey,c=i.activeIndex,u=i.activeBar,d=Ue(this.props,!1);return n&&n.map(function(f,h){var p=h===c,m=p?u:s,g=ir(ir(ir({},d),f),{},{isActive:p,option:m,index:h,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return M.createElement(_t,wg({className:"recharts-bar-rectangle"},F0(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)}),M.createElement(jL,g))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,a=this.props,i=a.data,s=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,h=this.state.prevData;return M.createElement(Xa,{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 m=p.t,g=i.map(function(y,x){var v=h&&h[x];if(v){var b=Or(v.x,y.x),j=Or(v.y,y.y),w=Or(v.width,y.width),k=Or(v.height,y.height);return ir(ir({},y),{},{x:b(m),y:j(m),width:w(m),height:k(m)})}if(s==="horizontal"){var N=Or(0,y.height),_=N(m);return ir(ir({},y),{},{y:y.y+y.height-_,height:_})}var P=Or(0,y.width),C=P(m);return ir(ir({},y),{},{width:C})});return M.createElement(_t,null,n.renderRectanglesStatically(g))})}},{key:"renderRectangles",value:function(){var n=this.props,a=n.data,i=n.isAnimationActive,s=this.state.prevData;return i&&a&&a.length&&(!s||!au(s,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var n=this,a=this.props,i=a.data,s=a.dataKey,l=a.activeIndex,c=Ue(this.props.background,!1);return i.map(function(u,d){u.value;var f=u.background,h=FEe(u,zEe);if(!f)return null;var p=ir(ir(ir(ir(ir({},h),{},{fill:"#eee"},f),c),F0(n.props,u,d)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:s,index:d,className:"recharts-bar-background-rectangle"});return M.createElement(jL,wg({key:"background-bar-".concat(d),option:n.props.background,isActive:d===l},p))})}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.data,l=i.xAxis,c=i.yAxis,u=i.layout,d=i.children,f=ea(d,tp);if(!f)return null;var h=u==="vertical"?s[0].height/2:s[0].width/2,p=function(y,x){var v=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:v,errorVal:Qr(y,x)}},m={clipPath:n?"url(#clipPath-".concat(a,")"):null};return M.createElement(_t,m,f.map(function(g){return M.cloneElement(g,{key:"error-bar-".concat(a,"-").concat(g.props.dataKey),data:s,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var n=this.props,a=n.hide,i=n.data,s=n.className,l=n.xAxis,c=n.yAxis,u=n.left,d=n.top,f=n.width,h=n.height,p=n.isAnimationActive,m=n.background,g=n.id;if(a||!i||!i.length)return null;var y=this.state.isAnimationFinished,x=tt("recharts-bar",s),v=l&&l.allowDataOverflow,b=c&&c.allowDataOverflow,j=v||b,w=Ge(g)?this.id:g;return M.createElement(_t,{className:x},v||b?M.createElement("defs",null,M.createElement("clipPath",{id:"clipPath-".concat(w)},M.createElement("rect",{x:v?u:u-f/2,y:b?d:d-h/2,width:v?f:f*2,height:b?h:h*2}))):null,M.createElement(_t,{className:"recharts-bar-rectangles",clipPath:j?"url(#clipPath-".concat(w,")"):null},m?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(j,w),(!p||y)&&Ni.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:a.curData}:n.data!==a.curData?{curData:n.data}:null}}])}(S.PureComponent);EH=oo;Ps(oo,"displayName","Bar");Ps(oo,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!wl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ps(oo,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,a=e.bandSize,i=e.xAxis,s=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=t2e(n,r);if(!p)return null;var m=t.layout,g=r.type.defaultProps,y=g!==void 0?ir(ir({},g),r.props):r.props,x=y.dataKey,v=y.children,b=y.minPointSize,j=m==="horizontal"?s:i,w=u?j.scale.domain():null,k=c2e({numericAxis:j}),N=ea(v,lC),_=f.map(function(P,C){var A,O,T,E,R,D;u?A=r2e(u[d+C],w):(A=Qr(P,x),Array.isArray(A)||(A=[k,A]));var z=LEe(b,EH.defaultProps.minPointSize)(A[1],C);if(m==="horizontal"){var I,$=[s.scale(A[0]),s.scale(A[1])],F=$[0],q=$[1];O=SI({axis:i,ticks:l,bandSize:a,offset:p.offset,entry:P,index:C}),T=(I=q??F)!==null&&I!==void 0?I:void 0,E=p.size;var V=F-q;if(R=Number.isNaN(V)?0:V,D={x:O,y:s.y,width:E,height:s.height},Math.abs(z)>0&&Math.abs(R)<Math.abs(z)){var L=ka(R||z)*(Math.abs(z)-Math.abs(R));T-=L,R+=L}}else{var B=[i.scale(A[0]),i.scale(A[1])],Y=B[0],W=B[1];if(O=Y,T=SI({axis:s,ticks:c,bandSize:a,offset:p.offset,entry:P,index:C}),E=W-Y,R=p.size,D={x:i.x,y:T,width:i.width,height:R},Math.abs(z)>0&&Math.abs(E)<Math.abs(z)){var K=ka(E||z)*(Math.abs(z)-Math.abs(E));E+=K}}return ir(ir(ir({},P),{},{x:O,y:T,width:E,height:R,value:u?A:A[1],payload:P,background:D},N&&N[C]&&N[C].props),{},{tooltipPayload:[cH(r,P)],tooltipPosition:{x:O+E/2,y:T+R/2}})});return ir({data:_,layout:m},h)});function Sh(e){"@babel/helpers - typeof";return Sh=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},Sh(e)}function YEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,AH(n.key),n)}}function XEe(e,t,r){return t&&SL(e.prototype,t),r&&SL(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ya(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_L(Object(r),!0).forEach(function(n){uy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_L(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uy(e,t,r){return t=AH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AH(e){var t=ZEe(e,"string");return Sh(t)=="symbol"?t:t+""}function ZEe(e,t){if(Sh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Sh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var TC=function(t,r,n,a,i){var s=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(r),f={left:n.left,leftMirror:n.left,right:s-n.right,rightMirror:s-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},h=!!yn(u,oo);return d.reduce(function(p,m){var g=r[m],y=g.orientation,x=g.domain,v=g.padding,b=v===void 0?{}:v,j=g.mirror,w=g.reversed,k="".concat(y).concat(j?"Mirror":""),N,_,P,C,A;if(g.type==="number"&&(g.padding==="gap"||g.padding==="no-gap")){var O=x[1]-x[0],T=1/0,E=g.categoricalDomain.sort(Vxe);if(E.forEach(function(B,Y){Y>0&&(T=Math.min((B||0)-(E[Y-1]||0),T))}),Number.isFinite(T)){var R=T/O,D=g.layout==="vertical"?n.height:n.width;if(g.padding==="gap"&&(N=R*D/2),g.padding==="no-gap"){var z=ll(t.barCategoryGap,R*D),I=R*D/2;N=I-z-(I-z)/D*z}}}a==="xAxis"?_=[n.left+(b.left||0)+(N||0),n.left+n.width-(b.right||0)-(N||0)]:a==="yAxis"?_=c==="horizontal"?[n.top+n.height-(b.bottom||0),n.top+(b.top||0)]:[n.top+(b.top||0)+(N||0),n.top+n.height-(b.bottom||0)-(N||0)]:_=g.range,w&&(_=[_[1],_[0]]);var $=Jke(g,i,h),F=$.scale,q=$.realScaleType;F.domain(x).range(_),e2e(F);var V=l2e(F,ya(ya({},g),{},{realScaleType:q}));a==="xAxis"?(A=y==="top"&&!j||y==="bottom"&&j,P=n.left,C=f[k]-A*g.height):a==="yAxis"&&(A=y==="left"&&!j||y==="right"&&j,P=f[k]-A*g.width,C=n.top);var L=ya(ya(ya({},g),V),{},{realScaleType:q,x:P,y:C,scale:F,width:a==="xAxis"?n.width:g.width,height:a==="yAxis"?n.height:g.height});return L.bandSize=cg(L,V),!g.hide&&a==="xAxis"?f[k]+=(A?-1:1)*L.height:g.hide||(f[k]+=(A?-1:1)*L.width),ya(ya({},p),{},uy({},m,L))},{})},OH=function(t,r){var n=t.x,a=t.y,i=r.x,s=r.y;return{x:Math.min(n,i),y:Math.min(a,s),width:Math.abs(i-n),height:Math.abs(s-a)}},QEe=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return OH({x:r,y:n},{x:a,y:i})},TH=function(){function e(t){YEe(this,e),this.scale=t}return XEe(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(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();uy(TH,"EPS",1e-4);var MC=function(t){var r=Object.keys(t).reduce(function(n,a){return ya(ya({},n),{},uy({},a,TH.create(t[a])))},{});return ya(ya({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.bandAware,l=i.position;return yEe(a,function(c,u){return r[u].apply(c,{bandAware:s,position:l})})},isInRange:function(a){return _H(a,function(i,s){return r[s].isInRange(i)})}})};function JEe(e){return(e%180+180)%180}var ePe=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=JEe(a),s=i*Math.PI/180,l=Math.atan(n/r),c=s>l&&s<Math.PI-l?n/Math.sin(s):r/Math.cos(s);return Math.abs(c)},tPe=TV();const rPe=lt(tPe);var nPe=lV();const aPe=lt(nPe);var iPe=aPe(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("")}),RC=S.createContext(void 0),DC=S.createContext(void 0),MH=S.createContext(void 0),RH=S.createContext({}),DH=S.createContext(void 0),$H=S.createContext(0),IH=S.createContext(0),EL=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,s=t.clipPathId,l=t.children,c=t.width,u=t.height,d=iPe(i);return M.createElement(RC.Provider,{value:n},M.createElement(DC.Provider,{value:a},M.createElement(RH.Provider,{value:i},M.createElement(MH.Provider,{value:d},M.createElement(DH.Provider,{value:s},M.createElement($H.Provider,{value:u},M.createElement(IH.Provider,{value:c},l)))))))},sPe=function(){return S.useContext(DH)},LH=function(t){var r=S.useContext(RC);r==null&&ul();var n=r[t];return n==null&&ul(),n},oPe=function(){var t=S.useContext(RC);return vs(t)},lPe=function(){var t=S.useContext(DC),r=rPe(t,function(n){return _H(n.domain,Number.isFinite)});return r||vs(t)},zH=function(t){var r=S.useContext(DC);r==null&&ul();var n=r[t];return n==null&&ul(),n},cPe=function(){var t=S.useContext(MH);return t},uPe=function(){return S.useContext(RH)},$C=function(){return S.useContext(IH)},IC=function(){return S.useContext($H)};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 dPe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fPe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,BH(n.key),n)}}function hPe(e,t,r){return t&&fPe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pPe(e,t,r){return t=kg(t),mPe(e,FH()?Reflect.construct(t,r||[],kg(e).constructor):t.apply(e,r))}function mPe(e,t){if(t&&(cu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gPe(e)}function gPe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FH=function(){return!!e})()}function kg(e){return kg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},kg(e)}function xPe(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&&KS(e,t)}function KS(e,t){return KS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},KS(e,t)}function PL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function CL(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PL(Object(r),!0).forEach(function(n){LC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LC(e,t,r){return t=BH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BH(e){var t=yPe(e,"string");return cu(t)=="symbol"?t:t+""}function yPe(e,t){if(cu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function vPe(e,t){return kPe(e)||jPe(e,t)||wPe(e,t)||bPe()}function bPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
729
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wPe(e,t){if(e){if(typeof e=="string")return AL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return AL(e,t)}}function AL(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jPe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function kPe(e){if(Array.isArray(e))return e}function YS(){return YS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},YS.apply(this,arguments)}var NPe=function(t,r){var n;return M.isValidElement(t)?n=M.cloneElement(t,r):Be(t)?n=t(r):n=M.createElement("line",YS({},r,{className:"recharts-reference-line-line"})),n},SPe=function(t,r,n,a,i,s,l,c,u){var d=i.x,f=i.y,h=i.width,p=i.height;if(n){var m=u.y,g=t.y.apply(m,{position:s});if(Ka(u,"discard")&&!t.y.isInRange(g))return null;var y=[{x:d+h,y:g},{x:d,y:g}];return c==="left"?y.reverse():y}if(r){var x=u.x,v=t.x.apply(x,{position:s});if(Ka(u,"discard")&&!t.x.isInRange(v))return null;var b=[{x:v,y:f+p},{x:v,y:f}];return l==="top"?b.reverse():b}if(a){var j=u.segment,w=j.map(function(k){return t.apply(k,{position:s})});return Ka(u,"discard")&&gEe(w,function(k){return!t.isInRange(k)})?null:w}return null};function _Pe(e){var t=e.x,r=e.y,n=e.segment,a=e.xAxisId,i=e.yAxisId,s=e.shape,l=e.className,c=e.alwaysShow,u=sPe(),d=LH(a),f=zH(i),h=cPe();if(!u||!h)return null;ji(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=MC({x:d.scale,y:f.scale}),m=gr(t),g=gr(r),y=n&&n.length===2,x=SPe(p,m,g,y,h,e.position,d.orientation,f.orientation,e);if(!x)return null;var v=vPe(x,2),b=v[0],j=b.x,w=b.y,k=v[1],N=k.x,_=k.y,P=Ka(e,"hidden")?"url(#".concat(u,")"):void 0,C=CL(CL({clipPath:P},Ue(e,!0)),{},{x1:j,y1:w,x2:N,y2:_});return M.createElement(_t,{className:tt("recharts-reference-line",l)},NPe(s,C),Fr.renderCallByParent(e,QEe({x1:j,y1:w,x2:N,y2:_})))}var zC=function(e){function t(){return dPe(this,t),pPe(this,t,arguments)}return xPe(t,e),hPe(t,[{key:"render",value:function(){return M.createElement(_Pe,this.props)}}])}(M.Component);LC(zC,"displayName","ReferenceLine");LC(zC,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function XS(){return XS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XS.apply(this,arguments)}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)}function OL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function TL(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OL(Object(r),!0).forEach(function(n){dy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EPe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PPe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qH(n.key),n)}}function CPe(e,t,r){return t&&PPe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function APe(e,t,r){return t=Ng(t),OPe(e,VH()?Reflect.construct(t,r||[],Ng(e).constructor):t.apply(e,r))}function OPe(e,t){if(t&&(uu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return TPe(e)}function TPe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VH=function(){return!!e})()}function Ng(e){return Ng=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ng(e)}function MPe(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&&ZS(e,t)}function ZS(e,t){return ZS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},ZS(e,t)}function dy(e,t,r){return t=qH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qH(e){var t=RPe(e,"string");return uu(t)=="symbol"?t:t+""}function RPe(e,t){if(uu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(uu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var DPe=function(t){var r=t.x,n=t.y,a=t.xAxis,i=t.yAxis,s=MC({x:a.scale,y:i.scale}),l=s.apply({x:r,y:n},{bandAware:!0});return Ka(t,"discard")&&!s.isInRange(l)?null:l},fy=function(e){function t(){return EPe(this,t),APe(this,t,arguments)}return MPe(t,e),CPe(t,[{key:"render",value:function(){var n=this.props,a=n.x,i=n.y,s=n.r,l=n.alwaysShow,c=n.clipPathId,u=gr(a),d=gr(i);if(ji(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=DPe(this.props);if(!f)return null;var h=f.x,p=f.y,m=this.props,g=m.shape,y=m.className,x=Ka(this.props,"hidden")?"url(#".concat(c,")"):void 0,v=TL(TL({clipPath:x},Ue(this.props,!0)),{},{cx:h,cy:p});return M.createElement(_t,{className:tt("recharts-reference-dot",y)},t.renderDot(g,v),Fr.renderCallByParent(this.props,{x:h-s,y:p-s,width:2*s,height:2*s}))}}])}(M.Component);dy(fy,"displayName","ReferenceDot");dy(fy,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});dy(fy,"renderDot",function(e,t){var r;return M.isValidElement(e)?r=M.cloneElement(e,t):Be(e)?r=e(t):r=M.createElement(oy,XS({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function QS(){return QS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QS.apply(this,arguments)}function du(e){"@babel/helpers - typeof";return du=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},du(e)}function ML(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function RL(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ML(Object(r),!0).forEach(function(n){hy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ML(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $Pe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IPe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,HH(n.key),n)}}function LPe(e,t,r){return t&&IPe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zPe(e,t,r){return t=Sg(t),FPe(e,UH()?Reflect.construct(t,r||[],Sg(e).constructor):t.apply(e,r))}function FPe(e,t){if(t&&(du(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return BPe(e)}function BPe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UH=function(){return!!e})()}function Sg(e){return Sg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Sg(e)}function VPe(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&&JS(e,t)}function JS(e,t){return JS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},JS(e,t)}function hy(e,t,r){return t=HH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HH(e){var t=qPe(e,"string");return du(t)=="symbol"?t:t+""}function qPe(e,t){if(du(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(du(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var UPe=function(t,r,n,a,i){var s=i.x1,l=i.x2,c=i.y1,u=i.y2,d=i.xAxis,f=i.yAxis;if(!d||!f)return null;var h=MC({x:d.scale,y:f.scale}),p={x:t?h.x.apply(s,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(c,{position:"start"}):h.y.rangeMin},m={x:r?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:a?h.y.apply(u,{position:"end"}):h.y.rangeMax};return Ka(i,"discard")&&(!h.isInRange(p)||!h.isInRange(m))?null:OH(p,m)},py=function(e){function t(){return $Pe(this,t),zPe(this,t,arguments)}return VPe(t,e),LPe(t,[{key:"render",value:function(){var n=this.props,a=n.x1,i=n.x2,s=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,d=n.clipPathId;ji(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=gr(a),h=gr(i),p=gr(s),m=gr(l),g=this.props.shape;if(!f&&!h&&!p&&!m&&!g)return null;var y=UPe(f,h,p,m,this.props);if(!y&&!g)return null;var x=Ka(this.props,"hidden")?"url(#".concat(d,")"):void 0;return M.createElement(_t,{className:tt("recharts-reference-area",c)},t.renderRect(g,RL(RL({clipPath:x},Ue(this.props,!0)),y)),Fr.renderCallByParent(this.props,y))}}])}(M.Component);hy(py,"displayName","ReferenceArea");hy(py,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});hy(py,"renderRect",function(e,t){var r;return M.isValidElement(e)?r=M.cloneElement(e,t):Be(e)?r=e(t):r=M.createElement(OC,QS({},t,{className:"recharts-reference-area-rect"})),r});function WH(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],a=0;a<e.length;a+=t)n.push(e[a]);return n}function HPe(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return ePe(n,r)}function WPe(e,t,r){var n=r==="width",a=e.x,i=e.y,s=e.width,l=e.height;return t===1?{start:n?a:i,end:n?a+s:i+l}:{start:n?a+s:i+l,end:n?a:i}}function _g(e,t,r,n,a){if(e*t<e*n||e*t>e*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function GPe(e,t){return WH(e,t+1)}function KPe(e,t,r,n,a){for(var i=(n||[]).slice(),s=t.start,l=t.end,c=0,u=1,d=s,f=function(){var m=n==null?void 0:n[c];if(m===void 0)return{v:WH(n,u)};var g=c,y,x=function(){return y===void 0&&(y=r(m,g)),y},v=m.coordinate,b=c===0||_g(e,v,x,d,l);b||(c=0,d=s,u+=1),b&&(d=v+e*(x()/2+a),c+=u)},h;u<=i.length;)if(h=f(),h)return h.v;return[]}function _h(e){"@babel/helpers - typeof";return _h=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},_h(e)}function DL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Lr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DL(Object(r),!0).forEach(function(n){YPe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YPe(e,t,r){return t=XPe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XPe(e){var t=ZPe(e,"string");return _h(t)=="symbol"?t:t+""}function ZPe(e,t){if(_h(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_h(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QPe(e,t,r,n,a){for(var i=(n||[]).slice(),s=i.length,l=t.start,c=t.end,u=function(h){var p=i[h],m,g=function(){return m===void 0&&(m=r(p,h)),m};if(h===s-1){var y=e*(p.coordinate+e*g()/2-c);i[h]=p=Lr(Lr({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate})}else i[h]=p=Lr(Lr({},p),{},{tickCoord:p.coordinate});var x=_g(e,p.tickCoord,g,l,c);x&&(c=p.tickCoord-e*(g()/2+a),i[h]=Lr(Lr({},p),{},{isShow:!0}))},d=s-1;d>=0;d--)u(d);return i}function JPe(e,t,r,n,a,i){var s=(n||[]).slice(),l=s.length,c=t.start,u=t.end;if(i){var d=n[l-1],f=r(d,l-1),h=e*(d.coordinate+e*f/2-u);s[l-1]=d=Lr(Lr({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=_g(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+a),s[l-1]=Lr(Lr({},d),{},{isShow:!0}))}for(var m=i?l-1:l,g=function(v){var b=s[v],j,w=function(){return j===void 0&&(j=r(b,v)),j};if(v===0){var k=e*(b.coordinate-e*w()/2-c);s[v]=b=Lr(Lr({},b),{},{tickCoord:k<0?b.coordinate-k*e:b.coordinate})}else s[v]=b=Lr(Lr({},b),{},{tickCoord:b.coordinate});var N=_g(e,b.tickCoord,w,c,u);N&&(c=b.tickCoord+e*(w()/2+a),s[v]=Lr(Lr({},b),{},{isShow:!0}))},y=0;y<m;y++)g(y);return s}function FC(e,t,r){var n=e.tick,a=e.ticks,i=e.viewBox,s=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!a||!a.length||!n)return[];if(ue(c)||wl.isSsr)return GPe(a,typeof c=="number"&&ue(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",m=d&&p==="width"?rf(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},g=function(b,j){var w=Be(u)?u(b.value,j):b.value;return p==="width"?HPe(rf(w,{fontSize:t,letterSpacing:r}),m,f):rf(w,{fontSize:t,letterSpacing:r})[p]},y=a.length>=2?ka(a[1].coordinate-a[0].coordinate):1,x=WPe(i,y,p);return c==="equidistantPreserveStart"?KPe(y,x,g,a,s):(c==="preserveStart"||c==="preserveStartEnd"?h=JPe(y,x,g,a,s,c==="preserveStartEnd"):h=QPe(y,x,g,a,s),h.filter(function(v){return v.isShow}))}var eCe=["viewBox"],tCe=["viewBox"],rCe=["ticks"];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)}function dc(){return dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dc.apply(this,arguments)}function $L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$L(Object(r),!0).forEach(function(n){BC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$L(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bk(e,t){if(e==null)return{};var r=nCe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nCe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function aCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KH(n.key),n)}}function iCe(e,t,r){return t&&IL(e.prototype,t),r&&IL(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function sCe(e,t,r){return t=Eg(t),oCe(e,GH()?Reflect.construct(t,r||[],Eg(e).constructor):t.apply(e,r))}function oCe(e,t){if(t&&(fu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lCe(e)}function lCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GH=function(){return!!e})()}function Eg(e){return Eg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Eg(e)}function cCe(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&&e_(e,t)}function e_(e,t){return e_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},e_(e,t)}function BC(e,t,r){return t=KH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KH(e){var t=uCe(e,"string");return fu(t)=="symbol"?t:t+""}function uCe(e,t){if(fu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Vu=function(e){function t(r){var n;return aCe(this,t),n=sCe(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return cCe(t,e),iCe(t,[{key:"shouldComponentUpdate",value:function(n,a){var i=n.viewBox,s=Bk(n,eCe),l=this.props,c=l.viewBox,u=Bk(l,tCe);return!Ec(i,c)||!Ec(s,u)||!Ec(a,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var a=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.x,s=a.y,l=a.width,c=a.height,u=a.orientation,d=a.tickSize,f=a.mirror,h=a.tickMargin,p,m,g,y,x,v,b=f?-1:1,j=n.tickSize||d,w=ue(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":p=m=n.coordinate,y=s+ +!f*c,g=y-b*j,v=g-b*h,x=w;break;case"left":g=y=n.coordinate,m=i+ +!f*l,p=m-b*j,x=p-b*h,v=w;break;case"right":g=y=n.coordinate,m=i+ +f*l,p=m+b*j,x=p+b*h,v=w;break;default:p=m=n.coordinate,y=s+ +f*c,g=y+b*j,v=g+b*h,x=w;break}return{line:{x1:p,y1:g,x2:m,y2:y},tick:{x,y:v}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,s;switch(a){case"left":s=i?"start":"end";break;case"right":s=i?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,s="end";switch(a){case"left":case"right":s="middle";break;case"top":s=i?"start":"end";break;default:s=i?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,l=n.height,c=n.orientation,u=n.mirror,d=n.axisLine,f=fr(fr(fr({},Ue(this.props,!1)),Ue(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=fr(fr({},f),{},{x1:a,y1:i+h*l,x2:a+s,y2:i+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);f=fr(fr({},f),{},{x1:a+p*s,y1:i,x2:a+p*s,y2:i+l})}return M.createElement("line",dc({},f,{className:tt("recharts-cartesian-axis-line",Jn(d,"className"))}))}},{key:"renderTicks",value:function(n,a,i){var s=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,p=FC(fr(fr({},this.props),{},{ticks:n}),a,i),m=this.getTickTextAnchor(),g=this.getTickVerticalAnchor(),y=Ue(this.props,!1),x=Ue(d,!1),v=fr(fr({},y),{},{fill:"none"},Ue(c,!1)),b=p.map(function(j,w){var k=s.getTickLineCoord(j),N=k.line,_=k.tick,P=fr(fr(fr(fr({textAnchor:m,verticalAnchor:g},y),{},{stroke:"none",fill:u},x),_),{},{index:w,payload:j,visibleTicksCount:p.length,tickFormatter:f});return M.createElement(_t,dc({className:"recharts-cartesian-axis-tick",key:"tick-".concat(j.value,"-").concat(j.coordinate,"-").concat(j.tickCoord)},F0(s.props,j,w)),c&&M.createElement("line",dc({},v,N,{className:tt("recharts-cartesian-axis-tick-line",Jn(c,"className"))})),d&&t.renderTickItem(d,P,"".concat(Be(f)?f(j.value,w):j.value).concat(h||"")))});return M.createElement("g",{className:"recharts-cartesian-axis-ticks"},b)}},{key:"render",value:function(){var n=this,a=this.props,i=a.axisLine,s=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=Bk(f,rCe),m=h;return Be(c)&&(m=h&&h.length>0?c(this.props):c(p)),s<=0||l<=0||!m||!m.length?null:M.createElement(_t,{className:tt("recharts-cartesian-axis",u),ref:function(y){n.layerReference=y}},i&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),Fr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var s,l=tt(a.className,"recharts-cartesian-axis-tick-value");return M.isValidElement(n)?s=M.cloneElement(n,fr(fr({},a),{},{className:l})):Be(n)?s=n(fr(fr({},a),{},{className:l})):s=M.createElement(Z0,dc({},a,{className:"recharts-cartesian-axis-tick-value"}),i),s}}])}(S.Component);BC(Vu,"displayName","CartesianAxis");BC(Vu,"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 dCe=["x1","y1","x2","y2","key"],fCe=["offset"];function fl(e){"@babel/helpers - typeof";return fl=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},fl(e)}function LL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Br(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LL(Object(r),!0).forEach(function(n){hCe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hCe(e,t,r){return t=pCe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pCe(e){var t=mCe(e,"string");return fl(t)=="symbol"?t:t+""}function mCe(e,t){if(fl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(fl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $o(){return $o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$o.apply(this,arguments)}function zL(e,t){if(e==null)return{};var r=gCe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gCe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var xCe=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,s=t.width,l=t.height,c=t.ry;return M.createElement("rect",{x:a,y:i,ry:c,width:s,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function YH(e,t){var r;if(M.isValidElement(e))r=M.cloneElement(e,t);else if(Be(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,s=t.y2,l=t.key,c=zL(t,dCe),u=Ue(c,!1);u.offset;var d=zL(u,fCe);r=M.createElement("line",$o({},d,{x1:n,y1:a,x2:i,y2:s,fill:"none",key:l}))}return r}function yCe(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var s=i.map(function(l,c){var u=Br(Br({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return YH(a,u)});return M.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function vCe(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var s=i.map(function(l,c){var u=Br(Br({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return YH(a,u)});return M.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function bCe(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,s=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 m=!d[p+1],g=m?a+s-h:d[p+1]-h;if(g<=0)return null;var y=p%t.length;return M.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:g,width:i,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return M.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function wCe(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,s=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var m=!d[p+1],g=m?i+l-h:d[p+1]-h;if(g<=0)return null;var y=p%n.length;return M.createElement("rect",{key:"react-".concat(p),x:h,y:s,width:g,height:c,stroke:"none",fill:n[y],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return M.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var jCe=function(t,r){var n=t.xAxis,a=t.width,i=t.height,s=t.offset;return oH(FC(Br(Br(Br({},Vu.defaultProps),n),{},{ticks:mi(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),s.left,s.left+s.width,r)},kCe=function(t,r){var n=t.yAxis,a=t.width,i=t.height,s=t.offset;return oH(FC(Br(Br(Br({},Vu.defaultProps),n),{},{ticks:mi(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),s.top,s.top+s.height,r)},zl={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function rp(e){var t,r,n,a,i,s,l=$C(),c=IC(),u=uPe(),d=Br(Br({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:zl.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:zl.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:zl.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:zl.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:zl.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:zl.verticalFill,x:ue(e.x)?e.x:u.left,y:ue(e.y)?e.y:u.top,width:ue(e.width)?e.width:u.width,height:ue(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,m=d.height,g=d.syncWithTicks,y=d.horizontalValues,x=d.verticalValues,v=oPe(),b=lPe();if(!ue(p)||p<=0||!ue(m)||m<=0||!ue(f)||f!==+f||!ue(h)||h!==+h)return null;var j=d.verticalCoordinatesGenerator||jCe,w=d.horizontalCoordinatesGenerator||kCe,k=d.horizontalPoints,N=d.verticalPoints;if((!k||!k.length)&&Be(w)){var _=y&&y.length,P=w({yAxis:b?Br(Br({},b),{},{ticks:_?y:b.ticks}):void 0,width:l,height:c,offset:u},_?!0:g);ji(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(fl(P),"]")),Array.isArray(P)&&(k=P)}if((!N||!N.length)&&Be(j)){var C=x&&x.length,A=j({xAxis:v?Br(Br({},v),{},{ticks:C?x:v.ticks}):void 0,width:l,height:c,offset:u},C?!0:g);ji(Array.isArray(A),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(fl(A),"]")),Array.isArray(A)&&(N=A)}return M.createElement("g",{className:"recharts-cartesian-grid"},M.createElement(xCe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),M.createElement(yCe,$o({},d,{offset:u,horizontalPoints:k,xAxis:v,yAxis:b})),M.createElement(vCe,$o({},d,{offset:u,verticalPoints:N,xAxis:v,yAxis:b})),M.createElement(bCe,$o({},d,{horizontalPoints:k})),M.createElement(wCe,$o({},d,{verticalPoints:N})))}rp.displayName="CartesianGrid";var NCe=["type","layout","connectNulls","ref"],SCe=["key"];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 FL(e,t){if(e==null)return{};var r=_Ce(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _Ce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function of(){return of=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},of.apply(this,arguments)}function BL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function mn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BL(Object(r),!0).forEach(function(n){va(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fl(e){return ACe(e)||CCe(e)||PCe(e)||ECe()}function ECe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
730
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PCe(e,t){if(e){if(typeof e=="string")return t_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t_(e,t)}}function CCe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ACe(e){if(Array.isArray(e))return t_(e)}function t_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function OCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ZH(n.key),n)}}function TCe(e,t,r){return t&&VL(e.prototype,t),r&&VL(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function MCe(e,t,r){return t=Pg(t),RCe(e,XH()?Reflect.construct(t,r||[],Pg(e).constructor):t.apply(e,r))}function RCe(e,t){if(t&&(hu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DCe(e)}function DCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(XH=function(){return!!e})()}function Pg(e){return Pg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Pg(e)}function $Ce(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&&r_(e,t)}function r_(e,t){return r_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},r_(e,t)}function va(e,t,r){return t=ZH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZH(e){var t=ICe(e,"string");return hu(t)=="symbol"?t:t+""}function ICe(e,t){if(hu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(hu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var np=function(e){function t(){var r;OCe(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=MCe(this,t,[].concat(a)),va(r,"state",{isAnimationFinished:!0,totalLength:0}),va(r,"generateSimpleStrokeDasharray",function(s,l){return"".concat(l,"px ").concat(s-l,"px")}),va(r,"getStrokeDasharray",function(s,l,c){var u=c.reduce(function(x,v){return x+v});if(!u)return r.generateSimpleStrokeDasharray(l,s);for(var d=Math.floor(s/u),f=s%u,h=l-s,p=[],m=0,g=0;m<c.length;g+=c[m],++m)if(g+c[m]>f){p=[].concat(Fl(c.slice(0,m)),[f-g]);break}var y=p.length%2===0?[0,h]:[h];return[].concat(Fl(t.repeat(c,d)),Fl(p),y).map(function(x){return"".concat(x,"px")}).join(", ")}),va(r,"id",zu("recharts-line-")),va(r,"pathRef",function(s){r.mainCurve=s}),va(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),va(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return $Ce(t,e),TCe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.points,l=i.xAxis,c=i.yAxis,u=i.layout,d=i.children,f=ea(d,tp);if(!f)return null;var h=function(g,y){return{x:g.x,y:g.y,value:g.value,errorVal:Qr(g.payload,y)}},p={clipPath:n?"url(#clipPath-".concat(a,")"):null};return M.createElement(_t,p,f.map(function(m){return M.cloneElement(m,{key:"bar-".concat(m.props.dataKey),data:s,xAxis:l,yAxis:c,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,a,i){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,f=Ue(this.props,!1),h=Ue(c,!0),p=u.map(function(g,y){var x=mn(mn(mn({key:"dot-".concat(y),r:3},f),h),{},{index:y,cx:g.x,cy:g.y,value:g.value,dataKey:d,payload:g.payload,points:u});return t.renderDotItem(c,x)}),m={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return M.createElement(_t,of({className:"recharts-line-dots",key:"dots"},m),p)}},{key:"renderCurveStatically",value:function(n,a,i,s){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var f=FL(l,NCe),h=mn(mn(mn({},Ue(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:n},s),{},{type:c,layout:u,connectNulls:d});return M.createElement(Cc,of({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,a){var i=this,s=this.props,l=s.points,c=s.strokeDasharray,u=s.isAnimationActive,d=s.animationBegin,f=s.animationDuration,h=s.animationEasing,p=s.animationId,m=s.animateNewValues,g=s.width,y=s.height,x=this.state,v=x.prevPoints,b=x.totalLength;return M.createElement(Xa,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(j){var w=j.t;if(v){var k=v.length/l.length,N=l.map(function(O,T){var E=Math.floor(T*k);if(v[E]){var R=v[E],D=Or(R.x,O.x),z=Or(R.y,O.y);return mn(mn({},O),{},{x:D(w),y:z(w)})}if(m){var I=Or(g*2,O.x),$=Or(y/2,O.y);return mn(mn({},O),{},{x:I(w),y:$(w)})}return mn(mn({},O),{},{x:O.x,y:O.y})});return i.renderCurveStatically(N,n,a)}var _=Or(0,b),P=_(w),C;if(c){var A="".concat(c).split(/[,\s]+/gim).map(function(O){return parseFloat(O)});C=i.getStrokeDasharray(P,b,A)}else C=i.generateSimpleStrokeDasharray(b,P);return i.renderCurveStatically(l,n,a,{strokeDasharray:C})})}},{key:"renderCurve",value:function(n,a){var i=this.props,s=i.points,l=i.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&s&&s.length&&(!u&&d>0||!au(u,s))?this.renderCurveWithAnimation(n,a):this.renderCurveStatically(s,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,s=a.dot,l=a.points,c=a.className,u=a.xAxis,d=a.yAxis,f=a.top,h=a.left,p=a.width,m=a.height,g=a.isAnimationActive,y=a.id;if(i||!l||!l.length)return null;var x=this.state.isAnimationFinished,v=l.length===1,b=tt("recharts-line",c),j=u&&u.allowDataOverflow,w=d&&d.allowDataOverflow,k=j||w,N=Ge(y)?this.id:y,_=(n=Ue(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},P=_.r,C=P===void 0?3:P,A=_.strokeWidth,O=A===void 0?2:A,T=Pq(s)?s:{},E=T.clipDot,R=E===void 0?!0:E,D=C*2+O;return M.createElement(_t,{className:b},j||w?M.createElement("defs",null,M.createElement("clipPath",{id:"clipPath-".concat(N)},M.createElement("rect",{x:j?h:h-p/2,y:w?f:f-m/2,width:j?p:p*2,height:w?m:m*2})),!R&&M.createElement("clipPath",{id:"clipPath-dots-".concat(N)},M.createElement("rect",{x:h-D/2,y:f-D/2,width:p+D,height:m+D}))):null,!v&&this.renderCurve(k,N),this.renderErrorBar(k,N),(v||s)&&this.renderDots(k,R,N),(!g||x)&&Ni.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:a.curPoints}:n.points!==a.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,a){for(var i=n.length%2!==0?[].concat(Fl(n),[0]):n,s=[],l=0;l<a;++l)s=[].concat(Fl(s),Fl(i));return s}},{key:"renderDotItem",value:function(n,a){var i;if(M.isValidElement(n))i=M.cloneElement(n,a);else if(Be(n))i=n(a);else{var s=a.key,l=FL(a,SCe),c=tt("recharts-line-dot",typeof n!="boolean"?n.className:"");i=M.createElement(oy,of({key:s},l,{className:c}))}return i}}])}(S.PureComponent);va(np,"displayName","Line");va(np,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!wl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});va(np,"getComposedData",function(e){var t=e.props,r=e.xAxis,n=e.yAxis,a=e.xAxisTicks,i=e.yAxisTicks,s=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,f=c.map(function(h,p){var m=Qr(h,s);return d==="horizontal"?{x:lg({axis:r,ticks:a,bandSize:l,entry:h,index:p}),y:Ge(m)?null:n.scale(m),value:m,payload:h}:{x:Ge(m)?null:r.scale(m),y:lg({axis:n,ticks:i,bandSize:l,entry:h,index:p}),value:m,payload:h}});return mn({points:f,layout:d},u)});var LCe=["layout","type","stroke","connectNulls","isRange","ref"],zCe=["key"],QH;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 JH(e,t){if(e==null)return{};var r=FCe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FCe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Io(){return Io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Io.apply(this,arguments)}function qL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function cs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qL(Object(r),!0).forEach(function(n){Va(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,tW(n.key),n)}}function VCe(e,t,r){return t&&UL(e.prototype,t),r&&UL(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function qCe(e,t,r){return t=Cg(t),UCe(e,eW()?Reflect.construct(t,r||[],Cg(e).constructor):t.apply(e,r))}function UCe(e,t){if(t&&(pu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HCe(e)}function HCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eW(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eW=function(){return!!e})()}function Cg(e){return Cg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cg(e)}function WCe(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&&n_(e,t)}function n_(e,t){return n_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},n_(e,t)}function Va(e,t,r){return t=tW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tW(e){var t=GCe(e,"string");return pu(t)=="symbol"?t:t+""}function GCe(e,t){if(pu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(pu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var lo=function(e){function t(){var r;BCe(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=qCe(this,t,[].concat(a)),Va(r,"state",{isAnimationFinished:!0}),Va(r,"id",zu("recharts-area-")),Va(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Be(s)&&s()}),Va(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Be(s)&&s()}),r}return WCe(t,e),VCe(t,[{key:"renderDots",value:function(n,a,i){var s=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(s&&!l)return null;var c=this.props,u=c.dot,d=c.points,f=c.dataKey,h=Ue(this.props,!1),p=Ue(u,!0),m=d.map(function(y,x){var v=cs(cs(cs({key:"dot-".concat(x),r:3},h),p),{},{index:x,cx:y.x,cy:y.y,dataKey:f,value:y.value,payload:y.payload,points:d});return t.renderDotItem(u,v)}),g={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return M.createElement(_t,Io({className:"recharts-area-dots"},g),m)}},{key:"renderHorizontalRect",value:function(n){var a=this.props,i=a.baseLine,s=a.points,l=a.strokeWidth,c=s[0].x,u=s[s.length-1].x,d=n*Math.abs(c-u),f=Es(s.map(function(h){return h.y||0}));return ue(i)&&typeof i=="number"?f=Math.max(i,f):i&&Array.isArray(i)&&i.length&&(f=Math.max(Es(i.map(function(h){return h.y||0})),f)),ue(f)?M.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var a=this.props,i=a.baseLine,s=a.points,l=a.strokeWidth,c=s[0].y,u=s[s.length-1].y,d=n*Math.abs(c-u),f=Es(s.map(function(h){return h.x||0}));return ue(i)&&typeof i=="number"?f=Math.max(i,f):i&&Array.isArray(i)&&i.length&&(f=Math.max(Es(i.map(function(h){return h.x||0})),f)),ue(f)?M.createElement("rect",{x:0,y:c<u?c:c-d,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(n){var a=this.props.layout;return a==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,a,i,s){var l=this.props,c=l.layout,u=l.type,d=l.stroke,f=l.connectNulls,h=l.isRange;l.ref;var p=JH(l,LCe);return M.createElement(_t,{clipPath:i?"url(#clipPath-".concat(s,")"):null},M.createElement(Cc,Io({},Ue(p,!0),{points:n,connectNulls:f,type:u,baseLine:a,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&M.createElement(Cc,Io({},Ue(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:n})),d!=="none"&&h&&M.createElement(Cc,Io({},Ue(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:a})))}},{key:"renderAreaWithAnimation",value:function(n,a){var i=this,s=this.props,l=s.points,c=s.baseLine,u=s.isAnimationActive,d=s.animationBegin,f=s.animationDuration,h=s.animationEasing,p=s.animationId,m=this.state,g=m.prevPoints,y=m.prevBaseLine;return M.createElement(Xa,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"area-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(x){var v=x.t;if(g){var b=g.length/l.length,j=l.map(function(_,P){var C=Math.floor(P*b);if(g[C]){var A=g[C],O=Or(A.x,_.x),T=Or(A.y,_.y);return cs(cs({},_),{},{x:O(v),y:T(v)})}return _}),w;if(ue(c)&&typeof c=="number"){var k=Or(y,c);w=k(v)}else if(Ge(c)||Lu(c)){var N=Or(y,0);w=N(v)}else w=c.map(function(_,P){var C=Math.floor(P*b);if(y[C]){var A=y[C],O=Or(A.x,_.x),T=Or(A.y,_.y);return cs(cs({},_),{},{x:O(v),y:T(v)})}return _});return i.renderAreaStatically(j,w,n,a)}return M.createElement(_t,null,M.createElement("defs",null,M.createElement("clipPath",{id:"animationClipPath-".concat(a)},i.renderClipRect(v))),M.createElement(_t,{clipPath:"url(#animationClipPath-".concat(a,")")},i.renderAreaStatically(l,c,n,a)))})}},{key:"renderArea",value:function(n,a){var i=this.props,s=i.points,l=i.baseLine,c=i.isAnimationActive,u=this.state,d=u.prevPoints,f=u.prevBaseLine,h=u.totalLength;return c&&s&&s.length&&(!d&&h>0||!au(d,s)||!au(f,l))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(s,l,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,s=a.dot,l=a.points,c=a.className,u=a.top,d=a.left,f=a.xAxis,h=a.yAxis,p=a.width,m=a.height,g=a.isAnimationActive,y=a.id;if(i||!l||!l.length)return null;var x=this.state.isAnimationFinished,v=l.length===1,b=tt("recharts-area",c),j=f&&f.allowDataOverflow,w=h&&h.allowDataOverflow,k=j||w,N=Ge(y)?this.id:y,_=(n=Ue(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},P=_.r,C=P===void 0?3:P,A=_.strokeWidth,O=A===void 0?2:A,T=Pq(s)?s:{},E=T.clipDot,R=E===void 0?!0:E,D=C*2+O;return M.createElement(_t,{className:b},j||w?M.createElement("defs",null,M.createElement("clipPath",{id:"clipPath-".concat(N)},M.createElement("rect",{x:j?d:d-p/2,y:w?u:u-m/2,width:j?p:p*2,height:w?m:m*2})),!R&&M.createElement("clipPath",{id:"clipPath-dots-".concat(N)},M.createElement("rect",{x:d-D/2,y:u-D/2,width:p+D,height:m+D}))):null,v?null:this.renderArea(k,N),(s||v)&&this.renderDots(k,R,N),(!g||x)&&Ni.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(S.PureComponent);QH=lo;Va(lo,"displayName","Area");Va(lo,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!wl.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Va(lo,"getBaseValue",function(e,t,r,n){var a=e.layout,i=e.baseValue,s=t.props.baseValue,l=s??i;if(ue(l)&&typeof l=="number")return l;var c=a==="horizontal"?n:r,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return l==="dataMin"?f:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});Va(lo,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,a=e.yAxis,i=e.xAxisTicks,s=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=t.layout,m=u&&u.length,g=QH.getBaseValue(t,r,n,a),y=p==="horizontal",x=!1,v=f.map(function(j,w){var k;m?k=u[d+w]:(k=Qr(j,c),Array.isArray(k)?x=!0:k=[g,k]);var N=k[1]==null||m&&Qr(j,c)==null;return y?{x:lg({axis:n,ticks:i,bandSize:l,entry:j,index:w}),y:N?null:a.scale(k[1]),value:k,payload:j}:{x:N?null:n.scale(k[1]),y:lg({axis:a,ticks:s,bandSize:l,entry:j,index:w}),value:k,payload:j}}),b;return m||x?b=v.map(function(j){var w=Array.isArray(j.value)?j.value[0]:null;return y?{x:j.x,y:w!=null&&j.y!=null?a.scale(w):null}:{x:w!=null?n.scale(w):null,y:j.y}}):b=y?a.scale(g):n.scale(g),cs({points:v,baseLine:b,layout:p,isRange:x},h)});Va(lo,"renderDotItem",function(e,t){var r;if(M.isValidElement(e))r=M.cloneElement(e,t);else if(Be(e))r=e(t);else{var n=tt("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,i=JH(t,zCe);r=M.createElement(oy,Io({},i,{key:a,className:n}))}return r});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 KCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YCe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,aW(n.key),n)}}function XCe(e,t,r){return t&&YCe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZCe(e,t,r){return t=Ag(t),QCe(e,rW()?Reflect.construct(t,r||[],Ag(e).constructor):t.apply(e,r))}function QCe(e,t){if(t&&(mu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JCe(e)}function JCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rW(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rW=function(){return!!e})()}function Ag(e){return Ag=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ag(e)}function eAe(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&&a_(e,t)}function a_(e,t){return a_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},a_(e,t)}function nW(e,t,r){return t=aW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aW(e){var t=tAe(e,"string");return mu(t)=="symbol"?t:t+""}function tAe(e,t){if(mu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(mu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function i_(){return i_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i_.apply(this,arguments)}function rAe(e){var t=e.xAxisId,r=$C(),n=IC(),a=LH(t);return a==null?null:S.createElement(Vu,i_({},a,{className:tt("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(s){return mi(s,!0)}}))}var Yi=function(e){function t(){return KCe(this,t),ZCe(this,t,arguments)}return eAe(t,e),XCe(t,[{key:"render",value:function(){return S.createElement(rAe,this.props)}}])}(S.Component);nW(Yi,"displayName","XAxis");nW(Yi,"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 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 nAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aAe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,oW(n.key),n)}}function iAe(e,t,r){return t&&aAe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function sAe(e,t,r){return t=Og(t),oAe(e,iW()?Reflect.construct(t,r||[],Og(e).constructor):t.apply(e,r))}function oAe(e,t){if(t&&(gu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lAe(e)}function lAe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iW(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iW=function(){return!!e})()}function Og(e){return Og=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Og(e)}function cAe(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&&s_(e,t)}function s_(e,t){return s_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},s_(e,t)}function sW(e,t,r){return t=oW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oW(e){var t=uAe(e,"string");return gu(t)=="symbol"?t:t+""}function uAe(e,t){if(gu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(gu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function o_(){return o_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o_.apply(this,arguments)}var dAe=function(t){var r=t.yAxisId,n=$C(),a=IC(),i=zH(r);return i==null?null:S.createElement(Vu,o_({},i,{className:tt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:a},ticksGenerator:function(l){return mi(l,!0)}}))},Xi=function(e){function t(){return nAe(this,t),sAe(this,t,arguments)}return cAe(t,e),iAe(t,[{key:"render",value:function(){return S.createElement(dAe,this.props)}}])}(S.Component);sW(Xi,"displayName","YAxis");sW(Xi,"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 HL(e){return mAe(e)||pAe(e)||hAe(e)||fAe()}function fAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
731
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hAe(e,t){if(e){if(typeof e=="string")return l_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l_(e,t)}}function pAe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mAe(e){if(Array.isArray(e))return l_(e)}function l_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var c_=function(t,r,n,a,i){var s=ea(t,zC),l=ea(t,fy),c=[].concat(HL(s),HL(l)),u=ea(t,py),d="".concat(a,"Id"),f=a[0],h=r;if(c.length&&(h=c.reduce(function(g,y){if(y.props[d]===n&&Ka(y.props,"extendDomain")&&ue(y.props[f])){var x=y.props[f];return[Math.min(g[0],x),Math.max(g[1],x)]}return g},h)),u.length){var p="".concat(f,"1"),m="".concat(f,"2");h=u.reduce(function(g,y){if(y.props[d]===n&&Ka(y.props,"extendDomain")&&ue(y.props[p])&&ue(y.props[m])){var x=y.props[p],v=y.props[m];return[Math.min(g[0],x,v),Math.max(g[1],x,v)]}return g},h)}return i&&i.length&&(h=i.reduce(function(g,y){return ue(y)?[Math.min(g[0],y),Math.max(g[1],y)]:g},h)),h},lW={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function i(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),m=r?r+u:u;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,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(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=r?r+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,m=new Array(p);h<p;h++)m[h]=f[h].fn;return m},l.prototype.listenerCount=function(u){var d=r?r+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,p,m){var g=r?r+u:u;if(!this._events[g])return!1;var y=this._events[g],x=arguments.length,v,b;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),x){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,m),!0}for(b=1,v=new Array(x-1);b<x;b++)v[b-1]=arguments[b];y.fn.apply(y.context,v)}else{var j=y.length,w;for(b=0;b<j;b++)switch(y[b].once&&this.removeListener(u,y[b].fn,void 0,!0),x){case 1:y[b].fn.call(y[b].context);break;case 2:y[b].fn.call(y[b].context,d);break;case 3:y[b].fn.call(y[b].context,d,f);break;case 4:y[b].fn.call(y[b].context,d,f,h);break;default:if(!v)for(w=1,v=new Array(x-1);w<x;w++)v[w-1]=arguments[w];y[b].fn.apply(y[b].context,v)}}return!0},l.prototype.on=function(u,d,f){return i(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return i(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var p=r?r+u:u;if(!this._events[p])return this;if(!d)return s(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!h||m.once)&&(!f||m.context===f)&&s(this,p);else{for(var g=0,y=[],x=m.length;g<x;g++)(m[g].fn!==d||h&&!m[g].once||f&&m[g].context!==f)&&y.push(m[g]);y.length?this._events[p]=y.length===1?y[0]:y:s(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&s(this,d)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(lW);var gAe=lW.exports;const xAe=lt(gAe);var Vk=new xAe,qk="recharts.syncMouseEvents";function Eh(e){"@babel/helpers - typeof";return Eh=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},Eh(e)}function yAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vAe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cW(n.key),n)}}function bAe(e,t,r){return t&&vAe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uk(e,t,r){return t=cW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cW(e){var t=wAe(e,"string");return Eh(t)=="symbol"?t:t+""}function wAe(e,t){if(Eh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Eh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jAe=function(){function e(){yAe(this,e),Uk(this,"activeIndex",0),Uk(this,"coordinateList",[]),Uk(this,"layout","horizontal")}return bAe(e,[{key:"setDetails",value:function(r){var n,a=r.coordinateList,i=a===void 0?null:a,s=r.container,l=s===void 0?null:s,c=r.layout,u=c===void 0?null:c,d=r.offset,f=d===void 0?null:d,h=r.mouseHandlerCallback,p=h===void 0?null:h;this.coordinateList=(n=i??this.coordinateList)!==null&&n!==void 0?n:[],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(r){if(this.coordinateList.length!==0)switch(r.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(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,s=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,d=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=i+c+u,h=s+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function kAe(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],a=e==null?void 0:e[1];if(n&&a&&ue(n)&&ue(a))return!0}return!1}function NAe(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function uW(e){var t=e.cx,r=e.cy,n=e.radius,a=e.startAngle,i=e.endAngle,s=Tr(t,r,n,a),l=Tr(t,r,n,i);return{points:[s,l],cx:t,cy:r,radius:n,startAngle:a,endAngle:i}}function SAe(e,t,r){var n,a,i,s;if(e==="horizontal")n=t.x,i=n,a=r.top,s=r.top+r.height;else if(e==="vertical")a=t.y,s=a,n=r.left,i=r.left+r.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=Tr(l,c,u,f),p=Tr(l,c,d,f);n=h.x,a=h.y,i=p.x,s=p.y}else return uW(t);return[{x:n,y:a},{x:i,y:s}]}function Ph(e){"@babel/helpers - typeof";return Ph=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},Ph(e)}function WL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function em(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WL(Object(r),!0).forEach(function(n){_Ae(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _Ae(e,t,r){return t=EAe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EAe(e){var t=PAe(e,"string");return Ph(t)=="symbol"?t:t+""}function PAe(e,t){if(Ph(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ph(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CAe(e){var t,r,n=e.element,a=e.tooltipEventType,i=e.isActive,s=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,p=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!p||!i||!s||h!=="ScatterChart"&&a!=="axis")return null;var m,g=Cc;if(h==="ScatterChart")m=s,g=d_e;else if(h==="BarChart")m=NAe(f,s,c,d),g=OC;else if(f==="radial"){var y=uW(s),x=y.cx,v=y.cy,b=y.radius,j=y.startAngle,w=y.endAngle;m={cx:x,cy:v,startAngle:j,endAngle:w,innerRadius:b,outerRadius:b},g=fH}else m={points:SAe(f,s,c)},g=Cc;var k=em(em(em(em({stroke:"#ccc",pointerEvents:"none"},c),m),Ue(p,!1)),{},{payload:l,payloadIndex:u,className:tt("recharts-tooltip-cursor",p.className)});return S.isValidElement(p)?S.cloneElement(p,k):S.createElement(g,k)}var AAe=["item"],OAe=["children","className","width","height","style","compact","title","desc"];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 fc(){return fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fc.apply(this,arguments)}function GL(e,t){return RAe(e)||MAe(e,t)||fW(e,t)||TAe()}function TAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
732
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MAe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function RAe(e){if(Array.isArray(e))return e}function KL(e,t){if(e==null)return{};var r=DAe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function DAe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $Ae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IAe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,hW(n.key),n)}}function LAe(e,t,r){return t&&IAe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zAe(e,t,r){return t=Tg(t),FAe(e,dW()?Reflect.construct(t,r||[],Tg(e).constructor):t.apply(e,r))}function FAe(e,t){if(t&&(xu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return BAe(e)}function BAe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dW(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dW=function(){return!!e})()}function Tg(e){return Tg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tg(e)}function VAe(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&&u_(e,t)}function u_(e,t){return u_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},u_(e,t)}function yu(e){return HAe(e)||UAe(e)||fW(e)||qAe()}function qAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
733
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fW(e,t){if(e){if(typeof e=="string")return d_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d_(e,t)}}function UAe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function HAe(e){if(Array.isArray(e))return d_(e)}function d_(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function YL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function te(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YL(Object(r),!0).forEach(function(n){Oe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YL(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oe(e,t,r){return t=hW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hW(e){var t=WAe(e,"string");return xu(t)=="symbol"?t:t+""}function WAe(e,t){if(xu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var GAe={xAxis:["bottom","top"],yAxis:["left","right"]},KAe={width:"100%",height:"100%"},pW={x:0,y:0};function tm(e){return e}var YAe=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},XAe=function(t,r,n,a){var i=r.find(function(d){return d&&d.index===n});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var s=i.coordinate,l=a.radius;return te(te(te({},a),Tr(a.cx,a.cy,l,s)),{},{angle:s,radius:l})}var c=i.coordinate,u=a.angle;return te(te(te({},a),Tr(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return pW},my=function(t,r){var n=r.graphicalItems,a=r.dataStartIndex,i=r.dataEndIndex,s=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(yu(l),yu(u)):l},[]);return s.length>0?s:t&&t.length&&ue(a)&&ue(i)?t.slice(a,i+1):[]};function mW(e){return e==="number"?[0,"auto"]:void 0}var f_=function(t,r,n,a){var i=t.graphicalItems,s=t.tooltipAxis,l=my(r,t);return n<0||!i||!i.length||n>=l.length?null:i.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(s.dataKey&&!s.allowDuplicatedCategory){var p=f===void 0?l:f;h=L0(p,s.dataKey,a)}else h=f&&f[n]||l[n];return h?[].concat(yu(c),[cH(u,h)]):c},[])},XL=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},s=YAe(i,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=Gke(s,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=f_(t,r,d,f),p=XAe(n,l,d,i);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},ZAe=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,s=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=sH(d,i);return n.reduce(function(m,g){var y,x=g.type.defaultProps!==void 0?te(te({},g.type.defaultProps),g.props):g.props,v=x.type,b=x.dataKey,j=x.allowDataOverflow,w=x.allowDuplicatedCategory,k=x.scale,N=x.ticks,_=x.includeHidden,P=x[s];if(m[P])return m;var C=my(t.data,{graphicalItems:a.filter(function(V){var L,B=s in V.props?V.props[s]:(L=V.type.defaultProps)===null||L===void 0?void 0:L[s];return B===P}),dataStartIndex:c,dataEndIndex:u}),A=C.length,O,T,E;kAe(x.domain,j,v)&&(O=CS(x.domain,null,j),p&&(v==="number"||k!=="auto")&&(E=af(C,b,"category")));var R=mW(v);if(!O||O.length===0){var D,z=(D=x.domain)!==null&&D!==void 0?D:R;if(b){if(O=af(C,b,v),v==="category"&&p){var I=Bxe(O);w&&I?(T=O,O=yg(0,A)):w||(O=PI(z,O,g).reduce(function(V,L){return V.indexOf(L)>=0?V:[].concat(yu(V),[L])},[]))}else if(v==="category")w?O=O.filter(function(V){return V!==""&&!Ge(V)}):O=PI(z,O,g).reduce(function(V,L){return V.indexOf(L)>=0||L===""||Ge(L)?V:[].concat(yu(V),[L])},[]);else if(v==="number"){var $=Qke(C,a.filter(function(V){var L,B,Y=s in V.props?V.props[s]:(L=V.type.defaultProps)===null||L===void 0?void 0:L[s],W="hide"in V.props?V.props.hide:(B=V.type.defaultProps)===null||B===void 0?void 0:B.hide;return Y===P&&(_||!W)}),b,i,d);$&&(O=$)}p&&(v==="number"||k!=="auto")&&(E=af(C,b,"category"))}else p?O=yg(0,A):l&&l[P]&&l[P].hasStack&&v==="number"?O=h==="expand"?[0,1]:lH(l[P].stackGroups,c,u):O=iH(C,a.filter(function(V){var L=s in V.props?V.props[s]:V.type.defaultProps[s],B="hide"in V.props?V.props.hide:V.type.defaultProps.hide;return L===P&&(_||!B)}),v,d,!0);if(v==="number")O=c_(f,O,P,i,N),z&&(O=CS(z,O,j));else if(v==="category"&&z){var F=z,q=O.every(function(V){return F.indexOf(V)>=0});q&&(O=F)}}return te(te({},m),{},Oe({},P,te(te({},x),{},{axisType:i,domain:O,categoricalDomain:E,duplicateDomain:T,originalDomain:(y=x.domain)!==null&&y!==void 0?y:R,isCategorical:p,layout:d})))},{})},QAe=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,s=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=my(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),p=h.length,m=sH(d,i),g=-1;return n.reduce(function(y,x){var v=x.type.defaultProps!==void 0?te(te({},x.type.defaultProps),x.props):x.props,b=v[s],j=mW("number");if(!y[b]){g++;var w;return m?w=yg(0,p):l&&l[b]&&l[b].hasStack?(w=lH(l[b].stackGroups,c,u),w=c_(f,w,b,i)):(w=CS(j,iH(h,n.filter(function(k){var N,_,P=s in k.props?k.props[s]:(N=k.type.defaultProps)===null||N===void 0?void 0:N[s],C="hide"in k.props?k.props.hide:(_=k.type.defaultProps)===null||_===void 0?void 0:_.hide;return P===b&&!C}),"number",d),a.defaultProps.allowDataOverflow),w=c_(f,w,b,i)),te(te({},y),{},Oe({},b,te(te({axisType:i},a.defaultProps),{},{hide:!0,orientation:Jn(GAe,"".concat(i,".").concat(g%2),null),domain:w,originalDomain:j,isCategorical:m,layout:d})))}return y},{})},JAe=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,s=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.children,f="".concat(a,"Id"),h=ea(d,i),p={};return h&&h.length?p=ZAe(t,{axes:h,graphicalItems:s,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):s&&s.length&&(p=QAe(t,{Axis:i,graphicalItems:s,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},eOe=function(t){var r=vs(t),n=mi(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:sC(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:cg(r,n)}},ZL=function(t){var r=t.children,n=t.defaultShowTooltip,a=yn(r,dl),i=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(s=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},tOe=function(t){return!t||!t.length?!1:t.some(function(r){var n=wi(r&&r.type);return n&&n.indexOf("Bar")>=0})},QL=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"}},rOe=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,s=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,d=n.height,f=n.children,h=n.margin||{},p=yn(f,dl),m=yn(f,zs),g=Object.keys(c).reduce(function(w,k){var N=c[k],_=N.orientation;return!N.mirror&&!N.hide?te(te({},w),{},Oe({},_,w[_]+N.width)):w},{left:h.left||0,right:h.right||0}),y=Object.keys(s).reduce(function(w,k){var N=s[k],_=N.orientation;return!N.mirror&&!N.hide?te(te({},w),{},Oe({},_,Jn(w,"".concat(_))+N.height)):w},{top:h.top||0,bottom:h.bottom||0}),x=te(te({},y),g),v=x.bottom;p&&(x.bottom+=p.props.height||dl.defaultProps.height),m&&r&&(x=Xke(x,a,n,r));var b=u-x.left-x.right,j=d-x.top-x.bottom;return te(te({brushBottom:v},x),{},{width:Math.max(b,0),height:Math.max(j,0)})},nOe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},VC=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(x,v){var b=v.graphicalItems,j=v.stackGroups,w=v.offset,k=v.updateId,N=v.dataStartIndex,_=v.dataEndIndex,P=x.barSize,C=x.layout,A=x.barGap,O=x.barCategoryGap,T=x.maxBarSize,E=QL(C),R=E.numericAxisName,D=E.cateAxisName,z=tOe(b),I=[];return b.forEach(function($,F){var q=my(x.data,{graphicalItems:[$],dataStartIndex:N,dataEndIndex:_}),V=$.type.defaultProps!==void 0?te(te({},$.type.defaultProps),$.props):$.props,L=V.dataKey,B=V.maxBarSize,Y=V["".concat(R,"Id")],W=V["".concat(D,"Id")],K={},Q=c.reduce(function(st,xe){var rt=v["".concat(xe.axisType,"Map")],Le=V["".concat(xe.axisType,"Id")];rt&&rt[Le]||xe.axisType==="zAxis"||ul();var Me=rt[Le];return te(te({},st),{},Oe(Oe({},xe.axisType,Me),"".concat(xe.axisType,"Ticks"),mi(Me)))},K),X=Q[D],ee=Q["".concat(D,"Ticks")],U=j&&j[Y]&&j[Y].hasStack&&u2e($,j[Y].stackGroups),G=wi($.type).indexOf("Bar")>=0,ae=cg(X,ee),ce=[],de=z&&Kke({barSize:P,stackGroups:j,totalSize:nOe(Q,D)});if(G){var je,le,se=Ge(B)?T:B,$e=(je=(le=cg(X,ee,!0))!==null&&le!==void 0?le:se)!==null&&je!==void 0?je:0;ce=Yke({barGap:A,barCategoryGap:O,bandSize:$e!==ae?$e:ae,sizeList:de[W],maxBarSize:se}),$e!==ae&&(ce=ce.map(function(st){return te(te({},st),{},{position:te(te({},st.position),{},{offset:st.position.offset-$e/2})})}))}var Pt=$&&$.type&&$.type.getComposedData;Pt&&I.push({props:te(te({},Pt(te(te({},Q),{},{displayedData:q,props:x,dataKey:L,item:$,bandSize:ae,barPosition:ce,offset:w,stackedData:U,layout:C,dataStartIndex:N,dataEndIndex:_}))),{},Oe(Oe(Oe({key:$.key||"item-".concat(F)},R,Q[R]),D,Q[D]),"animationId",k)),childIndex:Jxe($,x.children),item:$})}),I},p=function(x,v){var b=x.props,j=x.dataStartIndex,w=x.dataEndIndex,k=x.updateId;if(!i$({props:b}))return null;var N=b.children,_=b.layout,P=b.stackOffset,C=b.data,A=b.reverseStackOrder,O=QL(_),T=O.numericAxisName,E=O.cateAxisName,R=ea(N,n),D=o2e(C,R,"".concat(T,"Id"),"".concat(E,"Id"),P,A),z=c.reduce(function(V,L){var B="".concat(L.axisType,"Map");return te(te({},V),{},Oe({},B,JAe(b,te(te({},L),{},{graphicalItems:R,stackGroups:L.axisType===T&&D,dataStartIndex:j,dataEndIndex:w}))))},{}),I=rOe(te(te({},z),{},{props:b,graphicalItems:R}),v==null?void 0:v.legendBBox);Object.keys(z).forEach(function(V){z[V]=d(b,z[V],I,V.replace("Map",""),r)});var $=z["".concat(E,"Map")],F=eOe($),q=h(b,te(te({},z),{},{dataStartIndex:j,dataEndIndex:w,updateId:k,graphicalItems:R,stackGroups:D,offset:I}));return te(te({formattedGraphicalItems:q,graphicalItems:R,offset:I,stackGroups:D},F),z)},m=function(y){function x(v){var b,j,w;return $Ae(this,x),w=zAe(this,x,[v]),Oe(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Oe(w,"accessibilityManager",new jAe),Oe(w,"handleLegendBBoxUpdate",function(k){if(k){var N=w.state,_=N.dataStartIndex,P=N.dataEndIndex,C=N.updateId;w.setState(te({legendBBox:k},p({props:w.props,dataStartIndex:_,dataEndIndex:P,updateId:C},te(te({},w.state),{},{legendBBox:k}))))}}),Oe(w,"handleReceiveSyncEvent",function(k,N,_){if(w.props.syncId===k){if(_===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(N)}}),Oe(w,"handleBrushChange",function(k){var N=k.startIndex,_=k.endIndex;if(N!==w.state.dataStartIndex||_!==w.state.dataEndIndex){var P=w.state.updateId;w.setState(function(){return te({dataStartIndex:N,dataEndIndex:_},p({props:w.props,dataStartIndex:N,dataEndIndex:_,updateId:P},w.state))}),w.triggerSyncEvent({dataStartIndex:N,dataEndIndex:_})}}),Oe(w,"handleMouseEnter",function(k){var N=w.getMouseInfo(k);if(N){var _=te(te({},N),{},{isTooltipActive:!0});w.setState(_),w.triggerSyncEvent(_);var P=w.props.onMouseEnter;Be(P)&&P(_,k)}}),Oe(w,"triggeredAfterMouseMove",function(k){var N=w.getMouseInfo(k),_=N?te(te({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(_),w.triggerSyncEvent(_);var P=w.props.onMouseMove;Be(P)&&P(_,k)}),Oe(w,"handleItemMouseEnter",function(k){w.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),Oe(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),Oe(w,"handleMouseMove",function(k){k.persist(),w.throttleTriggeredAfterMouseMove(k)}),Oe(w,"handleMouseLeave",function(k){w.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};w.setState(N),w.triggerSyncEvent(N);var _=w.props.onMouseLeave;Be(_)&&_(N,k)}),Oe(w,"handleOuterEvent",function(k){var N=Qxe(k),_=Jn(w.props,"".concat(N));if(N&&Be(_)){var P,C;/.*touch.*/i.test(N)?C=w.getMouseInfo(k.changedTouches[0]):C=w.getMouseInfo(k),_((P=C)!==null&&P!==void 0?P:{},k)}}),Oe(w,"handleClick",function(k){var N=w.getMouseInfo(k);if(N){var _=te(te({},N),{},{isTooltipActive:!0});w.setState(_),w.triggerSyncEvent(_);var P=w.props.onClick;Be(P)&&P(_,k)}}),Oe(w,"handleMouseDown",function(k){var N=w.props.onMouseDown;if(Be(N)){var _=w.getMouseInfo(k);N(_,k)}}),Oe(w,"handleMouseUp",function(k){var N=w.props.onMouseUp;if(Be(N)){var _=w.getMouseInfo(k);N(_,k)}}),Oe(w,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),Oe(w,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&w.handleMouseDown(k.changedTouches[0])}),Oe(w,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&w.handleMouseUp(k.changedTouches[0])}),Oe(w,"handleDoubleClick",function(k){var N=w.props.onDoubleClick;if(Be(N)){var _=w.getMouseInfo(k);N(_,k)}}),Oe(w,"handleContextMenu",function(k){var N=w.props.onContextMenu;if(Be(N)){var _=w.getMouseInfo(k);N(_,k)}}),Oe(w,"triggerSyncEvent",function(k){w.props.syncId!==void 0&&Vk.emit(qk,w.props.syncId,k,w.eventEmitterSymbol)}),Oe(w,"applySyncEvent",function(k){var N=w.props,_=N.layout,P=N.syncMethod,C=w.state.updateId,A=k.dataStartIndex,O=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)w.setState(te({dataStartIndex:A,dataEndIndex:O},p({props:w.props,dataStartIndex:A,dataEndIndex:O,updateId:C},w.state)));else if(k.activeTooltipIndex!==void 0){var T=k.chartX,E=k.chartY,R=k.activeTooltipIndex,D=w.state,z=D.offset,I=D.tooltipTicks;if(!z)return;if(typeof P=="function")R=P(I,k);else if(P==="value"){R=-1;for(var $=0;$<I.length;$++)if(I[$].value===k.activeLabel){R=$;break}}var F=te(te({},z),{},{x:z.left,y:z.top}),q=Math.min(T,F.x+F.width),V=Math.min(E,F.y+F.height),L=I[R]&&I[R].value,B=f_(w.state,w.props.data,R),Y=I[R]?{x:_==="horizontal"?I[R].coordinate:q,y:_==="horizontal"?V:I[R].coordinate}:pW;w.setState(te(te({},k),{},{activeLabel:L,activeCoordinate:Y,activePayload:B,activeTooltipIndex:R}))}else w.setState(k)}),Oe(w,"renderCursor",function(k){var N,_=w.state,P=_.isTooltipActive,C=_.activeCoordinate,A=_.activePayload,O=_.offset,T=_.activeTooltipIndex,E=_.tooltipAxisBandSize,R=w.getTooltipEventType(),D=(N=k.props.active)!==null&&N!==void 0?N:P,z=w.props.layout,I=k.key||"_recharts-cursor";return M.createElement(CAe,{key:I,activeCoordinate:C,activePayload:A,activeTooltipIndex:T,chartName:r,element:k,isActive:D,layout:z,offset:O,tooltipAxisBandSize:E,tooltipEventType:R})}),Oe(w,"renderPolarAxis",function(k,N,_){var P=Jn(k,"type.axisType"),C=Jn(w.state,"".concat(P,"Map")),A=k.type.defaultProps,O=A!==void 0?te(te({},A),k.props):k.props,T=C&&C[O["".concat(P,"Id")]];return S.cloneElement(k,te(te({},T),{},{className:tt(P,T.className),key:k.key||"".concat(N,"-").concat(_),ticks:mi(T,!0)}))}),Oe(w,"renderPolarGrid",function(k){var N=k.props,_=N.radialLines,P=N.polarAngles,C=N.polarRadius,A=w.state,O=A.radiusAxisMap,T=A.angleAxisMap,E=vs(O),R=vs(T),D=R.cx,z=R.cy,I=R.innerRadius,$=R.outerRadius;return S.cloneElement(k,{polarAngles:Array.isArray(P)?P:mi(R,!0).map(function(F){return F.coordinate}),polarRadius:Array.isArray(C)?C:mi(E,!0).map(function(F){return F.coordinate}),cx:D,cy:z,innerRadius:I,outerRadius:$,key:k.key||"polar-grid",radialLines:_})}),Oe(w,"renderLegend",function(){var k=w.state.formattedGraphicalItems,N=w.props,_=N.children,P=N.width,C=N.height,A=w.props.margin||{},O=P-(A.left||0)-(A.right||0),T=nH({children:_,formattedGraphicalItems:k,legendWidth:O,legendContent:u});if(!T)return null;var E=T.item,R=KL(T,AAe);return S.cloneElement(E,te(te({},R),{},{chartWidth:P,chartHeight:C,margin:A,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),Oe(w,"renderTooltip",function(){var k,N=w.props,_=N.children,P=N.accessibilityLayer,C=yn(_,jn);if(!C)return null;var A=w.state,O=A.isTooltipActive,T=A.activeCoordinate,E=A.activePayload,R=A.activeLabel,D=A.offset,z=(k=C.props.active)!==null&&k!==void 0?k:O;return S.cloneElement(C,{viewBox:te(te({},D),{},{x:D.left,y:D.top}),active:z,label:R,payload:z?E:[],coordinate:T,accessibilityLayer:P})}),Oe(w,"renderBrush",function(k){var N=w.props,_=N.margin,P=N.data,C=w.state,A=C.offset,O=C.dataStartIndex,T=C.dataEndIndex,E=C.updateId;return S.cloneElement(k,{key:k.key||"_recharts-brush",onChange:Xp(w.handleBrushChange,k.props.onChange),data:P,x:ue(k.props.x)?k.props.x:A.left,y:ue(k.props.y)?k.props.y:A.top+A.height+A.brushBottom-(_.bottom||0),width:ue(k.props.width)?k.props.width:A.width,startIndex:O,endIndex:T,updateId:"brush-".concat(E)})}),Oe(w,"renderReferenceElement",function(k,N,_){if(!k)return null;var P=w,C=P.clipPathId,A=w.state,O=A.xAxisMap,T=A.yAxisMap,E=A.offset,R=k.type.defaultProps||{},D=k.props,z=D.xAxisId,I=z===void 0?R.xAxisId:z,$=D.yAxisId,F=$===void 0?R.yAxisId:$;return S.cloneElement(k,{key:k.key||"".concat(N,"-").concat(_),xAxis:O[I],yAxis:T[F],viewBox:{x:E.left,y:E.top,width:E.width,height:E.height},clipPathId:C})}),Oe(w,"renderActivePoints",function(k){var N=k.item,_=k.activePoint,P=k.basePoint,C=k.childIndex,A=k.isRange,O=[],T=N.props.key,E=N.item.type.defaultProps!==void 0?te(te({},N.item.type.defaultProps),N.item.props):N.item.props,R=E.activeDot,D=E.dataKey,z=te(te({index:C,dataKey:D,cx:_.x,cy:_.y,r:4,fill:AC(N.item),strokeWidth:2,stroke:"#fff",payload:_.payload,value:_.value},Ue(R,!1)),z0(R));return O.push(x.renderActiveDot(R,z,"".concat(T,"-activePoint-").concat(C))),P?O.push(x.renderActiveDot(R,te(te({},z),{},{cx:P.x,cy:P.y}),"".concat(T,"-basePoint-").concat(C))):A&&O.push(null),O}),Oe(w,"renderGraphicChild",function(k,N,_){var P=w.filterFormatItem(k,N,_);if(!P)return null;var C=w.getTooltipEventType(),A=w.state,O=A.isTooltipActive,T=A.tooltipAxis,E=A.activeTooltipIndex,R=A.activeLabel,D=w.props.children,z=yn(D,jn),I=P.props,$=I.points,F=I.isRange,q=I.baseLine,V=P.item.type.defaultProps!==void 0?te(te({},P.item.type.defaultProps),P.item.props):P.item.props,L=V.activeDot,B=V.hide,Y=V.activeBar,W=V.activeShape,K=!!(!B&&O&&z&&(L||Y||W)),Q={};C!=="axis"&&z&&z.props.trigger==="click"?Q={onClick:Xp(w.handleItemMouseEnter,k.props.onClick)}:C!=="axis"&&(Q={onMouseLeave:Xp(w.handleItemMouseLeave,k.props.onMouseLeave),onMouseEnter:Xp(w.handleItemMouseEnter,k.props.onMouseEnter)});var X=S.cloneElement(k,te(te({},P.props),Q));function ee(xe){return typeof T.dataKey=="function"?T.dataKey(xe.payload):null}if(K)if(E>=0){var U,G;if(T.dataKey&&!T.allowDuplicatedCategory){var ae=typeof T.dataKey=="function"?ee:"payload.".concat(T.dataKey.toString());U=L0($,ae,R),G=F&&q&&L0(q,ae,R)}else U=$==null?void 0:$[E],G=F&&q&&q[E];if(W||Y){var ce=k.props.activeIndex!==void 0?k.props.activeIndex:E;return[S.cloneElement(k,te(te(te({},P.props),Q),{},{activeIndex:ce})),null,null]}if(!Ge(U))return[X].concat(yu(w.renderActivePoints({item:P,activePoint:U,basePoint:G,childIndex:E,isRange:F})))}else{var de,je=(de=w.getItemByXY(w.state.activeCoordinate))!==null&&de!==void 0?de:{graphicalItem:X},le=je.graphicalItem,se=le.item,$e=se===void 0?k:se,Pt=le.childIndex,st=te(te(te({},P.props),Q),{},{activeIndex:Pt});return[S.cloneElement($e,st),null,null]}return F?[X,null,null]:[X,null]}),Oe(w,"renderCustomized",function(k,N,_){return S.cloneElement(k,te(te({key:"recharts-customized-".concat(_)},w.props),w.state))}),Oe(w,"renderMap",{CartesianGrid:{handler:tm,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:tm},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:tm},YAxis:{handler:tm},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((b=v.id)!==null&&b!==void 0?b:zu("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=oU(w.triggeredAfterMouseMove,(j=v.throttleDelay)!==null&&j!==void 0?j:1e3/60),w.state={},w}return VAe(x,y),LAe(x,[{key:"componentDidMount",value:function(){var b,j;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,j=b.children,w=b.data,k=b.height,N=b.layout,_=yn(j,jn);if(_){var P=_.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,A=f_(this.state,w,P,C),O=this.state.tooltipTicks[P].coordinate,T=(this.state.offset.top+k)/2,E=N==="horizontal",R=E?{x:O,y:T}:{y:O,x:T},D=this.state.formattedGraphicalItems.find(function(I){var $=I.item;return $.type.name==="Scatter"});D&&(R=te(te({},R),D.props.points[P].tooltipPosition),A=D.props.points[P].tooltipPayload);var z={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:C,activePayload:A,activeCoordinate:R};this.setState(z),this.renderCursor(_),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,j){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==j.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var w,k;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(b){ZN([yn(b.children,jn)],[yn(this.props.children,jn)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=yn(this.props.children,jn);if(b&&typeof b.props.shared=="boolean"){var j=b.props.shared?"axis":"item";return l.indexOf(j)>=0?j:i}return i}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var j=this.container,w=j.getBoundingClientRect(),k=c1e(w),N={chartX:Math.round(b.pageX-k.left),chartY:Math.round(b.pageY-k.top)},_=w.width/j.offsetWidth||1,P=this.inRange(N.chartX,N.chartY,_);if(!P)return null;var C=this.state,A=C.xAxisMap,O=C.yAxisMap,T=this.getTooltipEventType(),E=XL(this.state,this.props.data,this.props.layout,P);if(T!=="axis"&&A&&O){var R=vs(A).scale,D=vs(O).scale,z=R&&R.invert?R.invert(N.chartX):null,I=D&&D.invert?D.invert(N.chartY):null;return te(te({},N),{},{xValue:z,yValue:I},E)}return E?te(te({},N),E):null}},{key:"inRange",value:function(b,j){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,N=b/w,_=j/w;if(k==="horizontal"||k==="vertical"){var P=this.state.offset,C=N>=P.left&&N<=P.left+P.width&&_>=P.top&&_<=P.top+P.height;return C?{x:N,y:_}:null}var A=this.state,O=A.angleAxisMap,T=A.radiusAxisMap;if(O&&T){var E=vs(O);return OI({x:N,y:_},E)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,j=this.getTooltipEventType(),w=yn(b,jn),k={};w&&j==="axis"&&(w.props.trigger==="click"?k={onClick:this.handleClick}:k={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 N=z0(this.props,this.handleOuterEvent);return te(te({},N),k)}},{key:"addListener",value:function(){Vk.on(qk,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Vk.removeListener(qk,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,j,w){for(var k=this.state.formattedGraphicalItems,N=0,_=k.length;N<_;N++){var P=k[N];if(P.item===b||P.props.key===b.key||j===wi(P.item.type)&&w===P.childIndex)return P}return null}},{key:"renderClipPath",value:function(){var b=this.clipPathId,j=this.state.offset,w=j.left,k=j.top,N=j.height,_=j.width;return M.createElement("defs",null,M.createElement("clipPath",{id:b},M.createElement("rect",{x:w,y:k,height:N,width:_})))}},{key:"getXScales",value:function(){var b=this.state.xAxisMap;return b?Object.entries(b).reduce(function(j,w){var k=GL(w,2),N=k[0],_=k[1];return te(te({},j),{},Oe({},N,_.scale))},{}):null}},{key:"getYScales",value:function(){var b=this.state.yAxisMap;return b?Object.entries(b).reduce(function(j,w){var k=GL(w,2),N=k[0],_=k[1];return te(te({},j),{},Oe({},N,_.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(b){var j;return(j=this.state.xAxisMap)===null||j===void 0||(j=j[b])===null||j===void 0?void 0:j.scale}},{key:"getYScaleByAxisId",value:function(b){var j;return(j=this.state.yAxisMap)===null||j===void 0||(j=j[b])===null||j===void 0?void 0:j.scale}},{key:"getItemByXY",value:function(b){var j=this.state,w=j.formattedGraphicalItems,k=j.activeItem;if(w&&w.length)for(var N=0,_=w.length;N<_;N++){var P=w[N],C=P.props,A=P.item,O=A.type.defaultProps!==void 0?te(te({},A.type.defaultProps),A.props):A.props,T=wi(A.type);if(T==="Bar"){var E=(C.data||[]).find(function(I){return t_e(b,I)});if(E)return{graphicalItem:P,payload:E}}else if(T==="RadialBar"){var R=(C.data||[]).find(function(I){return OI(b,I)});if(R)return{graphicalItem:P,payload:R}}else if(ly(P,k)||cy(P,k)||jh(P,k)){var D=W_e({graphicalItem:P,activeTooltipItem:k,itemData:O.data}),z=O.activeIndex===void 0?D:O.activeIndex;return{graphicalItem:te(te({},P),{},{childIndex:z}),payload:jh(P,k)?O.data[D]:P.props.data[D]}}}return null}},{key:"render",value:function(){var b=this;if(!i$(this))return null;var j=this.props,w=j.children,k=j.className,N=j.width,_=j.height,P=j.style,C=j.compact,A=j.title,O=j.desc,T=KL(j,OAe),E=Ue(T,!1);if(C)return M.createElement(EL,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},M.createElement(JN,fc({},E,{width:N,height:_,title:A,desc:O}),this.renderClipPath(),o$(w,this.renderMap)));if(this.props.accessibilityLayer){var R,D;E.tabIndex=(R=this.props.tabIndex)!==null&&R!==void 0?R:0,E.role=(D=this.props.role)!==null&&D!==void 0?D:"application",E.onKeyDown=function(I){b.accessibilityManager.keyboardEvent(I)},E.onFocus=function(){b.accessibilityManager.focus()}}var z=this.parseEventsOfWrapper();return M.createElement(EL,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},M.createElement("div",fc({className:tt("recharts-wrapper",k),style:te({position:"relative",cursor:"default",width:N,height:_},P)},z,{ref:function($){b.container=$}}),M.createElement(JN,fc({},E,{width:N,height:_,title:A,desc:O,style:KAe}),this.renderClipPath(),o$(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(S.Component);Oe(m,"displayName",r),Oe(m,"defaultProps",te({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Oe(m,"getDerivedStateFromProps",function(y,x){var v=y.dataKey,b=y.data,j=y.children,w=y.width,k=y.height,N=y.layout,_=y.stackOffset,P=y.margin,C=x.dataStartIndex,A=x.dataEndIndex;if(x.updateId===void 0){var O=ZL(y);return te(te(te({},O),{},{updateId:0},p(te(te({props:y},O),{},{updateId:0}),x)),{},{prevDataKey:v,prevData:b,prevWidth:w,prevHeight:k,prevLayout:N,prevStackOffset:_,prevMargin:P,prevChildren:j})}if(v!==x.prevDataKey||b!==x.prevData||w!==x.prevWidth||k!==x.prevHeight||N!==x.prevLayout||_!==x.prevStackOffset||!Ec(P,x.prevMargin)){var T=ZL(y),E={chartX:x.chartX,chartY:x.chartY,isTooltipActive:x.isTooltipActive},R=te(te({},XL(x,b,N)),{},{updateId:x.updateId+1}),D=te(te(te({},T),E),R);return te(te(te({},D),p(te({props:y},D),x)),{},{prevDataKey:v,prevData:b,prevWidth:w,prevHeight:k,prevLayout:N,prevStackOffset:_,prevMargin:P,prevChildren:j})}if(!ZN(j,x.prevChildren)){var z,I,$,F,q=yn(j,dl),V=q&&(z=(I=q.props)===null||I===void 0?void 0:I.startIndex)!==null&&z!==void 0?z:C,L=q&&($=(F=q.props)===null||F===void 0?void 0:F.endIndex)!==null&&$!==void 0?$:A,B=V!==C||L!==A,Y=!Ge(b),W=Y&&!B?x.updateId:x.updateId+1;return te(te({updateId:W},p(te(te({props:y},x),{},{updateId:W,dataStartIndex:V,dataEndIndex:L}),x)),{},{prevChildren:j,dataStartIndex:V,dataEndIndex:L})}return null}),Oe(m,"renderActiveDot",function(y,x,v){var b;return S.isValidElement(y)?b=S.cloneElement(y,x):Be(y)?b=y(x):b=M.createElement(oy,x),M.createElement(_t,{className:"recharts-active-dot",key:v},b)});var g=S.forwardRef(function(x,v){return M.createElement(m,fc({},x,{ref:v}))});return g.displayName=m.displayName,g},aOe=VC({chartName:"LineChart",GraphicalChild:np,axisComponents:[{axisType:"xAxis",AxisComp:Yi},{axisType:"yAxis",AxisComp:Xi}],formatAxisMap:TC}),gW=VC({chartName:"BarChart",GraphicalChild:oo,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Yi},{axisType:"yAxis",AxisComp:Xi}],formatAxisMap:TC}),iOe=VC({chartName:"AreaChart",GraphicalChild:lo,axisComponents:[{axisType:"xAxis",AxisComp:Yi},{axisType:"yAxis",AxisComp:Xi}],formatAxisMap:TC});const Bn=[{main:"#3b82f6",light:"#93c5fd"},{main:"#8b5cf6",light:"#c4b5fd"},{main:"#10b981",light:"#6ee7b7"},{main:"#f59e0b",light:"#fcd34d"},{main:"#ef4444",light:"#fca5a5"},{main:"#ec4899",light:"#f9a8d4"},{main:"#06b6d4",light:"#67e8f9"},{main:"#84cc16",light:"#bef264"}],sOe=({active:e,payload:t,label:r})=>e&&t&&t.length?o.jsxs(ge.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"bg-white/95 backdrop-blur-lg p-4 rounded-xl shadow-2xl border border-slate-200/50 max-w-xs",children:[o.jsxs("p",{className:"font-bold text-slate-900 mb-2 flex items-center gap-2",children:[o.jsx(jE,{size:14,className:"text-primary-500"}),"Epoch ",r]}),o.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:t.map((n,a)=>o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:n.color}}),o.jsx("span",{className:"text-sm text-slate-600 truncate",children:n.name})]}),o.jsx("span",{className:"text-sm font-mono font-bold text-slate-900",children:typeof n.value=="number"?n.value.toExponential(4):n.value})]},a))})]}):null;function rm({icon:e,label:t,value:r,trend:n,color:a,subValue:i}){const s=n==="up",l=s?Hr:rx;return o.jsxs(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},whileHover:{scale:1.02,y:-2},className:"relative overflow-hidden p-4 bg-gradient-to-br from-white to-slate-50 dark:from-slate-800 dark:to-slate-900 rounded-xl border border-slate-200 dark:border-slate-700 shadow-sm hover:shadow-lg transition-all duration-300",children:[o.jsx("div",{className:"absolute top-0 right-0 w-24 h-24 rounded-full blur-2xl opacity-20",style:{backgroundColor:a}}),o.jsxs("div",{className:"relative",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx("div",{className:"p-2 rounded-lg",style:{backgroundColor:`${a}20`},children:o.jsx(e,{size:16,style:{color:a}})}),o.jsx("span",{className:"text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wide",children:t})]}),o.jsxs("div",{className:"flex items-end justify-between",children:[o.jsx("span",{className:"text-2xl font-bold text-slate-900 dark:text-white font-mono",children:typeof r=="number"?r.toFixed(4):r}),n&&o.jsxs("div",{className:`flex items-center gap-1 text-xs ${s?"text-emerald-600":"text-rose-600"}`,children:[o.jsx(l,{size:12}),o.jsx("span",{className:"font-medium",children:s?"Improving":"Degrading"})]})]}),i&&o.jsx("p",{className:"mt-1 text-xs text-slate-500 dark:text-slate-400",children:i})]})]})}function oOe({scale:e,onChange:t}){return o.jsx("div",{className:"flex items-center gap-1 bg-slate-100 dark:bg-slate-800 rounded-lg p-1",children:["linear","log"].map(r=>o.jsx("button",{onClick:()=>t(r),className:`px-3 py-1.5 text-xs font-medium rounded-md transition-all ${e===r?"bg-white dark:bg-slate-700 text-slate-900 dark:text-white shadow-sm":"text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,children:r==="log"?"Log":"Linear"},r))})}function lOe({metric:e,color:t,visible:r,onToggle:n}){return o.jsxs("button",{onClick:n,className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${r?"bg-white dark:bg-slate-700 shadow-sm border border-slate-200 dark:border-slate-600":"bg-slate-100 dark:bg-slate-800 text-slate-400 dark:text-slate-500"}`,children:[o.jsx("div",{className:`w-3 h-3 rounded-full transition-opacity ${r?"opacity-100":"opacity-30"}`,style:{backgroundColor:t}}),o.jsx("span",{className:r?"text-slate-700 dark:text-slate-200":"",children:e}),r?o.jsx(ju,{size:12}):o.jsx(K8,{size:12})]})}function cOe(e){const t={loss:{train:[],val:[]},accuracy:{train:[],val:[]},other:{train:[],val:[]}};return e.forEach(r=>{const n=r.startsWith("val_"),a=n?r.replace("val_",""):r.replace("train_",""),i=n?"val":"train";a.includes("loss")||a.includes("mse")||a.includes("mae")||a.includes("error")?t.loss[i].push(r):a.includes("accuracy")||a.includes("acc")||a.includes("f1")||a.includes("precision")||a.includes("recall")?t.accuracy[i].push(r):t.other[i].push(r)}),t}function Lm(e){return e.replace("train_","Train ").replace("val_","Val ").replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function Hk({data:e,metrics:t,title:r,icon:n,iconColor:a,compact:i=!1,defaultScale:s="linear",isLossLike:l=!0}){const[c,u]=S.useState(s),[d,f]=S.useState(()=>t.reduce((j,w)=>({...j,[w]:!0}),{})),[h,p]=S.useState(null),[m,g]=S.useState(!1),y=S.useCallback(j=>{f(w=>({...w,[j]:!w[j]}))},[]),x=S.useMemo(()=>c!=="log"?e:e.map(j=>{const w={...j};return t.forEach(k=>{const N=Lm(k);w[N]!==void 0&&w[N]>0?w[N]=w[N]:w[N]!==void 0&&(w[N]=1e-10)}),w}),[e,t,c]),v=t.filter(j=>d[j]),b=m?400:i?200:300;return t.length===0?null:o.jsxs(ge.div,{layout:!0,initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`bg-white dark:bg-slate-800 rounded-2xl border border-slate-200 dark:border-slate-700 shadow-sm overflow-hidden ${m?"col-span-full":""}`,children:[o.jsxs("div",{className:"p-4 border-b border-slate-100 dark:border-slate-700 flex items-center justify-between flex-wrap gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:a}}),o.jsx("h4",{className:"text-sm font-bold text-slate-700 dark:text-slate-300",children:r}),o.jsxs("span",{className:"text-xs text-slate-400",children:["(",v.length,"/",t.length," shown)"]})]}),o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx(oOe,{scale:c,onChange:u}),o.jsx("button",{onClick:()=>g(!m),className:"p-2 rounded-lg bg-slate-100 dark:bg-slate-700 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors",title:m?"Collapse":"Expand",children:o.jsx(Cf,{size:14,className:"text-slate-600 dark:text-slate-300"})})]})]}),o.jsx("div",{className:"px-4 py-3 border-b border-slate-100 dark:border-slate-700 flex flex-wrap gap-2",children:t.map((j,w)=>o.jsx(lOe,{metric:Lm(j),color:Bn[w%Bn.length].main,visible:d[j],onToggle:()=>y(j)},j))}),o.jsx("div",{className:"p-4",children:o.jsx(Zx,{width:"100%",height:b,children:o.jsxs(iOe,{data:x,children:[o.jsx("defs",{children:t.map((j,w)=>o.jsxs("linearGradient",{id:`gradient-${j}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:Bn[w%Bn.length].main,stopOpacity:.3}),o.jsx("stop",{offset:"95%",stopColor:Bn[w%Bn.length].main,stopOpacity:0})]},j))}),o.jsx(rp,{strokeDasharray:"3 3",stroke:"#e2e8f0",strokeOpacity:.5}),o.jsx(Yi,{dataKey:"epoch",stroke:"#94a3b8",tick:{fontSize:11},tickLine:!1,label:{value:"Epoch",position:"insideBottom",offset:-5,fontSize:11,fill:"#94a3b8"}}),o.jsx(Xi,{stroke:"#94a3b8",tick:{fontSize:11},tickLine:!1,scale:c,domain:c==="log"?["auto","auto"]:[0,"auto"],tickFormatter:j=>j===0?"0":Math.abs(j)<.001||Math.abs(j)>1e3?j.toExponential(1):j.toFixed(3),label:{value:c==="log"?"Value (log)":"Value",angle:-90,position:"insideLeft",fontSize:11,fill:"#94a3b8"}}),o.jsx(jn,{content:o.jsx(sOe,{})}),o.jsx(zs,{wrapperStyle:{paddingTop:10},iconType:"circle",iconSize:8}),o.jsx(dl,{dataKey:"epoch",height:30,stroke:"#94a3b8",fill:"#f1f5f9",travellerWidth:10}),t.map((j,w)=>d[j]&&o.jsx(lo,{type:"monotone",dataKey:Lm(j),stroke:Bn[w%Bn.length].main,strokeWidth:2,fill:`url(#gradient-${j})`,dot:!1,activeDot:{r:5,strokeWidth:2,fill:"white"},animationDuration:500},j))]})})}),o.jsx("div",{className:"px-4 py-2 bg-slate-50 dark:bg-slate-900/50 border-t border-slate-100 dark:border-slate-700",children:o.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 dark:text-slate-400",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(LZ,{size:12})," Drag brush to zoom"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(ju,{size:12})," Click legend to toggle"]})]}),o.jsxs("span",{children:[e.length," data points"]})]})})]})}function gy({trainingHistory:e,title:t="Training History",compact:r=!1}){const{chartData:n,metricGroups:a,allMetrics:i,summary:s}=S.useMemo(()=>{if(!e||!e.epochs||e.epochs.length===0)return{chartData:[],metricGroups:{},allMetrics:[],summary:null};const d=e.epochs,f=d.map((g,y)=>{const x={epoch:g};return Object.keys(e).forEach(v=>{var b;v!=="epochs"&&((b=e[v])==null?void 0:b[y])!==void 0&&(x[Lm(v)]=e[v][y])}),x}),h=Object.keys(e).filter(g=>{var y;return g!=="epochs"&&((y=e[g])==null?void 0:y.length)>0}),p=cOe(h),m={totalEpochs:d.length,metrics:{}};return h.forEach(g=>{const y=e[g];if(!y||y.length===0)return;const x=y[y.length-1],v=g.includes("loss")||g.includes("mae")||g.includes("mse")||g.includes("error"),b=v?Math.min(...y):Math.max(...y);m.metrics[g]={final:x,best:b,isLossLike:v,trend:y.length>1?y[y.length-1]<y[y.length-2]?"down":"up":null}}),{chartData:f,metricGroups:p,allMetrics:h,summary:m}},[e]);if(n.length===0)return null;const l=[...a.loss.train,...a.loss.val],c=[...a.accuracy.train,...a.accuracy.val],u=[...a.other.train,...a.other.val];return o.jsxs("div",{className:"space-y-6",children:[!r&&s&&o.jsxs(ge.div,{initial:"hidden",animate:"visible",variants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1}}},className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[o.jsx(rm,{icon:hn,label:"Epochs Trained",value:s.totalEpochs,color:Bn[0].main}),s.metrics.val_loss&&o.jsx(rm,{icon:rx,label:"Best Val Loss",value:s.metrics.val_loss.best,trend:s.metrics.val_loss.trend,color:Bn[1].main}),s.metrics.val_mae&&o.jsx(rm,{icon:jE,label:"Best Val MAE",value:s.metrics.val_mae.best,trend:s.metrics.val_mae.trend,color:Bn[4].main}),s.metrics.val_accuracy&&o.jsx(rm,{icon:Hr,label:"Best Val Accuracy",value:s.metrics.val_accuracy.best,trend:s.metrics.val_accuracy.trend,color:Bn[2].main})]}),o.jsxs("div",{className:`grid gap-6 ${!r&&l.length>0&&c.length>0?"lg:grid-cols-2":""}`,children:[l.length>0&&o.jsx(Hk,{data:n,metrics:l,title:"Loss & Error Metrics",iconColor:"#3b82f6",compact:r,defaultScale:"linear",isLossLike:!0}),c.length>0&&o.jsx(Hk,{data:n,metrics:c,title:"Accuracy & Score Metrics",iconColor:"#10b981",compact:r,defaultScale:"linear",isLossLike:!1}),u.length>0&&o.jsx(Hk,{data:n,metrics:u,title:"Additional Metrics",iconColor:"#06b6d4",compact:r,defaultScale:"linear",isLossLike:!0})]})]})}const Mg=["#3b82f6","#8b5cf6","#10b981","#f59e0b","#ef4444","#ec4899","#06b6d4","#84cc16","#f97316","#6366f1"],xW=({active:e,payload:t,label:r})=>e&&t&&t.length?o.jsxs("div",{className:"bg-white/95 backdrop-blur-lg p-3 rounded-lg shadow-xl border border-slate-200/50",children:[o.jsx("p",{className:"font-medium text-slate-900 text-sm",children:r}),o.jsxs("p",{className:"text-primary-600 text-sm font-mono",children:["Count: ",o.jsx("span",{className:"font-bold",children:t[0].value})]})]}):null;function nm({icon:e,label:t,value:r,subValue:n,color:a="blue"}){const i={blue:"from-blue-500 to-blue-600",purple:"from-purple-500 to-purple-600",emerald:"from-emerald-500 to-emerald-600",amber:"from-amber-500 to-amber-600",rose:"from-rose-500 to-rose-600"};return o.jsx(ge.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 p-4 hover:shadow-md transition-shadow",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:`p-2 rounded-lg bg-gradient-to-br ${i[a]} shadow-sm`,children:o.jsx(e,{size:16,className:"text-white"})}),o.jsxs("div",{children:[o.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 uppercase tracking-wide",children:t}),o.jsx("p",{className:"text-lg font-bold text-slate-900 dark:text-white font-mono",children:r}),n&&o.jsx("p",{className:"text-xs text-slate-400 dark:text-slate-500",children:n})]})]})})}function uOe({column:e,index:t,data:r}){const[n,a]=S.useState(!1),i=Mg[t%Mg.length],s=S.useMemo(()=>{if(!r||!e.values)return null;const f=e.values.filter(w=>w!=null&&!isNaN(w));if(f.length===0)return null;const h=f.map(Number).filter(w=>!isNaN(w));if(h.length===0)return null;const m=h.reduce((w,k)=>w+k,0)/h.length,g=[...h].sort((w,k)=>w-k),y=g[0],x=g[g.length-1],v=g[Math.floor(g.length/2)],b=h.reduce((w,k)=>w+Math.pow(k-m,2),0)/h.length,j=Math.sqrt(b);return{mean:m,min:y,max:x,median:v,std:j,count:h.length}},[e,r]),l=S.useMemo(()=>{if(!s||!e.values)return[];const f=e.values.map(Number).filter(y=>!isNaN(y)),h=Math.min(20,Math.max(5,Math.ceil(Math.sqrt(f.length)))),m=(s.max-s.min)/h||1,g=Array(h).fill(0).map((y,x)=>({range:`${(s.min+x*m).toFixed(2)}`,count:0}));return f.forEach(y=>{const x=Math.min(Math.floor((y-s.min)/m),h-1);x>=0&&x<h&&g[x].count++}),g},[e,s]),c=s!==null,u=e.values?new Set(e.values).size:0,d=e.values?e.values.filter(f=>f==null||f==="").length:0;return o.jsxs(ge.div,{layout:!0,initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:t*.05},className:"bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden",children:[o.jsxs("button",{onClick:()=>a(!n),className:"w-full p-4 flex items-center justify-between hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:i}}),o.jsxs("div",{className:"text-left",children:[o.jsx("h4",{className:"font-semibold text-slate-900 dark:text-white",children:e.name}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-500 dark:text-slate-400",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[c?o.jsx(bE,{size:10}):o.jsx(IZ,{size:10}),c?"Numeric":"Categorical"]}),o.jsx("span",{children:"•"}),o.jsxs("span",{children:[u," unique"]}),d>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"•"}),o.jsxs("span",{className:"text-amber-600 flex items-center gap-1",children:[o.jsx(ex,{size:10}),d," null"]})]})]})]})]}),n?o.jsx(yE,{size:18}):o.jsx(na,{size:18})]}),o.jsx(Zt,{children:n&&o.jsx(ge.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:o.jsxs("div",{className:"p-4 pt-0 border-t border-slate-100 dark:border-slate-700",children:[c&&s&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-3 gap-2 mb-4",children:[o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-900 rounded-lg p-2 text-center",children:[o.jsx("p",{className:"text-xs text-slate-500",children:"Mean"}),o.jsx("p",{className:"font-mono font-bold text-slate-900 dark:text-white",children:s.mean.toFixed(4)})]}),o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-900 rounded-lg p-2 text-center",children:[o.jsx("p",{className:"text-xs text-slate-500",children:"Std Dev"}),o.jsx("p",{className:"font-mono font-bold text-slate-900 dark:text-white",children:s.std.toFixed(4)})]}),o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-900 rounded-lg p-2 text-center",children:[o.jsx("p",{className:"text-xs text-slate-500",children:"Median"}),o.jsx("p",{className:"font-mono font-bold text-slate-900 dark:text-white",children:s.median.toFixed(4)})]}),o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-900 rounded-lg p-2 text-center",children:[o.jsx("p",{className:"text-xs text-slate-500",children:"Min"}),o.jsx("p",{className:"font-mono font-bold text-emerald-600",children:s.min.toFixed(4)})]}),o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-900 rounded-lg p-2 text-center",children:[o.jsx("p",{className:"text-xs text-slate-500",children:"Max"}),o.jsx("p",{className:"font-mono font-bold text-rose-600",children:s.max.toFixed(4)})]}),o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-900 rounded-lg p-2 text-center",children:[o.jsx("p",{className:"text-xs text-slate-500",children:"Count"}),o.jsx("p",{className:"font-mono font-bold text-slate-900 dark:text-white",children:s.count})]})]}),o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-900 rounded-lg p-3",children:[o.jsxs("h5",{className:"text-xs font-semibold text-slate-600 dark:text-slate-400 mb-2 flex items-center gap-1",children:[o.jsx(p0,{size:12})," Distribution"]}),o.jsx(Zx,{width:"100%",height:120,children:o.jsxs(gW,{data:l,children:[o.jsx(rp,{strokeDasharray:"3 3",stroke:"#e2e8f0",strokeOpacity:.5}),o.jsx(Yi,{dataKey:"range",tick:{fontSize:9},tickLine:!1,interval:"preserveStartEnd"}),o.jsx(Xi,{tick:{fontSize:9},tickLine:!1,width:30}),o.jsx(jn,{content:o.jsx(xW,{})}),o.jsx(oo,{dataKey:"count",fill:i,radius:[2,2,0,0]})]})})]})]}),!c&&e.values&&o.jsx(dOe,{values:e.values,color:i})]})})})]})}function dOe({values:e,color:t}){const r=S.useMemo(()=>{const n={};return e.forEach(a=>{const i=a==null?"(null)":String(a);n[i]=(n[i]||0)+1}),Object.entries(n).sort((a,i)=>i[1]-a[1]).slice(0,10).map(([a,i],s)=>({name:a.length>15?a.substring(0,15)+"...":a,count:i,fill:Mg[s%Mg.length]}))},[e]);return o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-900 rounded-lg p-3",children:[o.jsxs("h5",{className:"text-xs font-semibold text-slate-600 dark:text-slate-400 mb-2 flex items-center gap-1",children:[o.jsx(sF,{size:12})," Top Values"]}),o.jsx(Zx,{width:"100%",height:150,children:o.jsxs(gW,{data:r,layout:"vertical",children:[o.jsx(rp,{strokeDasharray:"3 3",stroke:"#e2e8f0",strokeOpacity:.5}),o.jsx(Yi,{type:"number",tick:{fontSize:9}}),o.jsx(Xi,{dataKey:"name",type:"category",tick:{fontSize:9},width:80}),o.jsx(jn,{content:o.jsx(xW,{})}),o.jsx(oo,{dataKey:"count",radius:[0,2,2,0],children:r.map((n,a)=>o.jsx(lC,{fill:n.fill},`cell-${a}`))})]})})]})}function fOe({data:e,columns:t,maxRows:r=10}){if(!e||!t||t.length===0)return null;const n=e.slice(0,r);return o.jsxs("div",{className:"overflow-x-auto rounded-lg border border-slate-200 dark:border-slate-700",children:[o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{className:"bg-slate-100 dark:bg-slate-800",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-3 py-2 text-left text-slate-600 dark:text-slate-400 font-semibold border-b border-slate-200 dark:border-slate-700",children:"#"}),t.map((a,i)=>o.jsx("th",{className:"px-3 py-2 text-left text-slate-600 dark:text-slate-400 font-semibold border-b border-slate-200 dark:border-slate-700",children:a},i))]})}),o.jsx("tbody",{children:n.map((a,i)=>o.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-colors",children:[o.jsx("td",{className:"px-3 py-2 text-slate-400 border-b border-slate-100 dark:border-slate-800 font-mono",children:i+1}),t.map((s,l)=>o.jsx("td",{className:"px-3 py-2 text-slate-700 dark:text-slate-300 border-b border-slate-100 dark:border-slate-800 font-mono",children:a[s]===null||a[s]===void 0?o.jsx("span",{className:"text-slate-400 italic",children:"null"}):typeof a[s]=="number"?a[s].toFixed(4):String(a[s]).substring(0,30)},l))]},i))})]}),e.length>r&&o.jsxs("div",{className:"px-3 py-2 text-center text-xs text-slate-500 bg-slate-50 dark:bg-slate-900",children:["Showing ",r," of ",e.length," rows"]})]})}function hOe(e){if(!e||typeof e!="string")return null;try{let t=e.replace(/'/g,'"').replace(/True/g,"true").replace(/False/g,"false").replace(/None/g,"null");return JSON.parse(t)}catch(t){return console.warn("Failed to parse data string:",t),null}}function pOe(e){if(!e)return null;if(e.features&&typeof e.features=="object")return e;if(e.element_spec||e.cardinality!==void 0)return{_tf_dataset:!0,element_spec:e.element_spec,cardinality:e.cardinality,...e};if(e.columns&&Array.isArray(e.columns)&&e.data&&Array.isArray(e.data)){const t={};return e.columns.forEach((r,n)=>{t[r]=e.data.map(a=>a[n])}),{features:t,target:[]}}if(e.shape&&e.dtype&&Array.isArray(e.data))return{features:{values:e.data.flat()},target:[]};if(typeof e=="object"&&!Array.isArray(e)){const t=Object.keys(e),r=e[t[0]];if(Array.isArray(r)){const n=["target","label","y","labels","targets"],a=t.find(l=>n.includes(l.toLowerCase())),i=t.filter(l=>l!==a),s={};return i.forEach(l=>{s[l]=e[l]}),{features:s,target:a?e[a]:[]}}}return null}function yW({artifact:e}){var a;const[t,r]=S.useState("overview"),n=S.useMemo(()=>{var p,m;if(!e)return null;const i=e.properties||{};let s=e.data||i._full_data||i.data;!s&&e.value&&(s=hOe(e.value));const l=pOe(s);if(l&&l._tf_dataset)return{name:e.name||"Dataset",numSamples:l.cardinality||i.num_samples||i.samples||"Unknown",numFeatures:i.num_features||0,featureColumns:i.feature_columns||[],columns:[],columnNames:[],samples:[],source:i.source||"TensorFlow Dataset",createdAt:e.created_at,isTensorFlow:!0,elementSpec:l.element_spec,tfMetadata:l};if(!l||typeof l!="object")return{name:e.name||"Dataset",numSamples:i.num_samples||i.samples||i.cardinality||0,numFeatures:i.num_features||((p=i.feature_columns)==null?void 0:p.length)||0,featureColumns:i.feature_columns||[],columns:[],columnNames:[],samples:[],source:i.source,createdAt:e.created_at};let c=l.features||{},u=l.target||[],d=[],f=[],h=[];if(c&&typeof c=="object"&&!Array.isArray(c)){f=Object.keys(c);const g=((m=c[f[0]])==null?void 0:m.length)||0;for(let y=0;y<g;y++){const x={};f.forEach(v=>{var b;x[v]=(b=c[v])==null?void 0:b[y]}),Array.isArray(u)&&u.length>y&&(x.target=u[y]),d.push(x)}f.forEach(y=>{h.push({name:y,values:c[y]||[]})}),Array.isArray(u)&&u.length>0&&(f.push("target"),h.push({name:"target",values:u}))}return{name:e.name||"Dataset",numSamples:i.num_samples||i.samples||d.length,numFeatures:i.num_features||f.length-(Array.isArray(u)&&u.length>0?1:0),featureColumns:i.feature_columns||f.filter(g=>g!=="target"),columns:h,columnNames:f,samples:d,source:i.source,createdAt:e.created_at}},[e]);return n?n.isTensorFlow?o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center gap-3 pb-4 border-b border-slate-200 dark:border-slate-700",children:[o.jsx("div",{className:"p-3 bg-gradient-to-br from-orange-500 to-red-600 rounded-xl shadow-lg",children:o.jsx(nr,{size:24,className:"text-white"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-white",children:n.name}),o.jsxs("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:["TensorFlow Dataset • ",n.numSamples," samples"]})]})]}),o.jsxs("div",{className:"bg-gradient-to-br from-orange-50 to-red-50 dark:from-orange-900/20 dark:to-red-900/20 rounded-xl p-6 border border-orange-200 dark:border-orange-800",children:[o.jsxs("h4",{className:"font-bold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[o.jsx(Fe,{size:18,className:"text-orange-600"}),"TensorFlow Dataset Metadata"]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"bg-white dark:bg-slate-800 p-4 rounded-lg",children:[o.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Cardinality"}),o.jsx("p",{className:"text-lg font-bold text-slate-900 dark:text-white font-mono",children:n.numSamples})]}),o.jsxs("div",{className:"bg-white dark:bg-slate-800 p-4 rounded-lg",children:[o.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Source"}),o.jsx("p",{className:"text-lg font-bold text-slate-900 dark:text-white",children:n.source})]})]}),n.elementSpec&&o.jsxs("div",{className:"mt-4 bg-white dark:bg-slate-800 p-4 rounded-lg",children:[o.jsx("p",{className:"text-xs text-slate-500 uppercase tracking-wide mb-2",children:"Element Spec"}),o.jsx("pre",{className:"text-xs font-mono text-slate-700 dark:text-slate-300 overflow-x-auto",children:JSON.stringify(n.elementSpec,null,2)})]}),o.jsx("p",{className:"text-xs text-slate-500 mt-4 italic",children:"💡 TensorFlow datasets are lazy-loaded. Full data visualization requires materializing the dataset."})]})]}):o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center gap-3 pb-4 border-b border-slate-200 dark:border-slate-700",children:[o.jsx("div",{className:"p-3 bg-gradient-to-br from-blue-500 to-indigo-600 rounded-xl shadow-lg",children:o.jsx(nr,{size:24,className:"text-white"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-white",children:n.name}),o.jsxs("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:["Dataset with ",n.numSamples," samples, ",n.numFeatures," features"]})]})]}),o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[o.jsx(nm,{icon:AZ,label:"Samples",value:((a=n.numSamples)==null?void 0:a.toLocaleString())||"—",color:"blue"}),o.jsx(nm,{icon:mZ,label:"Features",value:n.numFeatures||"—",color:"purple"}),o.jsx(nm,{icon:bE,label:"Columns",value:n.columnNames.length,color:"emerald"}),o.jsx(nm,{icon:yi,label:"Source",value:n.source||"Pipeline",color:"amber"})]}),o.jsxs("div",{className:"flex gap-2 border-b border-slate-200 dark:border-slate-700",children:[o.jsxs("button",{onClick:()=>r("overview"),className:`px-4 py-2 text-sm font-medium transition-colors ${t==="overview"?"text-primary-600 border-b-2 border-primary-600":"text-slate-500 hover:text-slate-700"}`,children:[o.jsx(p0,{size:14,className:"inline mr-1"}),"Column Statistics"]}),o.jsxs("button",{onClick:()=>r("sample"),className:`px-4 py-2 text-sm font-medium transition-colors ${t==="sample"?"text-primary-600 border-b-2 border-primary-600":"text-slate-500 hover:text-slate-700"}`,children:[o.jsx(Of,{size:14,className:"inline mr-1"}),"Sample Data"]})]}),o.jsxs(Zt,{mode:"wait",children:[t==="overview"&&o.jsx(ge.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"space-y-3",children:n.columns.length>0?n.columns.map((i,s)=>o.jsx(uOe,{column:i,index:s,data:n.samples},i.name)):o.jsxs("div",{className:"text-center py-8 text-slate-400",children:[o.jsx(p0,{size:32,className:"mx-auto mb-2 opacity-50"}),o.jsx("p",{className:"text-sm",children:"Column statistics not available"}),o.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Data structure may not support detailed analysis"})]})},"overview"),t==="sample"&&o.jsx(ge.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:n.samples.length>0?o.jsx(fOe,{data:n.samples,columns:n.columnNames,maxRows:15}):o.jsxs("div",{className:"text-center py-8 text-slate-400",children:[o.jsx(Of,{size:32,className:"mx-auto mb-2 opacity-50"}),o.jsx("p",{className:"text-sm",children:"Sample data not available"})]})},"sample")]})]}):o.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-slate-400",children:[o.jsx(nr,{size:32,className:"mb-2 opacity-50"}),o.jsx("p",{className:"text-sm",children:"No dataset information available"})]})}Xf.registerLanguage("json",mxe);Xf.registerLanguage("python",wxe);function JL({artifact:e}){var h,p;const[t,r]=S.useState(null),[n,a]=S.useState(null),[i,s]=S.useState(!1),[l,c]=S.useState(null);if(((h=e==null?void 0:e.type)==null?void 0:h.toLowerCase())==="dataset"||((p=e==null?void 0:e.asset_type)==null?void 0:p.toLowerCase())==="dataset")return o.jsx(yW,{artifact:e});S.useEffect(()=>{e!=null&&e.artifact_id&&d()},[e]);const d=async()=>{s(!0),c(null);try{let m="text";if(e.path){const y=e.path.split(".").pop().toLowerCase();["png","jpg","jpeg","svg","gif"].includes(y)?m="image":["json"].includes(y)?m="json":["csv","tsv"].includes(y)&&(m="table")}if(!e.path&&e.value){try{const y=JSON.parse(e.value);r(y),a("json")}catch{r(e.value),a("text")}s(!1);return}const g=await Ne(`/api/assets/${e.artifact_id}/content`);if(g.ok){const y=await g.blob(),x=y.type;if(x.startsWith("image/")||m==="image"){const v=URL.createObjectURL(y);r(v),a("image")}else if(x.includes("json")||m==="json"){const v=await y.text();r(JSON.parse(v)),a("json")}else{const v=await y.text();r(v),a("text")}}else if(e.value)r(e.value),a("text");else throw new Error("Failed to load artifact content")}catch(m){console.error("Failed to load artifact:",m),c("Could not load full content. Showing metadata only.")}finally{s(!1)}};return i?o.jsxs("div",{className:"flex flex-col items-center justify-center p-12 text-slate-400",children:[o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-500 mb-2"}),o.jsx("p",{className:"text-sm",children:"Loading content..."})]}):l?o.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-rose-500 bg-rose-50 rounded-lg border border-rose-100",children:[o.jsx(dn,{size:24,className:"mb-2"}),o.jsx("p",{className:"text-sm font-medium",children:l})]}):(e==null?void 0:e.training_history)&&e.training_history.epochs&&e.training_history.epochs.length>0?o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 mb-4 pb-3 border-b border-slate-200 dark:border-slate-700",children:[o.jsx(Hr,{className:"text-primary-500",size:20}),o.jsx("h4",{className:"text-lg font-bold text-slate-900 dark:text-white",children:"Training History"}),o.jsxs("span",{className:"text-xs text-slate-500 bg-slate-100 dark:bg-slate-800 px-2 py-1 rounded-full",children:[e.training_history.epochs.length," epochs"]})]}),o.jsx(gy,{trainingHistory:e.training_history,compact:!1})]}),t&&n==="json"&&o.jsxs("div",{className:"mt-6 pt-6 border-t border-slate-200 dark:border-slate-700",children:[o.jsxs("h5",{className:"text-sm font-semibold text-slate-600 dark:text-slate-400 mb-3 flex items-center gap-2",children:[o.jsx(NO,{size:14}),"Raw Metadata"]}),o.jsx("div",{className:"rounded-lg overflow-hidden border border-slate-200 dark:border-slate-700 shadow-sm",children:o.jsx("div",{className:"max-h-[30vh] overflow-y-auto bg-white dark:bg-slate-900",children:o.jsx(Xf,{language:"json",style:e$,customStyle:{margin:0,padding:"1rem",fontSize:"0.75rem"},children:JSON.stringify(t,null,2)})})})]})]}):n==="image"?o.jsxs("div",{className:"flex flex-col items-center bg-slate-50 dark:bg-slate-900 p-4 rounded-lg border border-slate-200 dark:border-slate-700",children:[o.jsx("div",{className:"relative rounded-lg overflow-hidden shadow-sm bg-white dark:bg-black",children:o.jsx("img",{src:t,alt:e.name,className:"max-w-full max-h-[60vh] object-contain"})}),o.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-2 flex items-center gap-1",children:[o.jsx(jZ,{size:12}),"Image Preview"]})]}):n==="json"?o.jsxs("div",{className:"rounded-lg overflow-hidden border border-slate-200 dark:border-slate-700 shadow-sm",children:[o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800 px-3 py-2 border-b border-slate-200 dark:border-slate-700 flex items-center gap-2",children:[o.jsx(NO,{size:14,className:"text-slate-500 dark:text-slate-400"}),o.jsx("span",{className:"text-xs font-semibold text-slate-600 dark:text-slate-300",children:"JSON Viewer"})]}),o.jsx("div",{className:"max-h-[50vh] overflow-y-auto bg-white",children:o.jsx(Xf,{language:"json",style:e$,customStyle:{margin:0,padding:"1rem",fontSize:"0.85rem"},children:JSON.stringify(t,null,2)})})]}):o.jsxs("div",{className:"rounded-lg overflow-hidden border border-slate-200 dark:border-slate-700 shadow-sm",children:[o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800 px-3 py-2 border-b border-slate-200 dark:border-slate-700 flex items-center gap-2",children:[o.jsx(qs,{size:14,className:"text-slate-500 dark:text-slate-400"}),o.jsx("span",{className:"text-xs font-semibold text-slate-600 dark:text-slate-300",children:"Text Content"})]}),o.jsx("pre",{className:"p-4 bg-white dark:bg-slate-900 text-slate-800 dark:text-slate-200 text-xs font-mono overflow-x-auto whitespace-pre-wrap max-h-[50vh] overflow-y-auto",children:typeof t=="string"?t:JSON.stringify(t,null,2)})]})}function mOe({code:e,language:t="python",title:r,className:n=""}){const[a,i]=S.useState(!1),s=()=>{navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs("div",{className:`relative group ${n}`,children:[r&&o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-slate-800 dark:bg-slate-900 border-b border-slate-700 rounded-t-lg",children:[o.jsx("span",{className:"text-sm font-medium text-slate-300",children:r}),o.jsx("span",{className:"text-xs text-slate-500 uppercase font-mono",children:t})]}),o.jsxs("div",{className:"relative",children:[o.jsx("pre",{className:`p-4 bg-slate-900 dark:bg-slate-950 text-slate-100 text-sm font-mono overflow-x-auto leading-relaxed ${r?"":"rounded-t-lg"} rounded-b-lg`,children:o.jsx("code",{className:`language-${t}`,children:e})}),o.jsx("button",{onClick:s,className:"absolute top-3 right-3 p-2 bg-slate-800 hover:bg-slate-700 text-slate-400 hover:text-slate-200 rounded-md transition-all opacity-0 group-hover:opacity-100",title:"Copy to clipboard",children:a?o.jsx(Ef,{size:14}):o.jsx(Pf,{size:14})})]})]})}function gOe({runId:e,isRunning:t=!1,autoRefresh:r=!0}){var y,x;const[n,a]=S.useState(null),[i,s]=S.useState(!0),[l,c]=S.useState(null),[u,d]=S.useState(null),[f,h]=S.useState(!1),p=async()=>{var v,b;try{const j=await Ne(`/api/runs/${e}/training-history`);if(!j.ok)throw new Error("Failed to fetch training history");const w=await j.json();w.has_history&&((b=(v=w.training_history)==null?void 0:v.epochs)==null?void 0:b.length)>0?(a(w.training_history),d(new Date),c(null)):a(null)}catch(j){console.error("Error fetching training history:",j),c(j.message),a(null)}finally{s(!1),h(!0)}};S.useEffect(()=>{e&&p()},[e]),S.useEffect(()=>{if(!t||!r)return;const v=setInterval(p,5e3);return()=>clearInterval(v)},[e,t,r]);const m=()=>{if(!n)return;const v=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),b=URL.createObjectURL(v),j=document.createElement("a");j.href=b,j.download=`training-history-${e}.json`,j.click(),URL.revokeObjectURL(b)};if(i&&!f)return o.jsx("div",{className:"flex items-center justify-center p-6",children:o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-primary-200 border-t-primary-600"})});if(!n||!((y=n.epochs)!=null&&y.length))return null;const g=((x=n.epochs)==null?void 0:x.length)||0;return o.jsxs(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2.5 bg-gradient-to-br from-primary-500 to-purple-500 rounded-xl shadow-lg",children:o.jsx(Hr,{size:20,className:"text-white"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-white",children:"Training Metrics"}),o.jsxs("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:[g," epochs recorded",u&&o.jsxs("span",{className:"text-xs text-slate-400 ml-2",children:["• Updated ",u.toLocaleTimeString()]})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[t&&o.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-amber-50 dark:bg-amber-900/30 rounded-full border border-amber-200 dark:border-amber-800",children:[o.jsx(Fe,{size:14,className:"text-amber-600 dark:text-amber-400 animate-pulse"}),o.jsx("span",{className:"text-xs font-medium text-amber-700 dark:text-amber-300",children:"Live"})]}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:p,className:"text-slate-500 hover:text-slate-700",children:o.jsx(CZ,{size:14})}),o.jsxs(fe,{variant:"outline",size:"sm",onClick:m,className:"text-slate-600",children:[o.jsx(Oa,{size:14,className:"mr-1.5"}),"Export"]})]})]}),o.jsx(gy,{trainingHistory:n,compact:!1}),o.jsx("div",{className:"pt-4 border-t border-slate-200 dark:border-slate-700",children:o.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 dark:text-slate-400",children:[o.jsx("span",{children:"💡 Tip: Hover over the charts for detailed epoch-by-epoch values"}),o.jsxs("a",{href:"https://flowyml.readthedocs.io/integrations/keras/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:text-primary-600 transition-colors",children:["Learn more about Keras integration",o.jsx(bc,{size:12})]})]})})]})}function xOe(){var z,I,$,F;const{runId:e}=xE(),[t,r]=S.useState(null),[n,a]=S.useState([]),[i,s]=S.useState([]),[l,c]=S.useState(!0),[u,d]=S.useState(null),[f,h]=S.useState("overview"),[p,m]=S.useState(null),[g,y]=S.useState(null),[x,v]=S.useState(!1),[b,j]=S.useState(!1),[w,k]=S.useState({}),[N,_]=S.useState(!1),[P,C]=S.useState(!1),A=async()=>{if(confirm("Are you sure you want to stop this run?")){j(!0);try{await Ne(`/api/runs/${e}/stop`,{method:"POST"});const V=await(await Ne(`/api/runs/${e}`)).json();r(V)}catch(q){console.error("Failed to stop run:",q),alert("Failed to stop run")}finally{j(!1)}}},O=async q=>{try{await Ne(`/api/runs/${e}/project`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_name:q})}),r(V=>({...V,project:q}))}catch(V){console.error("Failed to update project:",V)}};if(S.useEffect(()=>{if(!t)return;const q=async()=>{try{const B=await(await Ne(`/api/runs/${e}/cloud-status`)).json();y(B),B.is_remote&&B.cloud_status&&!B.cloud_status.is_finished?v(!0):v(!1)}catch(L){console.error("Failed to fetch cloud status:",L),v(!1)}};q();let V;return x&&(V=setInterval(q,5e3)),()=>{V&&clearInterval(V)}},[e,t,x]),S.useEffect(()=>{(async()=>{try{const[V,L]=await Promise.all([Ne(`/api/runs/${e}`),Ne(`/api/assets?run_id=${e}`)]),B=await V.json(),Y=await L.json();let W=[];try{const K=await Ne(`/api/runs/${e}/metrics`);K.ok&&(W=(await K.json()).metrics||[])}catch(K){console.warn("Failed to fetch metrics",K)}r(B),a(Y.assets||[]),s(W),B.steps&&Object.keys(B.steps).length>0&&d(Object.keys(B.steps)[0]),c(!1)}catch(V){console.error(V),c(!1)}})()},[e]),l)return o.jsx("div",{className:"flex items-center justify-center h-96",children:o.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})});if(!t)return o.jsx("div",{className:"p-8 text-center text-slate-500",children:"Run not found"});const T=t.status==="completed"?"success":t.status==="failed"?"danger":"warning",E=u?(z=t.steps)==null?void 0:z[u]:null,R=n.filter(q=>q.step===u),D=i.filter(q=>q.step===u||q.name.startsWith(u));return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between bg-white dark:bg-slate-800 p-6 rounded-xl border border-slate-100 dark:border-slate-700 shadow-sm",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx(ft,{to:"/runs",className:"text-sm text-slate-500 hover:text-slate-700 transition-colors",children:"Runs"}),o.jsx(na,{size:14,className:"text-slate-300"}),o.jsx("span",{className:"text-sm text-slate-900 dark:text-white font-medium",children:t.run_id})]}),o.jsxs("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white flex items-center gap-3",children:[o.jsx("div",{className:`w-3 h-3 rounded-full ${t.status==="completed"?"bg-emerald-500":t.status==="failed"?"bg-rose-500":"bg-amber-500"}`}),"Run: ",o.jsx("span",{className:"font-mono text-slate-500",children:((I=t.run_id)==null?void 0:I.substring(0,8))||(e==null?void 0:e.substring(0,8))||"N/A"})]}),o.jsxs("p",{className:"text-slate-500 dark:text-slate-400 mt-1 flex items-center gap-2",children:[o.jsx(Zr,{size:16}),"Pipeline: ",o.jsx("span",{className:"font-medium text-slate-700 dark:text-slate-200",children:t.pipeline_name}),(g==null?void 0:g.is_remote)&&o.jsxs(qe,{variant:"secondary",className:"text-xs bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 flex items-center gap-1",children:[o.jsx(G8,{size:12}),g.orchestrator_type]}),(g==null?void 0:g.is_remote)&&x&&o.jsxs("span",{className:"text-xs text-amber-600 flex items-center gap-1 animate-pulse",children:[o.jsx(Fe,{size:12}),"Live"]})]})]}),o.jsxs("div",{className:"flex flex-col items-end gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lx,{currentProject:t.project,onUpdate:O}),o.jsx(qe,{variant:T,className:"text-sm px-4 py-1.5 uppercase tracking-wide shadow-sm",children:(($=g==null?void 0:g.cloud_status)==null?void 0:$.status)||t.status})]}),o.jsxs("span",{className:"text-xs text-slate-400 font-mono",children:["ID: ",t.run_id]}),t.status==="running"&&o.jsx(fe,{variant:"danger",size:"sm",onClick:A,disabled:b,className:"mt-2",children:b?"Stopping...":"Stop Run"})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[o.jsx(Wk,{icon:o.jsx(ht,{size:24}),label:"Duration",value:t.duration?`${t.duration.toFixed(2)}s`:"-",color:"blue"}),o.jsx(Wk,{icon:o.jsx(_a,{size:24}),label:"Started At",value:t.start_time?Ft(new Date(t.start_time),"MMM d, HH:mm:ss"):"-",color:"purple"}),o.jsx(Wk,{icon:o.jsx(rr,{size:24}),label:"Steps Completed",value:`${t.steps?Object.values(t.steps).filter(q=>q.success).length:0} / ${t.steps?Object.keys(t.steps).length:0}`,color:"emerald"})]}),o.jsxs("div",{className:`grid gap-6 transition-all duration-300 ${N?"grid-cols-1 lg:grid-cols-2":"grid-cols-1 lg:grid-cols-3"}`,children:[o.jsxs("div",{className:N?"lg:col-span-1":"lg:col-span-2",children:[o.jsxs("h3",{className:"text-xl font-bold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[o.jsx(Fe,{className:"text-primary-500"})," Pipeline Execution Graph"]}),o.jsx("div",{className:`min-h-[500px] ${N?"h-[500px]":"h-[calc(100vh-240px)]"}`,children:t.dag?o.jsx(lq,{dag:t.dag,steps:t.steps,selectedStep:u,onStepSelect:d,onArtifactSelect:q=>{let V=n.find(L=>L.name===q);if(!V){const L=q.split("/"),B=L[0],Y=L[1],K={data:"Dataset",model:"Model",metrics:"Metrics",features:"FeatureSet"}[B];if(Y&&K&&(V=n.find(Q=>Q.type===K&&(Q.name.toLowerCase().includes(Y.toLowerCase())||Y.toLowerCase().includes(Q.name.toLowerCase().replace(/_/g,""))))),!V&&K){const Q=n.filter(X=>X.type===K);Q.length===1&&(V=Q[0])}}V?m(V):console.warn(`Artifact "${q}" not found in assets list. Available:`,n.map(L=>L.name))}}):o.jsx(Te,{className:"h-full flex items-center justify-center",children:o.jsx("p",{className:"text-slate-500",children:"DAG visualization not available"})})})]}),o.jsxs("div",{className:N?"lg:col-span-1":"",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("h3",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(yi,{className:"text-primary-500"})," Step Details"]}),o.jsx("button",{onClick:()=>_(!N),className:"p-2 rounded-lg bg-slate-100 dark:bg-slate-800 hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors",title:N?"Collapse panel":"Expand panel",children:o.jsx(Cf,{size:16,className:"text-slate-600 dark:text-slate-300"})})]}),E?o.jsxs(Te,{className:`overflow-hidden transition-all duration-300 ${N?"h-auto":""}`,children:[o.jsxs("div",{className:"pb-4 border-b border-slate-100 dark:border-slate-700",children:[o.jsx("div",{className:"flex items-center justify-between",children:o.jsx("h4",{className:"text-lg font-bold text-slate-900 dark:text-white",children:u})}),o.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[o.jsx(qe,{variant:E.success?"success":"danger",className:"text-xs",children:E.success?"Success":"Failed"}),E.cached&&o.jsx(qe,{variant:"secondary",className:"text-xs bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",children:"Cached"}),o.jsxs("span",{className:"text-xs font-mono text-slate-500 dark:text-slate-400 bg-slate-100 dark:bg-slate-800 px-2 py-0.5 rounded",children:[(F=E.duration)==null?void 0:F.toFixed(2),"s"]})]})]}),E.status==="running"&&o.jsxs("div",{className:"px-4 py-2 bg-blue-50 dark:bg-blue-900/20 border-b border-blue-100 dark:border-blue-800 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm text-blue-700 dark:text-blue-300",children:[o.jsx(Fe,{size:14,className:"animate-pulse"}),o.jsx("span",{children:"Step is running"})]}),E.last_heartbeat&&o.jsxs("span",{className:"text-xs text-blue-600 dark:text-blue-400 font-mono",children:["Last heartbeat: ",(Date.now()/1e3-E.last_heartbeat).toFixed(1),"s ago"]})]}),E.status==="dead"&&o.jsxs("div",{className:"px-4 py-2 bg-rose-50 dark:bg-rose-900/20 border-b border-rose-100 dark:border-rose-800 flex items-center gap-2",children:[o.jsx(dn,{size:14,className:"text-rose-600 dark:text-rose-400"}),o.jsx("span",{className:"text-sm font-medium text-rose-700 dark:text-rose-300",children:"Step detected as DEAD (missed heartbeats)"})]}),o.jsxs("div",{className:"flex gap-1 border-b border-slate-100 dark:border-slate-700 mt-4 overflow-x-auto",children:[o.jsxs(am,{active:f==="overview",onClick:()=>h("overview"),children:[o.jsx(yi,{size:14})," Overview"]}),o.jsxs(am,{active:f==="code",onClick:()=>h("code"),children:[o.jsx(pZ,{size:14})," Code"]}),o.jsxs(am,{active:f==="artifacts",onClick:()=>h("artifacts"),children:[o.jsx(Ea,{size:14})," Artifacts"]}),o.jsxs(am,{active:f==="logs",onClick:()=>h("logs"),"data-tab":"logs",children:[o.jsx(nl,{size:14})," Logs"]})]}),o.jsxs("div",{className:`mt-4 overflow-y-auto transition-all duration-300 ${N?"max-h-[600px]":"max-h-[450px]"}`,children:[f==="overview"&&o.jsx(yOe,{stepData:E,metrics:D,runId:e,stepName:u}),f==="code"&&o.jsx(bOe,{sourceCode:E.source_code}),f==="artifacts"&&o.jsx(wOe,{artifacts:R,onArtifactClick:m}),f==="logs"&&o.jsx(vW,{runId:e,stepName:u,isRunning:t.status==="running",maxHeight:N?"max-h-[500px]":"max-h-96"})]})]}):o.jsxs(Te,{className:"p-12 text-center border-2 border-dashed border-slate-200 dark:border-slate-700",children:[o.jsx(yi,{size:32,className:"mx-auto text-slate-300 dark:text-slate-600 mb-3"}),o.jsx("p",{className:"text-slate-500 dark:text-slate-400 font-medium",children:"Select a step to view details"}),o.jsx("p",{className:"text-xs text-slate-400 dark:text-slate-500 mt-1",children:"Click on any step in the graph"})]})]})]}),o.jsx(NOe,{runId:e,isRunning:t.status==="running"}),o.jsx(jOe,{artifact:p,onClose:()=>m(null)})]})}function Wk({icon:e,label:t,value:r,color:n}){const a={blue:"bg-blue-50 text-blue-600",purple:"bg-purple-50 text-purple-600",emerald:"bg-emerald-50 text-emerald-600"};return o.jsx(Te,{className:"hover:shadow-md transition-shadow duration-200",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:`p-3 rounded-xl ${a[n]}`,children:e}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 font-medium",children:t}),o.jsx("p",{className:"text-xl font-bold text-slate-900 dark:text-white",children:r})]})]})})}function am({active:e,onClick:t,children:r,...n}){return o.jsx("button",{onClick:t,...n,className:`
734
+ flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors border-b-2
735
+ ${e?"text-primary-600 dark:text-primary-400 border-primary-600 dark:border-primary-400":"text-slate-500 dark:text-slate-400 border-transparent hover:text-slate-700 dark:hover:text-slate-200"}
736
+ `,children:r})}function yOe({stepData:e,metrics:t,runId:r,stepName:n}){var i,s,l,c;const a=u=>{if(!u)return"N/A";if(u<1)return`${(u*1e3).toFixed(0)}ms`;if(u<60)return`${u.toFixed(2)}s`;const d=Math.floor(u/60),f=(u%60).toFixed(0);return`${d}m ${f}s`};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-4 bg-gradient-to-br from-slate-50 to-white dark:from-slate-800 dark:to-slate-900 rounded-xl border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx(ht,{size:14,className:"text-slate-400"}),o.jsx("span",{className:"text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wide",children:"Duration"})]}),o.jsx("p",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:a(e.duration)})]}),o.jsxs("div",{className:"p-4 bg-gradient-to-br from-slate-50 to-white dark:from-slate-800 dark:to-slate-900 rounded-xl border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx(Fe,{size:14,className:"text-slate-400"}),o.jsx("span",{className:"text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wide",children:"Status"})]}),o.jsx("div",{className:"flex items-center gap-2",children:e.status==="dead"?o.jsxs(o.Fragment,{children:[o.jsx(dn,{size:20,className:"text-rose-500"}),o.jsx("span",{className:"text-lg font-bold text-rose-700 dark:text-rose-400",children:"Dead"})]}):e.success?o.jsxs(o.Fragment,{children:[o.jsx(rr,{size:20,className:"text-emerald-500"}),o.jsx("span",{className:"text-lg font-bold text-emerald-700",children:"Success"})]}):e.error?o.jsxs(o.Fragment,{children:[o.jsx(kr,{size:20,className:"text-rose-500"}),o.jsx("span",{className:"text-lg font-bold text-rose-700",children:"Failed"})]}):o.jsxs(o.Fragment,{children:[o.jsx(ht,{size:20,className:"text-amber-500"}),o.jsx("span",{className:"text-lg font-bold text-amber-700 dark:text-amber-500",children:"Pending"})]})})]})]}),e.last_heartbeat&&o.jsxs("div",{className:"p-4 bg-slate-50 dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700",children:[o.jsxs("h5",{className:"text-sm font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wide mb-2 flex items-center gap-2",children:[o.jsx(Fe,{size:16,className:"text-blue-500"}),"System Heartbeat"]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Last received:"}),o.jsxs("span",{className:"font-mono font-medium text-slate-900 dark:text-white",children:[new Date(e.last_heartbeat*1e3).toLocaleTimeString(),o.jsxs("span",{className:"text-xs text-slate-400 ml-2",children:["(",(Date.now()/1e3-e.last_heartbeat).toFixed(1),"s ago)"]})]})]})]}),o.jsxs("div",{className:"mt-6",children:[o.jsxs("h5",{className:"text-sm font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wide mb-3 flex items-center gap-2",children:[o.jsx(nl,{size:16}),"Logs Preview"]}),o.jsx(vW,{runId:r,stepName:n,isRunning:e.status==="running",maxHeight:"max-h-48",minimal:!0}),o.jsx("div",{className:"mt-2 text-right",children:o.jsx("button",{onClick:()=>{var u;return(u=document.querySelector('[data-tab="logs"]'))==null?void 0:u.click()},className:"text-xs text-primary-600 hover:text-primary-700 dark:text-primary-400 font-medium",children:"View Full Logs →"})})]}),(((i=e.inputs)==null?void 0:i.length)>0||((s=e.outputs)==null?void 0:s.length)>0)&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("h5",{className:"text-sm font-bold text-slate-700 uppercase tracking-wide flex items-center gap-2",children:[o.jsx(nr,{size:16}),"Data Flow"]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[((l=e.inputs)==null?void 0:l.length)>0&&o.jsxs("div",{className:"p-4 bg-blue-50/50 dark:bg-blue-900/10 rounded-xl border border-blue-100 dark:border-blue-800",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(lZ,{size:16,className:"text-blue-600"}),o.jsx("span",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100",children:"Inputs"}),o.jsx(qe,{variant:"secondary",className:"ml-auto text-xs",children:e.inputs.length})]}),o.jsx("div",{className:"space-y-1.5",children:e.inputs.map((u,d)=>o.jsxs("div",{className:"flex items-center gap-2 p-2 bg-white dark:bg-slate-800 rounded-lg border border-blue-100 dark:border-blue-800/50",children:[o.jsx(nr,{size:12,className:"text-blue-500 flex-shrink-0"}),o.jsx("span",{className:"text-sm font-mono text-slate-700 dark:text-slate-200 truncate",children:u})]},d))})]}),((c=e.outputs)==null?void 0:c.length)>0&&o.jsxs("div",{className:"p-4 bg-purple-50/50 dark:bg-purple-900/10 rounded-xl border border-purple-100 dark:border-purple-800",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(cZ,{size:16,className:"text-purple-600"}),o.jsx("span",{className:"text-sm font-semibold text-purple-900 dark:text-purple-100",children:"Outputs"}),o.jsx(qe,{variant:"secondary",className:"ml-auto text-xs",children:e.outputs.length})]}),o.jsx("div",{className:"space-y-1.5",children:e.outputs.map((u,d)=>o.jsxs("div",{className:"flex items-center gap-2 p-2 bg-white dark:bg-slate-800 rounded-lg border border-purple-100 dark:border-purple-800/50",children:[o.jsx(Ur,{size:12,className:"text-purple-500 flex-shrink-0"}),o.jsx("span",{className:"text-sm font-mono text-slate-700 dark:text-slate-200 truncate",children:u})]},d))})]})]})]}),e.tags&&Object.keys(e.tags).length>0&&o.jsxs("div",{children:[o.jsxs("h5",{className:"text-sm font-bold text-slate-700 uppercase tracking-wide mb-3 flex items-center gap-2",children:[o.jsx(Tf,{size:16}),"Metadata"]}),o.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(e.tags).map(([u,d])=>o.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700",children:[o.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 mb-1",children:u}),o.jsx("div",{className:"text-sm font-mono font-medium text-slate-900 dark:text-white truncate",children:String(d)})]},u))})]}),e.cached&&o.jsx("div",{className:"p-4 bg-gradient-to-r from-blue-50 to-cyan-50 dark:from-blue-900/20 dark:to-cyan-900/20 rounded-xl border-2 border-blue-200 dark:border-blue-800",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(hn,{size:24,className:"text-blue-600"}),o.jsxs("div",{children:[o.jsx("h6",{className:"font-bold text-blue-900 dark:text-blue-100",children:"Cached Result"}),o.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"This step used cached results from a previous run"})]})]})}),e.error&&o.jsxs("div",{children:[o.jsxs("h5",{className:"text-sm font-bold text-rose-700 uppercase tracking-wide mb-3 flex items-center gap-2",children:[o.jsx(dn,{size:16}),"Error Details"]}),o.jsx("div",{className:"p-4 bg-rose-50 dark:bg-rose-900/20 rounded-xl border-2 border-rose-200 dark:border-rose-800",children:o.jsx("pre",{className:"text-sm font-mono text-rose-700 dark:text-rose-300 whitespace-pre-wrap overflow-x-auto",children:e.error})})]}),(t==null?void 0:t.length)>0&&o.jsxs("div",{children:[o.jsxs("h5",{className:"text-sm font-bold text-slate-700 uppercase tracking-wide mb-3 flex items-center gap-2",children:[o.jsx(Hr,{size:16}),"Performance Metrics"]}),o.jsx("div",{className:"grid grid-cols-2 gap-3",children:t.map((u,d)=>o.jsx(vOe,{metric:u},d))})]})]})}function vOe({metric:e}){const t=typeof e.value=="number",r=t?e.value.toFixed(4):e.value;return o.jsxs("div",{className:"p-3 bg-gradient-to-br from-slate-50 to-white dark:from-slate-800 dark:to-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 hover:border-primary-300 dark:hover:border-primary-700 transition-all group",children:[o.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 block truncate mb-1",title:e.name,children:e.name}),o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-xl font-mono font-bold text-slate-900 dark:text-white group-hover:text-primary-600 dark:group-hover:text-primary-400 transition-colors",children:r}),t&&e.value>0&&o.jsx(Hr,{size:14,className:"text-emerald-500"})]})]})}function bOe({sourceCode:e}){return o.jsx(mOe,{code:e||"# Source code not available",language:"python",title:"Step Source Code"})}function wOe({artifacts:e,onArtifactClick:t}){return o.jsxs("div",{children:[o.jsx("h5",{className:"text-sm font-semibold text-slate-700 mb-3",children:"Produced Artifacts"}),(e==null?void 0:e.length)>0?o.jsx("div",{className:"space-y-2",children:e.map(r=>o.jsxs(ge.div,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:()=>t(r),className:"group flex items-center gap-3 p-3 bg-slate-50 hover:bg-white rounded-lg border border-slate-100 hover:border-primary-300 hover:shadow-md transition-all cursor-pointer",children:[o.jsx("div",{className:"p-2 bg-white rounded-md text-slate-500 shadow-sm group-hover:text-primary-600 group-hover:scale-110 transition-all",children:r.type==="Dataset"?o.jsx(nr,{size:18}):r.type==="Model"?o.jsx(Ur,{size:18}):r.type==="Metrics"?o.jsx(Pn,{size:18}):o.jsx(qs,{size:18})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-sm font-semibold text-slate-900 truncate group-hover:text-primary-600 transition-colors",children:r.name}),o.jsx("p",{className:"text-xs text-slate-500 truncate",children:r.type})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{className:"p-2 rounded-lg hover:bg-white transition-colors text-slate-400 hover:text-primary-600 disabled:opacity-40",onClick:n=>{n.stopPropagation(),Yc(r.artifact_id)},disabled:!r.artifact_id,children:o.jsx(Oa,{size:14})}),o.jsx(Cf,{size:14,className:"text-slate-300 group-hover:text-primary-400 transition-colors"}),o.jsx(Ai,{size:14,className:"text-slate-300 group-hover:text-primary-400 opacity-0 group-hover:opacity-100 transition-all"})]})]},r.artifact_id))}):o.jsx("p",{className:"text-sm text-slate-500 italic",children:"No artifacts produced by this step"})]})}function jOe({artifact:e,onClose:t}){var g,y,x,v,b,j,w,k,N,_,P,C,A;const[r,n]=S.useState("visualization");if(!e)return null;const a=e.type==="Dataset"||e.asset_type==="Dataset",i=e.type==="Model"||e.asset_type==="Model",s=e.type==="Metrics"||e.asset_type==="Metrics",l=e.properties?Object.entries(e.properties).filter(([O,T])=>!(O.startsWith("_")||typeof T=="string"&&T.length>500)):[];e.training_history&&e.training_history.epochs&&e.training_history.epochs.length>0;const c=(g=e.properties)==null?void 0:g.training_history,u=e.training_history||(c&&c.epochs?c:null),f=a?{icon:o.jsx(nr,{size:28}),gradient:"from-blue-500 to-indigo-600",bgGradient:"from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20",iconBg:"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400"}:i?{icon:o.jsx(Ur,{size:28}),gradient:"from-purple-500 to-violet-600",bgGradient:"from-purple-50 to-violet-50 dark:from-purple-900/20 dark:to-violet-900/20",iconBg:"bg-purple-100 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400"}:s?{icon:o.jsx(Pn,{size:28}),gradient:"from-emerald-500 to-teal-600",bgGradient:"from-emerald-50 to-teal-50 dark:from-emerald-900/20 dark:to-teal-900/20",iconBg:"bg-emerald-100 dark:bg-emerald-900/30 text-emerald-600 dark:text-emerald-400"}:{icon:o.jsx(qs,{size:28}),gradient:"from-slate-500 to-slate-600",bgGradient:"from-slate-50 to-slate-100 dark:from-slate-800 dark:to-slate-900",iconBg:"bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-400"},h=i?{framework:((y=e.properties)==null?void 0:y.framework)||"Unknown",parameters:(x=e.properties)==null?void 0:x.parameters,layers:(v=e.properties)==null?void 0:v.num_layers,optimizer:(b=e.properties)==null?void 0:b.optimizer,learningRate:(j=e.properties)==null?void 0:j.learning_rate,epochsTrained:((w=e.properties)==null?void 0:w.epochs_trained)||((k=u==null?void 0:u.epochs)==null?void 0:k.length)}:null,p=a?{samples:((N=e.properties)==null?void 0:N.num_samples)||((_=e.properties)==null?void 0:_.samples),features:(P=e.properties)==null?void 0:P.num_features,source:(C=e.properties)==null?void 0:C.source,split:(A=e.properties)==null?void 0:A.split}:null,m=s&&e.properties?Object.entries(e.properties).filter(([O,T])=>typeof T=="number"&&!O.startsWith("_")).sort((O,T)=>O[0].localeCompare(T[0])):[];return o.jsx(Zt,{children:o.jsx(ge.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/60 backdrop-blur-md z-50 flex items-center justify-center p-4",onClick:t,children:o.jsxs(ge.div,{initial:{scale:.9,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.9,opacity:0,y:20},transition:{type:"spring",damping:25,stiffness:300},onClick:O=>O.stopPropagation(),className:"bg-white dark:bg-slate-900 rounded-2xl shadow-2xl w-full max-w-5xl max-h-[90vh] overflow-hidden flex flex-col",children:[o.jsxs("div",{className:`relative p-6 bg-gradient-to-r ${f.bgGradient} border-b border-slate-200 dark:border-slate-700`,children:[o.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 opacity-10 pointer-events-none",children:o.jsx("div",{className:`w-full h-full bg-gradient-to-br ${f.gradient} rounded-full blur-3xl`})}),o.jsxs("div",{className:"relative flex items-start justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:`p-4 rounded-2xl shadow-lg bg-gradient-to-br ${f.gradient}`,children:o.jsx("div",{className:"text-white",children:f.icon})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:e.name}),o.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[o.jsx("span",{className:`text-sm font-medium px-3 py-0.5 rounded-full ${f.iconBg}`,children:e.type}),e.step&&o.jsxs("span",{className:"text-sm text-slate-500 dark:text-slate-400",children:["from ",o.jsx("span",{className:"font-mono font-medium",children:e.step})]})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:()=>Yc(e.artifact_id),className:`inline-flex items-center gap-2 px-4 py-2.5 rounded-xl bg-gradient-to-r ${f.gradient} text-white text-sm font-semibold hover:shadow-lg transition-all disabled:opacity-50`,disabled:!e.artifact_id,children:[o.jsx(Oa,{size:16})," Download"]}),o.jsx("button",{onClick:t,className:"p-2.5 hover:bg-white/50 dark:hover:bg-slate-800 rounded-xl transition-colors",children:o.jsx(Tn,{size:22,className:"text-slate-500 dark:text-slate-400"})})]})]}),i&&h&&o.jsxs("div",{className:"mt-4 flex flex-wrap gap-4",children:[o.jsx(ss,{label:"Framework",value:h.framework,icon:o.jsx(hn,{size:12})}),h.parameters&&o.jsx(ss,{label:"Parameters",value:h.parameters.toLocaleString(),icon:o.jsx(Fe,{size:12})}),h.layers&&o.jsx(ss,{label:"Layers",value:h.layers,icon:o.jsx(Zr,{size:12})}),h.epochsTrained&&o.jsx(ss,{label:"Epochs",value:h.epochsTrained,icon:o.jsx(Hr,{size:12})})]}),a&&p&&o.jsxs("div",{className:"mt-4 flex flex-wrap gap-4",children:[p.samples&&o.jsx(ss,{label:"Samples",value:p.samples.toLocaleString(),icon:o.jsx(nr,{size:12})}),p.features&&o.jsx(ss,{label:"Features",value:p.features,icon:o.jsx(Zr,{size:12})}),p.split&&o.jsx(ss,{label:"Split",value:p.split,icon:o.jsx(qs,{size:12})}),p.source&&o.jsx(ss,{label:"Source",value:p.source,icon:o.jsx(G8,{size:12})})]})]}),(i||a||s)&&o.jsxs("div",{className:"flex gap-1 px-6 py-3 border-b border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-800/50",children:[o.jsx(Gk,{active:r==="visualization",onClick:()=>n("visualization"),children:i?o.jsxs(o.Fragment,{children:[o.jsx(tl,{size:14})," Visualization"]}):a?o.jsxs(o.Fragment,{children:[o.jsx(Pn,{size:14})," Statistics"]}):o.jsxs(o.Fragment,{children:[o.jsx(Fe,{size:14})," Metrics"]})}),l.length>0&&o.jsxs(Gk,{active:r==="properties",onClick:()=>n("properties"),children:[o.jsx(Tf,{size:14})," Properties (",l.length,")"]}),o.jsxs(Gk,{active:r==="metadata",onClick:()=>n("metadata"),children:[o.jsx(yi,{size:14})," Metadata"]})]}),o.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:o.jsxs(Zt,{mode:"wait",children:[r==="visualization"&&o.jsxs(ge.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"space-y-6",children:[i&&u&&o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[o.jsx("div",{className:"p-2 bg-purple-100 dark:bg-purple-900/30 rounded-lg",children:o.jsx(tl,{size:18,className:"text-purple-600 dark:text-purple-400"})}),o.jsx("h4",{className:"text-lg font-bold text-slate-900 dark:text-white",children:"Training History"}),o.jsxs("span",{className:"text-xs bg-slate-100 dark:bg-slate-800 px-2 py-0.5 rounded-full text-slate-500",children:[u.epochs.length," epochs"]})]}),o.jsx(gy,{trainingHistory:u,compact:!1})]}),i&&!u&&o.jsxs("div",{className:"text-center py-12",children:[o.jsx("div",{className:"inline-flex p-4 bg-slate-100 dark:bg-slate-800 rounded-full mb-4",children:o.jsx(Ur,{size:32,className:"text-slate-400"})}),o.jsx("h4",{className:"text-lg font-bold text-slate-900 dark:text-white mb-2",children:"Model Artifact"}),o.jsxs("p",{className:"text-slate-500 dark:text-slate-400",children:["No training history available for this model.",o.jsx("br",{}),"Use ",o.jsx("code",{className:"bg-slate-100 dark:bg-slate-800 px-1.5 py-0.5 rounded text-xs",children:"FlowymlKerasCallback"})," to capture training metrics."]})]}),a&&o.jsx(JL,{artifact:e}),s&&m.length>0&&o.jsx("div",{className:"space-y-4",children:o.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:m.map(([O,T],E)=>o.jsx(kOe,{name:O,value:T,index:E},O))})}),!i&&!a&&!s&&o.jsx(JL,{artifact:e})]},"viz"),r==="properties"&&o.jsx(ge.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:l.map(([O,T])=>o.jsxs("div",{className:"p-4 bg-slate-50 dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700",children:[o.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 uppercase tracking-wide block mb-1",children:O.replace(/_/g," ")}),o.jsx("span",{className:"text-sm font-mono font-semibold text-slate-900 dark:text-white break-all",children:typeof T=="object"?JSON.stringify(T,null,2):typeof T=="number"?T.toLocaleString():String(T)})]},O))})},"props"),r==="metadata"&&o.jsx(ge.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"space-y-4",children:o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800 rounded-xl p-6 border border-slate-200 dark:border-slate-700",children:[o.jsx("h5",{className:"text-sm font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wide mb-4",children:"Artifact Information"}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(Bl,{label:"Artifact ID",value:e.artifact_id,mono:!0}),o.jsx(Bl,{label:"Type",value:e.type}),o.jsx(Bl,{label:"Step",value:e.step}),e.run_id&&o.jsx(Bl,{label:"Run ID",value:e.run_id,mono:!0}),e.pipeline_name&&o.jsx(Bl,{label:"Pipeline",value:e.pipeline_name}),e.created_at&&o.jsx(Bl,{label:"Created",value:Ft(new Date(e.created_at),"MMM d, yyyy HH:mm:ss")})]})]})},"meta")]})}),o.jsxs("div",{className:"p-4 border-t border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-800/50 flex justify-between items-center",children:[o.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:"💡 Click Download to save the full artifact data"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(fe,{variant:"ghost",onClick:t,children:"Close"}),o.jsxs(fe,{variant:"primary",onClick:()=>Yc(e.artifact_id),disabled:!e.artifact_id,children:[o.jsx(Oa,{size:14,className:"mr-1.5"}),"Download"]})]})]})]})})})}function ss({label:e,value:t,icon:r}){return o.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-white/50 dark:bg-slate-800/50 rounded-lg backdrop-blur-sm border border-slate-200/50 dark:border-slate-700/50",children:[o.jsx("span",{className:"text-slate-400",children:r}),o.jsxs("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:[e,":"]}),o.jsx("span",{className:"text-sm font-bold text-slate-900 dark:text-white",children:t})]})}function Gk({active:e,onClick:t,children:r}){return o.jsx("button",{onClick:t,className:`flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg transition-all ${e?"bg-white dark:bg-slate-700 text-slate-900 dark:text-white shadow-sm":"text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 hover:bg-white/50 dark:hover:bg-slate-700/50"}`,children:r})}function kOe({name:e,value:t,index:r}){const n=["from-blue-500 to-indigo-600","from-purple-500 to-violet-600","from-emerald-500 to-teal-600","from-amber-500 to-orange-600","from-rose-500 to-pink-600","from-cyan-500 to-blue-600"],a=n[r%n.length],i=e.replace(/_/g," ").replace(/\b\w/g,c=>c.toUpperCase()),s=typeof t=="number"?Math.abs(t)<.01||Math.abs(t)>1e3?t.toExponential(3):t.toFixed(4):t,l=e.toLowerCase().includes("loss")||e.toLowerCase().includes("error")||e.toLowerCase().includes("mse")||e.toLowerCase().includes("mae");return o.jsxs(ge.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:r*.05},className:"relative overflow-hidden p-4 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 hover:shadow-lg transition-all group",children:[o.jsx("div",{className:`absolute top-0 right-0 w-16 h-16 bg-gradient-to-br ${a} opacity-10 rounded-full blur-2xl group-hover:opacity-20 transition-opacity`}),o.jsxs("div",{className:"relative",children:[o.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 uppercase tracking-wide mb-1 truncate",children:i}),o.jsx("p",{className:"text-2xl font-bold font-mono text-slate-900 dark:text-white",children:s}),o.jsxs("div",{className:"mt-1 flex items-center gap-1",children:[l?o.jsx(rx,{size:12,className:"text-emerald-500"}):o.jsx(Hr,{size:12,className:"text-emerald-500"}),o.jsx("span",{className:"text-xs text-slate-400",children:l?"Lower is better":"Higher is better"})]})]})]})}function Bl({label:e,value:t,mono:r=!1}){return o.jsxs("div",{className:"flex justify-between items-center py-2 border-b border-slate-200/50 dark:border-slate-700/50 last:border-0",children:[o.jsx("span",{className:"text-sm text-slate-500 dark:text-slate-400",children:e}),o.jsx("span",{className:`text-sm font-medium text-slate-900 dark:text-white ${r?"font-mono text-xs":""}`,children:t||"—"})]})}function vW({runId:e,stepName:t,isRunning:r,maxHeight:n="max-h-96",minimal:a=!1}){const[i,s]=S.useState(""),[l,c]=S.useState(!0),[u,d]=S.useState(!0),f=M.useRef(null),h=M.useRef(null);return S.useEffect(()=>{h.current&&h.current.scrollIntoView({behavior:"smooth"})},[i]),S.useEffect(()=>{s(""),c(!0),f.current&&(f.current.close(),f.current=null)},[t]),S.useEffect(()=>{let p=!0;if((async()=>{try{const x=await(await Ne(`/api/runs/${e}/steps/${t}/logs`)).json();p&&x.logs&&s(x.logs)}catch(y){console.error("Failed to fetch logs:",y)}finally{p&&c(!1)}})(),r&&u)try{const x=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/runs/${e}/steps/${t}/logs`,v=new WebSocket(x);v.onopen=()=>{console.log("WebSocket connected for logs")},v.onmessage=b=>{try{const j=JSON.parse(b.data);j.type==="log"&&p&&s(w=>w+j.content+`
737
+ `)}catch{p&&b.data!=="pong"&&s(w=>w+b.data+`
738
+ `)}},v.onerror=()=>{console.log("WebSocket error, falling back to polling"),d(!1)},v.onclose=()=>{console.log("WebSocket closed")},f.current=v}catch(y){console.error("Failed to create WebSocket:",y),d(!1)}let g;if(r&&!u){let y=0;g=setInterval(async()=>{try{const v=await(await Ne(`/api/runs/${e}/steps/${t}/logs?offset=${y}`)).json();p&&v.logs&&(s(b=>b+v.logs),y=v.offset)}catch(x){console.error("Failed to fetch logs:",x)}},2e3)}return()=>{p=!1,f.current&&(f.current.close(),f.current=null),g&&clearInterval(g)}},[e,t,r,u]),l&&!i?o.jsx("div",{className:"flex items-center justify-center h-40",children:o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):o.jsxs("div",{className:`bg-slate-900 rounded-lg p-4 font-mono text-sm overflow-x-auto ${n} overflow-y-auto`,children:[i?o.jsxs(o.Fragment,{children:[o.jsx("pre",{className:"text-green-400 whitespace-pre-wrap break-words",children:a?i.split(`
739
+ `).slice(-10).join(`
740
+ `):i}),o.jsx("div",{ref:h})]}):o.jsx("div",{className:"text-slate-500 italic",children:"No logs available for this step."}),!a&&r&&o.jsxs("div",{className:"mt-2 text-amber-500 flex items-center gap-2 animate-pulse",children:[o.jsx(Fe,{size:14}),u?"Live streaming...":"Polling for logs..."]})]})}function NOe({runId:e,isRunning:t}){const[r,n]=S.useState(!1),[a,i]=S.useState(!0),[s,l]=S.useState(!0);return S.useEffect(()=>{e&&(async()=>{var u,d;try{const f=await Ne(`/api/runs/${e}/training-history`);if(f.ok){const h=await f.json();n(h.has_history&&((d=(u=h.training_history)==null?void 0:u.epochs)==null?void 0:d.length)>0)}}catch(f){console.error("Error checking training history:",f)}finally{l(!1)}})()},[e]),s||!r?null:o.jsx("div",{className:"mt-8",children:o.jsxs(Te,{className:"overflow-hidden",children:[o.jsxs("div",{className:"p-6 cursor-pointer flex items-center justify-between bg-gradient-to-r from-slate-50 to-white dark:from-slate-800 dark:to-slate-900 border-b border-slate-100 dark:border-slate-700 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors",onClick:()=>i(!a),children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2.5 bg-gradient-to-br from-emerald-500 to-teal-500 rounded-xl shadow-lg",children:o.jsx(tl,{size:20,className:"text-white"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-white",children:"Training Metrics"}),o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Interactive training history visualization"})]})]}),o.jsx(na,{size:20,className:`text-slate-400 transform transition-transform duration-200 ${a?"rotate-90":""}`})]}),o.jsx(Zt,{children:a&&o.jsx(ge.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:o.jsx("div",{className:"p-6",children:o.jsx(gOe,{runId:e,isRunning:t,autoRefresh:!0})})})})]})})}function qC({icon:e,title:t,description:r,action:n,actionLabel:a,onAction:i,className:s=""}){return o.jsxs("div",{className:`flex flex-col items-center justify-center py-16 px-4 text-center ${s}`,children:[o.jsx("div",{className:"w-20 h-20 bg-gradient-to-br from-slate-100 to-slate-200 dark:from-slate-800 dark:to-slate-700 rounded-2xl flex items-center justify-center mb-6 shadow-inner",children:e&&o.jsx(e,{className:"text-slate-400 dark:text-slate-500",size:40})}),o.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-white mb-2",children:t}),r&&o.jsx("p",{className:"text-slate-500 dark:text-slate-400 max-w-md mb-6",children:r}),(n||a&&i)&&o.jsx("div",{children:n||o.jsx(fe,{onClick:i,children:a})})]})}function bW({asset:e,onClose:t,hideHeader:r=!1}){var g,y,x,v,b,j,w,k,N,_,P,C;const[n,a]=S.useState("overview"),[i,s]=S.useState(e==null?void 0:e.project),l=Lh();if(!e)return null;const c=((g=e.type)==null?void 0:g.toLowerCase().includes("model"))||((y=e.name)==null?void 0:y.toLowerCase().includes("model"))||["keras","pytorch","sklearn","tensorflow","xgboost","lightgbm","onnx"].some(A=>(e.type||"").toLowerCase().includes(A)||(e.name||"").toLowerCase().includes(A)),u=async()=>{l(`/deployments?deploy=${encodeURIComponent(e.artifact_id)}&name=${encodeURIComponent(e.name)}`)},d=async A=>{try{await Ne(`/api/assets/${e.artifact_id}/project`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_name:A})}),s(A)}catch(O){console.error("Failed to update project:",O)}},f={model:{icon:Ur,color:"from-purple-500 to-pink-500",bgColor:"bg-purple-50 dark:bg-purple-900/20",textColor:"text-purple-600 dark:text-purple-400",borderColor:"border-purple-200 dark:border-purple-800"},dataset:{icon:nr,color:"from-blue-500 to-cyan-500",bgColor:"bg-blue-50 dark:bg-blue-900/20",textColor:"text-blue-600 dark:text-blue-400",borderColor:"border-blue-200 dark:border-blue-800"},metrics:{icon:Pn,color:"from-emerald-500 to-teal-500",bgColor:"bg-emerald-50 dark:bg-emerald-900/20",textColor:"text-emerald-600 dark:text-emerald-400",borderColor:"border-emerald-200 dark:border-emerald-800"},default:{icon:qs,color:"from-slate-500 to-slate-600",bgColor:"bg-slate-50 dark:bg-slate-900/20",textColor:"text-slate-600 dark:text-slate-400",borderColor:"border-slate-200 dark:border-slate-800"}},h=f[(x=e.type)==null?void 0:x.toLowerCase()]||f.default,p=h.icon,m=A=>{if(!A||A===0)return"N/A";const O=1024,T=["Bytes","KB","MB","GB","TB"],E=Math.floor(Math.log(A)/Math.log(O));return parseFloat((A/Math.pow(O,E)).toFixed(2))+" "+T[E]};return o.jsx(ge.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:.2},className:"h-full flex flex-col",children:o.jsxs(Te,{className:"flex-1 flex flex-col overflow-hidden",children:[!r&&o.jsxs("div",{className:`p-6 ${h.bgColor} border-b ${h.borderColor}`,children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsx("div",{className:`p-3 rounded-xl bg-gradient-to-br ${h.color} text-white shadow-lg`,children:o.jsx(p,{size:32})}),o.jsx("button",{onClick:t,className:"p-2 hover:bg-white/50 dark:hover:bg-slate-800/50 rounded-lg transition-colors",children:o.jsx(Tn,{size:20,className:"text-slate-400"})})]}),o.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-2",children:e.name}),o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx(qe,{className:`bg-gradient-to-r ${h.color} text-white border-0`,children:e.type}),o.jsx(lx,{currentProject:i,onUpdate:d})]})]}),o.jsxs("div",{className:"flex items-center gap-1 p-2 border-b border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 overflow-x-auto",children:[o.jsx(sm,{active:n==="overview",onClick:()=>a("overview"),icon:yi,label:"Overview"}),(((v=e.type)==null?void 0:v.toLowerCase())==="dataset"||((b=e.type)==null?void 0:b.toLowerCase())==="model")&&o.jsx(sm,{active:n==="visualization",onClick:()=>a("visualization"),icon:((j=e.type)==null?void 0:j.toLowerCase())==="model"?tl:Pn,label:((w=e.type)==null?void 0:w.toLowerCase())==="model"?"Training":"Statistics"}),o.jsx(sm,{active:n==="properties",onClick:()=>a("properties"),icon:Tf,label:"Properties"}),o.jsx(sm,{active:n==="metadata",onClick:()=>a("metadata"),icon:gs,label:"Metadata"})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[n==="visualization"&&o.jsxs("div",{className:"space-y-6",children:[((k=e.type)==null?void 0:k.toLowerCase())==="dataset"&&o.jsx(yW,{artifact:e}),((N=e.type)==null?void 0:N.toLowerCase())==="model"&&o.jsx(COe,{asset:e})]}),n==="overview"&&o.jsxs(o.Fragment,{children:[((_=e.type)==null?void 0:_.toLowerCase())==="model"&&e.properties&&o.jsx(_Oe,{properties:e.properties}),((P=e.type)==null?void 0:P.toLowerCase())==="dataset"&&e.properties&&o.jsx(EOe,{properties:e.properties}),((C=e.type)==null?void 0:C.toLowerCase())==="metrics"&&e.properties&&o.jsx(POe,{properties:e.properties}),o.jsxs("div",{children:[o.jsxs("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider mb-3 flex items-center gap-2",children:[o.jsx(gs,{size:16}),"Asset Information"]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(im,{icon:_a,label:"Created",value:e.created_at?Ft(new Date(e.created_at),"MMM d, yyyy HH:mm"):"N/A"}),o.jsx(im,{icon:X8,label:"Size",value:m(e.size||e.storage_bytes)}),o.jsx(im,{icon:Zr,label:"Step",value:e.step||"N/A"}),o.jsx(im,{icon:Fc,label:"Version",value:e.version||"N/A"})]})]}),(e.run_id||e.pipeline_name||i)&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider mb-3 flex items-center gap-2",children:[o.jsx(Fc,{size:16}),"Context"]}),o.jsxs("div",{className:"space-y-2",children:[i&&o.jsx(Kk,{icon:Ur,label:"Project",value:i,to:`/assets?project=${encodeURIComponent(i)}`}),e.pipeline_name&&o.jsx(Kk,{icon:Fe,label:"Pipeline",value:e.pipeline_name,to:`/pipelines?project=${encodeURIComponent(i||"")}`}),e.run_id&&o.jsx(Kk,{icon:Fe,label:"Run",value:e.run_id.slice(0,12)+"...",to:`/runs/${e.run_id}`})]})]})]}),n==="properties"&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider mb-3 flex items-center gap-2",children:[o.jsx(Tf,{size:16}),"Properties (",e.properties?Object.keys(e.properties).length:0,")"]}),e.properties&&Object.keys(e.properties).length>0?o.jsx("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-4 space-y-2",children:Object.entries(e.properties).map(([A,O])=>o.jsx(SOe,{name:A,value:O},A))}):o.jsx("div",{className:"text-center py-8 text-slate-500 italic",children:"No properties available"})]}),n==="metadata"&&o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider mb-2",children:"Artifact ID"}),o.jsx("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-3",children:o.jsx("code",{className:"text-xs text-slate-600 dark:text-slate-400 font-mono break-all",children:e.artifact_id})})]}),e.uri&&o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider mb-2",children:"Location"}),o.jsx("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-3",children:o.jsx("code",{className:"text-xs text-slate-600 dark:text-slate-400 break-all",children:e.uri})})]})]})]}),o.jsx("div",{className:"p-4 border-t border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-800/50",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(fe,{onClick:()=>Yc(e.artifact_id),disabled:!e.artifact_id,className:"flex-1",children:[o.jsx(Oa,{size:16,className:"mr-2"}),"Download Asset"]}),c&&o.jsxs(fe,{onClick:u,className:"bg-gradient-to-r from-orange-500 to-red-500 hover:from-orange-600 hover:to-red-600 text-white",children:[o.jsx(No,{size:16,className:"mr-2"}),"Deploy"]}),e.run_id&&o.jsx(ft,{to:`/runs/${e.run_id}`,children:o.jsxs(fe,{variant:"outline",children:[o.jsx(bc,{size:16,className:"mr-2"}),"View in Run"]})})]})})]})})}function im({icon:e,label:t,value:r,mono:n=!1}){return o.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-lg p-3 border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(e,{size:14,className:"text-slate-400"}),o.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:t})]}),o.jsx("p",{className:`text-sm font-semibold text-slate-900 dark:text-white ${n?"font-mono":""}`,children:r})]})}function Kk({icon:e,label:t,value:r,to:n}){return o.jsxs(ft,{to:n,className:"flex items-center gap-3 p-3 bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700 hover:border-primary-300 dark:hover:border-primary-700 hover:shadow-md transition-all group",children:[o.jsx("div",{className:"p-2 bg-slate-100 dark:bg-slate-700 rounded-lg group-hover:bg-primary-100 dark:group-hover:bg-primary-900/30 transition-colors",children:o.jsx(e,{size:16,className:"text-slate-600 dark:text-slate-400 group-hover:text-primary-600 dark:group-hover:text-primary-400"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:t}),o.jsx("p",{className:"text-sm font-medium text-slate-900 dark:text-white truncate",children:r})]}),o.jsx(bc,{size:14,className:"text-slate-400 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function SOe({name:e,value:t}){const r=()=>typeof t=="object"?JSON.stringify(t,null,2):typeof t=="boolean"?t?"true":"false":typeof t=="number"?t.toLocaleString():String(t);return o.jsxs("div",{className:"flex items-start justify-between gap-4 py-2 border-b border-slate-200 dark:border-slate-700 last:border-0",children:[o.jsx("span",{className:"text-sm font-medium text-slate-700 dark:text-slate-300 shrink-0",children:e}),o.jsx("span",{className:"text-sm text-slate-600 dark:text-slate-400 text-right font-mono break-all",children:r()})]})}function sm({active:e,onClick:t,icon:r,label:n}){return o.jsxs("button",{onClick:t,className:`
741
+ flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all
742
+ ${e?"bg-slate-100 dark:bg-slate-800 text-slate-900 dark:text-white":"text-slate-500 hover:bg-slate-50 dark:hover:bg-slate-800/50 hover:text-slate-700 dark:hover:text-slate-300"}
743
+ `,children:[o.jsx(r,{size:16}),n]})}function _Oe({properties:e}){const t=e.framework,r=e.parameters,n=e.trainable_parameters,a=e.optimizer,i=e.learning_rate,s=e.loss_function,l=e.num_layers,c=e.layer_types,u=e.architecture||e.model_class,d=e._auto_extracted;if(!t&&!r)return null;const f=h=>h?h>=1e6?(h/1e6).toFixed(1)+"M":h>=1e3?(h/1e3).toFixed(1)+"K":h.toLocaleString():"N/A";return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider flex items-center gap-2",children:[o.jsx(gZ,{size:16,className:"text-purple-500"}),"Model Details"]}),d&&o.jsx("span",{className:"text-[10px] bg-purple-100 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400 px-2 py-0.5 rounded-full",children:"Auto-extracted"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t&&o.jsxs("div",{className:"bg-gradient-to-br from-purple-50 to-pink-50 dark:from-purple-900/20 dark:to-pink-900/20 rounded-lg p-3 border border-purple-100 dark:border-purple-800",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(hn,{size:12,className:"text-purple-500"}),o.jsx("span",{className:"text-[10px] text-purple-600 dark:text-purple-400 font-medium uppercase",children:"Framework"})]}),o.jsx("p",{className:"text-lg font-bold text-purple-700 dark:text-purple-300 capitalize",children:t})]}),u&&o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-3 border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(tx,{size:12,className:"text-slate-500"}),o.jsx("span",{className:"text-[10px] text-slate-500 font-medium uppercase",children:"Architecture"})]}),o.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white truncate",children:u})]})]}),r&&o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-3 border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(bE,{size:12,className:"text-slate-500"}),o.jsx("span",{className:"text-[10px] text-slate-500 font-medium uppercase",children:"Parameters"})]}),o.jsx("p",{className:"text-xl font-bold text-slate-900 dark:text-white",children:f(r)})]}),n&&o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-3 border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(Hr,{size:12,className:"text-slate-500"}),o.jsx("span",{className:"text-[10px] text-slate-500 font-medium uppercase",children:"Trainable"})]}),o.jsx("p",{className:"text-xl font-bold text-slate-900 dark:text-white",children:f(n)})]})]}),(a||s||i)&&o.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-3 border border-blue-100 dark:border-blue-800",children:[o.jsx("h4",{className:"text-[10px] text-blue-600 dark:text-blue-400 font-medium uppercase mb-2",children:"Training Configuration"}),o.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[a&&o.jsxs("div",{children:[o.jsx("span",{className:"text-blue-500",children:"Optimizer:"}),o.jsx("span",{className:"ml-1 font-medium text-blue-700 dark:text-blue-300",children:a})]}),i&&o.jsxs("div",{children:[o.jsx("span",{className:"text-blue-500",children:"LR:"}),o.jsx("span",{className:"ml-1 font-medium text-blue-700 dark:text-blue-300",children:typeof i=="number"?i.toExponential(2):i})]}),s&&o.jsxs("div",{children:[o.jsx("span",{className:"text-blue-500",children:"Loss:"}),o.jsx("span",{className:"ml-1 font-medium text-blue-700 dark:text-blue-300",children:s})]})]})]}),(l||c)&&o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-3 border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("h4",{className:"text-[10px] text-slate-500 font-medium uppercase",children:"Layers"}),l&&o.jsx("span",{className:"text-sm font-bold text-slate-900 dark:text-white",children:l})]}),c&&o.jsx("div",{className:"flex flex-wrap gap-1",children:(Array.isArray(c)?c:JSON.parse(c||"[]")).map((h,p)=>o.jsx("span",{className:"text-[10px] bg-slate-200 dark:bg-slate-700 text-slate-600 dark:text-slate-300 px-2 py-0.5 rounded",children:h},p))})]})]})}function EOe({properties:e}){const t=e.samples||e.num_samples,r=e.num_features,n=e.columns||e.feature_columns,a=e.framework,i=e.label_column,s=e.column_stats,l=e._auto_extracted;return!t&&!r&&!n?null:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider flex items-center gap-2",children:[o.jsx(nr,{size:16,className:"text-blue-500"}),"Dataset Details"]}),l&&o.jsx("span",{className:"text-[10px] bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400 px-2 py-0.5 rounded-full",children:"Auto-extracted"})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[t&&o.jsxs("div",{className:"bg-gradient-to-br from-blue-50 to-cyan-50 dark:from-blue-900/20 dark:to-cyan-900/20 rounded-lg p-3 border border-blue-100 dark:border-blue-800",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(Of,{size:12,className:"text-blue-500"}),o.jsx("span",{className:"text-[10px] text-blue-600 dark:text-blue-400 font-medium uppercase",children:"Samples"})]}),o.jsx("p",{className:"text-xl font-bold text-blue-700 dark:text-blue-300",children:t.toLocaleString()})]}),r&&o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-3 border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(sF,{size:12,className:"text-slate-500"}),o.jsx("span",{className:"text-[10px] text-slate-500 font-medium uppercase",children:"Features"})]}),o.jsx("p",{className:"text-xl font-bold text-slate-900 dark:text-white",children:r})]}),a&&o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-3 border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(hn,{size:12,className:"text-slate-500"}),o.jsx("span",{className:"text-[10px] text-slate-500 font-medium uppercase",children:"Format"})]}),o.jsx("p",{className:"text-sm font-bold text-slate-900 dark:text-white capitalize",children:a})]})]}),n&&o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-lg p-3 border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("h4",{className:"text-[10px] text-slate-500 font-medium uppercase",children:"Columns"}),o.jsxs("span",{className:"text-xs text-slate-400",children:[Array.isArray(n)?n.length:0," total"]})]}),o.jsxs("div",{className:"flex flex-wrap gap-1",children:[(Array.isArray(n)?n:[]).slice(0,10).map((c,u)=>o.jsxs("span",{className:`text-[10px] px-2 py-0.5 rounded ${c===i?"bg-emerald-100 dark:bg-emerald-900/30 text-emerald-600 dark:text-emerald-400 font-medium":"bg-slate-200 dark:bg-slate-700 text-slate-600 dark:text-slate-300"}`,children:[c,c===i&&" (target)"]},u)),Array.isArray(n)&&n.length>10&&o.jsxs("span",{className:"text-[10px] text-slate-400",children:["+",n.length-10," more"]})]})]}),s&&Object.keys(s).length>0&&o.jsxs("div",{className:"bg-emerald-50 dark:bg-emerald-900/20 rounded-lg p-3 border border-emerald-100 dark:border-emerald-800",children:[o.jsx("h4",{className:"text-[10px] text-emerald-600 dark:text-emerald-400 font-medium uppercase mb-2",children:"Column Statistics Available"}),o.jsxs("p",{className:"text-xs text-emerald-700 dark:text-emerald-300",children:[Object.keys(s).length," columns with statistics (mean, std, min, max, etc.)"]})]})]})}function POe({properties:e}){const t=Object.entries(e).filter(([n])=>!n.startsWith("_")&&!["data","samples","source"].includes(n));if(t.length===0)return null;const r=n=>typeof n=="number"?n<.01&&n!==0?n.toExponential(3):n>1e3?n.toLocaleString():n.toFixed(4):String(n);return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider flex items-center gap-2",children:[o.jsx(bZ,{size:16,className:"text-emerald-500"}),"Evaluation Metrics"]}),o.jsx("div",{className:"grid grid-cols-2 gap-3",children:t.slice(0,8).map(([n,a])=>o.jsxs("div",{className:"bg-gradient-to-br from-emerald-50 to-teal-50 dark:from-emerald-900/20 dark:to-teal-900/20 rounded-lg p-3 border border-emerald-100 dark:border-emerald-800",children:[o.jsx("span",{className:"text-[10px] text-emerald-600 dark:text-emerald-400 font-medium uppercase block mb-1",children:n.replace(/_/g," ")}),o.jsx("p",{className:"text-lg font-bold text-emerald-700 dark:text-emerald-300 font-mono",children:r(a)})]},n))})]})}function COe({asset:e}){var n;const t=e.training_history||((n=e.properties)==null?void 0:n.training_history)||null;return t&&t.epochs&&t.epochs.length>0?o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center gap-3 pb-4 border-b border-slate-200 dark:border-slate-700",children:[o.jsx("div",{className:"p-3 bg-gradient-to-br from-purple-500 to-pink-600 rounded-xl shadow-lg",children:o.jsx(tl,{size:24,className:"text-white"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-white",children:"Training History"}),o.jsxs("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:[t.epochs.length," epochs recorded"]})]})]}),o.jsx(gy,{trainingHistory:t,compact:!1})]}):o.jsxs("div",{className:"text-center py-12 bg-slate-50 dark:bg-slate-800/50 rounded-xl border border-slate-200 dark:border-slate-700",children:[o.jsx("div",{className:"inline-flex p-4 bg-white dark:bg-slate-800 rounded-full mb-4 shadow-sm",children:o.jsx(tl,{size:32,className:"text-slate-400"})}),o.jsx("h4",{className:"text-lg font-bold text-slate-900 dark:text-white mb-2",children:"No Training History Available"}),o.jsxs("p",{className:"text-sm text-slate-500 dark:text-slate-400 max-w-md mx-auto",children:["This model artifact doesn't have training history data.",o.jsx("br",{}),"Use ",o.jsx("code",{className:"bg-slate-100 dark:bg-slate-700 px-1.5 py-0.5 rounded text-xs",children:"FlowymlKerasCallback"})," during training to capture metrics."]})]})}const xy=S.createContext(null);xy.displayName="PanelGroupContext";const Xt={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},UC=10,Wo=S.useLayoutEffect,ez=Nz.useId,AOe=typeof ez=="function"?ez:()=>null;let OOe=0;function HC(e=null){const t=AOe(),r=S.useRef(e||t||null);return r.current===null&&(r.current=""+OOe++),e??r.current}function wW({children:e,className:t="",collapsedSize:r,collapsible:n,defaultSize:a,forwardedRef:i,id:s,maxSize:l,minSize:c,onCollapse:u,onExpand:d,onResize:f,order:h,style:p,tagName:m="div",...g}){const y=S.useContext(xy);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:v,getPanelSize:b,getPanelStyle:j,groupId:w,isPanelCollapsed:k,reevaluatePanelConstraints:N,registerPanel:_,resizePanel:P,unregisterPanel:C}=y,A=HC(s),O=S.useRef({callbacks:{onCollapse:u,onExpand:d,onResize:f},constraints:{collapsedSize:r,collapsible:n,defaultSize:a,maxSize:l,minSize:c},id:A,idIsFromProps:s!==void 0,order:h});S.useRef({didLogMissingDefaultSizeWarning:!1}),Wo(()=>{const{callbacks:E,constraints:R}=O.current,D={...R};O.current.id=A,O.current.idIsFromProps=s!==void 0,O.current.order=h,E.onCollapse=u,E.onExpand=d,E.onResize=f,R.collapsedSize=r,R.collapsible=n,R.defaultSize=a,R.maxSize=l,R.minSize=c,(D.collapsedSize!==R.collapsedSize||D.collapsible!==R.collapsible||D.maxSize!==R.maxSize||D.minSize!==R.minSize)&&N(O.current,D)}),Wo(()=>{const E=O.current;return _(E),()=>{C(E)}},[h,A,_,C]),S.useImperativeHandle(i,()=>({collapse:()=>{x(O.current)},expand:E=>{v(O.current,E)},getId(){return A},getSize(){return b(O.current)},isCollapsed(){return k(O.current)},isExpanded(){return!k(O.current)},resize:E=>{P(O.current,E)}}),[x,v,b,k,A,P]);const T=j(O.current,a);return S.createElement(m,{...g,children:e,className:t,id:A,style:{...T,...p},[Xt.groupId]:w,[Xt.panel]:"",[Xt.panelCollapsible]:n||void 0,[Xt.panelId]:A,[Xt.panelSize]:parseFloat(""+T.flexGrow).toFixed(1)})}const h_=S.forwardRef((e,t)=>S.createElement(wW,{...e,forwardedRef:t}));wW.displayName="Panel";h_.displayName="forwardRef(Panel)";let p_=null,zm=-1,bs=null;function TOe(e,t,r){const n=(t&_W)!==0,a=(t&EW)!==0,i=(t&PW)!==0,s=(t&CW)!==0;if(t){if(n)return i?"se-resize":s?"ne-resize":"e-resize";if(a)return i?"sw-resize":s?"nw-resize":"w-resize";if(i)return"s-resize";if(s)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function MOe(){bs!==null&&(document.head.removeChild(bs),p_=null,bs=null,zm=-1)}function Yk(e,t,r){var n,a;const i=TOe(e,t);if(p_!==i){if(p_=i,bs===null&&(bs=document.createElement("style"),document.head.appendChild(bs)),zm>=0){var s;(s=bs.sheet)===null||s===void 0||s.removeRule(zm)}zm=(n=(a=bs.sheet)===null||a===void 0?void 0:a.insertRule(`*{cursor: ${i} !important;}`))!==null&&n!==void 0?n:-1}}function jW(e){return e.type==="keydown"}function kW(e){return e.type.startsWith("pointer")}function NW(e){return e.type.startsWith("mouse")}function yy(e){if(kW(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(NW(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function ROe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function DOe(e,t,r){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function $Oe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:nz(e),b:nz(t)};let n;for(;r.a.at(-1)===r.b.at(-1);)e=r.a.pop(),t=r.b.pop(),n=e;He(n,"Stacking order can only be calculated for elements with a common ancestor");const a={a:rz(tz(r.a)),b:rz(tz(r.b))};if(a.a===a.b){const i=n.childNodes,s={a:r.a.at(-1),b:r.b.at(-1)};let l=i.length;for(;l--;){const c=i[l];if(c===s.a)return 1;if(c===s.b)return-1}}return Math.sign(a.a-a.b)}const IOe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function LOe(e){var t;const r=getComputedStyle((t=SW(e))!==null&&t!==void 0?t:e).display;return r==="flex"||r==="inline-flex"}function zOe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||LOe(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||IOe.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function tz(e){let t=e.length;for(;t--;){const r=e[t];if(He(r,"Missing node"),zOe(r))return r}return null}function rz(e){return e&&Number(getComputedStyle(e).zIndex)||0}function nz(e){const t=[];for(;e;)t.push(e),e=SW(e);return t}function SW(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const _W=1,EW=2,PW=4,CW=8,FOe=ROe()==="coarse";let Ca=[],Ac=!1,ws=new Map,vy=new Map;const Ch=new Set;function BOe(e,t,r,n,a){var i;const{ownerDocument:s}=t,l={direction:r,element:t,hitAreaMargins:n,setResizeHandlerState:a},c=(i=ws.get(s))!==null&&i!==void 0?i:0;return ws.set(s,c+1),Ch.add(l),Rg(),function(){var d;vy.delete(e),Ch.delete(l);const f=(d=ws.get(s))!==null&&d!==void 0?d:1;if(ws.set(s,f-1),Rg(),f===1&&ws.delete(s),Ca.includes(l)){const h=Ca.indexOf(l);h>=0&&Ca.splice(h,1),by(),a("up",!0,null)}}}function VOe(e){const{target:t}=e,{x:r,y:n}=yy(e);Ac=!0,WC({target:t,x:r,y:n}),Rg(),Ca.length>0&&(Dg("down",e),by(),e.preventDefault(),AW(t)||e.stopImmediatePropagation())}function Xk(e){const{x:t,y:r}=yy(e);if(Ac&&e.type!=="pointerleave"&&e.buttons===0&&(Ac=!1,Dg("up",e)),!Ac){const{target:n}=e;WC({target:n,x:t,y:r})}Dg("move",e),by(),Ca.length>0&&e.preventDefault()}function Zk(e){const{target:t}=e,{x:r,y:n}=yy(e);vy.clear(),Ac=!1,Ca.length>0&&(e.preventDefault(),AW(t)||e.stopImmediatePropagation()),Dg("up",e),WC({target:t,x:r,y:n}),by(),Rg()}function AW(e){let t=e;for(;t;){if(t.hasAttribute(Xt.resizeHandle))return!0;t=t.parentElement}return!1}function WC({target:e,x:t,y:r}){Ca.splice(0);let n=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(n=e),Ch.forEach(a=>{const{element:i,hitAreaMargins:s}=a,l=i.getBoundingClientRect(),{bottom:c,left:u,right:d,top:f}=l,h=FOe?s.coarse:s.fine;if(t>=u-h&&t<=d+h&&r>=f-h&&r<=c+h){if(n!==null&&document.contains(n)&&i!==n&&!i.contains(n)&&!n.contains(i)&&$Oe(n,i)>0){let m=n,g=!1;for(;m&&!m.contains(i);){if(DOe(m.getBoundingClientRect(),l)){g=!0;break}m=m.parentElement}if(g)return}Ca.push(a)}})}function Qk(e,t){vy.set(e,t)}function by(){let e=!1,t=!1;Ca.forEach(n=>{const{direction:a}=n;a==="horizontal"?e=!0:t=!0});let r=0;vy.forEach(n=>{r|=n}),e&&t?Yk("intersection",r):e?Yk("horizontal",r):t?Yk("vertical",r):MOe()}let Jk;function Rg(){var e;(e=Jk)===null||e===void 0||e.abort(),Jk=new AbortController;const t={capture:!0,signal:Jk.signal};Ch.size&&(Ac?(Ca.length>0&&ws.forEach((r,n)=>{const{body:a}=n;r>0&&(a.addEventListener("contextmenu",Zk,t),a.addEventListener("pointerleave",Xk,t),a.addEventListener("pointermove",Xk,t))}),ws.forEach((r,n)=>{const{body:a}=n;a.addEventListener("pointerup",Zk,t),a.addEventListener("pointercancel",Zk,t)})):ws.forEach((r,n)=>{const{body:a}=n;r>0&&(a.addEventListener("pointerdown",VOe,t),a.addEventListener("pointermove",Xk,t))}))}function Dg(e,t){Ch.forEach(r=>{const{setResizeHandlerState:n}=r,a=Ca.includes(r);n(e,a,t)})}function qOe(){const[e,t]=S.useState(0);return S.useCallback(()=>t(r=>r+1),[])}function He(e,t){if(!e)throw console.error(t),Error(t)}function hl(e,t,r=UC){return e.toFixed(r)===t.toFixed(r)?0:e>t?1:-1}function oi(e,t,r=UC){return hl(e,t,r)===0}function vn(e,t,r){return hl(e,t,r)===0}function UOe(e,t,r){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const a=e[n],i=t[n];if(!vn(a,i,r))return!1}return!0}function hc({panelConstraints:e,panelIndex:t,size:r}){const n=e[t];He(n!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:a=0,collapsible:i,maxSize:s=100,minSize:l=0}=n;if(hl(r,l)<0)if(i){const c=(a+l)/2;hl(r,c)<0?r=a:r=l}else r=l;return r=Math.min(s,r),r=parseFloat(r.toFixed(UC)),r}function zd({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:a,trigger:i}){if(vn(e,0))return t;const s=[...t],[l,c]=n;He(l!=null,"Invalid first pivot index"),He(c!=null,"Invalid second pivot index");let u=0;if(i==="keyboard"){{const f=e<0?c:l,h=r[f];He(h,`Panel constraints not found for index ${f}`);const{collapsedSize:p=0,collapsible:m,minSize:g=0}=h;if(m){const y=t[f];if(He(y!=null,`Previous layout not found for panel index ${f}`),vn(y,p)){const x=g-y;hl(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const f=e<0?l:c,h=r[f];He(h,`No panel constraints found for index ${f}`);const{collapsedSize:p=0,collapsible:m,minSize:g=0}=h;if(m){const y=t[f];if(He(y!=null,`Previous layout not found for panel index ${f}`),vn(y,g)){const x=y-p;hl(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const f=e<0?1:-1;let h=e<0?c:l,p=0;for(;;){const g=t[h];He(g!=null,`Previous layout not found for panel index ${h}`);const x=hc({panelConstraints:r,panelIndex:h,size:100})-g;if(p+=x,h+=f,h<0||h>=r.length)break}const m=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-m:m}{let h=e<0?l:c;for(;h>=0&&h<r.length;){const p=Math.abs(e)-Math.abs(u),m=t[h];He(m!=null,`Previous layout not found for panel index ${h}`);const g=m-p,y=hc({panelConstraints:r,panelIndex:h,size:g});if(!vn(m,y)&&(u+=m-y,s[h]=y,u.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?h--:h++}}if(UOe(a,s))return a;{const f=e<0?c:l,h=t[f];He(h!=null,`Previous layout not found for panel index ${f}`);const p=h+u,m=hc({panelConstraints:r,panelIndex:f,size:p});if(s[f]=m,!vn(m,p)){let g=p-m,x=e<0?c:l;for(;x>=0&&x<r.length;){const v=s[x];He(v!=null,`Previous layout not found for panel index ${x}`);const b=v+g,j=hc({panelConstraints:r,panelIndex:x,size:b});if(vn(v,j)||(g-=j-v,s[x]=j),vn(g,0))break;e>0?x--:x++}}}const d=s.reduce((f,h)=>h+f,0);return vn(d,100)?s:a}function HOe({layout:e,panelsArray:t,pivotIndices:r}){let n=0,a=100,i=0,s=0;const l=r[0];He(l!=null,"No pivot index found"),t.forEach((f,h)=>{const{constraints:p}=f,{maxSize:m=100,minSize:g=0}=p;h===l?(n=g,a=m):(i+=g,s+=m)});const c=Math.min(a,100-i),u=Math.max(n,100-s),d=e[l];return{valueMax:c,valueMin:u,valueNow:d}}function Ah(e,t=document){return Array.from(t.querySelectorAll(`[${Xt.resizeHandleId}][data-panel-group-id="${e}"]`))}function OW(e,t,r=document){const a=Ah(e,r).findIndex(i=>i.getAttribute(Xt.resizeHandleId)===t);return a??null}function TW(e,t,r){const n=OW(e,t,r);return n!=null?[n,n+1]:[-1,-1]}function WOe(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function MW(e,t=document){if(WOe(t)&&t.dataset.panelGroupId==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function wy(e,t=document){const r=t.querySelector(`[${Xt.resizeHandleId}="${e}"]`);return r||null}function GOe(e,t,r,n=document){var a,i,s,l;const c=wy(t,n),u=Ah(e,n),d=c?u.indexOf(c):-1,f=(a=(i=r[d])===null||i===void 0?void 0:i.id)!==null&&a!==void 0?a:null,h=(s=(l=r[d+1])===null||l===void 0?void 0:l.id)!==null&&s!==void 0?s:null;return[f,h]}function KOe({committedValuesRef:e,eagerValuesRef:t,groupId:r,layout:n,panelDataArray:a,panelGroupElement:i,setLayout:s}){S.useRef({didWarnAboutMissingResizeHandle:!1}),Wo(()=>{if(!i)return;const l=Ah(r,i);for(let c=0;c<a.length-1;c++){const{valueMax:u,valueMin:d,valueNow:f}=HOe({layout:n,panelsArray:a,pivotIndices:[c,c+1]}),h=l[c];if(h!=null){const p=a[c];He(p,`No panel data found for index "${c}"`),h.setAttribute("aria-controls",p.id),h.setAttribute("aria-valuemax",""+Math.round(u)),h.setAttribute("aria-valuemin",""+Math.round(d)),h.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{l.forEach((c,u)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[r,n,a,i]),S.useEffect(()=>{if(!i)return;const l=t.current;He(l,"Eager values not found");const{panelDataArray:c}=l,u=MW(r,i);He(u!=null,`No group found for id "${r}"`);const d=Ah(r,i);He(d,`No resize handles found for group id "${r}"`);const f=d.map(h=>{const p=h.getAttribute(Xt.resizeHandleId);He(p,"Resize handle element has no handle id attribute");const[m,g]=GOe(r,p,c,i);if(m==null||g==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const v=c.findIndex(b=>b.id===m);if(v>=0){const b=c[v];He(b,`No panel data found for index ${v}`);const j=n[v],{collapsedSize:w=0,collapsible:k,minSize:N=0}=b.constraints;if(j!=null&&k){const _=zd({delta:vn(j,w)?N-w:w-j,initialLayout:n,panelConstraints:c.map(P=>P.constraints),pivotIndices:TW(r,p,i),prevLayout:n,trigger:"keyboard"});n!==_&&s(_)}}break}}};return h.addEventListener("keydown",y),()=>{h.removeEventListener("keydown",y)}});return()=>{f.forEach(h=>h())}},[i,e,t,r,n,a,s])}function az(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function RW(e,t){const r=e==="horizontal",{x:n,y:a}=yy(t);return r?n:a}function YOe(e,t,r,n,a){const i=r==="horizontal",s=wy(t,a);He(s,`No resize handle element found for id "${t}"`);const l=s.getAttribute(Xt.groupId);He(l,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=n;const u=RW(r,e),d=MW(l,a);He(d,`No group element found for id "${l}"`);const f=d.getBoundingClientRect(),h=i?f.width:f.height;return(u-c)/h*100}function XOe(e,t,r,n,a,i){if(jW(e)){const s=r==="horizontal";let l=0;e.shiftKey?l=100:a!=null?l=a:l=10;let c=0;switch(e.key){case"ArrowDown":c=s?0:l;break;case"ArrowLeft":c=s?-l:0;break;case"ArrowRight":c=s?l:0;break;case"ArrowUp":c=s?0:-l;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return n==null?0:YOe(e,t,r,n,i)}function ZOe({panelDataArray:e}){const t=Array(e.length),r=e.map(i=>i.constraints);let n=0,a=100;for(let i=0;i<e.length;i++){const s=r[i];He(s,`Panel constraints not found for index ${i}`);const{defaultSize:l}=s;l!=null&&(n++,t[i]=l,a-=l)}for(let i=0;i<e.length;i++){const s=r[i];He(s,`Panel constraints not found for index ${i}`);const{defaultSize:l}=s;if(l!=null)continue;const c=e.length-n,u=a/c;n++,t[i]=u,a-=u}return t}function Vl(e,t,r){t.forEach((n,a)=>{const i=e[a];He(i,`Panel data not found for index ${a}`);const{callbacks:s,constraints:l,id:c}=i,{collapsedSize:u=0,collapsible:d}=l,f=r[c];if(f==null||n!==f){r[c]=n;const{onCollapse:h,onExpand:p,onResize:m}=s;m&&m(n,f),d&&(h||p)&&(p&&(f==null||oi(f,u))&&!oi(n,u)&&p(),h&&(f==null||!oi(f,u))&&oi(n,u)&&h())}})}function om(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function QOe({defaultSize:e,dragState:t,layout:r,panelData:n,panelIndex:a,precision:i=3}){const s=r[a];let l;return s==null?l=e!=null?e.toFixed(i):"1":n.length===1?l="1":l=s.toFixed(i),{flexBasis:0,flexGrow:l,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function JOe(e,t=10){let r=null;return(...a)=>{r!==null&&clearTimeout(r),r=setTimeout(()=>{e(...a)},t)}}function iz(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,r)=>{localStorage.setItem(t,r)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function DW(e){return`react-resizable-panels:${e}`}function $W(e){return e.map(t=>{const{constraints:r,id:n,idIsFromProps:a,order:i}=t;return a?n:i?`${i}:${JSON.stringify(r)}`:JSON.stringify(r)}).sort((t,r)=>t.localeCompare(r)).join(",")}function IW(e,t){try{const r=DW(e),n=t.getItem(r);if(n){const a=JSON.parse(n);if(typeof a=="object"&&a!=null)return a}}catch{}return null}function eTe(e,t,r){var n,a;const i=(n=IW(e,r))!==null&&n!==void 0?n:{},s=$W(t);return(a=i[s])!==null&&a!==void 0?a:null}function tTe(e,t,r,n,a){var i;const s=DW(e),l=$W(t),c=(i=IW(e,a))!==null&&i!==void 0?i:{};c[l]={expandToSizes:Object.fromEntries(r.entries()),layout:n};try{a.setItem(s,JSON.stringify(c))}catch(u){console.error(u)}}function sz({layout:e,panelConstraints:t}){const r=[...e],n=r.reduce((i,s)=>i+s,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(i=>`${i}%`).join(", ")}`);if(!vn(n,100)&&r.length>0)for(let i=0;i<t.length;i++){const s=r[i];He(s!=null,`No layout data found for index ${i}`);const l=100/n*s;r[i]=l}let a=0;for(let i=0;i<t.length;i++){const s=r[i];He(s!=null,`No layout data found for index ${i}`);const l=hc({panelConstraints:t,panelIndex:i,size:s});s!=l&&(a+=s-l,r[i]=l)}if(!vn(a,0))for(let i=0;i<t.length;i++){const s=r[i];He(s!=null,`No layout data found for index ${i}`);const l=s+a,c=hc({panelConstraints:t,panelIndex:i,size:l});if(s!==c&&(a-=c-s,r[i]=c,vn(a,0)))break}return r}const rTe=100,Fd={getItem:e=>(iz(Fd),Fd.getItem(e)),setItem:(e,t)=>{iz(Fd),Fd.setItem(e,t)}},oz={};function LW({autoSaveId:e=null,children:t,className:r="",direction:n,forwardedRef:a,id:i=null,onLayout:s=null,keyboardResizeBy:l=null,storage:c=Fd,style:u,tagName:d="div",...f}){const h=HC(i),p=S.useRef(null),[m,g]=S.useState(null),[y,x]=S.useState([]),v=qOe(),b=S.useRef({}),j=S.useRef(new Map),w=S.useRef(0),k=S.useRef({autoSaveId:e,direction:n,dragState:m,id:h,keyboardResizeBy:l,onLayout:s,storage:c}),N=S.useRef({layout:y,panelDataArray:[],panelDataArrayChanged:!1});S.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),S.useImperativeHandle(a,()=>({getId:()=>k.current.id,getLayout:()=>{const{layout:L}=N.current;return L},setLayout:L=>{const{onLayout:B}=k.current,{layout:Y,panelDataArray:W}=N.current,K=sz({layout:L,panelConstraints:W.map(Q=>Q.constraints)});az(Y,K)||(x(K),N.current.layout=K,B&&B(K),Vl(W,K,b.current))}}),[]),Wo(()=>{k.current.autoSaveId=e,k.current.direction=n,k.current.dragState=m,k.current.id=h,k.current.onLayout=s,k.current.storage=c}),KOe({committedValuesRef:k,eagerValuesRef:N,groupId:h,layout:y,panelDataArray:N.current.panelDataArray,setLayout:x,panelGroupElement:p.current}),S.useEffect(()=>{const{panelDataArray:L}=N.current;if(e){if(y.length===0||y.length!==L.length)return;let B=oz[e];B==null&&(B=JOe(tTe,rTe),oz[e]=B);const Y=[...L],W=new Map(j.current);B(e,Y,W,y,c)}},[e,y,c]),S.useEffect(()=>{});const _=S.useCallback(L=>{const{onLayout:B}=k.current,{layout:Y,panelDataArray:W}=N.current;if(L.constraints.collapsible){const K=W.map(U=>U.constraints),{collapsedSize:Q=0,panelSize:X,pivotIndices:ee}=po(W,L,Y);if(He(X!=null,`Panel size not found for panel "${L.id}"`),!oi(X,Q)){j.current.set(L.id,X);const G=Ul(W,L)===W.length-1?X-Q:Q-X,ae=zd({delta:G,initialLayout:Y,panelConstraints:K,pivotIndices:ee,prevLayout:Y,trigger:"imperative-api"});om(Y,ae)||(x(ae),N.current.layout=ae,B&&B(ae),Vl(W,ae,b.current))}}},[]),P=S.useCallback((L,B)=>{const{onLayout:Y}=k.current,{layout:W,panelDataArray:K}=N.current;if(L.constraints.collapsible){const Q=K.map(ce=>ce.constraints),{collapsedSize:X=0,panelSize:ee=0,minSize:U=0,pivotIndices:G}=po(K,L,W),ae=B??U;if(oi(ee,X)){const ce=j.current.get(L.id),de=ce!=null&&ce>=ae?ce:ae,le=Ul(K,L)===K.length-1?ee-de:de-ee,se=zd({delta:le,initialLayout:W,panelConstraints:Q,pivotIndices:G,prevLayout:W,trigger:"imperative-api"});om(W,se)||(x(se),N.current.layout=se,Y&&Y(se),Vl(K,se,b.current))}}},[]),C=S.useCallback(L=>{const{layout:B,panelDataArray:Y}=N.current,{panelSize:W}=po(Y,L,B);return He(W!=null,`Panel size not found for panel "${L.id}"`),W},[]),A=S.useCallback((L,B)=>{const{panelDataArray:Y}=N.current,W=Ul(Y,L);return QOe({defaultSize:B,dragState:m,layout:y,panelData:Y,panelIndex:W})},[m,y]),O=S.useCallback(L=>{const{layout:B,panelDataArray:Y}=N.current,{collapsedSize:W=0,collapsible:K,panelSize:Q}=po(Y,L,B);return He(Q!=null,`Panel size not found for panel "${L.id}"`),K===!0&&oi(Q,W)},[]),T=S.useCallback(L=>{const{layout:B,panelDataArray:Y}=N.current,{collapsedSize:W=0,collapsible:K,panelSize:Q}=po(Y,L,B);return He(Q!=null,`Panel size not found for panel "${L.id}"`),!K||hl(Q,W)>0},[]),E=S.useCallback(L=>{const{panelDataArray:B}=N.current;B.push(L),B.sort((Y,W)=>{const K=Y.order,Q=W.order;return K==null&&Q==null?0:K==null?-1:Q==null?1:K-Q}),N.current.panelDataArrayChanged=!0,v()},[v]);Wo(()=>{if(N.current.panelDataArrayChanged){N.current.panelDataArrayChanged=!1;const{autoSaveId:L,onLayout:B,storage:Y}=k.current,{layout:W,panelDataArray:K}=N.current;let Q=null;if(L){const ee=eTe(L,K,Y);ee&&(j.current=new Map(Object.entries(ee.expandToSizes)),Q=ee.layout)}Q==null&&(Q=ZOe({panelDataArray:K}));const X=sz({layout:Q,panelConstraints:K.map(ee=>ee.constraints)});az(W,X)||(x(X),N.current.layout=X,B&&B(X),Vl(K,X,b.current))}}),Wo(()=>{const L=N.current;return()=>{L.layout=[]}},[]);const R=S.useCallback(L=>{let B=!1;const Y=p.current;return Y&&window.getComputedStyle(Y,null).getPropertyValue("direction")==="rtl"&&(B=!0),function(K){K.preventDefault();const Q=p.current;if(!Q)return()=>null;const{direction:X,dragState:ee,id:U,keyboardResizeBy:G,onLayout:ae}=k.current,{layout:ce,panelDataArray:de}=N.current,{initialLayout:je}=ee??{},le=TW(U,L,Q);let se=XOe(K,L,X,ee,G,Q);const $e=X==="horizontal";$e&&B&&(se=-se);const Pt=de.map(rt=>rt.constraints),st=zd({delta:se,initialLayout:je??ce,panelConstraints:Pt,pivotIndices:le,prevLayout:ce,trigger:jW(K)?"keyboard":"mouse-or-touch"}),xe=!om(ce,st);(kW(K)||NW(K))&&w.current!=se&&(w.current=se,!xe&&se!==0?$e?Qk(L,se<0?_W:EW):Qk(L,se<0?PW:CW):Qk(L,0)),xe&&(x(st),N.current.layout=st,ae&&ae(st),Vl(de,st,b.current))}},[]),D=S.useCallback((L,B)=>{const{onLayout:Y}=k.current,{layout:W,panelDataArray:K}=N.current,Q=K.map(ce=>ce.constraints),{panelSize:X,pivotIndices:ee}=po(K,L,W);He(X!=null,`Panel size not found for panel "${L.id}"`);const G=Ul(K,L)===K.length-1?X-B:B-X,ae=zd({delta:G,initialLayout:W,panelConstraints:Q,pivotIndices:ee,prevLayout:W,trigger:"imperative-api"});om(W,ae)||(x(ae),N.current.layout=ae,Y&&Y(ae),Vl(K,ae,b.current))},[]),z=S.useCallback((L,B)=>{const{layout:Y,panelDataArray:W}=N.current,{collapsedSize:K=0,collapsible:Q}=B,{collapsedSize:X=0,collapsible:ee,maxSize:U=100,minSize:G=0}=L.constraints,{panelSize:ae}=po(W,L,Y);ae!=null&&(Q&&ee&&oi(ae,K)?oi(K,X)||D(L,X):ae<G?D(L,G):ae>U&&D(L,U))},[D]),I=S.useCallback((L,B)=>{const{direction:Y}=k.current,{layout:W}=N.current;if(!p.current)return;const K=wy(L,p.current);He(K,`Drag handle element not found for id "${L}"`);const Q=RW(Y,B);g({dragHandleId:L,dragHandleRect:K.getBoundingClientRect(),initialCursorPosition:Q,initialLayout:W})},[]),$=S.useCallback(()=>{g(null)},[]),F=S.useCallback(L=>{const{panelDataArray:B}=N.current,Y=Ul(B,L);Y>=0&&(B.splice(Y,1),delete b.current[L.id],N.current.panelDataArrayChanged=!0,v())},[v]),q=S.useMemo(()=>({collapsePanel:_,direction:n,dragState:m,expandPanel:P,getPanelSize:C,getPanelStyle:A,groupId:h,isPanelCollapsed:O,isPanelExpanded:T,reevaluatePanelConstraints:z,registerPanel:E,registerResizeHandle:R,resizePanel:D,startDragging:I,stopDragging:$,unregisterPanel:F,panelGroupElement:p.current}),[_,m,n,P,C,A,h,O,T,z,E,R,D,I,$,F]),V={display:"flex",flexDirection:n==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return S.createElement(xy.Provider,{value:q},S.createElement(d,{...f,children:t,className:r,id:i,ref:p,style:{...V,...u},[Xt.group]:"",[Xt.groupDirection]:n,[Xt.groupId]:h}))}const zW=S.forwardRef((e,t)=>S.createElement(LW,{...e,forwardedRef:t}));LW.displayName="PanelGroup";zW.displayName="forwardRef(PanelGroup)";function Ul(e,t){return e.findIndex(r=>r===t||r.id===t.id)}function po(e,t,r){const n=Ul(e,t),i=n===e.length-1?[n-1,n]:[n,n+1],s=r[n];return{...t.constraints,panelSize:s,pivotIndices:i}}function nTe({disabled:e,handleId:t,resizeHandler:r,panelGroupElement:n}){S.useEffect(()=>{if(e||r==null||n==null)return;const a=wy(t,n);if(a==null)return;const i=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),r(s);break}case"F6":{s.preventDefault();const l=a.getAttribute(Xt.groupId);He(l,`No group element found for id "${l}"`);const c=Ah(l,n),u=OW(l,t,n);He(u!==null,`No resize element found for id "${t}"`);const d=s.shiftKey?u>0?u-1:c.length-1:u+1<c.length?u+1:0;c[d].focus();break}}};return a.addEventListener("keydown",i),()=>{a.removeEventListener("keydown",i)}},[n,e,t,r])}function FW({children:e=null,className:t="",disabled:r=!1,hitAreaMargins:n,id:a,onBlur:i,onClick:s,onDragging:l,onFocus:c,onPointerDown:u,onPointerUp:d,style:f={},tabIndex:h=0,tagName:p="div",...m}){var g,y;const x=S.useRef(null),v=S.useRef({onClick:s,onDragging:l,onPointerDown:u,onPointerUp:d});S.useEffect(()=>{v.current.onClick=s,v.current.onDragging=l,v.current.onPointerDown=u,v.current.onPointerUp=d});const b=S.useContext(xy);if(b===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:j,groupId:w,registerResizeHandle:k,startDragging:N,stopDragging:_,panelGroupElement:P}=b,C=HC(a),[A,O]=S.useState("inactive"),[T,E]=S.useState(!1),[R,D]=S.useState(null),z=S.useRef({state:A});Wo(()=>{z.current.state=A}),S.useEffect(()=>{if(r)D(null);else{const q=k(C);D(()=>q)}},[r,C,k]);const I=(g=n==null?void 0:n.coarse)!==null&&g!==void 0?g:15,$=(y=n==null?void 0:n.fine)!==null&&y!==void 0?y:5;S.useEffect(()=>{if(r||R==null)return;const q=x.current;He(q,"Element ref not attached");let V=!1;return BOe(C,q,j,{coarse:I,fine:$},(B,Y,W)=>{if(!Y){O("inactive");return}switch(B){case"down":{O("drag"),V=!1,He(W,'Expected event to be defined for "down" action'),N(C,W);const{onDragging:K,onPointerDown:Q}=v.current;K==null||K(!0),Q==null||Q();break}case"move":{const{state:K}=z.current;V=!0,K!=="drag"&&O("hover"),He(W,'Expected event to be defined for "move" action'),R(W);break}case"up":{O("hover"),_();const{onClick:K,onDragging:Q,onPointerUp:X}=v.current;Q==null||Q(!1),X==null||X(),V||K==null||K();break}}})},[I,j,r,$,k,C,R,N,_]),nTe({disabled:r,handleId:C,resizeHandler:R,panelGroupElement:P});const F={touchAction:"none",userSelect:"none"};return S.createElement(p,{...m,children:e,className:t,id:a,onBlur:()=>{E(!1),i==null||i()},onFocus:()=>{E(!0),c==null||c()},ref:x,role:"separator",style:{...F,...f},tabIndex:h,[Xt.groupDirection]:j,[Xt.groupId]:w,[Xt.resizeHandle]:"",[Xt.resizeHandleActive]:A==="drag"?"pointer":T?"keyboard":void 0,[Xt.resizeHandleEnabled]:!r,[Xt.resizeHandleId]:C,[Xt.resizeHandleState]:A})}FW.displayName="PanelResizeHandle";const lz={Model:{icon:Ur,color:"text-purple-500",bg:"bg-purple-50 dark:bg-purple-900/20",gradient:"from-purple-500 to-pink-500",borderColor:"border-purple-200 dark:border-purple-800",label:"Models"},Dataset:{icon:nr,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-900/20",gradient:"from-blue-500 to-cyan-500",borderColor:"border-blue-200 dark:border-blue-800",label:"Datasets"},Metrics:{icon:Pn,color:"text-emerald-500",bg:"bg-emerald-50 dark:bg-emerald-900/20",gradient:"from-emerald-500 to-teal-500",borderColor:"border-emerald-200 dark:border-emerald-800",label:"Metrics"},FeatureSet:{icon:Zr,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-900/20",gradient:"from-amber-500 to-orange-500",borderColor:"border-amber-200 dark:border-amber-800",label:"Features"},default:{icon:qs,color:"text-slate-500",bg:"bg-slate-50 dark:bg-slate-800",gradient:"from-slate-500 to-slate-600",borderColor:"border-slate-200 dark:border-slate-700",label:"Other"}},ap=e=>lz[e]||lz.default;function aTe(){const[e,t]=S.useState([]),[r,n]=S.useState([]),[a,i]=S.useState([]),[s,l]=S.useState(!0),[c,u]=S.useState(null),[d,f]=S.useState(""),[h,p]=S.useState("all"),[m,g]=S.useState(null),[y,x]=S.useState("table"),[v,b]=S.useState({key:"created_at",direction:"desc"}),[j,w]=S.useState(!1),[k,N]=S.useState(null),[_,P]=S.useState({}),[C,A]=S.useState({}),[O,T]=S.useState({}),[E,R]=S.useState(!0),[D,z]=S.useState(!1),{selectedProject:I}=Ui();S.useEffect(()=>{(async()=>{l(!0),u(null);try{const K=I?`&project=${encodeURIComponent(I)}`:"",[Q,X,ee,U]=await Promise.all([Ne(`/api/assets/?limit=500${K.replace("&","?")}`),Ne(`/api/runs?limit=200${K}`),Ne(`/api/pipelines?limit=100${K}`),Ne(`/api/assets/stats${K.replace("&","?")}`)]),[G,ae,ce,de]=await Promise.all([Q.json(),X.json(),ee.json(),U.ok?U.json():null]);t(G.assets||[]),n(ae.runs||[]),i(ce.pipelines||[]),N(de);const je=[...new Set((G.assets||[]).map(le=>le.project).filter(Boolean))];je.length>0&&P({[je[0]]:!0})}catch(K){console.error(K),u(K.message)}finally{l(!1)}})()},[I]);const $=S.useMemo(()=>{const W={all:e.length};return e.forEach(K=>{W[K.type]=(W[K.type]||0)+1}),W},[e]),F=S.useMemo(()=>{let W=e.filter(K=>{var ee,U,G,ae;const Q=h==="all"||K.type===h,X=!d||((ee=K.name)==null?void 0:ee.toLowerCase().includes(d.toLowerCase()))||((U=K.step)==null?void 0:U.toLowerCase().includes(d.toLowerCase()))||((G=K.pipeline_name)==null?void 0:G.toLowerCase().includes(d.toLowerCase()))||((ae=K.project)==null?void 0:ae.toLowerCase().includes(d.toLowerCase()));return Q&&X});return W.sort((K,Q)=>{let X=K[v.key],ee=Q[v.key];return v.key==="created_at"&&(X=new Date(X||0).getTime(),ee=new Date(ee||0).getTime()),X<ee?v.direction==="asc"?-1:1:X>ee?v.direction==="asc"?1:-1:0}),W},[e,h,d,v]),q=S.useMemo(()=>{const W={};return e.forEach(K=>{const Q=K.project||"Unassigned",X=K.pipeline_name||"Direct",ee=K.run_id||"unknown";W[Q]||(W[Q]={pipelines:{},count:0}),W[Q].pipelines[X]||(W[Q].pipelines[X]={runs:{},count:0}),W[Q].pipelines[X].runs[ee]||(W[Q].pipelines[X].runs[ee]=[]),W[Q].pipelines[X].runs[ee].push(K),W[Q].pipelines[X].count++,W[Q].count++}),W},[e]),V=W=>{b(K=>({key:W,direction:K.key===W&&K.direction==="asc"?"desc":"asc"}))},L=W=>{P(K=>({...K,[W]:!K[W]}))},B=(W,K)=>{const Q=`${W}-${K}`;A(X=>({...X,[Q]:!X[Q]}))},Y=(W,K,Q)=>{const X=`${W}-${K}-${Q}`;T(ee=>({...ee,[X]:!ee[X]}))};return s?o.jsx("div",{className:"flex items-center justify-center h-screen bg-slate-50 dark:bg-slate-900",children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600 mx-auto mb-4"}),o.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:"Loading assets..."})]})}):c?o.jsx("div",{className:"flex items-center justify-center h-screen bg-slate-50 dark:bg-slate-900",children:o.jsxs("div",{className:"text-center p-8 bg-red-50 dark:bg-red-900/20 rounded-2xl border border-red-200 dark:border-red-800 max-w-md",children:[o.jsx(kr,{className:"w-12 h-12 text-red-500 mx-auto mb-4"}),o.jsx("h3",{className:"text-lg font-bold text-red-700 dark:text-red-300 mb-2",children:"Failed to load assets"}),o.jsx("p",{className:"text-red-600 dark:text-red-400 mb-4",children:c}),o.jsxs("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors flex items-center gap-2 mx-auto",children:[o.jsx(vi,{size:16})," Retry"]})]})}):o.jsxs("div",{className:"h-screen flex flex-col overflow-hidden bg-gradient-to-br from-slate-50 via-slate-50 to-blue-50/30 dark:from-slate-900 dark:via-slate-900 dark:to-slate-800",children:[o.jsx("header",{className:"bg-white/80 dark:bg-slate-800/80 backdrop-blur-lg border-b border-slate-200 dark:border-slate-700 px-6 py-4 shrink-0",children:o.jsxs("div",{className:"flex items-center justify-between gap-6 max-w-[2000px] mx-auto",children:[o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold text-slate-900 dark:text-white flex items-center gap-3",children:[o.jsx("div",{className:"p-2 bg-gradient-to-br from-blue-500 to-purple-600 rounded-xl text-white",children:o.jsx(Ea,{size:24})}),"Asset Explorer"]}),o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:"Browse, search, and manage all pipeline artifacts"})]}),o.jsxs("div",{className:"hidden lg:flex items-center gap-3 pl-6 border-l border-slate-200 dark:border-slate-700",children:[o.jsx(lm,{icon:Ea,value:(k==null?void 0:k.total_assets)||e.length,label:"Total"}),o.jsx(lm,{icon:Ur,value:$.Model||0,label:"Models",color:"purple"}),o.jsx(lm,{icon:nr,value:$.Dataset||0,label:"Datasets",color:"blue"}),o.jsx(lm,{icon:Pn,value:$.Metrics||0,label:"Metrics",color:"emerald"})]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"relative",children:[o.jsx(Af,{size:18,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),o.jsx("input",{type:"text",placeholder:"Search assets...",value:d,onChange:W=>f(W.target.value),className:"w-64 pl-10 pr-4 py-2 bg-slate-100 dark:bg-slate-700 border-0 rounded-xl text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none transition-all"}),d&&o.jsx("button",{onClick:()=>f(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",children:o.jsx(Tn,{size:14})})]}),o.jsxs("div",{className:"flex items-center bg-slate-100 dark:bg-slate-700 rounded-xl p-1",children:[o.jsx("button",{onClick:()=>x("table"),className:`p-2 rounded-lg transition-all ${y==="table"?"bg-white dark:bg-slate-600 text-slate-900 dark:text-white shadow-sm":"text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,title:"Table View",children:o.jsx(eF,{size:18})}),o.jsx("button",{onClick:()=>x("grid"),className:`p-2 rounded-lg transition-all ${y==="grid"?"bg-white dark:bg-slate-600 text-slate-900 dark:text-white shadow-sm":"text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"}`,title:"Grid View",children:o.jsx(J8,{size:18})})]}),o.jsx("button",{onClick:()=>R(!E),className:`p-2 rounded-xl transition-all ${E?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"bg-slate-100 dark:bg-slate-700 text-slate-500"}`,title:E?"Hide Explorer":"Show Explorer",children:o.jsx(m0,{size:18})})]})]})}),o.jsx("div",{className:"bg-white/60 dark:bg-slate-800/60 backdrop-blur-sm border-b border-slate-200 dark:border-slate-700 px-6 py-3 shrink-0",children:o.jsxs("div",{className:"flex items-center gap-2 max-w-[2000px] mx-auto overflow-x-auto scrollbar-hide",children:[o.jsxs("span",{className:"text-xs font-medium text-slate-500 dark:text-slate-400 shrink-0 mr-2",children:[o.jsx(Y8,{size:14,className:"inline mr-1"}),"Filter:"]}),Object.entries({all:"All",...Object.fromEntries(Object.keys($).filter(W=>W!=="all").map(W=>[W,W]))}).map(([W,K])=>{const Q=ap(W),X=h===W,ee=$[W]||0,U=Q.icon;return o.jsxs("button",{onClick:()=>p(W),className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-medium transition-all whitespace-nowrap ${X?`bg-gradient-to-r ${Q.gradient} text-white shadow-md`:`${Q.bg} ${Q.color} hover:shadow-sm`}`,children:[W!=="all"&&o.jsx(U,{size:14}),o.jsx("span",{children:K}),o.jsx("span",{className:`px-1.5 py-0.5 rounded-full text-[10px] ${X?"bg-white/20":"bg-black/5 dark:bg-white/10"}`,children:ee})]},W)})]})}),o.jsxs("div",{className:"flex-1 overflow-hidden flex",children:[o.jsx(Zt,{children:E&&o.jsx(ge.aside,{initial:{width:0,opacity:0},animate:{width:320,opacity:1},exit:{width:0,opacity:0},transition:{duration:.2},className:"h-full border-r border-slate-200 dark:border-slate-700 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm overflow-hidden shrink-0",children:o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsx("div",{className:"p-4 border-b border-slate-100 dark:border-slate-700",children:o.jsxs("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 flex items-center gap-2",children:[o.jsx(Zn,{size:16,className:"text-blue-500"}),"Project Explorer"]})}),o.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:Object.entries(q).length===0?o.jsxs("div",{className:"text-center py-8 text-slate-500",children:[o.jsx(Zn,{size:32,className:"mx-auto mb-2 opacity-50"}),o.jsx("p",{className:"text-sm",children:"No assets found"})]}):Object.entries(q).map(([W,K])=>o.jsx(iTe,{name:W,data:K,expanded:_[W],onToggle:()=>L(W),expandedPipelines:C,expandedRuns:O,onTogglePipeline:Q=>B(W,Q),onToggleRun:(Q,X)=>Y(W,Q,X),onAssetSelect:g,typeFilter:h},W))})]})})}),o.jsx("main",{className:"flex-1 min-w-0 overflow-hidden",children:o.jsxs(zW,{direction:"horizontal",className:"h-full",children:[(!m||!D)&&o.jsx(h_,{defaultSize:m?j?25:35:100,minSize:m?15:100,className:"overflow-hidden",children:o.jsx("div",{className:"h-full overflow-hidden p-4",children:F.length===0?o.jsx("div",{className:"h-full flex items-center justify-center",children:o.jsx(qC,{icon:Ea,title:"No artifacts found",description:d?`No results for "${d}"`:"Run a pipeline to generate artifacts"})}):y==="table"?o.jsx(lTe,{assets:F,onSelect:g,sortConfig:v,onSort:V,selectedAsset:m}):o.jsx(uTe,{assets:F,onSelect:g,selectedAsset:m})})}),m&&o.jsxs(o.Fragment,{children:[!D&&o.jsx(FW,{className:"w-1.5 bg-slate-200 dark:bg-slate-700 hover:bg-blue-400 dark:hover:bg-blue-500 transition-colors flex items-center justify-center group cursor-col-resize",children:o.jsx("div",{className:"w-0.5 h-8 bg-slate-300 dark:bg-slate-600 group-hover:bg-blue-300 dark:group-hover:bg-blue-400 rounded-full"})}),o.jsx(h_,{defaultSize:D?100:j?75:65,minSize:40,className:"overflow-hidden",children:o.jsx("div",{className:"h-full overflow-hidden",children:o.jsx(fTe,{asset:m,onClose:()=>g(null),isExpanded:j,onToggleExpand:()=>w(!j),hideList:D,onToggleHideList:()=>z(!D)})})})]})]})})]})]})}function lm({icon:e,value:t,label:r,color:n="slate"}){const a={slate:"bg-slate-100 dark:bg-slate-700 text-slate-600 dark:text-slate-300",purple:"bg-purple-100 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400",blue:"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400",emerald:"bg-emerald-100 dark:bg-emerald-900/30 text-emerald-600 dark:text-emerald-400"};return o.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-lg ${a[n]}`,children:[o.jsx(e,{size:14}),o.jsx("span",{className:"font-bold",children:typeof t=="number"?t.toLocaleString():t}),o.jsx("span",{className:"text-xs opacity-70",children:r})]})}function iTe({name:e,data:t,expanded:r,onToggle:n,expandedPipelines:a,expandedRuns:i,onTogglePipeline:s,onToggleRun:l,onAssetSelect:c,typeFilter:u}){return o.jsxs("div",{className:"mb-1",children:[o.jsxs("button",{onClick:n,className:"w-full flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors",children:[o.jsx(ge.div,{animate:{rotate:r?90:0},transition:{duration:.15},children:o.jsx(na,{size:14,className:"text-slate-400"})}),r?o.jsx(m0,{size:16,className:"text-blue-500"}):o.jsx(Zn,{size:16,className:"text-blue-500"}),o.jsx("span",{className:"flex-1 text-left text-sm font-medium text-slate-700 dark:text-slate-300 truncate",children:e}),o.jsx("span",{className:"text-xs text-slate-400 bg-slate-100 dark:bg-slate-600 px-2 py-0.5 rounded-full",children:t.count})]}),o.jsx(Zt,{children:r&&o.jsx(ge.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},className:"overflow-hidden pl-4",children:Object.entries(t.pipelines).map(([d,f])=>o.jsx(sTe,{name:d,data:f,projectName:e,expanded:a[`${e}-${d}`],expandedRuns:i,onToggle:()=>s(d),onToggleRun:h=>l(d,h),onAssetSelect:c,typeFilter:u},d))})})]})}function sTe({name:e,data:t,projectName:r,expanded:n,expandedRuns:a,onToggle:i,onToggleRun:s,onAssetSelect:l,typeFilter:c}){return o.jsxs("div",{className:"mb-0.5",children:[o.jsxs("button",{onClick:i,className:"w-full flex items-center gap-2 px-2 py-1.5 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors",children:[o.jsx(ge.div,{animate:{rotate:n?90:0},transition:{duration:.15},children:o.jsx(na,{size:12,className:"text-slate-400"})}),o.jsx(Fe,{size:14,className:"text-emerald-500"}),o.jsx("span",{className:"flex-1 text-left text-xs text-slate-600 dark:text-slate-400 truncate",children:e}),o.jsx("span",{className:"text-[10px] text-slate-400",children:t.count})]}),o.jsx(Zt,{children:n&&o.jsx(ge.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},className:"overflow-hidden pl-4",children:Object.entries(t.runs).map(([u,d])=>o.jsx(oTe,{runId:u,assets:d,projectName:r,pipelineName:e,expanded:a[`${r}-${e}-${u}`],onToggle:()=>s(u),onAssetSelect:l,typeFilter:c},u))})})]})}function oTe({runId:e,assets:t,expanded:r,onToggle:n,onAssetSelect:a,typeFilter:i}){const s=i==="all"?t:t.filter(l=>l.type===i);return o.jsxs("div",{className:"mb-0.5",children:[o.jsxs("button",{onClick:n,className:"w-full flex items-center gap-2 px-2 py-1.5 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors",children:[o.jsx(ge.div,{animate:{rotate:r?90:0},transition:{duration:.15},children:o.jsx(na,{size:10,className:"text-slate-400"})}),o.jsx(Fc,{size:12,className:"text-slate-400"}),o.jsx("span",{className:"flex-1 text-left text-[10px] font-mono text-slate-500 truncate",children:(e==null?void 0:e.substring(0,12))||"unknown"}),o.jsx("span",{className:"text-[10px] text-slate-400",children:s.length})]}),o.jsx(Zt,{children:r&&o.jsx(ge.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},className:"overflow-hidden pl-4",children:s.map(l=>{const c=ap(l.type),u=c.icon;return o.jsxs("button",{onClick:()=>a(l),className:"w-full flex items-center gap-2 px-2 py-1 rounded hover:bg-blue-50 dark:hover:bg-blue-900/20 transition-colors group",children:[o.jsx(u,{size:12,className:c.color}),o.jsx("span",{className:"flex-1 text-left text-[11px] text-slate-600 dark:text-slate-400 truncate group-hover:text-blue-600 dark:group-hover:text-blue-400",children:l.name})]},l.artifact_id)})})})]})}function lTe({assets:e,onSelect:t,sortConfig:r,onSort:n,selectedAsset:a}){return o.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:[o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/50 border-b border-slate-200 dark:border-slate-700 px-4 py-3 grid grid-cols-[80px,1fr,120px,200px,140px,140px,100px,50px] gap-4 text-xs font-semibold text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:[o.jsx("div",{children:"Type"}),o.jsx(e2,{label:"Name",sortKey:"name",sortConfig:r,onSort:n}),o.jsx("div",{children:"Step"}),o.jsx("div",{children:"Details"}),o.jsx(e2,{label:"Pipeline",sortKey:"pipeline_name",sortConfig:r,onSort:n}),o.jsx("div",{children:"Run"}),o.jsx(e2,{label:"Created",sortKey:"created_at",sortConfig:r,onSort:n}),o.jsx("div",{})]}),o.jsx("div",{className:"flex-1 overflow-y-auto",children:e.map((i,s)=>o.jsx(cTe,{asset:i,onSelect:t,isEven:s%2===0,isSelected:(a==null?void 0:a.artifact_id)===i.artifact_id},i.artifact_id||s))})]})}function e2({label:e,sortKey:t,sortConfig:r,onSort:n}){const a=r.key===t;return o.jsxs("button",{onClick:()=>n(t),className:"flex items-center gap-1 hover:text-slate-700 dark:hover:text-slate-200 transition-colors",children:[e,o.jsx(W8,{size:12,className:a?"text-blue-500":"opacity-30"})]})}function cTe({asset:e,onSelect:t,isEven:r,isSelected:n}){var c;const a=ap(e.type),i=a.icon,s=e.properties||{},l=()=>{if(e.type==="Model"){const u=[];if(s.framework&&u.push(s.framework),s.parameters){const d=s.parameters;u.push(d>=1e6?`${(d/1e6).toFixed(1)}M params`:d>=1e3?`${(d/1e3).toFixed(0)}K params`:`${d} params`)}return u.join(" • ")||"-"}if(e.type==="Dataset"){const u=[],d=s.samples||s.num_samples;return d&&u.push(`${d.toLocaleString()} rows`),s.num_features&&u.push(`${s.num_features} cols`),u.join(" • ")||"-"}return e.type==="Metrics"&&Object.keys(s).filter(d=>!d.startsWith("_")&&typeof s[d]=="number").slice(0,2).map(d=>`${d}: ${s[d]<.01?s[d].toExponential(1):s[d].toFixed(3)}`).join(" • ")||"-"};return o.jsxs(ge.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},onClick:()=>t(e),className:`px-4 py-3 grid grid-cols-[80px,1fr,120px,200px,140px,140px,100px,50px] gap-4 items-center cursor-pointer transition-colors border-b border-slate-100 dark:border-slate-700/50 group ${n?"bg-blue-100 dark:bg-blue-900/40 border-l-4 border-l-blue-500":`hover:bg-blue-50 dark:hover:bg-blue-900/20 ${r?"":"bg-slate-50/50 dark:bg-slate-800/30"}`}`,children:[o.jsxs("div",{className:`flex items-center gap-2 px-2 py-1 rounded-lg w-fit ${a.bg}`,children:[o.jsx(i,{size:14,className:a.color}),o.jsx("span",{className:`text-xs font-medium ${a.color}`,children:e.type})]}),o.jsx("div",{className:"truncate",children:o.jsx("span",{className:"font-medium text-slate-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:e.name})}),o.jsx("span",{className:"text-xs font-mono text-slate-500 truncate",children:e.step||"-"}),o.jsx("span",{className:"text-xs text-slate-500 truncate",children:l()}),o.jsx("span",{className:"text-xs text-slate-600 dark:text-slate-400 truncate",children:e.pipeline_name||"-"}),e.run_id?o.jsx(ft,{to:`/runs/${e.run_id}`,onClick:u=>u.stopPropagation(),className:"text-xs font-mono text-blue-600 hover:underline truncate",children:(c=e.run_id)==null?void 0:c.substring(0,12)}):o.jsx("span",{className:"text-xs text-slate-400",children:"-"}),o.jsx("span",{className:"text-xs text-slate-500",children:e.created_at?Nae(new Date(e.created_at),{addSuffix:!0}).replace("about ",""):"-"}),o.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[o.jsx("button",{onClick:u=>{u.stopPropagation(),t(e)},className:"p-1 hover:bg-slate-200 dark:hover:bg-slate-600 rounded",title:"View Details",children:o.jsx(ju,{size:14,className:"text-slate-500"})}),o.jsx("button",{onClick:u=>{u.stopPropagation(),Yc(e.artifact_id)},className:"p-1 hover:bg-slate-200 dark:hover:bg-slate-600 rounded",title:"Download",children:o.jsx(Oa,{size:14,className:"text-slate-500"})})]})]})}function uTe({assets:e,onSelect:t,selectedAsset:r}){return o.jsx("div",{className:"h-full overflow-y-auto",children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-4 p-1",children:e.map((n,a)=>o.jsx(dTe,{asset:n,onSelect:t,isSelected:(r==null?void 0:r.artifact_id)===n.artifact_id},n.artifact_id||a))})})}function dTe({asset:e,onSelect:t,isSelected:r}){var c;const n=ap(e.type),a=n.icon,i=e.properties||{},l=(()=>{var u;if(e.type==="Model")return{primary:i.framework||"Unknown",secondary:i.parameters?i.parameters>=1e6?`${(i.parameters/1e6).toFixed(1)}M`:`${(i.parameters/1e3).toFixed(0)}K`:null,label:"params"};if(e.type==="Dataset")return{primary:((u=i.samples||i.num_samples)==null?void 0:u.toLocaleString())||"?",secondary:i.num_features,label:i.num_features?"cols":"rows"};if(e.type==="Metrics"){const d=Object.keys(i).find(f=>!f.startsWith("_")&&typeof i[f]=="number");return d?{primary:i[d]<.01?i[d].toExponential(1):i[d].toFixed(3),secondary:null,label:d}:{primary:"-",secondary:null,label:""}}return{primary:"-",secondary:null,label:""}})();return o.jsx(ge.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},whileHover:{y:-4,scale:1.02},transition:{duration:.2},children:o.jsxs(Te,{onClick:()=>t(e),className:`cursor-pointer group relative overflow-hidden bg-white dark:bg-slate-800 transition-all ${r?"border-2 border-blue-500 ring-2 ring-blue-200 dark:ring-blue-800 shadow-xl":"border border-slate-200 dark:border-slate-700 hover:border-blue-300 dark:hover:border-blue-600 hover:shadow-lg"}`,children:[o.jsx("div",{className:`absolute inset-0 bg-gradient-to-br ${n.gradient} opacity-5 group-hover:opacity-10 transition-opacity`}),o.jsxs("div",{className:"relative p-4",children:[o.jsxs("div",{className:"flex items-start justify-between mb-3",children:[o.jsx("div",{className:`p-2.5 rounded-xl bg-gradient-to-br ${n.gradient} text-white shadow-lg group-hover:shadow-xl transition-shadow`,children:o.jsx(a,{size:20})}),o.jsx(qe,{variant:"outline",className:`text-[10px] px-2 py-0.5 ${n.borderColor} ${n.color}`,children:e.type})]}),o.jsx("h4",{className:"font-semibold text-slate-900 dark:text-white mb-2 truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:e.name}),o.jsx("div",{className:`${n.bg} rounded-lg p-2 mb-3`,children:o.jsxs("div",{className:"flex items-baseline gap-1.5",children:[o.jsx("span",{className:`text-lg font-bold ${n.color}`,children:l.primary}),l.secondary&&o.jsxs("span",{className:"text-xs text-slate-500",children:["× ",l.secondary]}),o.jsx("span",{className:"text-[10px] text-slate-500 ml-auto",children:l.label})]})}),o.jsxs("div",{className:"flex items-center justify-between text-[10px] text-slate-500",children:[o.jsx("span",{className:"truncate max-w-[100px]",children:e.step||"N/A"}),o.jsx("span",{children:e.created_at?Ft(new Date(e.created_at),"MMM d"):"-"})]}),e.run_id&&o.jsx("div",{className:"mt-2 pt-2 border-t border-slate-100 dark:border-slate-700",children:o.jsx("span",{className:"text-[10px] font-mono text-slate-400 bg-slate-100 dark:bg-slate-700 px-2 py-0.5 rounded",children:(c=e.run_id)==null?void 0:c.substring(0,10)})})]})]})})}function fTe({asset:e,onClose:t,isExpanded:r,onToggleExpand:n,hideList:a,onToggleHideList:i}){const s=ap(e.type),l=s.icon;return o.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-slate-900 border-l border-slate-200 dark:border-slate-700",children:[o.jsx("div",{className:`bg-gradient-to-r ${s.gradient} p-4`,children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2.5 bg-white/20 backdrop-blur-sm rounded-xl",children:o.jsx(l,{size:24,className:"text-white"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-bold text-white truncate max-w-[400px]",children:e.name}),o.jsxs("p",{className:"text-white/80 text-sm",children:[e.type," • ",e.step||"No step"]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{onClick:i,className:"p-2 bg-white/20 hover:bg-white/30 rounded-lg transition-colors",title:a?"Show list":"Hide list for full view",children:a?o.jsx(SO,{size:18,className:"text-white"}):o.jsx(Cf,{size:18,className:"text-white"})}),o.jsx(fe,{onClick:n,variant:"ghost",size:"sm",className:"text-white/80 hover:text-white hover:bg-white/20",title:r?"Collapse panel":"Expand panel",children:r?o.jsx(SO,{size:18}):o.jsx(Cf,{size:18})}),o.jsx(fe,{onClick:t,variant:"ghost",size:"sm",className:"text-white/80 hover:text-white hover:bg-white/20",children:o.jsx(Tn,{size:18})})]})]})}),o.jsx("div",{className:"flex-1 overflow-hidden",children:o.jsx(bW,{asset:e,onClose:t,hideHeader:!0})})]})}function hTe({experiment:e,onClose:t}){const[r,n]=S.useState([]),[a,i]=S.useState(!1);S.useEffect(()=>{e&&s()},[e]);const s=async()=>{i(!0);try{const c=e.pipeline_name?`/api/runs?pipeline=${encodeURIComponent(e.pipeline_name)}&limit=50`:"/api/runs?limit=50",f=(await(await Ne(c)).json()).runs.filter(h=>h.pipeline_name===e.pipeline_name||e.runs&&e.runs.includes(h.run_id));n(f)}catch(c){console.error("Failed to fetch runs:",c)}finally{i(!1)}};if(!e)return null;const l={total:r.length,success:r.filter(c=>c.status==="completed").length,failed:r.filter(c=>c.status==="failed").length,avgDuration:r.length>0?r.reduce((c,u)=>c+(u.duration||0),0)/r.length:0};return o.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-slate-900",children:[o.jsxs("div",{className:"p-6 border-b border-slate-200 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50",children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"p-3 bg-purple-100 dark:bg-purple-900/30 rounded-xl text-purple-600 dark:text-purple-400",children:o.jsx(Xn,{size:24})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:e.name}),o.jsxs("div",{className:"flex items-center gap-2 mt-1 text-sm text-slate-500",children:[e.project&&o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"opacity-50",children:"Project:"}),o.jsx("span",{className:"font-medium text-slate-700 dark:text-slate-300",children:e.project})]}),o.jsx("span",{children:"•"}),o.jsx("span",{children:Ft(new Date(e.created_at||Date.now()),"MMM d, yyyy")})]})]})]}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(fe,{variant:"ghost",size:"sm",onClick:t,children:o.jsx(Tn,{size:20,className:"text-slate-400"})})})]}),e.description&&o.jsx("p",{className:"text-slate-600 dark:text-slate-400 text-sm mb-6 max-w-3xl",children:e.description}),o.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[o.jsx(cm,{label:"Total Runs",value:l.total,icon:Fe,color:"blue"}),o.jsx(cm,{label:"Success Rate",value:`${l.total>0?Math.round(l.success/l.total*100):0}%`,icon:rr,color:"emerald"}),o.jsx(cm,{label:"Avg Duration",value:`${l.avgDuration.toFixed(1)}s`,icon:ht,color:"purple"}),o.jsx(cm,{label:"Failed",value:l.failed,icon:kr,color:"rose"})]})]}),o.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[o.jsxs("div",{className:"p-4 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between bg-white dark:bg-slate-900",children:[o.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(fn,{size:18,className:"text-slate-400"}),"Recent Runs"]}),o.jsx(ft,{to:`/runs?pipeline=${encodeURIComponent(e.pipeline_name||"")}`,children:o.jsxs(fe,{variant:"ghost",size:"sm",className:"text-primary-600",children:["View All Runs ",o.jsx(Ai,{size:16,className:"ml-1"})]})})]}),o.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-slate-50 dark:bg-slate-900/50",children:a?o.jsx("div",{className:"flex justify-center py-8",children:o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):r.length===0?o.jsx("div",{className:"text-center py-12 text-slate-500",children:"No runs found for this experiment"}):r.map(c=>o.jsx(ft,{to:`/runs/${c.run_id}`,children:o.jsx(ge.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"bg-white dark:bg-slate-800 p-4 rounded-xl border border-slate-200 dark:border-slate-700 hover:shadow-md hover:border-primary-300 dark:hover:border-primary-700 transition-all group",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(qc,{status:c.status}),o.jsxs("div",{children:[o.jsxs("div",{className:"font-medium text-slate-900 dark:text-white flex items-center gap-2",children:[c.name||`Run ${c.run_id.slice(0,8)}`,o.jsxs("span",{className:"text-xs font-mono text-slate-400",children:["#",c.run_id.slice(0,6)]})]}),o.jsxs("div",{className:"flex items-center gap-3 text-xs text-slate-500 mt-1",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(_a,{size:12}),Ft(new Date(c.created||c.start_time),"MMM d, HH:mm")]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(ht,{size:12}),c.duration?`${c.duration.toFixed(1)}s`:"-"]})]})]})]}),o.jsx(Ai,{size:16,className:"text-slate-300 group-hover:text-primary-500 transition-colors"})]})})},c.run_id))})]})]})}function cm({label:e,value:t,icon:r,color:n}){const a={blue:"text-blue-600 bg-blue-50 dark:bg-blue-900/20",emerald:"text-emerald-600 bg-emerald-50 dark:bg-emerald-900/20",purple:"text-purple-600 bg-purple-50 dark:bg-purple-900/20",rose:"text-rose-600 bg-rose-50 dark:bg-rose-900/20"};return o.jsxs("div",{className:"bg-white dark:bg-slate-800 p-3 rounded-xl border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("div",{className:`p-1 rounded-lg ${a[n]}`,children:o.jsx(r,{size:14})}),o.jsx("span",{className:"text-xs text-slate-500 font-medium",children:e})]}),o.jsx("div",{className:"text-lg font-bold text-slate-900 dark:text-white pl-1",children:t})]})}function pTe(){const[e,t]=S.useState([]),[r,n]=S.useState(!0),[a,i]=S.useState(null),{selectedProject:s}=Ui(),l=Lh(),[c,u]=S.useState("single"),[d,f]=S.useState([]);S.useEffect(()=>{(async()=>{n(!0);try{const x=s?`/api/experiments/?project=${encodeURIComponent(s)}`:"/api/experiments/",b=await(await fetch(x)).json();t(b.experiments||[])}catch(x){console.error(x)}finally{n(!1)}})()},[s]);const h=y=>{c==="single"&&i(y)},p=()=>{c==="single"?(u("multi"),f([])):(u("single"),f([]))},m=(y,x)=>{f(x?v=>[...v,y]:v=>v.filter(b=>b!==y))},g=()=>{d.length>=2&&l(`/experiments/compare?ids=${d.join(",")}`)};return o.jsxs("div",{className:"h-screen flex flex-col overflow-hidden bg-slate-50 dark:bg-slate-900",children:[o.jsx("div",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4 shrink-0",children:o.jsxs("div",{className:"flex items-center justify-between max-w-[1800px] mx-auto",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(Xn,{className:"text-purple-500"}),"Experiments"]}),o.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:"Manage and track your ML experiments"})]}),o.jsx("div",{className:"flex items-center gap-3",children:c==="multi"?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"text-sm text-slate-500 mr-2",children:[d.length," selected"]}),o.jsxs(fe,{size:"sm",variant:"primary",disabled:d.length<2,onClick:g,children:[o.jsx(Fe,{size:16,className:"mr-2"}),"Compare"]}),o.jsxs(fe,{variant:"ghost",size:"sm",onClick:p,children:[o.jsx(iF,{size:16,className:"mr-2"}),"Cancel"]})]}):o.jsxs(fe,{variant:"outline",size:"sm",onClick:p,children:[o.jsx(Fe,{size:16,className:"mr-2"}),"Select to Compare"]})})]})}),o.jsx("div",{className:"flex-1 overflow-hidden",children:o.jsx("div",{className:"h-full max-w-[1800px] mx-auto px-6 py-6",children:o.jsxs("div",{className:"h-full flex gap-6",children:[o.jsxs("div",{className:"w-[320px] shrink-0 flex flex-col bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:[o.jsx("div",{className:"p-3 border-b border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50",children:o.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Explorer"})}),o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(aP,{mode:"experiments",projectId:s,onSelect:h,selectedId:a==null?void 0:a.experiment_id,selectionMode:c,selectedIds:d,onMultiSelect:m})})]}),o.jsx("div",{className:"flex-1 min-w-0 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm",children:a?o.jsx(hTe,{experiment:a,onClose:()=>i(null)}):o.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center p-8 bg-slate-50/50 dark:bg-slate-900/50",children:[o.jsx("div",{className:"w-20 h-20 bg-purple-100 dark:bg-purple-900/30 rounded-full flex items-center justify-center mb-6 animate-pulse",children:o.jsx(Xn,{size:40,className:"text-purple-500"})}),o.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-2",children:"Select an Experiment"}),o.jsx("p",{className:"text-slate-500 max-w-md",children:"Choose an experiment from the sidebar to view detailed metrics, runs, and analysis."})]})})]})})})]})}function mTe(){var l;const{experimentId:e}=xE(),[t,r]=S.useState(null),[n,a]=S.useState(!0);if(S.useEffect(()=>{Ne(`/api/experiments/${e}`).then(c=>c.json()).then(c=>{r(c),a(!1)}).catch(c=>{console.error(c),a(!1)})},[e]),n)return o.jsx("div",{className:"flex items-center justify-center h-96",children:o.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})});if(!t)return o.jsx("div",{className:"p-8 text-center",children:o.jsx("p",{className:"text-slate-500",children:"Experiment not found"})});const i={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},s={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return o.jsxs(ge.div,{initial:"hidden",animate:"show",variants:i,className:"space-y-8",children:[o.jsxs(ge.div,{variants:s,className:"bg-white p-6 rounded-xl border border-slate-100 shadow-sm",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(ft,{to:"/experiments",className:"text-sm text-slate-500 hover:text-slate-700 transition-colors",children:"Experiments"}),o.jsx(na,{size:14,className:"text-slate-300"}),o.jsx("span",{className:"text-sm text-slate-900 font-medium",children:t.name})]}),o.jsx("div",{className:"flex items-start justify-between",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"p-3 bg-gradient-to-br from-purple-500 to-pink-500 rounded-xl shadow-lg",children:o.jsx(Xn,{className:"text-white",size:28})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-3xl font-bold text-slate-900 tracking-tight",children:t.name}),o.jsx("p",{className:"text-slate-500 mt-1",children:t.description||"No description"})]})]})})]}),o.jsxs(ge.div,{variants:s,className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[o.jsx(t2,{icon:o.jsx(Fe,{size:24}),label:"Total Runs",value:((l=t.runs)==null?void 0:l.length)||0,color:"blue"}),o.jsx(t2,{icon:o.jsx(Hr,{size:24}),label:"Best Performance",value:gTe(t.runs),color:"emerald"}),o.jsx(t2,{icon:o.jsx(_a,{size:24}),label:"Last Run",value:xTe(t.runs),color:"purple"})]}),o.jsxs(ge.div,{variants:s,children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[o.jsx(p0,{className:"text-primary-500",size:24}),o.jsx("h3",{className:"text-xl font-bold text-slate-900",children:"Runs Comparison"})]}),t.runs&&t.runs.length>0?o.jsx(Te,{className:"p-0 overflow-hidden",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-left",children:[o.jsx("thead",{className:"bg-gradient-to-r from-slate-50 to-slate-100/50 border-b border-slate-200",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-4 font-semibold text-xs text-slate-600 uppercase tracking-wider",children:"Run ID"}),o.jsx("th",{className:"px-6 py-4 font-semibold text-xs text-slate-600 uppercase tracking-wider",children:"Date"}),o.jsx("th",{className:"px-6 py-4 font-semibold text-xs text-slate-600 uppercase tracking-wider",children:"Metrics"}),o.jsx("th",{className:"px-6 py-4 font-semibold text-xs text-slate-600 uppercase tracking-wider",children:"Parameters"}),o.jsx("th",{className:"px-6 py-4 font-semibold text-xs text-slate-600 uppercase tracking-wider"})]})}),o.jsx("tbody",{className:"divide-y divide-slate-100",children:t.runs.map((c,u)=>{var d;return o.jsxs(ge.tr,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:u*.05},className:"hover:bg-slate-50/70 transition-colors group",children:[o.jsx("td",{className:"px-6 py-4 font-mono text-sm text-slate-700 font-medium",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-2 h-2 rounded-full bg-primary-400 opacity-0 group-hover:opacity-100 transition-opacity"}),((d=c.run_id)==null?void 0:d.substring(0,12))||"N/A"]})}),o.jsx("td",{className:"px-6 py-4 text-sm text-slate-500",children:c.timestamp?Ft(new Date(c.timestamp),"MMM d, HH:mm:ss"):"-"}),o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex flex-wrap gap-2",children:[Object.entries(c.metrics||{}).map(([f,h])=>o.jsxs(qe,{variant:"outline",className:"font-mono text-xs bg-blue-50 text-blue-700 border-blue-200",children:[f,": ",typeof h=="number"?h.toFixed(4):h]},f)),Object.keys(c.metrics||{}).length===0&&o.jsx("span",{className:"text-xs text-slate-400 italic",children:"No metrics"})]})}),o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex flex-wrap gap-2",children:[Object.entries(c.parameters||{}).map(([f,h])=>o.jsxs("span",{className:"text-xs text-slate-600 bg-slate-100 px-2.5 py-1 rounded-md font-medium",children:[f,"=",String(h)]},f)),Object.keys(c.parameters||{}).length===0&&o.jsx("span",{className:"text-xs text-slate-400 italic",children:"No params"})]})}),o.jsx("td",{className:"px-6 py-4 text-right",children:o.jsx(ft,{to:`/runs/${c.run_id}`,children:o.jsx(fe,{variant:"ghost",size:"sm",className:"opacity-0 group-hover:opacity-100 transition-opacity",children:"View Run"})})})]},c.run_id)})})]})})}):o.jsx(Te,{className:"p-12 text-center border-dashed",children:o.jsx("p",{className:"text-slate-500",children:"No runs recorded for this experiment yet."})})]})]})}function t2({icon:e,label:t,value:r,color:n}){const a={blue:"bg-blue-50 text-blue-600",purple:"bg-purple-50 text-purple-600",emerald:"bg-emerald-50 text-emerald-600"};return o.jsx(Te,{className:"hover:shadow-md transition-shadow duration-200",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:`p-3 rounded-xl ${a[n]}`,children:e}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm text-slate-500 font-medium",children:t}),o.jsx("p",{className:"text-2xl font-bold text-slate-900",children:r})]})]})})}function gTe(e){if(!e||e.length===0)return"-";const t=["accuracy","f1_score","precision","recall"];for(const r of t){const n=e.map(a=>{var i;return(i=a.metrics)==null?void 0:i[r]}).filter(a=>typeof a=="number");if(n.length>0)return`${Math.max(...n).toFixed(4)} (${r})`}return"N/A"}function xTe(e){var r;if(!e||e.length===0)return"-";const t=[...e].sort((n,a)=>{const i=n.timestamp?new Date(n.timestamp):new Date(0);return(a.timestamp?new Date(a.timestamp):new Date(0))-i});return(r=t[0])!=null&&r.timestamp?Ft(new Date(t[0].timestamp),"MMM d, HH:mm"):"-"}function yTe(){const[e,t]=S.useState([]),[r,n]=S.useState(null),[a,i]=S.useState(!0),[s,l]=S.useState("all"),{selectedProject:c}=Ui();S.useEffect(()=>{u()},[s,c]);const u=async()=>{i(!0);try{const g=new URLSearchParams;s!=="all"&&g.append("event_type",s),c&&g.append("project",c);const x=await(await Ne(`/api/traces?${g}`)).json();t(x)}catch(g){console.error("Failed to fetch traces:",g)}finally{i(!1)}},d=async g=>{try{const x=await(await Ne(`/api/traces/${g}`)).json();n(x)}catch(y){console.error("Failed to fetch trace details:",y)}},f=g=>g?`${(g*1e3).toFixed(0)}ms`:"N/A",h=g=>{switch(g){case"success":return"text-green-400";case"error":return"text-red-400";case"running":return"text-yellow-400";default:return"text-gray-400"}},p=g=>{switch(g){case"llm":return o.jsx(rF,{className:"w-4 h-4"});case"tool":return o.jsx(hn,{className:"w-4 h-4"});default:return o.jsx(Fe,{className:"w-4 h-4"})}},m=({events:g,level:y=0})=>g?o.jsx("div",{className:`pl-${y*4}`,children:g.map((x,v)=>o.jsxs("div",{className:"mb-2",children:[o.jsxs("div",{className:"flex items-center gap-2 p-2 bg-gray-800/50 rounded border border-gray-700/50 hover:border-blue-500/50 transition-colors",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[p(x.event_type),o.jsx("span",{className:"font-medium",children:x.name}),o.jsx("span",{className:`text-sm ${h(x.status)}`,children:x.status})]}),o.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-400",children:[x.duration&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(ht,{className:"w-3 h-3"}),f(x.duration)]}),x.total_tokens>0&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Fe,{className:"w-3 h-3"}),x.total_tokens," tokens"]}),x.cost>0&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(xZ,{className:"w-3 h-3"}),"$",x.cost.toFixed(4)]})]})]}),x.children&&x.children.length>0&&o.jsx("div",{className:"ml-6 mt-2 border-l-2 border-gray-700/50 pl-2",children:o.jsx(m,{events:x.children,level:y+1})})]},v))}):null;return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"flex justify-between items-center mb-6",children:[o.jsx("h1",{className:"text-2xl font-bold",children:"🔍 LLM Traces"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("select",{value:s,onChange:g=>l(g.target.value),className:"px-4 py-2 bg-gray-800 border border-gray-700 rounded-lg",children:[o.jsx("option",{value:"all",children:"All Types"}),o.jsx("option",{value:"llm",children:"LLM Calls"}),o.jsx("option",{value:"tool",children:"Tool Calls"}),o.jsx("option",{value:"chain",children:"Chains"}),o.jsx("option",{value:"agent",children:"Agents"})]}),o.jsx("button",{onClick:u,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:"Refresh"})]})]}),a?o.jsxs("div",{className:"text-center py-12",children:[o.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"}),o.jsx("p",{className:"mt-4 text-gray-400",children:"Loading traces..."})]}):e.length===0?o.jsxs("div",{className:"text-center py-12 bg-gray-800/30 rounded-lg border-2 border-dashed border-gray-700",children:[o.jsx(Fe,{className:"w-12 h-12 mx-auto text-gray-600 mb-4"}),o.jsx("p",{className:"text-gray-400",children:"No traces found"}),o.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"Use @trace_llm decorator to track LLM calls"})]}):o.jsx("div",{className:"grid gap-4",children:e.map(g=>{const y=g.trace_id;return o.jsxs("div",{className:"bg-gray-800/50 rounded-lg border border-gray-700/50 p-4 hover:border-blue-500/50 transition-all cursor-pointer",onClick:()=>d(y),children:[o.jsxs("div",{className:"flex items-start justify-between mb-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[p(g.event_type),o.jsxs("div",{children:[o.jsx("h3",{className:"font-semibold text-lg",children:g.name}),o.jsxs("p",{className:"text-sm text-gray-400",children:["Trace ID: ",y.slice(0,8),"..."]})]})]}),o.jsx("span",{className:`px-3 py-1 rounded-full text-sm ${h(g.status)}`,children:g.status})]}),o.jsxs("div",{className:"grid grid-cols-4 gap-4 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-gray-500",children:"Duration:"}),o.jsx("span",{className:"ml-2 text-gray-300",children:f(g.duration)})]}),g.model&&o.jsxs("div",{children:[o.jsx("span",{className:"text-gray-500",children:"Model:"}),o.jsx("span",{className:"ml-2 text-gray-300",children:g.model})]}),g.total_tokens>0&&o.jsxs("div",{children:[o.jsx("span",{className:"text-gray-500",children:"Tokens:"}),o.jsxs("span",{className:"ml-2 text-gray-300",children:[g.total_tokens," (",g.prompt_tokens,"/",g.completion_tokens,")"]})]}),g.cost>0&&o.jsxs("div",{children:[o.jsx("span",{className:"text-gray-500",children:"Cost:"}),o.jsxs("span",{className:"ml-2 text-gray-300",children:["$",g.cost.toFixed(4)]})]})]})]},g.event_id)})}),r&&o.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center p-6 z-50",children:o.jsxs("div",{className:"bg-gray-900 rounded-lg max-w-4xl w-full max-h-[80vh] overflow-auto border border-gray-700",children:[o.jsxs("div",{className:"sticky top-0 bg-gray-900 border-b border-gray-700 p-4 flex justify-between items-center",children:[o.jsx("h2",{className:"text-xl font-bold",children:"Trace Details"}),o.jsx("button",{onClick:()=>n(null),className:"px-4 py-2 bg-gray-800 hover:bg-gray-700 rounded-lg",children:"Close"})]}),o.jsx("div",{className:"p-6",children:o.jsx(m,{events:r})})]})})]})}function vTe(){const[e,t]=S.useState([]),[r,n]=S.useState(!0),[a,i]=S.useState(!1),[s,l]=S.useState(""),[c,u]=S.useState(""),[d,f]=S.useState({}),{setSelectedProject:h}=Ui();S.useEffect(()=>{p()},[]);const p=async()=>{try{const b=await(await Ne("/api/projects/")).json(),j=Array.isArray(b)?b:b.projects||[],w=await Promise.all(j.map(async k=>{try{const _=await(await fetch(`/api/runs?project=${encodeURIComponent(k.name)}`)).json(),P=new Set((_.runs||[]).map(O=>O.pipeline_name)),A=await(await fetch(`/api/assets?project=${encodeURIComponent(k.name)}`)).json();return{...k,runs:(_.runs||[]).length,pipelines:P.size,artifacts:(A.artifacts||[]).length}}catch(N){return console.error(`Failed to fetch stats for project ${k.name}:`,N),{...k,runs:0,pipelines:0,artifacts:0}}}));t(w)}catch(v){console.error("Failed to fetch projects:",v)}finally{n(!1)}},m=async v=>{v.preventDefault();try{(await Ne("/api/projects/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s,description:c})})).ok&&(i(!1),l(""),u(""),p())}catch(b){console.error("Failed to create project:",b)}},g=async v=>{if(confirm(`Are you sure you want to delete project "${v}"?`))try{(await Ne(`/api/projects/${v}`,{method:"DELETE"})).ok&&p()}catch(b){console.error("Failed to delete project:",b)}},y=[{header:"Project Name",key:"name",sortable:!0,render:v=>o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 bg-blue-500/10 rounded-lg",children:o.jsx(Zn,{className:"w-5 h-5 text-blue-500"})}),o.jsxs("div",{children:[o.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:v.name}),o.jsxs("div",{className:"text-xs text-slate-500",children:["Created ",Ft(new Date(v.created_at),"MMM d, yyyy")]})]})]})},{header:"Description",key:"description",render:v=>o.jsx("span",{className:"text-slate-500 dark:text-slate-400 truncate max-w-xs block",children:v.description||"No description"})},{header:"Stats",key:"stats",render:v=>{const b={runs:v.runs||0,pipelines:v.pipelines||0,artifacts:v.artifacts||0};return o.jsxs("div",{className:"flex gap-4 text-sm text-slate-500",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Fe,{size:14})," ",b.pipelines||0]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(ht,{size:14})," ",b.runs||0]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(nr,{size:14})," ",b.artifacts||0]})]})}},{header:"Actions",key:"actions",render:v=>o.jsx("button",{onClick:b=>{b.stopPropagation(),g(v.name)},className:"p-2 text-slate-400 hover:text-red-500 transition-colors",children:o.jsx(Oi,{size:16})})}],x=v=>{const b={runs:v.runs||0,pipelines:v.pipelines||0,artifacts:v.artifacts||0};return o.jsx(ft,{to:`/projects/${encodeURIComponent(v.name)}`,onClick:()=>h(v.name),className:"block",children:o.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 p-6 hover:border-blue-500/50 hover:shadow-md transition-all group cursor-pointer",children:[o.jsxs("div",{className:"flex justify-between items-start mb-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-3 bg-blue-500/10 rounded-xl group-hover:bg-blue-500/20 transition-colors",children:o.jsx(Zn,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-bold text-lg text-slate-900 dark:text-white",children:v.name}),o.jsxs("p",{className:"text-xs text-slate-500",children:["Created ",Ft(new Date(v.created_at),"MMM d, yyyy")]})]})]}),o.jsx("button",{onClick:j=>{j.preventDefault(),j.stopPropagation(),g(v.name)},className:"text-slate-400 hover:text-red-500 transition-colors opacity-0 group-hover:opacity-100",children:o.jsx(Oi,{className:"w-4 h-4"})})]}),o.jsx("p",{className:"text-slate-500 dark:text-slate-400 mb-6 h-10 overflow-hidden text-sm line-clamp-2",children:v.description||"No description provided."}),o.jsxs("div",{className:"grid grid-cols-3 gap-4 border-t border-slate-100 dark:border-slate-700 pt-4",children:[o.jsxs("div",{className:"text-center",children:[o.jsxs("div",{className:"flex items-center justify-center gap-1 text-slate-400 text-xs mb-1",children:[o.jsx(Fe,{className:"w-3 h-3"})," Pipelines"]}),o.jsx("span",{className:"font-bold text-slate-700 dark:text-slate-200",children:b.pipelines||0})]}),o.jsxs("div",{className:"text-center",children:[o.jsxs("div",{className:"flex items-center justify-center gap-1 text-slate-400 text-xs mb-1",children:[o.jsx(ht,{className:"w-3 h-3"})," Runs"]}),o.jsx("span",{className:"font-bold text-slate-700 dark:text-slate-200",children:b.runs||0})]}),o.jsxs("div",{className:"text-center",children:[o.jsxs("div",{className:"flex items-center justify-center gap-1 text-slate-400 text-xs mb-1",children:[o.jsx(nr,{className:"w-3 h-3"})," Artifacts"]}),o.jsx("span",{className:"font-bold text-slate-700 dark:text-slate-200",children:b.artifacts||0})]})]})]})})};return o.jsxs("div",{className:"p-6 max-w-7xl mx-auto",children:[o.jsx(Uh,{title:"Projects",subtitle:"Manage your ML projects and workspaces",items:e,loading:r,columns:y,initialView:"grid",renderGrid:x,actions:o.jsxs(fe,{onClick:()=>i(!0),className:"flex items-center gap-2",children:[o.jsx(rl,{size:18}),"New Project"]}),emptyState:o.jsxs("div",{className:"text-center py-12 bg-slate-50 dark:bg-slate-800/30 rounded-xl border-2 border-dashed border-slate-200 dark:border-slate-700",children:[o.jsx(Zn,{className:"w-12 h-12 mx-auto text-slate-400 mb-4"}),o.jsx("h3",{className:"text-lg font-medium text-slate-900 dark:text-white",children:"No projects found"}),o.jsx("p",{className:"text-slate-500 mb-6",children:"Get started by creating your first project."}),o.jsx(fe,{onClick:()=>i(!0),children:"Create Project"})]})}),a&&o.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 animate-in fade-in duration-200",children:o.jsxs("div",{className:"bg-white dark:bg-slate-800 p-6 rounded-xl w-full max-w-md border border-slate-200 dark:border-slate-700 shadow-xl",children:[o.jsx("h2",{className:"text-xl font-bold mb-4 text-slate-900 dark:text-white",children:"Create New Project"}),o.jsxs("form",{onSubmit:m,children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Project Name"}),o.jsx("input",{type:"text",value:s,onChange:v=>l(v.target.value),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-700 rounded-lg border border-slate-200 dark:border-slate-600 focus:border-blue-500 outline-none text-slate-900 dark:text-white",required:!0,placeholder:"e.g., recommendation-system"})]}),o.jsxs("div",{className:"mb-6",children:[o.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Description"}),o.jsx("textarea",{value:c,onChange:v=>u(v.target.value),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-700 rounded-lg border border-slate-200 dark:border-slate-600 focus:border-blue-500 outline-none text-slate-900 dark:text-white",rows:"3",placeholder:"Brief description of the project..."})]}),o.jsxs("div",{className:"flex justify-end gap-3",children:[o.jsx("button",{type:"button",onClick:()=>i(!1),className:"px-4 py-2 text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-lg transition-colors",children:"Cancel"}),o.jsx(fe,{type:"submit",children:"Create Project"})]})]})]})})]})}const bTe=({status:e})=>{switch(e==null?void 0:e.toLowerCase()){case"completed":case"success":return o.jsx(rr,{className:"w-4 h-4 text-green-500"});case"failed":return o.jsx(kr,{className:"w-4 h-4 text-red-500"});case"running":return o.jsx(Fe,{className:"w-4 h-4 text-blue-500 animate-spin"});default:return o.jsx(ht,{className:"w-4 h-4 text-slate-400"})}},wTe=({type:e})=>{const t={className:"w-4 h-4"};switch(e==null?void 0:e.toLowerCase()){case"model":return o.jsx(Ur,{...t,className:"w-4 h-4 text-purple-500"});case"dataset":case"data":return o.jsx(nr,{...t,className:"w-4 h-4 text-blue-500"});case"metrics":return o.jsx(Pn,{...t,className:"w-4 h-4 text-emerald-500"});default:return o.jsx(gs,{...t,className:"w-4 h-4 text-slate-400"})}},bd=({label:e,icon:t,children:r,defaultExpanded:n=!1,actions:a,status:i,level:s=0,badge:l,onClick:c})=>{const[u,d]=S.useState(n),f=r&&r.length>0;return o.jsxs("div",{className:"select-none",children:[o.jsxs(ge.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{duration:.2},className:`
744
+ flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-all
745
+ hover:bg-slate-100 dark:hover:bg-slate-800
746
+ ${s===0?"bg-slate-50 dark:bg-slate-800/50 mb-1 font-semibold":""}
747
+ `,style:{paddingLeft:`${s*1.5+.5}rem`},onClick:()=>{f&&d(!u),c==null||c()},children:[o.jsx("div",{className:"flex items-center gap-1 text-slate-400",children:f?o.jsx(ge.div,{animate:{rotate:u?90:0},transition:{duration:.2},children:o.jsx(na,{className:"w-4 h-4"})}):o.jsx("div",{className:"w-4"})}),t&&o.jsx(t,{className:`w-4 h-4 ${s===0?"text-blue-500":"text-slate-500 dark:text-slate-400"}`}),o.jsxs("div",{className:"flex-1 flex items-center justify-between gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx("span",{className:`text-sm truncate ${s===0?"font-semibold text-slate-900 dark:text-white":"text-slate-700 dark:text-slate-300"}`,children:e}),l]}),o.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[i&&o.jsx(bTe,{status:i}),a]})]})]}),o.jsx(Zt,{children:u&&f&&o.jsx(ge.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2},children:r})})]})};function jTe({projectId:e,onAssetSelect:t,compact:r=!1}){const[n,a]=S.useState({projects:[],pipelines:[],runs:[],artifacts:[]}),[i,s]=S.useState(!0),[l,c]=S.useState(""),[u,d]=S.useState("all");if(S.useEffect(()=>{(async()=>{s(!0);try{const j=e?[Ne(`/api/pipelines?project=${e}`),Ne(`/api/runs?project=${e}&limit=200`),Ne(`/api/assets?project=${e}&limit=500`)]:[Ne("/api/pipelines?limit=100"),Ne("/api/runs?limit=200"),Ne("/api/assets?limit=500")],[w,k,N]=await Promise.all(j),_=await w.json(),P=await k.json(),C=await N.json();let A=[];if(!e){const O=new Set(((C==null?void 0:C.assets)||[]).map(E=>E.project).filter(Boolean)),T=new Set(((P==null?void 0:P.runs)||[]).map(E=>E.project).filter(Boolean));A=[...new Set([...O,...T])].map(E=>({name:E}))}a({projects:A,pipelines:Array.isArray(_==null?void 0:_.pipelines)?_.pipelines:[],runs:Array.isArray(P==null?void 0:P.runs)?P.runs:[],artifacts:Array.isArray(C==null?void 0:C.assets)?C.assets:[]})}catch(j){console.error("Failed to fetch hierarchy data:",j)}finally{s(!1)}})()},[e]),i)return o.jsx("div",{className:`w-full bg-slate-50 dark:bg-slate-800/50 animate-pulse flex items-center justify-center ${r?"h-full min-h-[200px]":"h-[600px] rounded-xl"}`,children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600 mx-auto mb-3"}),o.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:"Loading..."})]})});const f=(b,j=null)=>n.runs.filter(w=>w.pipeline_name===b&&(!j||w.project===j)),h=(b,j=null)=>{let w=n.artifacts.filter(k=>!!(k.run_id===b||b&&k.run_id&&(k.run_id.startsWith(b)||b.startsWith(k.run_id)||k.run_id.includes(b)||b.includes(k.run_id))||b&&k.artifact_id&&k.artifact_id.includes(b)||j&&k.pipeline_name&&k.pipeline_name===j.pipeline_name));return u!=="all"&&(w=w.filter(k=>{var N;return((N=k.type)==null?void 0:N.toLowerCase())===u})),w},p=(b,j)=>{let w=n.artifacts.filter(k=>k.pipeline_name===b||!k.pipeline_name&&k.project===j);return u!=="all"&&(w=w.filter(k=>{var N;return((N=k.type)==null?void 0:N.toLowerCase())===u})),w},m=b=>{const j=n.runs.filter(k=>k.project===b),w=[...new Set(j.map(k=>k.pipeline_name))];return n.pipelines.filter(k=>w.includes(k.name))},g=()=>e||n.projects.length===0?n.pipelines.map((b,j)=>{const w=f(b.name,e);return y(b,w,0,j<3,e)}):n.projects.map((b,j)=>{const w=m(b.name);return o.jsx(bd,{label:b.name,icon:Zn,level:0,defaultExpanded:j===0,badge:o.jsxs("span",{className:"text-xs text-slate-400",children:[w.length," pipeline",w.length!==1?"s":""]}),children:w.map((k,N)=>{const _=f(k.name,b.name);return y(k,_,1,j===0&&N<2,b.name)})},b.name)}),y=(b,j,w,k=!1,N=null)=>{const _=p(b.name,N),P=new Set(j.map(O=>O.run_id)),C=_.filter(O=>{var T;if(P.has(O.run_id))return!1;for(const E of P)if(O.run_id&&E&&(O.run_id.startsWith(E)||E.startsWith(O.run_id)||(T=O.artifact_id)!=null&&T.includes(E)))return!1;return!0});_.length-C.length;const A=_.length;return o.jsxs(bd,{label:b.name,icon:Fe,level:w,defaultExpanded:k||C.length>0,badge:o.jsx("div",{className:"flex gap-1",children:A>0&&o.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] bg-blue-100 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 px-1.5 py-0.5 rounded-full",children:[o.jsx(gs,{className:"w-3 h-3"})," ",A]})}),actions:o.jsx(ft,{to:`/pipelines/${b.name}`,className:"text-xs text-blue-500 hover:underline px-2 py-1 rounded hover:bg-blue-50 dark:hover:bg-blue-900/20",onClick:O=>O.stopPropagation(),children:"View"}),children:[j.length===0&&C.length===0&&o.jsx("div",{className:"pl-12 py-2 text-xs text-slate-400 italic",children:"No runs yet"}),j.map(O=>x(O,w+1)),C.length>0&&o.jsx(bd,{label:"Other Artifacts",icon:gs,level:w+1,defaultExpanded:!0,badge:o.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] bg-amber-100 text-amber-600 dark:bg-amber-900/30 dark:text-amber-400 px-1.5 py-0.5 rounded-full",children:[o.jsx(gs,{className:"w-3 h-3"})," ",C.length]}),children:C.map(O=>v(O,w+2))},`${b.name}-unmatched`)]},b.name)},x=(b,j)=>{const w=h(b.run_id,b),k=w.filter(N=>{var _;return((_=N.type)==null?void 0:_.toLowerCase())==="model"}).length;return o.jsxs(bd,{label:b.name||`Run ${b.run_id.slice(0,8)}`,icon:fn,level:j,status:b.status,defaultExpanded:w.length>0&&w.length<=5,badge:w.length>0&&o.jsxs("div",{className:"flex gap-1",children:[k>0&&o.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400 px-1.5 py-0.5 rounded-full",children:[o.jsx(Ur,{className:"w-3 h-3"})," ",k]}),o.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400 px-1.5 py-0.5 rounded-full",children:[o.jsx(gs,{className:"w-3 h-3"})," ",w.length]})]}),actions:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-slate-400",children:Di(b.created)}),o.jsx(ft,{to:`/runs/${b.run_id}`,className:"text-xs text-blue-500 hover:underline",onClick:N=>N.stopPropagation(),children:"Details"})]}),children:[w.length===0&&o.jsx("div",{className:"pl-16 py-1 text-xs text-slate-400 italic",children:"No artifacts"}),w.map(N=>v(N,j+1))]},b.run_id)},v=(b,j)=>{var N;const w={model:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300",dataset:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300",metrics:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300",default:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400"},k=w[(N=b.type)==null?void 0:N.toLowerCase()]||w.default;return o.jsx(bd,{label:b.name,icon:()=>o.jsx(wTe,{type:b.type}),level:j,onClick:()=>t==null?void 0:t(b),badge:o.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${k}`,children:b.type}),actions:o.jsxs("div",{className:"flex items-center gap-2",children:[b.properties&&Object.keys(b.properties).length>0&&o.jsxs("span",{className:"text-xs text-slate-400",children:[Object.keys(b.properties).length," props"]}),o.jsx("button",{onClick:_=>{_.stopPropagation(),t==null||t(b)},className:"p-1 rounded hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",children:o.jsx(ju,{className:"w-3 h-3 text-slate-400"})}),o.jsx("button",{onClick:_=>{_.stopPropagation(),Yc(b.artifact_id)},className:"p-1 rounded hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors disabled:opacity-40",disabled:!b.artifact_id,children:o.jsx(Oa,{className:"w-3 h-3 text-slate-400"})})]})},b.artifact_id)};return o.jsxs("div",{className:r?"h-full flex flex-col":"bg-white dark:bg-slate-900 rounded-xl border border-slate-200 dark:border-slate-800 overflow-hidden",children:[!r&&o.jsx("div",{className:"p-4 border-b border-slate-200 dark:border-slate-800 bg-gradient-to-r from-blue-50 to-purple-50 dark:from-slate-800 dark:to-slate-800",children:o.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(Fc,{className:"w-4 h-4 text-blue-500"}),"Asset Hierarchy"]}),o.jsxs("span",{className:"text-xs text-slate-500",children:[n.artifacts.length," asset",n.artifacts.length!==1?"s":""]})]})}),o.jsx("div",{className:`${r?"p-2 border-b border-slate-100 dark:border-slate-700":"p-4 border-b border-slate-200 dark:border-slate-800 bg-gradient-to-r from-blue-50 to-purple-50 dark:from-slate-800 dark:to-slate-800"}`,children:o.jsxs("div",{className:`flex ${r?"justify-between":"gap-2"}`,children:[o.jsxs("button",{onClick:()=>d("all"),title:"All Assets",className:`flex items-center justify-center gap-1.5 ${r?"p-1.5 rounded-md":"px-3 py-1.5 rounded-lg"} text-sm font-medium transition-all ${u==="all"?"bg-primary-500 text-white shadow-md":"bg-white dark:bg-slate-700 text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-600"}`,children:[o.jsx(gs,{className:"w-3.5 h-3.5"}),!r&&o.jsxs(o.Fragment,{children:["All Assets ",o.jsxs("span",{className:"text-xs opacity-75",children:["(",n.artifacts.length,")"]})]})]}),o.jsxs("button",{onClick:()=>d("model"),title:"Models",className:`flex items-center justify-center gap-1.5 ${r?"p-1.5 rounded-md":"px-3 py-1.5 rounded-lg"} text-sm font-medium transition-all ${u==="model"?"bg-gradient-to-r from-purple-500 to-pink-500 text-white shadow-md":"bg-white dark:bg-slate-700 text-purple-600 dark:text-purple-400 hover:bg-purple-50 dark:hover:bg-purple-900/20"}`,children:[o.jsx(Ur,{className:"w-3.5 h-3.5"}),!r&&o.jsxs(o.Fragment,{children:["Models ",o.jsxs("span",{className:"text-xs opacity-75",children:["(",n.artifacts.filter(b=>{var j;return((j=b.type)==null?void 0:j.toLowerCase())==="model"}).length,")"]})]})]}),o.jsxs("button",{onClick:()=>d("dataset"),title:"Datasets",className:`flex items-center justify-center gap-1.5 ${r?"p-1.5 rounded-md":"px-3 py-1.5 rounded-lg"} text-sm font-medium transition-all ${u==="dataset"?"bg-gradient-to-r from-blue-500 to-cyan-500 text-white shadow-md":"bg-white dark:bg-slate-700 text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20"}`,children:[o.jsx(nr,{className:"w-3.5 h-3.5"}),!r&&o.jsxs(o.Fragment,{children:["Datasets ",o.jsxs("span",{className:"text-xs opacity-75",children:["(",n.artifacts.filter(b=>{var j;return((j=b.type)==null?void 0:j.toLowerCase())==="dataset"}).length,")"]})]})]})]})}),o.jsx("div",{className:r?"flex-1 overflow-y-auto p-2":"p-3 max-h-[700px] overflow-y-auto",children:n.pipelines.length===0&&n.projects.length===0?o.jsxs("div",{className:"p-8 text-center",children:[o.jsx(nr,{className:"h-12 w-12 text-slate-300 dark:text-slate-600 mx-auto mb-3"}),o.jsx("p",{className:"text-slate-600 dark:text-slate-400 font-medium mb-1",children:"No assets found"}),o.jsx("p",{className:"text-slate-500 text-sm",children:"Run a pipeline to generate artifacts"})]}):g()})]})}function kTe({project:e,stats:t,loading:r}){var n,a,i;return r||!e?o.jsxs("div",{className:"animate-pulse space-y-4",children:[o.jsx("div",{className:"h-8 bg-slate-200 dark:bg-slate-700 rounded w-1/3"}),o.jsx("div",{className:"h-4 bg-slate-200 dark:bg-slate-700 rounded w-1/2"}),o.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[o.jsx("div",{className:"h-24 bg-slate-200 dark:bg-slate-700 rounded-xl"}),o.jsx("div",{className:"h-24 bg-slate-200 dark:bg-slate-700 rounded-xl"}),o.jsx("div",{className:"h-24 bg-slate-200 dark:bg-slate-700 rounded-xl"}),o.jsx("div",{className:"h-24 bg-slate-200 dark:bg-slate-700 rounded-xl"})]})]}):o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"p-3 bg-blue-600 rounded-xl shadow-lg shadow-blue-500/20",children:o.jsx(Zn,{className:"w-6 h-6 text-white"})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-1",children:e.name}),o.jsxs("div",{className:"flex items-center gap-4 text-sm text-slate-500 dark:text-slate-400",children:[o.jsxs("span",{children:["Created ",Di(((n=e.metadata)==null?void 0:n.created_at)||e.created_at)]}),(((a=e.metadata)==null?void 0:a.description)||e.description)&&o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"•"}),o.jsx("span",{children:((i=e.metadata)==null?void 0:i.description)||e.description})]})]})]})]}),o.jsx("div",{className:"flex gap-2"})]})}function cz({projectId:e}){const[t,r]=S.useState([]),[n,a]=S.useState(!0),[i,s]=S.useState(null);if(S.useEffect(()=>{e&&(async()=>{a(!0);try{const d=await(await Ne(`/api/projects/${e}/metrics?limit=500`)).json();r(Array.isArray(d==null?void 0:d.metrics)?d.metrics:[])}catch(u){console.error("Failed to load project metrics",u),s("Unable to load metrics")}finally{a(!1)}})()},[e]),n)return o.jsx(STe,{});if(i)return o.jsx(_Te,{error:i});if(!t.length)return o.jsx(ETe,{});const l=t.reduce((c,u)=>(c[u.model_name]||(c[u.model_name]=[]),c[u.model_name].push(u),c),{});return o.jsx("div",{className:"space-y-8",children:Object.entries(l).map(([c,u])=>o.jsx(NTe,{modelName:c,metrics:u},c))})}function NTe({modelName:e,metrics:t}){const r=[...t].sort((d,f)=>new Date(d.created_at)-new Date(f.created_at)),n=r[r.length-1],a=r.reduce((d,f)=>{const h=f.created_at;return d[h]||(d[h]={timestamp:h,displayDate:Ft(new Date(h),"MMM d HH:mm"),tags:f.tags,run_id:f.run_id,environment:f.environment}),d[h][f.metric_name]=typeof f.metric_value=="number"?parseFloat(f.metric_value.toFixed(4)):f.metric_value,d},{}),i=Object.values(a),l=[...new Set(t.map(d=>d.metric_name))].filter(d=>i.some(f=>typeof f[d]=="number")),c=l.filter(d=>!d.includes("latency")&&!d.includes("loss")),u=l.filter(d=>d.includes("latency"));return o.jsxs(Te,{className:"overflow-hidden border-slate-200 dark:border-slate-800",children:[o.jsxs("div",{className:"p-4 border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 bg-purple-100 dark:bg-purple-900/30 rounded-lg",children:o.jsx(Ur,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-semibold text-slate-900 dark:text-white",children:e}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:[o.jsx(ht,{size:12}),"Last updated: ",Ft(new Date(n.created_at),"MMM d, yyyy HH:mm")]})]})]}),o.jsxs("div",{className:"flex gap-2",children:[n.environment&&o.jsx(qe,{variant:"outline",className:"bg-white dark:bg-slate-800",children:n.environment}),o.jsxs(qe,{className:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300 border-0",children:[i.length," logs"]})]})]}),o.jsxs("div",{className:"p-6 grid grid-cols-1 lg:grid-cols-3 gap-6",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsx("h4",{className:"text-sm font-medium text-slate-500 uppercase tracking-wider",children:"Latest Performance"}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.map(d=>o.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-800/50 rounded-lg border border-slate-100 dark:border-slate-800",children:[o.jsx("p",{className:"text-xs text-slate-500 mb-1 capitalize",children:d.replace(/_/g," ")}),o.jsx("p",{className:"text-lg font-bold text-slate-900 dark:text-white",children:i[i.length-1][d]})]},d)),u.map(d=>o.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-800/50 rounded-lg border border-slate-100 dark:border-slate-800",children:[o.jsx("p",{className:"text-xs text-slate-500 mb-1 capitalize",children:d.replace(/_/g," ")}),o.jsxs("p",{className:"text-lg font-bold text-slate-900 dark:text-white",children:[i[i.length-1][d]," ",o.jsx("span",{className:"text-xs font-normal text-slate-400",children:"ms"})]})]},d))]})]}),o.jsx("div",{className:"lg:col-span-2 space-y-6",children:c.length>0&&o.jsxs("div",{className:"h-[250px] w-full",children:[o.jsx("h4",{className:"text-sm font-medium text-slate-500 uppercase tracking-wider mb-4",children:"Score Trends"}),o.jsx(Zx,{width:"100%",height:"100%",children:o.jsxs(aOe,{data:i,children:[o.jsx(rp,{strokeDasharray:"3 3",stroke:"#e2e8f0",vertical:!1}),o.jsx(Yi,{dataKey:"displayDate",stroke:"#94a3b8",fontSize:12,tickLine:!1,axisLine:!1}),o.jsx(Xi,{domain:[0,1],stroke:"#94a3b8",fontSize:12,tickLine:!1,axisLine:!1}),o.jsx(jn,{contentStyle:{backgroundColor:"#fff",borderRadius:"8px",border:"1px solid #e2e8f0",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"},itemStyle:{fontSize:"12px"}}),o.jsx(zs,{}),c.map((d,f)=>o.jsx(np,{type:"monotone",dataKey:d,stroke:um[f%um.length],strokeWidth:2,dot:{r:3,fill:um[f%um.length]},activeDot:{r:5}},d))]})})]})})]})]})}const um=["#8b5cf6","#3b82f6","#10b981","#f59e0b","#ef4444","#ec4899"];function STe(){return o.jsx("div",{className:"h-64 flex items-center justify-center border border-dashed border-slate-200 dark:border-slate-700 rounded-xl",children:o.jsxs("div",{className:"flex flex-col items-center gap-3",children:[o.jsx(Fe,{className:"w-8 h-8 text-primary-500 animate-spin"}),o.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:"Loading metrics..."})]})})}function _Te({error:e}){return o.jsx("div",{className:"h-64 flex items-center justify-center border border-rose-200 dark:border-rose-900 bg-rose-50 dark:bg-rose-900/10 rounded-xl",children:o.jsx("p",{className:"text-rose-600 dark:text-rose-400",children:e})})}function ETe(){return o.jsx("div",{className:"h-64 flex items-center justify-center border border-dashed border-slate-200 dark:border-slate-700 rounded-xl",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Pn,{className:"w-12 h-12 text-slate-300 mx-auto mb-3"}),o.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:"No metrics logged yet"}),o.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"Run a pipeline with model evaluation to see metrics here"})]})})}function PTe({projectId:e}){const[t,r]=S.useState([]),[n,a]=S.useState(!0);S.useEffect(()=>{e&&(async()=>{try{const c=await(await Ne(`/api/experiments?project=${e}`)).json();c.experiments&&Array.isArray(c.experiments)?r(c.experiments):r([])}catch(l){console.error("Failed to fetch experiments:",l)}finally{a(!1)}})()},[e]);const i=[{key:"name",label:"Name",sortable:!0,render:s=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Xn,{className:"w-4 h-4 text-purple-500"}),o.jsxs("div",{children:[o.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:s.name}),s.description&&o.jsx("div",{className:"text-xs text-slate-500 truncate max-w-[200px]",children:s.description})]})]})},{key:"run_count",label:"Runs",sortable:!0,render:s=>o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(fn,{className:"w-3 h-3 text-slate-400"}),o.jsx("span",{children:s.run_count||0})]})},{key:"created_at",label:"Created",sortable:!0,render:s=>o.jsxs("div",{className:"flex items-center gap-1 text-slate-500",children:[o.jsx(ht,{className:"w-3 h-3"}),o.jsx("span",{children:Di(s.created_at)})]})},{key:"tags",label:"Tags",render:s=>o.jsx("div",{className:"flex flex-wrap gap-1",children:Object.entries(s.tags||{}).map(([l,c])=>o.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",children:[o.jsx(Tf,{className:"w-3 h-3 mr-1"}),l,": ",c]},l))})}];return o.jsx(Uh,{items:t,loading:n,columns:i,initialView:"table",searchKeys:["name","description"],renderGrid:s=>o.jsxs("div",{className:"p-4 bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700 hover:shadow-md transition-shadow",children:[o.jsxs("div",{className:"flex items-start justify-between mb-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"p-2 bg-purple-50 dark:bg-purple-900/20 rounded-lg",children:o.jsx(Xn,{className:"w-5 h-5 text-purple-500"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-medium text-slate-900 dark:text-white",children:s.name}),o.jsxs("div",{className:"text-xs text-slate-500 flex items-center gap-1",children:[o.jsx(ht,{className:"w-3 h-3"}),Di(s.created_at)]})]})]}),o.jsxs("div",{className:"flex items-center gap-1 text-xs font-medium bg-slate-100 dark:bg-slate-800 px-2 py-1 rounded-full",children:[o.jsx(fn,{className:"w-3 h-3"}),s.run_count||0," runs"]})]}),s.description&&o.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 mb-3 line-clamp-2",children:s.description}),o.jsx("div",{className:"flex flex-wrap gap-1",children:Object.entries(s.tags||{}).map(([l,c])=>o.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",children:[l,": ",c]},l))})]}),emptyState:o.jsxs("div",{className:"text-center py-12",children:[o.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-slate-100 dark:bg-slate-800 mb-4",children:o.jsx(Xn,{className:"w-6 h-6 text-slate-400"})}),o.jsx("h3",{className:"text-lg font-medium text-slate-900 dark:text-white mb-1",children:"No experiments found"}),o.jsx("p",{className:"text-slate-500",children:"Create an experiment to track your model development."})]})})}const uz=({status:e})=>{switch(e==null?void 0:e.toLowerCase()){case"completed":case"success":return o.jsx(rr,{className:"w-4 h-4 text-green-500"});case"failed":return o.jsx(kr,{className:"w-4 h-4 text-red-500"});case"running":return o.jsx(Sn,{className:"w-4 h-4 text-blue-500 animate-spin"});default:return o.jsx(dn,{className:"w-4 h-4 text-slate-400"})}};function dz({projectId:e}){const[t,r]=S.useState([]),[n,a]=S.useState(!0);S.useEffect(()=>{e&&(async()=>{try{const c=await(await Ne(`/api/runs?project=${e}`)).json();r(Array.isArray(c==null?void 0:c.runs)?c.runs:[])}catch(l){console.error("Failed to fetch runs:",l)}finally{a(!1)}})()},[e]);const i=[{header:"Run Name",key:"name",render:s=>{var l;return o.jsxs(ft,{to:`/runs/${s.run_id}`,className:"flex items-center gap-3 group",children:[o.jsx("div",{className:"p-2 bg-slate-100 dark:bg-slate-700 rounded-lg group-hover:bg-slate-200 dark:group-hover:bg-slate-600 transition-colors",children:o.jsx(ht,{className:"w-4 h-4 text-slate-500"})}),o.jsxs("div",{children:[o.jsx("div",{className:"font-medium text-slate-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:s.name||((l=s.run_id)==null?void 0:l.substring(0,8))||"N/A"}),o.jsx("div",{className:"text-xs text-slate-500",children:s.pipeline_name})]})]})}},{header:"Status",key:"status",render:s=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(uz,{status:s.status}),o.jsx("span",{className:"capitalize text-sm",children:s.status})]})},{header:"Created",key:"created",render:s=>o.jsx("span",{className:"text-slate-500 text-sm",children:Di(s.created,"MMM d, yyyy HH:mm")})}];return o.jsx(Uh,{items:t,loading:n,columns:i,initialView:"table",renderGrid:s=>{var l,c;return o.jsx(ft,{to:`/runs/${s.run_id}`,className:"block",children:o.jsxs("div",{className:"group p-5 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 hover:border-blue-500/50 hover:shadow-md transition-all duration-300",children:[o.jsxs("div",{className:"flex items-start justify-between mb-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(uz,{status:s.status}),o.jsx("span",{className:`text-sm font-medium capitalize ${s.status==="completed"?"text-green-600 dark:text-green-400":s.status==="failed"?"text-red-600 dark:text-red-400":"text-slate-600 dark:text-slate-400"}`,children:s.status})]}),o.jsx("span",{className:"text-xs font-mono text-slate-400 bg-slate-50 dark:bg-slate-900 px-2 py-1 rounded",children:((l=s.run_id)==null?void 0:l.substring(0,8))||"N/A"})]}),o.jsx("h3",{className:"font-semibold text-slate-900 dark:text-white mb-1 truncate group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:s.name||`Run ${((c=s.run_id)==null?void 0:c.substring(0,8))||"N/A"}`}),o.jsxs("p",{className:"text-sm text-slate-500 dark:text-slate-400 mb-4 flex items-center gap-1",children:[o.jsx("span",{className:"opacity-75",children:"Pipeline:"}),o.jsx("span",{className:"font-medium text-slate-700 dark:text-slate-300",children:s.pipeline_name})]}),o.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 dark:text-slate-400 pt-3 border-t border-slate-100 dark:border-slate-700/50",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(ht,{className:"w-3.5 h-3.5"}),o.jsx("span",{children:Di(s.created,"MMM d, HH:mm")})]}),s.duration&&o.jsxs("span",{children:[s.duration.toFixed(2),"s"]})]})]})})},emptyState:o.jsxs("div",{className:"text-center py-8",children:[o.jsx(ht,{className:"w-10 h-10 mx-auto text-slate-300 mb-2"}),o.jsx("p",{className:"text-slate-500",children:"No runs found for this project"})]})})}function fz({projectId:e}){const[t,r]=S.useState([]),[n,a]=S.useState(!0);S.useEffect(()=>{e&&(async()=>{try{const c=await(await Ne(`/api/pipelines?project=${e}`)).json();r(Array.isArray(c==null?void 0:c.pipelines)?c.pipelines:[])}catch(l){console.error("Failed to fetch pipelines:",l)}finally{a(!1)}})()},[e]);const i=[{header:"Pipeline Name",key:"name",render:s=>o.jsxs(ft,{to:`/pipelines/${s.id||s.name}`,className:"flex items-center gap-3 group",children:[o.jsx("div",{className:"p-2 bg-blue-500/10 rounded-lg group-hover:bg-blue-500/20 transition-colors",children:o.jsx(Fe,{className:"w-4 h-4 text-blue-500"})}),o.jsx("span",{className:"font-medium text-slate-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:s.name})]})},{header:"Version",key:"version",render:s=>o.jsxs("span",{className:"px-2 py-1 bg-slate-100 dark:bg-slate-700 rounded text-xs font-medium",children:["v",s.version||"1.0"]})},{header:"Created",key:"created",render:s=>o.jsx("span",{className:"text-slate-500 text-sm",children:Di(s.created)})}];return o.jsx(Uh,{items:t,loading:n,columns:i,initialView:"table",renderGrid:s=>o.jsx(ft,{to:`/pipelines/${s.id||s.name}`,className:"block",children:o.jsxs("div",{className:"group p-5 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 hover:border-blue-500/50 hover:shadow-md transition-all duration-300",children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsx("div",{className:"p-2.5 bg-blue-50 dark:bg-blue-900/20 rounded-lg group-hover:bg-blue-100 dark:group-hover:bg-blue-900/40 transition-colors",children:o.jsx(Fe,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),o.jsxs("span",{className:"px-2.5 py-1 bg-slate-100 dark:bg-slate-700 rounded-full text-xs font-medium text-slate-600 dark:text-slate-300",children:["v",s.version||"1.0"]})]}),o.jsx("h3",{className:"font-semibold text-lg text-slate-900 dark:text-white mb-1 truncate",title:s.name,children:s.name}),o.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-slate-400 mt-4 pt-4 border-t border-slate-100 dark:border-slate-700/50",children:[o.jsx(ht,{className:"w-4 h-4"}),o.jsxs("span",{children:["Created ",Di(s.created)]})]})]})}),emptyState:o.jsxs("div",{className:"text-center py-8",children:[o.jsx(Fe,{className:"w-10 h-10 mx-auto text-slate-300 mb-2"}),o.jsx("p",{className:"text-slate-500",children:"No pipelines found for this project"})]})})}function CTe(){const{projectId:e}=xE(),[t,r]=S.useState(null),[n,a]=S.useState(null),[i,s]=S.useState(!0),[l,c]=S.useState("overview"),[u,d]=S.useState(null);S.useEffect(()=>{e&&(async()=>{try{const g=await(await Ne(`/api/projects/${e}`)).json();g.pipelines&&!Array.isArray(g.pipelines)&&(g.pipelines=[]),r(g);const[y,x,v]=await Promise.all([Ne(`/api/runs?project=${e}&limit=1000`),Ne(`/api/assets?project=${e}&limit=1000`),Ne(`/api/experiments?project=${e}`)]),b=await y.json(),j=await x.json(),w=await v.json(),k=Array.isArray(b==null?void 0:b.runs)?b.runs:[],N=Array.isArray(j==null?void 0:j.assets)?j.assets:[],_=Array.isArray(w==null?void 0:w.experiments)?w.experiments:[],P=new Set(k.map(A=>A.pipeline_name).filter(Boolean)),C=N.filter(A=>A.type==="Model");a({runs:k.length,pipelines:P.size,artifacts:N.length,models:C.length,experiments:_.length,total_storage_bytes:N.reduce((A,O)=>A+(O.size_bytes||0),0)})}catch(m){console.error("Failed to fetch project details:",m)}finally{s(!1)}})()},[e]);const f=p=>{d(p)},h=()=>{if(u)return o.jsx(bW,{asset:u,onClose:()=>d(null)});switch(l){case"overview":return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[o.jsx(dm,{icon:Fe,label:"Total Runs",value:(n==null?void 0:n.runs)||0,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-900/20"}),o.jsx(dm,{icon:Ur,label:"Models",value:(n==null?void 0:n.models)||0,color:"text-purple-500",bg:"bg-purple-50 dark:bg-purple-900/20"}),o.jsx(dm,{icon:Xn,label:"Experiments",value:(n==null?void 0:n.experiments)||0,color:"text-pink-500",bg:"bg-pink-50 dark:bg-pink-900/20"}),o.jsx(dm,{icon:X8,label:"Storage",value:ATe((n==null?void 0:n.total_storage_bytes)||0),color:"text-slate-500",bg:"bg-slate-50 dark:bg-slate-800"})]}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[o.jsxs(Te,{className:"p-0 overflow-hidden border-slate-200 dark:border-slate-800",children:[o.jsxs("div",{className:"p-4 border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50 flex items-center justify-between",children:[o.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(Fc,{size:16,className:"text-slate-400"}),"Recent Pipelines"]}),o.jsx("button",{onClick:()=>c("pipelines"),className:"text-xs text-primary-600 hover:text-primary-700 font-medium",children:"View All"})]}),o.jsx("div",{className:"p-4",children:o.jsx(fz,{projectId:e,limit:5,compact:!0})})]}),o.jsxs(Te,{className:"p-0 overflow-hidden border-slate-200 dark:border-slate-800",children:[o.jsxs("div",{className:"p-4 border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50 flex items-center justify-between",children:[o.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(fn,{size:16,className:"text-slate-400"}),"Recent Runs"]}),o.jsx("button",{onClick:()=>c("runs"),className:"text-xs text-primary-600 hover:text-primary-700 font-medium",children:"View All"})]}),o.jsx("div",{className:"p-4",children:o.jsx(dz,{projectId:e,limit:5,compact:!0})})]})]}),o.jsxs(Te,{className:"p-0 overflow-hidden border-slate-200 dark:border-slate-800",children:[o.jsx("div",{className:"p-4 border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-800/50",children:o.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(Pn,{size:16,className:"text-slate-400"}),"Production Metrics"]})}),o.jsx("div",{className:"p-4",children:o.jsx(cz,{projectId:e})})]})]});case"pipelines":return o.jsx(fz,{projectId:e});case"runs":return o.jsx(dz,{projectId:e});case"experiments":return o.jsx(PTe,{projectId:e});case"metrics":return o.jsx(cz,{projectId:e});default:return null}};return o.jsxs("div",{className:"h-screen flex flex-col overflow-hidden bg-slate-50 dark:bg-slate-900",children:[o.jsx("div",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4 shrink-0",children:o.jsx(kTe,{project:t,stats:n,loading:i})}),o.jsx("div",{className:"flex-1 overflow-hidden",children:o.jsx("div",{className:"h-full max-w-[1800px] mx-auto px-6 py-6",children:o.jsxs("div",{className:"h-full flex gap-6",children:[o.jsxs("div",{className:"w-[380px] shrink-0 flex flex-col gap-4 overflow-y-auto pb-6",children:[o.jsxs("nav",{className:"space-y-1",children:[o.jsx(wd,{active:l==="overview"&&!u,onClick:()=>{c("overview"),d(null)},icon:Q8,label:"Overview"}),o.jsx(wd,{active:l==="pipelines"&&!u,onClick:()=>{c("pipelines"),d(null)},icon:Fc,label:"Pipelines"}),o.jsx(wd,{active:l==="runs"&&!u,onClick:()=>{c("runs"),d(null)},icon:fn,label:"Runs"}),o.jsx(wd,{active:l==="experiments"&&!u,onClick:()=>{c("experiments"),d(null)},icon:Xn,label:"Experiments"}),o.jsx(wd,{active:l==="metrics"&&!u,onClick:()=>{c("metrics"),d(null)},icon:Pn,label:"Metrics"})]}),o.jsxs("div",{className:"flex-1 min-h-0 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden flex flex-col shadow-sm",children:[o.jsx("div",{className:"p-3 border-b border-slate-100 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50",children:o.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Project Assets"})}),o.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:o.jsx(jTe,{projectId:e,onAssetSelect:f,compact:!0})})]})]}),o.jsx("div",{className:"flex-1 min-w-0 bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 overflow-hidden flex flex-col shadow-sm",children:o.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:o.jsx(X7,{children:o.jsx(Zt,{mode:"wait",children:o.jsx(ge.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"h-full",children:h()},u?"asset":l)})})})})]})})})]})}function wd({active:e,onClick:t,icon:r,label:n}){return o.jsxs("button",{onClick:t,className:`w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-all duration-200 ${e?"bg-primary-50 text-primary-700 dark:bg-primary-900/20 dark:text-primary-400 shadow-sm":"text-slate-600 dark:text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white"}`,children:[o.jsx(r,{size:18,className:e?"text-primary-600 dark:text-primary-400":"text-slate-400"}),n]})}function dm({icon:e,label:t,value:r,color:n,bg:a}){return o.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl p-4 border border-slate-200 dark:border-slate-700 shadow-sm flex items-center gap-4",children:[o.jsx("div",{className:`p-3 rounded-lg ${a}`,children:o.jsx(e,{size:20,className:n})}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:t}),o.jsx("p",{className:"text-xl font-bold text-slate-900 dark:text-white",children:typeof r=="number"?r.toLocaleString():r})]})]})}function ATe(e){if(!e||e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(1))+" "+r[n]}function OTe(){const{selectedProject:e}=Ui(),[t,r]=S.useState([]),[n,a]=S.useState({registered:[],templates:[],metadata:[]}),[i,s]=S.useState(null),[l,c]=S.useState(!0),[u,d]=S.useState(!1),[f,h]=S.useState(!1),[p,m]=S.useState(null),[g,y]=S.useState([]),[x,v]=S.useState(!1),[b,j]=S.useState({name:"",pipeline_name:"",schedule_type:"daily",hour:0,minute:0,interval_seconds:3600,cron_expression:"* * * * *",timezone:"UTC",project_name:e||null});S.useEffect(()=>{w();const T=setInterval(w,1e4);return()=>clearInterval(T)},[e]);const w=async()=>{try{const T=e?`?project=${e}`:"",[E,R,D]=await Promise.all([fetch(`/api/schedules/${T}`),fetch(`/api/schedules/registered-pipelines${T}`),fetch("/api/schedules/health")]),z=await E.json(),I=await R.json();let $=null;D.ok&&($=await D.json()),r(z),a(I),s($)}catch(T){console.error("Failed to fetch data:",T)}finally{c(!1)}},k=async T=>{v(!0);try{const R=await(await fetch(`/api/schedules/${T}/history`)).json();y(R)}catch(E){console.error("Failed to fetch history:",E)}finally{v(!1)}},N=T=>{m(T),h(!0),k(T.pipeline_name)},_=async T=>{T.preventDefault();try{const E=await fetch("/api/schedules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...b,project_name:e||null})});if(E.ok)d(!1),j({name:"",pipeline_name:"",schedule_type:"daily",hour:0,minute:0,interval_seconds:3600,cron_expression:"* * * * *",timezone:"UTC"}),w();else{const R=await E.json();alert(`Failed to create schedule: ${R.detail}`)}}catch(E){console.error("Failed to create schedule:",E)}},P=async(T,E)=>{try{await fetch(`/api/schedules/${T}/${E?"disable":"enable"}`,{method:"POST"}),w()}catch(R){console.error("Failed to toggle schedule:",R)}},C=async T=>{if(confirm(`Delete schedule "${T}"?`))try{await fetch(`/api/schedules/${T}`,{method:"DELETE"}),w()}catch(E){console.error("Failed to delete schedule:",E)}},A=[{header:"Pipeline",key:"pipeline_name",sortable:!0,render:T=>o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:`p-2 rounded-lg ${T.enabled?"bg-emerald-50 text-emerald-600":"bg-slate-100 text-slate-400"}`,children:o.jsx(ht,{size:16})}),o.jsxs("div",{children:[o.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:T.pipeline_name}),o.jsxs("div",{className:"text-xs text-slate-500 flex items-center gap-1",children:[o.jsx(el,{size:10})," ",T.timezone]})]})]})},{header:"Type",key:"schedule_type",sortable:!0,render:T=>o.jsxs("div",{className:"flex flex-col",children:[o.jsx(qe,{variant:"secondary",className:"capitalize w-fit mb-1",children:T.schedule_type}),o.jsx("span",{className:"text-xs font-mono text-slate-500",children:T.schedule_value})]})},{header:"Next Run",key:"next_run",sortable:!0,render:T=>o.jsxs("div",{className:"flex items-center gap-2 text-slate-500",children:[o.jsx(_a,{size:14}),T.next_run?Ft(new Date(T.next_run),"MMM d, HH:mm:ss"):"N/A"]})},{header:"Status",key:"enabled",sortable:!0,render:T=>o.jsxs("div",{className:`flex items-center gap-2 text-sm ${T.enabled?"text-emerald-600":"text-slate-400"}`,children:[T.enabled?o.jsx(rr,{size:14}):o.jsx(kr,{size:14}),o.jsx("span",{className:"font-medium",children:T.enabled?"Active":"Paused"})]})},{header:"Actions",key:"actions",render:T=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{onClick:()=>N(T),className:"p-1.5 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 transition-colors",title:"History",children:o.jsx(Xd,{size:16})}),o.jsx("button",{onClick:()=>P(T.pipeline_name,T.enabled),className:`p-1.5 rounded-lg transition-colors ${T.enabled?"bg-amber-50 text-amber-600 hover:bg-amber-100":"bg-emerald-50 text-emerald-600 hover:bg-emerald-100"}`,title:T.enabled?"Pause":"Resume",children:T.enabled?o.jsx(_O,{size:16}):o.jsx(x0,{size:16})}),o.jsx("button",{onClick:()=>C(T.pipeline_name),className:"p-1.5 rounded-lg bg-rose-50 text-rose-600 hover:bg-rose-100 transition-colors",title:"Delete",children:o.jsx(Oi,{size:16})})]})}],O=T=>o.jsxs(Te,{className:"group hover:shadow-lg transition-all duration-200 border-l-4 border-l-transparent hover:border-l-primary-500 h-full",children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:`p-3 rounded-xl ${T.enabled?"bg-emerald-50 text-emerald-600":"bg-slate-100 text-slate-400"}`,children:o.jsx(ht,{size:24})}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-bold text-slate-900 dark:text-white truncate max-w-[150px]",title:T.pipeline_name,children:T.pipeline_name}),o.jsxs("div",{className:`text-xs font-medium flex items-center gap-1 ${T.enabled?"text-emerald-600":"text-slate-400"}`,children:[T.enabled?o.jsx(rr,{size:12}):o.jsx(kr,{size:12}),T.enabled?"Active":"Paused"]})]})]}),o.jsx(qe,{variant:"secondary",className:"capitalize",children:T.schedule_type})]}),o.jsxs("div",{className:"space-y-3 mb-4",children:[o.jsxs("div",{className:"flex items-center justify-between text-sm",children:[o.jsxs("span",{className:"text-slate-500 flex items-center gap-2",children:[o.jsx(_a,{size:14})," Next Run"]}),o.jsx("span",{className:"font-mono text-slate-700 dark:text-slate-300",children:T.next_run?Ft(new Date(T.next_run),"MMM d, HH:mm"):"N/A"})]}),o.jsxs("div",{className:"flex items-center justify-between text-sm",children:[o.jsxs("span",{className:"text-slate-500 flex items-center gap-2",children:[o.jsx(el,{size:14})," Timezone"]}),o.jsx("span",{className:"text-slate-700 dark:text-slate-300",children:T.timezone})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-4 border-t border-slate-100 dark:border-slate-700",children:[o.jsx(fe,{variant:"ghost",className:"text-blue-600 hover:bg-blue-50 hover:text-blue-700",onClick:()=>N(T),title:"History",children:o.jsx(Xd,{size:16})}),o.jsx(fe,{variant:"outline",className:`flex-1 flex items-center justify-center gap-2 ${T.enabled?"text-amber-600 border-amber-200 hover:bg-amber-50":"text-emerald-600 border-emerald-200 hover:bg-emerald-50"}`,onClick:()=>P(T.pipeline_name,T.enabled),children:T.enabled?o.jsxs(o.Fragment,{children:[o.jsx(_O,{size:14})," Pause"]}):o.jsxs(o.Fragment,{children:[o.jsx(x0,{size:14})," Resume"]})}),o.jsx(fe,{variant:"ghost",className:"text-rose-600 hover:bg-rose-50 hover:text-rose-700",onClick:()=>C(T.pipeline_name),children:o.jsx(Oi,{size:16})})]})]});return o.jsxs("div",{className:"p-6 max-w-7xl mx-auto",children:[i&&i.metrics&&o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 mb-8",children:[o.jsxs(Te,{className:"p-4 flex items-center gap-4",children:[o.jsx("div",{className:`p-3 rounded-full ${i.status==="running"?"bg-emerald-100 text-emerald-600":"bg-rose-100 text-rose-600"}`,children:o.jsx(Fe,{size:24})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-slate-500",children:"Scheduler Status"}),o.jsx("div",{className:"text-lg font-bold capitalize",children:i.status})]})]}),o.jsxs(Te,{className:"p-4",children:[o.jsx("div",{className:"text-sm text-slate-500 mb-1",children:"Total Runs"}),o.jsx("div",{className:"text-2xl font-bold",children:i.metrics.total_runs})]}),o.jsxs(Te,{className:"p-4",children:[o.jsx("div",{className:"text-sm text-slate-500 mb-1",children:"Success Rate"}),o.jsxs("div",{className:"text-2xl font-bold text-emerald-600",children:[(i.metrics.success_rate*100).toFixed(1),"%"]})]}),o.jsxs(Te,{className:"p-4",children:[o.jsx("div",{className:"text-sm text-slate-500 mb-1",children:"Active Schedules"}),o.jsxs("div",{className:"text-2xl font-bold",children:[i.enabled_schedules," / ",i.num_schedules]})]})]}),o.jsx(Uh,{title:"Schedules",subtitle:"Manage automated pipeline executions",items:t,loading:l,columns:A,renderGrid:O,actions:o.jsxs(fe,{onClick:()=>d(!0),className:"flex items-center gap-2",children:[o.jsx(rl,{size:18}),"New Schedule"]}),emptyState:o.jsx(qC,{icon:_a,title:"No active schedules",description:"Automate your pipelines by creating a schedule.",action:o.jsx(fe,{onClick:()=>d(!0),children:"Create your first schedule"})})}),u&&o.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:o.jsxs("div",{className:"bg-white dark:bg-slate-800 p-6 rounded-2xl w-full max-w-md border border-slate-200 dark:border-slate-700 shadow-2xl animate-in fade-in zoom-in duration-200 max-h-[90vh] overflow-y-auto",children:[o.jsx("h2",{className:"text-xl font-bold mb-4 text-slate-900 dark:text-white",children:"Create Schedule"}),o.jsxs("form",{onSubmit:_,children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Schedule Name"}),o.jsx("input",{type:"text",value:b.name,onChange:T=>j({...b,name:T.target.value}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all",required:!0,placeholder:"e.g., daily_etl_job"})]}),o.jsxs("div",{className:"mb-4",children:[o.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Pipeline"}),o.jsxs("select",{value:b.pipeline_name,onChange:T=>j({...b,pipeline_name:T.target.value}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all",required:!0,children:[o.jsx("option",{value:"",children:"Select a pipeline..."}),n.registered.length>0&&o.jsx("optgroup",{label:`Registered Pipelines (${n.registered.length})`,children:n.registered.map(T=>o.jsx("option",{value:T,children:T},T))}),n.templates.length>0&&o.jsx("optgroup",{label:`Templates (${n.templates.length})`,children:n.templates.map(T=>o.jsx("option",{value:T,children:T},T))}),n.metadata.length>0&&o.jsx("optgroup",{label:`Historical Pipelines (${n.metadata.length})`,children:n.metadata.map(T=>o.jsx("option",{value:T,children:T},`meta-${T}`))})]}),n.registered.length===0&&n.templates.length===0&&n.metadata.length===0&&o.jsx("p",{className:"text-xs text-amber-600 mt-1",children:"No pipelines available. Run a pipeline first or register one using @register_pipeline."})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Type"}),o.jsxs("select",{value:b.schedule_type,onChange:T=>j({...b,schedule_type:T.target.value}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all",children:[o.jsx("option",{value:"daily",children:"Daily"}),o.jsx("option",{value:"hourly",children:"Hourly"}),o.jsx("option",{value:"interval",children:"Interval"}),o.jsx("option",{value:"cron",children:"Cron"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Timezone"}),o.jsxs("select",{value:b.timezone,onChange:T=>j({...b,timezone:T.target.value}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all",children:[o.jsx("option",{value:"UTC",children:"UTC"}),o.jsx("option",{value:"America/New_York",children:"New York (EST/EDT)"}),o.jsx("option",{value:"America/Los_Angeles",children:"Los Angeles (PST/PDT)"}),o.jsx("option",{value:"Europe/London",children:"London (GMT/BST)"}),o.jsx("option",{value:"Europe/Paris",children:"Paris (CET/CEST)"}),o.jsx("option",{value:"Asia/Tokyo",children:"Tokyo (JST)"}),o.jsx("option",{value:"Asia/Shanghai",children:"Shanghai (CST)"})]})]})]}),b.schedule_type==="daily"&&o.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Hour (0-23)"}),o.jsx("input",{type:"number",min:"0",max:"23",value:b.hour,onChange:T=>j({...b,hour:parseInt(T.target.value)}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Minute (0-59)"}),o.jsx("input",{type:"number",min:"0",max:"59",value:b.minute,onChange:T=>j({...b,minute:parseInt(T.target.value)}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all"})]})]}),b.schedule_type==="hourly"&&o.jsxs("div",{className:"mb-4",children:[o.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Minute (0-59)"}),o.jsx("input",{type:"number",min:"0",max:"59",value:b.minute,onChange:T=>j({...b,minute:parseInt(T.target.value)}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all"})]}),b.schedule_type==="interval"&&o.jsxs("div",{className:"mb-4",children:[o.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Interval (seconds)"}),o.jsx("input",{type:"number",min:"1",value:b.interval_seconds,onChange:T=>j({...b,interval_seconds:parseInt(T.target.value)}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all"})]}),b.schedule_type==="cron"&&o.jsxs("div",{className:"mb-4",children:[o.jsx("label",{className:"block text-sm font-medium mb-1 text-slate-700 dark:text-slate-300",children:"Cron Expression"}),o.jsx("input",{type:"text",value:b.cron_expression,onChange:T=>j({...b,cron_expression:T.target.value}),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700 focus:ring-2 focus:ring-primary-500 outline-none transition-all font-mono",placeholder:"* * * * *"}),o.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Format: minute hour day month day-of-week"})]}),o.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[o.jsx(fe,{variant:"ghost",type:"button",onClick:()=>d(!1),children:"Cancel"}),o.jsx(fe,{type:"submit",variant:"primary",children:"Create Schedule"})]})]})]})}),f&&p&&o.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:o.jsxs("div",{className:"bg-white dark:bg-slate-800 p-6 rounded-2xl w-full max-w-2xl border border-slate-200 dark:border-slate-700 shadow-2xl animate-in fade-in zoom-in duration-200 max-h-[90vh] overflow-y-auto",children:[o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsxs("div",{children:[o.jsxs("h2",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(Xd,{size:20}),"Execution History"]}),o.jsx("p",{className:"text-slate-500 text-sm",children:p.pipeline_name})]}),o.jsx(fe,{variant:"ghost",onClick:()=>h(!1),children:o.jsx(kr,{size:20})})]}),x?o.jsx("div",{className:"flex justify-center py-8",children:o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-500"})}):g.length>0?o.jsx("div",{className:"space-y-4",children:g.map((T,E)=>o.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 dark:bg-slate-900 rounded-xl border border-slate-100 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:`p-2 rounded-full ${T.success?"bg-emerald-100 text-emerald-600":"bg-rose-100 text-rose-600"}`,children:T.success?o.jsx(rr,{size:16}):o.jsx(dn,{size:16})}),o.jsxs("div",{children:[o.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:Ft(new Date(T.started_at),"MMM d, yyyy HH:mm:ss")}),o.jsxs("div",{className:"text-xs text-slate-500",children:["Duration: ",T.duration_seconds?`${T.duration_seconds.toFixed(2)}s`:"N/A"]})]})]}),!T.success&&o.jsx("div",{className:"text-sm text-rose-600 max-w-xs truncate",title:T.error,children:T.error})]},E))}):o.jsx("div",{className:"text-center py-8 text-slate-500",children:"No execution history found."})]})})]})}function TTe(){const[e,t]=S.useState(null),[r,n]=S.useState(null),[a,i]=S.useState(!0);if(S.useEffect(()=>{const c=async()=>{try{const[d,f]=await Promise.all([Ne("/api/metrics/observability/orchestrator"),Ne("/api/metrics/observability/cache")]),h=await d.json(),p=await f.json();t(h),n(p)}catch(d){console.error("Failed to fetch metrics:",d)}finally{i(!1)}};c();const u=setInterval(c,3e4);return()=>clearInterval(u)},[]),a)return o.jsx("div",{className:"flex items-center justify-center h-96",children:o.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})});const s=(e==null?void 0:e.success_rate)||0,l=(r==null?void 0:r.cache_hit_rate)||0;return o.jsxs("div",{className:"p-6 space-y-6 max-w-7xl mx-auto",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-3xl font-bold text-slate-900 dark:text-white flex items-center gap-3",children:[o.jsx(Fe,{className:"text-primary-500",size:32}),"Observability Dashboard"]}),o.jsx("p",{className:"text-slate-500 mt-1",children:"System performance and metrics (Last 30 days)"})]}),o.jsx(qe,{variant:"secondary",className:"text-xs",children:"Auto-refresh: 30s"})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[o.jsx(fm,{icon:o.jsx(Pn,{size:24}),label:"Total Runs",value:(e==null?void 0:e.total_runs)||0,color:"blue"}),o.jsx(fm,{icon:o.jsx(rr,{size:24}),label:"Success Rate",value:`${(s*100).toFixed(1)}%`,color:"emerald",trend:s>=.9?"positive":s>=.7?"neutral":"negative"}),o.jsx(fm,{icon:o.jsx(ht,{size:24}),label:"Avg Duration",value:`${((e==null?void 0:e.avg_duration_seconds)||0).toFixed(2)}s`,color:"purple"}),o.jsx(fm,{icon:o.jsx(hn,{size:24}),label:"Cache Hit Rate",value:`${(l*100).toFixed(1)}%`,color:"amber",trend:l>=.5?"positive":l>=.2?"neutral":"negative"})]}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[o.jsxs(Te,{className:"p-6",children:[o.jsxs("h3",{className:"text-lg font-bold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[o.jsx(Hr,{className:"text-primary-500",size:20}),"Orchestrator Performance"]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 mb-3",children:"Status Distribution"}),o.jsx("div",{className:"space-y-2",children:(e==null?void 0:e.status_distribution)&&Object.entries(e.status_distribution).map(([c,u])=>o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:`w-3 h-3 rounded-full ${c==="completed"?"bg-emerald-500":c==="failed"?"bg-rose-500":"bg-amber-500"}`}),o.jsx("span",{className:"text-sm text-slate-600 dark:text-slate-400 capitalize",children:c})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-sm font-mono font-semibold text-slate-900 dark:text-white",children:u}),o.jsx("div",{className:"w-24 bg-slate-200 dark:bg-slate-700 rounded-full h-2",children:o.jsx("div",{className:`h-2 rounded-full ${c==="completed"?"bg-emerald-500":c==="failed"?"bg-rose-500":"bg-amber-500"}`,style:{width:`${u/e.total_runs*100}%`}})})]})]},c))})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3 pt-4 border-t border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"p-3 bg-emerald-50 dark:bg-emerald-900/20 rounded-lg",children:[o.jsx("div",{className:"text-xs text-emerald-600 dark:text-emerald-400 mb-1",children:"Success Rate"}),o.jsxs("div",{className:"text-2xl font-bold text-emerald-700 dark:text-emerald-300",children:[(s*100).toFixed(1),"%"]})]}),o.jsxs("div",{className:"p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg",children:[o.jsx("div",{className:"text-xs text-blue-600 dark:text-blue-400 mb-1",children:"Avg Duration"}),o.jsxs("div",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:[((e==null?void 0:e.avg_duration_seconds)||0).toFixed(1),"s"]})]})]})]})]}),o.jsxs(Te,{className:"p-6",children:[o.jsxs("h3",{className:"text-lg font-bold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[o.jsx(hn,{className:"text-amber-500",size:20}),"Cache Performance"]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-4 bg-gradient-to-br from-amber-50 to-orange-50 dark:from-amber-900/20 dark:to-orange-900/20 rounded-xl border border-amber-100 dark:border-amber-800",children:[o.jsx("div",{className:"text-xs text-amber-600 dark:text-amber-400 mb-1",children:"Total Steps"}),o.jsx("div",{className:"text-3xl font-bold text-amber-700 dark:text-amber-300",children:(r==null?void 0:r.total_steps)||0})]}),o.jsxs("div",{className:"p-4 bg-gradient-to-br from-emerald-50 to-teal-50 dark:from-emerald-900/20 dark:to-teal-900/20 rounded-xl border border-emerald-100 dark:border-emerald-800",children:[o.jsx("div",{className:"text-xs text-emerald-600 dark:text-emerald-400 mb-1",children:"Cached Steps"}),o.jsx("div",{className:"text-3xl font-bold text-emerald-700 dark:text-emerald-300",children:(r==null?void 0:r.cached_steps)||0})]})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("span",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300",children:"Cache Hit Rate"}),o.jsxs("span",{className:"text-lg font-bold text-slate-900 dark:text-white",children:[(l*100).toFixed(1),"%"]})]}),o.jsx("div",{className:"relative h-8 bg-slate-200 dark:bg-slate-700 rounded-full overflow-hidden",children:o.jsx("div",{className:"absolute inset-y-0 left-0 bg-gradient-to-r from-emerald-500 to-teal-500 flex items-center justify-end px-3 transition-all duration-500",style:{width:`${l*100}%`},children:l>.1&&o.jsxs("span",{className:"text-xs font-bold text-white",children:[(l*100).toFixed(0),"%"]})})})]}),o.jsxs("div",{className:"p-4 bg-blue-50 dark:bg-blue-900/20 rounded-xl border border-blue-100 dark:border-blue-800",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx(Hr,{size:16,className:"text-blue-600"}),o.jsx("span",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100",children:"Performance Impact"})]}),o.jsxs("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:["Cache saved approximately"," ",o.jsx("strong",{children:(r==null?void 0:r.cached_steps)||0})," step executions, improving pipeline efficiency."]})]})]})]})]})]})}function fm({icon:e,label:t,value:r,color:n,trend:a}){const i={blue:"bg-blue-50 text-blue-600 dark:bg-blue-900/20 dark:text-blue-400",emerald:"bg-emerald-50 text-emerald-600 dark:bg-emerald-900/20 dark:text-emerald-400",purple:"bg-purple-50 text-purple-600 dark:bg-purple-900/20 dark:text-purple-400",amber:"bg-amber-50 text-amber-600 dark:bg-amber-900/20 dark:text-amber-400"},s={positive:"text-emerald-600 dark:text-emerald-400",neutral:"text-amber-600 dark:text-amber-400",negative:"text-rose-600 dark:text-rose-400"};return o.jsx(Te,{className:"hover:shadow-lg transition-shadow duration-200",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:`p-3 rounded-xl ${i[n]}`,children:e}),o.jsxs("div",{className:"flex-1",children:[o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 font-medium",children:t}),o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("p",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:r}),a&&o.jsx(Hr,{size:16,className:`${s[a]} ${a==="negative"?"rotate-180":""}`})]})]})]})})}function MTe(){const[e,t]=S.useState("accuracy"),[r,n]=S.useState(null),[a,i]=S.useState(!0);S.useEffect(()=>{s()},[e]);const s=async()=>{i(!0);try{const c=await(await Ne(`/api/leaderboard/${e}`)).json();n(c)}catch(l){console.error("Failed to fetch leaderboard:",l)}finally{i(!1)}};return o.jsxs("div",{className:"p-6",children:[o.jsxs("div",{className:"flex justify-between items-center mb-6",children:[o.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2 text-slate-900 dark:text-white",children:[o.jsx(ql,{className:"text-yellow-500"}),"Model Leaderboard"]}),o.jsxs("div",{className:"flex items-center gap-2 bg-white dark:bg-slate-800 rounded-lg p-1 border border-slate-200 dark:border-slate-700",children:[o.jsx(Y8,{className:"w-4 h-4 ml-2 text-slate-400 dark:text-slate-500"}),o.jsxs("select",{value:e,onChange:l=>t(l.target.value),className:"bg-transparent border-none outline-none text-sm px-2 py-1 text-slate-700 dark:text-slate-200",children:[o.jsx("option",{value:"accuracy",children:"Accuracy"}),o.jsx("option",{value:"loss",children:"Loss"}),o.jsx("option",{value:"f1_score",children:"F1 Score"}),o.jsx("option",{value:"latency",children:"Latency"})]})]})]}),a?o.jsx("div",{className:"text-center py-12",children:o.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-yellow-500"})}):!r||r.models.length===0?o.jsx(qC,{icon:ql,title:`No models found for metric: ${e}`,description:"Generate sample data to populate the leaderboard.",action:o.jsxs(fe,{onClick:async()=>{i(!0);try{await Ne("/api/leaderboard/generate_sample_data",{method:"POST"}),s()}catch(l){console.error("Failed to generate sample data:",l),i(!1)}},className:"flex items-center gap-2",children:[o.jsx(vi,{size:16}),"Generate Sample Data"]})}):o.jsx("div",{className:"bg-white dark:bg-slate-800/50 rounded-lg border border-slate-200 dark:border-slate-700 overflow-hidden",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-slate-50 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700",children:[o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:"Rank"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:"Model"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:"Score"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:"Run ID"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:"Date"})]})}),o.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-700",children:r.models.map((l,c)=>{var u;return o.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors",children:[o.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:o.jsxs("div",{className:"flex items-center gap-2",children:[c===0&&o.jsx(ql,{className:"w-4 h-4 text-yellow-500"}),c===1&&o.jsx(ql,{className:"w-4 h-4 text-slate-400"}),c===2&&o.jsx(ql,{className:"w-4 h-4 text-amber-600"}),o.jsxs("span",{className:`font-bold ${c<3?"text-slate-900 dark:text-white":"text-slate-500 dark:text-slate-400"}`,children:["#",l.rank]})]})}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap font-medium text-slate-900 dark:text-white",children:l.model_name}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-lg font-bold text-blue-600 dark:text-blue-400",children:l.score.toFixed(4)}),r.higher_is_better?o.jsx(Hr,{className:"w-4 h-4 text-green-500"}):o.jsx(rx,{className:"w-4 h-4 text-green-500"})]})}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-slate-500 dark:text-slate-400 font-mono",children:((u=l.run_id)==null?void 0:u.substring(0,8))||"N/A"}),o.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-slate-500 dark:text-slate-400",children:l.timestamp?Ft(new Date(l.timestamp),"MMM d, HH:mm"):"-"})]},l.run_id)})})]})})]})}const jd="/api";class RTe{async getAvailablePlugins(){try{const t=await fetch(`${jd}/plugins/available`);if(!t.ok)throw new Error("Failed to fetch available plugins");return await t.json()}catch(t){return console.error("Error fetching available plugins:",t),[]}}async getInstalledPlugins(){try{const t=await fetch(`${jd}/plugins/installed`);if(!t.ok)throw new Error("Failed to fetch installed plugins");return await t.json()}catch(t){return console.error("Error fetching installed plugins:",t),[]}}async installPlugin(t){try{const r=await fetch(`${jd}/plugins/install`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:t})});if(!r.ok){const n=await r.json();throw new Error(n.detail||"Installation failed")}return await r.json()}catch(r){throw console.error("Error installing plugin:",r),r}}async uninstallPlugin(t){try{const r=await fetch(`${jd}/plugins/uninstall/${t}`,{method:"POST"});if(!r.ok){const n=await r.json();throw new Error(n.detail||"Uninstall failed")}return await r.json()}catch(r){throw console.error("Error uninstalling plugin:",r),r}}async importStack(t,r="zenml"){try{const n=await fetch(`${jd}/plugins/import-stack`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({stack_name:t})});if(!n.ok){const a=await n.json();throw new Error(a.detail||"Import failed")}return await n.json()}catch(n){throw console.error("Error importing stack:",n),n}}}const Oc=new RTe;function DTe({isOpen:e,onClose:t,onAdd:r}){const[n,a]=S.useState("package"),[i,s]=S.useState(""),[l,c]=S.useState(""),u=()=>{n==="package"&&i?(r({type:"package",value:i}),s(""),t()):n==="url"&&l&&(r({type:"url",value:l}),c(""),t())};return e?o.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:t,children:o.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl p-6 max-w-md w-full mx-4 shadow-2xl",onClick:d=>d.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("h3",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"Add Plugin"}),o.jsx("button",{onClick:t,className:"p-1 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-lg transition-colors",children:o.jsx(Tn,{size:20,className:"text-slate-500"})})]}),o.jsxs("div",{className:"flex gap-2 mb-4 bg-slate-100 dark:bg-slate-900 p-1 rounded-lg",children:[o.jsx("button",{onClick:()=>a("package"),className:`flex-1 px-4 py-2 rounded-md text-sm font-medium transition-all ${n==="package"?"bg-white dark:bg-slate-700 text-slate-900 dark:text-white shadow-sm":"text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-300"}`,children:o.jsxs("div",{className:"flex items-center justify-center gap-2",children:[o.jsx(Ea,{size:16}),"Package Name"]})}),o.jsx("button",{onClick:()=>a("url"),className:`flex-1 px-4 py-2 rounded-md text-sm font-medium transition-all ${n==="url"?"bg-white dark:bg-slate-700 text-slate-900 dark:text-white shadow-sm":"text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-300"}`,children:o.jsxs("div",{className:"flex items-center justify-center gap-2",children:[o.jsx(kZ,{size:16}),"URL/Git"]})})]}),o.jsx("div",{className:"mb-4",children:n==="package"?o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2",children:"Package Name"}),o.jsx("input",{type:"text",placeholder:"e.g., zenml-kubernetes",value:i,onChange:d=>s(d.target.value),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"}),o.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:"Install from PyPI by package name"})]}):o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2",children:"URL"}),o.jsx("input",{type:"text",placeholder:"e.g., git+https://github.com/...",value:l,onChange:d=>c(d.target.value),className:"w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"}),o.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:"Install from Git repository or URL"})]})}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(fe,{variant:"outline",onClick:t,className:"flex-1",children:"Cancel"}),o.jsx(fe,{onClick:u,disabled:n==="package"?!i:!l,className:"flex-1",children:"Install"})]})]})}):null}function $Te(){const[e,t]=S.useState(""),[r,n]=S.useState([]),[a,i]=S.useState(!0),[s,l]=S.useState(null),[c,u]=S.useState(!1);S.useEffect(()=>{d()},[]);const d=async()=>{try{i(!0);const m=await Oc.getAvailablePlugins();n(m)}catch(m){console.error("Failed to load plugins:",m)}finally{i(!1)}},f=r.filter(m=>m.name.toLowerCase().includes(e.toLowerCase())||m.description.toLowerCase().includes(e.toLowerCase())),h=async m=>{l(m);try{await Oc.installPlugin(m),n(g=>g.map(y=>y.id===m?{...y,installed:!0}:y))}catch(g){console.error("Install failed:",g),alert(`Installation failed: ${g.message}`)}finally{l(null)}},p=async({type:m,value:g})=>{l("manual");try{await Oc.installPlugin(g),await d(),alert(`Successfully installed ${g}`)}catch(y){console.error("Install failed:",y),alert(`Installation failed: ${y.message}`)}finally{l(null)}};return a?o.jsx("div",{className:"flex justify-center items-center py-12",children:o.jsx(Sn,{className:"animate-spin text-primary-500",size:32})}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex gap-4",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(Af,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:18}),o.jsx("input",{type:"text",placeholder:"Search plugins...",value:e,onChange:m=>t(m.target.value),className:"w-full pl-10 pr-4 py-2 bg-slate-50 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),o.jsxs(fe,{onClick:()=>u(!0),className:"flex items-center gap-2",children:[o.jsx(rl,{size:18}),"Add Plugin"]})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:f.map(m=>o.jsxs("div",{className:"p-4 border border-slate-200 dark:border-slate-700 rounded-xl hover:border-primary-500/50 dark:hover:border-primary-500/50 transition-colors bg-white dark:bg-slate-800/50",children:[o.jsxs("div",{className:"flex justify-between items-start mb-2",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"font-semibold text-slate-900 dark:text-white",children:m.name}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-500 dark:text-slate-400 mt-1",children:[o.jsxs("span",{children:["v",m.version]}),o.jsx("span",{children:"•"}),o.jsxs("span",{children:["by ",m.author]})]})]}),m.installed?o.jsxs(qe,{variant:"success",className:"flex items-center gap-1",children:[o.jsx(rr,{size:12})," Installed"]}):o.jsx(fe,{size:"sm",variant:"outline",onClick:()=>h(m.id),disabled:s===m.id||s==="manual",children:s===m.id?o.jsxs(o.Fragment,{children:[o.jsx(Sn,{size:12,className:"animate-spin mr-1"}),"Installing..."]}):"Install"})]}),o.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-300 mb-4 line-clamp-2",children:m.description}),o.jsxs("div",{className:"flex items-center justify-between mt-auto",children:[o.jsx("div",{className:"flex gap-2",children:m.tags.map(g=>o.jsx("span",{className:"px-2 py-0.5 bg-slate-100 dark:bg-slate-700 text-slate-600 dark:text-slate-300 text-xs rounded-full",children:g},g))}),o.jsxs("div",{className:"flex items-center gap-3 text-xs text-slate-400",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Oa,{size:12})," ",m.downloads]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx($Z,{size:12})," ",m.stars]})]})]})]},m.id))})]}),o.jsx(DTe,{isOpen:c,onClose:()=>u(!1),onAdd:p})]})}function ITe(){const[e,t]=S.useState([]),[r,n]=S.useState(!0),[a,i]=S.useState(null),[s,l]=S.useState(!1);S.useEffect(()=>{c()},[]);const c=async()=>{try{n(!0);const f=await Oc.getInstalledPlugins();t(f)}catch(f){console.error("Failed to load installed plugins:",f)}finally{n(!1),l(!1)}},u=async()=>{l(!0),await c()},d=async f=>{if(confirm("Are you sure you want to uninstall this plugin?")){i(f);try{await Oc.uninstallPlugin(f),t(h=>h.filter(p=>p.id!==f))}catch(h){console.error("Uninstall failed:",h),alert(`Uninstall failed: ${h.message}`)}finally{i(null)}}};return r?o.jsx("div",{className:"flex justify-center items-center py-12",children:o.jsx(Sn,{className:"animate-spin text-primary-500",size:32})}):e.length===0?o.jsxs("div",{className:"text-center py-12 text-slate-500 dark:text-slate-400",children:[o.jsx("p",{children:"No plugins installed yet."}),o.jsx("p",{className:"text-sm mt-2",children:"Install plugins from the Browser tab"})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"flex justify-end",children:o.jsxs(fe,{variant:"outline",size:"sm",onClick:u,disabled:s,className:"flex items-center gap-2",children:[o.jsx(vi,{size:14,className:s?"animate-spin":""}),"Refresh"]})}),e.map(f=>o.jsxs("div",{className:"flex items-center justify-between p-4 bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-xl",children:[o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"p-2 bg-primary-50 dark:bg-primary-900/20 rounded-lg",children:o.jsx(tx,{className:"text-primary-500",size:24})}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"font-semibold text-slate-900 dark:text-white",children:f.name}),o.jsxs(qe,{variant:"outline",className:"text-xs",children:["v",f.version]}),o.jsx(qe,{variant:"success",className:"text-xs",children:"Active"})]}),o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:f.description})]})]}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(fe,{variant:"ghost",size:"sm",className:"text-red-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20",title:"Uninstall",onClick:()=>d(f.id),disabled:a===f.id,children:a===f.id?o.jsx(Sn,{size:16,className:"animate-spin"}):o.jsx(Oi,{size:16})})})]},f.id))]})}function LTe(){const[e,t]=S.useState(""),[r,n]=S.useState("zenml"),[a,i]=S.useState("idle"),[s,l]=S.useState([]),c=async()=>{if(e){i("importing"),l([`Connecting to ${r==="zenml"?"ZenML":"Source"}...`,"Fetching stack details..."]);try{const u=await Oc.importStack(e,r);l(d=>[...d,`Found stack '${e}' with ${u.components.length} components.`]),await new Promise(d=>setTimeout(d,800)),l(d=>[...d,"Generating flowyml configuration...","Import successful!"]),i("success")}catch(u){console.error("Import failed:",u),l(d=>[...d,`Error: ${u.message}`]),i("error")}}};return o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"bg-slate-50 dark:bg-slate-800/50 p-4 rounded-xl border border-slate-200 dark:border-slate-700",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Z8,{className:"text-primary-500 mt-1",size:20}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-medium text-slate-900 dark:text-white",children:"Import External Stack"}),o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:"Migrate your existing infrastructure to FlowyML. We'll automatically detect your components and generate the necessary configuration."})]})]})}),o.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium text-slate-700 dark:text-slate-300",children:"Source Type"}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx("button",{onClick:()=>n("zenml"),className:`p-3 rounded-lg border text-sm font-medium flex items-center justify-center gap-2 transition-all ${r==="zenml"?"bg-primary-50 dark:bg-primary-900/20 border-primary-500 text-primary-700 dark:text-primary-300":"bg-white dark:bg-slate-800 border-slate-200 dark:border-slate-700 hover:border-slate-300 dark:hover:border-slate-600"}`,children:"ZenML"}),o.jsx("button",{disabled:!0,className:"p-3 rounded-lg border border-dashed border-slate-200 dark:border-slate-800 text-slate-400 text-sm font-medium flex items-center justify-center gap-2 cursor-not-allowed",children:"FlowyML YAML (Coming Soon)"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium text-slate-700 dark:text-slate-300",children:"Stack Name"}),o.jsx("input",{type:"text",placeholder:"e.g., production-stack",value:e,onChange:u=>t(u.target.value),className:"w-full px-3 py-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"})]})]}),o.jsx("div",{className:"flex justify-end",children:o.jsx(fe,{onClick:c,disabled:a==="importing"||!e,className:"flex items-center gap-2",children:a==="importing"?o.jsxs(o.Fragment,{children:[o.jsx(Sn,{size:16,className:"animate-spin"}),"Importing..."]}):o.jsxs(o.Fragment,{children:["Start Import",o.jsx(Ai,{size:16})]})})}),a!=="idle"&&o.jsxs("div",{className:"bg-slate-900 rounded-xl p-4 font-mono text-sm overflow-hidden",children:[o.jsx("div",{className:"space-y-1",children:s.map((u,d)=>o.jsxs("div",{className:"flex items-center gap-2 text-slate-300",children:[o.jsx("span",{className:"text-slate-600",children:"➜"}),u]},d))}),a==="success"&&o.jsxs("div",{className:"mt-4 pt-4 border-t border-slate-800 flex items-center gap-2 text-green-400",children:[o.jsx(rr,{size:16}),o.jsx("span",{children:"Stack imported successfully! You can now use it in your pipelines."})]}),a==="error"&&o.jsxs("div",{className:"mt-4 pt-4 border-t border-slate-800 flex items-center gap-2 text-red-400",children:[o.jsx(dn,{size:16}),o.jsx("span",{children:"Failed to import stack. Please check the name and try again."})]})]})]})}function zTe(){const[e,t]=S.useState("browser"),r=[{id:"browser",label:"Plugin Browser",icon:Ea},{id:"installed",label:"Installed",icon:Oa},{id:"import",label:"Import Stack",icon:Z8}];return o.jsxs(Te,{className:"overflow-hidden",children:[o.jsxs(Z7,{className:"border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50 pb-0",children:[o.jsx("div",{className:"flex items-center justify-between mb-4",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ea,{size:20,className:"text-primary-500"}),o.jsx(Q7,{children:"Plugins & Integrations"})]})}),o.jsx("div",{className:"flex gap-6",children:r.map(n=>{const a=n.icon,i=e===n.id;return o.jsxs("button",{onClick:()=>t(n.id),className:`
748
+ flex items-center gap-2 pb-3 text-sm font-medium transition-all relative
749
+ ${i?"text-primary-600 dark:text-primary-400":"text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}
750
+ `,children:[o.jsx(a,{size:16}),n.label,i&&o.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary-500 rounded-t-full"})]},n.id)})})]}),o.jsxs(jN,{className:"p-6",children:[e==="browser"&&o.jsx($Te,{}),e==="installed"&&o.jsx(ITe,{}),e==="import"&&o.jsx(LTe,{})]})]})}function FTe(){const e={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.1}}},t={hidden:{opacity:0,y:20},show:{opacity:1,y:0}};return o.jsxs(ge.div,{initial:"hidden",animate:"show",variants:e,className:"space-y-6",children:[o.jsxs(ge.div,{variants:t,children:[o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("div",{className:"p-2 bg-gradient-to-br from-purple-600 to-purple-800 rounded-lg",children:o.jsx(Ea,{className:"text-white",size:24})}),o.jsx("h2",{className:"text-3xl font-bold text-slate-900 dark:text-white tracking-tight",children:"Plugins & Integrations"})]}),o.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-2",children:"Extend flowyml with plugins from ZenML, Airflow, and other ecosystems. Browse, install, and manage integrations seamlessly."})]}),o.jsx(ge.div,{variants:t,children:o.jsx(zTe,{})})]})}function BTe(){const[e,t]=S.useState({theme:"system",notificationsEnabled:!0,emailAlerts:!1,autoRefresh:!0,refreshInterval:30,timezone:"auto",dataRetention:30,artifactUpload:!1,debugMode:!1}),[r,n]=S.useState(!1),[a,i]=S.useState(null);S.useEffect(()=>{s()},[]);const s=async()=>{try{const d=await fetch("/api/execution/info");if(d.ok){const f=await d.json();i(f)}}catch(d){console.error("Failed to fetch server info:",d)}},l=(d,f)=>{t(h=>({...h,[d]:f})),n(!1)},c=()=>{localStorage.setItem("flowyml_settings",JSON.stringify(e)),n(!0),setTimeout(()=>n(!1),3e3)},u=({theme:d,icon:f,label:h})=>o.jsxs("button",{onClick:()=>l("theme",d),className:`flex flex-col items-center justify-center p-4 rounded-xl border-2 transition-all ${e.theme===d?"border-primary-500 bg-primary-50 dark:bg-primary-900/20":"border-slate-200 dark:border-slate-700 hover:border-slate-300 dark:hover:border-slate-600"}`,children:[o.jsx(f,{size:24,className:e.theme===d?"text-primary-600":"text-slate-500"}),o.jsx("span",{className:`mt-2 text-sm font-medium ${e.theme===d?"text-primary-600":"text-slate-600 dark:text-slate-400"}`,children:h})]});return o.jsxs("div",{className:"p-6 max-w-4xl mx-auto space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-3xl font-bold text-slate-900 dark:text-white flex items-center gap-3",children:[o.jsx("div",{className:"p-3 bg-gradient-to-br from-slate-600 to-slate-800 rounded-xl text-white",children:o.jsx(tx,{size:28})}),"Settings"]}),o.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-2",children:"Configure your FlowyML dashboard preferences"})]}),o.jsxs(fe,{onClick:c,className:"flex items-center gap-2 bg-gradient-to-r from-primary-600 to-purple-600 hover:from-primary-700 hover:to-purple-700",children:[r?o.jsx(_m,{size:16}):o.jsx(OZ,{size:16}),r?"Saved!":"Save Settings"]})]}),o.jsxs(Te,{children:[o.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[o.jsx("div",{className:"p-2 bg-purple-100 dark:bg-purple-900/20 rounded-lg",children:o.jsx(SZ,{className:"text-purple-600 dark:text-purple-400",size:20})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"Appearance"}),o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Customize the look and feel"})]})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsx(u,{theme:"light",icon:oF,label:"Light"}),o.jsx(u,{theme:"dark",icon:aF,label:"Dark"}),o.jsx(u,{theme:"system",icon:NZ,label:"System"})]})]}),o.jsxs(Te,{children:[o.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[o.jsx("div",{className:"p-2 bg-blue-100 dark:bg-blue-900/20 rounded-lg",children:o.jsx(uZ,{className:"text-blue-600 dark:text-blue-400",size:20})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"Notifications"}),o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Manage alert preferences"})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("label",{className:"flex items-center justify-between cursor-not-allowed opacity-60",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"font-medium text-slate-900 dark:text-white flex items-center gap-2",children:["Push Notifications",o.jsx(qe,{variant:"secondary",className:"text-xs",children:"Coming Soon"})]}),o.jsx("div",{className:"text-sm text-slate-500",children:"Get notified about pipeline completions"})]}),o.jsx("input",{type:"checkbox",checked:e.notificationsEnabled,disabled:!0,className:"w-5 h-5 rounded text-slate-400 cursor-not-allowed"})]}),o.jsxs("label",{className:"flex items-center justify-between cursor-not-allowed opacity-60",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"font-medium text-slate-900 dark:text-white flex items-center gap-2",children:["Email Alerts",o.jsx(qe,{variant:"secondary",className:"text-xs",children:"Coming Soon"})]}),o.jsx("div",{className:"text-sm text-slate-500",children:"Receive email for failed pipelines"})]}),o.jsx("input",{type:"checkbox",checked:e.emailAlerts,disabled:!0,className:"w-5 h-5 rounded text-slate-400 cursor-not-allowed"})]})]})]}),o.jsxs(Te,{children:[o.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[o.jsx("div",{className:"p-2 bg-green-100 dark:bg-green-900/20 rounded-lg",children:o.jsx(nr,{className:"text-green-600 dark:text-green-400",size:20})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"Data & Storage"}),o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Configure data handling"})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("label",{className:"flex items-center justify-between cursor-not-allowed opacity-60",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"font-medium text-slate-900 dark:text-white flex items-center gap-2",children:["Auto-upload Artifacts",o.jsx(qe,{variant:"secondary",className:"text-xs",children:"Coming Soon"})]}),o.jsx("div",{className:"text-sm text-slate-500",children:"Automatically upload artifacts to remote storage"})]}),o.jsx("input",{type:"checkbox",checked:e.artifactUpload,disabled:!0,className:"w-5 h-5 rounded text-slate-400 cursor-not-allowed"})]}),o.jsxs("div",{className:"opacity-60",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"font-medium text-slate-900 dark:text-white flex items-center gap-2",children:["Data Retention",o.jsx(qe,{variant:"secondary",className:"text-xs",children:"Coming Soon"})]}),o.jsx("div",{className:"text-sm text-slate-500",children:"Days to keep run history"})]}),o.jsxs(qe,{variant:"secondary",children:[e.dataRetention," days"]})]}),o.jsx("input",{type:"range",min:"7",max:"365",value:e.dataRetention,disabled:!0,className:"w-full h-2 bg-slate-200 dark:bg-slate-700 rounded-lg appearance-none cursor-not-allowed"})]})]})]}),o.jsxs(Te,{children:[o.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[o.jsx("div",{className:"p-2 bg-amber-100 dark:bg-amber-900/20 rounded-lg",children:o.jsx(hn,{className:"text-amber-600 dark:text-amber-400",size:20})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"Performance"}),o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Dashboard behavior settings"})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("label",{className:"flex items-center justify-between cursor-pointer",children:[o.jsxs("div",{children:[o.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:"Auto-refresh Data"}),o.jsx("div",{className:"text-sm text-slate-500",children:"Automatically refresh dashboard data"})]}),o.jsx("input",{type:"checkbox",checked:e.autoRefresh,onChange:d=>l("autoRefresh",d.target.checked),className:"w-5 h-5 rounded text-primary-600 focus:ring-primary-500"})]}),e.autoRefresh&&o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:"Refresh Interval"}),o.jsx("div",{className:"text-sm text-slate-500",children:"Seconds between refreshes"})]}),o.jsxs(qe,{variant:"secondary",children:[e.refreshInterval,"s"]})]}),o.jsx("input",{type:"range",min:"10",max:"120",step:"10",value:e.refreshInterval,onChange:d=>l("refreshInterval",parseInt(d.target.value)),className:"w-full h-2 bg-slate-200 dark:bg-slate-700 rounded-lg appearance-none cursor-pointer"})]}),o.jsxs("label",{className:"flex items-center justify-between cursor-pointer",children:[o.jsxs("div",{children:[o.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:"Debug Mode"}),o.jsx("div",{className:"text-sm text-slate-500",children:"Show verbose logging in console"})]}),o.jsx("input",{type:"checkbox",checked:e.debugMode,onChange:d=>l("debugMode",d.target.checked),className:"w-5 h-5 rounded text-primary-600 focus:ring-primary-500"})]})]})]}),o.jsxs(Te,{className:"bg-slate-50 dark:bg-slate-800/50",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[o.jsx("div",{className:"p-2 bg-slate-200 dark:bg-slate-700 rounded-lg",children:o.jsx(el,{className:"text-slate-600 dark:text-slate-400",size:20})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-white",children:"Server Information"}),o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"FlowyML backend details"})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-slate-500 dark:text-slate-400",children:"Version"}),o.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:(a==null?void 0:a.version)||"0.1.0"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-slate-500 dark:text-slate-400",children:"Environment"}),o.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:(a==null?void 0:a.environment)||"Development"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-slate-500 dark:text-slate-400",children:"Database"}),o.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:(a==null?void 0:a.database)||"PostgreSQL"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-slate-500 dark:text-slate-400",children:"Uptime"}),o.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:(a==null?void 0:a.uptime)||"N/A"})]})]})]}),o.jsxs("div",{className:"text-center pt-8 pb-4 border-t border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"flex items-center justify-center gap-2 text-slate-500 dark:text-slate-400",children:[o.jsx("span",{className:"text-sm",children:"Made with ❤️ by"}),o.jsx("span",{className:"font-semibold text-primary-600 dark:text-primary-400",children:"UnicoLab"})]}),o.jsx("p",{className:"text-xs text-slate-400 dark:text-slate-500 mt-1",children:"FlowyML - Next-generation MLOps Platform"})]})]})}function VTe(){const[e,t]=S.useState([]),[r,n]=S.useState(!0),[a,i]=S.useState(!1),[s,l]=S.useState(null),[c,u]=S.useState(null);S.useEffect(()=>{d()},[]);const d=async()=>{try{const h=await Ne("/api/execution/tokens");if(h.status===401){t([]),n(!1);return}const p=await h.json();console.log("Tokens fetched:",p),t(p.tokens||[])}catch(h){console.error("Failed to fetch tokens:",h),u("Failed to load tokens")}finally{n(!1)}},f=async()=>{try{const h=await Ne("/api/execution/tokens/init",{method:"POST"}),p=await h.json();h.ok?(l(p.token),await d()):u(p.detail)}catch{u("Failed to create initial token")}};return r?o.jsx("div",{className:"flex items-center justify-center h-96",children:o.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600"})}):o.jsxs("div",{className:"space-y-6 max-w-6xl mx-auto",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("div",{className:"p-2 bg-gradient-to-br from-amber-600 to-orange-800 rounded-lg",children:o.jsx(g0,{className:"text-white",size:24})}),o.jsx("h2",{className:"text-3xl font-bold text-slate-900 dark:text-white tracking-tight",children:"API Tokens"})]}),o.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-2",children:"Manage API tokens for authenticating CLI and SDK requests"})]}),c&&o.jsxs("div",{className:"bg-rose-50 dark:bg-rose-900/20 border border-rose-200 dark:border-rose-800 rounded-lg p-4 flex items-start gap-3",children:[o.jsx(dn,{className:"text-rose-600 shrink-0",size:20}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium text-rose-900 dark:text-rose-200",children:"Error"}),o.jsx("p",{className:"text-sm text-rose-700 dark:text-rose-300 mt-1",children:c})]})]}),s&&o.jsx(WTe,{token:s,onClose:()=>l(null)}),e.length===0&&!s&&o.jsx(Te,{children:o.jsxs(jN,{className:"py-16 text-center",children:[o.jsx("div",{className:"mx-auto w-20 h-20 bg-amber-100 dark:bg-amber-900/30 rounded-2xl flex items-center justify-center mb-6",children:o.jsx(g0,{className:"text-amber-600",size:32})}),o.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-white mb-2",children:"No API Tokens Yet"}),o.jsx("p",{className:"text-slate-500 dark:text-slate-400 max-w-md mx-auto mb-6",children:"Create your first admin token to start using the flowyml API"}),o.jsxs(fe,{onClick:f,className:"flex items-center gap-2 mx-auto",children:[o.jsx(rl,{size:18}),"Create Initial Token"]})]})}),Array.isArray(e)&&e.length>0&&o.jsxs(Te,{children:[o.jsx(Z7,{children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Q7,{children:"Active Tokens"}),o.jsxs(fe,{onClick:()=>i(!0),variant:"primary",className:"flex items-center gap-2",children:[o.jsx(rl,{size:18}),"Create Token"]})]})}),o.jsx(jN,{children:o.jsx("div",{className:"space-y-3",children:e.map((h,p)=>o.jsx(HTe,{token:h,onRevoke:d},p))})})]}),a&&o.jsx(GTe,{onClose:()=>i(!1),onCreate:h=>{l(h),i(!1),d()}})]})}const qTe={read:{label:"Read",icon:ju,className:"bg-blue-50 text-blue-700 border-blue-200 dark:bg-blue-900/30 dark:text-blue-200 dark:border-blue-800"},write:{label:"Write",icon:PZ,className:"bg-emerald-50 text-emerald-700 border-emerald-200 dark:bg-emerald-900/30 dark:text-emerald-200 dark:border-emerald-800"},execute:{label:"Execute",icon:hn,className:"bg-purple-50 text-purple-700 border-purple-200 dark:bg-purple-900/30 dark:text-purple-200 dark:border-purple-800"},admin:{label:"Admin",icon:MZ,className:"bg-rose-50 text-rose-700 border-rose-200 dark:bg-rose-900/30 dark:text-rose-200 dark:border-rose-800"}};function UTe({perm:e}){const t=qTe[e]||{label:e,icon:wE,className:"bg-slate-100 text-slate-700 border-slate-200 dark:bg-slate-800/60 dark:text-slate-100 dark:border-slate-700"},r=t.icon;return o.jsxs("span",{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-semibold border ${t.className}`,children:[o.jsx(r,{size:12}),t.label]})}function HTe({token:e,onRevoke:t}){const[r,n]=S.useState(!1),a=async()=>{try{await Ne(`/api/execution/tokens/${e.name}`,{method:"DELETE"}),t()}catch(i){console.error("Failed to revoke token:",i)}};return o.jsxs("div",{className:"p-4 bg-slate-50 dark:bg-slate-800/50 rounded-lg border border-slate-200 dark:border-slate-700 hover:border-primary-300 dark:hover:border-primary-700 transition-colors",children:[o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("h4",{className:"font-semibold text-slate-900 dark:text-white",children:e.name}),e.project&&o.jsx(qe,{variant:"secondary",className:"text-xs",children:e.project})]}),o.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:Array.isArray(e.permissions)&&e.permissions.length>0?e.permissions.map(i=>o.jsx(UTe,{perm:i},i)):o.jsx("span",{className:"text-xs text-slate-400",children:"No permissions assigned"})}),o.jsxs("div",{className:"flex items-center gap-4 text-xs text-slate-500 dark:text-slate-400",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(_a,{size:12}),"Created: ",Ft(new Date(e.created_at),"MMM d, yyyy")]}),e.last_used&&o.jsxs("span",{children:["Last used: ",Ft(new Date(e.last_used),"MMM d, yyyy")]})]})]}),o.jsx("button",{onClick:()=>n(!0),className:"p-2 hover:bg-rose-100 dark:hover:bg-rose-900/30 text-slate-400 hover:text-rose-600 rounded-lg transition-colors",children:o.jsx(Oi,{size:16})})]}),r&&o.jsxs("div",{className:"mt-3 pt-3 border-t border-slate-200 dark:border-slate-700",children:[o.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 mb-3",children:"Are you sure you want to revoke this token? This action cannot be undone."}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(fe,{variant:"danger",size:"sm",onClick:a,children:"Yes, Revoke"}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>n(!1),children:"Cancel"})]})]})]})}function WTe({token:e,onClose:t}){const[r,n]=S.useState(!1),a=()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)};return o.jsxs(ge.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"bg-gradient-to-br from-emerald-50 to-teal-50 dark:from-emerald-900/20 dark:to-teal-900/20 border-2 border-emerald-300 dark:border-emerald-700 rounded-lg p-6",children:[o.jsx("div",{className:"flex items-start justify-between mb-4",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-2 bg-emerald-500 rounded-lg",children:o.jsx(wE,{className:"text-white",size:20})}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-bold text-emerald-900 dark:text-emerald-200",children:"Token Created Successfully!"}),o.jsx("p",{className:"text-sm text-emerald-700 dark:text-emerald-300 mt-1",children:"Save this token now - it won't be shown again"})]})]})}),o.jsx("div",{className:"bg-white dark:bg-slate-800 rounded-lg p-4 border border-emerald-200 dark:border-emerald-800",children:o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx("code",{className:"flex-1 font-mono text-sm text-slate-900 dark:text-white break-all",children:e}),o.jsx("button",{onClick:a,className:"p-2 hover:bg-slate-100 dark:hover:bg-slate-700 rounded transition-colors shrink-0",children:r?o.jsx(Ef,{className:"text-emerald-600",size:18}):o.jsx(Pf,{className:"text-slate-400",size:18})})]})}),o.jsx(fe,{variant:"ghost",onClick:t,className:"mt-4 w-full",children:"I've saved my token"})]})}function GTe({onClose:e,onCreate:t}){const[r,n]=S.useState(""),[a,i]=S.useState(""),[s,l]=S.useState(["read","write","execute"]),[c,u]=S.useState(!1),[d,f]=S.useState(null),[h,p]=S.useState([]),[m,g]=S.useState(!0);S.useEffect(()=>{y()},[]);const y=async()=>{try{const j=await(await Ne("/api/projects/")).json();p(j.projects||[])}catch(b){console.error("Failed to fetch projects:",b),p([])}finally{g(!1)}},x=async()=>{if(!r){f("Token name is required");return}u(!0),f(null);try{const b=await Ne("/api/execution/tokens",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r,project:a||null,permissions:s})}),j=await b.json();b.ok?t(j.token):f(j.detail)}catch{f("Failed to create token")}finally{u(!1)}},v=b=>{l(j=>j.includes(b)?j.filter(w=>w!==b):[...j,b])};return o.jsx(Zt,{children:o.jsx(ge.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",onClick:e,children:o.jsxs(ge.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},onClick:b=>b.stopPropagation(),className:"bg-white dark:bg-slate-800 rounded-2xl shadow-2xl max-w-lg w-full border border-slate-200 dark:border-slate-700",children:[o.jsxs("div",{className:"p-6 border-b border-slate-100 dark:border-slate-700",children:[o.jsx("h3",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:"Create New Token"}),o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:"Generate a new API token for authentication"})]}),o.jsxs("div",{className:"p-6 space-y-4",children:[d&&o.jsx("div",{className:"bg-rose-50 dark:bg-rose-900/20 border border-rose-200 dark:border-rose-800 rounded-lg p-3 text-sm text-rose-700 dark:text-rose-300",children:d}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-1",children:"Token Name *"}),o.jsx("input",{type:"text",value:r,onChange:b=>n(b.target.value),placeholder:"e.g., Production CLI Token",className:"w-full px-3 py-2 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 bg-white dark:bg-slate-900 text-slate-900 dark:text-white"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-1",children:"Project Scope"}),o.jsxs("select",{value:a,onChange:b=>i(b.target.value),disabled:m,className:"w-full px-3 py-2 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 bg-white dark:bg-slate-900 text-slate-900 dark:text-white",children:[o.jsx("option",{value:"",children:"All Projects"}),Array.isArray(h)&&h.map(b=>o.jsx("option",{value:b.name,children:b.name},b.name))]}),o.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:"Restrict this token to a specific project or allow access to all"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2",children:"Permissions"}),o.jsx("div",{className:"space-y-2",children:["read","write","execute","admin"].map(b=>o.jsxs("label",{className:"flex items-center gap-3 p-3 bg-slate-50 dark:bg-slate-900/50 rounded-lg cursor-pointer hover:bg-slate-100 dark:hover:bg-slate-700/50",children:[o.jsx("input",{type:"checkbox",checked:s.includes(b),onChange:()=>v(b),className:"w-4 h-4 text-primary-600 border-slate-300 rounded focus:ring-primary-500"}),o.jsxs("div",{className:"flex-1",children:[o.jsx("span",{className:"font-medium text-slate-900 dark:text-white capitalize",children:b}),o.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-0.5",children:[b==="read"&&"View pipelines, runs, and artifacts",b==="write"&&"Modify configurations and metadata",b==="execute"&&"Run pipelines and workflows",b==="admin"&&"Full access including token management"]})]})]},b))})]})]}),o.jsxs("div",{className:"p-6 border-t border-slate-100 dark:border-slate-700 flex gap-3",children:[o.jsx(fe,{variant:"ghost",onClick:e,className:"flex-1",children:"Cancel"}),o.jsx(fe,{onClick:x,disabled:c,className:"flex-1",children:c?"Creating...":"Create Token"})]})]})})})}function KTe(){const[e]=Jg(),[t,r]=S.useState([]),[n,a]=S.useState(!0),[i,s]=S.useState(null),l=e.get("runs"),c=e.get("run1"),u=e.get("run2"),d=l?l.split(",").filter(Boolean):[c,u].filter(Boolean);S.useEffect(()=>{if(d.length<2){s("Please select at least two runs to compare."),a(!1);return}f()},[l,c,u]);const f=async()=>{a(!0);try{const m=d.map(x=>Ne(`/api/runs/${x}`)),g=await Promise.all(m),y=[];for(const x of g){if(!x.ok)throw new Error("Failed to fetch run details");y.push(await x.json())}r(y)}catch(m){s(m.message)}finally{a(!1)}};if(n)return o.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-slate-50 dark:bg-slate-900",children:[o.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600 mb-4"}),o.jsx("p",{className:"text-slate-500",children:"Loading comparison..."})]});if(i)return o.jsx("div",{className:"flex flex-col items-center justify-center h-screen bg-slate-50 dark:bg-slate-900",children:o.jsxs("div",{className:"bg-red-50 p-6 rounded-xl border border-red-100 max-w-md text-center",children:[o.jsx(ex,{className:"mx-auto text-red-500 mb-2",size:32}),o.jsx("h2",{className:"text-xl font-bold text-slate-800 mb-2",children:"Error"}),o.jsx("p",{className:"text-slate-600 mb-4",children:i}),o.jsx(ft,{to:"/runs",children:o.jsx(fe,{children:"Back to Runs"})})]})});const h=Math.min(...t.map(m=>m.duration||1/0)),p=Array.from(new Set(t.flatMap(m=>Object.keys(m.steps||{}))));return o.jsxs("div",{className:"min-h-screen bg-slate-50 dark:bg-slate-900 overflow-y-auto",children:[o.jsx("div",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 sticky top-0 z-10 w-full overflow-x-auto",children:o.jsxs("div",{className:"w-full min-w-max px-6 py-4",children:[o.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[o.jsx(ft,{to:"/runs",className:"p-2 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-full transition-colors",children:o.jsx(H8,{size:20,className:"text-slate-500"})}),o.jsxs("h1",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:["Run Comparison",o.jsxs(qe,{variant:"secondary",className:"ml-2",children:["(",t.length," runs)"]})]})]}),o.jsx("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${t.length}, minmax(300px, 1fr))`},children:t.map(m=>o.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700",children:[o.jsx(qc,{status:m.status}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-bold text-slate-900 dark:text-white truncate",title:m.run_id,children:m.run_id}),o.jsx("p",{className:"text-xs text-slate-500",children:Ft(new Date(m.start_time),"MMM d, HH:mm:ss")})]})]},m.run_id))})]})}),o.jsx("div",{className:"w-full overflow-x-auto",children:o.jsxs("div",{className:"min-w-max px-6 py-8 space-y-8",children:[o.jsxs("section",{children:[o.jsxs("h2",{className:"text-lg font-bold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[o.jsx(Fe,{size:18})," Performance Metrics"]}),o.jsx(Te,{className:"overflow-hidden",children:o.jsxs("table",{className:"w-full text-sm text-left",children:[o.jsx("thead",{className:"bg-slate-50 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 text-xs uppercase text-slate-500 font-medium",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-3 w-48 sticky left-0 bg-slate-50 dark:bg-slate-800 z-10 border-r border-slate-200 dark:border-slate-700",children:"Metric"}),t.map((m,g)=>o.jsx("th",{className:`px-6 py-3 min-w-[200px] ${g<t.length-1?"border-r border-slate-200 dark:border-slate-700":""}`,children:m.run_id.slice(0,8)},m.run_id))]})}),o.jsxs("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-700",children:[o.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[o.jsx("td",{className:"px-6 py-3 font-medium text-slate-700 dark:text-slate-300 sticky left-0 bg-white dark:bg-slate-900 border-r border-slate-100 dark:border-slate-700",children:"Duration"}),t.map((m,g)=>{var y;return o.jsxs("td",{className:`px-6 py-3 ${g<t.length-1?"border-r border-slate-100 dark:border-slate-700":""} ${m.duration===h?"text-emerald-600 font-bold":"text-slate-600"}`,children:[(y=m.duration)==null?void 0:y.toFixed(2),"s",m.duration===h&&t.length>1&&o.jsx("span",{className:"ml-2 text-xs bg-emerald-100 dark:bg-emerald-900/30 text-emerald-600 px-1.5 py-0.5 rounded-full",children:"Fastest"})]},m.run_id)})]}),o.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[o.jsx("td",{className:"px-6 py-3 font-medium text-slate-700 dark:text-slate-300 sticky left-0 bg-white dark:bg-slate-900 border-r border-slate-100 dark:border-slate-700",children:"Step Count"}),t.map((m,g)=>o.jsx("td",{className:`px-6 py-3 text-slate-600 ${g<t.length-1?"border-r border-slate-100 dark:border-slate-700":""}`,children:Object.keys(m.steps||{}).length},m.run_id))]})]})]})})]}),o.jsxs("section",{children:[o.jsxs("h2",{className:"text-lg font-bold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[o.jsx(Zr,{size:18})," Step Execution"]}),o.jsx(Te,{className:"overflow-hidden",children:o.jsxs("table",{className:"w-full text-sm text-left",children:[o.jsx("thead",{className:"bg-slate-50 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 text-xs uppercase text-slate-500 font-medium",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-3 w-48 sticky left-0 bg-slate-50 dark:bg-slate-800 z-10 border-r border-slate-200 dark:border-slate-700",children:"Step Name"}),t.map((m,g)=>o.jsx("th",{className:`px-6 py-3 min-w-[200px] ${g<t.length-1?"border-r border-slate-200 dark:border-slate-700":""}`,children:m.run_id.slice(0,8)},m.run_id))]})}),o.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-700",children:p.map(m=>{const g=t.map(x=>{var v,b;return((b=(v=x.steps)==null?void 0:v[m])==null?void 0:b.duration)||1/0}),y=Math.min(...g);return o.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[o.jsx("td",{className:"px-6 py-3 font-medium text-slate-700 dark:text-slate-300 sticky left-0 bg-white dark:bg-slate-900 border-r border-slate-100 dark:border-slate-700",children:m}),t.map((x,v)=>{var j,w;const b=(j=x.steps)==null?void 0:j[m];return o.jsx("td",{className:`px-6 py-3 ${v<t.length-1?"border-r border-slate-100 dark:border-slate-700":""}`,children:b?o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsx(qc,{status:b.success?"completed":b.error?"failed":"pending",size:"sm"}),o.jsxs("span",{className:`font-mono text-xs ${b.duration===y&&t.length>1?"text-emerald-600 font-bold":"text-slate-500"}`,children:[(w=b.duration)==null?void 0:w.toFixed(2),"s"]})]}):o.jsx("span",{className:"text-slate-400 italic text-xs",children:"Not executed"})},x.run_id)})]},m)})})]})})]})]})})]})}function YTe(){const[e]=Jg(),[t,r]=S.useState([]),[n,a]=S.useState(!0),[i,s]=S.useState(null),l=e.get("ids"),c=l?l.split(",").filter(Boolean):[];S.useEffect(()=>{if(c.length<2){s("Please select at least two experiments to compare."),a(!1);return}u()},[l]);const u=async()=>{a(!0);try{const g=((await(await Ne("/api/experiments/?limit=1000")).json()).experiments||[]).filter(v=>c.includes(v.experiment_id)),y=await Promise.all(g.map(async v=>{try{const b=v.pipeline_name?`/api/runs?pipeline=${encodeURIComponent(v.pipeline_name)}&limit=100`:"/api/runs?limit=100",k=((await(await Ne(b)).json()).runs||[]).filter(O=>O.pipeline_name===v.pipeline_name||v.runs&&v.runs.includes(O.run_id)),N=k.length,_=k.filter(O=>O.status==="completed").length,P=k.filter(O=>O.status==="failed").length,C=k.map(O=>O.duration||0).filter(O=>O>0),A=C.length>0?C.reduce((O,T)=>O+T,0)/C.length:0;return{...v,stats:{total:N,success:_,failed:P,avgDuration:A,successRate:N>0?_/N*100:0}}}catch(b){return console.error(`Failed to fetch stats for experiment ${v.name}`,b),{...v,stats:{total:0,success:0,failed:0,avgDuration:0,successRate:0}}}})),x=c.map(v=>y.find(b=>b.experiment_id===v)).filter(Boolean);r(x)}catch(h){s(h.message)}finally{a(!1)}};if(n)return o.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-slate-50 dark:bg-slate-900",children:[o.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary-600 mb-4"}),o.jsx("p",{className:"text-slate-500",children:"Loading experiments..."})]});if(i)return o.jsx("div",{className:"flex flex-col items-center justify-center h-screen bg-slate-50 dark:bg-slate-900",children:o.jsxs("div",{className:"bg-red-50 p-6 rounded-xl border border-red-100 max-w-md text-center",children:[o.jsx(ex,{className:"mx-auto text-red-500 mb-2",size:32}),o.jsx("h2",{className:"text-xl font-bold text-slate-800 mb-2",children:"Error"}),o.jsx("p",{className:"text-slate-600 mb-4",children:i}),o.jsx(ft,{to:"/experiments",children:o.jsx(fe,{children:"Back to Experiments"})})]})});const d=Math.max(...t.map(h=>h.stats.successRate)),f=Math.min(...t.map(h=>h.stats.avgDuration).filter(h=>h>0));return o.jsxs("div",{className:"min-h-screen bg-slate-50 dark:bg-slate-900 overflow-y-auto",children:[o.jsx("div",{className:"bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 sticky top-0 z-10 w-full overflow-x-auto",children:o.jsxs("div",{className:"w-full min-w-max px-6 py-4",children:[o.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[o.jsx(ft,{to:"/experiments",className:"p-2 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-full transition-colors",children:o.jsx(H8,{size:20,className:"text-slate-500"})}),o.jsxs("h1",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:["Experiment Comparison",o.jsxs(qe,{variant:"secondary",className:"ml-2",children:["(",t.length," selected)"]})]})]}),o.jsx("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${t.length}, minmax(300px, 1fr))`},children:t.map(h=>o.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700",children:[o.jsx("div",{className:"p-2 bg-purple-100 dark:bg-purple-900/30 rounded-lg text-purple-600",children:o.jsx(Xn,{size:20})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-bold text-slate-900 dark:text-white truncate",title:h.name,children:h.name}),o.jsx("p",{className:"text-xs text-slate-500",children:Ft(new Date(h.created_at||Date.now()),"MMM d, yyyy")})]})]},h.experiment_id))})]})}),o.jsx("div",{className:"w-full overflow-x-auto",children:o.jsxs("div",{className:"min-w-max px-6 py-8 space-y-8",children:[o.jsxs("section",{children:[o.jsxs("h2",{className:"text-lg font-bold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[o.jsx(iF,{size:18})," Overview"]}),o.jsx(Te,{className:"overflow-hidden",children:o.jsxs("table",{className:"w-full text-sm text-left",children:[o.jsx("thead",{className:"bg-slate-50 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 text-xs uppercase text-slate-500 font-medium",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-3 w-48 sticky left-0 bg-slate-50 dark:bg-slate-800 z-10 border-r border-slate-200 dark:border-slate-700",children:"Attribute"}),t.map((h,p)=>o.jsx("th",{className:`px-6 py-3 min-w-[300px] ${p<t.length-1?"border-r border-slate-200 dark:border-slate-700":""}`,children:h.name},h.experiment_id))]})}),o.jsxs("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-700",children:[o.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[o.jsx("td",{className:"px-6 py-3 font-medium text-slate-700 dark:text-slate-300 sticky left-0 bg-white dark:bg-slate-900 border-r border-slate-100 dark:border-slate-700",children:"Description"}),t.map((h,p)=>o.jsx("td",{className:`px-6 py-3 text-slate-600 ${p<t.length-1?"border-r border-slate-100 dark:border-slate-700":""}`,children:h.description||"-"},h.experiment_id))]}),o.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[o.jsx("td",{className:"px-6 py-3 font-medium text-slate-700 dark:text-slate-300 sticky left-0 bg-white dark:bg-slate-900 border-r border-slate-100 dark:border-slate-700",children:"Project"}),t.map((h,p)=>o.jsx("td",{className:`px-6 py-3 text-slate-600 ${p<t.length-1?"border-r border-slate-100 dark:border-slate-700":""}`,children:h.project||"-"},h.experiment_id))]}),o.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[o.jsx("td",{className:"px-6 py-3 font-medium text-slate-700 dark:text-slate-300 sticky left-0 bg-white dark:bg-slate-900 border-r border-slate-100 dark:border-slate-700",children:"Pipeline Base"}),t.map((h,p)=>o.jsxs("td",{className:`px-6 py-3 text-slate-600 ${p<t.length-1?"border-r border-slate-100 dark:border-slate-700":""}`,children:[h.pipeline_name||"-",h.pipeline_version&&o.jsxs(qe,{variant:"outline",className:"ml-2",children:["v",h.pipeline_version]})]},h.experiment_id))]})]})]})})]}),o.jsxs("section",{children:[o.jsxs("h2",{className:"text-lg font-bold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[o.jsx(Fe,{size:18})," Performance Stats"]}),o.jsx(Te,{className:"overflow-hidden",children:o.jsxs("table",{className:"w-full text-sm text-left",children:[o.jsx("thead",{className:"bg-slate-50 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 text-xs uppercase text-slate-500 font-medium",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-3 w-48 sticky left-0 bg-slate-50 dark:bg-slate-800 z-10 border-r border-slate-200 dark:border-slate-700",children:"Metric"}),t.map((h,p)=>o.jsx("th",{className:`px-6 py-3 min-w-[300px] ${p<t.length-1?"border-r border-slate-200 dark:border-slate-700":""}`,children:h.name},h.experiment_id))]})}),o.jsxs("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-700",children:[o.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[o.jsx("td",{className:"px-6 py-3 font-medium text-slate-700 dark:text-slate-300 sticky left-0 bg-white dark:bg-slate-900 border-r border-slate-100 dark:border-slate-700",children:"Success Rate"}),t.map((h,p)=>o.jsxs("td",{className:`px-6 py-3 ${p<t.length-1?"border-r border-slate-100 dark:border-slate-700":""} ${h.stats.successRate===d&&h.stats.successRate>0?"text-emerald-600 font-bold":"text-slate-600"}`,children:[h.stats.successRate.toFixed(1),"%",h.stats.successRate===d&&h.stats.successRate>0&&t.length>1&&o.jsx("span",{className:"ml-2 text-xs bg-emerald-100 dark:bg-emerald-900/30 text-emerald-600 px-1.5 py-0.5 rounded-full",children:"Best"})]},h.experiment_id))]}),o.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[o.jsx("td",{className:"px-6 py-3 font-medium text-slate-700 dark:text-slate-300 sticky left-0 bg-white dark:bg-slate-900 border-r border-slate-100 dark:border-slate-700",children:"Avg Duration"}),t.map((h,p)=>o.jsxs("td",{className:`px-6 py-3 ${p<t.length-1?"border-r border-slate-100 dark:border-slate-700":""} ${h.stats.avgDuration===f&&h.stats.avgDuration>0?"text-emerald-600 font-bold":"text-slate-600"}`,children:[h.stats.avgDuration.toFixed(1),"s",h.stats.avgDuration===f&&h.stats.avgDuration>0&&t.length>1&&o.jsx("span",{className:"ml-2 text-xs bg-emerald-100 dark:bg-emerald-900/30 text-emerald-600 px-1.5 py-0.5 rounded-full",children:"Fastest"})]},h.experiment_id))]}),o.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[o.jsx("td",{className:"px-6 py-3 font-medium text-slate-700 dark:text-slate-300 sticky left-0 bg-white dark:bg-slate-900 border-r border-slate-100 dark:border-slate-700",children:"Total Runs"}),t.map((h,p)=>o.jsx("td",{className:`px-6 py-3 text-slate-600 ${p<t.length-1?"border-r border-slate-100 dark:border-slate-700":""}`,children:h.stats.total},h.experiment_id))]}),o.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/50",children:[o.jsx("td",{className:"px-6 py-3 font-medium text-slate-700 dark:text-slate-300 sticky left-0 bg-white dark:bg-slate-900 border-r border-slate-100 dark:border-slate-700",children:"Failures"}),t.map((h,p)=>o.jsx("td",{className:`px-6 py-3 ${p<t.length-1?"border-r border-slate-100 dark:border-slate-700":""} ${h.stats.failed>0?"text-rose-600":"text-emerald-600"}`,children:h.stats.failed},h.experiment_id))]})]})]})})]})]})})]})}function XTe(){var ee;const[e,t]=Jg(),[r,n]=S.useState([]),[a,i]=S.useState([]),[s,l]=S.useState(!0),[c,u]=S.useState(!1),[d,f]=S.useState(null),[h,p]=S.useState(new Set),[m,g]=S.useState(""),[y,x]=S.useState(!1),[v,b]=S.useState([]),[j,w]=S.useState(!1),[k,N]=S.useState(null),[_,P]=S.useState(!1),[C,A]=S.useState({}),[O,T]=S.useState(new Set),[E,R]=S.useState({name:"",model_artifact_id:"",model_version:null,port:null,config:{rate_limit:100,timeout_seconds:30,max_batch_size:1,enable_cors:!0,ttl_seconds:null}});S.useEffect(()=>{D(),z();const U=setInterval(()=>{D()},5e3);return()=>clearInterval(U)},[]),S.useEffect(()=>{const U=e.get("deploy"),G=e.get("name");U&&(R(ae=>({...ae,model_artifact_id:U,name:G?`${G}-api`:""})),u(!0),t({}))},[e,t]);const D=async()=>{try{const G=await(await fetch("/api/deployments/")).json();n(Array.isArray(G)?G:[])}catch(U){console.error("Failed to fetch deployments:",U)}finally{l(!1)}},z=async()=>{try{const G=await(await fetch("/api/deployments/available-models")).json();i(Array.isArray(G)?G:[])}catch(U){console.error("Failed to fetch models:",U)}},I=async()=>{try{const G=await(await fetch("/api/deployments/dependencies/status")).json();A(G.installed||{})}catch(U){console.error("Failed to fetch dependency status:",U)}},$=async U=>{T(G=>new Set([...G,U]));try{(await fetch("/api/deployments/dependencies/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({frameworks:[U]})})).ok&&setTimeout(()=>{I(),T(ae=>{const ce=new Set(ae);return ce.delete(U),ce})},3e3)}catch(G){console.error("Failed to install dependency:",G),T(ae=>{const ce=new Set(ae);return ce.delete(U),ce})}},F=async U=>{U.preventDefault();try{(await fetch("/api/deployments/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(E)})).ok&&(u(!1),R({name:"",model_artifact_id:"",model_version:null,port:null,config:{rate_limit:100,timeout_seconds:30,max_batch_size:1,enable_cors:!0}}),D())}catch(G){console.error("Failed to create deployment:",G)}},q=async(U,G)=>{try{await fetch(`/api/deployments/${U}/${G}`,{method:"POST"}),D()}catch(ae){console.error(`Failed to ${G} deployment:`,ae)}},V=async U=>{try{await fetch(`/api/deployments/${U}`,{method:"DELETE"}),N(null),D()}catch(G){console.error("Failed to delete deployment:",G)}},L=U=>{navigator.clipboard.writeText(U)},B=U=>{p(G=>{const ae=new Set(G);return ae.has(U)?ae.delete(U):ae.add(U),ae})},Y=U=>U?`${U.substring(0,8)}••••••••${U.substring(U.length-4)}`:"••••••••••••••••",W=U=>{switch(U){case"running":return"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/20 dark:text-emerald-400";case"pending":case"starting":return"bg-amber-100 text-amber-700 dark:bg-amber-900/20 dark:text-amber-400";case"stopped":return"bg-slate-100 text-slate-700 dark:bg-slate-900/20 dark:text-slate-400";case"error":return"bg-rose-100 text-rose-700 dark:bg-rose-900/20 dark:text-rose-400";default:return"bg-slate-100 text-slate-700"}},K=U=>{switch(U){case"running":return o.jsx(_m,{size:14});case"pending":case"starting":return o.jsx(Sn,{size:14,className:"animate-spin"});case"stopped":return o.jsx(EO,{size:14});case"error":return o.jsx(dn,{size:14});default:return o.jsx(ht,{size:14})}},Q=async U=>{f(U),w(!0);try{const G=await fetch(`/api/deployments/${U.id}/logs`);if(G.ok){const ae=await G.json();b(ae.logs||[])}}catch(G){console.error("Failed to fetch logs:",G),b([{timestamp:new Date().toISOString(),level:"ERROR",message:"Failed to fetch logs"}])}finally{w(!1)}},X=U=>{if(!U)return null;const G=new Date(U)-new Date;if(G<=0)return"Expired";const ae=Math.floor(G/6e4),ce=Math.floor(G%6e4/1e3);return ae>=60?`${Math.floor(ae/60)}h ${ae%60}m`:`${ae}m ${ce}s`};return s?o.jsx("div",{className:"flex items-center justify-center min-h-screen",children:o.jsx(Sn,{className:"w-12 h-12 animate-spin text-primary-600"})}):o.jsxs("div",{className:"p-6 max-w-7xl mx-auto space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-3xl font-bold text-slate-900 dark:text-white flex items-center gap-3",children:[o.jsx("div",{className:"p-3 bg-gradient-to-br from-orange-500 to-red-500 rounded-xl text-white",children:o.jsx(No,{size:28})}),"Deployment Lab",o.jsx(qe,{className:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400 text-xs font-medium",children:"Experimental"})]}),o.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-2",children:"Deploy models as API endpoints (TFServing for Keras models coming soon)"})]}),o.jsxs("div",{className:"flex gap-3",children:[o.jsxs(fe,{onClick:()=>{P(!_),_||I()},variant:"ghost",className:"flex items-center gap-2",children:[o.jsx(Ea,{size:16}),"Dependencies"]}),o.jsxs(fe,{onClick:D,variant:"ghost",className:"flex items-center gap-2",children:[o.jsx(vi,{size:16}),"Refresh"]}),o.jsxs(fe,{onClick:()=>u(!0),className:"flex items-center gap-2 bg-gradient-to-r from-orange-500 to-red-500 hover:from-orange-600 hover:to-red-600",children:[o.jsx(rl,{size:16}),"New Deployment"]})]})]}),_&&o.jsx(Te,{className:"bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 border-blue-200 dark:border-blue-800",children:o.jsxs("div",{className:"p-4",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ea,{className:"text-blue-500",size:20}),o.jsx("h3",{className:"font-semibold text-slate-900 dark:text-white",children:"ML Framework Dependencies"})]}),o.jsx(fe,{variant:"ghost",size:"sm",onClick:I,children:o.jsx(vi,{size:14})})]}),o.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mb-4",children:"Install ML frameworks on the server to enable model predictions"}),o.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:["keras","tensorflow","pytorch","sklearn","xgboost","onnx"].map(U=>o.jsxs("div",{className:"flex items-center justify-between p-3 bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700",children:[o.jsx("span",{className:"font-medium capitalize",children:U}),C[U]?o.jsxs(qe,{className:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",children:[o.jsx(_m,{size:12,className:"mr-1"}),"Installed"]}):O.has(U)?o.jsxs(qe,{className:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:[o.jsx(Sn,{size:12,className:"mr-1 animate-spin"}),"Installing..."]}):o.jsxs(fe,{size:"sm",variant:"ghost",onClick:()=>$(U),className:"text-blue-600 hover:bg-blue-50",children:[o.jsx(Oa,{size:14,className:"mr-1"}),"Install"]})]},U))})]})}),r.length===0?o.jsxs(Te,{className:"text-center py-16 bg-slate-50 dark:bg-slate-800/30",children:[o.jsx("div",{className:"mx-auto w-20 h-20 bg-gradient-to-br from-orange-100 to-red-100 dark:from-orange-900/20 dark:to-red-900/20 rounded-2xl flex items-center justify-center mb-6",children:o.jsx(No,{className:"text-orange-500",size:32})}),o.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-white mb-2",children:"No Deployments Yet"}),o.jsx("p",{className:"text-slate-500 max-w-md mx-auto mb-6",children:"Deploy your first model as an API endpoint to start testing predictions"}),o.jsxs(fe,{onClick:()=>u(!0),className:"bg-gradient-to-r from-orange-500 to-red-500",children:[o.jsx(rl,{size:16,className:"mr-2"}),"Create Your First Deployment"]})]}):o.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:r.map(U=>o.jsxs(Te,{className:"hover:shadow-lg transition-all duration-200",children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:`p-2 rounded-lg ${U.status==="running"?"bg-emerald-100 dark:bg-emerald-900/20":"bg-slate-100 dark:bg-slate-800"}`,children:o.jsx(No,{className:U.status==="running"?"text-emerald-600":"text-slate-500",size:20})}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-semibold text-slate-900 dark:text-white",children:U.name}),o.jsxs("p",{className:"text-xs text-slate-500",children:["ID: ",U.id.substring(0,8),"..."]})]})]}),o.jsx(qe,{className:W(U.status),children:o.jsxs("span",{className:"flex items-center gap-1",children:[K(U.status),U.status]})})]}),o.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800 rounded-lg p-3 mb-4",children:[o.jsxs("div",{className:"flex items-center justify-between mb-1",children:[o.jsx("span",{className:"text-xs font-medium text-slate-500",children:"Endpoint"}),o.jsx("button",{onClick:()=>L(U.endpoint_url+"/predict"),className:"p-1 hover:bg-slate-200 dark:hover:bg-slate-700 rounded",children:o.jsx(Pf,{size:12,className:"text-slate-500"})})]}),o.jsxs("code",{className:"text-sm text-primary-600 dark:text-primary-400",children:[U.endpoint_url,"/predict"]})]}),o.jsxs("div",{className:"bg-amber-50 dark:bg-amber-900/10 rounded-lg p-3 mb-4 border border-amber-200 dark:border-amber-800",children:[o.jsxs("div",{className:"flex items-center justify-between mb-1",children:[o.jsxs("span",{className:"text-xs font-medium text-amber-700 dark:text-amber-400 flex items-center gap-1",children:[o.jsx(wE,{size:12}),"API Token"]}),o.jsxs("div",{className:"flex gap-1",children:[o.jsx("button",{onClick:()=>B(U.id),className:"p-1 hover:bg-amber-200 dark:hover:bg-amber-800 rounded",children:h.has(U.id)?o.jsx(K8,{size:12}):o.jsx(ju,{size:12})}),o.jsx("button",{onClick:()=>L(U.api_token),className:"p-1 hover:bg-amber-200 dark:hover:bg-amber-800 rounded",children:o.jsx(Pf,{size:12})})]})]}),o.jsx("code",{className:"text-xs text-amber-800 dark:text-amber-300 font-mono",children:h.has(U.id)?U.api_token:Y(U.api_token)})]}),(U.expires_at||U.status==="running")&&o.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[U.expires_at&&o.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-purple-100 dark:bg-purple-900/20 rounded text-xs",children:[o.jsx(ht,{size:12,className:"text-purple-600"}),o.jsxs("span",{className:"font-medium text-purple-700 dark:text-purple-400",children:["TTL: ",X(U.expires_at)]})]}),U.status==="running"&&o.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-emerald-100 dark:bg-emerald-900/20 rounded text-xs",children:[o.jsx(_m,{size:12,className:"text-emerald-600"}),o.jsx("span",{className:"font-medium text-emerald-700 dark:text-emerald-400",children:"Healthy"})]}),U.status==="error"&&U.error_message&&o.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-rose-100 dark:bg-rose-900/20 rounded text-xs flex-1",children:[o.jsx(dn,{size:12,className:"text-rose-600"}),o.jsx("span",{className:"font-medium text-rose-700 dark:text-rose-400 truncate",children:U.error_message})]})]}),o.jsxs("div",{className:"flex gap-2",children:[U.status==="running"?o.jsxs(fe,{onClick:()=>q(U.id,"stop"),variant:"ghost",className:"flex-1 text-amber-600 hover:bg-amber-50",children:[o.jsx(EO,{size:14,className:"mr-1"}),"Stop"]}):U.status==="stopped"?o.jsxs(fe,{onClick:()=>q(U.id,"start"),variant:"ghost",className:"flex-1 text-emerald-600 hover:bg-emerald-50",children:[o.jsx(x0,{size:14,className:"mr-1"}),"Start"]}):null,o.jsxs(fe,{onClick:()=>Q(U),variant:"ghost",className:"flex-1",children:[o.jsx(nl,{size:14,className:"mr-1"}),"Logs"]}),o.jsx(fe,{onClick:()=>N(U.id),variant:"ghost",className:"text-rose-600 hover:bg-rose-50",children:o.jsx(Oi,{size:14})})]})]},U.id))}),c&&o.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:o.jsxs(Te,{className:"max-w-lg w-full max-h-[90vh] overflow-y-auto",children:[o.jsxs("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-6 flex items-center gap-2",children:[o.jsx(No,{className:"text-orange-500",size:24}),"New Deployment"]}),o.jsxs("form",{onSubmit:F,className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2",children:"Deployment Name"}),o.jsx("input",{type:"text",value:E.name,onChange:U=>R({...E,name:U.target.value}),placeholder:"e.g., My Model API",className:"w-full px-4 py-2 border border-slate-300 dark:border-slate-600 rounded-lg focus:ring-2 focus:ring-orange-500 bg-white dark:bg-slate-800 text-slate-900 dark:text-white",required:!0})]}),o.jsxs("div",{children:[o.jsxs("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2",children:["Model ",a.length>0&&o.jsxs("span",{className:"text-slate-400",children:["(",a.length," available)"]})]}),o.jsxs("div",{className:"relative",children:[o.jsx("input",{type:"text",placeholder:"Search models...",value:m,onChange:U=>g(U.target.value),onFocus:()=>x(!0),className:"w-full px-4 py-2 border border-slate-300 dark:border-slate-600 rounded-lg focus:ring-2 focus:ring-orange-500 bg-white dark:bg-slate-800 text-slate-900 dark:text-white"}),E.model_artifact_id&&o.jsxs("div",{className:"mt-1 px-2 py-1 bg-orange-100 dark:bg-orange-900/30 rounded text-sm text-orange-700 dark:text-orange-300 flex items-center justify-between",children:[o.jsxs("span",{children:["Selected: ",((ee=a.find(U=>U.artifact_id===E.model_artifact_id))==null?void 0:ee.name)||E.model_artifact_id]}),o.jsx("button",{type:"button",onClick:()=>R({...E,model_artifact_id:""}),className:"text-orange-500 hover:text-orange-700",children:"×"})]}),y&&o.jsxs("div",{className:"absolute z-50 w-full mt-1 max-h-60 overflow-y-auto bg-white dark:bg-slate-800 border border-slate-300 dark:border-slate-600 rounded-lg shadow-lg",children:[a.filter(U=>{var G,ae,ce;return((G=U.name)==null?void 0:G.toLowerCase().includes(m.toLowerCase()))||((ae=U.type)==null?void 0:ae.toLowerCase().includes(m.toLowerCase()))||((ce=U.project)==null?void 0:ce.toLowerCase().includes(m.toLowerCase()))}).slice(0,20).map(U=>o.jsxs("button",{type:"button",onClick:()=>{R({...E,model_artifact_id:U.artifact_id}),g(""),x(!1)},className:"w-full text-left px-4 py-2 hover:bg-slate-100 dark:hover:bg-slate-700 border-b border-slate-100 dark:border-slate-700 last:border-0",children:[o.jsxs("div",{className:"font-medium text-slate-900 dark:text-white flex items-center gap-2",children:[U.name,U.file_exists?o.jsx("span",{className:"px-1 py-0.5 text-xs bg-emerald-100 text-emerald-700 rounded",children:"Ready"}):U.has_file?o.jsx("span",{className:"px-1 py-0.5 text-xs bg-amber-100 text-amber-700 rounded",children:"Missing"}):o.jsx("span",{className:"px-1 py-0.5 text-xs bg-rose-100 text-rose-700 rounded",children:"No File"})]}),o.jsxs("div",{className:"text-xs text-slate-500 flex gap-2",children:[o.jsx("span",{className:"px-1 bg-slate-200 dark:bg-slate-600 rounded",children:U.type}),U.project&&o.jsx("span",{children:U.project})]})]},U.artifact_id)),a.filter(U=>{var G;return(G=U.name)==null?void 0:G.toLowerCase().includes(m.toLowerCase())}).length===0&&o.jsx("div",{className:"px-4 py-3 text-slate-500 text-center",children:"No models found"})]})]}),a.length===0&&o.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"No models available. Train a model first!"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2",children:"Port (optional)"}),o.jsx("input",{type:"number",value:E.port||"",onChange:U=>R({...E,port:U.target.value?parseInt(U.target.value):null}),placeholder:"Auto-assigned if empty",className:"w-full px-4 py-2 border border-slate-300 dark:border-slate-600 rounded-lg focus:ring-2 focus:ring-orange-500 bg-white dark:bg-slate-800 text-slate-900 dark:text-white"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2",children:"Auto-Destroy (TTL)"}),o.jsxs("select",{value:E.config.ttl_seconds||"",onChange:U=>R({...E,config:{...E.config,ttl_seconds:U.target.value?parseInt(U.target.value):null}}),className:"w-full px-4 py-2 border border-slate-300 dark:border-slate-600 rounded-lg focus:ring-2 focus:ring-orange-500 bg-white dark:bg-slate-800 text-slate-900 dark:text-white",children:[o.jsx("option",{value:"",children:"Never (keep running)"}),o.jsx("option",{value:"300",children:"5 minutes"}),o.jsx("option",{value:"900",children:"15 minutes"}),o.jsx("option",{value:"1800",children:"30 minutes"}),o.jsx("option",{value:"3600",children:"1 hour"}),o.jsx("option",{value:"7200",children:"2 hours"})]}),o.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Automatically stop deployment after selected time"})]}),o.jsxs("div",{className:"pt-4 flex gap-3 justify-end",children:[o.jsx(fe,{type:"button",variant:"ghost",onClick:()=>u(!1),children:"Cancel"}),o.jsxs(fe,{type:"submit",className:"bg-gradient-to-r from-orange-500 to-red-500",children:[o.jsx(No,{size:16,className:"mr-2"}),"Deploy"]})]})]})]})}),d&&o.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:o.jsxs(Te,{className:"max-w-2xl w-full max-h-[80vh] flex flex-col",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("h2",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(nl,{className:"text-orange-500",size:20}),"Logs: ",d.name]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(qe,{className:W(d.status),children:d.status}),o.jsx("button",{onClick:()=>{f(null),b([])},className:"p-1 hover:bg-slate-200 dark:hover:bg-slate-700 rounded",children:o.jsx(Tn,{size:20})})]})]}),o.jsx("div",{className:"flex-1 overflow-y-auto bg-slate-900 rounded-lg p-4 font-mono text-sm",children:j?o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(Sn,{className:"animate-spin text-slate-400",size:24})}):v.length===0?o.jsx("div",{className:"text-slate-500 text-center py-8",children:"No logs available"}):v.map((U,G)=>o.jsxs("div",{className:"mb-1 flex gap-2",children:[o.jsx("span",{className:"text-slate-500 shrink-0",children:new Date(U.timestamp).toLocaleTimeString()}),o.jsx("span",{className:`shrink-0 px-1 rounded text-xs font-bold ${U.level==="ERROR"?"bg-rose-900 text-rose-400":U.level==="WARN"?"bg-amber-900 text-amber-400":"bg-emerald-900 text-emerald-400"}`,children:U.level}),o.jsx("span",{className:"text-slate-300",children:U.message})]},G))}),o.jsxs("div",{className:"mt-4 flex justify-between",children:[o.jsxs(fe,{onClick:()=>Q(d),variant:"ghost",className:"flex items-center gap-2",children:[o.jsx(vi,{size:14}),"Refresh Logs"]}),o.jsx(fe,{onClick:()=>{f(null),b([])},variant:"ghost",children:"Close"})]})]})}),k&&o.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:o.jsxs(Te,{className:"max-w-sm w-full",children:[o.jsxs("h2",{className:"text-xl font-bold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[o.jsx(dn,{className:"text-rose-500",size:24}),"Delete Deployment"]}),o.jsx("p",{className:"text-slate-600 dark:text-slate-400 mb-6",children:"Are you sure you want to delete this deployment? This action cannot be undone."}),o.jsxs("div",{className:"flex gap-3 justify-end",children:[o.jsx(fe,{variant:"ghost",onClick:()=>N(null),children:"Cancel"}),o.jsxs(fe,{onClick:()=>V(k),className:"bg-rose-500 hover:bg-rose-600 text-white",children:[o.jsx(Oi,{size:14,className:"mr-2"}),"Delete"]})]})]})}),o.jsx("div",{className:"text-center pt-8 pb-4 border-t border-slate-200 dark:border-slate-700",children:o.jsxs("p",{className:"text-xs text-slate-400 dark:text-slate-500",children:["Made with ❤️ by ",o.jsx("span",{className:"font-medium text-primary-500",children:"UnicoLab"})]})})]})}const Lo=e=>e==null?"N/A":typeof e=="number"?e.toFixed(4):typeof e=="object"?JSON.stringify(e,null,2):String(e),ZTe=({value:e,onChange:t,error:r})=>{const[n,a]=S.useState(""),[i,s]=S.useState(null);S.useEffect(()=>{a(JSON.stringify(e,null,2))},[]);const l=c=>{const u=c.target.value;a(u);try{const d=JSON.parse(u);s(null),t(d)}catch(d){s(d.message)}};return o.jsxs("div",{className:"relative",children:[o.jsx("textarea",{value:n,onChange:l,className:`w-full h-48 p-3 font-mono text-sm rounded-lg border-2 transition-all
751
+ ${i?"border-rose-400 bg-rose-50 dark:bg-rose-900/10":"border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-900"}
752
+ focus:outline-none focus:ring-2 focus:ring-violet-500`,placeholder:"Enter JSON input..."}),i&&o.jsxs("div",{className:"absolute bottom-0 left-0 right-0 px-3 py-2 bg-rose-500 text-white text-xs rounded-b-lg",children:[o.jsx(dn,{size:12,className:"inline mr-1"}),i]})]})},QTe=({results:e,models:t})=>{var n,a,i;if(!e||e.length<2)return null;const r=Object.keys(((n=e[0])==null?void 0:n.outputs)||{});return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("h4",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(vE,{size:16,className:"text-violet-500"}),"Comparison Results"]}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-slate-100 dark:bg-slate-800",children:[o.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-600",children:"Metric"}),e.map((s,l)=>{var c;return o.jsx("th",{className:"px-4 py-2 text-center font-medium text-slate-600",children:((c=t[l])==null?void 0:c.name)||`Model ${l+1}`},l)}),o.jsx("th",{className:"px-4 py-2 text-center font-medium text-slate-600",children:"Δ Diff"})]})}),o.jsxs("tbody",{children:[r.map(s=>{var l,c,u,d;return o.jsxs("tr",{className:"border-b border-slate-200 dark:border-slate-700",children:[o.jsx("td",{className:"px-4 py-2 font-medium text-slate-700 dark:text-slate-300",children:s}),e.map((f,h)=>{var p;return o.jsx("td",{className:"px-4 py-2 text-center text-violet-600 dark:text-violet-400 font-mono",children:Lo((p=f.outputs)==null?void 0:p[s])},h)}),o.jsx("td",{className:"px-4 py-2 text-center font-mono",children:typeof((c=(l=e[0])==null?void 0:l.outputs)==null?void 0:c[s])=="number"&&typeof((d=(u=e[1])==null?void 0:u.outputs)==null?void 0:d[s])=="number"?o.jsxs("span",{className:e[0].outputs[s]>e[1].outputs[s]?"text-emerald-500":"text-rose-500",children:[((e[0].outputs[s]-e[1].outputs[s])*100/Math.max(Math.abs(e[1].outputs[s]),1e-4)).toFixed(2),"%"]}):"-"})]},s)}),o.jsxs("tr",{className:"bg-slate-50 dark:bg-slate-800/50",children:[o.jsx("td",{className:"px-4 py-2 font-medium text-slate-600",children:"Latency"}),e.map((s,l)=>{var c;return o.jsxs("td",{className:"px-4 py-2 text-center font-mono text-slate-500",children:[(c=s.latency_ms)==null?void 0:c.toFixed(2),"ms"]},l)}),o.jsx("td",{className:"px-4 py-2 text-center font-mono",children:(a=e[0])!=null&&a.latency_ms&&((i=e[1])!=null&&i.latency_ms)?o.jsxs("span",{className:e[0].latency_ms<e[1].latency_ms?"text-emerald-500":"text-rose-500",children:[((e[0].latency_ms-e[1].latency_ms)/e[1].latency_ms*100).toFixed(1),"%"]}):"-"})]})]})]})})]})},JTe=({data:e,title:t})=>{var n,a;if(!e||e.length===0)return null;const r=Math.max(...e.map(i=>Math.abs(i.value||i.prediction||0)));return o.jsxs("div",{className:"p-4 bg-gradient-to-br from-slate-50 to-violet-50 dark:from-slate-900 dark:to-violet-900/20 rounded-xl",children:[o.jsx("h4",{className:"text-sm font-medium text-slate-600 dark:text-slate-400 mb-4",children:t}),o.jsx("div",{className:"flex items-end gap-1 h-32",children:e.map((i,s)=>{const l=i.value||i.prediction||0,c=r>0?Math.abs(l)/r*100:50;return o.jsx(ge.div,{initial:{height:0},animate:{height:`${Math.max(c,5)}%`},transition:{duration:.5,delay:s*.05},className:`flex-1 rounded-t-md transition-all cursor-pointer group relative
753
+ ${l>=0?"bg-gradient-to-t from-violet-500 to-purple-400 hover:from-violet-600 hover:to-purple-500":"bg-gradient-to-t from-rose-500 to-pink-400 hover:from-rose-600 hover:to-pink-500"}`,title:`${i.label||s}: ${Lo(l)}`,children:o.jsx("div",{className:"absolute -top-8 left-1/2 transform -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity bg-slate-800 text-white text-xs px-2 py-1 rounded whitespace-nowrap",children:Lo(l)})},s)})}),o.jsxs("div",{className:"flex justify-between mt-2 text-xs text-slate-400",children:[o.jsx("span",{children:((n=e[0])==null?void 0:n.label)||"0"}),o.jsx("span",{children:((a=e[e.length-1])==null?void 0:a.label)||e.length-1})]})]})},eMe=({logs:e,onClose:t,deploymentId:r})=>o.jsxs(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},className:"bg-slate-900 rounded-xl border border-slate-700 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-slate-800 border-b border-slate-700",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(nl,{size:16,className:"text-emerald-400"}),o.jsx("span",{className:"text-sm font-medium text-white",children:"Deployment Logs"}),o.jsx(qe,{variant:"secondary",className:"text-xs",children:r})]}),o.jsx("button",{onClick:t,className:"text-slate-400 hover:text-white transition-colors",children:o.jsx(Tn,{size:16})})]}),o.jsx("div",{className:"h-48 overflow-y-auto p-3 font-mono text-xs space-y-1",children:e.length===0?o.jsx("div",{className:"text-slate-500 italic",children:"No logs available. Run a prediction to see logs."}):e.map((n,a)=>o.jsxs("div",{className:`flex gap-2 ${n.level==="ERROR"?"text-rose-400":n.level==="WARNING"?"text-amber-400":n.level==="INFO"?"text-emerald-400":"text-slate-400"}`,children:[o.jsx("span",{className:"text-slate-500 shrink-0",children:new Date(n.timestamp).toLocaleTimeString()}),o.jsx("span",{className:`font-semibold shrink-0 w-14 ${n.level==="ERROR"?"text-rose-500":n.level==="WARNING"?"text-amber-500":"text-emerald-500"}`,children:n.level}),o.jsx("span",{className:"text-slate-300",children:n.message})]},a))})]}),tMe=({modelInfo:e,onClose:t})=>e?o.jsxs(ge.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-gradient-to-br from-violet-50 to-purple-50 dark:from-slate-800 dark:to-violet-900/20 rounded-xl border border-violet-200 dark:border-violet-800 p-4",children:[o.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(yi,{size:16,className:"text-violet-500"}),o.jsx("span",{className:"text-sm font-semibold text-slate-800 dark:text-white",children:"Model Info"})]}),o.jsx("button",{onClick:t,className:"text-slate-400 hover:text-slate-600",children:o.jsx(Tn,{size:14})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[o.jsx("div",{className:"text-slate-500",children:"Framework"}),o.jsx("div",{className:"font-medium text-violet-600 dark:text-violet-400",children:e.framework}),e.input_shape&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-slate-500",children:"Input Shape"}),o.jsxs("div",{className:"font-mono text-slate-700 dark:text-slate-300",children:["[",e.input_shape.map(r=>r||"?").join(", "),"]"]})]}),e.input_features&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-slate-500",children:"Input Features"}),o.jsx("div",{className:"font-semibold text-emerald-600",children:e.input_features})]}),e.output_shape&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-slate-500",children:"Output Shape"}),o.jsxs("div",{className:"font-mono text-slate-700 dark:text-slate-300",children:["[",e.output_shape.map(r=>r||"?").join(", "),"]"]})]}),e.layer_count&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-slate-500",children:"Layers"}),o.jsx("div",{className:"text-slate-700 dark:text-slate-300",children:e.layer_count})]}),e.total_params&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-slate-500",children:"Parameters"}),o.jsx("div",{className:"text-slate-700 dark:text-slate-300",children:e.total_params.toLocaleString()})]})]})]}):null;function rMe(){var pt,jt,me,he,Ee,Pe,Je,vr,Er,Wr;const[e,t]=S.useState([]),[r,n]=S.useState([]),[a,i]=S.useState(null),[s,l]=S.useState({}),[c,u]=S.useState([]),[d,f]=S.useState([]),[h,p]=S.useState(null),[m,g]=S.useState(!0),[y,x]=S.useState(!1),[v,b]=S.useState(!1),[j,w]=S.useState("form"),[k,N]=S.useState("single"),[_,P]=S.useState(!1),[C,A]=S.useState(null),[O,T]=S.useState(!0),[E,R]=S.useState("internal"),[D,z]=S.useState(""),[I,$]=S.useState(""),[F,q]=S.useState(!1),[V,L]=S.useState(!1),[B,Y]=S.useState(""),[W,K]=S.useState(0),[Q,X]=S.useState(100),[ee,U]=S.useState(10),[G,ae]=S.useState([]),[ce,de]=S.useState(!1),[je,le]=S.useState(null);S.useEffect(()=>{se()},[]);const se=async()=>{try{const Ae=await(await fetch("/api/deployments/")).json(),Xe=(Array.isArray(Ae)?Ae:[]).filter(Ze=>Ze.status==="running");t(Xe),A(null)}catch(re){console.error("Failed to fetch deployments:",re),A("Failed to load deployments. Please check your connection.")}finally{g(!1)}},$e=async re=>{var Ae;try{const Xe=await fetch(`/api/explorer/model-info/${re}`);if(Xe.ok){const Ze=await Xe.json();if(le(Ze),Ze.input_features){const ut={};for(let Ct=0;Ct<Ze.input_features;Ct++){const Mn=((Ae=Ze.input_names)==null?void 0:Ae[Ct])||`feature_${Ct}`;ut[Mn]=.5}l(ut)}}}catch(Xe){console.error("Failed to fetch model info:",Xe)}},Pt=async re=>{try{const Ae=await fetch(`/api/explorer/logs/${re}?lines=50`);if(Ae.ok){const Xe=await Ae.json();ae(Xe.logs||[])}}catch(Ae){console.error("Failed to fetch logs:",Ae)}};S.useEffect(()=>{if(r.length>0&&ce){Pt(r[0].id);const re=setInterval(()=>{Pt(r[0].id)},2e3);return()=>clearInterval(re)}},[r,ce]);const st=async(re,Ae=!1)=>{var Xe,Ze,ut;k==="compare"&&Ae?r.length<2&&!r.find(Ct=>Ct.id===re.id)&&n(Ct=>[...Ct,re]):n([re]);try{const Mn=await(await fetch(`/api/explorer/schema/${re.model_artifact_id}`)).json();i(Mn),A(null);const Qa={};(Xe=Mn.inputs)==null||Xe.forEach(kt=>{kt.default!==null&&kt.default!==void 0?Qa[kt.name]=kt.default:kt.type==="number"?Qa[kt.name]=(kt.min_value||0)+((kt.max_value||100)-(kt.min_value||0))/2:kt.type==="integer"?Qa[kt.name]=Math.floor((kt.min_value||0)+((kt.max_value||100)-(kt.min_value||0))/2):(kt.type==="object"||kt.type==="array")&&(Qa[kt.name]=kt.default||{})}),l(Qa),Y(((ut=(Ze=Mn.inputs)==null?void 0:Ze.find(kt=>kt.type==="number"||kt.type==="integer"))==null?void 0:ut.name)||""),$e(re.id)}catch(Ct){console.error("Failed to fetch schema:",Ct),A("Failed to load model schema. Using default inputs.")}},xe=async()=>{if(r.length!==0){x(!0),A(null);try{const re=await Promise.all(r.map(async Ae=>{const Xe=Date.now(),Ze=await fetch("/api/explorer/predict",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deployment_id:Ae.id,inputs:s})}),ut=await Ze.json();if(!Ze.ok)throw new Error(ut.detail||"Prediction failed");return{...ut,model_name:Ae.name,source:"internal"}}));u(re),f(Ae=>[...re.map(Xe=>({...Xe,inputs:{...s}})),...Ae].slice(0,50))}catch(re){console.error("Prediction failed:",re),A(`Prediction failed: ${re.message}`)}finally{x(!1)}}},rt=async()=>{if(D){x(!0),A(null);try{const re=Date.now(),Ae={"Content-Type":"application/json"};I&&(Ae.Authorization=`Bearer ${I}`);const Ze=await(await fetch(D,{method:"POST",headers:Ae,body:JSON.stringify(s)})).json(),ut={id:Date.now().toString(),outputs:Ze.predictions||Ze.outputs||Ze,inputs:{...s},latency_ms:Date.now()-re,timestamp:new Date().toISOString(),source:"external"};u([ut]),f(Ct=>[ut,...Ct].slice(0,50))}catch(re){console.error("External prediction failed:",re),A(`External API call failed: ${re.message}`)}finally{x(!1)}}},Le=async()=>{if(!(r.length===0||!B)){b(!0),A(null);try{const re=[],Ae=(Q-W)/(ee-1);for(let ut=0;ut<ee;ut++)re.push(W+Ae*ut);const Xe=await fetch("/api/explorer/sweep",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deployment_id:r[0].id,base_inputs:s,sweep_param:B,sweep_values:re})}),Ze=await Xe.json();if(!Xe.ok)throw new Error(Ze.detail||"Sweep failed");p(Ze)}catch(re){console.error("Sweep failed:",re),A(`Parameter sweep failed: ${re.message}`)}finally{b(!1)}}},Me=(re,Ae)=>{l(Xe=>({...Xe,[re]:Ae}))},ur=()=>{navigator.clipboard.writeText(JSON.stringify(s,null,2)),P(!0),setTimeout(()=>P(!1),2e3)},Vt=re=>{l(re.inputs),u([re])};return m?o.jsx("div",{className:"flex items-center justify-center min-h-screen",children:o.jsxs("div",{className:"text-center",children:[o.jsx(Sn,{className:"w-12 h-12 animate-spin text-violet-500 mx-auto mb-4"}),o.jsx("p",{className:"text-slate-500",children:"Loading Model Explorer..."})]})}):o.jsxs("div",{className:"p-6 max-w-full mx-auto space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"p-3 bg-gradient-to-br from-violet-500 to-purple-600 rounded-xl text-white shadow-lg shadow-violet-500/20",children:o.jsx(nF,{size:28})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-3xl font-bold text-slate-900 dark:text-white",children:"Model Explorer"}),o.jsx("p",{className:"text-slate-500 dark:text-slate-400 mt-1",children:"Test, compare, and analyze ML models interactively"})]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex bg-slate-100 dark:bg-slate-800 rounded-lg p-1",children:[o.jsxs("button",{onClick:()=>{N("single"),n(r.slice(0,1))},className:`px-3 py-1.5 rounded-md text-sm font-medium transition-all flex items-center gap-1.5 ${k==="single"?"bg-white dark:bg-slate-700 text-violet-600 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:[o.jsx(jE,{size:14}),"Single"]}),o.jsxs("button",{onClick:()=>N("compare"),className:`px-3 py-1.5 rounded-md text-sm font-medium transition-all flex items-center gap-1.5 ${k==="compare"?"bg-white dark:bg-slate-700 text-violet-600 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:[o.jsx(vE,{size:14}),"Compare"]})]}),o.jsxs("div",{className:"flex bg-slate-100 dark:bg-slate-800 rounded-lg p-1",children:[o.jsxs("button",{onClick:()=>{R("internal"),L(!1)},className:`px-3 py-1.5 rounded-md text-sm font-medium transition-all flex items-center gap-1.5 ${E==="internal"?"bg-white dark:bg-slate-700 text-violet-600 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:[o.jsx(hn,{size:14}),"FlowyML"]}),o.jsxs("button",{onClick:()=>{R("external"),L(!0)},className:`px-3 py-1.5 rounded-md text-sm font-medium transition-all flex items-center gap-1.5 ${E==="external"?"bg-white dark:bg-slate-700 text-violet-600 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:[o.jsx(el,{size:14}),"External"]})]}),r.length>0&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("button",{onClick:()=>de(!ce),className:`p-2 rounded-lg transition-all ${ce?"bg-emerald-100 dark:bg-emerald-900/50 text-emerald-600":"bg-slate-100 dark:bg-slate-800 text-slate-500 hover:text-slate-700"}`,title:"Toggle Logs",children:o.jsx(nl,{size:16})}),o.jsx("button",{onClick:()=>le(je&&null),className:`p-2 rounded-lg transition-all ${je?"bg-violet-100 dark:bg-violet-900/50 text-violet-600":"bg-slate-100 dark:bg-slate-800 text-slate-500 hover:text-slate-700"}`,title:"Model Info",children:o.jsx(yi,{size:16})})]}),o.jsxs(fe,{onClick:se,variant:"ghost",className:"flex items-center gap-2",children:[o.jsx(vi,{size:16}),"Refresh"]})]})]}),o.jsx(Zt,{children:C&&o.jsxs(ge.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"bg-rose-50 dark:bg-rose-900/20 border border-rose-200 dark:border-rose-800 rounded-lg p-4 flex items-center gap-3",children:[o.jsx(dn,{className:"text-rose-500",size:20}),o.jsx("p",{className:"text-rose-700 dark:text-rose-400 text-sm flex-1",children:C}),o.jsx("button",{onClick:()=>A(null),className:"text-rose-500 hover:text-rose-700",children:"×"})]})}),o.jsx(Zt,{children:ce&&r.length>0&&o.jsx(eMe,{logs:G,deploymentId:(pt=r[0])==null?void 0:pt.id,onClose:()=>de(!1)})}),o.jsx(Zt,{children:je&&o.jsx(tMe,{modelInfo:je,onClose:()=>le(null)})}),o.jsx(Zt,{children:V&&o.jsx(ge.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:o.jsxs(Te,{className:"bg-gradient-to-r from-violet-50 to-purple-50 dark:from-violet-900/20 dark:to-purple-900/20 border-violet-200 dark:border-violet-800",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[o.jsx(el,{size:18,className:"text-violet-500"}),o.jsx("h3",{className:"font-semibold text-slate-900 dark:text-white",children:"External API Connection"}),F&&o.jsx(qe,{className:"bg-emerald-100 text-emerald-700 ml-2",children:"Connected"})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"md:col-span-2",children:[o.jsx("label",{className:"text-xs font-medium text-slate-500 mb-1 block",children:"Endpoint URL"}),o.jsx("input",{type:"url",value:D,onChange:re=>z(re.target.value),placeholder:"https://api.example.com/v1/predict",className:"w-full px-3 py-2 border border-slate-300 dark:border-slate-600 rounded-lg text-sm bg-white dark:bg-slate-800"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-medium text-slate-500 mb-1 block",children:"API Key (optional)"}),o.jsxs("div",{className:"relative",children:[o.jsx(g0,{size:14,className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-slate-400"}),o.jsx("input",{type:"password",value:I,onChange:re=>$(re.target.value),placeholder:"Bearer token...",className:"w-full pl-9 pr-3 py-2 border border-slate-300 dark:border-slate-600 rounded-lg text-sm bg-white dark:bg-slate-800"})]})]})]})]})})}),o.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[o.jsx(Zt,{children:O&&o.jsxs(ge.div,{initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},className:"col-span-12 lg:col-span-4 space-y-4",children:[o.jsxs(Te,{className:"border-2 border-slate-200 dark:border-slate-700",children:[o.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white mb-3 flex items-center gap-2",children:[o.jsx(Zr,{size:16,className:"text-violet-500"}),k==="compare"?"Select Models to Compare":"Select Model",k==="compare"&&o.jsxs(qe,{className:"bg-violet-100 text-violet-700 text-xs",children:[r.length,"/2"]})]}),e.length===0?o.jsxs("div",{className:"text-center py-8 text-slate-500",children:[o.jsx(hn,{size:32,className:"mx-auto mb-3 text-slate-300"}),o.jsx("p",{className:"text-sm font-medium",children:"No running deployments"}),o.jsx("a",{href:"/deployments",className:"text-sm text-violet-500 hover:underline mt-2 block",children:"Deploy a model first →"})]}):o.jsx("div",{className:"space-y-2",children:e.map(re=>o.jsxs(ge.button,{whileHover:{scale:1.01},whileTap:{scale:.99},onClick:()=>st(re,k==="compare"),className:`w-full text-left p-3 rounded-lg border-2 transition-all ${r.find(Ae=>Ae.id===re.id)?"border-violet-500 bg-violet-50 dark:bg-violet-900/20":"border-slate-200 dark:border-slate-700 hover:border-violet-300"}`,children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{className:"font-medium text-slate-900 dark:text-white",children:re.name}),r.find(Ae=>Ae.id===re.id)&&o.jsx(Ef,{size:16,className:"text-violet-500"})]}),o.jsx("div",{className:"text-xs text-slate-500 truncate",children:re.endpoint_url})]},re.id))})]}),(r.length>0||E==="external")&&o.jsxs(Te,{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white flex items-center gap-2",children:[o.jsx(RZ,{size:16,className:"text-violet-500"}),"Input Parameters"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{onClick:ur,className:"p-1.5 rounded-md hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",title:"Copy as JSON",children:_?o.jsx(Ef,{size:14,className:"text-emerald-500"}):o.jsx(Pf,{size:14,className:"text-slate-400"})}),o.jsxs("div",{className:"flex bg-slate-100 dark:bg-slate-800 rounded-md p-0.5",children:[o.jsx("button",{onClick:()=>w("form"),className:`p-1.5 rounded transition-all ${j==="form"?"bg-white dark:bg-slate-700 shadow-sm":""}`,title:"Form mode",children:o.jsx(Of,{size:14,className:j==="form"?"text-violet-500":"text-slate-400"})}),o.jsx("button",{onClick:()=>w("json"),className:`p-1.5 rounded transition-all ${j==="json"?"bg-white dark:bg-slate-700 shadow-sm":""}`,title:"JSON mode",children:o.jsx(yZ,{size:14,className:j==="json"?"text-violet-500":"text-slate-400"})})]})]})]}),j==="json"?o.jsx(ZTe,{value:s,onChange:l}):o.jsx("div",{className:"space-y-4 max-h-80 overflow-y-auto pr-2",children:((jt=a==null?void 0:a.inputs)==null?void 0:jt.map(re=>o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[o.jsxs("label",{className:"text-sm font-medium text-slate-700 dark:text-slate-300 flex items-center gap-1.5",children:[re.name,re.required&&o.jsx("span",{className:"text-rose-500",children:"*"})]}),o.jsx(qe,{variant:"secondary",className:"text-xs font-mono",children:Lo(s[re.name]).slice(0,20)})]}),re.type==="number"||re.type==="integer"?o.jsxs("div",{className:"space-y-1",children:[o.jsx("input",{type:"range",min:re.min_value||0,max:re.max_value||100,step:re.step||(re.type==="integer"?1:.1),value:s[re.name]||0,onChange:Ae=>Me(re.name,parseFloat(Ae.target.value)),className:"w-full h-2 bg-gradient-to-r from-violet-200 to-purple-200 dark:from-violet-900 dark:to-purple-900 rounded-lg appearance-none cursor-pointer"}),o.jsxs("div",{className:"flex justify-between text-xs text-slate-400",children:[o.jsx("span",{children:re.min_value||0}),o.jsx("input",{type:"number",value:s[re.name]||0,onChange:Ae=>Me(re.name,parseFloat(Ae.target.value)),className:"w-20 text-center px-2 py-0.5 border border-slate-200 dark:border-slate-700 rounded text-xs font-mono",step:re.step||(re.type==="integer"?1:.1)}),o.jsx("span",{children:re.max_value||100})]})]}):re.type==="boolean"?o.jsx("button",{onClick:()=>Me(re.name,!s[re.name]),className:`w-full py-2 rounded-lg text-sm font-medium transition-all ${s[re.name]?"bg-violet-500 text-white":"bg-slate-100 dark:bg-slate-800 text-slate-600"}`,children:s[re.name]?"True":"False"}):o.jsx("input",{type:"text",value:typeof s[re.name]=="object"?JSON.stringify(s[re.name]):s[re.name]||"",onChange:Ae=>{if(re.type==="object"||re.type==="array")try{Me(re.name,JSON.parse(Ae.target.value))}catch{Me(re.name,Ae.target.value)}else Me(re.name,Ae.target.value)},className:"w-full px-3 py-2 border border-slate-300 dark:border-slate-600 rounded-lg text-sm font-mono"}),re.description&&o.jsx("p",{className:"text-xs text-slate-400 mt-1",children:re.description})]},re.name)))||o.jsx("div",{className:"text-center py-4 text-slate-400 text-sm",children:"Enter inputs in JSON mode for external APIs"})}),o.jsxs(fe,{onClick:E==="external"?rt:xe,disabled:y,className:"w-full mt-4 bg-gradient-to-r from-violet-500 to-purple-600 hover:from-violet-600 hover:to-purple-700 shadow-lg shadow-violet-500/20",children:[y?o.jsx(Sn,{size:16,className:"mr-2 animate-spin"}):o.jsx(x0,{size:16,className:"mr-2"}),k==="compare"&&r.length>1?"Compare Models":"Run Prediction"]})]})]})}),o.jsxs("div",{className:`col-span-12 ${O?"lg:col-span-5":"lg:col-span-8"} space-y-4`,children:[o.jsx("button",{onClick:()=>T(!O),className:"lg:block hidden p-2 rounded-lg bg-slate-100 dark:bg-slate-800 hover:bg-slate-200 transition-colors",children:O?o.jsx(_Z,{size:16}):o.jsx(EZ,{size:16})}),c.length>0&&o.jsx(ge.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:o.jsxs(Te,{className:"bg-gradient-to-br from-violet-50 via-purple-50 to-pink-50 dark:from-violet-900/20 dark:via-purple-900/20 dark:to-pink-900/20 border-2 border-violet-200 dark:border-violet-800",children:[o.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[o.jsx(DZ,{size:16,className:"text-violet-500"}),k==="compare"&&c.length>1?"Comparison Results":"Prediction Result"]}),k==="compare"&&c.length>1?o.jsx(QTe,{results:c,models:r}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:Object.entries(((me=c[0])==null?void 0:me.outputs)||{}).map(([re,Ae])=>o.jsxs(ge.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"bg-white dark:bg-slate-800 rounded-xl p-4 shadow-sm border border-slate-100 dark:border-slate-700",children:[o.jsx("div",{className:"text-xs text-slate-500 mb-1 font-medium uppercase tracking-wide",children:re}),o.jsx("div",{className:"text-2xl font-bold text-violet-600 dark:text-violet-400 break-words",children:Lo(Ae)})]},re))}),o.jsxs("div",{className:"mt-4 flex items-center gap-4 text-xs text-slate-500",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Fe,{size:12,className:"text-emerald-500"}),(Ee=(he=c[0])==null?void 0:he.latency_ms)==null?void 0:Ee.toFixed(2),"ms"]}),o.jsxs("span",{children:["🕐 ",new Date((Pe=c[0])==null?void 0:Pe.timestamp).toLocaleTimeString()]}),((Je=c[0])==null?void 0:Je.source)==="external"&&o.jsx(qe,{className:"bg-blue-100 text-blue-700",children:"External"})]})]})]})}),r.length>0&&a&&o.jsxs(Te,{children:[o.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white mb-4 flex items-center gap-2",children:[o.jsx(Hr,{size:16,className:"text-violet-500"}),"Parameter Sensitivity Analysis"]}),o.jsxs("div",{className:"grid grid-cols-4 gap-3 mb-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-medium text-slate-500 mb-1 block",children:"Parameter"}),o.jsx("select",{value:B,onChange:re=>Y(re.target.value),className:"w-full px-3 py-2 border border-slate-300 dark:border-slate-600 rounded-lg text-sm bg-white dark:bg-slate-800",children:(vr=a.inputs)==null?void 0:vr.filter(re=>re.type==="number"||re.type==="integer").map(re=>o.jsx("option",{value:re.name,children:re.name},re.name))})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-medium text-slate-500 mb-1 block",children:"Min"}),o.jsx("input",{type:"number",value:W,onChange:re=>K(parseFloat(re.target.value)),className:"w-full px-3 py-2 border border-slate-300 dark:border-slate-600 rounded-lg text-sm"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-medium text-slate-500 mb-1 block",children:"Max"}),o.jsx("input",{type:"number",value:Q,onChange:re=>X(parseFloat(re.target.value)),className:"w-full px-3 py-2 border border-slate-300 dark:border-slate-600 rounded-lg text-sm"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-medium text-slate-500 mb-1 block",children:"Steps"}),o.jsx("input",{type:"number",value:ee,onChange:re=>U(parseInt(re.target.value)),min:2,max:50,className:"w-full px-3 py-2 border border-slate-300 dark:border-slate-600 rounded-lg text-sm"})]})]}),o.jsxs(fe,{onClick:Le,disabled:v||!B,variant:"ghost",className:"w-full border-2 border-dashed border-violet-300 hover:border-violet-500 hover:bg-violet-50",children:[v?o.jsx(Sn,{size:16,className:"mr-2 animate-spin"}):o.jsx(tl,{size:16,className:"mr-2"}),"Run Sensitivity Analysis"]}),h&&o.jsxs("div",{className:"mt-4",children:[o.jsx(JTe,{data:((Er=h.results)==null?void 0:Er.map((re,Ae)=>{var Xe,Ze;return{value:((Xe=re.outputs)==null?void 0:Xe.prediction)||0,label:(Ze=re.input_value)==null?void 0:Ze.toFixed(1)}}))||[],title:`${B} vs Prediction`}),o.jsxs("div",{className:"mt-2 text-xs text-slate-500 text-center",children:["Total sweep time: ",(Wr=h.total_latency_ms)==null?void 0:Wr.toFixed(2),"ms"]})]})]})]}),o.jsx("div",{className:"col-span-12 lg:col-span-3",children:o.jsxs(Te,{className:"sticky top-6",children:[o.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-white mb-3 flex items-center gap-2",children:[o.jsx(Xd,{size:16,className:"text-violet-500"}),"Prediction History",d.length>0&&o.jsx(qe,{className:"bg-slate-100 text-slate-600 text-xs",children:d.length})]}),d.length===0?o.jsxs("div",{className:"text-center py-12 text-slate-400",children:[o.jsx(Xd,{size:32,className:"mx-auto mb-3 opacity-30"}),o.jsx("p",{className:"text-sm",children:"No predictions yet"}),o.jsx("p",{className:"text-xs mt-1",children:"Run a prediction to see history"})]}):o.jsx("div",{className:"space-y-2 max-h-[500px] overflow-y-auto pr-1",children:d.map((re,Ae)=>{var Xe,Ze,ut;return o.jsxs(ge.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:Ae*.05},className:"p-3 bg-slate-50 dark:bg-slate-800 rounded-lg text-sm cursor-pointer hover:bg-violet-50 dark:hover:bg-violet-900/20 transition-colors group",onClick:()=>Vt(re),children:[o.jsxs("div",{className:"flex items-center justify-between mb-1",children:[o.jsx("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:(Ze=Lo(((Xe=re.outputs)==null?void 0:Xe.prediction)||Object.values(re.outputs||{})[0]))==null?void 0:Ze.slice(0,10)}),o.jsxs("span",{className:"text-xs text-slate-400 group-hover:text-violet-500 transition-colors",children:[(ut=re.latency_ms)==null?void 0:ut.toFixed(0),"ms"]})]}),o.jsx("div",{className:"text-xs text-slate-500 truncate",children:Object.entries(re.inputs||{}).slice(0,3).map(([Ct,Mn])=>`${Ct}=${Lo(Mn).slice(0,8)}`).join(", ")}),o.jsx("div",{className:"text-xs text-slate-400 mt-1",children:new Date(re.timestamp).toLocaleTimeString()})]},re.id||Ae)})}),d.length>0&&o.jsxs("div",{className:"flex gap-2 mt-4",children:[o.jsxs(fe,{onClick:()=>{const re=d.map(ut=>({...ut.inputs,...ut.outputs,latency_ms:ut.latency_ms,timestamp:ut.timestamp})),Ae=new Blob([JSON.stringify(re,null,2)],{type:"application/json"}),Xe=URL.createObjectURL(Ae),Ze=document.createElement("a");Ze.href=Xe,Ze.download="prediction_history.json",Ze.click()},variant:"ghost",className:"flex-1 text-xs",children:[o.jsx(Oa,{size:12,className:"mr-1"}),"Export"]}),o.jsxs(fe,{onClick:()=>f([]),variant:"ghost",className:"flex-1 text-xs text-rose-500 hover:bg-rose-50",children:[o.jsx(Oi,{size:12,className:"mr-1"}),"Clear"]})]})]})})]}),o.jsx("div",{className:"text-center pt-8 pb-4 border-t border-slate-200 dark:border-slate-700",children:o.jsxs("p",{className:"text-xs text-slate-400 dark:text-slate-500",children:["Made with ❤️ by ",o.jsx("span",{className:"font-medium text-violet-500",children:"UnicoLab"})]})})]})}const nMe=FX([{path:"/",element:o.jsx(lne,{}),children:[{index:!0,element:o.jsx(Sae,{})},{path:"pipelines",element:o.jsx(Aae,{})},{path:"runs",element:o.jsx($0e,{})},{path:"compare",element:o.jsx(KTe,{})},{path:"runs/:runId",element:o.jsx(xOe,{})},{path:"assets",element:o.jsx(aTe,{})},{path:"experiments",element:o.jsx(pTe,{})},{path:"experiments/compare",element:o.jsx(YTe,{})},{path:"experiments/:experimentId",element:o.jsx(mTe,{})},{path:"traces",element:o.jsx(yTe,{})},{path:"projects",element:o.jsx(vTe,{})},{path:"projects/:projectId",element:o.jsx(CTe,{})},{path:"schedules",element:o.jsx(OTe,{})},{path:"observability",element:o.jsx(TTe,{})},{path:"leaderboard",element:o.jsx(MTe,{})},{path:"plugins",element:o.jsx(FTe,{})},{path:"settings",element:o.jsx(BTe,{})},{path:"tokens",element:o.jsx(VTe,{})},{path:"deployments",element:o.jsx(XTe,{})},{path:"model-explorer",element:o.jsx(rMe,{})}]}]);function aMe(){return o.jsx(nZ,{children:o.jsx(iZ,{children:o.jsx(vre,{children:o.jsx(KX,{router:nMe})})})})}r2.createRoot(document.getElementById("root")).render(o.jsx(M.StrictMode,{children:o.jsx(aMe,{})}));