@winspan/claude-forge 3.6.26 → 3.6.39

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 (169) hide show
  1. package/dist/autopilot/issue-tracker.js +1 -1
  2. package/dist/autopilot/issue-tracker.js.map +1 -1
  3. package/dist/autopilot/quality-gate.d.ts +20 -2
  4. package/dist/autopilot/quality-gate.d.ts.map +1 -1
  5. package/dist/autopilot/quality-gate.js +20 -2
  6. package/dist/autopilot/quality-gate.js.map +1 -1
  7. package/dist/cli/commands/logs.js +1 -1
  8. package/dist/cli/commands/logs.js.map +1 -1
  9. package/dist/config/defaults.d.ts.map +1 -1
  10. package/dist/config/defaults.js +5 -0
  11. package/dist/config/defaults.js.map +1 -1
  12. package/dist/config/schema.d.ts +9 -1
  13. package/dist/config/schema.d.ts.map +1 -1
  14. package/dist/config/schema.js +5 -0
  15. package/dist/config/schema.js.map +1 -1
  16. package/dist/convention/convention-loader.d.ts.map +1 -1
  17. package/dist/convention/convention-loader.js +3 -0
  18. package/dist/convention/convention-loader.js.map +1 -1
  19. package/dist/daemon/handlers/stages/07-pipeline-reply.d.ts.map +1 -1
  20. package/dist/daemon/handlers/stages/07-pipeline-reply.js +3 -0
  21. package/dist/daemon/handlers/stages/07-pipeline-reply.js.map +1 -1
  22. package/dist/daemon/handlers/stages/18-complex-task.d.ts.map +1 -1
  23. package/dist/daemon/handlers/stages/18-complex-task.js +3 -0
  24. package/dist/daemon/handlers/stages/18-complex-task.js.map +1 -1
  25. package/dist/daemon/handlers/stages/19-moderate-task.d.ts.map +1 -1
  26. package/dist/daemon/handlers/stages/19-moderate-task.js +3 -0
  27. package/dist/daemon/handlers/stages/19-moderate-task.js.map +1 -1
  28. package/dist/daemon/index.d.ts.map +1 -1
  29. package/dist/daemon/index.js +81 -0
  30. package/dist/daemon/index.js.map +1 -1
  31. package/dist/pipeline/dynamic-node-types.d.ts +2 -0
  32. package/dist/pipeline/dynamic-node-types.d.ts.map +1 -1
  33. package/dist/pipeline/index.d.ts +27 -1
  34. package/dist/pipeline/index.d.ts.map +1 -1
  35. package/dist/pipeline/index.js +87 -72
  36. package/dist/pipeline/index.js.map +1 -1
  37. package/dist/pipeline/pipeline-state-machine.d.ts +19 -0
  38. package/dist/pipeline/pipeline-state-machine.d.ts.map +1 -0
  39. package/dist/pipeline/pipeline-state-machine.js +53 -0
  40. package/dist/pipeline/pipeline-state-machine.js.map +1 -0
  41. package/dist/pipeline/template-registry.d.ts.map +1 -1
  42. package/dist/pipeline/template-registry.js +4 -1
  43. package/dist/pipeline/template-registry.js.map +1 -1
  44. package/dist/storage/repositories/base-repository.d.ts +2 -0
  45. package/dist/storage/repositories/base-repository.d.ts.map +1 -1
  46. package/dist/storage/repositories/base-repository.js +12 -0
  47. package/dist/storage/repositories/base-repository.js.map +1 -1
  48. package/dist/storage/repositories/dynamic-pipeline-repository.d.ts +11 -4
  49. package/dist/storage/repositories/dynamic-pipeline-repository.d.ts.map +1 -1
  50. package/dist/storage/repositories/dynamic-pipeline-repository.js +41 -14
  51. package/dist/storage/repositories/dynamic-pipeline-repository.js.map +1 -1
  52. package/dist/storage/repositories/dynamic-pipeline-template-repository.d.ts +13 -0
  53. package/dist/storage/repositories/dynamic-pipeline-template-repository.d.ts.map +1 -0
  54. package/dist/storage/repositories/dynamic-pipeline-template-repository.js +117 -0
  55. package/dist/storage/repositories/dynamic-pipeline-template-repository.js.map +1 -0
  56. package/dist/storage/repositories/event-repository.d.ts.map +1 -1
  57. package/dist/storage/repositories/event-repository.js +3 -3
  58. package/dist/storage/repositories/event-repository.js.map +1 -1
  59. package/dist/storage/repositories/latency-repository.js +1 -1
  60. package/dist/storage/repositories/latency-repository.js.map +1 -1
  61. package/dist/storage/repositories/maintenance-repository.d.ts.map +1 -1
  62. package/dist/storage/repositories/maintenance-repository.js +1 -0
  63. package/dist/storage/repositories/maintenance-repository.js.map +1 -1
  64. package/dist/storage/repositories/quality-repository.d.ts +16 -0
  65. package/dist/storage/repositories/quality-repository.d.ts.map +1 -0
  66. package/dist/storage/repositories/quality-repository.js +36 -0
  67. package/dist/storage/repositories/quality-repository.js.map +1 -0
  68. package/dist/storage/repositories/session-repository.d.ts +7 -0
  69. package/dist/storage/repositories/session-repository.d.ts.map +1 -1
  70. package/dist/storage/repositories/session-repository.js +33 -0
  71. package/dist/storage/repositories/session-repository.js.map +1 -1
  72. package/dist/storage/schema/migration-manager.d.ts +1 -1
  73. package/dist/storage/schema/migration-manager.d.ts.map +1 -1
  74. package/dist/storage/schema/migration-manager.js +27 -1
  75. package/dist/storage/schema/migration-manager.js.map +1 -1
  76. package/dist/storage/sqlite.d.ts +13 -0
  77. package/dist/storage/sqlite.d.ts.map +1 -1
  78. package/dist/storage/sqlite.js +92 -31
  79. package/dist/storage/sqlite.js.map +1 -1
  80. package/dist/types/session.d.ts +3 -0
  81. package/dist/types/session.d.ts.map +1 -1
  82. package/dist/utils/logger.d.ts +4 -4
  83. package/dist/utils/logger.d.ts.map +1 -1
  84. package/dist/utils/logger.js +24 -10
  85. package/dist/utils/logger.js.map +1 -1
  86. package/dist/web/routes/config.d.ts +2 -0
  87. package/dist/web/routes/config.d.ts.map +1 -1
  88. package/dist/web/routes/config.js +58 -3
  89. package/dist/web/routes/config.js.map +1 -1
  90. package/dist/web/routes/events.d.ts.map +1 -1
  91. package/dist/web/routes/events.js +4 -5
  92. package/dist/web/routes/events.js.map +1 -1
  93. package/dist/web/routes/knowledge.d.ts.map +1 -1
  94. package/dist/web/routes/knowledge.js +51 -8
  95. package/dist/web/routes/knowledge.js.map +1 -1
  96. package/dist/web/routes/pipelines.d.ts.map +1 -1
  97. package/dist/web/routes/pipelines.js +79 -5
  98. package/dist/web/routes/pipelines.js.map +1 -1
  99. package/dist/web/routes/projects.d.ts.map +1 -1
  100. package/dist/web/routes/projects.js +1 -2
  101. package/dist/web/routes/projects.js.map +1 -1
  102. package/dist/web/routes/quality.d.ts.map +1 -1
  103. package/dist/web/routes/quality.js +16 -19
  104. package/dist/web/routes/quality.js.map +1 -1
  105. package/dist/web/routes/sessions.d.ts.map +1 -1
  106. package/dist/web/routes/sessions.js +44 -21
  107. package/dist/web/routes/sessions.js.map +1 -1
  108. package/dist/web/routes/skills.d.ts.map +1 -1
  109. package/dist/web/routes/skills.js +16 -10
  110. package/dist/web/routes/skills.js.map +1 -1
  111. package/dist/web/routes/stats.d.ts.map +1 -1
  112. package/dist/web/routes/stats.js +53 -2
  113. package/dist/web/routes/stats.js.map +1 -1
  114. package/dist/web/server.d.ts.map +1 -1
  115. package/dist/web/server.js +113 -26
  116. package/dist/web/server.js.map +1 -1
  117. package/dist/web/sse-broadcaster.d.ts +23 -0
  118. package/dist/web/sse-broadcaster.d.ts.map +1 -0
  119. package/dist/web/sse-broadcaster.js +73 -0
  120. package/dist/web/sse-broadcaster.js.map +1 -0
  121. package/dist/web/utils/error-response.d.ts +23 -0
  122. package/dist/web/utils/error-response.d.ts.map +1 -0
  123. package/dist/web/utils/error-response.js +26 -0
  124. package/dist/web/utils/error-response.js.map +1 -0
  125. package/dist/web/utils/validation.d.ts +56 -3
  126. package/dist/web/utils/validation.d.ts.map +1 -1
  127. package/dist/web/utils/validation.js +88 -4
  128. package/dist/web/utils/validation.js.map +1 -1
  129. package/dist/web-static/assets/Analytics-BTMAlQBr.js +1 -0
  130. package/dist/web-static/assets/BatchProgress-CIrC9RcC.js +1 -0
  131. package/dist/web-static/assets/Breadcrumb-DbDeWYcH.js +1 -0
  132. package/dist/web-static/assets/Config-yTRFpmlP.js +1 -0
  133. package/dist/web-static/assets/ConfirmDialog-CH1HyRaY.js +1 -0
  134. package/dist/web-static/assets/Conventions-DaqIk41m.js +1 -0
  135. package/dist/web-static/assets/Dashboard-BS61GjKa.js +1 -0
  136. package/dist/web-static/assets/ErrorState-HW0OjEYK.js +1 -0
  137. package/dist/web-static/assets/Events-DAms_1fs.js +1 -0
  138. package/dist/web-static/assets/Knowledge-CZhuou1K.js +2 -0
  139. package/dist/web-static/assets/NodeTypes-B5E6NYKn.js +1 -0
  140. package/dist/web-static/assets/Pagination-ooTI9JPa.js +1 -0
  141. package/dist/web-static/assets/PipelineDetail-DCnqD5lr.js +4 -0
  142. package/dist/web-static/assets/PipelineTemplates-CxGoLw6Q.js +1 -0
  143. package/dist/web-static/assets/Pipelines-DEuVx4hF.js +2 -0
  144. package/dist/web-static/assets/ProjectDetail-Dn01H3zi.js +1 -0
  145. package/dist/web-static/assets/Projects-D5-BfuFU.js +1 -0
  146. package/dist/web-static/assets/Quality-wvfdPtGB.js +3 -0
  147. package/dist/web-static/assets/SessionDetail-DleCNmQH.js +1 -0
  148. package/dist/web-static/assets/Sessions-Dz6xFq_4.js +2 -0
  149. package/dist/web-static/assets/Skills-CpHL-tyW.js +1 -0
  150. package/dist/web-static/assets/client-B_-7qCOP.js +1 -0
  151. package/dist/web-static/assets/exportCsv-CSExJI8h.js +3 -0
  152. package/dist/web-static/assets/index-CN_edVMt.js +2 -0
  153. package/dist/web-static/assets/index-DLMLziRH.css +2 -0
  154. package/dist/web-static/assets/rolldown-runtime-COnpUsM8.js +1 -0
  155. package/dist/web-static/assets/ui-B2gvOcFY.js +1 -0
  156. package/dist/web-static/assets/useDebounce-Bo1fLB5L.js +1 -0
  157. package/dist/web-static/assets/useSmartPolling-DYAVOihL.js +1 -0
  158. package/dist/web-static/assets/vendor-BpBCrKSP.js +9 -0
  159. package/dist/web-static/assets/vendor-charts-BXsEmmv5.js +36 -0
  160. package/dist/web-static/assets/vendor-editor-DYIoTHFO.js +11 -0
  161. package/dist/web-static/assets/vendor-flow-CHpVij2M.css +1 -0
  162. package/dist/web-static/assets/vendor-flow-D-_WxBha.js +7 -0
  163. package/dist/web-static/assets/vendor-motion-BsfSkSjj.js +9 -0
  164. package/dist/web-static/assets/vendor-query-BF-uT_c5.js +4 -0
  165. package/dist/web-static/assets/vendor-react-CXfI0Tes.js +11 -0
  166. package/dist/web-static/index.html +13 -2
  167. package/package.json +1 -1
  168. package/dist/web-static/assets/index-DL3sxp0u.js +0 -87
  169. package/dist/web-static/assets/index-DwWCJY_u.css +0 -1
@@ -1,87 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ee(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ne={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),p=s(((e,t)=>{t.exports=f()})),m=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),h=s(((e,t)=>{t.exports=m()})),g=s((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),_=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=s((e=>{var t=h(),n=p(),r=_();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,m=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function ee(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var te=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function F(e){return{current:e}}function I(e){0>ae||(e.current=ie[ae],ie[ae]=null,ae--)}function oe(e,t){ae++,ie[ae]=e.current,e.current=t}var se=F(null),ce=F(null),le=F(null),ue=F(null);function de(e,t){switch(oe(le,t),oe(ce,e),oe(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Xd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Xd(t),e=Zd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(se),oe(se,e)}function fe(){I(se),I(ce),I(le)}function pe(e){e.memoizedState!==null&&oe(ue,e);var t=se.current,n=Zd(t,e.type);t!==n&&(oe(ce,e),oe(se,n))}function me(e){ce.current===e&&(I(se),I(ce)),ue.current===e&&(I(ue),ip._currentValue=re)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
- `),l=s.split(`
5
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function Re(e){if(typeof Pe==`function`&&Fe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function L(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function R(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Je(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-ze(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function et(e,t){var n=t&-t;return n=n&42?1:tt(n),(n&(e.suspendedLanes|t))===0?n:0}function tt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function nt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function rt(){var e=ne.p;return e===0?(e=window.event,e===void 0?32:bp(e.type)):e}function it(e,t){var n=ne.p;try{return ne.p=e,t()}finally{ne.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,st=`__reactProps$`+at,ct=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,z=`__reactHandles$`+at,dt=`__reactResources$`+at,ft=`__reactMarker$`+at;function pt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[z]}function mt(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vf(e);e!==null;){if(n=e[ot])return n;e=vf(e)}return t}e=n,n=e.parentNode}return null}function ht(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function _t(e){var t=e[dt];return t||=e[dt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function vt(e){e[ft]=!0}var yt=new Set,bt={};function xt(e,t){St(e,t),St(e+`Capture`,t)}function St(e,t){for(bt[e]=t,e=0;e<t.length;e++)yt.add(t[e])}var Ct=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),wt={},Tt={};function Et(e){return Se.call(Tt,e)?!0:Se.call(wt,e)?!1:Ct.test(e)?Tt[e]=!0:(wt[e]=!0,!1)}function Dt(e,t,n){if(Et(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Ot(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function kt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function At(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Mt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Nt(e){if(!e._valueTracker){var t=jt(e)?`checked`:`value`;e._valueTracker=Mt(e,t,``+e[t])}}function Pt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=jt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ft(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var It=/[\n"\\]/g;function Lt(e){return e.replace(It,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Rt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+At(t)):e.value!==``+At(t)&&(e.value=``+At(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Bt(e,o,At(n)):Bt(e,o,At(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+At(s):e.removeAttribute(`name`)}function zt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Nt(e);return}n=n==null?``:``+At(n),t=t==null?n:``+At(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Nt(e)}function Bt(e,t,n){t===`number`&&Ft(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Vt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+At(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ht(e,t,n){if(t!=null&&(t=``+At(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+At(n)}function Ut(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(te(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=At(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Nt(e)}function Wt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Kt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Gt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function qt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Kt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Kt(e,o,t[o])}function Jt(e){if(e.indexOf(`-`)===-1)return!1;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 Yt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Xt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Zt(e){return Xt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Qt(){}var $t=null;function en(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tn=null,nn=null;function rn(e){var t=ht(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Rt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Lt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[st]||null;if(!a)throw Error(i(90));Rt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Pt(r)}break a;case`textarea`:Ht(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Vt(e,!!n.multiple,t,!1)}}}var an=!1;function on(e,t,n){if(an)return e(t,n);an=!0;try{return e(t)}finally{if(an=!1,(tn!==null||nn!==null)&&(Du(),tn&&(t=tn,e=nn,nn=tn=null,rn(t),e)))for(t=0;t<e.length;t++)rn(e[t])}}function sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var cn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),ln=!1;if(cn)try{var un={};Object.defineProperty(un,`passive`,{get:function(){ln=!0}}),window.addEventListener(`test`,un,un),window.removeEventListener(`test`,un,un)}catch{ln=!1}var dn=null,fn=null,pn=null;function mn(){if(pn)return pn;var e,t=fn,n=t.length,r,i=`value`in dn?dn.value:dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return pn=i.slice(e,1<r?1-r:void 0)}function hn(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 gn(){return!0}function _n(){return!1}function vn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?gn:_n,this.isPropagationStopped=_n,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=gn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=gn)},persist:function(){},isPersistent:gn}),t}var yn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bn=vn(yn),xn=f({},yn,{view:0,detail:0}),Sn=vn(xn),Cn,wn,Tn,En=f({},xn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ln,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!==Tn&&(Tn&&e.type===`mousemove`?(Cn=e.screenX-Tn.screenX,wn=e.screenY-Tn.screenY):wn=Cn=0,Tn=e),Cn)},movementY:function(e){return`movementY`in e?e.movementY:wn}}),Dn=vn(En),On=vn(f({},En,{dataTransfer:0})),kn=vn(f({},xn,{relatedTarget:0})),An=vn(f({},yn,{animationName:0,elapsedTime:0,pseudoElement:0})),jn=vn(f({},yn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Mn=vn(f({},yn,{data:0})),Nn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Pn={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`},Fn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function In(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fn[e])?!!t[e]:!1}function Ln(){return In}var Rn=vn(f({},xn,{key:function(e){if(e.key){var t=Nn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=hn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Pn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ln,charCode:function(e){return e.type===`keypress`?hn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?hn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),zn=vn(f({},En,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Bn=vn(f({},xn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ln})),Vn=vn(f({},yn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Hn=vn(f({},En,{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})),Un=vn(f({},yn,{newState:0,oldState:0})),Wn=[9,13,27,32],Gn=cn&&`CompositionEvent`in window,Kn=null;cn&&`documentMode`in document&&(Kn=document.documentMode);var qn=cn&&`TextEvent`in window&&!Kn,Jn=cn&&(!Gn||Kn&&8<Kn&&11>=Kn),Yn=` `,Xn=!1;function Zn(e,t){switch(e){case`keyup`:return Wn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var $n=!1;function er(e,t){switch(e){case`compositionend`:return Qn(t);case`keypress`:return t.which===32?(Xn=!0,Yn):null;case`textInput`:return e=t.data,e===Yn&&Xn?null:e;default:return null}}function tr(e,t){if($n)return e===`compositionend`||!Gn&&Zn(e,t)?(e=mn(),pn=fn=dn=null,$n=!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 Jn&&t.locale!==`ko`?null:t.data;default:return null}}var nr={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 rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!nr[e.type]:t===`textarea`}function ir(e,t,n,r){tn?nn?nn.push(r):nn=[r]:tn=r,t=Fd(t,`onChange`),0<t.length&&(n=new bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ar=null,or=null;function sr(e){Dd(e,0)}function cr(e){if(Pt(gt(e)))return e}function lr(e,t){if(e===`change`)return t}var ur=!1;if(cn){var dr;if(cn){var fr=`oninput`in document;if(!fr){var pr=document.createElement(`div`);pr.setAttribute(`oninput`,`return;`),fr=typeof pr.oninput==`function`}dr=fr}else dr=!1;ur=dr&&(!document.documentMode||9<document.documentMode)}function mr(){ar&&(ar.detachEvent(`onpropertychange`,hr),or=ar=null)}function hr(e){if(e.propertyName===`value`&&cr(or)){var t=[];ir(t,or,e,en(e)),on(sr,t)}}function gr(e,t,n){e===`focusin`?(mr(),ar=t,or=n,ar.attachEvent(`onpropertychange`,hr)):e===`focusout`&&mr()}function _r(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return cr(or)}function vr(e,t){if(e===`click`)return cr(t)}function yr(e,t){if(e===`input`||e===`change`)return cr(t)}function br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var xr=typeof Object.is==`function`?Object.is:br;function Sr(e,t){if(xr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Se.call(t,i)||!xr(e[i],t[i]))return!1}return!0}function Cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wr(e,t){var n=Cr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Cr(n)}}function Tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Er(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ft(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ft(e.document)}return t}function Dr(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`)}var Or=cn&&`documentMode`in document&&11>=document.documentMode,kr=null,Ar=null,jr=null,Mr=!1;function Nr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mr||kr==null||kr!==Ft(r)||(r=kr,`selectionStart`in r&&Dr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jr&&Sr(jr,r)||(jr=r,r=Fd(Ar,`onSelect`),0<r.length&&(t=new bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=kr)))}function Pr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Fr={animationend:Pr(`Animation`,`AnimationEnd`),animationiteration:Pr(`Animation`,`AnimationIteration`),animationstart:Pr(`Animation`,`AnimationStart`),transitionrun:Pr(`Transition`,`TransitionRun`),transitionstart:Pr(`Transition`,`TransitionStart`),transitioncancel:Pr(`Transition`,`TransitionCancel`),transitionend:Pr(`Transition`,`TransitionEnd`)},Ir={},Lr={};cn&&(Lr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),`TransitionEvent`in window||delete Fr.transitionend.transition);function Rr(e){if(Ir[e])return Ir[e];if(!Fr[e])return e;var t=Fr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Ir[e]=t[n];return e}var zr=Rr(`animationend`),Br=Rr(`animationiteration`),Vr=Rr(`animationstart`),Hr=Rr(`transitionrun`),Ur=Rr(`transitionstart`),Wr=Rr(`transitioncancel`),Gr=Rr(`transitionend`),Kr=new Map,qr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);qr.push(`scrollEnd`);function Jr(e,t){Kr.set(e,t),xt(t,[e])}var Yr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Xr=[],Zr=0,Qr=0;function $r(){for(var e=Zr,t=Qr=Zr=0;t<e;){var n=Xr[t];Xr[t++]=null;var r=Xr[t];Xr[t++]=null;var i=Xr[t];Xr[t++]=null;var a=Xr[t];if(Xr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ri(n,i,a)}}function ei(e,t,n,r){Xr[Zr++]=e,Xr[Zr++]=t,Xr[Zr++]=n,Xr[Zr++]=r,Qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ti(e,t,n,r){return ei(e,t,n,r),ii(e)}function ni(e,t){return ei(e,null,null,t),ii(e)}function ri(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ii(e){if(50<vu)throw vu=0,yu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ai={};function oi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(e,t,n,r){return new oi(e,t,n,r)}function ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var n=e.alternate;return n===null?(n=si(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ui(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function di(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ci(e)&&(s=1);else if(typeof e==`string`)s=Yf(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=si(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return fi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=si(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=si(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=si(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=si(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=si(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=si(6,e,null,t),e.lanes=n,e}function mi(e){var t=si(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-ze(r)-1;r&=~(1<<i),n+=1;var a=32-ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-ze(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,Ni=null,Pi=!1,Fi=null,Ii=!1,Li=Error(i(519));function Ri(e){throw Wi(_i(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Li}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[st]=r,n){case`dialog`:Od(`cancel`,t),Od(`close`,t);break;case`iframe`:case`object`:case`embed`:Od(`load`,t);break;case`video`:case`audio`:for(n=0;n<Td.length;n++)Od(Td[n],t);break;case`source`:Od(`error`,t);break;case`img`:case`image`:case`link`:Od(`error`,t),Od(`load`,t);break;case`details`:Od(`toggle`,t);break;case`input`:Od(`invalid`,t),zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Od(`invalid`,t);break;case`textarea`:Od(`invalid`,t),Ut(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Vd(t.textContent,n)?(r.popover!=null&&(Od(`beforetoggle`,t),Od(`toggle`,t)),r.onScroll!=null&&Od(`scroll`,t),r.onScrollEnd!=null&&Od(`scrollend`,t),r.onClick!=null&&(t.onclick=Qt),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:Mi=Mi.return}}function Vi(e){if(e!==Mi)return!1;if(!Pi)return Bi(e),Pi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||G(e.type,e.memoizedProps)),n=!n),n&&Ni&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=_f(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=_f(e)}else t===27?(t=Ni,K(e.type)?(e=gf,gf=null,Ni=e):Ni=t):Ni=Mi?hf(e.stateNode.nextSibling):null;return!0}function Hi(){Ni=Mi=null,Pi=!1}function Ui(){var e=Fi;return e!==null&&(iu===null?iu=e:iu.push.apply(iu,e),Fi=null),e}function Wi(e){Fi===null?Fi=[e]:Fi.push(e)}var Gi=F(null),Ki=null,qi=null;function Ji(e,t,n){oe(Gi,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Gi.current,I(Gi)}function Xi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Zi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Xi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Xi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Qi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;xr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ip]:e.push(ip))}a=a.return}e!==null&&Zi(t,e,n,r),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!xr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ta(e){return ra(Ki,e)}function na(e,t){return Ki===null&&ea(e),ra(e,t)}function ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(i(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ia=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},aa=t.unstable_scheduleCallback,oa=t.unstable_NormalPriority,sa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ca(){return{controller:new ia,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&aa(oa,function(){e.controller.abort()})}var ua=null,da=0,fa=0,pa=null;function ma(e,t){if(ua===null){var n=ua=[];da=0,fa=yd(),pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return da++,t.then(ha,ha),t}function ha(){if(--da===0&&ua!==null){pa!==null&&(pa.status=`fulfilled`);var e=ua;ua=null,fa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var _a=P.S;P.S=function(e,t){su=De(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=F(null);function ya(){var e=va.current;return e===null?Hl.pooledCache:e}function ba(e,t){t===null?oe(va,va.current):oe(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:sa._currentValue,pool:e}}var Sa=Error(i(460)),Ca=Error(i(474)),wa=Error(i(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Qt,Qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Aa(e),e;default:if(typeof t.status==`string`)t.then(Qt,Qt);else{if(e=Hl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Aa(e),e}throw B=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(B=e,Sa):e}}var B=null;function ka(){if(B===null)throw Error(i(459));var e=B;return B=null,e}function Aa(e){if(e===Sa||e===wa)throw Error(i(483))}var ja=null,Ma=0;function Na(e){var t=Ma;return Ma+=1,ja===null&&(ja=[]),Da(ja,e,t)}function Pa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Fa(e,t){throw t.$$typeof===m?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ia(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Oa(i)===t.type)?(t=a(t,n.props),Pa(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),Pa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=fi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=di(t.type,t.key,t.props,null,e.mode,n),Pa(n,t),n.return=e,n;case v:return t=hi(t,e.mode,n),t.return=e,t;case O:return t=Oa(t),f(e,t,n)}if(te(t)||M(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Na(t),n);if(t.$$typeof===C)return f(e,na(e,t),n);Fa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Oa(n),p(e,t,n,r)}if(te(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Na(n),r);if(n.$$typeof===C)return p(e,t,na(e,n),r);Fa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Oa(r),m(e,t,n,r,i)}if(te(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Na(r),i);if(r.$$typeof===C)return m(e,t,n,na(t,r),i);Fa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Pi&&Di(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Pi&&Di(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Pi&&Di(i,h),l}function _(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Pi&&Di(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Pi&&Di(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Pi&&Di(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Pa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Pa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Oa(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),_(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Na(o),c);if(o.$$typeof===C)return b(e,r,na(e,o),c);Fa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ma=0;var i=b(e,t,n,r);return ja=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var La=Ia(!0),Ra=Ia(!1),za=!1;function Ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Va(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Vl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Wa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function Ga(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ka=!1;function qa(){if(Ka){var e=pa;if(e!==null)throw e}}function Ja(e,t,n,r){Ka=!1;var i=e.updateQueue;za=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Wl&p)===p:(r&p)===p){p!==0&&p===fa&&(Ka=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:za=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ql|=o,e.lanes=o,e.memoizedState=d}}function Ya(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Xa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ya(n[e],t)}var Za=F(null),Qa=F(0);function $a(e,t){e=Xl,oe(Qa,e),oe(Za,t),Xl=e|t.baseLanes}function eo(){oe(Qa,Xl),oe(Za,Za.current)}function to(){Xl=Qa.current,I(Za),I(Qa)}var no=F(null),ro=null;function io(e){var t=e.alternate;oe(lo,lo.current&1),oe(no,e),ro===null&&(t===null||Za.current!==null||t.memoizedState!==null)&&(ro=e)}function ao(e){oe(lo,lo.current),oe(no,e),ro===null&&(ro=e)}function oo(e){e.tag===22?(oe(lo,lo.current),oe(no,e),ro===null&&(ro=e)):so(e)}function so(){oe(lo,lo.current),oe(no,no.current)}function co(e){I(no),ro===e&&(ro=null),I(lo)}var lo=F(0);function uo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ff(n)||pf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 fo=0,po=null,mo=null,ho=null,go=!1,_o=!1,vo=!1,yo=0,bo=0,xo=null,So=0;function Co(){throw Error(i(321))}function wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xr(e[n],t[n]))return!1;return!0}function To(e,t,n,r,i,a){return fo=a,po=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Vs:Hs,vo=!1,a=n(r,i),vo=!1,_o&&(a=Do(t,n,r,i)),Eo(e),a}function Eo(e){P.H=Bs;var t=mo!==null&&mo.next!==null;if(fo=0,ho=mo=po=null,go=!1,bo=0,xo=null,t)throw Error(i(300));e===null||ac||(e=e.dependencies,e!==null&&$i(e)&&(ac=!0))}function Do(e,t,n,r){po=e;var a=0;do{if(_o&&(xo=null),bo=0,_o=!1,25<=a)throw Error(i(301));if(a+=1,ho=mo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Us,o=t(n,r)}while(_o);return o}function Oo(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?Fo(t):t,e=e.useState()[0],(mo===null?null:mo.memoizedState)!==e&&(po.flags|=1024),t}function ko(){var e=yo!==0;return yo=0,e}function Ao(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function jo(e){if(go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}go=!1}fo=0,ho=mo=po=null,_o=!1,bo=yo=0,xo=null}function Mo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ho===null?po.memoizedState=ho=e:ho=ho.next=e,ho}function No(){if(mo===null){var e=po.alternate;e=e===null?null:e.memoizedState}else e=mo.next;var t=ho===null?po.memoizedState:ho.next;if(t!==null)ho=t,mo=e;else{if(e===null)throw po.alternate===null?Error(i(467)):Error(i(310));mo=e,e={memoizedState:mo.memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},ho===null?po.memoizedState=ho=e:ho=ho.next=e}return ho}function Po(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fo(e){var t=bo;return bo+=1,xo===null&&(xo=[]),e=Da(xo,e,t),t=po,(ho===null?t.memoizedState:ho.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Vs:Hs),e}function Io(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Fo(e);if(e.$$typeof===C)return ta(e)}throw Error(i(438,String(e)))}function Lo(e){var t=null,n=po.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=po.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Po(),po.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Ro(e,t){return typeof t==`function`?t(e):t}function zo(e){return Bo(No(),mo,e)}function Bo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(fo&f)===f:(Wl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===fa&&(d=!0);else if((fo&p)===p){u=u.next,p===fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,po.lanes|=p,Ql|=p;f=u.action,vo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,po.lanes|=f,Ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!xr(o,e.memoizedState)&&(ac=!0,d&&(n=pa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Vo(e){var t=No(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);xr(o,t.memoizedState)||(ac=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ho(e,t,n){var r=po,a=No(),o=Pi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!xr((mo||a).memoizedState,n);if(s&&(a.memoizedState=n,ac=!0),a=a.queue,ps(Go.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ho!==null&&ho.memoizedState.tag&1){if(r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,a,n,t),null),Hl===null)throw Error(i(349));o||fo&127||Uo(r,t,n)}return n}function Uo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=po.updateQueue,t===null?(t=Po(),po.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wo(e,t,n,r){t.value=n,t.getSnapshot=r,Ko(t)&&qo(e)}function Go(e,t,n){return n(function(){Ko(t)&&qo(e)})}function Ko(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xr(e,n)}catch{return!0}}function qo(e){var t=ni(e,2);t!==null&&Su(t,e,2)}function Jo(e){var t=Mo();if(typeof e==`function`){var n=e;if(e=n(),vo){Re(!0);try{n()}finally{Re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:e},t}function Yo(e,t,n,r){return e.baseState=n,Bo(e,mo,typeof r==`function`?r:Ro)}function Xo(e,t,n,r,a){if(Ls(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Zo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Zo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Qo(e,t,s)}catch(n){es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Qo(e,t,a)}catch(n){es(e,t,n)}}function Qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){$o(e,t,n)},function(n){return es(e,t,n)}):$o(e,t,n)}function $o(e,t,n){t.status=`fulfilled`,t.value=n,ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Zo(e,n)))}function es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ts(t),t=t.next;while(t!==r)}e.action=null}function ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ns(e,t){return t}function rs(e,t){if(Pi){var n=Hl.formState;if(n!==null){a:{var r=po;if(Pi){if(Ni){b:{for(var i=Ni,a=Ii;i.nodeType!==8;){if(!a){i=null;break b}if(i=hf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ni=hf(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=Mo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:t},n.queue=r,n=Ps.bind(null,po,r),r.dispatch=n,r=Jo(!1),a=Is.bind(null,po,!1,r.queue),r=Mo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Xo.bind(null,po,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function is(e){return as(No(),mo,e)}function as(e,t,n){if(t=Bo(e,t,ns)[0],e=zo(Ro)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Fo(t)}catch(e){throw e===Sa?wa:e}else r=t;t=No();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(po.flags|=2048,cs(9,{destroy:void 0},os.bind(null,i,n),null)),[r,a,e]}function os(e,t){e.action=t}function ss(e){var t=No(),n=mo;if(n!==null)return as(t,n,e);No(),t=t.memoizedState,n=No();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function cs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=po.updateQueue,t===null&&(t=Po(),po.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ls(){return No().memoizedState}function us(e,t,n,r){var i=Mo();po.flags|=e,i.memoizedState=cs(1|t,{destroy:void 0},n,r===void 0?null:r)}function ds(e,t,n,r){var i=No();r=r===void 0?null:r;var a=i.memoizedState.inst;mo!==null&&r!==null&&wo(r,mo.memoizedState.deps)?i.memoizedState=cs(t,a,n,r):(po.flags|=e,i.memoizedState=cs(1|t,a,n,r))}function fs(e,t){us(8390656,8,e,t)}function ps(e,t){ds(2048,8,e,t)}function ms(e){po.flags|=4;var t=po.updateQueue;if(t===null)t=Po(),po.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function hs(e){var t=No().memoizedState;return ms({ref:t,nextImpl:e}),function(){if(Vl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function gs(e,t){return ds(4,2,e,t)}function _s(e,t){return ds(4,4,e,t)}function vs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ys(e,t,n){n=n==null?null:n.concat([e]),ds(4,4,vs.bind(null,t,e),n)}function bs(){}function xs(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ss(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&wo(t,r[1]))return r[0];if(r=e(),vo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r}function Cs(e,t,n){return n===void 0||fo&1073741824&&!(Wl&261930)?e.memoizedState=t:(e.memoizedState=n,e=xu(),po.lanes|=e,Ql|=e,n)}function ws(e,t,n,r){return xr(n,t)?n:Za.current===null?!(fo&42)||fo&1073741824&&!(Wl&261930)?(ac=!0,e.memoizedState=n):(e=xu(),po.lanes|=e,Ql|=e,t):(e=Cs(e,n,r),xr(e,t)||(ac=!0),e)}function Ts(e,t,n,r,i){var a=ne.p;ne.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,Is(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Fs(e,t,ga(c,r),bu(e)):Fs(e,t,r,bu(e))}catch(n){Fs(e,t,{then:function(){},status:`rejected`,reason:n},bu())}finally{ne.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function Es(){}function V(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ds(e).queue;Ts(e,a,t,re,n===null?Es:function(){return Os(e),n(r)})}function Ds(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Os(e){var t=Ds(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},bu())}function ks(){return ta(ip)}function As(){return No().memoizedState}function js(){return No().memoizedState}function Ms(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=bu();e=Ha(n);var r=Ua(t,e,n);r!==null&&(Su(r,t,n),Wa(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function Ns(e,t,n){var r=bu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ls(e)?Rs(t,n):(n=ti(e,t,n,r),n!==null&&(Su(n,e,r),zs(n,t,r)))}function Ps(e,t,n){Fs(e,t,n,bu())}function Fs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ls(e))Rs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,xr(s,o))return ei(e,t,i,0),Hl===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return Su(n,e,r),zs(n,t,r),!0}return!1}function Is(e,t,n,r){if(r={lane:2,revertLane:yd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ls(e)){if(t)throw Error(i(479))}else t=ti(e,n,r,2),t!==null&&Su(t,e,2)}function Ls(e){var t=e.alternate;return e===po||t!==null&&t===po}function Rs(e,t){_o=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Bs={readContext:ta,use:Io,useCallback:Co,useContext:Co,useEffect:Co,useImperativeHandle:Co,useLayoutEffect:Co,useInsertionEffect:Co,useMemo:Co,useReducer:Co,useRef:Co,useState:Co,useDebugValue:Co,useDeferredValue:Co,useTransition:Co,useSyncExternalStore:Co,useId:Co,useHostTransitionStatus:Co,useFormState:Co,useActionState:Co,useOptimistic:Co,useMemoCache:Co,useCacheRefresh:Co};Bs.useEffectEvent=Co;var Vs={readContext:ta,use:Io,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=Mo();t=t===void 0?null:t;var r=e();if(vo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mo();if(n!==void 0){var i=n(t);if(vo){Re(!0);try{n(t)}finally{Re(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ns.bind(null,po,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,n=Ps.bind(null,po,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:bs,useDeferredValue:function(e,t){return Cs(Mo(),e,t)},useTransition:function(){var e=Jo(!1);return e=Ts.bind(null,po,e.queue,!0,!1),Mo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=po,a=Mo();if(Pi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Hl===null)throw Error(i(349));Wl&127||Uo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,fs(Go.bind(null,r,o,e),[e]),r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,o,n,t),null),n},useId:function(){var e=Mo(),t=Hl.identifierPrefix;if(Pi){var n=Ei,r=Ti;n=(r&~(1<<32-ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=So++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ks,useFormState:rs,useActionState:rs,useOptimistic:function(e){var t=Mo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Is.bind(null,po,!0,n),n.dispatch=t,[e,t]},useMemoCache:Lo,useCacheRefresh:function(){return Mo().memoizedState=Ms.bind(null,po)},useEffectEvent:function(e){var t=Mo(),n={impl:e};return t.memoizedState=n,function(){if(Vl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Hs={readContext:ta,use:Io,useCallback:xs,useContext:ta,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:zo,useRef:ls,useState:function(){return zo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){return ws(No(),mo.memoizedState,e,t)},useTransition:function(){var e=zo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:As,useHostTransitionStatus:ks,useFormState:is,useActionState:is,useOptimistic:function(e,t){return Yo(No(),mo,e,t)},useMemoCache:Lo,useCacheRefresh:js};Hs.useEffectEvent=hs;var Us={readContext:ta,use:Io,useCallback:xs,useContext:ta,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:Vo,useRef:ls,useState:function(){return Vo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){var n=No();return mo===null?Cs(n,e,t):ws(n,mo.memoizedState,e,t)},useTransition:function(){var e=Vo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:As,useHostTransitionStatus:ks,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){var n=No();return mo===null?(n.baseState=e,[e,n.queue.dispatch]):Yo(n,mo,e,t)},useMemoCache:Lo,useCacheRefresh:js};Us.useEffectEvent=hs;function Ws(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=bu(),i=Ha(r);i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(Su(t,e,r),Wa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=bu(),i=Ha(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(Su(t,e,r),Wa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=bu(),r=Ha(n);r.tag=2,t!=null&&(r.callback=t),t=Ua(e,r,n),t!==null&&(Su(t,e,n),Wa(t,e,n))}};function Ks(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Sr(n,r)||!Sr(i,a):!0}function qs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Gs.enqueueReplaceState(t,t.state,null)}function Js(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ys(e){Yr(e)}function Xs(e){console.error(e)}function Zs(e){Yr(e)}function Qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ec(e,t,n){return n=Ha(n),n.tag=3,n.payload={element:null},n.callback=function(){Qs(e,t)},n}function tc(e){return e=Ha(e),e.tag=3,e}function nc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){$s(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){$s(t,n,r),typeof i!=`function`&&(uu===null?uu=new Set([this]):uu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function rc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Qi(t,n,a,!0),n=no.current,n!==null){switch(n.tag){case 31:case 13:return ro===null?Pu():n.alternate===null&&Zl===0&&(Zl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),$u(e,r,a)),!1;case 22:return n.flags|=65536,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),$u(e,r,a)),!1}throw Error(i(435,n.tag))}return $u(e,r,a),Pu(),!1}if(Pi)return t=no.current,t===null?(r!==Li&&(t=Error(i(423),{cause:r}),Wi(_i(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=_i(r,n),a=ec(e.stateNode,r,a),Ga(e,a),Zl!==4&&(Zl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Li&&(e=Error(i(422),{cause:r}),Wi(_i(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=_i(o,n),ru===null?ru=[o]:ru.push(o),Zl!==4&&(Zl=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ec(n.stateNode,r,e),Ga(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(uu===null||!uu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=tc(a),nc(a,e,n,r),Ga(n,a),!1}n=n.return}while(n!==null);return!1}var ic=Error(i(461)),ac=!1;function oc(e,t,n,r){t.child=e===null?Ra(t,null,n,r):La(t,e.child,n,r)}function sc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ea(t),r=To(e,t,n,o,a,i),s=ko(),e!==null&&!ac?(Ao(e,t,i),jc(e,t,i)):(Pi&&s&&ki(t),t.flags|=1,oc(e,t,r,i),t.child)}function cc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,lc(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Mc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Sr:n,n(o,r)&&e.ref===t.ref)return jc(e,t,i)}return t.flags|=1,e=li(a,r),e.ref=t.ref,e.return=t,t.child=e}function lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Sr(a,r)&&e.ref===t.ref)if(ac=!1,t.pendingProps=r=a,Mc(e,i))e.flags&131072&&(ac=!0);else return t.lanes=e.lanes,jc(e,t,i)}return _c(e,t,n,r,i)}function uc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?eo():$a(t,a),oo(t);else return r=t.lanes=536870912,fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),eo(),so(t)):(ba(t,a.cachePool),$a(t,a),so(t),t.memoizedState=null);return oc(e,t,i,n),t.child}function dc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),eo(),oo(t),e!==null&&Qi(e,t,r,!0),t.childLanes=i,null}function pc(e,t){return t=Ec({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mc(e,t,n){return La(t,e.child,null,n),e=pc(t,t.pendingProps),e.flags|=2,co(t),t.memoizedState=null,e}function hc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Pi){if(r.mode===`hidden`)return e=pc(t,r),t.lanes=536870912,dc(null,e);if(ao(t),(e=Ni)?(e=df(e,Ii),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return pc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ao(t),a)if(t.flags&256)t.flags&=-257,t=mc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ac||Qi(e,t,n,!1),a=(n&e.childLanes)!==0,ac||a){if(r=Hl,r!==null&&(s=et(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ni(e,s),Su(r,e,s),ic;Pu(),t=mc(e,t,n)}else e=o.treeContext,Ni=hf(s.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=pc(t,r),t.flags|=4096;return t}return e=li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function gc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function _c(e,t,n,r,i){return ea(t),n=To(e,t,n,r,void 0,i),r=ko(),e!==null&&!ac?(Ao(e,t,i),jc(e,t,i)):(Pi&&r&&ki(t),t.flags|=1,oc(e,t,n,i),t.child)}function vc(e,t,n,r,i,a){return ea(t),t.updateQueue=null,n=Do(t,r,n,i),Eo(e),r=ko(),e!==null&&!ac?(Ao(e,t,a),jc(e,t,a)):(Pi&&r&&ki(t),t.flags|=1,oc(e,t,n,a),t.child)}function yc(e,t,n,r,i){if(ea(t),t.stateNode===null){var a=ai,o=n.contextType;typeof o==`object`&&o&&(a=ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Gs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ba(t),o=n.contextType,a.context=typeof o==`object`&&o?ta(o):ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ws(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Gs.enqueueReplaceState(a,a.state,null),Ja(t,r,a,i),qa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Js(n,s);a.props=c;var l=a.context,u=n.contextType;o=ai,typeof u==`object`&&u&&(o=ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&qs(t,a,r,o),za=!1;var f=t.memoizedState;a.state=f,Ja(t,r,a,i),qa(),l=t.memoizedState,s||f!==l||za?(typeof d==`function`&&(Ws(t,n,d,r),l=t.memoizedState),(c=za||Ks(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Va(e,t),o=t.memoizedProps,u=Js(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ai,typeof l==`object`&&l&&(c=ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&qs(t,a,r,c),za=!1,f=t.memoizedState,a.state=f,Ja(t,r,a,i),qa();var p=t.memoizedState;o!==d||f!==p||za||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof s==`function`&&(Ws(t,n,s,r),p=t.memoizedState),(u=za||Ks(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&$i(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,gc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=La(t,e.child,null,i),t.child=La(t,null,n,i)):oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=jc(e,t,i),e}function bc(e,t,n,r){return Hi(),t.flags|=256,oc(e,t,n,r),t.child}var xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sc(e){return{baseLanes:e,cachePool:xa()}}function Cc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=tu),e}function wc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(lo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Pi){if(a?io(t):so(t),(e=Ni)?(e=df(e,Ii),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return pf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(so(t),a=t.mode,c=Ec({mode:`hidden`,children:c},a),r=fi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(null,r)):(io(t),Tc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(io(t),t.flags&=-257,t=Dc(e,t,n)):t.memoizedState===null?(so(t),c=r.fallback,a=t.mode,r=Ec({mode:`visible`,children:r.children},a),c=fi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,La(t,e.child,null,n),r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,t=dc(null,r)):(so(t),t.child=e.child,t.flags|=128,t=null);else if(io(t),pf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Dc(e,t,n)}else if(ac||Qi(e,t,n,!1),s=(n&e.childLanes)!==0,ac||s){if(s=Hl,s!==null&&(r=et(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ni(e,r),Su(s,e,r),ic;ff(c)||Pu(),t=Dc(e,t,n)}else ff(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ni=hf(c.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=Tc(t,r.children),t.flags|=4096);return t}return a?(so(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=li(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,a,n,null),c.flags|=2):c=li(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,dc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Sc(n):(a=c.cachePool,a===null?a=xa():(l=sa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(e.child,r)):(io(t),n=e.child,e=n.sibling,n=li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Tc(e,t){return t=Ec({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ec(e,t){return e=si(22,e,null,t),e.lanes=0,e}function Dc(e,t,n){return La(t,e.child,null,n),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Oc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function kc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ac(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=lo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,oe(lo,o),oc(e,t,r,n),r=Pi?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Oc(e,n,t);else if(e.tag===19)Oc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&uo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),kc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}kc(t,!0,n,null,a,r);break;case`together`:kc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function jc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ql|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Mc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&$i(e))):!0}function Nc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Ji(t,sa,e.memoizedState.cache),Hi();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(io(t),e=jc(e,t,n),e===null?null:e.sibling):wc(e,t,n):(io(t),t.flags|=128,null);io(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ac(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),oe(lo,lo.current),r)break;return null;case 22:return t.lanes=0,uc(e,t,n,t.pendingProps);case 24:Ji(t,sa,e.memoizedState.cache)}return jc(e,t,n)}function Pc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ac=!0;else{if(!Mc(e,n)&&!(t.flags&128))return ac=!1,Nc(e,t,n);ac=!!(e.flags&131072)}else ac=!1,Pi&&t.flags&1048576&&Oi(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)ci(e)?(r=Js(e,r),t.tag=1,t=yc(null,t,e,r,n)):(t.tag=0,t=_c(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=sc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=cc(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,``))}}return t;case 0:return _c(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Js(r,t.pendingProps),yc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Va(e,t),Ja(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,sa,r),r!==o.cache&&Zi(t,[sa],n,!0),qa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=bc(e,t,r,n);break a}else if(r!==a){a=_i(Error(i(424)),t),Wi(a),t=bc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ni=hf(e.firstChild),Mi=t,Pi=!0,Fi=null,Ii=!0,n=Ra(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=jc(e,t,n);break a}oc(e,t,r,n)}t=t.child}return t;case 26:return gc(e,t),e===null?(n=Ff(t.type,null,t.pendingProps,null))?t.memoizedState=n:Pi||(n=t.type,e=t.pendingProps,r=Yd(le.current).createElement(n),r[ot]=t,r[st]=e,Ud(r,n,e),vt(r),t.stateNode=r):t.memoizedState=Ff(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&Pi&&(r=t.stateNode=yf(t.type,t.pendingProps,le.current),Mi=t,Ii=!0,a=Ni,K(t.type)?(gf=a,Ni=hf(r.firstChild)):Ni=a),oc(e,t,t.pendingProps.children,n),gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pi&&((a=r=Ni)&&(r=lf(r,t.type,t.pendingProps,Ii),r===null?a=!1:(t.stateNode=r,Mi=t,Ni=hf(r.firstChild),Ii=!1,a=!0)),a||Ri(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,G(a,o)?r=null:s!==null&&G(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=To(e,t,Oo,null,null,n),ip._currentValue=a),gc(e,t),oc(e,t,r,n),t.child;case 6:return e===null&&Pi&&((e=n=Ni)&&(n=uf(n,t.pendingProps,Ii),n===null?e=!1:(t.stateNode=n,Mi=t,Ni=null,e=!0)),e||Ri(t)),null;case 13:return wc(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=La(t,null,r,n):oc(e,t,r,n),t.child;case 11:return sc(e,t,t.type,t.pendingProps,n);case 7:return oc(e,t,t.pendingProps,n),t.child;case 8:return oc(e,t,t.pendingProps.children,n),t.child;case 12:return oc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),oc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ea(t),a=ta(a),r=r(a),t.flags|=1,oc(e,t,r,n),t.child;case 14:return cc(e,t,t.type,t.pendingProps,n);case 15:return lc(e,t,t.type,t.pendingProps,n);case 19:return Ac(e,t,n);case 31:return hc(e,t,n);case 22:return uc(e,t,n,t.pendingProps);case 24:return ea(t),r=ta(sa),e===null?(a=ya(),a===null&&(a=Hl,o=ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ba(t),Ji(t,sa,a)):((e.lanes&n)!==0&&(Va(e,t),Ja(t,null,null,n),qa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ji(t,sa,r),r!==a.cache&&Zi(t,[sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ji(t,sa,r))),oc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Fc(e){e.flags|=4}function Ic(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(ju())e.flags|=8192;else throw B=Ta,Ca}else e.flags&=-16777217}function Lc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xf(t))if(ju())e.flags|=8192;else throw B=Ta,Ca}function Rc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,nu|=t)}function zc(e,t){if(!Pi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Bc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Vc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bc(t),null;case 1:return Bc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(sa),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Fc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Bc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Fc(t),o===null?(Bc(t),Ic(t,a,null,r,n)):(Bc(t),Lc(t,o))):o?o===e.memoizedState?(Bc(t),t.flags&=-16777217):(Fc(t),Bc(t),Lc(t,o)):(e=e.memoizedProps,e!==r&&Fc(t),Bc(t),Ic(t,a,e,r,n)),null;case 27:if(me(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Bc(t),null}e=se.current,Vi(t)?zi(t,e):(e=yf(a,r,n),t.stateNode=e,Fc(t))}return Bc(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Bc(t),null}if(o=se.current,Vi(t))zi(t,o);else{var s=Yd(le.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ot]=t,o[st]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Ud(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Fc(t)}}return Bc(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Mi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Vd(e.nodeValue,n)),e||Ri(t,!0)}else e=Yd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return Bc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ot]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(co(t),t):(co(t),null);if(t.flags&128)throw Error(i(558))}return Bc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ot]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(co(t),t):(co(t),null)}return co(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Rc(t,t.updateQueue),Bc(t),null);case 4:return fe(),e===null&&jd(t.stateNode.containerInfo),Bc(t),null;case 10:return Yi(t.type),Bc(t),null;case 19:if(I(lo),r=t.memoizedState,r===null)return Bc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)zc(r,!1);else{if(Zl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=uo(e),o!==null){for(t.flags|=128,zc(r,!1),e=o.updateQueue,t.updateQueue=e,Rc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return oe(lo,lo.current&1|2),Pi&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>cu&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304)}else{if(!a)if(e=uo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Rc(t,e),zc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Pi)return Bc(t),null}else 2*De()-r.renderingStartTime>cu&&n!==536870912&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Bc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=lo.current,oe(lo,a?n&1|2:n&1),Pi&&Di(t,r.treeForkCount),e);case 22:case 23:return co(t),to(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Bc(t),t.subtreeFlags&6&&(t.flags|=8192)):Bc(t),n=t.updateQueue,n!==null&&Rc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&I(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),Bc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Hc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(co(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(co(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(lo),null;case 4:return fe(),null;case 10:return Yi(t.type),null;case 22:case 23:return co(t),to(),e!==null&&I(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Uc(e,t){switch(Ai(t),t.tag){case 3:Yi(sa),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&co(t);break;case 13:co(t);break;case 19:I(lo);break;case 10:Yi(t.type);break;case 22:case 23:co(t),to(),e!==null&&I(va);break;case 24:Yi(sa)}}function Wc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Qu(t,t.return,e)}}function Gc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Qu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Qu(t,t.return,e)}}function Kc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xa(t,n)}catch(t){Qu(e,e.return,t)}}}function qc(e,t,n){n.props=Js(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Qu(e,t,n)}}function Jc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Qu(e,t,n)}}function Yc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Qu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Qu(e,t,n)}else n.current=null}function Xc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Qu(e,e.return,t)}}function Zc(e,t,n){try{var r=e.stateNode;Wd(r,e.type,n,t),r[st]=t}catch(t){Qu(e,e.return,t)}}function Qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&K(e.type)||e.tag===4}function $c(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Qc(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.tag===27&&K(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qt));else if(r!==4&&(r===27&&K(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&K(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ud(t,r,n),t[ot]=e,t[st]=n}catch(t){Qu(e,e.return,t)}}var rl=!1,il=!1,al=!1,H=typeof WeakSet==`function`?WeakSet:Set,ol=null;function U(e,t){if(e=e.containerInfo,qd=pp,e=Er(e),Dr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Jd={focusedElem:e,selectionRange:n},pp=!1,ol=t;ol!==null;)if(t=ol,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ol=e;else for(;ol!==null;){switch(t=ol,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Js(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Qu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)cf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:cf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ol=e;break}ol=t.return}}function sl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Sl(e,n),r&4&&Wc(5,n);break;case 1:if(Sl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Qu(n,n.return,e)}else{var i=Js(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Qu(n,n.return,e)}}r&64&&Kc(n),r&512&&Jc(n,n.return);break;case 3:if(Sl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Xa(e,t)}catch(e){Qu(n,n.return,e)}}break;case 27:t===null&&r&4&&nl(n);case 26:case 5:Sl(e,n),t===null&&r&4&&Xc(n),r&512&&Jc(n,n.return);break;case 12:Sl(e,n);break;case 31:Sl(e,n),r&4&&pl(e,n);break;case 13:Sl(e,n),r&4&&ml(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=nd.bind(null,n),mf(e,n))));break;case 22:if(r=n.memoizedState!==null||rl,!r){t=t!==null&&t.memoizedState!==null||il,i=rl;var a=il;rl=r,(il=t)&&!a?wl(e,n,(n.subtreeFlags&8772)!=0):Sl(e,n),rl=i,il=a}break;case 30:break;default:Sl(e,n)}}function cl(e){var t=e.alternate;t!==null&&(e.alternate=null,cl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&pt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ll=null,ul=!1;function dl(e,t,n){for(n=n.child;n!==null;)fl(e,t,n),n=n.sibling}function fl(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==`function`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:il||Yc(n,t),dl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:il||Yc(n,t);var r=ll,i=ul;K(n.type)&&(ll=n.stateNode,ul=!1),dl(e,t,n),bf(n.stateNode),ll=r,ul=i;break;case 5:il||Yc(n,t);case 6:if(r=ll,i=ul,ll=null,dl(e,t,n),ll=r,ul=i,ll!==null)if(ul)try{(ll.nodeType===9?ll.body:ll.nodeName===`HTML`?ll.ownerDocument.body:ll).removeChild(n.stateNode)}catch(e){Qu(n,t,e)}else try{ll.removeChild(n.stateNode)}catch(e){Qu(n,t,e)}break;case 18:ll!==null&&(ul?(e=ll,of(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),zp(e)):of(ll,n.stateNode));break;case 4:r=ll,i=ul,ll=n.stateNode.containerInfo,ul=!0,dl(e,t,n),ll=r,ul=i;break;case 0:case 11:case 14:case 15:Gc(2,n,t),il||Gc(4,n,t),dl(e,t,n);break;case 1:il||(Yc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&qc(n,t,r)),dl(e,t,n);break;case 21:dl(e,t,n);break;case 22:il=(r=il)||n.memoizedState!==null,dl(e,t,n),il=r;break;default:dl(e,t,n)}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{zp(e)}catch(e){Qu(t,t.return,e)}}}function ml(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{zp(e)}catch(e){Qu(t,t.return,e)}}function hl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new H),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new H),t;default:throw Error(i(435,e.tag))}}function gl(e,t){var n=hl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=rd.bind(null,e,t);t.then(r,r)}})}function _l(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(K(c.type)){ll=c.stateNode,ul=!1;break a}break;case 5:ll=c.stateNode,ul=!1;break a;case 3:case 4:ll=c.stateNode.containerInfo,ul=!0;break a}c=c.return}if(ll===null)throw Error(i(160));fl(o,s,a),ll=null,ul=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yl(t,e),t=t.sibling}var vl=null;function yl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:_l(t,e),bl(e),r&4&&(Gc(3,e,e.return),Wc(3,e),Gc(5,e,e.return));break;case 1:_l(t,e),bl(e),r&512&&(il||n===null||Yc(n,n.return)),r&64&&rl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=vl;if(_l(t,e),bl(e),r&512&&(il||n===null||Yc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ft]||o[ot]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Ud(o,r,n),o[ot]=e,vt(o),r=o;break a;case`link`:var s=qf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Ud(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=qf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Ud(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ot]=e,vt(o),r=o}e.stateNode=r}else Jf(a,e.type,e.stateNode);else e.stateNode=Hf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Zc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Jf(a,e.type,e.stateNode):Hf(a,r,e.memoizedProps))}break;case 27:_l(t,e),bl(e),r&512&&(il||n===null||Yc(n,n.return)),n!==null&&r&4&&Zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(_l(t,e),bl(e),r&512&&(il||n===null||Yc(n,n.return)),e.flags&32){a=e.stateNode;try{Wt(a,``)}catch(t){Qu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Zc(e,a,n===null?a:n.memoizedProps)),r&1024&&(al=!0);break;case 6:if(_l(t,e),bl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Qu(e,e.return,t)}}break;case 3:if(Kf=null,a=vl,vl=Cf(t.containerInfo),_l(t,e),vl=a,bl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zp(t.containerInfo)}catch(t){Qu(e,e.return,t)}al&&(al=!1,xl(e));break;case 4:r=vl,vl=Cf(e.stateNode.containerInfo),_l(t,e),bl(e),vl=r;break;case 12:_l(t,e),bl(e);break;case 31:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 13:_l(t,e),bl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ou=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=rl,d=il;if(rl=u||a,il=d||l,_l(t,e),il=d,rl=u,bl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||rl||il||Cl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Qu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Qu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?sf(m,!0):sf(l.stateNode,!1)}catch(e){Qu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,gl(e,n))));break;case 19:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 30:break;case 21:break;default:_l(t,e),bl(e)}}function bl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;tl(e,$c(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Wt(o,``),n.flags&=-33),tl(e,$c(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;el(e,$c(e),s);break;default:throw Error(i(161))}}catch(t){Qu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Sl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sl(e,t.alternate,t),t=t.sibling}function Cl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gc(4,t,t.return),Cl(t);break;case 1:Yc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&qc(t,t.return,n),Cl(t);break;case 27:bf(t.stateNode);case 26:case 5:Yc(t,t.return),Cl(t);break;case 22:t.memoizedState===null&&Cl(t);break;case 30:Cl(t);break;default:Cl(t)}e=e.sibling}}function wl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:wl(i,a,n),Wc(4,a);break;case 1:if(wl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Qu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ya(c[i],s)}catch(e){Qu(r,r.return,e)}}n&&o&64&&Kc(a),Jc(a,a.return);break;case 27:nl(a);case 26:case 5:wl(i,a,n),n&&r===null&&o&4&&Xc(a),Jc(a,a.return);break;case 12:wl(i,a,n);break;case 31:wl(i,a,n),n&&o&4&&pl(i,a);break;case 13:wl(i,a,n),n&&o&4&&ml(i,a);break;case 22:a.memoizedState===null&&wl(i,a,n),Jc(a,a.return);break;case 30:break;default:wl(i,a,n)}t=t.sibling}}function Tl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&la(n))}function El(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function Dl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ol(e,t,n,r),t=t.sibling}function Ol(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Dl(e,t,n,r),i&2048&&Wc(9,t);break;case 1:Dl(e,t,n,r);break;case 3:Dl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e)));break;case 12:if(i&2048){Dl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Qu(t,t.return,e)}}else Dl(e,t,n,r);break;case 31:Dl(e,t,n,r);break;case 13:Dl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Dl(e,t,n,r):(a._visibility|=2,kl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Dl(e,t,n,r):Al(e,t),i&2048&&Tl(o,t);break;case 24:Dl(e,t,n,r),i&2048&&El(t.alternate,t);break;default:Dl(e,t,n,r)}}function kl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:kl(a,o,s,c,i),Wc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,kl(a,o,s,c,i)):u._visibility&2?kl(a,o,s,c,i):Al(a,o),i&&l&2048&&Tl(o.alternate,o);break;case 24:kl(a,o,s,c,i),i&&l&2048&&El(o.alternate,o);break;default:kl(a,o,s,c,i)}t=t.sibling}}function Al(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Al(n,r),i&2048&&Tl(r.alternate,r);break;case 24:Al(n,r),i&2048&&El(r.alternate,r);break;default:Al(n,r)}t=t.sibling}}var jl=8192;function Ml(e,t,n){if(e.subtreeFlags&jl)for(e=e.child;e!==null;)Nl(e,t,n),e=e.sibling}function Nl(e,t,n){switch(e.tag){case 26:Ml(e,t,n),e.flags&jl&&e.memoizedState!==null&&Zf(n,vl,e.memoizedState,e.memoizedProps);break;case 5:Ml(e,t,n);break;case 3:case 4:var r=vl;vl=Cf(e.stateNode.containerInfo),Ml(e,t,n),vl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=jl,jl=16777216,Ml(e,t,n),jl=r):Ml(e,t,n));break;default:Ml(e,t,n)}}function Pl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,Rl(r,e)}Pl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Il(e),e=e.sibling}function Il(e){switch(e.tag){case 0:case 11:case 15:Fl(e),e.flags&2048&&Gc(9,e,e.return);break;case 3:Fl(e);break;case 12:Fl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ll(e)):Fl(e);break;default:Fl(e)}}function Ll(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,Rl(r,e)}Pl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gc(8,t,t.return),Ll(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ll(t));break;default:Ll(t)}e=e.sibling}}function Rl(e,t){for(;ol!==null;){var n=ol;switch(n.tag){case 0:case 11:case 15:Gc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:la(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ol=r;else a:for(n=e;ol!==null;){r=ol;var i=r.sibling,a=r.return;if(cl(r),r===n){ol=null;break a}if(i!==null){i.return=a,ol=i;break a}ol=a}}}var zl={getCacheForType:function(e){var t=ta(sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ta(sa).controller.signal}},Bl=typeof WeakMap==`function`?WeakMap:Map,Vl=0,Hl=null,Ul=null,Wl=0,Gl=0,Kl=null,ql=!1,Jl=!1,Yl=!1,Xl=0,Zl=0,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=null,iu=null,au=!1,ou=0,su=0,cu=1/0,lu=null,uu=null,du=0,fu=null,pu=null,mu=0,hu=0,gu=null,_u=null,vu=0,yu=null;function bu(){return Vl&2&&Wl!==0?Wl&-Wl:P.T===null?rt():yd()}function xu(){if(tu===0)if(!(Wl&536870912)||Pi){var e=We;We<<=1,!(We&3932160)&&(We=262144),tu=e}else tu=536870912;return e=no.current,e!==null&&(e.flags|=32),tu}function Su(e,t,n){(e===Hl&&(Gl===2||Gl===9)||e.cancelPendingCommit!==null)&&(ku(e,0),Eu(e,Wl,tu,!1)),Xe(e,n),(!(Vl&2)||e!==Hl)&&(e===Hl&&(!(Vl&2)&&($l|=n),Zl===4&&Eu(e,Wl,tu,!1)),dd(e))}function Cu(e,t,n){if(Vl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||L(e,t),a=r?Lu(e,t):Fu(e,t,!0),o=r;do{if(a===0){Jl&&!r&&Eu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Tu(n)){a=Fu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ru;var l=c.current.memoizedState.isDehydrated;if(l&&(ku(c,s).flags|=256),s=Fu(c,s,!1),s!==2){if(Yl&&!l){c.errorRecoveryDisabledLanes|=o,$l|=o,a=4;break a}o=iu,iu=a,o!==null&&(iu===null?iu=o:iu.push.apply(iu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){ku(e,0),Eu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Eu(r,t,tu,!ql);break a;case 2:iu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=ou+300-De(),10<a)){if(Eu(r,t,tu,!ql),qe(r,0,!0)!==0)break a;mu=t,r.timeoutHandle=ef(wu.bind(null,r,n,iu,lu,au,t,tu,$l,nu,ql,o,`Throttled`,-0,0),a);break a}wu(r,n,iu,lu,au,t,tu,$l,nu,ql,o,null,-0,0)}}break}while(1);dd(e)}function wu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qt},Nl(t,a,d);var m=(a&62914560)===a?ou-De():(a&4194048)===a?su-De():0;if(m=$f(d,m),m!==null){mu=a,e.cancelPendingCommit=m(Wu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Eu(e,a,o,!l);return}}Wu(e,t,a,n,r,i,o,s,c)}function Tu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!xr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Eu(e,t,n,r){t&=~eu,t&=~$l,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Qe(e,n,t)}function Du(){return Vl&6?!0:(fd(0,!1),!1)}function Ou(){if(Ul!==null){if(Gl===0)var e=Ul.return;else e=Ul,qi=Ki=null,jo(e),ja=null,Ma=0,e=Ul;for(;e!==null;)Uc(e.alternate,e),e=e.return;Ul=null}}function ku(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,tf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),mu=0,Ou(),Hl=e,Ul=n=li(e.current,null),Wl=t,Gl=0,Kl=null,ql=!1,Jl=L(e,t),Yl=!1,nu=tu=eu=$l=Ql=Zl=0,iu=ru=null,au=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-ze(r),a=1<<i;t|=e[i],r&=~a}return Xl=t,$r(),n}function Au(e,t){po=null,P.H=Bs,t===Sa||t===wa?(t=ka(),Gl=3):t===Ca?(t=ka(),Gl=4):Gl=t===ic?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Kl=t,Ul===null&&(Zl=1,Qs(e,_i(t,e.current)))}function ju(){var e=no.current;return e===null?!0:(Wl&4194048)===Wl?ro===null:(Wl&62914560)===Wl||Wl&536870912?e===ro:!1}function Mu(){var e=P.H;return P.H=Bs,e===null?Bs:e}function Nu(){var e=P.A;return P.A=zl,e}function Pu(){Zl=4,ql||(Wl&4194048)!==Wl&&no.current!==null||(Jl=!0),!(Ql&134217727)&&!($l&134217727)||Hl===null||Eu(Hl,Wl,tu,!1)}function Fu(e,t,n){var r=Vl;Vl|=2;var i=Mu(),a=Nu();(Hl!==e||Wl!==t)&&(lu=null,ku(e,t)),t=!1;var o=Zl;a:do try{if(Gl!==0&&Ul!==null){var s=Ul,c=Kl;switch(Gl){case 8:Ou(),o=6;break a;case 3:case 2:case 9:case 6:no.current===null&&(t=!0);var l=Gl;if(Gl=0,Kl=null,Vu(e,s,c,l),n&&Jl){o=0;break a}break;default:l=Gl,Gl=0,Kl=null,Vu(e,s,c,l)}}Iu(),o=Zl;break}catch(t){Au(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,Vl=r,P.H=i,P.A=a,Ul===null&&(Hl=null,Wl=0,$r()),o}function Iu(){for(;Ul!==null;)zu(Ul)}function Lu(e,t){var n=Vl;Vl|=2;var r=Mu(),a=Nu();Hl!==e||Wl!==t?(lu=null,cu=De()+500,ku(e,t)):Jl=L(e,t);a:do try{if(Gl!==0&&Ul!==null){t=Ul;var o=Kl;b:switch(Gl){case 1:Gl=0,Kl=null,Vu(e,t,o,1);break;case 2:case 9:if(Ea(o)){Gl=0,Kl=null,Bu(t);break}t=function(){Gl!==2&&Gl!==9||Hl!==e||(Gl=7),dd(e)},o.then(t,t);break a;case 3:Gl=7;break a;case 4:Gl=5;break a;case 7:Ea(o)?(Gl=0,Kl=null,Bu(t)):(Gl=0,Kl=null,Vu(e,t,o,7));break;case 5:var s=null;switch(Ul.tag){case 26:s=Ul.memoizedState;case 5:case 27:var c=Ul;if(s?Xf(s):c.stateNode.complete){Gl=0,Kl=null;var l=c.sibling;if(l!==null)Ul=l;else{var u=c.return;u===null?Ul=null:(Ul=u,Hu(u))}break b}}Gl=0,Kl=null,Vu(e,t,o,5);break;case 6:Gl=0,Kl=null,Vu(e,t,o,6);break;case 8:Ou(),Zl=6;break a;default:throw Error(i(462))}}Ru();break}catch(t){Au(e,t)}while(1);return qi=Ki=null,P.H=r,P.A=a,Vl=n,Ul===null?(Hl=null,Wl=0,$r(),Zl):0}function Ru(){for(;Ul!==null&&!Te();)zu(Ul)}function zu(e){var t=Pc(e.alternate,e,Xl);e.memoizedProps=e.pendingProps,t===null?Hu(e):Ul=t}function Bu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=vc(n,t,t.pendingProps,t.type,void 0,Wl);break;case 11:t=vc(n,t,t.pendingProps,t.type.render,t.ref,Wl);break;case 5:jo(t);default:Uc(n,t),t=Ul=ui(t,Xl),t=Pc(n,t,Xl)}e.memoizedProps=e.pendingProps,t===null?Hu(e):Ul=t}function Vu(e,t,n,r){qi=Ki=null,jo(t),ja=null,Ma=0;var i=t.return;try{if(rc(e,i,t,n,Wl)){Zl=1,Qs(e,_i(n,e.current)),Ul=null;return}}catch(t){if(i!==null)throw Ul=i,t;Zl=1,Qs(e,_i(n,e.current)),Ul=null;return}t.flags&32768?(Pi||r===1?e=!0:Jl||Wl&536870912?e=!1:(ql=e=!0,(r===2||r===9||r===3||r===6)&&(r=no.current,r!==null&&r.tag===13&&(r.flags|=16384))),Uu(t,e)):Hu(t)}function Hu(e){var t=e;do{if(t.flags&32768){Uu(t,ql);return}e=t.return;var n=Vc(t.alternate,t,Xl);if(n!==null){Ul=n;return}if(t=t.sibling,t!==null){Ul=t;return}Ul=t=e}while(t!==null);Zl===0&&(Zl=5)}function Uu(e,t){do{var n=Hc(e.alternate,e);if(n!==null){n.flags&=32767,Ul=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ul=e;return}Ul=e=n}while(e!==null);Zl=6,Ul=null}function Wu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Yu();while(du!==0);if(Vl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Qr,Ze(e,n,o,s,c,l),e===Hl&&(Ul=Hl=null,Wl=0),pu=t,fu=e,mu=n,hu=o,gu=a,_u=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,id(je,function(){return Xu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=ne.p,ne.p=2,s=Vl,Vl|=4;try{U(e,t,n)}finally{Vl=s,ne.p=a,P.T=r}}du=1,Gu(),Ku(),qu()}}function Gu(){if(du===1){du=0;var e=fu,t=pu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=ne.p;ne.p=2;var i=Vl;Vl|=4;try{yl(t,e);var a=Jd,o=Er(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Tr(s.ownerDocument.documentElement,s)){if(c!==null&&Dr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=wr(s,h),v=wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}pp=!!qd,Jd=qd=null}finally{Vl=i,ne.p=r,P.T=n}}e.current=t,du=2}}function Ku(){if(du===2){du=0;var e=fu,t=pu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=ne.p;ne.p=2;var i=Vl;Vl|=4;try{sl(e,t.alternate,t)}finally{Vl=i,ne.p=r,P.T=n}}du=3}}function qu(){if(du===4||du===3){du=0,Ee();var e=fu,t=pu,n=mu,r=_u;t.subtreeFlags&10256||t.flags&10256?du=5:(du=0,pu=fu=null,Ju(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(uu=null),nt(n),t=t.stateNode,Le&&typeof Le.onCommitFiberRoot==`function`)try{Le.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=ne.p,ne.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,ne.p=i}}mu&3&&Yu(),dd(e),i=e.pendingLanes,n&261930&&i&42?e===yu?vu++:(vu=0,yu=e):vu=0,fd(0,!1)}}function Ju(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function Yu(){return Gu(),Ku(),qu(),Xu()}function Xu(){if(du!==5)return!1;var e=fu,t=hu;hu=0;var n=nt(mu),r=P.T,a=ne.p;try{ne.p=32>n?32:n,P.T=null,n=gu,gu=null;var o=fu,s=mu;if(du=0,pu=fu=null,mu=0,Vl&6)throw Error(i(331));var c=Vl;if(Vl|=4,Il(o.current),Ol(o,o.current,s,n),Vl=c,fd(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{ne.p=a,P.T=r,Ju(e,t)}}function Zu(e,t,n){t=_i(n,t),t=ec(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Xe(e,2),dd(e))}function Qu(e,t,n){if(e.tag===3)Zu(e,e,n);else for(;t!==null;){if(t.tag===3){Zu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(uu===null||!uu.has(r))){e=_i(n,e),n=tc(2),r=Ua(t,n,2),r!==null&&(nc(n,r,t,e),Xe(r,2),dd(r));break}}t=t.return}}function $u(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Bl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Yl=!0,i.add(n),e=ed.bind(null,e,t,n),t.then(e,e))}function ed(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Hl===e&&(Wl&n)===n&&(Zl===4||Zl===3&&(Wl&62914560)===Wl&&300>De()-ou?!(Vl&2)&&ku(e,0):eu|=n,nu===Wl&&(nu=0)),dd(e)}function td(e,t){t===0&&(t=Je()),e=ni(e,t),e!==null&&(Xe(e,t),dd(e))}function nd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),td(e,n)}function rd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),td(e,n)}function id(e,t){return Ce(e,t)}var ad=null,od=null,sd=!1,cd=!1,ld=!1,ud=0;function dd(e){e!==od&&e.next===null&&(od===null?ad=od=e:od=od.next=e),cd=!0,sd||(sd=!0,vd())}function fd(e,t){if(!ld&&cd){ld=!0;do for(var n=!1,r=ad;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,_d(r,a))}else a=Wl,a=qe(r,r===Hl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||L(r,a)||(n=!0,_d(r,a));r=r.next}while(n);ld=!1}}function pd(){md()}function md(){cd=sd=!1;var e=0;ud!==0&&$d()&&(e=ud);for(var t=De(),n=null,r=ad;r!==null;){var i=r.next,a=hd(r,t);a===0?(r.next=null,n===null?ad=i:n.next=i,i===null&&(od=n)):(n=r,(e!==0||a&3)&&(cd=!0)),r=i}du!==0&&du!==5||fd(e,!1),ud!==0&&(ud=0)}function hd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=R(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Hl,n=Wl,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Gl===2||Gl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||L(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),nt(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=gd.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function gd(e,t){if(du!==0&&du!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Yu()&&e.callbackNode!==n)return null;var r=Wl;return r=qe(e,e===Hl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Cu(e,r,t),hd(e,De()),e.callbackNode!=null&&e.callbackNode===n?gd.bind(null,e):null)}function _d(e,t){if(Yu())return null;Cu(e,t,!0)}function vd(){rf(function(){Vl&6?Ce(ke,pd):md()})}function yd(){if(ud===0){var e=fa;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),ud=e}return ud}function bd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Zt(``+e)}function xd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Sd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=bd((i[st]||null).action),o=r.submitter;o&&(t=(t=o[st]||null)?bd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ud!==0){var e=o?xd(i,o):new FormData(i);V(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?xd(i,o):new FormData(i),V(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Cd=0;Cd<qr.length;Cd++){var wd=qr[Cd];Jr(wd.toLowerCase(),`on`+(wd[0].toUpperCase()+wd.slice(1)))}Jr(zr,`onAnimationEnd`),Jr(Br,`onAnimationIteration`),Jr(Vr,`onAnimationStart`),Jr(`dblclick`,`onDoubleClick`),Jr(`focusin`,`onFocus`),Jr(`focusout`,`onBlur`),Jr(Hr,`onTransitionRun`),Jr(Ur,`onTransitionStart`),Jr(Wr,`onTransitionCancel`),Jr(Gr,`onTransitionEnd`),St(`onMouseEnter`,[`mouseout`,`mouseover`]),St(`onMouseLeave`,[`mouseout`,`mouseover`]),St(`onPointerEnter`,[`pointerout`,`pointerover`]),St(`onPointerLeave`,[`pointerout`,`pointerover`]),xt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),xt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),xt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),xt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Td=`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(` `),Ed=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Td));function Dd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}}}}function Od(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(Md(t,e,2,!1),n.add(r))}function kd(e,t,n){var r=0;t&&(r|=4),Md(n,e,r,t)}var Ad=`_reactListening`+Math.random().toString(36).slice(2);function jd(e){if(!e[Ad]){e[Ad]=!0,yt.forEach(function(t){t!==`selectionchange`&&(Ed.has(t)||kd(t,!1,e),kd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ad]||(t[Ad]=!0,kd(`selectionchange`,!1,t))}}function Md(e,t,n,r){switch(bp(t)){case 2:var i=mp;break;case 8:i=hp;break;default:i=gp}n=i.bind(null,t,n,e),i=void 0,!ln||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Nd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=mt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}on(function(){var r=a,i=en(n),s=[];a:{var c=Kr.get(e);if(c!==void 0){var l=bn,u=e;switch(e){case`keypress`:if(hn(n)===0)break a;case`keydown`:case`keyup`:l=Rn;break;case`focusin`:u=`focus`,l=kn;break;case`focusout`:u=`blur`,l=kn;break;case`beforeblur`:case`afterblur`:l=kn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Dn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=On;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Bn;break;case zr:case Br:case Vr:l=An;break;case Gr:l=Vn;break;case`scroll`:case`scrollend`:l=Sn;break;case`wheel`:l=Hn;break;case`copy`:case`cut`:case`paste`:l=jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=zn;break;case`toggle`:case`beforetoggle`:l=Un}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=sn(m,p),g!=null&&d.push(Pd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==$t&&(u=n.relatedTarget||n.fromElement)&&(mt(u)||u[ct]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?mt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Dn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=zn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:gt(l),h=u==null?c:gt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,mt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Id,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Ld(s,c,l,d,!1),u!==null&&f!==null&&Ld(s,f,u,d,!0)}}a:{if(c=r?gt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=lr;else if(rr(c))if(ur)v=yr;else{v=_r;var y=gr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Jt(r.elementType)&&(v=lr):v=vr;if(v&&=v(e,r)){ir(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Bt(c,`number`,c.value)}switch(y=r?gt(r):window,e){case`focusin`:(rr(y)||y.contentEditable===`true`)&&(kr=y,Ar=r,jr=null);break;case`focusout`:jr=Ar=kr=null;break;case`mousedown`:Mr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Mr=!1,Nr(s,n,i);break;case`selectionchange`:if(Or)break;case`keydown`:case`keyup`:Nr(s,n,i)}var b;if(Gn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else $n?Zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Jn&&n.locale!==`ko`&&($n||x!==`onCompositionStart`?x===`onCompositionEnd`&&$n&&(b=mn()):(dn=i,fn=`value`in dn?dn.value:dn.textContent,$n=!0)),y=Fd(r,x),0<y.length&&(x=new Mn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Qn(n),b!==null&&(x.data=b)))),(b=qn?er(e,n):tr(e,n))&&(x=Fd(r,`onBeforeInput`),0<x.length&&(y=new Mn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Sd(s,e,r,n,i)}Dd(s,t)})}function Pd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Fd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=sn(e,n),i!=null&&r.unshift(Pd(e,i,a)),i=sn(e,t),i!=null&&r.push(Pd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Id(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ld(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=sn(n,a),l!=null&&o.unshift(Pd(n,l,c))):i||(l=sn(n,a),l!=null&&o.push(Pd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Rd=/\r\n?/g,zd=/\u0000|\uFFFD/g;function Bd(e){return(typeof e==`string`?e:``+e).replace(Rd,`
9
- `).replace(zd,``)}function Vd(e,t){return t=Bd(t),Bd(e)===t}function W(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Wt(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:qt(e,r,o);break;case`data`:if(t!==`object`){Ot(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&W(e,t,`name`,a.name,a,null),W(e,t,`formEncType`,a.formEncType,a,null),W(e,t,`formMethod`,a.formMethod,a,null),W(e,t,`formTarget`,a.formTarget,a,null)):(W(e,t,`encType`,a.encType,a,null),W(e,t,`method`,a.method,a,null),W(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`onScroll`:r!=null&&Od(`scroll`,e);break;case`onScrollEnd`:r!=null&&Od(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Zt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Od(`beforetoggle`,e),Od(`toggle`,e),Dt(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Dt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Yt.get(n)||n,Dt(e,n,r))}}function Hd(e,t,n,r,a,o){switch(n){case`style`:qt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Wt(e,``+r);break;case`onScroll`:r!=null&&Od(`scroll`,e);break;case`onScrollEnd`:r!=null&&Od(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[st]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Dt(e,n,r)}}}function Ud(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Od(`error`,e),Od(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:W(e,t,o,s,n,null)}}a&&W(e,t,`srcSet`,n.srcSet,n,null),r&&W(e,t,`src`,n.src,n,null);return;case`input`:Od(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:W(e,t,r,d,n,null)}}zt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Od(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:W(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Vt(e,!!r,n,!0):Vt(e,!!r,t,!1);return;case`textarea`:for(s in Od(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:W(e,t,s,c,n,null)}Ut(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:W(e,t,l,r,n,null)}return;case`dialog`:Od(`beforetoggle`,e),Od(`toggle`,e),Od(`cancel`,e),Od(`close`,e);break;case`iframe`:case`object`:Od(`load`,e);break;case`video`:case`audio`:for(r=0;r<Td.length;r++)Od(Td[r],e);break;case`image`:Od(`error`,e),Od(`load`,e);break;case`details`:Od(`toggle`,e);break;case`embed`:case`source`:case`link`:Od(`error`,e),Od(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:W(e,t,u,r,n,null)}return;default:if(Jt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Hd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&W(e,t,c,r,n,null))}function Wd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||W(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&W(e,t,p,m,r,f)}}Rt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||W(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&W(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Vt(e,!!n,n?[]:``,!1):Vt(e,!!n,t,!0)):Vt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:W(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&W(e,t,s,a,r,o)}Ht(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:W(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:W(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&W(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:W(e,t,u,p,r,m)}return;default:if(Jt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Hd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Hd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&W(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||W(e,t,f,p,r,m)}function Gd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Kd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Gd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Gd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var qd=null,Jd=null;function Yd(e){return e.nodeType===9?e:e.ownerDocument}function Xd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Zd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function G(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Qd=null;function $d(){var e=window.event;return e&&e.type===`popstate`?e===Qd?!1:(Qd=e,!0):(Qd=null,!1)}var ef=typeof setTimeout==`function`?setTimeout:void 0,tf=typeof clearTimeout==`function`?clearTimeout:void 0,nf=typeof Promise==`function`?Promise:void 0,rf=typeof queueMicrotask==`function`?queueMicrotask:nf===void 0?ef:function(e){return nf.resolve(null).then(e).catch(af)};function af(e){setTimeout(function(){throw e})}function K(e){return e===`head`}function of(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),zp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)bf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,bf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ft]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&bf(e.ownerDocument.body);n=i}while(n);zp(t)}function sf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function cf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:cf(n),pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ft])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hf(e.nextSibling),e===null)break}return null}function uf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hf(e.nextSibling),e===null))return null;return e}function df(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hf(e.nextSibling),e===null))return null;return e}function ff(e){return e.data===`$?`||e.data===`$~`}function pf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hf(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var gf=null;function _f(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function yf(e,t,n){switch(t=Yd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function bf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);pt(e)}var xf=new Map,Sf=new Set;function Cf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var q=ne.d;ne.d={f:wf,r:Tf,D:Of,C:kf,L:Af,m:jf,X:Nf,S:Mf,M:Pf};function wf(){var e=q.f(),t=Du();return e||t}function Tf(e){var t=ht(e);t!==null&&t.tag===5&&t.type===`form`?Os(t):q.r(e)}var Ef=typeof document>`u`?null:document;function Df(e,t,n){var r=Ef;if(r&&typeof t==`string`&&t){var i=Lt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Sf.has(i)||(Sf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ud(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Of(e){q.D(e),Df(`dns-prefetch`,e,null)}function kf(e,t){q.C(e,t),Df(`preconnect`,e,t)}function Af(e,t,n){q.L(e,t,n);var r=Ef;if(r&&e&&t){var i=`link[rel="preload"][as="`+Lt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Lt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Lt(n.imageSizes)+`"]`)):i+=`[href="`+Lt(e)+`"]`;var a=i;switch(t){case`style`:a=If(e);break;case`script`:a=Bf(e)}xf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),xf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lf(a))||t===`script`&&r.querySelector(Vf(a))||(t=r.createElement(`link`),Ud(t,`link`,e),vt(t),r.head.appendChild(t)))}}function jf(e,t){q.m(e,t);var n=Ef;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Lt(r)+`"][href="`+Lt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bf(e)}if(!xf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),xf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vf(a)))return}r=n.createElement(`link`),Ud(r,`link`,e),vt(r),n.head.appendChild(r)}}}function Mf(e,t,n){q.S(e,t,n);var r=Ef;if(r&&e){var i=_t(r).hoistableStyles,a=If(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=xf.get(a))&&Wf(e,n);var c=o=r.createElement(`link`);vt(c),Ud(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Uf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nf(e,t){q.X(e,t);var n=Ef;if(n&&e){var r=_t(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=f({src:e,async:!0},t),(t=xf.get(i))&&Gf(e,t),a=n.createElement(`script`),vt(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t){q.M(e,t);var n=Ef;if(n&&e){var r=_t(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=xf.get(i))&&Gf(e,t),a=n.createElement(`script`),vt(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t,n,r){var a=(a=le.current)?Cf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=If(n.href),n=_t(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=If(n.href);var o=_t(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Lf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),xf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},xf.set(e,n),o||zf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Bf(n),n=_t(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function If(e){return`href="`+Lt(e)+`"`}function Lf(e){return`link[rel="stylesheet"][`+e+`]`}function Rf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function zf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ud(t,`link`,n),vt(t),e.head.appendChild(t))}function Bf(e){return`[src="`+Lt(e)+`"]`}function Vf(e){return`script[async]`+e}function Hf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Lt(n.href)+`"]`);if(r)return t.instance=r,vt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),vt(r),Ud(r,`style`,a),Uf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=If(n.href);var o=e.querySelector(Lf(a));if(o)return t.state.loading|=4,t.instance=o,vt(o),o;r=Rf(n),(a=xf.get(a))&&Wf(r,a),o=(e.ownerDocument||e).createElement(`link`),vt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ud(o,`link`,r),t.state.loading|=4,Uf(o,n.precedence,e),t.instance=o;case`script`:return o=Bf(n.src),(a=e.querySelector(Vf(o)))?(t.instance=a,vt(a),a):(r=n,(a=xf.get(o))&&(r=f({},n),Gf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),vt(a),Ud(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Uf(r,n.precedence,e));return t.instance}function Uf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Kf=null;function qf(e,t,n){if(Kf===null){var r=new Map,i=Kf=new Map;i.set(n,r)}else i=Kf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ft]||a[ot]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Jf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Yf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Xf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=If(r.href),a=t.querySelector(Lf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ep.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,vt(a);return}a=t.ownerDocument||t,r=Rf(r),(i=xf.get(i))&&Wf(r,i),a=a.createElement(`link`),vt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ud(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ep.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Qf=0;function $f(e,t){return e.stylesheets&&e.count===0&&np(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&np(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Qf===0&&(Qf=62500*Kd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&np(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ep(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)np(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var tp=null;function np(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,tp=new Map,t.forEach(rp,e),tp=null,ep.call(e))}function rp(e,t){if(!(t.state.loading&4)){var n=tp.get(e);if(n)var r=n.get(null);else{n=new Map,tp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ep.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ip={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function ap(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function op(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ap(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ba(a),e}function sp(e){return e?(e=ai,e):ai}function cp(e,t,n,r,i,a){i=sp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ha(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ua(e,r,t),n!==null&&(Su(n,e,t),Wa(n,e,t))}function lp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function up(e,t){lp(e,t),(e=e.alternate)&&lp(e,t)}function dp(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&Su(t,e,67108864),up(e,67108864)}}function fp(e){if(e.tag===13||e.tag===31){var t=bu();t=tt(t);var n=ni(e,t);n!==null&&Su(n,e,t),up(e,t)}}var pp=!0;function mp(e,t,n,r){var i=P.T;P.T=null;var a=ne.p;try{ne.p=2,gp(e,t,n,r)}finally{ne.p=a,P.T=i}}function hp(e,t,n,r){var i=P.T;P.T=null;var a=ne.p;try{ne.p=8,gp(e,t,n,r)}finally{ne.p=a,P.T=i}}function gp(e,t,n,r){if(pp){var i=_p(r);if(i===null)Nd(e,t,r,vp,n),kp(e,r);else if(jp(i,e,t,n,r))r.stopPropagation();else if(kp(e,r),t&4&&-1<Op.indexOf(e)){for(;i!==null;){var a=ht(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ze(o);s.entanglements[1]|=c,o&=~c}dd(a),!(Vl&6)&&(cu=De()+500,fd(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&Su(s,a,2),Du(),up(a,2)}if(a=_p(r),a===null&&Nd(e,t,r,vp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Nd(e,t,r,null,n)}}function _p(e){return e=en(e),yp(e)}var vp=null;function yp(e){if(vp=null,e=mt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return vp=e,null}function bp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var xp=!1,Sp=null,Cp=null,wp=null,Tp=new Map,Ep=new Map,Dp=[],Op=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function kp(e,t){switch(e){case`focusin`:case`focusout`:Sp=null;break;case`dragenter`:case`dragleave`:Cp=null;break;case`mouseover`:case`mouseout`:wp=null;break;case`pointerover`:case`pointerout`:Tp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ep.delete(t.pointerId)}}function Ap(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ht(t),t!==null&&dp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function jp(e,t,n,r,i){switch(t){case`focusin`:return Sp=Ap(Sp,e,t,n,r,i),!0;case`dragenter`:return Cp=Ap(Cp,e,t,n,r,i),!0;case`mouseover`:return wp=Ap(wp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Tp.set(a,Ap(Tp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ep.set(a,Ap(Ep.get(a)||null,e,t,n,r,i)),!0}return!1}function Mp(e){var t=mt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,it(e.priority,function(){fp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,it(e.priority,function(){fp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Np(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_p(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);$t=r,n.target.dispatchEvent(r),$t=null}else return t=ht(n),t!==null&&dp(t),e.blockedOn=n,!1;t.shift()}return!0}function Pp(e,t,n){Np(e)&&n.delete(t)}function Fp(){xp=!1,Sp!==null&&Np(Sp)&&(Sp=null),Cp!==null&&Np(Cp)&&(Cp=null),wp!==null&&Np(wp)&&(wp=null),Tp.forEach(Pp),Ep.forEach(Pp)}function Ip(e,n){e.blockedOn===n&&(e.blockedOn=null,xp||(xp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Fp)))}var Lp=null;function Rp(e){Lp!==e&&(Lp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Lp===e&&(Lp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(yp(r||n)===null)continue;break}var a=ht(n);a!==null&&(e.splice(t,3),t-=3,V(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function zp(e){function t(t){return Ip(t,e)}Sp!==null&&Ip(Sp,e),Cp!==null&&Ip(Cp,e),wp!==null&&Ip(wp,e),Tp.forEach(t),Ep.forEach(t);for(var n=0;n<Dp.length;n++){var r=Dp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Dp.length&&(n=Dp[0],n.blockedOn===null);)Mp(n),n.blockedOn===null&&Dp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[st]||null;if(typeof a==`function`)o||Rp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[st]||null)s=o.formAction;else if(yp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Rp(n)}}}function Bp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Vp(e){this._internalRoot=e}Hp.prototype.render=Vp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;cp(n,bu(),e,t,null,null)},Hp.prototype.unmount=Vp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cp(e.current,2,null,e,null,null),Du(),t[ct]=null}};function Hp(e){this._internalRoot=e}Hp.prototype.unstable_scheduleHydration=function(e){if(e){var t=rt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dp.length&&t!==0&&t<Dp[n].priority;n++);Dp.splice(n,0,e),n===0&&Mp(e)}};var Up=n.version;if(Up!==`19.2.5`)throw Error(i(527,Up,`19.2.5`));ne.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Wp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Gp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gp.isDisabled&&Gp.supportsFiber)try{Ie=Gp.inject(Wp),Le=Gp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ys,s=Xs,c=Zs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=op(e,1,!1,null,null,n,r,null,o,s,c,Bp),e[ct]=t.current,jd(e),new Vp(t)}})),y=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=v()})),b=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},x=new class extends b{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},S={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},C=new class{#e=S;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function w(e){setTimeout(e,0)}var T=typeof window>`u`||`Deno`in globalThis;function E(){}function D(e,t){return typeof e==`function`?e(t):e}function O(e){return typeof e==`number`&&e>=0&&e!==1/0}function k(e,t){return Math.max(e+(t||0)-Date.now(),0)}function A(e,t){return typeof e==`function`?e(t):e}function j(e,t){return typeof e==`function`?e(t):e}function M(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ee(o,t.options))return!1}else if(!P(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function N(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(te(t.options.mutationKey)!==te(a))return!1}else if(!P(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ee(e,t){return(t?.queryKeyHashFn||te)(e)}function te(e){return JSON.stringify(e,(e,t)=>F(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function P(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>P(e[n],t[n])):!1}var ne=Object.prototype.hasOwnProperty;function re(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ae(e)&&ae(t);if(!r&&!(F(e)&&F(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ne.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=re(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ie(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ae(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function F(e){if(!I(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!I(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function I(e){return Object.prototype.toString.call(e)===`[object Object]`}function oe(e){return new Promise(t=>{C.setTimeout(t,e)})}function se(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:re(e,t)}function ce(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function le(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ue=Symbol();function de(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ue?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function fe(e,t){return typeof e==`function`?e(...t):!!e}function pe(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var me=(()=>{let e=()=>T;return{isServer(){return e()},setIsServer(t){e=t}}})();function he(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ge=w;function _e(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ge,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ve=_e(),ye=new class extends b{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function be(e){return Math.min(1e3*2**e,3e4)}function xe(e){return(e??`online`)===`online`?ye.isOnline():!0}var Se=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ce(e){let t=!1,n=0,r,i=he(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Se(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>x.isFocused()&&(e.networkMode===`always`||ye.isOnline())&&e.canRun(),u=()=>xe(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(me.isServer()?0:3),o=e.retryDelay??be,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),oe(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var we=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),O(this.gcTime)&&(this.#e=C.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(me.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(C.clearTimeout(this.#e),this.#e=void 0)}},Te=class extends we{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Oe(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Oe(this.options);e.data!==void 0&&(this.setState(De(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=se(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(E).catch(E):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>j(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ue||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>A(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!k(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=de(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=Ce({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Se&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Se){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ee(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...De(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),ve.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Ee(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function De(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Oe(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ke=class extends b{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=he(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),je(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Me(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Me(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof j(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ie(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ne(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||j(this.options.enabled,this.#t)!==j(t.enabled,this.#t)||A(this.options.staleTime,this.#t)!==A(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||j(this.options.enabled,this.#t)!==j(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Fe(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(E)),t}#g(){this.#b();let e=A(this.options.staleTime,this.#t);if(me.isServer()||this.#r.isStale||!O(e))return;let t=k(this.#r.dataUpdatedAt,e)+1;this.#d=C.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(me.isServer()||j(this.options.enabled,this.#t)===!1||!O(this.#p)||this.#p===0)&&(this.#f=C.setInterval(()=>{(this.options.refetchIntervalInBackground||x.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(C.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(C.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&je(e,t),o=i&&Ne(e,n,t,r);(a||o)&&(l={...l,...Ee(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=se(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=se(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Pe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:j(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=he())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!ie(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){ve.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ae(e,t){return j(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function je(e,t){return Ae(e,t)||e.state.data!==void 0&&Me(e,t,t.refetchOnMount)}function Me(e,t,n){if(j(t.enabled,e)!==!1&&A(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Pe(e,t)}return!1}function Ne(e,t,n,r){return(e!==t||j(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Pe(e,n)}function Pe(e,t){return j(t.enabled,e)!==!1&&e.isStaleByTime(A(t.staleTime,e))}function Fe(e,t){return!ie(e.getCurrentResult(),t)}function Ie(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{pe(e,()=>t.signal,()=>n=!0)},u=de(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?le:ce;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Re:Le,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Le(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Le(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Re(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ze=class extends we{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Be(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Ce({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),ve.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Be(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ve=class extends b{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new ze({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=He(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=He(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=He(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=He(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ve.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>N(t,e))}findAll(e={}){return this.getAll().filter(t=>N(e,t))}notify(e){ve.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ve.batch(()=>Promise.all(e.map(e=>e.continue().catch(E))))}};function He(e){return e.options.scope?.id}var Ue=class extends b{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ie(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&te(t.mutationKey)!==te(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Be();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ve.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},We=class extends b{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ee(r,t),a=this.get(i);return a||(a=new Te({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ve.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>M(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>M(e,t)):t}notify(e){ve.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ve.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ve.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ge=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new We,this.#t=e.mutationCache||new Ve,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=x.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ye.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(A(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=D(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ve.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ve.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ve.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=ve.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(E).catch(E)}invalidateQueries(e,t={}){return ve.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ve.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(E)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(E)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(A(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(E).catch(E)}fetchInfiniteQuery(e){return e.behavior=Ie(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(E).catch(E)}ensureInfiniteQueryData(e){return e.behavior=Ie(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ye.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(te(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{P(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(te(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{P(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ee(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ue&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ke=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),qe=s(((e,t)=>{t.exports=Ke()})),L=u(p(),1),R=qe(),Je=L.createContext(void 0),Ye=e=>{let t=L.useContext(Je);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Xe=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(Je.Provider,{value:e,children:t})),Ze=L.createContext(!1),Qe=()=>L.useContext(Ze);Ze.Provider;function $e(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var et=L.createContext($e()),tt=()=>L.useContext(et),nt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?fe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},rt=e=>{L.useEffect(()=>{e.clearReset()},[e])},it=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||fe(n,[e.error,r])),at=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ot=(e,t)=>e.isLoading&&e.isFetching&&!t,st=(e,t)=>e?.suspense&&t.isPending,ct=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function lt(e,t,n){let r=Qe(),i=tt(),a=Ye(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,at(o),nt(o,i,s),rt(i);let c=!a.getQueryCache().get(o.queryHash),[l]=L.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(L.useSyncExternalStore(L.useCallback(e=>{let t=d?l.subscribe(ve.batchCalls(e)):E;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),L.useEffect(()=>{l.setOptions(o)},[o,l]),st(o,u))throw ct(o,l,i);if(it({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!me.isServer()&&ot(u,r)&&(c?ct(o,l,i):s?.promise)?.catch(E).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function ut(e,t){return lt(e,ke,t)}function z(e,t){let n=Ye(t),[r]=L.useState(()=>new Ue(n,e));L.useEffect(()=>{r.setOptions(e)},[r,e]);let i=L.useSyncExternalStore(L.useCallback(e=>r.subscribe(ve.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=L.useCallback((e,t)=>{r.mutate(e,t).catch(E)},[r]);if(i.error&&fe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var dt=`modulepreload`,ft=function(e){return`/`+e},pt={},mt=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=ft(t,n),t in pt)return;pt[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:dt,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ht=`popstate`;function gt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function _t(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return St(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Ct(t)}return Tt(t,n,null,e)}function vt(e,t){if(e===!1||e==null)throw Error(t)}function yt(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function bt(){return Math.random().toString(36).substring(2,10)}function xt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function St(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?wt(t):t,state:n,key:t&&t.key||r||bt(),unstable_mask:i}}function Ct({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function wt(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Tt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=gt(e)?e:St(h.location,e,t);n&&n(r,e),l=u()+1;let d=xt(r,l),f=h.createHref(r.unstable_mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=gt(e)?e:St(h.location,e,t);n&&n(r,e),l=u();let i=xt(r,l),d=h.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Et(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(ht,d),c=e,()=>{i.removeEventListener(ht,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Et(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),vt(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:Ct(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function Dt(e,t,n=`/`){return Ot(e,t,n,!1)}function Ot(e,t,n,r){let i=Kt((typeof t==`string`?wt(t):t).pathname||`/`,n);if(i==null)return null;let a=At(e);Mt(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=Gt(i);o=Ht(a[e],t,r)}return o}function kt(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function At(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;vt(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=tn([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(vt(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),At(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Bt(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of jt(e.path))a(e,t,!0,n)}),t}function jt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=jt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Mt(e){e.sort((e,t)=>e.score===t.score?Vt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Nt=/^:[\w-]+$/,Pt=3,Ft=2,It=1,Lt=10,Rt=-2,zt=e=>e===`*`;function Bt(e,t){let n=e.split(`/`),r=n.length;return n.some(zt)&&(r+=Rt),t&&(r+=Ft),n.filter(e=>!zt(e)).reduce((e,t)=>e+(Nt.test(t)?Pt:t===``?It:Lt),r)}function Vt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Ht(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=Ut({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Ut({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:tn([a,u.pathname]),pathnameBase:rn(tn([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=tn([a,u.pathnameBase]))}return o}function Ut(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Wt(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Wt(e,t=!1,n=!0){yt(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Gt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return yt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Kt(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var qt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Jt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?wt(e):e,a;return n?(n=en(n),a=n.startsWith(`/`)?Yt(n.substring(1),`/`):Yt(n,t)):a=t,{pathname:a,search:an(r),hash:on(i)}}function Yt(e,t){let n=nn(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Xt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Zt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Qt(e){let t=Zt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function $t(e,t,n,r=!1){let i;typeof e==`string`?i=wt(e):(i={...e},vt(!i.pathname||!i.pathname.includes(`?`),Xt(`?`,`pathname`,`search`,i)),vt(!i.pathname||!i.pathname.includes(`#`),Xt(`#`,`pathname`,`hash`,i)),vt(!i.search||!i.search.includes(`#`),Xt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Jt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var en=e=>e.replace(/\/\/+/g,`/`),tn=e=>en(e.join(`/`)),nn=e=>e.replace(/\/+$/,``),rn=e=>nn(e).replace(/^\/*/,`/`),an=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,on=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,sn=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function cn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ln(e){return tn(e.map(e=>e.route.path).filter(Boolean))||`/`}var un=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function dn(e,t){let n=e;if(typeof n!=`string`||!qt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(un)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=Kt(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{yt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var fn=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(fn);var pn=[`GET`,...fn];new Set(pn);var mn=L.createContext(null);mn.displayName=`DataRouter`;var hn=L.createContext(null);hn.displayName=`DataRouterState`;var gn=L.createContext(!1);function _n(){return L.useContext(gn)}var vn=L.createContext({isTransitioning:!1});vn.displayName=`ViewTransition`;var yn=L.createContext(new Map);yn.displayName=`Fetchers`;var bn=L.createContext(null);bn.displayName=`Await`;var xn=L.createContext(null);xn.displayName=`Navigation`;var Sn=L.createContext(null);Sn.displayName=`Location`;var Cn=L.createContext({outlet:null,matches:[],isDataRoute:!1});Cn.displayName=`Route`;var wn=L.createContext(null);wn.displayName=`RouteError`;var Tn=`REACT_ROUTER_ERROR`,En=`REDIRECT`,Dn=`ROUTE_ERROR_RESPONSE`;function On(e){if(e.startsWith(`${Tn}:${En}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function kn(e){if(e.startsWith(`${Tn}:${Dn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new sn(t.status,t.statusText,t.data)}catch{}}function An(e,{relative:t}={}){vt(jn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=L.useContext(xn),{hash:i,pathname:a,search:o}=Rn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:tn([n,a])),r.createHref({pathname:s,search:o,hash:i})}function jn(){return L.useContext(Sn)!=null}function Mn(){return vt(jn(),`useLocation() may be used only in the context of a <Router> component.`),L.useContext(Sn).location}var Nn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Pn(e){L.useContext(xn).static||L.useLayoutEffect(e)}function Fn(){let{isDataRoute:e}=L.useContext(Cn);return e?rr():In()}function In(){vt(jn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=L.useContext(mn),{basename:t,navigator:n}=L.useContext(xn),{matches:r}=L.useContext(Cn),{pathname:i}=Mn(),a=JSON.stringify(Qt(r)),o=L.useRef(!1);return Pn(()=>{o.current=!0}),L.useCallback((r,s={})=>{if(yt(o.current,Nn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=$t(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:tn([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}L.createContext(null);function Ln(){let{matches:e}=L.useContext(Cn),t=e[e.length-1];return t?t.params:{}}function Rn(e,{relative:t}={}){let{matches:n}=L.useContext(Cn),{pathname:r}=Mn(),i=JSON.stringify(Qt(n));return L.useMemo(()=>$t(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function zn(e,t){return Bn(e,t)}function Bn(e,t,n){vt(jn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=L.useContext(xn),{matches:i}=L.useContext(Cn),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;ar(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
-
11
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Mn(),d;if(t){let e=typeof t==`string`?wt(t):t;vt(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=Dt(e,{pathname:p});yt(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),yt(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=qn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:tn([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:tn([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?L.createElement(Sn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},h):h}function Vn(){let e=nr(),t=cn(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=L.createElement(L.Fragment,null,L.createElement(`p`,null,`💿 Hey developer 👋`),L.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,L.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,L.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),L.createElement(L.Fragment,null,L.createElement(`h2`,null,`Unexpected Application Error!`),L.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?L.createElement(`pre`,{style:i},n):null,o)}var Hn=L.createElement(Vn,null),Un=class extends L.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=kn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:L.createElement(Cn.Provider,{value:this.props.routeContext},L.createElement(wn.Provider,{value:e,children:this.props.component}));return this.context?L.createElement(Gn,{error:e},t):t}};Un.contextType=gn;var Wn=new WeakMap;function Gn({children:e,error:t}){let{basename:n}=L.useContext(xn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=On(t.digest);if(e){let r=Wn.get(t);if(r)throw r;let i=dn(e.location,n);if(un&&!Wn.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Wn.set(t,n),n}return L.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Kn({routeContext:e,match:t,children:n}){let r=L.useContext(mn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),L.createElement(Cn.Provider,{value:e},n)}function qn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);vt(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:ln(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Hn,o&&(s<0&&c===0?(ar(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?L.createElement(n.route.Component,null):n.route.element?n.route.element:e,L.createElement(Kn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?L.createElement(Un,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Jn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yn(e){let t=L.useContext(mn);return vt(t,Jn(e)),t}function Xn(e){let t=L.useContext(hn);return vt(t,Jn(e)),t}function Zn(e){let t=L.useContext(Cn);return vt(t,Jn(e)),t}function Qn(e){let t=Zn(e),n=t.matches[t.matches.length-1];return vt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function $n(){return Qn(`useRouteId`)}function er(){return Xn(`useNavigation`).navigation}function tr(){let{matches:e,loaderData:t}=Xn(`useMatches`);return L.useMemo(()=>e.map(e=>kt(e,t)),[e,t])}function nr(){let e=L.useContext(wn),t=Xn(`useRouteError`),n=Qn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function rr(){let{router:e}=Yn(`useNavigate`),t=Qn(`useNavigate`),n=L.useRef(!1);return Pn(()=>{n.current=!0}),L.useCallback(async(r,i={})=>{yt(n.current,Nn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ir={};function ar(e,t,n){!t&&!ir[e]&&(ir[e]=!0,yt(!1,n))}L.useOptimistic,L.memo(or);function or({routes:e,future:t,state:n,isStatic:r,onError:i}){return Bn(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function sr({to:e,replace:t,state:n,relative:r}){vt(jn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=L.useContext(xn);yt(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=L.useContext(Cn),{pathname:o}=Mn(),s=Fn(),c=$t(e,Qt(a),o,r===`path`),l=JSON.stringify(c);return L.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function cr(e){vt(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function lr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){vt(!jn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=L.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=wt(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,unstable_mask:m}=n,h=L.useMemo(()=>{let e=Kt(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,unstable_mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return yt(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:L.createElement(xn.Provider,{value:c},L.createElement(Sn.Provider,{children:t,value:h}))}function ur({children:e,location:t}){return zn(dr(e),t)}L.Component;function dr(e,t=[]){let n=[];return L.Children.forEach(e,(e,r)=>{if(!L.isValidElement(e))return;let i=[...t,r];if(e.type===L.Fragment){n.push.apply(n,dr(e.props.children,i));return}vt(e.type===cr,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),vt(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=dr(e.props.children,i)),n.push(a)}),n}var fr=`get`,pr=`application/x-www-form-urlencoded`;function mr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function hr(e){return mr(e)&&e.tagName.toLowerCase()===`button`}function gr(e){return mr(e)&&e.tagName.toLowerCase()===`form`}function _r(e){return mr(e)&&e.tagName.toLowerCase()===`input`}function vr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yr(e,t){return e.button===0&&(!t||t===`_self`)&&!vr(e)}var br=null;function xr(){if(br===null)try{new FormData(document.createElement(`form`),0),br=!1}catch{br=!0}return br}var Sr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Cr(e){return e!=null&&!Sr.has(e)?(yt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${pr}"`),null):e}function wr(e,t){let n,r,i,a,o;if(gr(e)){let o=e.getAttribute(`action`);r=o?Kt(o,t):null,n=e.getAttribute(`method`)||fr,i=Cr(e.getAttribute(`enctype`))||pr,a=new FormData(e)}else if(hr(e)||_r(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Kt(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||fr,i=Cr(e.getAttribute(`formenctype`))||Cr(o.getAttribute(`enctype`))||pr,a=new FormData(o,e),!xr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(mr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=fr,r=null,i=pr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Tr={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Er=/[&><\u2028\u2029]/g;function Dr(e){return e.replace(Er,e=>Tr[e])}function Or(e,t){if(e===!1||e==null)throw Error(t)}function kr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Kt(i.pathname,t)===`/`?i.pathname=`${nn(t)}/_root.${r}`:i.pathname=`${nn(i.pathname)}.${r}`,i}async function Ar(e,t){if(e.id in t)return t[e.id];try{let n=await mt(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function jr(e){return e!=null&&typeof e.page==`string`}function Mr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Nr(e,t,n){return Rr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Ar(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Mr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Pr(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Fr(e,t,{includeHydrateFallback:n}={}){return Ir(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Ir(e){return[...new Set(e)]}function Lr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Rr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!jr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Lr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function zr(){let e=L.useContext(mn);return Or(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Br(){let e=L.useContext(hn);return Or(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Vr=L.createContext(void 0);Vr.displayName=`FrameworkContext`;function Hr(){let e=L.useContext(Vr);return Or(e,`You must render this element inside a <HydratedRouter> element`),e}function Ur(e,t){let n=L.useContext(Vr),[r,i]=L.useState(!1),[a,o]=L.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=L.useRef(null);L.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),L.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Wr(s,p),onBlur:Wr(c,m),onMouseEnter:Wr(l,p),onMouseLeave:Wr(u,m),onTouchStart:Wr(d,p)}]:[a,f,{}]:[!1,f,{}]}function Wr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Gr({page:e,...t}){let n=_n(),{router:r}=zr(),i=L.useMemo(()=>Dt(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?L.createElement(qr,{page:e,matches:i,...t}):L.createElement(Jr,{page:e,matches:i,...t}):null}function Kr(e){let{manifest:t,routeModules:n}=Hr(),[r,i]=L.useState([]);return L.useEffect(()=>{let r=!1;return Nr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function qr({page:e,matches:t,...n}){let r=Mn(),{future:i}=Hr(),{basename:a}=zr(),o=L.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=kr(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return L.createElement(L.Fragment,null,o.map(e=>L.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Jr({page:e,matches:t,...n}){let r=Mn(),{future:i,manifest:a,routeModules:o}=Hr(),{basename:s}=zr(),{loaderData:c,matches:l}=Br(),u=L.useMemo(()=>Pr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=L.useMemo(()=>Pr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=L.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=kr(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=L.useMemo(()=>Fr(d,a),[d,a]),m=Kr(d);return L.createElement(L.Fragment,null,f.map(e=>L.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>L.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>L.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Yr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}L.Component;var Xr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Xr&&(window.__reactRouterVersion=`7.14.1`)}catch{}function Zr({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=L.useRef();i.current??=_t({window:r,v5Compat:!0});let a=i.current,[o,s]=L.useState({action:a.action,location:a.location}),c=L.useCallback(e=>{n===!1?s(e):L.startTransition(()=>s(e))},[n]);return L.useLayoutEffect(()=>a.listen(c),[a,c]),L.createElement(lr,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function Qr({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=L.useState({action:n.action,location:n.location}),o=L.useCallback(e=>{r===!1?a(e):L.startTransition(()=>a(e))},[r]);return L.useLayoutEffect(()=>n.listen(o),[n,o]),L.createElement(lr,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}Qr.displayName=`unstable_HistoryRouter`;var $r=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ei=L.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,unstable_useTransitions:_}=L.useContext(xn),v=typeof l==`string`&&$r.test(l),y=dn(l,h);l=y.to;let b=An(l,{relative:r}),x=Mn(),S=null;if(o){let e=$t(o,[],x.unstable_mask?x.unstable_mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:tn([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=Ur(n,p),E=si(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=L.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:Yr(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?L.createElement(L.Fragment,null,k,L.createElement(Gr,{page:b})):k});ei.displayName=`Link`;var ti=L.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Rn(a,{relative:c.relative}),d=Mn(),f=L.useContext(hn),{navigator:p,basename:m}=L.useContext(xn),h=f!=null&&_i(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Kt(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return L.createElement(ei,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});ti.displayName=`NavLink`;var ni=L.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=fr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=L.useContext(xn),g=ui(),_=di(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&$r.test(s);return L.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});h&&n!==!1?L.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});ni.displayName=`Form`;function ri({getKey:e,storageKey:t,...n}){let r=L.useContext(Vr),{basename:i}=L.useContext(xn),a=Mn(),o=tr();hi({getKey:e,storageKey:t});let s=L.useMemo(()=>{if(!r||!e)return null;let t=mi(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return L.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Dr(JSON.stringify(t||fi))}, ${Dr(JSON.stringify(s))})`}})}ri.displayName=`ScrollRestoration`;function ii(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ai(e){let t=L.useContext(mn);return vt(t,ii(e)),t}function oi(e){let t=L.useContext(hn);return vt(t,ii(e)),t}function si(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=Fn(),d=Mn(),f=Rn(e,{relative:o});return L.useCallback(p=>{if(yr(p,t)){p.preventDefault();let t=n===void 0?Ct(d)===Ct(f):n,m=()=>u(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?L.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var ci=0,li=()=>`__${String(++ci)}__`;function ui(){let{router:e}=ai(`useSubmit`),{basename:t}=L.useContext(xn),n=$n(),r=e.fetch,i=e.navigate;return L.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=wr(e,t);a.navigate===!1?await r(a.fetcherKey||li(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function di(e,{relative:t}={}){let{basename:n}=L.useContext(xn),r=L.useContext(Cn);vt(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Rn(e||`.`,{relative:t})},o=Mn();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:tn([n,a.pathname])),Ct(a)}var fi=`react-router-scroll-positions`,pi={};function mi(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Kt(e.pathname,n)||e.pathname},t)),i??=e.key,i}function hi({getKey:e,storageKey:t}={}){let{router:n}=ai(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=oi(`useScrollRestoration`),{basename:a}=L.useContext(xn),o=Mn(),s=tr(),c=er();L.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),gi(L.useCallback(()=>{if(c.state===`idle`){let t=mi(o,s,a,e);pi[t]=window.scrollY}try{sessionStorage.setItem(t||fi,JSON.stringify(pi))}catch(e){yt(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(L.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||fi);e&&(pi=JSON.parse(e))}catch{}},[t]),L.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(pi,()=>window.scrollY,e?(t,n)=>mi(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),L.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{yt(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function gi(e,t){let{capture:n}=t||{};L.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function _i(e,{relative:t}={}){let n=L.useContext(vn);vt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ai(`useViewTransitionState`),i=Rn(e,{relative:t});if(!n.isTransitioning)return!1;let a=Kt(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Kt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ut(i.pathname,o)!=null||Ut(i.pathname,a)!=null}function vi(e,t){return function(){return e.apply(t,arguments)}}var{toString:yi}=Object.prototype,{getPrototypeOf:bi}=Object,{iterator:xi,toStringTag:Si}=Symbol,Ci=(e=>t=>{let n=yi.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),wi=e=>(e=e.toLowerCase(),t=>Ci(t)===e),Ti=e=>t=>typeof t===e,{isArray:Ei}=Array,Di=Ti(`undefined`);function Oi(e){return e!==null&&!Di(e)&&e.constructor!==null&&!Di(e.constructor)&&Mi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var ki=wi(`ArrayBuffer`);function Ai(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ki(e.buffer),t}var ji=Ti(`string`),Mi=Ti(`function`),Ni=Ti(`number`),Pi=e=>typeof e==`object`&&!!e,Fi=e=>e===!0||e===!1,Ii=e=>{if(Ci(e)!==`object`)return!1;let t=bi(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Si in e)&&!(xi in e)},Li=e=>{if(!Pi(e)||Oi(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ri=wi(`Date`),zi=wi(`File`),Bi=e=>!!(e&&e.uri!==void 0),Vi=e=>e&&e.getParts!==void 0,Hi=wi(`Blob`),Ui=wi(`FileList`),Wi=e=>Pi(e)&&Mi(e.pipe);function Gi(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var Ki=Gi(),qi=Ki.FormData===void 0?void 0:Ki.FormData,Ji=e=>{if(!e)return!1;if(qi&&e instanceof qi)return!0;let t=bi(e);if(!t||t===Object.prototype||!Mi(e.append))return!1;let n=Ci(e);return n===`formdata`||n===`object`&&Mi(e.toString)&&e.toString()===`[object FormData]`},Yi=wi(`URLSearchParams`),[Xi,Zi,Qi,$i]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(wi),ea=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function ta(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),Ei(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Oi(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function na(e,t){if(Oi(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}var ra=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,ia=e=>!Di(e)&&e!==ra;function aa(){let{caseless:e,skipUndefined:t}=ia(this)&&this||{},n={},r=(r,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=e&&na(n,i)||i;Ii(n[a])&&Ii(r)?n[a]=aa(n[a],r):Ii(r)?n[a]=aa({},r):Ei(r)?n[a]=r.slice():(!t||!Di(r))&&(n[a]=r)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ta(arguments[e],r);return n}var oa=(e,t,n,{allOwnKeys:r}={})=>(ta(t,(t,r)=>{n&&Mi(t)?Object.defineProperty(e,r,{value:vi(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),sa=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ca=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,`constructor`,{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,`super`,{value:t.prototype}),n&&Object.assign(e.prototype,n)},la=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&bi(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ua=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},da=e=>{if(!e)return null;if(Ei(e))return e;let t=e.length;if(!Ni(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},fa=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&bi(Uint8Array)),pa=(e,t)=>{let n=(e&&e[xi]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},ma=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},ha=wi(`HTMLFormElement`),ga=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),_a=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),va=wi(`RegExp`),ya=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};ta(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},ba=e=>{ya(e,(t,n)=>{if(Mi(e)&&[`arguments`,`caller`,`callee`].indexOf(n)!==-1)return!1;let r=e[n];if(Mi(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},xa=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Ei(e)?r(e):r(String(e).split(t)),n},Sa=()=>{},Ca=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function wa(e){return!!(e&&Mi(e.append)&&e[Si]===`FormData`&&e[xi])}var Ta=e=>{let t=Array(10),n=(e,r)=>{if(Pi(e)){if(t.indexOf(e)>=0)return;if(Oi(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=Ei(e)?[]:{};return ta(e,(e,t)=>{let a=n(e,r+1);!Di(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},Ea=wi(`AsyncFunction`),Da=e=>e&&(Pi(e)||Mi(e))&&Mi(e.then)&&Mi(e.catch),Oa=((e,t)=>e?setImmediate:t?((e,t)=>(ra.addEventListener(`message`,({source:n,data:r})=>{n===ra&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),ra.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,Mi(ra.postMessage)),B={isArray:Ei,isArrayBuffer:ki,isBuffer:Oi,isFormData:Ji,isArrayBufferView:Ai,isString:ji,isNumber:Ni,isBoolean:Fi,isObject:Pi,isPlainObject:Ii,isEmptyObject:Li,isReadableStream:Xi,isRequest:Zi,isResponse:Qi,isHeaders:$i,isUndefined:Di,isDate:Ri,isFile:zi,isReactNativeBlob:Bi,isReactNative:Vi,isBlob:Hi,isRegExp:va,isFunction:Mi,isStream:Wi,isURLSearchParams:Yi,isTypedArray:fa,isFileList:Ui,forEach:ta,merge:aa,extend:oa,trim:ea,stripBOM:sa,inherits:ca,toFlatObject:la,kindOf:Ci,kindOfTest:wi,endsWith:ua,toArray:da,forEachEntry:pa,matchAll:ma,isHTMLForm:ha,hasOwnProperty:_a,hasOwnProp:_a,reduceDescriptors:ya,freezeMethods:ba,toObjectSet:xa,toCamelCase:ga,noop:Sa,toFiniteNumber:Ca,findKey:na,global:ra,isContextDefined:ia,isSpecCompliantForm:wa,toJSONObject:Ta,isAsyncFn:Ea,isThenable:Da,setImmediate:Oa,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(ra):typeof process<`u`&&process.nextTick||Oa,isIterable:e=>e!=null&&Mi(e[xi])},ka=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,`message`,{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:B.toJSONObject(this.config),code:this.code,status:this.status}}};ka.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,ka.ERR_BAD_OPTION=`ERR_BAD_OPTION`,ka.ECONNABORTED=`ECONNABORTED`,ka.ETIMEDOUT=`ETIMEDOUT`,ka.ERR_NETWORK=`ERR_NETWORK`,ka.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,ka.ERR_DEPRECATED=`ERR_DEPRECATED`,ka.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,ka.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,ka.ERR_CANCELED=`ERR_CANCELED`,ka.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,ka.ERR_INVALID_URL=`ERR_INVALID_URL`,ka.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function Aa(e){return B.isPlainObject(e)||B.isArray(e)}function ja(e){return B.endsWith(e,`[]`)?e.slice(0,-2):e}function Ma(e,t,n){return e?e.concat(t).map(function(e,t){return e=ja(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function Na(e){return B.isArray(e)&&!e.some(Aa)}var Pa=B.toFlatObject(B,{},null,function(e){return/^is[A-Z]/.test(e)});function Fa(e,t,n){if(!B.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=B.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!B.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||d,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=s&&B.isSpecCompliantForm(t);if(!B.isFunction(i))throw TypeError(`visitor must be a function`);function u(e){if(e===null)return``;if(B.isDate(e))return e.toISOString();if(B.isBoolean(e))return e.toString();if(!l&&B.isBlob(e))throw new ka(`Blob is not supported. Use a Buffer instead.`);return B.isArrayBuffer(e)||B.isTypedArray(e)?l&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function d(e,n,i){let s=e;if(B.isReactNative(t)&&B.isReactNativeBlob(e))return t.append(Ma(i,n,a),u(e)),!1;if(e&&!i&&typeof e==`object`){if(B.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(B.isArray(e)&&Na(e)||(B.isFileList(e)||B.endsWith(n,`[]`))&&(s=B.toArray(e)))return n=ja(n),s.forEach(function(e,r){!(B.isUndefined(e)||e===null)&&t.append(o===!0?Ma([n],r,a):o===null?n:n+`[]`,u(e))}),!1}return Aa(e)?!0:(t.append(Ma(i,n,a),u(e)),!1)}let f=[],p=Object.assign(Pa,{defaultVisitor:d,convertValue:u,isVisitable:Aa});function m(e,n,r=0){if(!B.isUndefined(e)){if(r>c)throw new ka(`Object is too deeply nested (`+r+` levels). Max depth: `+c,ka.ERR_FORM_DATA_DEPTH_EXCEEDED);if(f.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));f.push(e),B.forEach(e,function(e,a){(!(B.isUndefined(e)||e===null)&&i.call(t,e,B.isString(a)?a.trim():a,n,p))===!0&&m(e,n?n.concat(a):[a],r+1)}),f.pop()}}if(!B.isObject(e))throw TypeError(`data must be an object`);return m(e),t}function Ia(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function La(e,t){this._pairs=[],e&&Fa(e,this,t)}var Ra=La.prototype;Ra.append=function(e,t){this._pairs.push([e,t])},Ra.toString=function(e){let t=e?function(t){return e.call(this,t,Ia)}:Ia;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function za(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function Ba(e,t,n){if(!t)return e;let r=n&&n.encode||za,i=B.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):B.isURLSearchParams(t)?t.toString():new La(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var Va=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){B.forEach(this.handlers,function(t){t!==null&&e(t)})}},Ha={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Ua={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:La,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},Wa=c({hasBrowserEnv:()=>Ga,hasStandardBrowserEnv:()=>qa,hasStandardBrowserWebWorkerEnv:()=>Ja,navigator:()=>Ka,origin:()=>Ya}),Ga=typeof window<`u`&&typeof document<`u`,Ka=typeof navigator==`object`&&navigator||void 0,qa=Ga&&(!Ka||[`ReactNative`,`NativeScript`,`NS`].indexOf(Ka.product)<0),Ja=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,Ya=Ga&&window.location.href||`http://localhost`,Xa={...Wa,...Ua};function Za(e,t){return Fa(e,new Xa.classes.URLSearchParams,{visitor:function(e,t,n,r){return Xa.isNode&&B.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function Qa(e){return B.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function $a(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function eo(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&B.isArray(r)?r.length:a,s?(B.hasOwnProp(r,a)?r[a]=B.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!r[a]||!B.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&B.isArray(r[a])&&(r[a]=$a(r[a])),!o)}if(B.isFormData(e)&&B.isFunction(e.entries)){let n={};return B.forEachEntry(e,(e,r)=>{t(Qa(e),r,n,0)}),n}return null}var to=(e,t)=>e!=null&&B.hasOwnProp(e,t)?e[t]:void 0;function no(e,t,n){if(B.isString(e))try{return(t||JSON.parse)(e),B.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var ro={transitional:Ha,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=B.isObject(e);if(i&&B.isHTMLForm(e)&&(e=new FormData(e)),B.isFormData(e))return r?JSON.stringify(eo(e)):e;if(B.isArrayBuffer(e)||B.isBuffer(e)||B.isStream(e)||B.isFile(e)||B.isBlob(e)||B.isReadableStream(e))return e;if(B.isArrayBufferView(e))return e.buffer;if(B.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=to(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Za(e,t).toString();if((a=B.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=to(this,`env`),r=n&&n.FormData;return Fa(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),no(e)):e}],transformResponse:[function(e){let t=to(this,`transitional`)||ro.transitional,n=t&&t.forcedJSONParsing,r=to(this,`responseType`),i=r===`json`;if(B.isResponse(e)||B.isReadableStream(e))return e;if(e&&B.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,to(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?ka.from(e,ka.ERR_BAD_RESPONSE,this,null,to(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:Xa.classes.FormData,Blob:Xa.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};B.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`],e=>{ro.headers[e]={}});var io=B.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),ao=e=>{let t={},n,r,i;return e&&e.split(`
12
- `).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&io[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t},oo=Symbol(`internals`),so=/[^\x09\x20-\x7E\x80-\xFF]/g;function co(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function lo(e){return e&&String(e).trim().toLowerCase()}function uo(e){return co(e.replace(so,``))}function fo(e){return e===!1||e==null?e:B.isArray(e)?e.map(fo):uo(String(e))}function po(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var mo=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ho(e,t,n,r,i){if(B.isFunction(r))return r.call(this,t,n);if(i&&(t=n),B.isString(t)){if(B.isString(r))return t.indexOf(r)!==-1;if(B.isRegExp(r))return r.test(t)}}function go(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function _o(e,t){let n=B.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var vo=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=lo(t);if(!i)throw Error(`header name must be a non-empty string`);let a=B.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=fo(e))}let a=(e,t)=>B.forEach(e,(e,n)=>i(e,n,t));if(B.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(B.isString(e)&&(e=e.trim())&&!mo(e))a(ao(e),t);else if(B.isObject(e)&&B.isIterable(e)){let n={},r,i;for(let t of e){if(!B.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?B.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=lo(e),e){let n=B.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return po(e);if(B.isFunction(t))return t.call(this,e,n);if(B.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=lo(e),e){let n=B.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||ho(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=lo(e),e){let i=B.findKey(n,e);i&&(!t||ho(n,n[i],i,t))&&(delete n[i],r=!0)}}return B.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||ho(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return B.forEach(this,(r,i)=>{let a=B.findKey(n,i);if(a){t[a]=fo(r),delete t[i];return}let o=e?go(i):String(i).trim();o!==i&&delete t[i],t[o]=fo(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return B.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&B.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
13
- `)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[oo]=this[oo]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=lo(e);t[r]||(_o(n,e),t[r]=!0)}return B.isArray(e)?e.forEach(r):r(e),this}};vo.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),B.reduceDescriptors(vo.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),B.freezeMethods(vo);function yo(e,t){let n=this||ro,r=t||n,i=vo.from(r.headers),a=r.data;return B.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function bo(e){return!!(e&&e.__CANCEL__)}var xo=class extends ka{constructor(e,t,n){super(e??`canceled`,ka.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function So(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ka(`Request failed with status code `+n.status,[ka.ERR_BAD_REQUEST,ka.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Co(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function wo(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function To(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var Eo=(e,t,n=3)=>{let r=0,i=wo(50,250);return To(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Do=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Oo=e=>(...t)=>B.asap(()=>e(...t)),ko=Xa.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Xa.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Xa.origin),Xa.navigator&&/(msie|trident)/i.test(Xa.navigator.userAgent)):()=>!0,Ao=Xa.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];B.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),B.isString(r)&&s.push(`path=${r}`),B.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),B.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.match(RegExp(`(?:^|; )`+e+`=([^;]*)`));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function jo(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function Mo(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function No(e,t,n){let r=!jo(t);return e&&(r||n===!1)?Mo(e,t):t}var Po=e=>e instanceof vo?{...e}:e;function Fo(e,t){t||={};let n={};function r(e,t,n,r){return B.isPlainObject(e)&&B.isPlainObject(t)?B.merge.call({caseless:r},e,t):B.isPlainObject(t)?B.merge({},t):B.isArray(t)?t.slice():t}function i(e,t,n,i){if(!B.isUndefined(t))return r(e,t,n,i);if(!B.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!B.isUndefined(t))return r(void 0,t)}function o(e,t){if(!B.isUndefined(t))return r(void 0,t);if(!B.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(B.hasOwnProp(t,a))return r(n,i);if(B.hasOwnProp(e,a))return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(Po(e),Po(t),n,!0)};return B.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=B.hasOwnProp(c,r)?c[r]:i,o=a(B.hasOwnProp(e,r)?e[r]:void 0,B.hasOwnProp(t,r)?t[r]:void 0,r);B.isUndefined(o)&&a!==s||(n[r]=o)}),n}var Io=e=>{let t=Fo({},e),{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=vo.from(o),t.url=Ba(No(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set(`Authorization`,`Basic `+btoa((s.username||``)+`:`+(s.password?unescape(encodeURIComponent(s.password)):``))),B.isFormData(n)){if(Xa.hasStandardBrowserEnv||Xa.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(B.isFunction(n.getHeaders)){let e=n.getHeaders(),t=[`content-type`,`content-length`];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)})}}if(Xa.hasStandardBrowserEnv&&(B.isFunction(r)&&(r=r(t)),r===!0||r==null&&ko(t.url))){let e=i&&a&&Ao.read(a);e&&o.set(i,e)}return t},Lo=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=Io(e),i=r.data,a=vo.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=vo.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());So(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf(`file:`)===0)||setTimeout(g)},h.onabort=function(){h&&=(n(new ka(`Request aborted`,ka.ECONNABORTED,e,h)),null)},h.onerror=function(t){let r=new ka(t&&t.message?t.message:`Network Error`,ka.ERR_NETWORK,e,h);r.event=t||null,n(r),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||Ha;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ka(t,i.clarifyTimeoutError?ka.ETIMEDOUT:ka.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&B.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),B.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=Eo(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=Eo(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new xo(null,e,h):t),h.abort(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=Co(r.url);if(_&&Xa.protocols.indexOf(_)===-1){n(new ka(`Unsupported protocol `+_+`:`,ka.ERR_BAD_REQUEST,e));return}h.send(i||null)})},Ro=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof ka?t:new xo(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new ka(`timeout of ${t}ms exceeded`,ka.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>B.asap(o),s}},zo=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},Bo=async function*(e,t){for await(let n of Vo(e))yield*zo(n,t)},Vo=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Ho=(e,t,n,r)=>{let i=Bo(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},Uo=64*1024,{isFunction:Wo}=B,Go=(({Request:e,Response:t})=>({Request:e,Response:t}))(B.global),{ReadableStream:Ko,TextEncoder:qo}=B.global,Jo=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Yo=e=>{e=B.merge.call({skipUndefined:!0},Go,e);let{fetch:t,Request:n,Response:r}=e,i=t?Wo(t):typeof fetch==`function`,a=Wo(n),o=Wo(r);if(!i)return!1;let s=i&&Wo(Ko),c=i&&(typeof qo==`function`?(e=>t=>e.encode(t))(new qo):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=a&&s&&Jo(()=>{let e=!1,t=new n(Xa.origin,{body:new Ko,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),u=o&&s&&Jo(()=>B.isReadableStream(new r(``).body)),d={stream:u&&(e=>e.body)};i&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ka(`Response type '${e}' is not supported`,ka.ERR_NOT_SUPPORT,n)})});let f=async e=>{if(e==null)return 0;if(B.isBlob(e))return e.size;if(B.isSpecCompliantForm(e))return(await new n(Xa.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(B.isArrayBufferView(e)||B.isArrayBuffer(e))return e.byteLength;if(B.isURLSearchParams(e)&&(e+=``),B.isString(e))return(await c(e)).byteLength},p=async(e,t)=>B.toFiniteNumber(e.getContentLength())??f(t);return async e=>{let{url:i,method:o,data:s,signal:c,cancelToken:f,timeout:m,onDownloadProgress:h,onUploadProgress:g,responseType:_,headers:v,withCredentials:y=`same-origin`,fetchOptions:b}=Io(e),x=t||fetch;_=_?(_+``).toLowerCase():`text`;let S=Ro([c,f&&f.toAbortSignal()],m),C=null,w=S&&S.unsubscribe&&(()=>{S.unsubscribe()}),T;try{if(g&&l&&o!==`get`&&o!==`head`&&(T=await p(v,s))!==0){let e=new n(i,{method:`POST`,body:s,duplex:`half`}),t;if(B.isFormData(s)&&(t=e.headers.get(`content-type`))&&v.setContentType(t),e.body){let[t,n]=Do(T,Eo(Oo(g)));s=Ho(e.body,Uo,t,n)}}B.isString(y)||(y=y?`include`:`omit`);let t=a&&`credentials`in n.prototype;if(B.isFormData(s)){let e=v.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&v.delete(`content-type`)}let c={...b,signal:S,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:`half`,credentials:t?y:void 0};C=a&&new n(i,c);let f=await(a?x(C,b):x(i,c)),m=u&&(_===`stream`||_===`response`);if(u&&(h||m&&w)){let e={};[`status`,`statusText`,`headers`].forEach(t=>{e[t]=f[t]});let t=B.toFiniteNumber(f.headers.get(`content-length`)),[n,i]=h&&Do(t,Eo(Oo(h),!0))||[];f=new r(Ho(f.body,Uo,n,()=>{i&&i(),w&&w()}),e)}_||=`text`;let E=await d[B.findKey(d,_)||`text`](f,e);return!m&&w&&w(),await new Promise((t,n)=>{So(t,n,{data:E,headers:vo.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:C})})}catch(t){throw w&&w(),t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new ka(`Network Error`,ka.ERR_NETWORK,e,C,t&&t.response),{cause:t.cause||t}):ka.from(t,t&&t.code,e,C,t&&t.response)}}},Xo=new Map,Zo=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Xo;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:Yo(t)),l=c;return c};Zo();var Qo={http:null,xhr:Lo,fetch:{get:Zo}};B.forEach(Qo,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{value:t})}catch{}Object.defineProperty(e,`adapterName`,{value:t})}});var $o=e=>`- ${e}`,es=e=>B.isFunction(e)||e===null||e===!1;function ts(e,t){e=B.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!es(r)&&(i=Qo[(n=String(r)).toLowerCase()],i===void 0))throw new ka(`Unknown adapter '${n}'`);if(i&&(B.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new ka(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
14
- `+e.map($o).join(`
15
- `):` `+$o(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var ns={getAdapter:ts,adapters:Qo};function rs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xo(null,e)}function is(e){return rs(e),e.headers=vo.from(e.headers),e.data=yo.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),ns.getAdapter(e.adapter||ro.adapter,e)(e).then(function(t){return rs(e),t.data=yo.call(e,e.transformResponse,t),t.headers=vo.from(t.headers),t},function(t){return bo(t)||(rs(e),t&&t.response&&(t.response.data=yo.call(e,e.transformResponse,t.response),t.response.headers=vo.from(t.response.headers))),Promise.reject(t)})}var as=`1.15.1`,os={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{os[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var ss={};os.transitional=function(e,t,n){function r(e,t){return`[Axios v`+as+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new ka(r(i,` has been removed`+(t?` in `+t:``)),ka.ERR_DEPRECATED);return t&&!ss[i]&&(ss[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},os.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function cs(e,t,n){if(typeof e!=`object`)throw new ka(`options must be an object`,ka.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=t[a];if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new ka(`option `+a+` must be `+n,ka.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ka(`Unknown option `+a,ka.ERR_BAD_OPTION)}}var ls={assertOptions:cs,validators:os},us=ls.validators,ds=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Va,response:new Va}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return``;let e=t.stack.indexOf(`
16
- `);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(`
17
- `),r=t===-1?-1:n.indexOf(`
18
- `,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
19
- `+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=Fo(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&ls.assertOptions(n,{silentJSONParsing:us.transitional(us.boolean),forcedJSONParsing:us.transitional(us.boolean),clarifyTimeoutError:us.transitional(us.boolean),legacyInterceptorReqResOrdering:us.transitional(us.boolean)},!1),r!=null&&(B.isFunction(r)?t.paramsSerializer={serialize:r}:ls.assertOptions(r,{encode:us.function,serialize:us.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),ls.assertOptions(t,{baseUrl:us.spelling(`baseURL`),withXsrfToken:us.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&B.merge(i.common,i[t.method]);i&&B.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=vo.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||Ha;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[is.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=is.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=Fo(this.defaults,e),Ba(No(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};B.forEach([`delete`,`get`,`head`,`options`],function(e){ds.prototype[e]=function(t,n){return this.request(Fo(n||{},{method:e,url:t,data:(n||{}).data}))}}),B.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(Fo(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}ds.prototype[e]=t(),ds.prototype[e+`Form`]=t(!0)});var fs=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new xo(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function ps(e){return function(t){return e.apply(null,t)}}function ms(e){return B.isObject(e)&&e.isAxiosError===!0}var hs={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(hs).forEach(([e,t])=>{hs[t]=e});function gs(e){let t=new ds(e),n=vi(ds.prototype.request,t);return B.extend(n,ds.prototype,t,{allOwnKeys:!0}),B.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return gs(Fo(e,t))},n}var _s=gs(ro);_s.Axios=ds,_s.CanceledError=xo,_s.CancelToken=fs,_s.isCancel=bo,_s.VERSION=as,_s.toFormData=Fa,_s.AxiosError=ka,_s.Cancel=_s.CanceledError,_s.all=function(e){return Promise.all(e)},_s.spread=ps,_s.isAxiosError=ms,_s.mergeConfig=Fo,_s.AxiosHeaders=vo,_s.formToJSON=e=>eo(B.isHTMLForm(e)?new FormData(e):e),_s.getAdapter=ns.getAdapter,_s.HttpStatusCode=hs,_s.default=_s;var vs=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ys=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),bs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),xs=e=>{let t=bs(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ss={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`},Cs=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ws=(0,L.createContext)({}),Ts=()=>(0,L.useContext)(ws),Es=(0,L.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Ts()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,L.createElement)(`svg`,{ref:c,...Ss,width:t??l??Ss.width,height:t??l??Ss.height,stroke:e??f,strokeWidth:m,className:vs(`lucide`,p,i),...!a&&!Cs(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,L.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),V=(e,t)=>{let n=(0,L.forwardRef)(({className:n,...r},i)=>(0,L.createElement)(Es,{ref:i,iconNode:t,className:vs(`lucide-${ys(xs(e))}`,`lucide-${e}`,n),...r}));return n.displayName=xs(e),n},Ds=V(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Os=V(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),ks=V(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),As=V(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),js=V(`arrow-up-down`,[[`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`}]]),Ms=V(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Ns=V(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Ps=V(`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`}]]),Fs=V(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Is=V(`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`}]]),Ls=V(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Rs=V(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),zs=V(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Bs=V(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Vs=V(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Hs=V(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Us=V(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Ws=V(`circle-alert`,[[`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`}]]),Gs=V(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ks=V(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),qs=V(`circle-x`,[[`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`}]]),Js=V(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ys=V(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Xs=V(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Zs=V(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),Qs=V(`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`}]]),$s=V(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),ec=V(`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`}]]),tc=V(`dollar-sign`,[[`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`}]]),nc=V(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),rc=V(`external-link`,[[`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`}]]),ic=V(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ac=V(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),oc=V(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),sc=V(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),cc=V(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),lc=V(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),uc=V(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),dc=V(`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`}]]),fc=V(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),pc=V(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),mc=V(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),hc=V(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),gc=V(`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`}]]),_c=V(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),vc=V(`layout-dashboard`,[[`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`}]]),yc=V(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),bc=V(`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`}]]),xc=V(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Sc=V(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Cc=V(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),wc=V(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Tc=V(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Ec=V(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Dc=V(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),Oc=V(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),kc=V(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Ac=V(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),jc=V(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Mc=V(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Nc=V(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Pc=V(`refresh-cw`,[[`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`}]]),Fc=V(`rotate-ccw`,[[`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`}]]),Ic=V(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Lc=V(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Rc=V(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),zc=V(`shield-check`,[[`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`}]]),Bc=V(`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`}]]),Vc=V(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Hc=V(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Uc=V(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Wc=V(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Gc=V(`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`}]]),Kc=V(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),qc=V(`test-tube`,[[`path`,{d:`M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2`,key:`125lnx`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}],[`path`,{d:`M14.5 16h-5`,key:`1ox875`}]]),Jc=V(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Yc=V(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),Xc=V(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Zc=V(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Qc=V(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),$c=V(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),el=V(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),tl=V(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),nl=u(y(),1),rl=u(_(),1),il=(0,L.createContext)({toast:()=>{}}),al=()=>{};function H(e,t=`error`){al(e,t)}function ol({children:e}){let[t,n]=(0,L.useState)([]),r={current:0},i=(0,L.useCallback)((e,t=`error`)=>{let i=++r.current;n(n=>[...n,{id:i,type:t,message:e}]),setTimeout(()=>n(e=>e.filter(e=>e.id!==i)),4e3)},[]);(0,L.useEffect)(()=>{al=i},[i]);let a={success:Gs,error:qs,warning:Xc},o={success:`bg-green-50 border-green-200 text-green-800`,error:`bg-red-50 border-red-200 text-red-800`,warning:`bg-yellow-50 border-yellow-200 text-yellow-800`},s={success:`text-green-500`,error:`text-red-500`,warning:`text-yellow-500`};return(0,R.jsxs)(il.Provider,{value:{toast:i},children:[e,(0,rl.createPortal)((0,R.jsx)(`div`,{className:`fixed bottom-4 right-4 z-[9999] flex flex-col gap-2 max-w-sm`,children:t.map(e=>{let t=a[e.type];return(0,R.jsxs)(`div`,{className:`flex items-start gap-3 px-4 py-3 rounded-lg border shadow-lg text-sm ${o[e.type]}`,children:[(0,R.jsx)(t,{className:`h-4 w-4 mt-0.5 flex-shrink-0 ${s[e.type]}`}),(0,R.jsx)(`span`,{className:`flex-1`,children:e.message}),(0,R.jsx)(`button`,{onClick:()=>n(t=>t.filter(t=>t.id!==e.id)),children:(0,R.jsx)(el,{className:`h-3.5 w-3.5 opacity-60 hover:opacity-100`})})]},e.id)})}),document.body)]})}var U=_s.create({baseURL:`/api`,timeout:3e4});U.interceptors.request.use(e=>{let t=window.__AUTH_TOKEN__;return t&&(e.headers.Authorization=`Bearer ${t}`),e}),U.interceptors.response.use(e=>e,e=>(H(e.response?.data?.error||e.response?.data?.message||e.message||`请求失败`,`error`),Promise.reject(e)));var sl=()=>U.get(`/health`),cl=()=>U.get(`/config`),ll=e=>U.put(`/config`,e),ul=()=>U.get(`/config/history`),dl=e=>U.get(`/sessions`,{params:e}),fl=e=>U.get(`/sessions/${e}`),pl=e=>U.delete(`/sessions/${e}`),ml=e=>U.delete(`/sessions`,{data:{ids:e}}),hl=e=>U.get(`/events`,{params:e}),gl=e=>U.get(`/events/stats`,{params:{project_path:e}}),_l=e=>U.get(`/pipelines`,{params:e}),vl=e=>U.get(`/pipelines/${e}`),yl=e=>U.get(`/quality/history`,{params:e}),bl=e=>U.get(`/quality/unresolved`,{params:{project_path:e}}),xl=()=>U.get(`/stats/roi`),Sl=()=>U.get(`/stats/overview`),Cl=(e,t,n,r)=>U.get(`/knowledge/search`,{params:{q:e,project_path:t,node_type:n,limit:r}}),wl=e=>U.get(`/knowledge/overview`,{params:{project_path:e}}),Tl=(e,t)=>U.get(`/knowledge/neighbors`,{params:{node_id:e,project_path:t}}),El=(e,t)=>U.get(`/knowledge/graph`,{params:{project_path:e,node_type:t}}),Dl=e=>U.post(`/knowledge/nodes`,e),Ol=(e,t)=>U.put(`/knowledge/nodes/${e}`,t),kl=e=>U.delete(`/knowledge/nodes/${e}`),Al=e=>U.delete(`/knowledge/batch`,{data:{ids:e}}),jl=e=>U.post(`/knowledge/import`,{nodes:e}),Ml=e=>U.post(`/knowledge/edges`,e),Nl=e=>U.post(`/pipelines/${e}/close`),Pl=e=>U.post(`/pipelines/${e}/reactivate`),Fl=e=>U.post(`/pipelines/batch-close`,{ids:e}),Il=()=>U.post(`/pipelines/close-expired`),Ll=()=>U.get(`/pipelines/active`),Rl=e=>U.post(`/pipelines/${e}/resume`),zl=e=>U.post(`/pipelines/${e}/advance`),Bl=e=>U.get(`/projects`,{params:e}),Vl=e=>U.get(`/projects/${e}`),Hl=e=>U.delete(`/projects/${e}`),Ul=e=>U.post(`/convention/init`,{path:e},{timeout:18e4}),Wl=e=>U.get(`/projects/${e}/conventions`),Gl=(e,t)=>U.post(`/projects/${e}/conventions/bind`,{conventionId:t}),Kl=(e,t)=>U.delete(`/projects/${e}/conventions/${encodeURIComponent(t)}`),ql=e=>U.get(`/projects/${e}/conventions/custom/yaml`),Jl=(e,t)=>U.put(`/projects/${e}/conventions/custom`,{yaml:t}),Yl=e=>U.post(`/projects/${e}/conventions/distill`,{},{timeout:12e4}),Xl=e=>U.get(`/claudemd/${e}`),Zl=(e,t)=>U.put(`/claudemd/${e}`,{content:t}),Ql=e=>U.get(`/claudemd/${e}/profile`),$l=e=>U.get(`/claudemd/${e}/modules`),eu=e=>U.post(`/claudemd/${e}/distill`,void 0,{timeout:18e4}),tu=e=>U.post(`/claudemd/${e}/init`,void 0,{timeout:18e4}),nu=e=>U.post(`/quality/${e}/resolve`),ru=e=>U.post(`/quality/${e}/dismiss`),iu=e=>U.post(`/quality/batch-dismiss`,{ids:e}),au=e=>U.post(`/quality/batch-resolve`,{ids:e}),ou=()=>U.post(`/quality/resolve-all`),su=e=>U.get(`/quality/${e}/context`),cu=()=>U.get(`/daemon/status`),lu=()=>U.post(`/daemon/restart`),uu=()=>U.get(`/daemon/diagnose`),du=()=>U.post(`/daemon/repair`),fu=e=>U.post(`/config/backup`,e||{}),pu=()=>U.get(`/config/backups`),mu=e=>`/api/config/backups/${encodeURIComponent(e)}`,hu=(e,t)=>U.post(`/config/restore`,{filename:e,password:t}),gu=e=>U.post(`/events/purge`,{retentionDays:e}),_u=()=>U.get(`/memory/caches`),vu=()=>U.get(`/memory/process`),yu=e=>U.post(`/memory/caches/${encodeURIComponent(e)}/clear`),bu=()=>U.post(`/memory/caches/clear-all`),xu=()=>U.post(`/memory/gc`),Su=e=>U.get(`/stats/api-usage`,{params:{days:e}}),Cu=e=>U.get(`/skills`,{params:e}),wu=()=>U.get(`/skills/status`),Tu=e=>U.get(`/skills/${encodeURIComponent(e)}`),Eu=(e,t)=>U.put(`/skills/${encodeURIComponent(e)}/content`,{content:t}),Du=(e,t)=>U.post(`/skills/search`,{query:e,...t},{timeout:3e4}),Ou=e=>U.post(`/skills/install`,{url:e},{timeout:6e4}),ku=e=>U.delete(`/skills/${encodeURIComponent(e)}`),Au=e=>U.post(`/skills/batch-delete`,{names:e}),ju=()=>U.post(`/skills/evolve`,{},{timeout:12e4}),Mu=()=>U.post(`/skills/distill`,{},{timeout:12e4}),Nu=()=>U.post(`/skills/repair`,{},{timeout:6e4}),Pu=()=>U.get(`/skills/orchestration`),Fu=(e,t)=>U.put(`/skills/orchestration`,{skill:e,keywords:t}),Iu=e=>U.delete(`/skills/orchestration/${encodeURIComponent(e)}`),Lu=()=>U.get(`/conventions`),Ru=e=>U.get(`/conventions/${encodeURIComponent(e)}`),zu=()=>U.post(`/conventions/sync-official`),Bu=e=>U.post(`/conventions/install`,{url:e},{timeout:3e4}),Vu=e=>U.delete(`/conventions/${encodeURIComponent(e)}`),Hu=()=>U.get(`/conventions/usage-stats`),Uu=e=>U.get(`/conventions/${encodeURIComponent(e)}/evolution-history`),Wu=e=>U.post(`/conventions/batch-evolve`,{conventionIds:e},{timeout:12e4}),Gu=e=>U.get(`/conventions/${encodeURIComponent(e)}/yaml`),Ku=(e,t)=>U.put(`/conventions/${encodeURIComponent(e)}/yaml`,{yaml:t}),qu=e=>U.get(`/node-types`,{params:e?{projectPath:e}:void 0}),Ju=e=>U.get(`/node-types/${encodeURIComponent(e)}`),Yu=e=>U.post(`/node-types`,e),Xu=(e,t)=>U.put(`/node-types/${encodeURIComponent(e)}`,t),Zu=e=>U.delete(`/node-types/${encodeURIComponent(e)}`);function Qu(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Qu(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function $u(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Qu(e))&&(r&&(r+=` `),r+=t);return r}var ed=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},td=(e,t)=>({classGroupId:e,validator:t}),nd=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rd=`-`,id=[],ad=`arbitrary..`,od=e=>{let t=ld(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return cd(e);let n=e.split(rd);return sd(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?ed(i,t):t:i||id}return n[e]||id}}},sd=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=sd(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(rd):e.slice(t).join(rd),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},cd=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ad+r:void 0})(),ld=e=>{let{theme:t,classGroups:n}=e;return ud(n,t)},ud=(e,t)=>{let n=nd();for(let r in e){let i=e[r];dd(i,n,r,t)}return n},dd=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];fd(i,t,n,r)}},fd=(e,t,n,r)=>{if(typeof e==`string`){pd(e,t,n);return}if(typeof e==`function`){md(e,t,n,r);return}hd(e,t,n,r)},pd=(e,t,n)=>{let r=e===``?t:gd(t,e);r.classGroupId=n},md=(e,t,n,r)=>{if(_d(e)){dd(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(td(n,e))},hd=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];dd(o,gd(t,a),n,r)}},gd=(e,t)=>{let n=e,r=t.split(rd),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=nd(),n.nextPart.set(t,i)),n=i}return n},_d=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,vd=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},yd=`!`,bd=`:`,xd=[],Sd=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Cd=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===bd){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(yd)?(c=s.slice(0,-1),l=!0):s.startsWith(yd)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Sd(t,l,c,u)};if(t){let e=t+bd,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Sd(xd,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},wd=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Td=e=>({cache:vd(e.cacheSize),parseClassName:Cd(e),sortModifiers:wd(e),...od(e)}),Ed=/\s+/,Dd=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Ed),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+yd:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},Od=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=kd(n))&&(i&&(i+=` `),i+=r);return i},kd=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=kd(e[r]))&&(n&&(n+=` `),n+=t);return n},Ad=(e,...t)=>{let n,r,i,a,o=o=>(n=Td(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Dd(e,n);return i(e,a),a};return a=o,(...e)=>a(Od(...e))},jd=[],Md=e=>{let t=t=>t[e]||jd;return t.isThemeGetter=!0,t},Nd=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Pd=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Fd=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Id=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ld=/\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$/,Rd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vd=e=>Fd.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),Hd=e=>!!e&&Number.isInteger(Number(e)),Ud=e=>e.endsWith(`%`)&&W(e.slice(0,-1)),Wd=e=>Id.test(e),Gd=()=>!0,Kd=e=>Ld.test(e)&&!Rd.test(e),qd=()=>!1,Jd=e=>zd.test(e),Yd=e=>Bd.test(e),Xd=e=>!G(e)&&!K(e),Zd=e=>pf(e,_f,qd),G=e=>Nd.test(e),Qd=e=>pf(e,vf,Kd),$d=e=>pf(e,yf,W),ef=e=>pf(e,xf,Gd),tf=e=>pf(e,bf,qd),nf=e=>pf(e,hf,qd),rf=e=>pf(e,gf,Yd),af=e=>pf(e,Sf,Jd),K=e=>Pd.test(e),of=e=>mf(e,vf),sf=e=>mf(e,bf),cf=e=>mf(e,hf),lf=e=>mf(e,_f),uf=e=>mf(e,gf),df=e=>mf(e,Sf,!0),ff=e=>mf(e,xf,!0),pf=(e,t,n)=>{let r=Nd.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},mf=(e,t,n=!1)=>{let r=Pd.exec(e);return r?r[1]?t(r[1]):n:!1},hf=e=>e===`position`||e===`percentage`,gf=e=>e===`image`||e===`url`,_f=e=>e===`length`||e===`size`||e===`bg-size`,vf=e=>e===`length`,yf=e=>e===`number`,bf=e=>e===`family-name`,xf=e=>e===`number`||e===`weight`,Sf=e=>e===`shadow`,Cf=Ad(()=>{let e=Md(`color`),t=Md(`font`),n=Md(`text`),r=Md(`font-weight`),i=Md(`tracking`),a=Md(`leading`),o=Md(`breakpoint`),s=Md(`container`),c=Md(`spacing`),l=Md(`radius`),u=Md(`shadow`),d=Md(`inset-shadow`),f=Md(`text-shadow`),p=Md(`drop-shadow`),m=Md(`blur`),h=Md(`perspective`),g=Md(`aspect`),_=Md(`ease`),v=Md(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),K,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[K,G,c],T=()=>[Vd,`full`,`auto`,...w()],E=()=>[Hd,`none`,`subgrid`,K,G],D=()=>[`auto`,{span:[`full`,Hd,K,G]},Hd,K,G],O=()=>[Hd,`auto`,K,G],k=()=>[`auto`,`min`,`max`,`fr`,K,G],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Vd,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ee=()=>[Vd,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],te=()=>[Vd,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,K,G],ne=()=>[...b(),cf,nf,{position:[K,G]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,lf,Zd,{size:[K,G]}],ae=()=>[Ud,of,Qd],F=()=>[``,`none`,`full`,l,K,G],I=()=>[``,W,of,Qd],oe=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ce=()=>[W,Ud,cf,nf],le=()=>[``,`none`,m,K,G],ue=()=>[`none`,W,K,G],de=()=>[`none`,W,K,G],fe=()=>[W,K,G],pe=()=>[Vd,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Wd],breakpoint:[Wd],color:[Gd],container:[Wd],"drop-shadow":[Wd],ease:[`in`,`out`,`in-out`],font:[Xd],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Wd],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Wd],shadow:[Wd],spacing:[`px`,W],text:[Wd],"text-shadow":[Wd],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Vd,G,K,g]}],container:[`container`],columns:[{columns:[W,G,K,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Hd,`auto`,K,G]}],basis:[{basis:[Vd,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[W,Vd,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,W,K,G]}],shrink:[{shrink:[``,W,K,G]}],order:[{order:[Hd,`first`,`last`,`none`,K,G]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...ee()]}],"min-inline-size":[{"min-inline":[`auto`,...ee()]}],"max-inline-size":[{"max-inline":[`none`,...ee()]}],"block-size":[{block:[`auto`,...te()]}],"min-block-size":[{"min-block":[`auto`,...te()]}],"max-block-size":[{"max-block":[`none`,...te()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,of,Qd]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ff,ef]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ud,G]}],"font-family":[{font:[sf,tf,t]}],"font-features":[{"font-features":[G]}],"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:[i,K,G]}],"line-clamp":[{"line-clamp":[W,`none`,K,$d]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,K,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...oe(),`wavy`]}],"text-decoration-thickness":[{decoration:[W,`from-font`,`auto`,K,Qd]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[W,`auto`,K,G]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,G]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,K,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Hd,K,G],radial:[``,K,G],conic:[Hd,K,G]},uf,rf]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...oe(),`hidden`,`none`]}],"divide-style":[{divide:[...oe(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...oe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[W,K,G]}],"outline-w":[{outline:[``,W,of,Qd]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,df,af]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,df,af]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[W,Qd]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,df,af]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[W,K,G]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:le()}],brightness:[{brightness:[W,K,G]}],contrast:[{contrast:[W,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,df,af]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,W,K,G]}],"hue-rotate":[{"hue-rotate":[W,K,G]}],invert:[{invert:[``,W,K,G]}],saturate:[{saturate:[W,K,G]}],sepia:[{sepia:[``,W,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[W,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[W,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,W,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,W,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[W,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[W,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,W,K,G]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,K,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[W,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[W,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":[`scale-3d`],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:pe()}],"translate-x":[{"translate-x":pe()}],"translate-y":[{"translate-y":pe()}],"translate-z":[{"translate-z":pe()}],"translate-none":[`translate-none`],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,K,G]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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`,K,G]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[W,of,Qd,$d]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`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`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`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-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function q(...e){return Cf($u(e))}function wf(e){let t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60),i=Math.floor(r/24);return i>0?`${i}天${r%24}小时`:r>0?`${r}小时${n%60}分钟`:n>0?`${n}分钟${t%60}秒`:`${t}秒`}function Tf(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function Ef(e){let t={active:`text-green-600 bg-green-50`,completed:`text-blue-600 bg-blue-50`,failed:`text-red-600 bg-red-50`,interrupted:`text-yellow-600 bg-yellow-50`,pending:`text-gray-600 bg-gray-50`};return t[e]||t.pending}function Df(e){return e?e.endsWith(`Z`)||/[+-]\d{2}:\d{2}$/.test(e)?new Date(e):new Date(e+`Z`):new Date}var Of=[{path:`/dashboard`,label:`仪表盘`,icon:vc},{path:`/projects`,label:`项目管理`,icon:dc},{path:`/sessions`,label:`会话管理`,icon:Ds},{path:`/events`,label:`事件流`,icon:Is},{path:`/pipelines`,label:`流水线`,icon:pc},{path:`/quality`,label:`质量门禁`,icon:zc},{path:`/knowledge`,label:`知识图谱`,icon:Fs},{path:`/skills`,label:`技能管理`,icon:Dc},{path:`/conventions`,label:`规范管理`,icon:Ms},{path:`/node-types`,label:`节点类型`,icon:Ps},{path:`/analytics`,label:`数据分析`,icon:Ls},{path:`/config`,label:`系统配置`,icon:Rc}];function kf({children:e}){let[t,n]=(0,L.useState)(()=>localStorage.getItem(`sidebar-collapsed`)===`true`),r=Mn();(0,L.useEffect)(()=>{localStorage.setItem(`sidebar-collapsed`,String(t))},[t]);let{data:i}=ut({queryKey:[`health`],queryFn:()=>sl().then(e=>e.data),refetchInterval:15e3}),a=Of.find(e=>r.pathname.startsWith(e.path));return(0,R.jsxs)(`div`,{className:`flex min-h-screen bg-gray-50`,children:[(0,R.jsxs)(`aside`,{className:q(`fixed top-0 left-0 bottom-0 z-50 flex flex-col transition-all duration-300`,`bg-gradient-to-b from-slate-900 to-slate-800`,t?`w-16`:`w-60`),children:[(0,R.jsxs)(`div`,{className:q(`flex items-center border-b border-white/10 h-16`,t?`justify-center px-2`:`justify-between px-5`),children:[!t&&(0,R.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,R.jsx)(`div`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-gradient-to-br from-blue-500 to-purple-600`,children:(0,R.jsx)(tl,{className:`h-5 w-5 text-white`})}),(0,R.jsx)(`span`,{className:`text-white font-bold text-lg tracking-tight`,children:`Forge`})]}),(0,R.jsx)(`button`,{onClick:()=>n(!t),className:`p-1.5 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-colors`,children:t?(0,R.jsx)(wc,{className:`h-5 w-5`}):(0,R.jsx)(Vs,{className:`h-5 w-5`})})]}),(0,R.jsx)(`nav`,{className:`flex-1 py-4 space-y-1 px-2`,children:Of.map(e=>(0,R.jsxs)(ti,{to:e.path,className:({isActive:e})=>q(`flex items-center gap-3 rounded-lg transition-all duration-200`,t?`justify-center p-3`:`px-3 py-2.5`,e?`bg-blue-600/20 text-blue-400`:`text-white/60 hover:text-white hover:bg-white/5`),children:[(0,R.jsx)(e.icon,{className:`h-5 w-5 flex-shrink-0`}),!t&&(0,R.jsx)(`span`,{className:`text-sm font-medium`,children:e.label})]},e.path))}),(0,R.jsx)(`div`,{className:q(`border-t border-white/10 py-4`,t?`px-2`:`px-5`),children:(0,R.jsxs)(`div`,{className:q(`flex items-center gap-2`,t?`justify-center`:``),children:[(0,R.jsx)(`div`,{className:q(`w-2 h-2 rounded-full`,i?.status===`ok`?`bg-green-400 animate-pulse`:`bg-red-400`)}),!t&&(0,R.jsx)(`span`,{className:`text-xs text-white/40`,children:i?.status===`ok`?`Daemon 运行中`:`连接断开`})]})})]}),(0,R.jsxs)(`main`,{className:q(`flex-1 transition-all duration-300`,t?`ml-16`:`ml-60`),children:[(0,R.jsxs)(`header`,{className:`sticky top-0 z-40 bg-white/80 backdrop-blur-md border-b border-gray-200/50 h-16 flex items-center justify-between px-8`,children:[(0,R.jsx)(`h1`,{className:`text-xl font-semibold text-gray-900`,children:a?.label||`Claude Forge`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,R.jsxs)(`button`,{className:`hidden sm:flex items-center gap-2 px-3 py-1.5 text-sm text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors`,onClick:()=>{let e=new KeyboardEvent(`keydown`,{key:`k`,metaKey:!0});window.dispatchEvent(e)},children:[(0,R.jsx)(Zs,{className:`h-4 w-4`}),(0,R.jsx)(`span`,{children:`命令面板`}),(0,R.jsx)(`kbd`,{className:`px-2 py-0.5 text-xs bg-gray-100 rounded border border-gray-200`,children:`⌘K`})]}),(0,R.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[`v`,`3.6.26`]}),(0,R.jsxs)(`div`,{className:q(`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-semibold`,i?.status===`ok`?`bg-green-50 text-green-700 border border-green-200`:`bg-red-50 text-red-700 border border-red-200`),children:[(0,R.jsx)(`div`,{className:q(`w-1.5 h-1.5 rounded-full`,i?.status===`ok`?`bg-green-500`:`bg-red-500`)}),i?.status===`ok`?`在线`:`离线`]})]})]}),(0,R.jsx)(`div`,{className:`p-8 overflow-x-hidden`,children:e})]})]})}var Af=(0,L.createContext)({});function jf(e){let t=(0,L.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Mf=typeof window<`u`?L.useLayoutEffect:L.useEffect,Nf=(0,L.createContext)(null);function Pf(e,t){e.indexOf(t)===-1&&e.push(t)}function Ff(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var If=(e,t,n)=>n>t?t:n<e?e:n,Lf={},Rf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function zf(e){return typeof e==`object`&&!!e}var Bf=e=>/^0[^.\s]+$/u.test(e);function Vf(e){let t;return()=>(t===void 0&&(t=e()),t)}var Hf=e=>e,Uf=(e,t)=>n=>t(e(n)),Wf=(...e)=>e.reduce(Uf),Gf=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},Kf=class{constructor(){this.subscriptions=[]}add(e){return Pf(this.subscriptions,e),()=>Ff(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},qf=e=>e*1e3,Jf=e=>e/1e3;function Yf(e,t){return t?1e3/t*e:0}var Xf=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Zf=1e-7,Qf=12;function $f(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Xf(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Zf&&++s<Qf);return o}function ep(e,t,n,r){if(e===t&&n===r)return Hf;let i=t=>$f(t,0,1,e,n);return e=>e===0||e===1?e:Xf(i(e),t,r)}var tp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,np=e=>t=>1-e(1-t),rp=ep(.33,1.53,.69,.99),ip=np(rp),ap=tp(ip),op=e=>e>=1?1:(e*=2)<1?.5*ip(e):.5*(2-2**(-10*(e-1))),sp=e=>1-Math.sin(Math.acos(e)),cp=np(sp),lp=tp(sp),up=ep(.42,0,1,1),dp=ep(0,0,.58,1),fp=ep(.42,0,.58,1),pp=e=>Array.isArray(e)&&typeof e[0]!=`number`,mp=e=>Array.isArray(e)&&typeof e[0]==`number`,hp={linear:Hf,easeIn:up,easeInOut:fp,easeOut:dp,circIn:sp,circInOut:lp,circOut:cp,backIn:ip,backInOut:ap,backOut:rp,anticipate:op},gp=e=>typeof e==`string`,_p=e=>{if(mp(e)){e.length;let[t,n,r,i]=e;return ep(t,n,r,i)}else if(gp(e))return hp[e],`${e}`,hp[e];return e},vp=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],yp={value:null,addProjectionMetrics:null};function bp(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&yp.value&&yp.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var xp=40;function Sp(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=vp.reduce((e,n)=>(e[n]=bp(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Lf.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,xp),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:vp.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<vp.length;t++)o[vp[t]].cancel(e)},state:i,steps:o}}var{schedule:Cp,cancel:wp,state:Tp,steps:Ep}=Sp(typeof requestAnimationFrame<`u`?requestAnimationFrame:Hf,!0),Dp;function Op(){Dp=void 0}var kp={now:()=>(Dp===void 0&&kp.set(Tp.isProcessing||Lf.useManualTiming?Tp.timestamp:performance.now()),Dp),set:e=>{Dp=e,queueMicrotask(Op)}},Ap={layout:0,mainThread:0,waapi:0},jp=e=>t=>typeof t==`string`&&t.startsWith(e),Mp=jp(`--`),Np=jp(`var(--`),Pp=e=>Np(e)?Fp.test(e.split(`/*`)[0].trim()):!1,Fp=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ip(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var Lp={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Rp={...Lp,transform:e=>If(0,1,e)},zp={...Lp,default:1},Bp=e=>Math.round(e*1e5)/1e5,Vp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Hp(e){return e==null}var Up=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wp=(e,t)=>n=>!!(typeof n==`string`&&Up.test(n)&&n.startsWith(e)||t&&!Hp(n)&&Object.prototype.hasOwnProperty.call(n,t)),Gp=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Vp);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},eee=e=>If(0,255,e),Kp={...Lp,transform:e=>Math.round(eee(e))},qp={test:Wp(`rgb`,`red`),parse:Gp(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Kp.transform(e)+`, `+Kp.transform(t)+`, `+Kp.transform(n)+`, `+Bp(Rp.transform(r))+`)`};function Jp(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Yp={test:Wp(`#`),parse:Jp,transform:qp.transform},Xp=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Zp=Xp(`deg`),Qp=Xp(`%`),J=Xp(`px`),tee=Xp(`vh`),$p=Xp(`vw`),em={...Qp,parse:e=>Qp.parse(e)/100,transform:e=>Qp.transform(e*100)},tm={test:Wp(`hsl`,`hue`),parse:Gp(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Qp.transform(Bp(t))+`, `+Qp.transform(Bp(n))+`, `+Bp(Rp.transform(r))+`)`},nm={test:e=>qp.test(e)||Yp.test(e)||tm.test(e),parse:e=>qp.test(e)?qp.parse(e):tm.test(e)?tm.parse(e):Yp.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?qp.transform(e):tm.transform(e),getAnimatableNone:e=>{let t=nm.parse(e);return t.alpha=0,nm.transform(t)}},rm=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function im(e){return isNaN(e)&&typeof e==`string`&&(e.match(Vp)?.length||0)+(e.match(rm)?.length||0)>0}var am=`number`,om=`color`,sm=`var`,cm=`var(`,lm="${}",um=/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 dm(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(um,e=>(nm.test(e)?(r.color.push(a),i.push(om),n.push(nm.parse(e))):e.startsWith(cm)?(r.var.push(a),i.push(sm),n.push(e)):(r.number.push(a),i.push(am),n.push(parseFloat(e))),++a,lm)).split(lm),indexes:r,types:i}}function fm(e){return dm(e).values}function pm({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===am?i+=Bp(r[a]):e===om?i+=nm.transform(r[a]):i+=r[a]}return i}}function mm(e){return pm(dm(e))}var hm=e=>typeof e==`number`?0:nm.test(e)?nm.getAnimatableNone(e):e,nee=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:hm(e);function ree(e){let t=dm(e);return pm(t)(t.values.map((e,n)=>nee(e,t.split[n])))}var gm={test:im,parse:fm,createTransformer:mm,getAnimatableNone:ree};function _m(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iee({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=_m(s,r,e+1/3),a=_m(s,r,e),o=_m(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function vm(e,t){return n=>n>0?t:e}var ym=(e,t,n)=>e+(t-e)*n,bm=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},xm=[Yp,qp,tm],Sm=e=>xm.find(t=>t.test(e));function Cm(e){let t=Sm(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===tm&&(n=iee(n)),n}var wm=(e,t)=>{let n=Cm(e),r=Cm(t);if(!n||!r)return vm(e,t);let i={...n};return e=>(i.red=bm(n.red,r.red,e),i.green=bm(n.green,r.green,e),i.blue=bm(n.blue,r.blue,e),i.alpha=ym(n.alpha,r.alpha,e),qp.transform(i))},Tm=new Set([`none`,`hidden`]);function Em(e,t){return Tm.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Dm(e,t){return n=>ym(e,t,n)}function Om(e){return typeof e==`number`?Dm:typeof e==`string`?Pp(e)?vm:nm.test(e)?wm:Mm:Array.isArray(e)?km:typeof e==`object`?nm.test(e)?wm:Am:vm}function km(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Om(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Am(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Om(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function jm(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var Mm=(e,t)=>{let n=gm.createTransformer(t),r=dm(e),i=dm(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Tm.has(e)&&!i.values.length||Tm.has(t)&&!r.values.length?Em(e,t):Wf(km(jm(r,i),i.values),n):(`${e}${t}`,vm(e,t))};function Nm(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?ym(e,t,n):Om(e)(e,t)}var Pm=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Cp.update(t,e),stop:()=>wp(t),now:()=>Tp.isProcessing?Tp.timestamp:kp.now()}},Fm=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Im=2e4;function Lm(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function aee(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Lm(r),Im);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Jf(i)}}var Rm={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};function zm(e,t){return e*Math.sqrt(1-t*t)}var oee=12;function see(e,t,n){let r=n;for(let n=1;n<oee;n++)r-=e(r)/t(r);return r}var Bm=.001;function Vm({duration:e=Rm.duration,bounce:t=Rm.bounce,velocity:n=Rm.velocity,mass:r=Rm.mass}){let i,a;Rm.maxDuration;let o=1-t;o=If(Rm.minDamping,Rm.maxDamping,o),e=If(Rm.minDuration,Rm.maxDuration,Jf(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=zm(t,o),c=Math.exp(-i);return Bm-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=zm(t**2,o);return(-i(t)+Bm>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-Bm+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=see(i,a,s);if(e=qf(e),isNaN(c))return{stiffness:Rm.stiffness,damping:Rm.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Hm=[`duration`,`bounce`],Um=[`stiffness`,`damping`,`mass`];function Wm(e,t){return t.some(t=>e[t]!==void 0)}function Gm(e){let t={velocity:Rm.velocity,stiffness:Rm.stiffness,damping:Rm.damping,mass:Rm.mass,isResolvedFromDuration:!1,...e};if(!Wm(e,Um)&&Wm(e,Hm))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*If(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Rm.mass,stiffness:i,damping:a}}else{let n=Vm({...e,velocity:0});t={...t,...n,mass:Rm.mass},t.isResolvedFromDuration=!0}return t}function Km(e=Rm.visualDuration,t=Rm.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Gm({...n,velocity:-Jf(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Jf(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?Rm.restSpeed.granular:Rm.restSpeed.default,i||=v?Rm.restDelta.granular:Rm.restDelta.default;let y,b,x,S,C,w;if(h<1)x=zm(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>qf(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=qf(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=qf(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Lm(T),Im),t=Fm(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Km.applyToOptions=e=>{let t=aee(e,100,Km);return e.ease=t.ease,e.duration=qf(t.duration),e.type=`keyframes`,e};var qm=5;function Jm(e,t,n){let r=Math.max(t-qm,0);return Yf(n-e(r),t-r)}function Ym({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Km({keyframes:[f.value,m(f.value)],velocity:Jm(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Xm(e,t,n){let r=[],i=n||Lf.mix||Nm,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Wf(Array.isArray(t)?t[n]||Hf:t,a)),r.push(a)}return r}function Zm(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Xm(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Gf(e[r],e[r+1],n);return s[r](i)};return n?t=>l(If(e[0],e[a-1],t)):l}function Qm(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Gf(0,t,r);e.push(ym(n,1,i))}}function $m(e){let t=[0];return Qm(t,e.length-1),t}function eh(e,t){return e.map(e=>e*t)}function th(e,t){return e.map(()=>t||fp).splice(0,e.length-1)}function nh({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=pp(r)?r.map(_p):_p(r),a={done:!1,value:t[0]},o=Zm(eh(n&&n.length===t.length?n:$m(t),e),t,{ease:Array.isArray(i)?i:th(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var rh=e=>e!==null;function ih(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(rh),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var ah={decay:Ym,inertia:Ym,tween:nh,keyframes:nh,spring:Km};function oh(e){typeof e.type==`string`&&(e.type=ah[e.type])}var sh=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},ch=e=>e/100,lh=class extends sh{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==kp.now()&&this.tick(kp.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},Ap.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;oh(e);let{type:t=nh,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||nh;s!==nh&&typeof o[0]!=`number`&&(this.mixKeyframes=Wf(ch,Nm(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Lm(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=If(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Ym&&(b.value=ih(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Jf(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Jf(e)}get time(){return Jf(this.currentTime)}set time(e){e=qf(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Jm(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(kp.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Jf(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Pm,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,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(kp.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,Ap.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function uh(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var dh=e=>e*180/Math.PI,fh=e=>mh(dh(Math.atan2(e[1],e[0]))),ph={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:fh,rotateZ:fh,skewX:e=>dh(Math.atan(e[1])),skewY:e=>dh(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},mh=e=>(e%=360,e<0&&(e+=360),e),hh=fh,gh=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),_h=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),vh={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:gh,scaleY:_h,scale:e=>(gh(e)+_h(e))/2,rotateX:e=>mh(dh(Math.atan2(e[6],e[5]))),rotateY:e=>mh(dh(Math.atan2(-e[2],e[0]))),rotateZ:hh,rotate:hh,skewX:e=>dh(Math.atan(e[4])),skewY:e=>dh(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function yh(e){return+!!e.includes(`scale`)}function bh(e,t){if(!e||e===`none`)return yh(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=vh,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=ph,i=t}if(!i)return yh(t);let a=r[t],o=i[1].split(`,`).map(Sh);return typeof a==`function`?a(o):o[a]}var xh=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return bh(n,t)};function Sh(e){return parseFloat(e.trim())}var Ch=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],wh=new Set(Ch),Th=e=>e===Lp||e===J,Eh=new Set([`x`,`y`,`z`]),Dh=Ch.filter(e=>!Eh.has(e));function Oh(e){let t=[];return Dh.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var kh={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>bh(t,`x`),y:(e,{transform:t})=>bh(t,`y`)};kh.translateX=kh.x,kh.translateY=kh.y;var Ah=new Set,jh=!1,Mh=!1,Nh=!1;function Ph(){if(Mh){let e=Array.from(Ah).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Oh(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Mh=!1,jh=!1,Ah.forEach(e=>e.complete(Nh)),Ah.clear()}function Fh(){Ah.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Mh=!0)})}function Ih(){Nh=!0,Fh(),Ph(),Nh=!1}var Lh=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Ah.add(this),jh||(jh=!0,Cp.read(Fh),Cp.resolveKeyframes(Ph))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}uh(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ah.delete(this)}cancel(){this.state===`scheduled`&&(Ah.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Rh=e=>e.startsWith(`--`);function zh(e,t,n){Rh(t)?e.style.setProperty(t,n):e.style[t]=n}var Bh={};function Vh(e,t){let n=Vf(e);return()=>Bh[t]??n()}var Hh=Vh(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Uh=Vh(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Wh=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Gh={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Wh([0,.65,.55,1]),circOut:Wh([.55,0,1,.45]),backIn:Wh([.31,.01,.66,-.59]),backOut:Wh([.33,1.53,.69,.99])};function Kh(e,t){if(e)return typeof e==`function`?Uh()?Fm(e,t):`ease-out`:mp(e)?Wh(e):Array.isArray(e)?e.map(e=>Kh(e,t)||Gh.easeOut):Gh[e]}function qh(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Kh(s,i);Array.isArray(d)&&(u.easing=d),yp.value&&Ap.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return yp.value&&p.finished.finally(()=>{Ap.waapi--}),p}function Jh(e){return typeof e==`function`&&`applyToOptions`in e}function Yh({type:e,...t}){return Jh(e)&&Uh()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Xh=class extends sh{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Yh(e);this.animation=qh(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=ih(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),zh(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Jf(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Jf(e)}get time(){return Jf(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=qf(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Hh()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Hf):r(this)}},Zh={anticipate:op,backInOut:ap,circInOut:lp};function Qh(e){return e in Zh}function $h(e){typeof e.ease==`string`&&Qh(e.ease)&&(e.ease=Zh[e.ease])}var eg=10,tg=class extends Xh{constructor(e){$h(e),oh(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new lh({...a,autoplay:!1}),s=Math.max(eg,kp.now()-this.startTime),c=If(0,eg,s-eg),l=o.sample(s).value,{name:u}=this.options;i&&u&&zh(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},ng=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(gm.test(e)||e===`0`)&&!e.startsWith(`url(`));function cee(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function lee(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=ng(i,t),s=ng(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:cee(e)||(n===`spring`||Jh(n))&&r}function rg(e){e.duration=0,e.type=`keyframes`}var ig=new Set([`opacity`,`clipPath`,`filter`,`transform`]),uee=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function dee(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&uee.test(e[t]))return!0;return!1}var fee=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),pee=Vf(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function mee(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return pee()&&n&&(ig.has(n)||fee.has(n)&&dee(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var hee=40,gee=class extends sh{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=kp.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||Lh)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=kp.now();let u=!0;lee(e,i,a,o)||(u=!1,(Lf.instantAnimations||!s)&&l?.(ih(e,n,t)),e[0]=e[e.length-1],rg(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>hee?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&mee(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new tg({...d,element:p})}catch{m=new lh(d)}else m=new lh(d);m.finished.then(()=>{this.notifyFinished()}).catch(Hf),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ih()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function ag(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var _ee=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vee(e){let t=_ee.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function og(e,t,n=1){`${e}`;let[r,i]=vee(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Rf(e)?parseFloat(e):e}return Pp(i)?og(i,t,n+1):i}var yee={type:`spring`,stiffness:500,damping:25,restSpeed:10},bee=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xee={type:`keyframes`,duration:.8},See={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Cee=(e,{keyframes:t})=>t.length>2?xee:wh.has(e)?e.startsWith(`scale`)?bee(t[1]):yee:See;function sg(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function cg(e,t){let n=e?.[t]??e?.default??e;return n===e?n:sg(n,e)}var wee=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Tee(e){for(let t in e)if(!wee.has(t))return!0;return!1}var lg=(e,t,n,r={},i,a)=>o=>{let s=cg(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=qf(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Tee(s)||Object.assign(u,Cee(e,u)),u.duration&&=qf(u.duration),u.repeatDelay&&=qf(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(rg(u),u.delay===0&&(d=!0)),(Lf.instantAnimations||Lf.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,rg(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=ih(u.keyframes,s);if(e!==void 0){Cp.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new lh(u):new gee(u)};function ug(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function dg(e,t,n,r){if(typeof t==`function`){let[i,a]=ug(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=ug(r);t=t(n===void 0?e.custom:n,i,a)}return t}function fg(e,t,n){let r=e.getProps();return dg(r,t,n===void 0?r.custom:n,e)}var pg=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Ch]),mg=30,hg=e=>!isNaN(parseFloat(e)),gg={current:void 0},_g=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=kp.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=kp.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=hg(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new Kf);let n=this.events[e].add(t);return e===`change`?()=>{n(),Cp.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return gg.current&&gg.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=kp.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>mg)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,mg);return Yf(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function vg(e,t){return new _g(e,t)}var yg=e=>Array.isArray(e);function bg(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,vg(n))}function xg(e){return yg(e)?e[e.length-1]||0:e}function Eee(e,t){let{transitionEnd:n={},transition:r={},...i}=fg(e,t)||{};i={...i,...n};for(let t in i)bg(e,t,xg(i[t]))}var Sg=e=>!!(e&&e.getVelocity);function Dee(e){return!!(Sg(e)&&e.add)}function Cg(e,t){let n=e.getValue(`willChange`);if(Dee(n))return n.add(t);if(!n&&Lf.WillChange){let n=new Lf.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function wg(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Tg=`data-`+wg(`framerAppearId`);function Eg(e){return e.props[Tg]}function Dg({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Og(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?sg(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&Dg(d,t))continue;let o={delay:n,...cg(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Cp.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=Eg(e);if(n){let e=window.MotionHandoffAnimation(n,t,Cp);e!==null&&(o.startTime=e,f=!0)}}Cg(e,t);let p=l??e.shouldReduceMotion;r.start(lg(t,r,i,p&&pg.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>Cp.update(()=>{o&&Eee(e,o)});u.length?Promise.all(u).then(t):t()}return u}function kg(e,t,n={}){let r=fg(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Og(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Oee(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function Oee(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(kg(c,t,{...o,delay:n+(typeof r==`function`?0:r)+ag(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function kee(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>kg(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=kg(e,t,n);else{let i=typeof t==`function`?fg(e,t,n.custom):t;r=Promise.all(Og(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Aee={test:e=>e===`auto`,parse:e=>e},Ag=e=>t=>t.test(e),jg=[Lp,J,Qp,Zp,$p,tee,Aee],Mg=e=>jg.find(Ag(e));function Ng(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||Bf(e)}var Pg=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Fg(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Vp)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Pg.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Ig=/\b([a-z-]*)\(.*?\)/gu,Lg={...gm,getAnimatableNone:e=>{let t=e.match(Ig);return t?t.map(Fg).join(` `):e}},Rg={...gm,getAnimatableNone:e=>{let t=gm.parse(e);return gm.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},zg={...Lp,transform:Math.round},Bg={borderWidth:J,borderTopWidth:J,borderRightWidth:J,borderBottomWidth:J,borderLeftWidth:J,borderRadius:J,borderTopLeftRadius:J,borderTopRightRadius:J,borderBottomRightRadius:J,borderBottomLeftRadius:J,width:J,maxWidth:J,height:J,maxHeight:J,top:J,right:J,bottom:J,left:J,inset:J,insetBlock:J,insetBlockStart:J,insetBlockEnd:J,insetInline:J,insetInlineStart:J,insetInlineEnd:J,padding:J,paddingTop:J,paddingRight:J,paddingBottom:J,paddingLeft:J,paddingBlock:J,paddingBlockStart:J,paddingBlockEnd:J,paddingInline:J,paddingInlineStart:J,paddingInlineEnd:J,margin:J,marginTop:J,marginRight:J,marginBottom:J,marginLeft:J,marginBlock:J,marginBlockStart:J,marginBlockEnd:J,marginInline:J,marginInlineStart:J,marginInlineEnd:J,fontSize:J,backgroundPositionX:J,backgroundPositionY:J,rotate:Zp,rotateX:Zp,rotateY:Zp,rotateZ:Zp,scale:zp,scaleX:zp,scaleY:zp,scaleZ:zp,skew:Zp,skewX:Zp,skewY:Zp,distance:J,translateX:J,translateY:J,translateZ:J,x:J,y:J,z:J,perspective:J,transformPerspective:J,opacity:Rp,originX:em,originY:em,originZ:J,zIndex:zg,fillOpacity:Rp,strokeOpacity:Rp,numOctaves:zg},jee={...Bg,color:nm,backgroundColor:nm,outlineColor:nm,fill:nm,stroke:nm,borderColor:nm,borderTopColor:nm,borderRightColor:nm,borderBottomColor:nm,borderLeftColor:nm,filter:Lg,WebkitFilter:Lg,mask:Rg,WebkitMask:Rg},Vg=e=>jee[e],Hg=new Set([Lg,Rg]);function Ug(e,t){let n=Vg(e);return Hg.has(n)||(n=gm),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Wg=new Set([`auto`,`none`,`0`]);function Gg(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Wg.has(t)&&dm(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Ug(n,i)}var Kg=class extends Lh{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Pp(r))){let i=og(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!pg.has(n)||e.length!==2)return;let[r,i]=e,a=Mg(r),o=Mg(i);if(Ip(r)!==Ip(i)&&kh[n]){this.needsMeasurement=!0;return}if(a!==o)if(Th(a)&&Th(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else kh[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Ng(e[t]))&&n.push(t);n.length&&Gg(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=kh[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=kh[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function qg(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Jg=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Yg(e){return zf(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:Xg,cancel:Mee}=Sp(queueMicrotask,!1),Zg={x:!1,y:!1};function Qg(){return Zg.x||Zg.y}function Nee(e){return e===`x`||e===`y`?Zg[e]?null:(Zg[e]=!0,()=>{Zg[e]=!1}):Zg.x||Zg.y?null:(Zg.x=Zg.y=!0,()=>{Zg.x=Zg.y=!1})}function $g(e,t){let n=qg(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Pee(e){return!(e.pointerType===`touch`||Qg())}function Fee(e,t,n={}){let[r,i,a]=$g(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Pee(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var e_=(e,t)=>t?e===t?!0:e_(e,t.parentElement):!1,t_=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,n_=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function r_(e){return n_.has(e.tagName)||e.isContentEditable===!0}var i_=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function a_(e){return i_.has(e.tagName)||e.isContentEditable===!0}var o_=new WeakSet;function s_(e){return t=>{t.key===`Enter`&&e(t)}}function c_(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var l_=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=s_(()=>{if(o_.has(n))return;c_(n,`down`);let e=s_(()=>{c_(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>c_(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function u_(e){return t_(e)&&!Qg()}var d_=new WeakSet;function f_(e,t,n={}){let[r,i,a]=$g(e,n),o=e=>{let r=e.currentTarget;if(!u_(e)||d_.has(e))return;o_.add(r),n.stopPropagation&&d_.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),o_.has(r)&&o_.delete(r),u_(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||e_(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Yg(e)&&(e.addEventListener(`focus`,e=>l_(e,i)),!r_(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function p_(e){return zf(e)&&`ownerSVGElement`in e}var m_=new WeakMap,h_,g_=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:p_(r)&&`getBBox`in r?r.getBBox()[t]:r[n],__=g_(`inline`,`width`,`offsetWidth`),v_=g_(`block`,`height`,`offsetHeight`);function y_({target:e,borderBoxSize:t}){m_.get(e)?.forEach(n=>{n(e,{get width(){return __(e,t)},get height(){return v_(e,t)}})})}function b_(e){e.forEach(y_)}function x_(){typeof ResizeObserver>`u`||(h_=new ResizeObserver(b_))}function S_(e,t){h_||x_();let n=qg(e);return n.forEach(e=>{let n=m_.get(e);n||(n=new Set,m_.set(e,n)),n.add(t),h_?.observe(e)}),()=>{n.forEach(e=>{let n=m_.get(e);n?.delete(t),n?.size||h_?.unobserve(e)})}}var C_=new Set,w_;function T_(){w_=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};C_.forEach(t=>t(e))},window.addEventListener(`resize`,w_)}function E_(e){return C_.add(e),w_||T_(),()=>{C_.delete(e),!C_.size&&typeof w_==`function`&&(window.removeEventListener(`resize`,w_),w_=void 0)}}function D_(e,t){return typeof e==`function`?E_(e):S_(e,t)}function O_(e){return p_(e)&&e.tagName===`svg`}var k_=[...jg,nm,gm],A_=e=>k_.find(Ag(e)),j_=()=>({translate:0,scale:1,origin:0,originPoint:0}),M_=()=>({x:j_(),y:j_()}),N_=()=>({min:0,max:0}),P_=()=>({x:N_(),y:N_()}),F_=new WeakMap;function I_(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function L_(e){return typeof e==`string`||Array.isArray(e)}var R_=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],z_=[`initial`,...R_];function B_(e){return I_(e.animate)||z_.some(t=>L_(e[t]))}function V_(e){return!!(B_(e)||e.variants)}function H_(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Sg(i))e.addValue(r,i);else if(Sg(a))e.addValue(r,vg(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,vg(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var U_={current:null},W_={current:!1},G_=typeof window<`u`;function K_(){if(W_.current=!0,G_)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>U_.current=e.matches;e.addEventListener(`change`,t),t()}else U_.current=!1}var q_=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],J_={};function Y_(e){J_=e}function X_(){return J_}var Iee=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Lh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=kp.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Cp.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=B_(t),this.isVariantNode=V_(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&Sg(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,F_.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(W_.current||K_(),this.shouldReduceMotion=U_.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),wp(this.notifyUpdate),wp(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&ig.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Xh({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:qf(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=wh.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Cp.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in J_){let t=J_[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):P_()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<q_.length;t++){let n=q_[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=H_(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=vg(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Rf(n)||Bf(n))?n=parseFloat(n):!A_(n)&&gm.test(t)&&(n=Ug(e,t)),this.setBaseTarget(e,Sg(n)?n.get():n)),Sg(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=dg(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Sg(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Kf),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Xg.render(this.render)}},Z_=class extends Iee{constructor(){super(...arguments),this.KeyframeResolver=Kg}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;Sg(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Q_=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function $_({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Lee({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ree(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ev(e){return e===void 0||e===1}function tv({scale:e,scaleX:t,scaleY:n}){return!ev(e)||!ev(t)||!ev(n)}function nv(e){return tv(e)||rv(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function rv(e){return iv(e.x)||iv(e.y)}function iv(e){return e&&e!==`0%`}function av(e,t,n){return n+t*(e-n)}function ov(e,t,n,r,i){return i!==void 0&&(e=av(e,i,r)),av(e,n,r)+t}function sv(e,t=0,n=1,r,i){e.min=ov(e.min,t,n,r,i),e.max=ov(e.max,t,n,r,i)}function cv(e,{x:t,y:n}){sv(e.x,t.translate,t.scale,t.originPoint),sv(e.y,n.translate,n.scale,n.originPoint)}var lv=.999999999999,uv=1.0000000000001;function dv(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(fv(e.x,-a.scroll.offset.x),fv(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,cv(e,o)),r&&nv(a.latestValues)&&hv(e,a.latestValues,a.layout?.layoutBox))}t.x<uv&&t.x>lv&&(t.x=1),t.y<uv&&t.y>lv&&(t.y=1)}function fv(e,t){e.min+=t,e.max+=t}function pv(e,t,n,r,i=.5){sv(e,t,n,ym(e.min,e.max,i),r)}function mv(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function hv(e,t,n){let r=n??e;pv(e.x,mv(t.x,r.x),t.scaleX,t.scale,t.originX),pv(e.y,mv(t.y,r.y),t.scaleY,t.scale,t.originY)}function gv(e,t){return $_(Ree(e.getBoundingClientRect(),t))}function _v(e,t,n){let r=gv(e,n),{scroll:i}=t;return i&&(fv(r.x,i.offset.x),fv(r.y,i.offset.y)),r}var vv={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},yv=Ch.length;function bv(e,t,n){let r=``,i=!0;for(let a=0;a<yv;a++){let o=Ch[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Jg(s,Bg[o]);if(!c){i=!1;let t=vv[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function xv(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(wh.has(e)){o=!0;continue}else if(Mp(e)){i[e]=n;continue}else{let t=Jg(n,Bg[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=bv(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Sv(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Cv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var wv={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(J.test(e))e=parseFloat(e);else return e;return`${Cv(e,t.target.x)}% ${Cv(e,t.target.y)}%`}},Tv={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=gm.parse(e);if(i.length>5)return r;let a=gm.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=ym(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Ev={borderRadius:{...wv,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:wv,borderTopRightRadius:wv,borderBottomLeftRadius:wv,borderBottomRightRadius:wv,boxShadow:Tv};function Dv(e,{layout:t,layoutId:n}){return wh.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Ev[e]||e===`opacity`)}function Ov(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Sg(r[t])||i&&Sg(i[t])||Dv(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function kv(e){return window.getComputedStyle(e)}var Av=class extends Z_{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Sv}readValueFromInstance(e,t){if(wh.has(t))return this.projection?.isProjecting?yh(t):xh(e,t);{let n=kv(e),r=(Mp(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return gv(e,t)}build(e,t,n){xv(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ov(e,t,n)}},jv={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Mv={offset:`strokeDashoffset`,array:`strokeDasharray`};function Nv(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?jv:Mv;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Pv=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Fv(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(xv(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Pv)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Nv(d,i,a,o,!1)}var Iv=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`]),Lv=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Rv(e,t,n,r){Sv(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Iv.has(n)?n:wg(n),t.attrs[n])}function zv(e,t,n){let r=Ov(e,t,n);for(let n in e)if(Sg(e[n])||Sg(t[n])){let t=Ch.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Bv=class extends Z_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=P_}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(wh.has(t)){let e=Vg(t);return e&&e.default||0}return t=Iv.has(t)?t:wg(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return zv(e,t,n)}build(e,t,n){Fv(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Rv(e,t,n,r)}mount(e){this.isSVGTag=Lv(e.tagName),super.mount(e)}},Vv=z_.length;function Hv(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&Hv(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Vv;n++){let r=z_[n],i=e.props[r];(L_(i)||i===!1)&&(t[r]=i)}return t}function Uv(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Wv=[...R_].reverse(),Gv=R_.length;function Kv(e){return t=>Promise.all(t.map(({animation:t,options:n})=>kee(e,t,n)))}function qv(e){let t=Kv(e),n=Xv(),r=!0,i=!1,a=t=>(n,r)=>{let i=fg(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=Hv(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Gv;t++){let p=Wv[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=L_(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||I_(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Jv(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=yg(t)&&yg(n)?!Uv(t,n):t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=fg(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=ag(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=fg(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Xv(),i=!0}}}function Jv(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Uv(t,e):!1}function Yv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Xv(){return{animate:Yv(!0),whileInView:Yv(),whileHover:Yv(),whileTap:Yv(),whileDrag:Yv(),whileFocus:Yv(),exit:Yv()}}function Zv(e,t){e.min=t.min,e.max=t.max}function Qv(e,t){Zv(e.x,t.x),Zv(e.y,t.y)}function $v(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var ey=1e-4,ty=1-ey,ny=1+ey,ry=.01,iy=0-ry,ay=0+ry;function oy(e){return e.max-e.min}function sy(e,t,n){return Math.abs(e-t)<=n}function cy(e,t,n,r=.5){e.origin=r,e.originPoint=ym(t.min,t.max,e.origin),e.scale=oy(n)/oy(t),e.translate=ym(n.min,n.max,e.origin)-e.originPoint,(e.scale>=ty&&e.scale<=ny||isNaN(e.scale))&&(e.scale=1),(e.translate>=iy&&e.translate<=ay||isNaN(e.translate))&&(e.translate=0)}function ly(e,t,n,r){cy(e.x,t.x,n.x,r?r.originX:void 0),cy(e.y,t.y,n.y,r?r.originY:void 0)}function uy(e,t,n,r=0){e.min=(r?ym(n.min,n.max,r):n.min)+t.min,e.max=e.min+oy(t)}function dy(e,t,n,r){uy(e.x,t.x,n.x,r?.x),uy(e.y,t.y,n.y,r?.y)}function fy(e,t,n,r=0){let i=r?ym(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+oy(t)}function py(e,t,n,r){fy(e.x,t.x,n.x,r?.x),fy(e.y,t.y,n.y,r?.y)}function my(e,t,n,r,i){return e-=t,e=av(e,1/n,r),i!==void 0&&(e=av(e,1/i,r)),e}function hy(e,t=0,n=1,r=.5,i,a=e,o=e){if(Qp.test(t)&&(t=parseFloat(t),t=ym(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=ym(a.min,a.max,r);e===a&&(s-=t),e.min=my(e.min,t,n,s,i),e.max=my(e.max,t,n,s,i)}function gy(e,t,[n,r,i],a,o){hy(e,t[n],t[r],t[i],t.scale,a,o)}var _y=[`x`,`scaleX`,`originX`],vy=[`y`,`scaleY`,`originY`];function yy(e,t,n,r){gy(e.x,t,_y,n?n.x:void 0,r?r.x:void 0),gy(e.y,t,vy,n?n.y:void 0,r?r.y:void 0)}function by(e){return e.translate===0&&e.scale===1}function xy(e){return by(e.x)&&by(e.y)}function Sy(e,t){return e.min===t.min&&e.max===t.max}function Cy(e,t){return Sy(e.x,t.x)&&Sy(e.y,t.y)}function wy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ty(e,t){return wy(e.x,t.x)&&wy(e.y,t.y)}function Ey(e){return oy(e.x)/oy(e.y)}function Dy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Oy(e){return[e(`x`),e(`y`)]}function ky(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Ay=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],jy=Ay.length,My=e=>typeof e==`string`?parseFloat(e):e,Ny=e=>typeof e==`number`||J.test(e);function Py(e,t,n,r,i,a){i?(e.opacity=ym(0,n.opacity??1,Iy(r)),e.opacityExit=ym(t.opacity??1,0,Ly(r))):a&&(e.opacity=ym(t.opacity??1,n.opacity??1,r));for(let i=0;i<jy;i++){let a=Ay[i],o=Fy(t,a),s=Fy(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||Ny(o)===Ny(s)?(e[a]=Math.max(ym(My(o),My(s),r),0),(Qp.test(s)||Qp.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=ym(t.rotate||0,n.rotate||0,r))}function Fy(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Iy=Ry(0,.5,cp),Ly=Ry(.5,.95,Hf);function Ry(e,t,n){return r=>r<e?0:r>t?1:n(Gf(e,t,r))}function zy(e,t,n){let r=Sg(e)?e:vg(e);return r.start(lg(``,r,t,n)),r.animation}function By(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var Vy=(e,t)=>e.depth-t.depth,Hy=class{constructor(){this.children=[],this.isDirty=!1}add(e){Pf(this.children,e),this.isDirty=!0}remove(e){Ff(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Vy),this.isDirty=!1,this.children.forEach(e)}};function Uy(e,t){let n=kp.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(wp(r),e(a-t))};return Cp.setup(r,!0),()=>wp(r)}function Wy(e){return Sg(e)?e.get():e}var Gy=class{constructor(){this.members=[]}add(e){Pf(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Ff(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Ff(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},Ky={hasAnimatedSinceResize:!0,hasEverUpdated:!1},qy={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Jy=[``,`X`,`Y`,`Z`],Yy=1e3,Xy=0;function Zy(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Qy(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Eg(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Cp,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Qy(r)}function $y({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Xy++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,yp.value&&(qy.nodes=qy.calculatedTargetDeltas=qy.calculatedProjections=0),this.nodes.forEach(Vee),this.nodes.forEach(qee),this.nodes.forEach(Jee),this.nodes.forEach(Hee),yp.addProjectionMetrics&&yp.addProjectionMetrics(qy)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Hy)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Kf),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=p_(t)&&!O_(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Cp.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Uy(i,250),Ky.hasAnimatedSinceResize&&(Ky.hasAnimatedSinceResize=!1,this.nodes.forEach(nb)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||$ee,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Ty(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...cg(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||nb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),wp(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(Yee),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Qy(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Wee),this.nodes.forEach(eb);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(tb);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Gee),this.nodes.forEach(Kee),this.nodes.forEach(zee),this.nodes.forEach(Bee)):this.nodes.forEach(tb),this.clearAllSnapshots();let e=kp.now();Tp.delta=If(0,1e3/60,e-Tp.timestamp),Tp.timestamp=e,Tp.isProcessing=!0,Ep.update.process(Tp),Ep.preRender.process(Tp),Ep.render.process(Tp),Tp.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Xg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Uee),this.sharedNodes.forEach(Xee)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Cp.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Cp.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!oy(this.snapshot.measuredBox.x)&&!oy(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 e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=P_(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!xy(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||nv(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),ete(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return P_();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(tte))){let{scroll:e}=this.root;e&&(fv(t.x,e.offset.x),fv(t.y,e.offset.y))}return t}removeElementScroll(e){let t=P_();if(Qv(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Qv(t,e),fv(t.x,i.offset.x),fv(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||P_();Qv(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(fv(r.x,-n.scroll.offset.x),fv(r.y,-n.scroll.offset.y)),nv(n.latestValues)&&hv(r,n.latestValues,n.layout?.layoutBox)}return nv(this.latestValues)&&hv(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=P_();Qv(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!nv(n.latestValues))continue;let r;n.instance&&(tv(n.latestValues)&&n.updateSnapshot(),r=P_(),Qv(r,n.measurePageBox())),yy(t,n.latestValues,n.snapshot?.layoutBox,r)}return nv(this.latestValues)&&yy(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}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!==Tp.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Tp.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=P_(),this.targetWithTransforms=P_()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),dy(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Qv(this.target,this.layout.layoutBox),cv(this.target,this.targetDelta)):Qv(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),yp.value&&qy.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||tv(this.parent.latestValues)||rv(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=P_(),this.relativeTargetOrigin=P_(),py(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Qv(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Tp.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Qv(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;dv(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=P_());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():($v(this.prevProjectionDelta.x,this.projectionDelta.x),$v(this.prevProjectionDelta.y,this.projectionDelta.y)),ly(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Dy(this.projectionDelta.x,this.prevProjectionDelta.x)||!Dy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),yp.value&&qy.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=M_(),this.projectionDelta=M_(),this.projectionDeltaWithTransform=M_()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=M_();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=P_(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(Qee));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;rb(a.x,e.x,n),rb(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(py(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Zee(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&Cy(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=P_(),Qv(d,this.relativeTarget)),s&&(this.animationValues=i,Py(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(wp(this.pendingAnimation),void 0),this.pendingAnimation=Cp.update(()=>{Ky.hasAnimatedSinceResize=!0,Ap.layout++,this.motionValue||=vg(0),this.motionValue.jump(0,!1),this.currentAnimation=zy(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{Ap.layout--},onComplete:()=>{Ap.layout--,e.onComplete&&e.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);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Yy),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&cb(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||P_();let t=oy(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=oy(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Qv(t,n),hv(t,i),ly(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Gy),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&Zy(`z`,e,r,this.animationValues);for(let t=0;t<Jy.length;t++)Zy(`rotate${Jy[t]}`,e,r,this.animationValues),Zy(`skew${Jy[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Wy(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Wy(t?.pointerEvents)||``),this.hasProjected&&!nv(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=ky(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Ev){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Ev[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Wy(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(eb),this.root.sharedNodes.clear()}}}function zee(e){e.updateLayout()}function Bee(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Oy(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=oy(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Zv(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else cb(i,t.layoutBox,n)&&Oy(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=oy(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=M_();ly(o,n,t.layoutBox);let s=M_();a?ly(s,e.applyTransform(r,!0),t.measuredBox):ly(s,n,t.layoutBox);let c=!xy(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=P_();py(s,t.layoutBox,i.layoutBox,o);let c=P_();py(c,n,a.layoutBox,o),Ty(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Vee(e){yp.value&&qy.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Hee(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Uee(e){e.clearSnapshot()}function eb(e){e.clearMeasurements()}function Wee(e){e.isLayoutDirty=!0,e.updateLayout()}function tb(e){e.isLayoutDirty=!1}function Gee(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Kee(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function nb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function qee(e){e.resolveTargetDelta()}function Jee(e){e.calcProjection()}function Yee(e){e.resetSkewAndRotation()}function Xee(e){e.removeLeadSnapshot()}function rb(e,t,n){e.translate=ym(t.translate,0,n),e.scale=ym(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ib(e,t,n,r){e.min=ym(t.min,n.min,r),e.max=ym(t.max,n.max,r)}function Zee(e,t,n,r){ib(e.x,t.x,n.x,r),ib(e.y,t.y,n.y,r)}function Qee(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var $ee={duration:.45,ease:[.4,0,.1,1]},ab=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ob=ab(`applewebkit/`)&&!ab(`chrome/`)?Math.round:Hf;function sb(e){e.min=ob(e.min),e.max=ob(e.max)}function ete(e){sb(e.x),sb(e.y)}function cb(e,t,n){return e===`position`||e===`preserve-aspect`&&!sy(Ey(t),Ey(n),.2)}function tte(e){return e!==e.root&&e.scroll?.wasRoot}var nte=$y({attachResizeListener:(e,t)=>By(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),lb={current:void 0},ub=$y({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lb.current){let e=new nte({});e.mount(window),e.setOptions({layoutScroll:!0}),lb.current=e}return lb.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),db=(0,L.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function fb(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function rte(...e){return t=>{let n=!1,r=e.map(e=>{let r=fb(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():fb(e[t],null)}}}}function ite(...e){return L.useCallback(rte(...e),e)}var ate=class extends L.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Yg(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Yg(e)&&e.offsetWidth||0,r=Yg(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}};function ote({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,L.useId)(),s=(0,L.useRef)(null),c=(0,L.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=(0,L.useContext)(db),u=ite(s,e.props?.ref??e?.ref);return(0,L.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m}=c.current;if(t||a===!1||!s.current||!e||!u)return;let h=n===`left`?`left: ${f}`:`right: ${p}`,g=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let _=document.createElement(`style`);l&&(_.nonce=l);let v=i??document.head;return v.appendChild(_),_.sheet&&_.sheet.insertRule(`
20
- [data-motion-pop-id="${o}"] {
21
- position: absolute !important;
22
- width: ${e}px !important;
23
- height: ${u}px !important;
24
- ${h}px !important;
25
- ${g}px !important;
26
- }
27
- `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),v.contains(_)&&v.removeChild(_)}},[t]),(0,R.jsx)(ate,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:L.cloneElement(e,{ref:u})})}var ste=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=jf(cte),d=(0,L.useId)(),f=!0,p=(0,L.useMemo)(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>u.delete(e))}),[n,u,r]);return a&&f&&(p={...p}),(0,L.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),L.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,R.jsx)(ote,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,R.jsx)(Nf.Provider,{value:p,children:e})};function cte(){return new Map}function pb(e=!0){let t=(0,L.useContext)(Nf);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,L.useId)();(0,L.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,L.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var mb=e=>e.key||``;function hb(e){let t=[];return L.Children.forEach(e,e=>{(0,L.isValidElement)(e)&&t.push(e)}),t}var gb=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=pb(o),f=(0,L.useMemo)(()=>hb(e),[e]),p=o&&!u?[]:f.map(mb),m=(0,L.useRef)(!0),h=(0,L.useRef)(f),g=jf(()=>new Map),_=(0,L.useRef)(new Set),[v,y]=(0,L.useState)(f),[b,x]=(0,L.useState)(f);Mf(()=>{m.current=!1,h.current=f;for(let e=0;e<b.length;e++){let t=mb(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f];for(let t=0;t<b.length;t++){let n=b[t],r=mb(n);p.includes(r)||(e.splice(t,0,n),S.push(n))}return a===`wait`&&S.length&&(e=S),x(hb(e)),y(f),null}let{forceRender:C}=(0,L.useContext)(Af);return(0,R.jsx)(R.Fragment,{children:b.map(e=>{let v=mb(e),y=o&&!u?!1:f===b||p.includes(v);return(0,R.jsx)(ste,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),x(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},_b=(0,L.createContext)({strict:!1}),vb={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`]},yb=!1;function lte(){if(yb)return;let e={};for(let t in vb)e[t]={isEnabled:e=>vb[t].some(t=>!!e[t])};Y_(e),yb=!0}function bb(){return lte(),X_()}function ute(e){let t=bb();for(let n in e)t[n]={...t[n],...e[n]};Y_(t)}var dte=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function xb(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||dte.has(e)}var fte=c({default:()=>Sb}),Sb,pte=o((()=>{throw Sb={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),Cb=e=>!xb(e);function wb(e){typeof e==`function`&&(Cb=t=>t.startsWith(`on`)?!xb(t):e(t))}try{wb((pte(),d(fte)).default)}catch{}function Tb(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||Sg(e[i])||(Cb(i)||n===!0&&xb(i)||!t&&!xb(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var Eb=(0,L.createContext)({});function Db(e,t){if(B_(e)){let{initial:t,animate:n}=e;return{initial:t===!1||L_(t)?t:void 0,animate:L_(n)?n:void 0}}return e.inherit===!1?{}:t}function Ob(e){let{initial:t,animate:n}=Db(e,(0,L.useContext)(Eb));return(0,L.useMemo)(()=>({initial:t,animate:n}),[kb(t),kb(n)])}function kb(e){return Array.isArray(e)?e.join(` `):e}var Ab=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jb(e,t,n){for(let r in t)!Sg(t[r])&&!Dv(r,n)&&(e[r]=t[r])}function Mb({transformTemplate:e},t){return(0,L.useMemo)(()=>{let n=Ab();return xv(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Nb(e,t){let n=e.style||{},r={};return jb(r,n,e),Object.assign(r,Mb(e,t)),r}function Pb(e,t){let n={},r=Nb(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var Fb=()=>({...Ab(),attrs:{}});function Ib(e,t,n,r){let i=(0,L.useMemo)(()=>{let n=Fb();return Fv(n,t,Lv(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};jb(t,e.style,e),i.style={...t,...i.style}}return i}var Lb=[`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 Rb(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Lb.indexOf(e)>-1||/[A-Z]/u.test(e))}function zb(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??Rb(e)?Ib:Pb)(t,r,i,e),c=Tb(t,typeof e==`string`,a),l=e===L.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,L.useMemo)(()=>Sg(u)?u.get():u,[u]);return(0,L.createElement)(e,{...l,children:d})}function Bb({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Vb(n,r,i,e),renderState:t()}}function Vb(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Wy(a[e]);let{initial:o,animate:s}=e,c=B_(e),l=V_(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!I_(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=dg(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Hb=e=>(t,n)=>{let r=(0,L.useContext)(Eb),i=(0,L.useContext)(Nf),a=()=>Bb(e,t,r,i);return n?a():jf(a)},Ub=Hb({scrapeMotionValuesFromProps:Ov,createRenderState:Ab}),Wb=Hb({scrapeMotionValuesFromProps:zv,createRenderState:Fb}),Gb=Symbol.for(`motionComponentSymbol`);function Kb(e,t,n){let r=(0,L.useRef)(n);(0,L.useInsertionEffect)(()=>{r.current=n});let i=(0,L.useRef)(null);return(0,L.useCallback)(n=>{n&&e.onMount?.(n);let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n);t&&(n?t.mount(n):t.unmount())},[t])}var qb=(0,L.createContext)({});function Jb(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Yb(e,t,n,r,i,a){let{visualElement:o}=(0,L.useContext)(Eb),s=(0,L.useContext)(_b),c=(0,L.useContext)(Nf),l=(0,L.useContext)(db),u=l.reducedMotion,d=l.skipAnimations,f=(0,L.useRef)(null),p=(0,L.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,L.useContext)(qb);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Xb(f.current,n,i,h);let g=(0,L.useRef)(!1);(0,L.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Tg],v=(0,L.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Mf(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,L.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function Xb(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Zb(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Jb(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Zb(e){if(e)return e.options.allowProjection===!1?Zb(e.parent):e.projection}function Qb(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&ute(r);let a=n?n===`svg`:Rb(e),o=a?Wb:Ub;function s(n,s){let c,l={...(0,L.useContext)(db),...n,layoutId:$b(n)},{isStatic:u}=l,d=Ob(n),f=o(n,u);if(!u&&typeof window<`u`){ex(l,r);let t=tx(l);c=t.MeasureLayout,d.visualElement=Yb(e,f,l,i,t.ProjectionNode,a)}return(0,R.jsxs)(Eb.Provider,{value:d,children:[c&&d.visualElement?(0,R.jsx)(c,{visualElement:d.visualElement,...l}):null,zb(e,n,Kb(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,L.forwardRef)(s);return c[Gb]=e,c}function $b({layoutId:e}){let t=(0,L.useContext)(Af).id;return t&&e!==void 0?t+`-`+e:e}function ex(e,t){(0,L.useContext)(_b).strict}function tx(e){let{drag:t,layout:n}=bb();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function nx(e,t){if(typeof Proxy>`u`)return Qb;let n=new Map,r=(n,r)=>Qb(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Qb(a,void 0,e,t)),n.get(a))})}var rx=(e,t)=>t.isSVG??Rb(e)?new Bv(t):new Av(t,{allowProjection:e!==L.Fragment}),ix=class extends Q_{constructor(e){super(e),e.animationState||=qv(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();I_(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},ax=0,ox={animation:{Feature:ix},exit:{Feature:class extends Q_{constructor(){super(...arguments),this.id=ax++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`){let n=fg(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function sx(e){return{point:{x:e.pageX,y:e.pageY}}}var cx=e=>t=>t_(t)&&e(t,sx(t));function lx(e,t,n,r){return By(e,t,cx(n),r)}var ux=({current:e})=>e?e.ownerDocument.defaultView:null,dx=(e,t)=>Math.abs(e-t);function fx(e,t){let n=dx(e.x,t.x),r=dx(e.y,t.y);return Math.sqrt(n**2+r**2)}var px=new Set([`auto`,`scroll`]),mx=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=hx(this.lastRawMoveEventInfo,this.transformPagePoint));let e=_x(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=fx(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=Tp;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=hx(t,this.transformPagePoint),Cp.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=_x(e.type===`pointercancel`?this.lastMoveEventInfo:hx(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!t_(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=hx(sx(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Tp;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,_x(s,this.history)),this.removeListeners=Wf(lx(this.contextWindow,`pointermove`,this.handlePointerMove),lx(this.contextWindow,`pointerup`,this.handlePointerUp),lx(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(px.has(e.overflowX)||px.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Cp.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),wp(this.updatePoint)}};function hx(e,t){return t?{point:t(e.point)}:e}function gx(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _x({point:e},t){return{point:e,delta:gx(e,yx(t)),offset:gx(e,vx(t)),velocity:bx(t,.1)}}function vx(e){return e[0]}function yx(e){return e[e.length-1]}function bx(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=yx(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>qf(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>qf(t)*2&&(r=e[1]);let a=Jf(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function xx(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ym(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ym(n,e,r.max):Math.min(e,n)),e}function Sx(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Cx(e,{top:t,left:n,bottom:r,right:i}){return{x:Sx(e.x,n,i),y:Sx(e.y,t,r)}}function wx(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Tx(e,t){return{x:wx(e.x,t.x),y:wx(e.y,t.y)}}function Ex(e,t){let n=.5,r=oy(e),i=oy(t);return i>r?n=Gf(t.min,t.max-r,e.min):r>i&&(n=Gf(e.min,e.max-i,t.min)),If(0,1,n)}function Dx(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Ox=.35;function kx(e=Ox){return e===!1?e=0:e===!0&&(e=Ox),{x:Ax(e,`left`,`right`),y:Ax(e,`top`,`bottom`)}}function Ax(e,t,n){return{min:jx(e,t),max:jx(e,n)}}function jx(e,t){return typeof e==`number`?e:e[t]||0}var Mx=new WeakMap,Nx=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=P_(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(sx(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Nee(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Oy(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Qp.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=oy(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Cp.update(()=>i(e,t),!1,!0),Cg(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Lx(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Cp.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new mx(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:ux(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Cp.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Ix(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=xx(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Jb(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Cx(n.layoutBox,e):this.constraints=!1,this.elastic=kx(t),r!==this.constraints&&!Jb(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Oy(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Dx(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Jb(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=_v(n,r.root,this.visualElement.getTransformPagePoint()),a=Tx(r.layout.layoutBox,i);if(t){let e=t(Lee(a));this.hasMutatedConstraints=!!e,e&&(a=$_(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Oy(o=>{if(!Ix(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Cg(this.visualElement,e),n.start(lg(e,n,0,t,this.visualElement,!1))}stopAnimation(){Oy(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Oy(t=>{let{drag:n}=this.getProps();if(!Ix(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-ym(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Jb(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};Oy(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Ex({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Oy(t=>{if(!Ix(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(ym(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Mx.set(this.visualElement,this);let e=this.visualElement.current,t=lx(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&a_(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Jb(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Fx(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Cp.read(r);let o=By(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Oy(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Ox,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Px(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Fx(e,t,n){let r=D_(e,Px(n)),i=D_(t,Px(n));return()=>{r(),i()}}function Ix(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Lx(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Rx=class extends Q_{constructor(e){super(e),this.removeGroupControls=Hf,this.removeListeners=Hf,this.controls=new Nx(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Hf}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},zx=e=>(t,n)=>{e&&Cp.update(()=>e(t,n),!1,!0)},Bx=class extends Q_{constructor(){super(...arguments),this.removePointerDownListener=Hf}onPointerDown(e){this.session=new mx(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ux(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:zx(e),onStart:zx(t),onMove:zx(n),onEnd:(e,t)=>{delete this.session,r&&Cp.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=lx(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Vx=!1,Hx=class extends L.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Vx&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ky.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Vx=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Cp.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Xg.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Vx=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Ux(e){let[t,n]=pb(),r=(0,L.useContext)(Af);return(0,R.jsx)(Hx,{...e,layoutGroup:r,switchLayoutGroup:(0,L.useContext)(qb),isPresent:t,safeToRemove:n})}var Wx={pan:{Feature:Bx},drag:{Feature:Rx,ProjectionNode:ub,MeasureLayout:Ux}};function Gx(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Cp.postRender(()=>i(t,sx(t)))}var Kx=class extends Q_{mount(){let{current:e}=this.node;e&&(this.unmount=Fee(e,(e,t)=>(Gx(this.node,t,`Start`),e=>Gx(this.node,e,`End`))))}unmount(){}},qx=class extends Q_{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!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=Wf(By(this.node.current,`focus`,()=>this.onFocus()),By(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Jx(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Cp.postRender(()=>i(t,sx(t)))}var Yx=class extends Q_{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=f_(e,(e,t)=>(Jx(this.node,t,`Start`),(e,{success:t})=>Jx(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Xx=new WeakMap,Zx=new WeakMap,Qx=e=>{let t=Xx.get(e.target);t&&t(e)},$x=e=>{e.forEach(Qx)};function eS({root:e,...t}){let n=e||document;Zx.has(n)||Zx.set(n,{});let r=Zx.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver($x,{root:e,...t})),r[i]}function tS(e,t,n){let r=eS(t);return Xx.set(e,n),r.observe(e),()=>{Xx.delete(e),r.unobserve(e)}}var nS={some:0,all:1},rS=class extends Q_{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:nS[r]};this.stopObserver=tS(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(iS(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function iS({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var aS={inView:{Feature:rS},tap:{Feature:Yx},focus:{Feature:qx},hover:{Feature:Kx}},oS={layout:{ProjectionNode:ub,MeasureLayout:Ux}},sS=nx({...ox,...aS,...Wx,...oS},rx);function cS(e,t=300){let[n,r]=(0,L.useState)(e);return(0,L.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var lS=e=>[{id:`nav-dashboard`,label:`仪表盘`,description:`查看效率指标和趋势`,icon:vc,action:()=>e(`/dashboard`),category:`导航`},{id:`nav-sessions`,label:`会话管理`,description:`查看和管理会话`,icon:Ds,action:()=>e(`/sessions`),category:`导航`},{id:`nav-events`,label:`事件流`,description:`查看实时事件`,icon:Is,action:()=>e(`/events`),category:`导航`},{id:`nav-pipelines`,label:`流水线`,description:`查看编排流水线`,icon:pc,action:()=>e(`/pipelines`),category:`导航`},{id:`nav-quality`,label:`质量门禁`,description:`查看质量问题`,icon:zc,action:()=>e(`/quality`),category:`导航`},{id:`nav-knowledge`,label:`知识图谱`,description:`浏览知识节点`,icon:Fs,action:()=>e(`/knowledge`),category:`导航`},{id:`nav-analytics`,label:`数据分析`,description:`查看统计报表`,icon:Ls,action:()=>e(`/analytics`),category:`导航`},{id:`nav-config`,label:`系统配置`,description:`管理配置项`,icon:Rc,action:()=>e(`/config`),category:`导航`}];function uS(){let[e,t]=(0,L.useState)(!1),[n,r]=(0,L.useState)(``),[i,a]=(0,L.useState)(0),o=(0,L.useRef)(null),s=Fn(),c=cS(n,300),l=c.trim().length>=2,{data:u,isFetching:d}=ut({queryKey:[`cmd-pipelines`,c],queryFn:()=>_l({search:c,page_size:5}).then(e=>e.data),enabled:l&&e,staleTime:1e4}),{data:f,isFetching:p}=ut({queryKey:[`cmd-sessions`,c],queryFn:()=>dl({limit:5}).then(e=>e.data),enabled:l&&e,staleTime:1e4}),{data:m,isFetching:h}=ut({queryKey:[`cmd-knowledge`,c],queryFn:()=>Cl(c,void 0,void 0,5).then(e=>e.data),enabled:l&&e,staleTime:1e4}),{data:g,isFetching:_}=ut({queryKey:[`cmd-skills`,c],queryFn:()=>Cu({limit:5}).then(e=>e.data),enabled:l&&e,staleTime:1e4}),v=d||p||h||_,y=[];if(l){let e=c.toLowerCase();(u?.items||[]).forEach(t=>{let n=String(t.requirement||``);(n.toLowerCase().includes(e)||!e)&&y.push({id:`pipeline-${t.id}`,label:n.slice(0,60)||String(t.id),description:`流水线 · ${t.project||``}`,icon:mc,action:()=>s(`/pipelines/${t.id}`),category:`流水线`})}),(f?.items||[]).filter(t=>String(t.title||t.id||``).toLowerCase().includes(e)).forEach(e=>{y.push({id:`session-${e.id}`,label:String(e.title||e.id||``).slice(0,60),description:`会话 · ${String(e.project_path||``).split(`/`).pop()||``}`,icon:Ds,action:()=>s(`/sessions/${e.id}`),category:`会话`})}),(m?.items||[]).forEach(e=>{y.push({id:`knowledge-${e.id}`,label:String(e.title||``).slice(0,60),description:`知识节点 · ${e.node_type||``}`,icon:Fs,action:()=>s(`/knowledge`),category:`知识图谱`})}),(g?.items||[]).filter(t=>String(t.name||``).toLowerCase().includes(e)).forEach(e=>{y.push({id:`skill-${e.name}`,label:String(e.name||``).slice(0,60),description:`技能 · ${e.description?String(e.description).slice(0,40):``}`,icon:tl,action:()=>s(`/skills`),category:`技能`})})}let b=lS(s),x=n?b.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())||(e.description||``).toLowerCase().includes(n.toLowerCase())):b,S=l?[...y,...x]:x;(0,L.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),t(e=>!e),r(``),a(0)),e.key===`Escape`&&t(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,L.useEffect)(()=>{e&&setTimeout(()=>o.current?.focus(),100)},[e]),(0,L.useEffect)(()=>{a(0)},[c]);let C=e=>{e.key===`ArrowDown`?(e.preventDefault(),a(e=>Math.min(e+1,S.length-1))):e.key===`ArrowUp`?(e.preventDefault(),a(e=>Math.max(e-1,0))):e.key===`Enter`&&S[i]&&(S[i].action(),t(!1))},w=Array.from(new Set(S.map(e=>e.category)));return(0,R.jsx)(gb,{children:e&&(0,R.jsx)(sS.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 z-[200] bg-black/50 backdrop-blur-sm flex items-start justify-center pt-[20vh]`,onClick:()=>t(!1),children:(0,R.jsxs)(sS.div,{initial:{scale:.95,opacity:0,y:-20},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:-20},transition:{duration:.15},className:`bg-white rounded-xl shadow-2xl w-full max-w-lg overflow-hidden border border-gray-200`,onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 border-b border-gray-100`,children:[v?(0,R.jsx)(Sc,{className:`h-5 w-5 text-blue-400 flex-shrink-0 animate-spin`}):(0,R.jsx)(Lc,{className:`h-5 w-5 text-gray-400 flex-shrink-0`}),(0,R.jsx)(`input`,{ref:o,type:`text`,placeholder:`输入命令或搜索(≥2字符跨模块搜索)...`,value:n,onChange:e=>{r(e.target.value),a(0)},onKeyDown:C,className:`flex-1 text-sm outline-none placeholder:text-gray-400`}),(0,R.jsx)(`kbd`,{className:`hidden sm:inline-flex items-center gap-1 px-2 py-0.5 text-xs text-gray-400 bg-gray-100 rounded`,children:`ESC`})]}),(0,R.jsx)(`div`,{className:`max-h-80 overflow-y-auto py-2`,children:S.length===0&&!v?(0,R.jsx)(`div`,{className:`px-4 py-8 text-center text-sm text-gray-400`,children:l?`没有找到相关内容`:`没有匹配的命令`}):w.map(e=>(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`px-4 py-1.5 text-xs font-semibold text-gray-400 uppercase tracking-wider`,children:e}),S.filter(t=>t.category===e).map(e=>{let n=S.indexOf(e);return(0,R.jsxs)(`button`,{className:q(`w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors`,n===i?`bg-blue-50 text-blue-700`:`text-gray-700 hover:bg-gray-50`),onClick:()=>{e.action(),t(!1)},onMouseEnter:()=>a(n),children:[(0,R.jsx)(e.icon,{className:`h-4 w-4 flex-shrink-0`}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsx)(`div`,{className:`text-sm font-medium truncate`,children:e.label}),e.description&&(0,R.jsx)(`div`,{className:`text-xs text-gray-400 truncate`,children:e.description})]})]},e.id)})]},e))}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-t border-gray-100 text-xs text-gray-400`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`kbd`,{className:`px-1.5 py-0.5 bg-gray-100 rounded`,children:`↑↓`}),`导航`]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`kbd`,{className:`px-1.5 py-0.5 bg-gray-100 rounded`,children:`↵`}),`执行`]})]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(Zs,{className:`h-3 w-3`}),`K 打开`]})]})]})})})}function dS({title:e,value:t,change:n,icon:r,color:i=`blue`,trend:a}){return(0,R.jsx)(sS.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`relative overflow-hidden rounded-xl bg-white p-6 shadow-lg border border-gray-100`,children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsx)(`p`,{className:`text-sm font-medium text-gray-600`,children:e}),(0,R.jsx)(`p`,{className:`mt-2 text-3xl font-bold text-gray-900`,children:t}),n!==void 0&&(0,R.jsxs)(`div`,{className:q(`mt-2 flex items-center text-sm`,a===`up`?`text-green-600`:`text-red-600`),children:[(0,R.jsx)(`span`,{children:a===`up`?`↑`:`↓`}),(0,R.jsxs)(`span`,{className:`ml-1`,children:[Math.abs(n),`%`]}),(0,R.jsx)(`span`,{className:`ml-1 text-gray-500`,children:`vs 昨天`})]})]}),(0,R.jsx)(`div`,{className:q(`rounded-lg bg-gradient-to-br p-3`,{blue:`from-blue-500 to-blue-600`,green:`from-green-500 to-green-600`,purple:`from-purple-500 to-purple-600`,orange:`from-orange-500 to-orange-600`,red:`from-red-500 to-red-600`}[i]),children:(0,R.jsx)(r,{className:`h-6 w-6 text-white`})})]})})}function fS({children:e,variant:t=`default`,size:n=`md`}){return(0,R.jsx)(`span`,{className:q(`inline-flex items-center rounded-full font-medium`,{default:`bg-gray-100 text-gray-700`,success:`bg-green-100 text-green-700`,warning:`bg-yellow-100 text-yellow-700`,danger:`bg-red-100 text-red-700`,info:`bg-blue-100 text-blue-700`}[t],{sm:`px-2 py-0.5 text-xs`,md:`px-3 py-1 text-sm`}[n]),children:e})}function Y({children:e,variant:t=`primary`,size:n=`md`,loading:r,icon:i,className:a,disabled:o,...s}){return(0,R.jsxs)(`button`,{className:q(`inline-flex items-center justify-center gap-2 rounded-lg font-medium transition-colors`,`focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2`,`disabled:opacity-50 disabled:cursor-not-allowed`,{primary:`bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`,secondary:`bg-gray-100 text-gray-700 hover:bg-gray-200 active:bg-gray-300`,ghost:`bg-transparent text-gray-700 hover:bg-gray-100 active:bg-gray-200`,danger:`bg-red-600 text-white hover:bg-red-700 active:bg-red-800`}[t],{sm:`px-3 py-1.5 text-sm`,md:`px-4 py-2 text-sm`,lg:`px-6 py-3 text-base`}[n],a),disabled:o||r,...s,children:[r&&(0,R.jsxs)(`svg`,{className:`animate-spin h-4 w-4`,viewBox:`0 0 24 24`,children:[(0,R.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`,fill:`none`}),(0,R.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]}),i&&!r&&(0,R.jsx)(i,{className:`h-4 w-4`}),e]})}function X({children:e,className:t,title:n,action:r,...i}){return(0,R.jsxs)(`div`,{className:q(`rounded-xl bg-white p-6 shadow-sm border border-gray-100`,t),...i,children:[(n||r)&&(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[n&&(0,R.jsx)(`h3`,{className:`text-lg font-semibold text-gray-900`,children:n}),r]}),e]})}var pS=class extends L.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught:`,e,t)}render(){return this.state.hasError?(0,R.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gray-50 px-4`,children:(0,R.jsxs)(`div`,{className:`max-w-md w-full bg-white rounded-xl shadow-lg p-8 text-center`,children:[(0,R.jsx)(Xc,{className:`h-16 w-16 text-red-500 mx-auto mb-4`}),(0,R.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900 mb-2`,children:`出错了`}),(0,R.jsx)(`p`,{className:`text-gray-600 mb-6`,children:`页面加载时遇到错误,请刷新页面重试`}),this.state.error&&(0,R.jsxs)(`details`,{className:`text-left mb-6 p-4 bg-gray-50 rounded-lg`,children:[(0,R.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-gray-700 mb-2`,children:`错误详情`}),(0,R.jsx)(`pre`,{className:`text-xs text-red-600 overflow-auto`,children:this.state.error.toString()})]}),(0,R.jsx)(Y,{variant:`primary`,icon:Pc,onClick:()=>window.location.reload(),children:`刷新页面`})]})}):this.props.children}},mS=`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`.split(`.`);function hS(e){return typeof e==`string`?mS.includes(e):!1}var gS=new Set(`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`.split(`.`));function _S(e){return typeof e==`string`?gS.has(e):!1}function vS(e){return typeof e==`string`&&e.startsWith(`data-`)}function yS(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(_S(n)||vS(n))&&(t[n]=e[n]);return t}function bS(e){if(e==null)return null;if((0,L.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return yS(t)}return typeof e==`object`&&!Array.isArray(e)?yS(e):null}function xS(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(_S(n)||vS(n)||hS(n))&&(t[n]=e[n]);return t}function SS(e){return e==null?null:(0,L.isValidElement)(e)?xS(e.props):typeof e==`object`&&!Array.isArray(e)?xS(e):null}var CS=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function wS(){return wS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wS.apply(null,arguments)}function TS(e,t){if(e==null)return{};var n,r,i=ES(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ES(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var DS=(0,L.forwardRef)((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:s,title:c,desc:l}=e,u=TS(e,CS),d=a||{width:r,height:i,x:0,y:0},f=$u(`recharts-surface`,o);return L.createElement(`svg`,wS({},xS(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),L.createElement(`title`,null,c),L.createElement(`desc`,null,l),n)}),OS=[`children`,`className`];function kS(){return kS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kS.apply(null,arguments)}function AS(e,t){if(e==null)return{};var n,r,i=jS(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jS(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var MS=L.forwardRef((e,t)=>{var{children:n,className:r}=e,i=AS(e,OS),a=$u(`recharts-layer`,r);return L.createElement(`g`,kS({className:a},xS(i),{ref:t}),n)}),NS=(0,L.createContext)(null),PS=()=>(0,L.useContext)(NS);function FS(e){return function(){return e}}var IS=Math.cos,LS=Math.sin,RS=Math.sqrt,zS=Math.PI;zS/2;var BS=2*zS,VS=Math.PI,HS=2*VS,US=1e-6,WS=HS-US;function GS(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function KS(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return GS;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var qS=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?GS:KS(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>US)if(!(Math.abs(u*s-c*l)>US)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((VS-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>US&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>US||Math.abs(this._y1-l)>US)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%HS+HS),d>WS?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>US&&this._append`A${n},${n},0,${+(d>=VS)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function JS(){return new qS}JS.prototype=qS.prototype;function YS(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new qS(t)}Array.prototype.slice;function XS(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function ZS(e){this._context=e}ZS.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 QS(e){return new ZS(e)}function $S(e){return e[0]}function eC(e){return e[1]}function tC(e,t){var n=FS(!0),r=null,i=QS,a=null,o=YS(s);e=typeof e==`function`?e:e===void 0?$S:FS(e),t=typeof t==`function`?t:t===void 0?eC:FS(t);function s(s){var c,l=(s=XS(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:FS(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:FS(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:FS(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function nC(e,t,n){var r=null,i=FS(!0),a=null,o=QS,s=null,c=YS(l);e=typeof e==`function`?e:e===void 0?$S:FS(+e),t=typeof t==`function`?t:FS(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?eC:FS(+n);function l(l){var u,d,f,p=(l=XS(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return tC().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:FS(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:FS(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:FS(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:FS(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:FS(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:FS(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:FS(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var rC=class{constructor(e,t){this._context=e,this._x=t}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(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._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function iC(e){return new rC(e,!0)}function aC(e){return new rC(e,!1)}var oC={draw(e,t){let n=RS(t/zS);e.moveTo(n,0),e.arc(0,0,n,0,BS)}},sC={draw(e,t){let n=RS(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},cC=RS(1/3),lC=cC*2,uC={draw(e,t){let n=RS(t/lC),r=n*cC;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},dC={draw(e,t){let n=RS(t),r=-n/2;e.rect(r,r,n,n)}},fC=.8908130915292852,pC=LS(zS/10)/LS(7*zS/10),mC=LS(BS/10)*pC,hC=-IS(BS/10)*pC,gC={draw(e,t){let n=RS(t*fC),r=mC*n,i=hC*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=BS*t/5,o=IS(a),s=LS(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},_C=RS(3),vC={draw(e,t){let n=-RS(t/(_C*3));e.moveTo(0,n*2),e.lineTo(-_C*n,-n),e.lineTo(_C*n,-n),e.closePath()}},yC=-.5,bC=RS(3)/2,xC=1/RS(12),SC=(xC/2+1)*3,CC={draw(e,t){let n=RS(t/SC),r=n/2,i=n*xC,a=r,o=n*xC+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(yC*r-bC*i,bC*r+yC*i),e.lineTo(yC*a-bC*o,bC*a+yC*o),e.lineTo(yC*s-bC*c,bC*s+yC*c),e.lineTo(yC*r+bC*i,yC*i-bC*r),e.lineTo(yC*a+bC*o,yC*o-bC*a),e.lineTo(yC*s+bC*c,yC*c-bC*s),e.closePath()}};function wC(e,t){let n=null,r=YS(i);e=typeof e==`function`?e:FS(e||oC),t=typeof t==`function`?t:FS(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:FS(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:FS(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function TC(){}function EC(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function DC(e){this._context=e}DC.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:EC(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:EC(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OC(e){return new DC(e)}function kC(e){this._context=e}kC.prototype={areaStart:TC,areaEnd:TC,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:EC(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AC(e){return new kC(e)}function jC(e){this._context=e}jC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:EC(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function MC(e){return new jC(e)}function NC(e){this._context=e}NC.prototype={areaStart:TC,areaEnd:TC,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 PC(e){return new NC(e)}function FC(e){return e<0?-1:1}function IC(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(FC(a)+FC(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function LC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function RC(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function zC(e){this._context=e}zC.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:RC(this,this._t0,LC(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,RC(this,LC(this,n=IC(this,e,t)),n);break;default:RC(this,this._t0,n=IC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function BC(e){this._context=new VC(e)}(BC.prototype=Object.create(zC.prototype)).point=function(e,t){zC.prototype.point.call(this,t,e)};function VC(e){this._context=e}VC.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function HC(e){return new zC(e)}function UC(e){return new BC(e)}function WC(e){this._context=e}WC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=GC(e),i=GC(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function GC(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function KC(e){return new WC(e)}function qC(e,t){this._context=e,this._t=t}qC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function JC(e){return new qC(e,.5)}function YC(e){return new qC(e,0)}function XC(e){return new qC(e,1)}function ZC(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function QC(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function $C(e,t){return e[t]}function ew(e){let t=[];return t.key=e,t}function tw(){var e=FS([]),t=QC,n=ZC,r=$C;function i(i){var a=Array.from(e.apply(this,arguments),ew),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=XS(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:FS(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:FS(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?QC:typeof e==`function`?e:FS(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??ZC,i):n},i}function nw(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}ZC(e,t)}}function rw(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}ZC(e,t)}}function iw(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,ZC(e,t)}}var aw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e===`__proto__`}e.isUnsafeProperty=t})),ow=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}e.isDeepKey=t})),sw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}e.toKey=t})),cw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(t).join(`,`);let n=String(e);return n===`0`&&Object.is(Number(e),-0)?`-0`:n}e.toString=t})),lw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=cw(),n=sw();function r(e){if(Array.isArray(e))return e.map(n.toKey);if(typeof e==`symbol`)return[e];e=t.toString(e);let r=[],i=e.length;if(i===0)return r;let a=0,o=``,s=``,c=!1;for(e.charCodeAt(0)===46&&(r.push(``),a++);a<i;){let t=e[a];s?t===`\\`&&a+1<i?(a++,o+=e[a]):t===s?s=``:o+=t:c?t===`"`||t===`'`?s=t:t===`]`?(c=!1,r.push(o),o=``):o+=t:t===`[`?(c=!0,o&&=(r.push(o),``)):t===`.`?o&&=(r.push(o),``):o+=t,a++}return o&&r.push(o),r}e.toPath=r})),uw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=aw(),n=ow(),r=sw(),i=lw();function a(e,s,c){if(e==null)return c;switch(typeof s){case`string`:{if(t.isUnsafeProperty(s))return c;let r=e[s];return r===void 0?n.isDeepKey(s)?a(e,i.toPath(s),c):c:r}case`number`:case`symbol`:{typeof s==`number`&&(s=r.toKey(s));let t=e[s];return t===void 0?c:t}default:{if(Array.isArray(s))return o(e,s,c);if(s=Object.is(s?.valueOf(),-0)?`-0`:String(s),t.isUnsafeProperty(s))return c;let n=e[s];return n===void 0?c:n}}}function o(e,n,r){if(n.length===0)return r;let i=e;for(let e=0;e<n.length;e++){if(i==null||t.isUnsafeProperty(n[e]))return r;i=i[n[e]]}return i===void 0?r:i}e.get=a})),dw=s(((e,t)=>{t.exports=uw().get})),fw=4;function pw(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:fw),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function mw(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+pw(i)+n},``)}var hw=u(dw()),gw=e=>e===0?0:e>0?1:-1,_w=e=>typeof e==`number`&&e!=+e,vw=e=>typeof e==`string`&&e.indexOf(`%`)===e.length-1,Z=e=>(typeof e==`number`||e instanceof Number)&&!_w(e),yw=e=>Z(e)||typeof e==`string`,bw=0,xw=e=>{var t=++bw;return`${e||``}${t}`},Sw=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Z(e)&&typeof e!=`string`)return n;var i;if(vw(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return _w(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},Cw=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function ww(e,t,n){return Z(e)&&Z(t)?pw(e+n*(t-e)):t}function Tw(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):(0,hw.default)(e,t))===n)}var Ew=e=>e==null,Dw=e=>Ew(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function Ow(e){return e!=null}function kw(){}var mte=[`type`,`size`,`sizeType`];function Aw(){return Aw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Aw.apply(null,arguments)}function jw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jw(Object(n),!0).forEach(function(t){hte(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hte(e,t,n){return(t=gte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gte(e){var t=_te(e,`string`);return typeof t==`symbol`?t:t+``}function _te(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function vte(e,t){if(e==null)return{};var n,r,i=yte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Nw={symbolCircle:oC,symbolCross:sC,symbolDiamond:uC,symbolSquare:dC,symbolStar:gC,symbolTriangle:vC,symbolWye:CC},bte=Math.PI/180,xte=e=>Nw[`symbol${Dw(e)}`]||oC,Ste=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*bte;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Cte=(e,t)=>{Nw[`symbol${Dw(e)}`]=t},Pw=e=>{var{type:t=`circle`,size:n=64,sizeType:r=`area`}=e,i=Mw(Mw({},vte(e,mte)),{},{type:t,size:n,sizeType:r}),a=`circle`;typeof t==`string`&&(a=t);var o=()=>{var e=xte(a),t=wC().type(e).size(Ste(n,r,a))();if(t!==null)return t},{className:s,cx:c,cy:l}=i,u=xS(i);return Z(c)&&Z(l)&&Z(n)?L.createElement(`path`,Aw({},u,{className:$u(`recharts-symbols`,s),transform:`translate(${c}, ${l})`,d:o()})):null};Pw.registerSymbol=Cte;var Fw=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,Iw=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,L.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{hS(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},wte=(e,t,n)=>r=>(e(t,n,r),null),Lw=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];hS(i)&&typeof a==`function`&&(r||={},r[i]=wte(a,t,n))}),r};function Rw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Rw(Object(n),!0).forEach(function(t){Ete(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ete(e,t,n){return(t=Dte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dte(e){var t=Ote(e,`string`);return typeof t==`symbol`?t:t+``}function Ote(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function zw(e,t){var n=Tte({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function Bw(){return Bw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bw.apply(null,arguments)}function Vw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Vw(Object(n),!0).forEach(function(t){kte(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kte(e,t,n){return(t=Ate(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ate(e){var t=jte(e,`string`);return typeof t==`symbol`?t:t+``}function jte(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Uw=32,Mte={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function Nte(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function Pte(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Uw/2,a=Uw/6,o=Uw/3,s=t.inactive?r:t.color,c=n??t.type;if(c===`none`)return null;if(c===`plainline`)return L.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:s,strokeDasharray:Nte(t.payload),x1:0,y1:i,x2:Uw,y2:i,className:`recharts-legend-icon`});if(c===`line`)return L.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:s,d:`M0,${i}h${o}
28
- A${a},${a},0,1,1,${2*o},${i}
29
- H${Uw}M${2*o},${i}
30
- A${a},${a},0,1,1,${o},${i}`,className:`recharts-legend-icon`});if(c===`rect`)return L.createElement(`path`,{stroke:`none`,fill:s,d:`M0,${Uw/8}h${Uw}v${Uw*3/4}h${-Uw}z`,className:`recharts-legend-icon`});if(L.isValidElement(t.legendIcon)){var l=Hw({},t);return delete l.legendIcon,L.cloneElement(t.legendIcon,l)}return L.createElement(Pw,{fill:s,cx:i,cy:i,size:Uw,sizeType:`diameter`,type:c})}function Fte(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:s}=e,c={x:0,y:0,width:Uw,height:Uw},l={display:r===`horizontal`?`inline-block`:`block`,marginRight:10},u={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return t.map((t,r)=>{var d=t.formatter||i,f=$u({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var p=typeof s==`object`?Hw({},s):{};p.color=t.inactive?a:p.color||t.color;var m=d?d(t.value,t,r):t.value;return L.createElement(`li`,Bw({className:f,style:l,key:`legend-item-${r}`},Lw(e,t,r)),L.createElement(DS,{width:n,height:n,viewBox:c,style:u,"aria-label":`${t.value} legend icon`},L.createElement(Pte,{data:t,iconType:o,inactiveColor:a})),L.createElement(`span`,{className:`recharts-legend-item-text`,style:p},m))})}var Ite=e=>{var t=zw(e,Mte),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return L.createElement(`ul`,{className:`recharts-default-legend`,style:a},L.createElement(Fte,Bw({},t,{payload:n})))},Lte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}e.uniqBy=t})),Rte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}e.ary=t})),Ww=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e}e.identity=t})),zte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Number.isSafeInteger(e)&&e>=0}e.isLength=t})),Gw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=zte();function n(e){return e!=null&&typeof e!=`function`&&t.isLength(e.length)}e.isArrayLike=n})),Bte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`object`&&!!e}e.isObjectLike=t})),Vte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Gw(),n=Bte();function r(e){return n.isObjectLike(e)&&t.isArrayLike(e)}e.isArrayLikeObject=r})),Hte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=uw();function n(e){return function(n){return t.get(n,e)}}e.property=n})),Kw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}e.isObject=t})),qw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e==null||typeof e!=`object`&&typeof e!=`function`}e.isPrimitive=t})),Jw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}e.isEqualsSameValueZero=t})),Ute=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Kw(),n=qw(),r=Jw();function i(e,t,n){return typeof n==`function`?a(e,t,function e(t,r,i,o,s,c){let l=n(t,r,i,o,s,c);return l===void 0?a(t,r,e,c):!!l},new Map):i(e,t,()=>void 0)}function a(e,n,i,s){if(n===e)return!0;switch(typeof n){case`object`:return o(e,n,i,s);case`function`:return Object.keys(n).length>0?a(e,{...n},i,s):r.isEqualsSameValueZero(e,n);default:return t.isObject(e)?typeof n==`string`?n===``:!0:r.isEqualsSameValueZero(e,n)}}function o(e,t,r,i){if(t==null)return!0;if(Array.isArray(t))return c(e,t,r,i);if(t instanceof Map)return s(e,t,r,i);if(t instanceof Set)return l(e,t,r,i);let a=Object.keys(t);if(e==null||n.isPrimitive(e))return a.length===0;if(a.length===0)return!0;if(i?.has(t))return i.get(t)===e;i?.set(t,e);try{for(let o=0;o<a.length;o++){let s=a[o];if(!n.isPrimitive(e)&&!(s in e)||t[s]===void 0&&e[s]!==void 0||t[s]===null&&e[s]!==null||!r(e[s],t[s],s,e,t,i))return!1}return!0}finally{i?.delete(t)}}function s(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function c(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function l(e,t,n,r){return t.size===0?!0:e instanceof Set?c([...e],[...t],n,r):!1}e.isMatchWith=i,e.isSetMatch=l})),Yw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Ute();function n(e,n){return t.isMatchWith(e,n,()=>void 0)}e.isMatch=n})),Wte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}e.getSymbols=t})),Xw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}e.getTag=t})),Zw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),e.argumentsTag=`[object Arguments]`,e.arrayBufferTag=`[object ArrayBuffer]`,e.arrayTag=`[object Array]`,e.bigInt64ArrayTag=`[object BigInt64Array]`,e.bigUint64ArrayTag=`[object BigUint64Array]`,e.booleanTag=`[object Boolean]`,e.dataViewTag=`[object DataView]`,e.dateTag=`[object Date]`,e.errorTag=`[object Error]`,e.float32ArrayTag=`[object Float32Array]`,e.float64ArrayTag=`[object Float64Array]`,e.functionTag=`[object Function]`,e.int16ArrayTag=`[object Int16Array]`,e.int32ArrayTag=`[object Int32Array]`,e.int8ArrayTag=`[object Int8Array]`,e.mapTag=`[object Map]`,e.numberTag=`[object Number]`,e.objectTag=`[object Object]`,e.regexpTag=`[object RegExp]`,e.setTag=`[object Set]`,e.stringTag=`[object String]`,e.symbolTag=`[object Symbol]`,e.uint16ArrayTag=`[object Uint16Array]`,e.uint32ArrayTag=`[object Uint32Array]`,e.uint8ArrayTag=`[object Uint8Array]`,e.uint8ClampedArrayTag=`[object Uint8ClampedArray]`})),Gte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}e.isTypedArray=t})),Qw=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Wte(),n=Xw(),r=Zw(),i=qw(),a=Gte();function o(e,t){return s(e,void 0,e,new Map,t)}function s(e,t,n,r=new Map,o=void 0){let u=o?.(e,t,n,r);if(u!==void 0)return u;if(i.isPrimitive(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let i=0;i<e.length;i++)t[i]=s(e[i],i,n,r,o);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[i,a]of e)t.set(i,s(a,i,n,r,o));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let i of e)t.add(s(i,void 0,n,r,o));return t}if(typeof Buffer<`u`&&Buffer.isBuffer(e))return e.subarray();if(a.isTypedArray(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let i=0;i<e.length;i++)t[i]=s(e[i],i,n,r,o);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),c(t,e,n,r,o),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),c(t,e,n,r,o),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),c(t,e,n,r,o),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,c(t,e,n,r,o),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),c(t,e,n,r,o),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),c(t,e,n,r,o),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),c(t,e,n,r,o),t}if(typeof e==`object`&&l(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),c(t,e,n,r,o),t}return e}function c(e,n,r=e,i,a){let o=[...Object.keys(n),...t.getSymbols(n)];for(let t=0;t<o.length;t++){let c=o[t],l=Object.getOwnPropertyDescriptor(e,c);(l==null||l.writable)&&(e[c]=s(n[c],c,r,i,a))}}function l(e){switch(n.getTag(e)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=s,e.copyProperties=c})),Kte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Qw();function n(e){return t.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}e.cloneDeep=n})),qte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Yw(),n=Kte();function r(e){return e=n.cloneDeep(e),n=>t.isMatch(n,e)}e.matches=r})),Jte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Qw(),n=Xw(),r=Zw();function i(e,i){return t.cloneDeepWith(e,(a,o,s,c)=>{let l=i?.(a,o,s,c);if(l!==void 0)return l;if(typeof e==`object`){if(n.getTag(e)===r.objectTag&&typeof e.constructor!=`function`){let n={};return c.set(e,n),t.copyProperties(n,e,s,c),n}switch(Object.prototype.toString.call(e)){case r.numberTag:case r.stringTag:case r.booleanTag:{let n=new e.constructor(e?.valueOf());return t.copyProperties(n,e),n}case r.argumentsTag:{let n={};return t.copyProperties(n,e),n.length=e.length,n[Symbol.iterator]=e[Symbol.iterator],n}default:return}}})}e.cloneDeepWith=i})),Yte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Jte();function n(e){return t.cloneDeepWith(e)}e.cloneDeep=n})),$w=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=/^(?:0|[1-9]\d*)$/;function n(e,n=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<n;case`symbol`:return!1;case`string`:return t.test(e)}}e.isIndex=n})),Xte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Xw();function n(e){return typeof e==`object`&&!!e&&t.getTag(e)===`[object Arguments]`}e.isArguments=n})),Zte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=ow(),n=$w(),r=Xte(),i=lw();function a(e,a){let o;if(o=Array.isArray(a)?a:typeof a==`string`&&t.isDeepKey(a)&&e?.[a]==null?i.toPath(a):[a],o.length===0)return!1;let s=e;for(let e=0;e<o.length;e++){let t=o[e];if((s==null||!Object.hasOwn(s,t))&&!((Array.isArray(s)||r.isArguments(s))&&n.isIndex(t)&&t<s.length))return!1;s=s[t]}return!0}e.has=a})),Qte=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Yw(),n=sw(),r=Yte(),i=uw(),a=Zte();function o(e,o){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=n.toKey(e);break}return o=r.cloneDeep(o),function(n){let r=i.get(n,e);return r===void 0?a.has(n,e):o===void 0?r===void 0:t.isMatch(r,o)}}e.matchesProperty=o})),$te=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Ww(),n=Hte(),r=qte(),i=Qte();function a(e){if(e==null)return t.identity;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?i.matchesProperty(e[0],e[1]):r.matches(e);case`string`:case`symbol`:case`number`:return n.property(e)}}e.iteratee=a})),ene=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Lte(),n=Rte(),r=Ww(),i=Vte(),a=$te();function o(e,o=r.identity){return i.isArrayLikeObject(e)?t.uniqBy(Array.from(e),n.ary(a.iteratee(o),1)):[]}e.uniqBy=o})),eT=u(s(((e,t)=>{t.exports=ene().uniqBy}))());function tT(e,t,n){return t===!0?(0,eT.default)(e,n):typeof t==`function`?(0,eT.default)(e,t):e}var tne=s((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),nne=s(((e,t)=>{t.exports=tne()})),rne=s((e=>{var t=p(),n=nne();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ine=s(((e,t)=>{t.exports=rne()})),nT=(0,L.createContext)(null),rT=u(ine()),ane=e=>e,iT=()=>{var e=(0,L.useContext)(nT);return e?e.store.dispatch:ane},aT=()=>{},one=()=>aT,sne=(e,t)=>e===t;function Q(e){var t=(0,L.useContext)(nT),n=(0,L.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:aT,[t,e]);return(0,rT.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:one,t?t.store.getState:aT,t?t.store.getState:aT,n,sne)}function cne(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function lne(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function une(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var oT=e=>Array.isArray(e)?e:[e];function dne(e){let t=Array.isArray(e[0])?e[0]:e;return une(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function fne(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var pne=class{constructor(e){this.value=e}deref(){return this.value}},mne=typeof WeakRef<`u`?WeakRef:pne,hne=0,sT=1;function cT(){return{s:hne,v:void 0,o:null,p:null}}function lT(e,t={}){let n=cT(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=cT(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=cT(),e.set(n,t)):t=r}}let s=t,c;if(t.s===sT)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new mne(c):c}return s.s=sT,s.v=c,c}return o.clearCache=()=>{n=cT(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function gne(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),cne(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=lT,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=oT(c),p=oT(u),m=dne(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=fne(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var $=gne(lT),_ne=Object.assign((e,t=$)=>{lne(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>_ne}),vne=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}e.compareValues=(e,n,r)=>{if(e!==n){let i=t(e),a=t(n);if(i===a&&i===0){if(e<n)return r===`desc`?1:-1;if(e>n)return r===`desc`?-1:1}return r===`desc`?a-i:i-a}return 0}})),uT=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`symbol`||e instanceof Symbol}e.isSymbol=t})),yne=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=uT(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(e,i){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||t.isSymbol(e)?!0:typeof e==`string`&&(r.test(e)||!n.test(e))||i!=null&&Object.hasOwn(i,e)}e.isKey=i})),bne=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=vne(),n=yne(),r=lw();function i(e,i,a,o){if(e==null)return[];a=o?void 0:a,Array.isArray(e)||(e=Object.values(e)),Array.isArray(i)||(i=i==null?[null]:[i]),i.length===0&&(i=[null]),Array.isArray(a)||(a=a==null?[]:[a]),a=a.map(e=>String(e));let s=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},c=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:s(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?s(t,e):typeof t==`object`?t[e]:t,l=i.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||n.isKey(e)?e:{key:e,path:r.toPath(e)}));return e.map(e=>({original:e,criteria:l.map(t=>c(t,e))})).slice().sort((e,n)=>{for(let r=0;r<l.length;r++){let i=t.compareValues(e.criteria[r],n.criteria[r],a[r]);if(i!==0)return i}return 0}).map(e=>e.original)}e.orderBy=i})),xne=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}e.flatten=t})),dT=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=$w(),n=Gw(),r=Kw(),i=Jw();function a(e,a,o){return r.isObject(o)&&(typeof a==`number`&&n.isArrayLike(o)&&t.isIndex(a)&&a<o.length||typeof a==`string`&&a in o)?i.isEqualsSameValueZero(o[a],e):!1}e.isIterateeCall=a})),Sne=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=bne(),n=xne(),r=dT();function i(e,...i){let a=i.length;return a>1&&r.isIterateeCall(e,i[0],i[1])?i=[]:a>2&&r.isIterateeCall(i[0],i[1],i[2])&&(i=[i[0]]),t.orderBy(e,n.flatten(i),[`asc`])}e.sortBy=i})),fT=u(s(((e,t)=>{t.exports=Sne().sortBy}))()),pT=e=>e.legend.settings,Cne=e=>e.legend.size,wne=$([e=>e.legend.payload,pT],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?(0,fT.default)(r,n):r});function Tne(){return Q(wne)}var mT=1;function hT(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=(0,L.useState)({height:0,left:0,top:0,width:0});return[t,(0,L.useCallback)(e=>{if(e!=null){var r=e.getBoundingClientRect(),i={height:r.height,left:r.left,top:r.top,width:r.width};(Math.abs(i.height-t.height)>mT||Math.abs(i.left-t.left)>mT||Math.abs(i.top-t.top)>mT||Math.abs(i.width-t.width)>mT)&&n({height:i.height,left:i.left,top:i.top,width:i.width})}},[t.width,t.height,t.top,t.left,...e])]}function gT(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var _T=typeof Symbol==`function`&&Symbol.observable||`@@observable`,vT=()=>Math.random().toString(36).substring(7).split(``).join(`.`),yT={INIT:`@@redux/INIT${vT()}`,REPLACE:`@@redux/REPLACE${vT()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${vT()}`};function bT(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function xT(e,t,n){if(typeof e!=`function`)throw Error(gT(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(gT(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(gT(1));return n(xT)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(gT(3));return i}function d(e){if(typeof e!=`function`)throw Error(gT(4));if(c)throw Error(gT(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(gT(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!bT(e))throw Error(gT(7));if(e.type===void 0)throw Error(gT(8));if(typeof e.type!=`string`)throw Error(gT(17));if(c)throw Error(gT(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(gT(10));r=e,f({type:yT.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(gT(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[_T](){return this}}}return f({type:yT.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[_T]:m}}function Ene(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:yT.INIT})===void 0)throw Error(gT(12));if(n(void 0,{type:yT.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(gT(13))})}function ST(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{Ene(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(gT(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function CT(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Dne(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(gT(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=CT(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function wT(e){return bT(e)&&`type`in e&&typeof e.type==`string`}var TT=Symbol.for(`immer-nothing`),ET=Symbol.for(`immer-draftable`),DT=Symbol.for(`immer-state`);function OT(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var kT=Object,AT=kT.getPrototypeOf,jT=`constructor`,MT=`prototype`,NT=`configurable`,PT=`enumerable`,FT=`writable`,IT=`value`,LT=e=>!!e&&!!e[DT];function RT(e){return e?VT(e)||qT(e)||!!e[ET]||!!e[jT]?.[ET]||JT(e)||YT(e):!1}var zT=kT[MT][jT].toString(),BT=new WeakMap;function VT(e){if(!e||!XT(e))return!1;let t=AT(e);if(t===null||t===kT[MT])return!0;let n=kT.hasOwnProperty.call(t,jT)&&t[jT];if(n===Object)return!0;if(!ZT(n))return!1;let r=BT.get(n);return r===void 0&&(r=Function.toString.call(n),BT.set(n,r)),r===zT}function HT(e,t,n=!0){UT(e)===0?(n?Reflect.ownKeys(e):kT.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function UT(e){let t=e[DT];return t?t.type_:qT(e)?1:JT(e)?2:YT(e)?3:0}var WT=(e,t,n=UT(e))=>n===2?e.has(t):kT[MT].hasOwnProperty.call(e,t),GT=(e,t,n=UT(e))=>n===2?e.get(t):e[t],KT=(e,t,n,r=UT(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function One(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var qT=Array.isArray,JT=e=>e instanceof Map,YT=e=>e instanceof Set,XT=e=>typeof e==`object`,ZT=e=>typeof e==`function`,QT=e=>typeof e==`boolean`;function $T(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var eE=e=>e.copy_||e.base_,tE=e=>e.modified_?e.copy_:e.base_;function nE(e,t){if(JT(e))return new Map(e);if(YT(e))return new Set(e);if(qT(e))return Array[MT].slice.call(e);let n=VT(e);if(t===!0||t===`class_only`&&!n){let t=kT.getOwnPropertyDescriptors(e);delete t[DT];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[FT]===!1&&(a[FT]=!0,a[NT]=!0),(a.get||a.set)&&(t[i]={[NT]:!0,[FT]:!0,[PT]:a[PT],[IT]:e[i]})}return kT.create(AT(e),t)}else{let t=AT(e);if(t!==null&&n)return{...e};let r=kT.create(t);return kT.assign(r,e)}}function rE(e,t=!1){return aE(e)||LT(e)||!RT(e)?e:(UT(e)>1&&kT.defineProperties(e,{set:iE,add:iE,clear:iE,delete:iE}),kT.freeze(e),t&&HT(e,(e,t)=>{rE(t,!0)},!1),e)}function kne(){OT(2)}var iE={[IT]:kne};function aE(e){return e===null||!XT(e)?!0:kT.isFrozen(e)}var oE=`MapSet`,sE=`Patches`,cE=`ArrayMethods`,lE={};function uE(e){let t=lE[e];return t||OT(0,e),t}var dE=e=>!!lE[e],fE,pE=()=>fE,mE=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:dE(oE)?uE(oE):void 0,arrayMethodsPlugin_:dE(cE)?uE(cE):void 0});function hE(e,t){t&&(e.patchPlugin_=uE(sE),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function gE(e){_E(e),e.drafts_.forEach(yE),e.drafts_=null}function _E(e){e===fE&&(fE=e.parent_)}var vE=e=>fE=mE(fE,e);function yE(e){let t=e[DT];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bE(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[DT].modified_&&(gE(t),OT(4)),RT(e)&&(e=xE(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[DT].base_,e,t)}else e=xE(t,n);return SE(t,e,!0),gE(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===TT?void 0:e}function xE(e,t){if(aE(t))return t;let n=t[DT];if(!n)return OE(t,e.handledSet_,e);if(!wE(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);DE(n,e)}return n.copy_}function SE(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&rE(t,n)}function CE(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var wE=(e,t)=>e.scope_===t,TE=[];function EE(e,t,n,r){let i=eE(e),a=e.type_;if(r!==void 0&&GT(i,r,a)===t){KT(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;HT(i,(e,n)=>{if(LT(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??TE;for(let e of o)KT(i,e,n,a)}function Ane(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!wE(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=tE(i);EE(e,i.draft_??i,a,n),DE(i,r)})}function DE(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}CE(e)}}function jne(e,t,n){let{scope_:r}=e;if(LT(n)){let i=n[DT];wE(i,r)&&i.callbacks_.push(function(){PE(e),EE(e,n,tE(i),t)})}else RT(n)&&e.callbacks_.push(function(){let i=eE(e);e.type_===3?i.has(n)&&OE(n,r.handledSet_,r):GT(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&OE(GT(e.copy_,t,e.type_),r.handledSet_,r)})}function OE(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||LT(e)||t.has(e)||!RT(e)||aE(e)?e:(t.add(e),HT(e,(r,i)=>{if(LT(i)){let t=i[DT];wE(t,n)&&(KT(e,r,tE(t),e.type_),CE(t))}else RT(i)&&OE(i,t,n)}),e)}function Mne(e,t){let n=qT(e),r={type_:+!!n,scope_:t?t.scope_:pE(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=kE;n&&(i=[r],a=AE);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var kE={get(e,t){if(t===DT)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=eE(e);if(!WT(i,t,e.type_))return Nne(e,i,t);let a=i[t];if(e.finalized_||!RT(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&$T(t))return a;if(a===jE(e.base_,t)){PE(e);let n=e.type_===1?+t:t,r=IE(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in eE(e)},ownKeys(e){return Reflect.ownKeys(eE(e))},set(e,t,n){let r=ME(eE(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=jE(eE(e),t),i=r?.[DT];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(One(n,r)&&(n!==void 0||WT(e.base_,t,e.type_)))return!0;PE(e),NE(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),jne(e,t,n),!0)},deleteProperty(e,t){return PE(e),jE(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),NE(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=eE(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[FT]:!0,[NT]:e.type_!==1||t!==`length`,[PT]:r[PT],[IT]:n[t]}},defineProperty(){OT(11)},getPrototypeOf(e){return AT(e.base_)},setPrototypeOf(){OT(12)}},AE={};for(let e in kE){let t=kE[e];AE[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}AE.deleteProperty=function(e,t){return AE.set.call(this,e,t,void 0)},AE.set=function(e,t,n){return kE.set.call(this,e[0],t,n,e[0])};function jE(e,t){let n=e[DT];return(n?eE(n):e)[t]}function Nne(e,t,n){let r=ME(t,n);return r?IT in r?r[IT]:r.get?.call(e.draft_):void 0}function ME(e,t){if(!(t in e))return;let n=AT(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=AT(n)}}function NE(e){e.modified_||(e.modified_=!0,e.parent_&&NE(e.parent_))}function PE(e){e.copy_||=(e.assigned_=new Map,nE(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var FE=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(ZT(e)&&!ZT(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}ZT(t)||OT(6),n!==void 0&&!ZT(n)&&OT(7);let r;if(RT(e)){let i=vE(this),a=IE(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?gE(i):_E(i)}return hE(i,n),bE(r,i)}else if(!e||!XT(e)){if(r=t(e),r===void 0&&(r=e),r===TT&&(r=void 0),this.autoFreeze_&&rE(r,!0),n){let t=[],i=[];uE(sE).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else OT(1,e)},this.produceWithPatches=(e,t)=>{if(ZT(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},QT(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),QT(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),QT(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){RT(e)||OT(8),LT(e)&&(e=LE(e));let t=vE(this),n=IE(t,e,void 0);return n[DT].isManual_=!0,_E(t),n}finishDraft(e,t){let n=e&&e[DT];(!n||!n.isManual_)&&OT(9);let{scope_:r}=n;return hE(r,t),bE(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=uE(sE).applyPatches_;return LT(e)?r(e,t):this.produce(e,e=>r(e,t))}};function IE(e,t,n,r){let[i,a]=JT(t)?uE(oE).proxyMap_(t,n):YT(t)?uE(oE).proxySet_(t,n):Mne(t,n);return(n?.scope_??pE()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Ane(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function LE(e){return LT(e)||OT(10,e),RE(e)}function RE(e){if(!RT(e)||aE(e))return e;let t=e[DT],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=nE(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=nE(e,!0);return HT(n,(e,t)=>{KT(n,e,RE(t))},r),t&&(t.finalized_=!1),n}var zE=new FE().produce;function BE(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var VE=BE(),HE=BE,UE=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?CT:CT.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function WE(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(qD(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>wT(t)&&t.type===e,n}var GE=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function KE(e){return RT(e)?zE(e,()=>{}):e}function qE(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function JE(e){return typeof e==`boolean`}var YE=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new GE;return t&&(JE(t)?a.push(VE):a.push(HE(t.extraArgument))),a},XE=`RTK_autoBatch`,ZE=()=>e=>({payload:e,meta:{[XE]:!0}}),QE=e=>t=>{setTimeout(t,e)},$E=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?window.requestAnimationFrame:QE(10):e.type===`callback`?e.queueNotification:QE(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[XE],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},eD=e=>function(t){let{autoBatch:n=!0}=t??{},r=new GE(e);return n&&r.push($E(typeof n==`object`?n:void 0)),r};function tD(e){let t=YE(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(bT(n))c=ST(n);else throw Error(qD(1));let l;l=typeof r==`function`?r(t):t();let u=CT;i&&(u=UE({trace:!1,...typeof i==`object`&&i}));let d=eD(Dne(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return xT(c,o,p)}function nD(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(qD(28));if(r in t)throw Error(qD(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function rD(e){return typeof e==`function`}function iD(e,t){let[n,r,i]=nD(t),a;if(rD(e))a=()=>KE(e());else{let t=KE(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n)if(LT(e)){let r=n(e,t);return r===void 0?e:r}else if(RT(e))return zE(e,e=>n(e,t));else{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}return e},e)}return o.getInitialState=a,o}var aD=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,oD=(e=21)=>{let t=``,n=e;for(;n--;)t+=aD[Math.random()*64|0];return t},sD=Symbol.for(`rtk-slice-createasyncthunk`);function cD(e,t){return`${e}/${t}`}function lD({creators:e}={}){let t=e?.asyncThunk?.[sD];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(qD(11));let i=(typeof e.reducers==`function`?e.reducers(fD()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(qD(12));if(n in o.sliceCaseReducersByType)throw Error(qD(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:cD(n,r),createNotation:typeof e.reducers==`function`};mD(a)?gD(o,a,s,t):pD(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?nD(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return iD(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=qE(d,r,m)),i}function i(t=l){return qE(qE(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=uD(a,t,()=>qE(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function uD(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var dD=lD();function fD(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function pD({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!hD(r))throw Error(qD(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?WE(e,o):WE(e))}function mD(e){return e._reducerDefinitionType===`asyncThunk`}function hD(e){return e._reducerDefinitionType===`reducerWithPrepare`}function gD({type:e,reducerName:t},n,r,i){if(!i)throw Error(qD(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||_D,pending:s||_D,rejected:c||_D,settled:l||_D})}function _D(){}var vD=`task`,yD=`listener`,bD=`completed`,xD=`cancelled`,SD=`task-${xD}`,CD=`task-${bD}`,wD=`${yD}-${xD}`,TD=`${yD}-${bD}`,ED=class{constructor(e){this.code=e,this.message=`${vD} ${xD} (reason: ${e})`}name=`TaskAbortError`;message},DD=(e,t)=>{if(typeof e!=`function`)throw TypeError(qD(32))},OD=()=>{},kD=(e,t=OD)=>(e.catch(t),e),AD=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),jD=e=>{if(e.aborted)throw new ED(e.reason)};function MD(e,t){let n=OD;return new Promise((r,i)=>{let a=()=>i(new ED(e.reason));if(e.aborted){a();return}n=AD(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=OD})}var Pne=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof ED?`cancelled`:`rejected`,error:e}}finally{t?.()}},ND=e=>t=>kD(MD(e,t).then(t=>(jD(e),t))),PD=e=>{let t=ND(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:FD}=Object,ID={},LD=`listenerMiddleware`,Fne=(e,t)=>{let n=t=>AD(e,()=>t.abort(e.reason));return(r,i)=>{DD(r,`taskExecutor`);let a=new AbortController;n(a);let o=Pne(async()=>{jD(e),jD(a.signal);let t=await r({pause:ND(a.signal),delay:PD(a.signal),signal:a.signal});return jD(a.signal),t},()=>a.abort(CD));return i?.autoJoin&&t.push(o.catch(OD)),{result:ND(e)(o),cancel(){a.abort(SD)}}}},Ine=(e,t)=>{let n=async(n,r)=>{jD(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await MD(t,Promise.race(a));return jD(t),e}finally{i()}};return(e,t)=>kD(n(e,t))},RD=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=WE(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(qD(21));return DD(a,`options.listener`),{predicate:i,type:t,effect:a}},zD=FD(e=>{let{type:t,predicate:n,effect:r}=RD(e);return{id:oD(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(qD(22))}}},{withTypes:()=>zD}),BD=(e,t)=>{let{type:n,effect:r,predicate:i}=RD(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},VD=e=>{e.pending.forEach(e=>{e.abort(wD)})},Lne=(e,t)=>()=>{for(let e of t.keys())VD(e);e.clear()},HD=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},UD=FD(WE(`${LD}/add`),{withTypes:()=>UD}),Rne=WE(`${LD}/removeAll`),WD=FD(WE(`${LD}/remove`),{withTypes:()=>WD}),GD=(...e)=>{console.error(`${LD}/error`,...e)},KD=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=GD}=e;DD(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&VD(e)}),c=e=>s(BD(t,e)??zD(e));FD(c,{withTypes:()=>c});let l=e=>{let n=BD(t,e);return n&&(n.unsubscribe(),e.cancelActive&&VD(n)),!!n};FD(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=Ine(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,FD({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:PD(u.signal),pause:ND(u.signal),extra:a,signal:u.signal,fork:Fne(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(wD),n.delete(e))})},cancel:()=>{u.abort(wD),e.pending.delete(u)},throwIfCancelled:()=>{jD(u.signal)}})))}catch(e){e instanceof ED||HD(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(TD),i(e),e.pending.delete(u)}},d=Lne(t,n);return{middleware:e=>n=>r=>{if(!wT(r))return n(r);if(UD.match(r))return c(r.payload);if(Rne.match(r)){d();return}if(WD.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===ID)throw Error(qD(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,HD(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=ID}return s},startListening:c,stopListening:l,clearListeners:d}};function qD(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var JD=dD({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),{setMargin:YD,setLayout:XD,setChartSize:ZD,setScale:QD}=JD.actions,$D=JD.reducer;function eO(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function tO(e){return Number.isFinite(e)}function nO(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function rO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function iO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?rO(Object(n),!0).forEach(function(t){aO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function aO(e,t,n){return(t=oO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oO(e){var t=sO(e,`string`);return typeof t==`symbol`?t:t+``}function sO(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function cO(e,t,n){return Ew(e)||Ew(t)?n:yw(t)?(0,hw.default)(e,t,n):typeof t==`function`?t(e):n}var lO=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:s}=t;if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&Z(e[a]))return iO(iO({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&Z(e[o]))return iO(iO({},e),{},{[o]:e[o]+(i||0)})}return e},uO=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,dO=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},fO=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:s,isCategorical:c,categoricalDomain:l,tickCount:u,ticks:d,niceTicks:f,axisType:p}=e;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?gw(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return tO(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(Ow):c&&l?l.map((e,t)=>{var n=o.map(e);return tO(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(Ow):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return tO(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(Ow):o.domain().map((e,t)=>{var n=o.map(e);return tO(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(Ow)},pO=(e,t)=>{if(!t||t.length!==2||!Z(t[0])||!Z(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Z(e[0])||e[0]<n)&&(i[0]=n),(!Z(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},mO={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0,o=0;o<t;++o){var s=e[o]?.[r];if(s!=null){var c=s[1],l=s[0],u=_w(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:nw,none:ZC,silhouette:rw,wiggle:iw,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0;a<t;++a){var o=e[a]?.[r];if(o!=null){var s=_w(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},hO=(e,t,n)=>{var r=mO[n]??ZC,i=tw().keys(t).value((e,t)=>Number(cO(e,t,0))).order(QC).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=cO(e[i],t[r],0);Array.isArray(a)&&a.length===2&&Z(a[0])&&Z(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function gO(e){return e==null?void 0:String(e)}function _O(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ew(i[t.dataKey])){var s=Tw(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=cO(i,Ew(o)?t.dataKey:o),l=t.scale.map(c);return Z(l)?l:null}var vO=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=cO(a,t.dataKey,t.scale.domain()[o]);if(Ew(s))return null;var c=t.scale.map(s);return Z(c)?c-i/2+r:null},yO=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},bO=e=>{var t=e.flat(2).filter(Z);return[Math.min(...t),Math.max(...t)]},xO=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],SO=(e,t,n)=>{if(e!=null)return xO(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,s=o.reduce((e,r)=>{var i=bO(eO(r,t,n));return!tO(i[0])||!tO(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},CO=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,wO=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,TO=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,fT.default)(t,e=>e.coordinate),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c?.coordinate||0)-(l?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function EO(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return iO(iO({},t),{},{dataKey:n,payload:r,value:i,name:a})}function DO(e,t){if(e)return String(e);if(typeof t==`string`)return t}var OO=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},kO=(e,t)=>t===`centric`?e.angle:e.radius,AO=e=>e.layout.width,jO=e=>e.layout.height,MO=e=>e.layout.scale,NO=e=>e.layout.margin,PO=$(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),FO=$(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),IO=`data-recharts-item-index`,LO=`data-recharts-item-id`;function RO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?RO(Object(n),!0).forEach(function(t){BO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function BO(e,t,n){return(t=VO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VO(e){var t=HO(e,`string`);return typeof t==`symbol`?t:t+``}function HO(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var UO=e=>e.brush.height;function WO(e){return FO(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function GO(e){return FO(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function KO(e){return PO(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+t.height:e,0)}function qO(e){return PO(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+t.height:e,0)}var JO=$([AO,jO,NO,UO,WO,GO,KO,qO,pT,Cne],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=zO(zO({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=lO(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return zO(zO({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),YO=$(JO,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),XO=$(AO,jO,(e,t)=>({x:0,y:0,width:e,height:t})),ZO=(0,L.createContext)(null),QO=()=>(0,L.useContext)(ZO)!=null,$O=e=>e.brush,ek=$([$O,JO,NO],(e,t,n)=>({height:e.height,x:Z(e.x)?e.x:t.left,y:Z(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Z(e.width)?e.width:t.width})),tk=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}e.debounce=t})),nk=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=tk();function n(e,n=0,r={}){typeof r!=`object`&&(r={});let{leading:i=!1,trailing:a=!0,maxWait:o}=r,s=[,,];i&&(s[0]=`leading`),a&&(s[1]=`trailing`);let c,l=null,u=t.debounce(function(...t){c=e.apply(this,t),l=null},n,{edges:s}),d=function(...t){return o!=null&&(l===null&&(l=Date.now()),Date.now()-l>=o)?(c=e.apply(this,t),l=Date.now(),u.cancel(),u.schedule(),c):(u.apply(this,t),c)};return d.cancel=u.cancel,d.flush=()=>(u.flush(),c),d}e.debounce=n})),rk=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=nk();function n(e,n=0,r={}){let{leading:i=!0,trailing:a=!0}=r;return t.debounce(e,n,{leading:i,maxWait:n,trailing:a})}e.throttle=n})),ik=s(((e,t)=>{t.exports=rk().throttle})),ak=!0,ok=function(e,t){var n=[...arguments].slice(2);if(ak&&typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}},sk={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},ck=(e,t,n)=>{var{width:r=sk.width,height:i=sk.height,aspect:a,maxHeight:o}=n,s=vw(r)?e:Number(r),c=vw(i)?t:Number(i);return a&&a>0&&(s?c=s/a:c&&(s=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:s,calculatedHeight:c}},lk={width:0,height:0,overflow:`visible`},uk={width:0,overflowX:`visible`},dk={height:0,overflowY:`visible`},fk={},pk=e=>{var{width:t,height:n}=e,r=vw(t),i=vw(n);return r&&i?lk:r?uk:i?dk:fk};function mk(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=sk.width,a=sk.height):i===void 0?i=r&&r>0?void 0:sk.width:a===void 0&&(a=r&&r>0?void 0:sk.height),{width:i,height:a}}var hk=u(ik());function gk(){return gk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gk.apply(null,arguments)}function _k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_k(Object(n),!0).forEach(function(t){yk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_k(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yk(e,t,n){return(t=bk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bk(e){var t=xk(e,`string`);return typeof t==`symbol`?t:t+``}function xk(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Sk=(0,L.createContext)(sk.initialDimension);function Ck(e){return nO(e.width)&&nO(e.height)}function wk(e){var{children:t,width:n,height:r}=e,i=(0,L.useMemo)(()=>({width:n,height:r}),[n,r]);return Ck(i)?L.createElement(Sk.Provider,{value:i},t):null}var Tk=()=>(0,L.useContext)(Sk),Ek=(0,L.forwardRef)((e,t)=>{var{aspect:n,initialDimension:r=sk.initialDimension,width:i,height:a,minWidth:o=sk.minWidth,minHeight:s,maxHeight:c,children:l,debounce:u=sk.debounce,id:d,className:f,onResize:p,style:m={}}=e,h=(0,L.useRef)(null),g=(0,L.useRef)();g.current=p,(0,L.useImperativeHandle)(t,()=>h.current);var[_,v]=(0,L.useState)({containerWidth:r.width,containerHeight:r.height}),y=(0,L.useCallback)((e,t)=>{v(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,L.useEffect)(()=>{if(h.current==null||typeof ResizeObserver>`u`)return kw;var e=e=>{var t,n=e[0];if(n!=null){var{width:r,height:i}=n.contentRect;y(r,i),(t=g.current)==null||t.call(g,r,i)}};u>0&&(e=(0,hk.default)(e,u,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),{width:n,height:r}=h.current.getBoundingClientRect();return y(n,r),t.observe(h.current),()=>{t.disconnect()}},[y,u]);var{containerWidth:b,containerHeight:x}=_;ok(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var{calculatedWidth:S,calculatedHeight:C}=ck(b,x,{width:i,height:a,aspect:n,maxHeight:c});return ok(S!=null&&S>0||C!=null&&C>0,`The width(%s) and height(%s) of chart should be greater than 0,
31
- please check the style of container, or the props width(%s) and height(%s),
32
- or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
33
- height and width.`,S,C,i,a,o,s,n),L.createElement(`div`,{id:d?`${d}`:void 0,className:$u(`recharts-responsive-container`,f),style:vk(vk({},m),{},{width:i,height:a,minWidth:o,minHeight:s,maxHeight:c}),ref:h},L.createElement(`div`,{style:pk({width:i,height:a})},L.createElement(wk,{width:S,height:C},l)))}),Dk=(0,L.forwardRef)((e,t)=>{var n=Tk();if(nO(n.width)&&nO(n.height))return e.children;var{width:r,height:i}=mk({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=ck(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Z(a)&&Z(o)?L.createElement(wk,{width:a,height:o},e.children):L.createElement(Ek,gk({},e,{width:r,height:i,ref:t}))});function Ok(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var kk=()=>{var e=QO(),t=Q(YO),n=Q(ek),r=Q($O)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},Ak={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},jk=()=>Q(JO)??Ak,Mk=()=>Q(AO),Nk=()=>Q(jO),Pk=()=>Q(e=>e.layout.margin),Fk=e=>e.layout.layoutType,Ik=()=>Q(Fk),Lk=()=>{var e=Ik();if(e===`horizontal`||e===`vertical`)return e},Rk=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},zk=()=>Ik()!==void 0,Bk=e=>{var t=iT(),n=QO(),{width:r,height:i}=e,a=Tk(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,L.useEffect)(()=>{!n&&nO(o)&&nO(s)&&t(ZD({width:o,height:s}))},[t,n,o,s]),null},Vk=Symbol.for(`immer-nothing`),Hk=Symbol.for(`immer-draftable`),Uk=Symbol.for(`immer-state`);function Wk(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Gk=Object.getPrototypeOf;function Kk(e){return!!e&&!!e[Uk]}function qk(e){return e?Xk(e)||Array.isArray(e)||!!e[Hk]||!!e.constructor?.[Hk]||nA(e)||rA(e):!1}var Jk=Object.prototype.constructor.toString(),Yk=new WeakMap;function Xk(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;if(n===Object)return!0;if(typeof n!=`function`)return!1;let r=Yk.get(n);return r===void 0&&(r=Function.toString.call(n),Yk.set(n,r)),r===Jk}function Zk(e,t,n=!0){Qk(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Qk(e){let t=e[Uk];return t?t.type_:Array.isArray(e)?1:nA(e)?2:rA(e)?3:0}function $k(e,t){return Qk(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function eA(e,t,n){let r=Qk(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function tA(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function nA(e){return e instanceof Map}function rA(e){return e instanceof Set}function iA(e){return e.copy_||e.base_}function aA(e,t){if(nA(e))return new Map(e);if(rA(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=Xk(e);if(t===!0||t===`class_only`&&!n){let t=Object.getOwnPropertyDescriptors(e);delete t[Uk];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(Gk(e),t)}else{let t=Gk(e);return t!==null&&n?{...e}:Object.assign(Object.create(t),e)}}function oA(e,t=!1){return lA(e)||Kk(e)||!qk(e)?e:(Qk(e)>1&&Object.defineProperties(e,{set:cA,add:cA,clear:cA,delete:cA}),Object.freeze(e),t&&Object.values(e).forEach(e=>oA(e,!0)),e)}function sA(){Wk(2)}var cA={value:sA};function lA(e){return typeof e!=`object`||!e?!0:Object.isFrozen(e)}var uA={};function dA(e){let t=uA[e];return t||Wk(0,e),t}var fA;function pA(){return fA}function zne(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function mA(e,t){t&&(dA(`Patches`),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function hA(e){gA(e),e.drafts_.forEach(Bne),e.drafts_=null}function gA(e){e===fA&&(fA=e.parent_)}function _A(e){return fA=zne(fA,e)}function Bne(e){let t=e[Uk];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function vA(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[Uk].modified_&&(hA(t),Wk(4)),qk(e)&&(e=yA(t,e),t.parent_||xA(t,e)),t.patches_&&dA(`Patches`).generateReplacementPatches_(n[Uk].base_,e,t.patches_,t.inversePatches_)):e=yA(t,n,[]),hA(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Vk?void 0:e}function yA(e,t,n){if(lA(t))return t;let r=e.immer_.shouldUseStrictIteration(),i=t[Uk];if(!i)return Zk(t,(r,a)=>bA(e,i,t,r,a,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return xA(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let t=i.copy_,a=t,o=!1;i.type_===3&&(a=new Set(t),t.clear(),o=!0),Zk(a,(r,a)=>bA(e,i,t,r,a,n,o),r),xA(e,t,!1),n&&e.patches_&&dA(`Patches`).generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function bA(e,t,n,r,i,a,o){if(i==null||typeof i!=`object`&&!o)return;let s=lA(i);if(!(s&&!o)){if(Kk(i)){let o=yA(e,i,a&&t&&t.type_!==3&&!$k(t.assigned_,r)?a.concat(r):void 0);if(eA(n,r,o),Kk(o))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(qk(i)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&s)return;yA(e,i),(!t||!t.scope_.parent_)&&typeof r!=`symbol`&&(nA(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&xA(e,i)}}}function xA(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&oA(t,n)}function Vne(e,t){let n=Array.isArray(e),r={type_:+!!n,scope_:t?t.scope_:pA(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,a=SA;n&&(i=[r],a=CA);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}var SA={get(e,t){if(t===Uk)return e;let n=iA(e);if(!$k(n,t))return Hne(e,n,t);let r=n[t];return e.finalized_||!qk(r)?r:r===wA(e.base_,t)?(DA(e),e.copy_[t]=OA(r,e)):r},has(e,t){return t in iA(e)},ownKeys(e){return Reflect.ownKeys(iA(e))},set(e,t,n){let r=TA(iA(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=wA(iA(e),t),i=r?.[Uk];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(tA(n,r)&&(n!==void 0||$k(e.base_,t)))return!0;DA(e),EA(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_[t]=!0,!0)},deleteProperty(e,t){return wA(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,DA(e),EA(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=iA(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!==`length`,enumerable:r.enumerable,value:n[t]}},defineProperty(){Wk(11)},getPrototypeOf(e){return Gk(e.base_)},setPrototypeOf(){Wk(12)}},CA={};Zk(SA,(e,t)=>{CA[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),CA.deleteProperty=function(e,t){return CA.set.call(this,e,t,void 0)},CA.set=function(e,t,n){return SA.set.call(this,e[0],t,n,e[0])};function wA(e,t){let n=e[Uk];return(n?iA(n):e)[t]}function Hne(e,t,n){let r=TA(t,n);return r?`value`in r?r.value:r.get?.call(e.draft_):void 0}function TA(e,t){if(!(t in e))return;let n=Gk(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Gk(n)}}function EA(e){e.modified_||(e.modified_=!0,e.parent_&&EA(e.parent_))}function DA(e){e.copy_||=aA(e.base_,e.scope_.immer_.useStrictShallowCopy_)}var Une=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if(typeof e==`function`&&typeof t!=`function`){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}typeof t!=`function`&&Wk(6),n!==void 0&&typeof n!=`function`&&Wk(7);let r;if(qk(e)){let i=_A(this),a=OA(e,void 0),o=!0;try{r=t(a),o=!1}finally{o?hA(i):gA(i)}return mA(i,n),vA(r,i)}else if(!e||typeof e!=`object`){if(r=t(e),r===void 0&&(r=e),r===Vk&&(r=void 0),this.autoFreeze_&&oA(r,!0),n){let t=[],i=[];dA(`Patches`).generateReplacementPatches_(e,r,t,i),n(t,i)}return r}else Wk(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e==`function`)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},typeof e?.autoFreeze==`boolean`&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy==`boolean`&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration==`boolean`&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){qk(e)||Wk(8),Kk(e)&&(e=Wne(e));let t=_A(this),n=OA(e,void 0);return n[Uk].isManual_=!0,gA(t),n}finishDraft(e,t){let n=e&&e[Uk];(!n||!n.isManual_)&&Wk(9);let{scope_:r}=n;return mA(r,t),vA(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=dA(`Patches`).applyPatches_;return Kk(e)?r(e,t):this.produce(e,e=>r(e,t))}};function OA(e,t){let n=nA(e)?dA(`MapSet`).proxyMap_(e,t):rA(e)?dA(`MapSet`).proxySet_(e,t):Vne(e,t);return(t?t.scope_:pA()).drafts_.push(n),n}function Wne(e){return Kk(e)||Wk(10,e),kA(e)}function kA(e){if(!qk(e)||lA(e))return e;let t=e[Uk],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=aA(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=aA(e,!0);return Zk(n,(e,t)=>{eA(n,e,kA(t))},r),t&&(t.finalized_=!1),n}new Une().produce;function AA(e){return e}var jA=dD({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`middle`,itemSorter:`value`},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(AA(t.payload))},prepare:ZE()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=LE(e).payload.indexOf(AA(n));i>-1&&(e.payload[i]=AA(r))},prepare:ZE()},removeLegendPayload:{reducer(e,t){var n=LE(e).payload.indexOf(AA(t.payload));n>-1&&e.payload.splice(n,1)},prepare:ZE()}}}),{setLegendSize:MA,setLegendSettings:Gne,addLegendPayload:NA,replaceLegendPayload:PA,removeLegendPayload:FA}=jA.actions,Kne=jA.reducer,qne=s((e=>{var t=p();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));s(((e,t)=>{t.exports=qne()}))();function Jne(e){e()}function Yne(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Jne(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var IA={notify(){},get:()=>[]};function Xne(e,t){let n,r=IA,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=Yne())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=IA)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var Zne=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Qne=typeof navigator<`u`&&navigator.product===`ReactNative`,$ne=Zne||Qne?L.useLayoutEffect:L.useEffect;function LA(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function ere(e,t){if(LA(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!LA(e[n[r]],t[n[r]]))return!1;return!0}var tre=Symbol.for(`react-redux-context`),nre=typeof globalThis<`u`?globalThis:{};function rre(){if(!L.createContext)return{};let e=nre[tre]??=new Map,t=e.get(L.createContext);return t||(t=L.createContext(null),e.set(L.createContext,t)),t}var ire=rre();function are(e){let{children:t,context:n,serverState:r,store:i}=e,a=L.useMemo(()=>({store:i,subscription:Xne(i),getServerState:r?()=>r:void 0}),[i,r]),o=L.useMemo(()=>i.getState(),[i]);$ne(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||ire;return L.createElement(s.Provider,{value:a},t)}var ore=are,sre=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function cre(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function RA(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(sre.has(n)){if(e[n]==null&&t[n]==null)continue;if(!ere(e[n],t[n]))return!1}else if(!cre(e[n],t[n]))return!1;return!0}var lre=[`contextPayload`];function zA(){return zA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zA.apply(null,arguments)}function BA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function VA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?BA(Object(n),!0).forEach(function(t){ure(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ure(e,t,n){return(t=dre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dre(e){var t=fre(e,`string`);return typeof t==`symbol`?t:t+``}function fre(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function pre(e,t){if(e==null)return{};var n,r,i=mre(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mre(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function hre(e){return e.value}function gre(e){var{contextPayload:t}=e,n=pre(e,lre),r=tT(t,e.payloadUniqBy,hre),i=VA(VA({},n),{},{payload:r});return L.isValidElement(e.content)?L.cloneElement(e.content,i):typeof e.content==`function`?L.createElement(e.content,i):L.createElement(Ite,i)}function _re(e,t,n,r,i,a){var{layout:o,align:s,verticalAlign:c}=t,l,u;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l=s===`center`&&o===`vertical`?{left:((r||0)-a.width)/2}:s===`right`?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(u=c===`middle`?{top:((i||0)-a.height)/2}:c===`bottom`?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),VA(VA({},l),u)}function vre(e){var t=iT();return(0,L.useEffect)(()=>{t(Gne(e))},[t,e]),null}function yre(e){var t=iT();return(0,L.useEffect)(()=>(t(MA(e)),()=>{t(MA({width:0,height:0}))}),[t,e]),null}function HA(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var UA={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,layout:`horizontal`,verticalAlign:`bottom`};function WA(e){var t=zw(e,UA),n=Tne(),r=PS(),i=Pk(),{width:a,height:o,wrapperStyle:s,portal:c}=t,[l,u]=hT([n]),d=Mk(),f=Nk();if(d==null||f==null)return null;var p=d-(i?.left||0)-(i?.right||0),m=HA(t.layout,o,a,p),h=c?s:VA(VA({position:`absolute`,width:m?.width||a||`auto`,height:m?.height||o||`auto`},_re(s,t,i,d,f,l)),s),g=c??r;return g==null||n==null?null:(0,rl.createPortal)(L.createElement(`div`,{className:`recharts-legend-wrapper`,style:h,ref:u},L.createElement(vre,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&L.createElement(yre,{width:l.width,height:l.height}),L.createElement(gre,zA({},t,m,{margin:i,chartWidth:d,chartHeight:f,contextPayload:n}))),g)}var GA=L.memo(WA,RA);GA.displayName=`Legend`;function KA(){return KA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KA.apply(null,arguments)}function qA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function JA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qA(Object(n),!0).forEach(function(t){YA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function YA(e,t,n){return(t=XA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XA(e){var t=ZA(e,`string`);return typeof t==`symbol`?t:t+``}function ZA(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function QA(e){return Array.isArray(e)&&yw(e[0])&&yw(e[1])?e.join(` ~ `):e}var $A={separator:` : `,contentStyle:{margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},itemStyle:{display:`block`,paddingTop:4,paddingBottom:4,color:`#000`},labelStyle:{},accessibilityLayer:!1};function ej(e,t){return t==null?e:(0,fT.default)(e,t)}var tj=e=>{var{separator:t=$A.separator,contentStyle:n,itemStyle:r,labelStyle:i=$A.labelStyle,payload:a,formatter:o,itemSorter:s,wrapperClassName:c,labelClassName:l,label:u,labelFormatter:d,accessibilityLayer:f=$A.accessibilityLayer}=e,p=()=>{if(a&&a.length){var e={padding:0,margin:0},n=ej(a,s).map((e,n)=>{if(!e||e.type===`none`)return null;var i=e.formatter||o||QA,{value:s,name:c}=e,l=s,u=c;if(i){var d=i(s,c,e,n,a);if(Array.isArray(d))[l,u]=d;else if(d!=null)l=d;else return null}var f=JA(JA({},$A.itemStyle),{},{color:e.color||$A.itemStyle.color},r);return L.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${n}`,style:f},yw(u)?L.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,yw(u)?L.createElement(`span`,{className:`recharts-tooltip-item-separator`},t):null,L.createElement(`span`,{className:`recharts-tooltip-item-value`},l),L.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return L.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},n)}return null},m=JA(JA({},$A.contentStyle),n),h=JA({margin:0},i),g=!Ew(u),_=g?u:``,v=$u(`recharts-default-tooltip`,c),y=$u(`recharts-tooltip-label`,l);g&&d&&a!=null&&(_=d(u,a));var b=f?{role:`status`,"aria-live":`assertive`}:{};return L.createElement(`div`,KA({className:v,style:m},b),L.createElement(`p`,{className:y,style:h},L.isValidElement(_)?_:`${_}`),p())},nj=`recharts-tooltip-wrapper`,rj={visibility:`hidden`};function ij(e){var{coordinate:t,translateX:n,translateY:r}=e;return $u(nj,{[`${nj}-right`]:Z(n)&&t&&Z(t.x)&&n>=t.x,[`${nj}-left`]:Z(n)&&t&&Z(t.x)&&n<t.x,[`${nj}-bottom`]:Z(r)&&t&&Z(t.y)&&r>=t.y,[`${nj}-top`]:Z(r)&&t&&Z(t.y)&&r<t.y})}function aj(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:s,viewBox:c,viewBoxDimension:l}=e;if(a&&Z(a[r]))return a[r];var u=n[r]-s-(i>0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(u<f?d:u,f):l==null?0:d+s>f+l?Math.max(u,f):Math.max(d,f)}function oj(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function sj(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:s,useTranslate3d:c,viewBox:l}=e,u,d,f;return s.height>0&&s.width>0&&n?(d=aj({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=aj({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=oj({translateX:d,translateY:f,useTranslate3d:c})):u=rj,{cssProperties:u,cssClasses:ij({translateX:d,translateY:f,coordinate:n})}}var cj={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function lj(){var[e,t]=(0,L.useState)(()=>cj.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);return(0,L.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),n=()=>{t(e.matches)};return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}}},[]),e}function uj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uj(Object(n),!0).forEach(function(t){fj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fj(e,t,n){return(t=pj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pj(e){var t=mj(e,`string`);return typeof t==`symbol`?t:t+``}function mj(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function hj(e){if(!(e.prefersReducedMotion&&e.isAnimationActive===`auto`)&&e.isAnimationActive&&e.active)return`transform ${e.animationDuration}ms ${e.animationEasing}`}function gj(e){var t=lj(),[n,r]=L.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));L.useEffect(()=>{var t=t=>{t.key===`Escape`&&r({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),n.dismissed&&((e.coordinate?.x??0)!==n.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==n.dismissedAtCoordinate.y)&&r(dj(dj({},n),{},{dismissed:!1}));var{cssClasses:i,cssProperties:a}=sj({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=dj(dj({},e.hasPortalFromProps?{}:dj(dj({transition:hj({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},a),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!n.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return L.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:i,style:o,ref:e.innerRef},e.children)}var _j=L.memo(gj),vj=()=>Q(e=>e.rootProps.accessibilityLayer)??!0;function yj(){return yj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yj.apply(null,arguments)}function bj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?bj(Object(n),!0).forEach(function(t){Sj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Sj(e,t,n){return(t=Cj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cj(e){var t=wj(e,`string`);return typeof t==`symbol`?t:t+``}function wj(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Tj={curveBasisClosed:AC,curveBasisOpen:MC,curveBasis:OC,curveBumpX:iC,curveBumpY:aC,curveLinearClosed:PC,curveLinear:QS,curveMonotoneX:HC,curveMonotoneY:UC,curveNatural:KC,curveStep:JC,curveStepAfter:XC,curveStepBefore:YC},Ej=e=>tO(e.x)&&tO(e.y),Dj=e=>e.base!=null&&Ej(e.base)&&Ej(e),Oj=e=>e.x,kj=e=>e.y,Aj=(e,t)=>{if(typeof e==`function`)return e;var n=`curve${Dw(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=Tj[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return Tj[n]||QS},jj={connectNulls:!1,type:`linear`},Mj=e=>{var{type:t=jj.type,points:n=[],baseLine:r,layout:i,connectNulls:a=jj.connectNulls}=e,o=Aj(t,i),s=a?n.filter(Ej):n;if(Array.isArray(r)){var c,l=n.map((e,t)=>xj(xj({},e),{},{base:r[t]}));return c=i===`vertical`?nC().y(kj).x1(Oj).x0(e=>e.base.x):nC().x(Oj).y1(kj).y0(e=>e.base.y),c.defined(Dj).curve(o)(a?l.filter(Dj):l)}return(i===`vertical`&&Z(r)?nC().y(kj).x1(Oj).x0(r):Z(r)?nC().x(Oj).y1(kj).y0(r):tC().x(Oj).y(kj)).defined(Ej).curve(o)(s)},Nj=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Ik();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?Mj(o):r;return L.createElement(`path`,yj({},yS(e),Iw(e),{className:$u(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},Pj=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function Fj(){return Fj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fj.apply(null,arguments)}function Ij(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Lj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ij(Object(n),!0).forEach(function(t){Rj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ij(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Rj(e,t,n){return(t=zj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zj(e){var t=Bj(e,`string`);return typeof t==`symbol`?t:t+``}function Bj(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Vj(e,t){if(e==null)return{};var n,r,i=Hj(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Hj(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Uj=(e,t,n,r,i,a)=>`M${e},${i}v${r}M${a},${t}h${n}`,Wj=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:s}=e,c=Vj(e,Pj),l=Lj({x:t,y:n,top:r,left:i,width:a,height:o},c);return!Z(t)||!Z(n)||!Z(a)||!Z(o)||!Z(r)||!Z(i)?null:L.createElement(`path`,Fj({},xS(l),{className:$u(`recharts-cross`,s),d:Uj(t,n,a,o,r,i)}))};function Gj(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}function Kj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Kj(Object(n),!0).forEach(function(t){Jj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Jj(e,t,n){return(t=Yj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yj(e){var t=Xj(e,`string`);return typeof t==`symbol`?t:t+``}function Xj(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Zj=e=>e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),Qj=(e,t,n)=>e.map(e=>`${Zj(e)} ${t}ms ${n}`).join(`,`),$j=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((e,t)=>e.filter(e=>t.includes(e))),eM=(e,t)=>Object.keys(t).reduce((n,r)=>qj(qj({},n),{},{[r]:e(r,t[r])}),{});function tM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tM(Object(n),!0).forEach(function(t){rM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rM(e,t,n){return(t=iM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iM(e){var t=aM(e,`string`);return typeof t==`symbol`?t:t+``}function aM(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var oM=(e,t,n)=>e+(t-e)*n,sM=e=>{var{from:t,to:n}=e;return t!==n},cM=(e,t,n)=>{var r=eM((t,n)=>{if(sM(n)){var[r,i]=e(n.from,n.to,n.velocity);return nM(nM({},n),{},{from:r,velocity:i})}return n},t);return n<1?eM((e,t)=>sM(t)&&r[e]!=null?nM(nM({},t),{},{velocity:oM(t.velocity,r[e].velocity,n),from:oM(t.from,r[e].from,n)}):t,t):cM(e,r,n-1)};function lM(e,t,n,r,i,a){var o,s=r.reduce((n,r)=>nM(nM({},n),{},{[r]:{from:e[r],velocity:0,to:t[r]}}),{}),c=()=>eM((e,t)=>t.from,s),l=()=>!Object.values(s).filter(sM).length,u=null,d=r=>{o||=r;var f=(r-o)/n.dt;s=cM(n,s,f),i(nM(nM(nM({},e),t),c())),o=r,l()||(u=a.setTimeout(d))};return()=>(u=a.setTimeout(d),()=>{var e;(e=u)==null||e()})}function uM(e,t,n,r,i,a,o){var s=null,c=i.reduce((n,r)=>{var i=e[r],a=t[r];return i==null||a==null?n:nM(nM({},n),{},{[r]:[i,a]})},{}),l,u=i=>{l||=i;var d=(i-l)/r,f=eM((e,t)=>oM(...t,n(d)),c);if(a(nM(nM(nM({},e),t),f)),d<1)s=o.setTimeout(u);else{var p=eM((e,t)=>oM(...t,n(1)),c);a(nM(nM(nM({},e),t),p))}};return()=>(s=o.setTimeout(u),()=>{var e;(e=s)==null||e()})}var dM=(e,t,n,r,i,a)=>{var o=$j(e,t);return n==null?()=>(i(nM(nM({},e),t)),()=>{}):n.isStepper===!0?lM(e,t,n,o,i,a):uM(e,t,n,r,o,i,a)},fM=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],pM=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),mM=(e,t)=>n=>pM(fM(e,t),n),hM=(e,t)=>n=>pM([...fM(e,t).map((e,t)=>e*t).slice(1),0],n),gM=e=>{var t,n=e.split(`(`);if(n.length!==2||n[0]!==`cubic-bezier`)return null;var r=(t=n[1])==null||(t=t.split(`)`)[0])==null?void 0:t.split(`,`);if(r==null||r.length!==4)return null;var i=r.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]},_M=function(){var e=[...arguments];if(e.length===1)switch(e[0]){case`linear`:return[0,0,1,1];case`ease`:return[.25,.1,.25,1];case`ease-in`:return[.42,0,1,1];case`ease-out`:return[.42,0,.58,1];case`ease-in-out`:return[0,0,.58,1];default:var t=gM(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},vM=(e,t,n,r)=>{var i=mM(e,n),a=mM(t,r),o=hM(e,n),s=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,n=t,r=0;r<8;++r){var c=i(n)-t,l=o(n);if(Math.abs(c-t)<1e-4||l<1e-4)return a(n);n=s(n-c/l)}return a(n)};return c.isStepper=!1,c},yM=function(){return vM(..._M(...arguments))},bM=function(){var{stiff:e=100,damping:t=8,dt:n=17}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(r,i,a)=>{var o=a+(-(r-i)*e-a*t)*n/1e3,s=a*n/1e3+r;return Math.abs(s-i)<1e-4&&Math.abs(o)<1e-4?[i,0]:[s,o]};return r.isStepper=!0,r.dt=n,r},xM=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return yM(e);case`spring`:return bM();default:if(e.split(`(`)[0]===`cubic-bezier`)return yM(e)}return typeof e==`function`?e:null};function SM(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var[s,...c]=o;if(typeof s==`number`){i=e.setTimeout(a.bind(null,c),s);return}a(s),i=e.setTimeout(a.bind(null,c));return}typeof o==`string`&&(t=o,n(t)),typeof o==`object`&&(t=o,n(t)),typeof o==`function`&&o()}};return{stop:()=>{r=!0},start:e=>{r=!1,i&&=(i(),null),a(e)},subscribe:e=>(n=e,()=>{n=()=>null}),getTimeoutController:()=>e}}var CM=class{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),r=null,i=a=>{a-n>=t?e(a):typeof requestAnimationFrame==`function`&&(r=requestAnimationFrame(i))};return r=requestAnimationFrame(i),()=>{r!=null&&cancelAnimationFrame(r)}}};function wM(){return SM(new CM)}var TM=(0,L.createContext)(wM);function EM(e,t){var n=(0,L.useContext)(TM);return(0,L.useMemo)(()=>t??n(e),[e,t,n])}var DM={begin:0,duration:1e3,easing:`ease`,isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},OM={t:0},kM={t:1};function AM(e){var t=zw(e,DM),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:s,onAnimationStart:c,children:l}=t,u=lj(),d=n===`auto`?!cj.isSsr&&!u:n,f=EM(t.animationId,t.animationManager),[p,m]=(0,L.useState)(d?OM:kM),h=(0,L.useRef)(null);return(0,L.useEffect)(()=>{d||m(kM)},[d]),(0,L.useEffect)(()=>{if(!d||!r)return kw;var e=dM(OM,kM,xM(a),i,m,f.getTimeoutController());return f.start([c,o,()=>{h.current=e()},i,s]),()=>{f.stop(),h.current&&h.current(),s()}},[d,r,i,a,o,c,s,f]),l(p.t)}function jM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`animation-`,n=(0,L.useRef)(xw(t)),r=(0,L.useRef)(e);return r.current!==e&&(n.current=xw(t),r.current=e),n.current}var MM=[`radius`],NM=[`radius`],PM,FM,IM,LM,RM,zM,BM,VM,HM,UM;function WM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function GM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?WM(Object(n),!0).forEach(function(t){KM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function KM(e,t,n){return(t=qM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qM(e){var t=JM(e,`string`);return typeof t==`symbol`?t:t+``}function JM(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function YM(){return YM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YM.apply(null,arguments)}function XM(e,t){if(e==null)return{};var n,r,i=ZM(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ZM(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function QM(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var $M=(e,t,n,r,i)=>{var a=pw(n),o=pw(r),s=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,l=a>=0?1:-1,u=+(o>=0&&a>=0||o<0&&a<0),d;if(s>0&&Array.isArray(i)){for(var f=[0,0,0,0],p=0,m=4;p<m;p++){var h=i[p]??0;f[p]=h>s?s:h}d=mw(PM||=QM([`M`,`,`,``]),e,t+c*f[0]),f[0]>0&&(d+=mw(FM||=QM([`A `,`,`,`,0,0,`,`,`,`,`,``]),f[0],f[0],u,e+l*f[0],t)),d+=mw(IM||=QM([`L `,`,`,``]),e+n-l*f[1],t),f[1]>0&&(d+=mw(LM||=QM([`A `,`,`,`,0,0,`,`,
34
- `,`,`,``]),f[1],f[1],u,e+n,t+c*f[1])),d+=mw(RM||=QM([`L `,`,`,``]),e+n,t+r-c*f[2]),f[2]>0&&(d+=mw(zM||=QM([`A `,`,`,`,0,0,`,`,
35
- `,`,`,``]),f[2],f[2],u,e+n-l*f[2],t+r)),d+=mw(BM||=QM([`L `,`,`,``]),e+l*f[3],t+r),f[3]>0&&(d+=mw(VM||=QM([`A `,`,`,`,0,0,`,`,
36
- `,`,`,``]),f[3],f[3],u,e,t+r-c*f[3])),d+=`Z`}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);d=mw(HM||=QM(`M .,.
37
- A .,.,0,0,.,.,.
38
- L .,.
39
- A .,.,0,0,.,.,.
40
- L .,.
41
- A .,.,0,0,.,.,.
42
- L .,.
43
- A .,.,0,0,.,.,. Z`.split(`.`)),e,t+c*g,g,g,u,e+l*g,t,e+n-l*g,t,g,g,u,e+n,t+c*g,e+n,t+r-c*g,g,g,u,e+n-l*g,t+r,e+l*g,t+r,g,g,u,e,t+r-c*g)}else d=mw(UM||=QM([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},eN={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},tN=e=>{var t=zw(e,eN),n=(0,L.useRef)(null),[r,i]=(0,L.useState)(-1);(0,L.useEffect)(()=>{if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&i(e)}catch{}},[]);var{x:a,y:o,width:s,height:c,radius:l,className:u}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isAnimationActive:m,isUpdateAnimationActive:h}=t,g=(0,L.useRef)(s),_=(0,L.useRef)(c),v=(0,L.useRef)(a),y=(0,L.useRef)(o),b=jM((0,L.useMemo)(()=>({x:a,y:o,width:s,height:c,radius:l}),[a,o,s,c,l]),`rectangle-`);if(a!==+a||o!==+o||s!==+s||c!==+c||s===0||c===0)return null;var x=$u(`recharts-rectangle`,u);if(!h){var S=xS(t),{radius:C}=S,w=XM(S,MM);return L.createElement(`path`,YM({},w,{x:pw(a),y:pw(o),width:pw(s),height:pw(c),radius:typeof l==`number`?l:void 0,className:x,d:$M(a,o,s,c,l)}))}var T=g.current,E=_.current,D=v.current,O=y.current,k=`0px ${r===-1?1:r}px`,A=`${r}px ${r}px`,j=Qj([`strokeDasharray`],f,typeof d==`string`?d:eN.animationEasing);return L.createElement(AM,{animationId:b,key:b,canBegin:r>0,duration:f,easing:d,isActive:h,begin:p},e=>{var r=ww(T,s,e),i=ww(E,c,e),u=ww(D,a,e),d=ww(O,o,e);n.current&&(g.current=r,_.current=i,v.current=u,y.current=d);var f=m?e>0?{transition:j,strokeDasharray:A}:{strokeDasharray:k}:{strokeDasharray:A},p=xS(t),{radius:h}=p,b=XM(p,NM);return L.createElement(`path`,YM({},b,{radius:typeof l==`number`?l:void 0,className:x,d:$M(u,d,r,i,l),ref:n,style:GM(GM({},f),t.style)}))})};function nN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nN(Object(n),!0).forEach(function(t){iN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iN(e,t,n){return(t=aN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aN(e){var t=oN(e,`string`);return typeof t==`symbol`?t:t+``}function oN(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var sN=Math.PI/180,cN=e=>e*180/Math.PI,lN=(e,t,n,r)=>({x:e+Math.cos(-sN*r)*n,y:t+Math.sin(-sN*r)*n}),uN=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},dN=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},fN=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=dN({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:cN(c),angleInRadian:c}},pN=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},mN=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},hN=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=fN({x:n,y:r},t),{innerRadius:o,outerRadius:s}=t;if(i<o||i>s||i===0)return null;var{startAngle:c,endAngle:l}=pN(t),u=a,d;if(c<=l){for(;u>l;)u-=360;for(;u<c;)u+=360;d=u>=c&&u<=l}else{for(;u>c;)u-=360;for(;u<l;)u+=360;d=u>=l&&u<=c}return d?rN(rN({},t),{},{radius:i,angle:mN(u,t)}):null};function gN(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e;return{points:[lN(t,n,r,i),lN(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var _N,vN,yN,bN,xN,SN,CN;function wN(){return wN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wN.apply(null,arguments)}function TN(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var EN=(e,t)=>gw(t-e)*Math.min(Math.abs(t-e),359.999),DN=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:s,cornerIsExternal:c}=e,l=s*(o?1:-1)+r,u=Math.asin(s/l)/sN,d=c?i:i+a*u,f=lN(t,n,l,d),p=lN(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:lN(t,n,l*Math.cos(u*sN),m),theta:u}},ON=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,s=EN(a,o),c=a+s,l=lN(t,n,i,a),u=lN(t,n,i,c),d=mw(_N||=TN([`M `,`,`,`
44
- A `,`,`,`,0,
45
- `,`,`,`,
46
- `,`,`,`
47
- `]),l.x,l.y,i,i,+(Math.abs(s)>180),+(a>c),u.x,u.y);if(r>0){var f=lN(t,n,r,a),p=lN(t,n,r,c);d+=mw(vN||=TN([`L `,`,`,`
48
- A `,`,`,`,0,
49
- `,`,`,`,
50
- `,`,`,` Z`]),p.x,p.y,r,r,+(Math.abs(s)>180),+(a<=c),f.x,f.y)}else d+=mw(yN||=TN([`L `,`,`,` Z`]),t,n);return d},kN=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:s,startAngle:c,endAngle:l}=e,u=gw(l-c),{circleTangency:d,lineTangency:f,theta:p}=DN({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),{circleTangency:m,lineTangency:h,theta:g}=DN({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),_=s?Math.abs(c-l):Math.abs(c-l)-p-g;if(_<0)return o?mw(bN||=TN([`M `,`,`,`
51
- a`,`,`,`,0,0,1,`,`,0
52
- a`,`,`,`,0,0,1,`,`,0
53
- `]),f.x,f.y,a,a,a*2,a,a,-a*2):ON({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var v=mw(xN||=TN([`M `,`,`,`
54
- A`,`,`,`,0,0,`,`,`,`,`,`
55
- A`,`,`,`,0,`,`,`,`,`,`,`,`
56
- A`,`,`,`,0,0,`,`,`,`,`,`
57
- `]),f.x,f.y,a,a,+(u<0),d.x,d.y,i,i,+(_>180),+(u<0),m.x,m.y,a,a,+(u<0),h.x,h.y);if(r>0){var{circleTangency:y,lineTangency:b,theta:x}=DN({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),{circleTangency:S,lineTangency:C,theta:w}=DN({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),T=s?Math.abs(c-l):Math.abs(c-l)-x-w;if(T<0&&a===0)return`${v}L${t},${n}Z`;v+=mw(SN||=TN([`L`,`,`,`
58
- A`,`,`,`,0,0,`,`,`,`,`,`
59
- A`,`,`,`,0,`,`,`,`,`,`,`,`
60
- A`,`,`,`,0,0,`,`,`,`,`,`Z`]),C.x,C.y,a,a,+(u<0),S.x,S.y,r,r,+(T>180),+(u>0),y.x,y.y,a,a,+(u<0),b.x,b.y)}else v+=mw(CN||=TN([`L`,`,`,`Z`]),t,n);return v},AN={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},jN=e=>{var t=zw(e,AN),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u,className:d}=t;if(a<i||l===u)return null;var f=$u(`recharts-sector`,d),p=a-i,m=Sw(o,p,0,!0),h=m>0&&Math.abs(l-u)<360?kN({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):ON({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return L.createElement(`path`,wN({},xS(t),{className:f,d:h}))};function MN(e,t,n){if(e===`horizontal`)return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e===`vertical`)return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(Fw(t)){if(e===`centric`){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:s}=t,c=lN(r,i,a,s),l=lN(r,i,o,s);return[{x:c.x,y:c.y},{x:l.x,y:l.y}]}return gN(t)}}var NN=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=uT();function n(e){return t.isSymbol(e)?NaN:Number(e)}e.toNumber=n})),PN=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=NN();function n(e){return e?(e=t.toNumber(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}e.toFinite=n})),FN=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=dT(),n=PN();function r(e,r,i){i&&typeof i!=`number`&&t.isIterateeCall(e,r,i)&&(r=i=void 0),e=n.toFinite(e),r===void 0?(r=e,e=0):r=n.toFinite(r),i=i===void 0?e<r?1:-1:n.toFinite(i);let a=Math.max(Math.ceil((r-e)/(i||1)),0),o=Array(a);for(let t=0;t<a;t++)o[t]=e,e+=i;return o}e.range=r})),IN=s(((e,t)=>{t.exports=FN().range})),LN=e=>e.chartData,RN=$([LN],e=>{var t=e.chartData==null?0:e.chartData.length-1;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),zN=(e,t,n,r)=>r?RN(e):LN(e),BN=(e,t,n)=>n?RN(e):LN(e),VN=$([zN],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)}),HN=$([RN],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)}),UN=$([LN],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)});function WN(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(tO(t)&&tO(n))return!0}return!1}function GN(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function KN(e,t){if(t&&typeof e!=`function`&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(tO(n))i=n;else if(typeof n==`function`)return;if(tO(r))a=r;else if(typeof r==`function`)return;var o=[i,a];if(WN(o))return o}}function qN(e,t,n){if(!(!n&&t==null)){if(typeof e==`function`&&t!=null)try{var r=e(t,n);if(WN(r))return GN(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,s;if(i===`auto`)t!=null&&(o=Math.min(...t));else if(Z(i))o=i;else if(typeof i==`function`)try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i==`string`&&CO.test(i)){var c=CO.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var l=+c[1];o=t[0]-l}}else o=t?.[0];if(a===`auto`)t!=null&&(s=Math.max(...t));else if(Z(a))s=a;else if(typeof a==`function`)try{t!=null&&(s=a(t?.[1]))}catch{}else if(typeof a==`string`&&wO.test(a)){var u=wO.exec(a);if(u==null||u[1]==null||t==null)s=void 0;else{var d=+u[1];s=t[1]+d}}else s=t?.[1];var f=[o,s];if(WN(f))return t==null?f:GN(f,t,n)}}}var JN=u(s(((e,t)=>{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l<u&&(o=m,m=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=p-r.length,n&&(a+=w(n)),a+=r;o=e[t],r=o+``,n=p-r.length,n&&(a+=w(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}var b=(function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%f|0,r=n/f|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*f+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u<T||d)&&x--;u++)C=d*f+(M[u]||0),_[u]=C/N|0,d=C%N|0;else{for(d=f/(N[0]+1)|0,d>1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y<O;)v[y++]=0;k=N.slice(),k.unshift(0),E=N[0],N[1]>=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O<h?k:N,h))):(d==0&&(c=d=1),m=N.slice()),h=m.length,h<y&&m.unshift(0),n(v,m,y),c==-1&&(y=v.length,c=t(N,v,O,y),c<1&&(d++,n(v,O<y?k:N,y))),y=v.length):c===0&&(d++,v=[0]),_[u++]=d,c&&v[0]?v[y++]=M[w]||0:(v=[M[w]],y=1);while((w++<T||v[0]!==void 0)&&x--)}return _[0]||_.shift(),g.e=l,D(g,s?o+S(g)+1:o)}})();function x(e,t){var n,r,a,o,c,u,f=0,p=0,m=e.constructor,h=m.precision;if(S(e)>16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=p;r<a;)e.d.push(+t.slice(r,r+=p));t=t.slice(r),r=p-t.length}else r-=a;for(;r--;)t+=`0`;if(e.d.push(+t),i&&(e.e>h||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a<c,d&&(c=a),a=0;a<c;a++)if(l[a]!=m[a]){d=l[a]<m[a];break}s=0}for(d&&(n=l,l=m,m=n,t.s=-t.s),c=l.length,a=m.length-c;a>0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]<m[a]){for(o=a;o&&l[--o]===0;)l[o]=f-1;--l[o],l[a]+=f}l[a]-=m[a]}for(;l[--c]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,i?D(t,g):t):new h(0)}function k(e,t,n){var r,i=S(e),a=y(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i){t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;return}if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}else if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function M(e){if(!e||typeof e!=`object`)throw Error(a+`Object expected`);var t,r,i,s=[`precision`,1,n,`rounding`,0,8,`toExpNeg`,-1/0,0,`toExpPos`,0,1/0];for(t=0;t<s.length;t+=3)if((i=e[r=s[t]])!==void 0)if(c(i)===i&&i>=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i);if((i=e[r=`LN10`])!==void 0)if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i);return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}))());function YN(e){return e===0?1:Math.floor(new JN.default(e).abs().log(10).toNumber())+1}function XN(e,t,n){for(var r=new JN.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var ZN=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},QN=(e,t,n)=>{if(e.lte(0))return new JN.default(0);var r=YN(e.toNumber()),i=new JN.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new JN.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?new JN.default(s.toNumber()):new JN.default(Math.ceil(s.toNumber()))},$N=(e,t,n)=>{if(e.lte(0))return new JN.default(0);var r=[1,2,2.5,5],i=e.toNumber(),a=Math.floor(new JN.default(i).abs().log(10).toNumber()),o=new JN.default(10).pow(a),s=e.div(o).toNumber(),c=r.findIndex(e=>e>=s-1e-10);if(c===-1&&(o=o.mul(10),c=0),c+=n,c>=r.length){var l=Math.floor(c/r.length);c%=r.length,o=o.mul(new JN.default(10).pow(l))}var u=new JN.default(r[c]??1).mul(o);return t?u:new JN.default(Math.ceil(u.toNumber()))},eP=(e,t,n)=>{var r=new JN.default(1),i=new JN.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new JN.default(10).pow(YN(e)-1),i=new JN.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new JN.default(Math.floor(e)))}else e===0?i=new JN.default(Math.floor((t-1)/2)):n||(i=new JN.default(Math.floor(e)));for(var o=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new JN.default(c-o).mul(r)).toNumber());return s},tP=function(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:QN;if(!Number.isFinite((t-e)/(n-1)))return{step:new JN.default(0),tickMin:new JN.default(0),tickMax:new JN.default(0)};var o=a(new JN.default(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new JN.default(0):(s=new JN.default(e).add(t).div(2),s=s.sub(new JN.default(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new JN.default(t).sub(s).div(o).toNumber()),u=c+l+1;return u>n?tP(e,t,n,r,i+1,a):(u<n&&(l=t>0?l+(n-u):l,c=t>0?c:c+(n-u)),{step:o,tickMin:s.sub(new JN.default(c).mul(o)),tickMax:s.add(new JN.default(l).mul(o))})},nP=function(e){var[t,n]=e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,o=Math.max(r,2),[s,c]=ZN([t,n]);if(s===-1/0||c===1/0){var l=c===1/0?[s,...Array(r-1).fill(1/0)]:[...Array(r-1).fill(-1/0),c];return t>n?l.reverse():l}if(s===c)return eP(s,r,i);var{step:u,tickMin:d,tickMax:f}=tP(s,c,o,i,0,a===`snap125`?$N:QN),p=XN(d,f.add(new JN.default(.1).mul(u)),u);return t>n?p.reverse():p},rP=function(e,t){var[n,r]=e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,[o,s]=ZN([n,r]);if(o===-1/0||s===1/0)return[n,r];if(o===s)return[o];var c=a===`snap125`?$N:QN,l=Math.max(t,2),u=c(new JN.default(s).sub(o).div(l-1),i,0),d=[...XN(new JN.default(o),new JN.default(s),u),s];return i===!1&&(d=d.map(e=>Math.round(e))),n>r?d.reverse():d},iP=e=>e.rootProps.maxBarSize,aP=e=>e.rootProps.barGap,oP=e=>e.rootProps.barCategoryGap,sP=e=>e.rootProps.barSize,cP=e=>e.rootProps.stackOffset,lP=e=>e.rootProps.reverseStackOrder,uP=e=>e.options.chartName,dP=e=>e.rootProps.syncId,fP=e=>e.rootProps.syncMethod,pP=e=>e.options.eventEmitter,mP=e=>e.rootProps.baseValue,hP={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},gP={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:`polygon`,cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,niceTicks:`auto`,orientation:`outer`,reversed:!1,scale:`auto`,tick:!0,tickLine:!0,tickSize:8,type:`auto`,zIndex:hP.axis},_P={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,niceTicks:`auto`,label:!1,orientation:`right`,radiusAxisId:0,reversed:!1,scale:`auto`,stroke:`#ccc`,tick:!0,tickCount:5,tickLine:!0,type:`auto`,zIndex:hP.axis},vP=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function yP(e,t,n){if(n!==`auto`)return n;if(e!=null)return uO(e,t)?`category`:`number`}function bP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?bP(Object(n),!0).forEach(function(t){SP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function SP(e,t,n){return(t=CP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CP(e){var t=wP(e,`string`);return typeof t==`symbol`?t:t+``}function wP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var TP={allowDataOverflow:gP.allowDataOverflow,allowDecimals:gP.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:gP.angleAxisId,includeHidden:!1,name:void 0,reversed:gP.reversed,scale:gP.scale,tick:gP.tick,tickCount:void 0,ticks:void 0,type:gP.type,unit:void 0,niceTicks:`auto`},EP={allowDataOverflow:_P.allowDataOverflow,allowDecimals:_P.allowDecimals,allowDuplicatedCategory:_P.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:_P.radiusAxisId,includeHidden:_P.includeHidden,name:void 0,reversed:_P.reversed,scale:_P.scale,tick:_P.tick,tickCount:_P.tickCount,ticks:void 0,type:_P.type,unit:void 0,niceTicks:`auto`},DP=$([(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Rk],(e,t)=>{if(e!=null)return e;var n=yP(t,`angleAxis`,TP.type)??`category`;return xP(xP({},TP),{},{type:n})}),OP=$([(e,t)=>e.polarAxis.radiusAxis[t],Rk],(e,t)=>{if(e!=null)return e;var n=yP(t,`radiusAxis`,EP.type)??`category`;return xP(xP({},EP),{},{type:n})}),kP=e=>e.polarOptions,AP=$([AO,jO,JO],uN),jP=$([kP,AP],(e,t)=>{if(e!=null)return Sw(e.innerRadius,t,0)}),MP=$([kP,AP],(e,t)=>{if(e!=null)return Sw(e.outerRadius,t,t*.8)}),NP=$([kP],e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]});$([DP,NP],vP);var PP=$([AP,jP,MP],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});$([OP,PP],vP);var FP=$([Fk,kP,jP,MP,AO,jO],(e,t,n,r,i,a)=>{if(!(e!==`centric`&&e!==`radial`||t==null||n==null||r==null)){var{cx:o,cy:s,startAngle:c,endAngle:l}=t;return{cx:Sw(o,i,i/2),cy:Sw(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:l,clockWise:!1}}}),IP=(e,t)=>t,LP=(e,t,n)=>n;function RP(e){return e?.id}function zP(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(e=>{var t=e.data??r;if(!(t==null||t.length===0)){var n=RP(e);t.forEach((t,r)=>{var s=a==null||i?r:String(cO(t,a,null)),c=cO(t,e.dataKey,0),l=o.has(s)?o.get(s):{};Object.assign(l,{[n]:c}),o.set(s,l)})}}),Array.from(o.values())}function BP(e){return`stackId`in e&&e.stackId!=null&&e.dataKey!=null}var VP=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function HP(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function UP(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var WP=e=>{var t=Fk(e);return t===`horizontal`?`xAxis`:t===`vertical`?`yAxis`:t===`centric`?`angleAxis`:`radiusAxis`},GP=e=>e.tooltip.settings.axisId;function KP(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(e){var t=i[0],n=i[1];return t<=n?e>=t&&e<=n:e>=n&&e<=t},bandwidth:n?()=>n.call(e):void 0,ticks:t?n=>t.call(e,n):void 0,map:(t,n)=>{var r=e(t);if(r!=null){if(e.bandwidth&&n!=null&&n.position){var i=e.bandwidth();switch(n.position){case`middle`:r+=i/2;break;case`end`:r+=i;break;default:break}}return r}}}}}var qP=(e,t)=>{if(t!=null)switch(e){case`linear`:if(!WN(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];tO(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t;default:return t}};function JP(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function YP(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function XP(e){let t,n,r;e.length===2?(t=e===JP||e===YP?e:ZP,n=e,r=e):(t=JP,n=(t,n)=>JP(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function ZP(){return 0}function QP(e){return e===null?NaN:+e}function*$P(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var eF=XP(JP),tF=eF.right;eF.left,XP(QP).center;var nF=class extends Map{constructor(e,t=oF){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(rF(this,e))}has(e){return super.has(rF(this,e))}set(e,t){return super.set(iF(this,e),t)}delete(e){return super.delete(aF(this,e))}};function rF({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function iF({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function aF({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function oF(e){return typeof e==`object`&&e?e.valueOf():e}function sF(e=JP){if(e===JP)return cF;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function cF(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}var lF=Math.sqrt(50),uF=Math.sqrt(10),dF=Math.sqrt(2);function fF(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=lF?10:a>=uF?5:a>=dF?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?fF(e,t,n*2):[s,c,l]}function pF(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?fF(t,e,n):fF(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function mF(e,t,n){return t=+t,e=+e,n=+n,fF(e,t,n)[2]}function hF(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?mF(t,e,n):mF(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function gF(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function _F(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function vF(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?cF:sF(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));vF(e,t,u,d,i)}let a=e[t],o=n,s=r;for(yF(e,n,t),i(e[r],a)>0&&yF(e,n,r);o<s;){for(yF(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?yF(e,n,s):(++s,yF(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function yF(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function bF(e,t,n){if(e=Float64Array.from($P(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return _F(e);if(t>=1)return gF(e);var r,i=(r-1)*t,a=Math.floor(i),o=gF(vF(e,a).subarray(0,a+1));return o+(_F(e.subarray(a+1))-o)*(i-a)}}function xF(e,t,n=QP){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function SF(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function CF(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function wF(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}var TF=Symbol(`implicit`);function EF(){var e=new nF,t=[],n=[],r=TF;function i(i){let a=e.get(i);if(a===void 0){if(r!==TF)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new nF;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return EF(t,n).unknown(r)},CF.apply(i,arguments),i}function DF(){var e=EF().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=SF(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return DF(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},CF.apply(d(),arguments)}function OF(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return OF(t())},e}function kF(){return OF(DF.apply(null,arguments).paddingInner(1))}function AF(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function jF(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function MF(){}var NF=.7,PF=1/NF,FF=`\\s*([+-]?\\d+)\\s*`,IF=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,LF=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,RF=/^#([0-9a-f]{3,8})$/,zF=RegExp(`^rgb\\(${FF},${FF},${FF}\\)$`),BF=RegExp(`^rgb\\(${LF},${LF},${LF}\\)$`),VF=RegExp(`^rgba\\(${FF},${FF},${FF},${IF}\\)$`),HF=RegExp(`^rgba\\(${LF},${LF},${LF},${IF}\\)$`),UF=RegExp(`^hsl\\(${IF},${LF},${LF}\\)$`),WF=RegExp(`^hsla\\(${IF},${LF},${LF},${IF}\\)$`),GF={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};AF(MF,XF,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:KF,formatHex:KF,formatHex8:qF,formatHsl:JF,formatRgb:YF,toString:YF});function KF(){return this.rgb().formatHex()}function qF(){return this.rgb().formatHex8()}function JF(){return lI(this).formatHsl()}function YF(){return this.rgb().formatRgb()}function XF(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=RF.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ZF(t):n===3?new tI(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?QF(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?QF(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=zF.exec(e))?new tI(t[1],t[2],t[3],1):(t=BF.exec(e))?new tI(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=VF.exec(e))?QF(t[1],t[2],t[3],t[4]):(t=HF.exec(e))?QF(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=UF.exec(e))?cI(t[1],t[2]/100,t[3]/100,1):(t=WF.exec(e))?cI(t[1],t[2]/100,t[3]/100,t[4]):GF.hasOwnProperty(e)?ZF(GF[e]):e===`transparent`?new tI(NaN,NaN,NaN,0):null}function ZF(e){return new tI(e>>16&255,e>>8&255,e&255,1)}function QF(e,t,n,r){return r<=0&&(e=t=n=NaN),new tI(e,t,n,r)}function $F(e){return e instanceof MF||(e=XF(e)),e?(e=e.rgb(),new tI(e.r,e.g,e.b,e.opacity)):new tI}function eI(e,t,n,r){return arguments.length===1?$F(e):new tI(e,t,n,r??1)}function tI(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}AF(tI,eI,jF(MF,{brighter(e){return e=e==null?PF:PF**+e,new tI(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?NF:NF**+e,new tI(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tI(oI(this.r),oI(this.g),oI(this.b),aI(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:nI,formatHex:nI,formatHex8:rI,formatRgb:iI,toString:iI}));function nI(){return`#${sI(this.r)}${sI(this.g)}${sI(this.b)}`}function rI(){return`#${sI(this.r)}${sI(this.g)}${sI(this.b)}${sI((isNaN(this.opacity)?1:this.opacity)*255)}`}function iI(){let e=aI(this.opacity);return`${e===1?`rgb(`:`rgba(`}${oI(this.r)}, ${oI(this.g)}, ${oI(this.b)}${e===1?`)`:`, ${e})`}`}function aI(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function oI(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function sI(e){return e=oI(e),(e<16?`0`:``)+e.toString(16)}function cI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new dI(e,t,n,r)}function lI(e){if(e instanceof dI)return new dI(e.h,e.s,e.l,e.opacity);if(e instanceof MF||(e=XF(e)),!e)return new dI;if(e instanceof dI)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new dI(o,s,c,e.opacity)}function uI(e,t,n,r){return arguments.length===1?lI(e):new dI(e,t,n,r??1)}function dI(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}AF(dI,uI,jF(MF,{brighter(e){return e=e==null?PF:PF**+e,new dI(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?NF:NF**+e,new dI(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new tI(mI(e>=240?e-240:e+120,i,r),mI(e,i,r),mI(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new dI(fI(this.h),pI(this.s),pI(this.l),aI(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(){let e=aI(this.opacity);return`${e===1?`hsl(`:`hsla(`}${fI(this.h)}, ${pI(this.s)*100}%, ${pI(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function fI(e){return e=(e||0)%360,e<0?e+360:e}function pI(e){return Math.max(0,Math.min(1,e||0))}function mI(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var hI=e=>()=>e;function gI(e,t){return function(n){return e+n*t}}function _I(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function vI(e){return(e=+e)==1?yI:function(t,n){return n-t?_I(t,n,e):hI(isNaN(t)?n:t)}}function yI(e,t){var n=t-e;return n?gI(e,n):hI(isNaN(e)?t:e)}var bI=(function e(t){var n=vI(t);function r(e,t){var r=n((e=eI(e)).r,(t=eI(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=yI(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function xI(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function SI(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function CI(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=MI(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function wI(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function TI(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function EI(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=MI(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var DI=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,OI=new RegExp(DI.source,`g`);function kI(e){return function(){return e}}function AI(e){return function(t){return e(t)+``}}function jI(e,t){var n=DI.lastIndex=OI.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=DI.exec(e))&&(i=OI.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:TI(r,i)})),n=OI.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?AI(c[0].x):kI(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function MI(e,t){var n=typeof t,r;return t==null||n===`boolean`?hI(t):(n===`number`?TI:n===`string`?(r=XF(t))?(t=r,bI):jI:t instanceof XF?bI:t instanceof Date?wI:SI(t)?xI:Array.isArray(t)?CI:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?EI:TI)(e,t)}function NI(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var PI=180/Math.PI,FI={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function II(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*PI,skewX:Math.atan(c)*PI,scaleX:o,scaleY:s}}var LI;function RI(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?FI:II(t.a,t.b,t.c,t.d,t.e,t.f)}function zI(e){return e==null||(LI||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),LI.setAttribute(`transform`,e),!(e=LI.transform.baseVal.consolidate()))?FI:(e=e.matrix,II(e.a,e.b,e.c,e.d,e.e,e.f))}function BI(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:TI(e,i)},{i:c-2,x:TI(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:TI(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:TI(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:TI(e,n)},{i:s-2,x:TI(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var VI=BI(RI,`px, `,`px)`,`deg)`),HI=BI(zI,`, `,`)`,`)`),UI=1e-12;function WI(e){return((e=Math.exp(e))+1/e)/2}function GI(e){return((e=Math.exp(e))-1/e)/2}function KI(e){return((e=Math.exp(2*e))-1)/(e+1)}var qI=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<UI)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=WI(y),c=s/(n*g)*(i*KI(t*r+y)-GI(y));return[a+c*d,o+c*f,s*i/WI(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4);function JI(e,t){t===void 0&&(t=e,e=MI);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function YI(e){return function(){return e}}function XI(e){return+e}var ZI=[0,1];function QI(e){return e}function $I(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:YI(isNaN(t)?NaN:.5)}function bre(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function xre(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=$I(i,r),a=n(o,a)):(r=$I(r,i),a=n(a,o)),function(e){return a(r(e))}}function Sre(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=$I(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=tF(e,t,1,r)-1;return a[n](i[n](t))}}function eL(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function tL(){var e=ZI,t=ZI,n=MI,r,i,a,o=QI,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==QI&&(o=bre(e[0],e[n-1])),s=n>2?Sre:xre,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),TI))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,XI),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=NI,u()},d.clamp=function(e){return arguments.length?(o=e?!0:QI,u()):o!==QI},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function nL(){return tL()(QI,QI)}function Cre(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function rL(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function iL(e){return e=rL(Math.abs(e)),e?e[1]:NaN}function wre(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Tre(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Ere=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function aL(e){if(!(t=Ere.exec(e)))throw Error(`invalid format: `+e);var t;return new oL({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]})}aL.prototype=oL.prototype;function oL(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+``}oL.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 Dre(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var sL;function Ore(e,t){var n=rL(e,t);if(!n)return sL=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(sL=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+rL(e,Math.max(0,t+a-1))[0]}function cL(e,t){var n=rL(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var lL={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Cre,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)=>cL(e*100,t),r:cL,s:Ore,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function uL(e){return e}var dL=Array.prototype.map,fL=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function kre(e){var t=e.grouping===void 0||e.thousands===void 0?uL:wre(dL.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?uL:Tre(dL.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=aL(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):lL[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=lL[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=Dre(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&sL!==void 0?fL[8+sL/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(iL(t)/3)))*3,r=10**-n,i=l((e=aL(e),e.type=`f`,e),{suffix:fL[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var pL,mL,hL;Are({thousands:`,`,grouping:[3],currency:[`$`,``]});function Are(e){return pL=kre(e),mL=pL.format,hL=pL.formatPrefix,pL}function jre(e){return Math.max(0,-iL(Math.abs(e)))}function Mre(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(iL(t)/3)))*3-iL(Math.abs(e)))}function Nre(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,iL(t)-iL(e))+1}function gL(e,t,n,r){var i=hF(e,t,n),a;switch(r=aL(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Mre(i,o))&&(r.precision=a),hL(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Nre(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=jre(i))&&(r.precision=a-(r.type===`%`)*2);break}return mL(r)}function _L(e){var t=e.domain;return e.ticks=function(e){var n=t();return pF(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return gL(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-- >0;){if(l=mF(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function vL(){var e=nL();return e.copy=function(){return eL(e,vL())},CF.apply(e,arguments),_L(e)}function yL(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,XI),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return yL(e).unknown(t)},e=arguments.length?Array.from(e,XI):[0,1],_L(n)}function bL(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function xL(e){return Math.log(e)}function SL(e){return Math.exp(e)}function Pre(e){return-Math.log(-e)}function Fre(e){return-Math.exp(-e)}function Ire(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function Lre(e){return e===10?Ire:e===Math.E?Math.exp:t=>e**+t}function Rre(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 CL(e){return(t,n)=>-e(-t,n)}function wL(e){let t=e(xL,SL),n=t.domain,r=10,i,a;function o(){return i=Rre(r),a=Lre(r),n()[0]<0?(i=CL(i),a=CL(a),e(Pre,Fre)):e(xL,SL),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=pF(o,s,p))}else m=pF(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=aL(n)).precision==null&&(n.trim=!0),n=mL(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(bL(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function TL(){let e=wL(tL()).domain([1,10]);return e.copy=()=>eL(e,TL()).base(e.base()),CF.apply(e,arguments),e}function EL(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function DL(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function OL(e){var t=1,n=e(EL(t),DL(t));return n.constant=function(n){return arguments.length?e(EL(t=+n),DL(t)):t},_L(n)}function kL(){var e=OL(tL());return e.copy=function(){return eL(e,kL()).constant(e.constant())},CF.apply(e,arguments)}function AL(e){return function(t){return t<0?-((-t)**+e):t**+e}}function zre(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Bre(e){return e<0?-e*e:e*e}function jL(e){var t=e(QI,QI),n=1;function r(){return n===1?e(QI,QI):n===.5?e(zre,Bre):e(AL(n),AL(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},_L(t)}function ML(){var e=jL(tL());return e.copy=function(){return eL(e,ML()).exponent(e.exponent())},CF.apply(e,arguments),e}function Vre(){return ML.apply(null,arguments).exponent(.5)}function NL(e){return Math.sign(e)*e*e}function Hre(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function PL(){var e=nL(),t=[0,1],n=!1,r;function i(t){var i=Hre(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(NL(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,XI)).map(NL)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return PL(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},CF.apply(i,arguments),_L(i)}function FL(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=xF(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[tF(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(JP),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return FL().domain(e).range(t).unknown(r)},CF.apply(a,arguments)}function IL(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[tF(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i<n;)r[i]=((i+1)*t-(i-n)*e)/(n+1);return o}return o.domain=function(n){return arguments.length?([e,t]=n,e=+e,t=+t,s()):[e,t]},o.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},o.invertExtent=function(a){var o=i.indexOf(a);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return IL().domain([e,t]).range(i).unknown(a)},CF.apply(_L(o),arguments)}function LL(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[tF(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return LL().domain(e).range(t).unknown(n)},CF.apply(i,arguments)}var RL=new Date,zL=new Date;function BL(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>BL(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(RL.setTime(+t),zL.setTime(+r),e(RL),e(zL),Math.floor(n(RL,zL))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var VL=BL(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);VL.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?BL(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):VL),VL.range;var HL=1e3,UL=HL*60,WL=UL*60,GL=WL*24,KL=GL*7,qL=GL*30,JL=GL*365,YL=BL(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*HL)},(e,t)=>(t-e)/HL,e=>e.getUTCSeconds());YL.range;var XL=BL(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*HL)},(e,t)=>{e.setTime(+e+t*UL)},(e,t)=>(t-e)/UL,e=>e.getMinutes());XL.range;var ZL=BL(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*UL)},(e,t)=>(t-e)/UL,e=>e.getUTCMinutes());ZL.range;var QL=BL(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*HL-e.getMinutes()*UL)},(e,t)=>{e.setTime(+e+t*WL)},(e,t)=>(t-e)/WL,e=>e.getHours());QL.range;var $L=BL(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*WL)},(e,t)=>(t-e)/WL,e=>e.getUTCHours());$L.range;var eR=BL(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*UL)/GL,e=>e.getDate()-1);eR.range;var tR=BL(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/GL,e=>e.getUTCDate()-1);tR.range;var nR=BL(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/GL,e=>Math.floor(e/GL));nR.range;function rR(e){return BL(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*UL)/KL)}var iR=rR(0),aR=rR(1),Ure=rR(2),Wre=rR(3),oR=rR(4),Gre=rR(5),Kre=rR(6);iR.range,aR.range,Ure.range,Wre.range,oR.range,Gre.range,Kre.range;function sR(e){return BL(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/KL)}var cR=sR(0),lR=sR(1),qre=sR(2),Jre=sR(3),uR=sR(4),Yre=sR(5),Xre=sR(6);cR.range,lR.range,qre.range,Jre.range,uR.range,Yre.range,Xre.range;var dR=BL(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());dR.range;var fR=BL(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());fR.range;var pR=BL(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());pR.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:BL(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),pR.range;var mR=BL(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());mR.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:BL(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),mR.range;function hR(e,t,n,r,i,a){let o=[[YL,1,HL],[YL,5,5*HL],[YL,15,15*HL],[YL,30,30*HL],[a,1,UL],[a,5,5*UL],[a,15,15*UL],[a,30,30*UL],[i,1,WL],[i,3,3*WL],[i,6,6*WL],[i,12,12*WL],[r,1,GL],[r,2,2*GL],[n,1,KL],[t,1,qL],[t,3,3*qL],[e,1,JL]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=XP(([,,e])=>e).right(o,i);if(a===o.length)return e.every(hF(t/JL,n/JL,r));if(a===0)return VL.every(Math.max(hF(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[Zre,Qre]=hR(mR,fR,cR,nR,$L,ZL),[$re,eie]=hR(pR,dR,iR,eR,QL,XL);function gR(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 _R(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 vR(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function tie(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=SR(i),u=CR(i),d=SR(a),f=CR(a),p=SR(o),m=CR(o),h=SR(s),g=CR(s),_=SR(c),v=CR(c),y={a:N,A:ee,b:te,B:P,c:null,d:OR,e:OR,f:wie,g:Pie,G:Iie,H:xie,I:Sie,j:Cie,L:kR,m:Tie,M:Eie,p:ne,q:re,Q:FR,s:IR,S:Die,u:Oie,U:kie,V:Aie,w:jie,W:Mie,x:null,X:null,y:Nie,Y:Fie,Z:Lie,"%":PR},b={a:ie,A:ae,b:F,B:I,c:null,d:jR,e:jR,f:Vie,g:Zie,G:$ie,H:Rie,I:zie,j:Bie,L:MR,m:Hie,M:Uie,p:oe,q:se,Q:FR,s:IR,S:Wie,u:Gie,U:Kie,V:qie,w:Jie,W:Yie,x:null,X:null,y:Xie,Y:Qie,Z:eae,"%":PR},x={a:E,A:D,b:O,B:k,c:A,d:ER,e:ER,f:_ie,g:TR,G:wR,H:DR,I:DR,j:pie,L:gie,m:fie,M:mie,p:T,q:die,Q:yie,s:bie,S:hie,u:oie,U:sie,V:cie,w:aie,W:lie,x:j,X:M,y:TR,Y:wR,Z:uie,"%":vie};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=yR[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=vR(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=_R(vR(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?lR.ceil(a):lR(a),a=tR.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=gR(vR(r.y,0,1)),o=a.getDay(),a=o>4||o===0?aR.ceil(a):aR(a),a=eR.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else (`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?_R(vR(r.y,0,1)).getUTCDay():gR(vR(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,_R(r)):gR(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in yR?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function ee(e){return a[e.getDay()]}function te(e){return c[e.getMonth()]}function P(e){return s[e.getMonth()]}function ne(e){return i[+(e.getHours()>=12)]}function re(e){return 1+~~(e.getMonth()/3)}function ie(e){return o[e.getUTCDay()]}function ae(e){return a[e.getUTCDay()]}function F(e){return c[e.getUTCMonth()]}function I(e){return s[e.getUTCMonth()]}function oe(e){return i[+(e.getUTCHours()>=12)]}function se(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var yR={"-":``,_:` `,0:`0`},bR=/^\s*\d+/,nie=/^%/,rie=/[\\^$*+?|[\]().{}]/g;function xR(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function iie(e){return e.replace(rie,`\\$&`)}function SR(e){return RegExp(`^(?:`+e.map(iie).join(`|`)+`)`,`i`)}function CR(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function aie(e,t,n){var r=bR.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function oie(e,t,n){var r=bR.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function sie(e,t,n){var r=bR.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function cie(e,t,n){var r=bR.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function lie(e,t,n){var r=bR.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function wR(e,t,n){var r=bR.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function TR(e,t,n){var r=bR.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function uie(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function die(e,t,n){var r=bR.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function fie(e,t,n){var r=bR.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ER(e,t,n){var r=bR.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function pie(e,t,n){var r=bR.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function DR(e,t,n){var r=bR.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function mie(e,t,n){var r=bR.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function hie(e,t,n){var r=bR.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function gie(e,t,n){var r=bR.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function _ie(e,t,n){var r=bR.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function vie(e,t,n){var r=nie.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function yie(e,t,n){var r=bR.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function bie(e,t,n){var r=bR.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function OR(e,t){return xR(e.getDate(),t,2)}function xie(e,t){return xR(e.getHours(),t,2)}function Sie(e,t){return xR(e.getHours()%12||12,t,2)}function Cie(e,t){return xR(1+eR.count(pR(e),e),t,3)}function kR(e,t){return xR(e.getMilliseconds(),t,3)}function wie(e,t){return kR(e,t)+`000`}function Tie(e,t){return xR(e.getMonth()+1,t,2)}function Eie(e,t){return xR(e.getMinutes(),t,2)}function Die(e,t){return xR(e.getSeconds(),t,2)}function Oie(e){var t=e.getDay();return t===0?7:t}function kie(e,t){return xR(iR.count(pR(e)-1,e),t,2)}function AR(e){var t=e.getDay();return t>=4||t===0?oR(e):oR.ceil(e)}function Aie(e,t){return e=AR(e),xR(oR.count(pR(e),e)+(pR(e).getDay()===4),t,2)}function jie(e){return e.getDay()}function Mie(e,t){return xR(aR.count(pR(e)-1,e),t,2)}function Nie(e,t){return xR(e.getFullYear()%100,t,2)}function Pie(e,t){return e=AR(e),xR(e.getFullYear()%100,t,2)}function Fie(e,t){return xR(e.getFullYear()%1e4,t,4)}function Iie(e,t){var n=e.getDay();return e=n>=4||n===0?oR(e):oR.ceil(e),xR(e.getFullYear()%1e4,t,4)}function Lie(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+xR(t/60|0,`0`,2)+xR(t%60,`0`,2)}function jR(e,t){return xR(e.getUTCDate(),t,2)}function Rie(e,t){return xR(e.getUTCHours(),t,2)}function zie(e,t){return xR(e.getUTCHours()%12||12,t,2)}function Bie(e,t){return xR(1+tR.count(mR(e),e),t,3)}function MR(e,t){return xR(e.getUTCMilliseconds(),t,3)}function Vie(e,t){return MR(e,t)+`000`}function Hie(e,t){return xR(e.getUTCMonth()+1,t,2)}function Uie(e,t){return xR(e.getUTCMinutes(),t,2)}function Wie(e,t){return xR(e.getUTCSeconds(),t,2)}function Gie(e){var t=e.getUTCDay();return t===0?7:t}function Kie(e,t){return xR(cR.count(mR(e)-1,e),t,2)}function NR(e){var t=e.getUTCDay();return t>=4||t===0?uR(e):uR.ceil(e)}function qie(e,t){return e=NR(e),xR(uR.count(mR(e),e)+(mR(e).getUTCDay()===4),t,2)}function Jie(e){return e.getUTCDay()}function Yie(e,t){return xR(lR.count(mR(e)-1,e),t,2)}function Xie(e,t){return xR(e.getUTCFullYear()%100,t,2)}function Zie(e,t){return e=NR(e),xR(e.getUTCFullYear()%100,t,2)}function Qie(e,t){return xR(e.getUTCFullYear()%1e4,t,4)}function $ie(e,t){var n=e.getUTCDay();return e=n>=4||n===0?uR(e):uR.ceil(e),xR(e.getUTCFullYear()%1e4,t,4)}function eae(){return`+0000`}function PR(){return`%`}function FR(e){return+e}function IR(e){return Math.floor(e/1e3)}var LR,RR,zR;tae({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 tae(e){return LR=tie(e),RR=LR.format,LR.parse,zR=LR.utcFormat,LR.utcParse,LR}function nae(e){return new Date(e)}function rae(e){return e instanceof Date?+e:+new Date(+e)}function BR(e,t,n,r,i,a,o,s,c,l){var u=nL(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,rae)):f().map(nae)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(bL(n,e)):u},u.copy=function(){return eL(u,BR(e,t,n,r,i,a,o,s,c,l))},u}function VR(){return CF.apply(BR($re,eie,pR,dR,iR,eR,QL,XL,YL,RR).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function HR(){return CF.apply(BR(Zre,Qre,mR,fR,cR,tR,$L,ZL,YL,zR).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function UR(){var e=0,t=1,n,r,i,a,o=QI,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(MI),l.rangeRound=u(NI),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function WR(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function GR(){var e=_L(UR()(QI));return e.copy=function(){return WR(e,GR())},wF.apply(e,arguments)}function KR(){var e=wL(UR()).domain([1,10]);return e.copy=function(){return WR(e,KR()).base(e.base())},wF.apply(e,arguments)}function qR(){var e=OL(UR());return e.copy=function(){return WR(e,qR()).constant(e.constant())},wF.apply(e,arguments)}function JR(){var e=jL(UR());return e.copy=function(){return WR(e,JR()).exponent(e.exponent())},wF.apply(e,arguments)}function YR(){return JR.apply(null,arguments).exponent(.5)}function XR(){var e=[],t=QI;function n(n){if(n!=null&&!isNaN(n=+n))return t((tF(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(JP),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>bF(e,r/t))},n.copy=function(){return XR(t).domain(e)},wF.apply(n,arguments)}function ZR(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=QI,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=JI(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(MI),p.rangeRound=m(NI),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function QR(){var e=_L(ZR()(QI));return e.copy=function(){return WR(e,QR())},wF.apply(e,arguments)}function $R(){var e=wL(ZR()).domain([.1,1,10]);return e.copy=function(){return WR(e,$R()).base(e.base())},wF.apply(e,arguments)}function ez(){var e=OL(ZR());return e.copy=function(){return WR(e,ez()).constant(e.constant())},wF.apply(e,arguments)}function tz(){var e=jL(ZR());return e.copy=function(){return WR(e,tz()).exponent(e.exponent())},wF.apply(e,arguments)}function nz(){return tz.apply(null,arguments).exponent(.5)}var rz=c({scaleBand:()=>DF,scaleDiverging:()=>QR,scaleDivergingLog:()=>$R,scaleDivergingPow:()=>tz,scaleDivergingSqrt:()=>nz,scaleDivergingSymlog:()=>ez,scaleIdentity:()=>yL,scaleImplicit:()=>TF,scaleLinear:()=>vL,scaleLog:()=>TL,scaleOrdinal:()=>EF,scalePoint:()=>kF,scalePow:()=>ML,scaleQuantile:()=>FL,scaleQuantize:()=>IL,scaleRadial:()=>PL,scaleSequential:()=>GR,scaleSequentialLog:()=>KR,scaleSequentialPow:()=>JR,scaleSequentialQuantile:()=>XR,scaleSequentialSqrt:()=>YR,scaleSequentialSymlog:()=>qR,scaleSqrt:()=>Vre,scaleSymlog:()=>kL,scaleThreshold:()=>LL,scaleTime:()=>VR,scaleUtc:()=>HR,tickFormat:()=>gL});function iz(e){var t=rz;if(e in t&&typeof t[e]==`function`)return t[e]();var n=`scale${Dw(e)}`;if(n in t&&typeof t[n]==`function`)return t[n]()}function az(e,t,n){if(typeof e==`function`)return e.copy().domain(t).range(n);if(e!=null){var r=iz(e);if(r!=null)return r.domain(t).range(n),r}}function oz(e,t,n,r){if(!(n==null||r==null))return typeof e.scale==`function`?az(e.scale,n,r):az(t,n,r)}function sz(e){return`scale${Dw(e)}`}function cz(e){return sz(e)in rz}var lz=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r===`auto`)return i===`category`&&n&&(n.indexOf(`LineChart`)>=0||n.indexOf(`AreaChart`)>=0||n.indexOf(`ComposedChart`)>=0&&!t)?`point`:i===`category`?`band`:`linear`;if(typeof r==`string`)return cz(r)?r:`point`}};function uz(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function dz(e,t){if(e){var n=t??e.domain(),r=n.map(t=>e(t)??0),i=e.range();if(!(n.length===0||i.length<2))return e=>{var t=uz(r,e);if(t<=0)return n[0];if(t>=n.length)return n[n.length-1];var i=r[t-1]??0,a=r[t]??0;return Math.abs(e-i)<=Math.abs(e-a)?n[t-1]:n[t]}}}function fz(e){if(e!=null)return`invert`in e&&typeof e.invert==`function`?e.invert.bind(e):dz(e,void 0)}var pz=u(IN());function mz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mz(Object(n),!0).forEach(function(t){gz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gz(e,t,n){return(t=_z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _z(e){var t=vz(e,`string`);return typeof t==`symbol`?t:t+``}function vz(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var yz=[0,`auto`],bz={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`bottom`,padding:{left:0,right:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`category`,unit:void 0,niceTicks:`auto`},xz=(e,t)=>e.cartesianAxis.xAxis[t],Sz=(e,t)=>xz(e,t)??bz,Cz={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:yz,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`left`,padding:{top:0,bottom:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`number`,unit:void 0,niceTicks:`auto`,width:60},wz=(e,t)=>e.cartesianAxis.yAxis[t],Tz=(e,t)=>wz(e,t)??Cz,Ez={domain:[0,`auto`],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:``,range:[64,64],scale:`auto`,type:`number`,unit:``},Dz=(e,t)=>e.cartesianAxis.zAxis[t]??Ez,Oz=(e,t,n)=>{switch(t){case`xAxis`:return Sz(e,n);case`yAxis`:return Tz(e,n);case`zAxis`:return Dz(e,n);case`angleAxis`:return DP(e,n);case`radiusAxis`:return OP(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},kz=(e,t,n)=>{switch(t){case`xAxis`:return Sz(e,n);case`yAxis`:return Tz(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},Az=(e,t,n)=>{switch(t){case`xAxis`:return Sz(e,n);case`yAxis`:return Tz(e,n);case`angleAxis`:return DP(e,n);case`radiusAxis`:return OP(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},jz=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function Mz(e,t){return n=>{switch(e){case`xAxis`:return`xAxisId`in n&&n.xAxisId===t;case`yAxis`:return`yAxisId`in n&&n.yAxisId===t;case`zAxis`:return`zAxisId`in n&&n.zAxisId===t;case`angleAxis`:return`angleAxisId`in n&&n.angleAxisId===t;case`radiusAxis`:return`radiusAxisId`in n&&n.radiusAxisId===t;default:return!1}}}var Nz=e=>e.graphicalItems.cartesianItems,Pz=$([IP,LP],Mz),Fz=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0?!0:!e.hide),Iz=$([Nz,Oz,Pz],Fz,{memoizeOptions:{resultEqualityCheck:HP}}),Lz=$([Iz],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(BP)),Rz=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),zz=$([Iz],Rz),Bz=e=>e.map(e=>e.data).filter(Boolean).flat(1),Vz=$([Iz],e=>e.some(e=>!e.data)),Hz=$([Iz],Bz,{memoizeOptions:{resultEqualityCheck:HP}}),Uz=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},Wz=$([Hz,zN],Uz),Gz=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:cO(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:cO(e,t.dataKey)})),Kz=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:s,dataEndIndex:c}=r,l=Gz(e,t,n);return i&&t?.dataKey!=null&&a.length>0?[...o.slice(s,c+1).map(e=>({value:cO(e,t.dataKey)})).filter(e=>e.value!=null),...l]:l},qz=$([Wz,Oz,Iz,zN,Vz,Hz],Kz);function Jz(e){if(yw(e)||e instanceof Date){var t=Number(e);if(tO(t))return t}}function Yz(e){if(Array.isArray(e)){var t=[Jz(e[0]),Jz(e[1])];return WN(t)?t:void 0}var n=Jz(e);if(n!=null)return[n,n]}function Xz(e){return e.map(Jz).filter(Ow)}function Zz(e,t){var n=Jz(e),r=Jz(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Qz=$([qz],e=>e?.map(e=>e.value).sort(Zz));function $z(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}function eB(e,t,n){if(!n||!n.length)return[];var r;if(typeof t==`number`&&!_w(t))r=t;else if(Array.isArray(t)){var i=Xz(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Xz(n.flatMap(t=>{var n=cO(e,t.dataKey),i,a;if(Array.isArray(n)?[i,a]=n:i=a=n,!(!tO(i)||!tO(a)))return[r-i,r+a]}))}var tB=e=>Az(e,WP(e),GP(e)),nB=$([tB],e=>e?.dataKey),rB=$([Lz,zN,tB],zP),iB=(e,t,n,r)=>{var i=t.reduce((e,t)=>{if(t.stackId==null)return e;var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var[i,a]=t,o=r?[...a].reverse():a;return[i,{stackedData:hO(e,o.map(RP),n),graphicalItems:o}]}))},aB=$([rB,Lz,cP,lP],iB),oB=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!==`zAxis`){var o=SO(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},sB=$([Oz],e=>e.allowDataOverflow),cB=e=>{if(e==null||!(`domain`in e))return yz;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=Xz(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??yz},lB=$([Oz],cB),uB=$([lB,sB],KN),dB=$([aB,LN,IP,uB],oB,{memoizeOptions:{resultEqualityCheck:VP}}),fB=e=>e.errorBars,pB=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>$z(n,e)),mB=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},hB=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],o,s;if(n.length>0&&n.forEach(e=>{var n=e.data==null?a:[...e.data],c=r[e.id]?.filter(e=>$z(i,e));n.forEach(n=>{var r=cO(n,t.dataKey??e.dataKey),i=eB(n,r,c);if(i.length>=2){var a=Math.min(...i),l=Math.max(...i);(o==null||a<o)&&(o=a),(s==null||l>s)&&(s=l)}var u=Yz(r);u!=null&&(o=o==null?u[0]:Math.min(o,u[0]),s=s==null?u[1]:Math.max(s,u[1]))})}),t?.dataKey!=null&&n.length===0&&e.forEach(e=>{var n=Yz(cO(e,t.dataKey));n!=null&&(o=o==null?n[0]:Math.min(o,n[0]),s=s==null?n[1]:Math.max(s,n[1]))}),tO(o)&&tO(s))return[o,s]},gB=$([Wz,Oz,zz,fB,IP,VN],hB,{memoizeOptions:{resultEqualityCheck:VP}});function _B(e){var{value:t}=e;if(yw(t)||t instanceof Date)return t}var vB=(e,t,n)=>{var r=e.map(_B).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&Cw(r))?(0,pz.default)(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},yB=e=>e.referenceElements.dots,bB=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),xB=$([yB,IP,LP],bB),SB=e=>e.referenceElements.areas,CB=$([SB,IP,LP],bB),wB=e=>e.referenceElements.lines,TB=$([wB,IP,LP],bB),EB=(e,t)=>{if(e!=null){var n=Xz(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},DB=$(xB,IP,EB),OB=(e,t)=>{if(e!=null){var n=Xz(e.flatMap(e=>[t===`xAxis`?e.x1:e.y1,t===`xAxis`?e.x2:e.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},kB=$([CB,IP],OB);function AB(e){if(e.x!=null)return Xz([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:Xz(t)}function jB(e){if(e.y!=null)return Xz([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:Xz(t)}var MB=(e,t)=>{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?AB(e):jB(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},NB=$(DB,$([TB,IP],MB),kB,(e,t,n)=>mB(e,n,t)),PB=(e,t,n,r,i,a,o,s)=>n??qN(t,o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?mB(r,a,i):mB(a,i),e.allowDataOverflow),FB=$([Oz,lB,uB,dB,gB,NB,Fk,IP],PB,{memoizeOptions:{resultEqualityCheck:VP}}),IB=[0,1],LB=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:s,type:c}=e,l=uO(t,a);return l&&s==null?(0,pz.default)(0,n?.length??0):c===`category`?vB(r,e,l):i===`expand`&&!l?IB:o}},RB=$([Oz,Fk,Wz,qz,cP,IP,FB],LB),zB=$([Oz,jz,uP],lz),BB=(e,t,n)=>{var{niceTicks:r}=t;if(r!==`none`){var i=cB(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&WN(e)){if(a)return nP(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return rP(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&WN(e))return nP(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&WN(e))return rP(e,t.tickCount,t.allowDecimals,`adaptive`)}}},VB=$([RB,Az,zB],BB),HB=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&WN(t)&&Array.isArray(n)&&n.length>0){var i=t[0],a=n[0]??0,o=t[1],s=n[n.length-1]??0;return[Math.min(i,a),Math.max(o,s)]}return t},UB=$([Oz,RB,VB,IP],HB),WB=$($(qz,Oz,(e,t)=>{if(!(!t||t.type!==`number`)){var n=1/0,r=Array.from(Xz(e.map(e=>e.value))).sort((e,t)=>e-t),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var s=0;s<r.length-1;s++){var c=r[s],l=r[s+1];if(!(c==null||l==null)){var u=l-c;n=Math.min(n,u)}}return n/o}}),Fk,oP,JO,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!tO(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=Sw(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),GB=(e,t,n)=>{var r=Sz(e,t);return r==null||typeof r.padding!=`string`?0:WB(e,`xAxis`,t,n,r.padding)},KB=(e,t,n)=>{var r=Tz(e,t);return r==null||typeof r.padding!=`string`?0:WB(e,`yAxis`,t,n,r.padding)},qB=$(Sz,GB,(e,t)=>{if(e==null)return{left:0,right:0};var{padding:n}=e;return typeof n==`string`?{left:t,right:t}:{left:(n.left??0)+t,right:(n.right??0)+t}}),JB=$(Tz,KB,(e,t)=>{if(e==null)return{top:0,bottom:0};var{padding:n}=e;return typeof n==`string`?{top:t,bottom:t}:{top:(n.top??0)+t,bottom:(n.bottom??0)+t}}),YB=$([JO,qB,ek,$O,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),XB=$([JO,Fk,JB,ek,$O,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t===`horizontal`?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),ZB=(e,t,n,r)=>{switch(t){case`xAxis`:return YB(e,n,r);case`yAxis`:return XB(e,n,r);case`zAxis`:return Dz(e,n)?.range;case`angleAxis`:return NP(e);case`radiusAxis`:return PP(e,n);default:return}},QB=$([Oz,ZB],vP),$B=$([Oz,zB,$([zB,UB],qP),QB],oz),eV=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n;if(uO(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},tV=$([Fk,qz,Az,IP],eV),nV=$([$B],KP);$([$B],fz),$([$B,Qz],dz),$([Iz,fB,IP],pB);function rV(e,t){return e.id<t.id?-1:+(e.id>t.id)}var iV=(e,t)=>t,aV=(e,t,n)=>n,oV=$(PO,iV,aV,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(rV)),sV=$(FO,iV,aV,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(rV)),cV=(e,t)=>({width:e.width,height:t.height}),lV=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),uV=$(JO,Sz,cV),dV=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},fV=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},pV=$(jO,JO,oV,iV,aV,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=cV(t,n);o??=dV(t,r,e);var c=r===`top`&&!i||r===`bottom`&&i;a[n.id]=o-Number(c)*s.height,o+=(c?-1:1)*s.height}),a}),mV=$(AO,JO,sV,iV,aV,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=lV(t,n);o??=fV(t,r,e);var c=r===`left`&&!i||r===`right`&&i;a[n.id]=o-Number(c)*s.width,o+=(c?-1:1)*s.width}),a}),hV=$([JO,Sz,(e,t)=>{var n=Sz(e,t);if(n!=null)return pV(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),gV=$([JO,Tz,(e,t)=>{var n=Tz(e,t);if(n!=null)return mV(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),_V=$(JO,Tz,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),vV=(e,t,n)=>{switch(t){case`xAxis`:return uV(e,n).width;case`yAxis`:return _V(e,n).height;default:return}},yV=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,s=uO(e,r),c=t.map(e=>e.value),l=c.filter(e=>e!=null);if(o&&s&&a===`category`&&i&&Cw(l))return c}},bV=$([Fk,qz,Oz,IP],yV),xV=$([Fk,kz,zB,nV,bV,tV,ZB,VB,IP],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=uO(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:l,niceTicks:s,range:o,realScaleType:n,scale:r}}}),SV=$([Fk,Az,zB,nV,VB,ZB,bV,tV,IP],(e,t,n,r,i,a,o,s,c)=>{if(!(t==null||r==null)){var l=uO(e,c),{type:u,ticks:d,tickCount:f}=t,p=n===`scaleBand`&&typeof r.bandwidth==`function`?r.bandwidth()/2:2,m=u===`category`&&r.bandwidth?r.bandwidth()/p:0;m=c===`angleAxis`&&a!=null&&a.length>=2?gw(a[0]-a[1])*2*m:m;var h=d||i;return h?h.map((e,t)=>{var n=o?o.indexOf(e):e,i=r.map(n);return tO(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(Ow):l&&s?s.map((e,t)=>{var n=r.map(e);return tO(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(Ow):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return tO(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(Ow):r.domain().map((e,t)=>{var n=r.map(e);return tO(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(Ow)}}),CV=$([Fk,Az,nV,ZB,bV,tV,IP],(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=uO(e,o),{tickCount:c}=t,l=0;return l=o===`angleAxis`&&r?.length>=2?gw(r[0]-r[1])*2*l:l,s&&a?a.map((e,t)=>{var r=n.map(e);return tO(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(Ow):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return tO(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(Ow):n.domain().map((e,t)=>{var r=n.map(e);return tO(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(Ow)}}),wV=$(Oz,nV,(e,t)=>{if(!(e==null||t==null))return hz(hz({},e),{},{scale:t})});$((e,t,n)=>Dz(e,n),$([$([Oz,zB,RB,QB],oz)],KP),(e,t)=>{if(!(e==null||t==null))return hz(hz({},e),{},{scale:t})});var TV=$([Fk,PO,FO],(e,t,n)=>{switch(e){case`horizontal`:return t.some(e=>e.reversed)?`right-to-left`:`left-to-right`;case`vertical`:return n.some(e=>e.reversed)?`bottom-to-top`:`top-to-bottom`;case`centric`:case`radial`:return`left-to-right`;default:return}});$([(e,t,n)=>e.renderedTicks[t]?.[n]],e=>{if(!(!e||e.length===0))return t=>{var n=1/0,r=e[0];for(var i of e){var a=Math.abs(i.coordinate-t);a<n&&(n=a,r=i)}return r?.value}});var EV=e=>e.options.defaultTooltipEventType,DV=e=>e.options.validateTooltipEventTypes;function OV(e,t,n){if(e==null)return t;var r=e?`axis`:`item`;return n==null?t:n.includes(r)?r:t}function kV(e,t){return OV(t,EV(e),DV(e))}function AV(e){return Q(t=>kV(t,e))}var jV=(e,t)=>{var n,r=Number(t);if(!(_w(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},MV=e=>e.tooltip.settings,NV={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},PV=dD({name:`tooltip`,initialState:{itemInteraction:{click:NV,hover:NV},axisInteraction:{click:NV,hover:NV},keyboardInteraction:NV,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:`hover`,axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(AA(t.payload))},prepare:ZE()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=LE(e).tooltipItemPayloads.indexOf(AA(n));i>-1&&(e.tooltipItemPayloads[i]=AA(r))},prepare:ZE()},removeTooltipEntrySettings:{reducer(e,t){var n=LE(e).tooltipItemPayloads.indexOf(AA(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:ZE()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:FV,replaceTooltipEntrySettings:IV,removeTooltipEntrySettings:LV,setTooltipSettingsState:RV,setActiveMouseOverItemIndex:zV,mouseLeaveItem:BV,mouseLeaveChart:VV,setActiveClickItemIndex:HV,setMouseOverAxisIndex:UV,setMouseClickAxisIndex:WV,setSyncInteraction:GV,setKeyboardInteraction:KV}=PV.actions,qV=PV.reducer;function JV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function YV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?JV(Object(n),!0).forEach(function(t){XV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function XV(e,t,n){return(t=ZV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZV(e){var t=QV(e,`string`);return typeof t==`symbol`?t:t+``}function QV(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function $V(e,t,n){return t===`axis`?n===`click`?e.axisInteraction.click:e.axisInteraction.hover:n===`click`?e.itemInteraction.click:e.itemInteraction.hover}function eH(e){return e.index!=null}var tH=(e,t,n,r)=>{if(t==null)return NV;var i=$V(e,t,n);if(i==null)return NV;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(eH(i)){if(a)return YV(YV({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return YV(YV({},NV),{},{coordinate:i.coordinate})};function nH(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function rH(e,t){var n=nH(e),r=t[0],i=t[1];return n===void 0?!1:n>=Math.min(r,i)&&n<=Math.max(r,i)}function iH(e,t,n){if(n==null||t==null)return!0;var r=cO(e,t);return r==null||!WN(n)?!0:rH(r,n)}var aH=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!tO(a))return i;var o=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(o,Math.min(a,s)),l=t[c];return l==null||iH(l,n,r)?String(c):null},oH=(e,t,n,r,i,a,o)=>{if(a!=null){var s=o[0]?.getPosition(a);if(s!=null)return s;var c=i?.[Number(a)];if(c)switch(n){case`horizontal`:return{x:c.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:c.coordinate}}}},sH=(e,t,n,r)=>{if(t===`axis`)return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i=n===`hover`?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId;if(e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a==null?[]:[a]}return e.tooltipItemPayloads.filter(e=>e.settings?.graphicalItemId===i)},cH=e=>e.options.tooltipPayloadSearcher,lH=e=>e.tooltip;function uH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uH(Object(n),!0).forEach(function(t){fH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fH(e,t,n){return(t=pH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pH(e){var t=mH(e,`string`);return typeof t==`symbol`?t:t+``}function mH(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function hH(e){if(typeof e==`string`||typeof e==`number`)return e}function gH(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e}function _H(e){if(typeof e==`string`||typeof e==`number`)return e;if(typeof e==`function`)return t=>e(t)}function vH(e){if(typeof e==`string`)return e}function yH(e){if(!(typeof e!=`object`||!e))return{name:`name`in e?hH(e.name):void 0,unit:`unit`in e?gH(e.unit):void 0,dataKey:`dataKey`in e?_H(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?vH(e.color):void 0,fill:`fill`in e?vH(e.fill):void 0}}function bH(e,t){return e??t}var xH=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:s,computedData:c,dataStartIndex:l,dataEndIndex:u}=n;return e.reduce((e,n)=>{var{dataDefinedOnItem:d,settings:f}=n,p=bH(d,s),m=Array.isArray(p)?eO(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_=r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?Tw(m,r,i):a(m,t,c,g);return Array.isArray(_)?_.forEach(t=>{var n=yH(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=dH(dH({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push(EO({tooltipEntrySettings:o,dataKey:i,payload:a,value:cO(a,i),name:r==null?void 0:String(r)}))}):e.push(EO({tooltipEntrySettings:f,dataKey:h,payload:_,value:cO(_,h),name:cO(_,g)??f?.name})),e},[])}},SH=$([tB,jz,uP],lz),CH=$([$([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),tB,$([WP,GP],Mz)],Fz,{memoizeOptions:{resultEqualityCheck:HP}}),wH=$([CH],e=>e.filter(BP)),TH=$([CH],Bz,{memoizeOptions:{resultEqualityCheck:HP}}),EH=$([CH],e=>e.some(e=>!e.data)),DH=$([TH,LN],Uz),OH=$([wH,LN,tB],zP),kH=$([DH,tB,CH,LN,EH,TH],Kz),AH=$([tB],cB),jH=$([AH,$([tB],e=>e.allowDataOverflow)],KN),MH=$([$([OH,$([CH],e=>e.filter(BP)),cP,lP],iB),LN,WP,jH],oB),NH=$([DH,tB,$([CH],Rz),fB,WP,UN],hB,{memoizeOptions:{resultEqualityCheck:VP}}),PH=$([$([yB,WP,GP],bB),WP],EB),FH=$([$([SB,WP,GP],bB),WP],OB),IH=$([tB,Fk,DH,kH,cP,WP,$([tB,AH,jH,MH,NH,$([PH,$([$([wB,WP,GP],bB),WP],MB),FH],mB),Fk,WP],PB)],LB),LH=$([tB,IH,$([IH,tB,SH],BB),WP],HB),RH=e=>ZB(e,WP(e),GP(e),!1),zH=$([tB,RH],vP),BH=$([$([tB,SH,LH,zH],oz)],KP),VH=$([Fk,tB,SH,BH,RH,$([Fk,kH,tB,WP],yV),$([Fk,kH,tB,WP],eV),WP],(e,t,n,r,i,a,o,s)=>{if(t){var{type:c}=t,l=uO(e,s);if(r){var u=n===`scaleBand`&&r.bandwidth?r.bandwidth()/2:2,d=c===`category`&&r.bandwidth?r.bandwidth()/u:0;return d=s===`angleAxis`&&i!=null&&i?.length>=2?gw(i[0]-i[1])*2*d:d,l&&o?o.map((e,t)=>{var n=r.map(e);return tO(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(Ow):r.domain().map((e,t)=>{var n=r.map(e);return tO(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(Ow)}}}),HH=$([EV,DV,MV],(e,t,n)=>OV(n.shared,e,t)),UH=e=>e.tooltip.settings.trigger,WH=e=>e.tooltip.settings.defaultIndex,GH=$([lH,HH,UH,WH],tH),KH=$([GH,DH,nB,IH],aH),qH=$([VH,KH],jV),JH=$([GH],e=>{if(e)return e.dataKey}),YH=$([GH],e=>{if(e)return e.graphicalItemId}),XH=$([lH,HH,UH,WH],sH),ZH=$([GH,$([AO,jO,Fk,JO,VH,WH,XH],oH)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),QH=$([GH],e=>e?.active??!1),$H=$([$([XH,KH,LN,nB,qH,cH,HH],xH)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function eU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?eU(Object(n),!0).forEach(function(t){nU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nU(e,t,n){return(t=rU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rU(e){var t=iU(e,`string`);return typeof t==`symbol`?t:t+``}function iU(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var aU=()=>Q(tB),oU=()=>{var e=aU(),t=Q(VH),n=Q(BH);return TO(!e||!n?void 0:tU(tU({},e),{},{scale:n}),t)};function sU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?sU(Object(n),!0).forEach(function(t){lU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lU(e,t,n){return(t=uU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uU(e){var t=dU(e,`string`);return typeof t==`symbol`?t:t+``}function dU(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var fU=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.relativeY};if(e===`vertical`)return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},pU=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`centric`){var a=i.coordinate,{radius:o}=r;return cU(cU(cU({},r),lN(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,{angle:c}=r;return cU(cU(cU({},r),lN(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function mU(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var hU=(e,t,n,r,i)=>{var a=t?.length??0;if(a<=1||e==null)return 0;if(r===`angleAxis`&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=0;o<a;o++){var s=o>0?n[o-1]?.coordinate:n[a-1]?.coordinate,c=n[o]?.coordinate,l=o>=a-1?n[0]?.coordinate:n[o+1]?.coordinate,u=void 0;if(!(s==null||c==null||l==null))if(gw(c-s)!==gw(l-c)){var d=[];if(gw(l-c)===gw(i[1]-i[0])){u=l;var f=c+i[1]-i[0];d[0]=Math.min(f,(f+s)/2),d[1]=Math.max(f,(f+s)/2)}else{u=s;var p=l+i[1]-i[0];d[0]=Math.min(c,(p+c)/2),d[1]=Math.max(c,(p+c)/2)}var m=[Math.min(c,(u+c)/2),Math.max(c,(u+c)/2)];if(e>m[0]&&e<=m[1]||e>=d[0]&&e<=d[1])return n[o]?.index}else{var h=Math.min(s,l),g=Math.max(s,l);if(e>(h+c)/2&&e<=(g+c)/2)return n[o]?.index}}else if(t)for(var _=0;_<a;_++){var v=t[_];if(v!=null){var y=t[_+1],b=t[_-1];if(_===0&&y!=null&&e<=(v.coordinate+y.coordinate)/2||_===a-1&&b!=null&&e>(v.coordinate+b.coordinate)/2||_>0&&_<a-1&&b!=null&&y!=null&&e>(v.coordinate+b.coordinate)/2&&e<=(v.coordinate+y.coordinate)/2)return v.index}}return-1},gU=()=>Q(uP),_U=(e,t)=>t,vU=(e,t,n)=>n,yU=(e,t,n,r)=>r,bU=$(VH,e=>(0,fT.default)(e,e=>e.coordinate)),xU=$([lH,_U,vU,yU],tH),SU=$([xU,DH,nB,IH],aH),CU=(e,t,n)=>{if(t!=null){var r=lH(e);return t===`axis`?n===`hover`?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n===`hover`?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},wU=$([lH,_U,vU,yU],sH),TU=$([AO,jO,Fk,JO,VH,yU,wU],oH),EU=$([xU,TU],(e,t)=>e.coordinate??t),DU=$([VH,SU],jV),OU=$([wU,SU,LN,nB,DU,cH,_U],xH),kU=$([xU,SU],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),AU=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&mU(e,o)){var s=hU(OO(e,t),a,i,n,r),c=fU(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},jU=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var s=hN(e,n);if(s){var c=hU(kO(s,t),o,a,r,i),l=pU(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},MU=(e,t,n,r,i,a,o,s)=>{if(!(!e||!t||!r||!i||!a))return t===`horizontal`||t===`vertical`?AU(e,t,r,i,a,o,s):jU(e,t,n,r,i,a,o)},NU=$(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),PU=$(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(hP));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:UP}});function FU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function IU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?FU(Object(n),!0).forEach(function(t){LU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function LU(e,t,n){return(t=RU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RU(e){var t=zU(e,`string`);return typeof t==`symbol`?t:t+``}function zU(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var BU={zIndexMap:Object.values(hP).reduce((e,t)=>IU(IU({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},VU=new Set(Object.values(hP));function HU(e){return VU.has(e)}var UU=dD({name:`zIndex`,initialState:BU,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:ZE()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!HU(n)&&delete e.zIndexMap[n])},prepare:ZE()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=AA(r):e.zIndexMap[n].element=AA(r):e.zIndexMap[n]={consumers:0,element:i?void 0:AA(r),panoramaElement:i?AA(r):void 0}},prepare:ZE()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:ZE()}}}),{registerZIndexPortal:WU,unregisterZIndexPortal:GU,registerZIndexPortalElement:KU,unregisterZIndexPortalElement:qU}=UU.actions,JU=UU.reducer;function YU(e){var{zIndex:t,children:n}=e,r=zk()&&t!==void 0&&t!==0,i=QO(),a=(0,L.useRef)(void 0),o=(0,L.useRef)(new Set),s=iT(),c=Q(e=>NU(e,t,i));if((0,L.useLayoutEffect)(()=>{if(!r){var e=o.current;e.forEach(e=>{s(GU({zIndex:e}))}),e.clear(),a.current=void 0;return}if(o.current.has(t)||(s(WU({zIndex:t})),o.current.add(t)),c){a.current=c;var n=o.current;n.forEach(e=>{e!==t&&(s(GU({zIndex:e})),n.delete(e))})}},[s,t,r,c]),(0,L.useLayoutEffect)(()=>{var e=o.current;return()=>{e.forEach(e=>{s(GU({zIndex:e}))}),e.clear()}},[s]),!r)return n;var l=c??a.current;return l?(0,rl.createPortal)(n,l):null}function XU(){return XU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},XU.apply(null,arguments)}function ZU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ZU(Object(n),!0).forEach(function(t){$U(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $U(e,t,n){return(t=eW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eW(e){var t=tW(e,`string`);return typeof t==`symbol`?t:t+``}function tW(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function nW(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return(0,L.isValidElement)(t)?(0,L.cloneElement)(t,r):(0,L.createElement)(n,r)}function rW(e){var{coordinate:t,payload:n,index:r,offset:i,tooltipAxisBandSize:a,layout:o,cursor:s,tooltipEventType:c,chartName:l}=e,u=t,d=n,f=r;if(!s||!u||l!==`ScatterChart`&&c!==`axis`)return null;var p,m,h;if(l===`ScatterChart`)p=u,m=Wj,h=hP.cursorLine;else if(l===`BarChart`)p=Gj(o,u,i,a),m=tN,h=hP.cursorRectangle;else if(o===`radial`&&Fw(u)){var{cx:g,cy:_,radius:v,startAngle:y,endAngle:b}=gN(u);p={cx:g,cy:_,startAngle:y,endAngle:b,innerRadius:v,outerRadius:v},m=jN,h=hP.cursorLine}else p={points:MN(o,u,i)},m=Nj,h=hP.cursorLine;var x=typeof s==`object`&&`className`in s?s.className:void 0,S=QU(QU(QU(QU({stroke:`#ccc`,pointerEvents:`none`},i),p),bS(s)),{},{payload:d,payloadIndex:f,className:$u(`recharts-tooltip-cursor`,x)});return L.createElement(YU,{zIndex:e.zIndex??h},L.createElement(nW,{cursor:s,cursorComp:m,cursorProps:S}))}function iW(e){var t=oU(),n=jk(),r=Ik(),i=gU();return t==null||n==null||r==null||i==null?null:L.createElement(rW,XU({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var aW=(0,L.createContext)(null),oW=()=>(0,L.useContext)(aW),sW=u(s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default,cW=new sW,lW=`recharts.syncEvent.tooltip`,uW=`recharts.syncEvent.brush`,dW=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!_w(n))return e[n]}},fW=dD({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),pW=fW.reducer,{createEventEmitter:mW}=fW.actions;function hW(e){return e.tooltip.syncInteraction}var gW=dD({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){if(e.chartData=AA(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:_W,setDataStartEndIndexes:vW,setComputedData:iae}=gW.actions,yW=gW.reducer,bW=[`x`,`y`];function xW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function SW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?xW(Object(n),!0).forEach(function(t){CW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function CW(e,t,n){return(t=wW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wW(e){var t=TW(e,`string`);return typeof t==`symbol`?t:t+``}function TW(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function EW(e,t){if(e==null)return{};var n,r,i=DW(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DW(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function OW(){var e=Q(dP),t=Q(pP),n=iT(),r=Q(fP),i=Q(VH),a=Ik(),o=kk();(0,L.useEffect)(()=>{if(e==null)return kw;var s=(s,c,l)=>{if(t!==l&&e===s){if(c.payload.active===!1){n(GV({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r===`index`){var u;if(o&&c!=null&&(u=c.payload)!=null&&u.coordinate&&c.payload.sourceViewBox){var d=c.payload.coordinate,{x:f,y:p}=d,m=EW(d,bW),{x:h,y:g,width:_,height:v}=c.payload.sourceViewBox,y=SW(SW({},m),{},{x:o.x+(_?(f-h)/_:0)*o.width,y:o.y+(v?(p-g)/v:0)*o.height});n(SW(SW({},c),{},{payload:SW(SW({},c.payload),{},{coordinate:y})}))}else n(c);return}if(i!=null){var b;typeof r==`function`?b=i[r(i,{activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate})]:r===`value`&&(b=i.find(e=>String(e.value)===c.payload.label));var{coordinate:x}=c.payload;if(x==null||o==null){n(GV({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(b==null){n(GV({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:S,y:C}=x,w=Math.min(S,o.x+o.width),T=Math.min(C,o.y+o.height),E={x:a===`horizontal`?b.coordinate:w,y:a===`horizontal`?T:b.coordinate};n(GV({active:c.payload.active,coordinate:E,dataKey:c.payload.dataKey,index:String(b.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId}))}}};return cW.on(lW,s),()=>{cW.off(lW,s)}},[Q(e=>e.rootProps.className),n,t,e,r,i,a,o])}function kW(){var e=Q(dP),t=Q(pP),n=iT();(0,L.useEffect)(()=>{if(e==null)return kw;var r=(r,i,a)=>{t!==a&&e===r&&n(vW(i))};return cW.on(uW,r),()=>{cW.off(uW,r)}},[n,t,e])}function AW(){var e=iT();(0,L.useEffect)(()=>{e(mW())},[e]),OW(),kW()}function jW(e,t,n,r,i,a){var o=Q(n=>CU(n,e,t)),s=Q(YH),c=Q(pP),l=Q(dP),u=Q(fP),d=Q(hW)?.sourceViewBox!=null,f=kk();(0,L.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=GV({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:f,graphicalItemId:s});cW.emit(lW,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,f])}function MW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?MW(Object(n),!0).forEach(function(t){PW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PW(e,t,n){return(t=FW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FW(e){var t=IW(e,`string`);return typeof t==`symbol`?t:t+``}function IW(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function LW(e){return e.dataKey}function RW(e,t){return L.isValidElement(e)?L.cloneElement(e,t):typeof e==`function`?L.createElement(e,t):L.createElement(tj,t)}var zW=[],BW={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:`auto`,itemSorter:`name`,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:` : `,trigger:`hover`,useTranslate3d:!1,wrapperStyle:{}};function VW(e){var t=zw(e,BW),{active:n,allowEscapeViewBox:r,animationDuration:i,animationEasing:a,content:o,filterNull:s,isAnimationActive:c,offset:l,payloadUniqBy:u,position:d,reverseDirection:f,useTranslate3d:p,wrapperStyle:m,cursor:h,shared:g,trigger:_,defaultIndex:v,portal:y,axisId:b}=t,x=iT(),S=typeof v==`number`?String(v):v;(0,L.useEffect)(()=>{x(RV({shared:g,trigger:_,axisId:b,active:n,defaultIndex:S}))},[x,g,_,b,n,S]);var C=kk(),w=vj(),T=AV(g),{activeIndex:E,isActive:D}=Q(e=>kU(e,T,_,S))??{},O=Q(e=>OU(e,T,_,S)),k=Q(e=>DU(e,T,_,S)),A=Q(e=>EU(e,T,_,S)),j=O,M=oW(),N=n??D??!1,[ee,te]=hT([j,N]),P=T===`axis`?k:void 0;jW(T,_,A,P,E,N);var ne=y??M;if(ne==null||C==null||T==null)return null;var re=j??zW;N||(re=zW),s&&re.length&&(re=tT(re.filter(e=>e.value!=null&&(e.hide!==!0||t.includeHidden)),u,LW));var ie=re.length>0,ae=NW(NW({},t),{},{payload:re,label:P,active:N,activeIndex:E,coordinate:A,accessibilityLayer:w}),F=L.createElement(_j,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:c,active:N,coordinate:A,hasPayload:ie,offset:l,position:d,reverseDirection:f,useTranslate3d:p,viewBox:C,wrapperStyle:m,lastBoundingBox:ee,innerRef:te,hasPortalFromProps:!!y},RW(o,ae));return L.createElement(L.Fragment,null,(0,rl.createPortal)(F,ne),N&&L.createElement(iW,{cursor:h,tooltipEventType:T,coordinate:A,payload:re,index:E}))}var HW=e=>null;HW.displayName=`Cell`;function UW(e,t,n){return(t=WW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WW(e){var t=GW(e,`string`);return typeof t==`symbol`?t:t+``}function GW(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var KW=class{constructor(e){UW(this,`cache`,new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};function qW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function JW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qW(Object(n),!0).forEach(function(t){YW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function YW(e,t,n){return(t=XW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XW(e){var t=ZW(e,`string`);return typeof t==`symbol`?t:t+``}function ZW(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var QW=JW({},{cacheSize:2e3,enableCache:!0}),$W=new KW(QW.cacheSize),eG={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},tG=`recharts_measurement_span`;function nG(e,t){return`${e}|${t.fontSize||``}|${t.fontFamily||``}|${t.fontWeight||``}|${t.fontStyle||``}|${t.letterSpacing||``}|${t.textTransform||``}`}var rG=(e,t)=>{try{var n=document.getElementById(tG);n||(n=document.createElement(`span`),n.setAttribute(`id`,tG),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),Object.assign(n.style,eG,t),n.textContent=`${e}`;var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},iG=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||cj.isSsr)return{width:0,height:0};if(!QW.enableCache)return rG(e,t);var n=nG(e,t),r=$W.get(n);if(r)return r;var i=rG(e,t);return $W.set(n,i),i},aG;function oG(e,t,n){return(t=sG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sG(e){var t=cG(e,`string`);return typeof t==`symbol`?t:t+``}function cG(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var lG=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,uG=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,dG=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,fG=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,pG={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},mG=[`cm`,`mm`,`pt`,`pc`,`in`,`Q`,`px`];function hG(e){return mG.includes(e)}var gG=`NaN`;function _G(e,t){return e*pG[t]}var vG=class e{static parse(t){var[,n,r]=fG.exec(t)??[];return n==null?e.NaN:new e(parseFloat(n),r??``)}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,_w(e)&&(this.unit=``),t!==``&&!dG.test(t)&&(this.num=NaN,this.unit=``),hG(t)&&(this.num=_G(e,t),this.unit=`px`)}add(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}subtract(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}multiply(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}toString(){return`${this.num}${this.unit}`}isNaN(){return _w(this.num)}};aG=vG,oG(vG,`NaN`,new aG(NaN,``));function yG(e){if(e==null||e.includes(gG))return gG;for(var t=e;t.includes(`*`)||t.includes(`/`);){var[,n,r,i]=lG.exec(t)??[],a=vG.parse(n??``),o=vG.parse(i??``),s=r===`*`?a.multiply(o):a.divide(o);if(s.isNaN())return gG;t=t.replace(lG,s.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var[,c,l,u]=uG.exec(t)??[],d=vG.parse(c??``),f=vG.parse(u??``),p=l===`+`?d.add(f):d.subtract(f);if(p.isNaN())return gG;t=t.replace(uG,p.toString())}return t}var bG=/\(([^()]*)\)/;function xG(e){for(var t=e,n;(n=bG.exec(t))!=null;){var[,r]=n;t=t.replace(bG,yG(r))}return t}function SG(e){var t=e.replace(/\s+/g,``);return t=xG(t),t=yG(t),t}function CG(e){try{return SG(e)}catch{return gG}}function wG(e){var t=CG(e.slice(5,-1));return t===gG?``:t}var TG=[`x`,`y`,`lineHeight`,`capHeight`,`fill`,`scaleToFit`,`textAnchor`,`verticalAnchor`],EG=[`dx`,`dy`,`angle`,`className`,`breakAll`];function DG(){return DG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DG.apply(null,arguments)}function OG(e,t){if(e==null)return{};var n,r,i=kG(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kG(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var AG=/[ \f\n\r\t\v\u2028\u2029]+/,jG=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];return Ew(t)||(i=n?t.toString().split(``):t.toString().split(AG)),{wordsWithComputedWidth:i.map(e=>({word:e,width:iG(e,r).width})),spaceWidth:n?0:iG(`\xA0`,r).width}}catch{return null}};function MG(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}function NG(e){return Ew(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var PG=(e,t,n,r)=>e.reduce((e,i)=>{var{word:a,width:o}=i,s=e[e.length-1];if(s&&o!=null&&(t==null||r||s.width+o+n<Number(t)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[]),FG=e=>e.reduce((e,t)=>e.width>t.width?e:t),IG=`…`,LG=(e,t,n,r,i,a,o,s)=>{var c=jG({breakAll:n,style:r,children:e.slice(0,t)+IG});if(!c)return[!1,[]];var l=PG(c.wordsWithComputedWidth,a,o,s);return[l.length>i||FG(l).width>Number(a),l]},RG=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:s,breakAll:c}=e,l=Z(a),u=String(o),d=PG(t,r,n,i);if(!l||i||!(d.length>a||FG(d).width>Number(r)))return d;for(var f=0,p=u.length-1,m=0,h;f<=p&&m<=u.length-1;){var g=Math.floor((f+p)/2),[_,v]=LG(u,g-1,c,s,a,r,n,i),[y]=LG(u,g,c,s,a,r,n,i);if(!_&&!y&&(f=g+1),_&&y&&(p=g-1),!_&&y){h=v;break}m++}return h||d},zG=e=>[{words:Ew(e)?[]:e.toString().split(AG),width:void 0}],BG=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!cj.isSsr){var s,c,l=jG({breakAll:a,children:r,style:i});if(l){var{wordsWithComputedWidth:u,spaceWidth:d}=l;s=u,c=d}else return zG(r);return RG({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return zG(r)},VG=`#808080`,HG={angle:0,breakAll:!1,capHeight:`0.71em`,fill:VG,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},UG=(0,L.forwardRef)((e,t)=>{var n=zw(e,HG),{x:r,y:i,lineHeight:a,capHeight:o,fill:s,scaleToFit:c,textAnchor:l,verticalAnchor:u}=n,d=OG(n,TG),f=(0,L.useMemo)(()=>BG({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),{dx:p,dy:m,angle:h,className:g,breakAll:_}=d,v=OG(d,EG);if(!yw(r)||!yw(i)||f.length===0)return null;var y=Number(r)+(Z(p)?p:0),b=Number(i)+(Z(m)?m:0);if(!tO(y)||!tO(b))return null;var x;switch(u){case`start`:x=wG(`calc(${o})`);break;case`middle`:x=wG(`calc(${(f.length-1)/2} * -${a} + (${o} / 2))`);break;default:x=wG(`calc(${f.length-1} * -${a})`);break}var S=[],C=f[0];if(c&&C!=null){var w=C.width,{width:T}=d;S.push(`scale(${Z(T)&&Z(w)?T/w:1})`)}return h&&S.push(`rotate(${h}, ${y}, ${b})`),S.length&&(v.transform=S.join(` `)),L.createElement(`text`,DG({},xS(v),{ref:t,x:y,y:b,className:$u(`recharts-text`,g),textAnchor:l,fill:s.includes(`url`)?VG:s}),f.map((e,t)=>{var n=e.words.join(_?``:` `);return L.createElement(`tspan`,{x:y,dy:t===0?x:a,key:`${n}-${t}`},n)}))});UG.displayName=`Text`;function WG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function GG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?WG(Object(n),!0).forEach(function(t){KG(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WG(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function KG(e,t,n){return(t=qG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qG(e){var t=JG(e,`string`);return typeof t==`symbol`?t:t+``}function JG(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var YG=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i,clamp:a}=e,{x:o,y:s,height:c,upperWidth:l,lowerWidth:u}=Ok(t),d=o,f=o+(l-u)/2,p=(d+f)/2,m=(l+u)/2,h=d+l/2,g=c>=0?1:-1,_=g*r,v=g>0?`end`:`start`,y=g>0?`start`:`end`,b=l>=0?1:-1,x=b*r,S=b>0?`end`:`start`,C=b>0?`start`:`end`,w=i;if(n===`top`){var T={x:d+l/2,y:s-_,horizontalAnchor:`middle`,verticalAnchor:v};return a&&w&&(T.height=Math.max(s-w.y,0),T.width=l),T}if(n===`bottom`){var E={x:f+u/2,y:s+c+_,horizontalAnchor:`middle`,verticalAnchor:y};return a&&w&&(E.height=Math.max(w.y+w.height-(s+c),0),E.width=u),E}if(n===`left`){var D={x:p-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`};return a&&w&&(D.width=Math.max(D.x-w.x,0),D.height=c),D}if(n===`right`){var O={x:p+m+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`};return a&&w&&(O.width=Math.max(w.x+w.width-O.x,0),O.height=c),O}var k=a&&w?{width:m,height:c}:{};return n===`insideLeft`?GG({x:p+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`},k):n===`insideRight`?GG({x:p+m-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`},k):n===`insideTop`?GG({x:d+l/2,y:s+_,horizontalAnchor:`middle`,verticalAnchor:y},k):n===`insideBottom`?GG({x:f+u/2,y:s+c-_,horizontalAnchor:`middle`,verticalAnchor:v},k):n===`insideTopLeft`?GG({x:d+x,y:s+_,horizontalAnchor:C,verticalAnchor:y},k):n===`insideTopRight`?GG({x:d+l-x,y:s+_,horizontalAnchor:S,verticalAnchor:y},k):n===`insideBottomLeft`?GG({x:f+x,y:s+c-_,horizontalAnchor:C,verticalAnchor:v},k):n===`insideBottomRight`?GG({x:f+u-x,y:s+c-_,horizontalAnchor:S,verticalAnchor:v},k):n&&typeof n==`object`&&(Z(n.x)||vw(n.x))&&(Z(n.y)||vw(n.y))?GG({x:o+Sw(n.x,m),y:s+Sw(n.y,c),horizontalAnchor:`end`,verticalAnchor:`end`},k):GG({x:h,y:s+c/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},k)},XG=[`labelRef`],ZG=[`content`];function QG(e,t){if(e==null)return{};var n,r,i=$G(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $G(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function eK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?eK(Object(n),!0).forEach(function(t){nK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nK(e,t,n){return(t=rK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rK(e){var t=iK(e,`string`);return typeof t==`symbol`?t:t+``}function iK(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function aK(){return aK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aK.apply(null,arguments)}var oK=(0,L.createContext)(null),sK=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:s}=e,c=(0,L.useMemo)(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return L.createElement(oK.Provider,{value:c},s)},cK=()=>{var e=(0,L.useContext)(oK),t=kk();return e||(t?Ok(t):void 0)},lK=(0,L.createContext)(null),uK=()=>{var e=(0,L.useContext)(lK),t=Q(FP);return e||t},dK=e=>{var{value:t,formatter:n}=e,r=Ew(e.children)?t:e.children;return typeof n==`function`?n(r):r},fK=e=>e!=null&&typeof e==`function`,pK=(e,t)=>gw(t-e)*Math.min(Math.abs(t-e),360),mK=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:s,cy:c,innerRadius:l,outerRadius:u,startAngle:d,endAngle:f,clockWise:p}=i,m=(l+u)/2,h=pK(d,f),g=h>=0?1:-1,_,v;switch(t){case`insideStart`:_=d+g*a,v=p;break;case`insideEnd`:_=f-g*a,v=!p;break;case`end`:_=f+g*a,v=p;break;default:throw Error(`Unsupported position ${t}`)}v=h<=0?v:!v;var y=lN(s,c,m,_),b=lN(s,c,m,_+(v?1:-1)*359),x=`M${y.x},${y.y}
61
- A${m},${m},0,1,${+!v},
62
- ${b.x},${b.y}`,S=Ew(e.id)?xw(`recharts-radial-line-`):e.id;return L.createElement(`text`,aK({},r,{dominantBaseline:`central`,className:$u(`recharts-radial-bar-label`,o)}),L.createElement(`defs`,null,L.createElement(`path`,{id:S,d:x})),L.createElement(`textPath`,{xlinkHref:`#${S}`},n))},hK=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:s,endAngle:c}=e,l=(s+c)/2;if(n===`outside`){var{x:u,y:d}=lN(r,i,o+t,l);return{x:u,y:d,textAnchor:u>=r?`start`:`end`,verticalAnchor:`middle`}}if(n===`center`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`middle`};if(n===`centerTop`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`start`};if(n===`centerBottom`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`end`};var{x:f,y:p}=lN(r,i,(a+o)/2,l);return{x:f,y:p,textAnchor:`middle`,verticalAnchor:`middle`}},gK=e=>e!=null&&`cx`in e&&Z(e.cx),_K={angle:0,offset:5,zIndex:hP.label,position:`middle`,textBreakAll:!1};function vK(e){if(!gK(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function yK(e){var t=zw(e,_K),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:s,className:c=``,textBreakAll:l,labelRef:u}=t,d=uK(),f=cK(),p=n==null?i===`center`?f:d??f:gK(n)?n:Ok(n),m,h,g=vK(p);if(!p||Ew(a)&&Ew(o)&&!(0,L.isValidElement)(s)&&typeof s!=`function`)return null;var _=tK(tK({},t),{},{viewBox:p});if((0,L.isValidElement)(s)){var{labelRef:v}=_;return(0,L.cloneElement)(s,QG(_,XG))}if(typeof s==`function`){var{content:y}=_;if(m=(0,L.createElement)(s,QG(_,ZG)),(0,L.isValidElement)(m))return m}else m=dK(t);var b=xS(t);if(gK(p)){if(i===`insideStart`||i===`insideEnd`||i===`end`)return mK(t,i,m,b,p);h=hK(p,t.offset,t.position)}else{if(!g)return null;var x=YG({viewBox:g,position:i,offset:t.offset,parentViewBox:gK(r)?void 0:r,clamp:!0});h=tK(tK({x:x.x,y:x.y,textAnchor:x.horizontalAnchor,verticalAnchor:x.verticalAnchor},x.width===void 0?{}:{width:x.width}),x.height===void 0?{}:{height:x.height})}return L.createElement(YU,{zIndex:t.zIndex},L.createElement(UG,aK({ref:u,className:$u(`recharts-label`,c)},b,h,{textAnchor:MG(b.textAnchor)?b.textAnchor:h.textAnchor,breakAll:l}),m))}yK.displayName=`Label`;var bK=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?L.createElement(yK,aK({key:`label-implicit`},r)):yw(e)?L.createElement(yK,aK({key:`label-implicit`,value:e},r)):(0,L.isValidElement)(e)?e.type===yK?(0,L.cloneElement)(e,tK({key:`label-implicit`},r)):L.createElement(yK,aK({key:`label-implicit`,content:e},r)):fK(e)?L.createElement(yK,aK({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?L.createElement(yK,aK({},e,{key:`label-implicit`},r)):null};function xK(e){var{label:t,labelRef:n}=e;return bK(t,cK(),n)||null}var SK=[`valueAccessor`],CK=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function wK(){return wK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wK.apply(null,arguments)}function TK(e,t){if(e==null)return{};var n,r,i=EK(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function EK(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var DK=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(NG(t))return t},OK=(0,L.createContext)(void 0),kK=OK.Provider,AK=(0,L.createContext)(void 0),jK=AK.Provider;function MK(){return(0,L.useContext)(OK)}function NK(){return(0,L.useContext)(AK)}function PK(e){var{valueAccessor:t=DK}=e,n=TK(e,SK),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:s}=n,c=TK(n,CK),l=MK(),u=NK(),d=l||u;return!d||!d.length?null:L.createElement(YU,{zIndex:s??hP.label},L.createElement(MS,{className:`recharts-label-list`},d.map((e,i)=>{var s=Ew(r)?t(e,i):cO(e.payload,r),l=Ew(a)?{}:{id:`${a}-${i}`};return L.createElement(yK,wK({key:`label-${i}`},xS(e),c,l,{fill:n.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:i,zIndex:0}))})))}PK.displayName=`LabelList`;function FK(e){var{label:t}=e;return t?t===!0?L.createElement(PK,{key:`labelList-implicit`}):L.isValidElement(t)||fK(t)?L.createElement(PK,{key:`labelList-implicit`,content:t}):typeof t==`object`?L.createElement(PK,wK({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}function IK(){return IK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IK.apply(null,arguments)}var LK=e=>{var{cx:t,cy:n,r,className:i}=e,a=$u(`recharts-dot`,i);return Z(t)&&Z(n)&&Z(r)?L.createElement(`circle`,IK({},yS(e),Iw(e),{className:a,cx:t,cy:n,r})):null},RK=e=>e.graphicalItems.polarItems,zK=$([RK,Oz,$([IP,LP],Mz)],Fz),BK=$([$([zK],Bz),RN],Uz),VK=$([BK,Oz,zK],Gz);$([BK,Oz,zK],(e,t,n)=>n.length>0?e.flatMap(e=>n.flatMap(n=>({value:cO(e,t.dataKey??n.dataKey),errorDomain:[]}))).filter(Boolean):t?.dataKey==null?e.map(e=>({value:e,errorDomain:[]})):e.map(e=>({value:cO(e,t.dataKey),errorDomain:[]})));var HK=()=>void 0,UK=$([Oz,Fk,BK,VK,cP,IP,$([Oz,lB,uB,HK,$([BK,Oz,zK,fB,IP,HN],hB),HK,Fk,IP],PB)],LB);$([zB,$([Oz,UK,$([UK,Az,zB],BB),IP],HB)],qP);var WK=dD({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=AA(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=AA(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:aae,removeRadiusAxis:oae,addAngleAxis:sae,removeAngleAxis:cae}=WK.actions,GK=WK.reducer;function KK(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}function qK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function JK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qK(Object(n),!0).forEach(function(t){YK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function YK(e,t,n){return(t=XK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XK(e){var t=ZK(e,`string`);return typeof t==`symbol`?t:t+``}function ZK(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var QK=$([RK,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`pie`).find(e=>e.id===t)),$K=[],eq=(e,t,n)=>n?.length===0?$K:n,tq=$([RN,QK,eq],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i=t?.data!=null&&t.data.length>0?t.data:r;if((!i||!i.length)&&n!=null&&(i=n.map(e=>JK(JK({},t.presentationProps),e.props))),i!=null)return i}}),nq=$([tq,QK,eq],(e,t,n)=>{if(!(e==null||t==null))return e.map((e,r)=>{var i,a=cO(e,t.nameKey,t.name),o=n!=null&&(i=n[r])!=null&&(i=i.props)!=null&&i.fill?n[r].props.fill:typeof e==`object`&&e&&`fill`in e?e.fill:t.fill;return{value:DO(a,t.dataKey),color:o,payload:e,type:t.legendType}})}),rq=$([tq,QK,eq,JO],(e,t,n,r)=>{if(!(t==null||e==null))return NJ({offset:r,pieSettings:t,displayedData:e,cells:n})}),iq=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.suspense_list`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.view_transition`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:case p:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:return e;case o:return e;default:return m}}case n:return m}}}e.isFragment=function(e){return m(e)===r}})),aq=s(((e,t)=>{t.exports=iq()}))(),oq=e=>typeof e==`string`?e:e?e.displayName||e.name||`Component`:``,sq=null,cq=null,lq=e=>{if(e===sq&&Array.isArray(cq))return cq;var t=[];return L.Children.forEach(e,e=>{Ew(e)||((0,aq.isFragment)(e)?t=t.concat(lq(e.props.children)):t.push(e))}),cq=t,sq=e,t};function uq(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(e=>oq(e)):[oq(t)],lq(e).forEach(e=>{var t=(0,hw.default)(e,`type.displayName`)||(0,hw.default)(e,`type.name`);t&&r.indexOf(t)!==-1&&n.push(e)}),n}var dq=e=>e&&typeof e==`object`&&`clipDot`in e?!!e.clipDot:!0,fq=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}e.isPlainObject=t})),pq=s(((e,t)=>{t.exports=fq().isPlainObject})),mq,hq,gq,_q,vq;function yq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yq(Object(n),!0).forEach(function(t){xq(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xq(e,t,n){return(t=Sq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sq(e){var t=Cq(e,`string`);return typeof t==`symbol`?t:t+``}function Cq(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wq(){return wq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wq.apply(null,arguments)}function Tq(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Eq=(e,t,n,r,i)=>{var a=n-r,o=mw(mq||=Tq([`M `,`,`,``]),e,t);return o+=mw(hq||=Tq([`L `,`,`,``]),e+n,t),o+=mw(gq||=Tq([`L `,`,`,``]),e+n-a/2,t+i),o+=mw(_q||=Tq([`L `,`,`,``]),e+n-a/2-r,t+i),o+=mw(vq||=Tq([`L `,`,`,` Z`]),e,t),o},Dq={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},Oq=e=>{var t=zw(e,Dq),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:s}=t,{animationEasing:c,animationDuration:l,animationBegin:u,isUpdateAnimationActive:d}=t,f=(0,L.useRef)(null),[p,m]=(0,L.useState)(-1),h=(0,L.useRef)(i),g=(0,L.useRef)(a),_=(0,L.useRef)(o),v=(0,L.useRef)(n),y=(0,L.useRef)(r),b=jM(e,`trapezoid-`);if((0,L.useEffect)(()=>{if(f.current&&f.current.getTotalLength)try{var e=f.current.getTotalLength();e&&m(e)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var x=$u(`recharts-trapezoid`,s);if(!d)return L.createElement(`g`,null,L.createElement(`path`,wq({},xS(t),{className:x,d:Eq(n,r,i,a,o)})));var S=h.current,C=g.current,w=_.current,T=v.current,E=y.current,D=`0px ${p===-1?1:p}px`,O=`${p}px ${p}px`,k=Qj([`strokeDasharray`],l,c);return L.createElement(AM,{animationId:b,key:b,canBegin:p>0,duration:l,easing:c,isActive:d,begin:u},e=>{var s=ww(S,i,e),c=ww(C,a,e),l=ww(w,o,e),u=ww(T,n,e),d=ww(E,r,e);f.current&&(h.current=s,g.current=c,_.current=l,v.current=u,y.current=d);var p=e>0?{transition:k,strokeDasharray:O}:{strokeDasharray:D};return L.createElement(`path`,wq({},xS(t),{className:x,d:Eq(u,d,s,c,l),ref:f,style:bq(bq({},p),t.style)}))})},kq=u(pq()),Aq=[`option`,`shapeType`,`activeClassName`,`inActiveClassName`];function jq(e,t){if(e==null)return{};var n,r,i=Mq(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Mq(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Nq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Nq(Object(n),!0).forEach(function(t){Fq(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Fq(e,t,n){return(t=Iq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iq(e){var t=Lq(e,`string`);return typeof t==`symbol`?t:t+``}function Lq(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Rq(e,t){return Pq(Pq({},t),e)}function zq(e,t){return e===`symbols`}function Bq(e){var{shapeType:t,elementProps:n}=e;switch(t){case`rectangle`:return L.createElement(tN,n);case`trapezoid`:return L.createElement(Oq,n);case`sector`:return L.createElement(jN,n);case`symbols`:if(zq(t,n))return L.createElement(Pw,n);break;case`curve`:return L.createElement(Nj,n);default:return null}}function Vq(e){return(0,L.isValidElement)(e)?e.props:e}function Hq(e){var{option:t,shapeType:n,activeClassName:r=`recharts-active-shape`,inActiveClassName:i=`recharts-shape`}=e,a=jq(e,Aq),o;if((0,L.isValidElement)(t))o=(0,L.cloneElement)(t,Pq(Pq({},a),Vq(t)));else if(typeof t==`function`)o=t(a,a.index);else if((0,kq.default)(t)&&typeof t!=`boolean`){var s=Rq(t,a);o=L.createElement(Bq,{shapeType:n,elementProps:s})}else{var c=a;o=L.createElement(Bq,{shapeType:n,elementProps:c})}return a.isActive?L.createElement(MS,{className:r},o):L.createElement(MS,{className:i},o)}var Uq=(e,t,n)=>{var r=iT();return(i,a)=>o=>{e?.(i,a,o),r(zV({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Wq=e=>{var t=iT();return(n,r)=>i=>{e?.(n,r,i),t(BV())}},Gq=(e,t,n)=>{var r=iT();return(i,a)=>o=>{e?.(i,a,o),r(HV({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function Kq(e){var{tooltipEntrySettings:t}=e,n=iT(),r=QO(),i=(0,L.useRef)(null);return(0,L.useLayoutEffect)(()=>{r||(i.current===null?n(FV(t)):i.current!==t&&n(IV({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,L.useLayoutEffect)(()=>()=>{i.current&&=(n(LV(i.current)),null)},[n]),null}function qq(e){var{legendPayload:t}=e,n=iT(),r=QO(),i=(0,L.useRef)(null);return(0,L.useLayoutEffect)(()=>{r||(i.current===null?n(NA(t)):i.current!==t&&n(PA({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,L.useLayoutEffect)(()=>()=>{i.current&&=(n(FA(i.current)),null)},[n]),null}function Jq(e){var{legendPayload:t}=e,n=iT(),r=Q(Fk),i=(0,L.useRef)(null);return(0,L.useLayoutEffect)(()=>{r!==`centric`&&r!==`radial`||(i.current===null?n(NA(t)):i.current!==t&&n(PA({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,L.useLayoutEffect)(()=>()=>{i.current&&=(n(FA(i.current)),null)},[n]),null}var Yq=L.useId??(()=>{var[e]=L.useState(()=>xw(`uid-`));return e});function Xq(e,t){var n=Yq();return t||(e?`${e}-${n}`:n)}var Zq=(0,L.createContext)(void 0),Qq=e=>{var{id:t,type:n,children:r}=e,i=Xq(`recharts-${n}`,t);return L.createElement(Zq.Provider,{value:i},r(i))},$q=dD({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(AA(t.payload))},prepare:ZE()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=LE(e).cartesianItems.indexOf(AA(n));i>-1&&(e.cartesianItems[i]=AA(r))},prepare:ZE()},removeCartesianGraphicalItem:{reducer(e,t){var n=LE(e).cartesianItems.indexOf(AA(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:ZE()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(AA(t.payload))},prepare:ZE()},removePolarGraphicalItem:{reducer(e,t){var n=LE(e).polarItems.indexOf(AA(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:ZE()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=LE(e).polarItems.indexOf(AA(n));i>-1&&(e.polarItems[i]=AA(r))},prepare:ZE()}}}),{addCartesianGraphicalItem:eJ,replaceCartesianGraphicalItem:tJ,removeCartesianGraphicalItem:nJ,addPolarGraphicalItem:rJ,removePolarGraphicalItem:iJ,replacePolarGraphicalItem:aJ}=$q.actions,oJ=$q.reducer,sJ=(0,L.memo)(e=>{var t=iT(),n=(0,L.useRef)(null);return(0,L.useLayoutEffect)(()=>{n.current===null?t(eJ(e)):n.current!==e&&t(tJ({prev:n.current,next:e})),n.current=e},[t,e]),(0,L.useLayoutEffect)(()=>()=>{n.current&&=(t(nJ(n.current)),null)},[t]),null}),cJ=(0,L.memo)(e=>{var t=iT(),n=(0,L.useRef)(null);return(0,L.useLayoutEffect)(()=>{n.current===null?t(rJ(e)):n.current!==e&&t(aJ({prev:n.current,next:e})),n.current=e},[t,e]),(0,L.useLayoutEffect)(()=>()=>{n.current&&=(t(iJ(n.current)),null)},[t]),null}),lJ=[`key`],uJ=[`onMouseEnter`,`onClick`,`onMouseLeave`],dJ=[`id`],fJ=[`id`];function pJ(){return pJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pJ.apply(null,arguments)}function mJ(e,t){if(e==null)return{};var n,r,i=hJ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function gJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gJ(Object(n),!0).forEach(function(t){vJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vJ(e,t,n){return(t=yJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yJ(e){var t=bJ(e,`string`);return typeof t==`symbol`?t:t+``}function bJ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function xJ(e){var t=(0,L.useMemo)(()=>uq(e.children,HW),[e.children]),n=Q(n=>nq(n,e.id,t));return n==null?null:L.createElement(Jq,{legendPayload:n})}function SJ(e){if(!(e==null||typeof e==`boolean`||typeof e==`function`)){if(L.isValidElement(e)){var t=e.props?.fill;return typeof t==`string`?t:void 0}var{fill:n}=e;return typeof n==`string`?n:void 0}}var CJ=L.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:s,hide:c,tooltipType:l,id:u,activeShape:d}=e,f=SJ(d),p={dataDefinedOnItem:r.map(e=>{var t=e.tooltipPayload;return f==null||t==null?t:t.map(e=>_J(_J({},e),{},{color:f,fill:f}))}),getPosition:e=>r[Number(e)]?.tooltipPosition,settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:DO(s,t),hide:c,type:l,color:o,unit:``,graphicalItemId:u}};return L.createElement(Kq,{tooltipEntrySettings:p})}),wJ=(e,t)=>e>t?`start`:e<t?`end`:`middle`,TJ=(e,t,n)=>Sw(typeof t==`function`?t(e):t,n,n*.8),EJ=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,s=uN(a,o);return{cx:i+Sw(e.cx,a,a/2),cy:r+Sw(e.cy,o,o/2),innerRadius:Sw(e.innerRadius,s,0),outerRadius:TJ(n,e.outerRadius,s),maxRadius:e.maxRadius||Math.sqrt(a*a+o*o)/2}},DJ=(e,t)=>gw(t-e)*Math.min(Math.abs(t-e),360),OJ=(e,t)=>{if(L.isValidElement(e))return L.cloneElement(e,t);if(typeof e==`function`)return e(t);var n=$u(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className),{key:r}=t,i=mJ(t,lJ);return L.createElement(Nj,pJ({},i,{type:`linear`,className:n}))},kJ=(e,t,n)=>{if(L.isValidElement(e))return L.cloneElement(e,t);var r=n;if(typeof e==`function`&&(r=e(t),L.isValidElement(r)))return r;var i=$u(`recharts-pie-label-text`,KK(e));return L.createElement(UG,pJ({},t,{alignmentBaseline:`middle`,className:i}),r)};function AJ(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var s=yS(n),c=bS(i),l=bS(a),u=typeof i==`object`&&`offsetRadius`in i&&typeof i.offsetRadius==`number`&&i.offsetRadius||20,d=t.map((e,t)=>{var n=(e.startAngle+e.endAngle)/2,r=lN(e.cx,e.cy,e.outerRadius+u,n),d=_J(_J(_J(_J({},s),e),{},{stroke:`none`},c),{},{index:t,textAnchor:wJ(r.x,e.cx)},r),f=_J(_J(_J(_J({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:t,points:[lN(e.cx,e.cy,e.outerRadius,n),r],key:`line`});return L.createElement(YU,{zIndex:hP.label,key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${t}`},L.createElement(MS,null,a&&OJ(a,f),kJ(i,d,cO(e,o))))});return L.createElement(MS,{className:`recharts-pie-labels`},d)}function jJ(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i==`object`&&i&&`position`in i?L.createElement(FK,{label:i}):L.createElement(AJ,{sectors:t,props:n,showLabels:r})}function MJ(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,s=Q(KH),c=Q(JH),l=Q(YH),{onMouseEnter:u,onClick:d,onMouseLeave:f}=i,p=mJ(i,uJ),m=Uq(u,i.dataKey,o),h=Wq(f),g=Gq(d,i.dataKey,o);return t==null||t.length===0?null:L.createElement(L.Fragment,null,t.map((e,u)=>{if(e?.startAngle===0&&e?.endAngle===0&&t.length!==1)return null;var d=l==null||l===o,f=String(u)===s&&(c==null||i.dataKey===c)&&d,_=n&&f?n:s?r:null,v=_J(_J({},e),{},{stroke:e.stroke,tabIndex:-1,[IO]:u,[LO]:o});return L.createElement(MS,pJ({key:`sector-${e?.startAngle}-${e?.endAngle}-${e.midAngle}-${u}`,tabIndex:-1,className:`recharts-pie-sector`},Lw(p,e,u),{onMouseEnter:m(e,u),onMouseLeave:h(e,u),onClick:g(e,u)}),L.createElement(Hq,pJ({option:a??_,index:u,shapeType:`sector`,isActive:f},v)))}))}function NJ(e){var{pieSettings:t,displayedData:n,cells:r,offset:i}=e,{cornerRadius:a,startAngle:o,endAngle:s,dataKey:c,nameKey:l,tooltipType:u}=t,d=Math.abs(t.minAngle),f=DJ(o,s),p=Math.abs(f),m=n.length<=1?0:t.paddingAngle??0,h=n.filter(e=>cO(e,c,0)!==0).length,g=(p>=360?h:h-1)*m,_=n.reduce((e,t)=>{var n=cO(t,c,0);return e+(Z(n)?n:0)},0),v=d>0&&_>0&&n.some(e=>{var t=cO(e,c,0),n=(Z(t)?t:0)/_;return t!==0&&n*p<d})?d:0,y=p-h*v-g,b;if(_>0){var x;b=n.map((e,n)=>{var s=cO(e,c,0),d=cO(e,l,n),p=EJ(t,i,e),h=(Z(s)?s:0)/_,g,b=_J(_J({},e),r&&r[n]&&r[n].props),S=b!=null&&`fill`in b&&typeof b.fill==`string`?b.fill:t.fill;g=n?x.endAngle+gw(f)*m*(s===0?0:1):o;var C=g+gw(f)*((s===0?0:v)+h*y),w=(g+C)/2,T=(p.innerRadius+p.outerRadius)/2,E=[{name:d,value:s,payload:b,dataKey:c,type:u,color:S,fill:S,graphicalItemId:t.id}],D=lN(p.cx,p.cy,T,w);return x=_J(_J(_J(_J({},t.presentationProps),{},{percent:h,cornerRadius:typeof a==`string`?parseFloat(a):a,name:d,tooltipPayload:E,midAngle:w,middleRadius:T,tooltipPosition:D},b),p),{},{value:s,dataKey:c,startAngle:g,endAngle:C,payload:b,paddingAngle:s===0?0:gw(f)*m}),x})}return b}function PJ(e){var{showLabels:t,sectors:n,children:r}=e,i=(0,L.useMemo)(()=>!t||!n?[]:n.map(e=>({value:e.value,payload:e.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:e.cx,cy:e.cy,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clockWise:!1},fill:e.fill})),[n,t]);return L.createElement(jK,{value:t?i:void 0},r)}function FJ(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,activeShape:l,inactiveShape:u,onAnimationStart:d,onAnimationEnd:f}=t,p=jM(t,`recharts-pie-`),m=n.current,[h,g]=(0,L.useState)(!1),_=(0,L.useCallback)(()=>{typeof f==`function`&&f(),g(!1)},[f]),v=(0,L.useCallback)(()=>{typeof d==`function`&&d(),g(!0)},[d]);return L.createElement(PJ,{showLabels:!h,sectors:i},L.createElement(AM,{animationId:p,begin:o,duration:s,isActive:a,easing:c,onAnimationStart:v,onAnimationEnd:_,key:p},e=>{var a=[],o=(i&&i[0])?.startAngle??0;return i?.forEach((t,n)=>{var r=m&&m[n],i=n>0?(0,hw.default)(t,`paddingAngle`,0):0;if(r){var s=ww(r.endAngle-r.startAngle,t.endAngle-t.startAngle,e),c=_J(_J({},t),{},{startAngle:o+i,endAngle:o+s+i});a.push(c),o=c.endAngle}else{var{endAngle:l,startAngle:u}=t,d=ww(0,l-u,e),f=_J(_J({},t),{},{startAngle:o+i,endAngle:o+d+i});a.push(f),o=f.endAngle}}),n.current=a,L.createElement(MS,null,L.createElement(MJ,{sectors:a,activeShape:l,inactiveShape:u,allOtherPieProps:t,shape:t.shape,id:r}))}),L.createElement(jJ,{showLabels:!h,sectors:i,props:t}),t.children)}var IJ={animationBegin:400,animationDuration:1500,animationEasing:`ease`,cx:`50%`,cy:`50%`,dataKey:`value`,endAngle:360,fill:`#808080`,hide:!1,innerRadius:0,isAnimationActive:`auto`,label:!1,labelLine:!0,legendType:`rect`,minAngle:0,nameKey:`name`,outerRadius:`80%`,paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:`#fff`,zIndex:hP.area};function LJ(e){var{id:t}=e,n=mJ(e,dJ),{hide:r,className:i,rootTabIndex:a}=e,o=(0,L.useMemo)(()=>uq(e.children,HW),[e.children]),s=Q(e=>rq(e,t,o)),c=(0,L.useRef)(null),l=$u(`recharts-pie`,i);return r||s==null?(c.current=null,L.createElement(MS,{tabIndex:a,className:l})):L.createElement(YU,{zIndex:e.zIndex},L.createElement(CJ,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:s,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),L.createElement(MS,{tabIndex:a,className:l},L.createElement(FJ,{props:_J(_J({},n),{},{sectors:s}),previousSectorsRef:c,id:t})))}function RJ(e){var t=zw(e,IJ),{id:n}=t,r=mJ(t,fJ),i=yS(r);return L.createElement(Qq,{id:n,type:`pie`},e=>L.createElement(L.Fragment,null,L.createElement(cJ,{type:`pie`,id:e,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),L.createElement(xJ,pJ({},r,{id:e})),L.createElement(LJ,pJ({},r,{id:e}))))}var zJ=RJ;zJ.displayName=`Pie`;var BJ=[`points`];function VJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function HJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?VJ(Object(n),!0).forEach(function(t){UJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UJ(e,t,n){return(t=WJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WJ(e){var t=GJ(e,`string`);return typeof t==`symbol`?t:t+``}function GJ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function KJ(){return KJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KJ.apply(null,arguments)}function qJ(e,t){if(e==null)return{};var n,r,i=JJ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function JJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function YJ(e){var{option:t,dotProps:n,className:r}=e;if((0,L.isValidElement)(t))return(0,L.cloneElement)(t,n);if(typeof t==`function`)return t(n);var i=$u(r,typeof t==`boolean`?``:t.className),a=n??{},{points:o}=a,s=qJ(a,BJ);return L.createElement(LK,KJ({},s,{className:i}))}function XJ(e,t){return e==null?!1:t?!0:e.length===1}function ZJ(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:s,clipPathId:c,zIndex:l=hP.scatter}=e;if(!XJ(t,n))return null;var u=dq(n),d=SS(n),f=t.map((e,r)=>{var s=HJ(HJ(HJ({r:3},o),d),{},{index:r,cx:e.x??void 0,cy:e.y??void 0,dataKey:a,value:e.value,payload:e.payload,points:t});return L.createElement(YJ,{key:`dot-${r}`,option:n,dotProps:s,className:i})}),p={};return s&&c!=null&&(p.clipPath=`url(#clipPath-${u?``:`dots-`}${c})`),L.createElement(YU,{zIndex:l},L.createElement(MS,KJ({className:r},p),f))}function QJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?QJ(Object(n),!0).forEach(function(t){eY(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eY(e,t,n){return(t=tY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tY(e){var t=nY(e,`string`);return typeof t==`symbol`?t:t+``}function nY(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var rY=dD({name:`cartesianAxis`,initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=AA(t.payload)},prepare:ZE()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=AA(r))},prepare:ZE()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:ZE()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=AA(t.payload)},prepare:ZE()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=AA(r))},prepare:ZE()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:ZE()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=AA(t.payload)},prepare:ZE()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=AA(r))},prepare:ZE()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:ZE()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a=i.widthHistory||[];if(a.length===3&&a[0]===a[2]&&r===a[1]&&r!==i.width&&Math.abs(r-(a[0]??0))<=1)return;var o=[...a,r].slice(-3);e.yAxis[n]=$J($J({},i),{},{width:r,widthHistory:o})}}}}),{addXAxis:iY,replaceXAxis:aY,removeXAxis:oY,addYAxis:sY,replaceYAxis:cY,removeYAxis:lY,addZAxis:lae,replaceZAxis:uae,removeZAxis:dae,updateYAxisWidth:uY}=rY.actions,dY=rY.reducer,fY=$([$([JO],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),AO,jO],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),pY=()=>Q(fY),mY=()=>Q($H);function hY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hY(Object(n),!0).forEach(function(t){_Y(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _Y(e,t,n){return(t=vY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vY(e){var t=yY(e,`string`);return typeof t==`symbol`?t:t+``}function yY(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var bY=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var s=gY(gY(gY({},{index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),bS(i)),Iw(i)),c=(0,L.isValidElement)(i)?(0,L.cloneElement)(i,s):typeof i==`function`?i(s):L.createElement(LK,s);return L.createElement(MS,{className:`recharts-active-dot`,clipPath:o},c)};function xY(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=hP.activeDot}=e,s=Q(KH),c=mY();if(t==null||c==null)return null;var l=t.find(e=>c.includes(e.payload));return Ew(l)?null:L.createElement(YU,{zIndex:o},L.createElement(bY,{point:l,childIndex:Number(s),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var SY=(e,t,n)=>{var r=n??e;if(!Ew(r))return Sw(r,t,0)},CY=(e,t,n)=>{var r={},i=e.filter(BP),a=e.filter(e=>e.stackId==null),o=i.reduce((e,t)=>{var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},r),s=Object.entries(o).map(e=>{var[r,i]=e;return{stackId:r,dataKeys:i.map(e=>e.dataKey),barSize:SY(t,n,i[0]?.barSize)}}),c=a.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>e!=null),barSize:SY(t,n,e.barSize)}));return[...s,...c]};function wY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function TY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wY(Object(n),!0).forEach(function(t){EY(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function EY(e,t,n){return(t=DY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DY(e){var t=OY(e,`string`);return typeof t==`symbol`?t:t+``}function OY(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function kY(e,t,n,r,i){var a=r.length;if(!(a<1)){var o=Sw(e,n,0,!0),s,c=[];if(tO(r[0]?.barSize)){var l=!1,u=n/a,d=r.reduce((e,t)=>e+(t.barSize||0),0);d+=(a-1)*o,d>=n&&(d-=(a-1)*o,o=0),d>=n&&u>0&&(l=!0,u*=.9,d=a*u);var f={offset:((n-d)/2>>0)-o,size:0};s=r.reduce((e,t)=>{var n={stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:f.offset+f.size+o,size:l?u:t.barSize??0}},r=[...e,n];return f=n.position,r},c)}else{var p=Sw(t,n,0,!0);n-2*p-(a-1)*o<=0&&(o=0);var m=(n-2*p-(a-1)*o)/a;m>1&&(m>>=0);var h=tO(i)?Math.min(m,i):m;s=r.reduce((e,t,n)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:p+(m+o)*n+(m-h)/2,size:h}}],c)}return s}}var AY=(e,t,n,r,i,a,o)=>{var s=Ew(o)?t:o,c=kY(n,r,i===a?a:i,e,s);return i!==a&&c!=null&&(c=c.map(e=>TY(TY({},e),{},{position:TY(TY({},e.position),{},{offset:e.position.offset-i/2})}))),c},jY=(e,t)=>{var n=RP(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(e=>e.key===n)}}}},MY=(e,t)=>{if(!(e==null||t==null)){var n=e.find(e=>e.stackId===t.stackId&&t.dataKey!=null&&e.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function NY(e,t){return e&&typeof e==`object`&&`zIndex`in e&&typeof e.zIndex==`number`&&tO(e.zIndex)?e.zIndex:t}var PY=e=>{var{chartData:t}=e,n=iT(),r=QO();return(0,L.useEffect)(()=>r?()=>{}:(n(_W(t)),()=>{n(_W(void 0))}),[t,n,r]),null},FY={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},IY=dD({name:`brush`,initialState:FY,reducers:{setBrushSettings(e,t){return t.payload==null?FY:t.payload}}}),{setBrushSettings:fae}=IY.actions,LY=IY.reducer;function RY(e){return(e%180+180)%180}var zY=function(e){var{width:t,height:n}=e,r=RY(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r<Math.PI-i?n/Math.sin(r):t/Math.cos(r);return Math.abs(a)},BY=dD({name:`referenceElements`,initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=LE(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=LE(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(AA(t.payload))},removeLine:(e,t)=>{var n=LE(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:pae,removeDot:mae,addArea:hae,removeArea:gae,addLine:_ae,removeLine:vae}=BY.actions,VY=BY.reducer,HY=(0,L.createContext)(void 0),UY=e=>{var{children:t}=e,[n]=(0,L.useState)(`${xw(`recharts`)}-clip`),r=pY();if(r==null)return null;var{x:i,y:a,width:o,height:s}=r;return L.createElement(HY.Provider,{value:n},L.createElement(`defs`,null,L.createElement(`clipPath`,{id:n},L.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)};function WY(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function GY(e,t,n){return zY({width:e.width+t.width,height:e.height+t.height},n)}function KY(e,t,n){var r=n===`width`,{x:i,y:a,width:o,height:s}=e;return t===1?{start:r?i:a,end:r?i+o:a+s}:{start:r?i+o:a+s,end:r?i:a}}function qY(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function JY(e,t){return WY(e,t+1)}function YY(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:s}=t,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:WY(r,l)};var a=c,d,f=()=>(d===void 0&&(d=n(t,a)),d),p=t.coordinate,m=c===0||qY(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function XY(e,t,n,r,i){var a=(r||[]).slice().length;if(a===0)return[];for(var{start:o,end:s}=t,c=1;c<=a;c++){for(var l=(a-1)%c,u=o,d=!0,f=function(){var t=r[m];if(t==null)return 0;var a=m,o,c=()=>(o===void 0&&(o=n(t,a)),o),f=t.coordinate,p=m===l||qY(e,f,c,u,s);if(!p)return d=!1,1;p&&(u=f+e*(c()/2+i))},p,m=l;m<a&&(p=f(),!(p!==0&&p===1));m+=c);if(d){for(var h=[],g=l;g<a;g+=c){var _=r[g];_!=null&&h.push(_)}return h}}return[]}function ZY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ZY(Object(n),!0).forEach(function(t){$Y(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $Y(e,t,n){return(t=eX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eX(e){var t=tX(e,`string`);return typeof t==`symbol`?t:t+``}function tX(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function nX(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:s}=t,{end:c}=t,l=function(t){var r=a[t];if(r==null)return 1;var l=r,u,d=()=>(u===void 0&&(u=n(r,t)),u);if(t===o-1){var f=e*(l.coordinate+e*d()/2-c);a[t]=l=QY(QY({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else a[t]=l=QY(QY({},l),{},{tickCoord:l.coordinate});l.tickCoord!=null&&qY(e,l.tickCoord,d,s,c)&&(c=l.tickCoord-e*(d()/2+i),a[t]=QY(QY({},l),{},{isShow:!0}))},u=o-1;u>=0;u--)if(l(u))continue;return a}function rX(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,{start:c,end:l}=t;if(a){var u=r[s-1];if(u!=null){var d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=QY(QY({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),u.tickCoord!=null&&qY(e,u.tickCoord,()=>d,c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=QY(QY({},u),{},{isShow:!0}))}}for(var p=a?s-1:s,m=function(t){var r=o[t];if(r==null)return 1;var a=r,s,u=()=>(s===void 0&&(s=n(r,t)),s);if(t===0){var d=e*(a.coordinate-e*u()/2-c);o[t]=a=QY(QY({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else o[t]=a=QY(QY({},a),{},{tickCoord:a.coordinate});a.tickCoord!=null&&qY(e,a.tickCoord,u,c,l)&&(c=a.tickCoord+e*(u()/2+i),o[t]=QY(QY({},a),{},{isShow:!0}))},h=0;h<p;h++)if(m(h))continue;return o}function iX(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:s,interval:c,tickFormatter:l,unit:u,angle:d}=e;if(!i||!i.length||!r)return[];if(Z(c)||cj.isSsr)return JY(i,Z(c)?c:0)??[];var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?iG(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=(e,r)=>{var i=typeof l==`function`?l(e.value,r):e.value;return p===`width`?GY(iG(i,{fontSize:t,letterSpacing:n}),m,d):iG(i,{fontSize:t,letterSpacing:n})[p]},g=i[0],_=i[1],v=i.length>=2&&g!=null&&_!=null?gw(_.coordinate-g.coordinate):1,y=KY(a,v,p);return c===`equidistantPreserveStart`?YY(v,y,h,i,o):c===`equidistantPreserveEnd`?XY(v,y,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?rX(v,y,h,i,o,c===`preserveStartEnd`):nX(v,y,h,i,o),f.filter(e=>e.isShow))}var aX=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.width>o&&(o=t.width)}});var s=n?n.getBoundingClientRect().width:0,c=i+a,l=o+c+s+(n?r:0);return Math.round(l)}return 0},oX=dD({name:`renderedTicks`,initialState:{xAxis:{},yAxis:{}},reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=AA(i)},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:sX,removeRenderedTicks:cX}=oX.actions,lX=oX.reducer,uX=[`axisLine`,`width`,`height`,`className`,`hide`,`ticks`,`axisType`,`axisId`];function dX(e,t){if(e==null)return{};var n,r,i=fX(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function pX(){return pX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pX.apply(null,arguments)}function mX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mX(Object(n),!0).forEach(function(t){gX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gX(e,t,n){return(t=_X(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _X(e){var t=vX(e,`string`);return typeof t==`symbol`?t:t+``}function vX(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var yX={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:`bottom`,ticks:[],stroke:`#666`,tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:`preserveEnd`,zIndex:hP.axis};function bX(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:s,otherSvgProps:c}=e;if(!s)return null;var l=hX(hX(hX({},c),yS(s)),{},{fill:`none`});if(a===`top`||a===`bottom`){var u=+(a===`top`&&!o||a===`bottom`&&o);l=hX(hX({},l),{},{x1:t,y1:n+u*i,x2:t+r,y2:n+u*i})}else{var d=+(a===`left`&&!o||a===`right`&&o);l=hX(hX({},l),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return L.createElement(`line`,pX({},l,{className:$u(`recharts-cartesian-axis-line`,(0,hw.default)(s,`className`))}))}function xX(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h=s?-1:1,g=e.tickSize||o,_=Z(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case`top`:l=u=e.coordinate,f=n+ +!s*i,d=f-h*g,m=d-h*c,p=_;break;case`left`:d=f=e.coordinate,u=t+ +!s*r,l=u-h*g,p=l-h*c,m=_;break;case`right`:d=f=e.coordinate,u=t+ +s*r,l=u+h*g,p=l+h*c,m=_;break;default:l=u=e.coordinate,f=n+ +s*i,d=f+h*g,m=d+h*c,p=_;break}return{line:{x1:l,y1:d,x2:u,y2:f},tick:{x:p,y:m}}}function SX(e,t){switch(e){case`left`:return t?`start`:`end`;case`right`:return t?`end`:`start`;default:return`middle`}}function CX(e,t){switch(e){case`left`:case`right`:return`middle`;case`top`:return t?`start`:`end`;default:return t?`end`:`start`}}function wX(e){var{option:t,tickProps:n,value:r}=e,i,a=$u(n.className,`recharts-cartesian-axis-tick-value`);if(L.isValidElement(t))i=L.cloneElement(t,hX(hX({},n),{},{className:a}));else if(typeof t==`function`)i=t(hX(hX({},n),{},{className:a}));else{var o=`recharts-cartesian-axis-tick-value`;typeof t!=`boolean`&&(o=$u(o,KK(t))),i=L.createElement(UG,pX({},n,{className:o}),r)}return i}function TX(e){var{ticks:t,axisType:n,axisId:r}=e,i=iT();return(0,L.useEffect)(()=>r==null||n==null?kw:(i(sX({ticks:t.map(e=>({value:e.value,coordinate:e.coordinate,offset:e.offset,index:e.index})),axisId:r,axisType:n})),()=>{i(cX({axisId:r,axisType:n}))}),[i,t,r,n]),null}var EX=(0,L.forwardRef)((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:s,padding:c,tickTextProps:l,orientation:u,mirror:d,x:f,y:p,width:m,height:h,tickSize:g,tickMargin:_,fontSize:v,letterSpacing:y,getTicksConfig:b,events:x,axisType:S,axisId:C}=e,w=iX(hX(hX({},b),{},{ticks:n}),v,y),T=yS(b),E=bS(r),D=MG(T.textAnchor)?T.textAnchor:SX(u,d),O=CX(u,d),k={};typeof i==`object`&&(k=i);var A=hX(hX({},T),{},{fill:`none`},k),j=w.map(e=>hX({entry:e},xX(e,f,p,m,h,u,g,d,_))),M=j.map(e=>{var{entry:t,line:n}=e;return L.createElement(MS,{className:`recharts-cartesian-axis-tick`,key:`tick-${t.value}-${t.coordinate}-${t.tickCoord}`},i&&L.createElement(`line`,pX({},A,n,{className:$u(`recharts-cartesian-axis-tick-line`,(0,hw.default)(i,`className`))})))}),N=j.map((e,t)=>{var{entry:n,tick:i}=e,u=hX(hX({},hX(hX(hX(hX({verticalAnchor:O},T),{},{textAnchor:D,stroke:`none`,fill:a},i),{},{index:t,payload:n,visibleTicksCount:w.length,tickFormatter:o,padding:c},l),{},{angle:l?.angle??T.angle??0})),E);return L.createElement(MS,pX({className:`recharts-cartesian-axis-tick-label`,key:`tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`},Lw(x,n,t)),r&&L.createElement(wX,{option:r,tickProps:u,value:`${typeof o==`function`?o(n.value,t):n.value}${s||``}`}))});return L.createElement(`g`,{className:`recharts-cartesian-axis-ticks recharts-${S}-ticks`},L.createElement(TX,{ticks:w,axisId:C,axisType:S}),N.length>0&&L.createElement(YU,{zIndex:hP.label},L.createElement(`g`,{className:`recharts-cartesian-axis-tick-labels recharts-${S}-tick-labels`,ref:t},N)),M.length>0&&L.createElement(`g`,{className:`recharts-cartesian-axis-tick-lines recharts-${S}-tick-lines`},M))}),DX=(0,L.forwardRef)((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:s,axisType:c,axisId:l}=e,u=dX(e,uX),[d,f]=(0,L.useState)(``),[p,m]=(0,L.useState)(``),h=(0,L.useRef)(null);(0,L.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>aX({ticks:h.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}));var g=(0,L.useCallback)(e=>{if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`);h.current=t;var n=t[0];if(n){var r=window.getComputedStyle(n),i=r.fontSize,a=r.letterSpacing;(i!==d||a!==p)&&(f(i),m(a))}}},[d,p]);return o||r!=null&&r<=0||i!=null&&i<=0?null:L.createElement(YU,{zIndex:e.zIndex},L.createElement(MS,{className:$u(`recharts-cartesian-axis`,a)},L.createElement(bX,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:yS(e)}),L.createElement(EX,{ref:g,axisType:c,events:u,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:p,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:l}),L.createElement(sK,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},L.createElement(xK,{label:e.label,labelRef:e.labelRef}),e.children)))}),OX=L.forwardRef((e,t)=>{var n=zw(e,yX);return L.createElement(DX,pX({},n,{ref:t}))});OX.displayName=`CartesianAxis`;var kX=[`x1`,`y1`,`x2`,`y2`,`key`],AX=[`offset`],jX=[`xAxisId`,`yAxisId`],MX=[`xAxisId`,`yAxisId`];function NX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?NX(Object(n),!0).forEach(function(t){FX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function FX(e,t,n){return(t=IX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IX(e){var t=LX(e,`string`);return typeof t==`symbol`?t:t+``}function LX(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function RX(){return RX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RX.apply(null,arguments)}function zX(e,t){if(e==null)return{};var n,r,i=BX(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function BX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var VX=e=>{var{fill:t}=e;if(!t||t===`none`)return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:s}=e;return L.createElement(`rect`,{x:r,y:i,ry:s,width:a,height:o,stroke:`none`,fill:t,fillOpacity:n,className:`recharts-cartesian-grid-bg`})};function HX(e){var{option:t,lineItemProps:n}=e,r;if(L.isValidElement(t))r=L.cloneElement(t,n);else if(typeof t==`function`)r=t(n);else{var{x1:i,y1:a,x2:o,y2:s,key:c}=n,l=yS(zX(n,kX))??{},{offset:u}=l,d=zX(l,AX);r=L.createElement(`line`,RX({},d,{x1:i,y1:a,x2:o,y2:s,fill:`none`,key:c}))}return r}function UX(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,s=zX(e,jX),c=i.map((e,i)=>{var a=PX(PX({},s),{},{x1:t,y1:e,x2:t+n,y2:e,key:`line-${i}`,index:i});return L.createElement(HX,{key:`line-${i}`,option:r,lineItemProps:a})});return L.createElement(`g`,{className:`recharts-cartesian-grid-horizontal`},c)}function WX(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,s=zX(e,MX),c=i.map((e,i)=>{var a=PX(PX({},s),{},{x1:e,y1:t,x2:e,y2:t+n,key:`line-${i}`,index:i});return L.createElement(HX,{option:r,lineItemProps:a,key:`line-${i}`})});return L.createElement(`g`,{className:`recharts-cartesian-grid-vertical`},c)}function GX(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:s,horizontal:c=!0}=e;if(!c||!t||!t.length||s==null)return null;var l=s.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,s)=>{var c=l[s+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=s%t.length;return L.createElement(`rect`,{key:`react-${s}`,y:e,x:r,height:u,width:a,stroke:`none`,fill:t[d],fillOpacity:n,className:`recharts-cartesian-grid-bg`})});return L.createElement(`g`,{className:`recharts-cartesian-gridstripes-horizontal`},u)}function KX(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:s,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var l=c.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,t)=>{var c=l[t+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=t%n.length;return L.createElement(`rect`,{key:`react-${t}`,x:e,y:a,width:u,height:s,stroke:`none`,fill:n[d],fillOpacity:r,className:`recharts-cartesian-grid-bg`})});return L.createElement(`g`,{className:`recharts-cartesian-gridstripes-vertical`},u)}var qX=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return dO(iX(PX(PX(PX({},yX),n),{},{ticks:fO(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},JX=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return dO(iX(PX(PX(PX({},yX),n),{},{ticks:fO(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},YX={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:`#ccc`,fill:`none`,verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:hP.grid};function XX(e){var t=Mk(),n=Nk(),r=jk(),i=PX(PX({},zw(e,YX)),{},{x:Z(e.x)?e.x:r.left,y:Z(e.y)?e.y:r.top,width:Z(e.width)?e.width:r.width,height:Z(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:s,y:c,width:l,height:u,syncWithTicks:d,horizontalValues:f,verticalValues:p}=i,m=QO(),h=Q(e=>xV(e,`xAxis`,a,m)),g=Q(e=>xV(e,`yAxis`,o,m));if(!nO(l)||!nO(u)||!Z(s)||!Z(c))return null;var _=i.verticalCoordinatesGenerator||qX,v=i.horizontalCoordinatesGenerator||JX,{horizontalPoints:y,verticalPoints:b}=i;if((!y||!y.length)&&typeof v==`function`){var x=f&&f.length,S=v({yAxis:g?PX(PX({},g),{},{ticks:x?f:g.ticks}):void 0,width:t??l,height:n??u,offset:r},x?!0:d);ok(Array.isArray(S),`horizontalCoordinatesGenerator should return Array but instead it returned [${typeof S}]`),Array.isArray(S)&&(y=S)}if((!b||!b.length)&&typeof _==`function`){var C=p&&p.length,w=_({xAxis:h?PX(PX({},h),{},{ticks:C?p:h.ticks}):void 0,width:t??l,height:n??u,offset:r},C?!0:d);ok(Array.isArray(w),`verticalCoordinatesGenerator should return Array but instead it returned [${typeof w}]`),Array.isArray(w)&&(b=w)}return L.createElement(YU,{zIndex:i.zIndex},L.createElement(`g`,{className:`recharts-cartesian-grid`},L.createElement(VX,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),L.createElement(GX,RX({},i,{horizontalPoints:y})),L.createElement(KX,RX({},i,{verticalPoints:b})),L.createElement(UX,RX({},i,{offset:r,horizontalPoints:y,xAxis:h,yAxis:g})),L.createElement(WX,RX({},i,{offset:r,verticalPoints:b,xAxis:h,yAxis:g}))))}XX.displayName=`CartesianGrid`;var ZX=dD({name:`errorBars`,initialState:{},reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(e=>e.dataKey===r.dataKey&&e.direction===r.direction?i:e))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(e=>e.dataKey!==r.dataKey||e.direction!==r.direction))}}}),{addErrorBar:yae,replaceErrorBar:bae,removeErrorBar:xae}=ZX.actions,QX=ZX.reducer,$X=[`children`];function eZ(e,t){if(e==null)return{};var n,r,i=tZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function tZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var nZ=(0,L.createContext)({data:[],xAxisId:`xAxis-0`,yAxisId:`yAxis-0`,dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0});function rZ(e){var{children:t}=e,n=eZ(e,$X);return L.createElement(nZ.Provider,{value:n},t)}function iZ(e,t){var n=Q(t=>Sz(t,e)),r=Q(e=>Tz(e,t)),i=n?.allowDataOverflow??bz.allowDataOverflow,a=r?.allowDataOverflow??Cz.allowDataOverflow;return{needClip:i||a,needClipX:i,needClipY:a}}function aZ(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=pY(),{needClipX:a,needClipY:o,needClip:s}=iZ(t,n);if(!s||!i)return null;var{x:c,y:l,width:u,height:d}=i;return L.createElement(`clipPath`,{id:`clipPath-${r}`},L.createElement(`rect`,{x:a?c:c-u/2,y:o?l:l-d/2,width:a?u:u*2,height:o?d:d*2}))}var oZ=(e,t,n,r)=>wV(e,`xAxis`,t,r),sZ=(e,t,n,r)=>CV(e,`xAxis`,t,r),cZ=(e,t,n,r)=>wV(e,`yAxis`,n,r),lZ=(e,t,n,r)=>CV(e,`yAxis`,n,r),uZ=$([Fk,oZ,cZ,sZ,lZ],(e,t,n,r,i)=>uO(e,`xAxis`)?TO(t,r,!1):TO(n,i,!1)),dZ=(e,t,n,r,i)=>i;function fZ(e){return e.type===`line`}var pZ=$([Fk,oZ,cZ,sZ,lZ,$([Nz,dZ],(e,t)=>e.filter(fZ).find(e=>e.id===t)),uZ,zN],(e,t,n,r,i,a,o,s)=>{var{chartData:c,dataStartIndex:l,dataEndIndex:u}=s;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var{dataKey:d,data:f}=a,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return VZ({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}});function mZ(e){var t=bS(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),s=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(s)||s<0)&&(s=r),{r:o,strokeWidth:s}}return{r:n,strokeWidth:r}}var hZ=[`id`],gZ=[`type`,`layout`,`connectNulls`,`needClip`,`shape`],_Z=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function vZ(){return vZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vZ.apply(null,arguments)}function yZ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bZ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yZ(Object(n),!0).forEach(function(t){xZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yZ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xZ(e,t,n){return(t=SZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SZ(e){var t=CZ(e,`string`);return typeof t==`symbol`?t:t+``}function CZ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wZ(e,t){if(e==null)return{};var n,r,i=TZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function TZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var EZ=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:DO(n,t),payload:e}]},DZ=L.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:s,unit:c,tooltipType:l,id:u}=e,d={dataDefinedOnItem:n,getPosition:kw,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:DO(o,t),hide:s,type:l,color:r,unit:c,graphicalItemId:u}};return L.createElement(Kq,{tooltipEntrySettings:d})}),OZ=(e,t)=>`${t}px ${e}px`;function kZ(e,t){for(var n=e.length%2==0?e:[...e,0],r=[],i=0;i<t;++i)r.push(...n);return r}var AZ=(e,t,n)=>{var r=n.reduce((e,t)=>e+t,0);if(!r)return OZ(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],s=0,c=0;s<n.length;c+=(l=n[s])??0,++s){var l,u=n[s];if(u!=null&&c+u>a){o=[...n.slice(0,s),a-c];break}}var d=o.length%2==0?[0,t]:[t];return[...kZ(n,i),...o,...d].map(e=>`${e}px`).join(`, `)};function jZ(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:s}=r,c=yS(wZ(r,hZ));return L.createElement(ZJ,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:c,needClip:o,clipPathId:t})}function MZ(e){var{showLabels:t,children:n,points:r}=e,i=(0,L.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return bZ(bZ({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return L.createElement(kK,{value:t?i:void 0},n)}function NZ(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:s,connectNulls:c,needClip:l,shape:u}=a,d=bZ(bZ({},xS(wZ(a,gZ))),{},{fill:`none`,className:`recharts-line-curve`,clipPath:l?`url(#clipPath-${t})`:void 0,points:r,type:o,layout:s,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return L.createElement(L.Fragment,null,r?.length>1&&L.createElement(Hq,vZ({shapeType:`curve`,option:u},d,{pathRef:n})),L.createElement(jZ,{points:r,clipPathId:t,props:a}))}function PZ(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function FZ(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:s,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,animateNewValues:f,width:p,height:m,onAnimationEnd:h,onAnimationStart:g}=n,_=i.current,v=jM(o,`recharts-line-`),y=(0,L.useRef)(v),[b,x]=(0,L.useState)(!1),S=!b,C=(0,L.useCallback)(()=>{typeof h==`function`&&h(),x(!1)},[h]),w=(0,L.useCallback)(()=>{typeof g==`function`&&g(),x(!0)},[g]),T=PZ(r.current),E=(0,L.useRef)(0);y.current!==v&&(E.current=a.current,y.current=v);var D=E.current;return L.createElement(MZ,{points:o,showLabels:S},n.children,L.createElement(AM,{animationId:v,begin:l,duration:u,isActive:c,easing:d,onAnimationEnd:C,onAnimationStart:w,key:v},e=>{var l=ww(D,T+D,e),u=Math.min(l,T),d=c?s?AZ(u,T,`${s}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):OZ(T,u):s==null?void 0:String(s);if(e>0&&T>0&&(i.current=o,a.current=Math.max(a.current,u)),_){var h=_.length/o.length,g=e===1?o:o.map((t,n)=>{var r=Math.floor(n*h);if(_[r]){var i=_[r];return bZ(bZ({},t),{},{x:ww(i.x,t.x,e),y:ww(i.y,t.y,e)})}return f?bZ(bZ({},t),{},{x:ww(p*2,t.x,e),y:ww(m/2,t.y,e)}):bZ(bZ({},t),{},{x:t.x,y:t.y})});return i.current=g,L.createElement(NZ,{props:n,points:g,clipPathId:t,pathRef:r,strokeDasharray:d})}return L.createElement(NZ,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:d})}),L.createElement(FK,{label:n.label}))}function IZ(e){var{clipPathId:t,props:n}=e,r=(0,L.useRef)(null),i=(0,L.useRef)(0),a=(0,L.useRef)(null);return L.createElement(FZ,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var LZ=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:cO(e.payload,t)}),RZ=class extends L.Component{render(){var{hide:e,dot:t,points:n,className:r,xAxisId:i,yAxisId:a,top:o,left:s,width:c,height:l,id:u,needClip:d,zIndex:f}=this.props;if(e)return null;var p=$u(`recharts-line`,r),m=u,{r:h,strokeWidth:g}=mZ(t),_=dq(t),v=h*2+g,y=d?`url(#clipPath-${_?``:`dots-`}${m})`:void 0;return L.createElement(YU,{zIndex:f},L.createElement(MS,{className:p},d&&L.createElement(`defs`,null,L.createElement(aZ,{clipPathId:m,xAxisId:i,yAxisId:a}),!_&&L.createElement(`clipPath`,{id:`clipPath-dots-${m}`},L.createElement(`rect`,{x:s-v/2,y:o-v/2,width:c+v,height:l+v}))),L.createElement(rZ,{xAxisId:i,yAxisId:a,data:n,dataPointFormatter:LZ,errorBarOffset:0},L.createElement(IZ,{props:this.props,clipPathId:m}))),L.createElement(xY,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:y}))}},zZ={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:hP.line,type:`linear`};function BZ(e){var t=zw(e,zZ),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:s,dot:c,hide:l,isAnimationActive:u,label:d,legendType:f,xAxisId:p,yAxisId:m,id:h}=t,g=wZ(t,_Z),{needClip:_}=iZ(p,m),v=pY(),y=Ik(),b=QO(),x=Q(e=>pZ(e,p,m,b,h));if(y!==`horizontal`&&y!==`vertical`||x==null||v==null)return null;var{height:S,width:C,x:w,y:T}=v;return L.createElement(RZ,vZ({},g,{id:h,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:f,xAxisId:p,yAxisId:m,points:x,layout:y,height:S,width:C,left:w,top:T,needClip:_}))}function VZ(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:s,displayedData:c}=e;return c.map((e,c)=>{var l=cO(e,o);if(t===`horizontal`)return{x:_O({axis:n,ticks:i,bandSize:s,entry:e,index:c}),y:(Ew(l)?null:r.scale.map(l))??null,value:l,payload:e};var u=Ew(l)?null:n.scale.map(l),d=_O({axis:r,ticks:a,bandSize:s,entry:e,index:c});return u==null||d==null?null:{x:u,y:d,value:l,payload:e}}).filter(Boolean)}function HZ(e){var t=zw(e,zZ),n=QO();return L.createElement(Qq,{id:t.id,type:`line`},e=>L.createElement(L.Fragment,null,L.createElement(qq,{legendPayload:EZ(t)}),L.createElement(DZ,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),L.createElement(sJ,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),L.createElement(BZ,vZ({},t,{id:e}))))}var UZ=L.memo(HZ,RA);UZ.displayName=`Line`;function WZ(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function GZ(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var KZ=(e,t,n)=>wV(e,`xAxis`,WZ(e,t),n),qZ=(e,t,n)=>CV(e,`xAxis`,WZ(e,t),n),JZ=(e,t,n)=>wV(e,`yAxis`,GZ(e,t),n),YZ=(e,t,n)=>CV(e,`yAxis`,GZ(e,t),n),XZ=$([Fk,KZ,JZ,qZ,YZ],(e,t,n,r,i)=>uO(e,`xAxis`)?TO(t,r,!1):TO(n,i,!1)),ZZ=$([Nz,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),QZ=e=>uO(Fk(e),`xAxis`)?`yAxis`:`xAxis`,$Z=(e,t)=>QZ(e)===`yAxis`?GZ(e,t):WZ(e,t),eQ=$([Fk,KZ,JZ,qZ,YZ,$([ZZ,(e,t,n)=>aB(e,QZ(e),$Z(e,t),n)],(e,t)=>{if(!(e==null||t==null)){var{stackId:n}=e,r=RP(e);if(!(n==null||r==null)){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),BN,XZ,ZZ,mP],(e,t,n,r,i,a,o,s,c,l)=>{var{chartData:u,dataStartIndex:d,dataEndIndex:f}=o;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var{data:p}=c,m=p&&p.length>0?p:u?.slice(d,f+1);if(m!=null)return EQ({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:m,chartBaseValue:l,bandSize:s})}}),tQ=[`id`],nQ=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function rQ(){return rQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rQ.apply(null,arguments)}function iQ(e,t){if(e==null)return{};var n,r,i=aQ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function aQ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function oQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oQ(Object(n),!0).forEach(function(t){cQ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cQ(e,t,n){return(t=lQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lQ(e){var t=uQ(e,`string`);return typeof t==`symbol`?t:t+``}function uQ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function dQ(e,t){return e&&e!==`none`?e:t}var fQ=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:dQ(r,i),value:DO(n,t),payload:e}]},pQ=L.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:s,unit:c,tooltipType:l,id:u}=e,d={dataDefinedOnItem:n,getPosition:kw,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:DO(o,t),hide:s,type:l,color:dQ(r,a),unit:c,graphicalItemId:u}};return L.createElement(Kq,{tooltipEntrySettings:d})});function mQ(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,s=yS(r);return L.createElement(ZJ,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function hQ(e){var{showLabels:t,children:n,points:r}=e,i=r.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return sQ(sQ({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return L.createElement(kK,{value:t?i:void 0},n)}function gQ(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:s,stroke:c,connectNulls:l,isRange:u}=a,{id:d}=a,f=iQ(a,tQ),p=yS(f),m=xS(f);return L.createElement(L.Fragment,null,t?.length>1&&L.createElement(MS,{clipPath:r?`url(#clipPath-${i})`:void 0},L.createElement(Nj,rQ({},m,{id:d,points:t,connectNulls:l,type:s,baseLine:n,layout:o,stroke:`none`,className:`recharts-area-area`})),c!==`none`&&L.createElement(Nj,rQ({},p,{className:`recharts-area-curve`,layout:o,type:s,connectNulls:l,fill:`none`,points:t})),c!==`none`&&u&&Array.isArray(n)&&L.createElement(Nj,rQ({},p,{className:`recharts-area-curve`,layout:o,type:s,connectNulls:l,fill:`none`,points:n}))),L.createElement(mQ,{points:t,props:f,clipPathId:i}))}function _Q(e){var{alpha:t,baseLine:n,points:r,strokeWidth:i}=e,a=r[0]?.y,o=r[r.length-1]?.y;if(!tO(a)||!tO(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return Z(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),Z(c)?L.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function vQ(e){var{alpha:t,baseLine:n,points:r,strokeWidth:i}=e,a=r[0]?.x,o=r[r.length-1]?.x;if(!tO(a)||!tO(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return Z(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),Z(c)?L.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function yQ(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n===`vertical`?L.createElement(_Q,{alpha:t,points:r,baseLine:i,strokeWidth:a}):L.createElement(vQ,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function bQ(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:s,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationStart:f,onAnimationEnd:p}=r,m=jM((0,L.useMemo)(()=>({points:o,baseLine:s}),[o,s]),`recharts-area-`),h=Lk(),[g,_]=(0,L.useState)(!1),v=!g,y=(0,L.useCallback)(()=>{typeof p==`function`&&p(),_(!1)},[p]),b=(0,L.useCallback)(()=>{typeof f==`function`&&f(),_(!0)},[f]);if(h==null)return null;var x=i.current,S=a.current;return L.createElement(hQ,{showLabels:v,points:o},r.children,L.createElement(AM,{animationId:m,begin:l,duration:u,isActive:c,easing:d,onAnimationEnd:y,onAnimationStart:b,key:m},e=>{if(x){var l=x.length/o.length,u=e===1?o:o.map((t,n)=>{var r=Math.floor(n*l);if(x[r]){var i=x[r];return sQ(sQ({},t),{},{x:ww(i.x,t.x,e),y:ww(i.y,t.y,e)})}return t}),d=Z(s)?ww(S,s,e):Ew(s)||_w(s)?ww(S,0,e):s.map((t,n)=>{var r=Math.floor(n*l);if(Array.isArray(S)&&S[r]){var i=S[r];return sQ(sQ({},t),{},{x:ww(i.x,t.x,e),y:ww(i.y,t.y,e)})}return t});return e>0&&(i.current=u,a.current=d),L.createElement(gQ,{points:u,baseLine:d,needClip:t,clipPathId:n,props:r})}return e>0&&(i.current=o,a.current=s),L.createElement(MS,null,c&&L.createElement(`defs`,null,L.createElement(`clipPath`,{id:`animationClipPath-${n}`},L.createElement(yQ,{alpha:e,points:o,baseLine:s,layout:h,strokeWidth:r.strokeWidth}))),L.createElement(MS,{clipPath:`url(#animationClipPath-${n})`},L.createElement(gQ,{points:o,baseLine:s,needClip:t,clipPathId:n,props:r})))}),L.createElement(FK,{label:r.label}))}function xQ(e){var{needClip:t,clipPathId:n,props:r}=e,i=(0,L.useRef)(null),a=(0,L.useRef)();return L.createElement(bQ,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var SQ=class extends L.PureComponent{render(){var{hide:e,dot:t,points:n,className:r,top:i,left:a,needClip:o,xAxisId:s,yAxisId:c,width:l,height:u,id:d,baseLine:f,zIndex:p}=this.props;if(e)return null;var m=$u(`recharts-area`,r),h=d,{r:g,strokeWidth:_}=mZ(t),v=dq(t),y=g*2+_,b=o?`url(#clipPath-${v?``:`dots-`}${h})`:void 0;return L.createElement(YU,{zIndex:p},L.createElement(MS,{className:m},o&&L.createElement(`defs`,null,L.createElement(aZ,{clipPathId:h,xAxisId:s,yAxisId:c}),!v&&L.createElement(`clipPath`,{id:`clipPath-dots-${h}`},L.createElement(`rect`,{x:a-y/2,y:i-y/2,width:l+y,height:u+y}))),L.createElement(xQ,{needClip:o,clipPathId:h,props:this.props})),L.createElement(xY,{points:n,mainColor:dQ(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:b}),this.props.isRange&&Array.isArray(f)&&L.createElement(xY,{points:f,mainColor:dQ(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:b}))}},CQ={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,xAxisId:0,yAxisId:0,zIndex:hP.area};function wQ(e){var{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,connectNulls:a,dot:o,fill:s,fillOpacity:c,hide:l,isAnimationActive:u,legendType:d,stroke:f,xAxisId:p,yAxisId:m}=e,h=iQ(e,nQ),g=Ik(),_=gU(),{needClip:v}=iZ(p,m),y=QO(),{points:b,isRange:x,baseLine:S}=Q(t=>eQ(t,e.id,y))??{},C=pY();if(g!==`horizontal`&&g!==`vertical`||C==null||_!==`AreaChart`&&_!==`ComposedChart`)return null;var{height:w,width:T,x:E,y:D}=C;return!b||!b.length?null:L.createElement(SQ,rQ({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:S,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:w,hide:l,layout:g,isAnimationActive:u,isRange:x,legendType:d,needClip:v,points:b,stroke:f,width:T,left:E,top:D,xAxisId:p,yAxisId:m}))}var TQ=(e,t,n,r,i)=>{var a=n??t;if(Z(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function EQ(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:s,yAxis:c,displayedData:l,dataStartIndex:u,xAxisTicks:d,yAxisTicks:f,bandSize:p}=e,m=i&&i.length,h=TQ(a,o,n,s,c),g=a===`horizontal`,_=!1,v=l.map((e,n)=>{var a;if(m)a=i[u+n];else{var o=cO(e,r);Array.isArray(o)?(a=o,_=!0):a=[h,o]}var l=a?.[1]??null,v=l==null||m&&!t&&cO(e,r)==null;return g?{x:_O({axis:s,ticks:d,bandSize:p,entry:e,index:n}),y:v?null:c.scale.map(l)??null,value:a,payload:e}:{x:v?null:s.scale.map(l)??null,y:_O({axis:c,ticks:f,bandSize:p,entry:e,index:n}),value:a,payload:e}});return{points:v,baseLine:(m||_?v.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return g?{x:e.x,y:t!=null&&e.y!=null?c.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:s.scale.map(t)??null,y:e.y,payload:e.payload}}):g?c.scale.map(h):s.scale.map(h))??0,isRange:_}}function DQ(e){var t=zw(e,CQ),n=QO();return L.createElement(Qq,{id:t.id,type:`area`},e=>L.createElement(L.Fragment,null,L.createElement(qq,{legendPayload:fQ(t)}),L.createElement(pQ,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),L.createElement(sJ,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:gO(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),L.createElement(wQ,rQ({},t,{id:e}))))}var OQ=L.memo(DQ,RA);OQ.displayName=`Area`;var kQ=!0,AQ=`Invariant failed`;function jQ(e,t){if(!e){if(kQ)throw Error(AQ);var n=typeof t==`function`?t():t,r=n?`${AQ}: ${n}`:AQ;throw Error(r)}}function MQ(){return MQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MQ.apply(null,arguments)}function NQ(e){return L.createElement(Hq,MQ({shapeType:`rectangle`,activeClassName:`recharts-active-bar`,inActiveClassName:`recharts-inactive-bar`},e))}var PQ=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,r)=>{if(Z(e))return e;var i=Z(n)||Ew(n);return i?e(n,r):(!i&&jQ(!1,`minPointSize callback function received a value with type of ${typeof n}. Currently only numbers or null/undefined are supported.`),t)}},FQ=(e,t,n)=>n,IQ=$([Nz,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`bar`).find(e=>e.id===t)),LQ=$([IQ],e=>e?.maxBarSize),RQ=(e,t,n,r)=>r,zQ=$([Fk,Nz,WZ,GZ,FQ],(e,t,n,r,i)=>t.filter(t=>e===`horizontal`?t.xAxisId===n:t.yAxisId===r).filter(e=>e.isPanorama===i).filter(e=>e.hide===!1).filter(e=>e.type===`bar`)),BQ=(e,t,n)=>{var r=Fk(e),i=WZ(e,t),a=GZ(e,t);if(!(i==null||a==null))return r===`horizontal`?aB(e,`yAxis`,a,n):aB(e,`xAxis`,i,n)},VQ=$([zQ,sP,(e,t)=>{var n=Fk(e),r=WZ(e,t),i=GZ(e,t);if(!(r==null||i==null))return n===`horizontal`?vV(e,`xAxis`,r):vV(e,`yAxis`,i)}],CY),HQ=(e,t,n)=>{var r=IQ(e,t);if(r==null)return 0;var i=WZ(e,t),a=GZ(e,t);if(i==null||a==null)return 0;var o=Fk(e),s=iP(e),{maxBarSize:c}=r,l=Ew(c)?s:c,u,d;return o===`horizontal`?(u=wV(e,`xAxis`,i,n),d=CV(e,`xAxis`,i,n)):(u=wV(e,`yAxis`,a,n),d=CV(e,`yAxis`,a,n)),TO(u,d,!0)??l??0},UQ=(e,t,n)=>{var r=Fk(e),i=WZ(e,t),a=GZ(e,t);if(!(i==null||a==null)){var o,s;return r===`horizontal`?(o=wV(e,`xAxis`,i,n),s=CV(e,`xAxis`,i,n)):(o=wV(e,`yAxis`,a,n),s=CV(e,`yAxis`,a,n)),TO(o,s)}},WQ=$([JO,XO,(e,t,n)=>{var r=WZ(e,t);if(r!=null)return wV(e,`xAxis`,r,n)},(e,t,n)=>{var r=GZ(e,t);if(r!=null)return wV(e,`yAxis`,r,n)},(e,t,n)=>{var r=WZ(e,t);if(r!=null)return CV(e,`xAxis`,r,n)},(e,t,n)=>{var r=GZ(e,t);if(r!=null)return CV(e,`yAxis`,r,n)},$([$([VQ,iP,aP,oP,HQ,UQ,LQ],AY),IQ],MY),Fk,BN,UQ,$([BQ,IQ],jY),IQ,RQ],(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:h}=c;if(!(d==null||o==null||t==null||s!==`horizontal`&&s!==`vertical`||n==null||r==null||i==null||a==null||l==null)){var{data:g}=d,_=g!=null&&g.length>0?g:p?.slice(m,h+1);if(_!=null)return E$({layout:s,barSettings:d,pos:o,parentViewBox:t,bandSize:l,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:u,displayedData:_,offset:e,cells:f,dataStartIndex:m})}}),GQ=[`index`];function KQ(){return KQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KQ.apply(null,arguments)}function qQ(e,t){if(e==null)return{};var n,r,i=JQ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function JQ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var YQ=(0,L.createContext)(void 0),XQ=e=>{var t=(0,L.useContext)(YQ);if(t!=null)return t.stackId;if(e!=null)return gO(e)},ZQ=(e,t)=>`recharts-bar-stack-clip-path-${e}-${t}`,QQ=e=>{var t=(0,L.useContext)(YQ);if(t!=null){var{stackId:n}=t;return`url(#${ZQ(n,e)})`}},$Q=e=>{var{index:t}=e,n=qQ(e,GQ),r=QQ(t);return L.createElement(MS,KQ({className:`recharts-bar-stack-layer`,clipPath:r},n))},e$=[`onMouseEnter`,`onMouseLeave`,`onClick`],t$=[`value`,`background`,`tooltipPosition`],n$=[`id`],r$=[`onMouseEnter`,`onClick`,`onMouseLeave`];function i$(){return i$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i$.apply(null,arguments)}function a$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?a$(Object(n),!0).forEach(function(t){s$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function s$(e,t,n){return(t=c$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c$(e){var t=l$(e,`string`);return typeof t==`symbol`?t:t+``}function l$(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function u$(e,t){if(e==null)return{};var n,r,i=d$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d$(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var f$=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:DO(n,t),payload:e}]},p$=L.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:s,tooltipType:c,id:l}=e,u={dataDefinedOnItem:void 0,getPosition:kw,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:DO(a,t),hide:o,type:c,color:i,unit:s,graphicalItemId:l}};return L.createElement(Kq,{tooltipEntrySettings:u})});function m$(e){var t=Q(KH),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:s,onClick:c}=a,l=u$(a,e$),u=Uq(o,r,a.id),d=Wq(s),f=Gq(c,r,a.id);if(!i||n==null)return null;var p=bS(i);return L.createElement(YU,{zIndex:NY(i,hP.barBackground)},n.map((e,n)=>{var{value:a,background:o,tooltipPosition:s}=e,c=u$(e,t$);if(!o)return null;var m=u(e,n),h=d(e,n),g=f(e,n),_=o$(o$(o$(o$(o$({option:i,isActive:String(n)===t},c),{},{fill:`#eee`},o),p),Lw(l,e,n)),{},{onMouseEnter:m,onMouseLeave:h,onClick:g,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return L.createElement(NQ,i$({key:`background-bar-${n}`},_))}))}function h$(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(e=>{var t={x:e.x,y:e.y,width:e.width,lowerWidth:e.width,upperWidth:e.width,height:e.height};return o$(o$({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return L.createElement(kK,{value:t?i:void 0},n)}function g$(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,s=Q(KH),c=Q(JH),l=n&&String(i.originalDataIndex)===s&&(c==null||o===c),[u,d]=(0,L.useState)(!1),[f,p]=(0,L.useState)(!1);(0,L.useEffect)(()=>{var e;return l?(d(!0),e=requestAnimationFrame(()=>{p(!0)})):p(!1),()=>{cancelAnimationFrame(e)}},[l]);var m=(0,L.useCallback)(()=>{l||d(!1)},[l]),h=l&&f,g=l||u,_=l?n===!0?t:n:t,v=L.createElement(NQ,i$({},r,{name:String(r.name)},i,{isActive:h,option:_,index:a,dataKey:o,onTransitionEnd:m}));return g?L.createElement(YU,{zIndex:hP.activeBar},L.createElement($Q,{index:i.originalDataIndex},v)):v}function _$(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return L.createElement(NQ,i$({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function v$(e){var{data:t,props:n}=e,r=yS(n)??{},{id:i}=r,a=u$(r,n$),{shape:o,dataKey:s,activeBar:c}=n,{onMouseEnter:l,onClick:u,onMouseLeave:d}=n,f=u$(n,r$),p=Uq(l,s,i),m=Wq(d),h=Gq(u,s,i);return t?L.createElement(L.Fragment,null,t.map((e,t)=>L.createElement($Q,i$({index:e.originalDataIndex,key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${t}`,className:`recharts-bar-rectangle`},Lw(f,e,t),{onMouseEnter:p(e,t),onMouseLeave:m(e,t),onClick:h(e,t)}),c?L.createElement(g$,{shape:o,activeBar:c,baseProps:a,entry:e,index:t,dataKey:s}):L.createElement(_$,{shape:o,baseProps:a,entry:e,index:t,dataKey:s})))):null}function y$(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,onAnimationEnd:l,onAnimationStart:u}=t,d=n.current,f=jM(t,`recharts-bar-`),[p,m]=(0,L.useState)(!1),h=!p,g=(0,L.useCallback)(()=>{typeof l==`function`&&l(),m(!1)},[l]),_=(0,L.useCallback)(()=>{typeof u==`function`&&u(),m(!0)},[u]);return L.createElement(h$,{showLabels:h,rects:r},L.createElement(AM,{animationId:f,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:g,onAnimationStart:_,key:f},e=>{var a=e===1?r:r?.map((t,n)=>{var r=d&&d[n];if(r)return o$(o$({},t),{},{x:ww(r.x,t.x,e),y:ww(r.y,t.y,e),width:ww(r.width,t.width,e),height:ww(r.height,t.height,e)});if(i===`horizontal`){var a=ww(0,t.height,e),o=ww(t.stackedBarStart,t.y,e);return o$(o$({},t),{},{y:o,height:a})}var s=ww(0,t.width,e),c=ww(t.stackedBarStart,t.x,e);return o$(o$({},t),{},{width:s,x:c})});return e>0&&(n.current=a??null),a==null?null:L.createElement(MS,null,L.createElement(v$,{props:t,data:a}))}),L.createElement(FK,{label:t.label}),t.children)}function b$(e){var t=(0,L.useRef)(null);return L.createElement(y$,{previousRectanglesRef:t,props:e})}var x$=0,S$=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:cO(e,t)}},C$=class extends L.PureComponent{render(){var{hide:e,data:t,dataKey:n,className:r,xAxisId:i,yAxisId:a,needClip:o,background:s,id:c}=this.props;if(e||t==null)return null;var l=$u(`recharts-bar`,r),u=c;return L.createElement(MS,{className:l,id:c},o&&L.createElement(`defs`,null,L.createElement(aZ,{clipPathId:u,xAxisId:i,yAxisId:a})),L.createElement(MS,{className:`recharts-bar-rectangles`,clipPath:o?`url(#clipPath-${u})`:void 0},L.createElement(m$,{data:t,dataKey:n,background:s,allOtherBarProps:this.props}),L.createElement(b$,this.props)))}},w$={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:`ease`,background:!1,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`rect`,minPointSize:x$,xAxisId:0,yAxisId:0,zIndex:hP.bar};function T$(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u}=e,{needClip:d}=iZ(t,n),f=Ik(),p=QO(),m=uq(e.children,HW),h=Q(t=>WQ(t,e.id,p,m));if(f!==`vertical`&&f!==`horizontal`)return null;var g,_=h?.[0];return g=_==null||_.height==null||_.width==null?0:f===`vertical`?_.height/2:_.width/2,L.createElement(rZ,{xAxisId:t,yAxisId:n,data:h,dataPointFormatter:S$,errorBarOffset:g},L.createElement(C$,i$({},e,{layout:f,needClip:d,data:h,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u})))}function E$(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:s,yAxis:c,xAxisTicks:l,yAxisTicks:u,stackedData:d,displayedData:f,offset:p,cells:m,parentViewBox:h,dataStartIndex:g}=e,_=t===`horizontal`?c:s,v=d?_.scale.domain():null,y=yO({numericAxis:_}),b=_.scale.map(y);return f.map((e,f)=>{var _,x,S,C,w,T;if(d){var E=d[f+g];if(E==null)return null;_=pO(E,v)}else _=cO(e,n),Array.isArray(_)||(_=[y,_]);var D=PQ(r,x$)(_[1],f);if(t===`horizontal`){var O=c.scale.map(_[0]),k=c.scale.map(_[1]);if(O==null||k==null)return null;x=vO({axis:s,ticks:l,bandSize:o,offset:a.offset,entry:e,index:f}),S=k??O??void 0,C=a.size;var A=O-k;if(w=_w(A)?0:A,T={x,y:p.top,width:C,height:p.height},Math.abs(D)>0&&Math.abs(w)<Math.abs(D)){var j=gw(w||D)*(Math.abs(D)-Math.abs(w));S-=j,w+=j}}else{var M=s.scale.map(_[0]),N=s.scale.map(_[1]);if(M==null||N==null)return null;if(x=M,S=vO({axis:c,ticks:u,bandSize:o,offset:a.offset,entry:e,index:f}),C=N-M,w=a.size,T={x:p.left,y:S,width:p.width,height:w},Math.abs(D)>0&&Math.abs(C)<Math.abs(D)){var ee=gw(C||D)*(Math.abs(D)-Math.abs(C));C+=ee}}return x==null||S==null||C==null||w==null||!i&&(C===0||w===0)?null:o$(o$({},e),{},{stackedBarStart:b,x,y:S,width:C,height:w,value:d?_:_[1],payload:e,background:T,tooltipPosition:{x:x+C/2,y:S+w/2},parentViewBox:h,originalDataIndex:f},m&&m[f]&&m[f].props)}).filter(Boolean)}function D$(e){var t=zw(e,w$),n=XQ(t.stackId),r=QO();return L.createElement(Qq,{id:t.id,type:`bar`},e=>L.createElement(L.Fragment,null,L.createElement(qq,{legendPayload:f$(t)}),L.createElement(p$,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),L.createElement(sJ,{type:`bar`,id:e,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),L.createElement(YU,{zIndex:t.zIndex},L.createElement(T$,i$({},t,{id:e})))))}var O$=L.memo(D$,RA);O$.displayName=`Bar`;var k$=[`domain`,`range`],A$=[`domain`,`range`];function j$(e,t){if(e==null)return{};var n,r,i=M$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function M$(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function N$(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function P$(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=j$(e,k$),{domain:a,range:o}=t,s=j$(t,A$);return!N$(n,a)||!N$(r,o)?!1:RA(i,s)}var F$=[`type`],I$=[`dangerouslySetInnerHTML`,`ticks`,`scale`],L$=[`id`,`scale`];function R$(){return R$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R$.apply(null,arguments)}function z$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?z$(Object(n),!0).forEach(function(t){V$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V$(e,t,n){return(t=H$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H$(e){var t=U$(e,`string`);return typeof t==`symbol`?t:t+``}function U$(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function W$(e,t){if(e==null)return{};var n,r,i=G$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function G$(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function K$(e){var t=iT(),n=(0,L.useRef)(null),r=Lk(),{type:i}=e,a=W$(e,F$),o=yP(r,`xAxis`,i),s=(0,L.useMemo)(()=>{if(o!=null)return B$(B$({},a),{},{type:o})},[a,o]);return(0,L.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(iY(s)):n.current!==s&&t(aY({prev:n.current,next:s})),n.current=s)},[s,t]),(0,L.useLayoutEffect)(()=>()=>{n.current&&=(t(oY(n.current)),null)},[t]),null}var q$=e=>{var{xAxisId:t,className:n}=e,r=Q(XO),i=QO(),a=`xAxis`,o=Q(e=>SV(e,a,t,i)),s=Q(e=>uV(e,t)),c=Q(e=>hV(e,t)),l=Q(e=>xz(e,t));if(s==null||c==null||l==null)return null;var{dangerouslySetInnerHTML:u,ticks:d,scale:f}=e,p=W$(e,I$),{id:m,scale:h}=l,g=W$(l,L$);return L.createElement(OX,R$({},p,g,{x:c.x,y:c.y,width:s.width,height:s.height,className:$u(`recharts-${a} ${a}`,n),viewBox:r,ticks:o,axisType:a,axisId:t}))},J$={allowDataOverflow:bz.allowDataOverflow,allowDecimals:bz.allowDecimals,allowDuplicatedCategory:bz.allowDuplicatedCategory,angle:bz.angle,axisLine:yX.axisLine,height:bz.height,hide:!1,includeHidden:bz.includeHidden,interval:bz.interval,label:!1,minTickGap:bz.minTickGap,mirror:bz.mirror,orientation:bz.orientation,padding:bz.padding,reversed:bz.reversed,scale:bz.scale,tick:bz.tick,tickCount:bz.tickCount,tickLine:yX.tickLine,tickSize:yX.tickSize,type:bz.type,niceTicks:bz.niceTicks,xAxisId:0},Y$=L.memo(e=>{var t=zw(e,J$);return L.createElement(L.Fragment,null,L.createElement(K$,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),L.createElement(q$,t))},P$);Y$.displayName=`XAxis`;var X$=[`type`],Z$=[`dangerouslySetInnerHTML`,`ticks`,`scale`],Q$=[`id`,`scale`];function $$(){return $$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$$.apply(null,arguments)}function e1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function t1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?e1(Object(n),!0).forEach(function(t){n1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function n1(e,t,n){return(t=r1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r1(e){var t=i1(e,`string`);return typeof t==`symbol`?t:t+``}function i1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function a1(e,t){if(e==null)return{};var n,r,i=o1(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function o1(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function s1(e){var t=iT(),n=(0,L.useRef)(null),r=Lk(),{type:i}=e,a=a1(e,X$),o=yP(r,`yAxis`,i),s=(0,L.useMemo)(()=>{if(o!=null)return t1(t1({},a),{},{type:o})},[o,a]);return(0,L.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(sY(s)):n.current!==s&&t(cY({prev:n.current,next:s})),n.current=s)},[s,t]),(0,L.useLayoutEffect)(()=>()=>{n.current&&=(t(lY(n.current)),null)},[t]),null}function c1(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=(0,L.useRef)(null),o=(0,L.useRef)(null),s=Q(XO),c=QO(),l=iT(),u=`yAxis`,d=Q(e=>_V(e,t)),f=Q(e=>gV(e,t)),p=Q(e=>SV(e,u,t,c)),m=Q(e=>wz(e,t));if((0,L.useLayoutEffect)(()=>{if(!(r!==`auto`||!d||fK(i)||(0,L.isValidElement)(i)||m==null)){var e=a.current;if(e){var n=e.getCalculatedWidth();Math.round(d.width)!==Math.round(n)&&l(uY({id:t,width:n}))}}},[p,d,l,i,t,r,m]),d==null||f==null||m==null)return null;var{dangerouslySetInnerHTML:h,ticks:g,scale:_}=e,v=a1(e,Z$),{id:y,scale:b}=m,x=a1(m,Q$);return L.createElement(OX,$$({},v,x,{ref:a,labelRef:o,x:f.x,y:f.y,tickTextProps:r===`auto`?{width:void 0}:{width:r},width:d.width,height:d.height,className:$u(`recharts-${u} ${u}`,n),viewBox:s,ticks:p,axisType:u,axisId:t}))}var l1={allowDataOverflow:Cz.allowDataOverflow,allowDecimals:Cz.allowDecimals,allowDuplicatedCategory:Cz.allowDuplicatedCategory,angle:Cz.angle,axisLine:yX.axisLine,hide:!1,includeHidden:Cz.includeHidden,interval:Cz.interval,label:!1,minTickGap:Cz.minTickGap,mirror:Cz.mirror,orientation:Cz.orientation,padding:Cz.padding,reversed:Cz.reversed,scale:Cz.scale,tick:Cz.tick,tickCount:Cz.tickCount,tickLine:yX.tickLine,tickSize:yX.tickSize,type:Cz.type,niceTicks:Cz.niceTicks,width:Cz.width,yAxisId:0},u1=L.memo(e=>{var t=zw(e,l1);return L.createElement(L.Fragment,null,L.createElement(s1,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),L.createElement(c1,t))},P$);u1.displayName=`YAxis`;var d1=$([(e,t)=>t,Fk,FP,WP,zH,VH,bU,JO],MU);function f1(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function p1(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(f1(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var m1=WE(`mouseClick`),h1=KD();h1.startListening({actionCreator:m1,effect:(e,t)=>{var n=e.payload,r=d1(t.getState(),p1(n));r?.activeIndex!=null&&t.dispatch(WV({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var g1=WE(`mouseMove`),_1=KD(),v1=null,y1=null,b1=null;_1.startListening({actionCreator:g1,effect:(e,t)=>{var n=e.payload,{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i?.includes(`mousemove`);v1!==null&&(cancelAnimationFrame(v1),v1=null),y1!==null&&(typeof r!=`number`||!a)&&(clearTimeout(y1),y1=null),b1=p1(n);var o=()=>{var e=t.getState(),n=kV(e,e.tooltip.settings.shared);if(!b1){v1=null,y1=null;return}if(n===`axis`){var r=d1(e,b1);r?.activeIndex==null?t.dispatch(VV()):t.dispatch(UV({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}v1=null,y1=null};if(!a){o();return}r===`raf`?v1=requestAnimationFrame(o):typeof r==`number`&&y1===null&&(y1=setTimeout(o,r))}});function x1(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<<CHILDREN>>`:t}var S1={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},C1=dD({name:`rootProps`,initialState:S1,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??S1.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),w1=C1.reducer,{updateOptions:T1}=C1.actions,E1=dD({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}}),{updatePolarOptions:D1}=E1.actions,O1=E1.reducer,k1=WE(`keyDown`),A1=WE(`focus`),j1=WE(`blur`),M1=KD(),N1=null,P1=null,F1=null;M1.startListening({actionCreator:k1,effect:(e,t)=>{F1=e.payload,N1!==null&&(cancelAnimationFrame(N1),N1=null);var{throttleDelay:n,throttledEvents:r}=t.getState().eventSettings,i=r===`all`||r.includes(`keydown`);P1!==null&&(typeof n!=`number`||!i)&&(clearTimeout(P1),P1=null);var a=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var{keyboardInteraction:n}=e.tooltip,r=F1;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=aH(n,DH(e),nB(e),IH(e)),a=i==null?-1:Number(i),o=!Number.isFinite(a)||a<0,s=VH(e),c=DH(e),l=kV(e,e.tooltip.settings.shared);if(r===`Enter`){if(o)return;var u=TU(e,l,`hover`,String(n.index));t.dispatch(KV({active:!n.active,activeIndex:n.index,activeCoordinate:u}));return}var d=TV(e)===`left-to-right`?1:-1,f=r===`ArrowRight`?1:-1,p;if(o){var m=nB(e),h=IH(e),g=f*d,_=e=>({active:!1,index:String(e),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(p=-1,g>0){for(var v=0;v<c.length;v++)if(aH(_(v),c,m,h)!=null){p=v;break}}else for(var y=c.length-1;y>=0;y--)if(aH(_(y),c,m,h)!=null){p=y;break}if(p<0)return}else{p=a+f*d;var b=s?.length||c.length;if(b===0||p>=b||p<0)return}var x=TU(e,l,`hover`,String(p));t.dispatch(KV({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}finally{N1=null,P1=null}};if(!i){a();return}n===`raf`?N1=requestAnimationFrame(a):typeof n==`number`&&P1===null&&(a(),F1=null,P1=setTimeout(()=>{F1?a():(P1=null,N1=null)},n))}}),M1.startListening({actionCreator:A1,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;if(!r.active&&r.index==null){var i=`0`,a=TU(n,kV(n,n.tooltip.settings.shared),`hover`,String(i));t.dispatch(KV({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),M1.startListening({actionCreator:j1,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;r.active&&t.dispatch(KV({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function I1(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var L1=WE(`externalEvent`),R1=KD(),z1=new Map,B1=new Map,V1=new Map;R1.startListening({actionCreator:L1,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=I1(r);V1.set(i,{handler:n,reactEvent:a});var o=z1.get(i);o!==void 0&&(cancelAnimationFrame(o),z1.delete(i));var{throttleDelay:s,throttledEvents:c}=t.getState().eventSettings,l=c,u=l===`all`||l?.includes(i),d=B1.get(i);d!==void 0&&(typeof s!=`number`||!u)&&(clearTimeout(d),B1.delete(i));var f=()=>{var e=V1.get(i);try{if(!e)return;var{handler:n,reactEvent:r}=e,a=t.getState(),o={activeCoordinate:ZH(a),activeDataKey:JH(a),activeIndex:KH(a),activeLabel:qH(a),activeTooltipIndex:KH(a),isTooltipActive:QH(a)};n&&n(o,r)}finally{z1.delete(i),B1.delete(i),V1.delete(i)}};if(!u){f();return}if(s===`raf`){var p=requestAnimationFrame(f);z1.set(i,p)}else if(typeof s==`number`){if(!B1.has(i)){f();var m=setTimeout(f,s);B1.set(i,m)}}else f()}}});var H1=$([$([lH],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),U1=WE(`touchMove`),W1=KD(),G1=null,K1=null,q1=null,J1=null;W1.startListening({actionCreator:U1,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){J1=I1(n);var{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i.includes(`touchmove`);G1!==null&&(cancelAnimationFrame(G1),G1=null),K1!==null&&(typeof r!=`number`||!a)&&(clearTimeout(K1),K1=null),q1=Array.from(n.touches).map(e=>p1({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var o=()=>{if(J1!=null){var e=t.getState(),n=kV(e,e.tooltip.settings.shared);if(n===`axis`){var r=q1?.[0];if(r==null){G1=null,K1=null;return}var i=d1(e,r);i?.activeIndex!=null&&t.dispatch(UV({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=J1.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(IO),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=CH(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var{dataKey:u}=l,d=H1(e,s,c);t.dispatch(zV({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}G1=null,K1=null}};if(!a){o();return}r===`raf`?G1=requestAnimationFrame(o):typeof r==`number`&&K1===null&&(o(),J1=null,K1=setTimeout(()=>{J1?o():(K1=null,G1=null)},r))}}});var Y1={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},X1=dD({name:`eventSettings`,initialState:Y1,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=AA(t.payload.throttledEvents))}}}),{setEventSettings:Z1}=X1.actions,Q1=X1.reducer,$1=ST({brush:LY,cartesianAxis:dY,chartData:yW,errorBars:QX,eventSettings:Q1,graphicalItems:oJ,layout:$D,legend:Kne,options:pW,polarAxis:GK,polarOptions:O1,referenceElements:VY,renderedTicks:lX,rootProps:w1,tooltip:qV,zIndex:JU}),e0=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return tD({reducer:$1,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([h1.middleware,_1.middleware,M1.middleware,R1.middleware,W1.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat($E({type:`raf`}))},devTools:cj.devToolsEnabled&&{serialize:{replacer:x1},name:`recharts-${t}`}})};function t0(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=QO(),a=(0,L.useRef)(null);if(i)return n;a.current??=e0(t,r);var o=nT;return L.createElement(ore,{context:o,store:a.current},n)}function n0(e){var{layout:t,margin:n}=e,r=iT(),i=QO();return(0,L.useEffect)(()=>{i||(r(XD(t)),r(YD(n)))},[r,i,t,n]),null}var r0=(0,L.memo)(n0,RA);function i0(e){var t=iT();return(0,L.useEffect)(()=>{t(T1(e))},[t,e]),null}var a0=(0,L.memo)(e=>{var t=iT();return(0,L.useEffect)(()=>{t(Z1(e))},[t,e]),null},RA);function o0(e){var{zIndex:t,isPanorama:n}=e,r=(0,L.useRef)(null),i=iT();return(0,L.useLayoutEffect)(()=>(r.current&&i(KU({zIndex:t,element:r.current,isPanorama:n})),()=>{i(qU({zIndex:t,isPanorama:n}))}),[i,t,n]),L.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function s0(e){var{children:t,isPanorama:n}=e,r=Q(PU);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return L.createElement(L.Fragment,null,i.map(e=>L.createElement(o0,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>L.createElement(o0,{key:e,zIndex:e,isPanorama:n})))}var c0=[`children`];function l0(e,t){if(e==null)return{};var n,r,i=u0(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function d0(){return d0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d0.apply(null,arguments)}var f0={width:`100%`,height:`100%`,display:`block`},p0=(0,L.forwardRef)((e,t)=>{var n=Mk(),r=Nk(),i=vj();if(!nO(n)||!nO(r))return null;var{children:a,otherAttributes:o,title:s,desc:c}=e,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),L.createElement(DS,d0({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:f0,ref:t}),a)}),m0=e=>{var{children:t}=e,n=Q(ek);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return L.createElement(DS,{width:r,height:i,x:o,y:a},t)},h0=(0,L.forwardRef)((e,t)=>{var{children:n}=e,r=l0(e,c0);return QO()?L.createElement(m0,null,L.createElement(s0,{isPanorama:!0},n)):L.createElement(p0,d0({ref:t},r),L.createElement(s0,{isPanorama:!1},n))});function g0(){var e=iT(),[t,n]=(0,L.useState)(null),r=Q(MO);return(0,L.useEffect)(()=>{if(t!=null){var n=t.getBoundingClientRect().width/t.offsetWidth;tO(n)&&n!==r&&e(QD(n))}},[t,e,r]),n}function _0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_0(Object(n),!0).forEach(function(t){y0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y0(e,t,n){return(t=b0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b0(e){var t=x0(e,`string`);return typeof t==`symbol`?t:t+``}function x0(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function S0(){return S0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S0.apply(null,arguments)}var C0=()=>(AW(),null);function w0(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var T0=(0,L.forwardRef)((e,t)=>{var n=(0,L.useRef)(null),[r,i]=(0,L.useState)({containerWidth:w0(e.style?.width),containerHeight:w0(e.style?.height)}),a=(0,L.useCallback)((e,t)=>{i(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),o=(0,L.useCallback)(e=>{if(typeof t==`function`&&t(e),n.current!=null&&(n.current.disconnect(),n.current=null),e!=null&&typeof ResizeObserver<`u`){var{width:r,height:i}=e.getBoundingClientRect();a(r,i);var o=new ResizeObserver(e=>{var t=e[0];if(t!=null){var{width:n,height:r}=t.contentRect;a(n,r)}});o.observe(e),n.current=o}},[t,a]);return(0,L.useEffect)(()=>()=>{n.current?.disconnect()},[a]),L.createElement(L.Fragment,null,L.createElement(Bk,{width:r.containerWidth,height:r.containerHeight}),L.createElement(`div`,S0({ref:o},e)))}),E0=(0,L.forwardRef)((e,t)=>{var{width:n,height:r}=e,[i,a]=(0,L.useState)({containerWidth:w0(n),containerHeight:w0(r)}),o=(0,L.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,L.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var{width:n,height:r}=e.getBoundingClientRect();o(n,r)}},[t,o]);return L.createElement(L.Fragment,null,L.createElement(Bk,{width:i.containerWidth,height:i.containerHeight}),L.createElement(`div`,S0({ref:s},e)))}),D0=(0,L.forwardRef)((e,t)=>{var{width:n,height:r}=e;return L.createElement(L.Fragment,null,L.createElement(Bk,{width:n,height:r}),L.createElement(`div`,S0({ref:t},e)))}),O0=(0,L.forwardRef)((e,t)=>{var{width:n,height:r}=e;return typeof n==`string`||typeof r==`string`?L.createElement(E0,S0({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?L.createElement(D0,S0({},e,{width:n,height:r,ref:t})):L.createElement(L.Fragment,null,L.createElement(Bk,{width:n,height:r}),L.createElement(`div`,S0({ref:t},e)))});function k0(e){return e?T0:O0}var A0=(0,L.forwardRef)((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:c,onMouseEnter:l,onMouseLeave:u,onMouseMove:d,onMouseUp:f,onTouchEnd:p,onTouchMove:m,onTouchStart:h,style:g,width:_,responsive:v,dispatchTouchEvents:y=!0}=e,b=(0,L.useRef)(null),x=iT(),[S,C]=(0,L.useState)(null),[w,T]=(0,L.useState)(null),E=g0(),D=Tk(),O=D?.width>0?D.width:_,k=D?.height>0?D.height:i,A=(0,L.useCallback)(e=>{E(e),typeof t==`function`&&t(e),C(e),T(e),e!=null&&(b.current=e)},[E,t,C,T]),j=(0,L.useCallback)(e=>{x(m1(e)),x(L1({handler:a,reactEvent:e}))},[x,a]),M=(0,L.useCallback)(e=>{x(g1(e)),x(L1({handler:l,reactEvent:e}))},[x,l]),N=(0,L.useCallback)(e=>{x(VV()),x(L1({handler:u,reactEvent:e}))},[x,u]),ee=(0,L.useCallback)(e=>{x(g1(e)),x(L1({handler:d,reactEvent:e}))},[x,d]),te=(0,L.useCallback)(()=>{x(A1())},[x]),P=(0,L.useCallback)(()=>{x(j1())},[x]),ne=(0,L.useCallback)(e=>{x(k1(e.key))},[x]),re=(0,L.useCallback)(e=>{x(L1({handler:o,reactEvent:e}))},[x,o]),ie=(0,L.useCallback)(e=>{x(L1({handler:s,reactEvent:e}))},[x,s]),ae=(0,L.useCallback)(e=>{x(L1({handler:c,reactEvent:e}))},[x,c]),F=(0,L.useCallback)(e=>{x(L1({handler:f,reactEvent:e}))},[x,f]),I=(0,L.useCallback)(e=>{x(L1({handler:h,reactEvent:e}))},[x,h]),oe=(0,L.useCallback)(e=>{y&&x(U1(e)),x(L1({handler:m,reactEvent:e}))},[x,y,m]),se=(0,L.useCallback)(e=>{x(L1({handler:p,reactEvent:e}))},[x,p]),ce=k0(v);return L.createElement(aW.Provider,{value:S},L.createElement(NS.Provider,{value:w},L.createElement(ce,{width:O??g?.width,height:k??g?.height,className:$u(`recharts-wrapper`,r),style:v0({position:`relative`,cursor:`default`,width:O,height:k},g),onClick:j,onContextMenu:re,onDoubleClick:ie,onFocus:te,onBlur:P,onKeyDown:ne,onMouseDown:ae,onMouseEnter:M,onMouseLeave:N,onMouseMove:ee,onMouseUp:F,onTouchEnd:se,onTouchMove:oe,onTouchStart:I,ref:A},L.createElement(C0,null),n)))}),j0=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function M0(e,t){if(e==null)return{};var n,r,i=N0(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function N0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var P0=(0,L.forwardRef)((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:s,compact:c,title:l,desc:u}=e,d=yS(M0(e,j0));return c?L.createElement(L.Fragment,null,L.createElement(Bk,{width:n,height:r}),L.createElement(h0,{otherAttributes:d,title:l,desc:u},a)):L.createElement(A0,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},L.createElement(h0,{otherAttributes:d,title:l,desc:u,ref:t},L.createElement(UY,null,a)))});function F0(){return F0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F0.apply(null,arguments)}function I0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?I0(Object(n),!0).forEach(function(t){R0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function R0(e,t,n){return(t=z0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z0(e){var t=B0(e,`string`);return typeof t==`symbol`?t:t+``}function B0(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var V0=L0({accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,layout:`horizontal`,margin:{top:5,right:5,bottom:5,left:5},responsive:!1,reverseStackOrder:!1,stackOffset:`none`,syncMethod:`index`},Y1),H0=(0,L.forwardRef)(function(e,t){var n=zw(e.categoricalChartProps,V0),{chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,categoricalChartProps:s}=e,c={chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,eventEmitter:void 0};return L.createElement(t0,{preloadedState:{options:c},reduxStoreName:s.id??r},L.createElement(PY,{chartData:s.data}),L.createElement(r0,{layout:n.layout,margin:n.margin}),L.createElement(a0,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),L.createElement(i0,{baseValue:n.baseValue,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),L.createElement(P0,F0({},n,{ref:t})))}),U0=[`axis`],W0=(0,L.forwardRef)((e,t)=>L.createElement(H0,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:U0,tooltipPayloadSearcher:dW,categoricalChartProps:e,ref:t})),G0=[`axis`,`item`],K0=(0,L.forwardRef)((e,t)=>L.createElement(H0,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:G0,tooltipPayloadSearcher:dW,categoricalChartProps:e,ref:t}));function q0(e){var t=iT();return(0,L.useEffect)(()=>{t(D1(e))},[t,e]),null}var J0=[`layout`];function Y0(){return Y0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y0.apply(null,arguments)}function X0(e,t){if(e==null)return{};var n,r,i=Z0(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Z0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Q0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Q0(Object(n),!0).forEach(function(t){e2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function e2(e,t,n){return(t=t2(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t2(e){var t=n2(e,`string`);return typeof t==`symbol`?t:t+``}function n2(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var r2=$0({accessibilityLayer:!0,stackOffset:`none`,barCategoryGap:`10%`,barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:`index`,layout:`radial`,responsive:!1,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`},Y1),i2=(0,L.forwardRef)(function(e,t){var n=zw(e.categoricalChartProps,r2),{layout:r}=n,i=X0(n,J0),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:s,tooltipPayloadSearcher:c}=e,l={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:s,tooltipPayloadSearcher:c,eventEmitter:void 0};return L.createElement(t0,{preloadedState:{options:l},reduxStoreName:n.id??a},L.createElement(PY,{chartData:n.data}),L.createElement(r0,{layout:r,margin:n.margin}),L.createElement(a0,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),L.createElement(i0,{baseValue:void 0,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),L.createElement(q0,{cx:n.cx,cy:n.cy,startAngle:n.startAngle,endAngle:n.endAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius}),L.createElement(P0,Y0({},i,{ref:t})))});function a2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?a2(Object(n),!0).forEach(function(t){s2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function s2(e,t,n){return(t=c2(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c2(e){var t=l2(e,`string`);return typeof t==`symbol`?t:t+``}function l2(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var u2=[`item`],d2=o2(o2({},r2),{},{layout:`centric`,startAngle:0,endAngle:360}),f2=(0,L.forwardRef)((e,t)=>{var n=zw(e,d2);return L.createElement(i2,{chartName:`PieChart`,defaultTooltipEventType:`item`,validateTooltipEventTypes:u2,tooltipPayloadSearcher:dW,categoricalChartProps:n,ref:t})}),p2=[`axis`],m2=(0,L.forwardRef)((e,t)=>L.createElement(H0,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:p2,tooltipPayloadSearcher:dW,categoricalChartProps:e,ref:t})),h2=365.2425,g2=6048e5,_2=864e5,v2=3600*24;v2*7,v2*h2/12*3;var y2=Symbol.for(`constructDateFrom`);function b2(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&y2 in e?e[y2](t):e instanceof Date?new e.constructor(t):new Date(t)}function x2(e,t){return b2(t||e,e)}function S2(e,t,n){let r=x2(e,n?.in);return isNaN(t)?b2(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}var C2={};function w2(){return C2}function T2(e,t){let n=w2(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=x2(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function E2(e,t){return T2(e,{...t,weekStartsOn:1})}function D2(e,t){let n=x2(e,t?.in),r=n.getFullYear(),i=b2(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=E2(i),o=b2(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=E2(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function O2(e){let t=x2(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function k2(e,...t){let n=b2.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function A2(e,t){let n=x2(e,t?.in);return n.setHours(0,0,0,0),n}function j2(e,t,n){let[r,i]=k2(n?.in,e,t),a=A2(r),o=A2(i),s=+a-O2(a),c=+o-O2(o);return Math.round((s-c)/_2)}function M2(e,t){let n=D2(e,t),r=b2(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),E2(r)}function N2(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function P2(e){return!(!N2(e)&&typeof e!=`number`||isNaN(+x2(e)))}function F2(e,t){let n=x2(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}var I2={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`}},L2=(e,t,n)=>{let r,i=I2[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function R2(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var z2={date:R2({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:R2({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:R2({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},B2={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},V2=(e,t,n,r)=>B2[e];function H2(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var U2={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:H2({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:H2({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:H2({values:{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`]},defaultWidth:`wide`}),day:H2({values:{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`]},defaultWidth:`wide`}),dayPeriod:H2({values:{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`}},defaultWidth:`wide`,formattingValues:{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`}},defaultFormattingWidth:`wide`})};function W2(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?K2(s,e=>e.test(o)):G2(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function G2(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function K2(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function q2(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var J2={code:`en-US`,formatDistance:L2,formatLong:z2,formatRelative:V2,localize:U2,match:{ordinalNumber:q2({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:W2({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:W2({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:W2({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),day:W2({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),dayPeriod:W2({matchPatterns:{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},defaultMatchWidth:`any`,parsePatterns:{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}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Y2(e,t){let n=x2(e,t?.in);return j2(n,F2(n))+1}function X2(e,t){let n=x2(e,t?.in),r=E2(n)-+M2(n);return Math.round(r/g2)+1}function Z2(e,t){let n=x2(e,t?.in),r=n.getFullYear(),i=w2(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=b2(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=T2(o,t),c=b2(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=T2(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Q2(e,t){let n=w2(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Z2(e,t),a=b2(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),T2(a,t)}function $2(e,t){let n=x2(e,t?.in),r=T2(n,t)-+Q2(n,t);return Math.round(r/g2)+1}function e4(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var t4={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return e4(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):e4(n+1,2)},d(e,t){return e4(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return e4(e.getHours()%12||12,t.length)},H(e,t){return e4(e.getHours(),t.length)},m(e,t){return e4(e.getMinutes(),t.length)},s(e,t){return e4(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return e4(Math.trunc(r*10**(n-3)),t.length)}},n4={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},r4={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return t4.y(e,t)},Y:function(e,t,n,r){let i=Z2(e,r),a=i>0?i:1-i;return t===`YY`?e4(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):e4(a,t.length)},R:function(e,t){return e4(D2(e),t.length)},u:function(e,t){return e4(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return e4(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return e4(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return t4.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return e4(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=$2(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):e4(i,t.length)},I:function(e,t,n){let r=X2(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):e4(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):t4.d(e,t)},D:function(e,t,n){let r=Y2(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):e4(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return e4(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return e4(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return e4(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?n4.noon:r===0?n4.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?n4.evening:r>=12?n4.afternoon:r>=4?n4.morning:n4.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return t4.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):t4.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):e4(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):e4(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):t4.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):t4.s(e,t)},S:function(e,t){return t4.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return a4(r);case`XXXX`:case`XX`:return o4(r);default:return o4(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return a4(r);case`xxxx`:case`xx`:return o4(r);default:return o4(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+i4(r,`:`);default:return`GMT`+o4(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+i4(r,`:`);default:return`GMT`+o4(r,`:`)}},t:function(e,t,n){return e4(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return e4(+e,t.length)}};function i4(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+e4(a,2)}function a4(e,t){return e%60==0?(e>0?`-`:`+`)+e4(Math.abs(e)/60,2):o4(e,t)}function o4(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=e4(Math.trunc(r/60),2),a=e4(r%60,2);return n+i+t+a}var s4=(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`});default:return t.date({width:`full`})}},c4=(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`});default:return t.time({width:`full`})}},l4={p:c4,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return s4(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,s4(r,t)).replace(`{{time}}`,c4(i,t))}},u4=/^D+$/,d4=/^Y+$/,f4=[`D`,`DD`,`YY`,`YYYY`];function p4(e){return u4.test(e)}function m4(e){return d4.test(e)}function h4(e,t,n){let r=g4(e,t,n);if(console.warn(r),f4.includes(e))throw RangeError(r)}function g4(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Sae=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_4=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,v4=/^'([^]*?)'?$/,y4=/''/g,b4=/[a-zA-Z]/;function x4(e,t,n){let r=w2(),i=n?.locale??r.locale??J2,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=x2(e,n?.in);if(!P2(s))throw RangeError(`Invalid time value`);let c=t.match(_4).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=l4[t];return n(e,i.formatLong)}return e}).join(``).match(Sae).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:S4(e)};if(r4[t])return{isToken:!0,value:e};if(t.match(b4))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&m4(a)||!n?.useAdditionalDayOfYearTokens&&p4(a))&&h4(a,t,String(e));let o=r4[a[0]];return o(s,a,i.localize,l)}).join(``)}function S4(e){let t=e.match(v4);return t?t[1].replace(y4,`'`):e}function C4(e,t,n){return S2(e,-t,n)}function w4({open:e,title:t,description:n,confirmText:r=`确认`,cancelText:i=`取消`,variant:a=`default`,loading:o=!1,count:s,onConfirm:c,onCancel:l}){let[u,d]=(0,L.useState)(``),f=s!==void 0&&s>=5&&s<=20,p=s!==void 0&&s>20,m=f||p,h=p?`DELETE`:String(s),g=!m||u===h;if((0,L.useEffect)(()=>{if(!e){d(``);return}let t=e=>{e.key===`Escape`&&l(),e.key===`Enter`&&g&&c()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,c,l,g]),!e)return null;let _=a===`danger`?Jc:a===`warning`?Xc:_c,v=a===`danger`?`text-red-500`:a===`warning`?`text-amber-500`:`text-blue-500`;return(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm`,onClick:l,children:(0,R.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md mx-4 p-6`,onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,R.jsx)(`div`,{className:q(`flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center`,a===`danger`?`bg-red-50`:a===`warning`?`bg-amber-50`:`bg-blue-50`),children:(0,R.jsx)(_,{className:q(`h-5 w-5`,v)})}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsx)(`h3`,{className:`text-base font-semibold text-gray-900`,children:t}),(0,R.jsx)(`p`,{className:`mt-1 text-sm text-gray-500 leading-relaxed`,children:n})]})]}),m&&(0,R.jsxs)(`div`,{className:`mt-4`,children:[(0,R.jsx)(`p`,{className:`text-sm text-gray-600 mb-2`,children:p?(0,R.jsxs)(R.Fragment,{children:[`请输入 `,(0,R.jsx)(`code`,{className:`px-1 py-0.5 bg-gray-100 rounded text-red-600 font-mono text-xs`,children:`DELETE`}),` 以确认操作`]}):(0,R.jsxs)(R.Fragment,{children:[`请输入数量 `,(0,R.jsx)(`code`,{className:`px-1 py-0.5 bg-gray-100 rounded text-gray-800 font-mono text-xs`,children:s}),` 以确认操作`]})}),(0,R.jsx)(`input`,{autoFocus:!0,type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:h,className:q(`w-full px-3 py-2 border rounded-lg text-sm focus:outline-none focus:ring-2`,u&&!g?`border-red-300 focus:ring-red-400`:`border-gray-200 focus:ring-blue-500`)})]}),(0,R.jsxs)(`div`,{className:`flex justify-end gap-3 mt-6`,children:[(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,onClick:l,disabled:o,children:i}),(0,R.jsx)(Y,{variant:a===`danger`?`danger`:`primary`,size:`sm`,onClick:c,loading:o,disabled:!g,children:r})]})]})})}var T4={PreToolUse:`#3b82f6`,PostToolUse:`#10b981`,UserPromptSubmit:`#f59e0b`,Stop:`#ef4444`,Notification:`#8b5cf6`};function E4(){let e=Fn(),t=Ye(),[n,r]=(0,L.useState)(!1),i=(0,L.useRef)(null),[a,o]=(0,L.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),{data:s}=ut({queryKey:[`daemon-status`],queryFn:()=>cu().then(e=>e.data),refetchInterval:3e4}),{data:c}=ut({queryKey:[`pipelines-active`],queryFn:()=>Ll().then(e=>e.data),refetchInterval:3e4}),{data:l}=ut({queryKey:[`overview`],queryFn:()=>Sl().then(e=>e.data),refetchInterval:3e4}),{data:u}=ut({queryKey:[`roi-stats`],queryFn:()=>xl().then(e=>e.data),refetchInterval:6e4}),{data:d,refetch:f}=ut({queryKey:[`events-live`],queryFn:()=>hl({limit:100}).then(e=>e.data),refetchInterval:n?!1:3e4}),{data:p}=ut({queryKey:[`memory-process-dash`],queryFn:()=>vu().then(e=>e.data),refetchInterval:3e4}),{data:m}=ut({queryKey:[`memory-caches-dash`],queryFn:()=>_u().then(e=>e.data),refetchInterval:3e4}),h=z({mutationFn:e=>Nl(e),onSuccess:()=>t.invalidateQueries({queryKey:[`pipelines-active`]})}),g=z({mutationFn:()=>Il(),onSuccess:()=>t.invalidateQueries({queryKey:[`pipelines-active`]})}),_=z({mutationFn:()=>ou(),onSuccess:()=>t.invalidateQueries({queryKey:[`overview`]})}),v=z({mutationFn:()=>lu()});(0,L.useEffect)(()=>{!n&&i.current&&i.current.scrollIntoView({behavior:`smooth`})},[d,n]);let y=(c?.total||0)>0,b=l?.recommendations?.find(e=>e.action===`/quality`);return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsx)(X,{className:`!p-3`,children:(0,R.jsxs)(`div`,{className:`flex items-center justify-between flex-wrap gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-4 text-sm flex-wrap`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`div`,{className:q(`w-2 h-2 rounded-full`,s?.running?`bg-green-500 animate-pulse`:`bg-red-500`)}),(0,R.jsx)(`span`,{className:`font-medium`,children:s?.running?`Daemon PID:${s.pid}`:`Daemon 离线`})]}),s?.uptime&&(0,R.jsxs)(`span`,{className:`text-gray-400`,children:[`运行 `,s.uptime.formatted]}),s?.memory&&(0,R.jsxs)(`span`,{className:`text-gray-400`,children:[`内存 `,s.memory.rss,`MB`]}),y&&(0,R.jsx)(fS,{variant:`info`,children:`Pipeline 运行中`}),b&&(0,R.jsx)(fS,{variant:`warning`,children:b.title})]}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Nc,onClick:()=>{o({open:!0,title:`重启 Daemon`,description:`确认重启 daemon?这将中断当前所有会话。`,onConfirm:()=>{v.mutate(),o(e=>({...e,open:!1}))}})},children:`重启`})]})}),p&&(0,R.jsx)(X,{className:`!p-3`,children:(0,R.jsxs)(`div`,{className:`flex items-center justify-between flex-wrap gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)($s,{className:`h-4 w-4 text-purple-500`}),(0,R.jsx)(`span`,{className:`text-sm font-medium text-gray-700`,children:`内存`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-4 text-sm flex-wrap`,children:[(0,R.jsxs)(`span`,{className:`text-gray-500`,children:[`RSS `,(0,R.jsxs)(`span`,{className:`font-mono text-gray-800`,children:[p.rssMB,` MB`]})]}),(0,R.jsxs)(`span`,{className:`text-gray-500`,children:[`堆 `,(0,R.jsxs)(`span`,{className:`font-mono text-gray-800`,children:[p.heapUsedMB,`/`,p.heapTotalMB,` MB`]})]}),m&&(0,R.jsxs)(`span`,{className:`text-gray-500`,children:[`缓存 `,(0,R.jsxs)(`span`,{className:`font-mono text-gray-800`,children:[m.caches.reduce((e,t)=>e+t.size,0),`/`,m.caches.reduce((e,t)=>e+t.maxSize,0)]}),` 条`]}),(0,R.jsx)(`button`,{onClick:()=>e(`/config?section=memory_mgmt`),className:`text-xs text-blue-600 hover:underline`,children:`管理`})]})]})}),y&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-sm font-semibold text-gray-500 uppercase tracking-wider mb-3`,children:`当前运行中`}),(0,R.jsx)(`div`,{className:`space-y-3`,children:c?.items.map((t,n)=>(0,R.jsx)(sS.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,R.jsx)(X,{className:`border-l-4 border-l-blue-500 !p-4`,children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,R.jsx)(pc,{className:`h-5 w-5 text-blue-500`}),t.type===`dynamic`&&(0,R.jsx)(fS,{variant:`primary`,size:`sm`,children:`动态编排`}),(0,R.jsx)(fS,{variant:`info`,children:t.phaseLabel}),(0,R.jsx)(`span`,{className:`text-sm text-gray-500`,children:t.projectPath?t.projectPath.split(`/`).pop():``})]}),(0,R.jsx)(`p`,{className:`text-sm text-gray-700 line-clamp-2`,children:t.requirement?.slice(0,150)}),(0,R.jsxs)(`p`,{className:`text-xs text-gray-400 mt-2`,children:[`创建于 `,t.updatedAt?x4(Df(t.updatedAt),`HH:mm:ss`):``]})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 ml-4`,children:[(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:ac,onClick:()=>e(`/pipelines/${t.id}`),children:`查看`}),(0,R.jsx)(Y,{variant:`danger`,size:`sm`,icon:el,onClick:()=>{o({open:!0,title:`关闭 Pipeline`,description:`确认关闭此 Pipeline?`,onConfirm:()=>{h.mutate(t.id),o(e=>({...e,open:!1}))}})},children:`关闭`})]})]})})},t.id))})]}),l?.recommendations&&l.recommendations.length>0&&(0,R.jsx)(`div`,{className:`space-y-2`,children:l.recommendations.map((t,n)=>(0,R.jsxs)(sS.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:q(`flex items-center justify-between p-3 rounded-lg border cursor-pointer transition-all hover:shadow-sm`,t.type===`warning`?`bg-amber-50 border-amber-200`:`bg-blue-50 border-blue-200`),children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 flex-1`,onClick:()=>e(t.action),children:[(0,R.jsx)(Xc,{className:q(`h-4 w-4`,t.type===`warning`?`text-amber-500`:`text-blue-500`)}),(0,R.jsx)(`span`,{className:`text-sm font-medium`,children:t.title})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t.action===`/quality`&&(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:zs,onClick:e=>{e.stopPropagation(),_.mutate()},children:`修复`}),t.action===`/pipelines`&&(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Jc,onClick:e=>{e.stopPropagation(),g.mutate()},children:`清理`}),(0,R.jsx)(As,{className:`h-4 w-4 text-gray-300`})]})]},n))}),(0,R.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,R.jsx)(`div`,{className:`cursor-pointer`,onClick:()=>e(`/sessions`),children:(0,R.jsx)(dS,{title:`本周节省`,value:`${u?.week.timeSavedHours||0}h`,icon:Ys,color:`blue`})}),(0,R.jsx)(`div`,{className:`cursor-pointer`,onClick:()=>e(`/analytics`),children:(0,R.jsx)(dS,{title:`Token 用量`,value:Tf(u?.week.tokensTotal||0),icon:tl,color:`green`})}),(0,R.jsx)(`div`,{className:`cursor-pointer`,onClick:()=>e(`/quality`),children:(0,R.jsx)(dS,{title:`质量拦截`,value:u?.week.qualityBlocked||0,icon:zc,color:`purple`})}),(0,R.jsx)(`div`,{className:`cursor-pointer`,onClick:()=>e(`/knowledge`),children:(0,R.jsx)(dS,{title:`知识沉淀`,value:u?.totals.knowledgeNodes||0,icon:Fs,color:`orange`})})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,R.jsx)(X,{title:`7 天活动趋势`,children:(0,R.jsx)(Dk,{width:`100%`,height:180,children:(0,R.jsxs)(m2,{data:u?.dailyTrend||[],children:[(0,R.jsx)(`defs`,{children:(0,R.jsxs)(`linearGradient`,{id:`gradE`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,R.jsx)(`stop`,{offset:`5%`,stopColor:`#3b82f6`,stopOpacity:.3}),(0,R.jsx)(`stop`,{offset:`95%`,stopColor:`#3b82f6`,stopOpacity:0})]})}),(0,R.jsx)(XX,{strokeDasharray:`3 3`,stroke:`#e5e7eb`}),(0,R.jsx)(Y$,{dataKey:`date`,stroke:`#6b7280`}),(0,R.jsx)(u1,{stroke:`#6b7280`}),(0,R.jsx)(VW,{contentStyle:{borderRadius:`8px`,border:`1px solid #e5e7eb`}}),(0,R.jsx)(OQ,{type:`monotone`,dataKey:`events`,stroke:`#3b82f6`,fill:`url(#gradE)`,name:`事件`})]})})}),(0,R.jsx)(X,{title:`实时事件流`,action:(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[n&&(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Pc,onClick:()=>void f(),children:`刷新`}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:n?jc:Oc,onClick:()=>r(!n),children:n?`继续`:`暂停`})]}),children:(0,R.jsxs)(`div`,{className:`h-[180px] overflow-y-auto text-xs font-mono space-y-1`,children:[d?.items.map((t,n)=>{let r=t.tool_input,i=r?.file_path?String(r.file_path).split(`/`).slice(-2).join(`/`):r?.command?String(r.command).slice(0,60):r?.pattern?String(r.pattern):t.hook_type===`UserPromptSubmit`?`用户输入`:``;return(0,R.jsxs)(`div`,{className:`flex items-center gap-2 py-1 hover:bg-gray-50 rounded px-1 cursor-pointer`,onClick:()=>e(`/events`),children:[(0,R.jsx)(`span`,{className:`text-gray-400 w-14 flex-shrink-0`,children:x4(Df(t.timestamp),`HH:mm:ss`)}),(0,R.jsx)(`span`,{className:`w-2 h-2 rounded-full flex-shrink-0`,style:{backgroundColor:T4[t.hook_type]||`#6b7280`}}),(0,R.jsx)(`span`,{className:`text-gray-700 font-medium w-16 flex-shrink-0 truncate`,children:t.tool_name||t.hook_type}),(0,R.jsx)(`span`,{className:`text-gray-400 truncate flex-1`,children:i})]},`${t.id}-${n}`)}),(0,R.jsx)(`div`,{ref:i})]})})]}),(0,R.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[{label:`会话管理`,icon:Ds,path:`/sessions`,count:u?.week.sessions},{label:`流水线`,icon:pc,path:`/pipelines`,count:c?.total},{label:`质量门禁`,icon:zc,path:`/quality`,count:l?.recommendations?.find(e=>e.action===`/quality`)?`!`:`0`},{label:`知识图谱`,icon:Fs,path:`/knowledge`,count:u?.totals.knowledgeNodes}].map(t=>(0,R.jsx)(sS.div,{whileHover:{scale:1.02},whileTap:{scale:.98},className:`bg-white rounded-xl p-4 border border-gray-100 cursor-pointer hover:border-blue-200 hover:shadow-sm transition-all`,onClick:()=>e(t.path),children:(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(t.icon,{className:`h-5 w-5 text-gray-500`}),(0,R.jsx)(`span`,{className:`text-sm font-medium text-gray-700`,children:t.label})]}),(0,R.jsx)(`span`,{className:`text-sm font-bold text-gray-900`,children:t.count??`-`})]})},t.path))}),(0,R.jsx)(w4,{open:a.open,title:a.title,description:a.description,variant:`warning`,onConfirm:a.onConfirm,onCancel:()=>o(e=>({...e,open:!1}))})]})}function D4(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o;n.key&&n.debug?.call(n)&&(o=Date.now());let s=e();if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug?.call(n)&&(c=Date.now()),i=t(...s),n.key&&n.debug?.call(n)){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
63
- font-size: .6rem;
64
- font-weight: bold;
65
- color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function O4(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var k4=(e,t)=>Math.abs(e-t)<1.01,A4=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},j4=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},M4=e=>e,N4=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},P4=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(j4(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(j4(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},F4={passive:!0},I4=typeof window>`u`?!0:`onscrollend`in window,L4=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=e.options.useScrollendEvent&&I4?()=>void 0:A4(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{let{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s&&-1||1):n.scrollTop,a(),t(i,r)},s=o(!0),c=o(!1);n.addEventListener(`scroll`,s,F4);let l=e.options.useScrollendEvent&&I4;return l&&n.addEventListener(`scrollend`,c,F4),()=>{n.removeEventListener(`scroll`,s),l&&n.removeEventListener(`scrollend`,c)}},R4=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},z4=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},B4=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:M4,rangeExtractor:N4,onChange:()=>{},measureElement:R4,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,...e}},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=D4(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=D4(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=D4(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let l=this.measurementsCache.slice(0,c),u=Array(a).fill(void 0);for(let e=0;e<c;e++){let t=l[e];t&&(u[t.lane]=e)}for(let i=c;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),c,d,f=o===`estimate`||s.has(e);if(a!==void 0&&this.options.lanes>1){c=a;let e=u[c],r=e===void 0?void 0:l[e];d=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?l[i-1]:this.getFurthestMeasurement(l,i);d=e?e.end+this.options.gap:t+n,c=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,c)}let p=s.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=d+m;l[i]={index:i,start:d,size:m,end:h,key:e,lane:c},u[c]=i}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=D4(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?H4({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=D4(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let r=t-(this.itemSizeCache.get(n.key)??n.size);r!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start<this.getScrollOffset()+this.scrollAdjustments:this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this))&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.getVirtualItems=D4(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return O4(t[V4(0,t.length-1,e=>O4(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t);this.scrollState={index:null,align:t,behavior:n,startedAt:this.now(),lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e;this.scrollState={index:null,align:`start`,behavior:t,startedAt:this.now(),lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=e[e.length-1]?.end??0;else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&k4(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,n&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior=`auto`,this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}));this.scheduleScrollReconcile()}},V4=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function H4({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){let i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=V4(0,i,a,n),s=o;if(r===1)for(;s<i&&e[s].end<n+t;)s++;else if(r>1){let a=Array(r).fill(0);for(;s<i&&a.some(e=>e<n+t);){let t=e[s];a[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var U4=typeof document<`u`?L.useLayoutEffect:L.useEffect;function W4({useFlushSync:e=!0,...t}){let n=L.useReducer(()=>({}),{})[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,rl.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=L.useState(()=>new B4(r));return i.setOptions(r),U4(()=>i._didMount(),[]),U4(()=>i._willUpdate()),i}function G4(e){return W4({observeElementRect:P4,observeElementOffset:L4,scrollToFn:z4,...e})}function K4(e,t,n){let r=e=>{let t=e==null?``:String(e);return t.includes(`,`)||t.includes(`"`)||t.includes(`
66
- `)?`"${t.replace(/"/g,`""`)}"`:t},i=[t.map(r).join(`,`),...n.map(e=>e.map(r).join(`,`))].join(`
67
- `),a=new Blob([``+i],{type:`text/csv;charset=utf-8;`}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=e,s.click(),URL.revokeObjectURL(o)}function q4({message:e=`加载失败,请重试`,onRetry:t}){return(0,R.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-96 text-center px-4`,children:[(0,R.jsx)(`div`,{className:`flex items-center justify-center w-16 h-16 rounded-full bg-red-50 mb-4`,children:(0,R.jsx)(Ws,{className:`h-8 w-8 text-red-500`})}),(0,R.jsx)(`h3`,{className:`text-lg font-semibold text-gray-900 mb-2`,children:`出错了`}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500 mb-6 max-w-md`,children:e}),t&&(0,R.jsx)(Y,{variant:`primary`,size:`sm`,icon:Pc,onClick:t,children:`重试`})]})}function J4(e,t){let n=t.getTime()-e.getTime();if(n<0)return`-`;let r=Math.floor(n/6e4),i=Math.floor(r/60);return i>0?`${i}h ${r%60}m`:r>0?`${r}m`:`${Math.floor(n/1e3)}s`}function Y4(){let e=Ye(),[t,n]=(0,L.useState)(``),[r,i]=(0,L.useState)(``),[a,o]=(0,L.useState)(``),[s,c]=(0,L.useState)(`all`),[l,u]=(0,L.useState)(new Set),[d,f]=(0,L.useState)(`start_time`),[p,m]=(0,L.useState)(!1),[h,g]=(0,L.useState)(!1),[_,v]=(0,L.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),y=Fn(),b=(0,L.useRef)(null),{data:x,isLoading:S,isError:C,refetch:w}=ut({queryKey:[`sessions`,{limit:1e3,status:r||void 0}],queryFn:()=>dl({limit:1e3,status:r||void 0}).then(e=>e.data),refetchInterval:1e4}),T=z({mutationFn:e=>pl(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`sessions`]})}}),E=z({mutationFn:e=>ml(e),onSuccess:()=>{u(new Set),e.invalidateQueries({queryKey:[`sessions`]})}}),D=(x?.items.filter(e=>{let n=e.session_id.toLowerCase().includes(t.toLowerCase())||e.project_path.toLowerCase().includes(t.toLowerCase()),r=!a||e.project_path.split(`/`).pop()===a,i=s===`all`||new Date(e.start_time)>=C4(new Date,s===`1d`?1:s===`7d`?7:30);return n&&r&&i})||[]).sort((e,t)=>{let n=0;return d===`start_time`?n=e.start_time.localeCompare(t.start_time):d===`event_count`?n=e.event_count-t.event_count:d===`duration`&&(n=(e.end_time?new Date(e.end_time).getTime()-new Date(e.start_time).getTime():1/0)-(t.end_time?new Date(t.end_time).getTime()-new Date(t.start_time).getTime():1/0)),p?n:-n}),O=Array.from(new Set(x?.items.map(e=>e.project_path.split(`/`).pop()||``).filter(Boolean)||[])),k=e=>{d===e?m(e=>!e):(f(e),m(!1))},A=G4({count:D.length,getScrollElement:()=>b.current,estimateSize:()=>72,overscan:10}),j=()=>{let e=[`Session ID`,`项目`,`状态`,`开始时间`,`结束时间`,`事件数`],t=D.map(e=>[e.session_id,e.project_path,e.status,e.start_time,e.end_time||``,e.event_count]);K4(`sessions-${x4(new Date,`yyyyMMdd-HHmmss`)}.csv`,e,t)};return S?(0,R.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,R.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})}):C?(0,R.jsx)(q4,{message:`会话数据加载失败`,onRetry:()=>w()}):(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,R.jsxs)(`div`,{className:`relative flex-1`,children:[(0,R.jsx)(Lc,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,R.jsx)(`input`,{type:`text`,placeholder:`搜索会话 ID 或项目...`,value:t,onChange:e=>n(e.target.value),className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,R.jsxs)(`button`,{onClick:()=>g(e=>!e),className:q(`flex items-center gap-1.5 px-3 py-2 text-sm rounded-lg border transition-colors`,h||r||a||s!==`all`?`border-blue-300 bg-blue-50 text-blue-700`:`border-gray-200 text-gray-600 hover:bg-gray-50`),children:[(0,R.jsx)(fc,{className:`h-4 w-4`}),`筛选`,(r||a||s!==`all`)&&(0,R.jsx)(`span`,{className:`ml-1 px-1.5 py-0.5 bg-blue-600 text-white text-xs rounded-full`,children:[r,a,s===`all`?``:s].filter(Boolean).length}),(0,R.jsx)(Bs,{className:q(`h-3.5 w-3.5 transition-transform`,h&&`rotate-180`)})]}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[l.size>0&&(0,R.jsxs)(Y,{variant:`danger`,size:`sm`,icon:Jc,onClick:()=>{v({open:!0,title:`批量删除会话`,description:`确定删除选中的 ${l.size} 个会话吗?此操作不可撤销。`,count:l.size,onConfirm:()=>{E.mutate(Array.from(l)),v(e=>({...e,open:!1}))}})},loading:E.isPending,children:[`删除 (`,l.size,`)`]}),(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:nc,onClick:()=>D.length>0&&j(),children:`导出`}),(0,R.jsx)(Y,{variant:`primary`,size:`sm`,onClick:()=>w(),children:`刷新`})]})]}),h&&(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-3 pt-2 border-t border-gray-100`,children:[(0,R.jsxs)(`select`,{value:r,onChange:e=>i(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:``,children:`全部状态`}),(0,R.jsx)(`option`,{value:`active`,children:`活跃`}),(0,R.jsx)(`option`,{value:`completed`,children:`已完成`}),(0,R.jsx)(`option`,{value:`interrupted`,children:`中断`})]}),(0,R.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:``,children:`全部项目`}),O.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1 border border-gray-200 rounded-lg overflow-hidden text-sm`,children:[(0,R.jsx)(Is,{className:`h-3.5 w-3.5 text-gray-400 ml-2`}),[`all`,`1d`,`7d`,`30d`].map(e=>(0,R.jsx)(`button`,{onClick:()=>c(e),className:q(`px-2.5 py-1.5 transition-colors`,s===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:e===`all`?`全部`:e},e))]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1 text-sm`,children:[(0,R.jsx)(`span`,{className:`text-gray-500 text-xs`,children:`排序:`}),[{key:`start_time`,label:`时间`},{key:`event_count`,label:`事件数`},{key:`duration`,label:`时长`}].map(({key:e,label:t})=>(0,R.jsxs)(`button`,{onClick:()=>k(e),className:q(`px-2.5 py-1.5 rounded-lg transition-colors flex items-center gap-1`,d===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:[t,d===e&&(0,R.jsx)(js,{className:q(`h-3 w-3`,p&&`rotate-180`)})]},e))]})]})]})}),(0,R.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4`,children:[(0,R.jsxs)(X,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`text-3xl font-bold text-blue-600`,children:x?.total||0}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`总会话数`})]}),(0,R.jsxs)(X,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`text-3xl font-bold text-green-600`,children:x?.items.filter(e=>e.status===`active`).length||0}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`活跃会话`})]}),(0,R.jsxs)(X,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`text-3xl font-bold text-purple-600`,children:x?.items.filter(e=>e.status===`completed`).length||0}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`已完成`})]}),(0,R.jsxs)(X,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`text-3xl font-bold text-orange-600`,children:Math.round((x?.items.reduce((e,t)=>e+t.event_count,0)||0)/(x?.items.length||1))}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`平均事件数`})]})]}),(0,R.jsx)(X,{title:`会话列表 (${D.length})`,action:D.length>0?(0,R.jsx)(`button`,{onClick:()=>{l.size===D.length?u(new Set):u(new Set(D.map(e=>e.session_id)))},className:`text-xs text-blue-600 hover:underline`,children:l.size===D.length?`取消全选`:`全选`}):void 0,children:D.length===0?(0,R.jsxs)(`div`,{className:`text-center py-12 text-gray-400`,children:[(0,R.jsx)(Ds,{className:`h-12 w-12 mx-auto mb-3 opacity-30`}),(0,R.jsx)(`p`,{children:`暂无会话记录`}),(0,R.jsx)(`p`,{className:`text-sm mt-1`,children:`使用 Claude Code 开始一个会话后,记录将自动出现在这里`})]}):(0,R.jsx)(`div`,{ref:b,className:`h-[600px] overflow-auto`,children:(0,R.jsx)(`div`,{style:{height:`${A.getTotalSize()}px`,position:`relative`},children:A.getVirtualItems().map(e=>{let t=D[e.index];return(0,R.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:(0,R.jsxs)(`div`,{className:q(`flex items-center gap-3 p-4 rounded-lg border transition-all cursor-pointer mb-2`,l.has(t.session_id)?`border-blue-300 bg-blue-50`:`border-gray-100 hover:border-blue-200 hover:bg-blue-50/50`),onClick:()=>y(`/sessions/${t.session_id}`),children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:l.has(t.session_id),onChange:e=>{e.stopPropagation(),u(e=>{let n=new Set(e);return n.has(t.session_id)?n.delete(t.session_id):n.add(t.session_id),n})},onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded border-gray-300 text-blue-600 cursor-pointer flex-shrink-0`}),(0,R.jsxs)(`div`,{className:`flex-1 grid grid-cols-1 md:grid-cols-6 gap-4 items-center`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`font-mono text-sm font-medium text-gray-900`,children:[t.session_id.slice(0,12),`...`]}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500 mt-1`,children:t.project_path.split(`/`).slice(-2).join(`/`)})]}),(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,R.jsx)(fS,{variant:t.status===`active`?`success`:t.status===`completed`?`info`:`warning`,children:t.status})}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:[(0,R.jsx)(Ds,{className:`h-4 w-4`}),t.event_count,` 事件`]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:[(0,R.jsx)(Ys,{className:`h-4 w-4`}),x4(Df(t.start_time),`MM-dd HH:mm`)]}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600`,children:t.end_time?J4(Df(t.start_time),Df(t.end_time)):J4(Df(t.start_time),new Date)}),(0,R.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:ac,children:`查看详情`}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Jc,onClick:e=>{e.stopPropagation(),v({open:!0,title:`删除会话`,description:`确认删除此会话及其所有数据?此操作不可撤销。`,onConfirm:()=>{T.mutate(t.session_id),v(e=>({...e,open:!1}))}})},loading:T.isPending&&T.variables===t.session_id})]})]})]})},t.session_id)})})})}),(0,R.jsx)(w4,{open:_.open,title:_.title,description:_.description,count:_.count,variant:`danger`,onConfirm:_.onConfirm,onCancel:()=>v({..._,open:!1})})]})}function X4({items:e}){return(0,R.jsx)(`nav`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:e.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t>0&&(0,R.jsx)(Hs,{className:`h-3.5 w-3.5 text-gray-400`}),e.path?(0,R.jsx)(ei,{to:e.path,className:`hover:text-gray-900 transition-colors`,children:e.label}):(0,R.jsx)(`span`,{className:`text-gray-900 font-medium`,children:e.label})]},t))})}function Z4(){let{id:e}=Ln(),t=Fn(),n=Mn(),[r,i]=(0,L.useState)(null),[a,o]=(0,L.useState)(`phases`),s=n.state?.from||`/sessions`,{data:c,isLoading:l,isError:u,error:d}=ut({queryKey:[`session`,e],queryFn:()=>fl(e).then(e=>e.data),enabled:!!e});if(u)return(0,R.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,d?.message||`未知错误`]});if(l||!c)return(0,R.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,R.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let{session:f,phases:p,dataFlow:m,timeline:h,stats:g}=c,_=Object.entries(g.toolUsage).sort((e,t)=>t[1]-e[1]).slice(0,12).map(([e,t])=>({name:e,value:t}));return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsx)(X4,{items:[{label:`会话列表`,path:`/sessions`},{label:f.session_id.slice(0,8)+`...`}]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:ks,onClick:()=>t(s),children:`返回`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:`会话详情`}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500 font-mono`,children:f.session_id})]}),(0,R.jsx)(fS,{variant:f.status===`active`?`success`:`info`,children:f.status})]}),c.pipeline&&(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,onClick:()=>t(`/pipelines/${c.pipeline.id}`,{state:{from:s}}),children:`查看关联 Pipeline`})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-4`,children:[(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsx)(Ys,{className:`h-5 w-5 text-blue-500 mx-auto mb-2`}),(0,R.jsx)(`div`,{className:`text-xl font-bold`,children:wf(g.duration)}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500`,children:`持续时间`})]}),(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsx)($c,{className:`h-5 w-5 text-green-500 mx-auto mb-2`}),(0,R.jsx)(`div`,{className:`text-xl font-bold`,children:g.totalEvents}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500`,children:`总事件数`})]}),(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsx)(sc,{className:`h-5 w-5 text-purple-500 mx-auto mb-2`}),(0,R.jsx)(`div`,{className:`text-xl font-bold`,children:g.writeOps}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500`,children:`写入操作`})]}),(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsx)(Lc,{className:`h-5 w-5 text-orange-500 mx-auto mb-2`}),(0,R.jsx)(`div`,{className:`text-xl font-bold`,children:g.readOps}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500`,children:`读取操作`})]}),(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsx)(Kc,{className:`h-5 w-5 text-red-500 mx-auto mb-2`}),(0,R.jsx)(`div`,{className:`text-xl font-bold`,children:p.length}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500`,children:`交互轮次`})]})]}),(0,R.jsx)(X,{title:`事件密度时间线`,children:(0,R.jsx)(Dk,{width:`100%`,height:120,children:(0,R.jsxs)(m2,{data:h,children:[(0,R.jsx)(`defs`,{children:(0,R.jsxs)(`linearGradient`,{id:`timelineGrad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,R.jsx)(`stop`,{offset:`5%`,stopColor:`#3b82f6`,stopOpacity:.4}),(0,R.jsx)(`stop`,{offset:`95%`,stopColor:`#3b82f6`,stopOpacity:0})]})}),(0,R.jsx)(XX,{strokeDasharray:`3 3`,stroke:`#e5e7eb`}),(0,R.jsx)(Y$,{dataKey:`time`,tick:!1}),(0,R.jsx)(u1,{hide:!0}),(0,R.jsx)(VW,{formatter:e=>[`${e} 事件`,`数量`]}),(0,R.jsx)(OQ,{type:`monotone`,dataKey:`count`,stroke:`#3b82f6`,fill:`url(#timelineGrad)`})]})})}),(0,R.jsx)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit`,children:[`phases`,`flow`,`events`].map(e=>(0,R.jsx)(`button`,{onClick:()=>o(e),className:q(`px-4 py-2 rounded-md text-sm font-medium transition-colors`,a===e?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`),children:{phases:`阶段视图`,flow:`数据流图`,events:`事件列表`}[e]},e))}),a===`phases`&&(0,R.jsx)(`div`,{className:`space-y-3`,children:p.map((e,t)=>(0,R.jsx)(sS.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:t*.05},children:(0,R.jsxs)(X,{className:`!p-0 overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between p-4 cursor-pointer hover:bg-gray-50 transition-colors`,onClick:()=>i(r===t?null:t),children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,R.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 text-white font-bold text-sm`,children:t+1}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`font-semibold text-gray-900`,children:e.name}),(0,R.jsxs)(`div`,{className:`text-sm text-gray-500`,children:[e.toolCalls,` 工具调用 · `,e.writeOps,` 写入 · `,e.artifacts.length,` 产物`]})]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-4`,children:[e.duration&&(0,R.jsx)(`span`,{className:`text-sm text-gray-500`,children:wf(e.duration)}),(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[e.artifacts.slice(0,3).map((e,t)=>(0,R.jsx)(fS,{variant:`success`,size:`sm`,children:e},t)),e.artifacts.length>3&&(0,R.jsxs)(fS,{variant:`default`,size:`sm`,children:[`+`,e.artifacts.length-3]})]}),r===t?(0,R.jsx)(Bs,{className:`h-5 w-5 text-gray-400`}):(0,R.jsx)(Hs,{className:`h-5 w-5 text-gray-400`})]})]}),r===t&&(0,R.jsx)(sS.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},className:`border-t border-gray-100`,children:(0,R.jsx)(`div`,{className:`p-4 max-h-96 overflow-y-auto space-y-2`,children:e.events.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-start gap-3 text-sm`,children:[(0,R.jsx)(`div`,{className:`text-gray-400 font-mono w-20 flex-shrink-0`,children:x4(Df(e.time),`HH:mm:ss`)}),(0,R.jsx)(fS,{size:`sm`,variant:e.hookType===`PostToolUse`?`success`:e.hookType===`PreToolUse`?`info`:e.hookType===`UserPromptSubmit`?`warning`:`default`,children:e.hookType}),e.toolName&&(0,R.jsx)(`span`,{className:`font-mono text-gray-700 font-medium`,children:e.toolName}),e.input&&(0,R.jsx)(`span`,{className:`text-gray-500 truncate max-w-md`,children:e.input})]},t))})})]})},t))}),a===`flow`&&(0,R.jsx)(X,{title:`数据流图 (${m.nodes.length} 节点)`,children:(0,R.jsx)(`div`,{className:`space-y-1 max-h-[600px] overflow-y-auto`,children:m.nodes.map((e,t)=>(0,R.jsxs)(sS.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:t*.02},className:`flex items-center gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col items-center w-8`,children:[t>0&&(0,R.jsx)(`div`,{className:`w-0.5 h-3 bg-gray-300`}),(0,R.jsx)(`div`,{className:q(`w-3 h-3 rounded-full border-2`,e.type===`intent`?`bg-blue-500 border-blue-500`:e.type===`artifact`?`bg-green-500 border-green-500`:e.type===`quality`?`bg-yellow-500 border-yellow-500`:`bg-gray-400 border-gray-400`)}),t<m.nodes.length-1&&(0,R.jsx)(`div`,{className:`w-0.5 h-3 bg-gray-300`})]}),(0,R.jsxs)(`div`,{className:q(`flex-1 flex items-center gap-3 p-2 rounded-lg text-sm`,e.type===`intent`?`bg-blue-50`:e.type===`artifact`?`bg-green-50`:e.type===`quality`?`bg-yellow-50`:`bg-gray-50`),children:[(0,R.jsx)(`span`,{className:`font-mono text-xs text-gray-400`,children:x4(Df(e.time),`HH:mm:ss`)}),(0,R.jsx)(fS,{size:`sm`,variant:e.type===`intent`?`info`:e.type===`artifact`?`success`:e.type===`quality`?`warning`:`default`,children:e.label}),e.detail&&(0,R.jsx)(`span`,{className:`text-gray-600 truncate`,children:e.detail})]})]},e.id))})}),a===`events`&&(0,R.jsx)(X,{title:`全部事件 (${c.events.length})`,children:(0,R.jsx)(`div`,{className:`overflow-x-auto`,children:(0,R.jsxs)(`table`,{className:`w-full`,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`类型`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`工具`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`详情`})]})}),(0,R.jsx)(`tbody`,{className:`text-sm`,children:c.events.map(e=>(0,R.jsxs)(`tr`,{className:`border-t border-gray-50 hover:bg-gray-50`,children:[(0,R.jsx)(`td`,{className:`py-2 font-mono text-gray-500`,children:x4(Df(e.timestamp),`HH:mm:ss`)}),(0,R.jsx)(`td`,{className:`py-2`,children:(0,R.jsx)(fS,{size:`sm`,variant:e.hook_type===`PostToolUse`?`success`:e.hook_type===`UserPromptSubmit`?`warning`:`default`,children:e.hook_type})}),(0,R.jsx)(`td`,{className:`py-2 font-mono`,children:e.tool_name||`-`}),(0,R.jsx)(`td`,{className:`py-2 text-gray-500 truncate max-w-md`,children:typeof e.tool_input==`string`?e.tool_input.slice(0,80):``})]},e.id))})]})})}),(0,R.jsx)(X,{title:`工具使用分布`,children:(0,R.jsx)(Dk,{width:`100%`,height:250,children:(0,R.jsxs)(K0,{data:_,layout:`vertical`,children:[(0,R.jsx)(XX,{strokeDasharray:`3 3`,stroke:`#e5e7eb`}),(0,R.jsx)(Y$,{type:`number`}),(0,R.jsx)(u1,{dataKey:`name`,type:`category`,width:80,tick:{fontSize:12}}),(0,R.jsx)(VW,{}),(0,R.jsx)(O$,{dataKey:`value`,fill:`#3b82f6`,radius:[0,4,4,0]})]})})})]})}var Q4={PreToolUse:`bg-blue-100 text-blue-700`,PostToolUse:`bg-green-100 text-green-700`,UserPromptSubmit:`bg-amber-100 text-amber-700`,Stop:`bg-red-100 text-red-700`,Notification:`bg-purple-100 text-purple-700`};function $4(e){if(!e)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function e3(e){if(e.hook_type===`UserPromptSubmit`){let t=e.user_prompt;return{title:`用户输入`,subtitle:t?t.slice(0,80):`用户提交了新请求`}}if(e.tool_name){let t=e.tool_input;return t?.file_path?{title:`${e.tool_name} 文件`,subtitle:String(t.file_path).split(`/`).slice(-2).join(`/`)}:t?.command?{title:`${e.tool_name} 命令`,subtitle:String(t.command).slice(0,100)}:t?.pattern?{title:`${e.tool_name} 搜索`,subtitle:String(t.pattern)}:{title:e.tool_name,subtitle:e.hook_type}}return{title:e.hook_type,subtitle:e.project_path.split(`/`).pop()||``}}function t3(){let e=Ye(),[t,n]=(0,L.useState)(200),[r,i]=(0,L.useState)(``),[a,o]=(0,L.useState)(``),[s,c]=(0,L.useState)(``),[l,u]=(0,L.useState)(null),[d,f]=(0,L.useState)(``),p=cS(d),[m,h]=(0,L.useState)(``),[g,_]=(0,L.useState)(``),[v,y]=(0,L.useState)(`all`),[b,x]=(0,L.useState)(30),[S,C]=(0,L.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),w=(0,L.useRef)(null),T=v===`all`?void 0:x4(C4(new Date,v===`1d`?1:v===`7d`?7:30),`yyyy-MM-dd'T'HH:mm:ss`),{data:E,isLoading:D,isError:O,refetch:k}=ut({queryKey:[`events`,{limit:t,tool_name:r||void 0,start_time:T,search:m||void 0}],queryFn:()=>hl({limit:t,tool_name:r||void 0,start_time:T,search:m||void 0}).then(e=>e.data)}),A=z({mutationFn:e=>gu(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`events`]})}}),j=E?.items.filter(e=>!(a&&e.hook_type!==a||s&&e.project_path.split(`/`).pop()!==s||p&&![e.tool_name,$4(e.tool_input),$4(e.tool_output)].join(` `).toLowerCase().includes(p.toLowerCase())))||[],M=G4({count:j.length,getScrollElement:()=>w.current,estimateSize:()=>120,overscan:5});if(D)return(0,R.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,R.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});if(O)return(0,R.jsx)(q4,{message:`事件数据加载失败`,onRetry:()=>k()});let N=Array.from(new Set(E?.items.map(e=>e.project_path.split(`/`).pop()||``).filter(Boolean)||[])),ee=j.reduce((e,t)=>{let n=t.tool_name||`N/A`;return e[n]=(e[n]||0)+1,e},{}),te=Object.entries(ee).sort((e,t)=>t[1]-e[1]).slice(0,10),P=Array.from(new Set(E?.items.map(e=>e.hook_type)||[]));return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-3 items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-3 items-center flex-1`,children:[(0,R.jsxs)(`div`,{className:`relative flex-1 min-w-[240px] max-w-sm`,children:[(0,R.jsx)(Lc,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,R.jsx)(`input`,{type:`text`,placeholder:`实时过滤:工具名、文件名...`,value:d,onChange:e=>{f(e.target.value)},className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm`})]}),(0,R.jsx)(`div`,{className:`relative min-w-[200px] max-w-xs`,children:(0,R.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),h(g)},children:[(0,R.jsx)(`input`,{type:`text`,placeholder:`全文搜索内容(回车提交)...`,value:g,onChange:e=>_(e.target.value),className:q(`w-full pl-3 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm`,m?`border-blue-400 bg-blue-50`:`border-gray-200`)}),m&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>{h(``),_(``)},className:`absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 text-xs`,children:`✕`})]})}),(0,R.jsxs)(`select`,{value:a,onChange:e=>{o(e.target.value)},className:`px-3 py-2 border border-gray-200 rounded-lg text-sm`,children:[(0,R.jsx)(`option`,{value:``,children:`全部类型`}),P.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]}),(0,R.jsxs)(`select`,{value:s,onChange:e=>{c(e.target.value)},className:`px-3 py-2 border border-gray-200 rounded-lg text-sm`,children:[(0,R.jsx)(`option`,{value:``,children:`全部项目`}),N.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1 border border-gray-200 rounded-lg overflow-hidden text-sm`,children:[(0,R.jsx)(Is,{className:`h-3.5 w-3.5 text-gray-400 ml-2`}),[`all`,`1d`,`7d`,`30d`].map(e=>(0,R.jsx)(`button`,{onClick:()=>{y(e)},className:q(`px-2.5 py-2 transition-colors`,v===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:e===`all`?`全部`:e},e))]}),(0,R.jsxs)(`select`,{value:t,onChange:e=>n(Number(e.target.value)),className:`px-3 py-2 border border-gray-200 rounded-lg text-sm`,children:[(0,R.jsx)(`option`,{value:500,children:`500 条`}),(0,R.jsx)(`option`,{value:1e3,children:`1000 条`}),(0,R.jsx)(`option`,{value:2e3,children:`2000 条`}),(0,R.jsx)(`option`,{value:5e3,children:`5000 条`})]})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,R.jsxs)(`select`,{value:b,onChange:e=>x(Number(e.target.value)),className:`px-2 py-1.5 border border-gray-200 rounded-lg text-sm`,children:[(0,R.jsx)(`option`,{value:7,children:`7天`}),(0,R.jsx)(`option`,{value:30,children:`30天`}),(0,R.jsx)(`option`,{value:90,children:`90天`})]}),(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:nc,onClick:()=>{let e=[`时间`,`类型`,`工具`,`项目`,`会话ID`,`摘要`],t=j.map(e=>{let t=e3(e);return[e.timestamp,e.hook_type,e.tool_name||``,e.project_path.split(`/`).pop()||``,e.session_id.slice(0,12),t.subtitle]});K4(`events-${x4(new Date,`yyyyMMdd-HHmmss`)}.csv`,e,t)},children:`导出`}),(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Jc,onClick:()=>{C({open:!0,title:`清理历史事件`,description:`确认清理 ${b} 天前的已蒸馏事件?此操作不可撤销。`,onConfirm:()=>{A.mutate(b),C({...S,open:!1})}})},loading:A.isPending,children:`清理历史`}),(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Pc,onClick:()=>k(),children:`刷新`})]})]})}),(0,R.jsx)(X,{title:`工具使用频率`,children:(0,R.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:te.map(([e,t])=>(0,R.jsxs)(`button`,{onClick:()=>{i(r===e?``:e)},className:q(`px-3 py-1.5 rounded-full text-sm transition-all`,r===e?`bg-blue-100 text-blue-700 border-2 border-blue-300`:`bg-gray-100 text-gray-700 hover:bg-gray-200 border-2 border-transparent`),children:[(0,R.jsx)(`span`,{className:`font-medium`,children:e}),(0,R.jsx)(`span`,{className:`ml-1 text-xs opacity-70`,children:t})]},e))})}),(0,R.jsx)(X,{title:`执行轨迹 (${j.length})`,children:(0,R.jsx)(`div`,{ref:w,className:`h-[600px] overflow-auto`,style:{contain:`strict`},children:(0,R.jsx)(`div`,{style:{height:`${M.getTotalSize()}px`,width:`100%`,position:`relative`},children:M.getVirtualItems().map(e=>{let t=j[e.index],n=e3(t),r=l===t.event_id;return(0,R.jsx)(`div`,{"data-index":e.index,ref:M.measureElement,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},className:`pb-2`,children:(0,R.jsxs)(`div`,{className:`border border-gray-100 rounded-lg overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between p-3 hover:bg-gray-50 cursor-pointer`,onClick:()=>u(r?null:t.event_id),children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,R.jsx)(`button`,{className:`text-gray-400`,children:r?(0,R.jsx)(Bs,{className:`h-4 w-4`}):(0,R.jsx)(Hs,{className:`h-4 w-4`})}),(0,R.jsx)(fS,{size:`sm`,className:Q4[t.hook_type]||`bg-gray-100 text-gray-700`,children:t.hook_type}),t.tool_name&&(0,R.jsxs)(`div`,{className:`flex items-center gap-1 text-sm text-gray-700 flex-shrink-0`,children:[t.tool_name===`Bash`?(0,R.jsx)(Kc,{className:`h-4 w-4`}):(0,R.jsx)(oc,{className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`font-mono`,children:t.tool_name})]}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`text-sm font-medium text-gray-900 truncate`,children:n.title}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500 truncate`,children:n.subtitle})]})]}),(0,R.jsx)(`div`,{className:`text-xs text-gray-400 font-mono ml-3`,children:x4(Df(t.timestamp),`HH:mm:ss`)})]}),(0,R.jsx)(gb,{children:r&&(0,R.jsx)(sS.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},className:`border-t border-gray-100 bg-gray-50`,children:(0,R.jsxs)(`div`,{className:`p-4 space-y-4`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3 text-xs`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-gray-400 mb-1`,children:`会话`}),(0,R.jsxs)(`div`,{className:`font-mono text-gray-700`,children:[t.session_id.slice(0,12),`...`]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-gray-400 mb-1`,children:`项目`}),(0,R.jsx)(`div`,{className:`text-gray-700`,children:t.project_path.split(`/`).pop()})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-gray-400 mb-1`,children:`时间`}),(0,R.jsx)(`div`,{className:`font-mono text-gray-700`,children:t.timestamp})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-gray-400 mb-1`,children:`类型`}),(0,R.jsx)(`div`,{className:`text-gray-700`,children:t.hook_type})]})]}),t.tool_input&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-gray-500 mb-2 uppercase tracking-wider`,children:[(0,R.jsx)(Tc,{className:`h-3 w-3`}),` 输入`]}),(0,R.jsx)(`pre`,{className:`bg-white p-3 rounded-lg text-xs font-mono overflow-x-auto border border-gray-200 text-gray-700 whitespace-pre-wrap break-all`,children:$4(t.tool_input)})]}),t.tool_output&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-gray-500 mb-2 uppercase tracking-wider`,children:[(0,R.jsx)(Ns,{className:`h-3 w-3`}),` 输出`]}),(0,R.jsx)(`pre`,{className:`bg-white p-3 rounded-lg text-xs font-mono overflow-x-auto border border-gray-200 text-gray-700 whitespace-pre-wrap break-all max-h-64 overflow-y-auto`,children:$4(t.tool_output)})]})]})})})]})},t.event_id)})})})}),(0,R.jsx)(w4,{open:S.open,title:S.title,description:S.description,variant:`danger`,onConfirm:S.onConfirm,onCancel:()=>C({...S,open:!1})})]})}function n3({currentPage:e,totalPages:t,onPageChange:n,pageSize:r,onPageSizeChange:i,totalItems:a}){return(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-t border-gray-200`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,R.jsxs)(`span`,{className:`text-sm text-gray-600`,children:[`显示 `,(e-1)*r+1,`-`,Math.min(e*r,a),` / 共 `,a,` 条`]}),(0,R.jsxs)(`select`,{value:r,onChange:e=>i(Number(e.target.value)),className:`px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:10,children:`10 条/页`}),(0,R.jsx)(`option`,{value:20,children:`20 条/页`}),(0,R.jsx)(`option`,{value:50,children:`50 条/页`}),(0,R.jsx)(`option`,{value:100,children:`100 条/页`})]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Vs,onClick:()=>n(e-1),disabled:e===1,children:`上一页`}),(0,R.jsx)(`div`,{className:`flex items-center gap-1`,children:Array.from({length:Math.min(t,7)},(r,i)=>{let a;return a=t<=7||e<=4?i+1:e>=t-3?t-6+i:e-3+i,(0,R.jsx)(`button`,{onClick:()=>n(a),className:`px-3 py-1.5 text-sm rounded-lg transition-colors ${e===a?`bg-blue-600 text-white`:`text-gray-600 hover:bg-gray-100`}`,children:a},a)})}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Hs,onClick:()=>n(e+1),disabled:e===t,children:`下一页`})]})]})}function r3(){let e=Ye(),t=Fn(),[n,r]=(0,L.useState)(``),i=cS(n),[a,o]=(0,L.useState)(``),[s,c]=(0,L.useState)(`all`),[l,u]=(0,L.useState)(1),[d,f]=(0,L.useState)(20),[p,m]=(0,L.useState)(new Set),[h,g]=(0,L.useState)(``),[_,v]=(0,L.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),{data:y,isLoading:b,isError:x,refetch:S}=ut({queryKey:[`pipelines`,`active`],queryFn:()=>_l({status:`active`,page_size:100}).then(e=>e.data),refetchInterval:1e4}),{data:C,refetch:w}=ut({queryKey:[`pipelines`,`completed`,i,a,l,d],queryFn:()=>_l({status:`completed`,search:i||void 0,complexity:a||void 0,page:l,page_size:d}).then(e=>e.data)}),T=z({mutationFn:e=>Nl(e),onSuccess:()=>e.invalidateQueries({queryKey:[`pipelines`]})}),E=z({mutationFn:()=>Il(),onSuccess:()=>e.invalidateQueries({queryKey:[`pipelines`]})}),D=z({mutationFn:e=>Fl(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`pipelines`]}),m(new Set)}});if(b)return(0,R.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,R.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});if(x)return(0,R.jsx)(q4,{message:`Pipeline 数据加载失败`,onRetry:()=>S()});let O=y?.items||[],k=C?.items||[],A=C?.total||0,j=O.filter(e=>!h||e.requirement.toLowerCase().includes(h.toLowerCase())||e.project.toLowerCase().includes(h.toLowerCase())),M=s===`all`||s===`active`,N=s===`all`||s===`completed`,ee=Math.ceil(A/d);return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,R.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[O.length,` 个活跃 · `,A,` 个已完成`,p.size>0&&` · 已选 ${p.size} 个`]}),(0,R.jsxs)(`select`,{value:s,onChange:e=>{c(e.target.value),u(1)},className:`px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:`all`,children:`全部状态`}),(0,R.jsx)(`option`,{value:`active`,children:`仅活跃`}),(0,R.jsx)(`option`,{value:`completed`,children:`仅已完成`})]})]}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[j.length>0&&p.size>0&&(0,R.jsxs)(Y,{variant:`danger`,size:`sm`,icon:el,onClick:()=>{p.size!==0&&v({open:!0,title:`批量关闭 Pipeline`,description:`确认关闭选中的 ${p.size} 个 Pipeline?`,count:p.size,onConfirm:()=>{D.mutate(Array.from(p)),v(e=>({...e,open:!1}))}})},loading:D.isPending,children:[`批量关闭 (`,p.size,`)`]}),j.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,onClick:()=>{p.size===j.length?m(new Set):m(new Set(j.map(e=>e.id)))},children:p.size===j.length?`取消全选`:`全选`}),(0,R.jsx)(Y,{variant:`danger`,size:`sm`,icon:Jc,onClick:()=>{v({open:!0,title:`清理过期 Pipeline`,description:`确认关闭所有过期 Pipeline?`,onConfirm:()=>{E.mutate(),v(e=>({...e,open:!1}))}})},loading:E.isPending,children:`清理过期`})]}),(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Pc,onClick:()=>S(),children:`刷新`}),(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:nc,onClick:()=>{let e=[...O,...k];K4(`pipelines-${x4(new Date,`yyyyMMdd-HHmmss`)}.csv`,[`ID`,`需求`,`复杂度`,`状态`,`项目`,`创建时间`],e.map(e=>[e.id,e.requirement,e.complexity,e.status,e.project,e.createdAt]))},children:`导出 CSV`})]})]}),M&&O.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,R.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-500 uppercase tracking-wider`,children:[`活跃中 (`,j.length,`/`,O.length,`)`]}),(0,R.jsxs)(`div`,{className:`relative w-64`,children:[(0,R.jsx)(Lc,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,R.jsx)(`input`,{type:`text`,placeholder:`搜索活跃 Pipeline...`,value:h,onChange:e=>g(e.target.value),className:`w-full pl-10 pr-4 py-1.5 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm`})]})]}),(0,R.jsx)(`div`,{className:`space-y-3`,children:j.map((e,n)=>(0,R.jsx)(sS.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:n*.05},children:(0,R.jsx)(X,{className:`!p-0 overflow-hidden cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>t(`/pipelines/${e.id}`),children:(0,R.jsxs)(`div`,{className:`flex items-center justify-between p-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-4 flex-1 min-w-0`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:p.has(e.id),onChange:t=>{t.stopPropagation(),m(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})},onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded border-gray-300 text-blue-600 flex-shrink-0`}),(0,R.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg`,style:{backgroundColor:`#10b98120`},children:(0,R.jsx)(pc,{className:`h-5 w-5`,style:{color:`#10b981`}})}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsx)(`div`,{className:`font-medium text-gray-900 truncate`,children:e.requirement}),(0,R.jsxs)(`div`,{className:`text-sm text-gray-500 flex items-center gap-3 mt-1`,children:[(0,R.jsx)(fS,{variant:`primary`,size:`sm`,children:`动态`}),(0,R.jsx)(`span`,{children:e.project}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(Ys,{className:`h-3 w-3`}),x4(Df(e.createdAt),`MM-dd HH:mm`)]})]}),e.type===`dynamic`&&e.nodeConfig&&(0,R.jsxs)(`div`,{className:`mt-2 flex items-center gap-3 text-xs text-gray-600`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(pc,{className:`h-3 w-3`}),e.nodeConfig.totalNodes,` 个节点`]}),e.nodeConfig.boundSkills.length>0&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[`⚡ `,e.nodeConfig.boundSkills.length,` 个技能`]}),(0,R.jsxs)(`span`,{className:`text-gray-400`,children:[`节点类型:`,e.nodeConfig.nodeTypes.map(e=>e.split(/[_\-.]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `)).join(` → `)]})]})]})]}),(0,R.jsx)(Y,{variant:`danger`,size:`sm`,icon:el,onClick:()=>{v({open:!0,title:`关闭 Pipeline`,description:`确认关闭此 Pipeline?`,onConfirm:()=>{T.mutate(e.id),v(e=>({...e,open:!1}))}})},loading:T.isPending,children:`关闭`})]})})},e.id))})]}),N&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold text-gray-500 uppercase tracking-wider mb-3`,children:`历史记录`}),(0,R.jsxs)(X,{children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-3 items-center mb-4 pb-4 border-b border-gray-100`,children:[(0,R.jsxs)(`div`,{className:`relative flex-1 min-w-[240px] max-w-sm`,children:[(0,R.jsx)(Lc,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,R.jsx)(`input`,{type:`text`,placeholder:`搜索需求描述...`,value:n,onChange:e=>{r(e.target.value),u(1)},className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm`})]}),(0,R.jsxs)(`select`,{value:a,onChange:e=>{o(e.target.value),u(1)},className:`px-3 py-2 border border-gray-200 rounded-lg text-sm`,children:[(0,R.jsx)(`option`,{value:``,children:`全部复杂度`}),(0,R.jsx)(`option`,{value:`simple`,children:`简单`}),(0,R.jsx)(`option`,{value:`moderate`,children:`中等`}),(0,R.jsx)(`option`,{value:`complex`,children:`复杂`})]})]}),(0,R.jsx)(`div`,{className:`overflow-x-auto`,children:(0,R.jsxs)(`table`,{className:`w-full`,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`需求`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`项目`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`类型`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`复杂度`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`操作`})]})}),(0,R.jsx)(`tbody`,{className:`text-sm`,children:k.map(e=>(0,R.jsxs)(`tr`,{className:`border-t border-gray-50 hover:bg-gray-50 cursor-pointer`,onClick:()=>t(`/pipelines/${e.id}`),children:[(0,R.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.requirement}),(0,R.jsx)(`td`,{className:`py-3`,children:e.project}),(0,R.jsx)(`td`,{className:`py-3`,children:(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(fS,{size:`sm`,variant:`primary`,children:`动态编排`}),e.nodeConfig&&(0,R.jsxs)(`div`,{className:`text-xs text-gray-500 space-y-0.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(pc,{className:`h-3 w-3`}),e.nodeConfig.totalNodes,` 节点`,e.nodeConfig.boundSkills.length>0&&(0,R.jsxs)(`span`,{className:`ml-1`,children:[`· ⚡ `,e.nodeConfig.boundSkills.length,` 技能`]})]}),(0,R.jsx)(`div`,{className:`text-gray-400 max-w-[200px] truncate`,children:e.nodeConfig.nodeTypes.map(e=>e.split(/[_\-.]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `)).join(` → `)})]})]})}),(0,R.jsx)(`td`,{className:`py-3`,children:(0,R.jsx)(fS,{size:`sm`,variant:e.complexity===`complex`?`danger`:e.complexity===`moderate`?`warning`:`default`,children:e.complexity||`-`})}),(0,R.jsx)(`td`,{className:`py-3 text-gray-500`,children:x4(Df(e.createdAt),`MM-dd HH:mm`)}),(0,R.jsx)(`td`,{className:`py-3`,children:(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:ac,onClick:n=>{n.stopPropagation(),t(`/pipelines/${e.id}`)},children:`查看`})})]},e.id))})]})}),A===0&&(0,R.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:`暂无历史记录`}),A>0&&(0,R.jsx)(n3,{currentPage:l,totalPages:ee,onPageChange:u,pageSize:d,onPageSizeChange:e=>{f(e),u(1)},totalItems:A})]})]}),(0,R.jsx)(w4,{open:_.open,title:_.title,description:_.description,count:_.count,variant:`danger`,onConfirm:_.onConfirm,onCancel:()=>v({..._,open:!1})})]})}var i3={pending:Js,running:Ys,validating:Fc,passed:Gs,failed:qs,need_human:Ws},a3={pending:`text-gray-400`,running:`text-blue-500`,validating:`text-yellow-500`,passed:`text-green-500`,failed:`text-red-500`,need_human:`text-orange-500`},o3={pending:`待执行`,running:`执行中`,validating:`验证中`,passed:`已完成`,failed:`失败`,need_human:`需人工介入`};function s3({steps:e,currentStepId:t}){return!e||e.length===0?null:(0,R.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,R.jsxs)(`div`,{className:`text-sm font-medium text-gray-700 dark:text-gray-300 mb-2`,children:[`步骤进度 (`,e.filter(e=>e.status===`passed`).length,`/`,e.length,`)`]}),(0,R.jsx)(`div`,{className:`space-y-2`,children:e.map((e,n)=>{let r=i3[e.status],i=e.id===t;return(0,R.jsxs)(`div`,{className:q(`flex items-start gap-3 p-3 rounded-lg border transition-colors`,i?`bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800`:`bg-gray-50 dark:bg-gray-800/50 border-gray-200 dark:border-gray-700`),children:[(0,R.jsx)(`div`,{className:`flex-shrink-0 w-6 h-6 rounded-full bg-gray-200 dark:bg-gray-700 flex items-center justify-center text-xs font-medium`,children:n+1}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,R.jsx)(r,{className:q(`w-4 h-4`,a3[e.status])}),(0,R.jsx)(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:e.stepName}),(0,R.jsx)(fS,{variant:e.status===`passed`?`success`:e.status===`failed`?`error`:`default`,children:o3[e.status]}),i&&(0,R.jsx)(fS,{variant:`info`,children:`当前`})]}),e.attempts>0&&(0,R.jsxs)(`div`,{className:`text-xs text-gray-500 dark:text-gray-400 mb-1`,children:[`重试次数:`,e.attempts]}),e.failureReason&&(0,R.jsxs)(`div`,{className:`text-xs text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 p-2 rounded mt-1`,children:[`失败原因:`,e.failureReason]}),e.outputs&&Object.keys(e.outputs).length>0&&(0,R.jsxs)(`div`,{className:`mt-2 text-xs`,children:[(0,R.jsx)(`div`,{className:`text-gray-600 dark:text-gray-400 mb-1`,children:`输出产物:`}),(0,R.jsx)(`div`,{className:`space-y-1`,children:Object.entries(e.outputs).map(([e,t])=>(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-700 dark:text-gray-300`,children:[(0,R.jsxs)(`span`,{className:`font-medium`,children:[e,`:`]}),(0,R.jsx)(`a`,{href:`file://${t}`,className:`text-blue-600 dark:text-blue-400 hover:underline truncate`,title:t,children:t})]},e))})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-4 mt-2 text-xs text-gray-500 dark:text-gray-400`,children:[e.startedAt&&(0,R.jsxs)(`span`,{children:[`开始:`,x4(new Date(e.startedAt),`HH:mm:ss`)]}),e.completedAt&&(0,R.jsxs)(`span`,{children:[`完成:`,x4(new Date(e.completedAt),`HH:mm:ss`)]})]})]})]},e.id)})})]})}var c3={document:cc,code:Xs,test:qc,config:Rc,diagram:gc,data:ec,other:lc},l3={analyze:{name:`需求分析`,description:`分析需求,明确目标和范围`},design:{name:`架构设计`,description:`设计系统架构和技术方案`},profile:{name:`性能分析`,description:`分析性能瓶颈,制定优化方案`},code:{name:`编码实现`,description:`编写代码,实现功能`},test:{name:`测试验证`,description:`编写测试,验证功能正确性`},review:{name:`代码审查`,description:`审查代码质量和规范`}},u3={analy:`#3b82f6`,design:`#8b5cf6`,architect:`#8b5cf6`,profile:`#06b6d4`,code:`#10b981`,implement:`#10b981`,test:`#f59e0b`,verif:`#f59e0b`,review:`#ef4444`,deploy:`#06b6d4`};function d3(e){let t=e.toLowerCase();for(let[e,n]of Object.entries(u3))if(t.includes(e))return n;return`#6b7280`}function f3(e){let t=l3[e];return t?t.name:e.split(/[_\-.]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `)}function p3(e){return l3[e]?.description||null}function m3(e){let t=new Set,n=[],r=new Map(e.map(e=>[e.id,e]));function i(e){if(t.has(e))return;t.add(e);let a=r.get(e);a&&((a.dependencies||[]).forEach(e=>i(e)),n.push(a))}return e.forEach(e=>i(e.id)),n}function h3(e,t){if(!e)return null;let n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),i=Math.floor((r-n)/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}function g3({pipeline:e,onRetryNode:t}){let[n,r]=(0,L.useState)(new Set),i=(0,L.useMemo)(()=>m3(e.nodes),[e.nodes]),a=i.filter(e=>e.status===`completed`||e.status===`skipped`).length,o=i.length>0&&i.every(e=>e.status===`completed`||e.status===`skipped`||e.status===`failed`),s=o?-1:i.findIndex(t=>t.id===e.currentNodeId),c=e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return i.length===0?(0,R.jsx)(X,{children:(0,R.jsx)(`div`,{className:`text-center py-8 text-gray-400`,children:`暂无节点`})}):(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(X,{className:`!p-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,R.jsxs)(`span`,{className:`text-sm font-medium text-gray-700`,children:[`编排阶段 · `,a,`/`,i.length,` 已完成`]}),(0,R.jsx)(`span`,{className:`text-xs text-gray-400`,children:o||e.status===`completed`?`✅ 全部完成`:e.status===`failed`?`❌ 已失败`:s>=0?`当前:第 ${s+1} 阶段`:`准备中`})]}),(0,R.jsx)(`div`,{className:`flex items-start gap-0 overflow-x-auto pb-1`,children:i.map((t,n)=>{let r=t.id===e.currentNodeId,a=t.status===`completed`,o=t.status===`failed`,s=t.status===`skipped`,c=d3(t.nodeTypeId),l=o?`#ef4444`:s?`#9ca3af`:a||r?c:void 0;return(0,R.jsxs)(`div`,{className:`flex items-center flex-shrink-0`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,R.jsx)(`div`,{className:q(`w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold transition-all`,l?`text-white`:`bg-gray-100 text-gray-400`,r&&`ring-4 ring-offset-2`),style:l?{backgroundColor:l,...r?{ringColor:`${c}40`}:{}}:{},children:a?`✓`:o?`✗`:s?`—`:n+1}),(0,R.jsx)(`span`,{className:q(`text-xs mt-1 max-w-[72px] text-center leading-tight break-words`,r?`font-bold text-gray-900`:`text-gray-500`),children:f3(t.nodeTypeId)})]}),n<i.length-1&&(0,R.jsx)(`div`,{className:q(`h-0.5 w-6 mx-0.5 mb-5 flex-shrink-0 transition-colors`,a?`bg-green-400`:`bg-gray-200`)})]},t.id)})})]}),(0,R.jsx)(`div`,{className:`space-y-3`,children:i.map((r,a)=>{let o=r.id===e.currentNodeId,s=d3(r.nodeTypeId),l=f3(r.nodeTypeId),u=p3(r.nodeTypeId),d=h3(r.startedAt,r.completedAt),f=n.has(r.id),p=null,m=null;if(r.output)try{let e=JSON.parse(r.output);e.artifacts&&e.validation?p=e:m=r.output}catch{m=r.output}let h=m?m.trim().split(`
68
- `):[],g=h.length>10,_=(r.dependencies||[]).map(e=>{let t=i.find(t=>t.id===e);return t?f3(t.nodeTypeId):e.slice(0,8)});return(0,R.jsxs)(X,{className:q(`!p-0 overflow-hidden transition-all`,o?`ring-2 ring-blue-400 ring-offset-1`:``),children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 p-4`,children:[(0,R.jsx)(`div`,{className:`w-10 h-10 rounded-full flex items-center justify-center text-white font-bold text-sm flex-shrink-0`,style:{backgroundColor:r.status===`pending`?`#d1d5db`:r.status===`failed`?`#ef4444`:r.status===`skipped`?`#9ca3af`:s},children:r.status===`completed`?`✓`:r.status===`failed`?`✗`:r.status===`skipped`?`—`:a+1}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-gray-900`,children:l}),o&&(0,R.jsx)(fS,{variant:`info`,size:`sm`,children:`当前阶段`}),(0,R.jsx)(fS,{size:`sm`,variant:r.status===`completed`?`success`:r.status===`in_progress`?`info`:r.status===`failed`?`danger`:r.status===`skipped`?`warning`:`default`,children:r.status===`completed`?`已完成`:r.status===`in_progress`?`执行中`:r.status===`failed`?`失败`:r.status===`skipped`?`已跳过`:`等待中`}),d&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-gray-400`,children:[(0,R.jsx)(Ys,{className:`w-3 h-3`}),d]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-0.5 mt-1`,children:[u&&(0,R.jsx)(`span`,{className:`text-xs text-gray-500`,children:u}),r.boundSkillName&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-amber-600`,children:[(0,R.jsx)(tl,{className:`w-3 h-3`}),r.boundSkillName]}),_.length>0&&(0,R.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`依赖:`,_.join(`, `)]}),r.completedAt&&(0,R.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`完成于 `,x4(new Date(r.completedAt),`HH:mm:ss`)]})]})]}),r.status===`failed`&&t&&(0,R.jsx)(Y,{variant:`outline`,size:`sm`,icon:Fc,onClick:()=>t(r.id),className:`flex-shrink-0`,children:`重试`})]}),p&&(0,R.jsxs)(`div`,{className:`border-t border-gray-100 bg-gray-50 px-4 pt-3 pb-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,R.jsx)(`span`,{className:`text-xs font-semibold text-gray-500 uppercase tracking-wider`,children:`阶段产出`}),!p.validation.passed&&(0,R.jsx)(fS,{variant:`danger`,size:`sm`,children:`验证失败`})]}),p.summary&&(0,R.jsx)(`div`,{className:`text-sm text-gray-700 mb-3`,children:p.summary}),p.artifacts.length>0&&(0,R.jsx)(`div`,{className:`space-y-2`,children:p.artifacts.map((e,t)=>(0,R.jsx)(`div`,{className:`bg-white rounded-lg border border-gray-200 p-3`,children:(0,R.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,R.jsx)(c3[e.type]||lc,{className:`w-4 h-4 text-gray-400 mt-0.5 flex-shrink-0`}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsx)(`div`,{className:`font-mono text-sm text-gray-900 break-all`,children:e.path}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 text-xs text-gray-500`,children:[(0,R.jsx)(`span`,{className:`capitalize`,children:e.type}),e.size_bytes&&(0,R.jsxs)(`span`,{children:[`· `,(e.size_bytes/1024).toFixed(1),` KB`]}),(0,R.jsxs)(`span`,{children:[`· `,x4(new Date(e.created_at),`HH:mm:ss`)]})]})]})]})},t))}),p.validation.errors&&p.validation.errors.length>0&&(0,R.jsx)(`div`,{className:`mt-3 p-2 bg-red-50 border border-red-200 rounded text-xs text-red-700`,children:p.validation.errors.map((e,t)=>(0,R.jsxs)(`div`,{children:[`• `,e]},t))})]}),!p&&h.length>0&&(0,R.jsxs)(`div`,{className:`border-t border-gray-100 bg-gray-50 px-4 pt-3 pb-4`,children:[(0,R.jsx)(`span`,{className:`text-xs font-semibold text-gray-500 uppercase tracking-wider`,children:`阶段产出`}),(0,R.jsx)(`div`,{className:q(`mt-2 text-sm text-gray-800 whitespace-pre-wrap font-mono bg-white rounded-lg border border-gray-100 p-3 leading-relaxed`,!f&&g?`max-h-52 overflow-hidden`:``),children:!f&&g?h.slice(0,10).join(`
69
- `)+`
70
- …`:m}),g&&(0,R.jsx)(`button`,{onClick:()=>c(r.id),className:`mt-2 text-xs text-blue-600 hover:underline flex items-center gap-1`,children:f?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Us,{className:`w-3 h-3`}),`收起`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Bs,{className:`w-3 h-3`}),`展开全部(`,h.length,` 行)`]})})]}),r.stepExecutions&&r.stepExecutions.length>0&&(0,R.jsx)(`div`,{className:`border-t border-gray-100 bg-white px-4 py-3`,children:(0,R.jsx)(s3,{steps:r.stepExecutions,currentStepId:r.currentStepId})}),r.status===`in_progress`&&h.length===0&&(0,R.jsxs)(`div`,{className:`border-t border-blue-100 bg-blue-50 px-4 py-3 flex items-center gap-2 text-sm text-blue-600`,children:[(0,R.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-blue-500 animate-pulse`}),`正在执行,等待产出…`]})]},r.id)})})]})}var _3={PreToolUse:`#3b82f6`,PostToolUse:`#10b981`,UserPromptSubmit:`#f59e0b`,Stop:`#ef4444`};function v3(){let{id:e}=Ln(),t=Fn(),n=Mn(),r=Ye(),[i,a]=(0,L.useState)(`tasks`),[o,s]=(0,L.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),c=n.state?.from||`/pipelines`,{data:l,isLoading:u,isError:d,error:f}=ut({queryKey:[`pipeline`,e],queryFn:()=>vl(e).then(e=>e.data),enabled:!!e,refetchInterval:5e3}),p=z({mutationFn:()=>Nl(e),onSuccess:()=>{r.invalidateQueries({queryKey:[`pipeline`,e]}),t(c)},onError:e=>H(e.message||`关闭失败`,`error`)}),m=z({mutationFn:()=>Pl(e),onSuccess:()=>{r.invalidateQueries({queryKey:[`pipeline`,e]}),H(`Pipeline 已重新激活`,`success`)},onError:e=>H(e.message||`重新激活失败`,`error`)}),h=z({mutationFn:()=>Rl(e),onSuccess:()=>{H(`已添加到执行队列,下次工具调用时自动注入提示`,`success`)},onError:e=>H(e.message||`恢复失败`,`error`)}),g=z({mutationFn:t=>zl(e),onSuccess:t=>{r.invalidateQueries({queryKey:[`pipeline`,e]}),H(t.data.message||`节点已重置,等待重新执行`,`success`)},onError:e=>H(e.message||`重试失败`,`error`)}),_=z({mutationFn:e=>nu(e),onSuccess:()=>{r.invalidateQueries({queryKey:[`pipeline`,e]}),H(`问题已标记为已解决`,`success`)},onError:e=>H(e.message||`操作失败`,`error`)}),v=z({mutationFn:e=>ru(e),onSuccess:()=>{r.invalidateQueries({queryKey:[`pipeline`,e]}),H(`问题已忽略`,`success`)},onError:e=>H(e.message||`操作失败`,`error`)});if(d)return(0,R.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,f?.message||`未知错误`]});if(u||!l)return(0,R.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,R.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let y=l,b=y.status!==`completed`&&y.status!==`failed`;return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsx)(X4,{items:[{label:`Pipeline 列表`,path:`/pipelines`},{label:l.id.slice(0,12)+`...`}]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:ks,onClick:()=>t(c),children:`返回`}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-bold text-gray-900`,children:`Pipeline 执行轨迹`}),(0,R.jsxs)(fS,{variant:`primary`,size:`sm`,children:[(0,R.jsx)(Qc,{className:`w-3 h-3 mr-1`}),` 动态编排`]})]}),(0,R.jsxs)(`p`,{className:`text-sm text-gray-500`,children:[(0,R.jsx)(`span`,{className:`font-mono`,children:l.id.slice(0,12)}),l.sessionId&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`mx-2`,children:`·`}),(0,R.jsxs)(`span`,{className:`text-blue-600 cursor-pointer hover:underline`,onClick:()=>t(`/sessions/${l.sessionId}`),children:[`会话 `,l.sessionId.slice(0,8)]})]})]})]}),(0,R.jsx)(fS,{variant:b?`info`:`success`,children:y.status===`completed`?`已完成`:y.status===`failed`?`已失败`:`执行中`}),(0,R.jsx)(fS,{variant:l.complexity===`complex`?`danger`:l.complexity===`moderate`?`warning`:`default`,children:l.complexity})]}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[l.sessionId&&(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Ds,onClick:()=>t(`/sessions/${l.sessionId}`),children:`查看会话`}),b&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Y,{variant:`primary`,size:`sm`,onClick:()=>h.mutate(),loading:h.isPending,children:`继续执行`}),(0,R.jsx)(Y,{variant:`danger`,size:`sm`,icon:el,onClick:()=>{s({open:!0,title:`关闭 Pipeline`,description:`确认关闭此 Pipeline?`,onConfirm:()=>{p.mutate(),s(e=>({...e,open:!1}))}})},children:`关闭`})]}),!b&&(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Pc,onClick:()=>{s({open:!0,title:`重新激活 Pipeline`,description:`确认重新激活此 Pipeline?状态将重置为活跃。`,onConfirm:()=>{m.mutate(),s(e=>({...e,open:!1}))}})},loading:m.isPending,children:`重新激活`})]})]}),(0,R.jsx)(X,{className:`!p-4`,children:(0,R.jsx)(`p`,{className:`text-sm text-gray-700 line-clamp-3`,children:l.requirement})}),y.executionPlan&&(0,R.jsx)(X,{title:`编排计划`,className:`!p-4`,children:(0,R.jsxs)(`div`,{className:`space-y-4`,children:[y.reasoning&&(0,R.jsxs)(`div`,{className:`text-sm text-gray-600 bg-blue-50 p-3 rounded-lg border border-blue-100`,children:[(0,R.jsx)(`div`,{className:`font-medium text-blue-900 mb-1`,children:`规划依据`}),(0,R.jsx)(`p`,{className:`text-blue-800`,children:y.reasoning})]}),(0,R.jsx)(`div`,{className:`space-y-2`,children:y.executionPlan.stages.map((e,t)=>{let n=y.nodes.find(t=>t.nodeTypeId===e.nodeTypeId),r=n?.status===`completed`,i=n?.status===`in_progress`,a=!n||n.status===`pending`;return(0,R.jsxs)(`div`,{className:q(`flex items-start gap-3 p-3 rounded-lg border`,r&&`bg-green-50 border-green-200`,i&&`bg-blue-50 border-blue-200`,a&&`bg-gray-50 border-gray-200`),children:[(0,R.jsx)(`div`,{className:`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold`,style:{backgroundColor:r?`#10b981`:i?`#3b82f6`:`#9ca3af`,color:`white`},children:t+1}),(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-medium text-gray-900`,children:e.name}),(0,R.jsx)(fS,{size:`sm`,variant:r?`success`:i?`info`:`default`,children:r?`已完成`:i?`进行中`:`待执行`}),e.phase&&(0,R.jsx)(fS,{size:`sm`,children:e.phase})]}),e.description&&(0,R.jsx)(`p`,{className:`text-sm text-gray-600 mt-1`,children:e.description}),e.expectedArtifacts&&e.expectedArtifacts.length>0&&(0,R.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500`,children:[(0,R.jsx)(`span`,{className:`font-medium`,children:`预期产物:`}),e.expectedArtifacts.map((e,t)=>(0,R.jsxs)(`span`,{className:`ml-1 font-mono bg-gray-100 px-1.5 py-0.5 rounded`,children:[e.pattern,e.required&&(0,R.jsx)(`span`,{className:`text-red-500`,children:`*`})]},t))]})]})]},t)})})]})}),(0,R.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-3`,children:[(0,R.jsxs)(X,{className:`text-center !p-3`,children:[(0,R.jsx)(`div`,{className:`text-xl font-bold text-blue-600`,children:l.stats.totalEvents}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500`,children:`事件`})]}),(0,R.jsxs)(X,{className:`text-center !p-3`,children:[(0,R.jsx)(`div`,{className:`text-xl font-bold text-green-600`,children:`${y.stats.completedNodes}/${y.stats.totalNodes}`}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500`,children:`节点`})]}),(0,R.jsxs)(X,{className:`text-center !p-3`,children:[(0,R.jsx)(`div`,{className:`text-xl font-bold text-purple-600`,children:l.stats.totalArtifacts}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500`,children:`产物`})]}),(0,R.jsxs)(X,{className:`text-center !p-3`,children:[(0,R.jsx)(`div`,{className:`text-xl font-bold text-orange-600`,children:l.stats.totalQualityIssues}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500`,children:`质量问题`})]}),(0,R.jsxs)(X,{className:`text-center !p-3`,children:[(0,R.jsx)(`div`,{className:`text-xl font-bold text-red-600`,children:l.stats.unresolvedQuality}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500`,children:`未解决`})]})]}),(0,R.jsx)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit`,children:[`tasks`,`events`,`artifacts`,`quality`].map(e=>(0,R.jsx)(`button`,{onClick:()=>a(e),className:q(`px-4 py-2 rounded-md text-sm font-medium transition-colors`,i===e?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`),children:{tasks:`编排图 (${y.stats.totalNodes})`,events:`事件 (${l.stats.totalEvents})`,artifacts:`产物 (${l.stats.totalArtifacts})`,quality:`质量 (${l.stats.totalQualityIssues})`}[e]},e))}),i===`tasks`&&(0,R.jsx)(`div`,{className:`space-y-4`,children:(0,R.jsx)(g3,{pipeline:y,onRetryNode:e=>{s({open:!0,title:`重试失败节点`,description:`确定要重试此节点吗?节点状态将重置为等待中,下次工具调用时自动重新执行。`,onConfirm:()=>{g.mutate(e),s(e=>({...e,open:!1}))}})}})}),i===`events`&&(0,R.jsx)(X,{title:`工具调用时间线`,children:(0,R.jsxs)(`div`,{className:`space-y-1 max-h-[600px] overflow-y-auto`,children:[l.events.map((e,t)=>(0,R.jsxs)(sS.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:t*.01},className:`flex items-center gap-3 py-1.5 px-2 rounded hover:bg-gray-50 text-sm`,children:[(0,R.jsx)(`span`,{className:`text-gray-400 font-mono w-16 flex-shrink-0`,children:x4(Df(e.time),`HH:mm:ss`)}),(0,R.jsx)(`span`,{className:`w-2 h-2 rounded-full flex-shrink-0`,style:{backgroundColor:_3[e.hookType]||`#6b7280`}}),(0,R.jsx)(`span`,{className:`font-mono text-gray-700 w-20 flex-shrink-0`,children:e.toolName||e.hookType}),(0,R.jsx)(`span`,{className:`text-gray-500 truncate`,children:e.detail||``})]},t)),l.events.length===0&&(0,R.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:`暂无事件`})]})}),i===`artifacts`&&(0,R.jsx)(X,{title:`产物文件`,children:(0,R.jsxs)(`div`,{className:`space-y-2`,children:[l.artifacts.map((e,t)=>(0,R.jsx)(sS.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:t*.03},className:`flex items-center justify-between p-3 rounded-lg border border-gray-100 hover:border-green-200 hover:bg-green-50/50`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(oc,{className:`h-5 w-5 text-green-500`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`font-mono text-sm text-gray-900`,children:e.filePath.split(`/`).slice(-2).join(`/`)}),(0,R.jsxs)(`div`,{className:`text-xs text-gray-400`,children:[e.tool,` · `,x4(Df(e.time),`HH:mm:ss`)]})]})]})},t)),l.artifacts.length===0&&(0,R.jsx)(`div`,{className:`text-center py-12 text-gray-400`,children:`暂无产物`})]})}),i===`quality`&&(0,R.jsx)(X,{title:`质量问题`,children:(0,R.jsxs)(`div`,{className:`space-y-2`,children:[l.qualityIssues.map((e,t)=>(0,R.jsxs)(sS.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:t*.03},className:`flex items-start justify-between p-3 rounded-lg border border-gray-100`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-3 flex-1`,children:[e.resolved?(0,R.jsx)(Gs,{className:`h-5 w-5 text-green-500 mt-0.5`}):(0,R.jsx)(Xc,{className:`h-5 w-5 text-amber-500 mt-0.5`}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(fS,{size:`sm`,variant:e.level===`error`?`danger`:e.level===`warn`?`warning`:`info`,children:e.level}),(0,R.jsx)(fS,{size:`sm`,children:e.category})]}),(0,R.jsx)(`p`,{className:`text-sm text-gray-700 mt-1`,children:e.message}),(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:x4(Df(e.createdAt),`MM-dd HH:mm`)})]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(fS,{size:`sm`,variant:e.resolved?`success`:`warning`,children:e.resolved?`已解决`:`未解决`}),!e.resolved&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,onClick:()=>_.mutate(e.id),loading:_.isPending,children:`解决`}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>v.mutate(e.id),loading:v.isPending,children:`忽略`})]})]})]},t)),l.qualityIssues.length===0&&(0,R.jsxs)(`div`,{className:`text-center py-12 text-gray-400`,children:[(0,R.jsx)(zc,{className:`h-12 w-12 mx-auto mb-3 text-green-300`}),`暂无质量问题`]})]})}),(0,R.jsx)(w4,{open:o.open,title:o.title,description:o.description,variant:`danger`,onConfirm:o.onConfirm,onCancel:()=>s({...o,open:!1})})]})}var y3={spec:{label:`规格`,icon:cc,color:`text-blue-600`,bg:`bg-blue-50`,border:`border-blue-200`},security:{label:`安全`,icon:Bc,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-200`},quality:{label:`质量`,icon:oc,color:`text-purple-600`,bg:`bg-purple-50`,border:`border-purple-200`},test:{label:`测试`,icon:qc,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-200`},performance:{label:`性能`,icon:tl,color:`text-orange-600`,bg:`bg-orange-50`,border:`border-orange-200`}},b3={fail:{label:`失败`,icon:qs,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-300`},warn:{label:`警告`,icon:Xc,color:`text-yellow-600`,bg:`bg-yellow-50`,border:`border-yellow-300`},pass:{label:`通过`,icon:Gs,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-300`}};function x3({level:e}){let t=b3[e];if(!t)return(0,R.jsx)(fS,{size:`sm`,children:e});let n=t.icon;return(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,R.jsx)(n,{className:`h-3 w-3`}),t.label]})}function S3({category:e}){let t=y3[e];if(!t)return(0,R.jsx)(fS,{size:`sm`,children:e});let n=t.icon;return(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,R.jsx)(n,{className:`h-3 w-3`}),t.label]})}function C3(){let e=Ye(),[t,n]=(0,L.useState)(``),r=cS(t),[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(``),[c,l]=(0,L.useState)(``),[u,d]=(0,L.useState)(``),[f,p]=(0,L.useState)(!1),[m,h]=(0,L.useState)(1),[g,_]=(0,L.useState)(20),[v,y]=(0,L.useState)(null),[b,x]=(0,L.useState)(null),[S,C]=(0,L.useState)(new Set),[w,T]=(0,L.useState)(`list`),[E,D]=(0,L.useState)(new Set),[O,k]=(0,L.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),{data:A,isError:j,refetch:M}=ut({queryKey:[`quality-unresolved`],queryFn:()=>bl().then(e=>e.data),refetchInterval:1e4}),{data:N}=ut({queryKey:[`quality-history`,i,o,c,u,r],queryFn:()=>yl({limit:500,level:i||void 0,category:o||void 0,resolved:c===`resolved`?!0:c===`unresolved`?!1:void 0,project_path:u||void 0,search:r||void 0}).then(e=>e.data)}),{data:ee}=ut({queryKey:[`quality-history`,`all`],queryFn:()=>yl({limit:500}).then(e=>e.data)}),te=z({mutationFn:e=>nu(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]})}}),P=z({mutationFn:e=>ru(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]})}}),ne=z({mutationFn:()=>ou(),onSuccess:()=>{e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]})}}),re=z({mutationFn:e=>iu(e),onSuccess:()=>{C(new Set),e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]})}}),ie=z({mutationFn:e=>au(e),onSuccess:()=>{C(new Set),e.invalidateQueries({queryKey:[`quality-unresolved`]}),e.invalidateQueries({queryKey:[`quality-history`]})}}),ae=async e=>{try{let t=await su(e);await navigator.clipboard.writeText(t.data.context),x(e),H(`上下文已复制,请粘贴到 Claude Code 进行修复`,`success`),setTimeout(()=>x(null),3e3)}catch{H(`复制失败`,`error`)}},F=N?.items||[],I=F.reduce((e,t)=>{let n=t.project_path?.split(`/`).pop()||`未知项目`;return e[n]||(e[n]=[]),e[n].push(t),e},{}),oe=Math.ceil(F.length/g),se=F.slice((m-1)*g,m*g),ce=ee?.total||0,le=A?.total||0,ue=F.filter(e=>e.level===`fail`).length,de=F.filter(e=>e.level===`warn`).length,fe=Array.from(new Set(ee?.items.map(e=>e.level)||[])),pe=Array.from(new Set(ee?.items.map(e=>e.category)||[])),me=Array.from(new Set(ee?.items.map(e=>e.project_path?.split(`/`).pop()||``).filter(Boolean)||[])),he=[i,o,c,u].filter(Boolean).length,ge=()=>{let e=[`级别`,`类别`,`消息`,`项目`,`状态`,`创建时间`],t=F.map(e=>[e.level,e.category,e.message,e.project_path?.split(`/`).pop()||``,e.resolved?`已解决`:`未解决`,e.created_at?x4(Df(e.created_at),`yyyy-MM-dd HH:mm:ss`):``]);K4(`quality-issues-${x4(new Date,`yyyyMMdd-HHmmss`)}.csv`,e,t)};return j?(0,R.jsx)(q4,{message:`质量数据加载失败`,onRetry:()=>M()}):(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,R.jsxs)(`div`,{className:`relative flex-1`,children:[(0,R.jsx)(Lc,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,R.jsx)(`input`,{type:`text`,placeholder:`搜索问题描述...`,value:t,onChange:e=>{n(e.target.value),h(1)},className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,R.jsxs)(`button`,{onClick:()=>p(e=>!e),className:q(`flex items-center gap-1.5 px-3 py-2 text-sm rounded-lg border transition-colors`,f||he>0?`border-blue-300 bg-blue-50 text-blue-700`:`border-gray-200 text-gray-600 hover:bg-gray-50`),children:[(0,R.jsx)(fc,{className:`h-4 w-4`}),`筛选`,he>0&&(0,R.jsx)(`span`,{className:`ml-1 px-1.5 py-0.5 bg-blue-600 text-white text-xs rounded-full`,children:he}),(0,R.jsx)(Bs,{className:q(`h-3.5 w-3.5 transition-transform`,f&&`rotate-180`)})]}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[S.size>0&&(0,R.jsxs)(Y,{variant:`secondary`,size:`sm`,icon:zs,onClick:()=>k({open:!0,title:`批量解决问题`,description:`确认将选中的 ${S.size} 个问题标记为已解决?`,count:S.size,onConfirm:()=>{ie.mutate(Array.from(S)),k(e=>({...e,open:!1}))}}),loading:ie.isPending,children:[`解决 (`,S.size,`)`]}),S.size>0&&(0,R.jsxs)(Y,{variant:`secondary`,size:`sm`,icon:el,onClick:()=>k({open:!0,title:`批量忽略问题`,description:`确认忽略选中的 ${S.size} 个问题?`,count:S.size,onConfirm:()=>{re.mutate(Array.from(S)),k(e=>({...e,open:!1}))}}),loading:re.isPending,children:[`忽略 (`,S.size,`)`]}),le>0&&(0,R.jsx)(Y,{variant:`primary`,size:`sm`,icon:zs,onClick:()=>k({open:!0,title:`全部标记已修复`,description:`确认将 ${le} 个问题全部标记为已修复?`,onConfirm:()=>{ne.mutate(),k(e=>({...e,open:!1}))}}),loading:ne.isPending,children:`全部已修复`}),(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:nc,onClick:()=>F.length>0&&ge(),children:`导出`}),(0,R.jsxs)(`div`,{className:`flex border border-gray-200 rounded-lg overflow-hidden`,children:[(0,R.jsx)(`button`,{onClick:()=>T(`list`),className:q(`px-2.5 py-1.5 text-sm transition-colors flex items-center gap-1`,w===`list`?`bg-blue-50 text-blue-700`:`text-gray-600 hover:bg-gray-50`),title:`列表视图`,children:(0,R.jsx)(xc,{className:`h-4 w-4`})}),(0,R.jsx)(`button`,{onClick:()=>T(`group`),className:q(`px-2.5 py-1.5 text-sm transition-colors flex items-center gap-1`,w===`group`?`bg-blue-50 text-blue-700`:`text-gray-600 hover:bg-gray-50`),title:`按项目分组`,children:(0,R.jsx)(uc,{className:`h-4 w-4`})})]})]})]}),f&&(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-3 pt-2 border-t border-gray-100`,children:[(0,R.jsxs)(`select`,{value:i,onChange:e=>{a(e.target.value),h(1)},className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:``,children:`全部级别`}),fe.map(e=>(0,R.jsx)(`option`,{value:e,children:b3[e]?.label||e},e))]}),(0,R.jsxs)(`select`,{value:o,onChange:e=>{s(e.target.value),h(1)},className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:``,children:`全部类别`}),pe.map(e=>(0,R.jsx)(`option`,{value:e,children:y3[e]?.label||e},e))]}),(0,R.jsxs)(`select`,{value:c,onChange:e=>{l(e.target.value),h(1)},className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:``,children:`全部状态`}),(0,R.jsx)(`option`,{value:`resolved`,children:`已解决`}),(0,R.jsx)(`option`,{value:`unresolved`,children:`未解决`})]}),(0,R.jsxs)(`select`,{value:u,onChange:e=>{d(e.target.value),h(1)},className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:``,children:`全部项目`}),me.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]})]})]})}),(0,R.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4`,children:[(0,R.jsxs)(X,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`text-3xl font-bold text-red-600`,children:ue}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`失败`})]}),(0,R.jsxs)(X,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`text-3xl font-bold text-amber-600`,children:de}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`警告`})]}),(0,R.jsxs)(X,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`text-3xl font-bold text-orange-600`,children:le}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`未解决`})]}),(0,R.jsxs)(X,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`text-3xl font-bold text-blue-600`,children:ce}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`总检查`})]})]}),(0,R.jsxs)(X,{title:`问题列表 (${F.length})`,action:F.length>0?(0,R.jsx)(`button`,{onClick:()=>{let e=w===`list`?se.filter(e=>!e.resolved).map(e=>String(e.id)):F.filter(e=>!e.resolved).map(e=>String(e.id));S.size===e.length&&e.length>0?C(new Set):C(new Set(e))},className:`text-xs text-blue-600 hover:underline`,children:S.size>0?`取消全选`:w===`list`?`全选当前页未解决`:`全选所有未解决`}):void 0,children:[w===`list`?(0,R.jsx)(`div`,{className:`space-y-2`,children:se.map((e,t)=>{let n=v===String(e.id||t);return(0,R.jsxs)(`div`,{className:`rounded-lg border border-gray-100 overflow-hidden`,children:[(0,R.jsxs)(sS.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:t*.02},className:q(`flex items-center gap-3 p-4 cursor-pointer transition-all`,S.has(String(e.id))?`bg-blue-50`:`hover:bg-gray-50`),onClick:()=>y(n?null:String(e.id||t)),children:[e.resolved?(0,R.jsx)(`div`,{className:`h-4 w-4 flex-shrink-0`}):(0,R.jsx)(`input`,{type:`checkbox`,checked:S.has(String(e.id)),onChange:t=>{t.stopPropagation(),C(t=>{let n=new Set(t);return n.has(String(e.id))?n.delete(String(e.id)):n.add(String(e.id)),n})},onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded border-gray-300 text-blue-600 cursor-pointer flex-shrink-0`}),(0,R.jsxs)(`div`,{className:`flex-1 grid grid-cols-1 md:grid-cols-5 gap-3 items-center min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,R.jsx)(x3,{level:e.level}),(0,R.jsx)(S3,{category:e.category})]}),(0,R.jsx)(`div`,{className:`md:col-span-2 min-w-0`,children:(0,R.jsx)(`p`,{className:`text-sm text-gray-700 truncate`,children:e.message})}),(0,R.jsx)(`div`,{className:`text-sm text-gray-500 truncate`,children:e.project_path?.split(`/`).pop()||`-`}),(0,R.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,R.jsx)(fS,{size:`sm`,variant:e.resolved?`success`:`warning`,children:e.resolved?`已解决`:`未解决`}),(0,R.jsx)(`span`,{className:`text-xs text-gray-400 flex-shrink-0`,children:e.created_at?x4(Df(e.created_at),`MM-dd HH:mm`):``}),n?(0,R.jsx)(Bs,{className:`h-4 w-4 text-gray-400 flex-shrink-0`}):(0,R.jsx)(Hs,{className:`h-4 w-4 text-gray-400 flex-shrink-0`})]})]})]}),(0,R.jsx)(gb,{children:n&&(0,R.jsx)(sS.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`overflow-hidden`,children:(0,R.jsxs)(`div`,{className:`border-t border-gray-100 bg-gray-50 p-4 space-y-2 text-sm`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`完整消息:`}),(0,R.jsx)(`p`,{className:`text-gray-700 mt-1 break-words`,children:e.message})]}),e.project_path&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`项目路径:`}),(0,R.jsx)(`span`,{className:`text-gray-700 ml-1 font-mono text-xs break-all`,children:e.project_path})]}),(0,R.jsxs)(`div`,{className:`flex gap-6`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`创建时间:`}),(0,R.jsx)(`span`,{className:`text-gray-700 ml-1`,children:e.created_at?x4(Df(e.created_at),`yyyy-MM-dd HH:mm:ss`):`-`})]}),e.resolved_at&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`解决时间:`}),(0,R.jsx)(`span`,{className:`text-gray-700 ml-1`,children:x4(Df(e.resolved_at),`yyyy-MM-dd HH:mm:ss`)})]})]}),!e.resolved&&(0,R.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:b===String(e.id)?Rs:Qs,onClick:t=>{t.stopPropagation(),ae(String(e.id))},children:b===String(e.id)?`已复制`:`复制上下文`}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:zs,onClick:t=>{t.stopPropagation(),te.mutate(String(e.id))},loading:te.isPending,children:`标记已修复`}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:el,onClick:t=>{t.stopPropagation(),P.mutate(String(e.id))},loading:P.isPending,children:`忽略`})]})]})})})]},e.id||t)})}):(0,R.jsx)(`div`,{className:`space-y-3`,children:Object.entries(I).map(([e,t])=>{let n=E.has(e),r=t.filter(e=>!e.resolved).length;return(0,R.jsxs)(`div`,{className:`border border-gray-200 rounded-lg overflow-hidden`,children:[(0,R.jsx)(`div`,{className:`flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100 transition-colors`,onClick:()=>D(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n?(0,R.jsx)(Bs,{className:`h-4 w-4 text-gray-500`}):(0,R.jsx)(Hs,{className:`h-4 w-4 text-gray-500`}),(0,R.jsx)(`span`,{className:`font-medium text-gray-900`,children:e}),(0,R.jsxs)(fS,{size:`sm`,children:[t.length,` 个问题`]}),r>0&&(0,R.jsxs)(fS,{size:`sm`,variant:`warning`,children:[r,` 未解决`]})]})}),(0,R.jsx)(gb,{children:n&&(0,R.jsx)(sS.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`overflow-hidden`,children:(0,R.jsx)(`div`,{className:`divide-y divide-gray-100`,children:t.map((e,t)=>{let n=v===String(e.id||t);return(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(sS.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:t*.01},className:q(`flex items-center gap-3 p-3 cursor-pointer transition-all`,S.has(String(e.id))?`bg-blue-50`:`hover:bg-gray-50`),onClick:()=>y(n?null:String(e.id||t)),children:[e.resolved?(0,R.jsx)(`div`,{className:`h-4 w-4 flex-shrink-0`}):(0,R.jsx)(`input`,{type:`checkbox`,checked:S.has(String(e.id)),onChange:t=>{t.stopPropagation(),C(t=>{let n=new Set(t);return n.has(String(e.id))?n.delete(String(e.id)):n.add(String(e.id)),n})},onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded border-gray-300 text-blue-600 cursor-pointer flex-shrink-0`}),(0,R.jsxs)(`div`,{className:`flex-1 grid grid-cols-1 md:grid-cols-4 gap-3 items-center min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,R.jsx)(x3,{level:e.level}),(0,R.jsx)(S3,{category:e.category})]}),(0,R.jsx)(`div`,{className:`md:col-span-2 min-w-0`,children:(0,R.jsx)(`p`,{className:`text-sm text-gray-700 truncate`,children:e.message})}),(0,R.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,R.jsx)(fS,{size:`sm`,variant:e.resolved?`success`:`warning`,children:e.resolved?`已解决`:`未解决`}),(0,R.jsx)(`span`,{className:`text-xs text-gray-400 flex-shrink-0`,children:e.created_at?x4(Df(e.created_at),`MM-dd HH:mm`):``}),n?(0,R.jsx)(Bs,{className:`h-4 w-4 text-gray-400 flex-shrink-0`}):(0,R.jsx)(Hs,{className:`h-4 w-4 text-gray-400 flex-shrink-0`})]})]})]}),(0,R.jsx)(gb,{children:n&&(0,R.jsx)(sS.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`overflow-hidden`,children:(0,R.jsxs)(`div`,{className:`border-t border-gray-100 bg-gray-50 p-4 space-y-2 text-sm`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`完整消息:`}),(0,R.jsx)(`p`,{className:`text-gray-700 mt-1 break-words`,children:e.message})]}),e.project_path&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`项目路径:`}),(0,R.jsx)(`span`,{className:`text-gray-700 ml-1 font-mono text-xs break-all`,children:e.project_path})]}),(0,R.jsxs)(`div`,{className:`flex gap-6`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`创建时间:`}),(0,R.jsx)(`span`,{className:`text-gray-700 ml-1`,children:e.created_at?x4(Df(e.created_at),`yyyy-MM-dd HH:mm:ss`):`-`})]}),e.resolved_at&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-500 font-medium`,children:`解决时间:`}),(0,R.jsx)(`span`,{className:`text-gray-700 ml-1`,children:x4(Df(e.resolved_at),`yyyy-MM-dd HH:mm:ss`)})]})]}),!e.resolved&&(0,R.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:b===String(e.id)?Rs:Qs,onClick:t=>{t.stopPropagation(),ae(String(e.id))},children:b===String(e.id)?`已复制`:`复制上下文`}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:zs,onClick:t=>{t.stopPropagation(),te.mutate(String(e.id))},loading:te.isPending,children:`标记已修复`}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:el,onClick:t=>{t.stopPropagation(),P.mutate(String(e.id))},loading:P.isPending,children:`忽略`})]})]})})})]},e.id||t)})})})})]},e)})}),F.length===0&&(0,R.jsxs)(`div`,{className:`text-center py-12 text-gray-400`,children:[(0,R.jsx)(Gs,{className:`h-12 w-12 mx-auto mb-3 text-green-300`}),`没有符合条件的记录`]}),F.length>0&&w===`list`&&(0,R.jsx)(n3,{currentPage:m,totalPages:oe,onPageChange:h,pageSize:g,onPageSizeChange:e=>{_(e),h(1)},totalItems:F.length})]}),(0,R.jsx)(w4,{open:O.open,title:O.title,description:O.description,count:O.count,variant:`warning`,onConfirm:O.onConfirm,onCancel:()=>k({...O,open:!1})})]})}var w3=[{key:`distill`,title:`蒸馏配置`,description:`AI 知识蒸馏的触发条件和参数`,fields:[{key:`provider`,label:`提供商`,type:`select`,options:[{value:`claude`,label:`Claude`},{value:`openai`,label:`OpenAI`},{value:`ollama`,label:`Ollama`}]},{key:`auto_trigger`,label:`自动触发`,type:`boolean`,description:`达到事件阈值时自动蒸馏`},{key:`event_threshold`,label:`事件阈值`,type:`number`,description:`触发蒸馏的最小事件数`,min:1,max:1e4},{key:`timer_interval_minutes`,label:`定时器间隔(分钟)`,type:`number`,min:1,max:1440},{key:`model`,label:`模型`,type:`text`},{key:`api_key`,label:`API Key`,type:`text`,sensitive:!0,description:`留空自动从环境变量获取`},{key:`base_url`,label:`API 地址`,type:`text`,description:`留空使用默认地址`}]},{key:`autopilot`,title:`自动驾驶`,description:`意图分析、质量门禁、Pipeline 编排`,fields:[{key:`enabled`,label:`启用`,type:`boolean`},{key:`intent_analysis`,label:`意图分析`,type:`boolean`,description:`AI 分析用户意图和任务复杂度`},{key:`quality_gate`,label:`质量门禁`,type:`boolean`,description:`代码变更时自动审查质量`},{key:`quality_review_interval`,label:`审查间隔`,type:`number`,description:`每 N 次 Write/Edit 触发一次审查`,min:1,max:100},{key:`auto_start_pipeline`,label:`自动启动流水线`,type:`boolean`},{key:`pipeline_confirm_mode`,label:`确认模式`,type:`select`,options:[{value:`prompt`,label:`提示确认`},{value:`auto`,label:`自动启动`},{value:`preview`,label:`仅预览`}]}]},{key:`resume`,title:`会话续接`,description:`中断会话的自动恢复`,fields:[{key:`enabled`,label:`启用`,type:`boolean`},{key:`timeout_minutes`,label:`超时时间(分钟)`,type:`number`,min:1,max:1440},{key:`max_age_days`,label:`最大保留天数`,type:`number`,min:1,max:365}]},{key:`claudemd`,title:`CLAUDE.md 管理`,description:`项目级 CLAUDE.md 的自动生成与精炼`,fields:[{key:`auto_generate`,label:`自动生成`,type:`boolean`},{key:`auto_refine`,label:`自动精炼`,type:`boolean`},{key:`refine_interval`,label:`精炼间隔`,type:`number`,description:`每 N 次蒸馏后精炼一次`,min:1,max:100}]},{key:`orchestration`,title:`编排通知`,description:`蒸馏和 CLAUDE.md 更新的通知`,fields:[{key:`enabled`,label:`启用`,type:`boolean`},{key:`notify_on_distill`,label:`蒸馏完成通知`,type:`boolean`},{key:`notify_on_claudemd`,label:`CLAUDE.md 更新通知`,type:`boolean`}]},{key:`web`,title:`Web 管理后台`,description:`Web 服务配置`,fields:[{key:`enabled`,label:`启用`,type:`boolean`},{key:`port`,label:`端口`,type:`number`,min:1024,max:65535}]},{key:`ai`,title:`AI 模型`,description:`分层模型配置(Haiku/Sonnet/Opus)`,fields:[{key:`models.haiku`,label:`Haiku 模型`,type:`text`},{key:`models.sonnet`,label:`Sonnet 模型`,type:`text`},{key:`models.opus`,label:`Opus 模型`,type:`text`}]},{key:`storage`,title:`存储`,description:`数据库路径和容量限制`,fields:[{key:`path`,label:`数据库路径`,type:`text`},{key:`max_size_mb`,label:`最大容量(MB)`,type:`number`,min:100,max:102400}]},{key:`backup`,title:`备份配置`,description:`数据备份策略`,fields:[{key:`include_profile`,label:`包含用户画像`,type:`boolean`,description:`备份时包含用户画像数据`},{key:`encrypt_by_default`,label:`默认加密`,type:`boolean`,description:`备份文件默认加密`}]},{key:`pattern_engine`,title:`模式引擎`,description:`模式识别与演化配置`,fields:[{key:`enabled`,label:`启用`,type:`boolean`},{key:`route_timeout_ms`,label:`路由超时(毫秒)`,type:`number`,min:100,max:6e4},{key:`evolve_interval_days`,label:`演化间隔(天)`,type:`number`,min:1,max:365},{key:`evolve_min_executions`,label:`最小执行次数`,type:`number`,description:`触发演化的最小执行次数`,min:1,max:1e3}]},{key:`ui`,title:`UI 配置`,description:`前端界面参数`,fields:[{key:`skill_repair_limit`,label:`Skill 修复上限`,type:`number`,min:1,max:100},{key:`logs_tail_default`,label:`日志默认条数`,type:`number`,min:10,max:1e3},{key:`pipeline_expire_hours`,label:`Pipeline 过期时间(小时)`,type:`number`,min:1,max:720}]},{key:`history`,title:`配置历史`,description:`查看最近 10 次配置变更记录`,fields:[]}];function T3(){let e=Ye(),[t,n]=(0,L.useState)(null),[r,i]=(0,L.useState)(`idle`),[a,o]=(0,L.useState)(`distill`),[s,c]=(0,L.useState)(new Set),l=s.size>0,[u,d]=(0,L.useState)(null),[f,p]=(0,L.useState)(new Set),[m,h]=(0,L.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),[g,_]=(0,L.useState)(null),[v,y]=(0,L.useState)(!1),[b,x]=(0,L.useState)(``),[S,C]=(0,L.useState)(!1),[w,T]=(0,L.useState)({}),{data:E,isLoading:D}=ut({queryKey:[`config`],queryFn:()=>cl().then(e=>e.data)}),{data:O,refetch:k}=ut({queryKey:[`daemon-diagnosis`],queryFn:()=>uu().then(e=>e.data),enabled:a===`environment`}),{data:A,refetch:j}=ut({queryKey:[`backups`],queryFn:()=>pu().then(e=>e.data),enabled:a===`backup_mgmt`}),{data:M}=ut({queryKey:[`config-history`],queryFn:()=>ul().then(e=>e.data),enabled:a===`history`}),{data:N}=ut({queryKey:[`daemon-status`],queryFn:()=>cu().then(e=>e.data),enabled:a===`backup_mgmt`}),{data:ee,refetch:te}=ut({queryKey:[`memory-caches`],queryFn:()=>_u().then(e=>e.data),enabled:a===`memory_mgmt`,refetchInterval:a===`memory_mgmt`?5e3:!1}),{data:P,refetch:ne}=ut({queryKey:[`memory-process`],queryFn:()=>vu().then(e=>e.data),enabled:a===`memory_mgmt`,refetchInterval:a===`memory_mgmt`?5e3:!1}),re=z({mutationFn:e=>yu(e),onSuccess:(e,t)=>{H(`缓存 ${t} 已清空`,`success`),te()},onError:()=>H(`清空缓存失败`,`error`)}),ie=z({mutationFn:()=>bu(),onSuccess:()=>{H(`所有缓存已清空`,`success`),te()},onError:()=>H(`清空缓存失败`,`error`)}),ae=z({mutationFn:()=>xu(),onSuccess:e=>{let t=e.data.freed;H(t?`GC 完成,释放堆内存 ${t.heapMB} MB`:e.data.message,`success`),ne()},onError:()=>H(`GC 触发失败(需要 --expose-gc 启动)`,`error`)}),F=z({mutationFn:()=>fu(v?{encrypt:!0,password:b}:{}),onSuccess:e=>{j(),H(e.data.encrypted?`加密备份已创建`:`备份已创建`,`success`),x(``),i(`success`),setTimeout(()=>i(`idle`),3e3)},onError:()=>{i(`error`),setTimeout(()=>i(`idle`),3e3)}}),I=z({mutationFn:({filename:e,password:t})=>hu(e,t),onSuccess:e=>{H(`${e.data.message}(已备份当前数据库为 ${e.data.preRestoreBackup})`,`success`),setTimeout(()=>window.location.reload(),2e3)},onError:()=>H(`恢复失败`,`error`)}),oe=z({mutationFn:()=>du(),onSuccess:e=>{d(e.data),k()}});(0,L.useEffect)(()=>{E&&!t&&n(E)},[E,t]);let se=z({mutationFn:e=>ll(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),i(`success`),c(new Set),setTimeout(()=>i(`idle`),3e3)},onError:()=>{i(`error`),setTimeout(()=>i(`idle`),3e3)}}),ce=z({mutationFn:()=>U.post(`/config/reset`),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),n(null),i(`success`),setTimeout(()=>i(`idle`),3e3)}});if(D||!t)return(0,R.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,R.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let le=(e,n)=>{let r=t[e];if(!r)return``;let i=n.split(`.`),a=r;for(let e of i)a=a?.[e];return a??``},ue=(e,t,r)=>{c(t=>new Set(t).add(e)),n(n=>{if(!n)return n;let i={...n[e]||{}},a=t.split(`.`);if(a.length===1)i[t]=r;else{let e={...i[a[0]]||{}};e[a[1]]=r,i[a[0]]=e}return{...n,[e]:i}})},de=()=>{if(!t)return;let e={};s.forEach(n=>{e[n]=t[n]}),se.mutate(e)},fe=()=>{n(E),c(new Set)},pe=()=>{let e=JSON.stringify(t,null,2),n=new Blob([e],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`claude-forge-config-${new Date().toISOString().slice(0,10)}.json`,i.click(),URL.revokeObjectURL(r)},me=()=>{let e=document.createElement(`input`);e.type=`file`,e.accept=`.json`,e.onchange=e=>{let t=e.target.files?.[0];if(!t)return;let r=new FileReader;r.onload=e=>{try{n(JSON.parse(e.target?.result)),c(new Set(w3.map(e=>e.key)))}catch{H(`配置文件格式错误,请选择有效的 JSON 文件`,`error`)}},r.readAsText(t)},e.click()},he=w3.find(e=>e.key===a);return(0,R.jsxs)(`div`,{className:`flex gap-6`,children:[(0,R.jsx)(`div`,{className:`w-56 flex-shrink-0`,children:(0,R.jsx)(X,{className:`!p-2 sticky top-6`,children:(0,R.jsxs)(`nav`,{className:`space-y-1`,children:[w3.map(e=>(0,R.jsx)(`button`,{onClick:()=>o(e.key),className:q(`w-full text-left px-3 py-2.5 rounded-lg text-sm transition-colors`,a===e.key?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50 hover:text-gray-900`),children:e.title},e.key)),(0,R.jsx)(`div`,{className:`border-t border-gray-100 my-1`}),(0,R.jsxs)(`button`,{onClick:()=>o(`backup_mgmt`),className:q(`w-full text-left px-3 py-2.5 rounded-lg text-sm transition-colors flex items-center gap-2`,a===`backup_mgmt`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50 hover:text-gray-900`),children:[(0,R.jsx)(ec,{className:`h-3.5 w-3.5`}),`数据备份`]}),(0,R.jsxs)(`button`,{onClick:()=>o(`memory_mgmt`),className:q(`w-full text-left px-3 py-2.5 rounded-lg text-sm transition-colors flex items-center gap-2`,a===`memory_mgmt`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50 hover:text-gray-900`),children:[(0,R.jsx)($s,{className:`h-3.5 w-3.5`}),`内存管理`]}),(0,R.jsxs)(`button`,{onClick:()=>o(`environment`),className:q(`w-full text-left px-3 py-2.5 rounded-lg text-sm transition-colors flex items-center gap-2`,a===`environment`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50 hover:text-gray-900`),children:[(0,R.jsx)(zc,{className:`h-3.5 w-3.5`}),`环境检测`]})]})})}),(0,R.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold text-gray-900`,children:a===`environment`?`环境检测`:a===`backup_mgmt`?`数据备份`:a===`memory_mgmt`?`内存管理`:a===`history`?`配置历史`:he?.title}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500`,children:a===`environment`?`Hook 脚本与 Claude settings.json 注入状态检测与修复`:a===`backup_mgmt`?`数据库备份与历史备份管理`:a===`memory_mgmt`?`LRU 缓存状态与进程内存管理`:a===`history`?`查看最近 10 次配置变更记录`:he?.description??``})]}),a!==`environment`&&a!==`backup_mgmt`&&a!==`memory_mgmt`&&a!==`history`&&(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsxs)(gb,{children:[r===`success`&&(0,R.jsxs)(sS.div,{initial:{opacity:0,x:10},animate:{opacity:1,x:0},exit:{opacity:0},className:`flex items-center gap-1.5 text-green-600 text-sm`,children:[(0,R.jsx)(Gs,{className:`h-4 w-4`}),`已保存`]}),r===`error`&&(0,R.jsxs)(sS.div,{initial:{opacity:0,x:10},animate:{opacity:1,x:0},exit:{opacity:0},className:`flex items-center gap-1.5 text-red-600 text-sm`,children:[(0,R.jsx)(qs,{className:`h-4 w-4`}),`保存失败`]})]}),l&&(0,R.jsx)(fS,{variant:`warning`,children:`未保存`}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:nc,onClick:pe,children:`导出`}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Zc,onClick:me,children:`导入`}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Fc,onClick:fe,disabled:!l,children:`撤销`}),(0,R.jsx)(Y,{variant:`primary`,size:`sm`,icon:Ic,onClick:de,loading:se.isPending,disabled:!l,children:`保存`})]})]}),a!==`environment`&&a!==`backup_mgmt`&&a!==`memory_mgmt`&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(X,{children:(0,R.jsx)(`div`,{className:`space-y-6`,children:he?.fields.map(e=>(0,R.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,R.jsxs)(`div`,{className:`w-48 flex-shrink-0 pt-2`,children:[(0,R.jsx)(`label`,{className:`text-sm font-medium text-gray-700`,children:e.label}),e.description&&(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mt-0.5`,children:e.description})]}),(0,R.jsx)(`div`,{className:`flex-1`,children:e.type===`boolean`?(0,R.jsx)(`button`,{onClick:()=>ue(a,e.key,!le(a,e.key)),className:q(`relative inline-flex h-6 w-11 items-center rounded-full transition-colors`,le(a,e.key)?`bg-blue-600`:`bg-gray-300`),children:(0,R.jsx)(`span`,{className:q(`inline-block h-4 w-4 transform rounded-full bg-white transition-transform`,le(a,e.key)?`translate-x-6`:`translate-x-1`)})}):e.type===`select`?(0,R.jsx)(`select`,{value:String(le(a,e.key)||``),onChange:t=>ue(a,e.key,t.target.value),className:`w-full max-w-xs px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm`,children:e.options?.map(e=>(0,R.jsx)(`option`,{value:e.value,children:e.label},e.value))}):e.type===`number`?(0,R.jsx)(`input`,{type:`number`,value:Number(le(a,e.key))||0,onChange:t=>ue(a,e.key,Number(t.target.value)),min:e.min,max:e.max,className:`w-full max-w-xs px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm`}):(0,R.jsxs)(`div`,{className:`relative flex items-center max-w-xs`,children:[(0,R.jsx)(`input`,{type:e.sensitive&&!f.has(`${a}.${e.key}`)?`password`:`text`,value:String(le(a,e.key)||``),onChange:t=>ue(a,e.key,t.target.value),className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm pr-9`}),e.sensitive&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>p(t=>{let n=new Set(t),r=`${a}.${e.key}`;return n.has(r)?n.delete(r):n.add(r),n}),className:`absolute right-2 text-gray-400 hover:text-gray-600`,children:f.has(`${a}.${e.key}`)?(0,R.jsx)(ic,{className:`h-4 w-4`}):(0,R.jsx)(ac,{className:`h-4 w-4`})})]})})]},e.key))})}),(0,R.jsx)(X,{className:`!border-red-200`,children:(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold text-red-600`,children:`重置配置`}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500 mt-1`,children:`将所有配置恢复为默认值,此操作不可撤销`})]}),(0,R.jsx)(Y,{variant:`danger`,size:`sm`,icon:Xc,onClick:()=>{h({open:!0,title:`重置配置`,description:`确定要重置所有配置为默认值吗?此操作不可撤销。`,onConfirm:()=>{ce.mutate(),h({...m,open:!1})}})},loading:ce.isPending,children:`重置`})]})})]}),a===`backup_mgmt`&&(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,R.jsx)(`div`,{className:`flex-shrink-0 w-10 h-10 rounded-full bg-blue-50 flex items-center justify-center`,children:(0,R.jsx)(hc,{className:`h-5 w-5 text-blue-600`})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`font-medium text-gray-900`,children:`当前数据库`}),(0,R.jsxs)(`p`,{className:`text-sm text-gray-500 mt-1`,children:[`内存占用:`,N?.memory?`${(N.memory.heapUsed/1024/1024).toFixed(2)} MB`:`加载中...`]})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-col items-end gap-2`,children:[(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,R.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm text-gray-600 cursor-pointer`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:v,onChange:e=>y(e.target.checked),className:`rounded`}),(0,R.jsx)(Cc,{className:`h-3.5 w-3.5`}),`加密备份`]})}),v&&(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(`input`,{type:S?`text`:`password`,placeholder:`备份密码(≥8位)`,value:b,onChange:e=>x(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 pr-8 w-48`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>C(e=>!e),className:`absolute right-2 top-1/2 -translate-y-1/2 text-gray-400`,children:S?(0,R.jsx)(ic,{className:`h-3.5 w-3.5`}):(0,R.jsx)(ac,{className:`h-3.5 w-3.5`})})]}),(0,R.jsx)(Y,{variant:`primary`,size:`sm`,icon:ec,onClick:()=>F.mutate(),loading:F.isPending,disabled:v&&b.length<8,children:`立即备份`})]})]})}),(0,R.jsxs)(X,{children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,R.jsx)(`h3`,{className:`font-medium text-gray-900`,children:`备份历史`}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Pc,onClick:()=>j(),children:`刷新`})]}),A&&A.items.length>0?(0,R.jsx)(`div`,{className:`space-y-2`,children:A.items.map(e=>(0,R.jsxs)(`div`,{className:`flex flex-col gap-2 py-3 px-4 bg-gray-50 rounded-lg`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`p`,{className:`text-sm font-medium text-gray-900 truncate`,children:e.filename}),e.encrypted&&(0,R.jsxs)(`span`,{className:`flex items-center gap-0.5 text-xs text-amber-600 bg-amber-50 px-1.5 py-0.5 rounded`,children:[(0,R.jsx)(Cc,{className:`h-3 w-3`}),` 已加密`]})]}),(0,R.jsxs)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:[x4(new Date(e.createdAt),`yyyy-MM-dd HH:mm:ss`),` · `,e.sizeMb,` MB`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 ml-3 flex-shrink-0`,children:[(0,R.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>{h({open:!0,title:`恢复数据库`,description:`确定要从 ${e.filename} 恢复数据库吗?当前数据库将被覆盖(会自动备份)。恢复后 daemon 将自动重启。`,onConfirm:()=>{I.mutate({filename:e.filename,password:w[e.filename]}),h(e=>({...e,open:!1}))}})},loading:I.isPending&&I.variables?.filename===e.filename,children:`恢复`}),(0,R.jsx)(`a`,{href:mu(e.filename),download:e.filename,children:(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:nc,children:`下载`})})]})]}),e.encrypted&&(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Cc,{className:`h-3.5 w-3.5 text-amber-500 flex-shrink-0`}),(0,R.jsx)(`input`,{type:`password`,placeholder:`输入解密密码后点击恢复`,value:w[e.filename]||``,onChange:t=>T(n=>({...n,[e.filename]:t.target.value})),className:`flex-1 px-2 py-1 text-xs border border-amber-200 rounded focus:outline-none focus:ring-1 focus:ring-amber-400`})]})]},e.filename))}):(0,R.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`暂无备份记录`})]}),(0,R.jsxs)(X,{children:[(0,R.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,R.jsx)(`h3`,{className:`font-medium text-gray-900`,children:`数据管理`})}),(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:`清理历史事件`}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:`删除超过指定天数的事件记录`})]}),(0,R.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>{h({open:!0,title:`清理历史事件`,description:`确定要清理 30 天前的事件记录吗?此操作不可撤销。`,onConfirm:()=>{U.post(`/events/purge`,{retentionDays:30}).then(()=>{H(`事件清理完成`,`success`),h(e=>({...e,open:!1}))}).catch(()=>{H(`事件清理失败`,`error`),h(e=>({...e,open:!1}))})}})},children:`清理 30 天前`})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:`数据库优化`}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:`执行 VACUUM 回收空间,提升性能`})]}),(0,R.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>{h({open:!0,title:`数据库优化`,description:`确定要执行 VACUUM 优化吗?此操作可能需要几分钟。`,onConfirm:()=>{U.post(`/config/vacuum`).then(()=>{H(`数据库优化完成`,`success`),h(e=>({...e,open:!1}))}).catch(()=>{H(`数据库优化失败`,`error`),h(e=>({...e,open:!1}))})}})},children:`立即优化`})]})]})]})]}),a===`memory_mgmt`&&(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between mb-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,R.jsx)(`div`,{className:`flex-shrink-0 w-10 h-10 rounded-full bg-purple-50 flex items-center justify-center`,children:(0,R.jsx)($s,{className:`h-5 w-5 text-purple-600`})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`font-medium text-gray-900`,children:`进程内存`}),P&&(0,R.jsxs)(`div`,{className:`text-sm text-gray-600 mt-2 space-y-1`,children:[(0,R.jsxs)(`div`,{children:[`RSS: `,P.rssMB,` MB`]}),(0,R.jsxs)(`div`,{children:[`堆已用: `,P.heapUsedMB,` MB / `,P.heapTotalMB,` MB`]}),(0,R.jsxs)(`div`,{children:[`外部: `,P.externalMB,` MB`]})]})]})]}),(0,R.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>ae.mutate(),loading:ae.isPending,children:`触发 GC`})]})}),(0,R.jsxs)(X,{children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,R.jsx)(`h3`,{className:`font-medium text-gray-900`,children:`LRU 缓存`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Pc,onClick:()=>void te(),children:`刷新`}),(0,R.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>{h({open:!0,title:`清空所有缓存`,description:`确定要清空所有 LRU 缓存吗?`,onConfirm:()=>{ie.mutate(),h(e=>({...e,open:!1}))}})},loading:ie.isPending,children:`清空全部`})]})]}),ee&&ee.caches.length>0?(0,R.jsx)(`div`,{className:`space-y-2`,children:ee.caches.map(e=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between py-3 px-4 bg-gray-50 rounded-lg`,children:[(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,R.jsxs)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:[e.size,` / `,e.maxSize,` 条`,e.hitRate!==void 0&&` · 命中率 ${(e.hitRate*100).toFixed(1)}%`]})]}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>re.mutate(e.name),loading:re.isPending&&re.variables===e.name,children:`清空`})]},e.name))}):(0,R.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`暂无缓存数据`})]})]}),a===`history`&&(0,R.jsxs)(X,{children:[(0,R.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,R.jsx)(`h3`,{className:`font-medium text-gray-900`,children:`最近 10 次配置变更`})}),M&&M.items.length>0?(0,R.jsx)(`div`,{className:`space-y-2`,children:M.items.map(e=>{let t=g===String(e.id),n=E,r=[];if(t&&n){let t=(e,n=``)=>typeof e!=`object`||!e?{[n]:JSON.stringify(e)}:Object.entries(e).reduce((e,[r,i])=>{let a=n?`${n}.${r}`:r;return typeof i==`object`&&i&&!Array.isArray(i)?Object.assign(e,t(i,a)):e[a]=JSON.stringify(i),e},{}),i=t(e.config),a=t(n);new Set([...Object.keys(i),...Object.keys(a)]).forEach(e=>{let t=i[e]??`(无)`,n=a[e]??`(无)`;t!==n&&r.push({key:e,old:t,cur:n})})}return(0,R.jsxs)(`div`,{className:`py-3 px-4 bg-gray-50 rounded-lg`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`span`,{className:`text-sm font-medium text-gray-900`,children:[`#`,e.id]}),(0,R.jsx)(`span`,{className:`text-xs text-gray-500`,children:x4(new Date(e.savedAt),`yyyy-MM-dd HH:mm:ss`)})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>_(t?null:String(e.id)),children:t?`收起对比`:`与当前对比`}),(0,R.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>{h({open:!0,title:`确认恢复配置`,description:`确定要恢复到 ${x4(new Date(e.savedAt),`yyyy-MM-dd HH:mm:ss`)} 的配置吗?当前配置将被覆盖。`,onConfirm:()=>{se.mutate(e.config),h(e=>({...e,open:!1}))}})},children:`恢复到此版本`})]})]}),(0,R.jsx)(gb,{children:t&&(0,R.jsx)(sS.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:`overflow-hidden`,children:(0,R.jsxs)(`div`,{className:`mt-3 rounded border border-gray-200 overflow-hidden text-xs font-mono`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-3 bg-gray-100 px-3 py-1.5 text-gray-500 font-medium text-xs`,children:[(0,R.jsx)(`span`,{children:`配置项`}),(0,R.jsx)(`span`,{className:`text-red-600`,children:`历史值`}),(0,R.jsx)(`span`,{className:`text-green-600`,children:`当前值`})]}),r.length===0?(0,R.jsx)(`div`,{className:`px-3 py-3 text-gray-400 text-center`,children:`与当前配置完全一致`}):(0,R.jsx)(`div`,{className:`divide-y divide-gray-100 max-h-64 overflow-auto`,children:r.map(({key:e,old:t,cur:n})=>(0,R.jsxs)(`div`,{className:`grid grid-cols-3 px-3 py-1.5 hover:bg-gray-50`,children:[(0,R.jsx)(`span`,{className:`text-gray-600 truncate pr-2`,children:e}),(0,R.jsx)(`span`,{className:`text-red-600 truncate pr-2 bg-red-50 rounded px-1`,children:t}),(0,R.jsx)(`span`,{className:`text-green-600 truncate bg-green-50 rounded px-1`,children:n})]},e))})]})})}),!t&&(0,R.jsx)(`div`,{className:`mt-2 text-xs text-gray-500 font-mono bg-white rounded border border-gray-100 p-2 max-h-32 overflow-auto`,children:(0,R.jsx)(`pre`,{className:`whitespace-pre-wrap break-all`,children:JSON.stringify(e.config,null,2)})})]},e.id)})}):(0,R.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`暂无配置变更记录`})]}),a===`environment`&&(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`font-medium text-gray-900 mb-1`,children:`Hook 环境诊断`}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500`,children:`检测 Forge hooks 脚本与 Claude settings.json 中 Forge 注入是否完整`})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 flex-shrink-0`,children:[(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Pc,onClick:()=>k(),children:`重新检测`}),(0,R.jsx)(Y,{size:`sm`,icon:$c,onClick:()=>oe.mutate(),disabled:oe.isPending||O?.hooksHealthy,children:oe.isPending?`修复中...`:`一键修复`})]})]})}),u&&(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-2`,children:[u.hooksHealthy?(0,R.jsx)(Gs,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,R.jsx)(Xc,{className:`h-4 w-4 text-yellow-500 mt-0.5 flex-shrink-0`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:q(`text-sm font-medium`,u.hooksHealthy?`text-gray-900`:`text-yellow-600`),children:u.hooksHealthy?`Hooks 环境已恢复正常`:`修复后仍有未通过项,请根据下方列表排查`}),u.backupPath&&(0,R.jsxs)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:[`已备份 settings: `,u.backupPath.split(`/`).pop()]})]})]}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:qs,onClick:()=>d(null)})]})}),O&&(0,R.jsx)(X,{children:(0,R.jsx)(`div`,{className:`space-y-2`,children:O.items.map(e=>(0,R.jsxs)(`div`,{className:`flex items-start gap-3 py-2 border-b border-gray-50 last:border-0`,children:[(0,R.jsx)(`div`,{className:`flex-shrink-0 mt-0.5`,children:e.ok?(0,R.jsx)(Gs,{className:`h-4 w-4 text-green-500`}):e.id===`daemon_process`?(0,R.jsx)(Xc,{className:`h-4 w-4 text-yellow-500`}):(0,R.jsx)(qs,{className:`h-4 w-4 text-red-500`})}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:e.label}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5 break-all`,children:e.detail})]})]},e.id))})}),O&&(0,R.jsx)(X,{className:O.hooksHealthy?`!border-green-200 !bg-green-50`:`!border-yellow-200 !bg-yellow-50`,children:(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:O.hooksHealthy?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Gs,{className:`h-5 w-5 text-green-600`}),(0,R.jsx)(`p`,{className:`text-sm font-medium text-green-700`,children:`Hooks 相关环境正常`})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Xc,{className:`h-5 w-5 text-yellow-600`}),(0,R.jsx)(`p`,{className:`text-sm font-medium text-yellow-700`,children:`检测到 Hooks 环境不完整,请点击「一键修复」`})]})})})]})]}),(0,R.jsx)(w4,{open:m.open,title:m.title,description:m.description,variant:`danger`,onConfirm:m.onConfirm,onCancel:()=>h({...m,open:!1})})]})}function E3({children:e,fallback:t,rootMargin:n=`200px`}){let[r,i]=(0,L.useState)(!1),a=(0,L.useRef)(null);return(0,L.useEffect)(()=>{let e=new IntersectionObserver(([t])=>{t.isIntersecting&&(i(!0),e.disconnect())},{rootMargin:n,threshold:.01});return a.current&&e.observe(a.current),()=>e.disconnect()},[n]),(0,R.jsx)(`div`,{ref:a,style:{minHeight:r?`auto`:`400px`},children:r?e:t||(0,R.jsx)(`div`,{className:`flex items-center justify-center h-96 text-gray-400`,children:`加载中...`})})}var D3=[`#667eea`,`#10b981`,`#f59e0b`,`#ef4444`,`#8b5cf6`,`#06b6d4`],O3={"7d":7,"30d":30,"90d":90,custom:0};function k3(){let[e,t]=(0,L.useState)(`30d`),[n,r]=(0,L.useState)(``),[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(`sessions`),c=O3[e],l=e===`custom`?n?`${n}T00:00:00`:void 0:x4(C4(new Date,c),`yyyy-MM-dd'T'HH:mm:ss`),u=e===`custom`&&i?`${i}T23:59:59`:void 0,{data:d,isLoading:f,isError:p,refetch:m}=ut({queryKey:[`sessions`,{limit:500,startTime:l,endTime:u}],queryFn:()=>dl({limit:500,start_time:l,end_time:u}).then(e=>e.data)}),{data:h,isLoading:g,isError:_,refetch:v}=ut({queryKey:[`events`,{limit:1e3,startTime:l,endTime:u}],queryFn:()=>hl({limit:1e3,start_time:l,end_time:u}).then(e=>e.data)}),{data:y,isLoading:b}=ut({queryKey:[`event-stats`],queryFn:()=>gl().then(e=>e.data)}),{data:x}=ut({queryKey:[`api-usage-stats`,e],queryFn:()=>Su(e===`custom`?90:c).then(e=>e.data),staleTime:6e4}),{data:S}=ut({queryKey:[`pipelines-analytics`,{limit:500}],queryFn:()=>_l({limit:500}).then(e=>e.data),enabled:o===`pipelines`}),{data:C}=ut({queryKey:[`quality-history-analytics`,{limit:500}],queryFn:()=>yl({limit:500}).then(e=>e.data),enabled:o===`pipelines`}),w=f||g||b,T=p||_,E=()=>{K4(`analytics-sessions-${x4(new Date,`yyyyMMdd`)}.csv`,[`日期`,`会话数`],D.map(e=>[e.date,e.count])),K4(`analytics-tools-${x4(new Date,`yyyyMMdd`)}.csv`,[`工具`,`使用次数`],j.map(e=>[e.name,e.value])),K4(`analytics-projects-${x4(new Date,`yyyyMMdd`)}.csv`,[`项目`,`事件数`],k.map(e=>[e.name,e.value])),K4(`analytics-durations-${x4(new Date,`yyyyMMdd`)}.csv`,[`时长区间`,`会话数`],N.map(e=>[e.range,e.count]))},D=(0,L.useMemo)(()=>{if(!d?.items)return[];if(e===`custom`){if(!n||!i)return[];let e=new Date(n),t=new Date(i),r=Math.ceil((t.getTime()-e.getTime())/(1e3*60*60*24))+1;return Array.from({length:r},(t,n)=>{let r=x4(new Date(e.getTime()+n*24*60*60*1e3),`MM-dd`);return{date:r,count:d.items.filter(e=>x4(Df(e.start_time),`MM-dd`)===r).length}})}return Array.from({length:c},(e,t)=>{let n=x4(C4(new Date,c-1-t),`MM-dd`);return{date:n,count:d.items.filter(e=>x4(Df(e.start_time),`MM-dd`)===n).length}})},[d?.items,c,e,n,i]),O=(0,L.useMemo)(()=>h?.items?Array.from({length:24},(e,t)=>{let n=h.items.filter(e=>Df(e.timestamp).getHours()===t).length;return{hour:`${t}:00`,count:n}}):[],[h?.items]),k=(0,L.useMemo)(()=>{if(!h?.items)return[];let e=h.items.reduce((e,t)=>{let n=t.project_path.split(`/`).pop()||`Unknown`;return e[n]=(e[n]||0)+1,e},{});return Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,10).map(([e,t])=>({name:e,value:t}))},[h?.items]),A={Bash:`Bash 命令`,Read:`读取文件`,Edit:`编辑文件`,Write:`写入文件`,Grep:`搜索内容`,Glob:`查找文件`,Agent:`子代理`,WebFetch:`网页获取`,WebSearch:`网页搜索`,TodoWrite:`任务管理`,NotebookEdit:`笔记编辑`,stop:`停止`,notification:`通知`,UserPrompt:`用户输入`,TaskCreate:`创建任务`,TaskUpdate:`更新任务`,TaskList:`任务列表`,TaskGet:`获取任务`,TaskStop:`停止任务`,TaskOutput:`任务输出`},j=(0,L.useMemo)(()=>{if(!h?.items)return[];let e=h.items.reduce((e,t)=>{let n=t.tool_name||`N/A`;return e[n]=(e[n]||0)+1,e},{});return Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,15).map(([e,t])=>({name:A[e]||e,value:t}))},[h?.items]),{sessionDurations:M,durationBuckets:N}=(0,L.useMemo)(()=>{if(!d?.items)return{sessionDurations:[],durationBuckets:[]};let e=d.items.filter(e=>e.end_time).map(e=>{let t=(Df(e.end_time).getTime()-Df(e.start_time).getTime())/1e3/60;return Math.round(t)});return{sessionDurations:e,durationBuckets:[{range:`0-5分钟`,count:e.filter(e=>e<=5).length},{range:`5-15分钟`,count:e.filter(e=>e>5&&e<=15).length},{range:`15-30分钟`,count:e.filter(e=>e>15&&e<=30).length},{range:`30-60分钟`,count:e.filter(e=>e>30&&e<=60).length},{range:`60+分钟`,count:e.filter(e=>e>60).length}]}},[d?.items]),{avgSessionEvents:ee,avgSessionDuration:te}=(0,L.useMemo)(()=>{let e=M.filter(e=>e>0&&e<=480),t=e.length>0?e.reduce((e,t)=>e+t,0)/e.length:0,n=d?.items.filter(e=>e.event_count>0&&e.event_count<=500)??[];return{avgSessionEvents:n.length>0?n.reduce((e,t)=>e+t.event_count,0)/n.length:0,avgSessionDuration:t}},[d?.items,M]),P=(0,L.useMemo)(()=>{if(!S?.items)return null;let e=S.items,t=e.filter(e=>e.status===`completed`).length;return{completed:t,failed:e.filter(e=>e.status===`failed`).length,completionRate:e.length>0?(t/e.length*100).toFixed(1):`0`,complexityDist:e.reduce((e,t)=>(e[t.complexity]=(e[t.complexity]||0)+1,e),{}),avgNodes:e.length>0?(e.reduce((e,t)=>e+(t.stats?.totalNodes||0),0)/e.length).toFixed(1):`0`,total:e.length}},[S?.items]),ne=(0,L.useMemo)(()=>C?.items?Array.from({length:c},(e,t)=>{let n=x4(C4(new Date,c-1-t),`MM-dd`),r=C.items.filter(e=>x4(Df(e.created_at),`MM-dd`)===n);return{date:n,total:r.length,unresolved:r.filter(e=>!e.resolved).length}}):[],[C?.items,c]);return w?(0,R.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,R.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})}):T?(0,R.jsx)(q4,{message:`分析数据加载失败`,onRetry:()=>{m(),v()}}):(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Is,{className:`h-4 w-4 text-gray-400`}),(0,R.jsx)(`span`,{className:`text-sm text-gray-600`,children:`时间范围:`}),(0,R.jsx)(`div`,{className:`flex gap-1 border border-gray-200 rounded-lg overflow-hidden`,children:[`7d`,`30d`,`90d`,`custom`].map(n=>(0,R.jsx)(`button`,{onClick:()=>t(n),className:q(`px-3 py-1.5 text-sm transition-colors`,e===n?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:n===`7d`?`7 天`:n===`30d`?`30 天`:n===`90d`?`90 天`:`自定义`},n))})]}),(0,R.jsx)(Y,{variant:`outline`,size:`sm`,icon:nc,onClick:E,children:`导出数据`})]}),e===`custom`&&(0,R.jsxs)(`div`,{className:`flex items-center gap-3 pl-6`,children:[(0,R.jsx)(`label`,{className:`text-sm text-gray-600`,children:`开始日期:`}),(0,R.jsx)(`input`,{type:`date`,value:n,onChange:e=>r(e.target.value),className:`px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,R.jsx)(`label`,{className:`text-sm text-gray-600`,children:`结束日期:`}),(0,R.jsx)(`input`,{type:`date`,value:i,onChange:e=>a(e.target.value),className:`px-3 py-1.5 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`})]})]})}),(0,R.jsxs)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit`,children:[(0,R.jsxs)(`button`,{onClick:()=>s(`sessions`),className:q(`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors`,o===`sessions`?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`),children:[(0,R.jsx)(Ds,{className:`h-4 w-4`}),`会话分析`]}),(0,R.jsxs)(`button`,{onClick:()=>s(`pipelines`),className:q(`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors`,o===`pipelines`?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`),children:[(0,R.jsx)(pc,{className:`h-4 w-4`}),`Pipeline 分析`]})]}),o===`sessions`&&(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsx)(Ds,{className:`h-7 w-7 text-indigo-500 mx-auto mb-2`}),(0,R.jsx)(`div`,{className:`text-2xl font-bold text-gray-900`,children:ee.toFixed(1)}),(0,R.jsx)(`div`,{className:`text-sm text-gray-500`,children:`平均会话事件数`})]}),(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsx)(Ys,{className:`h-7 w-7 text-green-500 mx-auto mb-2`}),(0,R.jsx)(`div`,{className:`text-2xl font-bold text-gray-900`,children:te.toFixed(1)}),(0,R.jsx)(`div`,{className:`text-sm text-gray-500`,children:`平均会话时长(分钟)`})]}),(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsx)(tl,{className:`h-7 w-7 text-amber-500 mx-auto mb-2`}),(0,R.jsx)(`div`,{className:`text-2xl font-bold text-gray-900`,children:h?.total||0}),(0,R.jsx)(`div`,{className:`text-sm text-gray-500`,children:`总事件数`})]}),(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsx)(Yc,{className:`h-7 w-7 text-purple-500 mx-auto mb-2`}),(0,R.jsx)(`div`,{className:`text-2xl font-bold text-gray-900`,children:d?.total||0}),(0,R.jsx)(`div`,{className:`text-sm text-gray-500`,children:`总会话数`})]})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-2 gap-6`,children:[(0,R.jsx)(X,{title:`最近 ${c} 天会话趋势`,children:(0,R.jsx)(E3,{children:(0,R.jsx)(Dk,{width:`100%`,height:250,children:(0,R.jsxs)(m2,{data:D,children:[(0,R.jsx)(XX,{strokeDasharray:`3 3`}),(0,R.jsx)(Y$,{dataKey:`date`}),(0,R.jsx)(u1,{}),(0,R.jsx)(VW,{}),(0,R.jsx)(OQ,{type:`monotone`,dataKey:`count`,stroke:`#667eea`,fill:`#667eea`,fillOpacity:.3})]})})})}),(0,R.jsx)(X,{title:`24 小时事件分布`,children:(0,R.jsx)(E3,{children:(0,R.jsx)(Dk,{width:`100%`,height:250,children:(0,R.jsxs)(W0,{data:O,children:[(0,R.jsx)(XX,{strokeDasharray:`3 3`}),(0,R.jsx)(Y$,{dataKey:`hour`}),(0,R.jsx)(u1,{}),(0,R.jsx)(VW,{}),(0,R.jsx)(UZ,{type:`monotone`,dataKey:`count`,stroke:`#10b981`,strokeWidth:2})]})})})}),(0,R.jsx)(X,{title:`项目活跃度 Top 10`,children:(0,R.jsx)(E3,{children:(0,R.jsx)(Dk,{width:`100%`,height:250,children:(0,R.jsxs)(K0,{data:k,layout:`vertical`,children:[(0,R.jsx)(XX,{strokeDasharray:`3 3`}),(0,R.jsx)(Y$,{type:`number`}),(0,R.jsx)(u1,{dataKey:`name`,type:`category`,width:100}),(0,R.jsx)(VW,{}),(0,R.jsx)(O$,{dataKey:`value`,fill:`#667eea`})]})})})}),(0,R.jsx)(X,{title:`工具使用排行 Top 15`,children:(0,R.jsx)(E3,{children:(0,R.jsx)(Dk,{width:`100%`,height:250,children:(0,R.jsxs)(K0,{data:j,children:[(0,R.jsx)(XX,{strokeDasharray:`3 3`}),(0,R.jsx)(Y$,{dataKey:`name`,angle:-45,textAnchor:`end`,height:80}),(0,R.jsx)(u1,{}),(0,R.jsx)(VW,{}),(0,R.jsx)(O$,{dataKey:`value`,fill:`#10b981`})]})})})}),(0,R.jsx)(X,{title:`会话时长分布`,children:(0,R.jsx)(E3,{children:(0,R.jsx)(Dk,{width:`100%`,height:250,children:(0,R.jsxs)(f2,{children:[(0,R.jsx)(zJ,{data:N,cx:`50%`,cy:`50%`,labelLine:!1,label:({range:e,count:t})=>`${e}: ${t}`,outerRadius:80,fill:`#8884d8`,dataKey:`count`,children:N.map((e,t)=>(0,R.jsx)(HW,{fill:D3[t%D3.length]},`cell-${t}`))}),(0,R.jsx)(VW,{})]})})})}),(0,R.jsx)(X,{title:`事件类型趋势`,children:(0,R.jsx)(E3,{children:(0,R.jsx)(Dk,{width:`100%`,height:250,children:(0,R.jsxs)(m2,{data:y?.stats.slice(0,30)||[],children:[(0,R.jsx)(XX,{strokeDasharray:`3 3`}),(0,R.jsx)(Y$,{dataKey:`date`}),(0,R.jsx)(u1,{}),(0,R.jsx)(VW,{}),(0,R.jsx)(GA,{}),(0,R.jsx)(OQ,{type:`monotone`,dataKey:`count`,stackId:`1`,stroke:`#667eea`,fill:`#667eea`})]})})})})]}),x&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mt-2`,children:[(0,R.jsx)(tc,{className:`h-5 w-5 text-gray-500`}),(0,R.jsx)(`h2`,{className:`text-base font-semibold text-gray-800`,children:`Token 与费用统计`})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsxs)(`div`,{className:`text-2xl font-bold text-gray-900`,children:[`$`,x.summary.totalCost.toFixed(4)]}),(0,R.jsx)(`div`,{className:`text-sm text-gray-500`,children:`总费用(USD)`})]}),(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsxs)(`div`,{className:`text-2xl font-bold text-gray-900`,children:[(x.summary.totalTokens/1e3).toFixed(1),`K`]}),(0,R.jsx)(`div`,{className:`text-sm text-gray-500`,children:`总 Token 数`})]}),(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsxs)(`div`,{className:`text-2xl font-bold text-gray-900`,children:[(x.summary.totalTokensIn/1e3).toFixed(1),`K`]}),(0,R.jsx)(`div`,{className:`text-sm text-gray-500`,children:`输入 Token`})]}),(0,R.jsxs)(X,{className:`text-center !p-4`,children:[(0,R.jsxs)(`div`,{className:`text-2xl font-bold text-gray-900`,children:[(x.summary.totalTokensOut/1e3).toFixed(1),`K`]}),(0,R.jsx)(`div`,{className:`text-sm text-gray-500`,children:`输出 Token`})]})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-1 xl:grid-cols-2 gap-6`,children:[(0,R.jsx)(X,{title:`每日 Token 趋势`,children:(0,R.jsx)(E3,{children:(0,R.jsx)(Dk,{width:`100%`,height:250,children:(0,R.jsxs)(m2,{data:x.dailyTrend,children:[(0,R.jsx)(XX,{strokeDasharray:`3 3`}),(0,R.jsx)(Y$,{dataKey:`date`}),(0,R.jsx)(u1,{}),(0,R.jsx)(VW,{formatter:e=>`${(e/1e3).toFixed(1)}K`}),(0,R.jsx)(GA,{}),(0,R.jsx)(OQ,{type:`monotone`,dataKey:`tokens_in`,name:`输入`,stroke:`#667eea`,fill:`#667eea`,fillOpacity:.3,stackId:`1`}),(0,R.jsx)(OQ,{type:`monotone`,dataKey:`tokens_out`,name:`输出`,stroke:`#10b981`,fill:`#10b981`,fillOpacity:.3,stackId:`1`})]})})})}),(0,R.jsx)(X,{title:`每日费用趋势(USD)`,children:(0,R.jsx)(E3,{children:(0,R.jsx)(Dk,{width:`100%`,height:250,children:(0,R.jsxs)(K0,{data:x.dailyTrend,children:[(0,R.jsx)(XX,{strokeDasharray:`3 3`}),(0,R.jsx)(Y$,{dataKey:`date`}),(0,R.jsx)(u1,{tickFormatter:e=>`$${e.toFixed(3)}`}),(0,R.jsx)(VW,{formatter:e=>`$${e.toFixed(4)}`}),(0,R.jsx)(O$,{dataKey:`cost_usd`,name:`费用`,fill:`#f59e0b`})]})})})}),x.byModel.length>0&&(0,R.jsx)(X,{title:`按模型费用分布`,children:(0,R.jsx)(E3,{children:(0,R.jsx)(Dk,{width:`100%`,height:250,children:(0,R.jsxs)(f2,{children:[(0,R.jsx)(zJ,{data:x.byModel,dataKey:`cost`,nameKey:`model`,cx:`50%`,cy:`50%`,outerRadius:80,label:({model:e,cost:t})=>`${e}: $${t.toFixed(4)}`,children:x.byModel.map((e,t)=>(0,R.jsx)(HW,{fill:D3[t%D3.length]},t))}),(0,R.jsx)(VW,{formatter:e=>`$${e.toFixed(4)}`})]})})})})]})]})]}),o===`pipelines`&&P&&(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4`,children:[(0,R.jsxs)(X,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`text-3xl font-bold text-blue-600`,children:P.total}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`总 Pipeline`})]}),(0,R.jsxs)(X,{className:`text-center`,children:[(0,R.jsxs)(`div`,{className:`text-3xl font-bold text-green-600`,children:[P.completionRate,`%`]}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`完成率`})]}),(0,R.jsxs)(X,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`text-3xl font-bold text-purple-600`,children:P.avgNodes}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`平均节点数`})]}),(0,R.jsxs)(X,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`text-3xl font-bold text-red-600`,children:P.failed}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600 mt-1`,children:`失败数`})]})]}),(0,R.jsx)(X,{title:`复杂度分布`,children:(0,R.jsx)(E3,{children:(0,R.jsx)(Dk,{width:`100%`,height:250,children:(0,R.jsxs)(K0,{data:Object.entries(P.complexityDist).map(([e,t])=>({name:e===`simple`?`简单`:e===`moderate`?`中等`:`复杂`,value:t})),children:[(0,R.jsx)(XX,{strokeDasharray:`3 3`}),(0,R.jsx)(Y$,{dataKey:`name`}),(0,R.jsx)(u1,{}),(0,R.jsx)(VW,{}),(0,R.jsx)(O$,{dataKey:`value`,name:`数量`,fill:`#667eea`})]})})})}),ne.length>0&&(0,R.jsx)(X,{title:`质量问题趋势`,children:(0,R.jsx)(E3,{children:(0,R.jsx)(Dk,{width:`100%`,height:250,children:(0,R.jsxs)(W0,{data:ne,children:[(0,R.jsx)(XX,{strokeDasharray:`3 3`}),(0,R.jsx)(Y$,{dataKey:`date`}),(0,R.jsx)(u1,{}),(0,R.jsx)(VW,{}),(0,R.jsx)(GA,{}),(0,R.jsx)(UZ,{type:`monotone`,dataKey:`total`,name:`总问题`,stroke:`#667eea`,strokeWidth:2}),(0,R.jsx)(UZ,{type:`monotone`,dataKey:`unresolved`,name:`未解决`,stroke:`#ef4444`,strokeWidth:2})]})})})})]})]})}function A3(e,t){let[n,r]=(0,L.useState)(e);return(0,L.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function j3({open:e,count:t,itemLabel:n=`项`,loading:r=!1,onConfirm:i,onCancel:a}){let[o,s]=(0,L.useState)(``);if((0,L.useEffect)(()=>{e||s(``)},[e]),(0,L.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&a()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,a]),!e)return null;let c=t<5?`simple`:t<=20?`count`:`keyword`,l=`DELETE`,u=c===`simple`||c===`count`&&o===String(t)||c===`keyword`&&o===l;return(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm`,onClick:a,children:(0,R.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md mx-4 p-6`,onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,R.jsx)(`div`,{className:`flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center bg-red-50`,children:(0,R.jsx)(Jc,{className:`h-5 w-5 text-red-500`})}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsxs)(`h3`,{className:`text-base font-semibold text-gray-900`,children:[`删除 `,t,` 个`,n]}),(0,R.jsx)(`p`,{className:`mt-1 text-sm text-gray-500 leading-relaxed`,children:`此操作不可撤销,关联数据也会被删除。`}),c===`count`&&(0,R.jsxs)(`div`,{className:`mt-3`,children:[(0,R.jsxs)(`label`,{className:`block text-xs text-gray-500 mb-1`,children:[`请输入数量 `,(0,R.jsx)(`span`,{className:`font-mono font-bold text-gray-800`,children:t}),` 以确认:`]}),(0,R.jsx)(`input`,{autoFocus:!0,type:`text`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u&&i()},placeholder:String(t),className:`w-full px-3 py-1.5 text-sm border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-400 font-mono`})]}),c===`keyword`&&(0,R.jsxs)(`div`,{className:`mt-3`,children:[(0,R.jsxs)(`label`,{className:`block text-xs text-gray-500 mb-1`,children:[`请输入 `,(0,R.jsx)(`span`,{className:`font-mono font-bold text-red-600`,children:l}),` 以确认:`]}),(0,R.jsx)(`input`,{autoFocus:!0,type:`text`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u&&i()},placeholder:l,className:`w-full px-3 py-1.5 text-sm border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-400 font-mono`})]})]})]}),(0,R.jsxs)(`div`,{className:`flex justify-end gap-3 mt-6`,children:[(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,onClick:a,disabled:r,children:`取消`}),(0,R.jsx)(Y,{variant:`danger`,size:`sm`,onClick:i,loading:r,disabled:!u,children:`确认删除`})]})]})})}function M3(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=M3(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var N3={value:()=>{}};function P3(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new F3(n)}function F3(e){this._=e}function I3(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}F3.prototype=P3.prototype={constructor:F3,on:function(e,t){var n=this._,r=I3(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=L3(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=R3(n[i],e.name,t);else if(t==null)for(i in n)n[i]=R3(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new F3(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function L3(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function R3(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=N3,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var z3={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function B3(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),z3.hasOwnProperty(t)?{space:z3[t],local:e}:e}function V3(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function H3(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function U3(e){var t=B3(e);return(t.local?H3:V3)(t)}function W3(){}function G3(e){return e==null?W3:function(){return this.querySelector(e)}}function K3(e){typeof e!=`function`&&(e=G3(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new l6(r,this._parents)}function q3(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function J3(){return[]}function Y3(e){return e==null?J3:function(){return this.querySelectorAll(e)}}function Cae(e){return function(){return q3(e.apply(this,arguments))}}function wae(e){e=typeof e==`function`?Cae(e):Y3(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new l6(r,i)}function X3(e){return function(){return this.matches(e)}}function Z3(e){return function(t){return t.matches(e)}}var Tae=Array.prototype.find;function Eae(e){return function(){return Tae.call(this.children,e)}}function Dae(){return this.firstElementChild}function Oae(e){return this.select(e==null?Dae:Eae(typeof e==`function`?e:Z3(e)))}var kae=Array.prototype.filter;function Aae(){return Array.from(this.children)}function jae(e){return function(){return kae.call(this.children,e)}}function Mae(e){return this.selectAll(e==null?Aae:jae(typeof e==`function`?e:Z3(e)))}function Nae(e){typeof e!=`function`&&(e=X3(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new l6(r,this._parents)}function Q3(e){return Array(e.length)}function Pae(){return new l6(this._enter||this._groups.map(Q3),this._parents)}function $3(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}$3.prototype={constructor:$3,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 Fae(e){return function(){return e}}function Iae(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new $3(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Lae(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new $3(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Rae(e){return e.__data__}function zae(e,t){if(!arguments.length)return Array.from(this,Rae);var n=t?Lae:Iae,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Fae(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Bae(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new l6(o,r),o._enter=s,o._exit=c,o}function Bae(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Vae(){return new l6(this._exit||this._groups.map(Q3),this._parents)}function Hae(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Uae(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new l6(s,this._parents)}function Wae(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Gae(e){e||=Kae;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new l6(i,this._parents).order()}function Kae(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function qae(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Jae(){return Array.from(this)}function Yae(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Xae(){let e=0;for(let t of this)++e;return e}function Zae(){return!this.node()}function Qae(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function $ae(e){return function(){this.removeAttribute(e)}}function eoe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function toe(e,t){return function(){this.setAttribute(e,t)}}function noe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function roe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ioe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function aoe(e,t){var n=B3(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?eoe:$ae:typeof t==`function`?n.local?ioe:roe:n.local?noe:toe)(n,t))}function e6(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ooe(e){return function(){this.style.removeProperty(e)}}function soe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function coe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function loe(e,t,n){return arguments.length>1?this.each((t==null?ooe:typeof t==`function`?coe:soe)(e,t,n??``)):t6(this.node(),e)}function t6(e,t){return e.style.getPropertyValue(t)||e6(e).getComputedStyle(e,null).getPropertyValue(t)}function uoe(e){return function(){delete this[e]}}function doe(e,t){return function(){this[e]=t}}function foe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function poe(e,t){return arguments.length>1?this.each((t==null?uoe:typeof t==`function`?foe:doe)(e,t)):this.node()[e]}function n6(e){return e.trim().split(/^|\s+/)}function r6(e){return e.classList||new i6(e)}function i6(e){this._node=e,this._names=n6(e.getAttribute(`class`)||``)}i6.prototype={add:function(e){this._names.indexOf(e)<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 a6(e,t){for(var n=r6(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function o6(e,t){for(var n=r6(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function moe(e){return function(){a6(this,e)}}function hoe(e){return function(){o6(this,e)}}function goe(e,t){return function(){(t.apply(this,arguments)?a6:o6)(this,e)}}function _oe(e,t){var n=n6(e+``);if(arguments.length<2){for(var r=r6(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?goe:t?moe:hoe)(n,t))}function voe(){this.textContent=``}function yoe(e){return function(){this.textContent=e}}function boe(e){return function(){this.textContent=e.apply(this,arguments)??``}}function xoe(e){return arguments.length?this.each(e==null?voe:(typeof e==`function`?boe:yoe)(e)):this.node().textContent}function Soe(){this.innerHTML=``}function Coe(e){return function(){this.innerHTML=e}}function woe(e){return function(){this.innerHTML=e.apply(this,arguments)??``}}function Toe(e){return arguments.length?this.each(e==null?Soe:(typeof e==`function`?woe:Coe)(e)):this.node().innerHTML}function Eoe(){this.nextSibling&&this.parentNode.appendChild(this)}function Doe(){return this.each(Eoe)}function Ooe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function koe(){return this.each(Ooe)}function Aoe(e){var t=typeof e==`function`?e:U3(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function joe(){return null}function Moe(e,t){var n=typeof e==`function`?e:U3(e),r=t==null?joe:typeof t==`function`?t:G3(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Noe(){var e=this.parentNode;e&&e.removeChild(this)}function Poe(){return this.each(Noe)}function Foe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ioe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Loe(e){return this.select(e?Ioe:Foe)}function Roe(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function zoe(e){return function(t){e.call(this,t,this.__data__)}}function Boe(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Voe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Hoe(e,t,n){return function(){var r=this.__on,i,a=zoe(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Uoe(e,t,n){var r=Boe(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Hoe:Voe,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function s6(e,t,n){var r=e6(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Woe(e,t){return function(){return s6(this,e,t)}}function Goe(e,t){return function(){return s6(this,e,t.apply(this,arguments))}}function Koe(e,t){return this.each((typeof t==`function`?Goe:Woe)(e,t))}function*qoe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var c6=[null];function l6(e,t){this._groups=e,this._parents=t}function u6(){return new l6([[document.documentElement]],c6)}function Joe(){return this}l6.prototype=u6.prototype={constructor:l6,select:K3,selectAll:wae,selectChild:Oae,selectChildren:Mae,filter:Nae,data:zae,enter:Pae,exit:Vae,join:Hae,merge:Uae,selection:Joe,order:Wae,sort:Gae,call:qae,nodes:Jae,node:Yae,size:Xae,empty:Zae,each:Qae,attr:aoe,style:loe,property:poe,classed:_oe,text:xoe,html:Toe,raise:Doe,lower:koe,append:Aoe,insert:Moe,remove:Poe,clone:Loe,datum:Roe,on:Uoe,dispatch:Koe,[Symbol.iterator]:qoe};function d6(e){return typeof e==`string`?new l6([[document.querySelector(e)]],[document.documentElement]):new l6([[e]],c6)}function Yoe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function f6(e,t){if(e=Yoe(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Xoe={passive:!1},p6={capture:!0,passive:!1};function m6(e){e.stopImmediatePropagation()}function h6(e){e.preventDefault(),e.stopImmediatePropagation()}function g6(e){var t=e.document.documentElement,n=d6(e).on(`dragstart.drag`,h6,p6);`onselectstart`in t?n.on(`selectstart.drag`,h6,p6):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function _6(e,t){var n=e.document.documentElement,r=d6(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,h6,p6),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var v6=e=>()=>e;function y6(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}y6.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Zoe(e){return!e.ctrlKey&&!e.button}function Qoe(){return this.parentNode}function $oe(e,t){return t??{x:e.x,y:e.y}}function ese(){return navigator.maxTouchPoints||`ontouchstart`in this}function b6(){var e=Zoe,t=Qoe,n=$oe,r=ese,i={},a=P3(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Xoe).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(d6(n.view).on(`mousemove.drag`,m,p6).on(`mouseup.drag`,h,p6),g6(n.view),m6(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(h6(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){d6(e.view).on(`mousemove.drag mouseup.drag`,null),_6(e.view,l),h6(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(m6(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(h6(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(m6(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=f6(l||r,t),p,m,h;if((h=n.call(e,new y6(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=f6(l||a,t),_=o;break}u.call(r,e,new y6(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:v6(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:v6(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:v6(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:v6(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}var x6=0,S6=0,C6=0,w6=1e3,T6,E6,D6=0,O6=0,k6=0,A6=typeof performance==`object`&&performance.now?performance:Date,j6=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function M6(){return O6||=(j6(tse),A6.now()+k6)}function tse(){O6=0}function N6(){this._call=this._time=this._next=null}N6.prototype=P6.prototype={constructor:N6,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?M6():+n)+(t==null?0:+t),!this._next&&E6!==this&&(E6?E6._next=this:T6=this,E6=this),this._call=e,this._time=n,I6()},stop:function(){this._call&&(this._call=null,this._time=1/0,I6())}};function P6(e,t,n){var r=new N6;return r.restart(e,t,n),r}function nse(){M6(),++x6;for(var e=T6,t;e;)(t=O6-e._time)>=0&&e._call.call(void 0,t),e=e._next;--x6}function F6(){O6=(D6=A6.now())+k6,x6=S6=0;try{nse()}finally{x6=0,ise(),O6=0}}function rse(){var e=A6.now(),t=e-D6;t>w6&&(k6-=t,D6=e)}function ise(){for(var e,t=T6,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:T6=n);E6=e,I6(r)}function I6(e){x6||(S6&&=clearTimeout(S6),e-O6>24?(e<1/0&&(S6=setTimeout(F6,e-A6.now()-k6)),C6&&=clearInterval(C6)):(C6||=(D6=A6.now(),setInterval(rse,w6)),x6=1,j6(F6)))}function L6(e,t,n){var r=new N6;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var ase=P3(`start`,`end`,`cancel`,`interrupt`),ose=[];function R6(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;sse(e,n,{name:t,index:r,group:i,on:ase,tween:ose,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function z6(e,t){var n=V6(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function B6(e,t){var n=V6(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function V6(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function sse(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=P6(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return L6(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(L6(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function H6(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function cse(e){return this.each(function(){H6(this,e)})}function lse(e,t){var n,r;return function(){var i=B6(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function use(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=B6(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function dse(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=V6(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?lse:use)(n,e,t))}function U6(e,t,n){var r=e._id;return e.each(function(){var e=B6(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return V6(e,r).value[t]}}function W6(e,t){var n;return(typeof t==`number`?TI:t instanceof XF?bI:(n=XF(t))?(t=n,bI):jI)(e,t)}function fse(e){return function(){this.removeAttribute(e)}}function pse(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mse(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function hse(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function gse(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function _se(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function vse(e,t){var n=B3(e),r=n===`transform`?HI:W6;return this.attrTween(e,typeof t==`function`?(n.local?_se:gse)(n,r,U6(this,`attr.`+e,t)):t==null?(n.local?pse:fse)(n):(n.local?hse:mse)(n,r,t))}function yse(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function bse(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function xse(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&bse(e,i)),n}return i._value=t,i}function Sse(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&yse(e,i)),n}return i._value=t,i}function Cse(e,t){var n=`attr.`+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 Error();var r=B3(e);return this.tween(n,(r.local?xse:Sse)(r,t))}function wse(e,t){return function(){z6(this,e).delay=+t.apply(this,arguments)}}function Tse(e,t){return t=+t,function(){z6(this,e).delay=t}}function Ese(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?wse:Tse)(t,e)):V6(this.node(),t).delay}function Dse(e,t){return function(){B6(this,e).duration=+t.apply(this,arguments)}}function Ose(e,t){return t=+t,function(){B6(this,e).duration=t}}function kse(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Dse:Ose)(t,e)):V6(this.node(),t).duration}function Ase(e,t){if(typeof t!=`function`)throw Error();return function(){B6(this,e).ease=t}}function jse(e){var t=this._id;return arguments.length?this.each(Ase(t,e)):V6(this.node(),t).ease}function Mse(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();B6(this,e).ease=n}}function Nse(e){if(typeof e!=`function`)throw Error();return this.each(Mse(this._id,e))}function Pse(e){typeof e!=`function`&&(e=X3(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new K6(r,this._parents,this._name,this._id)}function Fse(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new K6(o,this._parents,this._name,this._id)}function Ise(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Lse(e,t,n){var r,i,a=Ise(t)?z6:B6;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Rse(e,t){var n=this._id;return arguments.length<2?V6(this.node(),n).on.on(e):this.each(Lse(n,e,t))}function zse(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Bse(){return this.on(`end.remove`,zse(this._id))}function Vse(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=G3(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,R6(l[f],t,n,f,l,V6(u,n)));return new K6(a,this._parents,t,n)}function Hse(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Y3(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=V6(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&R6(p,t,n,h,f,m);a.push(f),o.push(u)}return new K6(a,o,t,n)}var Use=u6.prototype.constructor;function Wse(){return new Use(this._groups,this._parents)}function Gse(e,t){var n,r,i;return function(){var a=t6(this,e),o=(this.style.removeProperty(e),t6(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function G6(e){return function(){this.style.removeProperty(e)}}function Kse(e,t,n){var r,i=n+``,a;return function(){var o=t6(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function qse(e,t,n){var r,i,a;return function(){var o=t6(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),t6(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Jse(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=B6(this,e),l=c.on,u=c.value[a]==null?s||=G6(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Yse(e,t,n){var r=(e+=``)==`transform`?VI:W6;return t==null?this.styleTween(e,Gse(e,r)).on(`end.style.`+e,G6(e)):typeof t==`function`?this.styleTween(e,qse(e,r,U6(this,`style.`+e,t))).each(Jse(this._id,e)):this.styleTween(e,Kse(e,r,t),n).on(`end.style.`+e,null)}function Xse(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Zse(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Xse(e,a,n)),r}return a._value=t,a}function Qse(e,t,n){var r=`style.`+(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 Error();return this.tween(r,Zse(e,t,n??``))}function $se(e){return function(){this.textContent=e}}function ece(e){return function(){this.textContent=e(this)??``}}function tce(e){return this.tween(`text`,typeof e==`function`?ece(U6(this,`text`,e)):$se(e==null?``:e+``))}function nce(e){return function(t){this.textContent=e.call(this,t)}}function rce(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&nce(r)),t}return r._value=e,r}function ice(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 Error();return this.tween(t,rce(e))}function ace(){for(var e=this._name,t=this._id,n=q6(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=V6(c,t);R6(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new K6(r,this._parents,e,n)}function oce(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=B6(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var sce=0;function K6(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function cce(e){return u6().transition(e)}function q6(){return++sce}var J6=u6.prototype;K6.prototype=cce.prototype={constructor:K6,select:Vse,selectAll:Hse,selectChild:J6.selectChild,selectChildren:J6.selectChildren,filter:Pse,merge:Fse,selection:Wse,transition:ace,call:J6.call,nodes:J6.nodes,node:J6.node,size:J6.size,empty:J6.empty,each:J6.each,on:Rse,attr:vse,attrTween:Cse,style:Yse,styleTween:Qse,text:tce,textTween:ice,remove:Bse,tween:dse,delay:Ese,duration:kse,ease:jse,easeVarying:Nse,end:oce,[Symbol.iterator]:J6[Symbol.iterator]};function lce(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var uce={time:null,delay:0,duration:250,ease:lce};function dce(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function fce(e){var t,n;e instanceof K6?(t=e._id,e=e._name):(t=q6(),(n=uce).time=M6(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&R6(c,e,t,l,o,n||dce(c,t));return new K6(r,this._parents,e,t)}u6.prototype.interrupt=cse,u6.prototype.transition=fce;var Y6=e=>()=>e;function pce(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function X6(e,t,n){this.k=e,this.x=t,this.y=n}X6.prototype={constructor:X6,scale:function(e){return e===1?this:new X6(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new X6(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 Z6=new X6(1,0,0);Q6.prototype=X6.prototype;function Q6(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Z6;return e.__zoom}function $6(e){e.stopImmediatePropagation()}function e8(e){e.preventDefault(),e.stopImmediatePropagation()}function mce(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function hce(){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 t8(){return this.__zoom||Z6}function gce(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function _ce(){return navigator.maxTouchPoints||`ontouchstart`in this}function vce(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function n8(){var e=mce,t=hce,n=vce,r=gce,i=_ce,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=qI,l=P3(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,t8).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,t8),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Z6.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new X6(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new X6(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new X6(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.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,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=d6(this.that).datum();l.call(e,this.that,new pce(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=f6(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],H6(this),s.start();e8(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=d6(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=f6(t,i),l=t.clientX,u=t.clientY;g6(t.view),$6(t),a.mouse=[c,this.__zoom.invert(c)],H6(this),a.start();function d(e){if(e8(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=f6(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),_6(e.view,a.moved),e8(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=f6(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);e8(r),s>0?d6(this).transition().duration(s).call(x,d,c,r):d6(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for($6(t),s=0;s<i;++s)c=r[s],l=f6(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),H6(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(e8(e),s=0;s<a;++s)c=i[s],l=f6(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for($6(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=f6(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=d6(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Y6(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Y6(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Y6(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Y6([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var r8={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,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,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.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`},i8=[[-1/0,-1/0],[1/0,1/0]],a8=[`Enter`,` `,`Escape`],o8={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},s8;(function(e){e.Strict=`strict`,e.Loose=`loose`})(s8||={});var c8;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(c8||={});var l8;(function(e){e.Partial=`partial`,e.Full=`full`})(l8||={});var u8={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},d8;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(d8||={});var f8;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(f8||={});var p8;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(p8||={});var m8={[p8.Left]:p8.Right,[p8.Right]:p8.Left,[p8.Top]:p8.Bottom,[p8.Bottom]:p8.Top};function h8(e){return e===null?null:e?`valid`:`invalid`}var g8=e=>`id`in e&&`source`in e&&`target`in e,yce=e=>`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),_8=e=>`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),v8=(e,t=[0,0])=>{let{width:n,height:r}=U8(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},bce=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:k8(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):_8(n)?n:t.nodeLookup.get(n.id)),D8(e,i?j8(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),y8=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=D8(n,j8(e)),r=!0)}),r?k8(n):{x:0,y:0,width:0,height:0}},b8=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s={...L8(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??null,l=e.height??t.height??t.initialHeight??null,u=N8(s,A8(t)),d=(i??0)*(l??0),f=a&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&c.push(t)}return c},xce=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function Sce(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{e.measured.width&&e.measured.height&&(t?.includeHiddenNodes||!e.hidden)&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function Cce({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);let s=B8(y8(Sce(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),Promise.resolve(!0)}function x8({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,r8.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&H8(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=H8(d)?C8(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,r8.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function wce({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=xce(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var S8=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),C8=(e={x:0,y:0},t,n)=>({x:S8(e.x,t[0][0],t[1][0]-(n?.width??0)),y:S8(e.y,t[0][1],t[1][1]-(n?.height??0))});function w8(e,t,n){let{width:r,height:i}=U8(n),{x:a,y:o}=n.internals.positionAbsolute;return C8(e,[[a,o],[a+r,o+i]],t)}var T8=(e,t,n)=>e<t?S8(Math.abs(e-t),1,t)/t:e>n?-S8(Math.abs(e-n),1,t)/t:0,E8=(e,t,n=15,r=40)=>[T8(e.x,r,t.width-r)*n,T8(e.y,r,t.height-r)*n],D8=(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)}),O8=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),k8=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),A8=(e,t=[0,0])=>{let{x:n,y:r}=_8(e)?e.internals.positionAbsolute:v8(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},j8=(e,t=[0,0])=>{let{x:n,y:r}=_8(e)?e.internals.positionAbsolute:v8(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},M8=(e,t)=>k8(D8(O8(e),O8(t))),N8=(e,t)=>{let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},P8=e=>F8(e.width)&&F8(e.height)&&F8(e.x)&&F8(e.y),F8=e=>!isNaN(e)&&isFinite(e),Tce=(e,t)=>{},I8=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),L8=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?I8(s,o):s},R8=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function z8(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Ece(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=z8(e,n),i=z8(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=z8(e.top??e.y??0,n),i=z8(e.bottom??e.y??0,n),a=z8(e.left??e.x??0,t),o=z8(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Dce(e,t,n,r,i,a){let{x:o,y:s}=R8(e,[t,n,r]),{x:c,y:l}=R8({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var B8=(e,t,n,r,i,a)=>{let o=Ece(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=S8(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=Dce(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},V8=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function H8(e){return e!=null&&e!==`parent`}function U8(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function W8(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function G8(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function K8(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Oce(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function kce(e){return{...o8,...e||{}}}function q8(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=Q8(e),s=L8({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?I8(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var J8=e=>({width:e.offsetWidth,height:e.offsetHeight}),Y8=e=>e?.getRootNode?.()||window?.document,Ace=[`INPUT`,`SELECT`,`TEXTAREA`];function X8(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?Ace.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var Z8=e=>`clientX`in e,Q8=(e,t)=>{let n=Z8(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},$8=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...J8(t)}})};function e5({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function t5(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function n5({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case p8.Left:return[t-t5(t-r,a),n];case p8.Right:return[t+t5(r-t,a),n];case p8.Top:return[t,n-t5(n-i,a)];case p8.Bottom:return[t,n+t5(i-n,a)]}}function r5({sourceX:e,sourceY:t,sourcePosition:n=p8.Bottom,targetX:r,targetY:i,targetPosition:a=p8.Top,curvature:o=.25}){let[s,c]=n5({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=n5({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=e5({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function i5({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function jce({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function Mce({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=D8(j8(e),j8(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),N8({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},k8(a))>0}var Nce=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,Pce=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),Fce=(e,t,n={})=>{if(!e.source||!e.target)return r8.error006(),t;let r=n.getEdgeId||Nce,i;return i=g8(e)?{...e}:{...e,id:r(e)},Pce(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function a5({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=i5({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var o5={[p8.Left]:{x:-1,y:0},[p8.Right]:{x:1,y:0},[p8.Top]:{x:0,y:-1},[p8.Bottom]:{x:0,y:1}},Ice=({source:e,sourcePosition:t=p8.Bottom,target:n})=>t===p8.Left||t===p8.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},s5=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function Lce({source:e,sourcePosition:t=p8.Bottom,target:n,targetPosition:r=p8.Top,center:i,offset:a,stepPosition:o}){let s=o5[t],c=o5[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=Ice({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=i5({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function Rce(e,t,n,r){let i=Math.min(s5(e,t)/2,s5(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function c5({sourceX:e,sourceY:t,sourcePosition:n=p8.Bottom,targetX:r,targetY:i,targetPosition:a=p8.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=Lce({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=Rce(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function l5(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function zce(e){let{sourceNode:t,targetNode:n}=e;if(!l5(t)||!l5(n))return null;let r=t.internals.handleBounds||u5(t.handles),i=n.internals.handleBounds||u5(n.handles),a=f5(r?.source??[],e.sourceHandle),o=f5(e.connectionMode===s8.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,r8.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||p8.Bottom,c=o?.position||p8.Top,l=d5(t,a,s),u=d5(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function u5(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function d5(e,t,n=p8.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??U8(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case p8.Top:return{x:i+o/2,y:a};case p8.Right:return{x:i+o,y:a+s/2};case p8.Bottom:return{x:i+o/2,y:a+s};case p8.Left:return{x:i,y:a+s/2}}}function f5(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function p5(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Bce(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=p5(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var m5=1e3,Vce=10,h5={nodeOrigin:[0,0],nodeExtent:i8,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},Hce={...h5,checkEquality:!0};function g5(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function Uce(e,t,n){let r=g5(h5,n);for(let n of e.values())if(n.parentId)y5(n,e,t,r);else{let e=C8(v8(n,r.nodeOrigin),H8(n.extent)?n.extent:r.nodeExtent,U8(n));n.internals.positionAbsolute=e}}function Wce(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function _5(e){return e===`manual`}function v5(e,t,n,r={}){let i=g5(Hce,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!_5(i.zIndexMode)?m5:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=C8(v8(u,i.nodeOrigin),H8(u.extent)?u.extent:i.nodeExtent,U8(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:Wce(u,e),z:b5(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&y5(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function Gce(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function y5(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=g5(h5,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Gce(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*Vce),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=Kce(e,u,o,s,a&&!_5(c)?m5:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function b5(e,t,n){let r=F8(e.zIndex)?e.zIndex:0;return _5(n)?r:r+(e.selected?t:0)}function Kce(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=U8(e),l=v8(e,n),u=H8(e.extent)?C8(l,e.extent,c):l,d=C8({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=w8(d,c,t));let f=b5(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function x5(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=M8(a.get(n.parentId)?.expandedRect??A8(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=U8(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function qce(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=J8(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=H8(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;e.parentId&&e.extent===`parent`?h=w8(h,s,t.get(e.parentId)):m&&(h=C8(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:$8(`source`,r.nodeElement,p,d,e.id),target:$8(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&y5(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:A8(g,i)}))}}if(f.length>0){let e=x5(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function Jce({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r),s=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(s)}function S5(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function C5(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;S5(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),S5(`target`,s,c,e,i,o),t.set(r.id,r)}}function w5(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:w5(n,t):!1}function T5(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function Yce(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!w5(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function E5({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function Xce({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=I8(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Zce({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=d6(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?O8(y8(s)):null,x=v&&l?Xce({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:I8(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=x8({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=E5({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=E8(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=q8(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=Yce(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=E5({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=b6().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=q8(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=Q8(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=q8(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=Q8(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=Q8(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!(!d||p)&&(c=!1,d=!1,cancelAnimationFrame(o),s.size>0)){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=E5({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!T5(t,`.${g}`,v))&&(!_||T5(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function Qce(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())N8(i,A8(e))>0&&r.push(e);return r}var $ce=250;function ele(e,t,n,r){let i=[],a=1/0,o=Qce(e,n,t+$ce);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=d5(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function D5(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...d5(o,c,c.position,!0)}:c}function O5(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function tle(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var k5=()=>!0;function nle(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=k5,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=Y8(e.target),E=0,D,{x:O,y:k}=Q8(e),A=O5(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=D5(i,A,r,c,t);if(!N)return;let ee=Q8(e,j),te=!1,P=null,ne=!1,re=null;function ie(){if(!u||!j)return;let[e,t]=E8(ee,j,S);f({x:e,y:t}),E=requestAnimationFrame(ie)}let ae={...N,nodeId:i,type:A,position:N.position},F=c.get(i),I={inProgress:!0,isValid:null,from:d5(F,ae,p8.Left,!0),fromHandle:ae,fromPosition:ae.position,fromNode:F,to:ee,toHandle:null,toPosition:m8[ae.position],toNode:null,pointer:ee};function oe(){M=!0,y(I),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&oe();function se(e){if(!M){let{x:t,y:n}=Q8(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;oe()}if(!x()||!ae){ce(e);return}let a=b();ee=Q8(e,j),D=ele(L8(ee,a,!1,[1,1]),n,c,ae),te||=(ie(),!0);let s=A5(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});re=s.handleDomNode,P=s.connection,ne=tle(!!D,s.isValid);let u=c.get(i),f=u?d5(u,ae,p8.Left,!0):I.from,p={...I,from:f,isValid:ne,to:s.toHandle&&ne?R8({x:s.toHandle.x,y:s.toHandle.y},a):ee,toHandle:s.toHandle,toPosition:ne&&s.toHandle?s.toHandle.position:m8[ae.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:ee};y(p),I=p}function ce(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||re)&&P&&ne&&h?.(P);let{inProgress:t,...n}=I,r={...n,toPosition:I.toHandle?I.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),te=!1,ne=!1,P=null,re=null,T.removeEventListener(`mousemove`,se),T.removeEventListener(`mouseup`,ce),T.removeEventListener(`touchmove`,se),T.removeEventListener(`touchend`,ce)}}T.addEventListener(`mousemove`,se),T.addEventListener(`mouseup`,ce),T.addEventListener(`touchmove`,se),T.addEventListener(`touchend`,ce)}function A5(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=k5,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=Q8(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=O5(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===s8.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=D5(t,e,a,u,n,!0)}return _}var j5={onPointerDown:nle,isValid:A5};function rle({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=d6(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&V8()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=n8().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:f6}}var M5=e=>({x:e.x,y:e.y,zoom:e.k}),N5=({x:e,y:t,zoom:n})=>Z6.translate(e,t).scale(n),P5=(e,t)=>e.target.closest(`.${t}`),F5=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),ile=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,I5=(e,t=0,n=ile,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},L5=e=>{let t=e.ctrlKey&&V8()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function ale({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(P5(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=f6(u),t=d*2**L5(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===c8.Vertical?0:u.deltaX*f,m=i===c8.Horizontal?0:u.deltaY*f;!V8()&&u.shiftKey&&i!==c8.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=M5(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c?.(u,h),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s?.(u,h))}}function ole({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=P5(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function sle({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=M5(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function cle({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&F5(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,M5(a.transform))}}function lle({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&F5(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=M5(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function ule({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(P5(d,`${l}-flow__node`)||P5(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||P5(d,s)&&m||P5(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function dle({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=n8().scaleExtent([t,n]).translateExtent(r),f=d6(e).call(d);v({x:i.x,y:i.y,zoom:S8(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let p=f.on(`wheel.zoom`),m=f.on(`dblclick.zoom`);d.wheelDelta(L5);function h(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?MI:qI).transform(I5(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function g({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:h,panOnScrollSpeed:g,preventScrolling:v,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&_();let O=i&&!S&&!r;d.clickDistance(D?1/0:!F8(E)||E<0?0:E);let k=O?ale({zoomPanValues:l,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:h,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):ole({noWheelClassName:e,preventScrolling:v,d3ZoomHandler:p});if(f.on(`wheel.zoom`,k,{passive:!1}),!r){let e=sle({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});d.on(`start`,e);let t=cle({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});d.on(`zoom`,t);let r=lle({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});d.on(`end`,r)}let A=ule({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});d.filter(A),x?f.on(`dblclick.zoom`,m):f.on(`dblclick.zoom`,null)}function _(){d.on(`zoom`,null)}async function v(e,t,n){let r=N5(e),i=d?.constrain()(r,t,n);return i&&await h(i),new Promise(e=>e(i))}async function y(e,t){let n=N5(e);return await h(n,t),new Promise(e=>e(n))}function b(e){if(f){let t=N5(e),n=f.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&d?.transform(f,t,null,{sync:!0})}}function x(){let e=f?Q6(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}function S(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?MI:qI).scaleTo(I5(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function C(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?MI:qI).scaleBy(I5(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function w(e){d?.scaleExtent(e)}function T(e){d?.translateExtent(e)}function E(e){let t=!F8(e)||e<0?0:e;d?.clickDistance(t)}return{update:g,destroy:_,setViewport:y,setViewportConstrained:v,getViewport:x,scaleTo:S,scaleBy:C,setScaleExtent:w,setTranslateExtent:T,syncViewport:b,setClickDistance:E}}var R5;(function(e){e.Line=`line`,e.Handle=`handle`})(R5||={});function fle({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function z5(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function B5(e,t){return Math.max(0,t-e)}function V5(e,t){return Math.max(0,e-t)}function H5(e,t,n){return Math.max(0,t-e,e-n)}function U5(e,t){return e?!t:t}function ple(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=H5(E,h,g),j=H5(D,_,v);if(o){let e=0,t=0;c&&w<0?e=B5(y+w+O,o[0][0]):!c&&w>0&&(e=V5(y+E+O,o[1][0])),l&&T<0?t=B5(b+T+k,o[0][1]):!l&&T>0&&(t=V5(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=V5(y+w,s[0][0]):!c&&w<0&&(e=B5(y+E,s[1][0])),l&&T>0?t=V5(b+T,s[0][1]):!l&&T<0&&(t=B5(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=H5(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?V5(b+k+E/C,o[1][1])*C:B5(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?B5(b+E/C,s[1][1])*C:V5(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=H5(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?V5(y+D*C+O,o[1][0])/C:B5(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?B5(y+D*C,s[1][0])/C:V5(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(U5(c,l)?-w:w)/C:w=(U5(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var W5={width:0,height:0,x:0,y:0},mle={...W5,pointerX:0,pointerY:0,aspectRatio:1};function hle(e){return[[0,0],[e.measured.width,e.measured.height]]}function gle(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function _le({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=d6(e),o={controlDirection:z5(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...W5},h={...mle};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:z5(e)};let g,_=null,v=[],y,b,x,S=!1,C=b6().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=q8(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId),b=y&&g.extent===`parent`?hle(y):void 0),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=gle(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=q8(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=ple(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,ee=A!==f&&M;if(!N&&!ee&&!j&&!M)return;if((N||ee||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=ee?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let te=fle({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),P={...m,direction:te};p?.(e,P)!==!1&&(S=!0,d?.(e,P),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var G5=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},vle=e=>e?G5(e):G5,{useDebugValue:yle}=L.default,{useSyncExternalStoreWithSelector:ble}=rT.default,xle=e=>e;function K5(e,t=xle,n){let r=ble(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return yle(r),r}var q5=(e,t)=>{let n=vle(e),r=(e,r=t)=>K5(n,e,r);return Object.assign(r,n),r},Sle=(e,t)=>e?q5(e,t):q5;function J5(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var Y5=(0,L.createContext)(null),Cle=Y5.Provider,X5=r8.error001();function Z5(e,t){let n=(0,L.useContext)(Y5);if(n===null)throw Error(X5);return K5(n,e,t)}function Q5(){let e=(0,L.useContext)(Y5);if(e===null)throw Error(X5);return(0,L.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var $5={display:`none`},wle={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},e7=`react-flow__node-desc`,t7=`react-flow__edge-desc`,Tle=`react-flow__aria-live`,Ele=e=>e.ariaLiveMessage,Dle=e=>e.ariaLabelConfig;function Ole({rfId:e}){let t=Z5(Ele);return(0,R.jsx)(`div`,{id:`${Tle}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:wle,children:t})}function kle({rfId:e,disableKeyboardA11y:t}){let n=Z5(Dle);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{id:`${e7}-${e}`,style:$5,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,R.jsx)(`div`,{id:`${t7}-${e}`,style:$5,children:n[`edge.a11yDescription.default`]}),!t&&(0,R.jsx)(Ole,{rfId:e})]})}var n7=(0,L.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>(0,R.jsx)(`div`,{className:M3([`react-flow__panel`,n,...`${e}`.split(`-`)]),style:r,ref:a,...i,children:t}));n7.displayName=`Panel`;function Ale({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,R.jsx)(n7,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev`,children:(0,R.jsx)(`a`,{href:`https://reactflow.dev`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var jle=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},r7=e=>e.id;function Mle(e,t){return J5(e.selectedNodes.map(r7),t.selectedNodes.map(r7))&&J5(e.selectedEdges.map(r7),t.selectedEdges.map(r7))}function Nle({onSelectionChange:e}){let t=Q5(),{selectedNodes:n,selectedEdges:r}=Z5(jle,Mle);return(0,L.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var Ple=e=>!!e.onSelectionChangeHandlers;function Fle({onSelectionChange:e}){let t=Z5(Ple);return e||t?(0,R.jsx)(Nle,{onSelectionChange:e}):null}var i7=typeof window<`u`?L.useLayoutEffect:L.useEffect,a7=[0,0],Ile={x:0,y:0,zoom:1},o7=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],Lle=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),s7={translateExtent:i8,nodeOrigin:a7,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function Rle(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=Z5(Lle,J5),l=Q5();i7(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=s7,s()}),[]);let u=(0,L.useRef)(s7);return i7(()=>{for(let s of o7){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:kce(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},o7.map(t=>e[t])),null}function c7(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function zle(e){let[t,n]=(0,L.useState)(e===`system`?null:e);return(0,L.useEffect)(()=>{if(e!==`system`){n(e);return}let t=c7(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?c7()?.matches?`dark`:`light`:t}var l7=typeof document<`u`?document:null;function u7(e=null,t={target:l7,actInsideInputWithModifier:!0}){let[n,r]=(0,L.useState)(!1),i=(0,L.useRef)(!1),a=(0,L.useRef)(new Set([])),[o,s]=(0,L.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
71
- `).replace(`
72
-
73
- `,`
74
- +`).split(`
75
- `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,L.useEffect)(()=>{let n=t?.target??l7,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&X8(e))return!1;let n=f7(e.code,s);if(a.current.add(e[n]),d7(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=f7(e.code,s);d7(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function d7(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function f7(e,t){return t.includes(e)?`code`:`key`}var Ble=()=>{let e=Q5();return(0,L.useMemo)(()=>({zoomIn:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=B8(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return L8(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=R8(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function p7(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)Vle(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function Vle(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing);break}}function m7(e,t){return p7(e,t)}function h7(e,t){return p7(e,t)}function g7(e,t){return{id:e,type:`select`,selected:t}}function _7(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);!(a.selected===void 0&&!e)&&a.selected!==e&&(n&&(a.selected=e),r.push(g7(a.id,e)))}return r}function v7({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function y7(e){return{id:e.id,type:`remove`}}var b7=e=>yce(e),Hle=e=>g8(e);function x7(e){return(0,L.forwardRef)(e)}function S7(e){let[t,n]=(0,L.useState)(BigInt(0)),[r]=(0,L.useState)(()=>Ule(()=>n(e=>e+BigInt(1))));return i7(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function Ule(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var C7=(0,L.createContext)(null);function Wle({children:e}){let t=Q5(),n=S7((0,L.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=v7({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=S7((0,L.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(v7({items:s,lookup:o}))},[])),i=(0,L.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,R.jsx)(C7.Provider,{value:i,children:e})}function Gle(){let e=(0,L.useContext)(C7);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var Kle=e=>!!e.panZoom;function w7(){let e=Ble(),t=Q5(),n=Gle(),r=Z5(Kle),i=(0,L.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=b7(e)?e:n.get(e.id),a=i.parentId?G8(i.position,i.measured,i.parentId,n,r):i.position;return A8({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&b7(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&Hle(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await wce({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(y7);o?.(f),c(e)}if(m){let e=d.map(y7);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=P8(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=A8(s?r:a),l=N8(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=P8(e)?e:a(e);if(!r)return!1;let i=N8(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return bce(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??Oce();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,L.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var T7=e=>e.selected,qle=typeof window<`u`?window:void 0;function Jle({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=Q5(),{deleteElements:r}=w7(),i=u7(e,{actInsideInputWithModifier:!1}),a=u7(t,{target:qle});(0,L.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(T7),edges:e.filter(T7)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,L.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function Yle(e){let t=Q5();(0,L.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=J8(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,r8.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var E7={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},Xle=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Zle({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=c8.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:h,noPanClassName:g,onViewportChange:_,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:b}){let x=Q5(),S=(0,L.useRef)(null),{userSelectionActive:C,lib:w,connectionInProgress:T}=Z5(Xle,J5),E=u7(f),D=(0,L.useRef)();Yle(S);let O=(0,L.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),v||x.setState({transform:e})},[_,v]);return(0,L.useEffect)(()=>{if(S.current){D.current=dle({domNode:S.current,minZoom:u,maxZoom:d,translateExtent:l,viewport:c,onDraggingChange:e=>x.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=x.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=x.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=x.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=D.current.getViewport();return x.setState({panZoom:D.current,transform:[e,t,n],domNode:S.current.closest(`.react-flow`)}),()=>{D.current?.destroy()}}},[]),(0,L.useEffect)(()=>{D.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:E,preventScrolling:p,noPanClassName:g,userSelectionActive:C,noWheelClassName:h,lib:w,onTransformChange:O,connectionInProgress:T,selectionOnDrag:b,paneClickDistance:y})},[e,t,n,r,i,a,o,s,E,p,g,C,h,w,O,T,b,y]),(0,R.jsx)(`div`,{className:`react-flow__renderer`,ref:S,style:E7,children:m})}var Qle=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function $le(){let{userSelectionActive:e,userSelectionRect:t}=Z5(Qle,J5);return e&&t?(0,R.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var D7=(e,t)=>n=>{n.target===t.current&&e?.(n)},eue=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function tue({isSelecting:e,selectionKeyPressed:t,selectionMode:n=l8.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:s,onPaneClick:c,onPaneContextMenu:l,onPaneScroll:u,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:p,children:m}){let h=Q5(),{userSelectionActive:g,elementsSelectable:_,dragging:v,connectionInProgress:y}=Z5(eue,J5),b=_&&(e||g),x=(0,L.useRef)(null),S=(0,L.useRef)(),C=(0,L.useRef)(new Set),w=(0,L.useRef)(new Set),T=(0,L.useRef)(!1),E=e=>{if(T.current||y){T.current=!1;return}c?.(e),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},D=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}l?.(e)},O=u?e=>u(e):void 0;return(0,R.jsxs)(`div`,{className:M3([`react-flow__pane`,{draggable:r===!0||Array.isArray(r)&&r.includes(0),dragging:v,selection:e}]),onClick:b?void 0:D7(E,x),onContextMenu:D7(D,x),onWheel:D7(O,x),onPointerEnter:b?void 0:d,onPointerMove:b?e=>{let{userSelectionRect:r,transform:a,nodeLookup:s,edgeLookup:c,connectionLookup:l,triggerNodeChanges:u,triggerEdgeChanges:d,defaultEdgeOptions:f,resetSelectedElements:p}=h.getState();if(!S.current||!r)return;let{x:m,y:g}=Q8(e.nativeEvent,S.current),{startX:_,startY:v}=r;if(!T.current){let n=t?0:i;if(Math.hypot(m-_,g-v)<=n)return;p(),o?.(e)}T.current=!0;let y={startX:_,startY:v,x:m<_?m:_,y:g<v?g:v,width:Math.abs(m-_),height:Math.abs(g-v)},b=C.current,x=w.current;C.current=new Set(b8(s,y,a,n===l8.Partial,!0).map(e=>e.id)),w.current=new Set;let E=f?.selectable??!0;for(let e of C.current){let t=l.get(e);if(t)for(let{edgeId:e}of t.values()){let t=c.get(e);t&&(t.selectable??E)&&w.current.add(e)}}K8(b,C.current)||u(_7(s,C.current,!0)),K8(x,w.current)||d(_7(c,w.current)),h.setState({userSelectionRect:y,userSelectionActive:!0,nodesSelectionActive:!1})}:f,onPointerUp:b?e=>{e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!g&&e.target===x.current&&h.getState().userSelectionRect&&E?.(e),h.setState({userSelectionActive:!1,userSelectionRect:null}),T.current&&(s?.(e),h.setState({nodesSelectionActive:C.current.size>0})))}:void 0,onPointerDownCapture:b?n=>{let{domNode:r}=h.getState();if(S.current=r?.getBoundingClientRect(),!S.current)return;let i=n.target===x.current;if(!i&&n.target.closest(`.nokey`)||!e||!(a&&i||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),T.current=!1;let{x:o,y:s}=Q8(n.nativeEvent,S.current);h.setState({userSelectionRect:{width:0,height:0,startX:o,startY:s,x:o,y:s}}),i||(n.stopPropagation(),n.preventDefault())}:void 0,onClickCapture:b?e=>{T.current&&=(e.stopPropagation(),!1)}:void 0,onPointerLeave:p,ref:x,style:E7,children:[m,(0,R.jsx)($le,{})]})}function O7({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,r8.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function k7({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=Q5(),[c,l]=(0,L.useState)(!1),u=(0,L.useRef)();return(0,L.useEffect)(()=>{u.current=Zce({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{O7({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),(0,L.useEffect)(()=>{if(!(t||!e.current||!u.current))return u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{u.current?.destroy()}},[n,r,t,a,e,i,o]),c}var nue=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function A7(){let e=Q5();return(0,L.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=nue(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=I8(t,i));let{position:a,positionAbsolute:s}=x8({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var j7=(0,L.createContext)(null),rue=j7.Provider;j7.Consumer;var M7=()=>(0,L.useContext)(j7),iue=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),aue=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o,u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===s8.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function oue({type:e=`source`,position:t=p8.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=Q5(),_=M7(),{connectOnClick:v,noPanClassName:y,rfId:b}=Z5(iue,J5),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=Z5(aue(_,m,e),J5);_||g.getState().onError?.(`010`,r8.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t}=g.getState();t(Fce(i,e))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=Z8(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();j5.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,R.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:M3([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=Y8(t.target),h=n||c,{connection:v,isValid:y}=j5.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var N7=(0,L.memo)(x7(oue));function sue({data:e,isConnectable:t,sourcePosition:n=p8.Bottom}){return(0,R.jsxs)(R.Fragment,{children:[e?.label,(0,R.jsx)(N7,{type:`source`,position:n,isConnectable:t})]})}function cue({data:e,isConnectable:t,targetPosition:n=p8.Top,sourcePosition:r=p8.Bottom}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(N7,{type:`target`,position:n,isConnectable:t}),e?.label,(0,R.jsx)(N7,{type:`source`,position:r,isConnectable:t})]})}function lue(){return null}function uue({data:e,isConnectable:t,targetPosition:n=p8.Top}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(N7,{type:`target`,position:n,isConnectable:t}),e?.label]})}var P7={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},F7={input:sue,default:cue,output:uue,group:lue};function due(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var fue=e=>{let{width:t,height:n,x:r,y:i}=y8(e.nodeLookup,{filter:e=>!!e.selected});return{width:F8(t)?t:null,height:F8(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function pue({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=Q5(),{width:i,height:a,transformString:o,userSelectionActive:s}=Z5(fue,J5),c=A7(),l=(0,L.useRef)(null);(0,L.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(k7({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,R.jsx)(`div`,{className:M3([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,R.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(P7,e.key)&&(e.preventDefault(),c({direction:P7[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var I7=typeof window<`u`?window:void 0,mue=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function L7({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,defaultViewport:T,translateExtent:E,minZoom:D,maxZoom:O,preventScrolling:k,onSelectionContextMenu:A,noWheelClassName:j,noPanClassName:M,disableKeyboardA11y:N,onViewportChange:ee,isControlledViewport:te}){let{nodesSelectionActive:P,userSelectionActive:ne}=Z5(mue,J5),re=u7(l,{target:I7}),ie=u7(h,{target:I7}),ae=ie||w,F=ie||b,I=u&&ae!==!0,oe=re||ne||I;return Jle({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,R.jsx)(Zle,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:F,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!re&&ae,defaultViewport:T,translateExtent:E,minZoom:D,maxZoom:O,zoomActivationKeyCode:g,preventScrolling:k,noWheelClassName:j,noPanClassName:M,onViewportChange:ee,isControlledViewport:te,paneClickDistance:s,selectionOnDrag:I,children:(0,R.jsxs)(tue,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:ae,isSelecting:!!oe,selectionMode:d,selectionKeyPressed:re,paneClickDistance:s,selectionOnDrag:I,children:[e,P&&(0,R.jsx)(pue,{onSelectionContextMenu:A,noPanClassName:M,disableKeyboardA11y:N})]})})}L7.displayName=`FlowRenderer`;var hue=(0,L.memo)(L7),gue=e=>t=>e?b8(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function _ue(e){return Z5((0,L.useCallback)(gue(e),[e]),J5)}var vue=e=>e.updateNodeInternals;function yue(){let e=Z5(vue),[t]=(0,L.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,L.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function bue({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=Q5(),a=(0,L.useRef)(null),o=(0,L.useRef)(null),s=(0,L.useRef)(e.sourcePosition),c=(0,L.useRef)(e.targetPosition),l=(0,L.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,L.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,L.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,L.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function xue({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=Z5(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},J5),S=y.type||`default`,C=g?.[S]||F7[S];C===void 0&&(v?.(`003`,r8.error003(S)),S=`default`,C=g?.default||F7.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=Q5(),k=W8(y),A=bue({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=k7({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=A7();if(y.hidden)return null;let N=U8(y),ee=due(y),te=T||w||t||n||r||i,P=n?e=>n(e,{...b.userNode}):void 0,ne=r?e=>r(e,{...b.userNode}):void 0,re=i?e=>i(e,{...b.userNode}):void 0,ie=a?e=>a(e,{...b.userNode}):void 0,ae=o?e=>o(e,{...b.userNode}):void 0,F=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&O7({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},I=t=>{if(!(X8(t.nativeEvent)||m)){if(a8.includes(t.key)&&T)O7({id:e,store:O,unselect:t.key===`Escape`,nodeRef:A});else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(P7,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:P7[t.key],factor:t.shiftKey?4:1})}}},oe=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(b8(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+N.width/2,y.position.y+N.height/2,{zoom:t[2]}))};return(0,R.jsx)(`div`,{className:M3([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:te?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...ee},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:P,onMouseMove:ne,onMouseLeave:re,onContextMenu:ie,onClick:F,onDoubleClick:ae,onKeyDown:D?I:void 0,tabIndex:D?0:void 0,onFocus:D?oe:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${e7}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,R.jsx)(rue,{value:e,children:(0,R.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...N})})})}var Sue=(0,L.memo)(xue),Cue=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function R7(e){let{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Z5(Cue,J5),o=_ue(e.onlyRenderVisibleElements),s=yue();return(0,R.jsx)(`div`,{className:`react-flow__nodes`,style:E7,children:o.map(o=>(0,R.jsx)(Sue,{id:o,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},o))})}R7.displayName=`NodeRenderer`;var wue=(0,L.memo)(R7);function Tue(e){return Z5((0,L.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&Mce({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),J5)}var Eue=({color:e=`none`,strokeWidth:t=1})=>(0,R.jsx)(`polyline`,{className:`arrow`,style:{strokeWidth:t,...e&&{stroke:e}},strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`}),Due=({color:e=`none`,strokeWidth:t=1})=>(0,R.jsx)(`polyline`,{className:`arrowclosed`,style:{strokeWidth:t,...e&&{stroke:e,fill:e}},strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`}),z7={[f8.Arrow]:Eue,[f8.ArrowClosed]:Due};function Oue(e){let t=Q5();return(0,L.useMemo)(()=>Object.prototype.hasOwnProperty.call(z7,e)?z7[e]:(t.getState().onError?.(`009`,r8.error009(e)),null),[e])}var kue=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=Oue(t);return c?(0,R.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,R.jsx)(c,{color:n,strokeWidth:o})}):null},B7=({defaultColor:e,rfId:t})=>{let n=Z5(e=>e.edges),r=Z5(e=>e.defaultEdgeOptions),i=(0,L.useMemo)(()=>Bce(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,R.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,R.jsx)(`defs`,{children:i.map(e=>(0,R.jsx)(kue,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};B7.displayName=`MarkerDefinitions`;var Aue=(0,L.memo)(B7);function V7({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,L.useState)({x:1,y:0,width:0,height:0}),p=M3([`react-flow__edge-textwrapper`,l]),m=(0,L.useRef)(null);return(0,L.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,R.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,R.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,R.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}V7.displayName=`EdgeText`;var jue=(0,L.memo)(V7);function H7({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{...u,d:e,fill:`none`,className:M3([`react-flow__edge-path`,u.className])}),l?(0,R.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&F8(t)&&F8(n)?(0,R.jsx)(jue,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function U7({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===p8.Left||e===p8.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function W7({sourceX:e,sourceY:t,sourcePosition:n=p8.Bottom,targetX:r,targetY:i,targetPosition:a=p8.Top}){let[o,s]=U7({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=U7({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=e5({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function G7(e){return(0,L.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=W7({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s});return(0,R.jsx)(H7,{id:e.isInternal?void 0:t,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var Mue=G7({isInternal:!1}),K7=G7({isInternal:!0});Mue.displayName=`SimpleBezierEdge`,K7.displayName=`SimpleBezierEdgeInternal`;function q7(e){return(0,L.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=p8.Bottom,targetPosition:m=p8.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=c5({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition});return(0,R.jsx)(H7,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var J7=q7({isInternal:!1}),Y7=q7({isInternal:!0});J7.displayName=`SmoothStepEdge`,Y7.displayName=`SmoothStepEdgeInternal`;function X7(e){return(0,L.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,R.jsx)(J7,{...n,id:r,pathOptions:(0,L.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var Nue=X7({isInternal:!1}),Z7=X7({isInternal:!0});Nue.displayName=`StepEdge`,Z7.displayName=`StepEdgeInternal`;function Q7(e){return(0,L.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=a5({sourceX:n,sourceY:r,targetX:i,targetY:a});return(0,R.jsx)(H7,{id:e.isInternal?void 0:t,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var Pue=Q7({isInternal:!1}),$7=Q7({isInternal:!0});Pue.displayName=`StraightEdge`,$7.displayName=`StraightEdgeInternal`;function e9(e){return(0,L.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=p8.Bottom,targetPosition:s=p8.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=r5({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature});return(0,R.jsx)(H7,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var Fue=e9({isInternal:!1}),t9=e9({isInternal:!0});Fue.displayName=`BezierEdge`,t9.displayName=`BezierEdgeInternal`;var n9={default:t9,straight:$7,step:Z7,smoothstep:Y7,simplebezier:K7},r9={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Iue=(e,t,n)=>n===p8.Left?e-t:n===p8.Right?e+t:e,Lue=(e,t,n)=>n===p8.Top?e-t:n===p8.Bottom?e+t:e,i9=`react-flow__edgeupdater`;function a9({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,R.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:M3([i9,`${i9}-${s}`]),cx:Iue(t,r,e),cy:Lue(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function Rue({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=Q5(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;j5.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,R.jsxs)(R.Fragment,{children:[(e===!0||e===`source`)&&(0,R.jsx)(a9,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,R.jsx)(a9,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function zue({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let y=Z5(t=>t.edgeLookup.get(e)),b=Z5(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||n9[x];S===void 0&&(_?.(`011`,r8.error011(x)),x=`default`,S=h?.default||n9.default);let C=!!(y.focusable||t&&y.focusable===void 0),w=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),T=!!(y.selectable||r&&y.selectable===void 0),E=(0,L.useRef)(null),[D,O]=(0,L.useState)(!1),[k,A]=(0,L.useState)(!1),j=Q5(),{zIndex:M,sourceX:N,sourceY:ee,targetX:te,targetY:P,sourcePosition:ne,targetPosition:re}=Z5((0,L.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return{zIndex:y.zIndex,...r9};let i=zce({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_});return{zIndex:jce({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode}),...i||r9}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),J5),ie=(0,L.useMemo)(()=>y.markerStart?`url('#${p5(y.markerStart,m)}')`:void 0,[y.markerStart,m]),ae=(0,L.useMemo)(()=>y.markerEnd?`url('#${p5(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||N===null||ee===null||te===null||P===null)return null;let F=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=j.getState();T&&(j.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),E.current?.blur()):n([e])),i&&i(t,y)},I=a?e=>{a(e,{...y})}:void 0,oe=o?e=>{o(e,{...y})}:void 0,se=s?e=>{s(e,{...y})}:void 0,ce=c?e=>{c(e,{...y})}:void 0,le=l?e=>{l(e,{...y})}:void 0;return(0,R.jsx)(`svg`,{style:{zIndex:M},children:(0,R.jsxs)(`g`,{className:M3([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:F,onDoubleClick:I,onContextMenu:oe,onMouseEnter:se,onMouseMove:ce,onMouseLeave:le,onKeyDown:C?t=>{if(!v&&a8.includes(t.key)&&T){let{unselectNodesAndEdges:n,addSelectedEdges:r}=j.getState();t.key===`Escape`?(E.current?.blur(),n({edges:[y]})):r([e])}}:void 0,tabIndex:C?0:void 0,role:y.ariaRole??(C?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":C?`${t7}-${m}`:void 0,ref:E,...y.domAttributes,children:[!k&&(0,R.jsx)(S,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:T,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:N,sourceY:ee,targetX:te,targetY:P,sourcePosition:ne,targetPosition:re,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:ie,markerEnd:ae,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&(0,R.jsx)(Rue,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:N,sourceY:ee,targetX:te,targetY:P,sourcePosition:ne,targetPosition:re,setUpdateHover:O,setReconnecting:A})]})})}var Bue=(0,L.memo)(zue),Vue=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function o9({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=Z5(Vue,J5),b=Tue(t);return(0,R.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,R.jsx)(Aue,{defaultColor:e,rfId:n}),b.map(e=>(0,R.jsx)(Bue,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}o9.displayName=`EdgeRenderer`;var Hue=(0,L.memo)(o9),Uue=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Wue({children:e}){return(0,R.jsx)(`div`,{className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:Z5(Uue)},children:e})}function Gue(e){let t=w7(),n=(0,L.useRef)(!1);(0,L.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var Kue=e=>e.panZoom?.syncViewport;function que(e){let t=Z5(Kue),n=Q5();return(0,L.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function s9(e){return e.connection.inProgress?{...e.connection,to:L8(e.connection.to,e.transform)}:{...e.connection}}function Jue(e){return e?t=>e(s9(t)):s9}function Yue(e){return Z5(Jue(e),J5)}var Xue=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Zue({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=Z5(Xue,J5);return a&&i&&c?(0,R.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,R.jsx)(`g`,{className:M3([`react-flow__connection`,h8(s)]),children:(0,R.jsx)(c9,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var c9=({style:e,type:t=d8.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=Yue();if(!i)return;if(n)return(0,R.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:h8(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case d8.Bezier:[m]=r5(h);break;case d8.SimpleBezier:[m]=W7(h);break;case d8.Step:[m]=c5({...h,borderRadius:0});break;case d8.SmoothStep:[m]=c5(h);break;default:[m]=a5(h)}return(0,R.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};c9.displayName=`ConnectionLine`;var Que={};function l9(e=Que){(0,L.useRef)(e),Q5(),(0,L.useEffect)(()=>{},[e])}function $ue(){Q5(),(0,L.useRef)(!1),(0,L.useEffect)(()=>{},[])}function u9({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:N,zoomOnPinch:ee,panOnScroll:te,panOnScrollSpeed:P,panOnScrollMode:ne,zoomOnDoubleClick:re,panOnDrag:ie,onPaneClick:ae,onPaneMouseEnter:F,onPaneMouseMove:I,onPaneMouseLeave:oe,onPaneScroll:se,onPaneContextMenu:ce,paneClickDistance:le,nodeClickDistance:ue,onEdgeContextMenu:de,onEdgeMouseEnter:fe,onEdgeMouseMove:pe,onEdgeMouseLeave:me,reconnectRadius:he,onReconnect:ge,onReconnectStart:_e,onReconnectEnd:ve,noDragClassName:ye,noWheelClassName:be,noPanClassName:xe,disableKeyboardA11y:Se,nodeExtent:Ce,rfId:we,viewport:Te,onViewportChange:Ee}){return l9(e),l9(t),$ue(),Gue(n),que(Te),(0,R.jsx)(hue,{onPaneClick:ae,onPaneMouseEnter:F,onPaneMouseMove:I,onPaneMouseLeave:oe,onPaneContextMenu:ce,onPaneScroll:se,paneClickDistance:le,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:ee,zoomOnDoubleClick:re,panOnScroll:te,panOnScrollSpeed:P,panOnScrollMode:ne,panOnDrag:ie,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:ye,noWheelClassName:be,noPanClassName:xe,disableKeyboardA11y:Se,onViewportChange:Ee,isControlledViewport:!!Te,children:(0,R.jsxs)(Wue,{children:[(0,R.jsx)(Hue,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ge,onReconnectStart:_e,onReconnectEnd:ve,onlyRenderVisibleElements:T,onEdgeContextMenu:de,onEdgeMouseEnter:fe,onEdgeMouseMove:pe,onEdgeMouseLeave:me,reconnectRadius:he,defaultMarkerColor:M,noPanClassName:xe,disableKeyboardA11y:Se,rfId:we}),(0,R.jsx)(Zue,{style:h,type:m,component:g,containerStyle:_}),(0,R.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,R.jsx)(wue,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:ue,onlyRenderVisibleElements:T,noPanClassName:xe,noDragClassName:ye,disableKeyboardA11y:Se,nodeExtent:Ce,rfId:we}),(0,R.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}u9.displayName=`GraphView`;var ede=(0,L.memo)(u9),d9=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??i8;C5(h,g,_);let{nodesInitialized:x}=v5(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=B8(y8(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:i8,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:s8.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...u8},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Tce,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:o8,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},tde=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>Sle((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await Cce({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...d9({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i,fitViewQueued:a,zIndexMode:o,nodesSelectionActive:s}=m(),{nodesInitialized:c,hasSelectedNodes:l}=v5(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:o}),u=s&&l;a&&c?(h(),p({nodes:e,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:c,nodesSelectionActive:u})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();C5(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=qce(e,n,r,i,a,o,l);d&&(Uce(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=d5(e,o.fromHandle,p8.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=x5(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(m7(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(h7(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>g7(e,!0)));return}i(_7(r,new Set([...e]),!0)),a(_7(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>g7(e,!0)));return}a(_7(n,new Set([...e]))),i(_7(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(g7(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(g7(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,g7(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,g7(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();e[0][0]===o[0][0]&&e[0][1]===o[0][1]&&e[1][0]===o[1][0]&&e[1][1]===o[1][1]||(v5(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return Jce({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return Promise.resolve(!1);let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...u8}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...d9()})}},Object.is);function nde({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,L.useState)(()=>tde({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,R.jsx)(Cle,{value:m,children:(0,R.jsx)(Wle,{children:p})})}function rde({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,L.useContext)(Y5)?(0,R.jsx)(R.Fragment,{children:e}):(0,R.jsx)(nde,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var ide={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function ade({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onSelectionChange:k,onSelectionDragStart:A,onSelectionDrag:j,onSelectionDragStop:M,onSelectionContextMenu:N,onSelectionStart:ee,onSelectionEnd:te,onBeforeDelete:P,connectionMode:ne,connectionLineType:re=d8.Bezier,connectionLineStyle:ie,connectionLineComponent:ae,connectionLineContainerStyle:F,deleteKeyCode:I=`Backspace`,selectionKeyCode:oe=`Shift`,selectionOnDrag:se=!1,selectionMode:ce=l8.Full,panActivationKeyCode:le=`Space`,multiSelectionKeyCode:ue=V8()?`Meta`:`Control`,zoomActivationKeyCode:de=V8()?`Meta`:`Control`,snapToGrid:fe,snapGrid:pe,onlyRenderVisibleElements:me=!1,selectNodesOnDrag:he,nodesDraggable:ge,autoPanOnNodeFocus:_e,nodesConnectable:ve,nodesFocusable:ye,nodeOrigin:be=a7,edgesFocusable:xe,edgesReconnectable:Se,elementsSelectable:Ce=!0,defaultViewport:we=Ile,minZoom:Te=.5,maxZoom:Ee=2,translateExtent:De=i8,preventScrolling:Oe=!0,nodeExtent:ke,defaultMarkerColor:Ae=`#b1b1b7`,zoomOnScroll:je=!0,zoomOnPinch:Me=!0,panOnScroll:Ne=!1,panOnScrollSpeed:Pe=.5,panOnScrollMode:Fe=c8.Free,zoomOnDoubleClick:Ie=!0,panOnDrag:Le=!0,onPaneClick:Re,onPaneMouseEnter:ze,onPaneMouseMove:Be,onPaneMouseLeave:Ve,onPaneScroll:He,onPaneContextMenu:Ue,paneClickDistance:We=1,nodeClickDistance:Ge=0,children:Ke,onReconnect:qe,onReconnectStart:Je,onReconnectEnd:Ye,onEdgeContextMenu:Xe,onEdgeDoubleClick:Ze,onEdgeMouseEnter:Qe,onEdgeMouseMove:$e,onEdgeMouseLeave:et,reconnectRadius:tt=10,onNodesChange:nt,onEdgesChange:rt,noDragClassName:it=`nodrag`,noWheelClassName:at=`nowheel`,noPanClassName:ot=`nopan`,fitView:st,fitViewOptions:ct,connectOnClick:lt,attributionPosition:ut,proOptions:z,defaultEdgeOptions:dt,elevateNodesOnSelect:ft=!0,elevateEdgesOnSelect:pt=!1,disableKeyboardA11y:mt=!1,autoPanOnConnect:ht,autoPanOnNodeDrag:gt,autoPanSpeed:_t,connectionRadius:vt,isValidConnection:yt,onError:bt,style:xt,id:St,nodeDragThreshold:Ct,connectionDragThreshold:wt,viewport:Tt,onViewportChange:Et,width:Dt,height:Ot,colorMode:kt=`light`,debug:At,onScroll:jt,ariaLabelConfig:Mt,zIndexMode:Nt=`basic`,...Pt},Ft){let It=St||`1`,Lt=zle(kt),Rt=(0,L.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),jt?.(e)},[jt]);return(0,R.jsx)(`div`,{"data-testid":`rf__wrapper`,...Pt,onScroll:Rt,style:{...xt,...ide},ref:Ft,className:M3([`react-flow`,i,Lt]),id:St,role:`application`,children:(0,R.jsxs)(rde,{nodes:e,edges:t,width:Dt,height:Ot,fitView:st,fitViewOptions:ct,minZoom:Te,maxZoom:Ee,nodeOrigin:be,nodeExtent:ke,zIndexMode:Nt,children:[(0,R.jsx)(Rle,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:ge,autoPanOnNodeFocus:_e,nodesConnectable:ve,nodesFocusable:ye,edgesFocusable:xe,edgesReconnectable:Se,elementsSelectable:Ce,elevateNodesOnSelect:ft,elevateEdgesOnSelect:pt,minZoom:Te,maxZoom:Ee,nodeExtent:ke,onNodesChange:nt,onEdgesChange:rt,snapToGrid:fe,snapGrid:pe,connectionMode:ne,translateExtent:De,connectOnClick:lt,defaultEdgeOptions:dt,fitView:st,fitViewOptions:ct,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:j,onSelectionDragStart:A,onSelectionDragStop:M,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:ot,nodeOrigin:be,rfId:It,autoPanOnConnect:ht,autoPanOnNodeDrag:gt,autoPanSpeed:_t,onError:bt,connectionRadius:vt,isValidConnection:yt,selectNodesOnDrag:he,nodeDragThreshold:Ct,connectionDragThreshold:wt,onBeforeDelete:P,debug:At,ariaLabelConfig:Mt,zIndexMode:Nt}),(0,R.jsx)(ede,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:re,connectionLineStyle:ie,connectionLineComponent:ae,connectionLineContainerStyle:F,selectionKeyCode:oe,selectionOnDrag:se,selectionMode:ce,deleteKeyCode:I,multiSelectionKeyCode:ue,panActivationKeyCode:le,zoomActivationKeyCode:de,onlyRenderVisibleElements:me,defaultViewport:we,translateExtent:De,minZoom:Te,maxZoom:Ee,preventScrolling:Oe,zoomOnScroll:je,zoomOnPinch:Me,zoomOnDoubleClick:Ie,panOnScroll:Ne,panOnScrollSpeed:Pe,panOnScrollMode:Fe,panOnDrag:Le,onPaneClick:Re,onPaneMouseEnter:ze,onPaneMouseMove:Be,onPaneMouseLeave:Ve,onPaneScroll:He,onPaneContextMenu:Ue,paneClickDistance:We,nodeClickDistance:Ge,onSelectionContextMenu:N,onSelectionStart:ee,onSelectionEnd:te,onReconnect:qe,onReconnectStart:Je,onReconnectEnd:Ye,onEdgeContextMenu:Xe,onEdgeDoubleClick:Ze,onEdgeMouseEnter:Qe,onEdgeMouseMove:$e,onEdgeMouseLeave:et,reconnectRadius:tt,defaultMarkerColor:Ae,noDragClassName:it,noWheelClassName:at,noPanClassName:ot,rfId:It,disableKeyboardA11y:mt,nodeExtent:ke,viewport:Tt,onViewportChange:Et}),(0,R.jsx)(Fle,{onSelectionChange:k}),Ke,(0,R.jsx)(Ale,{proOptions:z,position:ut}),(0,R.jsx)(kle,{rfId:It,disableKeyboardA11y:mt})]})})}var ode=x7(ade);function sde(e){let[t,n]=(0,L.useState)(e);return[t,n,(0,L.useCallback)(e=>n(t=>m7(e,t)),[])]}function cde(e){let[t,n]=(0,L.useState)(e);return[t,n,(0,L.useCallback)(e=>n(t=>h7(e,t)),[])]}r8.error014();function lde({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,R.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:M3([`react-flow__background-pattern`,n,r])})}function ude({radius:e,className:t}){return(0,R.jsx)(`circle`,{cx:e,cy:e,r:e,className:M3([`react-flow__background-pattern`,`dots`,t])})}var f9;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(f9||={});var dde={[f9.Dots]:1,[f9.Lines]:1,[f9.Cross]:6},fde=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function p9({id:e,variant:t=f9.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,L.useRef)(null),{transform:f,patternId:p}=Z5(fde,J5),m=r||dde[t],h=t===f9.Dots,g=t===f9.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],y=m*f[2],b=Array.isArray(a)?a:[a,a],x=g?[y,y]:v,S=[b[0]*f[2]||1+x[0]/2,b[1]*f[2]||1+x[1]/2],C=`${p}${e||``}`;return(0,R.jsxs)(`svg`,{className:M3([`react-flow__background`,l]),style:{...c,...E7,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,R.jsx)(`pattern`,{id:C,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${S[0]},-${S[1]})`,children:h?(0,R.jsx)(ude,{radius:y/2,className:u}):(0,R.jsx)(lde,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,R.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}p9.displayName=`Background`;var pde=(0,L.memo)(p9);function mde(){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,R.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function hde(){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,R.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function gde(){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,R.jsx)(`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 _de(){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,R.jsx)(`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 vde(){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,R.jsx)(`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`})})}function m9({children:e,className:t,...n}){return(0,R.jsx)(`button`,{type:`button`,className:M3([`react-flow__controls-button`,t]),...n,children:e})}var yde=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function h9({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=Q5(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=Z5(yde,J5),{zoomIn:y,zoomOut:b,fitView:x}=w7();return(0,R.jsxs)(n7,{className:M3([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(m9,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,R.jsx)(mde,{})}),(0,R.jsx)(m9,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,R.jsx)(hde,{})})]}),n&&(0,R.jsx)(m9,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,R.jsx)(gde,{})}),r&&(0,R.jsx)(m9,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,R.jsx)(vde,{}):(0,R.jsx)(_de,{})}),u]})}h9.displayName=`Controls`;var bde=(0,L.memo)(h9);function xde({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,R.jsx)(`rect`,{className:M3([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var Sde=(0,L.memo)(xde),Cde=e=>e.nodes.map(e=>e.id),g9=e=>e instanceof Function?e:()=>e;function wde({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=Sde,onClick:o}){let s=Z5(Cde,J5),c=g9(t),l=g9(e),u=g9(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,R.jsx)(R.Fragment,{children:s.map(e=>(0,R.jsx)(Ede,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function Tde({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=Z5(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=U8(r);return{node:r,x:i,y:a,width:o,height:s}},J5);return!l||l.hidden||!W8(l)?null:(0,R.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var Ede=(0,L.memo)(Tde),Dde=(0,L.memo)(wde),Ode=200,kde=150,Ade=e=>!e.hidden,jde=e=>{let t={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:t,boundingRect:e.nodeLookup.size>0?M8(y8(e.nodeLookup,{filter:Ade}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Mde=`react-flow__minimap-desc`;function _9({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:y=1,offsetScale:b=5}){let x=Q5(),S=(0,L.useRef)(null),{boundingRect:C,viewBB:w,rfId:T,panZoom:E,translateExtent:D,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=Z5(jde,J5),j=e?.width??Ode,M=e?.height??kde,N=C.width/j,ee=C.height/M,te=Math.max(N,ee),P=te*j,ne=te*M,re=b*te,ie=C.x-(P-C.width)/2-re,ae=C.y-(ne-C.height)/2-re,F=P+re*2,I=ne+re*2,oe=`${Mde}-${T}`,se=(0,L.useRef)(0),ce=(0,L.useRef)();se.current=te,(0,L.useEffect)(()=>{if(S.current&&E)return ce.current=rle({domNode:S.current,panZoom:E,getTransform:()=>x.getState().transform,getViewScale:()=>se.current}),()=>{ce.current?.destroy()}},[E]),(0,L.useEffect)(()=>{ce.current?.update({translateExtent:D,width:O,height:k,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,O,k]);let le=p?e=>{let[t,n]=ce.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,ue=m?(0,L.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m(e,n)},[]):void 0,de=_??A[`minimap.ariaLabel`];return(0,R.jsx)(n7,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*te:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:M3([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,R.jsxs)(`svg`,{width:j,height:M,viewBox:`${ie} ${ae} ${F} ${I}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":oe,ref:S,onClick:le,children:[de&&(0,R.jsx)(`title`,{id:oe,children:de}),(0,R.jsx)(Dde,{onClick:ue,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,R.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${ie-re},${ae-re}h${F+re*2}v${I+re*2}h${-F-re*2}z
76
- M${w.x},${w.y}h${w.width}v${w.height}h${-w.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}_9.displayName=`MiniMap`;var Nde=(0,L.memo)(_9),Pde=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Fde={[R5.Line]:`right`,[R5.Handle]:`bottom-right`};function Ide({nodeId:e,position:t,variant:n=R5.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=M7(),y=typeof e==`string`?e:v,b=Q5(),x=(0,L.useRef)(null),S=n===R5.Handle,C=Z5((0,L.useCallback)(Pde(S&&p),[S,p]),J5),w=(0,L.useRef)(null),T=t??Fde[n];return(0,L.useEffect)(()=>{if(!(!x.current||!y))return w.current||=_le({domNode:x.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=b.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=b.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=x5([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...G8({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};b.getState().triggerNodeChanges([n])}}),w.current.update({controlPosition:T,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{w.current?.destroy()}},[T,s,c,l,u,d,h,g,_,m]),(0,R.jsx)(`div`,{className:M3([`react-flow__resize-control`,`nodrag`,...T.split(`-`),n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,L.memo)(Ide);var v9={requirement:`#3b82f6`,decision:`#8b5cf6`,code_change:`#10b981`,outcome:`#f59e0b`};function Lde({nodes:e,edges:t,onNodeClick:n}){let r=(0,L.useMemo)(()=>e.map((e,t)=>({id:e.id,type:`default`,data:{label:(0,R.jsxs)(`div`,{className:`text-xs`,children:[(0,R.jsx)(`div`,{className:`font-semibold truncate max-w-[120px]`,children:e.title}),(0,R.jsx)(`div`,{className:`text-gray-500 text-[10px]`,children:e.node_type})]})},position:{x:t%5*200+Math.sin(t)*30,y:Math.floor(t/5)*150+Math.cos(t)*20},style:{background:v9[e.node_type]||`#6b7280`,color:`#fff`,border:`none`,borderRadius:`8px`,padding:`8px 12px`,minWidth:`140px`}})),[e]),i=(0,L.useMemo)(()=>t.map(e=>({id:e.id,source:e.from_node_id,target:e.to_node_id,label:e.edge_type,labelStyle:{fontSize:10,fill:`#6b7280`},style:{stroke:`#d1d5db`,strokeWidth:Math.max(1,e.weight)},markerEnd:{type:f8.ArrowClosed,color:`#d1d5db`}})),[t]),[a,,o]=sde(r),[s,,c]=cde(i),l=(0,L.useCallback)((e,t)=>{n?.(t.id)},[n]);return e.length===0?(0,R.jsx)(`div`,{className:`flex items-center justify-center h-full text-gray-400 text-sm`,children:`暂无知识节点`}):(0,R.jsxs)(ode,{nodes:a,edges:s,onNodesChange:o,onEdgesChange:c,onNodeClick:l,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[(0,R.jsx)(pde,{color:`#f3f4f6`,gap:20}),(0,R.jsx)(bde,{}),(0,R.jsx)(Nde,{nodeColor:t=>v9[e.find(e=>e.id===t.id)?.node_type||``]||`#6b7280`,style:{background:`#f9fafb`}})]})}var y9={requirement:cc,decision:yc,code_change:Xs,outcome:Gs},b9={requirement:`#3b82f6`,decision:`#8b5cf6`,code_change:`#10b981`,outcome:`#f59e0b`},x9={requirement:`需求`,decision:`决策`,code_change:`代码变更`,outcome:`结果`},S9=[`#3b82f6`,`#8b5cf6`,`#10b981`,`#f59e0b`,`#ef4444`,`#06b6d4`];function Rde(){let e=Ye(),[t,n]=(0,L.useState)(``),r=A3(t,300),[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(null),[c,l]=(0,L.useState)(new Set),[u,d]=(0,L.useState)(1),[f,p]=(0,L.useState)(20),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(!1),[v,y]=(0,L.useState)(!1),[b,x]=(0,L.useState)(null),[S,C]=(0,L.useState)(``),[w,T]=(0,L.useState)(`list`),[E,D]=(0,L.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),[O,k]=(0,L.useState)(!1),{data:A}=ut({queryKey:[`knowledge-overview`],queryFn:()=>wl().then(e=>e.data)}),{data:j}=ut({queryKey:[`knowledge-search`,r,i,S],queryFn:()=>Cl(r,S||void 0,i||void 0).then(e=>e.data),enabled:r.length>0}),{data:M}=ut({queryKey:[`knowledge-all`],queryFn:()=>Cl(``,void 0,void 0,500).then(e=>e.data)}),{data:N}=ut({queryKey:[`knowledge-filtered`,i,S],queryFn:()=>Cl(``,S||void 0,i||void 0,500).then(e=>e.data),enabled:t.length===0&&(!!i||!!S)}),{data:ee}=ut({queryKey:[`knowledge-neighbors`,o],queryFn:()=>Tl(o).then(e=>e.data),enabled:!!o}),{data:te}=ut({queryKey:[`knowledge-graph`,S,i],queryFn:()=>El(S||void 0,i||void 0).then(e=>e.data),enabled:w===`graph`}),P=z({mutationFn:Dl,onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),e.invalidateQueries({queryKey:[`knowledge-overview`]}),h(!1)}}),ne=z({mutationFn:({id:e,data:t})=>Ol(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),_(!1),x(null)}}),re=z({mutationFn:kl,onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),e.invalidateQueries({queryKey:[`knowledge-overview`]}),s(null)}}),ie=z({mutationFn:e=>Al(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-filtered`]}),e.invalidateQueries({queryKey:[`knowledge-search`]}),e.invalidateQueries({queryKey:[`knowledge-overview`]}),l(new Set),s(null)}}),ae=z({mutationFn:Ml,onSuccess:()=>{e.invalidateQueries({queryKey:[`knowledge-neighbors`]}),e.invalidateQueries({queryKey:[`knowledge-graph`]}),y(!1)}}),F=r?j?.items:i||S?N?.items:M?.items,I=Array.from(new Set(M?.items.map(e=>e.node_type)||[])),oe=Array.from(new Set(M?.items.map(e=>e.project_path||``).filter(Boolean)||[])),se=A?.byType?Object.entries(A.byType).map(([e,t])=>({name:e,value:t})):[],ce=Math.ceil((F?.length||0)/f),le=F?.slice((u-1)*f,u*f),ue=e=>{e.preventDefault();let t=new FormData(e.currentTarget);P.mutate({title:t.get(`title`),content:t.get(`content`),node_type:t.get(`node_type`),project_path:t.get(`project_path`),tags:t.get(`tags`)})},de=e=>{if(e.preventDefault(),!b)return;let t=new FormData(e.currentTarget);ne.mutate({id:b.id,data:{title:t.get(`title`),content:t.get(`content`),tags:t.get(`tags`)}})},fe=e=>{D({open:!0,title:`删除知识节点`,description:`确认删除此知识节点?关联的边也会被删除。`,onConfirm:()=>{re.mutate(e),D(e=>({...e,open:!1}))}})},pe=()=>{k(!0)},me=()=>{if(!F||F.length===0)return;let e=[`ID`,`标题`,`类型`,`内容`,`标签`,`项目路径`],t=F.map(e=>[e.id,e.title,e.node_type,e.content,e.tags||``,e.project_path||``]);K4(`knowledge-nodes-${x4(new Date,`yyyyMMdd-HHmmss`)}.csv`,e,t)},he=z({mutationFn:e=>jl(e).then(e=>e.data),onSuccess:t=>{H(t.message,`success`),e.invalidateQueries({queryKey:[`knowledge-all`]}),e.invalidateQueries({queryKey:[`knowledge-overview`]})},onError:()=>H(`导入失败`,`error`)});return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,R.jsxs)(`div`,{className:`relative flex-1`,children:[(0,R.jsx)(Lc,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,R.jsx)(`input`,{type:`text`,placeholder:`搜索知识节点(需求、决策、代码变更、结果)...`,value:t,onChange:e=>{n(e.target.value),d(1)},className:`w-full pl-10 pr-4 py-3 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500 text-lg`})]}),(0,R.jsxs)(`select`,{value:i,onChange:e=>{a(e.target.value),d(1)},className:`px-3 py-3 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:``,children:`全部类型`}),I.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]}),(0,R.jsxs)(`select`,{value:S,onChange:e=>{C(e.target.value),d(1)},className:`px-3 py-3 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:``,children:`全部项目`}),oe.map(e=>(0,R.jsx)(`option`,{value:e,children:e.split(`/`).pop()},e))]}),(0,R.jsx)(Y,{variant:`primary`,size:`sm`,icon:Mc,onClick:()=>h(!0),children:`创建节点`}),c.size>0&&(0,R.jsxs)(Y,{variant:`danger`,size:`sm`,icon:Jc,onClick:pe,loading:ie.isPending,children:[`删除 (`,c.size,`)`]}),(0,R.jsxs)(`div`,{className:`flex border border-gray-200 rounded-lg overflow-hidden`,children:[(0,R.jsx)(`button`,{onClick:()=>T(`list`),className:`px-3 py-2 text-sm transition-colors ${w===`list`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`}`,children:`列表`}),(0,R.jsxs)(`button`,{onClick:()=>T(`graph`),className:`px-3 py-2 text-sm transition-colors flex items-center gap-1 ${w===`graph`?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`}`,children:[(0,R.jsx)(Ec,{className:`h-4 w-4`}),`图谱`]})]})]})}),(0,R.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,R.jsxs)(X,{title:`知识图谱概览`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 mb-4`,children:[(0,R.jsxs)(`button`,{className:`text-center p-4 bg-blue-50 rounded-xl hover:bg-blue-100 transition-colors cursor-pointer`,onClick:()=>{a(``),C(``),d(1)},title:`点击查看全部节点`,children:[(0,R.jsx)(Fs,{className:`h-8 w-8 text-blue-500 mx-auto mb-2`}),(0,R.jsx)(`div`,{className:`text-3xl font-bold text-blue-600`,children:A?.totalNodes||0}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600`,children:`知识节点`})]}),(0,R.jsxs)(`div`,{className:`text-center p-4 bg-purple-50 rounded-xl`,children:[(0,R.jsx)(pc,{className:`h-8 w-8 text-purple-500 mx-auto mb-2`}),(0,R.jsx)(`div`,{className:`text-3xl font-bold text-purple-600`,children:se.length}),(0,R.jsx)(`div`,{className:`text-sm text-gray-600`,children:`节点类型`})]})]}),se.length>0&&(0,R.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:se.map((e,t)=>(0,R.jsxs)(`button`,{onClick:()=>{a(i===e.name?``:e.name),d(1)},className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${i===e.name?`text-white`:`bg-gray-100 text-gray-700 hover:bg-gray-200`}`,style:i===e.name?{backgroundColor:S9[t%S9.length]}:{},children:[(0,R.jsx)(`span`,{className:`w-2 h-2 rounded-full flex-shrink-0`,style:{backgroundColor:S9[t%S9.length]}}),x9[e.name]||e.name,(0,R.jsxs)(`span`,{className:`opacity-70`,children:[`(`,e.value,`)`]})]},e.name))})]}),(0,R.jsx)(X,{title:`节点类型分布`,children:se.length>0?(0,R.jsx)(Dk,{width:`100%`,height:220,children:(0,R.jsxs)(f2,{margin:{top:20,right:20,bottom:20,left:20},children:[(0,R.jsx)(zJ,{data:se,cx:`50%`,cy:`50%`,innerRadius:50,outerRadius:80,dataKey:`value`,label:({name:e,percent:t})=>t>=.05?`${x9[e]||e} ${(t*100).toFixed(0)}%`:``,labelLine:({percent:e})=>e>=.05,onClick:e=>{a(i===e.name?``:e.name),d(1)},style:{cursor:`pointer`},children:se.map((e,t)=>(0,R.jsx)(HW,{fill:S9[t%S9.length],opacity:i&&i!==e.name?.4:1},t))}),(0,R.jsx)(VW,{formatter:(e,t)=>[e,x9[t]||t]})]})}):(0,R.jsx)(`div`,{className:`flex items-center justify-center h-48 text-gray-400`,children:`暂无数据`})})]}),w===`graph`&&(0,R.jsx)(X,{title:`知识图谱`,children:(0,R.jsx)(`div`,{className:`h-[600px] border border-gray-200 rounded-lg overflow-hidden`,children:te?(0,R.jsx)(Lde,{nodes:te.nodes,edges:te.edges,onNodeClick:s}):(0,R.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,R.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})})})}),w===`list`&&(0,R.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-6`,children:[(0,R.jsx)(`div`,{className:`lg:col-span-2`,children:(0,R.jsxs)(X,{title:`知识节点 (${F?.length||0})`,action:(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[F&&F.length>0&&(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:nc,onClick:me,children:`导出 CSV`}),(0,R.jsxs)(`label`,{className:`cursor-pointer`,children:[(0,R.jsx)(`input`,{type:`file`,accept:`.json,.csv`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=e=>{try{let n=e.target?.result,r=[];if(t.name.endsWith(`.json`)){let e=JSON.parse(n);r=Array.isArray(e)?e:e.nodes||e.items||[]}else if(t.name.endsWith(`.csv`)){let e=n.split(`
77
- `).filter(e=>e.trim()),t=e[0].split(`,`).map(e=>e.trim().replace(/^"|"$/g,``));r=e.slice(1).map(e=>{let n=e.split(`,`).map(e=>e.trim().replace(/^"|"$/g,``)),r={};return t.forEach((e,t)=>{r[e]=n[t]||``}),{title:r.title||r.标题||``,content:r.content||r.内容||``,node_type:r.node_type||r.类型||`requirement`,project_path:r.project_path||r.项目路径||``,tags:r.tags||r.标签?(r.tags||r.标签).split(`;`).filter(Boolean):[]}})}if(r.length===0){H(`未解析到有效节点,请检查文件格式`,`error`);return}he.mutate(r)}catch{H(`文件解析失败,请检查格式`,`error`)}},n.readAsText(t),e.target.value=``}}),(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg border border-gray-200 bg-white hover:bg-gray-50 transition-colors ${he.isPending?`opacity-50 pointer-events-none`:``}`,children:[(0,R.jsx)(Zc,{className:`h-4 w-4`}),he.isPending?`导入中...`:`导入`]})]}),le&&le.length>0&&(0,R.jsx)(`button`,{onClick:()=>{c.size===le.length?l(new Set):l(new Set(le.map(e=>e.id)))},className:`text-xs text-blue-600 hover:underline`,children:c.size===le.length?`取消全选`:`全选当前页`})]}),children:[(0,R.jsxs)(`div`,{className:`space-y-2`,children:[le?.map((e,t)=>{let n=y9[e.node_type]||Fs,r=b9[e.node_type]||`#6b7280`;return(0,R.jsx)(sS.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:t*.03},className:`p-4 rounded-lg border cursor-pointer transition-all group ${c.has(e.id)?`border-blue-300 bg-blue-50`:o===e.id?`border-blue-300 bg-blue-50 shadow-sm`:`border-gray-100 hover:border-gray-200 hover:bg-gray-50`}`,onClick:()=>s(e.id),children:(0,R.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:c.has(e.id),onChange:t=>{t.stopPropagation(),l(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})},onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded border-gray-300 text-blue-600 cursor-pointer flex-shrink-0 mt-1`}),(0,R.jsx)(`div`,{className:`p-2 rounded-lg`,style:{backgroundColor:`${r}15`},children:(0,R.jsx)(n,{className:`h-5 w-5`,style:{color:r}})}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-gray-900 truncate`,children:e.title}),(0,R.jsx)(fS,{size:`sm`,variant:e.node_type===`outcome`?`success`:e.node_type===`decision`?`info`:`default`,children:x9[e.node_type]||e.node_type})]}),(0,R.jsx)(`p`,{className:`text-sm text-gray-600 mt-1 line-clamp-2`,children:e.content}),e.tags&&e.tags.trim()&&(0,R.jsx)(`div`,{className:`flex gap-1 mt-2`,children:e.tags.split(`,`).filter(e=>e.trim()).slice(0,3).map(e=>(0,R.jsx)(`span`,{className:`text-xs px-2 py-0.5 bg-gray-100 rounded-full text-gray-600`,children:e.trim()},e))})]}),(0,R.jsxs)(`div`,{className:`flex gap-1 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity`,children:[(0,R.jsx)(`button`,{onClick:t=>{t.stopPropagation(),x({id:e.id,title:e.title,content:e.content,tags:e.tags||``}),_(!0)},className:`p-1.5 rounded hover:bg-gray-200 text-gray-400 hover:text-gray-600`,children:(0,R.jsx)(Uc,{className:`h-3.5 w-3.5`})}),(0,R.jsx)(`button`,{onClick:t=>{t.stopPropagation(),fe(e.id)},className:`p-1.5 rounded hover:bg-red-100 text-gray-400 hover:text-red-600`,children:(0,R.jsx)(Jc,{className:`h-3.5 w-3.5`})})]})]})},e.id)}),(!le||le.length===0)&&(0,R.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-gray-400`,children:[(0,R.jsx)(Fs,{className:`h-12 w-12 mb-4`}),(0,R.jsx)(`p`,{children:`暂无知识节点`}),(0,R.jsx)(`p`,{className:`text-sm mt-1`,children:`使用 Claude Code 进行开发后,知识会自动沉淀`})]})]}),F&&F.length>0&&(0,R.jsx)(`div`,{className:`mt-4`,children:(0,R.jsx)(n3,{currentPage:u,totalPages:ce,onPageChange:d,pageSize:f,onPageSizeChange:e=>{p(e),d(1)},totalItems:F.length})})]})}),(0,R.jsx)(`div`,{children:(0,R.jsx)(X,{title:`节点详情`,children:o&&F?(()=>{let e=F.find(e=>e.id===o);if(!e)return(0,R.jsx)(`div`,{className:`text-gray-400 text-center py-8`,children:`节点未找到`});let t=y9[e.node_type]||Fs,n=b9[e.node_type]||`#6b7280`;return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(`div`,{className:`p-3 rounded-xl`,style:{backgroundColor:`${n}15`},children:(0,R.jsx)(t,{className:`h-6 w-6`,style:{color:n}})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`font-bold text-gray-900`,children:e.title}),(0,R.jsx)(fS,{size:`sm`,children:x9[e.node_type]||e.node_type})]})]}),(0,R.jsx)(`div`,{className:`p-3 bg-gray-50 rounded-lg text-sm text-gray-700 whitespace-pre-wrap`,children:e.content}),e.tags&&e.tags.trim()&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-xs font-semibold text-gray-500 mb-2`,children:`标签`}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.tags.split(`,`).filter(e=>e.trim()).map(e=>(0,R.jsx)(`span`,{className:`text-xs px-2 py-1 bg-blue-50 text-blue-600 rounded-full`,children:e.trim()},e))})]}),ee&&ee.items.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`text-xs font-semibold text-gray-500 mb-2`,children:[`关联节点 (`,ee.total,`)`]}),(0,R.jsx)(`div`,{className:`space-y-2`,children:ee.items.map((e,t)=>(0,R.jsxs)(`div`,{className:`p-2 bg-gray-50 rounded-lg text-sm cursor-pointer hover:bg-gray-100`,onClick:()=>s(e.id),children:[(0,R.jsx)(`div`,{className:`font-medium`,children:e.title}),(0,R.jsxs)(`div`,{className:`text-xs text-gray-500`,children:[e.edge_type,` · `,e.node_type]})]},t))})]}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:pc,onClick:()=>y(!0),children:`添加关系`})]})})():(0,R.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-gray-400`,children:[(0,R.jsx)(Lc,{className:`h-8 w-8 mb-3`}),(0,R.jsx)(`p`,{className:`text-sm`,children:`点击左侧节点查看详情`})]})})})]}),m&&(0,R.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,onClick:()=>h(!1),children:(0,R.jsxs)(`div`,{className:`bg-white rounded-xl p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto`,onClick:e=>e.stopPropagation(),children:[(0,R.jsx)(`h3`,{className:`text-xl font-bold mb-4`,children:`创建知识节点`}),(0,R.jsxs)(`form`,{onSubmit:ue,className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标题 *`}),(0,R.jsx)(`input`,{type:`text`,name:`title`,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`内容 *`}),(0,R.jsx)(`textarea`,{name:`content`,required:!0,rows:6,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`类型 *`}),(0,R.jsxs)(`select`,{name:`node_type`,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:`requirement`,children:`需求 (requirement)`}),(0,R.jsx)(`option`,{value:`decision`,children:`决策 (decision)`}),(0,R.jsx)(`option`,{value:`code_change`,children:`代码变更 (code_change)`}),(0,R.jsx)(`option`,{value:`outcome`,children:`结果 (outcome)`})]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`项目路径 *`}),(0,R.jsx)(`input`,{type:`text`,name:`project_path`,required:!0,placeholder:`/path/to/project`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,R.jsx)(`input`,{type:`text`,name:`tags`,placeholder:`tag1, tag2, tag3`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 justify-end pt-2`,children:[(0,R.jsx)(Y,{type:`button`,variant:`secondary`,onClick:()=>h(!1),children:`取消`}),(0,R.jsx)(Y,{type:`submit`,variant:`primary`,loading:P.isPending,children:`创建`})]})]})]})}),g&&b&&(0,R.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,onClick:()=>_(!1),children:(0,R.jsxs)(`div`,{className:`bg-white rounded-xl p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto`,onClick:e=>e.stopPropagation(),children:[(0,R.jsx)(`h3`,{className:`text-xl font-bold mb-4`,children:`编辑知识节点`}),(0,R.jsxs)(`form`,{onSubmit:de,className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标题`}),(0,R.jsx)(`input`,{type:`text`,name:`title`,defaultValue:b.title,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`内容`}),(0,R.jsx)(`textarea`,{name:`content`,defaultValue:b.content,required:!0,rows:6,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,R.jsx)(`input`,{type:`text`,name:`tags`,defaultValue:b.tags,placeholder:`tag1, tag2, tag3`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 justify-end pt-2`,children:[(0,R.jsx)(Y,{type:`button`,variant:`secondary`,onClick:()=>_(!1),children:`取消`}),(0,R.jsx)(Y,{type:`submit`,variant:`primary`,loading:ne.isPending,children:`保存`})]})]})]})}),v&&o&&(0,R.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,onClick:()=>y(!1),children:(0,R.jsxs)(`div`,{className:`bg-white rounded-xl p-6 w-full max-w-md`,onClick:e=>e.stopPropagation(),children:[(0,R.jsx)(`h3`,{className:`text-xl font-bold mb-4`,children:`添加关系`}),(0,R.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=new FormData(e.currentTarget),n=t.get(`to_node_id`),r=t.get(`edge_type`);n&&r&&ae.mutate({from_node_id:o,to_node_id:n,edge_type:r})},className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`目标节点 *`}),(0,R.jsxs)(`select`,{name:`to_node_id`,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:``,children:`选择节点`}),M?.items.filter(e=>e.id!==o).map(e=>(0,R.jsxs)(`option`,{value:e.id,children:[e.title,` (`,x9[e.node_type]||e.node_type,`)`]},e.id))]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`关系类型 *`}),(0,R.jsxs)(`select`,{name:`edge_type`,required:!0,className:`w-full px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:``,children:`选择关系`}),(0,R.jsx)(`option`,{value:`depends_on`,children:`依赖于`}),(0,R.jsx)(`option`,{value:`implements`,children:`实现`}),(0,R.jsx)(`option`,{value:`relates_to`,children:`关联到`}),(0,R.jsx)(`option`,{value:`causes`,children:`导致`}),(0,R.jsx)(`option`,{value:`resolves`,children:`解决`})]})]}),(0,R.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>y(!1),className:`px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg transition-colors`,children:`取消`}),(0,R.jsx)(`button`,{type:`submit`,disabled:ae.isPending,className:`px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50`,children:ae.isPending?`创建中...`:`创建`})]})]})]})}),(0,R.jsx)(w4,{open:E.open,title:E.title,description:E.description,variant:`danger`,onConfirm:E.onConfirm,onCancel:()=>D({...E,open:!1})}),(0,R.jsx)(j3,{open:O,count:c.size,itemLabel:`知识节点`,loading:ie.isPending,onConfirm:()=>{ie.mutate(Array.from(c)),k(!1),l(new Set)},onCancel:()=>k(!1)})]})}function zde(){let e=Fn(),t=Ye(),[n,r]=(0,L.useState)(``),[i,a]=(0,L.useState)(1),[o,s]=(0,L.useState)(12),[c,l]=(0,L.useState)(`lastActivity`),[u,d]=(0,L.useState)(!1),[f,p]=(0,L.useState)(!1),[m,h]=(0,L.useState)(null),[g,_]=(0,L.useState)(``),[v,y]=(0,L.useState)(``),[b,x]=(0,L.useState)(new Set),[S,C]=(0,L.useState)(!1),[w,T]=(0,L.useState)(``),[E,D]=(0,L.useState)(!1),{data:O}=ut({queryKey:[`project-meta-all`],queryFn:()=>U.get(`/projects/meta/all`).then(e=>e.data),staleTime:3e4}),k=O||{},A=z({mutationFn:({projectPath:e,meta:t})=>U.put(`/projects/${encodeURIComponent(e)}/meta`,t),onSuccess:()=>{t.invalidateQueries({queryKey:[`project-meta-all`]})},onError:e=>H(e.message||`操作失败`,`error`)}),j=(e,t)=>{t.stopPropagation();let n=k[e]||{notes:``,tags:[],archived:!1};_(n.notes),y(n.tags.join(`, `)),h(e)},M=()=>{if(!m)return;let e=k[m]||{notes:``,tags:[],archived:!1};A.mutate({projectPath:m,meta:{notes:g.trim(),tags:v.split(`,`).map(e=>e.trim()).filter(Boolean),archived:e.archived}}),h(null)},N=(e,t)=>{t.stopPropagation();let n=k[e]||{notes:``,tags:[],archived:!1};A.mutate({projectPath:e,meta:{...n,archived:!n.archived}})},ee=(e,t)=>{t.stopPropagation(),x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},te=()=>{for(let e of b){let t=k[e]||{notes:``,tags:[],archived:!1};A.mutate({projectPath:e,meta:{...t,archived:!0}})}H(`已归档 ${b.size} 个项目`,`success`),x(new Set)},P=async()=>{D(!0);let e=0;for(let t of b)try{await Hl(encodeURIComponent(t)),e++}catch{}D(!1),C(!1),T(``),x(new Set),t.invalidateQueries({queryKey:[`projects`]}),H(`已删除 ${e} 个项目`,`success`)},{data:ne,isLoading:re}=ut({queryKey:[`projects`],queryFn:()=>Bl({limit:1e3}).then(e=>e.data),refetchInterval:3e4});if(re)return(0,R.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,R.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})});let ie=ne?.items||[],ae=e=>{c===e?d(e=>!e):(l(e),d(!1)),a(1)},F=ie.filter(e=>{if(k[e.projectPath]?.archived&&!f)return!1;if(!n)return!0;let t=n.toLowerCase();return e.projectName.toLowerCase().includes(t)||e.projectPath.toLowerCase().includes(t)}).sort((e,t)=>{let n=0;return c===`name`?n=e.projectName.localeCompare(t.projectName):c===`lastActivity`?n=(e.lastActivity||``).localeCompare(t.lastActivity||``):c===`sessionCount`?n=e.sessionCount-t.sessionCount:c===`totalEvents`&&(n=e.totalEvents-t.totalEvents),u?n:-n}),I=Math.ceil(F.length/o),oe=F.slice((i-1)*o,i*o);return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`项目管理`}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`查看所有被 Forge 管理的项目`})]}),(0,R.jsx)(`div`,{className:`flex items-center gap-3`,children:b.size>0?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(fS,{variant:`info`,children:[b.size,` 个已选`]}),(0,R.jsxs)(`button`,{onClick:te,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,R.jsx)(Os,{className:`h-4 w-4`}),`批量归档`]}),(0,R.jsxs)(`button`,{onClick:()=>C(!0),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors`,children:[(0,R.jsx)(Jc,{className:`h-4 w-4`}),`批量删除`]}),(0,R.jsxs)(`button`,{onClick:()=>x(new Set),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-50 rounded-lg transition-colors`,children:[(0,R.jsx)(el,{className:`h-4 w-4`}),`取消选择`]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(fS,{variant:`info`,children:[F.length,` 个项目`]}),(0,R.jsxs)(`button`,{onClick:()=>p(!f),className:q(`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg transition-colors`,f?`bg-blue-50 text-blue-600`:`text-gray-600 hover:bg-gray-50`),children:[(0,R.jsx)(Os,{className:`h-4 w-4`}),f?`隐藏归档`:`显示归档`]}),(0,R.jsxs)(`button`,{onClick:()=>{let e=[`项目名称`,`项目路径`,`会话数`,`Pipeline 数`,`质量问题数`,`总事件数`,`最近活动`],t=F.map(e=>[e.projectName,e.projectPath,e.sessionCount,e.pipelineCount,e.qualityIssueCount,e.totalEvents,e.lastActivity||``]);K4(`projects-${new Date().toISOString().slice(0,10)}.csv`,e,t)},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-50 rounded-lg transition-colors`,children:[(0,R.jsx)(nc,{className:`h-4 w-4`}),`导出 CSV`]})]})})]}),(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,R.jsxs)(`div`,{className:`relative flex-1`,children:[(0,R.jsx)(Lc,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`}),(0,R.jsx)(`input`,{type:`text`,placeholder:`搜索项目名称或路径...`,value:n,onChange:e=>{r(e.target.value),a(1)},className:`w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,R.jsx)(`span`,{className:`text-gray-500`,children:`排序:`}),[{key:`name`,label:`名称`},{key:`lastActivity`,label:`活动时间`},{key:`sessionCount`,label:`会话数`},{key:`totalEvents`,label:`事件数`}].map(({key:e,label:t})=>(0,R.jsxs)(`button`,{onClick:()=>ae(e),className:q(`px-3 py-1.5 rounded-lg transition-colors flex items-center gap-1`,c===e?`bg-blue-50 text-blue-700 font-medium`:`text-gray-600 hover:bg-gray-50`),children:[t,c===e&&(0,R.jsx)(js,{className:q(`h-3 w-3`,u&&`rotate-180`)})]},e))]})]})}),(0,R.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:oe.map((t,n)=>{let r=t.projectPath,i=k[r]||{notes:``,tags:[],archived:!1};return(0,R.jsx)(sS.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:n*.03},children:(0,R.jsx)(X,{className:q(`!p-0 overflow-hidden cursor-pointer hover:shadow-md transition-shadow h-full flex flex-col`,i.archived&&`opacity-60`),onClick:()=>e(`/projects/${encodeURIComponent(r)}`),children:(0,R.jsxs)(`div`,{className:`p-4 flex-1 flex flex-col`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-3 mb-3`,children:[(0,R.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-blue-50 flex-shrink-0`,children:(0,R.jsx)(dc,{className:`h-5 w-5 text-blue-600`})}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`h3`,{className:`font-semibold text-gray-900 truncate`,children:t.projectName}),i.archived&&(0,R.jsx)(Os,{className:`h-3.5 w-3.5 text-gray-400 flex-shrink-0`})]}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500 truncate`,children:r}),i.tags.length>0&&(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:i.tags.map(e=>(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-blue-50 text-blue-600 text-xs rounded`,children:[(0,R.jsx)(Gc,{className:`h-2.5 w-2.5`}),e]},e))}),i.notes&&(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mt-1 truncate`,children:i.notes})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[(0,R.jsx)(`button`,{onClick:e=>ee(r,e),className:q(`p-1 rounded transition-colors`,b.has(r)?`text-blue-600`:`text-gray-300 hover:text-gray-500`),title:`选择`,children:b.has(r)?(0,R.jsx)(Hc,{className:`h-3.5 w-3.5`}):(0,R.jsx)(Wc,{className:`h-3.5 w-3.5`})}),(0,R.jsx)(`button`,{onClick:e=>N(r,e),className:`p-1 text-gray-400 hover:text-gray-600 rounded`,title:i.archived?`取消归档`:`归档`,children:(0,R.jsx)(Os,{className:`h-3.5 w-3.5`})}),(0,R.jsx)(`button`,{onClick:e=>j(r,e),className:`p-1 text-gray-400 hover:text-gray-600 rounded`,title:`项目设置`,children:(0,R.jsx)(Rc,{className:`h-3.5 w-3.5`})})]})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-sm flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,R.jsx)(Ds,{className:`h-4 w-4 flex-shrink-0`}),(0,R.jsxs)(`span`,{children:[t.sessionCount,` 会话`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,R.jsx)(pc,{className:`h-4 w-4 flex-shrink-0`}),(0,R.jsxs)(`span`,{children:[t.pipelineCount,` Pipeline`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,R.jsx)(zc,{className:`h-4 w-4 flex-shrink-0`}),(0,R.jsxs)(`span`,{children:[t.qualityIssueCount,` 质量`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-600`,children:[(0,R.jsx)(Fs,{className:`h-4 w-4 flex-shrink-0`}),(0,R.jsxs)(`span`,{children:[t.totalEvents,` 事件`]})]})]}),t.lastActivity&&(0,R.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-gray-400 mt-3 pt-3 border-t border-gray-100`,children:[(0,R.jsx)(Ys,{className:`h-3 w-3 flex-shrink-0`}),(0,R.jsxs)(`span`,{children:[`最近活动:`,x4(Df(t.lastActivity),`MM-dd HH:mm`)]})]})]})})},r)})}),F.length===0&&(0,R.jsxs)(`div`,{className:`text-center py-12`,children:[(0,R.jsx)(dc,{className:`h-12 w-12 text-gray-300 mx-auto mb-3`}),(0,R.jsx)(`p`,{className:`text-gray-500`,children:`暂无项目`}),(0,R.jsx)(`p`,{className:`text-sm text-gray-400 mt-1`,children:`在任意目录使用 Claude Code 后,项目将自动出现在这里`})]}),F.length>0&&(0,R.jsx)(n3,{currentPage:i,totalPages:I,onPageChange:a,pageSize:o,onPageSizeChange:e=>{s(e),a(1)},totalItems:F.length}),S&&(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onClick:()=>{C(!1),T(``)},children:(0,R.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md p-6`,onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`h3`,{className:`text-lg font-bold text-red-600 mb-3 flex items-center gap-2`,children:[(0,R.jsx)(Jc,{className:`h-5 w-5`}),`危险操作:批量删除项目`]}),(0,R.jsxs)(`div`,{className:`bg-red-50 border border-red-200 rounded-lg p-3 mb-4`,children:[(0,R.jsxs)(`p`,{className:`text-sm text-red-800 font-medium mb-2`,children:[`⚠️ 此操作将永久删除 `,(0,R.jsxs)(`strong`,{children:[b.size,` 个项目`]}),` 的所有监控数据:`]}),(0,R.jsxs)(`ul`,{className:`text-xs text-red-700 space-y-1 ml-4 list-disc`,children:[(0,R.jsx)(`li`,{children:`所有会话记录`}),(0,R.jsx)(`li`,{children:`所有 Pipeline 历史`}),(0,R.jsx)(`li`,{children:`所有质量问题记录`}),(0,R.jsx)(`li`,{children:`所有事件日志`}),(0,R.jsx)(`li`,{children:`所有知识节点`})]}),(0,R.jsx)(`p`,{className:`text-xs text-red-800 font-bold mt-2`,children:`此操作无法撤销,无法恢复!`})]}),(0,R.jsxs)(`div`,{className:`mb-4`,children:[(0,R.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:[`请输入 `,(0,R.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-100 rounded text-red-600`,children:`删除`}),` 以确认批量删除:`]}),(0,R.jsx)(`input`,{type:`text`,value:w,onChange:e=>T(e.target.value),placeholder:`输入「删除」二字`,className:`w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500`,autoFocus:!0})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,R.jsx)(`button`,{onClick:()=>{C(!1),T(``)},className:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 rounded-lg`,children:`取消`}),(0,R.jsx)(`button`,{disabled:w!==`删除`||E,onClick:P,className:`px-4 py-2 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed`,children:E?`删除中...`:`确认删除`})]})]})}),m&&(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,onClick:()=>h(null),children:(0,R.jsxs)(`div`,{className:`bg-white rounded-xl shadow-xl w-full max-w-md p-6`,onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,R.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`项目设置`}),(0,R.jsx)(`button`,{onClick:()=>h(null),className:`text-gray-400 hover:text-gray-600`,children:(0,R.jsx)(el,{className:`h-5 w-5`})})]}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500 mb-4 truncate`,children:m}),(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`标签(逗号分隔)`}),(0,R.jsx)(`input`,{type:`text`,value:v,onChange:e=>y(e.target.value),placeholder:`前端, 工具, 实验...`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-1`,children:`备注`}),(0,R.jsx)(`textarea`,{value:g,onChange:e=>_(e.target.value),rows:3,placeholder:`项目说明、注意事项...`,className:`w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none`})]})]}),(0,R.jsxs)(`div`,{className:`flex justify-end gap-2 mt-5`,children:[(0,R.jsx)(`button`,{onClick:()=>h(null),className:`px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 rounded-lg`,children:`取消`}),(0,R.jsx)(`button`,{onClick:M,className:`px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700`,children:`保存`})]})]})})]})}var Bde={spec:{label:`规格`,icon:cc,color:`text-blue-600`,bg:`bg-blue-50`,border:`border-blue-200`},security:{label:`安全`,icon:Bc,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-200`},quality:{label:`质量`,icon:oc,color:`text-purple-600`,bg:`bg-purple-50`,border:`border-purple-200`},test:{label:`测试`,icon:qc,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-200`},performance:{label:`性能`,icon:tl,color:`text-orange-600`,bg:`bg-orange-50`,border:`border-orange-200`}},Vde={fail:{label:`失败`,icon:qs,color:`text-red-600`,bg:`bg-red-50`,border:`border-red-300`},warn:{label:`警告`,icon:Xc,color:`text-yellow-600`,bg:`bg-yellow-50`,border:`border-yellow-300`},pass:{label:`通过`,icon:Gs,color:`text-green-600`,bg:`bg-green-50`,border:`border-green-300`}};function Hde({level:e}){let t=Vde[e];if(!t)return(0,R.jsx)(fS,{size:`sm`,children:e});let n=t.icon;return(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,R.jsx)(n,{className:`h-3 w-3`}),t.label]})}function Ude({category:e}){let t=Bde[e];if(!t)return(0,R.jsx)(fS,{size:`sm`,children:e});let n=t.icon;return(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border ${t.bg} ${t.color} ${t.border}`,children:[(0,R.jsx)(n,{className:`h-3 w-3`}),t.label]})}function Wde(){let{encodedPath:e}=Ln(),t=Fn(),n=Ye(),[r,i]=(0,L.useState)(`sessions`),[a,o]=(0,L.useState)(!1),[s,c]=(0,L.useState)(``),[l,u]=(0,L.useState)(!1),[d,f]=(0,L.useState)(``),[p,m]=(0,L.useState)(null),[h,g]=(0,L.useState)(1),[_,v]=(0,L.useState)(20),[y,b]=(0,L.useState)(null),x=async e=>{try{let t=await su(e);await navigator.clipboard.writeText(t.data.context),b(e),H(`上下文已复制,请粘贴到 Claude Code 进行修复`,`success`),setTimeout(()=>b(null),3e3)}catch{H(`复制失败`,`error`)}},S=e?encodeURIComponent(e):``,{data:C,isLoading:w,isError:T,error:E}=ut({queryKey:[`project`,e],queryFn:()=>Vl(S).then(e=>e.data),enabled:!!e}),{data:D}=ut({queryKey:[`claudemd`,e],queryFn:()=>Xl(S).then(e=>e.data),enabled:!!e&&r===`claudemd`}),{data:O}=ut({queryKey:[`claudemd-modules`,e],queryFn:()=>$l(S).then(e=>e.data),enabled:!!e&&r===`claudemd`}),k=z({mutationFn:()=>Hl(S),onSuccess:()=>{n.invalidateQueries({queryKey:[`projects`]}),t(`/projects`)},onError:e=>H(e.message||`删除失败`,`error`)}),A=z({mutationFn:e=>Zl(S,e),onSuccess:()=>{n.invalidateQueries({queryKey:[`claudemd`,e]}),u(!1)},onError:e=>H(e.message||`保存失败`,`error`)}),j=z({mutationFn:()=>eu(S),onSuccess:t=>{n.invalidateQueries({queryKey:[`claudemd`,e]}),m({success:!0,message:t.data.distilled?`蒸馏完成,压缩 ${t.data.reduction}%(${t.data.before} → ${t.data.after} 字符):${t.data.summary}`:t.data.message??`无需蒸馏`})},onError:e=>{m({success:!1,message:e.message})}}),[M,N]=(0,L.useState)(null),[ee,te]=(0,L.useState)(!1),[P,ne]=(0,L.useState)(!1),[re,ie]=(0,L.useState)(null),[ae,F]=(0,L.useState)(!1),[I,oe]=(0,L.useState)(null);return T?(0,R.jsxs)(`div`,{className:`flex items-center justify-center h-96 text-red-500`,children:[`加载失败:`,E?.message||`未知错误`]}):w||!C?(0,R.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,R.jsx)(`div`,{className:`animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600`})}):(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsx)(X4,{items:[{label:`项目列表`,path:`/projects`},{label:C.projectName}]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:ks,onClick:()=>t(`/projects`),children:`返回`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(`div`,{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-blue-50`,children:(0,R.jsx)(dc,{className:`h-5 w-5 text-blue-600`})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:C.projectName}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500`,children:C.projectPath})]})]})]}),(0,R.jsx)(Y,{variant:`danger`,size:`sm`,icon:Jc,onClick:()=>o(!0),children:`删除项目`})]}),a&&(0,R.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,children:(0,R.jsxs)(X,{className:`max-w-md`,children:[(0,R.jsxs)(`h3`,{className:`text-lg font-bold text-red-600 mb-3 flex items-center gap-2`,children:[(0,R.jsx)(Xc,{className:`h-5 w-5`}),`危险操作:删除项目`]}),(0,R.jsxs)(`div`,{className:`bg-red-50 border border-red-200 rounded-lg p-3 mb-4`,children:[(0,R.jsxs)(`p`,{className:`text-sm text-red-800 font-medium mb-2`,children:[`⚠️ 此操作将永久删除项目 `,(0,R.jsx)(`strong`,{children:C.projectName}),` 的所有监控数据:`]}),(0,R.jsxs)(`ul`,{className:`text-xs text-red-700 space-y-1 ml-4 list-disc`,children:[(0,R.jsx)(`li`,{children:`所有会话记录`}),(0,R.jsx)(`li`,{children:`所有 Pipeline 历史`}),(0,R.jsx)(`li`,{children:`所有质量问题记录`}),(0,R.jsx)(`li`,{children:`所有事件日志`}),(0,R.jsx)(`li`,{children:`所有知识节点`})]}),(0,R.jsx)(`p`,{className:`text-xs text-red-800 font-bold mt-2`,children:`此操作无法撤销,无法恢复!`})]}),(0,R.jsxs)(`div`,{className:`mb-4`,children:[(0,R.jsxs)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:[`请输入项目名称 `,(0,R.jsx)(`code`,{className:`px-1.5 py-0.5 bg-gray-100 rounded text-red-600`,children:C.projectName}),` 以确认删除:`]}),(0,R.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`输入项目名称`,className:`w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500`,autoFocus:!0})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>{o(!1),c(``)},children:`取消`}),(0,R.jsx)(Y,{variant:`danger`,size:`sm`,disabled:s!==C.projectName,onClick:()=>{s===C.projectName&&(k.mutate(),o(!1),c(``))},children:`确认删除`})]})]})}),(0,R.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-5 gap-4`,children:[(0,R.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`sessions`),children:(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(Ds,{className:`h-8 w-8 text-blue-500`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:C.sessions.total}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500`,children:`会话`})]})]})}),(0,R.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`pipelines`),children:(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(pc,{className:`h-8 w-8 text-green-500`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:C.pipelines.total}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500`,children:`Pipeline`})]})]})}),(0,R.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`api`),children:(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(Kc,{className:`h-8 w-8 text-purple-500`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:C.events.total}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500`,children:`事件`})]})]})}),(0,R.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`quality`),children:(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(zc,{className:`h-8 w-8 text-orange-500`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:C.quality.total}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500`,children:`质量`})]})]})}),(0,R.jsx)(X,{className:`!p-4 cursor-pointer hover:shadow-md transition-shadow`,onClick:()=>i(`knowledge`),children:(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(Fs,{className:`h-8 w-8 text-pink-500`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-2xl font-bold text-gray-900`,children:C.knowledge.total}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500`,children:`知识`})]})]})})]}),(0,R.jsx)(`div`,{className:`flex gap-1 bg-gray-100 p-1 rounded-lg w-fit flex-wrap`,children:[{key:`sessions`,label:`会话`},{key:`pipelines`,label:`Pipeline`},{key:`quality`,label:`质量问题`},{key:`knowledge`,label:`知识文档`},{key:`rules`,label:`规则管理`},{key:`convention`,label:`自定义规范`},{key:`claudemd`,label:`CLAUDE.md`},{key:`environment`,label:`环境初始化`}].map(e=>(0,R.jsx)(`button`,{onClick:()=>i(e.key),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${r===e.key?`bg-white text-gray-900 shadow-sm`:`text-gray-600 hover:text-gray-900`}`,children:e.label},e.key))}),r===`sessions`&&(0,R.jsxs)(X,{children:[(0,R.jsx)(`div`,{className:`overflow-x-auto`,children:(0,R.jsxs)(`table`,{className:`w-full`,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`会话 ID`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`首条对话`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`状态`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`开始时间`})]})}),(0,R.jsx)(`tbody`,{className:`text-sm`,children:(()=>{let e=C.sessions.items;return Math.ceil(e.length/_),(0,R.jsxs)(R.Fragment,{children:[e.slice((h-1)*_,h*_).map(e=>(0,R.jsxs)(`tr`,{onClick:()=>t(`/sessions/${e.session_id}`,{state:{from:`/projects/${S}`}}),className:`border-t border-gray-50 hover:bg-blue-50 cursor-pointer transition-colors`,children:[(0,R.jsx)(`td`,{className:`py-3 font-mono text-xs`,children:e.session_id.slice(0,12)}),(0,R.jsx)(`td`,{className:`py-3 text-gray-700 max-w-md truncate`,title:e.first_requirement,children:e.first_requirement?e.first_requirement:`(无对话记录)`}),(0,R.jsx)(`td`,{className:`py-3`,children:(0,R.jsx)(fS,{size:`sm`,className:Ef(e.status),children:e.status})}),(0,R.jsx)(`td`,{className:`py-3 text-gray-500`,children:x4(Df(e.start_time),`MM-dd HH:mm`)})]},e.session_id)),e.length===0&&(0,R.jsx)(`tr`,{children:(0,R.jsx)(`td`,{colSpan:4,className:`py-8 text-center text-gray-400`,children:`暂无会话记录`})})]})})()})]})}),(()=>{let e=C.sessions.items,t=Math.ceil(e.length/_);return e.length>_?(0,R.jsx)(`div`,{className:`mt-4`,children:(0,R.jsx)(n3,{currentPage:h,totalPages:t,onPageChange:g,pageSize:_,onPageSizeChange:e=>{v(e),g(1)},totalItems:e.length})}):null})()]}),r===`pipelines`&&(0,R.jsx)(X,{children:(0,R.jsx)(`div`,{className:`overflow-x-auto`,children:(0,R.jsxs)(`table`,{className:`w-full`,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`需求`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`阶段`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`})]})}),(0,R.jsx)(`tbody`,{className:`text-sm`,children:C.pipelines.items.map(e=>(0,R.jsxs)(`tr`,{onClick:()=>t(`/pipelines/${e.id}`,{state:{from:`/projects/${S}`}}),className:`border-t border-gray-50 hover:bg-blue-50 cursor-pointer transition-colors`,children:[(0,R.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.requirement}),(0,R.jsx)(`td`,{className:`py-3`,children:(0,R.jsx)(fS,{size:`sm`,children:e.phase})}),(0,R.jsx)(`td`,{className:`py-3 text-gray-500`,children:x4(Df(e.updated_at),`MM-dd HH:mm`)})]},e.id))})]})})}),r===`quality`&&(0,R.jsxs)(X,{children:[(0,R.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,R.jsxs)(`p`,{className:`text-sm text-gray-600`,children:[`共 `,C.quality.total,` 个质量问题`]})}),(0,R.jsx)(`div`,{className:`overflow-x-auto`,children:(0,R.jsxs)(`table`,{className:`w-full`,children:[(0,R.jsx)(`thead`,{children:(0,R.jsxs)(`tr`,{className:`text-left text-sm text-gray-600`,children:[(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`问题`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`级别`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`分类`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`状态`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`,children:`时间`}),(0,R.jsx)(`th`,{className:`pb-3 font-medium`})]})}),(0,R.jsx)(`tbody`,{className:`text-sm`,children:C.quality.items.map(e=>(0,R.jsxs)(`tr`,{className:`border-t border-gray-50 hover:bg-blue-50 transition-colors`,children:[(0,R.jsx)(`td`,{className:`py-3 max-w-xs truncate`,children:e.message}),(0,R.jsx)(`td`,{className:`py-3`,children:(0,R.jsx)(Hde,{level:e.level})}),(0,R.jsx)(`td`,{className:`py-3`,children:(0,R.jsx)(Ude,{category:e.category})}),(0,R.jsx)(`td`,{className:`py-3`,children:(0,R.jsx)(fS,{size:`sm`,variant:e.resolved?`success`:`default`,children:e.resolved?`已解决`:`未解决`})}),(0,R.jsx)(`td`,{className:`py-3 text-gray-500`,children:x4(Df(e.created_at),`MM-dd HH:mm`)}),(0,R.jsx)(`td`,{className:`py-3`,children:!e.resolved&&(0,R.jsxs)(`button`,{onClick:()=>x(e.id),className:`flex items-center gap-1 px-2 py-1 text-xs text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors`,title:`复制上下文到剪贴板`,children:[y===e.id?(0,R.jsx)(Rs,{className:`h-3.5 w-3.5 text-green-500`}):(0,R.jsx)(Qs,{className:`h-3.5 w-3.5`}),y===e.id?`已复制`:`复制`]})})]},e.id))})]})})]}),r===`knowledge`&&(0,R.jsx)(X,{children:(0,R.jsx)(`div`,{className:`space-y-3`,children:C.knowledge.items.map(e=>(0,R.jsx)(`div`,{className:`p-4 border border-gray-100 rounded-lg hover:bg-blue-50 cursor-pointer transition-colors`,children:(0,R.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,R.jsx)(cc,{className:`h-5 w-5 text-blue-500 flex-shrink-0 mt-0.5`}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsx)(`h4`,{className:`font-medium text-gray-900 mb-1`,children:e.title}),(0,R.jsxs)(`p`,{className:`text-sm text-gray-600 line-clamp-2`,children:[e.content?.substring(0,150),`...`]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-gray-400`,children:[(0,R.jsx)(fS,{size:`sm`,children:e.node_type}),(0,R.jsxs)(`span`,{children:[`更新于 `,x4(Df(e.updated_at),`MM-dd HH:mm`)]})]})]})]})},e.id))})}),r===`rules`&&(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsx)(X,{title:`意图识别规则`,children:(0,R.jsx)(`div`,{className:`space-y-2`,children:C.rules.intentRules.slice(0,10).map(e=>(0,R.jsx)(`div`,{className:`flex items-center justify-between p-3 border border-gray-100 rounded-lg`,children:(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(fS,{size:`sm`,children:e.rule_type}),(0,R.jsx)(`code`,{className:`text-xs text-gray-600`,children:e.pattern})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3 mt-1 text-xs text-gray-400`,children:[(0,R.jsxs)(`span`,{children:[`命中 `,e.hit_count,` 次`]}),(0,R.jsxs)(`span`,{children:[`置信度 `,(e.confidence*100).toFixed(0),`%`]})]})]})},e.id))})}),(0,R.jsx)(X,{title:`任务模式`,children:(0,R.jsx)(`div`,{className:`space-y-2`,children:C.rules.taskPatterns.slice(0,10).map(e=>(0,R.jsxs)(`div`,{className:`p-3 border border-gray-100 rounded-lg`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,R.jsx)(fS,{size:`sm`,children:e.task_type}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-gray-500`,children:[(0,R.jsx)(Yc,{className:`h-3 w-3`}),(0,R.jsxs)(`span`,{children:[`效果 `,(e.effectiveness_score*100).toFixed(0),`%`]})]})]}),(0,R.jsx)(`p`,{className:`text-sm text-gray-600 mb-1`,children:e.failure_pattern}),(0,R.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[`策略:`,e.prevention_strategy]})]},e.id))})})]}),r===`convention`&&e&&(0,R.jsx)(Gde,{encodedPath:S}),r===`claudemd`&&(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(cc,{className:`h-5 w-5 text-blue-500`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`font-medium text-gray-900`,children:`CLAUDE.md`}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500`,children:D?.exists?`${(D.size/1024).toFixed(1)} KB · ${D.hasAutoSection?`含自动区块`:`纯用户内容`}`:`文件不存在`})]})]}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:Pc,onClick:()=>n.invalidateQueries({queryKey:[`claudemd`,e]}),children:`刷新`}),D?.exists&&(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:tl,onClick:()=>{m(null),j.mutate()},disabled:j.isPending,title:`AI 蒸馏:压缩冗余内容,保留核心规范`,children:j.isPending?`蒸馏中...`:`蒸馏`}),D?.exists&&!l&&(0,R.jsx)(Y,{size:`sm`,icon:kc,onClick:()=>{f(D.content||``),u(!0)},children:`编辑`})]})]})}),p&&(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsx)(`p`,{className:`text-sm ${p.success?`text-gray-900`:`text-red-600`}`,children:p.message}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:el,onClick:()=>m(null)})]})}),l&&(0,R.jsxs)(X,{children:[(0,R.jsx)(`textarea`,{className:`w-full px-3 py-2 text-sm border border-gray-200 rounded-md font-mono h-96 resize-y`,value:d,onChange:e=>f(e.target.value)}),(0,R.jsxs)(`div`,{className:`flex gap-2 justify-end mt-3`,children:[(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:el,onClick:()=>u(!1),children:`取消`}),(0,R.jsx)(Y,{size:`sm`,icon:zs,onClick:()=>A.mutate(d),children:`保存`})]})]}),!l&&D?.exists&&(0,R.jsx)(X,{title:`内容预览`,children:(0,R.jsx)(`pre`,{className:`text-xs text-gray-700 bg-gray-50 p-4 rounded-md overflow-auto max-h-96 whitespace-pre-wrap font-mono`,children:D.content})}),(0,R.jsx)(X,{title:`子模块 (${O?.total??0})`,children:O?.items.length===0?(0,R.jsx)(`p`,{className:`text-sm text-gray-400`,children:`未检测到子模块`}):(0,R.jsx)(`div`,{className:`space-y-2`,children:O?.items.map(e=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between p-3 border border-gray-100 rounded-lg`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(dc,{className:`h-4 w-4 text-gray-400`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,R.jsx)(`p`,{className:`text-xs text-gray-400`,children:e.relativePath})]})]}),(0,R.jsx)(fS,{size:`sm`,variant:e.hasClaudeMd?`success`:`default`,children:e.hasClaudeMd?`已有 CLAUDE.md`:`未生成`})]},e.path))})})]}),r===`environment`&&(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`font-medium text-gray-900 mb-1`,children:`环境检测 & 项目初始化`}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500`,children:`检测项目技术栈、创建 .claude-forge 目录、自动生成 CLAUDE.md(如不存在)`})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 flex-shrink-0`,children:[(0,R.jsx)(Y,{variant:`secondary`,size:`sm`,icon:Rc,onClick:async()=>{te(!0),N(null);try{N((await Ql(S)).data.profile)}catch(e){N({error:String(e)})}finally{te(!1)}},disabled:ee,children:ee?`检测中...`:`环境检测`}),(0,R.jsx)(Y,{size:`sm`,icon:tl,onClick:async()=>{ne(!0),ie(null);try{let t=await tu(S);ie({success:t.data.success,message:t.data.message,claudeMdGenerated:t.data.claudeMdGenerated}),N(t.data.profile),n.invalidateQueries({queryKey:[`claudemd`,e]}),n.invalidateQueries({queryKey:[`project`,e]})}catch(e){ie({success:!1,message:String(e)})}finally{ne(!1)}},disabled:P,children:P?`初始化中...`:`一键初始化`}),(0,R.jsx)(Y,{size:`sm`,icon:cc,onClick:async()=>{F(!0),oe(null);try{let t=await Ul(S);oe({success:t.data.success,message:t.data.message}),t.data.skipped||(n.invalidateQueries({queryKey:[`conventions`,e]}),n.invalidateQueries({queryKey:[`claudemd`,e]}))}catch(e){oe({success:!1,message:String(e)})}finally{F(!1)}},disabled:ae,children:ae?`生成中...`:`初始化规范`})]})]})}),re&&(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-2`,children:[re.success?(0,R.jsx)(zs,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,R.jsx)(el,{className:`h-4 w-4 text-red-500 mt-0.5 flex-shrink-0`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-sm font-medium ${re.success?`text-gray-900`:`text-red-600`}`,children:re.message}),re.claudeMdGenerated&&(0,R.jsx)(`p`,{className:`text-xs text-green-600 mt-0.5`,children:`CLAUDE.md 已自动生成`})]})]}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:el,onClick:()=>ie(null)})]})}),I&&(0,R.jsx)(X,{children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-2`,children:[I.success?(0,R.jsx)(zs,{className:`h-4 w-4 text-green-500 mt-0.5 flex-shrink-0`}):(0,R.jsx)(el,{className:`h-4 w-4 text-red-500 mt-0.5 flex-shrink-0`}),(0,R.jsx)(`p`,{className:q(`text-sm font-medium`,I.success?`text-gray-900`:`text-red-600`),children:I.message})]}),(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,icon:el,onClick:()=>oe(null)})]})}),M&&!(`error`in M)&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(X,{title:`技术栈`,children:(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 text-sm`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`项目名称`}),(0,R.jsx)(`p`,{className:`font-medium text-gray-900`,children:M.projectName})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`包管理器`}),(0,R.jsx)(`p`,{className:`font-medium text-gray-900`,children:M.packageManager||`未检测到`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`测试框架`}),(0,R.jsx)(`p`,{className:`font-medium text-gray-900`,children:M.testFramework||`未检测到`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`构建工具`}),(0,R.jsx)(`p`,{className:`font-medium text-gray-900`,children:M.buildTool||`未检测到`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`Linter`}),(0,R.jsx)(`p`,{className:`font-medium text-gray-900`,children:M.linter||`未检测到`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mb-1`,children:`Formatter`}),(0,R.jsx)(`p`,{className:`font-medium text-gray-900`,children:M.formatter||`未检测到`})]})]})}),M.languages.length>0&&(0,R.jsx)(X,{title:`检测到的语言`,children:(0,R.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:M.languages.map((e,t)=>(0,R.jsxs)(fS,{size:`sm`,children:[e.name,e.version?` ${e.version}`:``]},t))})}),M.frameworks.length>0&&(0,R.jsx)(X,{title:`检测到的框架`,children:(0,R.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:M.frameworks.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1 bg-blue-50 rounded-md`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-blue-700`,children:e.name}),(0,R.jsx)(`span`,{className:`text-xs text-blue-400`,children:e.category})]},t))})}),Object.keys(M.scripts).length>0&&(0,R.jsx)(X,{title:`常用脚本`,children:(0,R.jsx)(`div`,{className:`space-y-1`,children:Object.entries(M.scripts).map(([e,t])=>(0,R.jsxs)(`div`,{className:`flex items-start gap-3 text-sm py-1 border-b border-gray-50 last:border-0`,children:[(0,R.jsx)(`span`,{className:`font-mono text-blue-600 flex-shrink-0 w-24`,children:e}),(0,R.jsx)(`span`,{className:`text-gray-600 font-mono text-xs break-all`,children:t})]},e))})}),M.keyDirectories.length>0&&(0,R.jsx)(X,{title:`关键目录`,children:(0,R.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:M.keyDirectories.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1 bg-gray-50 rounded-md`,children:[(0,R.jsx)(dc,{className:`h-3.5 w-3.5 text-gray-400`}),(0,R.jsx)(`span`,{className:`text-sm text-gray-700 font-mono`,children:e})]},t))})})]}),M&&`error`in M&&(0,R.jsx)(X,{children:(0,R.jsxs)(`p`,{className:`text-sm text-red-600`,children:[`检测失败:`,M.error]})})]})]})}function Gde({encodedPath:e}){let[t,n]=(0,L.useState)(`bindings`),[r,i]=(0,L.useState)(!1),[a,o]=(0,L.useState)(``),[s,c]=(0,L.useState)(!1),l=Ye(),{data:u,isLoading:d}=ut({queryKey:[`project-conventions`,e],queryFn:()=>Wl(e).then(e=>e.data)}),{data:f}=ut({queryKey:[`global-conventions`],queryFn:()=>Lu().then(e=>e.data),enabled:r}),{data:p}=ut({queryKey:[`project-custom-yaml`,e],queryFn:()=>ql(e).then(e=>e.data),enabled:s}),m=z({mutationFn:t=>Gl(e,t).then(e=>e.data),onSuccess:t=>{H(`已绑定:${t.convention.name}`,`success`),i(!1),l.invalidateQueries({queryKey:[`project-conventions`,e]})}}),h=z({mutationFn:t=>Kl(e,t).then(e=>e.data),onSuccess:()=>{H(`已解绑`,`success`),l.invalidateQueries({queryKey:[`project-conventions`,e]})}}),g=z({mutationFn:()=>Yl(e).then(e=>e.data),onSuccess:t=>{H(t.isIncremental?`增量蒸馏完成,版本 ${t.convention.version}`:`蒸馏完成,生成 ${t.convention.name}`,`success`),l.invalidateQueries({queryKey:[`project-conventions`,e]}),n(`custom`)}}),_=z({mutationFn:t=>Jl(e,t).then(e=>e.data),onSuccess:()=>{H(`保存成功`,`success`),c(!1),l.invalidateQueries({queryKey:[`project-conventions`,e]})}}),v=u?.bindings||[],y=u?.custom,b=(f?.items||[]).filter(e=>!v.some(t=>t.id===e.id)),x={official:`bg-amber-50 text-amber-700`,user:`bg-blue-50 text-blue-700`,community:`bg-purple-50 text-purple-700`},S={official:`官方`,user:`用户`,community:`社区`};return d?(0,R.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,R.jsx)(Pc,{className:`h-6 w-6 animate-spin text-blue-500`})}):(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsx)(`div`,{className:`flex gap-1 bg-gray-100 rounded-lg p-1`,children:[`bindings`,`custom`].map(e=>(0,R.jsx)(`button`,{onClick:()=>n(e),className:`px-4 py-1.5 text-sm font-medium rounded-md transition-colors flex items-center gap-1.5 ${t===e?`bg-white text-gray-900 shadow-sm`:`text-gray-500 hover:text-gray-700`}`,children:e===`bindings`?`绑定的规范 (${v.length})`:(0,R.jsxs)(R.Fragment,{children:[`蒸馏规范`,y&&(0,R.jsx)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700`,children:`实际生效`})]})},e))}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[t===`bindings`&&(0,R.jsxs)(`button`,{onClick:()=>i(!r),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,R.jsx)(bc,{className:`h-3.5 w-3.5`}),`绑定规范`]}),t===`custom`&&(0,R.jsxs)(`button`,{onClick:()=>g.mutate(),disabled:g.isPending||v.length===0,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 transition-colors`,title:v.length===0?`请先绑定至少一个规范`:``,children:[(0,R.jsx)(tl,{className:`h-3.5 w-3.5 ${g.isPending?`animate-pulse`:``}`}),g.isPending?`蒸馏中...`:y?`重新蒸馏`:`生成蒸馏规范`]})]})]}),r&&(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-blue-200 p-4 space-y-3`,children:[(0,R.jsx)(`div`,{className:`text-sm font-medium text-gray-700`,children:`从全局规范库选择绑定`}),b.length===0?(0,R.jsx)(`p`,{className:`text-sm text-gray-400`,children:`所有全局规范已全部绑定`}):(0,R.jsx)(`div`,{className:`grid gap-2`,children:b.map(e=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between p-3 bg-gray-50 rounded-lg`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-gray-900`,children:e.name}),(0,R.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded-full ${x[e.source]||`bg-gray-100 text-gray-600`}`,children:S[e.source]||e.source}),(0,R.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,e.version]})]}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:e.description})]}),(0,R.jsx)(`button`,{onClick:()=>m.mutate(e.id),disabled:m.isPending,className:`px-3 py-1.5 text-xs bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:`绑定`})]},e.id))}),(0,R.jsx)(`button`,{onClick:()=>i(!1),className:`text-xs text-gray-400 hover:text-gray-600`,children:`关闭`})]}),t===`bindings`&&(0,R.jsx)(`div`,{className:`space-y-3`,children:v.length===0?(0,R.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,R.jsx)(Ms,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,R.jsx)(`p`,{className:`text-gray-500 text-sm`,children:`尚未绑定任何规范`}),(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`点击「绑定规范」从全局规范库选择`})]}):v.map(e=>(0,R.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,R.jsx)(`span`,{className:`font-medium text-gray-900`,children:e.name}),(0,R.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded-full font-medium ${x[e.source]||`bg-gray-100 text-gray-600`}`,children:S[e.source]||e.source}),(0,R.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,e.version]})]}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500`,children:e.description}),(0,R.jsxs)(`div`,{className:`flex gap-3 mt-2 text-xs text-gray-400`,children:[(0,R.jsxs)(`span`,{children:[e.roles?Object.keys(e.roles).length:0,` 个角色`]}),(0,R.jsxs)(`span`,{children:[e.quality_standards?.length||0,` 条质量标准`]})]})]}),(0,R.jsx)(`button`,{onClick:()=>h.mutate(e.id),disabled:h.isPending,className:`ml-4 p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`解绑`,children:(0,R.jsx)(el,{className:`h-4 w-4`})})]})},e.id))}),t===`custom`&&(0,R.jsx)(`div`,{className:`space-y-4`,children:y?(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-4 border-b border-gray-100`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-gray-900`,children:y.name}),(0,R.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`v`,y.version]}),(0,R.jsx)(`span`,{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700 border border-green-200`,children:`项目真实规范`})]}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:y.description})]}),!s&&(0,R.jsxs)(`button`,{onClick:()=>{o(p?.yaml||``),c(!0)},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-gray-100 text-gray-700 hover:bg-gray-200 rounded-lg transition-colors`,children:[(0,R.jsx)(kc,{className:`h-3.5 w-3.5`}),`编辑 YAML`]})]}),(0,R.jsx)(`div`,{className:`p-5`,children:s?(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsx)(`textarea`,{value:a||p?.yaml||``,onChange:e=>o(e.target.value),rows:24,className:`w-full px-3 py-2 text-xs border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono`}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsxs)(`button`,{onClick:()=>_.mutate(a),disabled:_.isPending,className:`flex items-center gap-1.5 px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[(0,R.jsx)(Ic,{className:`h-3.5 w-3.5`}),_.isPending?`保存中...`:`保存`]}),(0,R.jsx)(`button`,{onClick:()=>c(!1),className:`px-4 py-2 text-sm bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}):(0,R.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[y.principles&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:`核心原则`}),(0,R.jsx)(`pre`,{className:`text-xs text-gray-700 bg-gray-50 rounded-lg p-3 whitespace-pre-wrap border border-gray-100 max-h-48 overflow-y-auto`,children:typeof y.principles==`string`?y.principles:JSON.stringify(y.principles,null,2)})]}),y.quality_standards&&y.quality_standards.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:[`质量标准 (`,y.quality_standards.length,`)`]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[y.quality_standards.slice(0,5).map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-gray-600`,children:[(0,R.jsx)(`span`,{className:`mt-0.5 px-1.5 py-0.5 rounded text-xs font-medium ${e.severity===`must`?`bg-red-50 text-red-600`:e.severity===`should`?`bg-yellow-50 text-yellow-600`:`bg-gray-100 text-gray-500`}`,children:e.severity||`rule`}),(0,R.jsx)(`span`,{children:e.rule||String(e)})]},t)),y.quality_standards.length>5&&(0,R.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[`...还有 `,y.quality_standards.length-5,` 条`]})]})]})]})})]}):(0,R.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,R.jsx)(tl,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,R.jsx)(`p`,{className:`text-gray-500 text-sm`,children:`尚未生成蒸馏规范`}),(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:v.length>0?`点击「生成蒸馏规范」将绑定的规范融合为项目专属规范`:`请先绑定至少一个规范,再生成蒸馏规范`})]})})]})}var C9={local:`bg-blue-50 text-blue-700`,remote:`bg-purple-50 text-purple-700`,generated:`bg-green-50 text-green-700`,official:`bg-amber-50 text-amber-700`,user:`bg-pink-50 text-pink-700`},w9={local:`本地`,remote:`远程`,generated:`AI生成`,official:`官方`,user:`用户`};function Kde(){let[e,t]=(0,L.useState)(`list`),[n,r]=(0,L.useState)(``),[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(new Set),[c,l]=(0,L.useState)(``),[u,d]=(0,L.useState)(null),[f,p]=(0,L.useState)(!1),[m,h]=(0,L.useState)(null),[g,_]=(0,L.useState)({open:!1,title:``,description:``,onConfirm:()=>{}}),v=Ye(),{data:y,isLoading:b}=ut({queryKey:[`skills`,n,i],queryFn:()=>Cu({source:n||void 0,tag:i||void 0}).then(e=>e.data),refetchInterval:3e4}),{data:x}=ut({queryKey:[`skills-status`],queryFn:()=>wu().then(e=>e.data),refetchInterval:3e4}),S=z({mutationFn:e=>Du(e).then(e=>e.data),onSuccess:e=>{d(e),H(`找到 ${e.github.length+e.npm.length} 个结果`,`success`)}}),C=z({mutationFn:e=>Ou(e).then(e=>e.data),onSuccess:e=>{H(`已安装: ${e.skill.name}`,`success`),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),w=z({mutationFn:e=>ku(e).then(e=>e.data),onSuccess:(e,t)=>{H(`已删除: ${t}`,`success`),s(e=>{let n=new Set(e);return n.delete(t),n}),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),T=z({mutationFn:e=>Au(e).then(e=>e.data),onSuccess:e=>{H(`已删除 ${e.success.length} 个技能`,`success`),s(new Set),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),E=z({mutationFn:()=>ju().then(e=>e.data),onSuccess:e=>{H(`进化完成:${e.repaired.length+e.retired.length+e.optimized.length+e.generated.length} 项变更`,`success`),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),D=z({mutationFn:()=>Mu().then(e=>e.data),onSuccess:e=>{H(`蒸馏完成:新增 ${e.distilled.length} 个技能`,`success`),v.invalidateQueries({queryKey:[`skills`]}),v.invalidateQueries({queryKey:[`skills-status`]})}}),O=z({mutationFn:()=>Nu().then(e=>e.data),onSuccess:e=>{H(`修复完成:${e.repaired.length} 个技能已修复`,`success`),v.invalidateQueries({queryKey:[`skills`]})}}),k=y?.items||[],A=k.length>0&&o.size===k.length,j=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`技能管理`}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`管理 Claude Code 技能库,搜索安装、进化优化`})]}),x&&(0,R.jsx)(`div`,{className:`flex items-center gap-3`,children:[{label:`全部`,value:x.total,color:`text-gray-700`},{label:`官方`,value:x.official,color:`text-amber-600`},{label:`本地`,value:x.local,color:`text-blue-600`},{label:`AI生成`,value:x.generated,color:`text-green-600`}].map(({label:e,value:t,color:n})=>(0,R.jsxs)(`div`,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:q(`text-xl font-bold`,n),children:t}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500`,children:e})]},e))})]}),(0,R.jsx)(`div`,{className:`border-b border-gray-200`,children:(0,R.jsx)(`nav`,{className:`flex gap-1`,children:[{key:`list`,label:`技能列表`},{key:`search`,label:`搜索安装`},{key:`evolve`,label:`进化管理`},{key:`sources`,label:`技能源`}].map(n=>(0,R.jsx)(`button`,{onClick:()=>t(n.key),className:q(`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors`,e===n.key?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`),children:n.label},n.key))})}),e===`list`&&(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsxs)(`button`,{onClick:()=>p(!f),className:q(`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg transition-colors`,f?`bg-blue-50 text-blue-600`:`text-gray-600 hover:bg-gray-50`),children:[(0,R.jsx)(fc,{className:`h-4 w-4`}),`筛选`,(0,R.jsx)(Bs,{className:q(`h-3.5 w-3.5 transition-transform`,f&&`rotate-180`)})]}),(0,R.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[k.length,` 个技能`]}),o.size>0&&(0,R.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,R.jsxs)(`span`,{className:`text-sm text-gray-600`,children:[`已选 `,o.size,` 个`]}),(0,R.jsxs)(`button`,{onClick:()=>{_({open:!0,title:`批量删除技能`,description:`确定要删除选中的 ${o.size} 个技能吗?此操作不可恢复。`,count:o.size,onConfirm:()=>{T.mutate(Array.from(o)),_(e=>({...e,open:!1}))}})},disabled:T.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-red-50 text-red-600 hover:bg-red-100 rounded-lg transition-colors`,children:[(0,R.jsx)(Jc,{className:`h-3.5 w-3.5`}),`批量删除`]})]})]}),f&&(0,R.jsxs)(`div`,{className:`flex gap-3 mt-3 pt-3 border-t border-gray-100`,children:[(0,R.jsxs)(`select`,{value:n,onChange:e=>r(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:``,children:`全部来源`}),(0,R.jsx)(`option`,{value:`local`,children:`本地`}),(0,R.jsx)(`option`,{value:`official`,children:`官方`}),(0,R.jsx)(`option`,{value:`remote`,children:`远程`}),(0,R.jsx)(`option`,{value:`generated`,children:`AI生成`}),(0,R.jsx)(`option`,{value:`user`,children:`用户`})]}),(0,R.jsx)(`input`,{type:`text`,placeholder:`按标签筛选...`,value:i,onChange:e=>a(e.target.value),className:`px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]})]}),b?(0,R.jsx)(`div`,{className:`flex items-center justify-center h-48`,children:(0,R.jsx)(Sc,{className:`h-8 w-8 animate-spin text-blue-500`})}):(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,R.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,R.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`th`,{className:`w-10 px-4 py-3`,children:(0,R.jsx)(`input`,{type:`checkbox`,checked:A,onChange:()=>{s(A?new Set:new Set(k.map(e=>e.name)))},className:`rounded`})}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`技能名称`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`版本`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`调用次数`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`成功率`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`最近使用`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,R.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:k.map(e=>(0,R.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,R.jsx)(`td`,{className:`px-4 py-3`,children:(0,R.jsx)(`input`,{type:`checkbox`,checked:o.has(e.name),onChange:()=>j(e.name),className:`rounded`})}),(0,R.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,R.jsx)(`button`,{onClick:()=>h(e.name),className:`font-medium text-blue-600 hover:text-blue-700 cursor-pointer`,children:e.name}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500 truncate max-w-xs`,children:e.description}),e.tags&&e.tags.length>0&&(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:e.tags.map(e=>(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-gray-100 text-gray-600 text-xs rounded`,children:[(0,R.jsx)(Gc,{className:`h-2.5 w-2.5`}),e]},e))})]}),(0,R.jsx)(`td`,{className:`px-4 py-3`,children:(0,R.jsx)(`span`,{className:q(`px-2 py-0.5 text-xs rounded-full font-medium`,C9[e.source]||`bg-gray-100 text-gray-600`),children:w9[e.source]||e.source})}),(0,R.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.version}),(0,R.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.stats.callCount}),(0,R.jsx)(`td`,{className:`px-4 py-3`,children:e.stats.callCount>0?(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`div`,{className:`w-16 h-1.5 bg-gray-200 rounded-full overflow-hidden`,children:(0,R.jsx)(`div`,{className:q(`h-full rounded-full`,e.stats.successRate>=.8?`bg-green-500`:e.stats.successRate>=.5?`bg-yellow-500`:`bg-red-500`),style:{width:`${e.stats.successRate*100}%`}})}),(0,R.jsxs)(`span`,{className:`text-xs text-gray-600`,children:[(e.stats.successRate*100).toFixed(0),`%`]})]}):(0,R.jsx)(`span`,{className:`text-xs text-gray-400`,children:`未使用`})}),(0,R.jsx)(`td`,{className:`px-4 py-3 text-xs text-gray-500`,children:e.stats.lastUsed?new Date(e.stats.lastUsed).toLocaleDateString(`zh-CN`):`—`}),(0,R.jsx)(`td`,{className:`px-4 py-3`,children:(0,R.jsx)(`button`,{onClick:()=>{_({open:!0,title:`删除技能`,description:`确定要删除技能 "${e.name}" 吗?此操作不可恢复。`,onConfirm:()=>{w.mutate(e.name),_(e=>({...e,open:!1}))}})},disabled:w.isPending,className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`删除`,children:(0,R.jsx)(Jc,{className:`h-4 w-4`})})})]},e.name))})]}),k.length===0&&(0,R.jsxs)(`div`,{className:`text-center py-12`,children:[(0,R.jsx)(Dc,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,R.jsx)(`p`,{className:`text-gray-500`,children:`暂无技能`})]})]}),x&&(x.topUsed.length>0||x.topRated.length>0)&&(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[x.topUsed.length>0&&(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,R.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2`,children:[(0,R.jsx)(Yc,{className:`h-4 w-4 text-blue-500`}),`最常用技能`]}),(0,R.jsx)(`div`,{className:`space-y-2`,children:x.topUsed.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-xs text-gray-400 w-4`,children:t+1}),(0,R.jsx)(`span`,{className:`text-gray-700`,children:e.name})]}),(0,R.jsxs)(`span`,{className:`text-gray-500`,children:[e.calls,` 次`]})]},e.name))})]}),x.topRated.length>0&&(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,R.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2`,children:[(0,R.jsx)(Ks,{className:`h-4 w-4 text-green-500`}),`评分最高技能`]}),(0,R.jsx)(`div`,{className:`space-y-2`,children:x.topRated.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-xs text-gray-400 w-4`,children:t+1}),(0,R.jsx)(`span`,{className:`text-gray-700`,children:e.name})]}),(0,R.jsxs)(`span`,{className:`text-gray-500`,children:[(e.rating*100).toFixed(0),`%`]})]},e.name))})]})]})]}),e===`search`&&(0,R.jsx)(Jde,{searchQuery:c,setSearchQuery:l,searchResults:u,onSearch:()=>S.mutate(c),onInstall:e=>C.mutate(e),isSearching:S.isPending,isInstalling:C.isPending}),e===`evolve`&&(0,R.jsx)(Yde,{onEvolve:()=>E.mutate(),onDistill:()=>D.mutate(),onRepair:()=>O.mutate(),isEvolving:E.isPending,isDistilling:D.isPending,isRepairing:O.isPending,evolveResult:E.data,distillResult:D.data,repairResult:O.data}),e===`sources`&&(0,R.jsx)(Xde,{}),m&&(0,R.jsx)(qde,{name:m,onClose:()=>h(null)}),(0,R.jsx)(w4,{open:g.open,title:g.title,description:g.description,count:g.count,onConfirm:g.onConfirm,onCancel:()=>_(e=>({...e,open:!1}))})]})}function qde({name:e,onClose:t}){let[n,r]=(0,L.useState)(`content`),[i,a]=(0,L.useState)(!1),[o,s]=(0,L.useState)(``),[c,l]=(0,L.useState)(``),u=Ye(),{data:d,isLoading:f}=ut({queryKey:[`skill-detail`,e],queryFn:()=>Tu(e).then(e=>e.data)}),{data:p}=ut({queryKey:[`orchestration-mappings`],queryFn:()=>Pu().then(e=>e.data),enabled:n===`orchestration`}),m=p?.items.find(t=>t.skill===e),[h,g]=(0,L.useState)([]),_=m?.keywords??[],v=z({mutationFn:t=>Eu(e,t),onSuccess:()=>{H(`技能内容已保存`,`success`),a(!1),u.invalidateQueries({queryKey:[`skill-detail`,e]})},onError:()=>H(`保存失败`,`error`)}),y=z({mutationFn:t=>Fu(e,t),onSuccess:()=>{H(`编排映射已保存`,`success`),u.invalidateQueries({queryKey:[`orchestration-mappings`]})},onError:()=>H(`保存失败`,`error`)}),b=z({mutationFn:()=>Iu(e),onSuccess:()=>{H(`编排映射已删除`,`success`),u.invalidateQueries({queryKey:[`orchestration-mappings`]})}}),[x,S]=(0,L.useState)(null),C=x??_;return(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/40`,onClick:t,children:(0,R.jsxs)(`div`,{className:`bg-white rounded-2xl shadow-2xl w-full max-w-3xl max-h-[85vh] flex flex-col`,onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-6 py-4 border-b border-gray-100`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(Dc,{className:`h-5 w-5 text-blue-500`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold text-gray-900`,children:e}),d&&(0,R.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:d.description})]})]}),(0,R.jsx)(`button`,{onClick:t,className:`p-1.5 text-gray-400 hover:text-gray-600 rounded-lg transition-colors`,children:(0,R.jsx)(el,{className:`h-5 w-5`})})]}),(0,R.jsx)(`div`,{className:`flex gap-1 px-6 pt-3 border-b border-gray-100`,children:[`content`,`stats`,`orchestration`].map(e=>(0,R.jsx)(`button`,{onClick:()=>r(e),className:`px-3 py-1.5 text-sm font-medium border-b-2 transition-colors ${n===e?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`}`,children:e===`content`?`技能内容`:e===`stats`?`使用情况`:`编排映射`},e))}),(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto px-6 py-5`,children:f?(0,R.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,R.jsx)(Sc,{className:`h-6 w-6 animate-spin text-blue-500`})}):d?n===`content`?(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,R.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full font-medium ${C9[d.source]||`bg-gray-100 text-gray-600`}`,children:w9[d.source]||d.source}),(0,R.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,d.version]}),d.requires?.bins&&d.requires.bins.length>0&&(0,R.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`需要:`,d.requires.bins.join(`, `)]}),d.filePath&&(0,R.jsx)(`span`,{className:`text-xs text-gray-400 font-mono truncate max-w-xs`,children:d.filePath})]}),d.tags&&d.tags.length>0&&(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:d.tags.map(e=>(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 text-xs rounded-full`,children:[(0,R.jsx)(Gc,{className:`h-2.5 w-2.5`}),e]},e))}),d.content||d.filePath?(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`text-xs text-gray-500 mb-2 flex items-center justify-between`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(cc,{className:`h-3.5 w-3.5`}),`技能文件内容`]}),d.filePath&&!i&&(0,R.jsxs)(`button`,{onClick:()=>{s(d.content||``),a(!0)},className:`flex items-center gap-1 text-blue-600 hover:underline`,children:[(0,R.jsx)(kc,{className:`h-3 w-3`}),`编辑`]}),i&&(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`button`,{onClick:()=>a(!1),className:`text-gray-500 hover:text-gray-700 text-xs`,children:`取消`}),(0,R.jsxs)(`button`,{onClick:()=>v.mutate(o),disabled:v.isPending,className:`flex items-center gap-1 text-green-600 hover:underline text-xs`,children:[(0,R.jsx)(Ic,{className:`h-3 w-3`}),v.isPending?`保存中...`:`保存`]})]})]}),i?(0,R.jsx)(`textarea`,{value:o,onChange:e=>s(e.target.value),className:`w-full text-xs text-gray-800 bg-gray-50 rounded-lg p-4 border border-blue-300 focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono leading-relaxed resize-y`,style:{minHeight:`40vh`,maxHeight:`60vh`}}):(0,R.jsx)(`pre`,{className:`text-xs text-gray-800 bg-gray-50 rounded-lg p-4 overflow-auto whitespace-pre-wrap border border-gray-200 max-h-[50vh] leading-relaxed`,children:d.content||`(空文件)`})]}):(0,R.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`暂无文件内容`}),d.sourceUrl&&(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,R.jsx)(rc,{className:`h-3.5 w-3.5 text-gray-400`}),(0,R.jsx)(`a`,{href:d.sourceUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-600 hover:underline truncate`,children:d.sourceUrl})]})]}):n===`stats`?(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,R.jsxs)(`div`,{className:`bg-blue-50 rounded-xl p-4 text-center`,children:[(0,R.jsx)(`div`,{className:`text-2xl font-bold text-blue-700`,children:d.stats.callCount}),(0,R.jsx)(`div`,{className:`text-xs text-blue-600 mt-1`,children:`总调用次数`})]}),(0,R.jsxs)(`div`,{className:`bg-green-50 rounded-xl p-4 text-center`,children:[(0,R.jsx)(`div`,{className:`text-2xl font-bold text-green-700`,children:d.stats.callCount>0?`${(d.stats.successRate*100).toFixed(0)}%`:`—`}),(0,R.jsx)(`div`,{className:`text-xs text-green-600 mt-1`,children:`成功率`})]}),(0,R.jsxs)(`div`,{className:`bg-purple-50 rounded-xl p-4 text-center`,children:[(0,R.jsx)(`div`,{className:`text-2xl font-bold text-purple-700`,children:d.stats.userFeedback.positive+d.stats.userFeedback.negative>0?`${d.stats.userFeedback.positive} / ${d.stats.userFeedback.negative}`:`—`}),(0,R.jsx)(`div`,{className:`text-xs text-purple-600 mt-1`,children:`用户反馈(正向/负向)`})]})]}),d.stats.callCount>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex justify-between text-xs text-gray-500 mb-1.5`,children:[(0,R.jsx)(`span`,{children:`成功率`}),(0,R.jsxs)(`span`,{children:[(d.stats.successRate*100).toFixed(1),`%`]})]}),(0,R.jsx)(`div`,{className:`w-full h-2 bg-gray-200 rounded-full overflow-hidden`,children:(0,R.jsx)(`div`,{className:`h-full rounded-full transition-all ${d.stats.successRate>=.8?`bg-green-500`:d.stats.successRate>=.5?`bg-yellow-500`:`bg-red-500`}`,style:{width:`${d.stats.successRate*100}%`}})})]}),(0,R.jsxs)(`div`,{className:`bg-gray-50 rounded-xl p-4`,children:[(0,R.jsx)(`div`,{className:`text-xs text-gray-500 mb-1`,children:`最近使用时间`}),(0,R.jsx)(`div`,{className:`text-sm font-medium text-gray-900`,children:d.stats.lastUsed?new Date(d.stats.lastUsed).toLocaleString(`zh-CN`):`从未使用`})]}),d.stats.callCount===0&&(0,R.jsx)(`div`,{className:`text-center py-8 text-gray-400 text-sm`,children:`该技能尚未被调用过`})]}):(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(`p`,{className:`text-xs text-gray-500`,children:`配置触发该技能的关键词,当用户输入包含这些关键词时,编排引擎会自动调用此技能。`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide mb-2`,children:`触发关键词`}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-2 min-h-[40px] p-3 bg-gray-50 rounded-lg border border-gray-200`,children:C.length===0?(0,R.jsx)(`span`,{className:`text-xs text-gray-400`,children:`暂无关键词,添加后可触发自动编排`}):C.map((e,t)=>(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 bg-blue-100 text-blue-700 text-xs rounded-full`,children:[e,(0,R.jsx)(`button`,{onClick:()=>S(C.filter((e,n)=>n!==t)),className:`hover:text-red-500 transition-colors`,children:(0,R.jsx)(el,{className:`h-3 w-3`})})]},t))})]}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{if(e.key===`Enter`&&c.trim()){let e=c.trim();C.includes(e)||S([...C,e]),l(``)}},placeholder:`输入关键词,回车添加`,className:`flex-1 px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,R.jsx)(`button`,{onClick:()=>{let e=c.trim();e&&!C.includes(e)&&S([...C,e]),l(``)},disabled:!c.trim(),className:`px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:(0,R.jsx)(Mc,{className:`h-4 w-4`})})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 pt-2`,children:[(0,R.jsxs)(`button`,{onClick:()=>y.mutate(C),disabled:y.isPending||x===null,className:`flex items-center gap-1.5 px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[(0,R.jsx)(Ic,{className:`h-3.5 w-3.5`}),y.isPending?`保存中...`:`保存映射`]}),m&&(0,R.jsxs)(`button`,{onClick:()=>b.mutate(),disabled:b.isPending,className:`flex items-center gap-1.5 px-4 py-2 text-sm bg-red-50 text-red-600 rounded-lg hover:bg-red-100 disabled:opacity-50 transition-colors`,children:[(0,R.jsx)(Jc,{className:`h-3.5 w-3.5`}),`删除映射`]})]})]}):(0,R.jsx)(`div`,{className:`text-center py-16 text-gray-500`,children:`技能不存在`})})]})})}function Jde({searchQuery:e,setSearchQuery:t,searchResults:n,onSearch:r,onInstall:i,isSearching:a,isInstalling:o}){return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:(0,R.jsxs)(`div`,{className:`flex gap-3`,children:[(0,R.jsx)(`input`,{type:`text`,placeholder:`搜索技能(GitHub / npm)...`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>e.key===`Enter`&&r(),className:`flex-1 px-4 py-2.5 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,R.jsxs)(`button`,{onClick:r,disabled:a||!e.trim(),className:`flex items-center gap-2 px-6 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:[a?(0,R.jsx)(Sc,{className:`h-4 w-4 animate-spin`}):(0,R.jsx)(Lc,{className:`h-4 w-4`}),`搜索`]})]})}),n&&(0,R.jsxs)(`div`,{className:`space-y-6`,children:[n.github.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:[`GitHub 结果 (`,n.github.length,`)`]}),(0,R.jsx)(`div`,{className:`grid gap-3`,children:n.github.map((e,t)=>(0,R.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 hover:border-blue-300 transition-colors`,children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,R.jsx)(`h4`,{className:`font-semibold text-gray-900`,children:e.skill.name}),(0,R.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,e.skill.version]})]}),(0,R.jsx)(`p`,{className:`text-sm text-gray-600 mb-2`,children:e.skill.description}),(0,R.jsxs)(`a`,{href:e.sourceUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-xs text-blue-600 hover:underline`,children:[(0,R.jsx)(rc,{className:`h-3 w-3`}),e.sourceUrl]})]}),(0,R.jsxs)(`button`,{onClick:()=>i(e.sourceUrl),disabled:o,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-50 text-blue-600 hover:bg-blue-100 rounded-lg transition-colors`,children:[(0,R.jsx)(nc,{className:`h-3.5 w-3.5`}),`安装`]})]})},t))})]}),n.npm.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:[`npm 结果 (`,n.npm.length,`)`]}),(0,R.jsx)(`div`,{className:`grid gap-3`,children:n.npm.map((e,t)=>(0,R.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 hover:border-purple-300 transition-colors`,children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,R.jsx)(`h4`,{className:`font-semibold text-gray-900`,children:e.skill.name}),(0,R.jsxs)(`span`,{className:`text-xs text-gray-500`,children:[`v`,e.skill.version]})]}),(0,R.jsx)(`p`,{className:`text-sm text-gray-600 mb-2`,children:e.skill.description}),e.installCommand&&(0,R.jsx)(`code`,{className:`text-xs bg-gray-100 px-2 py-1 rounded`,children:e.installCommand})]}),(0,R.jsxs)(`button`,{onClick:()=>i(e.sourceUrl),disabled:o,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-purple-50 text-purple-600 hover:bg-purple-100 rounded-lg transition-colors`,children:[(0,R.jsx)(nc,{className:`h-3.5 w-3.5`}),`安装`]})]})},t))})]}),n.github.length===0&&n.npm.length===0&&(0,R.jsxs)(`div`,{className:`text-center py-12 bg-white rounded-xl border border-gray-200`,children:[(0,R.jsx)(Lc,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,R.jsx)(`p`,{className:`text-gray-500`,children:`未找到匹配的技能`})]})]})]})}function Yde({onEvolve:e,onDistill:t,onRepair:n,isEvolving:r,isDistilling:i,isRepairing:a,evolveResult:o,distillResult:s,repairResult:c}){return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,R.jsx)(`div`,{className:`p-2 bg-blue-50 rounded-lg`,children:(0,R.jsx)(Vc,{className:`h-5 w-5 text-blue-600`})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`技能进化`}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500`,children:`淘汰、优化、生成`})]})]}),(0,R.jsxs)(`button`,{onClick:e,disabled:r,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[r?(0,R.jsx)(Sc,{className:`h-4 w-4 animate-spin`}):(0,R.jsx)(Pc,{className:`h-4 w-4`}),r?`进化中...`:`开始进化`]}),o&&(0,R.jsxs)(`div`,{className:`mt-4 space-y-2 text-sm`,children:[o.repaired?.length>0&&(0,R.jsxs)(`div`,{className:`text-green-600`,children:[`✔ 修复 `,o.repaired.length,` 个`]}),o.retired?.length>0&&(0,R.jsxs)(`div`,{className:`text-red-600`,children:[`- 淘汰 `,o.retired.length,` 个`]}),o.optimized?.length>0&&(0,R.jsxs)(`div`,{className:`text-blue-600`,children:[`↑ 优化 `,o.optimized.length,` 个`]}),o.generated?.length>0&&(0,R.jsxs)(`div`,{className:`text-green-600`,children:[`+ 生成 `,o.generated.length,` 个`]})]})]}),(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,R.jsx)(`div`,{className:`p-2 bg-purple-50 rounded-lg`,children:(0,R.jsx)(nc,{className:`h-5 w-5 text-purple-600`})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`社区蒸馏`}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500`,children:`从精选源采集`})]})]}),(0,R.jsxs)(`button`,{onClick:t,disabled:i,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 transition-colors`,children:[i?(0,R.jsx)(Sc,{className:`h-4 w-4 animate-spin`}):(0,R.jsx)(nc,{className:`h-4 w-4`}),i?`蒸馏中...`:`开始蒸馏`]}),s&&s.distilled?.length>0&&(0,R.jsxs)(`div`,{className:`mt-4 text-sm text-purple-600`,children:[`✦ 新增 `,s.distilled.length,` 个技能`]})]}),(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,R.jsx)(`div`,{className:`p-2 bg-amber-50 rounded-lg`,children:(0,R.jsx)($c,{className:`h-5 w-5 text-amber-600`})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:`修复残缺`}),(0,R.jsx)(`p`,{className:`text-xs text-gray-500`,children:`AI 修复低质量技能`})]})]}),(0,R.jsxs)(`button`,{onClick:n,disabled:a,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-amber-600 text-white rounded-lg hover:bg-amber-700 disabled:opacity-50 transition-colors`,children:[a?(0,R.jsx)(Sc,{className:`h-4 w-4 animate-spin`}):(0,R.jsx)($c,{className:`h-4 w-4`}),a?`修复中...`:`开始修复`]}),c&&c.repaired?.length>0&&(0,R.jsxs)(`div`,{className:`mt-4 text-sm text-amber-600`,children:[`✔ 修复 `,c.repaired.length,` 个技能`]})]})]}),(0,R.jsxs)(`div`,{className:`bg-blue-50 rounded-xl border border-blue-200 p-4`,children:[(0,R.jsx)(`h4`,{className:`text-sm font-semibold text-blue-900 mb-2`,children:`进化机制说明`}),(0,R.jsxs)(`ul`,{className:`text-sm text-blue-700 space-y-1`,children:[(0,R.jsxs)(`li`,{children:[`• `,(0,R.jsx)(`strong`,{children:`技能进化`}),`:根据使用统计自动淘汰低效技能、优化高频技能、生成新技能`]}),(0,R.jsxs)(`li`,{children:[`• `,(0,R.jsx)(`strong`,{children:`社区蒸馏`}),`:从 GitHub 精选仓库采集优质技能并蒸馏为官方技能`]}),(0,R.jsxs)(`li`,{children:[`• `,(0,R.jsx)(`strong`,{children:`修复残缺`}),`:检测并修复缺少描述、版本号或格式错误的技能文件`]})]})]})]})}function Xde(){let e=Ye(),[t,n]=(0,L.useState)(!1),[r,i]=(0,L.useState)({repo:``,dir:``,branch:`main`,format:`command-md`,description:``}),{data:a}=ut({queryKey:[`skill-sources`],queryFn:()=>U.get(`/skills/sources`).then(e=>e.data)}),o=z({mutationFn:e=>U.post(`/skills/sources`,e).then(e=>e.data),onSuccess:()=>{H(`技能源已添加`,`success`),n(!1),i({repo:``,dir:``,branch:`main`,format:`command-md`,description:``}),e.invalidateQueries({queryKey:[`skill-sources`]})}}),s=z({mutationFn:e=>U.delete(`/skills/sources/${encodeURIComponent(e)}`).then(e=>e.data),onSuccess:()=>{H(`技能源已删除`,`success`),e.invalidateQueries({queryKey:[`skill-sources`]})}}),c=a?.builtIn||[],l=a?.user||[];return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(`div`,{className:`flex justify-end`,children:(0,R.jsxs)(`button`,{onClick:()=>n(!t),className:`flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:[(0,R.jsx)(nc,{className:`h-4 w-4`}),`添加技能源`]})}),t&&(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:[(0,R.jsx)(`h3`,{className:`font-semibold text-gray-900 mb-4`,children:`添加自定义技能源`}),(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,R.jsx)(`input`,{type:`text`,placeholder:`仓库 (owner/repo)`,value:r.repo,onChange:e=>i({...r,repo:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,R.jsx)(`input`,{type:`text`,placeholder:`目录路径`,value:r.dir,onChange:e=>i({...r,dir:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,R.jsx)(`input`,{type:`text`,placeholder:`分支 (默认 main)`,value:r.branch,onChange:e=>i({...r,branch:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,R.jsxs)(`select`,{value:r.format,onChange:e=>i({...r,format:e.target.value}),className:`px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:`command-md`,children:`command-md`}),(0,R.jsx)(`option`,{value:`skill-md`,children:`skill-md`})]}),(0,R.jsx)(`input`,{type:`text`,placeholder:`描述`,value:r.description,onChange:e=>i({...r,description:e.target.value}),className:`col-span-2 px-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 mt-4`,children:[(0,R.jsx)(`button`,{onClick:()=>o.mutate(r),disabled:!r.repo||!r.dir||o.isPending,className:`px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:o.isPending?`添加中...`:`确认添加`}),(0,R.jsx)(`button`,{onClick:()=>n(!1),className:`px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:`内置技能源`}),(0,R.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 divide-y divide-gray-100`,children:c.map((e,t)=>(0,R.jsxs)(`div`,{className:`p-4 flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`font-medium text-gray-900`,children:[e.repo,`/`,e.dir]}),(0,R.jsx)(`div`,{className:`text-sm text-gray-500`,children:e.description})]}),(0,R.jsx)(`span`,{className:`px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded`,children:`内置`})]},t))})]}),l.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-3`,children:`用户自定义源`}),(0,R.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 divide-y divide-gray-100`,children:l.map((e,t)=>(0,R.jsxs)(`div`,{className:`p-4 flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`font-medium text-gray-900`,children:[e.repo,`/`,e.dir]}),(0,R.jsx)(`div`,{className:`text-sm text-gray-500`,children:e.description})]}),(0,R.jsx)(`button`,{onClick:()=>s.mutate(e.repo),disabled:s.isPending,className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,children:(0,R.jsx)(Jc,{className:`h-4 w-4`})})]},t))})]})]})}function T9(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zde(e){if(Array.isArray(e))return e}function Qde(e,t,n){return(t=afe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $de(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function efe(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
78
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function D9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?E9(Object(n),!0).forEach(function(t){Qde(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tfe(e,t){if(e==null)return{};var n,r,i=nfe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nfe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function rfe(e,t){return Zde(e)||$de(e,t)||ofe(e,t)||efe()}function ife(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function afe(e){var t=ife(e,`string`);return typeof t==`symbol`?t:t+``}function ofe(e,t){if(e){if(typeof e==`string`)return T9(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T9(e,t):void 0}}function sfe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?O9(Object(n),!0).forEach(function(t){sfe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cfe(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}}function A9(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function j9(e){return{}.toString.call(e).includes(`Object`)}function lfe(e){return!Object.keys(e).length}function M9(e){return typeof e==`function`}function ufe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function dfe(e,t){return j9(t)||N9(`changeType`),Object.keys(t).some(function(t){return!ufe(e,t)})&&N9(`changeField`),t}function ffe(e){M9(e)||N9(`selectorType`)}function pfe(e){M9(e)||j9(e)||N9(`handlerType`),j9(e)&&Object.values(e).some(function(e){return!M9(e)})&&N9(`handlersType`)}function mfe(e){e||N9(`initialIsRequired`),j9(e)||N9(`initialType`),lfe(e)&&N9(`initialContent`)}function hfe(e,t){throw Error(e[t]||e.default)}var N9=A9(hfe)({initialIsRequired:`initial state is required`,initialType:`initial state should be an object`,initialContent:`initial state shouldn't be an empty object`,handlerType:`handler should be an object or a function`,handlersType:`all handlers should be a functions`,selectorType:`selector should be a function`,changeType:`provided value of changes should be an object`,changeField:`it seams you want to change a field in the state which is not specified in the "initial" state`,default:"an unknown error accured in `state-local` package"}),P9={changes:dfe,selector:ffe,handler:pfe,initial:mfe};function gfe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};P9.initial(e),P9.handler(t);var n={current:e},r=A9(yfe)(n,t),i=A9(vfe)(n),a=A9(P9.changes)(e),o=A9(_fe)(n);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e};return P9.selector(e),e(n.current)}function c(e){cfe(r,i,a,o)(e)}return[s,c]}function _fe(e,t){return M9(t)?t(e.current):t}function vfe(e,t){return e.current=k9(k9({},e.current),t),t}function yfe(e,t,n){return M9(t)?t(e.current):Object.keys(n).forEach(function(n){return t[n]?.call(t,e.current[n])}),n}var bfe={create:gfe},xfe={paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}};function Sfe(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function Cfe(e){return{}.toString.call(e).includes(`Object`)}function wfe(e){return e||I9(`configIsRequired`),Cfe(e)||I9(`configType`),e.urls?(Tfe(),{paths:{vs:e.urls.monacoBase}}):e}function Tfe(){console.warn(F9.deprecation)}function Efe(e,t){throw Error(e[t]||e.default)}var F9={configIsRequired:`the configuration object is required`,configType:`the configuration object should be an object`,default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
79
- You are using deprecated way of configuration.
80
-
81
- Instead of using
82
- monaco.config({ urls: { monacoBase: '...' } })
83
- use
84
- monaco.config({ paths: { vs: '...' } })
85
-
86
- For more please check the link https://github.com/suren-atoyan/monaco-loader#config
87
- `},I9=Sfe(Efe)(F9),Dfe={config:wfe},Ofe=function(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}};function L9(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],L9(e[n],t[n]))}),D9(D9({},e),t)}var kfe={type:`cancelation`,msg:`operation is manually canceled`};function R9(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(kfe):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var Afe=[`monaco`],z9=rfe(bfe.create({config:xfe,isInitialized:!1,resolve:null,reject:null,monaco:null}),2),B9=z9[0],V9=z9[1];function jfe(e){var t=Dfe.config(e),n=t.monaco,r=tfe(t,Afe);V9(function(e){return{config:L9(e.config,r),monaco:n}})}function Mfe(){var e=B9(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(V9({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),R9(U9);if(window.monaco&&window.monaco.editor)return H9(window.monaco),e.resolve(window.monaco),R9(U9);Ofe(Nfe,Ffe)(Ife)}return R9(U9)}function Nfe(e){return document.body.appendChild(e)}function Pfe(e){var t=document.createElement(`script`);return e&&(t.src=e),t}function Ffe(e){var t=B9(function(e){return{config:e.config,reject:e.reject}}),n=Pfe(`${t.config.paths.vs}/loader.js`);return n.onload=function(){return e()},n.onerror=t.reject,n}function Ife(){var e=B9(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t([`vs/editor/editor.main`],function(t){var n=t.m||t;H9(n),e.resolve(n)},function(t){e.reject(t)})}function H9(e){B9().monaco||V9({monaco:e})}function Lfe(){return B9(function(e){return e.monaco})}var U9=new Promise(function(e,t){return V9({resolve:e,reject:t})}),W9={config:jfe,init:Mfe,__getMonacoInstance:Lfe},G9={wrapper:{display:`flex`,position:`relative`,textAlign:`initial`},fullWidth:{width:`100%`},hide:{display:`none`}},Rfe={container:{display:`flex`,height:`100%`,width:`100%`,justifyContent:`center`,alignItems:`center`}};function zfe({children:e}){return L.createElement(`div`,{style:Rfe.container},e)}var Bfe=zfe;function Vfe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:a,wrapperProps:o}){return L.createElement(`section`,{style:{...G9.wrapper,width:e,height:t},...o},!n&&L.createElement(Bfe,null,r),L.createElement(`div`,{ref:i,style:{...G9.fullWidth,...!n&&G9.hide},className:a}))}var K9=(0,L.memo)(Vfe);function Hfe(e){(0,L.useEffect)(e,[])}var q9=Hfe;function Ufe(e,t,n=!0){let r=(0,L.useRef)(!0);(0,L.useEffect)(r.current||!n?()=>{r.current=!1}:e,t)}var J9=Ufe;function Y9(){}function X9(e,t,n,r){return Wfe(e,r)||Gfe(e,t,n,r)}function Wfe(e,t){return e.editor.getModel(Z9(e,t))}function Gfe(e,t,n,r){return e.editor.createModel(t,n,r?Z9(e,r):void 0)}function Z9(e,t){return e.Uri.parse(t)}function Kfe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:a,modifiedModelPath:o,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:l=`light`,loading:u=`Loading...`,options:d={},height:f=`100%`,width:p=`100%`,className:m,wrapperProps:h={},beforeMount:g=Y9,onMount:_=Y9}){let[v,y]=(0,L.useState)(!1),[b,x]=(0,L.useState)(!0),S=(0,L.useRef)(null),C=(0,L.useRef)(null),w=(0,L.useRef)(null),T=(0,L.useRef)(_),E=(0,L.useRef)(g),D=(0,L.useRef)(!1);q9(()=>{let e=W9.init();return e.then(e=>(C.current=e)&&x(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>S.current?A():e.cancel()}),J9(()=>{if(S.current&&C.current){let t=S.current.getOriginalEditor(),i=X9(C.current,e||``,r||n||`text`,a||``);i!==t.getModel()&&t.setModel(i)}},[a],v),J9(()=>{if(S.current&&C.current){let e=S.current.getModifiedEditor(),r=X9(C.current,t||``,i||n||`text`,o||``);r!==e.getModel()&&e.setModel(r)}},[o],v),J9(()=>{let e=S.current.getModifiedEditor();e.getOption(C.current.editor.EditorOption.readOnly)?e.setValue(t||``):t!==e.getValue()&&(e.executeEdits(``,[{range:e.getModel().getFullModelRange(),text:t||``,forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),J9(()=>{S.current?.getModel()?.original.setValue(e||``)},[e],v),J9(()=>{let{original:e,modified:t}=S.current.getModel();C.current.editor.setModelLanguage(e,r||n||`text`),C.current.editor.setModelLanguage(t,i||n||`text`)},[n,r,i],v),J9(()=>{C.current?.editor.setTheme(l)},[l],v),J9(()=>{S.current?.updateOptions(d)},[d],v);let O=(0,L.useCallback)(()=>{if(!C.current)return;E.current(C.current);let s=X9(C.current,e||``,r||n||`text`,a||``),c=X9(C.current,t||``,i||n||`text`,o||``);S.current?.setModel({original:s,modified:c})},[n,t,i,e,r,a,o]),k=(0,L.useCallback)(()=>{!D.current&&w.current&&(S.current=C.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...d}),O(),C.current?.editor.setTheme(l),y(!0),D.current=!0)},[d,l,O]);(0,L.useEffect)(()=>{v&&T.current(S.current,C.current)},[v]),(0,L.useEffect)(()=>{!b&&!v&&k()},[b,v,k]);function A(){let e=S.current?.getModel();s||e?.original?.dispose(),c||e?.modified?.dispose(),S.current?.dispose()}return L.createElement(K9,{width:p,height:f,isEditorReady:v,loading:u,_ref:w,className:m,wrapperProps:h})}(0,L.memo)(Kfe);function qfe(e){let t=(0,L.useRef)();return(0,L.useEffect)(()=>{t.current=e},[e]),t.current}var Jfe=qfe,Q9=new Map;function Yfe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:a,theme:o=`light`,line:s,loading:c=`Loading...`,options:l={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:p=`100%`,height:m=`100%`,className:h,wrapperProps:g={},beforeMount:_=Y9,onMount:v=Y9,onChange:y,onValidate:b=Y9}){let[x,S]=(0,L.useState)(!1),[C,w]=(0,L.useState)(!0),T=(0,L.useRef)(null),E=(0,L.useRef)(null),D=(0,L.useRef)(null),O=(0,L.useRef)(v),k=(0,L.useRef)(_),A=(0,L.useRef)(),j=(0,L.useRef)(r),M=Jfe(a),N=(0,L.useRef)(!1),ee=(0,L.useRef)(!1);q9(()=>{let e=W9.init();return e.then(e=>(T.current=e)&&w(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>E.current?P():e.cancel()}),J9(()=>{let o=X9(T.current,e||r||``,t||i||``,a||n||``);o!==E.current?.getModel()&&(d&&Q9.set(M,E.current?.saveViewState()),E.current?.setModel(o),d&&E.current?.restoreViewState(Q9.get(a)))},[a],x),J9(()=>{E.current?.updateOptions(l)},[l],x),J9(()=>{!E.current||r===void 0||(E.current.getOption(T.current.editor.EditorOption.readOnly)?E.current.setValue(r):r!==E.current.getValue()&&(ee.current=!0,E.current.executeEdits(``,[{range:E.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),E.current.pushUndoStop(),ee.current=!1))},[r],x),J9(()=>{let e=E.current?.getModel();e&&i&&T.current?.editor.setModelLanguage(e,i)},[i],x),J9(()=>{s!==void 0&&E.current?.revealLine(s)},[s],x),J9(()=>{T.current?.editor.setTheme(o)},[o],x);let te=(0,L.useCallback)(()=>{if(!(!D.current||!T.current)&&!N.current){k.current(T.current);let c=a||n,f=X9(T.current,r||e||``,t||i||``,c||``);E.current=T.current?.editor.create(D.current,{model:f,automaticLayout:!0,...l},u),d&&E.current.restoreViewState(Q9.get(c)),T.current.editor.setTheme(o),s!==void 0&&E.current.revealLine(s),S(!0),N.current=!0}},[e,t,n,r,i,a,l,u,d,o,s]);(0,L.useEffect)(()=>{x&&O.current(E.current,T.current)},[x]),(0,L.useEffect)(()=>{!C&&!x&&te()},[C,x,te]),j.current=r,(0,L.useEffect)(()=>{x&&y&&(A.current?.dispose(),A.current=E.current?.onDidChangeModelContent(e=>{ee.current||y(E.current.getValue(),e)}))},[x,y]),(0,L.useEffect)(()=>{if(x){let e=T.current.editor.onDidChangeMarkers(e=>{let t=E.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=T.current.editor.getModelMarkers({resource:t});b?.(e)}});return()=>{e?.dispose()}}return()=>{}},[x,b]);function P(){A.current?.dispose(),f?d&&Q9.set(a,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()}return L.createElement(K9,{width:p,height:m,isEditorReady:x,loading:c,_ref:D,className:h,wrapperProps:g})}var Xfe=(0,L.memo)(Yfe);function Zfe(){let[e,t]=(0,L.useState)(`library`),[n,r]=(0,L.useState)(`all`),[i,a]=(0,L.useState)(``),[o,s]=(0,L.useState)(new Set),[c,l]=(0,L.useState)(null),[u,d]=(0,L.useState)(``),[f,p]=(0,L.useState)(!1),[m,h]=(0,L.useState)(null),g=Ye(),{data:_,isLoading:v}=ut({queryKey:[`global-conventions`],queryFn:()=>Lu().then(e=>e.data),refetchInterval:6e4}),{data:y}=ut({queryKey:[`convention-usage-stats`],queryFn:()=>Hu().then(e=>e.data),enabled:e===`usage`}),b=z({mutationFn:()=>zu().then(e=>e.data),onSuccess:e=>{H(e.added.length+e.updated.length>0?`同步完成:新增 ${e.added.length},更新 ${e.updated.length}`:`已是最新`,`success`),g.invalidateQueries({queryKey:[`global-conventions`]})}}),x=z({mutationFn:e=>Bu(e).then(e=>e.data),onSuccess:e=>{H(`已安装:${e.convention.name}`,`success`),d(``),p(!1),g.invalidateQueries({queryKey:[`global-conventions`]})}}),S=z({mutationFn:e=>Vu(e).then(e=>e.data),onSuccess:(e,t)=>{H(`规范已删除`,`success`),h(null),g.invalidateQueries({queryKey:[`global-conventions`]})}}),C=z({mutationFn:e=>Wu(e.length>0?e:void 0).then(e=>e.data),onSuccess:e=>{H(`进化完成:${e.results.success.length} 个规范已更新`,`success`),g.invalidateQueries({queryKey:[`global-conventions`]})}}),w=(_?.items||[]).filter(e=>!(n!==`all`&&e.source!==n||i&&!e.name.toLowerCase().includes(i.toLowerCase()))),T=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},E=w.length>0&&o.size===w.length,D=()=>s(E?new Set:new Set(w.map(e=>e.id))),O={official:`bg-amber-50 text-amber-700`,user:`bg-blue-50 text-blue-700`,community:`bg-purple-50 text-purple-700`},k={official:`官方`,user:`用户`,community:`社区`};return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`规范管理`}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:`管理全局规范模板,绑定到项目,追踪使用情况`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`button`,{onClick:()=>b.mutate(),disabled:b.isPending,className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-amber-50 text-amber-700 hover:bg-amber-100 rounded-lg transition-colors`,children:[(0,R.jsx)(Pc,{className:`h-4 w-4 ${b.isPending?`animate-spin`:``}`}),`同步官方规范`]}),(0,R.jsxs)(`button`,{onClick:()=>p(!f),className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-blue-600 text-white hover:bg-blue-700 rounded-lg transition-colors`,children:[(0,R.jsx)(nc,{className:`h-4 w-4`}),`从 URL 安装`]})]})]}),f&&(0,R.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:(0,R.jsxs)(`div`,{className:`flex gap-3`,children:[(0,R.jsx)(`input`,{type:`text`,placeholder:`规范 YAML 文件 URL...`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>e.key===`Enter`&&u.trim()&&x.mutate(u.trim()),className:`flex-1 px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`}),(0,R.jsx)(`button`,{onClick:()=>x.mutate(u.trim()),disabled:!u.trim()||x.isPending,className:`px-4 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:x.isPending?`安装中...`:`安装`}),(0,R.jsx)(`button`,{onClick:()=>p(!1),className:`p-2 text-gray-400 hover:text-gray-600 rounded-lg`,children:(0,R.jsx)(el,{className:`h-4 w-4`})})]})}),(0,R.jsx)(`div`,{className:`border-b border-gray-200`,children:(0,R.jsx)(`nav`,{className:`flex gap-1`,children:[{key:`library`,label:`规范库`},{key:`usage`,label:`使用统计`},{key:`evolution`,label:`进化历史`}].map(n=>(0,R.jsx)(`button`,{onClick:()=>t(n.key),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors ${e===n.key?`border-blue-600 text-blue-600`:`border-transparent text-gray-500 hover:text-gray-700`}`,children:n.label},n.key))})}),e===`library`&&(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 flex items-center gap-3 flex-wrap`,children:[(0,R.jsx)(`div`,{className:`flex gap-1`,children:[`all`,`official`,`user`,`community`].map(e=>(0,R.jsx)(`button`,{onClick:()=>r(e),className:`px-3 py-1.5 text-xs rounded-lg transition-colors ${n===e?`bg-blue-600 text-white`:`bg-gray-100 text-gray-600 hover:bg-gray-200`}`,children:{all:`全部`,official:`官方`,user:`用户`,community:`社区`}[e]},e))}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(Lc,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400`}),(0,R.jsx)(`input`,{type:`text`,placeholder:`搜索规范名称...`,value:i,onChange:e=>a(e.target.value),className:`pl-8 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 w-48`})]}),(0,R.jsxs)(`span`,{className:`text-sm text-gray-500`,children:[w.length,` 个规范`]}),o.size>0&&(0,R.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,R.jsxs)(`span`,{className:`text-sm text-gray-600`,children:[`已选 `,o.size,` 个`]}),(0,R.jsxs)(`button`,{onClick:()=>C.mutate(Array.from(o)),disabled:C.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-green-50 text-green-600 hover:bg-green-100 rounded-lg transition-colors`,children:[(0,R.jsx)(Pc,{className:`h-3.5 w-3.5 ${C.isPending?`animate-spin`:``}`}),`批量进化`]})]})]}),v?(0,R.jsx)(`div`,{className:`flex items-center justify-center h-48 bg-white rounded-xl border border-gray-200`,children:(0,R.jsx)(Pc,{className:`h-8 w-8 animate-spin text-blue-500`})}):(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:[(0,R.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,R.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`th`,{className:`w-10 px-4 py-3`,children:(0,R.jsx)(`input`,{type:`checkbox`,checked:E,onChange:D,className:`rounded`})}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`规范名称`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`版本`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`角色数`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`质量标准`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,R.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:w.map(e=>(0,R.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,R.jsx)(`td`,{className:`px-4 py-3`,children:(0,R.jsx)(`input`,{type:`checkbox`,checked:o.has(e.id),onChange:()=>T(e.id),className:`rounded`})}),(0,R.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,R.jsx)(`button`,{onClick:()=>l(e.id),className:`font-medium text-blue-600 hover:text-blue-700 text-left`,children:e.name}),(0,R.jsx)(`div`,{className:`text-xs text-gray-500 truncate max-w-xs mt-0.5`,children:e.description})]}),(0,R.jsx)(`td`,{className:`px-4 py-3`,children:(0,R.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full font-medium ${O[e.source]||`bg-gray-100 text-gray-600`}`,children:k[e.source]||e.source})}),(0,R.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.version||`—`}),(0,R.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.roles?Object.keys(e.roles).length:0}),(0,R.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.quality_standards?.length||0}),(0,R.jsx)(`td`,{className:`px-4 py-3`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`button`,{onClick:()=>l(e.id),className:`p-1.5 text-gray-400 hover:text-blue-500 rounded transition-colors`,title:`查看/编辑`,children:(0,R.jsx)(cc,{className:`h-4 w-4`})}),e.source!==`official`&&(0,R.jsx)(`button`,{onClick:()=>h(e),className:`p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors`,title:`删除`,children:(0,R.jsx)(Jc,{className:`h-4 w-4`})})]})})]},e.id))})]}),w.length===0&&(0,R.jsxs)(`div`,{className:`text-center py-12`,children:[(0,R.jsx)(Ms,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,R.jsx)(`p`,{className:`text-gray-500`,children:`暂无规范`}),(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`点击「同步官方规范」获取内置规范`})]})]})]}),e===`usage`&&(0,R.jsx)(Qfe,{data:y?.items||[]}),e===`evolution`&&(0,R.jsx)($fe,{conventions:_?.items||[]}),c&&(0,R.jsx)(epe,{id:c,onClose:()=>l(null)}),m&&(0,R.jsx)(w4,{open:!!m,title:`删除规范`,description:`确定要删除规范「${m.name}」吗?此操作不可撤销。`,variant:`danger`,onConfirm:()=>S.mutate(m.id),onCancel:()=>h(null)})]})}function Qfe({data:e}){let[t,n]=(0,L.useState)(null);return(0,R.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 overflow-hidden`,children:e.length===0?(0,R.jsxs)(`div`,{className:`text-center py-12`,children:[(0,R.jsx)(Yc,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,R.jsx)(`p`,{className:`text-gray-500`,children:`暂无使用数据`})]}):(0,R.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,R.jsx)(`thead`,{className:`bg-gray-50 border-b border-gray-200`,children:(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`规范名称`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`来源`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`使用项目数`}),(0,R.jsx)(`th`,{className:`px-4 py-3 text-left font-medium text-gray-600`,children:`操作`})]})}),(0,R.jsx)(`tbody`,{className:`divide-y divide-gray-100`,children:e.map(e=>(0,R.jsxs)(L.Fragment,{children:[(0,R.jsxs)(`tr`,{className:`hover:bg-gray-50 transition-colors`,children:[(0,R.jsx)(`td`,{className:`px-4 py-3 font-medium text-gray-900`,children:e.name}),(0,R.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.source}),(0,R.jsx)(`td`,{className:`px-4 py-3 text-gray-600`,children:e.projectCount}),(0,R.jsx)(`td`,{className:`px-4 py-3`,children:(0,R.jsx)(`button`,{onClick:()=>n(t===e.id?null:e.id),className:`text-xs text-blue-600 hover:text-blue-700`,children:t===e.id?`收起`:`查看项目`})})]}),t===e.id&&(0,R.jsx)(`tr`,{children:(0,R.jsx)(`td`,{colSpan:4,className:`px-4 py-3 bg-gray-50`,children:(0,R.jsx)(`div`,{className:`text-xs text-gray-600 space-y-1`,children:e.projects.map((e,t)=>(0,R.jsx)(`div`,{className:`font-mono`,children:e},t))})})})]},e.id))})]})})}function $fe({conventions:e}){let[t,n]=(0,L.useState)(null),{data:r,isLoading:i}=ut({queryKey:[`convention-evolution`,t],queryFn:()=>t?Uu(t).then(e=>e.data):null,enabled:!!t});return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,R.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 mb-2`,children:`选择规范`}),(0,R.jsxs)(`select`,{value:t||``,onChange:e=>n(e.target.value||null),className:`w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[(0,R.jsx)(`option`,{value:``,children:`— 请选择 —`}),e.map(e=>(0,R.jsxs)(`option`,{value:e.id,children:[e.name,` (v`,e.version,`)`]},e.id))]})]}),t&&(0,R.jsx)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-6`,children:i?(0,R.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,R.jsx)(Pc,{className:`h-8 w-8 animate-spin text-blue-500`})}):!r||r.history.length===0?(0,R.jsxs)(`div`,{className:`text-center py-12`,children:[(0,R.jsx)(Ys,{className:`h-10 w-10 text-gray-300 mx-auto mb-3`}),(0,R.jsx)(`p`,{className:`text-gray-500`,children:`暂无进化记录`})]}):(0,R.jsx)(`div`,{className:`space-y-4`,children:r.history.map((e,t)=>(0,R.jsxs)(`div`,{className:`border-l-2 border-blue-200 pl-4 pb-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,R.jsx)(Gs,{className:`h-4 w-4 text-green-500`}),(0,R.jsxs)(`span`,{className:`text-sm font-medium text-gray-900`,children:[e.previousVersion,` → `,e.newVersion]}),(0,R.jsx)(`span`,{className:`text-xs text-gray-500`,children:new Date(e.timestamp).toLocaleString(`zh-CN`)})]}),e.changes.length>0&&(0,R.jsx)(`ul`,{className:`text-sm text-gray-600 space-y-1 ml-6`,children:e.changes.map((e,t)=>(0,R.jsx)(`li`,{className:`list-disc`,children:e},t))})]},t))})})]})}function epe({id:e,onClose:t}){let[n,r]=(0,L.useState)(``),[i,a]=(0,L.useState)(!1),o=Ye(),{data:s,isLoading:c}=ut({queryKey:[`global-convention`,e],queryFn:()=>Ru(e).then(e=>e.data)}),{data:l}=ut({queryKey:[`convention-yaml`,e],queryFn:()=>Gu(e).then(e=>e.data),enabled:i});(0,L.useEffect)(()=>{l?.yaml!==void 0&&r(l.yaml)},[l]);let u=z({mutationFn:t=>Ku(e,t).then(e=>e.data),onSuccess:()=>{H(`保存成功`,`success`),a(!1),o.invalidateQueries({queryKey:[`global-convention`,e]}),o.invalidateQueries({queryKey:[`global-conventions`]})},onError:()=>{H(`保存失败`,`error`)}}),d=z({mutationFn:()=>Wu([e]).then(e=>e.data),onSuccess:t=>{t.results.success.length>0?(H(`规范已进化更新`,`success`),o.invalidateQueries({queryKey:[`global-convention`,e]}),o.invalidateQueries({queryKey:[`global-conventions`]})):H(`进化失败:`+(t.results.failed[0]?.error||`未知错误`),`error`)},onError:()=>{H(`进化失败`,`error`)}});if(c)return(0,R.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,children:(0,R.jsx)(`div`,{className:`bg-white rounded-xl p-8`,children:(0,R.jsx)(Pc,{className:`h-8 w-8 animate-spin text-blue-500 mx-auto`})})});if(!s)return null;let f=s.source===`official`;return(0,R.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`,onClick:t,children:(0,R.jsxs)(`div`,{className:`bg-white rounded-xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col`,onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between p-6 border-b border-gray-200`,children:[(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:s.name}),(0,R.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:s.description})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 ml-4`,children:[(0,R.jsxs)(`button`,{onClick:()=>d.mutate(),disabled:d.isPending,className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-green-50 text-green-600 hover:bg-green-100 rounded-lg transition-colors disabled:opacity-50`,title:`AI 进化优化`,children:[(0,R.jsx)(Pc,{className:`h-4 w-4 ${d.isPending?`animate-spin`:``}`}),d.isPending?`进化中...`:`手动进化`]}),(0,R.jsx)(`button`,{onClick:t,className:`p-2 text-gray-400 hover:text-gray-600 rounded-lg transition-colors`,children:(0,R.jsx)(el,{className:`h-5 w-5`})})]})]}),(0,R.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-6 space-y-4`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-3 gap-4 text-sm`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-500`,children:`版本`}),(0,R.jsx)(`div`,{className:`font-medium text-gray-900 mt-1`,children:s.version})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-500`,children:`来源`}),(0,R.jsx)(`div`,{className:`font-medium text-gray-900 mt-1`,children:s.source===`official`?`官方`:s.source===`user`?`用户`:`社区`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-500`,children:`角色数`}),(0,R.jsx)(`div`,{className:`font-medium text-gray-900 mt-1`,children:s.roles?Object.keys(s.roles).length:0})]})]}),i?(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsx)(`label`,{className:`text-sm font-medium text-gray-700`,children:`YAML 内容`}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsxs)(`button`,{onClick:()=>u.mutate(n),disabled:u.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 transition-colors`,children:[(0,R.jsx)(Ic,{className:`h-3.5 w-3.5`}),u.isPending?`保存中...`:`保存`]}),(0,R.jsx)(`button`,{onClick:()=>a(!1),className:`px-3 py-1.5 text-sm bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors`,children:`取消`})]})]}),(0,R.jsx)(`div`,{className:`border border-gray-200 rounded-lg overflow-hidden`,children:(0,R.jsx)(Xfe,{height:`500px`,language:`yaml`,value:n,onChange:e=>r(e||``),theme:`vs-light`,options:{minimap:{enabled:!1},fontSize:13,lineNumbers:`on`,scrollBeyondLastLine:!1,wordWrap:`on`,automaticLayout:!0}})})]}):(0,R.jsxs)(`div`,{className:`space-y-4`,children:[s.principles&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`核心原则`}),(0,R.jsx)(`pre`,{className:`text-sm text-gray-600 bg-gray-50 p-3 rounded-lg overflow-x-auto whitespace-pre-wrap`,children:s.principles})]}),s.roles&&Object.keys(s.roles).length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`角色定义`}),(0,R.jsx)(`div`,{className:`space-y-2`,children:Object.entries(s.roles).map(([e,t])=>(0,R.jsxs)(`div`,{className:`bg-gray-50 p-3 rounded-lg`,children:[(0,R.jsx)(`div`,{className:`font-medium text-gray-900 text-sm`,children:t.name||e}),t.responsibilities&&(0,R.jsxs)(`div`,{className:`text-xs text-gray-600 mt-1`,children:[`职责:`,t.responsibilities]}),t.constraints&&(0,R.jsxs)(`div`,{className:`text-xs text-gray-500 mt-1`,children:[`约束:`,t.constraints]})]},e))})]}),s.quality_standards&&s.quality_standards.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`质量标准`}),(0,R.jsx)(`div`,{className:`space-y-1.5`,children:s.quality_standards.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-start gap-2 text-sm`,children:[(0,R.jsx)(`span`,{className:`px-1.5 py-0.5 text-xs rounded font-medium ${e.severity===`must`?`bg-red-50 text-red-600`:e.severity===`should`?`bg-amber-50 text-amber-600`:`bg-blue-50 text-blue-600`}`,children:e.severity===`must`?`必须`:e.severity===`should`?`应该`:`可以`}),(0,R.jsxs)(`span`,{className:`text-gray-500`,children:[`[`,e.category,`]`]}),(0,R.jsx)(`span`,{className:`text-gray-700 flex-1`,children:e.rule})]},t))})]}),s.active_prompt&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 mb-2`,children:`Active Prompt`}),(0,R.jsx)(`pre`,{className:`text-xs text-gray-600 bg-gray-50 p-3 rounded-lg overflow-x-auto whitespace-pre-wrap`,children:s.active_prompt})]}),!f&&(0,R.jsxs)(`button`,{onClick:()=>a(!0),className:`flex items-center gap-1.5 px-3 py-2 text-sm bg-blue-50 text-blue-600 hover:bg-blue-100 rounded-lg transition-colors`,children:[(0,R.jsx)(cc,{className:`h-4 w-4`}),`编辑 YAML`]})]})]})]})})}var tpe=[`analyze`,`design`,`code`,`test`,`review`,`deploy`],npe=[`read_heavy`,`write_heavy`,`balanced`],rpe=[`document`,`code`,`test`,`config`];function ipe({artifacts:e,onChange:t}){let n=e||[],r=()=>t([...n,{type:`document`,description:``,required:!0,minCount:1}]),i=e=>t(n.filter((t,n)=>n!==e)),a=(e,r,i)=>{t(n.map((t,n)=>n===e?{...t,[r]:i}:t))};return(0,R.jsxs)(`div`,{className:`space-y-2`,children:[n.map((e,t)=>(0,R.jsxs)(`div`,{className:`border border-gray-200 rounded p-3 space-y-2 text-sm`,children:[(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`select`,{value:e.type,onChange:e=>a(t,`type`,e.target.value),className:`border rounded px-2 py-1 text-xs`,children:rpe.map(e=>(0,R.jsx)(`option`,{children:e},e))}),(0,R.jsx)(`input`,{value:e.description,onChange:e=>a(t,`description`,e.target.value),placeholder:`描述`,className:`flex-1 border rounded px-2 py-1 text-xs`}),(0,R.jsx)(`button`,{onClick:()=>i(t),className:`text-red-400 hover:text-red-600`,children:(0,R.jsx)(el,{className:`h-4 w-4`})})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,R.jsx)(`input`,{value:e.pathPattern||``,onChange:e=>a(t,`pathPattern`,e.target.value),placeholder:`路径模式 (如 docs/**/*.md)`,className:`flex-1 border rounded px-2 py-1 text-xs`}),(0,R.jsxs)(`label`,{className:`flex items-center gap-1 text-xs text-gray-600`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:e.required!==!1,onChange:e=>a(t,`required`,e.target.checked)}),`必须`]}),(0,R.jsx)(`input`,{type:`number`,value:e.minCount||1,min:1,onChange:e=>a(t,`minCount`,parseInt(e.target.value)),className:`w-16 border rounded px-2 py-1 text-xs`})]})]},t)),(0,R.jsxs)(`button`,{onClick:r,className:`flex items-center gap-1 text-xs text-blue-600 hover:text-blue-800`,children:[(0,R.jsx)(Mc,{className:`h-3 w-3`}),` 添加产物约束`]})]})}function $9({initial:e,onSave:t,onCancel:n}){let[r,i]=(0,L.useState)({id:e?.id||``,name:e?.name||``,description:e?.description||``,semanticCategory:e?.semanticCategory||`code`,defaultSkills:e?.defaultSkills||[],minToolCalls:e?.minToolCalls||20,stagnationStrategy:e?.stagnationStrategy||`balanced`,expectedArtifacts:e?.expectedArtifacts||[],instructionSuffix:e?.instructionSuffix||``}),a=(e,t)=>i(n=>({...n,[e]:t}));return(0,R.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`ID(唯一标识)`}),(0,R.jsx)(`input`,{value:r.id,onChange:e=>a(`id`,e.target.value),disabled:!!e?.id,className:`w-full border rounded px-2 py-1 text-xs disabled:bg-gray-50`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`名称`}),(0,R.jsx)(`input`,{value:r.name,onChange:e=>a(`name`,e.target.value),className:`w-full border rounded px-2 py-1 text-xs`})]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`描述`}),(0,R.jsx)(`input`,{value:r.description,onChange:e=>a(`description`,e.target.value),className:`w-full border rounded px-2 py-1 text-xs`})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`语义类别`}),(0,R.jsx)(`select`,{value:r.semanticCategory,onChange:e=>a(`semanticCategory`,e.target.value),className:`w-full border rounded px-2 py-1 text-xs`,children:tpe.map(e=>(0,R.jsx)(`option`,{children:e},e))})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`最小工具调用`}),(0,R.jsx)(`input`,{type:`number`,value:r.minToolCalls,min:1,onChange:e=>a(`minToolCalls`,parseInt(e.target.value)),className:`w-full border rounded px-2 py-1 text-xs`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`停滞策略`}),(0,R.jsx)(`select`,{value:r.stagnationStrategy,onChange:e=>a(`stagnationStrategy`,e.target.value),className:`w-full border rounded px-2 py-1 text-xs`,children:npe.map(e=>(0,R.jsx)(`option`,{children:e},e))})]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`预期产物`}),(0,R.jsx)(ipe,{artifacts:r.expectedArtifacts,onChange:e=>a(`expectedArtifacts`,e)})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`block text-xs text-gray-600 mb-1`,children:`执行提示(可选)`}),(0,R.jsx)(`textarea`,{value:r.instructionSuffix||``,onChange:e=>a(`instructionSuffix`,e.target.value),rows:2,className:`w-full border rounded px-2 py-1 text-xs`})]}),(0,R.jsxs)(`div`,{className:`flex gap-2 pt-2`,children:[(0,R.jsxs)(`button`,{onClick:()=>t(r),className:`flex items-center gap-1 px-3 py-1.5 bg-blue-600 text-white text-xs rounded hover:bg-blue-700`,children:[(0,R.jsx)(Ic,{className:`h-3 w-3`}),` 保存`]}),(0,R.jsxs)(`button`,{onClick:n,className:`flex items-center gap-1 px-3 py-1.5 border text-xs rounded hover:bg-gray-50`,children:[(0,R.jsx)(el,{className:`h-3 w-3`}),` 取消`]})]})]})}function ape(){let[e,t]=(0,L.useState)(null),[n,r]=(0,L.useState)(!1),[i,a]=(0,L.useState)(void 0),[o,s]=(0,L.useState)(`view`),c=Ye(),{data:l}=ut({queryKey:[`projects`],queryFn:()=>Bl().then(e=>e.data)});(0,L.useEffect)(()=>{l?.items?.[0]?.projectPath&&a(l.items[0].projectPath)},[l]);let{data:u,isLoading:d}=ut({queryKey:[`node-types`,i],queryFn:()=>qu(i),enabled:!!i}),{data:f,isLoading:p}=ut({queryKey:[`node-type`,e],queryFn:()=>Ju(e),enabled:!!e&&o===`view`}),m=()=>{c.invalidateQueries({queryKey:[`node-types`]}),c.invalidateQueries({queryKey:[`node-type`,e]})},h=z({mutationFn:e=>Yu(e),onSuccess:()=>{m(),s(`view`)}}),g=z({mutationFn:e=>Xu(e.id,e),onSuccess:()=>{m(),s(`view`)}}),_=z({mutationFn:e=>Zu(e),onSuccess:()=>{t(null),s(`view`),m()}}),v=u?.data.items||[],y=f?.data,b=e=>({analyze:`bg-blue-100 text-blue-700`,design:`bg-purple-100 text-purple-700`,code:`bg-green-100 text-green-700`,test:`bg-orange-100 text-orange-700`,review:`bg-red-100 text-red-700`,deploy:`bg-indigo-100 text-indigo-700`})[e]||`bg-gray-100 text-gray-700`;return(0,R.jsxs)(`div`,{className:`p-6 max-w-7xl mx-auto`,children:[(0,R.jsxs)(`div`,{className:`mb-6 flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900`,children:`流水线节点类型管理`}),(0,R.jsx)(`p`,{className:`text-sm text-gray-600 mt-1`,children:`浏览所有可用的节点类型,点击查看详细配置`})]}),(0,R.jsxs)(`button`,{onClick:()=>{t(null),s(`create`)},className:`flex items-center gap-1 px-3 py-2 bg-blue-600 text-white text-sm rounded hover:bg-blue-700`,children:[(0,R.jsx)(Mc,{className:`h-4 w-4`}),` 新建节点类型`]})]}),d?(0,R.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,R.jsx)(Sc,{className:`h-6 w-6 animate-spin text-gray-400`})}):(0,R.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,R.jsx)(`div`,{className:`space-y-3`,children:v.map(n=>(0,R.jsxs)(`div`,{onClick:()=>{t(n.id),s(`view`),r(!1)},className:`p-4 border rounded-lg cursor-pointer transition-all ${e===n.id?`border-blue-500 bg-blue-50 shadow-sm`:`border-gray-200 hover:border-gray-300 hover:shadow-sm`}`,children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Ps,{className:`h-5 w-5 text-gray-600`}),(0,R.jsx)(`h3`,{className:`font-semibold text-gray-900`,children:n.name})]}),(0,R.jsx)(`span`,{className:`px-2 py-0.5 text-xs rounded-full ${b(n.semanticCategory)}`,children:n.semanticCategory})]}),(0,R.jsx)(`p`,{className:`text-sm text-gray-600 mt-2`,children:n.description}),(0,R.jsxs)(`div`,{className:`flex items-center gap-4 mt-3 text-xs text-gray-500`,children:[n.isBuiltin&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(Gs,{className:`h-3 w-3`}),`内置`]}),!n.isBuiltin&&(0,R.jsx)(`span`,{className:`flex items-center gap-1 text-blue-600`,children:`自定义`}),n.defaultSkills.length>0&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(tl,{className:`h-3 w-3`}),n.defaultSkills.length,` 个默认技能`]}),(n.expectedArtifacts?.length||0)>0&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(cc,{className:`h-3 w-3`}),n.expectedArtifacts.length,` 个产物约束`]}),n.usageCount!==void 0&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1 text-purple-600 font-medium`,children:[`使用 `,n.usageCount,` 次`]})]})]},n.id))}),(0,R.jsx)(`div`,{className:`lg:sticky lg:top-6 lg:self-start`,children:o===`create`?(0,R.jsxs)(`div`,{className:`border border-gray-200 rounded-lg p-6`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-bold text-gray-900 mb-4`,children:`新建节点类型`}),(0,R.jsx)($9,{onSave:e=>h.mutate(e),onCancel:()=>s(`view`)})]}):o===`edit`&&y?(0,R.jsxs)(`div`,{className:`border border-gray-200 rounded-lg p-6`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-bold text-gray-900 mb-4`,children:`编辑节点类型`}),(0,R.jsx)($9,{initial:{...y,minToolCalls:y.activityThreshold.minToolCalls,stagnationStrategy:y.activityThreshold.stagnationStrategy},onSave:e=>g.mutate(e),onCancel:()=>s(`view`)})]}):e?p?(0,R.jsx)(`div`,{className:`border border-gray-200 rounded-lg p-8 flex items-center justify-center`,children:(0,R.jsx)(Sc,{className:`h-6 w-6 animate-spin text-gray-400`})}):y?(0,R.jsxs)(`div`,{className:`border border-gray-200 rounded-lg p-6 space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,R.jsx)(`h2`,{className:`text-xl font-bold text-gray-900`,children:y.name}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`px-2 py-1 text-xs rounded-full ${b(y.semanticCategory)}`,children:y.semanticCategory}),!y.isBuiltin&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{onClick:()=>s(`edit`),className:`p-1 text-gray-400 hover:text-blue-600`,children:(0,R.jsx)(Ac,{className:`h-4 w-4`})}),(0,R.jsx)(`button`,{onClick:()=>{confirm(`确认删除?`)&&_.mutate(y.id)},className:`p-1 text-gray-400 hover:text-red-600`,children:(0,R.jsx)(Jc,{className:`h-4 w-4`})})]})]})]}),(0,R.jsx)(`p`,{className:`text-sm text-gray-600`,children:y.description}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 text-xs text-gray-500`,children:[(0,R.jsx)(`code`,{className:`bg-gray-100 px-2 py-0.5 rounded`,children:y.id}),y.isBuiltin&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1 text-green-600`,children:[(0,R.jsx)(Gs,{className:`h-3 w-3`}),`内置节点`]})]})]}),y.expectedArtifacts&&y.expectedArtifacts.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2 flex items-center gap-1`,children:[(0,R.jsx)(cc,{className:`h-4 w-4`}),`预期产物`]}),(0,R.jsx)(`div`,{className:`space-y-2`,children:y.expectedArtifacts.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex items-start gap-2 text-xs bg-gray-50 rounded p-2`,children:[(0,R.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-xs font-medium ${e.type===`code`?`bg-green-100 text-green-700`:e.type===`test`?`bg-orange-100 text-orange-700`:`bg-blue-100 text-blue-700`}`,children:e.type}),(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsx)(`div`,{className:`text-gray-700`,children:e.description}),e.pathPattern&&(0,R.jsx)(`code`,{className:`text-gray-500`,children:e.pathPattern})]}),e.required&&(0,R.jsx)(`span`,{className:`text-red-500 text-xs`,children:`必须`})]},t))})]}),y.defaultSkills.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2 flex items-center gap-1`,children:[(0,R.jsx)(tl,{className:`h-4 w-4`}),`默认技能`]}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:y.defaultSkills.map(e=>(0,R.jsx)(`span`,{className:`px-2 py-1 bg-blue-50 text-blue-700 text-xs rounded`,children:e},e))})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2 flex items-center gap-1`,children:[(0,R.jsx)(Gs,{className:`h-4 w-4`}),`完成条件`]}),(0,R.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[y.completion.explicitSignal&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-600`,children:`显式信号:`}),(0,R.jsx)(`code`,{className:`ml-2 bg-gray-100 px-2 py-0.5 rounded text-xs`,children:y.completion.explicitSignal})]}),y.completion.keywords.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-600`,children:`关键词:`}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:y.completion.keywords.map((e,t)=>(0,R.jsx)(`code`,{className:`bg-gray-100 px-2 py-0.5 rounded text-xs`,children:e},t))})]})]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2`,children:`活跃度阈值`}),(0,R.jsxs)(`div`,{className:`space-y-1 text-sm`,children:[y.activityThreshold.minToolCalls!==void 0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-600`,children:`最小工具调用:`}),(0,R.jsx)(`span`,{className:`ml-2`,children:y.activityThreshold.minToolCalls})]}),y.activityThreshold.stagnationStrategy&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-gray-600`,children:`停滞策略:`}),(0,R.jsx)(`code`,{className:`ml-2 bg-gray-100 px-2 py-0.5 rounded text-xs`,children:y.activityThreshold.stagnationStrategy})]})]})]}),y.instructionSuffix&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700 mb-2`,children:`执行提示`}),(0,R.jsx)(`p`,{className:`text-xs text-gray-600 bg-gray-50 rounded p-2`,children:y.instructionSuffix})]}),y.heuristic&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`button`,{onClick:()=>r(!n),className:`flex items-center gap-2 text-sm font-semibold text-gray-700 hover:text-gray-900`,children:[n?(0,R.jsx)(Us,{className:`h-4 w-4`}):(0,R.jsx)(Bs,{className:`h-4 w-4`}),`原始配置(JSON)`]}),n&&(0,R.jsx)(`pre`,{className:`mt-2 p-3 bg-gray-50 rounded text-xs overflow-auto max-h-64`,children:JSON.stringify(y.heuristic,null,2)})]})]}):null:(0,R.jsxs)(`div`,{className:`border border-gray-200 rounded-lg p-8 text-center text-gray-500`,children:[(0,R.jsx)(Ps,{className:`h-12 w-12 mx-auto mb-3 text-gray-300`}),(0,R.jsx)(`p`,{children:`选择左侧节点类型查看详细信息`})]})})]})]})}function ope(){return(0,R.jsx)(pS,{children:(0,R.jsxs)(ol,{children:[(0,R.jsx)(uS,{}),(0,R.jsx)(kf,{children:(0,R.jsxs)(ur,{children:[(0,R.jsx)(cr,{path:`/`,element:(0,R.jsx)(sr,{to:`/dashboard`,replace:!0})}),(0,R.jsx)(cr,{path:`/dashboard`,element:(0,R.jsx)(E4,{})}),(0,R.jsx)(cr,{path:`/sessions`,element:(0,R.jsx)(Y4,{})}),(0,R.jsx)(cr,{path:`/sessions/:id`,element:(0,R.jsx)(Z4,{})}),(0,R.jsx)(cr,{path:`/events`,element:(0,R.jsx)(t3,{})}),(0,R.jsx)(cr,{path:`/pipelines`,element:(0,R.jsx)(r3,{})}),(0,R.jsx)(cr,{path:`/pipelines/:id`,element:(0,R.jsx)(v3,{})}),(0,R.jsx)(cr,{path:`/projects`,element:(0,R.jsx)(zde,{})}),(0,R.jsx)(cr,{path:`/projects/:encodedPath`,element:(0,R.jsx)(Wde,{})}),(0,R.jsx)(cr,{path:`/quality`,element:(0,R.jsx)(C3,{})}),(0,R.jsx)(cr,{path:`/analytics`,element:(0,R.jsx)(k3,{})}),(0,R.jsx)(cr,{path:`/knowledge`,element:(0,R.jsx)(Rde,{})}),(0,R.jsx)(cr,{path:`/skills`,element:(0,R.jsx)(Kde,{})}),(0,R.jsx)(cr,{path:`/conventions`,element:(0,R.jsx)(Zfe,{})}),(0,R.jsx)(cr,{path:`/node-types`,element:(0,R.jsx)(ape,{})}),(0,R.jsx)(cr,{path:`/config`,element:(0,R.jsx)(T3,{})})]})})]})})}var spe=new Ge({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}});nl.createRoot(document.getElementById(`root`)).render((0,R.jsx)(L.StrictMode,{children:(0,R.jsx)(Xe,{client:spe,children:(0,R.jsx)(Zr,{children:(0,R.jsx)(ope,{})})})}));